diff --git a/content/mirror/ubu.md b/content/mirror/ubu.md
index aa2e316..f67b620 100644
--- a/content/mirror/ubu.md
+++ b/content/mirror/ubu.md
@@ -1,7 +1,7 @@
+++
title = "Stage: Everything Is Temporary"
glassblowers = ["alessandroludovico.md", "cristobalsciutto.md", "custodiansonline.md", "dusanbarok.md", "felixstalder.md", "marcellmars.md", "nickthurston.md", "olgagoriunova.md", "sanjabojanic.md", "sasasavanovic.md", "sreckohorvat.md", "tomislavmedak.md"]
-has_reflections = ["accidental-neighbors.md", "archiveapocalypse.md", "cristobal.md", "decapitated.md", "endtimes.md", "homelandlessparasite.md", "material.md", "relational.md", "variations.md"]
+has_reflections = ["accidental-neighbors.md", "archiveapocalypse.md", "cristobal.md","closingwindowopendoor.md", "decapitated.md", "endtimes.md", "homelandlessparasite.md", "material.md", "relational.md", "variations.md"]
+++
diff --git a/content/reflection/accidental-neighbors.md b/content/reflection/accidental-neighbors.md
index a8a8bf9..09da459 100644
--- a/content/reflection/accidental-neighbors.md
+++ b/content/reflection/accidental-neighbors.md
@@ -1,9 +1,10 @@
+++
title = "Accidental neighbors"
glassblowers = ["marcellmars.md"]
+has_shards = ["accidental-neighbors.md"]
+++
-At the moment there is a  which should become this reflection.
+At the moment there is a  which should become this reflection.
There are many examples of concepts with the same spellings existing across different fields. Bringing them together can be rewarding after a successful composition. However, if this attempt fails, it can be quite embarrassing. It might work if done with an understanding of why, even if it seems wrong initially. If it can politicize or broaden our imagination, it could be powerful.
diff --git a/content/reflection/archiveapocalypse.md b/content/reflection/archiveapocalypse.md
index 1b17190..4d55c2c 100644
--- a/content/reflection/archiveapocalypse.md
+++ b/content/reflection/archiveapocalypse.md
@@ -1,7 +1,7 @@
+++
title = "The Apocalypse of the Archive"
-has_shards = ["processnotplace.md", ]
-glassblowers = ["sreckohorvat.md", "duree.md"]
+has_shards = ["processnotplace.md", "duree.md", "senseofimagination.md", "theimaginary.md"]
+glassblowers = ["sreckohorvat.md"]
+++
The origin of the archive is always already linked to destruction. Something is preserved in order to avoid destruction. And vice versa, something is destroyed in order to abolish knowledge and memory. The destruction of books is as old as the book.
diff --git a/content/reflection/closingwindowopendoor.md b/content/reflection/closingwindowopendoor.md
index 14ddaa5..d34bf0f 100644
--- a/content/reflection/closingwindowopendoor.md
+++ b/content/reflection/closingwindowopendoor.md
@@ -1,12 +1,15 @@
+++
-title = "Closing the window to open the door."
+title = "Closing the window to open the door"
+has_shards = ["enshittification.md", "duree.md"]
glassblowers = ["felixstalder.md"]
+++
-The reflexion has two parts. Closing the window is a critique of the neoliberal demands for transparency and openness. Rather, certain ways of being accessible, of being read must to refused. With possible reference to Eduard Glissant’s Right to Opactiy.
+The reflection has two parts. Closing the window is a critique of the neoliberal demands for transparency and openness. Rather, certain ways of being accessible, of being read must to refused. With possible reference to Eduard Glissant’s Right to Opactiy.
In order for closing the window, enforcing some boundaries not to become a reactionary stance, there is a need to think about what one wants to open up towards. Hence, the opening the door.
I want to think about an opening in two directions: towards /abundance, which implies things and objects beyond the commodity from, that become more valuable in a social sense through use and re-use. We all know, degrowth is coming. Question is: can it be avoided to become civil war. This makes thinking about abundance urgent.
-The second direction I want to open the door towards is the /duree, the long-term. On an infrastructural level, this means /permacomputing and question of autonomy. On a cultural level, it means providing a framework that allows for both readability in the long-term and for unknown future adaptations. Here there is a possible reference to Achille Mbembe’s Earthly Community, in which he writes: „The Earth can attain unlimited duration, but only if it is capable of fecundity and regeneration. In the absence of this capacity for periodic (re-)begetting, it amounts to no more than the darkened mask of a vast house of the dead.“ (p.9)
+The second direction I want to open the door towards is the , the long-term. On an infrastructural level, this means /permacomputing and question of autonomy. On a cultural level, it means providing a framework that allows for both readability in the long-term and for unknown future adaptations. Here there is a possible reference to Achille Mbembe’s Earthly Community, in which he writes:
+
+> The Earth can attain unlimited duration, but only if it is capable of fecundity and regeneration. In the absence of this capacity for periodic (re-)begetting, it amounts to no more than the darkened mask of a vast house of the dead.“ (p.9)
diff --git a/content/reflection/decapitated.md b/content/reflection/decapitated.md
index a153fa2..98233b2 100644
--- a/content/reflection/decapitated.md
+++ b/content/reflection/decapitated.md
@@ -1,5 +1,6 @@
+++
title = "Decapitated UBU: a Decapitated Reflection"
+has_shards = ["sense-countersense.md"]
glassblowers = ["sanjabojanic.md"]
+++
diff --git a/content/reflection/homelandlessparasite.md b/content/reflection/homelandlessparasite.md
index 0bf69c2..7b49f3e 100644
--- a/content/reflection/homelandlessparasite.md
+++ b/content/reflection/homelandlessparasite.md
@@ -1,5 +1,6 @@
+++
title = "A homelandless parasite"
+has_shards = ["autonomouslife.md", "custodianshipinrelationalpractices.md", "productionreproduction.md", "care.md"]
glassblowers = ["sasasavanovic.md"]
++++
diff --git a/content/reflection/material.md b/content/reflection/material.md
index 4ecf85e..1741762 100644
--- a/content/reflection/material.md
+++ b/content/reflection/material.md
@@ -1,7 +1,7 @@
+++
title = "A Material Basis for Digital Archives"
glassblowers = ["cristobalsciutto.md"]
-has_shards = []
+has_shards = ["difference.md", "crisis.md", "interpretivelabor.md", "latentimage.md", "protocols.md", "maintenance.md"]
+++
1. Why preserve the archive? (exuberance, potentialities, political imaginary, etc)
diff --git a/content/reflection/relational.md b/content/reflection/relational.md
index 300196a..c10683d 100644
--- a/content/reflection/relational.md
+++ b/content/reflection/relational.md
@@ -1,5 +1,6 @@
+++
title = "The role of relational practices in custodianship"
+glassblowers = ["alessandroludovico.md"]
has_shards = ["library.md", "neoliberallibrary.md", "protocols.md"]
+++
diff --git a/content/reflection/variations.md b/content/reflection/variations.md
index cb64fe5..5e5dbd1 100644
--- a/content/reflection/variations.md
+++ b/content/reflection/variations.md
@@ -1,5 +1,6 @@
+++
title = "Variations on preserving a digital archive of the avant-garde"
+has_shards = ["under-constraints.md"]
glassblowers = ["dusanbarok.md"]
+++
diff --git a/public/404.html b/public/404.html
deleted file mode 100644
index 066e36f..0000000
--- a/public/404.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-404 Page not found - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png
deleted file mode 100644
index 2d3182d..0000000
Binary files a/public/android-chrome-192x192.png and /dev/null differ
diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png
deleted file mode 100644
index 49ee1ee..0000000
Binary files a/public/android-chrome-512x512.png and /dev/null differ
diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png
deleted file mode 100644
index 1d6a770..0000000
Binary files a/public/apple-touch-icon.png and /dev/null differ
diff --git a/public/css/dyn.css b/public/css/dyn.css
deleted file mode 100644
index 435c466..0000000
--- a/public/css/dyn.css
+++ /dev/null
@@ -1,1157 +0,0 @@
-body {counter-reset: css-eafefdc71daa907b62cb51c5b7bfee58-h2 css-7d4d24131caf4a686cb17ddacf5168e4-h2 css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2 css-1477c3971f30e506f225a6232acfa7b0-h2 css-419fe82e974c07e5d632fde5495ed8a8-h2 css-bb1e7e318496500d4fe19dee4fbfc9f7-h2 css-7f440be48db1bbc1ce7a74d507bd2a1c-h2 css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2 css-0a084c93e57cd63692cf108dce469022-h2 css-f5d10c16210aef233d3f65fe2695c0c2-h2 css-860cd8131a9bb9a3b00230ec5ead7def-h2 css-2bf156e91ef1322b45d2d32208c83718-h2 css-76ae203204efe06ca3ec8b91aa80fd01-h2 css-0a084c93e57cd63692cf108dce469022-h2 css-3c22ea229b38f74c28169d3099aa6a33-h2 css-88d3820c2893fc9ab8dd376e03e846ef-h2 css-79e417090828f2d619dd1a1b0ac818b3-h2 css-1477c3971f30e506f225a6232acfa7b0-h2 css-419fe82e974c07e5d632fde5495ed8a8-h2 css-88d3820c2893fc9ab8dd376e03e846ef-h2 css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2;}
-
-.css-eafefdc71daa907b62cb51c5b7bfee58-h2 {
- counter-reset: css-eafefdc71daa907b62cb51c5b7bfee58-h3;
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h3 {
- counter-reset: css-eafefdc71daa907b62cb51c5b7bfee58-h4;
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h4 {
- counter-reset: css-eafefdc71daa907b62cb51c5b7bfee58-h5;
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h5 {
- counter-reset: css-eafefdc71daa907b62cb51c5b7bfee58-h6;
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-eafefdc71daa907b62cb51c5b7bfee58-h2 1;
- content: counter(css-eafefdc71daa907b62cb51c5b7bfee58-h2) ". ";
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-eafefdc71daa907b62cb51c5b7bfee58-h3 1;
- content: counter(css-eafefdc71daa907b62cb51c5b7bfee58-h2) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h3) ". ";
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-eafefdc71daa907b62cb51c5b7bfee58-h4 1;
- content: counter(css-eafefdc71daa907b62cb51c5b7bfee58-h2) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h3) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h4) ". ";
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-eafefdc71daa907b62cb51c5b7bfee58-h5 1;
- content: counter(css-eafefdc71daa907b62cb51c5b7bfee58-h2) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h3) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h4) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h5) ". ";
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-eafefdc71daa907b62cb51c5b7bfee58-h6 1;
- content: counter(css-eafefdc71daa907b62cb51c5b7bfee58-h2) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h3) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h4) "." counter(css-eafefdc71daa907b62cb51c5b7bfee58-h5) "."
- counter(css-eafefdc71daa907b62cb51c5b7bfee58-h6) ". ";
- }
-
- .css-eafefdc71daa907b62cb51c5b7bfee58-h2.nocount:before,
- .css-eafefdc71daa907b62cb51c5b7bfee58-h3.nocount:before,
- .css-eafefdc71daa907b62cb51c5b7bfee58-h4.nocount:before,
- .css-eafefdc71daa907b62cb51c5b7bfee58-h5.nocount:before,
- .css-eafefdc71daa907b62cb51c5b7bfee58-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-7d4d24131caf4a686cb17ddacf5168e4-h2 {
- counter-reset: css-7d4d24131caf4a686cb17ddacf5168e4-h3;
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h3 {
- counter-reset: css-7d4d24131caf4a686cb17ddacf5168e4-h4;
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h4 {
- counter-reset: css-7d4d24131caf4a686cb17ddacf5168e4-h5;
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h5 {
- counter-reset: css-7d4d24131caf4a686cb17ddacf5168e4-h6;
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7d4d24131caf4a686cb17ddacf5168e4-h2 1;
- content: counter(css-7d4d24131caf4a686cb17ddacf5168e4-h2) ". ";
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7d4d24131caf4a686cb17ddacf5168e4-h3 1;
- content: counter(css-7d4d24131caf4a686cb17ddacf5168e4-h2) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h3) ". ";
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7d4d24131caf4a686cb17ddacf5168e4-h4 1;
- content: counter(css-7d4d24131caf4a686cb17ddacf5168e4-h2) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h3) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h4) ". ";
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7d4d24131caf4a686cb17ddacf5168e4-h5 1;
- content: counter(css-7d4d24131caf4a686cb17ddacf5168e4-h2) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h3) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h4) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h5) ". ";
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7d4d24131caf4a686cb17ddacf5168e4-h6 1;
- content: counter(css-7d4d24131caf4a686cb17ddacf5168e4-h2) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h3) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h4) "." counter(css-7d4d24131caf4a686cb17ddacf5168e4-h5) "."
- counter(css-7d4d24131caf4a686cb17ddacf5168e4-h6) ". ";
- }
-
- .css-7d4d24131caf4a686cb17ddacf5168e4-h2.nocount:before,
- .css-7d4d24131caf4a686cb17ddacf5168e4-h3.nocount:before,
- .css-7d4d24131caf4a686cb17ddacf5168e4-h4.nocount:before,
- .css-7d4d24131caf4a686cb17ddacf5168e4-h5.nocount:before,
- .css-7d4d24131caf4a686cb17ddacf5168e4-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2 {
- counter-reset: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3;
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3 {
- counter-reset: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4;
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4 {
- counter-reset: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5;
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5 {
- counter-reset: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h6;
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2 1;
- content: counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2) ". ";
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3 1;
- content: counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3) ". ";
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4 1;
- content: counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4) ". ";
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5 1;
- content: counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5) ". ";
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h6 1;
- content: counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4) "." counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5) "."
- counter(css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h6) ". ";
- }
-
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h2.nocount:before,
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h3.nocount:before,
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h4.nocount:before,
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h5.nocount:before,
- .css-0ad5206fbb3d3c5c2d9cc5dbd42d7011-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-1477c3971f30e506f225a6232acfa7b0-h2 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h3;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h3 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h4;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h4 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h5;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h5 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h6;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h2 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h3 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h4 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h5 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h5) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h6 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h5) "."
- counter(css-1477c3971f30e506f225a6232acfa7b0-h6) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h2.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h3.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h4.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h5.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-419fe82e974c07e5d632fde5495ed8a8-h2 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h3;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h3 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h4;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h4 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h5;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h5 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h6;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h2 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h3 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h4 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h5 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h5) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h6 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h5) "."
- counter(css-419fe82e974c07e5d632fde5495ed8a8-h6) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h2.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h3.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h4.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h5.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-bb1e7e318496500d4fe19dee4fbfc9f7-h2 {
- counter-reset: css-bb1e7e318496500d4fe19dee4fbfc9f7-h3;
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h3 {
- counter-reset: css-bb1e7e318496500d4fe19dee4fbfc9f7-h4;
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h4 {
- counter-reset: css-bb1e7e318496500d4fe19dee4fbfc9f7-h5;
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h5 {
- counter-reset: css-bb1e7e318496500d4fe19dee4fbfc9f7-h6;
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-bb1e7e318496500d4fe19dee4fbfc9f7-h2 1;
- content: counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h2) ". ";
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-bb1e7e318496500d4fe19dee4fbfc9f7-h3 1;
- content: counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h2) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h3) ". ";
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-bb1e7e318496500d4fe19dee4fbfc9f7-h4 1;
- content: counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h2) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h3) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h4) ". ";
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-bb1e7e318496500d4fe19dee4fbfc9f7-h5 1;
- content: counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h2) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h3) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h4) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h5) ". ";
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-bb1e7e318496500d4fe19dee4fbfc9f7-h6 1;
- content: counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h2) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h3) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h4) "." counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h5) "."
- counter(css-bb1e7e318496500d4fe19dee4fbfc9f7-h6) ". ";
- }
-
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h2.nocount:before,
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h3.nocount:before,
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h4.nocount:before,
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h5.nocount:before,
- .css-bb1e7e318496500d4fe19dee4fbfc9f7-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-7f440be48db1bbc1ce7a74d507bd2a1c-h2 {
- counter-reset: css-7f440be48db1bbc1ce7a74d507bd2a1c-h3;
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h3 {
- counter-reset: css-7f440be48db1bbc1ce7a74d507bd2a1c-h4;
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h4 {
- counter-reset: css-7f440be48db1bbc1ce7a74d507bd2a1c-h5;
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h5 {
- counter-reset: css-7f440be48db1bbc1ce7a74d507bd2a1c-h6;
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7f440be48db1bbc1ce7a74d507bd2a1c-h2 1;
- content: counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h2) ". ";
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7f440be48db1bbc1ce7a74d507bd2a1c-h3 1;
- content: counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h2) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h3) ". ";
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7f440be48db1bbc1ce7a74d507bd2a1c-h4 1;
- content: counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h2) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h3) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h4) ". ";
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7f440be48db1bbc1ce7a74d507bd2a1c-h5 1;
- content: counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h2) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h3) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h4) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h5) ". ";
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-7f440be48db1bbc1ce7a74d507bd2a1c-h6 1;
- content: counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h2) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h3) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h4) "." counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h5) "."
- counter(css-7f440be48db1bbc1ce7a74d507bd2a1c-h6) ". ";
- }
-
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h2.nocount:before,
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h3.nocount:before,
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h4.nocount:before,
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h5.nocount:before,
- .css-7f440be48db1bbc1ce7a74d507bd2a1c-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2 {
- counter-reset: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3;
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3 {
- counter-reset: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4;
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4 {
- counter-reset: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5;
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5 {
- counter-reset: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h6;
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2 1;
- content: counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2) ". ";
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3 1;
- content: counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3) ". ";
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4 1;
- content: counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4) ". ";
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5 1;
- content: counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5) ". ";
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h6 1;
- content: counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4) "." counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5) "."
- counter(css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h6) ". ";
- }
-
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h2.nocount:before,
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h3.nocount:before,
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h4.nocount:before,
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h5.nocount:before,
- .css-4e58da96ac7bdbb9ffc0b0a8c7bc9ff3-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-0a084c93e57cd63692cf108dce469022-h2 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h3;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h3 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h4;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h4 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h5;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h5 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h6;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h2 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h3 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h4 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h5 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) "." counter(css-0a084c93e57cd63692cf108dce469022-h5) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h6 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) "." counter(css-0a084c93e57cd63692cf108dce469022-h5) "."
- counter(css-0a084c93e57cd63692cf108dce469022-h6) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h2.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h3.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h4.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h5.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-f5d10c16210aef233d3f65fe2695c0c2-h2 {
- counter-reset: css-f5d10c16210aef233d3f65fe2695c0c2-h3;
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h3 {
- counter-reset: css-f5d10c16210aef233d3f65fe2695c0c2-h4;
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h4 {
- counter-reset: css-f5d10c16210aef233d3f65fe2695c0c2-h5;
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h5 {
- counter-reset: css-f5d10c16210aef233d3f65fe2695c0c2-h6;
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-f5d10c16210aef233d3f65fe2695c0c2-h2 1;
- content: counter(css-f5d10c16210aef233d3f65fe2695c0c2-h2) ". ";
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-f5d10c16210aef233d3f65fe2695c0c2-h3 1;
- content: counter(css-f5d10c16210aef233d3f65fe2695c0c2-h2) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h3) ". ";
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-f5d10c16210aef233d3f65fe2695c0c2-h4 1;
- content: counter(css-f5d10c16210aef233d3f65fe2695c0c2-h2) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h3) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h4) ". ";
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-f5d10c16210aef233d3f65fe2695c0c2-h5 1;
- content: counter(css-f5d10c16210aef233d3f65fe2695c0c2-h2) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h3) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h4) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h5) ". ";
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-f5d10c16210aef233d3f65fe2695c0c2-h6 1;
- content: counter(css-f5d10c16210aef233d3f65fe2695c0c2-h2) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h3) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h4) "." counter(css-f5d10c16210aef233d3f65fe2695c0c2-h5) "."
- counter(css-f5d10c16210aef233d3f65fe2695c0c2-h6) ". ";
- }
-
- .css-f5d10c16210aef233d3f65fe2695c0c2-h2.nocount:before,
- .css-f5d10c16210aef233d3f65fe2695c0c2-h3.nocount:before,
- .css-f5d10c16210aef233d3f65fe2695c0c2-h4.nocount:before,
- .css-f5d10c16210aef233d3f65fe2695c0c2-h5.nocount:before,
- .css-f5d10c16210aef233d3f65fe2695c0c2-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-860cd8131a9bb9a3b00230ec5ead7def-h2 {
- counter-reset: css-860cd8131a9bb9a3b00230ec5ead7def-h3;
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h3 {
- counter-reset: css-860cd8131a9bb9a3b00230ec5ead7def-h4;
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h4 {
- counter-reset: css-860cd8131a9bb9a3b00230ec5ead7def-h5;
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h5 {
- counter-reset: css-860cd8131a9bb9a3b00230ec5ead7def-h6;
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-860cd8131a9bb9a3b00230ec5ead7def-h2 1;
- content: counter(css-860cd8131a9bb9a3b00230ec5ead7def-h2) ". ";
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-860cd8131a9bb9a3b00230ec5ead7def-h3 1;
- content: counter(css-860cd8131a9bb9a3b00230ec5ead7def-h2) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h3) ". ";
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-860cd8131a9bb9a3b00230ec5ead7def-h4 1;
- content: counter(css-860cd8131a9bb9a3b00230ec5ead7def-h2) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h3) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h4) ". ";
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-860cd8131a9bb9a3b00230ec5ead7def-h5 1;
- content: counter(css-860cd8131a9bb9a3b00230ec5ead7def-h2) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h3) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h4) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h5) ". ";
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-860cd8131a9bb9a3b00230ec5ead7def-h6 1;
- content: counter(css-860cd8131a9bb9a3b00230ec5ead7def-h2) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h3) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h4) "." counter(css-860cd8131a9bb9a3b00230ec5ead7def-h5) "."
- counter(css-860cd8131a9bb9a3b00230ec5ead7def-h6) ". ";
- }
-
- .css-860cd8131a9bb9a3b00230ec5ead7def-h2.nocount:before,
- .css-860cd8131a9bb9a3b00230ec5ead7def-h3.nocount:before,
- .css-860cd8131a9bb9a3b00230ec5ead7def-h4.nocount:before,
- .css-860cd8131a9bb9a3b00230ec5ead7def-h5.nocount:before,
- .css-860cd8131a9bb9a3b00230ec5ead7def-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-2bf156e91ef1322b45d2d32208c83718-h2 {
- counter-reset: css-2bf156e91ef1322b45d2d32208c83718-h3;
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h3 {
- counter-reset: css-2bf156e91ef1322b45d2d32208c83718-h4;
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h4 {
- counter-reset: css-2bf156e91ef1322b45d2d32208c83718-h5;
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h5 {
- counter-reset: css-2bf156e91ef1322b45d2d32208c83718-h6;
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-2bf156e91ef1322b45d2d32208c83718-h2 1;
- content: counter(css-2bf156e91ef1322b45d2d32208c83718-h2) ". ";
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-2bf156e91ef1322b45d2d32208c83718-h3 1;
- content: counter(css-2bf156e91ef1322b45d2d32208c83718-h2) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h3) ". ";
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-2bf156e91ef1322b45d2d32208c83718-h4 1;
- content: counter(css-2bf156e91ef1322b45d2d32208c83718-h2) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h3) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h4) ". ";
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-2bf156e91ef1322b45d2d32208c83718-h5 1;
- content: counter(css-2bf156e91ef1322b45d2d32208c83718-h2) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h3) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h4) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h5) ". ";
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-2bf156e91ef1322b45d2d32208c83718-h6 1;
- content: counter(css-2bf156e91ef1322b45d2d32208c83718-h2) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h3) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h4) "." counter(css-2bf156e91ef1322b45d2d32208c83718-h5) "."
- counter(css-2bf156e91ef1322b45d2d32208c83718-h6) ". ";
- }
-
- .css-2bf156e91ef1322b45d2d32208c83718-h2.nocount:before,
- .css-2bf156e91ef1322b45d2d32208c83718-h3.nocount:before,
- .css-2bf156e91ef1322b45d2d32208c83718-h4.nocount:before,
- .css-2bf156e91ef1322b45d2d32208c83718-h5.nocount:before,
- .css-2bf156e91ef1322b45d2d32208c83718-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-76ae203204efe06ca3ec8b91aa80fd01-h2 {
- counter-reset: css-76ae203204efe06ca3ec8b91aa80fd01-h3;
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h3 {
- counter-reset: css-76ae203204efe06ca3ec8b91aa80fd01-h4;
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h4 {
- counter-reset: css-76ae203204efe06ca3ec8b91aa80fd01-h5;
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h5 {
- counter-reset: css-76ae203204efe06ca3ec8b91aa80fd01-h6;
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-76ae203204efe06ca3ec8b91aa80fd01-h2 1;
- content: counter(css-76ae203204efe06ca3ec8b91aa80fd01-h2) ". ";
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-76ae203204efe06ca3ec8b91aa80fd01-h3 1;
- content: counter(css-76ae203204efe06ca3ec8b91aa80fd01-h2) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h3) ". ";
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-76ae203204efe06ca3ec8b91aa80fd01-h4 1;
- content: counter(css-76ae203204efe06ca3ec8b91aa80fd01-h2) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h3) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h4) ". ";
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-76ae203204efe06ca3ec8b91aa80fd01-h5 1;
- content: counter(css-76ae203204efe06ca3ec8b91aa80fd01-h2) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h3) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h4) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h5) ". ";
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-76ae203204efe06ca3ec8b91aa80fd01-h6 1;
- content: counter(css-76ae203204efe06ca3ec8b91aa80fd01-h2) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h3) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h4) "." counter(css-76ae203204efe06ca3ec8b91aa80fd01-h5) "."
- counter(css-76ae203204efe06ca3ec8b91aa80fd01-h6) ". ";
- }
-
- .css-76ae203204efe06ca3ec8b91aa80fd01-h2.nocount:before,
- .css-76ae203204efe06ca3ec8b91aa80fd01-h3.nocount:before,
- .css-76ae203204efe06ca3ec8b91aa80fd01-h4.nocount:before,
- .css-76ae203204efe06ca3ec8b91aa80fd01-h5.nocount:before,
- .css-76ae203204efe06ca3ec8b91aa80fd01-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-0a084c93e57cd63692cf108dce469022-h2 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h3;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h3 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h4;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h4 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h5;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h5 {
- counter-reset: css-0a084c93e57cd63692cf108dce469022-h6;
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h2 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h3 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h4 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h5 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) "." counter(css-0a084c93e57cd63692cf108dce469022-h5) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-0a084c93e57cd63692cf108dce469022-h6 1;
- content: counter(css-0a084c93e57cd63692cf108dce469022-h2) "." counter(css-0a084c93e57cd63692cf108dce469022-h3) "." counter(css-0a084c93e57cd63692cf108dce469022-h4) "." counter(css-0a084c93e57cd63692cf108dce469022-h5) "."
- counter(css-0a084c93e57cd63692cf108dce469022-h6) ". ";
- }
-
- .css-0a084c93e57cd63692cf108dce469022-h2.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h3.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h4.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h5.nocount:before,
- .css-0a084c93e57cd63692cf108dce469022-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-3c22ea229b38f74c28169d3099aa6a33-h2 {
- counter-reset: css-3c22ea229b38f74c28169d3099aa6a33-h3;
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h3 {
- counter-reset: css-3c22ea229b38f74c28169d3099aa6a33-h4;
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h4 {
- counter-reset: css-3c22ea229b38f74c28169d3099aa6a33-h5;
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h5 {
- counter-reset: css-3c22ea229b38f74c28169d3099aa6a33-h6;
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-3c22ea229b38f74c28169d3099aa6a33-h2 1;
- content: counter(css-3c22ea229b38f74c28169d3099aa6a33-h2) ". ";
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-3c22ea229b38f74c28169d3099aa6a33-h3 1;
- content: counter(css-3c22ea229b38f74c28169d3099aa6a33-h2) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h3) ". ";
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-3c22ea229b38f74c28169d3099aa6a33-h4 1;
- content: counter(css-3c22ea229b38f74c28169d3099aa6a33-h2) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h3) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h4) ". ";
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-3c22ea229b38f74c28169d3099aa6a33-h5 1;
- content: counter(css-3c22ea229b38f74c28169d3099aa6a33-h2) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h3) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h4) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h5) ". ";
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-3c22ea229b38f74c28169d3099aa6a33-h6 1;
- content: counter(css-3c22ea229b38f74c28169d3099aa6a33-h2) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h3) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h4) "." counter(css-3c22ea229b38f74c28169d3099aa6a33-h5) "."
- counter(css-3c22ea229b38f74c28169d3099aa6a33-h6) ". ";
- }
-
- .css-3c22ea229b38f74c28169d3099aa6a33-h2.nocount:before,
- .css-3c22ea229b38f74c28169d3099aa6a33-h3.nocount:before,
- .css-3c22ea229b38f74c28169d3099aa6a33-h4.nocount:before,
- .css-3c22ea229b38f74c28169d3099aa6a33-h5.nocount:before,
- .css-3c22ea229b38f74c28169d3099aa6a33-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-88d3820c2893fc9ab8dd376e03e846ef-h2 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h3;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h4;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h5;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h6;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h2 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h3 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h4 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h5 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h5) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h6 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h5) "."
- counter(css-88d3820c2893fc9ab8dd376e03e846ef-h6) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h2.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-79e417090828f2d619dd1a1b0ac818b3-h2 {
- counter-reset: css-79e417090828f2d619dd1a1b0ac818b3-h3;
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h3 {
- counter-reset: css-79e417090828f2d619dd1a1b0ac818b3-h4;
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h4 {
- counter-reset: css-79e417090828f2d619dd1a1b0ac818b3-h5;
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h5 {
- counter-reset: css-79e417090828f2d619dd1a1b0ac818b3-h6;
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-79e417090828f2d619dd1a1b0ac818b3-h2 1;
- content: counter(css-79e417090828f2d619dd1a1b0ac818b3-h2) ". ";
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-79e417090828f2d619dd1a1b0ac818b3-h3 1;
- content: counter(css-79e417090828f2d619dd1a1b0ac818b3-h2) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h3) ". ";
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-79e417090828f2d619dd1a1b0ac818b3-h4 1;
- content: counter(css-79e417090828f2d619dd1a1b0ac818b3-h2) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h3) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h4) ". ";
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-79e417090828f2d619dd1a1b0ac818b3-h5 1;
- content: counter(css-79e417090828f2d619dd1a1b0ac818b3-h2) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h3) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h4) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h5) ". ";
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-79e417090828f2d619dd1a1b0ac818b3-h6 1;
- content: counter(css-79e417090828f2d619dd1a1b0ac818b3-h2) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h3) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h4) "." counter(css-79e417090828f2d619dd1a1b0ac818b3-h5) "."
- counter(css-79e417090828f2d619dd1a1b0ac818b3-h6) ". ";
- }
-
- .css-79e417090828f2d619dd1a1b0ac818b3-h2.nocount:before,
- .css-79e417090828f2d619dd1a1b0ac818b3-h3.nocount:before,
- .css-79e417090828f2d619dd1a1b0ac818b3-h4.nocount:before,
- .css-79e417090828f2d619dd1a1b0ac818b3-h5.nocount:before,
- .css-79e417090828f2d619dd1a1b0ac818b3-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-1477c3971f30e506f225a6232acfa7b0-h2 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h3;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h3 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h4;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h4 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h5;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h5 {
- counter-reset: css-1477c3971f30e506f225a6232acfa7b0-h6;
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h2 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h3 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h4 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h5 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h5) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-1477c3971f30e506f225a6232acfa7b0-h6 1;
- content: counter(css-1477c3971f30e506f225a6232acfa7b0-h2) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h3) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h4) "." counter(css-1477c3971f30e506f225a6232acfa7b0-h5) "."
- counter(css-1477c3971f30e506f225a6232acfa7b0-h6) ". ";
- }
-
- .css-1477c3971f30e506f225a6232acfa7b0-h2.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h3.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h4.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h5.nocount:before,
- .css-1477c3971f30e506f225a6232acfa7b0-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-419fe82e974c07e5d632fde5495ed8a8-h2 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h3;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h3 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h4;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h4 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h5;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h5 {
- counter-reset: css-419fe82e974c07e5d632fde5495ed8a8-h6;
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h2 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h3 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h4 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h5 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h5) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-419fe82e974c07e5d632fde5495ed8a8-h6 1;
- content: counter(css-419fe82e974c07e5d632fde5495ed8a8-h2) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h3) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h4) "." counter(css-419fe82e974c07e5d632fde5495ed8a8-h5) "."
- counter(css-419fe82e974c07e5d632fde5495ed8a8-h6) ". ";
- }
-
- .css-419fe82e974c07e5d632fde5495ed8a8-h2.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h3.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h4.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h5.nocount:before,
- .css-419fe82e974c07e5d632fde5495ed8a8-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-88d3820c2893fc9ab8dd376e03e846ef-h2 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h3;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h4;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h5;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5 {
- counter-reset: css-88d3820c2893fc9ab8dd376e03e846ef-h6;
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h2 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h3 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h4 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h5 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h5) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-88d3820c2893fc9ab8dd376e03e846ef-h6 1;
- content: counter(css-88d3820c2893fc9ab8dd376e03e846ef-h2) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h3) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h4) "." counter(css-88d3820c2893fc9ab8dd376e03e846ef-h5) "."
- counter(css-88d3820c2893fc9ab8dd376e03e846ef-h6) ". ";
- }
-
- .css-88d3820c2893fc9ab8dd376e03e846ef-h2.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h3.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h4.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h5.nocount:before,
- .css-88d3820c2893fc9ab8dd376e03e846ef-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
-.css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2 {
- counter-reset: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3;
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3 {
- counter-reset: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4;
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4 {
- counter-reset: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5;
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5 {
- counter-reset: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h6;
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2 1;
- content: counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2) ". ";
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3 1;
- content: counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3) ". ";
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4 1;
- content: counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4) ". ";
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5 1;
- content: counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5) ". ";
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h6:before {
- color: rgba(0, 0, 0, 0.4);
- counter-increment: css-e3b4941d3f0bf0c8e46362a0012d6eb8-h6 1;
- content: counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4) "." counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5) "."
- counter(css-e3b4941d3f0bf0c8e46362a0012d6eb8-h6) ". ";
- }
-
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h2.nocount:before,
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h3.nocount:before,
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h4.nocount:before,
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h5.nocount:before,
- .css-e3b4941d3f0bf0c8e46362a0012d6eb8-h6.nocount:before {
- content: "";
- counter-increment: none;
- }
\ No newline at end of file
diff --git a/public/css/paged_interface.css b/public/css/paged_interface.css
deleted file mode 100644
index 4450cf3..0000000
--- a/public/css/paged_interface.css
+++ /dev/null
@@ -1,104 +0,0 @@
-/* CSS for Paged.js interface */
-
-/* Change the look */
-:root {
- --color-background: whitesmoke;
- --color-pageBox: #666;
- --color-paper: white;
- --color-marginBox: transparent;
-}
-
-/* To define how the book look on the screen: */
-@media screen {
- body {
- background-color: var(--color-background);
- }
-
- .pagedjs_pages {
- display: flex;
- width: calc(var(--pagedjs-width) * 2);
- flex: 0;
- flex-wrap: wrap;
- margin: 0 auto;
- }
-
- .pagedjs_page {
- background-color: var(--color-paper);
- box-shadow: 0 0 0 1px var(--color-pageBox);
- margin: 0;
- flex-shrink: 0;
- flex-grow: 0;
- margin-top: 10mm;
- }
-
- .pagedjs_first_page {
- margin-left: var(--pagedjs-width);
- }
-
- .pagedjs_page:last-of-type {
- margin-bottom: 10mm;
- }
-
- /* show the margin-box */
-
- .pagedjs_margin-top-left-corner-holder,
- .pagedjs_margin-top,
- .pagedjs_margin-top-left,
- .pagedjs_margin-top-center,
- .pagedjs_margin-top-right,
- .pagedjs_margin-top-right-corner-holder,
- .pagedjs_margin-bottom-left-corner-holder,
- .pagedjs_margin-bottom,
- .pagedjs_margin-bottom-left,
- .pagedjs_margin-bottom-center,
- .pagedjs_margin-bottom-right,
- .pagedjs_margin-bottom-right-corner-holder,
- .pagedjs_margin-right,
- .pagedjs_margin-right-top,
- .pagedjs_margin-right-middle,
- .pagedjs_margin-right-bottom,
- .pagedjs_margin-left,
- .pagedjs_margin-left-top,
- .pagedjs_margin-left-middle,
- .pagedjs_margin-left-bottom {
- box-shadow: 0 0 0 1px inset var(--color-marginBox);
- }
-
- /* uncomment this part for recto/verso book : ------------------------------------ */
-
-
- .pagedjs_pages {
- flex-direction: column;
- width: 100%;
- }
-
- .pagedjs_first_page {
- margin-left: 0;
- }
-
- .pagedjs_page {
- margin: 0 auto;
- margin-top: 10mm;
- }
-
- /*--------------------------------------------------------------------------------------*/
-
-
-
- /* uncomment this par to see the baseline : -------------------------------------------*/
-
- /*
- .pagedjs_pagebox {
- --pagedjs-baseline: 11px;
- --pagedjs-baseline-position: -4px;
- --pagedjs-baseline-color: cyan;
- background: linear-gradient(var(--color-paper) 0%, var(--color-paper) calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) var(--pagedjs-baseline)), transparent;
- background-size: 100% var(--pagedjs-baseline);
- background-repeat: repeat-y;
- background-position-y: var(--pagedjs-baseline-position);
- }
- */
-
- /*--------------------------------------------------------------------------------------*/
-}
-
diff --git a/public/css/player.min.css b/public/css/player.min.css
deleted file mode 100644
index 0bb9d03..0000000
--- a/public/css/player.min.css
+++ /dev/null
@@ -1 +0,0 @@
-@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg);opacity:.4}50%{-webkit-transform:rotate(180deg);opacity:1}to{-webkit-transform:rotate(360deg);opacity:.4}}@keyframes spin{from{transform:rotate(0deg);opacity:.2}50%{transform:rotate(180deg);opacity:1}to{transform:rotate(360deg);opacity:.2}}.soundcite-loaded{border-radius:6px;padding:0 5px;display:inline-block;cursor:pointer}.soundcite-loaded:before{display:inline-block;content:"";vertical-align:-10%;margin-right:.25em}.soundcite-loading:before{margin-right:.5em;font-size:.9em;position:relative;top:-.05em;height:.75em;width:.75em;border:2px solid #000;border-right-color:transparent;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.soundcite-play:before{font-size:.9em;position:relative;top:-.05em;border:.5em solid transparent;border-left:.75em solid #000}.soundcite-pause:before{font-size:.9em;position:relative;top:-.05em;height:1em;border-left:.75em double #000;border-right:.5em solid transparent}
\ No newline at end of file
diff --git a/public/css/print.css b/public/css/print.css
deleted file mode 100644
index 4682b5e..0000000
--- a/public/css/print.css
+++ /dev/null
@@ -1,242 +0,0 @@
-@page {
- size: 6.14in 9.21in;
- margin-bottom: 0.8in;
- padding-bottom: 0.2in;
- margin-top: 0.7in;
-}
-
-@page:left {
- margin-right: 0.8in;
- margin-left: 0.9in;
- @bottom-left-corner {
- content: counter(page);
- font-size: 1rem;
- vertical-align: text-top;
- }
-
- @bottom {
- content: element(runningTitle);
- position: relative;
- }
-}
-
-@page:right {
- margin-left: 0.8in;
- margin-right: 0.9in;
- @bottom-right-corner {
- content: counter(page);
- font-size: 1rem;
- vertical-align: text-top;
- }
-
- @bottom {
- content: element(runningAuthors);
- position: relative;
- }
-}
-
-@page crustpage :first {
- @bottom-right-corner {
- content: none;
- }
- @bottom {
- content: none;
- }
-}
-
-@media print {
- html {
- font-size: 0.8em;
- box-sizing: border-box;
- margin: 0;
- padding: 0;
- }
- body {
- font-size: 1rem;
- padding: 0;
- margin: 0;
- }
-
- .sup,
- .hassup {
- color: black;
- }
- .grid {
- display: inline;
- }
-
- .coretitle {
- margin-top: 3rem;
- margin-bottom: 2rem;
- font-size: 2.2rem;
- }
-
- .leftcolumn {
- display: none;
- }
-
- .has,
- .afterhas {
- font-size: 1.1rem;
- }
-
- .mantle,
- .crust {
- margin-bottom: 0.2em;
- }
-
- .content {
- padding: 0px;
- margin: 0 auto;
- margin-top: 4rem;
- }
-
- .hpar {
- display: none;
- }
-
- .mantletitle {
- font-size: 1.7rem;
- }
-
- .sessiongrid {
- display: none;
- }
-
- #bibliography {
- break-before: page;
- }
-
- .footnotes ol {
- margin-top: 3rem;
- padding-left: 0.9rem;
- }
-
- .footnotes hr {
- border: none;
- border-top: 0px;
- text-align: left;
- margin-top: 2rem;
- margin-bottom: -2rem;
- }
-
- .footnotes hr::after {
- content: "Endnotes";
- font-size: 1.2rem;
- font-weight: bold;
- }
-
- .runningTitle {
- position: running(runningTitle);
- }
-
- .runningAuthors {
- position: running(runningAuthors);
- }
-
- .hasauthors .afterhas {
- font-size: 1.5rem;
- }
-
- .crustpage {
- break-before: page;
- page: crustpage;
- }
-
- .hasin {
- display: none;
- }
-
- .abstract {
- margin-left: 0;
- margin-right: 0;
- max-width: inherit;
- }
-
- .keywords {
- margin-left: 0;
- margin-right: 0;
- max-width: inherit;
- padding-left: 0;
- padding-right: 0;
- font-size: 0.9rem;
- }
- /*
- h2:before,
- h3:before,
- h4:before,
- h5:before {
- content: none;
- }
- */
- h2, h3, h4, h5, hr {
- break-after: avoid;
- }
-
- .glosscontainer,
- table,
- table + p,
- tr,
- blockquote,
- li {
- break-inside: avoid;
- }
-
- .authorpage {
- break-before: page;
- }
-
- img {
- display: block;
- max-height: 150mm;
- width: auto;
- break-after: avoid;
- margin-bottom: 0.5rem;
- margin-left: 1rem;
- }
-
- .crustoc {
- position: relative;
- bottom: 0
- }
-
- a.toc::before {
- direction: rtl;
- content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
- line-height: 0;
- height: 1px;
- position: absolute;
- bottom: 10px;
- z-index: -1;
- }
-
- a.toc {
- display: grid;
- grid-template-columns: 1fr auto;
- align-items: flex-end;
- }
-
- a.toc span {
- }
-
- a.toc .back {
- background: white;
- }
-
- a.toc::after {
- text-align: right;
- float: right;
- content: target-counter(attr(href url), page, decimal-leading-zero);
- background: white;
- padding-left: 0.1rem;
- }
-
- ol[data-split-from] {
- padding-left: 0.5rem;
- }
-
- .longesttitle {
- visibility: hidden;
- cursor: default;
- }
-}
diff --git a/public/css/site.min.css b/public/css/site.min.css
deleted file mode 100644
index 35c040a..0000000
--- a/public/css/site.min.css
+++ /dev/null
@@ -1 +0,0 @@
-qhtml,body,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}img,video{height:auto;max-width:100%}iframe{border:0}strong del{display:inline;text-decoration:none;margin-left:1rem;box-decoration-break:clone;-webkit-box-decoration-break:clone}table{border-collapse:collapse;border-spacing:0;background-color:#fff9f9;border-left:1px red solid;margin-left:1rem}td,th{padding:0;vertical-align:top;padding-right:1rem;padding-left:1rem;padding-bottom:.5rem}td:not([align]),th:not([align]){text-align:left}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:600;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:700;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:900;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format("svg")}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local("Great Vibes"),local("GreatVibes-Regular"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format("woff"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format("svg")}html{line-height:1.5}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}#preview{display:none}sup,sub{vertical-align:baseline;position:relative;top:-.4em}sub{top:.4em}.headiter{display:flex;justify-content:space-between;border-bottom:.3rem solid red;border-top:.1rem solid red;padding-top:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;margin-bottom:1rem}a.edit-button{color:#000;text-decoration:none}a.edit-button:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}.header{display:grid;grid-template-columns:auto;grid-auto-flow:column;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{grid-column:1}.bibliotheke{width:2.4rem;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.alsoin{font-weight:700;display:inline-flex;padding-left:.2rem;padding-right:.3rem}.ddmenu{cursor:pointer;display:inline-grid}.ddmenu input{display:none}.ddmenu li{list-style-type:none}.ddmenu .hiddendiv{display:none;margin-top:-.9rem}input:focus,select:focus,textarea:focus,label:focus,button:focus{outline:none}.ddmenu input:checked~.hiddendiv{display:block}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}ol li{list-style-type:decimal}img{width:100%}.supt{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:rgba(0,0,0,.8);vertical-align:baseline;position:relative;top:-.3em}.sup{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.nosup a{color:red}.nosup a span.sup{display:none}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.grid{padding-left:3rem;margin-bottom:2rem;display:grid;grid-template-columns:1fr 1fr}.leftcolumn{grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{padding-left:.5rem}.has{display:inline-grid;grid-column:2;grid-auto-rows:max-content;font-size:1.4rem;font-style:italic;margin-bottom:.8rem}.hasauthors{font-size:1.6rem!important;display:flex}.hassup{grid-column:1;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative}.afterhas{grid-column:2}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}.abstract{font-style:italic;border-left:1px solid #000;margin-left:5rem;margin-right:2rem;margin-bottom:1.2rem;padding-left:1rem;padding-right:2rem;padding-top:1.2rem;padding-bottom:1.2rem;background-color:rgba(0,0,0,5%);max-width:45ch}.authors{display:inline-block;font-size:1.8rem;margin-left:5rem;margin-right:2rem;padding-left:1rem}.keywords{display:inline-block;font-size:1.2rem;margin-left:5rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;margin-bottom:2.2rem;max-width:72ch}blockquote{border-left:1px red solid;margin-left:1rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}.smallcaps{font-family:vollkorn sc,serif;font-weight:400}body{counter-reset:h2 glossN}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}details{padding-left:1rem}#toggleAllLinks{font-size:.8rem}#toggleAllLinks:hover{cursor:pointer;text-decoration:underline;text-decoration-color:red}.glosscontainer{display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr;gap:0 0;grid-template-areas:"glossnumber gloss";border-left:1px red solid;background-color:#fff9f9;padding-top:.4em;margin-top:1rem;margin-bottom:1rem;margin-left:1rem;margin-right:2rem;padding-bottom:.4em;padding-left:1rem;padding-right:2rem}.gloss{grid-area:gloss}.glossnumber{grid-area:glossnumber;padding-right:.6rem}.glossnumberAuto::before{counter-increment:glossN;content:"(" counter(glossN)")"}.glosswords{display:inline-block;padding-left:-.3rem;padding-right:1rem}.sitemap{padding-left:3rem;font-size:1.2rem}.sitemap a{color:rgba(0,0,0,.4)}.sitemap .sup{color:rgba(255,0,0,.7)}.highline a,.sitemap a:hover{color:#000}.highline .sup,.sitemap .sup:hover{color:red}.highline{font-size:1.6rem;color:#000;border-left:1px red solid;padding-left:1rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}.svedit{display:none;margin-left:.5rem}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}}
diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png
deleted file mode 100644
index 004b99f..0000000
Binary files a/public/favicon-16x16.png and /dev/null differ
diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png
deleted file mode 100644
index a041b71..0000000
Binary files a/public/favicon-32x32.png and /dev/null differ
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 98b8f24..0000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/fonts/great-vibes-v7-latin-ext_latin-regular.eot b/public/fonts/great-vibes-v7-latin-ext_latin-regular.eot
deleted file mode 100644
index a1fd8f4..0000000
Binary files a/public/fonts/great-vibes-v7-latin-ext_latin-regular.eot and /dev/null differ
diff --git a/public/fonts/great-vibes-v7-latin-ext_latin-regular.svg b/public/fonts/great-vibes-v7-latin-ext_latin-regular.svg
deleted file mode 100644
index fd0ec65..0000000
--- a/public/fonts/great-vibes-v7-latin-ext_latin-regular.svg
+++ /dev/null
@@ -1,581 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/great-vibes-v7-latin-ext_latin-regular.ttf b/public/fonts/great-vibes-v7-latin-ext_latin-regular.ttf
deleted file mode 100644
index d3f4bca..0000000
Binary files a/public/fonts/great-vibes-v7-latin-ext_latin-regular.ttf and /dev/null differ
diff --git a/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff b/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff
deleted file mode 100644
index 5b46304..0000000
Binary files a/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff and /dev/null differ
diff --git a/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff2 b/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff2
deleted file mode 100644
index 6442cfa..0000000
Binary files a/public/fonts/great-vibes-v7-latin-ext_latin-regular.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.eot b/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.eot
deleted file mode 100644
index e807f05..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.svg b/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.svg
deleted file mode 100644
index caec8a8..0000000
--- a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.svg
+++ /dev/null
@@ -1,437 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf b/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf
deleted file mode 100644
index 1c480a2..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff b/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff
deleted file mode 100644
index 3018662..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2 b/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2
deleted file mode 100644
index 0c55ed8..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.eot b/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.eot
deleted file mode 100644
index 20d6573..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.svg b/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.svg
deleted file mode 100644
index ced96d6..0000000
--- a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.svg
+++ /dev/null
@@ -1,436 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf b/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf
deleted file mode 100644
index c1fd445..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff b/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff
deleted file mode 100644
index 571854a..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2 b/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2
deleted file mode 100644
index 9e67d0a..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.eot b/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.eot
deleted file mode 100644
index 3e1a0fd..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.svg b/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.svg
deleted file mode 100644
index c60df64..0000000
--- a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.svg
+++ /dev/null
@@ -1,441 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf b/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf
deleted file mode 100644
index 72d32b2..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff b/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff
deleted file mode 100644
index b3fc465..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2 b/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2
deleted file mode 100644
index 666d061..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot b/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot
deleted file mode 100644
index 53b418e..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg b/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg
deleted file mode 100644
index b77ed8b..0000000
--- a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf b/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf
deleted file mode 100644
index d97731d..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff b/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff
deleted file mode 100644
index 34d574a..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2 b/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2
deleted file mode 100644
index 2360d2f..0000000
Binary files a/public/fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500.eot b/public/fonts/vollkorn-v12-latin-ext_latin-500.eot
deleted file mode 100644
index 4b648de..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500.svg b/public/fonts/vollkorn-v12-latin-ext_latin-500.svg
deleted file mode 100644
index 519081e..0000000
--- a/public/fonts/vollkorn-v12-latin-ext_latin-500.svg
+++ /dev/null
@@ -1,516 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500.ttf b/public/fonts/vollkorn-v12-latin-ext_latin-500.ttf
deleted file mode 100644
index af39216..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500.woff b/public/fonts/vollkorn-v12-latin-ext_latin-500.woff
deleted file mode 100644
index efe0e72..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500.woff2 b/public/fonts/vollkorn-v12-latin-ext_latin-500.woff2
deleted file mode 100644
index 058eb2e..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.eot b/public/fonts/vollkorn-v12-latin-ext_latin-500italic.eot
deleted file mode 100644
index 1985a5d..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.svg b/public/fonts/vollkorn-v12-latin-ext_latin-500italic.svg
deleted file mode 100644
index edcacb9..0000000
--- a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.svg
+++ /dev/null
@@ -1,511 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.ttf b/public/fonts/vollkorn-v12-latin-ext_latin-500italic.ttf
deleted file mode 100644
index 66fab01..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff b/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff
deleted file mode 100644
index ab8712e..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff2 b/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff2
deleted file mode 100644
index 9ff6246..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-500italic.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-italic.eot b/public/fonts/vollkorn-v12-latin-ext_latin-italic.eot
deleted file mode 100644
index cd501a6..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-italic.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-italic.svg b/public/fonts/vollkorn-v12-latin-ext_latin-italic.svg
deleted file mode 100644
index 7a47d67..0000000
--- a/public/fonts/vollkorn-v12-latin-ext_latin-italic.svg
+++ /dev/null
@@ -1,511 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-italic.ttf b/public/fonts/vollkorn-v12-latin-ext_latin-italic.ttf
deleted file mode 100644
index ce0bcb1..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-italic.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff b/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff
deleted file mode 100644
index 1388686..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff2 b/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff2
deleted file mode 100644
index 74a8889..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-italic.woff2 and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-regular.eot b/public/fonts/vollkorn-v12-latin-ext_latin-regular.eot
deleted file mode 100644
index 9185676..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-regular.eot and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-regular.svg b/public/fonts/vollkorn-v12-latin-ext_latin-regular.svg
deleted file mode 100644
index c411210..0000000
--- a/public/fonts/vollkorn-v12-latin-ext_latin-regular.svg
+++ /dev/null
@@ -1,516 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-regular.ttf b/public/fonts/vollkorn-v12-latin-ext_latin-regular.ttf
deleted file mode 100644
index c30f35b..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-regular.ttf and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff b/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff
deleted file mode 100644
index aa06e7b..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff and /dev/null differ
diff --git a/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff2 b/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff2
deleted file mode 100644
index a7c150f..0000000
Binary files a/public/fonts/vollkorn-v12-latin-ext_latin-regular.woff2 and /dev/null differ
diff --git a/public/glassblower/alessandroludovico/index.html b/public/glassblower/alessandroludovico/index.html
deleted file mode 100644
index 401c60f..0000000
--- a/public/glassblower/alessandroludovico/index.html
+++ /dev/null
@@ -1,294 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Alessandro Ludovico - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Alessandro Ludovico
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄A lessandro Ludovico
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/glassblower/cristobalsciutto/index.html b/public/glassblower/cristobalsciutto/index.html
deleted file mode 100644
index 897ac04..0000000
--- a/public/glassblower/cristobalsciutto/index.html
+++ /dev/null
@@ -1,299 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Cristóbal Sciutto Rodríguez - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Cristóbal Sciutto Rodríguez
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄C ristóbal Sciutto Rodríguez
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Cristóbal Sciutto Rodríguez is a programmer and researcher concerned with
-technically simple, but compositionally complex infrastructures for living.
-
-
-
diff --git a/public/glassblower/custodiansonline/index.html b/public/glassblower/custodiansonline/index.html
deleted file mode 100644
index 12c9e36..0000000
--- a/public/glassblower/custodiansonline/index.html
+++ /dev/null
@@ -1,289 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Custodians.Online - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Custodians.Online
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄C ustodians.Online
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Custodians.online is an ad-hoc collective who wrote two letters to the public:
-
-
It is an attempt to articulate the subjectivity who could stand (up) in solidarity and represent the voice of critique if any treat against Internet appears.
-
It tries to articulate the sweet spot in being as inclusive as possible without trivializing the care one should express and practice in order to be a custodian. (of an online universe.)
-
Custodians.online is especially sensitive of the treats coming from restrictive regime of (private) intellectual property. Custodians, as a signifier, emphasized via Little Prince reference in the first letter, invites for a journey to imagine the world in which value of the property comes from the care and commitment and not the market price signaling.
-
-
-
diff --git a/public/glassblower/dusanbarok/index.html b/public/glassblower/dusanbarok/index.html
deleted file mode 100644
index 7550028..0000000
--- a/public/glassblower/dusanbarok/index.html
+++ /dev/null
@@ -1,278 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Dušan Barok - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Dušan Barok
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄D ušan Barok
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Dušan Barok’s work is concerned with digital culture, memory and activism. He is founding editor of Monoskop, a wiki for arts and studies, and has been involved in collectives such as 3/4, Burundi, Multiplace, La Société Anonyme and Society of Algorithm.
-
-
-
diff --git a/public/glassblower/felixstalder/index.html b/public/glassblower/felixstalder/index.html
deleted file mode 100644
index a030716..0000000
--- a/public/glassblower/felixstalder/index.html
+++ /dev/null
@@ -1,295 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Felix Stalder - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Felix Stalder
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄F elix Stalder
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Bio¶
-
Felix Stalder is a writer, teacher, and researcher. His work focuses on
-the intersection of cultural, political and technological dynamics, in
-particular on new modes of commons-based production, copyright,
-datafication, and transformation of subjectivity. He not only works as
-an academic, but also as a cultural producer, facilitator, and community
-janitor for the nettime mailing list (1998-2023) and now for the
-Fediverse instance tldr.nettime.org
-
-
-
diff --git a/public/glassblower/index.html b/public/glassblower/index.html
deleted file mode 100644
index 957bacc..0000000
--- a/public/glassblower/index.html
+++ /dev/null
@@ -1,557 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sitemap⁄U bu@50 - 50 Ubus (glassblower/)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/glassblower/marcellmars/index.html b/public/glassblower/marcellmars/index.html
deleted file mode 100644
index ddc8910..0000000
--- a/public/glassblower/marcellmars/index.html
+++ /dev/null
@@ -1,320 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Marcell Mars - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Marcell Mars
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄M arcell Mars
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/glassblower/nickthurston/index.html b/public/glassblower/nickthurston/index.html
deleted file mode 100644
index 1f728b6..0000000
--- a/public/glassblower/nickthurston/index.html
+++ /dev/null
@@ -1,289 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Nick Thurston - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Nick Thurston
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄N ick Thurston
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Bio¶
-
Nick Thurston (b.1982) is a writer and editor who makes art and teaches. He explores the throughlines between those four roles by publishing, reading and exhibiting his own work and other’s. He lives with his partner and children in York, England, and currently teaches at the University of Leeds.
-
-
-
diff --git a/public/glassblower/olgagoriunova/index.html b/public/glassblower/olgagoriunova/index.html
deleted file mode 100644
index cec1f75..0000000
--- a/public/glassblower/olgagoriunova/index.html
+++ /dev/null
@@ -1,314 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Olga Goriunova - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Olga Goriunova
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄O lga Goriunova
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Olga Goriunova is a cultural theorist and a professor in the Media Arts Department at Royal Holloway, University of London. In the 2000s, she curated Readme software art festivals (Moscow 2002, Helsinki 2003, Aarhus 2004, Dortmund 2005), co-organized the software art repository Runme.org and an international exhibition Funware that was first shown in Arnolfini gallery in Bristol. In her interdisciplinary research she draws on theories of computation, art and literature as well as philosophy. She is interested in the processes of subjectivation in relation to technology and aesthetics but also in thinking beyond the human, in terms of posthuman ecologies. My earlier work in media art is linked to my newest interests in the digital abstractions of the subject through an interest in what happens to the human – gendered and racialized – in networked cultures.
-
-
-
diff --git a/public/glassblower/sanjabojanic/index.html b/public/glassblower/sanjabojanic/index.html
deleted file mode 100644
index 8ced674..0000000
--- a/public/glassblower/sanjabojanic/index.html
+++ /dev/null
@@ -1,285 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sanja Bojanić - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sanja Bojanić
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄S anja Bojanić
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Bio¶
-
Sanja Bojanić is a researcher immersed in the philosophy of culture, media, and queer studies, with an overarching commitment to comprehend contemporary forms of gender, racial, and class practices, which underpin social and affective inequalities specifically increased in modern societal and political contexts.
-
-
-
diff --git a/public/glassblower/sasasavanovic/index.html b/public/glassblower/sasasavanovic/index.html
deleted file mode 100644
index 8309f3d..0000000
--- a/public/glassblower/sasasavanovic/index.html
+++ /dev/null
@@ -1,286 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Saša Savanović - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Saša Savanović
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄S aša Savanović
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/glassblower/sreckohorvat/index.html b/public/glassblower/sreckohorvat/index.html
deleted file mode 100644
index 825f1ed..0000000
--- a/public/glassblower/sreckohorvat/index.html
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Srećko Horvat - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Srećko Horvat
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄S rećko Horvat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/glassblower/tomislavmedak/index.html b/public/glassblower/tomislavmedak/index.html
deleted file mode 100644
index 0e6a8f5..0000000
--- a/public/glassblower/tomislavmedak/index.html
+++ /dev/null
@@ -1,309 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Tomislav Medak - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Tomislav Medak
-
-
-
-
-
-
-
-
-
-
-
-
-
-glassblower⁄T omislav Medak
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
mentioned in⁄
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/images/bibliotheke.svg b/public/images/bibliotheke.svg
deleted file mode 100644
index 526611e..0000000
--- a/public/images/bibliotheke.svg
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/images/everythingistemporary.jpg b/public/images/everythingistemporary.jpg
deleted file mode 100644
index 1da522c..0000000
Binary files a/public/images/everythingistemporary.jpg and /dev/null differ
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index b5a61c8..0000000
--- a/public/index.html
+++ /dev/null
@@ -1,557 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Ubu@50 - 50 Ubus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sitemap⁄U bu@50 - 50 Ubus (/)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/js/paged.polyfill.js b/public/js/paged.polyfill.js
deleted file mode 100644
index e1f48b4..0000000
--- a/public/js/paged.polyfill.js
+++ /dev/null
@@ -1,33040 +0,0 @@
-/**
- * @license Paged.js v0.4.0 | MIT | https://gitlab.pagedmedia.org/tools/pagedjs
- */
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.PagedPolyfill = factory());
-})(this, (function () { 'use strict';
-
- var eventEmitter = {exports: {}};
-
- var d$3 = {exports: {}};
-
- var isImplemented$6 = function () {
- var assign = Object.assign, obj;
- if (typeof assign !== "function") return false;
- obj = { foo: "raz" };
- assign(obj, { bar: "dwa" }, { trzy: "trzy" });
- return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy";
- };
-
- var isImplemented$5 = function () {
- try {
- Object.keys("primitive");
- return true;
- } catch (e) {
- return false;
- }
- };
-
- // eslint-disable-next-line no-empty-function
- var noop$4 = function () {};
-
- var _undefined = noop$4(); // Support ES3 engines
-
- var isValue$5 = function (val) {
- return (val !== _undefined) && (val !== null);
- };
-
- var isValue$4 = isValue$5;
-
- var keys$2 = Object.keys;
-
- var shim$5 = function (object) {
- return keys$2(isValue$4(object) ? Object(object) : object);
- };
-
- var keys$1 = isImplemented$5()
- ? Object.keys
- : shim$5;
-
- var isValue$3 = isValue$5;
-
- var validValue$1 = function (value) {
- if (!isValue$3(value)) throw new TypeError("Cannot use null or undefined");
- return value;
- };
-
- var keys = keys$1
- , value$3 = validValue$1
- , max$1 = Math.max;
-
- var shim$4 = function (dest, src /*, …srcn*/) {
- var error, i, length = max$1(arguments.length, 2), assign;
- dest = Object(value$3(dest));
- assign = function (key) {
- try {
- dest[key] = src[key];
- } catch (e) {
- if (!error) error = e;
- }
- };
- for (i = 1; i < length; ++i) {
- src = arguments[i];
- keys(src).forEach(assign);
- }
- if (error !== undefined) throw error;
- return dest;
- };
-
- var assign$2 = isImplemented$6()
- ? Object.assign
- : shim$4;
-
- var isValue$2 = isValue$5;
-
- var forEach$1 = Array.prototype.forEach, create$6 = Object.create;
-
- var process = function (src, obj) {
- var key;
- for (key in src) obj[key] = src[key];
- };
-
- // eslint-disable-next-line no-unused-vars
- var normalizeOptions = function (opts1 /*, …options*/) {
- var result = create$6(null);
- forEach$1.call(arguments, function (options) {
- if (!isValue$2(options)) return;
- process(Object(options), result);
- });
- return result;
- };
-
- var isCallable$1 = function (obj) {
- return typeof obj === "function";
- };
-
- var str = "razdwatrzy";
-
- var isImplemented$4 = function () {
- if (typeof str.contains !== "function") return false;
- return (str.contains("dwa") === true) && (str.contains("foo") === false);
- };
-
- var indexOf$3 = String.prototype.indexOf;
-
- var shim$3 = function (searchString/*, position*/) {
- return indexOf$3.call(this, searchString, arguments[1]) > -1;
- };
-
- var contains$1 = isImplemented$4()
- ? String.prototype.contains
- : shim$3;
-
- var assign$1 = assign$2
- , normalizeOpts = normalizeOptions
- , isCallable = isCallable$1
- , contains = contains$1
-
- , d$2;
-
- d$2 = d$3.exports = function (dscr, value/*, options*/) {
- var c, e, w, options, desc;
- if ((arguments.length < 2) || (typeof dscr !== 'string')) {
- options = value;
- value = dscr;
- dscr = null;
- } else {
- options = arguments[2];
- }
- if (dscr == null) {
- c = w = true;
- e = false;
- } else {
- c = contains.call(dscr, 'c');
- e = contains.call(dscr, 'e');
- w = contains.call(dscr, 'w');
- }
-
- desc = { value: value, configurable: c, enumerable: e, writable: w };
- return !options ? desc : assign$1(normalizeOpts(options), desc);
- };
-
- d$2.gs = function (dscr, get, set/*, options*/) {
- var c, e, options, desc;
- if (typeof dscr !== 'string') {
- options = set;
- set = get;
- get = dscr;
- dscr = null;
- } else {
- options = arguments[3];
- }
- if (get == null) {
- get = undefined;
- } else if (!isCallable(get)) {
- options = get;
- get = set = undefined;
- } else if (set == null) {
- set = undefined;
- } else if (!isCallable(set)) {
- options = set;
- set = undefined;
- }
- if (dscr == null) {
- c = true;
- e = false;
- } else {
- c = contains.call(dscr, 'c');
- e = contains.call(dscr, 'e');
- }
-
- desc = { get: get, set: set, configurable: c, enumerable: e };
- return !options ? desc : assign$1(normalizeOpts(options), desc);
- };
-
- var validCallable = function (fn) {
- if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
- return fn;
- };
-
- (function (module, exports) {
-
- var d = d$3.exports
- , callable = validCallable
-
- , apply = Function.prototype.apply, call = Function.prototype.call
- , create = Object.create, defineProperty = Object.defineProperty
- , defineProperties = Object.defineProperties
- , hasOwnProperty = Object.prototype.hasOwnProperty
- , descriptor = { configurable: true, enumerable: false, writable: true }
-
- , on, once, off, emit, methods, descriptors, base;
-
- on = function (type, listener) {
- var data;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) {
- data = descriptor.value = create(null);
- defineProperty(this, '__ee__', descriptor);
- descriptor.value = null;
- } else {
- data = this.__ee__;
- }
- if (!data[type]) data[type] = listener;
- else if (typeof data[type] === 'object') data[type].push(listener);
- else data[type] = [data[type], listener];
-
- return this;
- };
-
- once = function (type, listener) {
- var once, self;
-
- callable(listener);
- self = this;
- on.call(this, type, once = function () {
- off.call(self, type, once);
- apply.call(listener, this, arguments);
- });
-
- once.__eeOnceListener__ = listener;
- return this;
- };
-
- off = function (type, listener) {
- var data, listeners, candidate, i;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) return this;
- data = this.__ee__;
- if (!data[type]) return this;
- listeners = data[type];
-
- if (typeof listeners === 'object') {
- for (i = 0; (candidate = listeners[i]); ++i) {
- if ((candidate === listener) ||
- (candidate.__eeOnceListener__ === listener)) {
- if (listeners.length === 2) data[type] = listeners[i ? 0 : 1];
- else listeners.splice(i, 1);
- }
- }
- } else {
- if ((listeners === listener) ||
- (listeners.__eeOnceListener__ === listener)) {
- delete data[type];
- }
- }
-
- return this;
- };
-
- emit = function (type) {
- var i, l, listener, listeners, args;
-
- if (!hasOwnProperty.call(this, '__ee__')) return;
- listeners = this.__ee__[type];
- if (!listeners) return;
-
- if (typeof listeners === 'object') {
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) args[i - 1] = arguments[i];
-
- listeners = listeners.slice();
- for (i = 0; (listener = listeners[i]); ++i) {
- apply.call(listener, this, args);
- }
- } else {
- switch (arguments.length) {
- case 1:
- call.call(listeners, this);
- break;
- case 2:
- call.call(listeners, this, arguments[1]);
- break;
- case 3:
- call.call(listeners, this, arguments[1], arguments[2]);
- break;
- default:
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) {
- args[i - 1] = arguments[i];
- }
- apply.call(listeners, this, args);
- }
- }
- };
-
- methods = {
- on: on,
- once: once,
- off: off,
- emit: emit
- };
-
- descriptors = {
- on: d(on),
- once: d(once),
- off: d(off),
- emit: d(emit)
- };
-
- base = defineProperties({}, descriptors);
-
- module.exports = exports = function (o) {
- return (o == null) ? create(base) : defineProperties(Object(o), descriptors);
- };
- exports.methods = methods;
- }(eventEmitter, eventEmitter.exports));
-
- var EventEmitter = eventEmitter.exports;
-
- /**
- * Hooks allow for injecting functions that must all complete in order before finishing
- * They will execute in parallel but all must finish before continuing
- * Functions may return a promise if they are asycn.
- * From epubjs/src/utils/hooks
- * @param {any} context scope of this
- * @example this.content = new Hook(this);
- */
- class Hook {
- constructor(context){
- this.context = context || this;
- this.hooks = [];
- }
-
- /**
- * Adds a function to be run before a hook completes
- * @example this.content.register(function(){...});
- * @return {undefined} void
- */
- register(){
- for(var i = 0; i < arguments.length; ++i) {
- if (typeof arguments[i] === "function") {
- this.hooks.push(arguments[i]);
- } else {
- // unpack array
- for(var j = 0; j < arguments[i].length; ++j) {
- this.hooks.push(arguments[i][j]);
- }
- }
- }
- }
-
- /**
- * Triggers a hook to run all functions
- * @example this.content.trigger(args).then(function(){...});
- * @return {Promise} results
- */
- trigger(){
- var args = arguments;
- var context = this.context;
- var promises = [];
-
- this.hooks.forEach(function(task) {
- var executing = task.apply(context, args);
-
- if(executing && typeof executing["then"] === "function") {
- // Task is a function that returns a promise
- promises.push(executing);
- } else {
- // Otherwise Task resolves immediately, add resolved promise with result
- promises.push(new Promise((resolve, reject) => {
- resolve(executing);
- }));
- }
- });
-
-
- return Promise.all(promises);
- }
-
- /**
- * Triggers a hook to run all functions synchronously
- * @example this.content.trigger(args).then(function(){...});
- * @return {Array} results
- */
- triggerSync(){
- var args = arguments;
- var context = this.context;
- var results = [];
-
- this.hooks.forEach(function(task) {
- var executing = task.apply(context, args);
-
- results.push(executing);
- });
-
-
- return results;
- }
-
- // Adds a function to be run before a hook completes
- list(){
- return this.hooks;
- }
-
- clear(){
- return this.hooks = [];
- }
- }
-
- function getBoundingClientRect(element) {
- if (!element) {
- return;
- }
- let rect;
- if (typeof element.getBoundingClientRect !== "undefined") {
- rect = element.getBoundingClientRect();
- } else {
- let range = document.createRange();
- range.selectNode(element);
- rect = range.getBoundingClientRect();
- }
- return rect;
- }
-
- function getClientRects(element) {
- if (!element) {
- return;
- }
- let rect;
- if (typeof element.getClientRects !== "undefined") {
- rect = element.getClientRects();
- } else {
- let range = document.createRange();
- range.selectNode(element);
- rect = range.getClientRects();
- }
- return rect;
- }
-
- /**
- * Generates a UUID
- * based on: http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
- * @returns {string} uuid
- */
- function UUID() {
- var d = new Date().getTime();
- if (typeof performance !== "undefined" && typeof performance.now === "function") {
- d += performance.now(); //use high-precision timer if available
- }
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
- var r = (d + Math.random() * 16) % 16 | 0;
- d = Math.floor(d / 16);
- return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16);
- });
- }
-
- function attr(element, attributes) {
- for (var i = 0; i < attributes.length; i++) {
- if (element.hasAttribute(attributes[i])) {
- return element.getAttribute(attributes[i]);
- }
- }
- }
-
- /* Based on by https://mths.be/cssescape v1.5.1 by @mathias | MIT license
- * Allows # and .
- */
- function querySelectorEscape(value) {
- if (arguments.length == 0) {
- throw new TypeError("`CSS.escape` requires an argument.");
- }
- var string = String(value);
-
- var length = string.length;
- var index = -1;
- var codeUnit;
- var result = "";
- var firstCodeUnit = string.charCodeAt(0);
- while (++index < length) {
- codeUnit = string.charCodeAt(index);
-
-
-
- // Note: there’s no need to special-case astral symbols, surrogate
- // pairs, or lone surrogates.
-
- // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
- // (U+FFFD).
- if (codeUnit == 0x0000) {
- result += "\uFFFD";
- continue;
- }
-
- if (
- // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
- // U+007F, […]
- (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
- // If the character is the first character and is in the range [0-9]
- // (U+0030 to U+0039), […]
- (index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
- // If the character is the second character and is in the range [0-9]
- // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
- (
- index == 1 &&
- codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
- firstCodeUnit == 0x002D
- )
- ) {
- // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
- result += "\\" + codeUnit.toString(16) + " ";
- continue;
- }
-
- if (
- // If the character is the first character and is a `-` (U+002D), and
- // there is no second character, […]
- index == 0 &&
- length == 1 &&
- codeUnit == 0x002D
- ) {
- result += "\\" + string.charAt(index);
- continue;
- }
-
- // support for period character in id
- if (codeUnit == 0x002E) {
- if (string.charAt(0) == "#") {
- result += "\\.";
- continue;
- }
- }
-
-
- // If the character is not handled by one of the above rules and is
- // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
- // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
- // U+005A), or [a-z] (U+0061 to U+007A), […]
- if (
- codeUnit >= 0x0080 ||
- codeUnit == 0x002D ||
- codeUnit == 0x005F ||
- codeUnit == 35 || // Allow #
- codeUnit == 46 || // Allow .
- codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
- codeUnit >= 0x0041 && codeUnit <= 0x005A ||
- codeUnit >= 0x0061 && codeUnit <= 0x007A
- ) {
- // the character itself
- result += string.charAt(index);
- continue;
- }
-
- // Otherwise, the escaped character.
- // https://drafts.csswg.org/cssom/#escape-a-character
- result += "\\" + string.charAt(index);
-
- }
- return result;
- }
-
- /**
- * Creates a new pending promise and provides methods to resolve or reject it.
- * From: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred#backwards_forwards_compatible
- * @returns {object} defered
- */
- function defer() {
- this.resolve = null;
-
- this.reject = null;
-
- this.id = UUID();
-
- this.promise = new Promise((resolve, reject) => {
- this.resolve = resolve;
- this.reject = reject;
- });
- Object.freeze(this);
- }
-
- const requestIdleCallback = typeof window !== "undefined" && ("requestIdleCallback" in window ? window.requestIdleCallback : window.requestAnimationFrame);
-
- function CSSValueToString(obj) {
- return obj.value + (obj.unit || "");
- }
-
- function isElement(node) {
- return node && node.nodeType === 1;
- }
-
- function isText(node) {
- return node && node.nodeType === 3;
- }
-
- function* walk$2(start, limiter) {
- let node = start;
-
- while (node) {
-
- yield node;
-
- if (node.childNodes.length) {
- node = node.firstChild;
- } else if (node.nextSibling) {
- if (limiter && node === limiter) {
- node = undefined;
- break;
- }
- node = node.nextSibling;
- } else {
- while (node) {
- node = node.parentNode;
- if (limiter && node === limiter) {
- node = undefined;
- break;
- }
- if (node && node.nextSibling) {
- node = node.nextSibling;
- break;
- }
-
- }
- }
- }
- }
-
- function nodeAfter(node, limiter) {
- if (limiter && node === limiter) {
- return;
- }
- let significantNode = nextSignificantNode(node);
- if (significantNode) {
- return significantNode;
- }
- if (node.parentNode) {
- while ((node = node.parentNode)) {
- if (limiter && node === limiter) {
- return;
- }
- significantNode = nextSignificantNode(node);
- if (significantNode) {
- return significantNode;
- }
- }
- }
- }
-
- function nodeBefore(node, limiter) {
- if (limiter && node === limiter) {
- return;
- }
- let significantNode = previousSignificantNode(node);
- if (significantNode) {
- return significantNode;
- }
- if (node.parentNode) {
- while ((node = node.parentNode)) {
- if (limiter && node === limiter) {
- return;
- }
- significantNode = previousSignificantNode(node);
- if (significantNode) {
- return significantNode;
- }
- }
- }
- }
-
- function elementAfter(node, limiter) {
- let after = nodeAfter(node, limiter);
-
- while (after && after.nodeType !== 1) {
- after = nodeAfter(after, limiter);
- }
-
- return after;
- }
-
- function elementBefore(node, limiter) {
- let before = nodeBefore(node, limiter);
-
- while (before && before.nodeType !== 1) {
- before = nodeBefore(before, limiter);
- }
-
- return before;
- }
-
- function displayedElementAfter(node, limiter) {
- let after = elementAfter(node, limiter);
-
- while (after && after.dataset.undisplayed) {
- after = elementAfter(after, limiter);
- }
-
- return after;
- }
-
- function displayedElementBefore(node, limiter) {
- let before = elementBefore(node, limiter);
-
- while (before && before.dataset.undisplayed) {
- before = elementBefore(before, limiter);
- }
-
- return before;
- }
-
- function rebuildAncestors(node) {
- let parent, ancestor;
- let ancestors = [];
- let added = [];
-
- let fragment = document.createDocumentFragment();
-
- // Handle rowspan on table
- if (node.nodeName === "TR") {
- let previousRow = node.previousElementSibling;
- let previousRowDistance = 1;
- while (previousRow) {
- // previous row has more columns, might indicate a rowspan.
- if (previousRow.childElementCount > node.childElementCount) {
- const initialColumns = Array.from(node.children);
- while (node.firstChild) {
- node.firstChild.remove();
- }
- let k = 0;
- for (let j = 0; j < previousRow.children.length; j++) {
- let column = previousRow.children[j];
- if (column.rowSpan && column.rowSpan > previousRowDistance) {
- const duplicatedColumn = column.cloneNode(true);
- // Adjust rowspan value
- duplicatedColumn.rowSpan = column.rowSpan - previousRowDistance;
- // Add the column to the row
- node.appendChild(duplicatedColumn);
- } else {
- // Fill the gap with the initial columns (if exists)
- const initialColumn = initialColumns[k++];
- // The initial column can be undefined if the newly created table has less columns than the original table
- if (initialColumn) {
- node.appendChild(initialColumn);
- }
- }
- }
- }
- previousRow = previousRow.previousElementSibling;
- previousRowDistance++;
- }
- }
-
- // Gather all ancestors
- let element = node;
- while(element.parentNode && element.parentNode.nodeType === 1) {
- ancestors.unshift(element.parentNode);
- element = element.parentNode;
- }
-
- for (var i = 0; i < ancestors.length; i++) {
- ancestor = ancestors[i];
- parent = ancestor.cloneNode(false);
-
- parent.setAttribute("data-split-from", parent.getAttribute("data-ref"));
- // ancestor.setAttribute("data-split-to", parent.getAttribute("data-ref"));
-
- if (parent.hasAttribute("id")) {
- let dataID = parent.getAttribute("id");
- parent.setAttribute("data-id", dataID);
- parent.removeAttribute("id");
- }
-
- // This is handled by css :not, but also tidied up here
- if (parent.hasAttribute("data-break-before")) {
- parent.removeAttribute("data-break-before");
- }
-
- if (parent.hasAttribute("data-previous-break-after")) {
- parent.removeAttribute("data-previous-break-after");
- }
-
- if (added.length) {
- let container = added[added.length-1];
- container.appendChild(parent);
- } else {
- fragment.appendChild(parent);
- }
- added.push(parent);
-
- // rebuild table rows
- if (parent.nodeName === "TD" && ancestor.parentElement.contains(ancestor)) {
- let td = ancestor;
- let prev = parent;
- while ((td = td.previousElementSibling)) {
- let sib = td.cloneNode(false);
- parent.parentElement.insertBefore(sib, prev);
- prev = sib;
- }
-
- }
- }
-
- added = undefined;
- return fragment;
- }
- /*
- export function split(bound, cutElement, breakAfter) {
- let needsRemoval = [];
- let index = indexOf(cutElement);
-
- if (!breakAfter && index === 0) {
- return;
- }
-
- if (breakAfter && index === (cutElement.parentNode.children.length - 1)) {
- return;
- }
-
- // Create a fragment with rebuilt ancestors
- let fragment = rebuildAncestors(cutElement);
-
- // Clone cut
- if (!breakAfter) {
- let clone = cutElement.cloneNode(true);
- let ref = cutElement.parentNode.getAttribute('data-ref');
- let parent = fragment.querySelector("[data-ref='" + ref + "']");
- parent.appendChild(clone);
- needsRemoval.push(cutElement);
- }
-
- // Remove all after cut
- let next = nodeAfter(cutElement, bound);
- while (next) {
- let clone = next.cloneNode(true);
- let ref = next.parentNode.getAttribute('data-ref');
- let parent = fragment.querySelector("[data-ref='" + ref + "']");
- parent.appendChild(clone);
- needsRemoval.push(next);
- next = nodeAfter(next, bound);
- }
-
- // Remove originals
- needsRemoval.forEach((node) => {
- if (node) {
- node.remove();
- }
- });
-
- // Insert after bounds
- bound.parentNode.insertBefore(fragment, bound.nextSibling);
- return [bound, bound.nextSibling];
- }
- */
-
- function needsBreakBefore(node) {
- if( typeof node !== "undefined" &&
- typeof node.dataset !== "undefined" &&
- typeof node.dataset.breakBefore !== "undefined" &&
- (node.dataset.breakBefore === "always" ||
- node.dataset.breakBefore === "page" ||
- node.dataset.breakBefore === "left" ||
- node.dataset.breakBefore === "right" ||
- node.dataset.breakBefore === "recto" ||
- node.dataset.breakBefore === "verso")
- ) {
- return true;
- }
-
- return false;
- }
-
- function needsPreviousBreakAfter(node) {
- if( typeof node !== "undefined" &&
- typeof node.dataset !== "undefined" &&
- typeof node.dataset.previousBreakAfter !== "undefined" &&
- (node.dataset.previousBreakAfter === "always" ||
- node.dataset.previousBreakAfter === "page" ||
- node.dataset.previousBreakAfter === "left" ||
- node.dataset.previousBreakAfter === "right" ||
- node.dataset.previousBreakAfter === "recto" ||
- node.dataset.previousBreakAfter === "verso")
- ) {
- return true;
- }
-
- return false;
- }
-
- function needsPageBreak(node, previousSignificantNode) {
- if (typeof node === "undefined" || !previousSignificantNode || isIgnorable(node)) {
- return false;
- }
- if (node.dataset && node.dataset.undisplayed) {
- return false;
- }
- let previousSignificantNodePage = previousSignificantNode.dataset ? previousSignificantNode.dataset.page : undefined;
- if (typeof previousSignificantNodePage === "undefined") {
- const nodeWithNamedPage = getNodeWithNamedPage(previousSignificantNode);
- if (nodeWithNamedPage) {
- previousSignificantNodePage = nodeWithNamedPage.dataset.page;
- }
- }
- let currentNodePage = node.dataset ? node.dataset.page : undefined;
- if (typeof currentNodePage === "undefined") {
- const nodeWithNamedPage = getNodeWithNamedPage(node, previousSignificantNode);
- if (nodeWithNamedPage) {
- currentNodePage = nodeWithNamedPage.dataset.page;
- }
- }
- return currentNodePage !== previousSignificantNodePage;
- }
-
- function *words(node) {
- let currentText = node.nodeValue;
- let max = currentText.length;
- let currentOffset = 0;
- let currentLetter;
-
- let range;
- const significantWhitespaces = node.parentElement && node.parentElement.nodeName === "PRE";
-
- while (currentOffset < max) {
- currentLetter = currentText[currentOffset];
- if (/^[\S\u202F\u00A0]$/.test(currentLetter) || significantWhitespaces) {
- if (!range) {
- range = document.createRange();
- range.setStart(node, currentOffset);
- }
- } else {
- if (range) {
- range.setEnd(node, currentOffset);
- yield range;
- range = undefined;
- }
- }
-
- currentOffset += 1;
- }
-
- if (range) {
- range.setEnd(node, currentOffset);
- yield range;
- }
- }
-
- function *letters(wordRange) {
- let currentText = wordRange.startContainer;
- let max = currentText.length;
- let currentOffset = wordRange.startOffset;
- // let currentLetter;
-
- let range;
-
- while(currentOffset < max) {
- // currentLetter = currentText[currentOffset];
- range = document.createRange();
- range.setStart(currentText, currentOffset);
- range.setEnd(currentText, currentOffset+1);
-
- yield range;
-
- currentOffset += 1;
- }
- }
-
- function isContainer(node) {
- let container;
-
- if (typeof node.tagName === "undefined") {
- return true;
- }
-
- if (node.style && node.style.display === "none") {
- return false;
- }
-
- switch (node.tagName) {
- // Inline
- case "A":
- case "ABBR":
- case "ACRONYM":
- case "B":
- case "BDO":
- case "BIG":
- case "BR":
- case "BUTTON":
- case "CITE":
- case "CODE":
- case "DFN":
- case "EM":
- case "I":
- case "IMG":
- case "INPUT":
- case "KBD":
- case "LABEL":
- case "MAP":
- case "OBJECT":
- case "Q":
- case "SAMP":
- case "SCRIPT":
- case "SELECT":
- case "SMALL":
- case "SPAN":
- case "STRONG":
- case "SUB":
- case "SUP":
- case "TEXTAREA":
- case "TIME":
- case "TT":
- case "VAR":
- case "P":
- case "H1":
- case "H2":
- case "H3":
- case "H4":
- case "H5":
- case "H6":
- case "FIGCAPTION":
- case "BLOCKQUOTE":
- case "PRE":
- case "LI":
- case "TD":
- case "DT":
- case "DD":
- case "VIDEO":
- case "CANVAS":
- container = false;
- break;
- default:
- container = true;
- }
-
- return container;
- }
-
- function cloneNode(n, deep=false) {
- return n.cloneNode(deep);
- }
-
- function findElement(node, doc, forceQuery) {
- const ref = node.getAttribute("data-ref");
- return findRef(ref, doc, forceQuery);
- }
-
- function findRef(ref, doc, forceQuery) {
- if (!forceQuery && doc.indexOfRefs && doc.indexOfRefs[ref]) {
- return doc.indexOfRefs[ref];
- } else {
- return doc.querySelector(`[data-ref='${ref}']`);
- }
- }
-
- function validNode(node) {
- if (isText(node)) {
- return true;
- }
-
- if (isElement(node) && node.dataset.ref) {
- return true;
- }
-
- return false;
- }
-
- function prevValidNode(node) {
- while (!validNode(node)) {
- if (node.previousSibling) {
- node = node.previousSibling;
- } else {
- node = node.parentNode;
- }
-
- if (!node) {
- break;
- }
- }
-
- return node;
- }
-
-
- function indexOf$2(node) {
- let parent = node.parentNode;
- if (!parent) {
- return 0;
- }
- return Array.prototype.indexOf.call(parent.childNodes, node);
- }
-
- function child(node, index) {
- return node.childNodes[index];
- }
-
- function hasContent(node) {
- if (isElement(node)) {
- return true;
- } else if (isText(node) &&
- node.textContent.trim().length) {
- return true;
- }
- return false;
- }
-
- function indexOfTextNode(node, parent) {
- if (!isText(node)) {
- return -1;
- }
- let nodeTextContent = node.textContent;
- let child;
- let index = -1;
- for (var i = 0; i < parent.childNodes.length; i++) {
- child = parent.childNodes[i];
- if (child.nodeType === 3) {
- let text = parent.childNodes[i].textContent;
- if (text.includes(nodeTextContent)) {
- index = i;
- break;
- }
- }
- }
-
- return index;
- }
-
-
- /**
- * Throughout, whitespace is defined as one of the characters
- * "\t" TAB \u0009
- * "\n" LF \u000A
- * "\r" CR \u000D
- * " " SPC \u0020
- *
- * This does not use Javascript's "\s" because that includes non-breaking
- * spaces (and also some other characters).
- */
-
- /**
- * Determine if a node should be ignored by the iterator functions.
- * taken from https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace#Whitespace_helper_functions
- *
- * @param {Node} node An object implementing the DOM1 |Node| interface.
- * @return {boolean} true if the node is:
- * 1) A |Text| node that is all whitespace
- * 2) A |Comment| node
- * and otherwise false.
- */
- function isIgnorable(node) {
- return (node.nodeType === 8) || // A comment node
- ((node.nodeType === 3) && isAllWhitespace(node)); // a text node, all whitespace
- }
-
- /**
- * Determine whether a node's text content is entirely whitespace.
- *
- * @param {Node} node A node implementing the |CharacterData| interface (i.e., a |Text|, |Comment|, or |CDATASection| node
- * @return {boolean} true if all of the text content of |nod| is whitespace, otherwise false.
- */
- function isAllWhitespace(node) {
- return !(/[^\t\n\r ]/.test(node.textContent));
- }
-
- /**
- * Version of |previousSibling| that skips nodes that are entirely
- * whitespace or comments. (Normally |previousSibling| is a property
- * of all DOM nodes that gives the sibling node, the node that is
- * a child of the same parent, that occurs immediately before the
- * reference node.)
- *
- * @param {ChildNode} sib The reference node.
- * @return {Node|null} Either:
- * 1) The closest previous sibling to |sib| that is not ignorable according to |is_ignorable|, or
- * 2) null if no such node exists.
- */
- function previousSignificantNode(sib) {
- while ((sib = sib.previousSibling)) {
- if (!isIgnorable(sib)) return sib;
- }
- return null;
- }
-
- function getNodeWithNamedPage(node, limiter) {
- if (node && node.dataset && node.dataset.page) {
- return node;
- }
- if (node.parentNode) {
- while ((node = node.parentNode)) {
- if (limiter && node === limiter) {
- return;
- }
- if (node.dataset && node.dataset.page) {
- return node;
- }
- }
- }
- return null;
- }
-
- function breakInsideAvoidParentNode(node) {
- while ((node = node.parentNode)) {
- if (node && node.dataset && node.dataset.breakInside === "avoid") {
- return node;
- }
- }
- return null;
- }
-
- /**
- * Find a parent with a given node name.
- * @param {Node} node - initial Node
- * @param {string} nodeName - node name (eg. "TD", "TABLE", "STRONG"...)
- * @param {Node} limiter - go up to the parent until there's no more parent or the current node is equals to the limiter
- * @returns {Node|undefined} - Either:
- * 1) The closest parent for a the given node name, or
- * 2) undefined if no such node exists.
- */
- function parentOf(node, nodeName, limiter) {
- if (limiter && node === limiter) {
- return;
- }
- if (node.parentNode) {
- while ((node = node.parentNode)) {
- if (limiter && node === limiter) {
- return;
- }
- if (node.nodeName === nodeName) {
- return node;
- }
- }
- }
- }
-
- /**
- * Version of |nextSibling| that skips nodes that are entirely
- * whitespace or comments.
- *
- * @param {ChildNode} sib The reference node.
- * @return {Node|null} Either:
- * 1) The closest next sibling to |sib| that is not ignorable according to |is_ignorable|, or
- * 2) null if no such node exists.
- */
- function nextSignificantNode(sib) {
- while ((sib = sib.nextSibling)) {
- if (!isIgnorable(sib)) return sib;
- }
- return null;
- }
-
- function filterTree(content, func, what) {
- const treeWalker = document.createTreeWalker(
- content || this.dom,
- what || NodeFilter.SHOW_ALL,
- func ? { acceptNode: func } : null,
- false
- );
-
- let node;
- let current;
- node = treeWalker.nextNode();
- while(node) {
- current = node;
- node = treeWalker.nextNode();
- current.parentNode.removeChild(current);
- }
- }
-
- /**
- * BreakToken
- * @class
- */
- class BreakToken {
-
- constructor(node, offset) {
- this.node = node;
- this.offset = offset;
- }
-
- equals(otherBreakToken) {
- if (!otherBreakToken) {
- return false;
- }
- if (this["node"] && otherBreakToken["node"] &&
- this["node"] !== otherBreakToken["node"]) {
- return false;
- }
- if (this["offset"] && otherBreakToken["offset"] &&
- this["offset"] !== otherBreakToken["offset"]) {
- return false;
- }
- return true;
- }
-
- toJSON(hash) {
- let node;
- let index = 0;
- if (!this.node) {
- return {};
- }
- if (isElement(this.node) && this.node.dataset.ref) {
- node = this.node.dataset.ref;
- } else if (hash) {
- node = this.node.parentElement.dataset.ref;
- }
-
- if (this.node.parentElement) {
- const children = Array.from(this.node.parentElement.childNodes);
- index = children.indexOf(this.node);
- }
-
- return JSON.stringify({
- "node": node,
- "index" : index,
- "offset": this.offset
- });
- }
-
- }
-
- /**
- * Render result.
- * @class
- */
- class RenderResult {
-
- constructor(breakToken, error) {
- this.breakToken = breakToken;
- this.error = error;
- }
- }
-
- class OverflowContentError extends Error {
- constructor(message, items) {
- super(message);
- this.items = items;
- }
- }
-
- const MAX_CHARS_PER_BREAK = 1500;
-
- /**
- * Layout
- * @class
- */
- class Layout {
-
- constructor(element, hooks, options) {
- this.element = element;
-
- this.bounds = this.element.getBoundingClientRect();
- this.parentBounds = this.element.offsetParent.getBoundingClientRect();
- let gap = parseFloat(window.getComputedStyle(this.element).columnGap);
-
- if (gap) {
- let leftMargin = this.bounds.left - this.parentBounds.left;
- this.gap = gap - leftMargin;
- } else {
- this.gap = 0;
- }
-
- if (hooks) {
- this.hooks = hooks;
- } else {
- this.hooks = {};
- this.hooks.layout = new Hook();
- this.hooks.renderNode = new Hook();
- this.hooks.layoutNode = new Hook();
- this.hooks.beforeOverflow = new Hook();
- this.hooks.onOverflow = new Hook();
- this.hooks.afterOverflowRemoved = new Hook();
- this.hooks.onBreakToken = new Hook();
- }
-
- this.settings = options || {};
-
- this.maxChars = this.settings.maxChars || MAX_CHARS_PER_BREAK;
- this.forceRenderBreak = false;
- }
-
- async renderTo(wrapper, source, breakToken, bounds = this.bounds) {
- let start = this.getStart(source, breakToken);
- let walker = walk$2(start, source);
-
- let node;
- let prevNode;
- let done;
- let next;
-
- let hasRenderedContent = false;
- let newBreakToken;
-
- let length = 0;
-
- let prevBreakToken = breakToken || new BreakToken(start);
-
- while (!done && !newBreakToken) {
- next = walker.next();
- prevNode = node;
- node = next.value;
- done = next.done;
-
- if (!node) {
- this.hooks && this.hooks.layout.trigger(wrapper, this);
-
- let imgs = wrapper.querySelectorAll("img");
- if (imgs.length) {
- await this.waitForImages(imgs);
- }
-
- newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
-
- if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
- console.warn("Unable to layout item: ", prevNode);
- return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [prevNode]));
- }
-
- this.rebuildTableFromBreakToken(newBreakToken, wrapper);
-
- return new RenderResult(newBreakToken);
- }
-
- this.hooks && this.hooks.layoutNode.trigger(node);
-
- // Check if the rendered element has a break set
- if (hasRenderedContent && this.shouldBreak(node, start)) {
- this.hooks && this.hooks.layout.trigger(wrapper, this);
-
- let imgs = wrapper.querySelectorAll("img");
- if (imgs.length) {
- await this.waitForImages(imgs);
- }
-
- newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
-
- if (!newBreakToken) {
- newBreakToken = this.breakAt(node);
- } else {
- this.rebuildTableFromBreakToken(newBreakToken, wrapper);
- }
-
- if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
- console.warn("Unable to layout item: ", node);
- let after = newBreakToken.node && nodeAfter(newBreakToken.node);
- if (after) {
- newBreakToken = new BreakToken(after);
- } else {
- return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [node]));
- }
- }
-
- length = 0;
-
- break;
- }
-
- if (node.dataset && node.dataset.page) {
- let named = node.dataset.page;
- let page = this.element.closest(".pagedjs_page");
- page.classList.add("pagedjs_named_page");
- page.classList.add("pagedjs_" + named + "_page");
-
- if (!node.dataset.splitFrom) {
- page.classList.add("pagedjs_" + named + "_first_page");
- }
- }
-
- // Should the Node be a shallow or deep clone
- let shallow = isContainer(node);
-
- let rendered = this.append(node, wrapper, breakToken, shallow);
-
- length += rendered.textContent.length;
-
- // Check if layout has content yet
- if (!hasRenderedContent) {
- hasRenderedContent = hasContent(node);
- }
-
- // Skip to the next node if a deep clone was rendered
- if (!shallow) {
- walker = walk$2(nodeAfter(node, source), source);
- }
-
- if (this.forceRenderBreak) {
- this.hooks && this.hooks.layout.trigger(wrapper, this);
-
- newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
-
- if (!newBreakToken) {
- newBreakToken = this.breakAt(node);
- } else {
- this.rebuildTableFromBreakToken(newBreakToken, wrapper);
- }
-
- length = 0;
- this.forceRenderBreak = false;
-
- break;
- }
-
- // Only check x characters
- if (length >= this.maxChars) {
-
- this.hooks && this.hooks.layout.trigger(wrapper, this);
-
- let imgs = wrapper.querySelectorAll("img");
- if (imgs.length) {
- await this.waitForImages(imgs);
- }
-
- newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
-
- if (newBreakToken) {
- length = 0;
- this.rebuildTableFromBreakToken(newBreakToken, wrapper);
- }
-
- if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
- console.warn("Unable to layout item: ", node);
- let after = newBreakToken.node && nodeAfter(newBreakToken.node);
- if (after) {
- newBreakToken = new BreakToken(after);
- } else {
- return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [node]));
- }
- }
- }
-
- }
-
- return new RenderResult(newBreakToken);
- }
-
- breakAt(node, offset = 0) {
- let newBreakToken = new BreakToken(
- node,
- offset
- );
- let breakHooks = this.hooks.onBreakToken.triggerSync(newBreakToken, undefined, node, this);
- breakHooks.forEach((newToken) => {
- if (typeof newToken != "undefined") {
- newBreakToken = newToken;
- }
- });
-
- return newBreakToken;
- }
-
- shouldBreak(node, limiter) {
- let previousNode = nodeBefore(node, limiter);
- let parentNode = node.parentNode;
- let parentBreakBefore = needsBreakBefore(node) && parentNode && !previousNode && needsBreakBefore(parentNode);
- let doubleBreakBefore;
-
- if (parentBreakBefore) {
- doubleBreakBefore = node.dataset.breakBefore === parentNode.dataset.breakBefore;
- }
-
- return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node, previousNode);
- }
-
- forceBreak() {
- this.forceRenderBreak = true;
- }
-
- getStart(source, breakToken) {
- let start;
- let node = breakToken && breakToken.node;
-
- if (node) {
- start = node;
- } else {
- start = source.firstChild;
- }
-
- return start;
- }
-
- append(node, dest, breakToken, shallow = true, rebuild = true) {
-
- let clone = cloneNode(node, !shallow);
-
- if (node.parentNode && isElement(node.parentNode)) {
- let parent = findElement(node.parentNode, dest);
- // Rebuild chain
- if (parent) {
- parent.appendChild(clone);
- } else if (rebuild) {
- let fragment = rebuildAncestors(node);
- parent = findElement(node.parentNode, fragment);
- if (!parent) {
- dest.appendChild(clone);
- } else if (breakToken && isText(breakToken.node) && breakToken.offset > 0) {
- clone.textContent = clone.textContent.substring(breakToken.offset);
- parent.appendChild(clone);
- } else {
- parent.appendChild(clone);
- }
-
- dest.appendChild(fragment);
- } else {
- dest.appendChild(clone);
- }
-
-
- } else {
- dest.appendChild(clone);
- }
-
- if (clone.dataset && clone.dataset.ref) {
- if (!dest.indexOfRefs) {
- dest.indexOfRefs = {};
- }
- dest.indexOfRefs[clone.dataset.ref] = clone;
- }
-
- let nodeHooks = this.hooks.renderNode.triggerSync(clone, node, this);
- nodeHooks.forEach((newNode) => {
- if (typeof newNode != "undefined") {
- clone = newNode;
- }
- });
-
- return clone;
- }
-
- rebuildTableFromBreakToken(breakToken, dest) {
- if (!breakToken || !breakToken.node) {
- return;
- }
- let node = breakToken.node;
- let td = isElement(node) ? node.closest("td") : node.parentElement.closest("td");
- if (td) {
- let rendered = findElement(td, dest, true);
- if (!rendered) {
- return;
- }
- while ((td = td.nextElementSibling)) {
- this.append(td, dest, null, true);
- }
- }
- }
-
- async waitForImages(imgs) {
- let results = Array.from(imgs).map(async (img) => {
- return this.awaitImageLoaded(img);
- });
- await Promise.all(results);
- }
-
- async awaitImageLoaded(image) {
- return new Promise(resolve => {
- if (image.complete !== true) {
- image.onload = function () {
- let {width, height} = window.getComputedStyle(image);
- resolve(width, height);
- };
- image.onerror = function (e) {
- let {width, height} = window.getComputedStyle(image);
- resolve(width, height, e);
- };
- } else {
- let {width, height} = window.getComputedStyle(image);
- resolve(width, height);
- }
- });
- }
-
- avoidBreakInside(node, limiter) {
- let breakNode;
-
- if (node === limiter) {
- return;
- }
-
- while (node.parentNode) {
- node = node.parentNode;
-
- if (node === limiter) {
- break;
- }
-
- if (window.getComputedStyle(node)["break-inside"] === "avoid") {
- breakNode = node;
- break;
- }
-
- }
- return breakNode;
- }
-
- createBreakToken(overflow, rendered, source) {
- let container = overflow.startContainer;
- let offset = overflow.startOffset;
- let node, renderedNode, parent, index, temp;
-
- if (isElement(container)) {
- temp = child(container, offset);
-
- if (isElement(temp)) {
- renderedNode = findElement(temp, rendered);
-
- if (!renderedNode) {
- // Find closest element with data-ref
- let prevNode = prevValidNode(temp);
- if (!isElement(prevNode)) {
- prevNode = prevNode.parentElement;
- }
- renderedNode = findElement(prevNode, rendered);
- // Check if temp is the last rendered node at its level.
- if (!temp.nextSibling) {
- // We need to ensure that the previous sibling of temp is fully rendered.
- const renderedNodeFromSource = findElement(renderedNode, source);
- const walker = document.createTreeWalker(renderedNodeFromSource, NodeFilter.SHOW_ELEMENT);
- const lastChildOfRenderedNodeFromSource = walker.lastChild();
- const lastChildOfRenderedNodeMatchingFromRendered = findElement(lastChildOfRenderedNodeFromSource, rendered);
- // Check if we found that the last child in source
- if (!lastChildOfRenderedNodeMatchingFromRendered) {
- // Pending content to be rendered before virtual break token
- return;
- }
- // Otherwise we will return a break token as per below
- }
- // renderedNode is actually the last unbroken box that does not overflow.
- // Break Token is therefore the next sibling of renderedNode within source node.
- node = findElement(renderedNode, source).nextSibling;
- offset = 0;
- } else {
- node = findElement(renderedNode, source);
- offset = 0;
- }
- } else {
- renderedNode = findElement(container, rendered);
-
- if (!renderedNode) {
- renderedNode = findElement(prevValidNode(container), rendered);
- }
-
- parent = findElement(renderedNode, source);
- index = indexOfTextNode(temp, parent);
- // No seperatation for the first textNode of an element
- if(index === 0) {
- node = parent;
- offset = 0;
- } else {
- node = child(parent, index);
- offset = 0;
- }
- }
- } else {
- renderedNode = findElement(container.parentNode, rendered);
-
- if (!renderedNode) {
- renderedNode = findElement(prevValidNode(container.parentNode), rendered);
- }
-
- parent = findElement(renderedNode, source);
- index = indexOfTextNode(container, parent);
-
- if (index === -1) {
- return;
- }
-
- node = child(parent, index);
-
- offset += node.textContent.indexOf(container.textContent);
- }
-
- if (!node) {
- return;
- }
-
- return new BreakToken(
- node,
- offset
- );
-
- }
-
- findBreakToken(rendered, source, bounds = this.bounds, prevBreakToken, extract = true) {
- let overflow = this.findOverflow(rendered, bounds);
- let breakToken, breakLetter;
-
- let overflowHooks = this.hooks.onOverflow.triggerSync(overflow, rendered, bounds, this);
- overflowHooks.forEach((newOverflow) => {
- if (typeof newOverflow != "undefined") {
- overflow = newOverflow;
- }
- });
-
- if (overflow) {
- breakToken = this.createBreakToken(overflow, rendered, source);
- // breakToken is nullable
- let breakHooks = this.hooks.onBreakToken.triggerSync(breakToken, overflow, rendered, this);
- breakHooks.forEach((newToken) => {
- if (typeof newToken != "undefined") {
- breakToken = newToken;
- }
- });
-
- // Stop removal if we are in a loop
- if (breakToken && breakToken.equals(prevBreakToken)) {
- return breakToken;
- }
-
- if (breakToken && breakToken["node"] && breakToken["offset"] && breakToken["node"].textContent) {
- breakLetter = breakToken["node"].textContent.charAt(breakToken["offset"]);
- } else {
- breakLetter = undefined;
- }
-
- if (breakToken && breakToken.node && extract) {
- let removed = this.removeOverflow(overflow, breakLetter);
- this.hooks && this.hooks.afterOverflowRemoved.trigger(removed, rendered, this);
- }
-
- }
- return breakToken;
- }
-
- hasOverflow(element, bounds = this.bounds) {
- let constrainingElement = element && element.parentNode; // this gets the element, instead of the wrapper for the width workaround
- let {width, height} = element.getBoundingClientRect();
- let scrollWidth = constrainingElement ? constrainingElement.scrollWidth : 0;
- let scrollHeight = constrainingElement ? constrainingElement.scrollHeight : 0;
- return Math.max(Math.floor(width), scrollWidth) > Math.round(bounds.width) ||
- Math.max(Math.floor(height), scrollHeight) > Math.round(bounds.height);
- }
-
- findOverflow(rendered, bounds = this.bounds, gap = this.gap) {
- if (!this.hasOverflow(rendered, bounds)) return;
-
- let start = Math.floor(bounds.left);
- let end = Math.round(bounds.right + gap);
- let vStart = Math.round(bounds.top);
- let vEnd = Math.round(bounds.bottom);
- let range;
-
- let walker = walk$2(rendered.firstChild, rendered);
-
- // Find Start
- let next, done, node, offset, skip, breakAvoid, prev, br;
- while (!done) {
- next = walker.next();
- done = next.done;
- node = next.value;
- skip = false;
- breakAvoid = false;
- prev = undefined;
- br = undefined;
-
- if (node) {
- let pos = getBoundingClientRect(node);
- let left = Math.round(pos.left);
- let right = Math.floor(pos.right);
- let top = Math.round(pos.top);
- let bottom = Math.floor(pos.bottom);
-
- if (!range && (left >= end || top >= vEnd)) {
- // Check if it is a float
- let isFloat = false;
-
- // Check if the node is inside a break-inside: avoid table cell
- const insideTableCell = parentOf(node, "TD", rendered);
- if (insideTableCell && window.getComputedStyle(insideTableCell)["break-inside"] === "avoid") {
- // breaking inside a table cell produces unexpected result, as a workaround, we forcibly avoid break inside in a cell.
- // But we take the whole row, not just the cell that is causing the break.
- prev = insideTableCell.parentElement;
- } else if (isElement(node)) {
- let styles = window.getComputedStyle(node);
- isFloat = styles.getPropertyValue("float") !== "none";
- skip = styles.getPropertyValue("break-inside") === "avoid";
- breakAvoid = node.dataset.breakBefore === "avoid" || node.dataset.previousBreakAfter === "avoid";
- prev = breakAvoid && nodeBefore(node, rendered);
- br = node.tagName === "BR" || node.tagName === "WBR";
- }
-
- let tableRow;
- if (node.nodeName === "TR") {
- tableRow = node;
- } else {
- tableRow = parentOf(node, "TR", rendered);
- }
- if (tableRow) {
- // honor break-inside="avoid" in parent tbody/thead
- let container = tableRow.parentElement;
- if (["TBODY", "THEAD"].includes(container.nodeName)) {
- let styles = window.getComputedStyle(container);
- if (styles.getPropertyValue("break-inside") === "avoid") prev = container;
- }
-
- // Check if the node is inside a row with a rowspan
- const table = parentOf(tableRow, "TABLE", rendered);
- const rowspan = table.querySelector("[colspan]");
- if (table && rowspan) {
- let columnCount = 0;
- for (const cell of Array.from(table.rows[0].cells)) {
- columnCount += parseInt(cell.getAttribute("colspan") || "1");
- }
- if (tableRow.cells.length !== columnCount) {
- let previousRow = tableRow.previousElementSibling;
- let previousRowColumnCount;
- while (previousRow !== null) {
- previousRowColumnCount = 0;
- for (const cell of Array.from(previousRow.cells)) {
- previousRowColumnCount += parseInt(cell.getAttribute("colspan") || "1");
- }
- if (previousRowColumnCount === columnCount) {
- break;
- }
- previousRow = previousRow.previousElementSibling;
- }
- if (previousRowColumnCount === columnCount) {
- prev = previousRow;
- }
- }
- }
- }
-
- if (prev) {
- range = document.createRange();
- range.selectNode(prev);
- break;
- }
-
- if (!br && !isFloat && isElement(node)) {
- range = document.createRange();
- range.selectNode(node);
- break;
- }
-
- if (isText(node) && node.textContent.trim().length) {
- range = document.createRange();
- range.selectNode(node);
- break;
- }
-
- }
-
- if (!range && isText(node) &&
- node.textContent.trim().length &&
- !breakInsideAvoidParentNode(node.parentNode)) {
-
- let rects = getClientRects(node);
- let rect;
- left = 0;
- top = 0;
- for (var i = 0; i != rects.length; i++) {
- rect = rects[i];
- if (rect.width > 0 && (!left || rect.left > left)) {
- left = rect.left;
- }
- if (rect.height > 0 && (!top || rect.top > top)) {
- top = rect.top;
- }
- }
-
- if (left >= end || top >= vEnd) {
- range = document.createRange();
- offset = this.textBreak(node, start, end, vStart, vEnd);
- if (!offset) {
- range = undefined;
- } else {
- range.setStart(node, offset);
- }
- break;
- }
- }
-
- // Skip children
- if (skip || (right <= end && bottom <= vEnd)) {
- next = nodeAfter(node, rendered);
- if (next) {
- walker = walk$2(next, rendered);
- }
-
- }
-
- }
- }
-
- // Find End
- if (range) {
- range.setEndAfter(rendered.lastChild);
- return range;
- }
-
- }
-
- findEndToken(rendered, source) {
- if (rendered.childNodes.length === 0) {
- return;
- }
-
- let lastChild = rendered.lastChild;
-
- let lastNodeIndex;
- while (lastChild && lastChild.lastChild) {
- if (!validNode(lastChild)) {
- // Only get elements with refs
- lastChild = lastChild.previousSibling;
- } else if (!validNode(lastChild.lastChild)) {
- // Deal with invalid dom items
- lastChild = prevValidNode(lastChild.lastChild);
- break;
- } else {
- lastChild = lastChild.lastChild;
- }
- }
-
- if (isText(lastChild)) {
-
- if (lastChild.parentNode.dataset.ref) {
- lastNodeIndex = indexOf$2(lastChild);
- lastChild = lastChild.parentNode;
- } else {
- lastChild = lastChild.previousSibling;
- }
- }
-
- let original = findElement(lastChild, source);
-
- if (lastNodeIndex) {
- original = original.childNodes[lastNodeIndex];
- }
-
- let after = nodeAfter(original);
-
- return this.breakAt(after);
- }
-
- textBreak(node, start, end, vStart, vEnd) {
- let wordwalker = words(node);
- let left = 0;
- let right = 0;
- let top = 0;
- let bottom = 0;
- let word, next, done, pos;
- let offset;
- while (!done) {
- next = wordwalker.next();
- word = next.value;
- done = next.done;
-
- if (!word) {
- break;
- }
-
- pos = getBoundingClientRect(word);
-
- left = Math.floor(pos.left);
- right = Math.floor(pos.right);
- top = Math.floor(pos.top);
- bottom = Math.floor(pos.bottom);
-
- if (left >= end || top >= vEnd) {
- offset = word.startOffset;
- break;
- }
-
- if (right > end || bottom > vEnd) {
- let letterwalker = letters(word);
- let letter, nextLetter, doneLetter;
-
- while (!doneLetter) {
- nextLetter = letterwalker.next();
- letter = nextLetter.value;
- doneLetter = nextLetter.done;
-
- if (!letter) {
- break;
- }
-
- pos = getBoundingClientRect(letter);
- left = Math.floor(pos.left);
- top = Math.floor(pos.top);
-
- if (left >= end || top >= vEnd) {
- offset = letter.startOffset;
- done = true;
-
- break;
- }
- }
- }
-
- }
-
- return offset;
- }
-
- removeOverflow(overflow, breakLetter) {
- let {startContainer} = overflow;
- let extracted = overflow.extractContents();
-
- this.hyphenateAtBreak(startContainer, breakLetter);
-
- return extracted;
- }
-
- hyphenateAtBreak(startContainer, breakLetter) {
- if (isText(startContainer)) {
- let startText = startContainer.textContent;
- let prevLetter = startText[startText.length - 1];
-
- // Add a hyphen if previous character is a letter or soft hyphen
- if (
- (breakLetter && /^\w|\u00AD$/.test(prevLetter) && /^\w|\u00AD$/.test(breakLetter)) ||
- (!breakLetter && /^\w|\u00AD$/.test(prevLetter))
- ) {
- startContainer.parentNode.classList.add("pagedjs_hyphen");
- startContainer.textContent += this.settings.hyphenGlyph || "\u2011";
- }
- }
- }
-
- equalTokens(a, b) {
- if (!a || !b) {
- return false;
- }
- if (a["node"] && b["node"] && a["node"] !== b["node"]) {
- return false;
- }
- if (a["offset"] && b["offset"] && a["offset"] !== b["offset"]) {
- return false;
- }
- return true;
- }
- }
-
- EventEmitter(Layout.prototype);
-
- /**
- * Render a page
- * @class
- */
- class Page {
- constructor(pagesArea, pageTemplate, blank, hooks, options) {
- this.pagesArea = pagesArea;
- this.pageTemplate = pageTemplate;
- this.blank = blank;
-
- this.width = undefined;
- this.height = undefined;
-
- this.hooks = hooks;
-
- this.settings = options || {};
-
- // this.element = this.create(this.pageTemplate);
- }
-
- create(template, after) {
- //let documentFragment = document.createRange().createContextualFragment( TEMPLATE );
- //let page = documentFragment.children[0];
- let clone = document.importNode(this.pageTemplate.content, true);
-
- let page, index;
- if (after) {
- this.pagesArea.insertBefore(clone, after.nextElementSibling);
- index = Array.prototype.indexOf.call(this.pagesArea.children, after.nextElementSibling);
- page = this.pagesArea.children[index];
- } else {
- this.pagesArea.appendChild(clone);
- page = this.pagesArea.lastChild;
- }
-
- let pagebox = page.querySelector(".pagedjs_pagebox");
- let area = page.querySelector(".pagedjs_page_content");
- let footnotesArea = page.querySelector(".pagedjs_footnote_area");
-
-
- let size = area.getBoundingClientRect();
-
-
- area.style.columnWidth = Math.round(size.width) + "px";
- area.style.columnGap = "calc(var(--pagedjs-margin-right) + var(--pagedjs-margin-left) + var(--pagedjs-bleed-right) + var(--pagedjs-bleed-left) + var(--pagedjs-column-gap-offset))";
- // area.style.overflow = "scroll";
-
- this.width = Math.round(size.width);
- this.height = Math.round(size.height);
-
- this.element = page;
- this.pagebox = pagebox;
- this.area = area;
- this.footnotesArea = footnotesArea;
-
- return page;
- }
-
- createWrapper() {
- let wrapper = document.createElement("div");
-
- this.area.appendChild(wrapper);
-
- this.wrapper = wrapper;
-
- return wrapper;
- }
-
- index(pgnum) {
- this.position = pgnum;
-
- let page = this.element;
- // let pagebox = this.pagebox;
-
- let index = pgnum + 1;
-
- let id = `page-${index}`;
-
- this.id = id;
-
- // page.dataset.pageNumber = index;
-
- page.dataset.pageNumber = index;
- page.setAttribute("id", id);
-
- if (this.name) {
- page.classList.add("pagedjs_" + this.name + "_page");
- }
-
- if (this.blank) {
- page.classList.add("pagedjs_blank_page");
- }
-
- if (pgnum === 0) {
- page.classList.add("pagedjs_first_page");
- }
-
- if (pgnum % 2 !== 1) {
- page.classList.remove("pagedjs_left_page");
- page.classList.add("pagedjs_right_page");
- } else {
- page.classList.remove("pagedjs_right_page");
- page.classList.add("pagedjs_left_page");
- }
- }
-
- /*
- size(width, height) {
- if (width === this.width && height === this.height) {
- return;
- }
- this.width = width;
- this.height = height;
-
- this.element.style.width = Math.round(width) + "px";
- this.element.style.height = Math.round(height) + "px";
- this.element.style.columnWidth = Math.round(width) + "px";
- }
- */
-
- async layout(contents, breakToken, maxChars) {
-
- this.clear();
-
- this.startToken = breakToken;
-
- let settings = this.settings;
- if (!settings.maxChars && maxChars) {
- settings.maxChars = maxChars;
- }
-
- this.layoutMethod = new Layout(this.area, this.hooks, settings);
-
- let renderResult = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
- let newBreakToken = renderResult.breakToken;
-
- this.addListeners(contents);
-
- this.endToken = newBreakToken;
-
- return newBreakToken;
- }
-
- async append(contents, breakToken) {
-
- if (!this.layoutMethod) {
- return this.layout(contents, breakToken);
- }
-
- let renderResult = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
- let newBreakToken = renderResult.breakToken;
-
- this.endToken = newBreakToken;
-
- return newBreakToken;
- }
-
- getByParent(ref, entries) {
- let e;
- for (var i = 0; i < entries.length; i++) {
- e = entries[i];
- if (e.dataset.ref === ref) {
- return e;
- }
- }
- }
-
- onOverflow(func) {
- this._onOverflow = func;
- }
-
- onUnderflow(func) {
- this._onUnderflow = func;
- }
-
- clear() {
- this.removeListeners();
- this.wrapper && this.wrapper.remove();
- this.createWrapper();
- }
-
- addListeners(contents) {
- if (typeof ResizeObserver !== "undefined") {
- this.addResizeObserver(contents);
- } else {
- this._checkOverflowAfterResize = this.checkOverflowAfterResize.bind(this, contents);
- this.element.addEventListener("overflow", this._checkOverflowAfterResize, false);
- this.element.addEventListener("underflow", this._checkOverflowAfterResize, false);
- }
- // TODO: fall back to mutation observer?
-
- this._onScroll = function () {
- if (this.listening) {
- this.element.scrollLeft = 0;
- }
- }.bind(this);
-
- // Keep scroll left from changing
- this.element.addEventListener("scroll", this._onScroll);
-
- this.listening = true;
-
- return true;
- }
-
- removeListeners() {
- this.listening = false;
-
- if (typeof ResizeObserver !== "undefined" && this.ro) {
- this.ro.disconnect();
- } else if (this.element) {
- this.element.removeEventListener("overflow", this._checkOverflowAfterResize, false);
- this.element.removeEventListener("underflow", this._checkOverflowAfterResize, false);
- }
-
- this.element && this.element.removeEventListener("scroll", this._onScroll);
-
- }
-
- addResizeObserver(contents) {
- let wrapper = this.wrapper;
- let prevHeight = wrapper.getBoundingClientRect().height;
- this.ro = new ResizeObserver(entries => {
-
- if (!this.listening) {
- return;
- }
- requestAnimationFrame(() => {
- for (let entry of entries) {
- const cr = entry.contentRect;
-
- if (cr.height > prevHeight) {
- this.checkOverflowAfterResize(contents);
- prevHeight = wrapper.getBoundingClientRect().height;
- } else if (cr.height < prevHeight) { // TODO: calc line height && (prevHeight - cr.height) >= 22
- this.checkUnderflowAfterResize(contents);
- prevHeight = cr.height;
- }
- }
- });
- });
-
- this.ro.observe(wrapper);
- }
-
- checkOverflowAfterResize(contents) {
- if (!this.listening || !this.layoutMethod) {
- return;
- }
-
- let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents, this.startToken);
-
- if (newBreakToken) {
- this.endToken = newBreakToken;
- this._onOverflow && this._onOverflow(newBreakToken);
- }
- }
-
- checkUnderflowAfterResize(contents) {
- if (!this.listening || !this.layoutMethod) {
- return;
- }
-
- let endToken = this.layoutMethod.findEndToken(this.wrapper, contents);
-
- if (endToken) {
- this._onUnderflow && this._onUnderflow(endToken);
- }
- }
-
-
- destroy() {
- this.removeListeners();
-
- this.element.remove();
-
- this.element = undefined;
- this.wrapper = undefined;
- }
- }
-
- EventEmitter(Page.prototype);
-
- /**
- * Render a flow of text offscreen
- * @class
- */
- class ContentParser {
-
- constructor(content, cb) {
- if (content && content.nodeType) {
- // handle dom
- this.dom = this.add(content);
- } else if (typeof content === "string") {
- this.dom = this.parse(content);
- }
-
- return this.dom;
- }
-
- parse(markup, mime) {
- let range = document.createRange();
- let fragment = range.createContextualFragment(markup);
-
- this.addRefs(fragment);
-
- return fragment;
- }
-
- add(contents) {
- // let fragment = document.createDocumentFragment();
- //
- // let children = [...contents.childNodes];
- // for (let child of children) {
- // let clone = child.cloneNode(true);
- // fragment.appendChild(clone);
- // }
-
- this.addRefs(contents);
-
- return contents;
- }
-
- addRefs(content) {
- var treeWalker = document.createTreeWalker(
- content,
- NodeFilter.SHOW_ELEMENT,
- null,
- false
- );
-
- let node = treeWalker.nextNode();
- while(node) {
-
- if (!node.hasAttribute("data-ref")) {
- let uuid = UUID();
- node.setAttribute("data-ref", uuid);
- }
-
- if (node.id) {
- node.setAttribute("data-id", node.id);
- }
-
- // node.setAttribute("data-children", node.childNodes.length);
-
- // node.setAttribute("data-text", node.textContent.trim().length);
- node = treeWalker.nextNode();
- }
- }
-
- find(ref) {
- return this.refs[ref];
- }
-
- destroy() {
- this.refs = undefined;
- this.dom = undefined;
- }
- }
-
- /**
- * Queue for handling tasks one at a time
- * @class
- * @param {scope} context what this will resolve to in the tasks
- */
- class Queue {
- constructor(context){
- this._q = [];
- this.context = context;
- this.tick = requestAnimationFrame;
- this.running = false;
- this.paused = false;
- }
-
- /**
- * Add an item to the queue
- * @return {Promise} enqueued
- */
- enqueue() {
- var deferred, promise;
- var queued;
- var task = [].shift.call(arguments);
- var args = arguments;
-
- // Handle single args without context
- // if(args && !Array.isArray(args)) {
- // args = [args];
- // }
- if(!task) {
- throw new Error("No Task Provided");
- }
-
- if(typeof task === "function"){
-
- deferred = new defer();
- promise = deferred.promise;
-
- queued = {
- "task" : task,
- "args" : args,
- //"context" : context,
- "deferred" : deferred,
- "promise" : promise
- };
-
- } else {
- // Task is a promise
- queued = {
- "promise" : task
- };
-
- }
-
- this._q.push(queued);
-
- // Wait to start queue flush
- if (this.paused == false && !this.running) {
- this.run();
- }
-
- return queued.promise;
- }
-
- /**
- * Run one item
- * @return {Promise} dequeued
- */
- dequeue(){
- var inwait, task, result;
-
- if(this._q.length && !this.paused) {
- inwait = this._q.shift();
- task = inwait.task;
- if(task){
- // console.log(task)
-
- result = task.apply(this.context, inwait.args);
-
- if(result && typeof result["then"] === "function") {
- // Task is a function that returns a promise
- return result.then(function(){
- inwait.deferred.resolve.apply(this.context, arguments);
- }.bind(this), function() {
- inwait.deferred.reject.apply(this.context, arguments);
- }.bind(this));
- } else {
- // Task resolves immediately
- inwait.deferred.resolve.apply(this.context, result);
- return inwait.promise;
- }
-
-
-
- } else if(inwait.promise) {
- // Task is a promise
- return inwait.promise;
- }
-
- } else {
- inwait = new defer();
- inwait.deferred.resolve();
- return inwait.promise;
- }
-
- }
-
- // Run All Immediately
- dump(){
- while(this._q.length) {
- this.dequeue();
- }
- }
-
- /**
- * Run all tasks sequentially, at convince
- * @return {Promise} all run
- */
- run(){
-
- if(!this.running){
- this.running = true;
- this.defered = new defer();
- }
-
- this.tick.call(window, () => {
-
- if(this._q.length) {
-
- this.dequeue()
- .then(function(){
- this.run();
- }.bind(this));
-
- } else {
- this.defered.resolve();
- this.running = undefined;
- }
-
- });
-
- // Unpause
- if(this.paused == true) {
- this.paused = false;
- }
-
- return this.defered.promise;
- }
-
- /**
- * Flush all, as quickly as possible
- * @return {Promise} ran
- */
- flush(){
-
- if(this.running){
- return this.running;
- }
-
- if(this._q.length) {
- this.running = this.dequeue()
- .then(function(){
- this.running = undefined;
- return this.flush();
- }.bind(this));
-
- return this.running;
- }
-
- }
-
- /**
- * Clear all items in wait
- * @return {void}
- */
- clear(){
- this._q = [];
- }
-
- /**
- * Get the number of tasks in the queue
- * @return {number} tasks
- */
- length(){
- return this._q.length;
- }
-
- /**
- * Pause a running queue
- * @return {void}
- */
- pause(){
- this.paused = true;
- }
-
- /**
- * End the queue
- * @return {void}
- */
- stop(){
- this._q = [];
- this.running = false;
- this.paused = true;
- }
- }
-
- const TEMPLATE = `
-`;
-
- /**
- * Chop up text into flows
- * @class
- */
- class Chunker {
- constructor(content, renderTo, options) {
- // this.preview = preview;
-
- this.settings = options || {};
-
- this.hooks = {};
- this.hooks.beforeParsed = new Hook(this);
- this.hooks.filter = new Hook(this);
- this.hooks.afterParsed = new Hook(this);
- this.hooks.beforePageLayout = new Hook(this);
- this.hooks.layout = new Hook(this);
- this.hooks.renderNode = new Hook(this);
- this.hooks.layoutNode = new Hook(this);
- this.hooks.onOverflow = new Hook(this);
- this.hooks.afterOverflowRemoved = new Hook(this);
- this.hooks.onBreakToken = new Hook();
- this.hooks.afterPageLayout = new Hook(this);
- this.hooks.finalizePage = new Hook(this);
- this.hooks.afterRendered = new Hook(this);
-
- this.pages = [];
- this.total = 0;
-
- this.q = new Queue(this);
- this.stopped = false;
- this.rendered = false;
-
- this.content = content;
-
- this.charsPerBreak = [];
- this.maxChars;
-
- if (content) {
- this.flow(content, renderTo);
- }
- }
-
- setup(renderTo) {
- this.pagesArea = document.createElement("div");
- this.pagesArea.classList.add("pagedjs_pages");
-
- if (renderTo) {
- renderTo.appendChild(this.pagesArea);
- } else {
- document.querySelector("body").appendChild(this.pagesArea);
- }
-
- this.pageTemplate = document.createElement("template");
- this.pageTemplate.innerHTML = TEMPLATE;
-
- }
-
- async flow(content, renderTo) {
- let parsed;
-
- await this.hooks.beforeParsed.trigger(content, this);
-
- parsed = new ContentParser(content);
-
- this.hooks.filter.triggerSync(parsed);
-
- this.source = parsed;
- this.breakToken = undefined;
-
- if (this.pagesArea && this.pageTemplate) {
- this.q.clear();
- this.removePages();
- } else {
- this.setup(renderTo);
- }
-
- this.emit("rendering", parsed);
-
- await this.hooks.afterParsed.trigger(parsed, this);
-
- await this.loadFonts();
-
- let rendered = await this.render(parsed, this.breakToken);
- while (rendered.canceled) {
- this.start();
- rendered = await this.render(parsed, this.breakToken);
- }
-
- this.rendered = true;
- this.pagesArea.style.setProperty("--pagedjs-page-count", this.total);
-
- await this.hooks.afterRendered.trigger(this.pages, this);
-
- this.emit("rendered", this.pages);
-
-
-
- return this;
- }
-
- // oversetPages() {
- // let overset = [];
- // for (let i = 0; i < this.pages.length; i++) {
- // let page = this.pages[i];
- // if (page.overset) {
- // overset.push(page);
- // // page.overset = false;
- // }
- // }
- // return overset;
- // }
- //
- // async handleOverset(parsed) {
- // let overset = this.oversetPages();
- // if (overset.length) {
- // console.log("overset", overset);
- // let index = this.pages.indexOf(overset[0]) + 1;
- // console.log("INDEX", index);
- //
- // // Remove pages
- // // this.removePages(index);
- //
- // // await this.render(parsed, overset[0].overset);
- //
- // // return this.handleOverset(parsed);
- // }
- // }
-
- async render(parsed, startAt) {
- let renderer = this.layout(parsed, startAt);
-
- let done = false;
- let result;
- while (!done) {
- result = await this.q.enqueue(() => { return this.renderAsync(renderer); });
- done = result.done;
- }
-
- return result;
- }
-
- start() {
- this.rendered = false;
- this.stopped = false;
- }
-
- stop() {
- this.stopped = true;
- // this.q.clear();
- }
-
- renderOnIdle(renderer) {
- return new Promise(resolve => {
- requestIdleCallback(async () => {
- if (this.stopped) {
- return resolve({ done: true, canceled: true });
- }
- let result = await renderer.next();
- if (this.stopped) {
- resolve({ done: true, canceled: true });
- } else {
- resolve(result);
- }
- });
- });
- }
-
- async renderAsync(renderer) {
- if (this.stopped) {
- return { done: true, canceled: true };
- }
- let result = await renderer.next();
- if (this.stopped) {
- return { done: true, canceled: true };
- } else {
- return result;
- }
- }
-
- async handleBreaks(node, force) {
- let currentPage = this.total + 1;
- let currentPosition = currentPage % 2 === 0 ? "left" : "right";
- // TODO: Recto and Verso should reverse for rtl languages
- let currentSide = currentPage % 2 === 0 ? "verso" : "recto";
- let previousBreakAfter;
- let breakBefore;
- let page;
-
- if (currentPage === 1) {
- return;
- }
-
- if (node &&
- typeof node.dataset !== "undefined" &&
- typeof node.dataset.previousBreakAfter !== "undefined") {
- previousBreakAfter = node.dataset.previousBreakAfter;
- }
-
- if (node &&
- typeof node.dataset !== "undefined" &&
- typeof node.dataset.breakBefore !== "undefined") {
- breakBefore = node.dataset.breakBefore;
- }
-
- if (force) {
- page = this.addPage(true);
- } else if( previousBreakAfter &&
- (previousBreakAfter === "left" || previousBreakAfter === "right") &&
- previousBreakAfter !== currentPosition) {
- page = this.addPage(true);
- } else if( previousBreakAfter &&
- (previousBreakAfter === "verso" || previousBreakAfter === "recto") &&
- previousBreakAfter !== currentSide) {
- page = this.addPage(true);
- } else if( breakBefore &&
- (breakBefore === "left" || breakBefore === "right") &&
- breakBefore !== currentPosition) {
- page = this.addPage(true);
- } else if( breakBefore &&
- (breakBefore === "verso" || breakBefore === "recto") &&
- breakBefore !== currentSide) {
- page = this.addPage(true);
- }
-
- if (page) {
- await this.hooks.beforePageLayout.trigger(page, undefined, undefined, this);
- this.emit("page", page);
- // await this.hooks.layout.trigger(page.element, page, undefined, this);
- await this.hooks.afterPageLayout.trigger(page.element, page, undefined, this);
- await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
- this.emit("renderedPage", page);
- }
- }
-
- async *layout(content, startAt) {
- let breakToken = startAt || false;
- let tokens = [];
-
- while (breakToken !== undefined && (true)) {
-
- if (breakToken && breakToken.node) {
- await this.handleBreaks(breakToken.node);
- } else {
- await this.handleBreaks(content.firstChild);
- }
-
- let page = this.addPage();
-
- await this.hooks.beforePageLayout.trigger(page, content, breakToken, this);
- this.emit("page", page);
-
- // Layout content in the page, starting from the breakToken
- breakToken = await page.layout(content, breakToken, this.maxChars);
-
- if (breakToken) {
- let newToken = breakToken.toJSON(true);
- if (tokens.lastIndexOf(newToken) > -1) {
- // loop
- let err = new OverflowContentError("Layout repeated", [breakToken.node]);
- console.error("Layout repeated at: ", breakToken.node);
- return err;
- } else {
- tokens.push(newToken);
- }
- }
-
- await this.hooks.afterPageLayout.trigger(page.element, page, breakToken, this);
- await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
- this.emit("renderedPage", page);
-
- this.recoredCharLength(page.wrapper.textContent.length);
-
- yield breakToken;
-
- // Stop if we get undefined, showing we have reached the end of the content
- }
-
-
- }
-
- recoredCharLength(length) {
- if (length === 0) {
- return;
- }
-
- this.charsPerBreak.push(length);
-
- // Keep the length of the last few breaks
- if (this.charsPerBreak.length > 4) {
- this.charsPerBreak.shift();
- }
-
- this.maxChars = this.charsPerBreak.reduce((a, b) => a + b, 0) / (this.charsPerBreak.length);
- }
-
- removePages(fromIndex=0) {
-
- if (fromIndex >= this.pages.length) {
- return;
- }
-
- // Remove pages
- for (let i = fromIndex; i < this.pages.length; i++) {
- this.pages[i].destroy();
- }
-
- if (fromIndex > 0) {
- this.pages.splice(fromIndex);
- } else {
- this.pages = [];
- }
-
- this.total = this.pages.length;
- }
-
- addPage(blank) {
- let lastPage = this.pages[this.pages.length - 1];
- // Create a new page from the template
- let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks, this.settings);
-
- this.pages.push(page);
-
- // Create the pages
- page.create(undefined, lastPage && lastPage.element);
-
- page.index(this.total);
-
- if (!blank) {
- // Listen for page overflow
- page.onOverflow((overflowToken) => {
- console.warn("overflow on", page.id, overflowToken);
-
- // Only reflow while rendering
- if (this.rendered) {
- return;
- }
-
- let index = this.pages.indexOf(page) + 1;
-
- // Stop the rendering
- this.stop();
-
- // Set the breakToken to resume at
- this.breakToken = overflowToken;
-
- // Remove pages
- this.removePages(index);
-
- if (this.rendered === true) {
- this.rendered = false;
-
- this.q.enqueue(async () => {
-
- this.start();
-
- await this.render(this.source, this.breakToken);
-
- this.rendered = true;
-
- });
- }
-
-
- });
-
- page.onUnderflow((overflowToken) => {
- // console.log("underflow on", page.id, overflowToken);
-
- // page.append(this.source, overflowToken);
-
- });
- }
-
- this.total = this.pages.length;
-
- return page;
- }
- /*
- insertPage(index, blank) {
- let lastPage = this.pages[index];
- // Create a new page from the template
- let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks);
-
- let total = this.pages.splice(index, 0, page);
-
- // Create the pages
- page.create(undefined, lastPage && lastPage.element);
-
- page.index(index + 1);
-
- for (let i = index + 2; i < this.pages.length; i++) {
- this.pages[i].index(i);
- }
-
- if (!blank) {
- // Listen for page overflow
- page.onOverflow((overflowToken) => {
- if (total < this.pages.length) {
- this.pages[total].layout(this.source, overflowToken);
- } else {
- let newPage = this.addPage();
- newPage.layout(this.source, overflowToken);
- }
- });
-
- page.onUnderflow(() => {
- // console.log("underflow on", page.id);
- });
- }
-
- this.total += 1;
-
- return page;
- }
- */
-
- async clonePage(originalPage) {
- let lastPage = this.pages[this.pages.length - 1];
-
- let page = new Page(this.pagesArea, this.pageTemplate, false, this.hooks);
-
- this.pages.push(page);
-
- // Create the pages
- page.create(undefined, lastPage && lastPage.element);
-
- page.index(this.total);
-
- await this.hooks.beforePageLayout.trigger(page, undefined, undefined, this);
- this.emit("page", page);
-
- for (const className of originalPage.element.classList) {
- if (className !== "pagedjs_left_page" && className !== "pagedjs_right_page") {
- page.element.classList.add(className);
- }
- }
-
- await this.hooks.afterPageLayout.trigger(page.element, page, undefined, this);
- await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
- this.emit("renderedPage", page);
- }
-
- loadFonts() {
- let fontPromises = [];
- (document.fonts || []).forEach((fontFace) => {
- if (fontFace.status !== "loaded") {
- let fontLoaded = fontFace.load().then((r) => {
- return fontFace.family;
- }, (r) => {
- console.warn("Failed to preload font-family:", fontFace.family);
- return fontFace.family;
- });
- fontPromises.push(fontLoaded);
- }
- });
- return Promise.all(fontPromises).catch((err) => {
- console.warn(err);
- });
- }
-
- destroy() {
- this.pagesArea.remove();
- this.pageTemplate.remove();
- }
-
- }
-
- EventEmitter(Chunker.prototype);
-
- var syntax = {exports: {}};
-
- var create$5 = {};
-
- //
- // list
- // ┌──────┐
- // ┌──────────────┼─head │
- // │ │ tail─┼──────────────┐
- // │ └──────┘ │
- // ▼ ▼
- // item item item item
- // ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐
- // null ◀──┼─prev │◀───┼─prev │◀───┼─prev │◀───┼─prev │
- // │ next─┼───▶│ next─┼───▶│ next─┼───▶│ next─┼──▶ null
- // ├──────┤ ├──────┤ ├──────┤ ├──────┤
- // │ data │ │ data │ │ data │ │ data │
- // └──────┘ └──────┘ └──────┘ └──────┘
- //
-
- function createItem(data) {
- return {
- prev: null,
- next: null,
- data: data
- };
- }
-
- function allocateCursor(node, prev, next) {
- var cursor;
-
- if (cursors !== null) {
- cursor = cursors;
- cursors = cursors.cursor;
- cursor.prev = prev;
- cursor.next = next;
- cursor.cursor = node.cursor;
- } else {
- cursor = {
- prev: prev,
- next: next,
- cursor: node.cursor
- };
- }
-
- node.cursor = cursor;
-
- return cursor;
- }
-
- function releaseCursor(node) {
- var cursor = node.cursor;
-
- node.cursor = cursor.cursor;
- cursor.prev = null;
- cursor.next = null;
- cursor.cursor = cursors;
- cursors = cursor;
- }
-
- var cursors = null;
- var List$6 = function() {
- this.cursor = null;
- this.head = null;
- this.tail = null;
- };
-
- List$6.createItem = createItem;
- List$6.prototype.createItem = createItem;
-
- List$6.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
- var cursor = this.cursor;
-
- while (cursor !== null) {
- if (cursor.prev === prevOld) {
- cursor.prev = prevNew;
- }
-
- if (cursor.next === nextOld) {
- cursor.next = nextNew;
- }
-
- cursor = cursor.cursor;
- }
- };
-
- List$6.prototype.getSize = function() {
- var size = 0;
- var cursor = this.head;
-
- while (cursor) {
- size++;
- cursor = cursor.next;
- }
-
- return size;
- };
-
- List$6.prototype.fromArray = function(array) {
- var cursor = null;
-
- this.head = null;
-
- for (var i = 0; i < array.length; i++) {
- var item = createItem(array[i]);
-
- if (cursor !== null) {
- cursor.next = item;
- } else {
- this.head = item;
- }
-
- item.prev = cursor;
- cursor = item;
- }
-
- this.tail = cursor;
-
- return this;
- };
-
- List$6.prototype.toArray = function() {
- var cursor = this.head;
- var result = [];
-
- while (cursor) {
- result.push(cursor.data);
- cursor = cursor.next;
- }
-
- return result;
- };
-
- List$6.prototype.toJSON = List$6.prototype.toArray;
-
- List$6.prototype.isEmpty = function() {
- return this.head === null;
- };
-
- List$6.prototype.first = function() {
- return this.head && this.head.data;
- };
-
- List$6.prototype.last = function() {
- return this.tail && this.tail.data;
- };
-
- List$6.prototype.each = function(fn, context) {
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, null, this.head);
-
- while (cursor.next !== null) {
- item = cursor.next;
- cursor.next = item.next;
-
- fn.call(context, item.data, item, this);
- }
-
- // pop cursor
- releaseCursor(this);
- };
-
- List$6.prototype.forEach = List$6.prototype.each;
-
- List$6.prototype.eachRight = function(fn, context) {
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, this.tail, null);
-
- while (cursor.prev !== null) {
- item = cursor.prev;
- cursor.prev = item.prev;
-
- fn.call(context, item.data, item, this);
- }
-
- // pop cursor
- releaseCursor(this);
- };
-
- List$6.prototype.forEachRight = List$6.prototype.eachRight;
-
- List$6.prototype.reduce = function(fn, initialValue, context) {
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, null, this.head);
- var acc = initialValue;
-
- while (cursor.next !== null) {
- item = cursor.next;
- cursor.next = item.next;
-
- acc = fn.call(context, acc, item.data, item, this);
- }
-
- // pop cursor
- releaseCursor(this);
-
- return acc;
- };
-
- List$6.prototype.reduceRight = function(fn, initialValue, context) {
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, this.tail, null);
- var acc = initialValue;
-
- while (cursor.prev !== null) {
- item = cursor.prev;
- cursor.prev = item.prev;
-
- acc = fn.call(context, acc, item.data, item, this);
- }
-
- // pop cursor
- releaseCursor(this);
-
- return acc;
- };
-
- List$6.prototype.nextUntil = function(start, fn, context) {
- if (start === null) {
- return;
- }
-
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, null, start);
-
- while (cursor.next !== null) {
- item = cursor.next;
- cursor.next = item.next;
-
- if (fn.call(context, item.data, item, this)) {
- break;
- }
- }
-
- // pop cursor
- releaseCursor(this);
- };
-
- List$6.prototype.prevUntil = function(start, fn, context) {
- if (start === null) {
- return;
- }
-
- var item;
-
- if (context === undefined) {
- context = this;
- }
-
- // push cursor
- var cursor = allocateCursor(this, start, null);
-
- while (cursor.prev !== null) {
- item = cursor.prev;
- cursor.prev = item.prev;
-
- if (fn.call(context, item.data, item, this)) {
- break;
- }
- }
-
- // pop cursor
- releaseCursor(this);
- };
-
- List$6.prototype.some = function(fn, context) {
- var cursor = this.head;
-
- if (context === undefined) {
- context = this;
- }
-
- while (cursor !== null) {
- if (fn.call(context, cursor.data, cursor, this)) {
- return true;
- }
-
- cursor = cursor.next;
- }
-
- return false;
- };
-
- List$6.prototype.map = function(fn, context) {
- var result = new List$6();
- var cursor = this.head;
-
- if (context === undefined) {
- context = this;
- }
-
- while (cursor !== null) {
- result.appendData(fn.call(context, cursor.data, cursor, this));
- cursor = cursor.next;
- }
-
- return result;
- };
-
- List$6.prototype.filter = function(fn, context) {
- var result = new List$6();
- var cursor = this.head;
-
- if (context === undefined) {
- context = this;
- }
-
- while (cursor !== null) {
- if (fn.call(context, cursor.data, cursor, this)) {
- result.appendData(cursor.data);
- }
- cursor = cursor.next;
- }
-
- return result;
- };
-
- List$6.prototype.clear = function() {
- this.head = null;
- this.tail = null;
- };
-
- List$6.prototype.copy = function() {
- var result = new List$6();
- var cursor = this.head;
-
- while (cursor !== null) {
- result.insert(createItem(cursor.data));
- cursor = cursor.next;
- }
-
- return result;
- };
-
- List$6.prototype.prepend = function(item) {
- // head
- // ^
- // item
- this.updateCursors(null, item, this.head, item);
-
- // insert to the beginning of the list
- if (this.head !== null) {
- // new item <- first item
- this.head.prev = item;
-
- // new item -> first item
- item.next = this.head;
- } else {
- // if list has no head, then it also has no tail
- // in this case tail points to the new item
- this.tail = item;
- }
-
- // head always points to new item
- this.head = item;
-
- return this;
- };
-
- List$6.prototype.prependData = function(data) {
- return this.prepend(createItem(data));
- };
-
- List$6.prototype.append = function(item) {
- return this.insert(item);
- };
-
- List$6.prototype.appendData = function(data) {
- return this.insert(createItem(data));
- };
-
- List$6.prototype.insert = function(item, before) {
- if (before !== undefined && before !== null) {
- // prev before
- // ^
- // item
- this.updateCursors(before.prev, item, before, item);
-
- if (before.prev === null) {
- // insert to the beginning of list
- if (this.head !== before) {
- throw new Error('before doesn\'t belong to list');
- }
-
- // since head points to before therefore list doesn't empty
- // no need to check tail
- this.head = item;
- before.prev = item;
- item.next = before;
-
- this.updateCursors(null, item);
- } else {
-
- // insert between two items
- before.prev.next = item;
- item.prev = before.prev;
-
- before.prev = item;
- item.next = before;
- }
- } else {
- // tail
- // ^
- // item
- this.updateCursors(this.tail, item, null, item);
-
- // insert to the ending of the list
- if (this.tail !== null) {
- // last item -> new item
- this.tail.next = item;
-
- // last item <- new item
- item.prev = this.tail;
- } else {
- // if list has no tail, then it also has no head
- // in this case head points to new item
- this.head = item;
- }
-
- // tail always points to new item
- this.tail = item;
- }
-
- return this;
- };
-
- List$6.prototype.insertData = function(data, before) {
- return this.insert(createItem(data), before);
- };
-
- List$6.prototype.remove = function(item) {
- // item
- // ^
- // prev next
- this.updateCursors(item, item.prev, item, item.next);
-
- if (item.prev !== null) {
- item.prev.next = item.next;
- } else {
- if (this.head !== item) {
- throw new Error('item doesn\'t belong to list');
- }
-
- this.head = item.next;
- }
-
- if (item.next !== null) {
- item.next.prev = item.prev;
- } else {
- if (this.tail !== item) {
- throw new Error('item doesn\'t belong to list');
- }
-
- this.tail = item.prev;
- }
-
- item.prev = null;
- item.next = null;
-
- return item;
- };
-
- List$6.prototype.push = function(data) {
- this.insert(createItem(data));
- };
-
- List$6.prototype.pop = function() {
- if (this.tail !== null) {
- return this.remove(this.tail);
- }
- };
-
- List$6.prototype.unshift = function(data) {
- this.prepend(createItem(data));
- };
-
- List$6.prototype.shift = function() {
- if (this.head !== null) {
- return this.remove(this.head);
- }
- };
-
- List$6.prototype.prependList = function(list) {
- return this.insertList(list, this.head);
- };
-
- List$6.prototype.appendList = function(list) {
- return this.insertList(list);
- };
-
- List$6.prototype.insertList = function(list, before) {
- // ignore empty lists
- if (list.head === null) {
- return this;
- }
-
- if (before !== undefined && before !== null) {
- this.updateCursors(before.prev, list.tail, before, list.head);
-
- // insert in the middle of dist list
- if (before.prev !== null) {
- // before.prev <-> list.head
- before.prev.next = list.head;
- list.head.prev = before.prev;
- } else {
- this.head = list.head;
- }
-
- before.prev = list.tail;
- list.tail.next = before;
- } else {
- this.updateCursors(this.tail, list.tail, null, list.head);
-
- // insert to end of the list
- if (this.tail !== null) {
- // if destination list has a tail, then it also has a head,
- // but head doesn't change
-
- // dest tail -> source head
- this.tail.next = list.head;
-
- // dest tail <- source head
- list.head.prev = this.tail;
- } else {
- // if list has no a tail, then it also has no a head
- // in this case points head to new item
- this.head = list.head;
- }
-
- // tail always start point to new item
- this.tail = list.tail;
- }
-
- list.head = null;
- list.tail = null;
-
- return this;
- };
-
- List$6.prototype.replace = function(oldItem, newItemOrList) {
- if ('head' in newItemOrList) {
- this.insertList(newItemOrList, oldItem);
- } else {
- this.insert(newItemOrList, oldItem);
- }
-
- this.remove(oldItem);
- };
-
- var List_1 = List$6;
-
- var createCustomError$3 = function createCustomError(name, message) {
- // use Object.create(), because some VMs prevent setting line/column otherwise
- // (iOS Safari 10 even throws an exception)
- var error = Object.create(SyntaxError.prototype);
- var errorStack = new Error();
-
- error.name = name;
- error.message = message;
-
- Object.defineProperty(error, 'stack', {
- get: function() {
- return (errorStack.stack || '').replace(/^(.+\n){1,3}/, name + ': ' + message + '\n');
- }
- });
-
- return error;
- };
-
- var createCustomError$2 = createCustomError$3;
- var MAX_LINE_LENGTH = 100;
- var OFFSET_CORRECTION = 60;
- var TAB_REPLACEMENT = ' ';
-
- function sourceFragment(error, extraLines) {
- function processLines(start, end) {
- return lines.slice(start, end).map(function(line, idx) {
- var num = String(start + idx + 1);
-
- while (num.length < maxNumLength) {
- num = ' ' + num;
- }
-
- return num + ' |' + line;
- }).join('\n');
- }
-
- var lines = error.source.split(/\r\n?|\n|\f/);
- var line = error.line;
- var column = error.column;
- var startLine = Math.max(1, line - extraLines) - 1;
- var endLine = Math.min(line + extraLines, lines.length + 1);
- var maxNumLength = Math.max(4, String(endLine).length) + 1;
- var cutLeft = 0;
-
- // column correction according to replaced tab before column
- column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
-
- if (column > MAX_LINE_LENGTH) {
- cutLeft = column - OFFSET_CORRECTION + 3;
- column = OFFSET_CORRECTION - 2;
- }
-
- for (var i = startLine; i <= endLine; i++) {
- if (i >= 0 && i < lines.length) {
- lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
- lines[i] =
- (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
- lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
- (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
- }
- }
-
- return [
- processLines(startLine, line),
- new Array(column + maxNumLength + 2).join('-') + '^',
- processLines(line, endLine)
- ].filter(Boolean).join('\n');
- }
-
- var SyntaxError$4 = function(message, source, offset, line, column) {
- var error = createCustomError$2('SyntaxError', message);
-
- error.source = source;
- error.offset = offset;
- error.line = line;
- error.column = column;
-
- error.sourceFragment = function(extraLines) {
- return sourceFragment(error, isNaN(extraLines) ? 0 : extraLines);
- };
- Object.defineProperty(error, 'formattedMessage', {
- get: function() {
- return (
- 'Parse error: ' + error.message + '\n' +
- sourceFragment(error, 2)
- );
- }
- });
-
- // for backward capability
- error.parseError = {
- offset: offset,
- line: line,
- column: column
- };
-
- return error;
- };
-
- var _SyntaxError$1 = SyntaxError$4;
-
- // CSS Syntax Module Level 3
- // https://www.w3.org/TR/css-syntax-3/
- var TYPE$H = {
- EOF: 0, //
- Ident: 1, //
- Function: 2, //
- AtKeyword: 3, //
- Hash: 4, //
- String: 5, //
- BadString: 6, //
- Url: 7, //
- BadUrl: 8, //
- Delim: 9, //
- Number: 10, //
- Percentage: 11, //
- Dimension: 12, //
- WhiteSpace: 13, //
- CDO: 14, //
- CDC: 15, //
- Colon: 16, // :
- Semicolon: 17, // ;
- Comma: 18, // ,
- LeftSquareBracket: 19, // <[-token>
- RightSquareBracket: 20, // <]-token>
- LeftParenthesis: 21, // <(-token>
- RightParenthesis: 22, // <)-token>
- LeftCurlyBracket: 23, // <{-token>
- RightCurlyBracket: 24, // <}-token>
- Comment: 25
- };
-
- var NAME$3 = Object.keys(TYPE$H).reduce(function(result, key) {
- result[TYPE$H[key]] = key;
- return result;
- }, {});
-
- var _const = {
- TYPE: TYPE$H,
- NAME: NAME$3
- };
-
- var EOF$1 = 0;
-
- // https://drafts.csswg.org/css-syntax-3/
- // § 4.2. Definitions
-
- // digit
- // A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
- function isDigit$5(code) {
- return code >= 0x0030 && code <= 0x0039;
- }
-
- // hex digit
- // A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),
- // or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).
- function isHexDigit$4(code) {
- return (
- isDigit$5(code) || // 0 .. 9
- (code >= 0x0041 && code <= 0x0046) || // A .. F
- (code >= 0x0061 && code <= 0x0066) // a .. f
- );
- }
-
- // uppercase letter
- // A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).
- function isUppercaseLetter$1(code) {
- return code >= 0x0041 && code <= 0x005A;
- }
-
- // lowercase letter
- // A code point between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z).
- function isLowercaseLetter(code) {
- return code >= 0x0061 && code <= 0x007A;
- }
-
- // letter
- // An uppercase letter or a lowercase letter.
- function isLetter(code) {
- return isUppercaseLetter$1(code) || isLowercaseLetter(code);
- }
-
- // non-ASCII code point
- // A code point with a value equal to or greater than U+0080 .
- function isNonAscii(code) {
- return code >= 0x0080;
- }
-
- // name-start code point
- // A letter, a non-ASCII code point, or U+005F LOW LINE (_).
- function isNameStart(code) {
- return isLetter(code) || isNonAscii(code) || code === 0x005F;
- }
-
- // name code point
- // A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).
- function isName$2(code) {
- return isNameStart(code) || isDigit$5(code) || code === 0x002D;
- }
-
- // non-printable code point
- // A code point between U+0000 NULL and U+0008 BACKSPACE, or U+000B LINE TABULATION,
- // or a code point between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE, or U+007F DELETE.
- function isNonPrintable(code) {
- return (
- (code >= 0x0000 && code <= 0x0008) ||
- (code === 0x000B) ||
- (code >= 0x000E && code <= 0x001F) ||
- (code === 0x007F)
- );
- }
-
- // newline
- // U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,
- // as they are converted to U+000A LINE FEED during preprocessing.
- // TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED
- function isNewline$1(code) {
- return code === 0x000A || code === 0x000D || code === 0x000C;
- }
-
- // whitespace
- // A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.
- function isWhiteSpace$2(code) {
- return isNewline$1(code) || code === 0x0020 || code === 0x0009;
- }
-
- // § 4.3.8. Check if two code points are a valid escape
- function isValidEscape$2(first, second) {
- // If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
- if (first !== 0x005C) {
- return false;
- }
-
- // Otherwise, if the second code point is a newline or EOF, return false.
- if (isNewline$1(second) || second === EOF$1) {
- return false;
- }
-
- // Otherwise, return true.
- return true;
- }
-
- // § 4.3.9. Check if three code points would start an identifier
- function isIdentifierStart$2(first, second, third) {
- // Look at the first code point:
-
- // U+002D HYPHEN-MINUS
- if (first === 0x002D) {
- // If the second code point is a name-start code point or a U+002D HYPHEN-MINUS,
- // or the second and third code points are a valid escape, return true. Otherwise, return false.
- return (
- isNameStart(second) ||
- second === 0x002D ||
- isValidEscape$2(second, third)
- );
- }
-
- // name-start code point
- if (isNameStart(first)) {
- // Return true.
- return true;
- }
-
- // U+005C REVERSE SOLIDUS (\)
- if (first === 0x005C) {
- // If the first and second code points are a valid escape, return true. Otherwise, return false.
- return isValidEscape$2(first, second);
- }
-
- // anything else
- // Return false.
- return false;
- }
-
- // § 4.3.10. Check if three code points would start a number
- function isNumberStart$1(first, second, third) {
- // Look at the first code point:
-
- // U+002B PLUS SIGN (+)
- // U+002D HYPHEN-MINUS (-)
- if (first === 0x002B || first === 0x002D) {
- // If the second code point is a digit, return true.
- if (isDigit$5(second)) {
- return 2;
- }
-
- // Otherwise, if the second code point is a U+002E FULL STOP (.)
- // and the third code point is a digit, return true.
- // Otherwise, return false.
- return second === 0x002E && isDigit$5(third) ? 3 : 0;
- }
-
- // U+002E FULL STOP (.)
- if (first === 0x002E) {
- // If the second code point is a digit, return true. Otherwise, return false.
- return isDigit$5(second) ? 2 : 0;
- }
-
- // digit
- if (isDigit$5(first)) {
- // Return true.
- return 1;
- }
-
- // anything else
- // Return false.
- return 0;
- }
-
- //
- // Misc
- //
-
- // detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)
- function isBOM$2(code) {
- // UTF-16BE
- if (code === 0xFEFF) {
- return 1;
- }
-
- // UTF-16LE
- if (code === 0xFFFE) {
- return 1;
- }
-
- return 0;
- }
-
- // Fast code category
- //
- // https://drafts.csswg.org/css-syntax/#tokenizer-definitions
- // > non-ASCII code point
- // > A code point with a value equal to or greater than U+0080
- // > name-start code point
- // > A letter, a non-ASCII code point, or U+005F LOW LINE (_).
- // > name code point
- // > A name-start code point, a digit, or U+002D HYPHEN-MINUS (-)
- // That means only ASCII code points has a special meaning and we define a maps for 0..127 codes only
- var CATEGORY = new Array(0x80);
- charCodeCategory$1.Eof = 0x80;
- charCodeCategory$1.WhiteSpace = 0x82;
- charCodeCategory$1.Digit = 0x83;
- charCodeCategory$1.NameStart = 0x84;
- charCodeCategory$1.NonPrintable = 0x85;
-
- for (var i = 0; i < CATEGORY.length; i++) {
- switch (true) {
- case isWhiteSpace$2(i):
- CATEGORY[i] = charCodeCategory$1.WhiteSpace;
- break;
-
- case isDigit$5(i):
- CATEGORY[i] = charCodeCategory$1.Digit;
- break;
-
- case isNameStart(i):
- CATEGORY[i] = charCodeCategory$1.NameStart;
- break;
-
- case isNonPrintable(i):
- CATEGORY[i] = charCodeCategory$1.NonPrintable;
- break;
-
- default:
- CATEGORY[i] = i || charCodeCategory$1.Eof;
- }
- }
-
- function charCodeCategory$1(code) {
- return code < 0x80 ? CATEGORY[code] : charCodeCategory$1.NameStart;
- }
- var charCodeDefinitions$1 = {
- isDigit: isDigit$5,
- isHexDigit: isHexDigit$4,
- isUppercaseLetter: isUppercaseLetter$1,
- isLowercaseLetter: isLowercaseLetter,
- isLetter: isLetter,
- isNonAscii: isNonAscii,
- isNameStart: isNameStart,
- isName: isName$2,
- isNonPrintable: isNonPrintable,
- isNewline: isNewline$1,
- isWhiteSpace: isWhiteSpace$2,
- isValidEscape: isValidEscape$2,
- isIdentifierStart: isIdentifierStart$2,
- isNumberStart: isNumberStart$1,
-
- isBOM: isBOM$2,
- charCodeCategory: charCodeCategory$1
- };
-
- var charCodeDef = charCodeDefinitions$1;
- var isDigit$4 = charCodeDef.isDigit;
- var isHexDigit$3 = charCodeDef.isHexDigit;
- var isUppercaseLetter = charCodeDef.isUppercaseLetter;
- var isName$1 = charCodeDef.isName;
- var isWhiteSpace$1 = charCodeDef.isWhiteSpace;
- var isValidEscape$1 = charCodeDef.isValidEscape;
-
- function getCharCode(source, offset) {
- return offset < source.length ? source.charCodeAt(offset) : 0;
- }
-
- function getNewlineLength$1(source, offset, code) {
- if (code === 13 /* \r */ && getCharCode(source, offset + 1) === 10 /* \n */) {
- return 2;
- }
-
- return 1;
- }
-
- function cmpChar$5(testStr, offset, referenceCode) {
- var code = testStr.charCodeAt(offset);
-
- // code.toLowerCase() for A..Z
- if (isUppercaseLetter(code)) {
- code = code | 32;
- }
-
- return code === referenceCode;
- }
-
- function cmpStr$6(testStr, start, end, referenceStr) {
- if (end - start !== referenceStr.length) {
- return false;
- }
-
- if (start < 0 || end > testStr.length) {
- return false;
- }
-
- for (var i = start; i < end; i++) {
- var testCode = testStr.charCodeAt(i);
- var referenceCode = referenceStr.charCodeAt(i - start);
-
- // testCode.toLowerCase() for A..Z
- if (isUppercaseLetter(testCode)) {
- testCode = testCode | 32;
- }
-
- if (testCode !== referenceCode) {
- return false;
- }
- }
-
- return true;
- }
-
- function findWhiteSpaceStart$1(source, offset) {
- for (; offset >= 0; offset--) {
- if (!isWhiteSpace$1(source.charCodeAt(offset))) {
- break;
- }
- }
-
- return offset + 1;
- }
-
- function findWhiteSpaceEnd$1(source, offset) {
- for (; offset < source.length; offset++) {
- if (!isWhiteSpace$1(source.charCodeAt(offset))) {
- break;
- }
- }
-
- return offset;
- }
-
- function findDecimalNumberEnd(source, offset) {
- for (; offset < source.length; offset++) {
- if (!isDigit$4(source.charCodeAt(offset))) {
- break;
- }
- }
-
- return offset;
- }
-
- // § 4.3.7. Consume an escaped code point
- function consumeEscaped$1(source, offset) {
- // It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and
- // that the next input code point has already been verified to be part of a valid escape.
- offset += 2;
-
- // hex digit
- if (isHexDigit$3(getCharCode(source, offset - 1))) {
- // Consume as many hex digits as possible, but no more than 5.
- // Note that this means 1-6 hex digits have been consumed in total.
- for (var maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {
- if (!isHexDigit$3(getCharCode(source, offset))) {
- break;
- }
- }
-
- // If the next input code point is whitespace, consume it as well.
- var code = getCharCode(source, offset);
- if (isWhiteSpace$1(code)) {
- offset += getNewlineLength$1(source, offset, code);
- }
- }
-
- return offset;
- }
-
- // §4.3.11. Consume a name
- // Note: This algorithm does not do the verification of the first few code points that are necessary
- // to ensure the returned code points would constitute an . If that is the intended use,
- // ensure that the stream starts with an identifier before calling this algorithm.
- function consumeName$1(source, offset) {
- // Let result initially be an empty string.
- // Repeatedly consume the next input code point from the stream:
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
-
- // name code point
- if (isName$1(code)) {
- // Append the code point to result.
- continue;
- }
-
- // the stream starts with a valid escape
- if (isValidEscape$1(code, getCharCode(source, offset + 1))) {
- // Consume an escaped code point. Append the returned code point to result.
- offset = consumeEscaped$1(source, offset) - 1;
- continue;
- }
-
- // anything else
- // Reconsume the current input code point. Return result.
- break;
- }
-
- return offset;
- }
-
- // §4.3.12. Consume a number
- function consumeNumber$5(source, offset) {
- var code = source.charCodeAt(offset);
-
- // 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),
- // consume it and append it to repr.
- if (code === 0x002B || code === 0x002D) {
- code = source.charCodeAt(offset += 1);
- }
-
- // 3. While the next input code point is a digit, consume it and append it to repr.
- if (isDigit$4(code)) {
- offset = findDecimalNumberEnd(source, offset + 1);
- code = source.charCodeAt(offset);
- }
-
- // 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
- if (code === 0x002E && isDigit$4(source.charCodeAt(offset + 1))) {
- // 4.1 Consume them.
- // 4.2 Append them to repr.
- code = source.charCodeAt(offset += 2);
-
- // 4.3 Set type to "number".
- // TODO
-
- // 4.4 While the next input code point is a digit, consume it and append it to repr.
-
- offset = findDecimalNumberEnd(source, offset);
- }
-
- // 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)
- // or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:
- if (cmpChar$5(source, offset, 101 /* e */)) {
- var sign = 0;
- code = source.charCodeAt(offset + 1);
-
- // ... optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+) ...
- if (code === 0x002D || code === 0x002B) {
- sign = 1;
- code = source.charCodeAt(offset + 2);
- }
-
- // ... followed by a digit
- if (isDigit$4(code)) {
- // 5.1 Consume them.
- // 5.2 Append them to repr.
-
- // 5.3 Set type to "number".
- // TODO
-
- // 5.4 While the next input code point is a digit, consume it and append it to repr.
- offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);
- }
- }
-
- return offset;
- }
-
- // § 4.3.14. Consume the remnants of a bad url
- // ... its sole use is to consume enough of the input stream to reach a recovery point
- // where normal tokenizing can resume.
- function consumeBadUrlRemnants$1(source, offset) {
- // Repeatedly consume the next input code point from the stream:
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
-
- // U+0029 RIGHT PARENTHESIS ())
- // EOF
- if (code === 0x0029) {
- // Return.
- offset++;
- break;
- }
-
- if (isValidEscape$1(code, getCharCode(source, offset + 1))) {
- // Consume an escaped code point.
- // Note: This allows an escaped right parenthesis ("\)") to be encountered
- // without ending the . This is otherwise identical to
- // the "anything else" clause.
- offset = consumeEscaped$1(source, offset);
- }
- }
-
- return offset;
- }
-
- var utils$2 = {
- consumeEscaped: consumeEscaped$1,
- consumeName: consumeName$1,
- consumeNumber: consumeNumber$5,
- consumeBadUrlRemnants: consumeBadUrlRemnants$1,
-
- cmpChar: cmpChar$5,
- cmpStr: cmpStr$6,
-
- getNewlineLength: getNewlineLength$1,
- findWhiteSpaceStart: findWhiteSpaceStart$1,
- findWhiteSpaceEnd: findWhiteSpaceEnd$1
- };
-
- var constants$2 = _const;
- var TYPE$G = constants$2.TYPE;
- var NAME$2 = constants$2.NAME;
-
- var utils$1 = utils$2;
- var cmpStr$5 = utils$1.cmpStr;
-
- var EOF = TYPE$G.EOF;
- var WHITESPACE$c = TYPE$G.WhiteSpace;
- var COMMENT$a = TYPE$G.Comment;
-
- var OFFSET_MASK$1 = 0x00FFFFFF;
- var TYPE_SHIFT$1 = 24;
-
- var TokenStream$4 = function() {
- this.offsetAndType = null;
- this.balance = null;
-
- this.reset();
- };
-
- TokenStream$4.prototype = {
- reset: function() {
- this.eof = false;
- this.tokenIndex = -1;
- this.tokenType = 0;
- this.tokenStart = this.firstCharOffset;
- this.tokenEnd = this.firstCharOffset;
- },
-
- lookupType: function(offset) {
- offset += this.tokenIndex;
-
- if (offset < this.tokenCount) {
- return this.offsetAndType[offset] >> TYPE_SHIFT$1;
- }
-
- return EOF;
- },
- lookupOffset: function(offset) {
- offset += this.tokenIndex;
-
- if (offset < this.tokenCount) {
- return this.offsetAndType[offset - 1] & OFFSET_MASK$1;
- }
-
- return this.source.length;
- },
- lookupValue: function(offset, referenceStr) {
- offset += this.tokenIndex;
-
- if (offset < this.tokenCount) {
- return cmpStr$5(
- this.source,
- this.offsetAndType[offset - 1] & OFFSET_MASK$1,
- this.offsetAndType[offset] & OFFSET_MASK$1,
- referenceStr
- );
- }
-
- return false;
- },
- getTokenStart: function(tokenIndex) {
- if (tokenIndex === this.tokenIndex) {
- return this.tokenStart;
- }
-
- if (tokenIndex > 0) {
- return tokenIndex < this.tokenCount
- ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK$1
- : this.offsetAndType[this.tokenCount] & OFFSET_MASK$1;
- }
-
- return this.firstCharOffset;
- },
-
- // TODO: -> skipUntilBalanced
- getRawLength: function(startToken, mode) {
- var cursor = startToken;
- var balanceEnd;
- var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK$1;
- var type;
-
- loop:
- for (; cursor < this.tokenCount; cursor++) {
- balanceEnd = this.balance[cursor];
-
- // stop scanning on balance edge that points to offset before start token
- if (balanceEnd < startToken) {
- break loop;
- }
-
- type = this.offsetAndType[cursor] >> TYPE_SHIFT$1;
-
- // check token is stop type
- switch (mode(type, this.source, offset)) {
- case 1:
- break loop;
-
- case 2:
- cursor++;
- break loop;
-
- default:
- // fast forward to the end of balanced block
- if (this.balance[balanceEnd] === cursor) {
- cursor = balanceEnd;
- }
-
- offset = this.offsetAndType[cursor] & OFFSET_MASK$1;
- }
- }
-
- return cursor - this.tokenIndex;
- },
- isBalanceEdge: function(pos) {
- return this.balance[this.tokenIndex] < pos;
- },
- isDelim: function(code, offset) {
- if (offset) {
- return (
- this.lookupType(offset) === TYPE$G.Delim &&
- this.source.charCodeAt(this.lookupOffset(offset)) === code
- );
- }
-
- return (
- this.tokenType === TYPE$G.Delim &&
- this.source.charCodeAt(this.tokenStart) === code
- );
- },
-
- getTokenValue: function() {
- return this.source.substring(this.tokenStart, this.tokenEnd);
- },
- getTokenLength: function() {
- return this.tokenEnd - this.tokenStart;
- },
- substrToCursor: function(start) {
- return this.source.substring(start, this.tokenStart);
- },
-
- skipWS: function() {
- for (var i = this.tokenIndex, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {
- if ((this.offsetAndType[i] >> TYPE_SHIFT$1) !== WHITESPACE$c) {
- break;
- }
- }
-
- if (skipTokenCount > 0) {
- this.skip(skipTokenCount);
- }
- },
- skipSC: function() {
- while (this.tokenType === WHITESPACE$c || this.tokenType === COMMENT$a) {
- this.next();
- }
- },
- skip: function(tokenCount) {
- var next = this.tokenIndex + tokenCount;
-
- if (next < this.tokenCount) {
- this.tokenIndex = next;
- this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK$1;
- next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT$1;
- this.tokenEnd = next & OFFSET_MASK$1;
- } else {
- this.tokenIndex = this.tokenCount;
- this.next();
- }
- },
- next: function() {
- var next = this.tokenIndex + 1;
-
- if (next < this.tokenCount) {
- this.tokenIndex = next;
- this.tokenStart = this.tokenEnd;
- next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT$1;
- this.tokenEnd = next & OFFSET_MASK$1;
- } else {
- this.tokenIndex = this.tokenCount;
- this.eof = true;
- this.tokenType = EOF;
- this.tokenStart = this.tokenEnd = this.source.length;
- }
- },
-
- forEachToken(fn) {
- for (var i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
- var start = offset;
- var item = this.offsetAndType[i];
- var end = item & OFFSET_MASK$1;
- var type = item >> TYPE_SHIFT$1;
-
- offset = end;
-
- fn(type, start, end, i);
- }
- },
-
- dump() {
- var tokens = new Array(this.tokenCount);
-
- this.forEachToken((type, start, end, index) => {
- tokens[index] = {
- idx: index,
- type: NAME$2[type],
- chunk: this.source.substring(start, end),
- balance: this.balance[index]
- };
- });
-
- return tokens;
- }
- };
-
- var TokenStream_1 = TokenStream$4;
-
- function noop$3(value) {
- return value;
- }
-
- function generateMultiplier(multiplier) {
- if (multiplier.min === 0 && multiplier.max === 0) {
- return '*';
- }
-
- if (multiplier.min === 0 && multiplier.max === 1) {
- return '?';
- }
-
- if (multiplier.min === 1 && multiplier.max === 0) {
- return multiplier.comma ? '#' : '+';
- }
-
- if (multiplier.min === 1 && multiplier.max === 1) {
- return '';
- }
-
- return (
- (multiplier.comma ? '#' : '') +
- (multiplier.min === multiplier.max
- ? '{' + multiplier.min + '}'
- : '{' + multiplier.min + ',' + (multiplier.max !== 0 ? multiplier.max : '') + '}'
- )
- );
- }
-
- function generateTypeOpts(node) {
- switch (node.type) {
- case 'Range':
- return (
- ' [' +
- (node.min === null ? '-∞' : node.min) +
- ',' +
- (node.max === null ? '∞' : node.max) +
- ']'
- );
-
- default:
- throw new Error('Unknown node type `' + node.type + '`');
- }
- }
-
- function generateSequence(node, decorate, forceBraces, compact) {
- var combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
- var result = node.terms.map(function(term) {
- return generate$2(term, decorate, forceBraces, compact);
- }).join(combinator);
-
- if (node.explicit || forceBraces) {
- result = (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
- }
-
- return result;
- }
-
- function generate$2(node, decorate, forceBraces, compact) {
- var result;
-
- switch (node.type) {
- case 'Group':
- result =
- generateSequence(node, decorate, forceBraces, compact) +
- (node.disallowEmpty ? '!' : '');
- break;
-
- case 'Multiplier':
- // return since node is a composition
- return (
- generate$2(node.term, decorate, forceBraces, compact) +
- decorate(generateMultiplier(node), node)
- );
-
- case 'Type':
- result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
- break;
-
- case 'Property':
- result = '<\'' + node.name + '\'>';
- break;
-
- case 'Keyword':
- result = node.name;
- break;
-
- case 'AtKeyword':
- result = '@' + node.name;
- break;
-
- case 'Function':
- result = node.name + '(';
- break;
-
- case 'String':
- case 'Token':
- result = node.value;
- break;
-
- case 'Comma':
- result = ',';
- break;
-
- default:
- throw new Error('Unknown node type `' + node.type + '`');
- }
-
- return decorate(result, node);
- }
-
- var generate_1 = function(node, options) {
- var decorate = noop$3;
- var forceBraces = false;
- var compact = false;
-
- if (typeof options === 'function') {
- decorate = options;
- } else if (options) {
- forceBraces = Boolean(options.forceBraces);
- compact = Boolean(options.compact);
- if (typeof options.decorate === 'function') {
- decorate = options.decorate;
- }
- }
-
- return generate$2(node, decorate, forceBraces, compact);
- };
-
- const createCustomError$1 = createCustomError$3;
- const generate$1 = generate_1;
- const defaultLoc = { offset: 0, line: 1, column: 1 };
-
- function locateMismatch(matchResult, node) {
- const tokens = matchResult.tokens;
- const longestMatch = matchResult.longestMatch;
- const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
- const badNode = mismatchNode !== node ? mismatchNode : null;
- let mismatchOffset = 0;
- let mismatchLength = 0;
- let entries = 0;
- let css = '';
- let start;
- let end;
-
- for (let i = 0; i < tokens.length; i++) {
- const token = tokens[i].value;
-
- if (i === longestMatch) {
- mismatchLength = token.length;
- mismatchOffset = css.length;
- }
-
- if (badNode !== null && tokens[i].node === badNode) {
- if (i <= longestMatch) {
- entries++;
- } else {
- entries = 0;
- }
- }
-
- css += token;
- }
-
- if (longestMatch === tokens.length || entries > 1) { // last
- start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
- end = buildLoc(start);
- } else {
- start = fromLoc(badNode, 'start') ||
- buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
- end = fromLoc(badNode, 'end') ||
- buildLoc(start, css.substr(mismatchOffset, mismatchLength));
- }
-
- return {
- css,
- mismatchOffset,
- mismatchLength,
- start,
- end
- };
- }
-
- function fromLoc(node, point) {
- const value = node && node.loc && node.loc[point];
-
- if (value) {
- return 'line' in value ? buildLoc(value) : value;
- }
-
- return null;
- }
-
- function buildLoc({ offset, line, column }, extra) {
- const loc = {
- offset,
- line,
- column
- };
-
- if (extra) {
- const lines = extra.split(/\n|\r\n?|\f/);
-
- loc.offset += extra.length;
- loc.line += lines.length - 1;
- loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
- }
-
- return loc;
- }
-
- const SyntaxReferenceError$1 = function(type, referenceName) {
- const error = createCustomError$1(
- 'SyntaxReferenceError',
- type + (referenceName ? ' `' + referenceName + '`' : '')
- );
-
- error.reference = referenceName;
-
- return error;
- };
-
- const SyntaxMatchError$1 = function(message, syntax, node, matchResult) {
- const error = createCustomError$1('SyntaxMatchError', message);
- const {
- css,
- mismatchOffset,
- mismatchLength,
- start,
- end
- } = locateMismatch(matchResult, node);
-
- error.rawMessage = message;
- error.syntax = syntax ? generate$1(syntax) : '';
- error.css = css;
- error.mismatchOffset = mismatchOffset;
- error.mismatchLength = mismatchLength;
- error.message = message + '\n' +
- ' syntax: ' + error.syntax + '\n' +
- ' value: ' + (css || '') + '\n' +
- ' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
-
- Object.assign(error, start);
- error.loc = {
- source: (node && node.loc && node.loc.source) || '',
- start,
- end
- };
-
- return error;
- };
-
- var error = {
- SyntaxReferenceError: SyntaxReferenceError$1,
- SyntaxMatchError: SyntaxMatchError$1
- };
-
- var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
- var keywords$1 = Object.create(null);
- var properties$1 = Object.create(null);
- var HYPHENMINUS$5 = 45; // '-'.charCodeAt()
-
- function isCustomProperty$1(str, offset) {
- offset = offset || 0;
-
- return str.length - offset >= 2 &&
- str.charCodeAt(offset) === HYPHENMINUS$5 &&
- str.charCodeAt(offset + 1) === HYPHENMINUS$5;
- }
-
- function getVendorPrefix(str, offset) {
- offset = offset || 0;
-
- // verdor prefix should be at least 3 chars length
- if (str.length - offset >= 3) {
- // vendor prefix starts with hyper minus following non-hyper minus
- if (str.charCodeAt(offset) === HYPHENMINUS$5 &&
- str.charCodeAt(offset + 1) !== HYPHENMINUS$5) {
- // vendor prefix should contain a hyper minus at the ending
- var secondDashIndex = str.indexOf('-', offset + 2);
-
- if (secondDashIndex !== -1) {
- return str.substring(offset, secondDashIndex + 1);
- }
- }
- }
-
- return '';
- }
-
- function getKeywordDescriptor(keyword) {
- if (hasOwnProperty$7.call(keywords$1, keyword)) {
- return keywords$1[keyword];
- }
-
- var name = keyword.toLowerCase();
-
- if (hasOwnProperty$7.call(keywords$1, name)) {
- return keywords$1[keyword] = keywords$1[name];
- }
-
- var custom = isCustomProperty$1(name, 0);
- var vendor = !custom ? getVendorPrefix(name, 0) : '';
-
- return keywords$1[keyword] = Object.freeze({
- basename: name.substr(vendor.length),
- name: name,
- vendor: vendor,
- prefix: vendor,
- custom: custom
- });
- }
-
- function getPropertyDescriptor(property) {
- if (hasOwnProperty$7.call(properties$1, property)) {
- return properties$1[property];
- }
-
- var name = property;
- var hack = property[0];
-
- if (hack === '/') {
- hack = property[1] === '/' ? '//' : '/';
- } else if (hack !== '_' &&
- hack !== '*' &&
- hack !== '$' &&
- hack !== '#' &&
- hack !== '+' &&
- hack !== '&') {
- hack = '';
- }
-
- var custom = isCustomProperty$1(name, hack.length);
-
- // re-use result when possible (the same as for lower case)
- if (!custom) {
- name = name.toLowerCase();
- if (hasOwnProperty$7.call(properties$1, name)) {
- return properties$1[property] = properties$1[name];
- }
- }
-
- var vendor = !custom ? getVendorPrefix(name, hack.length) : '';
- var prefix = name.substr(0, hack.length + vendor.length);
-
- return properties$1[property] = Object.freeze({
- basename: name.substr(prefix.length),
- name: name.substr(hack.length),
- hack: hack,
- vendor: vendor,
- prefix: prefix,
- custom: custom
- });
- }
-
- var names$2 = {
- keyword: getKeywordDescriptor,
- property: getPropertyDescriptor,
- isCustomProperty: isCustomProperty$1,
- vendorPrefix: getVendorPrefix
- };
-
- var MIN_SIZE = 16 * 1024;
- var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported
-
- var adoptBuffer$2 = function adoptBuffer(buffer, size) {
- if (buffer === null || buffer.length < size) {
- return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));
- }
-
- return buffer;
- };
-
- var TokenStream$3 = TokenStream_1;
- var adoptBuffer$1 = adoptBuffer$2;
-
- var constants$1 = _const;
- var TYPE$F = constants$1.TYPE;
-
- var charCodeDefinitions = charCodeDefinitions$1;
- var isNewline = charCodeDefinitions.isNewline;
- var isName = charCodeDefinitions.isName;
- var isValidEscape = charCodeDefinitions.isValidEscape;
- var isNumberStart = charCodeDefinitions.isNumberStart;
- var isIdentifierStart$1 = charCodeDefinitions.isIdentifierStart;
- var charCodeCategory = charCodeDefinitions.charCodeCategory;
- var isBOM$1 = charCodeDefinitions.isBOM;
-
- var utils = utils$2;
- var cmpStr$4 = utils.cmpStr;
- var getNewlineLength = utils.getNewlineLength;
- var findWhiteSpaceEnd = utils.findWhiteSpaceEnd;
- var consumeEscaped = utils.consumeEscaped;
- var consumeName = utils.consumeName;
- var consumeNumber$4 = utils.consumeNumber;
- var consumeBadUrlRemnants = utils.consumeBadUrlRemnants;
-
- var OFFSET_MASK = 0x00FFFFFF;
- var TYPE_SHIFT = 24;
-
- function tokenize$3(source, stream) {
- function getCharCode(offset) {
- return offset < sourceLength ? source.charCodeAt(offset) : 0;
- }
-
- // § 4.3.3. Consume a numeric token
- function consumeNumericToken() {
- // Consume a number and let number be the result.
- offset = consumeNumber$4(source, offset);
-
- // If the next 3 input code points would start an identifier, then:
- if (isIdentifierStart$1(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {
- // Create a with the same value and type flag as number, and a unit set initially to the empty string.
- // Consume a name. Set the ’s unit to the returned value.
- // Return the .
- type = TYPE$F.Dimension;
- offset = consumeName(source, offset);
- return;
- }
-
- // Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.
- if (getCharCode(offset) === 0x0025) {
- // Create a with the same value as number, and return it.
- type = TYPE$F.Percentage;
- offset++;
- return;
- }
-
- // Otherwise, create a with the same value and type flag as number, and return it.
- type = TYPE$F.Number;
- }
-
- // § 4.3.4. Consume an ident-like token
- function consumeIdentLikeToken() {
- const nameStartOffset = offset;
-
- // Consume a name, and let string be the result.
- offset = consumeName(source, offset);
-
- // If string’s value is an ASCII case-insensitive match for "url",
- // and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
- if (cmpStr$4(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
- // While the next two input code points are whitespace, consume the next input code point.
- offset = findWhiteSpaceEnd(source, offset + 1);
-
- // If the next one or two input code points are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('),
- // or whitespace followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('),
- // then create a with its value set to string and return it.
- if (getCharCode(offset) === 0x0022 ||
- getCharCode(offset) === 0x0027) {
- type = TYPE$F.Function;
- offset = nameStartOffset + 4;
- return;
- }
-
- // Otherwise, consume a url token, and return it.
- consumeUrlToken();
- return;
- }
-
- // Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
- // Create a with its value set to string and return it.
- if (getCharCode(offset) === 0x0028) {
- type = TYPE$F.Function;
- offset++;
- return;
- }
-
- // Otherwise, create an with its value set to string and return it.
- type = TYPE$F.Ident;
- }
-
- // § 4.3.5. Consume a string token
- function consumeStringToken(endingCodePoint) {
- // This algorithm may be called with an ending code point, which denotes the code point
- // that ends the string. If an ending code point is not specified,
- // the current input code point is used.
- if (!endingCodePoint) {
- endingCodePoint = getCharCode(offset++);
- }
-
- // Initially create a with its value set to the empty string.
- type = TYPE$F.String;
-
- // Repeatedly consume the next input code point from the stream:
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
-
- switch (charCodeCategory(code)) {
- // ending code point
- case endingCodePoint:
- // Return the .
- offset++;
- return;
-
- // EOF
- case charCodeCategory.Eof:
- // This is a parse error. Return the .
- return;
-
- // newline
- case charCodeCategory.WhiteSpace:
- if (isNewline(code)) {
- // This is a parse error. Reconsume the current input code point,
- // create a , and return it.
- offset += getNewlineLength(source, offset, code);
- type = TYPE$F.BadString;
- return;
- }
- break;
-
- // U+005C REVERSE SOLIDUS (\)
- case 0x005C:
- // If the next input code point is EOF, do nothing.
- if (offset === source.length - 1) {
- break;
- }
-
- var nextCode = getCharCode(offset + 1);
-
- // Otherwise, if the next input code point is a newline, consume it.
- if (isNewline(nextCode)) {
- offset += getNewlineLength(source, offset + 1, nextCode);
- } else if (isValidEscape(code, nextCode)) {
- // Otherwise, (the stream starts with a valid escape) consume
- // an escaped code point and append the returned code point to
- // the ’s value.
- offset = consumeEscaped(source, offset) - 1;
- }
- break;
-
- // anything else
- // Append the current input code point to the ’s value.
- }
- }
- }
-
- // § 4.3.6. Consume a url token
- // Note: This algorithm assumes that the initial "url(" has already been consumed.
- // This algorithm also assumes that it’s being called to consume an "unquoted" value, like url(foo).
- // A quoted value, like url("foo"), is parsed as a . Consume an ident-like token
- // automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.
- function consumeUrlToken() {
- // Initially create a with its value set to the empty string.
- type = TYPE$F.Url;
-
- // Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd(source, offset);
-
- // Repeatedly consume the next input code point from the stream:
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
-
- switch (charCodeCategory(code)) {
- // U+0029 RIGHT PARENTHESIS ())
- case 0x0029:
- // Return the .
- offset++;
- return;
-
- // EOF
- case charCodeCategory.Eof:
- // This is a parse error. Return the .
- return;
-
- // whitespace
- case charCodeCategory.WhiteSpace:
- // Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd(source, offset);
-
- // If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,
- // consume it and return the
- // (if EOF was encountered, this is a parse error);
- if (getCharCode(offset) === 0x0029 || offset >= source.length) {
- if (offset < source.length) {
- offset++;
- }
- return;
- }
-
- // otherwise, consume the remnants of a bad url, create a ,
- // and return it.
- offset = consumeBadUrlRemnants(source, offset);
- type = TYPE$F.BadUrl;
- return;
-
- // U+0022 QUOTATION MARK (")
- // U+0027 APOSTROPHE (')
- // U+0028 LEFT PARENTHESIS (()
- // non-printable code point
- case 0x0022:
- case 0x0027:
- case 0x0028:
- case charCodeCategory.NonPrintable:
- // This is a parse error. Consume the remnants of a bad url,
- // create a , and return it.
- offset = consumeBadUrlRemnants(source, offset);
- type = TYPE$F.BadUrl;
- return;
-
- // U+005C REVERSE SOLIDUS (\)
- case 0x005C:
- // If the stream starts with a valid escape, consume an escaped code point and
- // append the returned code point to the ’s value.
- if (isValidEscape(code, getCharCode(offset + 1))) {
- offset = consumeEscaped(source, offset) - 1;
- break;
- }
-
- // Otherwise, this is a parse error. Consume the remnants of a bad url,
- // create a , and return it.
- offset = consumeBadUrlRemnants(source, offset);
- type = TYPE$F.BadUrl;
- return;
-
- // anything else
- // Append the current input code point to the ’s value.
- }
- }
- }
-
- if (!stream) {
- stream = new TokenStream$3();
- }
-
- // ensure source is a string
- source = String(source || '');
-
- var sourceLength = source.length;
- var offsetAndType = adoptBuffer$1(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token
- var balance = adoptBuffer$1(stream.balance, sourceLength + 1);
- var tokenCount = 0;
- var start = isBOM$1(getCharCode(0));
- var offset = start;
- var balanceCloseType = 0;
- var balanceStart = 0;
- var balancePrev = 0;
-
- // https://drafts.csswg.org/css-syntax-3/#consume-token
- // § 4.3.1. Consume a token
- while (offset < sourceLength) {
- var code = source.charCodeAt(offset);
- var type = 0;
-
- balance[tokenCount] = sourceLength;
-
- switch (charCodeCategory(code)) {
- // whitespace
- case charCodeCategory.WhiteSpace:
- // Consume as much whitespace as possible. Return a .
- type = TYPE$F.WhiteSpace;
- offset = findWhiteSpaceEnd(source, offset + 1);
- break;
-
- // U+0022 QUOTATION MARK (")
- case 0x0022:
- // Consume a string token and return it.
- consumeStringToken();
- break;
-
- // U+0023 NUMBER SIGN (#)
- case 0x0023:
- // If the next input code point is a name code point or the next two input code points are a valid escape, then:
- if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {
- // Create a .
- type = TYPE$F.Hash;
-
- // If the next 3 input code points would start an identifier, set the ’s type flag to "id".
- // if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
- // // TODO: set id flag
- // }
-
- // Consume a name, and set the ’s value to the returned string.
- offset = consumeName(source, offset + 1);
-
- // Return the .
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
-
- break;
-
- // U+0027 APOSTROPHE (')
- case 0x0027:
- // Consume a string token and return it.
- consumeStringToken();
- break;
-
- // U+0028 LEFT PARENTHESIS (()
- case 0x0028:
- // Return a <(-token>.
- type = TYPE$F.LeftParenthesis;
- offset++;
- break;
-
- // U+0029 RIGHT PARENTHESIS ())
- case 0x0029:
- // Return a <)-token>.
- type = TYPE$F.RightParenthesis;
- offset++;
- break;
-
- // U+002B PLUS SIGN (+)
- case 0x002B:
- // If the input stream starts with a number, ...
- if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
- // ... reconsume the current input code point, consume a numeric token, and return it.
- consumeNumericToken();
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
- break;
-
- // U+002C COMMA (,)
- case 0x002C:
- // Return a .
- type = TYPE$F.Comma;
- offset++;
- break;
-
- // U+002D HYPHEN-MINUS (-)
- case 0x002D:
- // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.
- if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
- consumeNumericToken();
- } else {
- // Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a .
- if (getCharCode(offset + 1) === 0x002D &&
- getCharCode(offset + 2) === 0x003E) {
- type = TYPE$F.CDC;
- offset = offset + 3;
- } else {
- // Otherwise, if the input stream starts with an identifier, ...
- if (isIdentifierStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
- // ... reconsume the current input code point, consume an ident-like token, and return it.
- consumeIdentLikeToken();
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
- }
- }
- break;
-
- // U+002E FULL STOP (.)
- case 0x002E:
- // If the input stream starts with a number, ...
- if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
- // ... reconsume the current input code point, consume a numeric token, and return it.
- consumeNumericToken();
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
-
- break;
-
- // U+002F SOLIDUS (/)
- case 0x002F:
- // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),
- if (getCharCode(offset + 1) === 0x002A) {
- // ... consume them and all following code points up to and including the first U+002A ASTERISK (*)
- // followed by a U+002F SOLIDUS (/), or up to an EOF code point.
- type = TYPE$F.Comment;
- offset = source.indexOf('*/', offset + 2) + 2;
- if (offset === 1) {
- offset = source.length;
- }
- } else {
- type = TYPE$F.Delim;
- offset++;
- }
- break;
-
- // U+003A COLON (:)
- case 0x003A:
- // Return a .
- type = TYPE$F.Colon;
- offset++;
- break;
-
- // U+003B SEMICOLON (;)
- case 0x003B:
- // Return a .
- type = TYPE$F.Semicolon;
- offset++;
- break;
-
- // U+003C LESS-THAN SIGN (<)
- case 0x003C:
- // If the next 3 input code points are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), ...
- if (getCharCode(offset + 1) === 0x0021 &&
- getCharCode(offset + 2) === 0x002D &&
- getCharCode(offset + 3) === 0x002D) {
- // ... consume them and return a .
- type = TYPE$F.CDO;
- offset = offset + 4;
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
-
- break;
-
- // U+0040 COMMERCIAL AT (@)
- case 0x0040:
- // If the next 3 input code points would start an identifier, ...
- if (isIdentifierStart$1(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
- // ... consume a name, create an with its value set to the returned value, and return it.
- type = TYPE$F.AtKeyword;
- offset = consumeName(source, offset + 1);
- } else {
- // Otherwise, return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
-
- break;
-
- // U+005B LEFT SQUARE BRACKET ([)
- case 0x005B:
- // Return a <[-token>.
- type = TYPE$F.LeftSquareBracket;
- offset++;
- break;
-
- // U+005C REVERSE SOLIDUS (\)
- case 0x005C:
- // If the input stream starts with a valid escape, ...
- if (isValidEscape(code, getCharCode(offset + 1))) {
- // ... reconsume the current input code point, consume an ident-like token, and return it.
- consumeIdentLikeToken();
- } else {
- // Otherwise, this is a parse error. Return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
- break;
-
- // U+005D RIGHT SQUARE BRACKET (])
- case 0x005D:
- // Return a <]-token>.
- type = TYPE$F.RightSquareBracket;
- offset++;
- break;
-
- // U+007B LEFT CURLY BRACKET ({)
- case 0x007B:
- // Return a <{-token>.
- type = TYPE$F.LeftCurlyBracket;
- offset++;
- break;
-
- // U+007D RIGHT CURLY BRACKET (})
- case 0x007D:
- // Return a <}-token>.
- type = TYPE$F.RightCurlyBracket;
- offset++;
- break;
-
- // digit
- case charCodeCategory.Digit:
- // Reconsume the current input code point, consume a numeric token, and return it.
- consumeNumericToken();
- break;
-
- // name-start code point
- case charCodeCategory.NameStart:
- // Reconsume the current input code point, consume an ident-like token, and return it.
- consumeIdentLikeToken();
- break;
-
- // EOF
- case charCodeCategory.Eof:
- // Return an .
- break;
-
- // anything else
- default:
- // Return a with its value set to the current input code point.
- type = TYPE$F.Delim;
- offset++;
- }
-
- switch (type) {
- case balanceCloseType:
- balancePrev = balanceStart & OFFSET_MASK;
- balanceStart = balance[balancePrev];
- balanceCloseType = balanceStart >> TYPE_SHIFT;
- balance[tokenCount] = balancePrev;
- balance[balancePrev++] = tokenCount;
- for (; balancePrev < tokenCount; balancePrev++) {
- if (balance[balancePrev] === sourceLength) {
- balance[balancePrev] = tokenCount;
- }
- }
- break;
-
- case TYPE$F.LeftParenthesis:
- case TYPE$F.Function:
- balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$F.RightParenthesis;
- balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
- break;
-
- case TYPE$F.LeftSquareBracket:
- balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$F.RightSquareBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
- break;
-
- case TYPE$F.LeftCurlyBracket:
- balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$F.RightCurlyBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
- break;
- }
-
- offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | offset;
- }
-
- // finalize buffers
- offsetAndType[tokenCount] = (TYPE$F.EOF << TYPE_SHIFT) | offset; //
- balance[tokenCount] = sourceLength;
- balance[sourceLength] = sourceLength; // prevents false positive balance match with any token
- while (balanceStart !== 0) {
- balancePrev = balanceStart & OFFSET_MASK;
- balanceStart = balance[balancePrev];
- balance[balancePrev] = sourceLength;
- }
-
- // update stream
- stream.source = source;
- stream.firstCharOffset = start;
- stream.offsetAndType = offsetAndType;
- stream.tokenCount = tokenCount;
- stream.balance = balance;
- stream.reset();
- stream.next();
-
- return stream;
- }
-
- // extend tokenizer with constants
- Object.keys(constants$1).forEach(function(key) {
- tokenize$3[key] = constants$1[key];
- });
-
- // extend tokenizer with static methods from utils
- Object.keys(charCodeDefinitions).forEach(function(key) {
- tokenize$3[key] = charCodeDefinitions[key];
- });
- Object.keys(utils).forEach(function(key) {
- tokenize$3[key] = utils[key];
- });
-
- var tokenizer$3 = tokenize$3;
-
- var isDigit$3 = tokenizer$3.isDigit;
- var cmpChar$4 = tokenizer$3.cmpChar;
- var TYPE$E = tokenizer$3.TYPE;
-
- var DELIM$6 = TYPE$E.Delim;
- var WHITESPACE$b = TYPE$E.WhiteSpace;
- var COMMENT$9 = TYPE$E.Comment;
- var IDENT$i = TYPE$E.Ident;
- var NUMBER$9 = TYPE$E.Number;
- var DIMENSION$7 = TYPE$E.Dimension;
- var PLUSSIGN$8 = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$4 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var N$4 = 0x006E; // U+006E LATIN SMALL LETTER N (n)
- var DISALLOW_SIGN$1 = true;
- var ALLOW_SIGN$1 = false;
-
- function isDelim$1(token, code) {
- return token !== null && token.type === DELIM$6 && token.value.charCodeAt(0) === code;
- }
-
- function skipSC(token, offset, getNextToken) {
- while (token !== null && (token.type === WHITESPACE$b || token.type === COMMENT$9)) {
- token = getNextToken(++offset);
- }
-
- return offset;
- }
-
- function checkInteger$1(token, valueOffset, disallowSign, offset) {
- if (!token) {
- return 0;
- }
-
- var code = token.value.charCodeAt(valueOffset);
-
- if (code === PLUSSIGN$8 || code === HYPHENMINUS$4) {
- if (disallowSign) {
- // Number sign is not allowed
- return 0;
- }
- valueOffset++;
- }
-
- for (; valueOffset < token.value.length; valueOffset++) {
- if (!isDigit$3(token.value.charCodeAt(valueOffset))) {
- // Integer is expected
- return 0;
- }
- }
-
- return offset + 1;
- }
-
- // ...
- // ... ['+' | '-']
- function consumeB$1(token, offset_, getNextToken) {
- var sign = false;
- var offset = skipSC(token, offset_, getNextToken);
-
- token = getNextToken(offset);
-
- if (token === null) {
- return offset_;
- }
-
- if (token.type !== NUMBER$9) {
- if (isDelim$1(token, PLUSSIGN$8) || isDelim$1(token, HYPHENMINUS$4)) {
- sign = true;
- offset = skipSC(getNextToken(++offset), offset, getNextToken);
- token = getNextToken(offset);
-
- if (token === null && token.type !== NUMBER$9) {
- return 0;
- }
- } else {
- return offset_;
- }
- }
-
- if (!sign) {
- var code = token.value.charCodeAt(0);
- if (code !== PLUSSIGN$8 && code !== HYPHENMINUS$4) {
- // Number sign is expected
- return 0;
- }
- }
-
- return checkInteger$1(token, sign ? 0 : 1, sign, offset);
- }
-
- // An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
- var genericAnPlusB = function anPlusB(token, getNextToken) {
- /* eslint-disable brace-style*/
- var offset = 0;
-
- if (!token) {
- return 0;
- }
-
- //
- if (token.type === NUMBER$9) {
- return checkInteger$1(token, 0, ALLOW_SIGN$1, offset); // b
- }
-
- // -n
- // -n
- // -n ['+' | '-']
- // -n-
- //
- else if (token.type === IDENT$i && token.value.charCodeAt(0) === HYPHENMINUS$4) {
- // expect 1st char is N
- if (!cmpChar$4(token.value, 1, N$4)) {
- return 0;
- }
-
- switch (token.value.length) {
- // -n
- // -n
- // -n ['+' | '-']
- case 2:
- return consumeB$1(getNextToken(++offset), offset, getNextToken);
-
- // -n-
- case 3:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
- return 0;
- }
-
- offset = skipSC(getNextToken(++offset), offset, getNextToken);
- token = getNextToken(offset);
-
- return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
-
- //
- default:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
- return 0;
- }
-
- return checkInteger$1(token, 3, DISALLOW_SIGN$1, offset);
- }
- }
-
- // '+'? n
- // '+'? n
- // '+'? n ['+' | '-']
- // '+'? n-
- // '+'?
- else if (token.type === IDENT$i || (isDelim$1(token, PLUSSIGN$8) && getNextToken(offset + 1).type === IDENT$i)) {
- // just ignore a plus
- if (token.type !== IDENT$i) {
- token = getNextToken(++offset);
- }
-
- if (token === null || !cmpChar$4(token.value, 0, N$4)) {
- return 0;
- }
-
- switch (token.value.length) {
- // '+'? n
- // '+'? n
- // '+'? n ['+' | '-']
- case 1:
- return consumeB$1(getNextToken(++offset), offset, getNextToken);
-
- // '+'? n-
- case 2:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
- return 0;
- }
-
- offset = skipSC(getNextToken(++offset), offset, getNextToken);
- token = getNextToken(offset);
-
- return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
-
- // '+'?
- default:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
- return 0;
- }
-
- return checkInteger$1(token, 2, DISALLOW_SIGN$1, offset);
- }
- }
-
- //
- //
- //
- //
- // ['+' | '-']
- else if (token.type === DIMENSION$7) {
- var code = token.value.charCodeAt(0);
- var sign = code === PLUSSIGN$8 || code === HYPHENMINUS$4 ? 1 : 0;
-
- for (var i = sign; i < token.value.length; i++) {
- if (!isDigit$3(token.value.charCodeAt(i))) {
- break;
- }
- }
-
- if (i === sign) {
- // Integer is expected
- return 0;
- }
-
- if (!cmpChar$4(token.value, i, N$4)) {
- return 0;
- }
-
- //
- //
- // ['+' | '-']
- if (i + 1 === token.value.length) {
- return consumeB$1(getNextToken(++offset), offset, getNextToken);
- } else {
- if (token.value.charCodeAt(i + 1) !== HYPHENMINUS$4) {
- return 0;
- }
-
- //
- if (i + 2 === token.value.length) {
- offset = skipSC(getNextToken(++offset), offset, getNextToken);
- token = getNextToken(offset);
-
- return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
- }
- //
- else {
- return checkInteger$1(token, i + 2, DISALLOW_SIGN$1, offset);
- }
- }
- }
-
- return 0;
- };
-
- var isHexDigit$2 = tokenizer$3.isHexDigit;
- var cmpChar$3 = tokenizer$3.cmpChar;
- var TYPE$D = tokenizer$3.TYPE;
-
- var IDENT$h = TYPE$D.Ident;
- var DELIM$5 = TYPE$D.Delim;
- var NUMBER$8 = TYPE$D.Number;
- var DIMENSION$6 = TYPE$D.Dimension;
- var PLUSSIGN$7 = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$3 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var QUESTIONMARK$2 = 0x003F; // U+003F QUESTION MARK (?)
- var U$2 = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
-
- function isDelim(token, code) {
- return token !== null && token.type === DELIM$5 && token.value.charCodeAt(0) === code;
- }
-
- function startsWith$1(token, code) {
- return token.value.charCodeAt(0) === code;
- }
-
- function hexSequence(token, offset, allowDash) {
- for (var pos = offset, hexlen = 0; pos < token.value.length; pos++) {
- var code = token.value.charCodeAt(pos);
-
- if (code === HYPHENMINUS$3 && allowDash && hexlen !== 0) {
- if (hexSequence(token, offset + hexlen + 1, false) > 0) {
- return 6; // dissallow following question marks
- }
-
- return 0; // dash at the ending of a hex sequence is not allowed
- }
-
- if (!isHexDigit$2(code)) {
- return 0; // not a hex digit
- }
-
- if (++hexlen > 6) {
- return 0; // too many hex digits
- } }
-
- return hexlen;
- }
-
- function withQuestionMarkSequence(consumed, length, getNextToken) {
- if (!consumed) {
- return 0; // nothing consumed
- }
-
- while (isDelim(getNextToken(length), QUESTIONMARK$2)) {
- if (++consumed > 6) {
- return 0; // too many question marks
- }
-
- length++;
- }
-
- return length;
- }
-
- // https://drafts.csswg.org/css-syntax/#urange
- // Informally, the production has three forms:
- // U+0001
- // Defines a range consisting of a single code point, in this case the code point "1".
- // U+0001-00ff
- // Defines a range of codepoints between the first and the second value, in this case
- // the range between "1" and "ff" (255 in decimal) inclusive.
- // U+00??
- // Defines a range of codepoints where the "?" characters range over all hex digits,
- // in this case defining the same as the value U+0000-00ff.
- // In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
- //
- // =
- // u '+' '?'* |
- // u '?'* |
- // u '?'* |
- // u |
- // u |
- // u '+' '?'+
- var genericUrange = function urange(token, getNextToken) {
- var length = 0;
-
- // should start with `u` or `U`
- if (token === null || token.type !== IDENT$h || !cmpChar$3(token.value, 0, U$2)) {
- return 0;
- }
-
- token = getNextToken(++length);
- if (token === null) {
- return 0;
- }
-
- // u '+' '?'*
- // u '+' '?'+
- if (isDelim(token, PLUSSIGN$7)) {
- token = getNextToken(++length);
- if (token === null) {
- return 0;
- }
-
- if (token.type === IDENT$h) {
- // u '+' '?'*
- return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
- }
-
- if (isDelim(token, QUESTIONMARK$2)) {
- // u '+' '?'+
- return withQuestionMarkSequence(1, ++length, getNextToken);
- }
-
- // Hex digit or question mark is expected
- return 0;
- }
-
- // u '?'*
- // u
- // u
- if (token.type === NUMBER$8) {
- if (!startsWith$1(token, PLUSSIGN$7)) {
- return 0;
- }
-
- var consumedHexLength = hexSequence(token, 1, true);
- if (consumedHexLength === 0) {
- return 0;
- }
-
- token = getNextToken(++length);
- if (token === null) {
- // u
- return length;
- }
-
- if (token.type === DIMENSION$6 || token.type === NUMBER$8) {
- // u
- // u
- if (!startsWith$1(token, HYPHENMINUS$3) || !hexSequence(token, 1, false)) {
- return 0;
- }
-
- return length + 1;
- }
-
- // u '?'*
- return withQuestionMarkSequence(consumedHexLength, length, getNextToken);
- }
-
- // u '?'*
- if (token.type === DIMENSION$6) {
- if (!startsWith$1(token, PLUSSIGN$7)) {
- return 0;
- }
-
- return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);
- }
-
- return 0;
- };
-
- var tokenizer$2 = tokenizer$3;
- var isIdentifierStart = tokenizer$2.isIdentifierStart;
- var isHexDigit$1 = tokenizer$2.isHexDigit;
- var isDigit$2 = tokenizer$2.isDigit;
- var cmpStr$3 = tokenizer$2.cmpStr;
- var consumeNumber$3 = tokenizer$2.consumeNumber;
- var TYPE$C = tokenizer$2.TYPE;
- var anPlusB = genericAnPlusB;
- var urange = genericUrange;
-
- var cssWideKeywords$1 = ['unset', 'initial', 'inherit'];
- var calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];
-
- // https://www.w3.org/TR/css-values-3/#lengths
- var LENGTH = {
- // absolute length units
- 'px': true,
- 'mm': true,
- 'cm': true,
- 'in': true,
- 'pt': true,
- 'pc': true,
- 'q': true,
-
- // relative length units
- 'em': true,
- 'ex': true,
- 'ch': true,
- 'rem': true,
-
- // viewport-percentage lengths
- 'vh': true,
- 'vw': true,
- 'vmin': true,
- 'vmax': true,
- 'vm': true
- };
-
- var ANGLE = {
- 'deg': true,
- 'grad': true,
- 'rad': true,
- 'turn': true
- };
-
- var TIME = {
- 's': true,
- 'ms': true
- };
-
- var FREQUENCY = {
- 'hz': true,
- 'khz': true
- };
-
- // https://www.w3.org/TR/css-values-3/#resolution (https://drafts.csswg.org/css-values/#resolution)
- var RESOLUTION = {
- 'dpi': true,
- 'dpcm': true,
- 'dppx': true,
- 'x': true // https://github.com/w3c/csswg-drafts/issues/461
- };
-
- // https://drafts.csswg.org/css-grid/#fr-unit
- var FLEX = {
- 'fr': true
- };
-
- // https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume
- var DECIBEL = {
- 'db': true
- };
-
- // https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch
- var SEMITONES = {
- 'st': true
- };
-
- // safe char code getter
- function charCode(str, index) {
- return index < str.length ? str.charCodeAt(index) : 0;
- }
-
- function eqStr(actual, expected) {
- return cmpStr$3(actual, 0, actual.length, expected);
- }
-
- function eqStrAny(actual, expected) {
- for (var i = 0; i < expected.length; i++) {
- if (eqStr(actual, expected[i])) {
- return true;
- }
- }
-
- return false;
- }
-
- // IE postfix hack, i.e. 123\0 or 123px\9
- function isPostfixIeHack(str, offset) {
- if (offset !== str.length - 2) {
- return false;
- }
-
- return (
- str.charCodeAt(offset) === 0x005C && // U+005C REVERSE SOLIDUS (\)
- isDigit$2(str.charCodeAt(offset + 1))
- );
- }
-
- function outOfRange(opts, value, numEnd) {
- if (opts && opts.type === 'Range') {
- var num = Number(
- numEnd !== undefined && numEnd !== value.length
- ? value.substr(0, numEnd)
- : value
- );
-
- if (isNaN(num)) {
- return true;
- }
-
- if (opts.min !== null && num < opts.min) {
- return true;
- }
-
- if (opts.max !== null && num > opts.max) {
- return true;
- }
- }
-
- return false;
- }
-
- function consumeFunction(token, getNextToken) {
- var startIdx = token.index;
- var length = 0;
-
- // balanced token consuming
- do {
- length++;
-
- if (token.balance <= startIdx) {
- break;
- }
- } while (token = getNextToken(length));
-
- return length;
- }
-
- // TODO: implement
- // can be used wherever , , , , , , or values are allowed
- // https://drafts.csswg.org/css-values/#calc-notation
- function calc(next) {
- return function(token, getNextToken, opts) {
- if (token === null) {
- return 0;
- }
-
- if (token.type === TYPE$C.Function && eqStrAny(token.value, calcFunctionNames)) {
- return consumeFunction(token, getNextToken);
- }
-
- return next(token, getNextToken, opts);
- };
- }
-
- function tokenType(expectedTokenType) {
- return function(token) {
- if (token === null || token.type !== expectedTokenType) {
- return 0;
- }
-
- return 1;
- };
- }
-
- function func(name) {
- name = name + '(';
-
- return function(token, getNextToken) {
- if (token !== null && eqStr(token.value, name)) {
- return consumeFunction(token, getNextToken);
- }
-
- return 0;
- };
- }
-
- // =========================
- // Complex types
- //
-
- // https://drafts.csswg.org/css-values-4/#custom-idents
- // 4.2. Author-defined Identifiers: the type
- // Some properties accept arbitrary author-defined identifiers as a component value.
- // This generic data type is denoted by , and represents any valid CSS identifier
- // that would not be misinterpreted as a pre-defined keyword in that property’s value definition.
- //
- // See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
- function customIdent(token) {
- if (token === null || token.type !== TYPE$C.Ident) {
- return 0;
- }
-
- var name = token.value.toLowerCase();
-
- // The CSS-wide keywords are not valid s
- if (eqStrAny(name, cssWideKeywords$1)) {
- return 0;
- }
-
- // The default keyword is reserved and is also not a valid
- if (eqStr(name, 'default')) {
- return 0;
- }
-
- // TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)
- // Specifications using must specify clearly what other keywords
- // are excluded from , if any—for example by saying that any pre-defined keywords
- // in that property’s value definition are excluded. Excluded keywords are excluded
- // in all ASCII case permutations.
-
- return 1;
- }
-
- // https://drafts.csswg.org/css-variables/#typedef-custom-property-name
- // A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
- // The production corresponds to this: it’s defined as any valid identifier
- // that starts with two dashes, except -- itself, which is reserved for future use by CSS.
- // NOTE: Current implementation treat `--` as a valid name since most (all?) major browsers treat it as valid.
- function customPropertyName(token) {
- // ... defined as any valid identifier
- if (token === null || token.type !== TYPE$C.Ident) {
- return 0;
- }
-
- // ... that starts with two dashes (U+002D HYPHEN-MINUS)
- if (charCode(token.value, 0) !== 0x002D || charCode(token.value, 1) !== 0x002D) {
- return 0;
- }
-
- return 1;
- }
-
- // https://drafts.csswg.org/css-color-4/#hex-notation
- // The syntax of a is a token whose value consists of 3, 4, 6, or 8 hexadecimal digits.
- // In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
- // letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
- function hexColor(token) {
- if (token === null || token.type !== TYPE$C.Hash) {
- return 0;
- }
-
- var length = token.value.length;
-
- // valid values (length): #rgb (4), #rgba (5), #rrggbb (7), #rrggbbaa (9)
- if (length !== 4 && length !== 5 && length !== 7 && length !== 9) {
- return 0;
- }
-
- for (var i = 1; i < length; i++) {
- if (!isHexDigit$1(token.value.charCodeAt(i))) {
- return 0;
- }
- }
-
- return 1;
- }
-
- function idSelector(token) {
- if (token === null || token.type !== TYPE$C.Hash) {
- return 0;
- }
-
- if (!isIdentifierStart(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
- return 0;
- }
-
- return 1;
- }
-
- // https://drafts.csswg.org/css-syntax/#any-value
- // It represents the entirety of what a valid declaration can have as its value.
- function declarationValue(token, getNextToken) {
- if (!token) {
- return 0;
- }
-
- var length = 0;
- var level = 0;
- var startIdx = token.index;
-
- // The production matches any sequence of one or more tokens,
- // so long as the sequence ...
- scan:
- do {
- switch (token.type) {
- // ... does not contain , ,
- case TYPE$C.BadString:
- case TYPE$C.BadUrl:
- break scan;
-
- // ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$C.RightCurlyBracket:
- case TYPE$C.RightParenthesis:
- case TYPE$C.RightSquareBracket:
- if (token.balance > token.index || token.balance < startIdx) {
- break scan;
- }
-
- level--;
- break;
-
- // ... or top-level tokens
- case TYPE$C.Semicolon:
- if (level === 0) {
- break scan;
- }
-
- break;
-
- // ... or tokens with a value of "!"
- case TYPE$C.Delim:
- if (token.value === '!' && level === 0) {
- break scan;
- }
-
- break;
-
- case TYPE$C.Function:
- case TYPE$C.LeftParenthesis:
- case TYPE$C.LeftSquareBracket:
- case TYPE$C.LeftCurlyBracket:
- level++;
- break;
- }
-
- length++;
-
- // until balance closing
- if (token.balance <= startIdx) {
- break;
- }
- } while (token = getNextToken(length));
-
- return length;
- }
-
- // https://drafts.csswg.org/css-syntax/#any-value
- // The production is identical to , but also
- // allows top-level tokens and tokens
- // with a value of "!". It represents the entirety of what valid CSS can be in any context.
- function anyValue(token, getNextToken) {
- if (!token) {
- return 0;
- }
-
- var startIdx = token.index;
- var length = 0;
-
- // The production matches any sequence of one or more tokens,
- // so long as the sequence ...
- scan:
- do {
- switch (token.type) {
- // ... does not contain , ,
- case TYPE$C.BadString:
- case TYPE$C.BadUrl:
- break scan;
-
- // ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$C.RightCurlyBracket:
- case TYPE$C.RightParenthesis:
- case TYPE$C.RightSquareBracket:
- if (token.balance > token.index || token.balance < startIdx) {
- break scan;
- }
-
- break;
- }
-
- length++;
-
- // until balance closing
- if (token.balance <= startIdx) {
- break;
- }
- } while (token = getNextToken(length));
-
- return length;
- }
-
- // =========================
- // Dimensions
- //
-
- function dimension(type) {
- return function(token, getNextToken, opts) {
- if (token === null || token.type !== TYPE$C.Dimension) {
- return 0;
- }
-
- var numberEnd = consumeNumber$3(token.value, 0);
-
- // check unit
- if (type !== null) {
- // check for IE postfix hack, i.e. 123px\0 or 123px\9
- var reverseSolidusOffset = token.value.indexOf('\\', numberEnd);
- var unit = reverseSolidusOffset === -1 || !isPostfixIeHack(token.value, reverseSolidusOffset)
- ? token.value.substr(numberEnd)
- : token.value.substring(numberEnd, reverseSolidusOffset);
-
- if (type.hasOwnProperty(unit.toLowerCase()) === false) {
- return 0;
- }
- }
-
- // check range if specified
- if (outOfRange(opts, token.value, numberEnd)) {
- return 0;
- }
-
- return 1;
- };
- }
-
- // =========================
- // Percentage
- //
-
- // §5.5. Percentages: the type
- // https://drafts.csswg.org/css-values-4/#percentages
- function percentage(token, getNextToken, opts) {
- // ... corresponds to the production
- if (token === null || token.type !== TYPE$C.Percentage) {
- return 0;
- }
-
- // check range if specified
- if (outOfRange(opts, token.value, token.value.length - 1)) {
- return 0;
- }
-
- return 1;
- }
-
- // =========================
- // Numeric
- //
-
- // https://drafts.csswg.org/css-values-4/#numbers
- // The value represents a literal number with the value 0. Expressions that merely
- // evaluate to a with the value 0 (for example, calc(0)) do not match ;
- // only literal s do.
- function zero(next) {
- if (typeof next !== 'function') {
- next = function() {
- return 0;
- };
- }
-
- return function(token, getNextToken, opts) {
- if (token !== null && token.type === TYPE$C.Number) {
- if (Number(token.value) === 0) {
- return 1;
- }
- }
-
- return next(token, getNextToken, opts);
- };
- }
-
- // § 5.3. Real Numbers: the type
- // https://drafts.csswg.org/css-values-4/#numbers
- // Number values are denoted by , and represent real numbers, possibly with a fractional component.
- // ... It corresponds to the production
- function number(token, getNextToken, opts) {
- if (token === null) {
- return 0;
- }
-
- var numberEnd = consumeNumber$3(token.value, 0);
- var isNumber = numberEnd === token.value.length;
- if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
- return 0;
- }
-
- // check range if specified
- if (outOfRange(opts, token.value, numberEnd)) {
- return 0;
- }
-
- return 1;
- }
-
- // §5.2. Integers: the type
- // https://drafts.csswg.org/css-values-4/#integers
- function integer(token, getNextToken, opts) {
- // ... corresponds to a subset of the production
- if (token === null || token.type !== TYPE$C.Number) {
- return 0;
- }
-
- // The first digit of an integer may be immediately preceded by `-` or `+` to indicate the integer’s sign.
- var i = token.value.charCodeAt(0) === 0x002B || // U+002B PLUS SIGN (+)
- token.value.charCodeAt(0) === 0x002D ? 1 : 0; // U+002D HYPHEN-MINUS (-)
-
- // When written literally, an integer is one or more decimal digits 0 through 9 ...
- for (; i < token.value.length; i++) {
- if (!isDigit$2(token.value.charCodeAt(i))) {
- return 0;
- }
- }
-
- // check range if specified
- if (outOfRange(opts, token.value, i)) {
- return 0;
- }
-
- return 1;
- }
-
- var generic$1 = {
- // token types
- 'ident-token': tokenType(TYPE$C.Ident),
- 'function-token': tokenType(TYPE$C.Function),
- 'at-keyword-token': tokenType(TYPE$C.AtKeyword),
- 'hash-token': tokenType(TYPE$C.Hash),
- 'string-token': tokenType(TYPE$C.String),
- 'bad-string-token': tokenType(TYPE$C.BadString),
- 'url-token': tokenType(TYPE$C.Url),
- 'bad-url-token': tokenType(TYPE$C.BadUrl),
- 'delim-token': tokenType(TYPE$C.Delim),
- 'number-token': tokenType(TYPE$C.Number),
- 'percentage-token': tokenType(TYPE$C.Percentage),
- 'dimension-token': tokenType(TYPE$C.Dimension),
- 'whitespace-token': tokenType(TYPE$C.WhiteSpace),
- 'CDO-token': tokenType(TYPE$C.CDO),
- 'CDC-token': tokenType(TYPE$C.CDC),
- 'colon-token': tokenType(TYPE$C.Colon),
- 'semicolon-token': tokenType(TYPE$C.Semicolon),
- 'comma-token': tokenType(TYPE$C.Comma),
- '[-token': tokenType(TYPE$C.LeftSquareBracket),
- ']-token': tokenType(TYPE$C.RightSquareBracket),
- '(-token': tokenType(TYPE$C.LeftParenthesis),
- ')-token': tokenType(TYPE$C.RightParenthesis),
- '{-token': tokenType(TYPE$C.LeftCurlyBracket),
- '}-token': tokenType(TYPE$C.RightCurlyBracket),
-
- // token type aliases
- 'string': tokenType(TYPE$C.String),
- 'ident': tokenType(TYPE$C.Ident),
-
- // complex types
- 'custom-ident': customIdent,
- 'custom-property-name': customPropertyName,
- 'hex-color': hexColor,
- 'id-selector': idSelector, // element( )
- 'an-plus-b': anPlusB,
- 'urange': urange,
- 'declaration-value': declarationValue,
- 'any-value': anyValue,
-
- // dimensions
- 'dimension': calc(dimension(null)),
- 'angle': calc(dimension(ANGLE)),
- 'decibel': calc(dimension(DECIBEL)),
- 'frequency': calc(dimension(FREQUENCY)),
- 'flex': calc(dimension(FLEX)),
- 'length': calc(zero(dimension(LENGTH))),
- 'resolution': calc(dimension(RESOLUTION)),
- 'semitones': calc(dimension(SEMITONES)),
- 'time': calc(dimension(TIME)),
-
- // percentage
- 'percentage': calc(percentage),
-
- // numeric
- 'zero': zero(),
- 'number': calc(number),
- 'integer': calc(integer),
-
- // old IE stuff
- '-ms-legacy-expression': func('expression')
- };
-
- var createCustomError = createCustomError$3;
-
- var _SyntaxError = function SyntaxError(message, input, offset) {
- var error = createCustomError('SyntaxError', message);
-
- error.input = input;
- error.offset = offset;
- error.rawMessage = message;
- error.message = error.rawMessage + '\n' +
- ' ' + error.input + '\n' +
- '--' + new Array((error.offset || error.input.length) + 1).join('-') + '^';
-
- return error;
- };
-
- var SyntaxError$3 = _SyntaxError;
-
- var TAB$1 = 9;
- var N$3 = 10;
- var F$2 = 12;
- var R$2 = 13;
- var SPACE$2 = 32;
-
- var Tokenizer$1 = function(str) {
- this.str = str;
- this.pos = 0;
- };
-
- Tokenizer$1.prototype = {
- charCodeAt: function(pos) {
- return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
- },
- charCode: function() {
- return this.charCodeAt(this.pos);
- },
- nextCharCode: function() {
- return this.charCodeAt(this.pos + 1);
- },
- nextNonWsCode: function(pos) {
- return this.charCodeAt(this.findWsEnd(pos));
- },
- findWsEnd: function(pos) {
- for (; pos < this.str.length; pos++) {
- var code = this.str.charCodeAt(pos);
- if (code !== R$2 && code !== N$3 && code !== F$2 && code !== SPACE$2 && code !== TAB$1) {
- break;
- }
- }
-
- return pos;
- },
- substringToPos: function(end) {
- return this.str.substring(this.pos, this.pos = end);
- },
- eat: function(code) {
- if (this.charCode() !== code) {
- this.error('Expect `' + String.fromCharCode(code) + '`');
- }
-
- this.pos++;
- },
- peek: function() {
- return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
- },
- error: function(message) {
- throw new SyntaxError$3(message, this.str, this.pos);
- }
- };
-
- var tokenizer$1 = Tokenizer$1;
-
- var Tokenizer = tokenizer$1;
- var TAB = 9;
- var N$2 = 10;
- var F$1 = 12;
- var R$1 = 13;
- var SPACE$1 = 32;
- var EXCLAMATIONMARK$3 = 33; // !
- var NUMBERSIGN$4 = 35; // #
- var AMPERSAND$1 = 38; // &
- var APOSTROPHE = 39; // '
- var LEFTPARENTHESIS$7 = 40; // (
- var RIGHTPARENTHESIS$7 = 41; // )
- var ASTERISK$6 = 42; // *
- var PLUSSIGN$6 = 43; // +
- var COMMA$4 = 44; // ,
- var HYPERMINUS = 45; // -
- var LESSTHANSIGN = 60; // <
- var GREATERTHANSIGN$2 = 62; // >
- var QUESTIONMARK$1 = 63; // ?
- var COMMERCIALAT = 64; // @
- var LEFTSQUAREBRACKET$4 = 91; // [
- var RIGHTSQUAREBRACKET$2 = 93; // ]
- var LEFTCURLYBRACKET$4 = 123; // {
- var VERTICALLINE$3 = 124; // |
- var RIGHTCURLYBRACKET$2 = 125; // }
- var INFINITY = 8734; // ∞
- var NAME_CHAR = createCharMap(function(ch) {
- return /[a-zA-Z0-9\-]/.test(ch);
- });
- var COMBINATOR_PRECEDENCE = {
- ' ': 1,
- '&&': 2,
- '||': 3,
- '|': 4
- };
-
- function createCharMap(fn) {
- var array = typeof Uint32Array === 'function' ? new Uint32Array(128) : new Array(128);
- for (var i = 0; i < 128; i++) {
- array[i] = fn(String.fromCharCode(i)) ? 1 : 0;
- }
- return array;
- }
-
- function scanSpaces(tokenizer) {
- return tokenizer.substringToPos(
- tokenizer.findWsEnd(tokenizer.pos)
- );
- }
-
- function scanWord(tokenizer) {
- var end = tokenizer.pos;
-
- for (; end < tokenizer.str.length; end++) {
- var code = tokenizer.str.charCodeAt(end);
- if (code >= 128 || NAME_CHAR[code] === 0) {
- break;
- }
- }
-
- if (tokenizer.pos === end) {
- tokenizer.error('Expect a keyword');
- }
-
- return tokenizer.substringToPos(end);
- }
-
- function scanNumber(tokenizer) {
- var end = tokenizer.pos;
-
- for (; end < tokenizer.str.length; end++) {
- var code = tokenizer.str.charCodeAt(end);
- if (code < 48 || code > 57) {
- break;
- }
- }
-
- if (tokenizer.pos === end) {
- tokenizer.error('Expect a number');
- }
-
- return tokenizer.substringToPos(end);
- }
-
- function scanString(tokenizer) {
- var end = tokenizer.str.indexOf('\'', tokenizer.pos + 1);
-
- if (end === -1) {
- tokenizer.pos = tokenizer.str.length;
- tokenizer.error('Expect an apostrophe');
- }
-
- return tokenizer.substringToPos(end + 1);
- }
-
- function readMultiplierRange(tokenizer) {
- var min = null;
- var max = null;
-
- tokenizer.eat(LEFTCURLYBRACKET$4);
-
- min = scanNumber(tokenizer);
-
- if (tokenizer.charCode() === COMMA$4) {
- tokenizer.pos++;
- if (tokenizer.charCode() !== RIGHTCURLYBRACKET$2) {
- max = scanNumber(tokenizer);
- }
- } else {
- max = min;
- }
-
- tokenizer.eat(RIGHTCURLYBRACKET$2);
-
- return {
- min: Number(min),
- max: max ? Number(max) : 0
- };
- }
-
- function readMultiplier(tokenizer) {
- var range = null;
- var comma = false;
-
- switch (tokenizer.charCode()) {
- case ASTERISK$6:
- tokenizer.pos++;
-
- range = {
- min: 0,
- max: 0
- };
-
- break;
-
- case PLUSSIGN$6:
- tokenizer.pos++;
-
- range = {
- min: 1,
- max: 0
- };
-
- break;
-
- case QUESTIONMARK$1:
- tokenizer.pos++;
-
- range = {
- min: 0,
- max: 1
- };
-
- break;
-
- case NUMBERSIGN$4:
- tokenizer.pos++;
-
- comma = true;
-
- if (tokenizer.charCode() === LEFTCURLYBRACKET$4) {
- range = readMultiplierRange(tokenizer);
- } else {
- range = {
- min: 1,
- max: 0
- };
- }
-
- break;
-
- case LEFTCURLYBRACKET$4:
- range = readMultiplierRange(tokenizer);
- break;
-
- default:
- return null;
- }
-
- return {
- type: 'Multiplier',
- comma: comma,
- min: range.min,
- max: range.max,
- term: null
- };
- }
-
- function maybeMultiplied(tokenizer, node) {
- var multiplier = readMultiplier(tokenizer);
-
- if (multiplier !== null) {
- multiplier.term = node;
- return multiplier;
- }
-
- return node;
- }
-
- function maybeToken(tokenizer) {
- var ch = tokenizer.peek();
-
- if (ch === '') {
- return null;
- }
-
- return {
- type: 'Token',
- value: ch
- };
- }
-
- function readProperty$1(tokenizer) {
- var name;
-
- tokenizer.eat(LESSTHANSIGN);
- tokenizer.eat(APOSTROPHE);
-
- name = scanWord(tokenizer);
-
- tokenizer.eat(APOSTROPHE);
- tokenizer.eat(GREATERTHANSIGN$2);
-
- return maybeMultiplied(tokenizer, {
- type: 'Property',
- name: name
- });
- }
-
- // https://drafts.csswg.org/css-values-3/#numeric-ranges
- // 4.1. Range Restrictions and Range Definition Notation
- //
- // Range restrictions can be annotated in the numeric type notation using CSS bracketed
- // range notation—[min,max]—within the angle brackets, after the identifying keyword,
- // indicating a closed range between (and including) min and max.
- // For example, indicates an integer between 0 and 10, inclusive.
- function readTypeRange(tokenizer) {
- // use null for Infinity to make AST format JSON serializable/deserializable
- var min = null; // -Infinity
- var max = null; // Infinity
- var sign = 1;
-
- tokenizer.eat(LEFTSQUAREBRACKET$4);
-
- if (tokenizer.charCode() === HYPERMINUS) {
- tokenizer.peek();
- sign = -1;
- }
-
- if (sign == -1 && tokenizer.charCode() === INFINITY) {
- tokenizer.peek();
- } else {
- min = sign * Number(scanNumber(tokenizer));
- }
-
- scanSpaces(tokenizer);
- tokenizer.eat(COMMA$4);
- scanSpaces(tokenizer);
-
- if (tokenizer.charCode() === INFINITY) {
- tokenizer.peek();
- } else {
- sign = 1;
-
- if (tokenizer.charCode() === HYPERMINUS) {
- tokenizer.peek();
- sign = -1;
- }
-
- max = sign * Number(scanNumber(tokenizer));
- }
-
- tokenizer.eat(RIGHTSQUAREBRACKET$2);
-
- // If no range is indicated, either by using the bracketed range notation
- // or in the property description, then [−∞,∞] is assumed.
- if (min === null && max === null) {
- return null;
- }
-
- return {
- type: 'Range',
- min: min,
- max: max
- };
- }
-
- function readType(tokenizer) {
- var name;
- var opts = null;
-
- tokenizer.eat(LESSTHANSIGN);
- name = scanWord(tokenizer);
-
- if (tokenizer.charCode() === LEFTPARENTHESIS$7 &&
- tokenizer.nextCharCode() === RIGHTPARENTHESIS$7) {
- tokenizer.pos += 2;
- name += '()';
- }
-
- if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET$4) {
- scanSpaces(tokenizer);
- opts = readTypeRange(tokenizer);
- }
-
- tokenizer.eat(GREATERTHANSIGN$2);
-
- return maybeMultiplied(tokenizer, {
- type: 'Type',
- name: name,
- opts: opts
- });
- }
-
- function readKeywordOrFunction(tokenizer) {
- var name;
-
- name = scanWord(tokenizer);
-
- if (tokenizer.charCode() === LEFTPARENTHESIS$7) {
- tokenizer.pos++;
-
- return {
- type: 'Function',
- name: name
- };
- }
-
- return maybeMultiplied(tokenizer, {
- type: 'Keyword',
- name: name
- });
- }
-
- function regroupTerms(terms, combinators) {
- function createGroup(terms, combinator) {
- return {
- type: 'Group',
- terms: terms,
- combinator: combinator,
- disallowEmpty: false,
- explicit: false
- };
- }
-
- combinators = Object.keys(combinators).sort(function(a, b) {
- return COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b];
- });
-
- while (combinators.length > 0) {
- var combinator = combinators.shift();
- for (var i = 0, subgroupStart = 0; i < terms.length; i++) {
- var term = terms[i];
- if (term.type === 'Combinator') {
- if (term.value === combinator) {
- if (subgroupStart === -1) {
- subgroupStart = i - 1;
- }
- terms.splice(i, 1);
- i--;
- } else {
- if (subgroupStart !== -1 && i - subgroupStart > 1) {
- terms.splice(
- subgroupStart,
- i - subgroupStart,
- createGroup(terms.slice(subgroupStart, i), combinator)
- );
- i = subgroupStart + 1;
- }
- subgroupStart = -1;
- }
- }
- }
-
- if (subgroupStart !== -1 && combinators.length) {
- terms.splice(
- subgroupStart,
- i - subgroupStart,
- createGroup(terms.slice(subgroupStart, i), combinator)
- );
- }
- }
-
- return combinator;
- }
-
- function readImplicitGroup(tokenizer) {
- var terms = [];
- var combinators = {};
- var token;
- var prevToken = null;
- var prevTokenPos = tokenizer.pos;
-
- while (token = peek(tokenizer)) {
- if (token.type !== 'Spaces') {
- if (token.type === 'Combinator') {
- // check for combinator in group beginning and double combinator sequence
- if (prevToken === null || prevToken.type === 'Combinator') {
- tokenizer.pos = prevTokenPos;
- tokenizer.error('Unexpected combinator');
- }
-
- combinators[token.value] = true;
- } else if (prevToken !== null && prevToken.type !== 'Combinator') {
- combinators[' '] = true; // a b
- terms.push({
- type: 'Combinator',
- value: ' '
- });
- }
-
- terms.push(token);
- prevToken = token;
- prevTokenPos = tokenizer.pos;
- }
- }
-
- // check for combinator in group ending
- if (prevToken !== null && prevToken.type === 'Combinator') {
- tokenizer.pos -= prevTokenPos;
- tokenizer.error('Unexpected combinator');
- }
-
- return {
- type: 'Group',
- terms: terms,
- combinator: regroupTerms(terms, combinators) || ' ',
- disallowEmpty: false,
- explicit: false
- };
- }
-
- function readGroup(tokenizer) {
- var result;
-
- tokenizer.eat(LEFTSQUAREBRACKET$4);
- result = readImplicitGroup(tokenizer);
- tokenizer.eat(RIGHTSQUAREBRACKET$2);
-
- result.explicit = true;
-
- if (tokenizer.charCode() === EXCLAMATIONMARK$3) {
- tokenizer.pos++;
- result.disallowEmpty = true;
- }
-
- return result;
- }
-
- function peek(tokenizer) {
- var code = tokenizer.charCode();
-
- if (code < 128 && NAME_CHAR[code] === 1) {
- return readKeywordOrFunction(tokenizer);
- }
-
- switch (code) {
- case RIGHTSQUAREBRACKET$2:
- // don't eat, stop scan a group
- break;
-
- case LEFTSQUAREBRACKET$4:
- return maybeMultiplied(tokenizer, readGroup(tokenizer));
-
- case LESSTHANSIGN:
- return tokenizer.nextCharCode() === APOSTROPHE
- ? readProperty$1(tokenizer)
- : readType(tokenizer);
-
- case VERTICALLINE$3:
- return {
- type: 'Combinator',
- value: tokenizer.substringToPos(
- tokenizer.nextCharCode() === VERTICALLINE$3
- ? tokenizer.pos + 2
- : tokenizer.pos + 1
- )
- };
-
- case AMPERSAND$1:
- tokenizer.pos++;
- tokenizer.eat(AMPERSAND$1);
-
- return {
- type: 'Combinator',
- value: '&&'
- };
-
- case COMMA$4:
- tokenizer.pos++;
- return {
- type: 'Comma'
- };
-
- case APOSTROPHE:
- return maybeMultiplied(tokenizer, {
- type: 'String',
- value: scanString(tokenizer)
- });
-
- case SPACE$1:
- case TAB:
- case N$2:
- case R$1:
- case F$1:
- return {
- type: 'Spaces',
- value: scanSpaces(tokenizer)
- };
-
- case COMMERCIALAT:
- code = tokenizer.nextCharCode();
-
- if (code < 128 && NAME_CHAR[code] === 1) {
- tokenizer.pos++;
- return {
- type: 'AtKeyword',
- name: scanWord(tokenizer)
- };
- }
-
- return maybeToken(tokenizer);
-
- case ASTERISK$6:
- case PLUSSIGN$6:
- case QUESTIONMARK$1:
- case NUMBERSIGN$4:
- case EXCLAMATIONMARK$3:
- // prohibited tokens (used as a multiplier start)
- break;
-
- case LEFTCURLYBRACKET$4:
- // LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
- // check next char isn't a number, because it's likely a disjoined multiplier
- code = tokenizer.nextCharCode();
-
- if (code < 48 || code > 57) {
- return maybeToken(tokenizer);
- }
-
- break;
-
- default:
- return maybeToken(tokenizer);
- }
- }
-
- function parse$2(source) {
- var tokenizer = new Tokenizer(source);
- var result = readImplicitGroup(tokenizer);
-
- if (tokenizer.pos !== source.length) {
- tokenizer.error('Unexpected input');
- }
-
- // reduce redundant groups with single group term
- if (result.terms.length === 1 && result.terms[0].type === 'Group') {
- result = result.terms[0];
- }
-
- return result;
- }
-
- // warm up parse to elimitate code branches that never execute
- // fix soft deoptimizations (insufficient type feedback)
- parse$2('[a&&#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
-
- var parse_1 = parse$2;
-
- var noop$2 = function() {};
-
- function ensureFunction$1(value) {
- return typeof value === 'function' ? value : noop$2;
- }
-
- var walk$1 = function(node, options, context) {
- function walk(node) {
- enter.call(context, node);
-
- switch (node.type) {
- case 'Group':
- node.terms.forEach(walk);
- break;
-
- case 'Multiplier':
- walk(node.term);
- break;
-
- case 'Type':
- case 'Property':
- case 'Keyword':
- case 'AtKeyword':
- case 'Function':
- case 'String':
- case 'Token':
- case 'Comma':
- break;
-
- default:
- throw new Error('Unknown type: ' + node.type);
- }
-
- leave.call(context, node);
- }
-
- var enter = noop$2;
- var leave = noop$2;
-
- if (typeof options === 'function') {
- enter = options;
- } else if (options) {
- enter = ensureFunction$1(options.enter);
- leave = ensureFunction$1(options.leave);
- }
-
- if (enter === noop$2 && leave === noop$2) {
- throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
- }
-
- walk(node);
- };
-
- var tokenize$2 = tokenizer$3;
- var TokenStream$2 = TokenStream_1;
- var tokenStream = new TokenStream$2();
- var astToTokens = {
- decorator: function(handlers) {
- var curNode = null;
- var prev = { len: 0, node: null };
- var nodes = [prev];
- var buffer = '';
-
- return {
- children: handlers.children,
- node: function(node) {
- var tmp = curNode;
- curNode = node;
- handlers.node.call(this, node);
- curNode = tmp;
- },
- chunk: function(chunk) {
- buffer += chunk;
- if (prev.node !== curNode) {
- nodes.push({
- len: chunk.length,
- node: curNode
- });
- } else {
- prev.len += chunk.length;
- }
- },
- result: function() {
- return prepareTokens$1(buffer, nodes);
- }
- };
- }
- };
-
- function prepareTokens$1(str, nodes) {
- var tokens = [];
- var nodesOffset = 0;
- var nodesIndex = 0;
- var currentNode = nodes ? nodes[nodesIndex].node : null;
-
- tokenize$2(str, tokenStream);
-
- while (!tokenStream.eof) {
- if (nodes) {
- while (nodesIndex < nodes.length && nodesOffset + nodes[nodesIndex].len <= tokenStream.tokenStart) {
- nodesOffset += nodes[nodesIndex++].len;
- currentNode = nodes[nodesIndex].node;
- }
- }
-
- tokens.push({
- type: tokenStream.tokenType,
- value: tokenStream.getTokenValue(),
- index: tokenStream.tokenIndex, // TODO: remove it, temporary solution
- balance: tokenStream.balance[tokenStream.tokenIndex], // TODO: remove it, temporary solution
- node: currentNode
- });
- tokenStream.next();
- // console.log({ ...tokens[tokens.length - 1], node: undefined });
- }
-
- return tokens;
- }
-
- var prepareTokens_1 = function(value, syntax) {
- if (typeof value === 'string') {
- return prepareTokens$1(value, null);
- }
-
- return syntax.generate(value, astToTokens);
- };
-
- var parse$1 = parse_1;
-
- var MATCH$1 = { type: 'Match' };
- var MISMATCH$1 = { type: 'Mismatch' };
- var DISALLOW_EMPTY$1 = { type: 'DisallowEmpty' };
- var LEFTPARENTHESIS$6 = 40; // (
- var RIGHTPARENTHESIS$6 = 41; // )
-
- function createCondition(match, thenBranch, elseBranch) {
- // reduce node count
- if (thenBranch === MATCH$1 && elseBranch === MISMATCH$1) {
- return match;
- }
-
- if (match === MATCH$1 && thenBranch === MATCH$1 && elseBranch === MATCH$1) {
- return match;
- }
-
- if (match.type === 'If' && match.else === MISMATCH$1 && thenBranch === MATCH$1) {
- thenBranch = match.then;
- match = match.match;
- }
-
- return {
- type: 'If',
- match: match,
- then: thenBranch,
- else: elseBranch
- };
- }
-
- function isFunctionType(name) {
- return (
- name.length > 2 &&
- name.charCodeAt(name.length - 2) === LEFTPARENTHESIS$6 &&
- name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS$6
- );
- }
-
- function isEnumCapatible(term) {
- return (
- term.type === 'Keyword' ||
- term.type === 'AtKeyword' ||
- term.type === 'Function' ||
- term.type === 'Type' && isFunctionType(term.name)
- );
- }
-
- function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
- switch (combinator) {
- case ' ':
- // Juxtaposing components means that all of them must occur, in the given order.
- //
- // a b c
- // =
- // match a
- // then match b
- // then match c
- // then MATCH
- // else MISMATCH
- // else MISMATCH
- // else MISMATCH
- var result = MATCH$1;
-
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
-
- result = createCondition(
- term,
- result,
- MISMATCH$1
- );
- }
- return result;
-
- case '|':
- // A bar (|) separates two or more alternatives: exactly one of them must occur.
- //
- // a | b | c
- // =
- // match a
- // then MATCH
- // else match b
- // then MATCH
- // else match c
- // then MATCH
- // else MISMATCH
-
- var result = MISMATCH$1;
- var map = null;
-
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
-
- // reduce sequence of keywords into a Enum
- if (isEnumCapatible(term)) {
- if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
- map = Object.create(null);
- result = createCondition(
- {
- type: 'Enum',
- map: map
- },
- MATCH$1,
- result
- );
- }
-
- if (map !== null) {
- var key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
- if (key in map === false) {
- map[key] = term;
- continue;
- }
- }
- }
-
- map = null;
-
- // create a new conditonal node
- result = createCondition(
- term,
- MATCH$1,
- result
- );
- }
- return result;
-
- case '&&':
- // A double ampersand (&&) separates two or more components,
- // all of which must occur, in any order.
-
- // Use MatchOnce for groups with a large number of terms,
- // since &&-groups produces at least N!-node trees
- if (terms.length > 5) {
- return {
- type: 'MatchOnce',
- terms: terms,
- all: true
- };
- }
-
- // Use a combination tree for groups with small number of terms
- //
- // a && b && c
- // =
- // match a
- // then [b && c]
- // else match b
- // then [a && c]
- // else match c
- // then [a && b]
- // else MISMATCH
- //
- // a && b
- // =
- // match a
- // then match b
- // then MATCH
- // else MISMATCH
- // else match b
- // then match a
- // then MATCH
- // else MISMATCH
- // else MISMATCH
- var result = MISMATCH$1;
-
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
- var thenClause;
-
- if (terms.length > 1) {
- thenClause = buildGroupMatchGraph(
- combinator,
- terms.filter(function(newGroupTerm) {
- return newGroupTerm !== term;
- }),
- false
- );
- } else {
- thenClause = MATCH$1;
- }
-
- result = createCondition(
- term,
- thenClause,
- result
- );
- }
- return result;
-
- case '||':
- // A double bar (||) separates two or more options:
- // one or more of them must occur, in any order.
-
- // Use MatchOnce for groups with a large number of terms,
- // since ||-groups produces at least N!-node trees
- if (terms.length > 5) {
- return {
- type: 'MatchOnce',
- terms: terms,
- all: false
- };
- }
-
- // Use a combination tree for groups with small number of terms
- //
- // a || b || c
- // =
- // match a
- // then [b || c]
- // else match b
- // then [a || c]
- // else match c
- // then [a || b]
- // else MISMATCH
- //
- // a || b
- // =
- // match a
- // then match b
- // then MATCH
- // else MATCH
- // else match b
- // then match a
- // then MATCH
- // else MATCH
- // else MISMATCH
- var result = atLeastOneTermMatched ? MATCH$1 : MISMATCH$1;
-
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
- var thenClause;
-
- if (terms.length > 1) {
- thenClause = buildGroupMatchGraph(
- combinator,
- terms.filter(function(newGroupTerm) {
- return newGroupTerm !== term;
- }),
- true
- );
- } else {
- thenClause = MATCH$1;
- }
-
- result = createCondition(
- term,
- thenClause,
- result
- );
- }
- return result;
- }
- }
-
- function buildMultiplierMatchGraph(node) {
- var result = MATCH$1;
- var matchTerm = buildMatchGraph$1(node.term);
-
- if (node.max === 0) {
- // disable repeating of empty match to prevent infinite loop
- matchTerm = createCondition(
- matchTerm,
- DISALLOW_EMPTY$1,
- MISMATCH$1
- );
-
- // an occurrence count is not limited, make a cycle;
- // to collect more terms on each following matching mismatch
- result = createCondition(
- matchTerm,
- null, // will be a loop
- MISMATCH$1
- );
-
- result.then = createCondition(
- MATCH$1,
- MATCH$1,
- result // make a loop
- );
-
- if (node.comma) {
- result.then.else = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH$1
- );
- }
- } else {
- // create a match node chain for [min .. max] interval with optional matches
- for (var i = node.min || 1; i <= node.max; i++) {
- if (node.comma && result !== MATCH$1) {
- result = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH$1
- );
- }
-
- result = createCondition(
- matchTerm,
- createCondition(
- MATCH$1,
- MATCH$1,
- result
- ),
- MISMATCH$1
- );
- }
- }
-
- if (node.min === 0) {
- // allow zero match
- result = createCondition(
- MATCH$1,
- MATCH$1,
- result
- );
- } else {
- // create a match node chain to collect [0 ... min - 1] required matches
- for (var i = 0; i < node.min - 1; i++) {
- if (node.comma && result !== MATCH$1) {
- result = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH$1
- );
- }
-
- result = createCondition(
- matchTerm,
- result,
- MISMATCH$1
- );
- }
- }
-
- return result;
- }
-
- function buildMatchGraph$1(node) {
- if (typeof node === 'function') {
- return {
- type: 'Generic',
- fn: node
- };
- }
-
- switch (node.type) {
- case 'Group':
- var result = buildGroupMatchGraph(
- node.combinator,
- node.terms.map(buildMatchGraph$1),
- false
- );
-
- if (node.disallowEmpty) {
- result = createCondition(
- result,
- DISALLOW_EMPTY$1,
- MISMATCH$1
- );
- }
-
- return result;
-
- case 'Multiplier':
- return buildMultiplierMatchGraph(node);
-
- case 'Type':
- case 'Property':
- return {
- type: node.type,
- name: node.name,
- syntax: node
- };
-
- case 'Keyword':
- return {
- type: node.type,
- name: node.name.toLowerCase(),
- syntax: node
- };
-
- case 'AtKeyword':
- return {
- type: node.type,
- name: '@' + node.name.toLowerCase(),
- syntax: node
- };
-
- case 'Function':
- return {
- type: node.type,
- name: node.name.toLowerCase() + '(',
- syntax: node
- };
-
- case 'String':
- // convert a one char length String to a Token
- if (node.value.length === 3) {
- return {
- type: 'Token',
- value: node.value.charAt(1),
- syntax: node
- };
- }
-
- // otherwise use it as is
- return {
- type: node.type,
- value: node.value.substr(1, node.value.length - 2).replace(/\\'/g, '\''),
- syntax: node
- };
-
- case 'Token':
- return {
- type: node.type,
- value: node.value,
- syntax: node
- };
-
- case 'Comma':
- return {
- type: node.type,
- syntax: node
- };
-
- default:
- throw new Error('Unknown node type:', node.type);
- }
- }
-
- var matchGraph$1 = {
- MATCH: MATCH$1,
- MISMATCH: MISMATCH$1,
- DISALLOW_EMPTY: DISALLOW_EMPTY$1,
- buildMatchGraph: function(syntaxTree, ref) {
- if (typeof syntaxTree === 'string') {
- syntaxTree = parse$1(syntaxTree);
- }
-
- return {
- type: 'MatchGraph',
- match: buildMatchGraph$1(syntaxTree),
- syntax: ref || null,
- source: syntaxTree
- };
- }
- };
-
- var hasOwnProperty$6 = Object.prototype.hasOwnProperty;
- var matchGraph = matchGraph$1;
- var MATCH = matchGraph.MATCH;
- var MISMATCH = matchGraph.MISMATCH;
- var DISALLOW_EMPTY = matchGraph.DISALLOW_EMPTY;
- var TYPE$B = _const.TYPE;
-
- var STUB = 0;
- var TOKEN = 1;
- var OPEN_SYNTAX = 2;
- var CLOSE_SYNTAX = 3;
-
- var EXIT_REASON_MATCH = 'Match';
- var EXIT_REASON_MISMATCH = 'Mismatch';
- var EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';
-
- var ITERATION_LIMIT = 15000;
- var totalIterationCount = 0;
-
- function reverseList(list) {
- var prev = null;
- var next = null;
- var item = list;
-
- while (item !== null) {
- next = item.prev;
- item.prev = prev;
- prev = item;
- item = next;
- }
-
- return prev;
- }
-
- function areStringsEqualCaseInsensitive(testStr, referenceStr) {
- if (testStr.length !== referenceStr.length) {
- return false;
- }
-
- for (var i = 0; i < testStr.length; i++) {
- var testCode = testStr.charCodeAt(i);
- var referenceCode = referenceStr.charCodeAt(i);
-
- // testCode.toLowerCase() for U+0041 LATIN CAPITAL LETTER A (A) .. U+005A LATIN CAPITAL LETTER Z (Z).
- if (testCode >= 0x0041 && testCode <= 0x005A) {
- testCode = testCode | 32;
- }
-
- if (testCode !== referenceCode) {
- return false;
- }
- }
-
- return true;
- }
-
- function isContextEdgeDelim(token) {
- if (token.type !== TYPE$B.Delim) {
- return false;
- }
-
- // Fix matching for unicode-range: U+30??, U+FF00-FF9F
- // Probably we need to check out previous match instead
- return token.value !== '?';
- }
-
- function isCommaContextStart(token) {
- if (token === null) {
- return true;
- }
-
- return (
- token.type === TYPE$B.Comma ||
- token.type === TYPE$B.Function ||
- token.type === TYPE$B.LeftParenthesis ||
- token.type === TYPE$B.LeftSquareBracket ||
- token.type === TYPE$B.LeftCurlyBracket ||
- isContextEdgeDelim(token)
- );
- }
-
- function isCommaContextEnd(token) {
- if (token === null) {
- return true;
- }
-
- return (
- token.type === TYPE$B.RightParenthesis ||
- token.type === TYPE$B.RightSquareBracket ||
- token.type === TYPE$B.RightCurlyBracket ||
- token.type === TYPE$B.Delim
- );
- }
-
- function internalMatch(tokens, state, syntaxes) {
- function moveToNextToken() {
- do {
- tokenIndex++;
- token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
- } while (token !== null && (token.type === TYPE$B.WhiteSpace || token.type === TYPE$B.Comment));
- }
-
- function getNextToken(offset) {
- var nextIndex = tokenIndex + offset;
-
- return nextIndex < tokens.length ? tokens[nextIndex] : null;
- }
-
- function stateSnapshotFromSyntax(nextState, prev) {
- return {
- nextState: nextState,
- matchStack: matchStack,
- syntaxStack: syntaxStack,
- thenStack: thenStack,
- tokenIndex: tokenIndex,
- prev: prev
- };
- }
-
- function pushThenStack(nextState) {
- thenStack = {
- nextState: nextState,
- matchStack: matchStack,
- syntaxStack: syntaxStack,
- prev: thenStack
- };
- }
-
- function pushElseStack(nextState) {
- elseStack = stateSnapshotFromSyntax(nextState, elseStack);
- }
-
- function addTokenToMatch() {
- matchStack = {
- type: TOKEN,
- syntax: state.syntax,
- token: token,
- prev: matchStack
- };
-
- moveToNextToken();
- syntaxStash = null;
-
- if (tokenIndex > longestMatch) {
- longestMatch = tokenIndex;
- }
- }
-
- function openSyntax() {
- syntaxStack = {
- syntax: state.syntax,
- opts: state.syntax.opts || (syntaxStack !== null && syntaxStack.opts) || null,
- prev: syntaxStack
- };
-
- matchStack = {
- type: OPEN_SYNTAX,
- syntax: state.syntax,
- token: matchStack.token,
- prev: matchStack
- };
- }
-
- function closeSyntax() {
- if (matchStack.type === OPEN_SYNTAX) {
- matchStack = matchStack.prev;
- } else {
- matchStack = {
- type: CLOSE_SYNTAX,
- syntax: syntaxStack.syntax,
- token: matchStack.token,
- prev: matchStack
- };
- }
-
- syntaxStack = syntaxStack.prev;
- }
-
- var syntaxStack = null;
- var thenStack = null;
- var elseStack = null;
-
- // null – stashing allowed, nothing stashed
- // false – stashing disabled, nothing stashed
- // anithing else – fail stashable syntaxes, some syntax stashed
- var syntaxStash = null;
-
- var iterationCount = 0; // count iterations and prevent infinite loop
- var exitReason = null;
-
- var token = null;
- var tokenIndex = -1;
- var longestMatch = 0;
- var matchStack = {
- type: STUB,
- syntax: null,
- token: null,
- prev: null
- };
-
- moveToNextToken();
-
- while (exitReason === null && ++iterationCount < ITERATION_LIMIT) {
- // function mapList(list, fn) {
- // var result = [];
- // while (list) {
- // result.unshift(fn(list));
- // list = list.prev;
- // }
- // return result;
- // }
- // console.log('--\n',
- // '#' + iterationCount,
- // require('util').inspect({
- // match: mapList(matchStack, x => x.type === TOKEN ? x.token && x.token.value : x.syntax ? ({ [OPEN_SYNTAX]: '<', [CLOSE_SYNTAX]: '' }[x.type] || x.type) + '!' + x.syntax.name : null),
- // token: token && token.value,
- // tokenIndex,
- // syntax: syntax.type + (syntax.id ? ' #' + syntax.id : '')
- // }, { depth: null })
- // );
- switch (state.type) {
- case 'Match':
- if (thenStack === null) {
- // turn to MISMATCH when some tokens left unmatched
- if (token !== null) {
- // doesn't mismatch if just one token left and it's an IE hack
- if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
- state = MISMATCH;
- break;
- }
- }
-
- // break the main loop, return a result - MATCH
- exitReason = EXIT_REASON_MATCH;
- break;
- }
-
- // go to next syntax (`then` branch)
- state = thenStack.nextState;
-
- // check match is not empty
- if (state === DISALLOW_EMPTY) {
- if (thenStack.matchStack === matchStack) {
- state = MISMATCH;
- break;
- } else {
- state = MATCH;
- }
- }
-
- // close syntax if needed
- while (thenStack.syntaxStack !== syntaxStack) {
- closeSyntax();
- }
-
- // pop stack
- thenStack = thenStack.prev;
- break;
-
- case 'Mismatch':
- // when some syntax is stashed
- if (syntaxStash !== null && syntaxStash !== false) {
- // there is no else branches or a branch reduce match stack
- if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
- // restore state from the stash
- elseStack = syntaxStash;
- syntaxStash = false; // disable stashing
- }
- } else if (elseStack === null) {
- // no else branches -> break the main loop
- // return a result - MISMATCH
- exitReason = EXIT_REASON_MISMATCH;
- break;
- }
-
- // go to next syntax (`else` branch)
- state = elseStack.nextState;
-
- // restore all the rest stack states
- thenStack = elseStack.thenStack;
- syntaxStack = elseStack.syntaxStack;
- matchStack = elseStack.matchStack;
- tokenIndex = elseStack.tokenIndex;
- token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
-
- // pop stack
- elseStack = elseStack.prev;
- break;
-
- case 'MatchGraph':
- state = state.match;
- break;
-
- case 'If':
- // IMPORTANT: else stack push must go first,
- // since it stores the state of thenStack before changes
- if (state.else !== MISMATCH) {
- pushElseStack(state.else);
- }
-
- if (state.then !== MATCH) {
- pushThenStack(state.then);
- }
-
- state = state.match;
- break;
-
- case 'MatchOnce':
- state = {
- type: 'MatchOnceBuffer',
- syntax: state,
- index: 0,
- mask: 0
- };
- break;
-
- case 'MatchOnceBuffer':
- var terms = state.syntax.terms;
-
- if (state.index === terms.length) {
- // no matches at all or it's required all terms to be matched
- if (state.mask === 0 || state.syntax.all) {
- state = MISMATCH;
- break;
- }
-
- // a partial match is ok
- state = MATCH;
- break;
- }
-
- // all terms are matched
- if (state.mask === (1 << terms.length) - 1) {
- state = MATCH;
- break;
- }
-
- for (; state.index < terms.length; state.index++) {
- var matchFlag = 1 << state.index;
-
- if ((state.mask & matchFlag) === 0) {
- // IMPORTANT: else stack push must go first,
- // since it stores the state of thenStack before changes
- pushElseStack(state);
- pushThenStack({
- type: 'AddMatchOnce',
- syntax: state.syntax,
- mask: state.mask | matchFlag
- });
-
- // match
- state = terms[state.index++];
- break;
- }
- }
- break;
-
- case 'AddMatchOnce':
- state = {
- type: 'MatchOnceBuffer',
- syntax: state.syntax,
- index: 0,
- mask: state.mask
- };
- break;
-
- case 'Enum':
- if (token !== null) {
- var name = token.value.toLowerCase();
-
- // drop \0 and \9 hack from keyword name
- if (name.indexOf('\\') !== -1) {
- name = name.replace(/\\[09].*$/, '');
- }
-
- if (hasOwnProperty$6.call(state.map, name)) {
- state = state.map[name];
- break;
- }
- }
-
- state = MISMATCH;
- break;
-
- case 'Generic':
- var opts = syntaxStack !== null ? syntaxStack.opts : null;
- var lastTokenIndex = tokenIndex + Math.floor(state.fn(token, getNextToken, opts));
-
- if (!isNaN(lastTokenIndex) && lastTokenIndex > tokenIndex) {
- while (tokenIndex < lastTokenIndex) {
- addTokenToMatch();
- }
-
- state = MATCH;
- } else {
- state = MISMATCH;
- }
-
- break;
-
- case 'Type':
- case 'Property':
- var syntaxDict = state.type === 'Type' ? 'types' : 'properties';
- var dictSyntax = hasOwnProperty$6.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
-
- if (!dictSyntax || !dictSyntax.match) {
- throw new Error(
- 'Bad syntax reference: ' +
- (state.type === 'Type'
- ? '<' + state.name + '>'
- : '<\'' + state.name + '\'>')
- );
- }
-
- // stash a syntax for types with low priority
- if (syntaxStash !== false && token !== null && state.type === 'Type') {
- var lowPriorityMatching =
- // https://drafts.csswg.org/css-values-4/#custom-idents
- // When parsing positionally-ambiguous keywords in a property value, a production
- // can only claim the keyword if no other unfulfilled production can claim it.
- (state.name === 'custom-ident' && token.type === TYPE$B.Ident) ||
-
- // https://drafts.csswg.org/css-values-4/#lengths
- // ... if a `0` could be parsed as either a or a in a property (such as line-height),
- // it must parse as a
- (state.name === 'length' && token.value === '0');
-
- if (lowPriorityMatching) {
- if (syntaxStash === null) {
- syntaxStash = stateSnapshotFromSyntax(state, elseStack);
- }
-
- state = MISMATCH;
- break;
- }
- }
-
- openSyntax();
- state = dictSyntax.match;
- break;
-
- case 'Keyword':
- var name = state.name;
-
- if (token !== null) {
- var keywordName = token.value;
-
- // drop \0 and \9 hack from keyword name
- if (keywordName.indexOf('\\') !== -1) {
- keywordName = keywordName.replace(/\\[09].*$/, '');
- }
-
- if (areStringsEqualCaseInsensitive(keywordName, name)) {
- addTokenToMatch();
- state = MATCH;
- break;
- }
- }
-
- state = MISMATCH;
- break;
-
- case 'AtKeyword':
- case 'Function':
- if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
- addTokenToMatch();
- state = MATCH;
- break;
- }
-
- state = MISMATCH;
- break;
-
- case 'Token':
- if (token !== null && token.value === state.value) {
- addTokenToMatch();
- state = MATCH;
- break;
- }
-
- state = MISMATCH;
- break;
-
- case 'Comma':
- if (token !== null && token.type === TYPE$B.Comma) {
- if (isCommaContextStart(matchStack.token)) {
- state = MISMATCH;
- } else {
- addTokenToMatch();
- state = isCommaContextEnd(token) ? MISMATCH : MATCH;
- }
- } else {
- state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
- }
-
- break;
-
- case 'String':
- var string = '';
-
- for (var lastTokenIndex = tokenIndex; lastTokenIndex < tokens.length && string.length < state.value.length; lastTokenIndex++) {
- string += tokens[lastTokenIndex].value;
- }
-
- if (areStringsEqualCaseInsensitive(string, state.value)) {
- while (tokenIndex < lastTokenIndex) {
- addTokenToMatch();
- }
-
- state = MATCH;
- } else {
- state = MISMATCH;
- }
-
- break;
-
- default:
- throw new Error('Unknown node type: ' + state.type);
- }
- }
-
- totalIterationCount += iterationCount;
-
- switch (exitReason) {
- case null:
- console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
- exitReason = EXIT_REASON_ITERATION_LIMIT;
- matchStack = null;
- break;
-
- case EXIT_REASON_MATCH:
- while (syntaxStack !== null) {
- closeSyntax();
- }
- break;
-
- default:
- matchStack = null;
- }
-
- return {
- tokens: tokens,
- reason: exitReason,
- iterations: iterationCount,
- match: matchStack,
- longestMatch: longestMatch
- };
- }
-
- function matchAsList(tokens, matchGraph, syntaxes) {
- var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
-
- if (matchResult.match !== null) {
- var item = reverseList(matchResult.match).prev;
-
- matchResult.match = [];
-
- while (item !== null) {
- switch (item.type) {
- case STUB:
- break;
-
- case OPEN_SYNTAX:
- case CLOSE_SYNTAX:
- matchResult.match.push({
- type: item.type,
- syntax: item.syntax
- });
- break;
-
- default:
- matchResult.match.push({
- token: item.token.value,
- node: item.token.node
- });
- break;
- }
-
- item = item.prev;
- }
- }
-
- return matchResult;
- }
-
- function matchAsTree$1(tokens, matchGraph, syntaxes) {
- var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
-
- if (matchResult.match === null) {
- return matchResult;
- }
-
- var item = matchResult.match;
- var host = matchResult.match = {
- syntax: matchGraph.syntax || null,
- match: []
- };
- var hostStack = [host];
-
- // revert a list and start with 2nd item since 1st is a stub item
- item = reverseList(item).prev;
-
- // build a tree
- while (item !== null) {
- switch (item.type) {
- case OPEN_SYNTAX:
- host.match.push(host = {
- syntax: item.syntax,
- match: []
- });
- hostStack.push(host);
- break;
-
- case CLOSE_SYNTAX:
- hostStack.pop();
- host = hostStack[hostStack.length - 1];
- break;
-
- default:
- host.match.push({
- syntax: item.syntax || null,
- token: item.token.value,
- node: item.token.node
- });
- }
-
- item = item.prev;
- }
-
- return matchResult;
- }
-
- var match = {
- matchAsList: matchAsList,
- matchAsTree: matchAsTree$1,
- getTotalIterationCount: function() {
- return totalIterationCount;
- }
- };
-
- function getTrace(node) {
- function shouldPutToTrace(syntax) {
- if (syntax === null) {
- return false;
- }
-
- return (
- syntax.type === 'Type' ||
- syntax.type === 'Property' ||
- syntax.type === 'Keyword'
- );
- }
-
- function hasMatch(matchNode) {
- if (Array.isArray(matchNode.match)) {
- // use for-loop for better perfomance
- for (var i = 0; i < matchNode.match.length; i++) {
- if (hasMatch(matchNode.match[i])) {
- if (shouldPutToTrace(matchNode.syntax)) {
- result.unshift(matchNode.syntax);
- }
-
- return true;
- }
- }
- } else if (matchNode.node === node) {
- result = shouldPutToTrace(matchNode.syntax)
- ? [matchNode.syntax]
- : [];
-
- return true;
- }
-
- return false;
- }
-
- var result = null;
-
- if (this.matched !== null) {
- hasMatch(this.matched);
- }
-
- return result;
- }
-
- function testNode(match, node, fn) {
- var trace = getTrace.call(match, node);
-
- if (trace === null) {
- return false;
- }
-
- return trace.some(fn);
- }
-
- function isType(node, type) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Type' && matchNode.name === type;
- });
- }
-
- function isProperty(node, property) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Property' && matchNode.name === property;
- });
- }
-
- function isKeyword(node) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Keyword';
- });
- }
-
- var trace$1 = {
- getTrace: getTrace,
- isType: isType,
- isProperty: isProperty,
- isKeyword: isKeyword
- };
-
- var List$5 = List_1;
-
- function getFirstMatchNode(matchNode) {
- if ('node' in matchNode) {
- return matchNode.node;
- }
-
- return getFirstMatchNode(matchNode.match[0]);
- }
-
- function getLastMatchNode(matchNode) {
- if ('node' in matchNode) {
- return matchNode.node;
- }
-
- return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
- }
-
- function matchFragments(lexer, ast, match, type, name) {
- function findFragments(matchNode) {
- if (matchNode.syntax !== null &&
- matchNode.syntax.type === type &&
- matchNode.syntax.name === name) {
- var start = getFirstMatchNode(matchNode);
- var end = getLastMatchNode(matchNode);
-
- lexer.syntax.walk(ast, function(node, item, list) {
- if (node === start) {
- var nodes = new List$5();
-
- do {
- nodes.appendData(item.data);
-
- if (item.data === end) {
- break;
- }
-
- item = item.next;
- } while (item !== null);
-
- fragments.push({
- parent: list,
- nodes: nodes
- });
- }
- });
- }
-
- if (Array.isArray(matchNode.match)) {
- matchNode.match.forEach(findFragments);
- }
- }
-
- var fragments = [];
-
- if (match.matched !== null) {
- findFragments(match.matched);
- }
-
- return fragments;
- }
-
- var search$1 = {
- matchFragments: matchFragments
- };
-
- var List$4 = List_1;
- var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
-
- function isValidNumber(value) {
- // Number.isInteger(value) && value >= 0
- return (
- typeof value === 'number' &&
- isFinite(value) &&
- Math.floor(value) === value &&
- value >= 0
- );
- }
-
- function isValidLocation(loc) {
- return (
- Boolean(loc) &&
- isValidNumber(loc.offset) &&
- isValidNumber(loc.line) &&
- isValidNumber(loc.column)
- );
- }
-
- function createNodeStructureChecker(type, fields) {
- return function checkNode(node, warn) {
- if (!node || node.constructor !== Object) {
- return warn(node, 'Type of node should be an Object');
- }
-
- for (var key in node) {
- var valid = true;
-
- if (hasOwnProperty$5.call(node, key) === false) {
- continue;
- }
-
- if (key === 'type') {
- if (node.type !== type) {
- warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
- }
- } else if (key === 'loc') {
- if (node.loc === null) {
- continue;
- } else if (node.loc && node.loc.constructor === Object) {
- if (typeof node.loc.source !== 'string') {
- key += '.source';
- } else if (!isValidLocation(node.loc.start)) {
- key += '.start';
- } else if (!isValidLocation(node.loc.end)) {
- key += '.end';
- } else {
- continue;
- }
- }
-
- valid = false;
- } else if (fields.hasOwnProperty(key)) {
- for (var i = 0, valid = false; !valid && i < fields[key].length; i++) {
- var fieldType = fields[key][i];
-
- switch (fieldType) {
- case String:
- valid = typeof node[key] === 'string';
- break;
-
- case Boolean:
- valid = typeof node[key] === 'boolean';
- break;
-
- case null:
- valid = node[key] === null;
- break;
-
- default:
- if (typeof fieldType === 'string') {
- valid = node[key] && node[key].type === fieldType;
- } else if (Array.isArray(fieldType)) {
- valid = node[key] instanceof List$4;
- }
- }
- }
- } else {
- warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
- }
-
- if (!valid) {
- warn(node, 'Bad value for `' + type + '.' + key + '`');
- }
- }
-
- for (var key in fields) {
- if (hasOwnProperty$5.call(fields, key) &&
- hasOwnProperty$5.call(node, key) === false) {
- warn(node, 'Field `' + type + '.' + key + '` is missed');
- }
- }
- };
- }
-
- function processStructure(name, nodeType) {
- var structure = nodeType.structure;
- var fields = {
- type: String,
- loc: true
- };
- var docs = {
- type: '"' + name + '"'
- };
-
- for (var key in structure) {
- if (hasOwnProperty$5.call(structure, key) === false) {
- continue;
- }
-
- var docsTypes = [];
- var fieldTypes = fields[key] = Array.isArray(structure[key])
- ? structure[key].slice()
- : [structure[key]];
-
- for (var i = 0; i < fieldTypes.length; i++) {
- var fieldType = fieldTypes[i];
- if (fieldType === String || fieldType === Boolean) {
- docsTypes.push(fieldType.name);
- } else if (fieldType === null) {
- docsTypes.push('null');
- } else if (typeof fieldType === 'string') {
- docsTypes.push('<' + fieldType + '>');
- } else if (Array.isArray(fieldType)) {
- docsTypes.push('List'); // TODO: use type enum
- } else {
- throw new Error('Wrong value `' + fieldType + '` in `' + name + '.' + key + '` structure definition');
- }
- }
-
- docs[key] = docsTypes.join(' | ');
- }
-
- return {
- docs: docs,
- check: createNodeStructureChecker(name, fields)
- };
- }
-
- var structure = {
- getStructureFromConfig: function(config) {
- var structure = {};
-
- if (config.node) {
- for (var name in config.node) {
- if (hasOwnProperty$5.call(config.node, name)) {
- var nodeType = config.node[name];
-
- if (nodeType.structure) {
- structure[name] = processStructure(name, nodeType);
- } else {
- throw new Error('Missed `structure` field in `' + name + '` node type definition');
- }
- }
- }
- }
-
- return structure;
- }
- };
-
- var SyntaxReferenceError = error.SyntaxReferenceError;
- var SyntaxMatchError = error.SyntaxMatchError;
- var names$1 = names$2;
- var generic = generic$1;
- var parse = parse_1;
- var generate = generate_1;
- var walk = walk$1;
- var prepareTokens = prepareTokens_1;
- var buildMatchGraph = matchGraph$1.buildMatchGraph;
- var matchAsTree = match.matchAsTree;
- var trace = trace$1;
- var search = search$1;
- var getStructureFromConfig = structure.getStructureFromConfig;
- var cssWideKeywords = buildMatchGraph('inherit | initial | unset');
- var cssWideKeywordsWithExpression = buildMatchGraph('inherit | initial | unset | <-ms-legacy-expression>');
-
- function dumpMapSyntax(map, compact, syntaxAsAst) {
- var result = {};
-
- for (var name in map) {
- if (map[name].syntax) {
- result[name] = syntaxAsAst
- ? map[name].syntax
- : generate(map[name].syntax, { compact: compact });
- }
- }
-
- return result;
- }
-
- function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
- const result = {};
-
- for (const [name, atrule] of Object.entries(map)) {
- result[name] = {
- prelude: atrule.prelude && (
- syntaxAsAst
- ? atrule.prelude.syntax
- : generate(atrule.prelude.syntax, { compact })
- ),
- descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
- };
- }
-
- return result;
- }
-
- function valueHasVar(tokens) {
- for (var i = 0; i < tokens.length; i++) {
- if (tokens[i].value.toLowerCase() === 'var(') {
- return true;
- }
- }
-
- return false;
- }
-
- function buildMatchResult(match, error, iterations) {
- return {
- matched: match,
- iterations: iterations,
- error: error,
- getTrace: trace.getTrace,
- isType: trace.isType,
- isProperty: trace.isProperty,
- isKeyword: trace.isKeyword
- };
- }
-
- function matchSyntax(lexer, syntax, value, useCommon) {
- var tokens = prepareTokens(value, lexer.syntax);
- var result;
-
- if (valueHasVar(tokens)) {
- return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
- }
-
- if (useCommon) {
- result = matchAsTree(tokens, lexer.valueCommonSyntax, lexer);
- }
-
- if (!useCommon || !result.match) {
- result = matchAsTree(tokens, syntax.match, lexer);
- if (!result.match) {
- return buildMatchResult(
- null,
- new SyntaxMatchError(result.reason, syntax.syntax, value, result),
- result.iterations
- );
- }
- }
-
- return buildMatchResult(result.match, null, result.iterations);
- }
-
- var Lexer$1 = function(config, syntax, structure) {
- this.valueCommonSyntax = cssWideKeywords;
- this.syntax = syntax;
- this.generic = false;
- this.atrules = {};
- this.properties = {};
- this.types = {};
- this.structure = structure || getStructureFromConfig(config);
-
- if (config) {
- if (config.types) {
- for (var name in config.types) {
- this.addType_(name, config.types[name]);
- }
- }
-
- if (config.generic) {
- this.generic = true;
- for (var name in generic) {
- this.addType_(name, generic[name]);
- }
- }
-
- if (config.atrules) {
- for (var name in config.atrules) {
- this.addAtrule_(name, config.atrules[name]);
- }
- }
-
- if (config.properties) {
- for (var name in config.properties) {
- this.addProperty_(name, config.properties[name]);
- }
- }
- }
- };
-
- Lexer$1.prototype = {
- structure: {},
- checkStructure: function(ast) {
- function collectWarning(node, message) {
- warns.push({
- node: node,
- message: message
- });
- }
-
- var structure = this.structure;
- var warns = [];
-
- this.syntax.walk(ast, function(node) {
- if (structure.hasOwnProperty(node.type)) {
- structure[node.type].check(node, collectWarning);
- } else {
- collectWarning(node, 'Unknown node type `' + node.type + '`');
- }
- });
-
- return warns.length ? warns : false;
- },
-
- createDescriptor: function(syntax, type, name, parent = null) {
- var ref = {
- type: type,
- name: name
- };
- var descriptor = {
- type: type,
- name: name,
- parent: parent,
- syntax: null,
- match: null
- };
-
- if (typeof syntax === 'function') {
- descriptor.match = buildMatchGraph(syntax, ref);
- } else {
- if (typeof syntax === 'string') {
- // lazy parsing on first access
- Object.defineProperty(descriptor, 'syntax', {
- get: function() {
- Object.defineProperty(descriptor, 'syntax', {
- value: parse(syntax)
- });
-
- return descriptor.syntax;
- }
- });
- } else {
- descriptor.syntax = syntax;
- }
-
- // lazy graph build on first access
- Object.defineProperty(descriptor, 'match', {
- get: function() {
- Object.defineProperty(descriptor, 'match', {
- value: buildMatchGraph(descriptor.syntax, ref)
- });
-
- return descriptor.match;
- }
- });
- }
-
- return descriptor;
- },
- addAtrule_: function(name, syntax) {
- if (!syntax) {
- return;
- }
-
- this.atrules[name] = {
- type: 'Atrule',
- name: name,
- prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
- descriptors: syntax.descriptors
- ? Object.keys(syntax.descriptors).reduce((res, descName) => {
- res[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
- return res;
- }, {})
- : null
- };
- },
- addProperty_: function(name, syntax) {
- if (!syntax) {
- return;
- }
-
- this.properties[name] = this.createDescriptor(syntax, 'Property', name);
- },
- addType_: function(name, syntax) {
- if (!syntax) {
- return;
- }
-
- this.types[name] = this.createDescriptor(syntax, 'Type', name);
-
- if (syntax === generic['-ms-legacy-expression']) {
- this.valueCommonSyntax = cssWideKeywordsWithExpression;
- }
- },
-
- checkAtruleName: function(atruleName) {
- if (!this.getAtrule(atruleName)) {
- return new SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
- }
- },
- checkAtrulePrelude: function(atruleName, prelude) {
- let error = this.checkAtruleName(atruleName);
-
- if (error) {
- return error;
- }
-
- var atrule = this.getAtrule(atruleName);
-
- if (!atrule.prelude && prelude) {
- return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
- }
-
- if (atrule.prelude && !prelude) {
- return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
- }
- },
- checkAtruleDescriptorName: function(atruleName, descriptorName) {
- let error = this.checkAtruleName(atruleName);
-
- if (error) {
- return error;
- }
-
- var atrule = this.getAtrule(atruleName);
- var descriptor = names$1.keyword(descriptorName);
-
- if (!atrule.descriptors) {
- return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
- }
-
- if (!atrule.descriptors[descriptor.name] &&
- !atrule.descriptors[descriptor.basename]) {
- return new SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
- }
- },
- checkPropertyName: function(propertyName) {
- var property = names$1.property(propertyName);
-
- // don't match syntax for a custom property
- if (property.custom) {
- return new Error('Lexer matching doesn\'t applicable for custom properties');
- }
-
- if (!this.getProperty(propertyName)) {
- return new SyntaxReferenceError('Unknown property', propertyName);
- }
- },
-
- matchAtrulePrelude: function(atruleName, prelude) {
- var error = this.checkAtrulePrelude(atruleName, prelude);
-
- if (error) {
- return buildMatchResult(null, error);
- }
-
- if (!prelude) {
- return buildMatchResult(null, null);
- }
-
- return matchSyntax(this, this.getAtrule(atruleName).prelude, prelude, false);
- },
- matchAtruleDescriptor: function(atruleName, descriptorName, value) {
- var error = this.checkAtruleDescriptorName(atruleName, descriptorName);
-
- if (error) {
- return buildMatchResult(null, error);
- }
-
- var atrule = this.getAtrule(atruleName);
- var descriptor = names$1.keyword(descriptorName);
-
- return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
- },
- matchDeclaration: function(node) {
- if (node.type !== 'Declaration') {
- return buildMatchResult(null, new Error('Not a Declaration node'));
- }
-
- return this.matchProperty(node.property, node.value);
- },
- matchProperty: function(propertyName, value) {
- var error = this.checkPropertyName(propertyName);
-
- if (error) {
- return buildMatchResult(null, error);
- }
-
- return matchSyntax(this, this.getProperty(propertyName), value, true);
- },
- matchType: function(typeName, value) {
- var typeSyntax = this.getType(typeName);
-
- if (!typeSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError('Unknown type', typeName));
- }
-
- return matchSyntax(this, typeSyntax, value, false);
- },
- match: function(syntax, value) {
- if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
- return buildMatchResult(null, new SyntaxReferenceError('Bad syntax'));
- }
-
- if (typeof syntax === 'string' || !syntax.match) {
- syntax = this.createDescriptor(syntax, 'Type', 'anonymous');
- }
-
- return matchSyntax(this, syntax, value, false);
- },
-
- findValueFragments: function(propertyName, value, type, name) {
- return search.matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
- },
- findDeclarationValueFragments: function(declaration, type, name) {
- return search.matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
- },
- findAllFragments: function(ast, type, name) {
- var result = [];
-
- this.syntax.walk(ast, {
- visit: 'Declaration',
- enter: function(declaration) {
- result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
- }.bind(this)
- });
-
- return result;
- },
-
- getAtrule: function(atruleName, fallbackBasename = true) {
- var atrule = names$1.keyword(atruleName);
- var atruleEntry = atrule.vendor && fallbackBasename
- ? this.atrules[atrule.name] || this.atrules[atrule.basename]
- : this.atrules[atrule.name];
-
- return atruleEntry || null;
- },
- getAtrulePrelude: function(atruleName, fallbackBasename = true) {
- const atrule = this.getAtrule(atruleName, fallbackBasename);
-
- return atrule && atrule.prelude || null;
- },
- getAtruleDescriptor: function(atruleName, name) {
- return this.atrules.hasOwnProperty(atruleName) && this.atrules.declarators
- ? this.atrules[atruleName].declarators[name] || null
- : null;
- },
- getProperty: function(propertyName, fallbackBasename = true) {
- var property = names$1.property(propertyName);
- var propertyEntry = property.vendor && fallbackBasename
- ? this.properties[property.name] || this.properties[property.basename]
- : this.properties[property.name];
-
- return propertyEntry || null;
- },
- getType: function(name) {
- return this.types.hasOwnProperty(name) ? this.types[name] : null;
- },
-
- validate: function() {
- function validate(syntax, name, broken, descriptor) {
- if (broken.hasOwnProperty(name)) {
- return broken[name];
- }
-
- broken[name] = false;
- if (descriptor.syntax !== null) {
- walk(descriptor.syntax, function(node) {
- if (node.type !== 'Type' && node.type !== 'Property') {
- return;
- }
-
- var map = node.type === 'Type' ? syntax.types : syntax.properties;
- var brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;
-
- if (!map.hasOwnProperty(node.name) || validate(syntax, node.name, brokenMap, map[node.name])) {
- broken[name] = true;
- }
- }, this);
- }
- }
-
- var brokenTypes = {};
- var brokenProperties = {};
-
- for (var key in this.types) {
- validate(this, key, brokenTypes, this.types[key]);
- }
-
- for (var key in this.properties) {
- validate(this, key, brokenProperties, this.properties[key]);
- }
-
- brokenTypes = Object.keys(brokenTypes).filter(function(name) {
- return brokenTypes[name];
- });
- brokenProperties = Object.keys(brokenProperties).filter(function(name) {
- return brokenProperties[name];
- });
-
- if (brokenTypes.length || brokenProperties.length) {
- return {
- types: brokenTypes,
- properties: brokenProperties
- };
- }
-
- return null;
- },
- dump: function(syntaxAsAst, pretty) {
- return {
- generic: this.generic,
- types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
- properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
- atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
- };
- },
- toString: function() {
- return JSON.stringify(this.dump());
- }
- };
-
- var Lexer_1 = Lexer$1;
-
- var definitionSyntax$1 = {
- SyntaxError: _SyntaxError,
- parse: parse_1,
- generate: generate_1,
- walk: walk$1
- };
-
- var adoptBuffer = adoptBuffer$2;
- var isBOM = tokenizer$3.isBOM;
-
- var N$1 = 10;
- var F = 12;
- var R = 13;
-
- function computeLinesAndColumns(host, source) {
- var sourceLength = source.length;
- var lines = adoptBuffer(host.lines, sourceLength); // +1
- var line = host.startLine;
- var columns = adoptBuffer(host.columns, sourceLength);
- var column = host.startColumn;
- var startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
-
- for (var i = startOffset; i < sourceLength; i++) { // -1
- var code = source.charCodeAt(i);
-
- lines[i] = line;
- columns[i] = column++;
-
- if (code === N$1 || code === R || code === F) {
- if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N$1) {
- i++;
- lines[i] = line;
- columns[i] = column;
- }
-
- line++;
- column = 1;
- }
- }
-
- lines[i] = line;
- columns[i] = column;
-
- host.lines = lines;
- host.columns = columns;
- }
-
- var OffsetToLocation$1 = function() {
- this.lines = null;
- this.columns = null;
- this.linesAndColumnsComputed = false;
- };
-
- OffsetToLocation$1.prototype = {
- setSource: function(source, startOffset, startLine, startColumn) {
- this.source = source;
- this.startOffset = typeof startOffset === 'undefined' ? 0 : startOffset;
- this.startLine = typeof startLine === 'undefined' ? 1 : startLine;
- this.startColumn = typeof startColumn === 'undefined' ? 1 : startColumn;
- this.linesAndColumnsComputed = false;
- },
-
- ensureLinesAndColumnsComputed: function() {
- if (!this.linesAndColumnsComputed) {
- computeLinesAndColumns(this, this.source);
- this.linesAndColumnsComputed = true;
- }
- },
- getLocation: function(offset, filename) {
- this.ensureLinesAndColumnsComputed();
-
- return {
- source: filename,
- offset: this.startOffset + offset,
- line: this.lines[offset],
- column: this.columns[offset]
- };
- },
- getLocationRange: function(start, end, filename) {
- this.ensureLinesAndColumnsComputed();
-
- return {
- source: filename,
- start: {
- offset: this.startOffset + start,
- line: this.lines[start],
- column: this.columns[start]
- },
- end: {
- offset: this.startOffset + end,
- line: this.lines[end],
- column: this.columns[end]
- }
- };
- }
- };
-
- var OffsetToLocation_1 = OffsetToLocation$1;
-
- var TYPE$A = tokenizer$3.TYPE;
- var WHITESPACE$a = TYPE$A.WhiteSpace;
- var COMMENT$8 = TYPE$A.Comment;
-
- var sequence$1 = function readSequence(recognizer) {
- var children = this.createList();
- var child = null;
- var context = {
- recognizer: recognizer,
- space: null,
- ignoreWS: false,
- ignoreWSAfter: false
- };
-
- this.scanner.skipSC();
-
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case COMMENT$8:
- this.scanner.next();
- continue;
-
- case WHITESPACE$a:
- if (context.ignoreWS) {
- this.scanner.next();
- } else {
- context.space = this.WhiteSpace();
- }
- continue;
- }
-
- child = recognizer.getNode.call(this, context);
-
- if (child === undefined) {
- break;
- }
-
- if (context.space !== null) {
- children.push(context.space);
- context.space = null;
- }
-
- children.push(child);
-
- if (context.ignoreWSAfter) {
- context.ignoreWSAfter = false;
- context.ignoreWS = true;
- } else {
- context.ignoreWS = false;
- }
- }
-
- return children;
- };
-
- var OffsetToLocation = OffsetToLocation_1;
- var SyntaxError$2 = _SyntaxError$1;
- var TokenStream$1 = TokenStream_1;
- var List$3 = List_1;
- var tokenize$1 = tokenizer$3;
- var constants = _const;
- var { findWhiteSpaceStart, cmpStr: cmpStr$2 } = utils$2;
- var sequence = sequence$1;
- var noop$1 = function() {};
-
- var TYPE$z = constants.TYPE;
- var NAME$1 = constants.NAME;
- var WHITESPACE$9 = TYPE$z.WhiteSpace;
- var COMMENT$7 = TYPE$z.Comment;
- var IDENT$g = TYPE$z.Ident;
- var FUNCTION$6 = TYPE$z.Function;
- var URL$4 = TYPE$z.Url;
- var HASH$5 = TYPE$z.Hash;
- var PERCENTAGE$3 = TYPE$z.Percentage;
- var NUMBER$7 = TYPE$z.Number;
- var NUMBERSIGN$3 = 0x0023; // U+0023 NUMBER SIGN (#)
- var NULL = 0;
-
- function createParseContext(name) {
- return function() {
- return this[name]();
- };
- }
-
- function processConfig(config) {
- var parserConfig = {
- context: {},
- scope: {},
- atrule: {},
- pseudo: {}
- };
-
- if (config.parseContext) {
- for (var name in config.parseContext) {
- switch (typeof config.parseContext[name]) {
- case 'function':
- parserConfig.context[name] = config.parseContext[name];
- break;
-
- case 'string':
- parserConfig.context[name] = createParseContext(config.parseContext[name]);
- break;
- }
- }
- }
-
- if (config.scope) {
- for (var name in config.scope) {
- parserConfig.scope[name] = config.scope[name];
- }
- }
-
- if (config.atrule) {
- for (var name in config.atrule) {
- var atrule = config.atrule[name];
-
- if (atrule.parse) {
- parserConfig.atrule[name] = atrule.parse;
- }
- }
- }
-
- if (config.pseudo) {
- for (var name in config.pseudo) {
- var pseudo = config.pseudo[name];
-
- if (pseudo.parse) {
- parserConfig.pseudo[name] = pseudo.parse;
- }
- }
- }
-
- if (config.node) {
- for (var name in config.node) {
- parserConfig[name] = config.node[name].parse;
- }
- }
-
- return parserConfig;
- }
-
- var create$4 = function createParser(config) {
- var parser = {
- scanner: new TokenStream$1(),
- locationMap: new OffsetToLocation(),
-
- filename: '',
- needPositions: false,
- onParseError: noop$1,
- onParseErrorThrow: false,
- parseAtrulePrelude: true,
- parseRulePrelude: true,
- parseValue: true,
- parseCustomProperty: false,
-
- readSequence: sequence,
-
- createList: function() {
- return new List$3();
- },
- createSingleNodeList: function(node) {
- return new List$3().appendData(node);
- },
- getFirstListNode: function(list) {
- return list && list.first();
- },
- getLastListNode: function(list) {
- return list.last();
- },
-
- parseWithFallback: function(consumer, fallback) {
- var startToken = this.scanner.tokenIndex;
-
- try {
- return consumer.call(this);
- } catch (e) {
- if (this.onParseErrorThrow) {
- throw e;
- }
-
- var fallbackNode = fallback.call(this, startToken);
-
- this.onParseErrorThrow = true;
- this.onParseError(e, fallbackNode);
- this.onParseErrorThrow = false;
-
- return fallbackNode;
- }
- },
-
- lookupNonWSType: function(offset) {
- do {
- var type = this.scanner.lookupType(offset++);
- if (type !== WHITESPACE$9) {
- return type;
- }
- } while (type !== NULL);
-
- return NULL;
- },
-
- eat: function(tokenType) {
- if (this.scanner.tokenType !== tokenType) {
- var offset = this.scanner.tokenStart;
- var message = NAME$1[tokenType] + ' is expected';
-
- // tweak message and offset
- switch (tokenType) {
- case IDENT$g:
- // when identifier is expected but there is a function or url
- if (this.scanner.tokenType === FUNCTION$6 || this.scanner.tokenType === URL$4) {
- offset = this.scanner.tokenEnd - 1;
- message = 'Identifier is expected but function found';
- } else {
- message = 'Identifier is expected';
- }
- break;
-
- case HASH$5:
- if (this.scanner.isDelim(NUMBERSIGN$3)) {
- this.scanner.next();
- offset++;
- message = 'Name is expected';
- }
- break;
-
- case PERCENTAGE$3:
- if (this.scanner.tokenType === NUMBER$7) {
- offset = this.scanner.tokenEnd;
- message = 'Percent sign is expected';
- }
- break;
-
- default:
- // when test type is part of another token show error for current position + 1
- // e.g. eat(HYPHENMINUS) will fail on "-foo", but pointing on "-" is odd
- if (this.scanner.source.charCodeAt(this.scanner.tokenStart) === tokenType) {
- offset = offset + 1;
- }
- }
-
- this.error(message, offset);
- }
-
- this.scanner.next();
- },
-
- consume: function(tokenType) {
- var value = this.scanner.getTokenValue();
-
- this.eat(tokenType);
-
- return value;
- },
- consumeFunctionName: function() {
- var name = this.scanner.source.substring(this.scanner.tokenStart, this.scanner.tokenEnd - 1);
-
- this.eat(FUNCTION$6);
-
- return name;
- },
-
- getLocation: function(start, end) {
- if (this.needPositions) {
- return this.locationMap.getLocationRange(
- start,
- end,
- this.filename
- );
- }
-
- return null;
- },
- getLocationFromList: function(list) {
- if (this.needPositions) {
- var head = this.getFirstListNode(list);
- var tail = this.getLastListNode(list);
- return this.locationMap.getLocationRange(
- head !== null ? head.loc.start.offset - this.locationMap.startOffset : this.scanner.tokenStart,
- tail !== null ? tail.loc.end.offset - this.locationMap.startOffset : this.scanner.tokenStart,
- this.filename
- );
- }
-
- return null;
- },
-
- error: function(message, offset) {
- var location = typeof offset !== 'undefined' && offset < this.scanner.source.length
- ? this.locationMap.getLocation(offset)
- : this.scanner.eof
- ? this.locationMap.getLocation(findWhiteSpaceStart(this.scanner.source, this.scanner.source.length - 1))
- : this.locationMap.getLocation(this.scanner.tokenStart);
-
- throw new SyntaxError$2(
- message || 'Unexpected input',
- this.scanner.source,
- location.offset,
- location.line,
- location.column
- );
- }
- };
-
- config = processConfig(config || {});
- for (var key in config) {
- parser[key] = config[key];
- }
-
- return function(source, options) {
- options = options || {};
-
- var context = options.context || 'default';
- var onComment = options.onComment;
- var ast;
-
- tokenize$1(source, parser.scanner);
- parser.locationMap.setSource(
- source,
- options.offset,
- options.line,
- options.column
- );
-
- parser.filename = options.filename || '';
- parser.needPositions = Boolean(options.positions);
- parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop$1;
- parser.onParseErrorThrow = false;
- parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
- parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
- parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
- parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;
-
- if (!parser.context.hasOwnProperty(context)) {
- throw new Error('Unknown context `' + context + '`');
- }
-
- if (typeof onComment === 'function') {
- parser.scanner.forEachToken((type, start, end) => {
- if (type === COMMENT$7) {
- const loc = parser.getLocation(start, end);
- const value = cmpStr$2(source, end - 2, end, '*/')
- ? source.slice(start + 2, end - 2)
- : source.slice(start + 2, end);
-
- onComment(value, loc);
- }
- });
- }
-
- ast = parser.context[context].call(parser, options);
-
- if (!parser.scanner.eof) {
- parser.error();
- }
-
- return ast;
- };
- };
-
- var sourceMapGenerator = {};
-
- var base64Vlq = {};
-
- var base64$1 = {};
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
- var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
-
- /**
- * Encode an integer in the range of 0 to 63 to a single base 64 digit.
- */
- base64$1.encode = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
- };
-
- /**
- * Decode a single base 64 character code digit to an integer. Returns -1 on
- * failure.
- */
- base64$1.decode = function (charCode) {
- var bigA = 65; // 'A'
- var bigZ = 90; // 'Z'
-
- var littleA = 97; // 'a'
- var littleZ = 122; // 'z'
-
- var zero = 48; // '0'
- var nine = 57; // '9'
-
- var plus = 43; // '+'
- var slash = 47; // '/'
-
- var littleOffset = 26;
- var numberOffset = 52;
-
- // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
- if (bigA <= charCode && charCode <= bigZ) {
- return (charCode - bigA);
- }
-
- // 26 - 51: abcdefghijklmnopqrstuvwxyz
- if (littleA <= charCode && charCode <= littleZ) {
- return (charCode - littleA + littleOffset);
- }
-
- // 52 - 61: 0123456789
- if (zero <= charCode && charCode <= nine) {
- return (charCode - zero + numberOffset);
- }
-
- // 62: +
- if (charCode == plus) {
- return 62;
- }
-
- // 63: /
- if (charCode == slash) {
- return 63;
- }
-
- // Invalid base64 digit.
- return -1;
- };
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- *
- * Based on the Base 64 VLQ implementation in Closure Compiler:
- * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
- *
- * Copyright 2011 The Closure Compiler 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.
- */
-
- var base64 = base64$1;
-
- // A single base 64 digit can contain 6 bits of data. For the base 64 variable
- // length quantities we use in the source map spec, the first bit is the sign,
- // the next four bits are the actual value, and the 6th bit is the
- // continuation bit. The continuation bit tells us whether there are more
- // digits in this value following this digit.
- //
- // Continuation
- // | Sign
- // | |
- // V V
- // 101011
-
- var VLQ_BASE_SHIFT = 5;
-
- // binary: 100000
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
-
- // binary: 011111
- var VLQ_BASE_MASK = VLQ_BASE - 1;
-
- // binary: 100000
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
-
- /**
- * Converts from a two-complement value to a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
- * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
- */
- function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
- }
-
- /**
- * Converts to a two-complement value from a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
- * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
- */
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
- }
-
- /**
- * Returns the base 64 VLQ encoded value.
- */
- base64Vlq.encode = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
-
- var vlq = toVLQSigned(aValue);
-
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
- // There are still more digits in this value, so we must make sure the
- // continuation bit is marked.
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
-
- return encoded;
- };
-
- /**
- * Decodes the next base 64 VLQ value from the given string and returns the
- * value and the rest of the string via the out parameter.
- */
- base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
-
- do {
- if (aIndex >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
-
- digit = base64.decode(aStr.charCodeAt(aIndex++));
- if (digit === -1) {
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
- }
-
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
-
- aOutParam.value = fromVLQSigned(result);
- aOutParam.rest = aIndex;
- };
-
- var util$3 = {};
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- (function (exports) {
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
- /**
- * This is a helper function for getting values from parameter/options
- * objects.
- *
- * @param args The object we are extracting values from
- * @param name The name of the property we are getting.
- * @param defaultValue An optional value to return if the property is missing
- * from the object. If this is not specified and the property is missing, an
- * error will be thrown.
- */
- function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
- }
- exports.getArg = getArg;
-
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
- var dataUrlRegexp = /^data:.+\,.+$/;
-
- function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
- }
- exports.urlParse = urlParse;
-
- function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port;
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
- }
- exports.urlGenerate = urlGenerate;
-
- /**
- * Normalizes a path, or the path portion of a URL:
- *
- * - Replaces consecutive slashes with one slash.
- * - Removes unnecessary '.' parts.
- * - Removes unnecessary '/..' parts.
- *
- * Based on code in the Node.js 'path' core module.
- *
- * @param aPath The path or url to normalize.
- */
- function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = exports.isAbsolute(path);
-
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
- // The first part is blank if the path is absolute. Trying to go
- // above the root is a no-op. Therefore we can remove all '..' parts
- // directly after the root.
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
-
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
-
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
- }
- exports.normalize = normalize;
-
- /**
- * Joins two paths/URLs.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be joined with the root.
- *
- * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
- * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
- * first.
- * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
- * is updated with the result and aRoot is returned. Otherwise the result
- * is returned.
- * - If aPath is absolute, the result is aPath.
- * - Otherwise the two paths are joined with a slash.
- * - Joining for example 'http://' and 'www.example.com' is also supported.
- */
- function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
-
- // `join(foo, '//www.example.org')`
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
-
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
-
- // `join('http://', 'www.example.com')`
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
-
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
-
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
- }
- exports.join = join;
-
- exports.isAbsolute = function (aPath) {
- return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
- };
-
- /**
- * Make a path relative to a URL or another path.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be made relative to aRoot.
- */
- function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
-
- aRoot = aRoot.replace(/\/$/, '');
-
- // It is possible for the path to be above the root. In this case, simply
- // checking whether the root is a prefix of the path won't work. Instead, we
- // need to remove components from the root one by one, until either we find
- // a prefix that fits, or we run out of components to remove.
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
-
- // If the only part of the root that is left is the scheme (i.e. http://,
- // file:///, etc.), one or more slashes (/), or simply nothing at all, we
- // have exhausted all components, so the path is not relative to the root.
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
-
- ++level;
- }
-
- // Make sure we add a "../" for each component we removed from the root.
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
- }
- exports.relative = relative;
-
- var supportsNullProto = (function () {
- var obj = Object.create(null);
- return !('__proto__' in obj);
- }());
-
- function identity (s) {
- return s;
- }
-
- /**
- * Because behavior goes wacky when you set `__proto__` on objects, we
- * have to prefix all the strings in our set with an arbitrary character.
- *
- * See https://github.com/mozilla/source-map/pull/31 and
- * https://github.com/mozilla/source-map/issues/30
- *
- * @param String aStr
- */
- function toSetString(aStr) {
- if (isProtoString(aStr)) {
- return '$' + aStr;
- }
-
- return aStr;
- }
- exports.toSetString = supportsNullProto ? identity : toSetString;
-
- function fromSetString(aStr) {
- if (isProtoString(aStr)) {
- return aStr.slice(1);
- }
-
- return aStr;
- }
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
-
- function isProtoString(s) {
- if (!s) {
- return false;
- }
-
- var length = s.length;
-
- if (length < 9 /* "__proto__".length */) {
- return false;
- }
-
- if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
- s.charCodeAt(length - 2) !== 95 /* '_' */ ||
- s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 4) !== 116 /* 't' */ ||
- s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
- s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
- s.charCodeAt(length - 8) !== 95 /* '_' */ ||
- s.charCodeAt(length - 9) !== 95 /* '_' */) {
- return false;
- }
-
- for (var i = length - 10; i >= 0; i--) {
- if (s.charCodeAt(i) !== 36 /* '$' */) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Comparator between two mappings where the original positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same original source/line/column, but different generated
- * line and column the same. Useful when searching for a mapping with a
- * stubbed out mapping.
- */
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0 || onlyCompareOriginal) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByOriginalPositions = compareByOriginalPositions;
-
- /**
- * Comparator between two mappings with deflated source and name indices where
- * the generated positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same generated line and column, but different
- * source/name/original line and column the same. Useful when searching for a
- * mapping with a stubbed out mapping.
- */
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0 || onlyCompareGenerated) {
- return cmp;
- }
-
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
-
- function strcmp(aStr1, aStr2) {
- if (aStr1 === aStr2) {
- return 0;
- }
-
- if (aStr1 === null) {
- return 1; // aStr2 !== null
- }
-
- if (aStr2 === null) {
- return -1; // aStr1 !== null
- }
-
- if (aStr1 > aStr2) {
- return 1;
- }
-
- return -1;
- }
-
- /**
- * Comparator between two mappings with inflated source and name strings where
- * the generated positions are compared.
- */
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
-
- /**
- * Strip any JSON XSSI avoidance prefix from the string (as documented
- * in the source maps specification), and then parse the string as
- * JSON.
- */
- function parseSourceMapInput(str) {
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
- }
- exports.parseSourceMapInput = parseSourceMapInput;
-
- /**
- * Compute the URL of a source given the the source root, the source's
- * URL, and the source map's URL.
- */
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
- sourceURL = sourceURL || '';
-
- if (sourceRoot) {
- // This follows what Chrome does.
- if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
- sourceRoot += '/';
- }
- // The spec says:
- // Line 4: An optional source root, useful for relocating source
- // files on a server or removing repeated values in the
- // “sources” entry. This value is prepended to the individual
- // entries in the “source” field.
- sourceURL = sourceRoot + sourceURL;
- }
-
- // Historically, SourceMapConsumer did not take the sourceMapURL as
- // a parameter. This mode is still somewhat supported, which is why
- // this code block is conditional. However, it's preferable to pass
- // the source map URL to SourceMapConsumer, so that this function
- // can implement the source URL resolution algorithm as outlined in
- // the spec. This block is basically the equivalent of:
- // new URL(sourceURL, sourceMapURL).toString()
- // ... except it avoids using URL, which wasn't available in the
- // older releases of node still supported by this library.
- //
- // The spec says:
- // If the sources are not absolute URLs after prepending of the
- // “sourceRoot”, the sources are resolved relative to the
- // SourceMap (like resolving script src in a html document).
- if (sourceMapURL) {
- var parsed = urlParse(sourceMapURL);
- if (!parsed) {
- throw new Error("sourceMapURL could not be parsed");
- }
- if (parsed.path) {
- // Strip the last path component, but keep the "/".
- var index = parsed.path.lastIndexOf('/');
- if (index >= 0) {
- parsed.path = parsed.path.substring(0, index + 1);
- }
- }
- sourceURL = join(urlGenerate(parsed), sourceURL);
- }
-
- return normalize(sourceURL);
- }
- exports.computeSourceURL = computeSourceURL;
- }(util$3));
-
- var arraySet = {};
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
- var util$2 = util$3;
- var has$1 = Object.prototype.hasOwnProperty;
- var hasNativeMap = typeof Map !== "undefined";
-
- /**
- * A data structure which is a combination of an array and a set. Adding a new
- * member is O(1), testing for membership is O(1), and finding the index of an
- * element is O(1). Removing elements from the set is not supported. Only
- * strings are supported for membership.
- */
- function ArraySet$1() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
- }
-
- /**
- * Static method for creating ArraySet instances from an existing array.
- */
- ArraySet$1.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet$1();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
-
- /**
- * Return how many unique items are in this ArraySet. If duplicates have been
- * added, than those do not count towards the size.
- *
- * @returns Number
- */
- ArraySet$1.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
- };
-
- /**
- * Add the given string to this set.
- *
- * @param String aStr
- */
- ArraySet$1.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util$2.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- if (hasNativeMap) {
- this._set.set(aStr, idx);
- } else {
- this._set[sStr] = idx;
- }
- }
- };
-
- /**
- * Is the given string a member of this set?
- *
- * @param String aStr
- */
- ArraySet$1.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util$2.toSetString(aStr);
- return has$1.call(this._set, sStr);
- }
- };
-
- /**
- * What is the index of the given string in the array?
- *
- * @param String aStr
- */
- ArraySet$1.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util$2.toSetString(aStr);
- if (has$1.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
-
- throw new Error('"' + aStr + '" is not in the set.');
- };
-
- /**
- * What is the element at the given index?
- *
- * @param Number aIdx
- */
- ArraySet$1.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
- };
-
- /**
- * Returns the array representation of this set (which has the proper indices
- * indicated by indexOf). Note that this is a copy of the internal array used
- * for storing the members so that no one can mess with internal state.
- */
- ArraySet$1.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
-
- arraySet.ArraySet = ArraySet$1;
-
- var mappingList = {};
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- /*
- * Copyright 2014 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
- var util$1 = util$3;
-
- /**
- * Determine whether mappingB is after mappingA with respect to generated
- * position.
- */
- function generatedPositionAfter(mappingA, mappingB) {
- // Optimized for most common case
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
- }
-
- /**
- * A data structure to provide a sorted view of accumulated mappings in a
- * performance conscious manner. It trades a neglibable overhead in general
- * case for a large speedup in case of mappings being added in order.
- */
- function MappingList$1() {
- this._array = [];
- this._sorted = true;
- // Serves as infimum
- this._last = {generatedLine: -1, generatedColumn: 0};
- }
-
- /**
- * Iterate through internal items. This method takes the same arguments that
- * `Array.prototype.forEach` takes.
- *
- * NOTE: The order of the mappings is NOT guaranteed.
- */
- MappingList$1.prototype.unsortedForEach =
- function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
-
- /**
- * Add the given source mapping.
- *
- * @param Object aMapping
- */
- MappingList$1.prototype.add = function MappingList_add(aMapping) {
- if (generatedPositionAfter(this._last, aMapping)) {
- this._last = aMapping;
- this._array.push(aMapping);
- } else {
- this._sorted = false;
- this._array.push(aMapping);
- }
- };
-
- /**
- * Returns the flat, sorted array of mappings. The mappings are sorted by
- * generated position.
- *
- * WARNING: This method returns internal data without copying, for
- * performance. The return value must NOT be mutated, and should be treated as
- * an immutable borrow. If you want to take ownership, you must make your own
- * copy.
- */
- MappingList$1.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util$1.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
- };
-
- mappingList.MappingList = MappingList$1;
-
- /* -*- Mode: js; js-indent-level: 2; -*- */
-
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
- var base64VLQ = base64Vlq;
- var util = util$3;
- var ArraySet = arraySet.ArraySet;
- var MappingList = mappingList.MappingList;
-
- /**
- * An instance of the SourceMapGenerator represents a source map which is
- * being built incrementally. You may pass an object with the following
- * properties:
- *
- * - file: The filename of the generated source.
- * - sourceRoot: A root for all relative URLs in this source map.
- */
- function SourceMapGenerator$1(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet();
- this._names = new ArraySet();
- this._mappings = new MappingList();
- this._sourcesContents = null;
- }
-
- SourceMapGenerator$1.prototype._version = 3;
-
- /**
- * Creates a new SourceMapGenerator based on a SourceMapConsumer
- *
- * @param aSourceMapConsumer The SourceMap.
- */
- SourceMapGenerator$1.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator$1({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
-
- if (mapping.source != null) {
- newMapping.source = mapping.source;
- if (sourceRoot != null) {
- newMapping.source = util.relative(sourceRoot, newMapping.source);
- }
-
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
-
- if (mapping.name != null) {
- newMapping.name = mapping.name;
- }
- }
-
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var sourceRelative = sourceFile;
- if (sourceRoot !== null) {
- sourceRelative = util.relative(sourceRoot, sourceFile);
- }
-
- if (!generator._sources.has(sourceRelative)) {
- generator._sources.add(sourceRelative);
- }
-
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
-
- /**
- * Add a single mapping from original source line and column to the generated
- * source's line and column for this source map being created. The mapping
- * object should have the following properties:
- *
- * - generated: An object with the generated line and column positions.
- * - original: An object with the original line and column positions.
- * - source: The original source file (relative to the sourceRoot).
- * - name: An optional original token name for this mapping.
- */
- SourceMapGenerator$1.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.getArg(aArgs, 'name', null);
-
- if (!this._skipValidation) {
- this._validateMapping(generated, original, source, name);
- }
-
- if (source != null) {
- source = String(source);
- if (!this._sources.has(source)) {
- this._sources.add(source);
- }
- }
-
- if (name != null) {
- name = String(name);
- if (!this._names.has(name)) {
- this._names.add(name);
- }
- }
-
- this._mappings.add({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
-
- /**
- * Set the source content for a source file.
- */
- SourceMapGenerator$1.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util.relative(this._sourceRoot, source);
- }
-
- if (aSourceContent != null) {
- // Add the source content to the _sourcesContents map.
- // Create a new _sourcesContents map if the property is null.
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
- // Remove the source file from the _sourcesContents map.
- // If the _sourcesContents map is empty, set the property to null.
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
-
- /**
- * Applies the mappings of a sub-source-map for a specific source file to the
- * source map being generated. Each mapping to the supplied source file is
- * rewritten using the supplied source map. Note: The resolution for the
- * resulting mappings is the minimium of this map and the supplied map.
- *
- * @param aSourceMapConsumer The source map to be applied.
- * @param aSourceFile Optional. The filename of the source file.
- * If omitted, SourceMapConsumer's file property will be used.
- * @param aSourceMapPath Optional. The dirname of the path to the source map
- * to be applied. If relative, it is relative to the SourceMapConsumer.
- * This parameter is needed when the two source maps aren't in the same
- * directory, and the source map to be applied contains relative source
- * paths. If so, those relative source paths need to be rewritten
- * relative to the SourceMapGenerator.
- */
- SourceMapGenerator$1.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
- // If aSourceFile is omitted, we will use the file property of the SourceMap
- if (aSourceFile == null) {
- if (aSourceMapConsumer.file == null) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- sourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
- // Make "sourceFile" relative if an absolute Url is passed.
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- // Applying the SourceMap can add and remove items from the sources and
- // the names array.
- var newSources = new ArraySet();
- var newNames = new ArraySet();
-
- // Find mappings for the "sourceFile"
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
- // Check if it can be mapped by the source map, then update the mapping.
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
- // Copy mapping
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util.join(aSourceMapPath, mapping.source);
- }
- if (sourceRoot != null) {
- mapping.source = util.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name != null) {
- mapping.name = original.name;
- }
- }
- }
-
- var source = mapping.source;
- if (source != null && !newSources.has(source)) {
- newSources.add(source);
- }
-
- var name = mapping.name;
- if (name != null && !newNames.has(name)) {
- newNames.add(name);
- }
-
- }, this);
- this._sources = newSources;
- this._names = newNames;
-
- // Copy sourcesContents of applied map.
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
-
- /**
- * A mapping can have one of the three levels of data:
- *
- * 1. Just the generated position.
- * 2. The Generated position, original position, and original source.
- * 3. Generated and original position, original source, as well as a name
- * token.
- *
- * To maintain consistency, we validate that any new mapping being added falls
- * in to one of these categories.
- */
- SourceMapGenerator$1.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
- // When aOriginal is truthy but has empty values for .line and .column,
- // it is most likely a programmer error. In this case we throw a very
- // specific error message to try to guide them the right way.
- // For example: https://github.com/Polymer/polymer-bundler/pull/519
- if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
- throw new Error(
- 'original.line and original.column are not numbers -- you probably meant to omit ' +
- 'the original mapping entirely and only map the generated position. If so, pass ' +
- 'null for the original mapping instead of an object with empty or null values.'
- );
- }
-
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
- // Case 1.
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
- // Cases 2 and 3.
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
-
- /**
- * Serialize the accumulated mappings in to the stream of base 64 VLQs
- * specified by the source map format.
- */
- SourceMapGenerator$1.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var next;
- var mapping;
- var nameIdx;
- var sourceIdx;
-
- var mappings = this._mappings.toArray();
- for (var i = 0, len = mappings.length; i < len; i++) {
- mapping = mappings[i];
- next = '';
-
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- next += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
- continue;
- }
- next += ',';
- }
- }
-
- next += base64VLQ.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
-
- if (mapping.source != null) {
- sourceIdx = this._sources.indexOf(mapping.source);
- next += base64VLQ.encode(sourceIdx - previousSource);
- previousSource = sourceIdx;
-
- // lines are stored 0-based in SourceMap spec version 3
- next += base64VLQ.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
-
- next += base64VLQ.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
-
- if (mapping.name != null) {
- nameIdx = this._names.indexOf(mapping.name);
- next += base64VLQ.encode(nameIdx - previousName);
- previousName = nameIdx;
- }
- }
-
- result += next;
- }
-
- return result;
- };
-
- SourceMapGenerator$1.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
-
- /**
- * Externalize the source map.
- */
- SourceMapGenerator$1.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._file != null) {
- map.file = this._file;
- }
- if (this._sourceRoot != null) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
-
- return map;
- };
-
- /**
- * Render the source map being generated to a string.
- */
- SourceMapGenerator$1.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
-
- sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
-
- var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
- var trackNodes = {
- Atrule: true,
- Selector: true,
- Declaration: true
- };
-
- var sourceMap$1 = function generateSourceMap(handlers) {
- var map = new SourceMapGenerator();
- var line = 1;
- var column = 0;
- var generated = {
- line: 1,
- column: 0
- };
- var original = {
- line: 0, // should be zero to add first mapping
- column: 0
- };
- var sourceMappingActive = false;
- var activatedGenerated = {
- line: 1,
- column: 0
- };
- var activatedMapping = {
- generated: activatedGenerated
- };
-
- var handlersNode = handlers.node;
- handlers.node = function(node) {
- if (node.loc && node.loc.start && trackNodes.hasOwnProperty(node.type)) {
- var nodeLine = node.loc.start.line;
- var nodeColumn = node.loc.start.column - 1;
-
- if (original.line !== nodeLine ||
- original.column !== nodeColumn) {
- original.line = nodeLine;
- original.column = nodeColumn;
-
- generated.line = line;
- generated.column = column;
-
- if (sourceMappingActive) {
- sourceMappingActive = false;
- if (generated.line !== activatedGenerated.line ||
- generated.column !== activatedGenerated.column) {
- map.addMapping(activatedMapping);
- }
- }
-
- sourceMappingActive = true;
- map.addMapping({
- source: node.loc.source,
- original: original,
- generated: generated
- });
- }
- }
-
- handlersNode.call(this, node);
-
- if (sourceMappingActive && trackNodes.hasOwnProperty(node.type)) {
- activatedGenerated.line = line;
- activatedGenerated.column = column;
- }
- };
-
- var handlersChunk = handlers.chunk;
- handlers.chunk = function(chunk) {
- for (var i = 0; i < chunk.length; i++) {
- if (chunk.charCodeAt(i) === 10) { // \n
- line++;
- column = 0;
- } else {
- column++;
- }
- }
-
- handlersChunk(chunk);
- };
-
- var handlersResult = handlers.result;
- handlers.result = function() {
- if (sourceMappingActive) {
- map.addMapping(activatedMapping);
- }
-
- return {
- css: handlersResult(),
- map: map
- };
- };
-
- return handlers;
- };
-
- var sourceMap = sourceMap$1;
- var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
-
- function processChildren(node, delimeter) {
- var list = node.children;
- var prev = null;
-
- if (typeof delimeter !== 'function') {
- list.forEach(this.node, this);
- } else {
- list.forEach(function(node) {
- if (prev !== null) {
- delimeter.call(this, prev);
- }
-
- this.node(node);
- prev = node;
- }, this);
- }
- }
-
- var create$3 = function createGenerator(config) {
- function processNode(node) {
- if (hasOwnProperty$4.call(types, node.type)) {
- types[node.type].call(this, node);
- } else {
- throw new Error('Unknown node type: ' + node.type);
- }
- }
-
- var types = {};
-
- if (config.node) {
- for (var name in config.node) {
- types[name] = config.node[name].generate;
- }
- }
-
- return function(node, options) {
- var buffer = '';
- var handlers = {
- children: processChildren,
- node: processNode,
- chunk: function(chunk) {
- buffer += chunk;
- },
- result: function() {
- return buffer;
- }
- };
-
- if (options) {
- if (typeof options.decorator === 'function') {
- handlers = options.decorator(handlers);
- }
-
- if (options.sourceMap) {
- handlers = sourceMap(handlers);
- }
- }
-
- handlers.node(node);
-
- return handlers.result();
- };
- };
-
- var List$2 = List_1;
-
- var create$2 = function createConvertors(walk) {
- return {
- fromPlainObject: function(ast) {
- walk(ast, {
- enter: function(node) {
- if (node.children && node.children instanceof List$2 === false) {
- node.children = new List$2().fromArray(node.children);
- }
- }
- });
-
- return ast;
- },
- toPlainObject: function(ast) {
- walk(ast, {
- leave: function(node) {
- if (node.children && node.children instanceof List$2) {
- node.children = node.children.toArray();
- }
- }
- });
-
- return ast;
- }
- };
- };
-
- var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
- var noop = function() {};
-
- function ensureFunction(value) {
- return typeof value === 'function' ? value : noop;
- }
-
- function invokeForType(fn, type) {
- return function(node, item, list) {
- if (node.type === type) {
- fn.call(this, node, item, list);
- }
- };
- }
-
- function getWalkersFromStructure(name, nodeType) {
- var structure = nodeType.structure;
- var walkers = [];
-
- for (var key in structure) {
- if (hasOwnProperty$3.call(structure, key) === false) {
- continue;
- }
-
- var fieldTypes = structure[key];
- var walker = {
- name: key,
- type: false,
- nullable: false
- };
-
- if (!Array.isArray(structure[key])) {
- fieldTypes = [structure[key]];
- }
-
- for (var i = 0; i < fieldTypes.length; i++) {
- var fieldType = fieldTypes[i];
- if (fieldType === null) {
- walker.nullable = true;
- } else if (typeof fieldType === 'string') {
- walker.type = 'node';
- } else if (Array.isArray(fieldType)) {
- walker.type = 'list';
- }
- }
-
- if (walker.type) {
- walkers.push(walker);
- }
- }
-
- if (walkers.length) {
- return {
- context: nodeType.walkContext,
- fields: walkers
- };
- }
-
- return null;
- }
-
- function getTypesFromConfig(config) {
- var types = {};
-
- for (var name in config.node) {
- if (hasOwnProperty$3.call(config.node, name)) {
- var nodeType = config.node[name];
-
- if (!nodeType.structure) {
- throw new Error('Missed `structure` field in `' + name + '` node type definition');
- }
-
- types[name] = getWalkersFromStructure(name, nodeType);
- }
- }
-
- return types;
- }
-
- function createTypeIterator(config, reverse) {
- var fields = config.fields.slice();
- var contextName = config.context;
- var useContext = typeof contextName === 'string';
-
- if (reverse) {
- fields.reverse();
- }
-
- return function(node, context, walk, walkReducer) {
- var prevContextValue;
-
- if (useContext) {
- prevContextValue = context[contextName];
- context[contextName] = node;
- }
-
- for (var i = 0; i < fields.length; i++) {
- var field = fields[i];
- var ref = node[field.name];
-
- if (!field.nullable || ref) {
- if (field.type === 'list') {
- var breakWalk = reverse
- ? ref.reduceRight(walkReducer, false)
- : ref.reduce(walkReducer, false);
-
- if (breakWalk) {
- return true;
- }
- } else if (walk(ref)) {
- return true;
- }
- }
- }
-
- if (useContext) {
- context[contextName] = prevContextValue;
- }
- };
- }
-
- function createFastTraveralMap(iterators) {
- return {
- Atrule: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block
- },
- Rule: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block
- },
- Declaration: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block,
- DeclarationList: iterators.DeclarationList
- }
- };
- }
-
- var create$1 = function createWalker(config) {
- var types = getTypesFromConfig(config);
- var iteratorsNatural = {};
- var iteratorsReverse = {};
- var breakWalk = Symbol('break-walk');
- var skipNode = Symbol('skip-node');
-
- for (var name in types) {
- if (hasOwnProperty$3.call(types, name) && types[name] !== null) {
- iteratorsNatural[name] = createTypeIterator(types[name], false);
- iteratorsReverse[name] = createTypeIterator(types[name], true);
- }
- }
-
- var fastTraversalIteratorsNatural = createFastTraveralMap(iteratorsNatural);
- var fastTraversalIteratorsReverse = createFastTraveralMap(iteratorsReverse);
-
- var walk = function(root, options) {
- function walkNode(node, item, list) {
- var enterRet = enter.call(context, node, item, list);
-
- if (enterRet === breakWalk) {
- debugger;
- return true;
- }
-
- if (enterRet === skipNode) {
- return false;
- }
-
- if (iterators.hasOwnProperty(node.type)) {
- if (iterators[node.type](node, context, walkNode, walkReducer)) {
- return true;
- }
- }
-
- if (leave.call(context, node, item, list) === breakWalk) {
- return true;
- }
-
- return false;
- }
-
- var walkReducer = (ret, data, item, list) => ret || walkNode(data, item, list);
- var enter = noop;
- var leave = noop;
- var iterators = iteratorsNatural;
- var context = {
- break: breakWalk,
- skip: skipNode,
-
- root: root,
- stylesheet: null,
- atrule: null,
- atrulePrelude: null,
- rule: null,
- selector: null,
- block: null,
- declaration: null,
- function: null
- };
-
- if (typeof options === 'function') {
- enter = options;
- } else if (options) {
- enter = ensureFunction(options.enter);
- leave = ensureFunction(options.leave);
-
- if (options.reverse) {
- iterators = iteratorsReverse;
- }
-
- if (options.visit) {
- if (fastTraversalIteratorsNatural.hasOwnProperty(options.visit)) {
- iterators = options.reverse
- ? fastTraversalIteratorsReverse[options.visit]
- : fastTraversalIteratorsNatural[options.visit];
- } else if (!types.hasOwnProperty(options.visit)) {
- throw new Error('Bad value `' + options.visit + '` for `visit` option (should be: ' + Object.keys(types).join(', ') + ')');
- }
-
- enter = invokeForType(enter, options.visit);
- leave = invokeForType(leave, options.visit);
- }
- }
-
- if (enter === noop && leave === noop) {
- throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
- }
-
- walkNode(root);
- };
-
- walk.break = breakWalk;
- walk.skip = skipNode;
-
- walk.find = function(ast, fn) {
- var found = null;
-
- walk(ast, function(node, item, list) {
- if (fn.call(this, node, item, list)) {
- found = node;
- return breakWalk;
- }
- });
-
- return found;
- };
-
- walk.findLast = function(ast, fn) {
- var found = null;
-
- walk(ast, {
- reverse: true,
- enter: function(node, item, list) {
- if (fn.call(this, node, item, list)) {
- found = node;
- return breakWalk;
- }
- }
- });
-
- return found;
- };
-
- walk.findAll = function(ast, fn) {
- var found = [];
-
- walk(ast, function(node, item, list) {
- if (fn.call(this, node, item, list)) {
- found.push(node);
- }
- });
-
- return found;
- };
-
- return walk;
- };
-
- var List$1 = List_1;
-
- var clone$1 = function clone(node) {
- var result = {};
-
- for (var key in node) {
- var value = node[key];
-
- if (value) {
- if (Array.isArray(value) || value instanceof List$1) {
- value = value.map(clone);
- } else if (value.constructor === Object) {
- value = clone(value);
- }
- }
-
- result[key] = value;
- }
-
- return result;
- };
-
- const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- const shape$1 = {
- generic: true,
- types: appendOrAssign,
- atrules: {
- prelude: appendOrAssignOrNull,
- descriptors: appendOrAssignOrNull
- },
- properties: appendOrAssign,
- parseContext: assign,
- scope: deepAssign,
- atrule: ['parse'],
- pseudo: ['parse'],
- node: ['name', 'structure', 'parse', 'generate', 'walkContext']
- };
-
- function isObject$2(value) {
- return value && value.constructor === Object;
- }
-
- function copy(value) {
- return isObject$2(value)
- ? Object.assign({}, value)
- : value;
- }
-
- function assign(dest, src) {
- return Object.assign(dest, src);
- }
-
- function deepAssign(dest, src) {
- for (const key in src) {
- if (hasOwnProperty$2.call(src, key)) {
- if (isObject$2(dest[key])) {
- deepAssign(dest[key], copy(src[key]));
- } else {
- dest[key] = copy(src[key]);
- }
- }
- }
-
- return dest;
- }
-
- function append(a, b) {
- if (typeof b === 'string' && /^\s*\|/.test(b)) {
- return typeof a === 'string'
- ? a + b
- : b.replace(/^\s*\|\s*/, '');
- }
-
- return b || null;
- }
-
- function appendOrAssign(a, b) {
- if (typeof b === 'string') {
- return append(a, b);
- }
-
- const result = Object.assign({}, a);
- for (let key in b) {
- if (hasOwnProperty$2.call(b, key)) {
- result[key] = append(hasOwnProperty$2.call(a, key) ? a[key] : undefined, b[key]);
- }
- }
-
- return result;
- }
-
- function appendOrAssignOrNull(a, b) {
- const result = appendOrAssign(a, b);
-
- return !isObject$2(result) || Object.keys(result).length
- ? result
- : null;
- }
-
- function mix$1(dest, src, shape) {
- for (const key in shape) {
- if (hasOwnProperty$2.call(shape, key) === false) {
- continue;
- }
-
- if (shape[key] === true) {
- if (key in src) {
- if (hasOwnProperty$2.call(src, key)) {
- dest[key] = copy(src[key]);
- }
- }
- } else if (shape[key]) {
- if (typeof shape[key] === 'function') {
- const fn = shape[key];
- dest[key] = fn({}, dest[key]);
- dest[key] = fn(dest[key] || {}, src[key]);
- } else if (isObject$2(shape[key])) {
- const result = {};
-
- for (let name in dest[key]) {
- result[name] = mix$1({}, dest[key][name], shape[key]);
- }
-
- for (let name in src[key]) {
- result[name] = mix$1(result[name] || {}, src[key][name], shape[key]);
- }
-
- dest[key] = result;
- } else if (Array.isArray(shape[key])) {
- const res = {};
- const innerShape = shape[key].reduce(function(s, k) {
- s[k] = true;
- return s;
- }, {});
-
- for (const [name, value] of Object.entries(dest[key] || {})) {
- res[name] = {};
- if (value) {
- mix$1(res[name], value, innerShape);
- }
- }
-
- for (const name in src[key]) {
- if (hasOwnProperty$2.call(src[key], name)) {
- if (!res[name]) {
- res[name] = {};
- }
-
- if (src[key] && src[key][name]) {
- mix$1(res[name], src[key][name], innerShape);
- }
- }
- }
-
- dest[key] = res;
- }
- }
- }
- return dest;
- }
-
- var mix_1 = (dest, src) => mix$1(dest, src, shape$1);
-
- var List = List_1;
- var SyntaxError$1 = _SyntaxError$1;
- var TokenStream = TokenStream_1;
- var Lexer = Lexer_1;
- var definitionSyntax = definitionSyntax$1;
- var tokenize = tokenizer$3;
- var createParser = create$4;
- var createGenerator = create$3;
- var createConvertor = create$2;
- var createWalker = create$1;
- var clone = clone$1;
- var names = names$2;
- var mix = mix_1;
-
- function createSyntax(config) {
- var parse = createParser(config);
- var walk = createWalker(config);
- var generate = createGenerator(config);
- var convert = createConvertor(walk);
-
- var syntax = {
- List: List,
- SyntaxError: SyntaxError$1,
- TokenStream: TokenStream,
- Lexer: Lexer,
-
- vendorPrefix: names.vendorPrefix,
- keyword: names.keyword,
- property: names.property,
- isCustomProperty: names.isCustomProperty,
-
- definitionSyntax: definitionSyntax,
- lexer: null,
- createLexer: function(config) {
- return new Lexer(config, syntax, syntax.lexer.structure);
- },
-
- tokenize: tokenize,
- parse: parse,
- walk: walk,
- generate: generate,
-
- find: walk.find,
- findLast: walk.findLast,
- findAll: walk.findAll,
-
- clone: clone,
- fromPlainObject: convert.fromPlainObject,
- toPlainObject: convert.toPlainObject,
-
- createSyntax: function(config) {
- return createSyntax(mix({}, config));
- },
- fork: function(extension) {
- var base = mix({}, config); // copy of config
- return createSyntax(
- typeof extension === 'function'
- ? extension(base, Object.assign)
- : mix(base, extension)
- );
- }
- };
-
- syntax.lexer = new Lexer({
- generic: true,
- types: config.types,
- atrules: config.atrules,
- properties: config.properties,
- node: config.node
- }, syntax);
-
- return syntax;
- }
- create$5.create = function(config) {
- return createSyntax(mix({}, config));
- };
-
- var require$$0 = {
- "@charset": {
- syntax: "@charset \"\";",
- groups: [
- "CSS Charsets"
- ],
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@charset"
- },
- "@counter-style": {
- syntax: "@counter-style {\n [ system: ; ] ||\n [ symbols: ; ] ||\n [ additive-symbols: ; ] ||\n [ negative: ; ] ||\n [ prefix: ; ] ||\n [ suffix: ; ] ||\n [ range: ; ] ||\n [ pad: ; ] ||\n [ speak-as: ; ] ||\n [ fallback: ; ]\n}",
- interfaces: [
- "CSSCounterStyleRule"
- ],
- groups: [
- "CSS Counter Styles"
- ],
- descriptors: {
- "additive-symbols": {
- syntax: "[ && ]#",
- media: "all",
- initial: "n/a (required)",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- fallback: {
- syntax: "",
- media: "all",
- initial: "decimal",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- negative: {
- syntax: " ?",
- media: "all",
- initial: "\"-\" hyphen-minus",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- pad: {
- syntax: " && ",
- media: "all",
- initial: "0 \"\"",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- prefix: {
- syntax: "",
- media: "all",
- initial: "\"\"",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- range: {
- syntax: "[ [ | infinite ]{2} ]# | auto",
- media: "all",
- initial: "auto",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- "speak-as": {
- syntax: "auto | bullets | numbers | words | spell-out | ",
- media: "all",
- initial: "auto",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- suffix: {
- syntax: "",
- media: "all",
- initial: "\". \"",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- symbols: {
- syntax: "+",
- media: "all",
- initial: "n/a (required)",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- system: {
- syntax: "cyclic | numeric | alphabetic | symbolic | additive | [ fixed ? ] | [ extends ]",
- media: "all",
- initial: "symbolic",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- }
- },
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@counter-style"
- },
- "@document": {
- syntax: "@document [ | url-prefix() | domain() | media-document() | regexp() ]# {\n \n}",
- interfaces: [
- "CSSGroupingRule",
- "CSSConditionRule"
- ],
- groups: [
- "CSS Conditional Rules"
- ],
- status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@document"
- },
- "@font-face": {
- syntax: "@font-face {\n [ font-family: ; ] ||\n [ src: ; ] ||\n [ unicode-range: ; ] ||\n [ font-variant: ; ] ||\n [ font-feature-settings: ; ] ||\n [ font-variation-settings: ; ] ||\n [ font-stretch: ; ] ||\n [ font-weight: ; ] ||\n [ font-style: ; ]\n}",
- interfaces: [
- "CSSFontFaceRule"
- ],
- groups: [
- "CSS Fonts"
- ],
- descriptors: {
- "font-display": {
- syntax: "[ auto | block | swap | fallback | optional ]",
- media: "visual",
- percentages: "no",
- initial: "auto",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "experimental"
- },
- "font-family": {
- syntax: "",
- media: "all",
- initial: "n/a (required)",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- "font-feature-settings": {
- syntax: "normal | #",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- "font-variation-settings": {
- syntax: "normal | [ ]#",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- "font-stretch": {
- syntax: "{1,2}",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- "font-style": {
- syntax: "normal | italic | oblique {0,2}",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- "font-weight": {
- syntax: "{1,2}",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "uniqueOrder",
- status: "standard"
- },
- "font-variant": {
- syntax: "normal | none | [ || || || || stylistic() || historical-forms || styleset(#) || character-variant(#) || swash() || ornaments() || annotation() || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || || || || ordinal || slashed-zero || || || ruby ]",
- media: "all",
- initial: "normal",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- src: {
- syntax: "[ [ format( # ) ]? | local( ) ]#",
- media: "all",
- initial: "n/a (required)",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- },
- "unicode-range": {
- syntax: "#",
- media: "all",
- initial: "U+0-10FFFF",
- percentages: "no",
- computed: "asSpecified",
- order: "orderOfAppearance",
- status: "standard"
- }
- },
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@font-face"
- },
- "@font-feature-values": {
- syntax: "@font-feature-values # {\n \n}",
- interfaces: [
- "CSSFontFeatureValuesRule"
- ],
- groups: [
- "CSS Fonts"
- ],
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@font-feature-values"
- },
- "@import": {
- syntax: "@import [ | ] [ ]?;",
- groups: [
- "Media Queries"
- ],
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@import"
- },
- "@keyframes": {
- syntax: "@keyframes {\n \n}",
- interfaces: [
- "CSSKeyframeRule",
- "CSSKeyframesRule"
- ],
- groups: [
- "CSS Animations"
- ],
- status: "standard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@keyframes"
- },
- "@media": {
- syntax: "@media