@antistatique/leckerli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/LICENSE +21 -0
- package/README.md +177 -0
- package/dist/assets/leckerli.min.css +1 -0
- package/dist/assets/leckerli.min.js +17 -0
- package/dist/index.html +60 -0
- package/index.html +62 -0
- package/package.json +32 -0
- package/postcss.config.cjs +10 -0
- package/src/components/App.tsx +22 -0
- package/src/components/Banner.tsx +43 -0
- package/src/components/Settings.tsx +48 -0
- package/src/defaultSettings.ts +23 -0
- package/src/hooks/useSettings.ts +129 -0
- package/src/index.css +3 -0
- package/src/index.tsx +9 -0
- package/src/types/cookie.ts +5 -0
- package/src/types/leckerli.d.ts +9 -0
- package/src/types/settings.ts +12 -0
- package/src/types/vite-env.d.ts +1 -0
- package/tailwind.config.js +27 -0
- package/tsconfig.json +26 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +16 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [1.0.0] - 2023-06-27
|
|
10
|
+
### Added
|
|
11
|
+
- First POC
|
|
12
|
+
|
|
13
|
+
[Unreleased]: https://github.com/antistatique/leckerli/compare/v1.0.0...HEAD
|
|
14
|
+
[1.0.0]: https://github.com/antistatique/leckerli/releases/tag/v1.0.0
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
dev@antistatique.net.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Antistatique
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# 🍪 Leckerli
|
|
2
|
+
|
|
3
|
+
> Lightweight and customisable GDPR cookie manager
|
|
4
|
+
|
|
5
|
+
## 📗 Usage
|
|
6
|
+
|
|
7
|
+
To use leckerli into your website, simply add the following CSS/JavaScript in your website:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<html>
|
|
11
|
+
<head>
|
|
12
|
+
<!-- somewhere in the <head /> -->
|
|
13
|
+
<link rel="stylesheet" href="leckerli.css">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<!-- at the end of your <body /> -->
|
|
17
|
+
<<script type="module" src="leckerli.js"></script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ⚙️ Configuration
|
|
23
|
+
|
|
24
|
+
To configure Leckerli, attach a `leckerliSettings` object to your `window`. Something like:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<script>
|
|
28
|
+
window.leckerliSettings = {
|
|
29
|
+
// Your settings
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Here are the settings that you can override:
|
|
35
|
+
|
|
36
|
+
### `name`
|
|
37
|
+
|
|
38
|
+
It's the name of your cookie.
|
|
39
|
+
|
|
40
|
+
### `banner`
|
|
41
|
+
|
|
42
|
+
`banner` is an object with the text content to override. By default:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
window.leckerliSettings = {
|
|
46
|
+
//...
|
|
47
|
+
banner: {
|
|
48
|
+
title: 'This website uses cookies.',
|
|
49
|
+
description: 'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',
|
|
50
|
+
accept: 'Accept all',
|
|
51
|
+
reject: 'Deny',
|
|
52
|
+
customise: 'Customize',
|
|
53
|
+
},
|
|
54
|
+
//...
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `permissions`
|
|
59
|
+
|
|
60
|
+
The core of Leckerli, it's all the permissions that you want to manage. By default:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
window.leckerliSettings = {
|
|
64
|
+
//...
|
|
65
|
+
permissions: [
|
|
66
|
+
{
|
|
67
|
+
slug: 'settings',
|
|
68
|
+
title: 'Preferences',
|
|
69
|
+
description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
//...
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `baseData`
|
|
77
|
+
|
|
78
|
+
`baseData` is an object of any kind that **will be passed to the final cookie** as well. For example for store consent-id of some sort.
|
|
79
|
+
|
|
80
|
+
### For example
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<script>
|
|
84
|
+
window.leckerliSettings = {
|
|
85
|
+
name: 'website-gdpr',
|
|
86
|
+
baseData: {
|
|
87
|
+
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
88
|
+
},
|
|
89
|
+
banner: {
|
|
90
|
+
title: 'Nous respectons votre vie privée.',
|
|
91
|
+
description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
|
|
92
|
+
accept: 'Accepter tout',
|
|
93
|
+
reject: 'Tout rejeter',
|
|
94
|
+
customise: 'Personnaliser',
|
|
95
|
+
},
|
|
96
|
+
permissions: [
|
|
97
|
+
{
|
|
98
|
+
slug: 'settings',
|
|
99
|
+
title: 'Préférences',
|
|
100
|
+
description: 'Les cookies de préférence permettent à un site web de mémoriser des informations qui modifient le comportement ou l\'apparence du site, comme votre langue préférée ou la région dans laquelle vous vous trouvez.'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
slug: 'ga',
|
|
104
|
+
title: 'Google analytics',
|
|
105
|
+
description: 'Google Analytics permet de mesurer et d\'analyser le comportement des visiteurs d\'un site internet, en fournissant des données clés sur leur provenance, leur navigation et leur engagement, afin d\'aider à optimiser le site et à améliorer l\'expérience utilisateur.'
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 🩻 Cookie structure
|
|
113
|
+
|
|
114
|
+
With the default settings above, here is the value stored in our cookie:
|
|
115
|
+
|
|
116
|
+
```plain
|
|
117
|
+
{%22settings%22:true}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
And after a `JSON.parse()`:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{"settings":true}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Basically, it's the `baseData` values, if there is any, and for each `permissions.slug`, a **boolean**.
|
|
127
|
+
|
|
128
|
+
## 🎫 Events
|
|
129
|
+
|
|
130
|
+
Here is a list of events you can **listen**:
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
// To listen to the permissions / cookie's updates
|
|
134
|
+
document.addEventListener('leckerli:permissions-updated');
|
|
135
|
+
|
|
136
|
+
// To listen the modal states
|
|
137
|
+
document.addEventListener('leckerli:modal-closed');
|
|
138
|
+
document.addEventListener('leckerli:modal-opened');
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Here is a list of events you can **dispatch**:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
// To manage the banner, even after the user's choice
|
|
145
|
+
document.dispatchEvent(new CustomEvent('leckerli:open-banner'));
|
|
146
|
+
document.dispatchEvent(new CustomEvent('leckerli:close-banner'));
|
|
147
|
+
|
|
148
|
+
// To manage the settings modal
|
|
149
|
+
document.dispatchEvent(new CustomEvent('leckerli:open-modal'));
|
|
150
|
+
document.dispatchEvent(new CustomEvent('leckerli:close-modal'));
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 🎨 Theming
|
|
154
|
+
|
|
155
|
+
You can theme Leckerli with the following CSS custom properties (variables):
|
|
156
|
+
|
|
157
|
+
```html
|
|
158
|
+
<style>
|
|
159
|
+
:root {
|
|
160
|
+
--leckerli-foreground: #fff; /* Texts */
|
|
161
|
+
--leckerli-background: #000; /* Backgrounds */
|
|
162
|
+
--leckerli-primary: #ff0099; /* Call to actions */
|
|
163
|
+
--leckerli-primary-hover: #d1007e; /* Call to actions hovered */
|
|
164
|
+
--leckerli-primary-active: #9D005F; /* Call to actions actived */
|
|
165
|
+
--leckerli-font: sans-serif; /* Font family */
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 🧑💻 Contribute
|
|
171
|
+
|
|
172
|
+
To locally run the project:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
$ yarn
|
|
176
|
+
$ yarn dev
|
|
177
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#lkrl-wrapper *,#lkrl-wrapper :before,#lkrl-wrapper :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}#lkrl-wrapper :before,#lkrl-wrapper :after{--tw-content: ""}#lkrl-wrapper{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}#lkrl-wrapper{margin:0;line-height:inherit}#lkrl-wrapper hr{height:0;color:inherit;border-top-width:1px}#lkrl-wrapper abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#lkrl-wrapper h1,#lkrl-wrapper h2,#lkrl-wrapper h3,#lkrl-wrapper h4,#lkrl-wrapper h5,#lkrl-wrapper h6{font-size:inherit;font-weight:inherit}#lkrl-wrapper a{color:inherit;text-decoration:inherit}#lkrl-wrapper b,#lkrl-wrapper strong{font-weight:bolder}#lkrl-wrapper code,#lkrl-wrapper kbd,#lkrl-wrapper samp,#lkrl-wrapper pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}#lkrl-wrapper small{font-size:80%}#lkrl-wrapper sub,#lkrl-wrapper sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#lkrl-wrapper sub{bottom:-.25em}#lkrl-wrapper sup{top:-.5em}#lkrl-wrapper table{text-indent:0;border-color:inherit;border-collapse:collapse}#lkrl-wrapper button,#lkrl-wrapper input,#lkrl-wrapper optgroup,#lkrl-wrapper select,#lkrl-wrapper textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}#lkrl-wrapper button,#lkrl-wrapper select{text-transform:none}#lkrl-wrapper button,#lkrl-wrapper [type=button],#lkrl-wrapper [type=reset],#lkrl-wrapper [type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}#lkrl-wrapper :-moz-focusring{outline:auto}#lkrl-wrapper :-moz-ui-invalid{box-shadow:none}#lkrl-wrapper progress{vertical-align:baseline}#lkrl-wrapper ::-webkit-inner-spin-button,#lkrl-wrapper ::-webkit-outer-spin-button{height:auto}#lkrl-wrapper [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#lkrl-wrapper ::-webkit-search-decoration{-webkit-appearance:none}#lkrl-wrapper ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#lkrl-wrapper summary{display:list-item}#lkrl-wrapper blockquote,#lkrl-wrapper dl,#lkrl-wrapper dd,#lkrl-wrapper h1,#lkrl-wrapper h2,#lkrl-wrapper h3,#lkrl-wrapper h4,#lkrl-wrapper h5,#lkrl-wrapper h6,#lkrl-wrapper hr,#lkrl-wrapper figure,#lkrl-wrapper p,#lkrl-wrapper pre{margin:0}#lkrl-wrapper fieldset{margin:0;padding:0}#lkrl-wrapper legend{padding:0}#lkrl-wrapper ol,#lkrl-wrapper ul,#lkrl-wrapper menu{list-style:none;margin:0;padding:0}#lkrl-wrapper textarea{resize:vertical}#lkrl-wrapper input::-moz-placeholder,#lkrl-wrapper textarea::-moz-placeholder{opacity:1;color:#9ca3af}#lkrl-wrapper input::placeholder,#lkrl-wrapper textarea::placeholder{opacity:1;color:#9ca3af}#lkrl-wrapper button,#lkrl-wrapper [role=button]{cursor:pointer}#lkrl-wrapper :disabled{cursor:default}#lkrl-wrapper img,#lkrl-wrapper svg,#lkrl-wrapper video,#lkrl-wrapper canvas,#lkrl-wrapper audio,#lkrl-wrapper iframe,#lkrl-wrapper embed,#lkrl-wrapper object{display:block;vertical-align:middle}#lkrl-wrapper img,#lkrl-wrapper video{max-width:100%;height:auto}#lkrl-wrapper [hidden]{display:none}#lkrl-wrapper *,#lkrl-wrapper :before,#lkrl-wrapper :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#lkrl-wrapper ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#lkrl-wrapper .sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}#lkrl-wrapper .pointer-events-none{pointer-events:none!important}#lkrl-wrapper .fixed{position:fixed!important}#lkrl-wrapper .absolute{position:absolute!important}#lkrl-wrapper .relative{position:relative!important}#lkrl-wrapper .bottom-0{bottom:0px!important}#lkrl-wrapper .left-0{left:0px!important}#lkrl-wrapper .left-1\/2{left:50%!important}#lkrl-wrapper .right-0{right:0px!important}#lkrl-wrapper .top-0{top:0px!important}#lkrl-wrapper .top-1\/2{top:50%!important}#lkrl-wrapper .z-\[9998\]{z-index:9998!important}#lkrl-wrapper .z-\[9999\]{z-index:9999!important}#lkrl-wrapper .m-0{margin:0!important}#lkrl-wrapper .m-2{margin:.5rem!important}#lkrl-wrapper .mr-2{margin-right:.5rem!important}#lkrl-wrapper .mt-0{margin-top:0!important}#lkrl-wrapper .mt-0\.5{margin-top:.125rem!important}#lkrl-wrapper .mt-2{margin-top:.5rem!important}#lkrl-wrapper .inline-block{display:inline-block!important}#lkrl-wrapper .flex{display:flex!important}#lkrl-wrapper .inline-flex{display:inline-flex!important}#lkrl-wrapper .h-5{height:1.25rem!important}#lkrl-wrapper .h-6{height:1.5rem!important}#lkrl-wrapper .h-8{height:2rem!important}#lkrl-wrapper .max-h-full{max-height:100%!important}#lkrl-wrapper .w-10\/12{width:83.333333%!important}#lkrl-wrapper .w-11{width:2.75rem!important}#lkrl-wrapper .w-5{width:1.25rem!important}#lkrl-wrapper .w-8{width:2rem!important}#lkrl-wrapper .w-full{width:100%!important}#lkrl-wrapper .max-w-md{max-width:28rem!important}#lkrl-wrapper .flex-shrink-0{flex-shrink:0!important}#lkrl-wrapper .-translate-x-1\/2{--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}#lkrl-wrapper .-translate-y-1\/2{--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}#lkrl-wrapper .translate-x-0{--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}#lkrl-wrapper .translate-x-5{--tw-translate-x: 1.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}#lkrl-wrapper .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}#lkrl-wrapper .cursor-pointer{cursor:pointer!important}#lkrl-wrapper .items-start{align-items:flex-start!important}#lkrl-wrapper .justify-between{justify-content:space-between!important}#lkrl-wrapper .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem * var(--tw-space-y-reverse))!important}#lkrl-wrapper .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1rem * var(--tw-space-y-reverse))!important}#lkrl-wrapper .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))!important}#lkrl-wrapper .rounded{border-radius:.25rem!important}#lkrl-wrapper .rounded-full{border-radius:9999px!important}#lkrl-wrapper .rounded-md{border-radius:.375rem!important}#lkrl-wrapper .border-2{border-width:2px!important}#lkrl-wrapper .border-solid{border-style:solid!important}#lkrl-wrapper .border-primary{border-color:var(--leckerli-primary, #059669)!important}#lkrl-wrapper .border-transparent{border-color:transparent!important}#lkrl-wrapper .bg-background{background-color:var(--leckerli-background, #fff)!important}#lkrl-wrapper .bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity))!important}#lkrl-wrapper .bg-primary{background-color:var(--leckerli-primary, #059669)!important}#lkrl-wrapper .px-2{padding-left:.5rem!important;padding-right:.5rem!important}#lkrl-wrapper .px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}#lkrl-wrapper .py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}#lkrl-wrapper .py-1\.5{padding-top:.375rem!important;padding-bottom:.375rem!important}#lkrl-wrapper .py-4{padding-top:1rem!important;padding-bottom:1rem!important}#lkrl-wrapper .pt-2{padding-top:.5rem!important}#lkrl-wrapper .font-primary{font-family:var(--leckerli-font, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji")!important}#lkrl-wrapper .text-lg{font-size:1.125rem!important;line-height:1.75rem!important}#lkrl-wrapper .text-sm{font-size:.875rem!important;line-height:1.25rem!important}#lkrl-wrapper .text-xl{font-size:1.25rem!important;line-height:1.75rem!important}#lkrl-wrapper .font-semibold{font-weight:600!important}#lkrl-wrapper .leading-snug{line-height:1.375!important}#lkrl-wrapper .text-background{color:var(--leckerli-background, #fff)!important}#lkrl-wrapper .text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}#lkrl-wrapper .text-foreground{color:var(--leckerli-foreground, #000)!important}#lkrl-wrapper .text-primary{color:var(--leckerli-primary, #059669)!important}#lkrl-wrapper .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}#lkrl-wrapper .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}#lkrl-wrapper .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}#lkrl-wrapper .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}#lkrl-wrapper .duration-200{transition-duration:.2s!important}#lkrl-wrapper .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)!important}#lkrl-wrapper .hover\:border-primary-hover:hover{border-color:var(--leckerli-primary-hover, #047857)!important}#lkrl-wrapper .hover\:bg-primary-hover:hover{background-color:var(--leckerli-primary-hover, #047857)!important}#lkrl-wrapper .hover\:text-primary-hover:hover{color:var(--leckerli-primary-hover, #047857)!important}#lkrl-wrapper .focus\:outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}#lkrl-wrapper .focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}#lkrl-wrapper .focus\:ring-primary:focus{--tw-ring-color: var(--leckerli-primary, #059669) !important}#lkrl-wrapper .focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px !important}#lkrl-wrapper .active\:border-primary-active:active{border-color:var(--leckerli-primary-active, #064e3b)!important}#lkrl-wrapper .active\:bg-primary-active:active{background-color:var(--leckerli-primary-active, #064e3b)!important}#lkrl-wrapper .active\:text-primary-active:active{color:var(--leckerli-primary-active, #064e3b)!important}@media (min-width: 768px){#lkrl-wrapper .md\:px-3{padding-left:.75rem!important;padding-right:.75rem!important}#lkrl-wrapper .md\:px-3\.5{padding-left:.875rem!important;padding-right:.875rem!important}#lkrl-wrapper .md\:py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}#lkrl-wrapper .md\:py-2\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}#lkrl-wrapper .md\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}#lkrl-wrapper .md\:text-base{font-size:1rem!important;line-height:1.5rem!important}#lkrl-wrapper .md\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const _ of o.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var V,a,Ze,R,Pe,Qe,pe,Xe,X={},et=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oe=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function tt(e){var t=e.parentNode;t&&t.removeChild(e)}function E(e,t,n){var r,i,o,_={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?V.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,r,i,null)}function I(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ze};return i==null&&a.vnode!=null&&a.vnode(o),o}function nt(){return{current:null}}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function rt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rt(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ee.__r++||Pe!==a.debounceRendering)&&((Pe=a.debounceRendering)||Qe)(ee)}function ee(){var e,t,n,r,i,o,_,c;for(R.sort(pe);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=void 0,_=(o=(n=e).__v).__e,(c=n.__P)&&(r=[],(i=w({},o)).__v=o.__v+1,ye(c,o,i,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[_]:null,r,_??F(o),o.__h),ct(r,o),o.__e!=_&&rt(o)),R.length>t&&R.sort(pe));ee.__r=0}function ot(e,t,n,r,i,o,_,c,l,p){var u,h,f,s,d,$,g,b=r&&r.__k||et,x=b.length;for(n.__k=[],u=0;u<t.length;u++)if((s=n.__k[u]=(s=t[u])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?I(null,s,null,null,s):oe(s)?I(C,{children:s},null,null,null):s.__b>0?I(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null){if(s.__=n,s.__b=n.__b+1,(f=b[u])===null||f&&s.key==f.key&&s.type===f.type)b[u]=void 0;else for(h=0;h<x;h++){if((f=b[h])&&s.key==f.key&&s.type===f.type){b[h]=void 0;break}f=null}ye(e,s,f=f||X,i,o,_,c,l,p),d=s.__e,(h=s.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,s),g.push(h,s.__c||d,s)),d!=null?($==null&&($=d),typeof s.type=="function"&&s.__k===f.__k?s.__d=l=it(s,l,e):l=ut(e,s,f,b,d,l),typeof n.type=="function"&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=F(f))}for(n.__e=$,u=x;u--;)b[u]!=null&&(typeof n.type=="function"&&b[u].__e!=null&&b[u].__e==n.__d&&(n.__d=_t(r).nextSibling),st(b[u],b[u]));if(g)for(u=0;u<g.length;u++)lt(g[u],g[++u],g[++u])}function it(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?it(r,t,n):ut(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],e==null||typeof e=="boolean"||(oe(e)?e.some(function(n){P(n,t)}):t.push(e)),t}function ut(e,t,n,r,i,o){var _,c,l;if(t.__d!==void 0)_=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),_=null;else{for(c=o,l=0;(c=c.nextSibling)&&l<r.length;l+=1)if(c==i)break e;e.insertBefore(i,o),_=o}return _!==void 0?_:i.nextSibling}function _t(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_t(n)))return r}return null}function Qt(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||te(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||te(e,o,t[o],n[o],r)}function Ne(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zt.test(t)?n:n+"px"}function te(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ne(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ne(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Re:De,o):e.removeEventListener(t,o?Re:De,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function De(e){return this.l[e.type+!1](a.event?a.event(e):e)}function Re(e){return this.l[e.type+!0](a.event?a.event(e):e)}function ye(e,t,n,r,i,o,_,c,l){var p,u,h,f,s,d,$,g,b,x,z,H,Oe,q,le,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(l=n.__h,c=t.__e=n.__e,t.__h=null,o=[c]),(p=a.__b)&&p(t);try{e:if(typeof k=="function"){if(g=t.props,b=(p=k.contextType)&&r[p.__c],x=p?b?b.props.value:p.__:r,n.__c?$=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,x):(t.__c=u=new S(g,x),u.constructor=k,u.render=en),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,s=u.state,u.__v=t,h)k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,x),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,x)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(K){K&&(K.__=t)}),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[],u.__h.length&&_.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,s,d)})}if(u.context=x,u.props=g,u.__P=e,H=a.__r,Oe=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++Oe<25);u.state=u.__s,u.getChildContext!=null&&(r=w(w({},r),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(d=u.getSnapshotBeforeUpdate(f,s)),ot(e,oe(le=p!=null&&p.type===C&&p.key==null?p.props.children:p)?le:[le],t,n,r,i,o,_,c,l),u.base=t.__e,t.__h=null,u.__h.length&&_.push(u),$&&(u.__E=u.__=null),u.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xt(n.__e,t,n,r,i,o,_,l);(p=a.diffed)&&p(t)}catch(K){t.__v=null,(l||o!=null)&&(t.__e=c,t.__h=!!l,o[o.indexOf(c)]=null),a.__e(K,t,n)}}function ct(e,t){a.__c&&a.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){a.__e(r,n.__v)}})}function Xt(e,t,n,r,i,o,_,c){var l,p,u,h=n.props,f=t.props,s=t.type,d=0;if(s==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((l=o[d])&&"setAttribute"in l==!!s&&(s?l.localName===s:l.nodeType===3)){e=l,o[d]=null;break}}if(e==null){if(s===null)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s,f.is&&f),o=null,c=!1}if(s===null)h===f||c&&e.data===f||(e.data=f);else{if(o=o&&V.call(e.childNodes),p=(h=n.props||X).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!c){if(o!=null)for(h={},d=0;d<e.attributes.length;d++)h[e.attributes[d].name]=e.attributes[d].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Qt(e,f,h,i,c),u)t.__k=[];else if(ot(e,oe(d=t.props.children)?d:[d],t,n,r,i&&s!=="foreignObject",o,_,o?o[0]:n.__k&&F(n,0),c),o!=null)for(d=o.length;d--;)o[d]!=null&&tt(o[d]);c||("value"in f&&(d=f.value)!==void 0&&(d!==e.value||s==="progress"&&!d||s==="option"&&d!==h.value)&&te(e,"value",d,h.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&te(e,"checked",d,h.checked,!1))}return e}function lt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){a.__e(r,n)}}function st(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){a.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&st(r[i],t,n||typeof e.type!="function");n||e.__e==null||tt(e.__e),e.__=e.__e=e.__d=void 0}function en(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,i,o;a.__&&a.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],ye(t,e=(!r&&n||t).__k=E(C,null,[e]),i||X,X,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?V.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),ct(o,e)}function at(e,t){j(e,t,at)}function tn(e,t,n){var r,i,o,_,c=w({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?i=t[o]:c[o]=t[o]===void 0&&_!==void 0?_[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?V.call(arguments,2):n),I(e.type,c,r||e.key,i||e.ref,null)}function ft(e,t){var n={__c:t="__cC"+Xe++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(_){this.props.value!==_.value&&i.some(function(c){c.__e=!0,de(c)})},this.sub=function(_){i.push(_);var c=_.componentWillUnmount;_.componentWillUnmount=function(){i.splice(i.indexOf(_),1),c&&c.call(_)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}V=et.slice,a={__e:function(e,t,n,r){for(var i,o,_;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),_=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),_=i.__d),_)return i.__E=i}catch(c){e=c}throw e}},Ze=0,S.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},S.prototype.render=C,R=[],Qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},ee.__r=0,Xe=0;var N,v,se,Ue,T=0,pt=[],Y=[],Ae=a.__b,Me=a.__r,je=a.diffed,Te=a.__c,Le=a.unmount;function U(e,t){a.__h&&a.__h(v,e,T||t),T=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function ie(e){return T=1,ge(gt,e)}function ge(e,t,n){var r=U(N++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gt(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],p=r.t(l,c);l!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var i=function(c,l,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,c,l,p);var h=!1;return u.forEach(function(f){if(f.__N){var s=f.__[0];f.__=f.__N,f.__N=void 0,s!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===c)&&(!o||o.call(this,c,l,p))};v.u=!0;var o=v.shouldComponentUpdate,_=v.componentWillUpdate;v.componentWillUpdate=function(c,l,p){if(this.__e){var u=o;o=void 0,i(c,l,p),o=u}_&&_.call(this,c,l,p)},v.shouldComponentUpdate=i}return r.__N||r.__}function ue(e,t){var n=U(N++,3);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function B(e,t){var n=U(N++,4);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,v.__h.push(n))}function dt(e){return T=5,_e(function(){return{current:e}},[])}function ht(e,t,n){T=6,B(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function _e(e,t){var n=U(N++,7);return ke(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function vt(e,t){return T=8,_e(function(){return e},t)}function mt(e){var t=v.context[e.__c],n=U(N++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(v)),t.props.value):e.__}function be(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function nn(e){var t=U(N++,10),n=ie();return t.__=e,v.componentDidCatch||(v.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yt(){var e=U(N++,11);if(!e.__){for(var t=v.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function rn(){for(var e;e=pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){v=null,Ae&&Ae(e)},a.__r=function(e){Me&&Me(e),N=0;var t=(v=e.__c).__H;t&&(se===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(Z),t.__h.forEach(he),t.__h=[],N=0)),se=v},a.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pt.push(t)!==1&&Ue===a.requestAnimationFrame||((Ue=a.requestAnimationFrame)||on)(rn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),se=v=null},a.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(r){return!r.__||he(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],a.__e(r,n.__v)}}),Te&&Te(e,t)},a.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Z(r)}catch(i){t=i}}),n.__H=void 0,t&&a.__e(t,n.__v))};var He=typeof requestAnimationFrame=="function";function on(e){var t,n=function(){clearTimeout(r),He&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);He&&(t=requestAnimationFrame(n))}function Z(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function he(e){var t=v;e.__c=e.__(),v=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gt(e,t){return typeof t=="function"?t(e):t}function m(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function O(e){return function t(n){return arguments.length===0||m(n)?t:e.apply(this,arguments)}}function D(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return m(n)?t:O(function(i){return e(n,i)});default:return m(n)&&m(r)?t:m(n)?O(function(i){return e(i,r)}):m(r)?O(function(i){return e(n,i)}):e(n,r)}}}function bt(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return m(n)?t:D(function(o,_){return e(n,o,_)});case 2:return m(n)&&m(r)?t:m(n)?D(function(o,_){return e(o,r,_)}):m(r)?D(function(o,_){return e(n,o,_)}):O(function(o){return e(n,r,o)});default:return m(n)&&m(r)&&m(i)?t:m(n)&&m(r)?D(function(o,_){return e(o,_,i)}):m(n)&&m(i)?D(function(o,_){return e(o,r,_)}):m(r)&&m(i)?D(function(o,_){return e(n,o,_)}):m(n)?O(function(o){return e(o,r,i)}):m(r)?O(function(o){return e(n,o,i)}):m(i)?O(function(o){return e(n,r,o)}):e(n,r,i)}}}function J(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ie(e){return Object.prototype.toString.call(e)==="[object Object]"}var kt=O(function(t){return t==null}),un=O(function(t){return!kt(t)});const xe=un;var _n=bt(function(t,n,r){var i={},o;n=n||{},r=r||{};for(o in n)J(o,n)&&(i[o]=J(o,r)?t(o,n[o],r[o]):n[o]);for(o in r)J(o,r)&&!J(o,i)&&(i[o]=r[o]);return i}),cn=bt(function e(t,n,r){return _n(function(i,o,_){return Ie(o)&&Ie(_)?e(t,o,_):t(i,o,_)},n,r)}),ln=D(function(t,n){return cn(function(r,i,o){return o},t,n)});const sn=ln,We=e=>{let t;const n=new Set,r=(l,p)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const h=t;t=p??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,h))}},i=()=>t,c={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,c),c},an=e=>e?We(e):We;function xt(e,t){for(var n in t)e[n]=t[n];return e}function ve(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ae(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ne(e){this.props=e}function St(e,t){function n(i){var o=this.props.ref,_=o==i.ref;return!_&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!_:ve(this.props,i)}function r(i){return this.shouldComponentUpdate=n,E(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ne.prototype=new S).isPureReactComponent=!0,ne.prototype.shouldComponentUpdate=function(e,t){return ve(this.props,e)||ve(this.state,t)};var Fe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fe&&Fe(e)};var fn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Et(e){function t(n){var r=xt({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=fn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ve=function(e,t){return e==null?null:P(P(e).map(t))},Ct={map:Ve,forEach:Ve,count:function(e){return e?P(e).length:0},only:function(e){var t=P(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:P},pn=a.__e;a.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}pn(e,t,n,r)};var Be=a.unmount;function $t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return $t(r,t,n)})),e}function wt(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pt(e){var t,n,r;function i(o){if(t||(t=e()).then(function(_){n=_.default||_},function(_){r=_}),r)throw r;if(!n)throw t;return E(n,o)}return i.displayName="Lazy",i.__f=!0,i}function A(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Be&&Be(e)},(W.prototype=new S).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Ot(r.__v),o=!1,_=function(){o||(o=!0,n.__R=null,i?i(c):c())};n.__R=_;var c=function(){if(!--r.__u){if(r.state.__a){var p=r.state.__a;r.__v.__k[0]=wt(p,p.__c.__P,p.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&E(C,null,e.fallback);return i&&(i.__h=null),[E(C,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function dn(e){return this.getChildContext=function(){return e.context},e.children}function hn(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),j(E(dn,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nt(e,t){var n=E(hn,{__v:e,i:t});return n.containerInfo=t,n}(A.prototype=new S).__a=function(e){var t=this,n=Ot(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},A.prototype.render=function(e){this.u=null,this.o=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},A.prototype.componentDidUpdate=A.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ze(e,n,t)})};var Dt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,vn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,mn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yn=/[A-Z0-9]/g,gn=typeof document<"u",bn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Rt(e,t,n){return t.__k==null&&(t.textContent=""),j(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ut(e,t,n){return at(e,t),typeof n=="function"&&n(),e?e.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qe=a.event;function kn(){}function xn(){return this.cancelBubble}function Sn(){return this.defaultPrevented}a.event=function(e){return qe&&(e=qe(e)),e.persist=kn,e.isPropagationStopped=xn,e.isDefaultPrevented=Sn,e.nativeEvent=e};var Se,En={enumerable:!1,configurable:!0,get:function(){return this.class}},Ke=a.vnode;a.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var o in n){var _=n[o];if(!(o==="value"&&"defaultValue"in n&&_==null||gn&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&_===!0?_="":c==="ondoubleclick"?o="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||bn(n.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":mn.test(o)?o=c:r.indexOf("-")===-1&&vn.test(o)?o=o.replace(yn,"-$&").toLowerCase():_===null&&(_=void 0):c=o="oninput",c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=_}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=P(n.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",En)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=Dt,Ke&&Ke(e)};var Je=a.__r;a.__r=function(e){Je&&Je(e),Se=e.__c};var Ge=a.diffed;a.diffed=function(e){Ge&&Ge(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Se=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return Se.__n[e.__c].props.value}}}},Cn="17.0.2";function Mt(e){return E.bind(null,e)}function Ee(e){return!!e&&e.$$typeof===Dt}function jt(e){return Ee(e)?tn.apply(null,arguments):e}function Tt(e){return!!e.__k&&(j(null,e),!0)}function Lt(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ht=function(e,t){return e(t)},It=function(e,t){return e(t)},Wt=C;function Ce(e){e()}function Ft(e){return e}function Vt(){return[!1,Ce]}var Bt=B;function zt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return B(function(){i.__=n,i.v=t,ae(i.__,t())||o({h:i})},[e,n,t]),ue(function(){return ae(i.__,i.v())||o({h:i}),e(function(){ae(i.__,i.v())||o({h:i})})},[e]),n}var $n={useState:ie,useId:yt,useReducer:ge,useEffect:ue,useLayoutEffect:B,useInsertionEffect:Bt,useTransition:Vt,useDeferredValue:Ft,useSyncExternalStore:zt,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:_e,useCallback:vt,useContext:mt,useDebugValue:be,version:"17.0.2",Children:Ct,render:Rt,hydrate:Ut,unmountComponentAtNode:Tt,createPortal:Nt,createElement:E,createContext:ft,createFactory:Mt,cloneElement:jt,createRef:nt,Fragment:C,isValidElement:Ee,findDOMNode:Lt,Component:S,PureComponent:ne,memo:St,forwardRef:Et,flushSync:It,unstable_batchedUpdates:Ht,StrictMode:Wt,Suspense:W,SuspenseList:A,lazy:Pt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At};const wn=Object.freeze(Object.defineProperty({__proto__:null,Children:Ct,Component:S,Fragment:C,PureComponent:ne,StrictMode:Wt,Suspense:W,SuspenseList:A,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At,cloneElement:jt,createContext:ft,createElement:E,createFactory:Mt,createPortal:Nt,createRef:nt,default:$n,findDOMNode:Lt,flushSync:It,forwardRef:Et,hydrate:Ut,isValidElement:Ee,lazy:Pt,memo:St,render:Rt,startTransition:Ce,unmountComponentAtNode:Tt,unstable_batchedUpdates:Ht,useCallback:vt,useContext:mt,useDebugValue:be,useDeferredValue:Ft,useEffect:ue,useErrorBoundary:nn,useId:yt,useImperativeHandle:ht,useInsertionEffect:Bt,useLayoutEffect:B,useMemo:_e,useReducer:ge,useRef:dt,useState:ie,useSyncExternalStore:zt,useTransition:Vt,version:Cn},Symbol.toStringTag,{value:"Module"}));function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qt={exports:{}},Kt={};const Jt=Pn(wn);var Gt={exports:{}},Yt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var L=Jt;function Nn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:Nn,Rn=L.useState,Un=L.useEffect,An=L.useLayoutEffect,Mn=L.useDebugValue;function jn(e,t){var n=t(),r=Rn({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return An(function(){i.value=n,i.getSnapshot=t,fe(i)&&o({inst:i})},[e,n,t]),Un(function(){return fe(i)&&o({inst:i}),e(function(){fe(i)&&o({inst:i})})},[e]),Mn(n),n}function fe(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dn(e,n)}catch{return!0}}function Tn(e,t){return t()}var Ln=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Tn:jn;Yt.useSyncExternalStore=L.useSyncExternalStore!==void 0?L.useSyncExternalStore:Ln;Gt.exports=Yt;var Hn=Gt.exports;/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ce=Jt,In=Hn;function Wn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fn=typeof Object.is=="function"?Object.is:Wn,Vn=In.useSyncExternalStore,Bn=ce.useRef,zn=ce.useEffect,qn=ce.useMemo,Kn=ce.useDebugValue;Kt.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Bn(null);if(o.current===null){var _={hasValue:!1,value:null};o.current=_}else _=o.current;o=qn(function(){function l(s){if(!p){if(p=!0,u=s,s=r(s),i!==void 0&&_.hasValue){var d=_.value;if(i(d,s))return h=d}return h=s}if(d=h,Fn(u,s))return d;var $=r(s);return i!==void 0&&i(d,$)?d:(u=s,h=$)}var p=!1,u,h,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var c=Vn(e,o[0],o[1]);return zn(function(){_.hasValue=!0,_.value=c},[c]),Kn(c),c};qt.exports=Kt;var Jn=qt.exports;const Gn=On(Jn),{useSyncExternalStoreWithSelector:Yn}=Gn;function Zn(e,t=e.getState,n){const r=Yn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return be(r),r}const Ye=e=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?an(e):e,n=(r,i)=>Zn(t,r,i);return Object.assign(n,t),n},Qn=e=>e?Ye(e):Ye,Xn={name:"leckerli",banner:{title:"This website uses cookies.",description:'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',accept:"Accept all",reject:"Deny",customise:"Customize"},permissions:[{slug:"settings",title:"Preferences",description:"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in."}],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1};/*! js-cookie v3.0.5 | MIT */function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var er={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(e,t){function n(i,o,_){if(!(typeof document>"u")){_=G({},t,_),typeof _.expires=="number"&&(_.expires=new Date(Date.now()+_.expires*864e5)),_.expires&&(_.expires=_.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var l in _)_[l]&&(c+="; "+l,_[l]!==!0&&(c+="="+_[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+c}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],_={},c=0;c<o.length;c++){var l=o[c].split("="),p=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(_[u]=e.read(p,u),i===u)break}catch{}}return i?_[i]:_}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",G({},o,{expires:-1}))},withAttributes:function(i){return me(this.converter,G({},this.attributes,i))},withConverter:function(i){return me(G({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Q=me(er,{path:"/"});const M=sn(Xn,window.leckerliSettings??{}),re=Q.get(M.name);M.cookie=xe(re)?JSON.parse(re):M.permissions.reduce((e,t)=>({...e,[t.slug]:!1}),M.baseData);M.choiceMade=xe(re);const $e=Qn((e,t)=>({...M,init:()=>{kt(re)&&t().choiceMade&&Q.set(t().name,JSON.stringify(t().cookie)),document.addEventListener("leckerli:open-banner",()=>t().setChoice(!1)),document.addEventListener("leckerli:close-banner",()=>t().setChoice(!0)),document.addEventListener("leckerli:open-modal",()=>t().setModal(!0)),document.addEventListener("leckerli:close-modal",()=>t().setModal(!1))},setChoice:n=>e(r=>({...r,choiceMade:n})),setModal:n=>e(r=>({...r,settingsOpen:n})),setPermissions:(n,r)=>e(i=>{const o=Array.isArray(n)?n:[n],_=i.permissions.reduce((c,l)=>(o.includes(l.slug)?c[l.slug]=r:c[l.slug]=i.cookie[l.slug]??!1,c),i.baseData);return Q.set(i.name,JSON.stringify(_)),{...i,choiceMade:!0,cookie:_}}),togglePermission:n=>e(r=>{const i=r.permissions.reduce((o,_)=>(n===_.slug?o[_.slug]=xe(r.cookie[_.slug])?!r.cookie[_.slug]:!0:o[_.slug]=r.cookie[_.slug]??!1,o),r.baseData);return Q.set(r.name,JSON.stringify(i)),{...r,choiceMade:!0,cookie:i}}),acceptAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!0)},rejectAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!1)}}));var tr=0;function y(e,t,n,r,i,o){var _,c,l={};for(c in t)c=="ref"?_=t[c]:l[c]=t[c];var p={type:e,props:l,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--tr,__source:i,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(c in _)l[c]===void 0&&(l[c]=_[c]);return a.vnode&&a.vnode(p),p}const nr=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=$e();return y("div",{class:"fixed z-[9998] bottom-0 left-0 max-w-md bg-background m-2 px-5 py-4 space-y-4 font-primary text-foreground rounded-md",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg md:text-xl",children:e.title}),y("p",{class:"m-0 leading-snug font-primary text-sm md:text-base",children:e.description}),y("div",{class:"pt-2 space-y-2",children:[y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:()=>r(!0),children:e.customise}),y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:n,children:e.reject}),y("button",{type:"button",class:"rounded mr-2 bg-primary font-primary font-semibold text-background px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors",onClick:t,children:e.accept})]})]})},rr=()=>{const{permissions:e,cookie:t,togglePermission:n,banner:r,setModal:i}=$e();return y("div",{class:"fixed z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-background text-foreground m-2 px-5 py-4 font-primary text-black rounded-md max-h-full",children:[y("div",{class:"space-y-6",children:[y("h3",{class:"w-10/12 m-0 font-primary font-semibold text-xl md:text-2xl",children:r.customise}),e.map(({slug:o,title:_,description:c})=>y("div",{children:[y("div",{class:"flex items-start justify-between",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg",children:_}),y("button",{type:"button",class:`${t[o]?"bg-primary":"bg-gray-200"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`,role:"switch","aria-checked":"false",onClick:()=>n(o),children:[y("span",{class:"sr-only",children:"Toggle"}),y("span",{"aria-hidden":"true",class:`${t[o]?"translate-x-5":"translate-x-0"} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`})]})]}),y("p",{class:"m-0 mt-2 leading-snug font-primary text-sm md:text-base",children:c})]},`setting-${o}`))]}),y("button",{class:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full",onClick:()=>i(!1),children:"×"})]})},or=()=>{const{choiceMade:e,init:t,settingsOpen:n}=$e();return ue(()=>{t()},[]),y(C,{children:[!e&&!n&&y(nr,{}),n&&y(rr,{})]})};const we=document.createElement("div");we.id="lkrl-wrapper";document.body.appendChild(we);j(y(or,{}),we);
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>🍪 Leckerli</title>
|
|
7
|
+
<script type="module" crossorigin src="/assets/leckerli.min.js"></script>
|
|
8
|
+
<link rel="stylesheet" href="/assets/leckerli.min.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body style="background: #cbd5e1; display: grid; place-content: center; font-family: sans-serif; min-height: 100vh;">
|
|
11
|
+
<h1>Your website here 🤗</h1>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
/*
|
|
18
|
+
window.leckerliSettings = {
|
|
19
|
+
baseData: {
|
|
20
|
+
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
21
|
+
},
|
|
22
|
+
banner: {
|
|
23
|
+
title: 'Nous respectons votre vie privée.',
|
|
24
|
+
description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
|
|
25
|
+
accept: 'Accepter tout',
|
|
26
|
+
reject: 'Tout rejeter',
|
|
27
|
+
customise: 'Personnaliser',
|
|
28
|
+
},
|
|
29
|
+
permissions: [
|
|
30
|
+
{
|
|
31
|
+
slug: 'ga',
|
|
32
|
+
title: 'Google analytics',
|
|
33
|
+
description: 'To track all your actions.'
|
|
34
|
+
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
slug: 'settings',
|
|
38
|
+
title: 'Preferences',
|
|
39
|
+
description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
}
|
|
44
|
+
*/
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
/*
|
|
49
|
+
:root {
|
|
50
|
+
--leckerli-foreground: #fff;
|
|
51
|
+
--leckerli-background: #000;
|
|
52
|
+
--leckerli-primary: #ff0099;
|
|
53
|
+
--leckerli-primary-hover: #d1007e;
|
|
54
|
+
--leckerli-primary-active: #9D005F;
|
|
55
|
+
--leckerli-font: sans-serif;
|
|
56
|
+
}
|
|
57
|
+
*/
|
|
58
|
+
</style>
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
package/index.html
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>🍪 Leckerli</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body style="background: #cbd5e1; display: grid; place-content: center; font-family: sans-serif; min-height: 100vh;">
|
|
9
|
+
<h1>Your website here 🤗</h1>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<script defer type="module" src="/src/index.tsx"></script>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
/*
|
|
16
|
+
window.leckerliSettings = {
|
|
17
|
+
baseData: {
|
|
18
|
+
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
19
|
+
},
|
|
20
|
+
banner: {
|
|
21
|
+
title: 'Nous respectons votre vie privée.',
|
|
22
|
+
description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
|
|
23
|
+
accept: 'Accepter tout',
|
|
24
|
+
reject: 'Tout rejeter',
|
|
25
|
+
customise: 'Personnaliser',
|
|
26
|
+
},
|
|
27
|
+
permissions: [
|
|
28
|
+
{
|
|
29
|
+
slug: 'ga',
|
|
30
|
+
title: 'Google analytics',
|
|
31
|
+
description: 'To track all your actions.'
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
slug: 'settings',
|
|
36
|
+
title: 'Preferences',
|
|
37
|
+
description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
}
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
document.addEventListener('leckerli:modal-closed', () => console.log('modal closed'))
|
|
45
|
+
document.addEventListener('leckerli:modal-opened', () => console.log('modal opened'))
|
|
46
|
+
document.addEventListener('leckerli:permissions-updated', () => console.log('permissions updated'))
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
/*
|
|
51
|
+
:root {
|
|
52
|
+
--leckerli-foreground: #fff;
|
|
53
|
+
--leckerli-background: #000;
|
|
54
|
+
--leckerli-primary: #ff0099;
|
|
55
|
+
--leckerli-primary-hover: #d1007e;
|
|
56
|
+
--leckerli-primary-active: #9D005F;
|
|
57
|
+
--leckerli-font: sans-serif;
|
|
58
|
+
}
|
|
59
|
+
*/
|
|
60
|
+
</style>
|
|
61
|
+
</body>
|
|
62
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@antistatique/leckerli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lightweight and customisable GDPR cookie consent manager",
|
|
5
|
+
"private": false,
|
|
6
|
+
"repository": "https://github.com/antistatique/leckerli",
|
|
7
|
+
"author": "Antistatique <dev@antistatique.net>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"build": "tsc && vite build",
|
|
13
|
+
"preview": "vite preview"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@types/ramda": "^0.29.2",
|
|
17
|
+
"js-cookie": "^3.0.5",
|
|
18
|
+
"preact": "^10.13.2",
|
|
19
|
+
"ramda": "^0.29.0",
|
|
20
|
+
"zustand": "^4.3.8"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@preact/preset-vite": "^2.5.0",
|
|
24
|
+
"@types/js-cookie": "^3.0.3",
|
|
25
|
+
"autoprefixer": "^10.4.14",
|
|
26
|
+
"postcss": "^8.4.24",
|
|
27
|
+
"postcss-prefixwrap": "^1.39.1",
|
|
28
|
+
"tailwindcss": "^3.3.2",
|
|
29
|
+
"typescript": "^5.0.2",
|
|
30
|
+
"vite": "^4.3.9"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect } from 'preact/hooks';
|
|
2
|
+
|
|
3
|
+
import Banner from './Banner';
|
|
4
|
+
import Settings from './Settings';
|
|
5
|
+
import useSettings from '../hooks/useSettings';
|
|
6
|
+
|
|
7
|
+
const App = () => {
|
|
8
|
+
const { choiceMade, init, settingsOpen } = useSettings();
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
init();
|
|
12
|
+
}, []);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{!choiceMade && !settingsOpen && <Banner/>}
|
|
17
|
+
{settingsOpen && <Settings/>}
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default App;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import useSettings from '../hooks/useSettings';
|
|
2
|
+
|
|
3
|
+
const Banner = () => {
|
|
4
|
+
const { banner, acceptAll, rejectAll, setModal } = useSettings();
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div class="fixed z-[9998] bottom-0 left-0 max-w-md bg-background m-2 px-5 py-4 space-y-4 font-primary text-foreground rounded-md">
|
|
8
|
+
<h3 class="m-0 font-primary font-semibold text-lg md:text-xl">
|
|
9
|
+
{banner.title}
|
|
10
|
+
</h3>
|
|
11
|
+
|
|
12
|
+
<p class="m-0 leading-snug font-primary text-sm md:text-base">
|
|
13
|
+
{banner.description}
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<div class="pt-2 space-y-2">
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
class="rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
|
|
20
|
+
onClick={() => setModal(true)}
|
|
21
|
+
>
|
|
22
|
+
{banner.customise}
|
|
23
|
+
</button>
|
|
24
|
+
<button
|
|
25
|
+
type="button"
|
|
26
|
+
class="rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
|
|
27
|
+
onClick={rejectAll}
|
|
28
|
+
>
|
|
29
|
+
{banner.reject}
|
|
30
|
+
</button>
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
class="rounded mr-2 bg-primary font-primary font-semibold text-background px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors"
|
|
34
|
+
onClick={acceptAll}
|
|
35
|
+
>
|
|
36
|
+
{banner.accept}
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default Banner;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import useSettings from '../hooks/useSettings';
|
|
2
|
+
|
|
3
|
+
const Settings = () => {
|
|
4
|
+
const { permissions, cookie, togglePermission, banner, setModal } = useSettings();
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div class="fixed z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-background text-foreground m-2 px-5 py-4 font-primary text-black rounded-md max-h-full">
|
|
8
|
+
<div class="space-y-6">
|
|
9
|
+
<h3 class="w-10/12 m-0 font-primary font-semibold text-xl md:text-2xl">
|
|
10
|
+
{banner.customise}
|
|
11
|
+
</h3>
|
|
12
|
+
|
|
13
|
+
{permissions.map(({slug, title, description}) => (
|
|
14
|
+
<div key={`setting-${slug}`}>
|
|
15
|
+
<div class="flex items-start justify-between">
|
|
16
|
+
<h3 class="m-0 font-primary font-semibold text-lg">
|
|
17
|
+
{title}
|
|
18
|
+
</h3>
|
|
19
|
+
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
class={`${cookie[slug] ? 'bg-primary' : 'bg-gray-200'} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`}
|
|
23
|
+
role="switch" aria-checked="false"
|
|
24
|
+
onClick={() => togglePermission(slug)}
|
|
25
|
+
>
|
|
26
|
+
<span class="sr-only">Toggle</span>
|
|
27
|
+
<span aria-hidden="true"
|
|
28
|
+
class={`${cookie[slug] ? 'translate-x-5' : 'translate-x-0'} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`}></span>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<p class="m-0 mt-2 leading-snug font-primary text-sm md:text-base">
|
|
33
|
+
{description}
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
))}
|
|
37
|
+
</div>
|
|
38
|
+
<button
|
|
39
|
+
class="absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full"
|
|
40
|
+
onClick={() => setModal(false)}
|
|
41
|
+
>
|
|
42
|
+
×
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default Settings;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const defaultSettings = {
|
|
2
|
+
name: 'leckerli',
|
|
3
|
+
banner: {
|
|
4
|
+
title: 'This website uses cookies.',
|
|
5
|
+
description: 'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',
|
|
6
|
+
accept: 'Accept all',
|
|
7
|
+
reject: 'Deny',
|
|
8
|
+
customise: 'Customize',
|
|
9
|
+
},
|
|
10
|
+
permissions: [
|
|
11
|
+
{
|
|
12
|
+
slug: 'settings',
|
|
13
|
+
title: 'Preferences',
|
|
14
|
+
description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
baseData: {},
|
|
18
|
+
cookie: {},
|
|
19
|
+
choiceMade: false,
|
|
20
|
+
settingsOpen: false,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default defaultSettings;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { isNil, isNotNil, mergeDeepRight } from 'ramda';
|
|
2
|
+
import { create } from 'zustand'
|
|
3
|
+
|
|
4
|
+
import type Settings from '../types/settings';
|
|
5
|
+
import Cookie from "../types/cookie";
|
|
6
|
+
import defaultSettings from "../defaultSettings.ts";
|
|
7
|
+
import cookies from "js-cookie";
|
|
8
|
+
|
|
9
|
+
type SettingsStore = Settings & {
|
|
10
|
+
choiceMade: boolean;
|
|
11
|
+
settingsOpen: boolean;
|
|
12
|
+
cookie: Cookie;
|
|
13
|
+
init: () => void;
|
|
14
|
+
setChoice: (value: boolean) => void;
|
|
15
|
+
setModal: (value: boolean) => void;
|
|
16
|
+
setPermissions: (slugs: string | string[], value: boolean) => void;
|
|
17
|
+
togglePermission: (slugs: string) => void;
|
|
18
|
+
acceptAll: () => void;
|
|
19
|
+
rejectAll: () => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Override default settings with custom settings
|
|
23
|
+
const initialState = mergeDeepRight(
|
|
24
|
+
defaultSettings,
|
|
25
|
+
window.leckerliSettings ?? {}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Get cookie value
|
|
29
|
+
const initialCookie = cookies.get(initialState.name);
|
|
30
|
+
|
|
31
|
+
// Set store's cookie value based on existing cookie or settings permissions
|
|
32
|
+
initialState.cookie = isNotNil(initialCookie)
|
|
33
|
+
? JSON.parse(initialCookie)
|
|
34
|
+
: initialState.permissions.reduce((acc, val) => ({
|
|
35
|
+
...acc,
|
|
36
|
+
[val.slug]: false,
|
|
37
|
+
}), initialState.baseData);
|
|
38
|
+
|
|
39
|
+
// With the existing cookie or not, set the choiceMade
|
|
40
|
+
initialState.choiceMade = isNotNil(initialCookie);
|
|
41
|
+
|
|
42
|
+
// Deliver the hook
|
|
43
|
+
const useSettings = create<SettingsStore>((set, getState) => ({
|
|
44
|
+
...initialState,
|
|
45
|
+
|
|
46
|
+
// Write cookie if not exist and setup eventListeners
|
|
47
|
+
init: () => {
|
|
48
|
+
if (isNil(initialCookie) && getState().choiceMade) {
|
|
49
|
+
cookies.set(getState().name, JSON.stringify(getState().cookie));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Open banner by resseting choiceMade
|
|
53
|
+
document.addEventListener('leckerli:open-banner', () => getState().setChoice(false));
|
|
54
|
+
document.addEventListener('leckerli:close-banner', () => getState().setChoice(true));
|
|
55
|
+
|
|
56
|
+
// Manage modal
|
|
57
|
+
document.addEventListener('leckerli:open-modal', () => getState().setModal(true));
|
|
58
|
+
document.addEventListener('leckerli:close-modal', () => getState().setModal(false));
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// Manage banner display
|
|
62
|
+
setChoice: (value: boolean) => set(state => {
|
|
63
|
+
return { ...state, choiceMade: value };
|
|
64
|
+
}),
|
|
65
|
+
|
|
66
|
+
// Manage modal display
|
|
67
|
+
setModal: (value: boolean) => set(state => {
|
|
68
|
+
document.dispatchEvent(new CustomEvent(`leckerli:modal-${value ? 'opened' : 'closed'}`));
|
|
69
|
+
return { ...state, settingsOpen: value };
|
|
70
|
+
}),
|
|
71
|
+
|
|
72
|
+
// Set cookie permission(s)
|
|
73
|
+
setPermissions: (slugs: string | string[], value: boolean) =>
|
|
74
|
+
set(state => {
|
|
75
|
+
const list = Array.isArray(slugs) ? slugs : [slugs];
|
|
76
|
+
|
|
77
|
+
const newCookie = state.permissions.reduce((acc, val) => {
|
|
78
|
+
if (list.includes(val.slug)) {
|
|
79
|
+
acc[val.slug] = value;
|
|
80
|
+
} else {
|
|
81
|
+
acc[val.slug] = state.cookie[val.slug] ?? false;
|
|
82
|
+
}
|
|
83
|
+
return acc;
|
|
84
|
+
}, state.baseData);
|
|
85
|
+
|
|
86
|
+
cookies.set(state.name, JSON.stringify(newCookie));
|
|
87
|
+
|
|
88
|
+
document.dispatchEvent(new CustomEvent('leckerli:permissions-updated'));
|
|
89
|
+
|
|
90
|
+
return { ...state, choiceMade: true, cookie: newCookie };
|
|
91
|
+
}),
|
|
92
|
+
|
|
93
|
+
// Toggle cookie permission
|
|
94
|
+
togglePermission: (slug: string) =>
|
|
95
|
+
set(state => {
|
|
96
|
+
const newCookie = state.permissions.reduce((acc, val) => {
|
|
97
|
+
if (slug === val.slug) {
|
|
98
|
+
acc[val.slug] = isNotNil(state.cookie[val.slug]) ? !state.cookie[val.slug] : true;
|
|
99
|
+
} else {
|
|
100
|
+
acc[val.slug] = state.cookie[val.slug] ?? false;
|
|
101
|
+
}
|
|
102
|
+
return acc;
|
|
103
|
+
}, state.baseData);
|
|
104
|
+
|
|
105
|
+
cookies.set(state.name, JSON.stringify(newCookie));
|
|
106
|
+
|
|
107
|
+
document.dispatchEvent(new CustomEvent('leckerli:permissions-updated'));
|
|
108
|
+
|
|
109
|
+
return { ...state, choiceMade: true, cookie: newCookie };
|
|
110
|
+
}),
|
|
111
|
+
|
|
112
|
+
// All permission at true shorthand
|
|
113
|
+
acceptAll: () => {
|
|
114
|
+
getState().setPermissions(
|
|
115
|
+
getState().permissions.map(i => i.slug),
|
|
116
|
+
true
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// All permission at false shorthand
|
|
121
|
+
rejectAll: () => {
|
|
122
|
+
getState().setPermissions(
|
|
123
|
+
getState().permissions.map(i => i.slug),
|
|
124
|
+
false
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
export default useSettings;
|
package/src/index.css
ADDED
package/src/index.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
import colors from 'tailwindcss/colors';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
important: true,
|
|
6
|
+
content: [
|
|
7
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
8
|
+
],
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {
|
|
11
|
+
colors: {
|
|
12
|
+
primary: {
|
|
13
|
+
DEFAULT: `var(--leckerli-primary, ${colors.emerald['600']})`,
|
|
14
|
+
hover: `var(--leckerli-primary-hover, ${colors.emerald['700']})`,
|
|
15
|
+
active: `var(--leckerli-primary-active, ${colors.emerald['900']})`,
|
|
16
|
+
},
|
|
17
|
+
foreground: `var(--leckerli-foreground, ${colors.black})`,
|
|
18
|
+
background: `var(--leckerli-background, ${colors.white})`,
|
|
19
|
+
},
|
|
20
|
+
fontFamily: {
|
|
21
|
+
primary: `var(--leckerli-font, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji")`
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
plugins: [],
|
|
26
|
+
}
|
|
27
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"jsxImportSource": "preact",
|
|
17
|
+
|
|
18
|
+
/* Linting */
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"],
|
|
25
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
26
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import preact from '@preact/preset-vite'
|
|
3
|
+
|
|
4
|
+
// https://vitejs.dev/config/
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [preact()],
|
|
7
|
+
build: {
|
|
8
|
+
rollupOptions: {
|
|
9
|
+
output: {
|
|
10
|
+
entryFileNames: 'assets/leckerli.min.js',
|
|
11
|
+
chunkFileNames: 'assets/leckerli.min.js',
|
|
12
|
+
assetFileNames: 'assets/leckerli.min.[ext]'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
})
|