doctracker 0.1.0__py3-none-any.whl

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.
Files changed (38) hide show
  1. doctracker/__init__.py +5 -0
  2. doctracker/__main__.py +4 -0
  3. doctracker/cli.py +55 -0
  4. doctracker/config.py +65 -0
  5. doctracker/extraction/__init__.py +5 -0
  6. doctracker/extraction/griffe_loader.py +148 -0
  7. doctracker/server/__init__.py +1 -0
  8. doctracker/server/app.py +78 -0
  9. doctracker/server/guide.md +62 -0
  10. doctracker/server/guide.py +68 -0
  11. doctracker/server/state.py +32 -0
  12. doctracker/server/tools.py +76 -0
  13. doctracker/server/watcher.py +63 -0
  14. doctracker/server/web.py +120 -0
  15. doctracker/wiki/__init__.py +1 -0
  16. doctracker/wiki/pages.py +356 -0
  17. doctracker/wiki/static/htmx-LICENSE.txt +13 -0
  18. doctracker/wiki/static/htmx.min.js +1 -0
  19. doctracker/wiki/static/live.js +178 -0
  20. doctracker/wiki/static/style.css +424 -0
  21. doctracker/wiki/templates/base.html +33 -0
  22. doctracker/wiki/templates/entity.html +97 -0
  23. doctracker/wiki/templates/fragment.html +3 -0
  24. doctracker/wiki/templates/fragment_content.html +5 -0
  25. doctracker/wiki/templates/header.html +20 -0
  26. doctracker/wiki/templates/loading.html +2 -0
  27. doctracker/wiki/templates/members.html +18 -0
  28. doctracker/wiki/templates/module.html +19 -0
  29. doctracker/wiki/templates/not_found.html +6 -0
  30. doctracker/wiki/templates/search.html +21 -0
  31. doctracker/wiki/templates/source.html +1 -0
  32. doctracker/wiki/templates/tree.html +31 -0
  33. doctracker-0.1.0.dist-info/METADATA +234 -0
  34. doctracker-0.1.0.dist-info/RECORD +38 -0
  35. doctracker-0.1.0.dist-info/WHEEL +4 -0
  36. doctracker-0.1.0.dist-info/entry_points.txt +3 -0
  37. doctracker-0.1.0.dist-info/licenses/LICENSE +21 -0
  38. doctracker-0.1.0.dist-info/licenses/src/doctracker/wiki/static/htmx-LICENSE.txt +13 -0
@@ -0,0 +1,120 @@
1
+ """Frontend routes: wiki pages, source code on demand and live-update events."""
2
+
3
+ import asyncio
4
+ from pathlib import Path
5
+
6
+ from jinja2 import Environment, PackageLoader, select_autoescape
7
+ from starlette.requests import Request
8
+ from starlette.responses import HTMLResponse, RedirectResponse, Response, StreamingResponse
9
+ from starlette.routing import BaseRoute, Mount, Route
10
+ from starlette.staticfiles import StaticFiles
11
+
12
+ from doctracker.config import Config, update_config_value
13
+ from doctracker.server.state import DocState
14
+ from doctracker.wiki import pages
15
+
16
+ KEEPALIVE_SECONDS = 15
17
+
18
+
19
+ def _same_origin(request: Request) -> bool:
20
+ """Writes are accepted only from pages served by this server (blocks other sites in the browser)."""
21
+ origin = request.headers.get("origin")
22
+ return origin is not None and origin == f"{request.url.scheme}://{request.headers.get('host', '')}"
23
+
24
+
25
+ def web_routes(state: DocState, project_root: Path, config: Config) -> list[BaseRoute]:
26
+ """Build the frontend routes served next to the MCP endpoint."""
27
+ templates = Environment(loader=PackageLoader("doctracker.wiki", "templates"), autoescape=select_autoescape())
28
+ templates.filters["markdown"] = pages.render_markdown
29
+ templates.filters["highlight"] = pages.highlight
30
+ templates.globals.update(
31
+ code_theme=config.code_theme if config.code_theme in pages.CODE_THEMES else "default",
32
+ code_themes=pages.CODE_THEMES,
33
+ signature=pages.signature,
34
+ summary=pages.summary,
35
+ page_role=pages.page_role,
36
+ symbols=pages.SYMBOLS,
37
+ members_by_group=pages.members_by_group,
38
+ parameter_rows=pages.parameter_rows,
39
+ other_sections=pages.other_sections,
40
+ )
41
+
42
+ def render(request: Request, path: str) -> HTMLResponse:
43
+ entity = state.entities.get(path)
44
+ context = {"path": path, "state": state, "entity": entity, "tree": pages.tree(state, path)}
45
+ if not state.ready:
46
+ content, status = "loading.html", 200
47
+ elif entity is None:
48
+ content, status = "not_found.html", 404
49
+ else:
50
+ content, status = ("module.html" if entity["kind"] == "module" else "entity.html"), 200
51
+ context["breadcrumbs"] = pages.breadcrumbs(state, path)
52
+ is_fragment = "HX-Request" in request.headers and "HX-History-Restore-Request" not in request.headers
53
+ template = "fragment.html" if is_fragment else "base.html"
54
+ html = templates.get_template(template).render(content=content, **context)
55
+ return HTMLResponse(html, status_code=status)
56
+
57
+ async def index(request: Request) -> Response:
58
+ if state.ready and state.roots:
59
+ return RedirectResponse(f"/wiki/{state.roots[0]}")
60
+ return render(request, "")
61
+
62
+ async def wiki(request: Request) -> Response:
63
+ return render(request, request.path_params["path"])
64
+
65
+ async def source(request: Request) -> Response:
66
+ entity = state.entities.get(request.path_params["path"])
67
+ if entity is None:
68
+ return HTMLResponse("", status_code=404)
69
+ code = pages.source_code(project_root, entity)
70
+ return HTMLResponse(templates.get_template("source.html").render(code=code))
71
+
72
+ async def search(request: Request) -> Response:
73
+ query = request.query_params.get("q", "")
74
+ results = pages.search(state, query)
75
+ return HTMLResponse(templates.get_template("search.html").render(results=results, query=query))
76
+
77
+ async def theme(request: Request) -> Response:
78
+ name = request.path_params["name"]
79
+ if name not in pages.CODE_THEMES:
80
+ return Response("", status_code=404)
81
+ return Response(pages.code_theme_css(name), media_type="text/css")
82
+
83
+ async def set_code_theme(request: Request) -> Response:
84
+ """Save the code theme chosen in the frontend into `config.json`."""
85
+ if not _same_origin(request):
86
+ return Response("", status_code=403)
87
+ name = (await request.form()).get("code_theme", "")
88
+ if name not in pages.CODE_THEMES:
89
+ return Response("", status_code=400)
90
+ config.code_theme = name
91
+ templates.globals["code_theme"] = name
92
+ update_config_value(project_root, "code_theme", name)
93
+ return Response("", status_code=204)
94
+
95
+ async def events(request: Request) -> Response:
96
+ queue = state.subscribe()
97
+
98
+ async def stream():
99
+ try:
100
+ while True:
101
+ try:
102
+ await asyncio.wait_for(queue.get(), KEEPALIVE_SECONDS)
103
+ yield "event: changed\ndata: 1\n\n"
104
+ except TimeoutError:
105
+ yield ": keepalive\n\n"
106
+ finally:
107
+ state.unsubscribe(queue)
108
+
109
+ return StreamingResponse(stream(), media_type="text/event-stream", headers={"Cache-Control": "no-cache"})
110
+
111
+ return [
112
+ Route("/", index),
113
+ Route("/wiki/{path:path}", wiki),
114
+ Route("/source/{path:path}", source),
115
+ Route("/search", search),
116
+ Route("/code-theme/{name}.css", theme),
117
+ Route("/settings/code-theme", set_code_theme, methods=["POST"]),
118
+ Route("/events", events),
119
+ Mount("/static", StaticFiles(packages=[("doctracker.wiki", "static")]), name="static"),
120
+ ]
@@ -0,0 +1 @@
1
+ """Wiki pages built from the extracted data."""
@@ -0,0 +1,356 @@
1
+ """Turn extracted entities into the data the wiki templates display."""
2
+
3
+ from pathlib import Path
4
+
5
+ from markdown_it import MarkdownIt
6
+ from markupsafe import Markup
7
+ from pygments import highlight as pygments_highlight
8
+ from pygments.formatters import HtmlFormatter
9
+ from pygments.lexers import PythonConsoleLexer, PythonLexer
10
+ from pygments.styles import get_all_styles, get_style_by_name
11
+ from pygments.token import Token
12
+
13
+ from doctracker.server.state import DocState
14
+
15
+ _markdown = MarkdownIt("commonmark", {"html": False})
16
+ # Only the token spans: the template provides <pre><code>, the CSS provides the colors.
17
+ _formatter = HtmlFormatter(nowrap=True)
18
+ _python = PythonLexer()
19
+ _console = PythonConsoleLexer()
20
+
21
+ # Order and labels of member groups on module and class pages.
22
+ GROUPS = (
23
+ ("module", "Modules"),
24
+ ("class", "Classes"),
25
+ ("function", "Functions"),
26
+ ("attribute", "Attributes"),
27
+ ("type alias", "Type aliases"),
28
+ )
29
+
30
+
31
+ def render_markdown(text: str) -> str:
32
+ """Render docstring text as HTML (raw HTML in docstrings is escaped)."""
33
+ return _markdown.render(text or "")
34
+
35
+
36
+ CODE_THEMES = sorted(get_all_styles())
37
+
38
+
39
+ SOURCE_SELECTOR = ".block-source .code-block"
40
+
41
+
42
+ def code_theme_css(name: str) -> str:
43
+ """CSS for one Pygments theme, applied only to the Source block, with its text and background colors."""
44
+ style = get_style_by_name(name)
45
+ text = style.style_for_token(Token.Text)["color"] or ("dddddd" if _is_dark(style.background_color) else "1f2328")
46
+ rules = HtmlFormatter(style=name).get_style_defs(SOURCE_SELECTOR)
47
+ # Pygments also emits unscoped rules (e.g. `pre { ... }`); keep only the Source ones.
48
+ scoped = "\n".join(line for line in rules.splitlines() if line.startswith(SOURCE_SELECTOR))
49
+ return f"{SOURCE_SELECTOR} {{ color: #{text}; background: {style.background_color}; }}\n{scoped}\n"
50
+
51
+
52
+ def _is_dark(color: str) -> bool:
53
+ color = (color or "#ffffff").lstrip("#")
54
+ if len(color) == 3:
55
+ color = "".join(c * 2 for c in color)
56
+ red, green, blue = (int(color[i : i + 2], 16) for i in (0, 2, 4))
57
+ return red * 0.299 + green * 0.587 + blue * 0.114 < 128
58
+
59
+
60
+ def highlight(code: str) -> Markup:
61
+ """Python code as HTML with syntax highlighting. `>>>` sessions use the console lexer."""
62
+ lexer = _console if code.lstrip().startswith(">>>") else _python
63
+ return Markup(pygments_highlight(code, lexer, _formatter).rstrip("\n"))
64
+
65
+
66
+ def signature(entity: dict) -> str:
67
+ """One-line signature of a function, class or attribute."""
68
+ kind = entity["kind"]
69
+ if kind == "function":
70
+ result = f"def {entity['name']}({_parameters(entity['parameters'])})"
71
+ if entity["returns"]:
72
+ result += f" -> {entity['returns']}"
73
+ return result
74
+ if kind == "class":
75
+ bases = f"({', '.join(entity['bases'])})" if entity["bases"] else ""
76
+ return f"class {entity['name']}{bases}"
77
+ if kind == "attribute":
78
+ result = entity["name"]
79
+ if entity["annotation"]:
80
+ result += f": {entity['annotation']}"
81
+ if entity["value"]:
82
+ result += f" = {entity['value']}"
83
+ return result
84
+ return entity["path"]
85
+
86
+
87
+ def _parameters(parameters: list[dict]) -> str:
88
+ parts = []
89
+ keyword_only_marked = False
90
+ for index, parameter in enumerate(parameters):
91
+ kind = parameter["kind"]
92
+ text = parameter["name"]
93
+ if parameter["annotation"]:
94
+ text += f": {parameter['annotation']}"
95
+ if parameter["default"]:
96
+ text += f" = {parameter['default']}" if parameter["annotation"] else f"={parameter['default']}"
97
+ if kind == "variadic positional":
98
+ text = "*" + text
99
+ keyword_only_marked = True
100
+ elif kind == "variadic keyword":
101
+ text = "**" + text
102
+ elif kind == "keyword-only" and not keyword_only_marked:
103
+ parts.append("*")
104
+ keyword_only_marked = True
105
+ parts.append(text)
106
+ next_kind = parameters[index + 1]["kind"] if index + 1 < len(parameters) else None
107
+ if kind == "positional-only" and next_kind != "positional-only":
108
+ parts.append("/")
109
+ return ", ".join(parts)
110
+
111
+
112
+ def summary(entity: dict) -> str:
113
+ """First line of the docstring."""
114
+ return entity["docstring"].strip().split("\n", 1)[0] if entity["docstring"] else ""
115
+
116
+
117
+ # Symbol shown before each item, by role (packages and modules use folder/file icons).
118
+ SYMBOLS = {"class": "C", "function": "f", "method": "m", "attribute": "a", "type alias": "t"}
119
+
120
+
121
+ def tree(state: DocState, current: str) -> list[dict]:
122
+ """Navigation tree: packages and modules, with their classes, functions and methods."""
123
+ return [_tree_node(state, path, current, "package") for path in state.roots if path in state.entities]
124
+
125
+
126
+ def _tree_node(state: DocState, path: str, current: str, role: str) -> dict:
127
+ entity = state.entities[path]
128
+ children = []
129
+ for member_path in entity["members"]:
130
+ member = state.entities.get(member_path)
131
+ if member and member["kind"] in ("module", "class", "function"):
132
+ children.append(_tree_node(state, member_path, current, _role(entity, member)))
133
+ return {
134
+ "path": path,
135
+ "name": entity["name"],
136
+ "role": role,
137
+ "symbol": SYMBOLS.get(role, ""),
138
+ "children": children,
139
+ "current": path == current,
140
+ "open": current == path or current.startswith(path + "."),
141
+ }
142
+
143
+
144
+ def _role(parent: dict, member: dict) -> str:
145
+ """Role of a member in the tree: subpackage, module, class, function or method."""
146
+ if member["kind"] == "module" and member.get("is_package"):
147
+ return "subpackage"
148
+ if member["kind"] == "function" and parent["kind"] == "class":
149
+ return "method"
150
+ return member["kind"]
151
+
152
+
153
+ def members_by_group(state: DocState, entity: dict) -> list[dict]:
154
+ """Members of a module or class, grouped by kind, each ready to be shown as one row.
155
+
156
+ Attributes without a docstring of their own take the description from the
157
+ parent's `Attributes` docstring section.
158
+ """
159
+ documented = _documented_attributes(entity)
160
+ groups = []
161
+ for kind, label in GROUPS:
162
+ items = []
163
+ for member_path in entity["members"]:
164
+ member = state.entities.get(member_path)
165
+ if member and member["kind"] == kind:
166
+ role = _role(entity, member)
167
+ items.append(
168
+ {
169
+ "path": member["path"],
170
+ "name": member["name"],
171
+ "role": role,
172
+ "symbol": SYMBOLS.get(role, ""),
173
+ "details": signature_details(member),
174
+ "summary": summary(member) or documented.get(member["name"], ""),
175
+ }
176
+ )
177
+ if items:
178
+ is_method = entity["kind"] == "class" and kind == "function"
179
+ groups.append(
180
+ {
181
+ "label": "Methods" if is_method else label,
182
+ "role": "method" if is_method else items[0]["role"],
183
+ "items": items,
184
+ }
185
+ )
186
+ return groups
187
+
188
+
189
+ def signature_details(entity: dict) -> str:
190
+ """The part of the signature after the name: `(params) -> type`, `(bases)` or `: type = value`."""
191
+ full = signature(entity)
192
+ kind = entity["kind"]
193
+ if kind == "function":
194
+ return full.removeprefix(f"def {entity['name']}")
195
+ if kind == "class":
196
+ return full.removeprefix(f"class {entity['name']}")
197
+ if kind == "attribute":
198
+ return full.removeprefix(entity["name"])
199
+ return ""
200
+
201
+
202
+ def page_role(state: DocState, entity: dict) -> str:
203
+ """Role of the entity shown on a page, used for its icon: package, subpackage, module, class..."""
204
+ if entity["path"] in state.roots:
205
+ return "package"
206
+ parent = state.entities.get(entity["parent"] or "")
207
+ return _role(parent, entity) if parent else entity["kind"]
208
+
209
+
210
+ def parameter_rows(entity: dict) -> list[dict]:
211
+ """Parameters table: signature data merged with descriptions from the docstring."""
212
+ described = {}
213
+ for section in entity["sections"]:
214
+ if section["kind"] in ("parameters", "other parameters"):
215
+ for item in section["items"]:
216
+ described[item["name"].lstrip("*")] = item
217
+ rows = []
218
+ for parameter in entity.get("parameters", []):
219
+ if parameter["name"] in ("self", "cls"):
220
+ continue
221
+ doc = described.get(parameter["name"], {})
222
+ rows.append(
223
+ {
224
+ "name": parameter["name"],
225
+ "annotation": parameter["annotation"] or doc.get("annotation", ""),
226
+ "default": parameter["default"],
227
+ "description": doc.get("description", ""),
228
+ }
229
+ )
230
+ return rows
231
+
232
+
233
+ def _documented_attributes(entity: dict) -> dict[str, str]:
234
+ """First line of each attribute description in the `Attributes` docstring section."""
235
+ descriptions = {}
236
+ for section in entity["sections"]:
237
+ if section["kind"] == "attributes":
238
+ for item in section["items"]:
239
+ descriptions[item["name"]] = item["description"].strip().split("\n", 1)[0]
240
+ return descriptions
241
+
242
+
243
+ def other_sections(entity: dict) -> list[dict]:
244
+ """Docstring sections not shown elsewhere on the page.
245
+
246
+ Parameters have their own table; on modules and classes, documented attributes
247
+ are merged into the members list.
248
+ """
249
+ hidden = {"parameters", "other parameters"}
250
+ if entity["kind"] in ("module", "class"):
251
+ hidden.add("attributes")
252
+ return [section for section in entity["sections"] if section["kind"] not in hidden]
253
+
254
+
255
+ def breadcrumbs(state: DocState, path: str) -> list[dict]:
256
+ """Links to the parents of an entity, from the root package down."""
257
+ crumbs = []
258
+ parent = state.entities[path]["parent"]
259
+ while parent and parent in state.entities:
260
+ crumbs.insert(0, {"path": parent, "name": state.entities[parent]["name"]})
261
+ parent = state.entities[parent]["parent"]
262
+ return crumbs
263
+
264
+
265
+ SNIPPET_CONTEXT = 40
266
+
267
+
268
+ def search(state: DocState, query: str, limit: int = 12) -> list[dict]:
269
+ """Entities matching `query`, best first.
270
+
271
+ Order: exact name, name prefix, name contains, path contains, description contains.
272
+ The description is the docstring plus the descriptions of its parameters, returns,
273
+ raises and other sections.
274
+ """
275
+ query = query.strip().lower()
276
+ if not query:
277
+ return []
278
+ scored = []
279
+ for path, entity in state.entities.items():
280
+ name = entity["name"].lower()
281
+ if name == query:
282
+ score = 0
283
+ elif name.startswith(query):
284
+ score = 1
285
+ elif query in name:
286
+ score = 2
287
+ elif query in path.lower():
288
+ score = 3
289
+ elif query in _description_text(entity).lower():
290
+ score = 4
291
+ else:
292
+ continue
293
+ scored.append((score, len(path), path))
294
+ results = []
295
+ for score, _, path in sorted(scored)[:limit]:
296
+ entity = state.entities[path]
297
+ parent = state.entities.get(entity["parent"] or "")
298
+ role = "package" if path in state.roots else (_role(parent, entity) if parent else entity["kind"])
299
+ name_parts = _split_match(entity["name"], query)
300
+ result = {
301
+ "path": path,
302
+ "role": role,
303
+ "symbol": SYMBOLS.get(role, ""),
304
+ "name": entity["name"],
305
+ # Name split around the first match, to highlight it.
306
+ "before": name_parts[0],
307
+ "match": name_parts[1],
308
+ "after": name_parts[2],
309
+ "snippet": None,
310
+ }
311
+ if score == 4:
312
+ result["snippet"] = _snippet(_description_text(entity), query)
313
+ results.append(result)
314
+ return results
315
+
316
+
317
+ def _description_text(entity: dict) -> str:
318
+ """All the descriptive text of an entity, as one line (parsed sections, without their headings)."""
319
+ parts = [] if entity["sections"] else [entity["docstring"]]
320
+ for section in entity["sections"]:
321
+ parts.append(section["text"])
322
+ parts.extend(item["description"] for item in section["items"])
323
+ return " ".join(" ".join(part.split()) for part in parts if part)
324
+
325
+
326
+ def _split_match(text: str, query: str) -> tuple[str, str, str]:
327
+ """`text` split as (before, match, after) around the first case-insensitive match."""
328
+ start = text.lower().find(query)
329
+ if start < 0:
330
+ return text, "", ""
331
+ return text[:start], text[start : start + len(query)], text[start + len(query) :]
332
+
333
+
334
+ def _snippet(text: str, query: str) -> dict:
335
+ """A short piece of `text` around the first match, split for highlighting."""
336
+ start = text.lower().find(query)
337
+ left = max(0, start - SNIPPET_CONTEXT)
338
+ right = min(len(text), start + len(query) + SNIPPET_CONTEXT)
339
+ before, match, after = _split_match(text[left:right], query)
340
+ return {
341
+ "before": ("…" if left > 0 else "") + before,
342
+ "match": match,
343
+ "after": after + ("…" if right < len(text) else ""),
344
+ }
345
+
346
+
347
+ def source_code(project_root: Path, entity: dict) -> str:
348
+ """Source lines of an entity, read from disk when the user asks for them."""
349
+ if not entity["filepath"] or not entity["lineno"]:
350
+ return ""
351
+ path = (project_root / entity["filepath"]).resolve()
352
+ if not path.is_relative_to(project_root.resolve()):
353
+ return ""
354
+ lines = path.read_text(encoding="utf-8").splitlines()
355
+ end = entity["endlineno"] or entity["lineno"]
356
+ return "\n".join(lines[entity["lineno"] - 1 : end])
@@ -0,0 +1,13 @@
1
+ Zero-Clause BSD
2
+ =============
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for
5
+ any purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
8
+ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
9
+ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
10
+ FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
11
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
12
+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1 @@
1
+ var htmx=function(){"use strict";const Y={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=pn(e,t||"post");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,allowScriptTags:true,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:"204",swap:false},{code:"[23]..",swap:true},{code:"[45]..",swap:false,error:true}],allowNestedOobSwaps:true,historyRestoreAsHxRequest:true,reportValidityOfForms:false},parseInterval:null,location:location,_:null,version:"2.0.11"};Y.onLoad=V;Y.process=Bt;Y.on=ye;Y.off=xe;Y.trigger=ae;Y.ajax=In;Y.find=a;Y.findAll=x;Y.closest=g;Y.remove=z;Y.addClass=w;Y.removeClass=S;Y.toggleClass=G;Y.takeClass=W;Y.swap=C;Y.defineExtension=zn;Y.removeExtension=Jn;Y.logAll=$;Y.logNone=_;Y.parseInterval=d;Y._=e;const n={addTriggerHandler:Et,bodyContains:ie,canAccessLocalStorage:U,findThisElement:we,filterValues:xn,swap:C,hasAttribute:s,getAttributeValue:f,getClosestAttributeValue:te,getClosestMatch:A,getExpressionVars:qn,getHeaders:yn,getInputValues:pn,getInternalData:re,getSwapSpecification:vn,getTriggerSpecs:lt,getTarget:Se,makeFragment:D,mergeObjects:se,makeSettleInfo:En,oobSwap:Te,querySelectorExt:ce,settleImmediately:Qt,shouldCancel:dt,triggerEvent:ae,triggerErrorEvent:ue,withExtensions:Vt};const he=["get","post","put","delete","patch"];const R=he.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)=="ms"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)=="s"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)=="m"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function Q(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function f(e,t){return Q(e,t)||Q(e,"data-"+t)}function u(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function ee(){return document}function q(e,t){return e.getRootNode?e.getRootNode({composed:t}):ee()}function A(e,t){while(e&&!t(e)){e=u(e)}return e||null}function o(e,t,n){const r=f(t,n);const o=f(t,"hx-disinherit");var i=f(t,"hx-inherit");if(e!==t){if(Y.config.disableInheritance){if(i&&(i==="*"||i.split(" ").indexOf(n)>=0)){return r}else{return null}}if(o&&(o==="*"||o.split(" ").indexOf(n)>=0)){return"unset"}}return r}function te(t,n){let r=null;A(t,function(e){return!!(r=o(t,le(e),n))});if(r!=="unset"){return r}}function h(e,t){return e instanceof Element&&e.matches(t)}function N(e){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return""}}function I(e){if("parseHTMLUnsafe"in Document){return Document.parseHTMLUnsafe(e)}const t=new DOMParser;return t.parseFromString(e,"text/html")}function L(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function r(e){const t=ee().createElement("script");oe(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Y.config.inlineScriptNonce){t.nonce=Y.config.inlineScriptNonce}return t}function i(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function k(e){if(!Y.config.allowScriptTags){e.querySelectorAll("script").forEach(e=>e.remove());return}Array.from(e.querySelectorAll("script")).forEach(e=>{if(i(e)){const t=r(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){T(e)}finally{e.remove()}}})}function D(e){e=e.replace(/<hx-([a-z]+)((?:\s[^>]*)?)>/gi,'<template hx type="$1"$2>').replace(/<\/hx-[a-z]+>/gi,"</template>");const t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,"");const n=N(t);let r;if(n==="html"){r=new DocumentFragment;const i=I(e);L(r,i.body);r.title=i.title}else if(n==="body"){r=new DocumentFragment;const i=I(t);L(r,i.body);r.title=i.title}else{const i=I('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=i.querySelector("template").content;r.title=i.title;var o=r.querySelector("title");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){k(r)}return r}function ne(e){if(e){e()}}function t(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function P(e){return typeof e==="function"}function M(e){return t(e,"Object")}function re(e){const t="htmx-internal-data";let n=e[t];if(!n){n=e[t]={}}return n}function F(t){const n=[];if(t){for(let e=0;e<t.length;e++){n.push(t[e])}}return n}function oe(t,n){if(t){for(let e=0;e<t.length;e++){n(t[e])}}}function B(e){const t=e.getBoundingClientRect();const n=t.top;const r=t.bottom;return n<window.innerHeight&&r>=0}function ie(e){return e.getRootNode({composed:true})===document}function X(e){return e.trim().split(/\s+/)}function se(e,t){return Object.assign({},e,t)}function v(e){try{return JSON.parse(e)}catch(e){T(e);return null}}function U(){const e="htmx:sessionStorageTest";try{sessionStorage.setItem(e,e);sessionStorage.removeItem(e);return true}catch(e){return false}}function j(e){try{const t=new URL(e,window.location.href);e=t.pathname+t.search}catch(e){}if(e!="/"){e=e.replace(/\/+$/,"")}return e}function e(e){return Tn(ee().body,function(){return eval(e)})}function V(t){const e=Y.on("htmx:load",function(e){t(e.detail.elt)});return e}function $(){Y.logger=function(e,t,n){if(console){console.log(t,e,n)}}}function _(){Y.logger=null}function a(e,t){if(typeof e!=="string"){return e.querySelector(t)}else{return a(ee(),e)}}function x(e,t){if(typeof e!=="string"){return e.querySelectorAll(t)}else{return x(ee(),e)}}function b(){return window}function z(e,t){e=E(e);if(t){b().setTimeout(function(){z(e);e=null},t)}else{u(e).removeChild(e)}}function le(e){return e instanceof Element?e:null}function J(e){return e instanceof HTMLElement?e:null}function K(e){return typeof e==="string"?e:null}function p(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function w(e,t,n){e=le(E(e));if(!e){return}if(n){b().setTimeout(function(){w(e,t);e=null},n)}else{e.classList&&e.classList.add(t)}}function S(e,t,n){let r=le(E(e));if(!r){return}if(n){b().setTimeout(function(){S(r,t);r=null},n)}else{if(r.classList){r.classList.remove(t);if(r.classList.length===0){r.removeAttribute("class")}}}}function G(e,t){e=E(e);e.classList.toggle(t)}function W(e,t){e=E(e);oe(e.parentElement.children,function(e){S(e,t)});w(le(e),t)}function g(e,t){e=le(E(e));if(e){return e.closest(t)}return null}function l(e,t){return e.substring(0,t.length)===t}function Z(e,t){return e.substring(e.length-t.length)===t}function de(e){const t=e.trim();if(l(t,"<")&&Z(t,"/>")){return t.substring(1,t.length-2)}else{return t}}function m(t,r,n){if(r.indexOf("global ")===0){return m(t,r.slice(7),true)}t=E(t);const o=[];{let t=0;let n=0;for(let e=0;e<r.length;e++){const l=r[e];if(l===","&&t===0){o.push(r.substring(n,e));n=e+1;continue}if(l==="<"){t++}else if(l==="/"&&e<r.length-1&&r[e+1]===">"){t--}}if(n<r.length){o.push(r.substring(n))}}const i=[];const s=[];while(o.length>0){const r=de(o.shift());let e;if(r.indexOf("closest ")===0){e=g(le(t),de(r.slice(8)))}else if(r.indexOf("find ")===0){e=a(p(t),de(r.slice(5)))}else if(r==="next"||r==="nextElementSibling"){e=le(t).nextElementSibling}else if(r.indexOf("next ")===0){e=pe(t,de(r.slice(5)),!!n)}else if(r==="previous"||r==="previousElementSibling"){e=le(t).previousElementSibling}else if(r.indexOf("previous ")===0){e=ge(t,de(r.slice(9)),!!n)}else if(r==="document"){e=document}else if(r==="window"){e=window}else if(r==="body"){e=document.body}else if(r==="root"){e=q(t,!!n)}else if(r==="host"){e=t.getRootNode().host}else{s.push(r)}if(e){i.push(e)}}if(s.length>0){const e=s.join(",");const c=p(q(t,!!n));i.push(...F(c.querySelectorAll(e)))}return i}var pe=function(t,e,n){const r=p(q(t,n)).querySelectorAll(e);for(let e=0;e<r.length;e++){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING){return o}}};var ge=function(t,e,n){const r=p(q(t,n)).querySelectorAll(e);for(let e=r.length-1;e>=0;e--){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}};function ce(e,t){if(typeof e!=="string"){return m(e,t)[0]}else{return m(ee().body,e)[0]}}function E(e,t){if(typeof e==="string"){return a(p(t)||document,e)}else{return e}}function me(e,t,n,r){if(P(t)){return{target:ee().body,event:K(e),listener:t,options:n}}else{return{target:E(e),event:K(t),listener:n,options:r}}}function ye(t,n,r,o){Wn(function(){const e=me(t,n,r,o);e.target.addEventListener(e.event,e.listener,e.options)});const e=P(n);return e?n:r}function xe(t,n,r){Wn(function(){const e=me(t,n,r);e.target.removeEventListener(e.event,e.listener)});return P(n)?n:r}const be=ee().createElement("output");function ve(t,n){const e=te(t,n);if(e){if(e==="this"){return[we(t,n)]}else{const r=m(t,e);const o=/(^|,)(\s*)inherit(\s*)($|,)/.test(e);if(o){const i=le(A(t,function(e){return e!==t&&s(le(e),n)}));if(i){r.push(...ve(i,n))}}if(r.length===0){T('The selector "'+e+'" on '+n+" returned no matches!");return[be]}else{return r}}}}function we(e,t){return le(A(e,function(e){return f(le(e),t)!=null}))}function Se(e){const t=te(e,"hx-target");if(t){if(t==="this"){return we(e,"hx-target")}else{return ce(e,t)}}else{const n=re(e);if(n.boosted){return ee().body}else{return e}}}function Ee(e){return Y.config.attributesToSettle.includes(e)}function Ce(t,n){oe(Array.from(t.attributes),function(e){if(!n.hasAttribute(e.name)&&Ee(e.name)){t.removeAttribute(e.name)}});oe(n.attributes,function(e){if(Ee(e.name)){t.setAttribute(e.name,e.value)}})}function Oe(t,e){const n=Kn(e);for(let e=0;e<n.length;e++){const r=n[e];try{if(r.isInlineSwap(t)){return true}}catch(e){T(e)}}return t==="outerHTML"}function Te(e,o,i,t){t=t||ee();let n="#"+CSS.escape(Q(o,"id"));let s="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){s=e.substring(0,e.indexOf(":"));n=e.substring(e.indexOf(":")+1)}else{s=e}o.removeAttribute("hx-swap-oob");o.removeAttribute("data-hx-swap-oob");const r=m(t,n,false);if(r.length){oe(r,function(e){let t;const n=o.cloneNode(true);t=ee().createDocumentFragment();t.appendChild(n);if(!Oe(s,e)){t=p(n)}const r={shouldSwap:true,target:e,fragment:t};if(!ae(e,"htmx:oobBeforeSwap",r))return;e=r.target;if(r.shouldSwap){Re(t);Ve(s,e,e,t,i);He()}oe(i.elts,function(e){ae(e,"htmx:oobAfterSwap",r)})});o.parentNode.removeChild(o)}else{o.parentNode.removeChild(o);ue(ee().body,"htmx:oobErrorNoTarget",{content:o,target:n})}return e}function He(){const e=a("#--htmx-preserve-pantry--");if(e){for(const t of[...e.children]){const n=a("#"+t.id);n.parentNode.moveBefore(t,n);n.remove()}e.remove()}}function Re(e){oe(x(e,"[hx-preserve], [data-hx-preserve]"),function(e){const t=f(e,"id");const n=ee().getElementById(t);if(n!=null){if(e.moveBefore){let e=a("#--htmx-preserve-pantry--");if(e==null){ee().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>");e=a("#--htmx-preserve-pantry--")}e.moveBefore(n,null)}else{e.parentNode.replaceChild(n,e)}}})}function qe(i,e,s){oe(e.querySelectorAll("[id]"),function(t){const n=Q(t,"id");if(n&&n.length>0){const e=p(i);const r=e&&e.querySelector(CSS.escape(t.tagName)+"#"+CSS.escape(n));if(r&&r!==e){const o=t.cloneNode();Ce(t,r);s.tasks.push(function(){Ce(t,o)})}}})}function Ae(e){return function(){S(e,Y.config.addedClass);Bt(le(e));Ne(p(e));ae(e,"htmx:load")}}function Ne(e){const t="[autofocus]";const n=J(h(e,t)?e:e.querySelector(t));if(n!=null){n.focus()}}function c(e,t,n,r){qe(e,n,r);while(n.childNodes.length>0){const o=n.firstChild;w(le(o),Y.config.addedClass);e.insertBefore(o,t);if(o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE){r.tasks.push(Ae(o))}}}function Ie(e,t){let n=0;while(n<e.length){t=(t<<5)-t+e.charCodeAt(n++)|0}return t}function Le(t){let n=0;for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e];if(r.value){n=Ie(r.name,n);n=Ie(r.value,n)}}return n}function ke(t){const n=re(t);if(n.onHandlers){for(let e=0;e<n.onHandlers.length;e++){const r=n.onHandlers[e];xe(t,r.event,r.listener)}delete n.onHandlers}}function De(e){const t=re(e);if(t.timeout){clearTimeout(t.timeout)}if(t.listenerInfos){oe(t.listenerInfos,function(e){if(e.on){xe(e.on,e.trigger,e.listener)}})}ke(e);oe(Object.keys(t),function(e){if(e!=="firstInitCompleted")delete t[e]})}function y(e){ae(e,"htmx:beforeCleanupElement");De(e);oe(e.children,function(e){y(e)})}function Pe(t,e,n){if(t.tagName==="BODY"){return je(t,e,n)}let r;const o=t.previousSibling;const i=u(t);if(!i){return}c(i,t,e,n);if(o==null){r=i.firstChild}else{r=o.nextSibling}n.elts=n.elts.filter(function(e){return e!==t});while(r&&r!==t){if(r instanceof Element){n.elts.push(r)}r=r.nextSibling}y(t);t.remove()}function Me(e,t,n){return c(e,e.firstChild,t,n)}function Fe(e,t,n){return c(u(e),e,t,n)}function Be(e,t,n){return c(e,null,t,n)}function Xe(e,t,n){return c(u(e),e.nextSibling,t,n)}function Ue(e){y(e);const t=u(e);if(t){return t.removeChild(e)}}function je(e,t,n){const r=e.firstChild;c(e,r,t,n);if(r){while(r.nextSibling){y(r.nextSibling);e.removeChild(r.nextSibling)}y(r);e.removeChild(r)}}function Ve(t,e,n,r,o){switch(t){case"none":return;case"outerHTML":Pe(n,r,o);return;case"afterbegin":Me(n,r,o);return;case"beforebegin":Fe(n,r,o);return;case"beforeend":Be(n,r,o);return;case"afterend":Xe(n,r,o);return;case"delete":Ue(n);return;default:var i=Kn(e);for(let e=0;e<i.length;e++){const s=i[e];try{const l=s.handleSwap(t,n,r,o);if(l){if(Array.isArray(l)){for(let e=0;e<l.length;e++){const c=l[e];if(c.nodeType!==Node.TEXT_NODE&&c.nodeType!==Node.COMMENT_NODE){o.tasks.push(Ae(c))}}}return}}catch(e){T(e)}}if(t==="innerHTML"){je(n,r,o)}else{Ve(Y.config.defaultSwapStyle,e,n,r,o)}}}function $e(e,s,l){var t=x(e,"template[hx]");oe(t,function(r){var e=Q(r,"type");if(e==="partial"){var t=f(r,"hx-target")||(r.id?"#"+CSS.escape(r.id):null);if(t){var n=f(r,"hx-swap");var o=vn(r,n);var i=m(l||ee().body,t,false);if(i.length===0){ue(ee().body,"htmx:partialErrorNoTarget",{template:r,targetSelector:t,sourceElement:l})}oe(i,function(e){e=le(e);if(e){var t=r.content.cloneNode(true);k(t);var n={shouldSwap:true,target:e,fragment:t};if(!ae(e,"htmx:partialBeforeSwap",n))return;e=n.target;if(n.shouldSwap){C(e,n.fragment,o,{contextElement:e,afterSwapCallback:function(){oe(s.elts,function(e){ae(e,"htmx:partialAfterSwap",n)})}})}}})}}else{ae(ee().body,"htmx:processTemplate",{type:e,template:r,settleInfo:s,sourceElement:l})}r.parentNode.removeChild(r)});return t.length>0}function _e(e,n,r){var t=x(e,"[hx-swap-oob], [data-hx-swap-oob]");oe(t,function(e){if(Y.config.allowNestedOobSwaps||e.parentElement===null){const t=f(e,"hx-swap-oob");if(t!=null){Te(t,e,n,r)}}else{e.removeAttribute("hx-swap-oob");e.removeAttribute("data-hx-swap-oob")}});return t.length>0}function C(d,p,g,m){if(!m){m={}}let y=null;let n=null;let e=function(){ne(m.beforeSwapCallback);d=E(d);const r=m.contextElement&&m.contextElement.isConnected?q(m.contextElement,false):ee();const e=document.activeElement;let t={};t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null};const o=En(d);if(g.swapStyle==="textContent"){d.textContent=p}else{let n=typeof p==="string"?D(p):p;o.title=m.title||n.title;if(m.historyRequest){n=n.querySelector("[hx-history-elt],[data-hx-history-elt]")||n}if(m.selectOOB){const s=m.selectOOB.split(",");for(let t=0;t<s.length;t++){const l=s[t].split(":",2);let e=l[0].trim();if(e.indexOf("#")===0){e=e.substring(1)}const c=l[1]||"true";const u=n.querySelector("#"+e);if(u){Te(c,u,o,r)}}}_e(n,o,r);oe(x(n,"template"),function(e){if(e.content&&_e(e.content,o,r)){e.remove()}});var i=$e(n,o,m.contextElement||le(d));if(m.select){const a=ee().createDocumentFragment();oe(n.querySelectorAll(m.select),function(e){a.appendChild(e)});n=a}Re(n);if(i&&!n.childElementCount&&!n.textContent.trim()){o.elts=[le(d)]}else{Ve(g.swapStyle,m.contextElement,d,n,o)}He()}if(t.elt&&!ie(t.elt)&&Q(t.elt,"id")){const f=document.getElementById(Q(t.elt,"id"));const h={preventScroll:g.focusScroll!==undefined?!g.focusScroll:!Y.config.defaultFocusScroll};if(f){if(t.start&&f.setSelectionRange){try{f.setSelectionRange(t.start,t.end)}catch(e){}}f.focus(h)}}S(d,Y.config.swappingClass);oe(o.elts,function(e){if(e.classList){w(e,Y.config.settlingClass)}ae(e,"htmx:afterSwap",m.eventInfo)});ne(m.afterSwapCallback);if(!g.ignoreTitle){Un(o.title)}const n=function(){oe(o.tasks,function(e){e.call()});oe(o.elts,function(e){if(e.classList){S(e,Y.config.settlingClass)}ae(e,"htmx:afterSettle",m.eventInfo)});if(m.anchor){const e=le(E("#"+m.anchor));if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}Cn(o.elts,g);ne(m.afterSettleCallback);ne(y)};if(g.settleDelay>0){b().setTimeout(n,g.settleDelay)}else{n()}};let t=Y.config.globalViewTransitions;if(g.hasOwnProperty("transition")){t=g.transition}const r=m.contextElement||ee();if(t&&ae(r,"htmx:beforeTransition",m.eventInfo)&&typeof Promise!=="undefined"&&document.startViewTransition){const o=new Promise(function(e,t){y=e;n=t});const i=e;e=function(){document.startViewTransition(function(){i();return o})}}try{if(g?.swapDelay&&g.swapDelay>0){b().setTimeout(e,g.swapDelay)}else{e()}}catch(e){ue(r,"htmx:swapError",m.eventInfo);ne(n);throw e}}function ze(e,t,n){const r=e.getResponseHeader(t);if(r.indexOf("{")===0){const o=v(r)||{};for(const i of Object.keys(o)){let e=o[i];if(M(e)){n=e.target!==undefined?e.target:n}else{e={value:e}}ae(n,i,e)}}else{const s=r.split(",");for(let e=0;e<s.length;e++){ae(n,s[e].trim(),[])}}}const Je=/\s/;const Ke=/[\s,]/;const Ge=/[_$a-zA-Z]/;const We=/[_$a-zA-Z0-9]/;const Ze=['"',"'","/"];const Ye=/[^\s]/;const Qe=/[{(]/;const et=/[})]/;function tt(e){const t=[];let n=0;while(n<e.length){if(Ge.exec(e.charAt(n))){var r=n;while(We.exec(e.charAt(n+1))){n++}t.push(e.substring(r,n+1))}else if(Ze.indexOf(e.charAt(n))!==-1){const o=e.charAt(n);var r=n;n++;while(n<e.length&&e.charAt(n)!==o){if(e.charAt(n)==="\\"){n++}n++}t.push(e.substring(r,n+1))}else{const i=e.charAt(n);t.push(i)}n++}return t}function nt(e,t,n){return Ge.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==n&&t!=="."}function rt(r,o,i){if(o[0]==="["){o.shift();let e=1;let t=" return (function("+i+"){ return (";let n=null;while(o.length>0){const s=o[0];if(s==="]"){e--;if(e===0){if(n===null){t=t+"true"}o.shift();t+=")})";try{const l=Tn(r,function(){return Function(t)()},function(){return true});l.source=t;return l}catch(e){ue(ee().body,"htmx:syntax:error",{error:e,source:t});return null}}}else if(s==="["){e++}if(nt(s,n,i)){t+="(("+i+"."+s+") ? ("+i+"."+s+") : (window."+s+"))"}else{t=t+s}n=o.shift()}}}function O(e,t){let n="";while(e.length>0&&!t.test(e[0])){n+=e.shift()}return n}function ot(e){let t;if(e.length>0&&Qe.test(e[0])){e.shift();t=O(e,et).trim();e.shift()}else{t=O(e,Ke)}return t}const it="input, textarea, select";function st(e,t,n){const r=[];const o=tt(t);do{O(o,Ye);const l=o.length;const c=O(o,/[,\[\s]/);if(c!==""){if(c==="every"){const u={trigger:"every"};O(o,Ye);u.pollInterval=d(O(o,/[,\[\s]/));O(o,Ye);var i=rt(e,o,"event");if(i){u.eventFilter=i}r.push(u)}else{const a={trigger:c};var i=rt(e,o,"event");if(i){a.eventFilter=i}O(o,Ye);while(o.length>0&&o[0]!==","){const f=o.shift();if(f==="changed"){a.changed=true}else if(f==="once"){a.once=true}else if(f==="consume"){a.consume=true}else if(f==="delay"&&o[0]===":"){o.shift();a.delay=d(O(o,Ke))}else if(f==="from"&&o[0]===":"){o.shift();if(Qe.test(o[0])){var s=ot(o)}else{var s=O(o,Ke);if(s==="closest"||s==="find"||s==="next"||s==="previous"){o.shift();const h=ot(o);if(h.length>0){s+=" "+h}}}a.from=s}else if(f==="target"&&o[0]===":"){o.shift();a.target=ot(o)}else if(f==="throttle"&&o[0]===":"){o.shift();a.throttle=d(O(o,Ke))}else if(f==="queue"&&o[0]===":"){o.shift();a.queue=O(o,Ke)}else if(f==="root"&&o[0]===":"){o.shift();a[f]=ot(o)}else if(f==="threshold"&&o[0]===":"){o.shift();a[f]=O(o,Ke)}else{ue(e,"htmx:syntax:error",{token:o.shift()})}O(o,Ye)}r.push(a)}}if(o.length===l){ue(e,"htmx:syntax:error",{token:o.shift()})}O(o,Ye)}while(o[0]===","&&o.shift());if(n){n[t]=r}return r}function lt(e){const t=f(e,"hx-trigger");let n=[];if(t){const r=Y.config.triggerSpecsCache;n=r&&r[t]||st(e,t,r)}if(n.length>0){return n}else if(h(e,"form")){return[{trigger:"submit"}]}else if(h(e,'input[type="button"], input[type="submit"]')){return[{trigger:"click"}]}else if(h(e,it)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function ct(e){re(e).cancelled=true}function ut(e,t,n){const r=re(e);r.timeout=b().setTimeout(function(){if(ie(e)&&r.cancelled!==true){if(!gt(n,e,Ut("hx:poll:trigger",{triggerSpec:n,target:e}))){t(e)}ut(e,t,n)}},n.pollInterval)}function at(e){return location.hostname===e.hostname&&Q(e,"href")&&Q(e,"href").indexOf("#")!==0}function ft(e){return g(e,Y.config.disableSelector)}function ht(t,n,e){if(t instanceof HTMLAnchorElement&&at(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"&&String(Q(t,"method")).toLowerCase()!=="dialog"){n.boosted=true;let r,o;if(t.tagName==="A"){r="get";o=Q(t,"href")}else{const i=Q(t,"method");r=i?i.toLowerCase():"get";o=Q(t,"action");if(o==null||o===""){o=location.href}if(r==="get"&&o.includes("?")){o=o.replace(/\?[^#]+/,"")}}e.forEach(function(e){mt(t,function(e,t){const n=le(e);if(ft(n)){y(n);return}fe(r,o,n,t)},n,e,true)})}}function dt(e,t){if(e.type==="submit"&&t.tagName==="FORM"){return true}else if(e.type==="click"){const n=t.closest('input[type="submit"], button');if(n&&n.form&&n.type==="submit"){return true}const r=t.closest("a");const o=/^#.+/;if(r&&r.href&&!o.test(r.getAttribute("href"))){return true}}return false}function pt(e,t){return re(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function gt(e,t,n){const r=e.eventFilter;if(r){try{return r.call(t,n)!==true}catch(e){const o=r.source;ue(ee().body,"htmx:eventFilter:error",{error:e,source:o});return true}}return false}function mt(l,c,e,u,a){const f=re(l);let t;if(u.from){t=m(l,u.from)}else{t=[l]}if(u.changed){if(!("lastValue"in f)){f.lastValue=new WeakMap}t.forEach(function(e){if(!f.lastValue.has(u)){f.lastValue.set(u,new WeakMap)}f.lastValue.get(u).set(e,e.value)})}oe(t,function(i){const s=function(e){if(!ie(l)){i.removeEventListener(u.trigger,s);return}if(pt(l,e)){return}if(a||dt(e,i)){e.preventDefault()}if(gt(u,l,e)){return}const t=re(e);t.triggerSpec=u;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(l)<0){t.handledFor.push(l);if(u.consume){e.stopPropagation()}if(u.target&&e.target){if(!h(le(e.target),u.target)){return}}if(u.once){if(f.triggeredOnce){return}else{f.triggeredOnce=true}}if(u.changed){const n=e.target;const r=n.value;const o=f.lastValue.get(u);if(o.has(n)&&o.get(n)===r){return}o.set(n,r)}if(f.delayed){clearTimeout(f.delayed)}if(f.throttle){return}if(u.throttle>0){if(!f.throttle){ae(l,"htmx:trigger");c(l,e);f.throttle=b().setTimeout(function(){f.throttle=null},u.throttle)}}else if(u.delay>0){f.delayed=b().setTimeout(function(){ae(l,"htmx:trigger");c(l,e)},u.delay)}else{ae(l,"htmx:trigger");c(l,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:u.trigger,listener:s,on:i});i.addEventListener(u.trigger,s)})}let yt=false;let xt=null;function bt(){if(!xt){xt=function(){yt=true};window.addEventListener("scroll",xt);window.addEventListener("resize",xt);setInterval(function(){if(yt){yt=false;oe(ee().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){vt(e)})}},200)}}function vt(e){if(!s(e,"data-hx-revealed")&&B(e)){e.setAttribute("data-hx-revealed","true");const t=re(e);if(t.initHash){ae(e,"revealed")}else{e.addEventListener("htmx:afterProcessNode",function(){ae(e,"revealed")},{once:true})}}}function wt(e,t,n,r){const o=function(){if(!n.loaded){n.loaded=true;ae(e,"htmx:trigger");t(e)}};if(r>0){b().setTimeout(o,r)}else{o()}}function St(t,n,e){let i=false;oe(he,function(r){if(s(t,"hx-"+r)){const o=f(t,"hx-"+r);i=true;n.path=o;n.verb=r;e.forEach(function(e){Et(t,e,n,function(e,t){const n=le(e);if(ft(n)){y(n);return}fe(r,o,n,t)})})}});return i}function Et(r,e,t,n){if(e.trigger==="revealed"){bt();mt(r,n,t,e);vt(le(r))}else if(e.trigger==="intersect"){const o={};if(e.root){o.root=ce(r,e.root)}if(e.threshold){o.threshold=parseFloat(e.threshold)}const i=new IntersectionObserver(function(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.isIntersecting){ae(r,"intersect");break}}},o);i.observe(le(r));mt(le(r),n,t,e)}else if(!t.firstInitCompleted&&e.trigger==="load"){if(!gt(e,r,Ut("load",{elt:r}))){wt(le(r),n,t,e.delay)}}else if(e.pollInterval>0){t.polling=true;ut(le(r),n,e)}else{mt(r,n,t,e)}}function Ct(e){const t=le(e);if(!t){return false}const n=t.attributes;for(let e=0;e<n.length;e++){const r=n[e].name;if(l(r,"hx-on:")||l(r,"data-hx-on:")||l(r,"hx-on-")||l(r,"data-hx-on-")){return true}}return false}const Ot=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or'+' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function Tt(e,t){if(Ct(e)){t.push(le(e))}const n=Ot.evaluate(e);let r=null;while(r=n.iterateNext())t.push(le(r))}function Ht(e){const t=[];if(e instanceof DocumentFragment){for(const n of e.childNodes){Tt(n,t)}}else{Tt(e,t)}return t}function Rt(e){if(e.querySelectorAll){const n=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]";const r=[];for(const i of Object.keys($n)){const s=$n[i];if(s.getSelectors){var t=s.getSelectors();if(t){r.push(t)}}}const o=e.querySelectorAll(R+n+", form, [type='submit'],"+" [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+r.flat().map(e=>", "+e).join(""));return o}else{return[]}}function qt(e){const t=Nt(e.target);const n=Lt(e);if(n){n.lastButtonClicked=t}}function At(e){const t=Lt(e);if(t){t.lastButtonClicked=null}}function Nt(e){return g(le(e),"button, input[type='submit']")}function It(e){return e.form||g(e,"form")}function Lt(e){const t=Nt(e.target);if(!t){return}const n=It(t);if(!n){return}return re(n)}function kt(e){e.addEventListener("click",qt);e.addEventListener("focusin",qt);e.addEventListener("focusout",At)}function Dt(t,e,n){const r=re(t);if(!Array.isArray(r.onHandlers)){r.onHandlers=[]}let o;const i=function(e){Tn(t,function(){if(ft(t)){return}if(!o){o=new Function("event",n)}o.call(t,e)})};t.addEventListener(e,i);r.onHandlers.push({event:e,listener:i})}function Pt(t){ke(t);for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;const r=t.attributes[e].value;if(l(n,"hx-on")||l(n,"data-hx-on")){const o=n.indexOf("-on")+3;const i=n.slice(o,o+1);if(i==="-"||i===":"){let e=n.slice(o+1);if(l(e,":")){e="htmx"+e}else if(l(e,"-")){e="htmx:"+e.slice(1)}else if(l(e,"htmx-")){e="htmx:"+e.slice(5)}Dt(t,e,r)}}}}function Mt(t){ae(t,"htmx:beforeProcessNode");const n=re(t);const e=lt(t);const r=St(t,n,e);if(!r){if(te(t,"hx-boost")==="true"){ht(t,n,e)}else if(s(t,"hx-trigger")){e.forEach(function(e){Et(t,e,n,function(){})})}}if(t.tagName==="FORM"||Q(t,"type")==="submit"&&s(t,"form")){kt(t)}n.firstInitCompleted=true;ae(t,"htmx:afterProcessNode")}function Ft(e){if(!(e instanceof Element)){return false}const t=re(e);const n=Le(e);if(t.initHash!==n){De(e);t.initHash=n;return true}return false}function Bt(e){e=E(e);if(ft(e)){y(e);return}const t=[];if(Ft(e)){t.push(e)}oe(Rt(e),function(e){if(ft(e)){y(e);return}if(Ft(e)){t.push(e)}});oe(Ht(e),Pt);oe(t,Mt)}function Xt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ut(e,t){return new CustomEvent(e,{bubbles:true,cancelable:true,composed:true,detail:t})}function ue(e,t,n){ae(e,t,se({error:t},n))}function jt(e){return e==="htmx:afterProcessNode"}function Vt(e,t,n){oe(Kn(e,[],n),function(e){try{t(e)}catch(e){T(e)}})}function T(e){console.error(e)}function ae(e,t,n){e=E(e);if(n==null){n={}}n.elt=e;const r=Ut(t,n);if(Y.logger&&!jt(t)){Y.logger(e,t,n)}if(n.error){T(n.error+(n.target?", "+n.target:""));ae(e,"htmx:error",{errorInfo:n})}let o=e.dispatchEvent(r);const i=Xt(t);if(o&&i!==t){const s=Ut(i,r.detail);o=o&&e.dispatchEvent(s)}Vt(le(e),function(e){o=o&&(e.onEvent(t,r)!==false&&!r.defaultPrevented)});return o}let $t;function _t(e){$t=e;if(U()){sessionStorage.setItem("htmx-current-path-for-history",e)}}_t(location.pathname+location.search);function zt(){const e=ee().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||ee().body}function Jt(t,e){if(!U()){return}const n=Gt(e);const r=ee().title;const o=window.scrollY;if(Y.config.historyCacheSize<=0){sessionStorage.removeItem("htmx-history-cache");return}t=j(t);const i=v(sessionStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<i.length;e++){if(i[e].url===t){i.splice(e,1);break}}const s={url:t,content:n,title:r,scroll:o};ae(ee().body,"htmx:historyItemCreated",{item:s,cache:i});i.push(s);while(i.length>Y.config.historyCacheSize){i.shift()}while(i.length>0){try{sessionStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){ue(ee().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Kt(t){if(!U()){return null}t=j(t);const n=v(sessionStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<n.length;e++){if(n[e].url===t){return n[e]}}return null}function Gt(e){const t=Y.config.requestClass;const n=e.cloneNode(true);oe(x(n,"."+t),function(e){S(e,t)});oe(x(n,"[data-disabled-by-htmx]"),function(e){e.removeAttribute("disabled")});return n.innerHTML}function Wt(){const e=zt();let t=$t;if(U()){t=sessionStorage.getItem("htmx-current-path-for-history")}t=t||location.pathname+location.search;const n=ee().querySelector('[hx-history="false" i],[data-hx-history="false" i]');if(!n){ae(ee().body,"htmx:beforeHistorySave",{path:t,historyElt:e});Jt(t,e)}if(Y.config.historyEnabled)history.replaceState({htmx:true},ee().title,location.href)}function Zt(e){if(Y.config.getCacheBusterParam){e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,"");if(Z(e,"&")||Z(e,"?")){e=e.slice(0,-1)}}if(Y.config.historyEnabled){history.pushState({htmx:true},"",e)}_t(e)}function Yt(e){if(Y.config.historyEnabled)history.replaceState({htmx:true},"",e);_t(e)}function Qt(e){oe(e,function(e){e.call(undefined)})}function en(e){const t=new XMLHttpRequest;const n={swapStyle:"innerHTML",swapDelay:0,settleDelay:0};const r={path:e,xhr:t,historyElt:zt(),swapSpec:n};t.open("GET",e,true);if(Y.config.historyRestoreAsHxRequest){t.setRequestHeader("HX-Request","true")}t.setRequestHeader("HX-History-Restore-Request","true");t.setRequestHeader("HX-Current-URL",location.href);t.onload=function(){if(this.status>=200&&this.status<400){r.response=this.response;ae(ee().body,"htmx:historyCacheMissLoad",r);C(r.historyElt,r.response,n,{contextElement:r.historyElt,historyRequest:true});_t(r.path);ae(ee().body,"htmx:historyRestore",{path:e,cacheMiss:true,serverResponse:r.response})}else{ue(ee().body,"htmx:historyCacheMissLoadError",r)}};if(ae(ee().body,"htmx:historyCacheMiss",r)){t.send()}}function tn(e){Wt();e=e||location.pathname+location.search;const t=Kt(e);if(t){const n={swapStyle:"innerHTML",swapDelay:0,settleDelay:0,scroll:t.scroll};const r={path:e,item:t,historyElt:zt(),swapSpec:n};if(ae(ee().body,"htmx:historyCacheHit",r)){C(r.historyElt,t.content,n,{contextElement:r.historyElt,title:t.title});_t(r.path);ae(ee().body,"htmx:historyRestore",r)}}else{if(Y.config.refreshOnHistoryMiss){Y.location.reload(true)}else{en(e)}}}function nn(e){let t=ve(e,"hx-indicator");if(t==null){t=[e]}oe(t,function(e){const t=re(e);t.requestCount=(t.requestCount||0)+1;w(e,Y.config.requestClass)});return t}function rn(e){let t=ve(e,"hx-disabled-elt");if(t==null){t=[]}oe(t,function(e){const t=re(e);t.requestCount=(t.requestCount||0)+1;if(!e.hasAttribute("disabled")){e.setAttribute("disabled","");e.setAttribute("data-disabled-by-htmx","")}});return t}function on(e,t){oe(e.concat(t),function(e){const t=re(e);t.requestCount=(t.requestCount||1)-1});oe(e,function(e){const t=re(e);if(t.requestCount===0){S(e,Y.config.requestClass)}});oe(t,function(e){const t=re(e);if(t.requestCount===0&&e.hasAttribute("data-disabled-by-htmx")){e.removeAttribute("disabled");e.removeAttribute("data-disabled-by-htmx")}})}function sn(t,n){for(let e=0;e<t.length;e++){const r=t[e];if(r.isSameNode(n)){return true}}return false}function ln(e){const t=e;if(t.name===""||t.name==null||t.disabled||g(t,"fieldset[disabled]")){return false}if(t.type==="button"||t.type==="submit"||t.tagName==="image"||t.tagName==="reset"||t.tagName==="file"){return false}if(t.type==="checkbox"||t.type==="radio"){return t.checked}return true}function cn(t,e,n){if(t!=null&&e!=null){if(Array.isArray(e)){e.forEach(function(e){n.append(t,e)})}else{n.append(t,e)}}}function un(t,n,r){if(t!=null&&n!=null){let e=r.getAll(t);if(Array.isArray(n)){e=e.filter(e=>n.indexOf(e)<0)}else{e=e.filter(e=>e!==n)}r.delete(t);oe(e,e=>r.append(t,e))}}function an(e){if(e instanceof HTMLSelectElement&&e.multiple){return F(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e instanceof HTMLInputElement&&e.files){return F(e.files)}return e.value}function fn(t,n,r,e,o){if(e==null||sn(t,e)){return}else{t.push(e)}if(ln(e)){const i=Q(e,"name");cn(i,an(e),n);if(o){hn(e,r)}}if(e instanceof HTMLFormElement){oe(e.elements,function(e){if(t.indexOf(e)>=0){un(e.name,an(e),n)}else{t.push(e)}if(o){hn(e,r)}});new FormData(e).forEach(function(e,t){if(e instanceof File&&e.name===""){return}cn(t,e,n)})}}function hn(e,t){const n=e;if(n.willValidate){ae(n,"htmx:validation:validate");if(!n.checkValidity()){if(ae(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})&&!t.length&&Y.config.reportValidityOfForms){n.reportValidity()}t.push({elt:n,message:n.validationMessage,validity:n.validity})}}}function dn(n,e){for(const t of e.keys()){n.delete(t)}e.forEach(function(e,t){n.append(t,e)});return n}function pn(e,t){const n=[];const r=new FormData;const o=new FormData;const i=[];const s=re(e);if(s.lastButtonClicked&&!ie(s.lastButtonClicked)){s.lastButtonClicked=null}let l=e instanceof HTMLFormElement&&e.noValidate!==true||f(e,"hx-validate")==="true";if(s.lastButtonClicked){l=l&&s.lastButtonClicked.formNoValidate!==true}if(t!=="get"){fn(n,o,i,It(e),l)}fn(n,r,i,e,l);if(s.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&Q(e,"type")==="submit"){const u=s.lastButtonClicked||e;const a=Q(u,"name");cn(a,u.value,o)}const c=ve(e,"hx-include");oe(c,function(e){fn(n,r,i,le(e),l);if(!h(e,"form")){oe(p(e).querySelectorAll(it),function(e){fn(n,r,i,e,l)})}});dn(r,o);return{errors:i,formData:r,values:Mn(r)}}function gn(e,t,n){if(e!==""){e+="&"}if(String(n)==="[object Object]"){n=JSON.stringify(n)}const r=encodeURIComponent(n);e+=encodeURIComponent(t)+"="+r;return e}function mn(e){e=Dn(e);let n="";e.forEach(function(e,t){n=gn(n,t,e)});return n}function yn(e,t,n){const r={"HX-Request":"true","HX-Trigger":Q(e,"id"),"HX-Trigger-Name":Q(e,"name"),"HX-Target":f(t,"id"),"HX-Current-URL":location.href};On(e,"hx-headers",false,r);if(n!==undefined){r["HX-Prompt"]=n}if(re(e).boosted){r["HX-Boosted"]="true"}return r}function xn(n,e){const t=te(e,"hx-params");if(t){if(t==="none"){return new FormData}else if(t==="*"){return n}else if(t.indexOf("not ")===0){oe(t.slice(4).split(","),function(e){e=e.trim();n.delete(e)});return n}else{const r=new FormData;oe(t.split(","),function(t){t=t.trim();if(n.has(t)){n.getAll(t).forEach(function(e){r.append(t,e)})}});return r}}else{return n}}function bn(e){return!!Q(e,"href")&&Q(e,"href").indexOf("#")>=0}function vn(e,t){const n=t||te(e,"hx-swap");const r={swapStyle:re(e).boosted?"innerHTML":Y.config.defaultSwapStyle,swapDelay:Y.config.defaultSwapDelay,settleDelay:Y.config.defaultSettleDelay};if(Y.config.scrollIntoViewOnBoost&&re(e).boosted&&!bn(e)){r.show="top"}if(n){const s=X(n);if(s.length>0){for(let e=0;e<s.length;e++){const l=s[e];if(l.indexOf("swap:")===0){r.swapDelay=d(l.slice(5))}else if(l.indexOf("settle:")===0){r.settleDelay=d(l.slice(7))}else if(l.indexOf("transition:")===0){r.transition=l.slice(11)==="true"}else if(l.indexOf("ignoreTitle:")===0){r.ignoreTitle=l.slice(12)==="true"}else if(l.indexOf("scroll:")===0){const c=l.slice(7);var o=c.split(":");const u=o.pop();var i=o.length>0?o.join(":"):null;r.scroll=u;r.scrollTarget=i}else if(l.indexOf("show:")===0){const a=l.slice(5);var o=a.split(":");const f=o.pop();var i=o.length>0?o.join(":"):null;r.show=f;r.showTarget=i}else if(l.indexOf("focus-scroll:")===0){const h=l.slice("focus-scroll:".length);r.focusScroll=h=="true"}else if(e==0){r.swapStyle=l}else{T("Unknown modifier in hx-swap: "+l)}}}}return r}function wn(e){return te(e,"hx-encoding")==="multipart/form-data"||h(e,"form")&&Q(e,"enctype")==="multipart/form-data"}function Sn(t,n,r){let o=null;Vt(n,function(e){if(o==null){o=e.encodeParameters(t,r,n)}});if(o!=null){return o}else{if(wn(n)){return dn(new FormData,Dn(r))}else{return mn(r)}}}function En(e){return{tasks:[],elts:[e]}}function Cn(e,t){const n=e[0];const r=e[e.length-1];if(t.scroll){var o=null;if(t.scrollTarget){o=le(ce(n,t.scrollTarget))}if(t.scroll==="top"&&(n||o)){o=o||n;o.scrollTop=0}if(t.scroll==="bottom"&&(r||o)){o=o||r;o.scrollTop=o.scrollHeight}if(typeof t.scroll==="number"){b().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}}if(t.show){var o=null;if(t.showTarget){let e=t.showTarget;if(t.showTarget==="window"){e="body"}o=le(ce(n,e))}if(t.show==="top"&&(n||o)){o=o||n;o.scrollIntoView({block:"start",behavior:Y.config.scrollBehavior})}if(t.show==="bottom"&&(r||o)){o=o||r;o.scrollIntoView({block:"end",behavior:Y.config.scrollBehavior})}}}function On(r,e,o,i,s){if(i==null){i={}}if(r==null){return i}const l=f(r,e);if(l){let e=l.trim();let t=o;if(e==="unset"){return null}if(e.indexOf("javascript:")===0){e=e.slice(11);t=true}else if(e.indexOf("js:")===0){e=e.slice(3);t=true}if(e.indexOf("{")!==0){e="{"+e+"}"}let n;if(t){n=Tn(r,function(){if(s){return Function("event","return ("+e+")").call(r,s)}else{return Function("return ("+e+")").call(r)}},{})}else{n=v(e)}for(const c of Object.keys(n)){if(i[c]==null){i[c]=n[c]}}}return On(le(u(r)),e,o,i,s)}function Tn(e,t,n){if(Y.config.allowEval){return t()}else{ue(e,"htmx:evalDisallowedError");return n}}function Hn(e,t,n){return On(e,"hx-vars",true,n,t)}function Rn(e,t,n){return On(e,"hx-vals",false,n,t)}function qn(e,t){return se(Hn(e,t),Rn(e,t))}function An(t,n,r){if(r!==null){try{t.setRequestHeader(n,r)}catch(e){t.setRequestHeader(n,encodeURIComponent(r));t.setRequestHeader(n+"-URI-AutoEncoded","true")}}}function Nn(t){if(t.responseURL){try{const e=new URL(t.responseURL);return e.pathname+e.search}catch(e){ue(ee().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function H(e,t){return e.getResponseHeader(t)!==null}function In(t,n,r){t=t.toLowerCase();if(r){if(r instanceof Element||typeof r==="string"){return fe(t,n,null,null,{targetOverride:E(r)||be,returnPromise:true})}else{let e=E(r.target);if(r.target&&!e||r.source&&!e&&!E(r.source)){e=be}return fe(t,n,E(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:e,swapOverride:r.swap,select:r.select,returnPromise:true,push:r.push,replace:r.replace,selectOOB:r.selectOOB})}}else{return fe(t,n,null,null,{returnPromise:true})}}function Ln(e){const t=[];while(e){t.push(e);e=e.parentElement}return t}function kn(e,t,n){const r=new URL(t,location.protocol!=="about:"?location.href:window.origin);const o=location.protocol!=="about:"?location.origin:window.origin;const i=o===r.origin;if(Y.config.selfRequestsOnly){if(!i){return false}}return ae(e,"htmx:validateUrl",se({url:r,sameHost:i},n))}function Dn(e){if(e instanceof FormData)return e;const t=new FormData;for(const n of Object.keys(e)){if(e[n]&&typeof e[n].forEach==="function"){e[n].forEach(function(e){t.append(n,e)})}else if(typeof e[n]==="object"&&!(e[n]instanceof Blob)){t.append(n,JSON.stringify(e[n]))}else{t.append(n,e[n])}}return t}function Pn(r,o,e){return new Proxy(e,{get:function(t,e){if(typeof e==="number")return t[e];if(e==="length")return t.length;if(e==="push"){return function(e){t.push(e);r.append(o,e)}}if(typeof t[e]==="function"){return function(){t[e].apply(t,arguments);r.delete(o);t.forEach(function(e){r.append(o,e)})}}if(t[e]&&t[e].length===1){return t[e][0]}else{return t[e]}},set:function(e,t,n){e[t]=n;r.delete(o);e.forEach(function(e){r.append(o,e)});return true}})}function Mn(o){return new Proxy(o,{get:function(e,t){if(typeof t==="symbol"){const r=Reflect.get(e,t);if(typeof r==="function"){return function(){return r.apply(o,arguments)}}else{return r}}if(t==="toJSON"){return()=>Object.fromEntries(o)}if(t in e){if(typeof e[t]==="function"){return function(){return o[t].apply(o,arguments)}}}const n=o.getAll(t);if(n.length===0){return undefined}else if(n.length===1){return n[0]}else{return Pn(e,t,n)}},set:function(t,n,e){if(typeof n!=="string"){return false}t.delete(n);if(e&&typeof e.forEach==="function"){e.forEach(function(e){t.append(n,e)})}else if(typeof e==="object"&&!(e instanceof Blob)){t.append(n,JSON.stringify(e))}else{t.append(n,e)}return true},deleteProperty:function(e,t){if(typeof t==="string"){e.delete(t)}return true},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function fe(t,n,r,o,i,P){let s=null;let l=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var e=new Promise(function(e,t){s=e;l=t})}if(r==null){r=ee().body}const M=i.handler||Vn;const F=i.select||null;if(!ie(r)){ne(s);return e}const c=i.targetOverride||le(Se(r));if(c==null||c==be){ue(r,"htmx:targetError",{target:te(r,"hx-target")});ne(l);return e}let u=re(r);const a=u.lastButtonClicked;if(a){const A=Q(a,"formaction");if(A!=null){n=A}const N=Q(a,"formmethod");if(N!=null){if(he.includes(N.toLowerCase())){t=N}else{ne(s);return e}}}const f=te(r,"hx-confirm");if(P===undefined){const K=function(e){return fe(t,n,r,o,i,!!e)};const G={target:c,elt:r,path:n,verb:t,triggeringEvent:o,etc:i,issueRequest:K,question:f};if(ae(r,"htmx:confirm",G)===false){ne(s);return e}}let h=r;let d=te(r,"hx-sync");let p=null;let B=false;if(d){const I=d.split(":");const L=I[0].trim();if(L==="this"){h=we(r,"hx-sync")}else{h=le(ce(r,L))}d=(I[1]||"drop").trim();u=re(h);if(d==="drop"&&u.xhr&&u.abortable!==true){ne(s);return e}else if(d==="abort"){if(u.xhr){ne(s);return e}else{B=true}}else if(d==="replace"){ae(h,"htmx:abort")}else if(d.indexOf("queue")===0){const W=d.split(" ");p=(W[1]||"last").trim()}}if(u.xhr){if(u.abortable){ae(h,"htmx:abort")}else{if(p==null){if(o){const k=re(o);if(k&&k.triggerSpec&&k.triggerSpec.queue){p=k.triggerSpec.queue}}if(p==null){p="last"}}if(u.queuedRequests==null){u.queuedRequests=[]}if(p==="first"&&u.queuedRequests.length===0){u.queuedRequests.push(function(){fe(t,n,r,o,i)})}else if(p==="all"){u.queuedRequests.push(function(){fe(t,n,r,o,i)})}else if(p==="last"){u.queuedRequests=[];u.queuedRequests.push(function(){fe(t,n,r,o,i)})}ne(s);return e}}const g=new XMLHttpRequest;u.xhr=g;u.abortable=B;const m=function(){u.xhr=null;u.abortable=false;if(u.queuedRequests!=null&&u.queuedRequests.length>0){const e=u.queuedRequests.shift();e()}};const X=te(r,"hx-prompt");if(X){var y=prompt(X);if(y===null||!ae(r,"htmx:prompt",{prompt:y,target:c})){ne(s);m();return e}}if(f&&!P){if(!confirm(f)){ne(s);m();return e}}let x=yn(r,c,y);if(t!=="get"&&!wn(r)){x["Content-Type"]="application/x-www-form-urlencoded"}if(i.headers){x=se(x,i.headers)}const U=pn(r,t);let b=U.errors;const j=U.formData;if(i.values){dn(j,Dn(i.values))}const V=Dn(qn(r,o));const v=dn(j,V);let w=xn(v,r);if(Y.config.getCacheBusterParam&&t==="get"){w.set("org.htmx.cache-buster",Q(c,"id")||"true")}if(n==null||n===""){n=location.href}const S=On(r,"hx-request");const $=re(r).boosted;let E=Y.config.methodsThatUseUrlParams.indexOf(t)>=0;const C={boosted:$,useUrlParams:E,formData:w,parameters:Mn(w),unfilteredFormData:v,unfilteredParameters:Mn(v),headers:x,elt:r,target:c,verb:t,errors:b,withCredentials:i.credentials||S.credentials||Y.config.withCredentials,timeout:i.timeout||S.timeout||Y.config.timeout,path:n,triggeringEvent:o};if(!ae(r,"htmx:configRequest",C)){ne(s);m();return e}n=C.path;t=C.verb;x=C.headers;w=Dn(C.parameters);b=C.errors;E=C.useUrlParams;if(b&&b.length>0){ae(r,"htmx:validation:halted",C);ne(s);m();return e}const _=n.split("#");const z=_[0];const O=_[1];let T=n;if(E){T=z;const Z=!w.keys().next().done;if(Z){if(T.indexOf("?")<0){T+="?"}else{T+="&"}T+=mn(w);if(O){T+="#"+O}}}if(!kn(r,T,C)){ue(r,"htmx:invalidPath",C);ne(l);m();return e}g.open(t.toUpperCase(),T,true);g.overrideMimeType("text/html");g.withCredentials=C.withCredentials;g.timeout=C.timeout;if(S.noHeaders){}else{for(const D of Object.keys(x)){An(g,D,x[D])}}const H={xhr:g,target:c,requestConfig:C,etc:i,boosted:$,select:F,pathInfo:{requestPath:n,finalRequestPath:T,responsePath:null,anchor:O}};g.onload=function(){try{const t=Ln(r);H.pathInfo.responsePath=Nn(g);M(r,H);if(H.keepIndicators!==true){on(R,q)}ae(r,"htmx:afterRequest",H);ae(r,"htmx:afterOnLoad",H);if(!ie(r)){let e=null;while(t.length>0&&e==null){const n=t.shift();if(ie(n)){e=n}}if(e){ae(e,"htmx:afterRequest",H);ae(e,"htmx:afterOnLoad",H)}}ne(s)}catch(e){ue(r,"htmx:onLoadError",se({error:e},H));throw e}finally{m()}};g.onerror=function(){on(R,q);ue(r,"htmx:afterRequest",H);ue(r,"htmx:sendError",H);ne(l);m()};g.onabort=function(){on(R,q);ue(r,"htmx:afterRequest",H);ue(r,"htmx:sendAbort",H);ne(l);m()};g.ontimeout=function(){on(R,q);ue(r,"htmx:afterRequest",H);ue(r,"htmx:timeout",H);ne(l);m()};if(!ae(r,"htmx:beforeRequest",H)){ne(s);m();return e}var R=nn(r);var q=rn(r);oe(["loadstart","loadend","progress","abort"],function(t){oe([g,g.upload],function(e){e.addEventListener(t,function(e){ae(r,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ae(r,"htmx:beforeSend",H);const J=E?null:Sn(g,r,w);g.send(J);return e}function Fn(e,t){const n=t.xhr;let r=null;let o=null;if(H(n,"HX-Push")){r=n.getResponseHeader("HX-Push");o="push"}else if(H(n,"HX-Push-Url")){r=n.getResponseHeader("HX-Push-Url");o="push"}else if(H(n,"HX-Replace-Url")){r=n.getResponseHeader("HX-Replace-Url");o="replace"}if(r){if(r==="false"){return{}}else{return{type:o,path:r}}}const i=t.pathInfo.finalRequestPath;const s=t.pathInfo.responsePath;const l=t.etc.push||te(e,"hx-push-url");let c=t.etc.replace||te(e,"hx-replace-url");if(c==="false")c=null;const u=re(e).boosted;let a=null;let f=null;if(l){a="push";f=l}else if(c){a="replace";f=c}else if(u){a="push";f=s||i}if(f){if(f==="false"){return{}}if(f==="true"){f=s||i}if(t.pathInfo.anchor&&f.indexOf("#")===-1){f=f+"#"+t.pathInfo.anchor}return{type:a,path:f}}else{return{}}}function Bn(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function Xn(e){for(var t=0;t<Y.config.responseHandling.length;t++){var n=Y.config.responseHandling[t];if(Bn(n,e.status)){return n}}return{swap:false}}function Un(e){if(e){const t=a("title");if(t){t.textContent=e}else{window.document.title=e}}}function jn(e,t){if(t==="this"){return e}const n=le(ce(e,t));if(n==null){ue(e,"htmx:targetError",{target:t});throw new Error(`Invalid re-target ${t}`)}return n}function Vn(t,e){const n=e.xhr;let r=e.target;const o=e.etc;const i=e.select;if(!ae(t,"htmx:beforeOnLoad",e))return;if(H(n,"HX-Trigger")){ze(n,"HX-Trigger",t)}if(H(n,"HX-Location")){let e=n.getResponseHeader("HX-Location");var s={};if(e.indexOf("{")===0){s=v(e);e=s.path;delete s.path}s.push=s.push??"true";In("get",e,s);return}const l=H(n,"HX-Refresh")&&n.getResponseHeader("HX-Refresh")==="true";if(H(n,"HX-Redirect")){e.keepIndicators=true;Y.location.href=n.getResponseHeader("HX-Redirect");l&&Y.location.reload();return}if(l){e.keepIndicators=true;Y.location.reload();return}const c=Fn(t,e);const u=Xn(n);const a=u.swap;let f=!!u.error;let h=Y.config.ignoreTitle||u.ignoreTitle;let d=u.select;if(u.target){e.target=jn(t,u.target)}var p=o.swapOverride;if(p==null&&u.swapOverride){p=u.swapOverride}if(H(n,"HX-Retarget")){e.target=jn(t,n.getResponseHeader("HX-Retarget"))}if(H(n,"HX-Reswap")){p=n.getResponseHeader("HX-Reswap")}var g=n.response;var m=se({shouldSwap:a,serverResponse:g,isError:f,ignoreTitle:h,selectOverride:d,swapOverride:p},e);if(u.event&&!ae(r,u.event,m))return;if(!ae(r,"htmx:beforeSwap",m))return;r=m.target;g=m.serverResponse;f=m.isError;h=m.ignoreTitle;d=m.selectOverride;p=m.swapOverride;e.target=r;e.failed=f;e.successful=!f;if(m.shouldSwap){if(n.status===286){ct(t)}Vt(t,function(e){g=e.transformResponse(g,n,t)});if(c.type){Wt()}var y=vn(t,p);if(!y.hasOwnProperty("ignoreTitle")){y.ignoreTitle=h}w(r,Y.config.swappingClass);if(i){d=i}if(H(n,"HX-Reselect")){d=n.getResponseHeader("HX-Reselect")}const x=o.selectOOB||te(t,"hx-select-oob");const b=te(t,"hx-select");C(r,g,y,{select:d==="unset"?null:d||b,selectOOB:x,eventInfo:e,anchor:e.pathInfo.anchor,contextElement:t,afterSwapCallback:function(){if(H(n,"HX-Trigger-After-Swap")){let e=t;if(!ie(t)){e=ee().body}ze(n,"HX-Trigger-After-Swap",e)}},afterSettleCallback:function(){if(H(n,"HX-Trigger-After-Settle")){let e=t;if(!ie(t)){e=ee().body}ze(n,"HX-Trigger-After-Settle",e)}},beforeSwapCallback:function(){if(c.type){ae(ee().body,"htmx:beforeHistoryUpdate",se({history:c},e));if(c.type==="push"){Zt(c.path);ae(ee().body,"htmx:pushedIntoHistory",{path:c.path})}else{Yt(c.path);ae(ee().body,"htmx:replacedInHistory",{path:c.path})}}}})}if(f){ue(t,"htmx:responseError",se({error:"Response Status Error Code "+n.status+" from "+e.pathInfo.requestPath},e))}}const $n={};function _n(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,n,r){return false},encodeParameters:function(e,t,n){return null}}}function zn(e,t){if(t.init){t.init(n)}$n[e]=se(_n(),t)}function Jn(e){delete $n[e]}function Kn(e,n,r){if(n==undefined){n=[]}if(e==undefined){return n}if(r==undefined){r=[]}const t=f(e,"hx-ext");if(t){oe(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){r.push(e.slice(7));return}if(r.indexOf(e)<0){const t=$n[e];if(t&&n.indexOf(t)<0){n.push(t)}}})}return Kn(le(u(e)),n,r)}var Gn=false;ee().addEventListener("DOMContentLoaded",function(){Gn=true});function Wn(e){if(Gn||ee().readyState==="complete"){e()}else{ee().addEventListener("DOMContentLoaded",e)}}function Zn(){if(Y.config.includeIndicatorStyles!==false){const e=Y.config.inlineStyleNonce?` nonce="${Y.config.inlineStyleNonce}"`:"";const t=Y.config.indicatorClass;const n=Y.config.requestClass;ee().head.insertAdjacentHTML("beforeend",`<style${e}>`+`.${t}{opacity:0;visibility: hidden} `+`.${n} .${t}, .${n}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`+"</style>")}}function Yn(){const e=ee().querySelector('meta[name="htmx-config"]');if(e){return v(e.content)}else{return null}}function Qn(){const e=Yn();if(e){Y.config=se(Y.config,e)}}Wn(function(){Qn();Zn();let e=ee().body;Bt(e);const t=ee().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){const t=e.detail.elt||e.target;const n=re(t);if(n&&n.xhr){n.xhr.abort()}});const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){tn();oe(t,function(e){ae(e,"htmx:restored",{document:ee(),triggerEvent:ae})})}else{if(n){n(e)}}};b().setTimeout(function(){ae(e,"htmx:load",{});e=null},0)});return Y}();