mnfst 0.5.334 → 0.5.336

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/lib/manifest.js CHANGED
@@ -353,8 +353,8 @@
353
353
  const DEFAULT_VERSION = 'latest';
354
354
 
355
355
  // Stamped at build
356
- const LOADER_VERSION = '0.5.334';
357
- const MODULES_INTEGRITY = 'sha384-bPSRgboL6vTFlnOH479ijw+2NeriwxjXXuLMwspVbslXBBEPWZm1zvT/CHzJsZRM';
356
+ const LOADER_VERSION = '0.5.336';
357
+ const MODULES_INTEGRITY = 'sha384-fjgL8yxzJrpIvgOzLZ2X3pI8OdRQukhaNhMnmfjlvTpL3s65XQJ5GhzE0MIUBqoM';
358
358
  const INTEGRITY_FILE = 'manifest.modules.integrity.json';
359
359
  const VENDOR_FILE = 'manifest.vendor.integrity.json';
360
360
  // 'strict' | 'warn' while checks are requested; map promise while they apply
@@ -498,8 +498,11 @@
498
498
 
499
499
  // Has DOMContentLoaded fired? readyState can't tell ('interactive' spans
500
500
  // both DCL-pending and DCL-done); the navigation timing entry disambiguates.
501
+ // Its end stays 0 while DCL listeners run: seen here first, so code run from them doesn't wait for load
502
+ let dclStarted = false;
503
+ if (typeof document !== 'undefined' && document.readyState !== 'complete') document.addEventListener('DOMContentLoaded', () => { dclStarted = true; }, { once: true });
501
504
  function domContentLoadedFired() {
502
- if (document.readyState === 'complete') return true;
505
+ if (dclStarted || document.readyState === 'complete') return true;
503
506
  if (document.readyState === 'loading') return false;
504
507
  try {
505
508
  const nav = performance.getEntriesByType('navigation')[0];
@@ -710,7 +713,7 @@
710
713
  return verifiedFetch(CDN_HOSTS.map(h => `${h}/${path}`), hash, path);
711
714
  }
712
715
 
713
- async function fetchPluginScript(pluginName, version) {
716
+ async function fetchPluginScript(pluginName, version, ordered = true) {
714
717
  let unchecked = false;
715
718
  if (integrityActive && version !== LOADER_VERSION) {
716
719
  integrityProblem(`Integrity checks cover this loader's own version (${LOADER_VERSION}); ${pluginName} was requested at ${version}.`, 'Not loaded.');
@@ -718,7 +721,7 @@
718
721
  }
719
722
  // Known only once manifest.json lands, and the first view waits on them: ahead of the hinted modules
720
723
  const priority = ['components', 'data', 'localization'].includes(pluginName) ? 'high' : null;
721
- return injectFrom(getPluginUrlCandidates(pluginName, version), { unchecked, priority });
724
+ return injectFrom(getPluginUrlCandidates(pluginName, version), { unchecked, priority, ordered });
722
725
  }
723
726
 
724
727
  // One execution per plugin per page. injectScript dedupes by URL, which two
@@ -727,8 +730,13 @@
727
730
  // fights the first. A failed load is forgotten so a retry can still run.
728
731
  const pluginLoads = new Map();
729
732
  const pluginsSettled = new Set();
733
+ // When each file ran: one 10 s give-up per module from then, however many waits share it
734
+ const ranAt = new Map();
735
+ const now = () => (typeof performance !== 'undefined' ? performance.now() : Date.now());
736
+ const sinceRan = (p) => ranAt.has(p) ? now() - ranAt.get(p) : 0;
737
+ const giveUpIn = (p) => Math.max(0, 10000 - sinceRan(p));
730
738
 
731
- async function addScript(pluginName, version = RESOLVED_VERSION) {
739
+ async function addScript(pluginName, version = RESOLVED_VERSION, ordered = true) {
732
740
  const prior = pluginLoads.get(pluginName);
733
741
  if (prior) {
734
742
  if (prior.version !== version) {
@@ -736,9 +744,9 @@
736
744
  }
737
745
  return prior.promise;
738
746
  }
739
- const promise = fetchPluginScript(pluginName, version);
747
+ const promise = fetchPluginScript(pluginName, version, ordered);
740
748
  pluginLoads.set(pluginName, { version, promise });
741
- promise.then(() => pluginsSettled.add(pluginName), () => pluginLoads.delete(pluginName));
749
+ promise.then(() => { pluginsSettled.add(pluginName); ranAt.set(pluginName, now()); }, () => pluginLoads.delete(pluginName));
742
750
  return promise;
743
751
  }
744
752
 
@@ -955,6 +963,9 @@
955
963
  return load ? load.promise : null;
956
964
  }
957
965
  const heldEls = new WeakSet();
966
+ // Holds not yet released (restore included), and controls an outer restore left to an inner one: outer root
967
+ const holding = new WeakSet();
968
+ const passedOn = new WeakMap();
958
969
  let heldCount = 0;
959
970
  let heldRelease = null;
960
971
  // Rendered from source: hidden while held so raw markdown/code never shows
@@ -979,23 +990,34 @@
979
990
  const focus = a && root.contains(a) ? [a, a.selectionStart, a.selectionEnd] : null;
980
991
  return () => {
981
992
  // Outside the held element these edits were already seen live: stop the replay at its root
982
- const replay = new WeakSet();
983
- const stop = (e) => { if (replay.has(e)) e.stopPropagation(); };
984
- root.addEventListener('input', stop);
985
- root.addEventListener('change', stop);
986
- const fire = (c, type) => { const e = new Event(type, { bubbles: true }); replay.add(e); c.dispatchEvent(e); };
993
+ const replay = new WeakMap();
994
+ const stop = (e) => { if (replay.get(e) === e.currentTarget) e.stopPropagation(); };
995
+ const plan = [];
987
996
  for (const [c, k, v] of typed) {
988
997
  try {
989
998
  // Taken over by its directive on start (e.g. a date field turned read-only): not typable there
990
999
  if (!c.isConnected || c.readOnly || c.disabled) continue;
1000
+ // Inside a nested hold still to restore: that one replays it, up to this root
1001
+ let inner = false;
1002
+ for (let n = c; n && n !== root; n = n.parentElement) if (holding.has(n)) { inner = true; break; }
1003
+ if (inner) { if (!passedOn.has(c)) passedOn.set(c, root); continue; }
1004
+ const at = passedOn.get(c) || root;
1005
+ passedOn.delete(c);
1006
+ plan.push([c, k, v, at]);
1007
+ } catch (_) { /* skipped */ }
1008
+ }
1009
+ const stops = new Set(plan.map(p => p[3]));
1010
+ stops.forEach(s => { s.addEventListener('input', stop); s.addEventListener('change', stop); });
1011
+ const fire = (c, type, at) => { const e = new Event(type, { bubbles: true }); replay.set(e, at); c.dispatchEvent(e); };
1012
+ for (const [c, k, v, at] of plan) {
1013
+ try {
991
1014
  if (k === 'options') [...c.options].forEach((o, i) => { o.selected = !!v[i]; });
992
1015
  else if (k !== 'files') c[k] = v;
993
- fire(c, 'input');
994
- fire(c, 'change');
1016
+ fire(c, 'input', at);
1017
+ fire(c, 'change', at);
995
1018
  } catch (_) { /* skipped */ }
996
1019
  }
997
- root.removeEventListener('input', stop);
998
- root.removeEventListener('change', stop);
1020
+ stops.forEach(s => { s.removeEventListener('input', stop); s.removeEventListener('change', stop); });
999
1021
  if (focus && focus[0].isConnected) {
1000
1022
  try { focus[0].focus({ preventScroll: true }); if (focus[1] != null) focus[0].setSelectionRange(focus[1], focus[2]); } catch (_) { }
1001
1023
  }
@@ -1006,6 +1028,7 @@
1006
1028
  if (!load) return false;
1007
1029
  const name = u.attr.slice(2);
1008
1030
  heldEls.add(el);
1031
+ holding.add(el);
1009
1032
  if (!heldCount++ && window.ManifestPending) heldRelease = window.ManifestPending.hold('held');
1010
1033
  // Once per hold, whatever throws on the way
1011
1034
  let released = false;
@@ -1013,6 +1036,7 @@
1013
1036
  if (released) return;
1014
1037
  released = true;
1015
1038
  heldEls.delete(el);
1039
+ holding.delete(el);
1016
1040
  if (!--heldCount && heldRelease) { const r = heldRelease; heldRelease = null; r(); }
1017
1041
  };
1018
1042
  const early = [];
@@ -1043,7 +1067,7 @@
1043
1067
  };
1044
1068
  load.catch(() => giveUp('failed to load'));
1045
1069
  // Loaded but never registered (e.g. its own vendor file failed): don't hold forever
1046
- load.then(() => setTimeout(() => giveUp('has not started 10 s after loading'), 10000), () => { });
1070
+ load.then(() => setTimeout(() => giveUp('has not started 10 s after loading'), giveUpIn(u.plugin)), () => { });
1047
1071
  });
1048
1072
  const start = ready.then(() => {
1049
1073
  let restore = null;
@@ -1268,12 +1292,16 @@
1268
1292
  // Post-boot usage: component HTML, x-html and markdown content load the
1269
1293
  // on-use plugins they reference. Derive path only, like the boot sniff.
1270
1294
  let usageSniff = false;
1295
+ // Derive path: loadUsed works once the loader has queued its own modules; earlier calls wait for that
1296
+ let usageArmed = false;
1297
+ let usageGate = null;
1271
1298
  // A failed on-use load is not retried within this page load
1272
1299
  const usageFailed = new Set();
1273
1300
  // Settled loads only: a second caller waits on a load still in flight
1274
1301
  const usageLoaded = (p) => pluginsSettled.has(p) || usageFailed.has(p);
1275
1302
  function loadUsed(source, version = RESOLVED_VERSION) {
1276
- if (!usageSniff || !source || typeof document === 'undefined') return Promise.resolve([]);
1303
+ if (!usageArmed) return usageGate && source ? usageGate.promise.then(() => usageArmed ? loadUsed(source, version) : []) : Promise.resolve([]);
1304
+ if (!source || typeof document === 'undefined') return Promise.resolve([]);
1277
1305
  let root = source;
1278
1306
  if (typeof source === 'string') {
1279
1307
  if (source.indexOf('x-') === -1 && source.indexOf('$') === -1 && source.indexOf('<code') === -1) return Promise.resolve([]);
@@ -1290,11 +1318,22 @@
1290
1318
  if (!list.length) return Promise.resolve([]);
1291
1319
  // Prerender waits for the module and the adoption it schedules
1292
1320
  const release = window.ManifestPending ? window.ManifestPending.hold('module') : () => { };
1293
- return Promise.all(list.map(p => addScript(p, version).catch(error => {
1321
+ // On-use modules run as they arrive: nothing (Alpine included) queues behind them
1322
+ const ready = Promise.all(list.map(p => addScript(p, version, !lateEntries.some(u => u.plugin === p)).catch(error => {
1294
1323
  if (usageFailed.has(p)) return;
1295
1324
  usageFailed.add(p);
1296
1325
  console.warn(`[Manifest Loader] Failed to load plugin ${p}:`, error);
1297
- }))).then(() => new Promise(r => setTimeout(r, 0))).then(() => { release(); return list; });
1326
+ }))).then(() => Promise.all(list.map(started))).then(() => new Promise(r => setTimeout(r, 0)));
1327
+ ready.then(release);
1328
+ // Content waits at most 1.5 s: a slower module is left to the hold
1329
+ return Promise.race([ready, new Promise(r => setTimeout(r, USED_WAIT))]).then(() => list);
1330
+ }
1331
+ const USED_WAIT = 1500;
1332
+ // Its directive registered (Markdown waits for its parser first), at most 1.5 s after the file ran
1333
+ function started(p) {
1334
+ const u = lateEntries.find(e => e.plugin === p && e.attr);
1335
+ if (!u || !window[u.present] || usageFailed.has(p) || gaveUp.has(p) || preloaded.includes(p) || registered.has(u.attr.slice(2))) return null;
1336
+ return Promise.race([whenRegistered(u.attr.slice(2)), new Promise(r => setTimeout(r, Math.max(0, USED_WAIT - sinceRan(p))))]);
1298
1337
  }
1299
1338
 
1300
1339
  function watchUsage(version) {
@@ -1747,6 +1786,7 @@
1747
1786
  return;
1748
1787
  }
1749
1788
  window.__manifestLoaderStarted = true;
1789
+ if (config.deriveFromManifest) { let resolve; usageGate = { promise: new Promise(r => { resolve = r; }), resolve }; }
1750
1790
 
1751
1791
  const MANIFEST_DEPENDENT_PLUGINS = [
1752
1792
  'data', 'localization', 'components',
@@ -1862,7 +1902,7 @@
1862
1902
  // On-use modules this page uses, while manifest.json may still be in flight
1863
1903
  if (config.deriveFromManifest) {
1864
1904
  const used = sniffBoot().used.filter(p => p !== 'components' && !_omitted.includes(p));
1865
- for (const p of resolveDependencies(used)) if (!config.plugins.includes(p)) hint('preload', getPluginUrl(p, config.version), 'script');
1905
+ for (const p of resolveDependencies(used)) if (!config.plugins.includes(p) && !pluginLoads.has(p)) hint('preload', getPluginUrl(p, config.version), 'script');
1866
1906
  }
1867
1907
  } catch (_) { /* optional */ }
1868
1908
  });
@@ -1909,6 +1949,8 @@
1909
1949
  console.warn(`[Manifest Loader] Failed to load plugin ${pluginName}:`, error);
1910
1950
  });
1911
1951
  });
1952
+ // Content fetched before the document is parsed (components) loads its modules now
1953
+ if (config.deriveFromManifest) { usageArmed = true; usageGate.resolve(); }
1912
1954
  if (config.tailwind && !staticUtilitiesFullyCovered()) {
1913
1955
  pluginPromises.push(config.tailwindCache
1914
1956
  ? tailwindReplay.then(hit => hit ? null : loadTailwind(config.version)).catch(() => { })
@@ -2000,6 +2042,7 @@
2000
2042
 
2001
2043
  const tailwindReplay = config.tailwindCache ? replayTailwindCache(config) : null;
2002
2044
  hintEarlyFetches();
2003
- loadPlugins();
2045
+ // Never leaves a loadUsed caller waiting, whatever stops the boot
2046
+ loadPlugins().finally(() => { if (usageGate) usageGate.resolve(); });
2004
2047
  }
2005
2048
  })();
@@ -1,2 +1,2 @@
1
- !function(){"use strict";const e=document.currentScript;if(!window.ManifestPending){const et=new Map;let tt=0;window.ManifestPending={hold(e="work"){const t=++tt;return et.set(t,e),()=>{et.delete(t)}},get count(){return et.size+(window.__manifestMarkdownPending||0)+(window.__manifestUtilitiesPending||0)},labels(){const e=[...et.values()];return window.__manifestMarkdownPending>0&&e.push("markdown"),window.__manifestUtilitiesPending>0&&e.push("utilities"),e},background:e=>("function"==typeof e&&(e.__manifestBackground=!0),e)}}const t=new Set,n=new WeakSet;let i=!1;function o(){for(const e of[...t])e.settle()}function r(){i||(i=!0,queueMicrotask(()=>{i=!1,o()}))}function a(e){for(let t=e.parentNode;t;t=t.parentNode)if(t._x_ignore)return!0;return!1}function s(e,i){const s=window.Alpine,c=e.getAttribute("x-if");let l=!e.closest("[x-data],[x-init]"),d=!1,u=null;const f=()=>!!s.evaluate(e,c),p=()=>{u&&(u(),u=null)},m=()=>{t.delete(y),p()},w=()=>{l=!1,d=!1,p(),i._x_ignore=!0,t.add(y)},h=()=>{m(),s.mutateDom(()=>{s.destroyTree(i),i.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl,r()},g=()=>{l||e._x_currentIfEl!==i||!i.isConnected||a(e)||(l=!0,d=!1,m(),delete i._x_ignore,s.initTree(i),o())},y={settle(){if(!l&&!d)return e._x_currentIfEl!==i?m():void(i.isConnected?e._x_marker&&!a(e)&&f()&&g():i.getRootNode()instanceof DocumentFragment||m())}},v=()=>window.__manifestReady||!window.__manifestReadyCoordinator?h():(queueMicrotask(()=>{e._x_currentIfEl===i&&(e._x_undoIf=v,(()=>{if(u||!d||e._x_currentIfEl!==i||a(e))return;const t=s.evaluateLater(e,c),n=s.effect(()=>t(e=>{e&&queueMicrotask(()=>{d&&f()&&g()})}));u=()=>s.release(n)})())}),a(e)?w():(l&&(l=!1,i._x_ignore=!0,s.destroyTree(i),t.add(y)),void(d||(d=!0,window.addEventListener("manifest:ready",()=>{if(d&&e._x_currentIfEl===i){if(e.isConnected&&a(e))return w();if(e.isConnected&&f())return g();h(),delete e._x_undoIf}},{once:!0})))));e._x_currentIfEl=i,e._x_lastRenderedEl=i,e._x_undoIf=v,n.add(e),l||(i._x_ignore=!0,t.add(y))}function c(e,t){e.querySelectorAll("template").forEach(e=>{const n=t||e.matches("[x-if],[x-for]");n&&e.content.querySelectorAll("[data-pre-rendered]").forEach(e=>{e.tagName.startsWith("X-")&&e.removeAttribute("data-pre-rendered")}),c(e.content,n)})}function l(){try{!function(){if("undefined"==typeof document||!document.querySelector)return;const e=document.querySelector('meta[name="manifest:prerendered"]');if(!e||"0"===e.getAttribute("content"))return;const t=document.getElementById("__manifest_hydrate__");if(!t)return;let n;try{n=JSON.parse(t.textContent||"[]")}catch(e){n=[]}if(!Array.isArray(n)||0===n.length)return void t.remove();const i=e=>String(null==e?"":e).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=[];for(const e of n){const t=document.querySelector('[data-hydrate-id="'+e.id+'"]');if(!t)continue;let n=0;for(let e=t.parentNode;e;e=e.parentNode)n++;r.push({entry:e,el:t,depth:n})}r.sort((e,t)=>t.depth-e.depth);for(const{entry:e,el:t}of r){const n=document.querySelector('[data-hydrate-id="'+e.id+'"]')||t;if(!n||!n.parentNode)continue;if("string"==typeof e.html){const t=n.tagName.toLowerCase(),r={},a=n.attributes;for(let e=0;e<a.length;e++)"data-hydrate-id"!==a[e].name&&(r[a[e].name]=a[e].value);if(e.attrs)for(const t in e.attrs){const n=e.attrs[t];null===n?delete r[t]:r[t]=n}const s=Object.keys(r).map(e=>e+'="'+i(r[e])+'"').join(" "),c=o.has(t)?"<"+t+" "+s+">":"<"+t+" "+s+">"+e.html+"</"+t+">",l=document.createElement("div");l.innerHTML=c;const d=l.firstElementChild;if(d)try{n.parentNode.replaceChild(d,n)}catch(e){}continue}if(!e.attrs)continue;const r=n.tagName.toLowerCase(),a={},s=n.attributes;for(let e=0;e<s.length;e++)"data-hydrate-id"!==s[e].name&&(a[s[e].name]=s[e].value);for(const t in e.attrs){const n=e.attrs[t];null===n?delete a[t]:a[t]=n}const c=Object.keys(a).map(e=>e+'="'+i(a[e])+'"').join(" "),l=o.has(r),d=l?"":n.innerHTML,u=l?"<"+r+" "+c+">":"<"+r+" "+c+">"+d+"</"+r+">",f=document.createElement("div");f.innerHTML=u;const p=f.firstElementChild;if(p)try{n.parentNode.replaceChild(p,n)}catch(e){}}t.remove()}()}catch(e){}}if("undefined"!=typeof document&&document.addEventListener("alpine:init",function(){if("undefined"==typeof document||!document.querySelectorAll)return;c(document);let e=0;if(document.querySelectorAll("[data-mnfst-prerender-clone]").forEach(t=>{if(t.closest&&t.closest("[data-hydrate]"))return;t.removeAttribute("data-mnfst-prerender-clone");const n=t.previousElementSibling;n&&"TEMPLATE"===n.tagName&&n.hasAttribute("x-if")?(s(n,t),e++):t.remove()}),!e)return;const i=window.Alpine;"function"==typeof i.interceptInit&&i.interceptInit(e=>{n.has(e)&&t.size&&r()}),document.addEventListener("alpine:initialized",o,{once:!0})},{once:!0}),"undefined"!=typeof document)if("loading"===document.readyState){let nt=!1;document.addEventListener("readystatechange",()=>{nt||"loading"===document.readyState||(nt=!0,l())})}else l();if("undefined"!=typeof window&&"undefined"!=typeof document){let it=null;window.addEventListener("resize",()=>{document.documentElement.classList.add("window-resizing"),it&&clearTimeout(it),it=setTimeout(()=>{document.documentElement.classList.remove("window-resizing"),it=null},200)},{passive:!0})}const d="latest",u="0.5.334",f="sha384-bPSRgboL6vTFlnOH479ijw+2NeriwxjXXuLMwspVbslXBBEPWZm1zvT/CHzJsZRM",p="manifest.modules.integrity.json",m="manifest.vendor.integrity.json";let w=null,h=null,g=!1,y=null,v=d,b=["https://cdn.manifestx.dev/npm","https://cdn.jsdelivr.net/npm","https://unpkg.com"];function _(e,t){return e.includes("unpkg.com")?t.replace(/\.min\.js$/,".js"):t}function $(e=d,t=b[0]){return`${t}/mnfst@${e}/lib`}const k=["components","router","utilities","data","icons","localization","color","toasts","tooltips","dropdowns","computed","tabs","url-parameters","status"],E=["defer","bindings"],x=["edit"],S=["appwrite-auth","appwrite-data","appwrite-presences"],A=["rich-text","submissions","markdown","svg","code","combobox","slides","colorpicker","datepicker","charts","virtual","export"],L={"appwrite-data":["data"],"appwrite-presences":["data","appwrite-auth"],device:["utilities"],edit:["rich-text"]};let M=null;let P=[];function C(e,t=v){const n=e.replace(/-/g,".");if(M){return[`${M.replace(/\/$/,"")}/manifest.${n}.js`]}return b.map(e=>`${$(t,e)}/${_(e,`manifest.${n}.min.js`)}`)}function j(e,t=v){return C(e,t)[0]}function I(e){if(e&&(e.startsWith("http")||e.startsWith("/")))return[e];const t=e||"3.17.5";return b.map(e=>`${e}/alpinejs@${t}/dist/cdn.min.js`)}function N(e){if(function(){if("complete"===document.readyState)return!0;if("loading"===document.readyState)return!1;try{const e=performance.getEntriesByType("navigation")[0];if(e)return e.domContentLoadedEventEnd>0}catch(e){}return!1}())return void e();let t=!1;const n=()=>{t||(t=!0,e())};document.addEventListener("DOMContentLoaded",n,{once:!0}),window.addEventListener("load",n,{once:!0})}function R(t){if(t.hasAttribute("data-mnfst-loaded"))return!0;if(t.hasAttribute("data-mnfst-loading"))return!1;if("complete"===document.readyState)return!0;if(!t.async&&!t.defer&&e&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)return!0;try{if(t.src&&performance.getEntriesByName(t.src).length)return!0}catch(e){}return!1}function T(e,t,n=!0,i=null){return new Promise((o,r)=>{const a=document.querySelector(`script[src="${e}"]`);if(a){if(R(a))return o();let t=!1;const n=()=>{t||(t=!0,o())};a.addEventListener("load",n),a.addEventListener("error",()=>{t||(t=!0,r(new Error(`Failed to load ${e}`)))});const i=setInterval(()=>{R(a)&&(clearInterval(i),n())},50);return void setTimeout(()=>{clearInterval(i),n()},4e3)}const s=document.createElement("script");t&&(s.integrity=t,s.crossOrigin="anonymous"),i&&s.setAttribute("fetchpriority",i),s.src=e,s.async=!n,s.setAttribute("data-mnfst-loading",""),s.onload=()=>{s.removeAttribute("data-mnfst-loading"),s.setAttribute("data-mnfst-loaded",""),o()},s.onerror=()=>{s.removeAttribute("data-mnfst-loading"),s.remove(),r(new Error(`Failed to load ${e}`))},document.head.appendChild(s)})}function O(e){return e.split(/[?#]/)[0].split("/").pop()}function z(e){const t=e.match(/(alpinejs@[^/]+\/dist\/cdn\.min\.js)(?:[?#]|$)/);return t?t[1]:null}function q(e){try{const t=performance.getEntriesByName(new URL(e,location.href).href).pop();return!!t&&200===t.responseStatus}catch(e){return!1}}function W(e,t){if("warn"!==w)throw console.error(`[Manifest Loader] ${e} ${t} data-integrity="warn" loads it unchecked instead.`),Object.assign(new Error(e),{logged:!0});console.warn(`[Manifest Loader] ${e} Loading unchecked (data-integrity="warn").`)}async function D(e,t,n){for(const i of e){try{const e=await fetch(i,t?{integrity:t,mode:"cors",credentials:"omit"}:{mode:"cors",credentials:"omit"});if(e.ok)return e}catch(e){}console.error(`[Manifest Loader] ${n} failed to load${t?" or failed its integrity check":""} from ${i}`)}throw new Error(`${n} could not be ${t?"verified":"loaded"} from any CDN${t?` (expected ${t})`:""}.`)}let U=null;const B=/^sha(256|384|512)-[A-Za-z0-9+/=]+$/;function F(e,t){const n=e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:null;return"string"==typeof n&&B.test(n)?n:null}async function H(e,t){const n=F(e,t);if(n)return n;const i=F(e,m);return i&&/\/(languages|langs)\//.test(t)?(U||(U=D(b.map(e=>`${$(u,e)}/${m}`),i,m).then(e=>e.json()).catch(e=>{throw U=null,e})),F(await U,t)):null}async function V(e,{key:t=null,hash:n=null,alpine:i=!1,unchecked:o=!1,ordered:r=!0,priority:a=null}={}){const s=h&&!o?await h:null,c=t||O(e[0]||"");let l=null;for(const o of e){let c=n;if(s){const e=t||(i?z(o):O(o));c=e&&await H(s,e)||(i?y:null),c||(i?W(`No integrity hash is known for Alpine at ${o}. Add data-alpine-integrity="sha384-…" for it, or remove data-alpine to use the default.`,"Alpine was not loaded."):W(`${e||o} has no integrity hash in this release.`,"Not loaded."))}try{return await T(o,c,r,a)}catch(t){l=t,c?console.error(`[Manifest Loader] ${O(o)} ${q(o)?"failed its integrity check":"failed to load or failed its integrity check"} from ${o}${e.length>1?" — trying next CDN":""}`):e.length>1&&console.warn(`[Manifest Loader] ${o} failed — trying fallback CDN`)}}throw s&&console.error(`[Manifest Loader] ${c} did not match its integrity hash on any CDN — not loaded.`),l||new Error(`Failed to load ${c}`)}const Z=new Map,J=new Set;async function X(e,t=v){const n=Z.get(e);if(n)return n.version!==t&&console.warn(`[Manifest Loader] ${e} already loaded at ${n.version} — ignoring request for ${t}`),n.promise;const i=async function(e,t){let n=!1;g&&t!==u&&(W(`Integrity checks cover this loader's own version (${u}); ${e} was requested at ${t}.`,"Not loaded."),n=!0);const i=["components","data","localization"].includes(e)?"high":null;return V(C(e,t),{unchecked:n,priority:i})}(e,t);return Z.set(e,{version:t,promise:i}),i.then(()=>J.add(e),()=>Z.delete(e)),i}function G(e){const t=[],n=new Set,i={native:"device",import:"export"};function o(e){if(e=i[e]||e,n.has(e))return;const r=L[e];if(r)for(const e of r)n.has(e)||o(e);t.push(e),n.add(e)}for(const t of e)o(t);return t}const K=[{magic:"$chat",plugin:"chat"},{magic:"$presence",plugin:"appwrite-presences"},{magic:"$rich",plugin:"rich-text",attr:"x-rich-text",family:!0},{plugin:"submissions",attr:"x-submit",family:!0},...["$share","$secure","$links","$push","$app","$haptics","$biometric","$camera"].map(e=>({magic:e,plugin:"device"})),{plugin:"charts",attr:"x-chart",magic:"$chart",present:"ensureChartsPluginInitialized"},{plugin:"colorpicker",attr:"x-colorpicker",magic:"$colorpicker",present:"ensureColorpickerPluginInitialized"},{plugin:"datepicker",attr:"x-date",magic:"$date",present:"ensureDatepickerPluginInitialized"},{plugin:"combobox",attr:"x-combobox",present:"ensureComboboxPluginInitialized"},{plugin:"code",attr:"x-code",present:"ensureCodePluginInitialized"},{plugin:"code",attr:"x-code-group",present:"ensureCodePluginInitialized"},{plugin:"markdown",attr:"x-markdown",present:"ensureMarkdownPluginInitialized"},{plugin:"export",attr:"x-export",magic:"$export",present:"ensureExportPluginInitialized",call:!0},{plugin:"export",attr:"x-import",magic:"$import",present:"ensureImportPluginInitialized",call:!0},{plugin:"virtual",attr:"x-virtual",present:"ensureVirtualPluginInitialized"},{plugin:"slides",attr:"x-carousel",present:"ensureSlidesPluginInitialized"},{plugin:"svg",attr:"x-svg",present:"ensureSvgPluginInitialized"}].map(e=>({...e,late:A.includes(e.plugin)&&!["rich-text","submissions"].includes(e.plugin),re:e.magic?new RegExp("\\"+e.magic+"\\b"):null})),Q=[...new Set(K.map(e=>e.plugin))],Y=new Map(K.filter(e=>e.attr).map(e=>[e.attr,e])),ee=K.filter(e=>e.family).map(e=>[e.attr+"-",e]),te=e=>{const t=ne(e);return t&&t.plugin};function ne(e){if(120!==e.charCodeAt(0)||45!==e.charCodeAt(1))return;let t=e.length;for(let n=2;n<t;n++){const i=e.charCodeAt(n);if(46===i||58===i){t=n;break}}const n=t===e.length?e:e.slice(0,t),i=Y.get(n);if(i)return i;for(const[e,t]of ee)if(n.startsWith(e))return t}let ie=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||ie)return;ie=!0;const e=()=>{const e=window.Alpine;if(window.ManifestRichText||!e||!e.magic||!e.reactive||window.__manifestRichStub)return;const t=window.__manifestRichStub=e.reactive({v:0}),n=window.__manifestRichStubWrites=[],i=new WeakMap,o=e=>e&&"function"==typeof e.deref?e.deref():e,r={value:"",link:"",selection:null,all:{},active:()=>!1,can:()=>!1,markdown:()=>"",html:()=>""};e.magic("rich",(e,a)=>(t.v,window.__manifestRichMagic?window.__manifestRichMagic(e,a):(e=>(i.has(e)||i.set(e,new Proxy(r,{get:(t,i)=>{const r=n.find(t=>o(t[0])===e&&t[1]===i);return r?r[2]:i in t?t[i]:"string"==typeof i?()=>{}:void 0},set:(t,i,r)=>{for(let t=n.length-1;t>=0;t--){const r=o(n[t][0]);r&&r.isConnected&&(r!==e||n[t][1]!==i)||n.splice(t,1)}return n.push(["function"==typeof WeakRef?new WeakRef(e):e,i,r]),!0}})),i.get(e)))(e)))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}();let oe=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||oe)return;oe=!0;const e=()=>{const e=window.Alpine;if(window.__manifestEditMagic||!e||!e.magic||!e.reactive||window.__manifestEditStub)return;const t=window.__manifestEditStub=e.reactive({v:0}),n=()=>!1,i=window.__manifestEditStubWrites={},o=new Proxy({active:!1,canUndo:!1,canRedo:!1,version:0,stale:[],conflicts:[],onPublish:null,target:null,can:n,scope:()=>null,block:()=>null,patches:()=>[],export:()=>({log:[],cursor:0}),publish:()=>Promise.resolve({results:[]}),undo:()=>Promise.resolve(!1),redo:()=>Promise.resolve(!1),classes:new Proxy({},{get:()=>n})},{get:(e,t)=>t in i?i[t]:t in e?e[t]:"string"==typeof t?n:void 0,set:(e,t,n)=>(i[t]=n,!0)});e.magic("edit",(e,n)=>(t.v,window.__manifestEditMagic?window.__manifestEditMagic(e,n):o))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}(),"undefined"!=typeof document&&document.addEventListener("alpine:initialized",()=>{window.__manifestAlpineStarted=!0},{once:!0});const re=K.filter(e=>e.late),ae=re.filter(e=>e.attr).map(e=>e.attr),se="undefined"==typeof window?[]:re.filter(e=>window[e.present]).map(e=>e.plugin),ce=new Set,le=new Map,de=new Map,ue=new Set,fe=e=>{const t=ne(e);return t&&t.late&&!se.includes(t.plugin)?t:null},pe=new Set;function me(e){if(Ce.has(e)||pe.has(e))return null;if(!Z.has(e)){if(!Pe||P.includes(e))return null;Ne(G([e]).filter(e=>!je(e)))}const t=Z.get(e);return t?t.promise:null}const we=new WeakSet;let he=0,ge=null;const ye=["markdown","code","svg"];function ve(e,t,n){const i=me(n.plugin);if(!i)return!1;const o=n.attr.slice(2);we.add(t),!he++&&window.ManifestPending&&(ge=window.ManifestPending.hold("held"));let r=!1;const a=()=>{if(!r&&(r=!0,we.delete(t),! --he&&ge)){const e=ge;ge=null,e()}},s=[];let c=null;try{const e=!t.hasAttribute("x-data")&&t.parentElement&&t.parentElement.closest("[x-data]");if(e){e._x_refs||(e._x_refs={});for(const n of[t,...t.querySelectorAll("[x-ref]")]){const t=n.getAttribute("x-ref");!t||n.closest("[x-data]")!==e||e._x_refs[t]&&!s.some(n=>n[2]===e._x_refs[t])||(e._x_refs[t]=n,s.push([e,t,n]))}}c=ye.includes(n.plugin)?t.style.opacity:null,null!==c&&(t.style.opacity="0")}catch(e){}const l=new Promise(e=>{let t=!1;(e=>{if(ce.has(e))return Promise.resolve();if(!le.has(e)){let t;const n=new Promise(e=>{t=e});le.set(e,{promise:n,resolve:t})}return le.get(e).promise})(o).then(()=>{t=!0,e()});const r=i=>{t||(pe.add(n.plugin),ue.has(n.plugin)||(ue.add(n.plugin),console.warn(`[Manifest Loader] ${n.plugin} ${i}: starting the elements that use it now${"failed to load"===i?", without it":"; it applies to them if it starts later"}.`)),e())};i.catch(()=>r("failed to load")),i.then(()=>setTimeout(()=>r("has not started 10 s after loading"),1e4),()=>{})}),d=l.then(()=>{let e=null;try{we.delete(t),null!==c&&(t.style.opacity=c);for(const[e,t,n]of s)!n.isConnected&&e._x_refs&&e._x_refs[t]===n&&delete e._x_refs[t];e=function(e){const t=[],n=e.matches("input, textarea, select")?[e]:[];n.push(...e.querySelectorAll("input, textarea, select"));for(const e of n)try{if("file"===e.type){e.files&&e.files.length&&t.push([e,"files",null]);continue}if("radio"===e.type)e.checked&&!e.defaultChecked&&t.push([e,"checked",!0]);else if("checkbox"===e.type)e.checked!==e.defaultChecked&&t.push([e,"checked",e.checked]);else if("SELECT"===e.tagName){const n=[...e.options].map(e=>e.selected);n.some((t,n)=>t!==e.options[n].defaultSelected)&&t.push([e,"options",n])}else e.value!==e.defaultValue&&t.push([e,"value",e.value])}catch(e){}const i=document.activeElement,o=i&&e.contains(i)?[i,i.selectionStart,i.selectionEnd]:null;return()=>{const n=new WeakSet,i=e=>{n.has(e)&&e.stopPropagation()};e.addEventListener("input",i),e.addEventListener("change",i);const r=(e,t)=>{const i=new Event(t,{bubbles:!0});n.add(i),e.dispatchEvent(i)};for(const[e,n,i]of t)try{if(!e.isConnected||e.readOnly||e.disabled)continue;"options"===n?[...e.options].forEach((e,t)=>{e.selected=!!i[t]}):"files"!==n&&(e[n]=i),r(e,"input"),r(e,"change")}catch(e){}if(e.removeEventListener("input",i),e.removeEventListener("change",i),o&&o[0].isConnected)try{o[0].focus({preventScroll:!0}),null!=o[1]&&o[0].setSelectionRange(o[1],o[2])}catch(e){}}}(t)}catch(e){}setTimeout(()=>{try{e&&e()}finally{a()}},0)});try{e.deferInit(t,d)}catch(e){throw a(),e}return!0}let be=!1;function _e(){const e="undefined"==typeof window?null:window.Alpine;if(be||!e||!e.directive||!e.magic)return;be=!0;const t=e.directive,n=e.magic;if(e.directive=function(e){const n=t.apply(this,arguments);if(!ce.has(e)){ce.add(e);const t=le.get(e);t&&(le.delete(e),t.resolve());const n=de.get(e);n&&(de.delete(e),setTimeout(()=>n.forEach(([e,t])=>{const n=$e(e);try{n&&n.isConnected&&n.hasAttribute(t)&&n.setAttribute(t,n.getAttribute(t))}catch(e){}}),0))}return n},"function"==typeof e.interceptInit){const t="function"==typeof e.deferInit,n=e=>{try{i(e)}catch(e){}},i=n=>{if(!we.has(n))for(const i of n.attributes){const o=fe(i.name);if(o&&!ce.has(o.attr.slice(2)))if(pe.has(o.plugin))ke(o,n,i.name);else if(t){if(ve(e,n,o))return}else me(o.plugin)&&ke(o,n,i.name)}};e.interceptInit("function"==typeof e.skipDuringClone?e.skipDuringClone(n):n)}!function(e,t){const n={},i=e.reactive?e.reactive({v:0}):{v:0},o=t=>{window.__manifestProbing=!0;try{return"undefined"!==e.evaluate(document.createElement("div"),`typeof $${t}`)}catch(e){return!1}finally{window.__manifestProbing=!1}},r=(e,t)=>new Proxy(function(){},{get(n,i){const o=e();if(null!=o){const e=o[i];return"function"==typeof e&&"constructor"!==i?e.bind(o):e}return i===Symbol.toPrimitive?()=>"":"symbol"!=typeof i&&"then"!==i?r(()=>{const t=e();return null==t?void 0:t[i]},t):void 0},apply(n,i,o){const a=e();if("function"==typeof a)return a.apply(i,o);if(t)return t().then(()=>{const t=e();return"function"==typeof t?t.apply(i,o):void 0});let s,c=!1;return r(()=>{if(c)return s;const t=e();return"function"==typeof t?(c=!0,s=t.apply(i,o)):void 0},t)}});for(const a of re){if(!a.magic||se.includes(a.plugin)||J.has(a.plugin))continue;const s=a.magic.slice(1);if(o(s))continue;let c=!1;const l=()=>new Promise(e=>{if(n[s])return e();const t=me(a.plugin);if(!t)return e();const i=()=>n[s]?e():null;t.then(()=>setTimeout(()=>{i(),setTimeout(e,0)},0),e)});t.call(e,s,(e,t)=>{if(i.v,n[s])return n[s](e,t);if(!(c||window.__manifestProbing||(c=!0,me(a.plugin)||ue.has(s)||ue.has(a.plugin)))){ue.add(s);const e=P.includes(a.plugin)?`remove ${a.plugin} from data-omit`:`add data-modules="+${a.plugin}"`;console.warn(`[Manifest Loader] ${a.magic} is used but ${a.plugin} is not loaded on this page: ${e}.`)}const o=a.call?"$import"!==a.magic?l:()=>l().then(()=>{const e=navigator.userActivation;!e||e.isActive||ue.has("$import:activation")||(ue.add("$import:activation"),console.warn('[Manifest Loader] $import waited for its module and the click that called it expired, so the browser may not open the file picker. Add data-modules="+import" to load it with the page.'))}):null;return r(()=>n[s]?n[s](e,t):void 0,o)})}e.magic=function(e,o){return re.some(t=>t.magic==="$"+e)&&(n[e]=o,setTimeout(()=>{i.v++},0)),t.apply(this,arguments)}}(e,n)}const $e=e=>e&&"function"==typeof e.deref?e.deref():e;function ke(e,t,n){const i=e.attr.slice(2);if(ce.has(i))return;de.has(i)||de.set(i,[]);const o=de.get(i).filter(([e])=>$e(e));o.push(["function"==typeof WeakRef?new WeakRef(t):t,n]),de.set(i,o)}"undefined"!=typeof document&&(document.addEventListener("alpine:init",_e,{once:!0}),"undefined"!=typeof window&&window.Alpine&&window.Alpine.magic&&_e()),"undefined"!=typeof window&&(window.__manifestHeld=e=>{if(!he)return!1;for(let t=e;t;t=t.parentElement)if(we.has(t))return!0;return!1});const Ee=/^x-(code|code-group)$/,xe=new RegExp("\\$("+K.filter(e=>e.magic).map(e=>e.magic.slice(1)).join("|")+")\\b"),Se=new Set;function Ae(e,t=("undefined"==typeof document?null:document)){const n=K.filter(t=>!e.includes(t.plugin)),i=!e.includes("components");if(0===n.length&&!i||!t)return[];const o=new Set,r=new Set(n.map(e=>e.plugin)),a=r.size+(i?1:0),s=()=>o.size===a,c=e=>{e&&r.has(e)&&!o.has(e)&&o.add(e)},l=r.has("code");for(const e of t.querySelectorAll("script:not([src])")){const t=e.textContent||"";for(const e of n)e.re&&!o.has(e.plugin)&&e.re.test(t)&&o.add(e.plugin);if(s())return[...o]}const d=e=>{if(i&&!o.has("components")){const t=e.tagName.toLowerCase();t.startsWith("x-")&&!Ee.test(t)&&o.add("components")}l&&c(function(e){if("CODE"!==e.tagName)return;if(e.hasAttribute("copy"))return"code";const t=e.getAttribute("class");return t&&-1!==t.indexOf("language-")&&e.parentElement&&"PRE"===e.parentElement.tagName?"code":void 0}(e));for(const t of e.attributes||[]){c(te(t.name));const e=t.value;if(e&&-1!==e.indexOf("$")&&!Se.has(e))if(xe.test(e))for(const t of n)t.re&&!o.has(t.plugin)&&t.re.test(e)&&o.add(t.plugin);else Se.size>2e4&&Se.clear(),Se.add(e)}},u=e=>{for(const t of e.querySelectorAll("*")){if(d(t),s())return;if("TEMPLATE"===t.tagName&&t.content&&(u(t.content),s()))return}};return 1===t.nodeType&&(d(t),"TEMPLATE"===t.tagName&&t.content&&u(t.content)),s()||u(t),[...o]}let Le=null;function Me(){if(Le)return Le;const e=new Set,t="undefined"==typeof MutationObserver?null:new MutationObserver(t=>{for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&e.add(t)});t&&t.observe(document.documentElement,{childList:!0,subtree:!0});const n=Ae([]);return Le={used:n,take(){t&&t.disconnect();const i=new Set(n);for(const t of e)t.isConnected&&Ae([...i],t).forEach(e=>i.add(e));return e.clear(),[...i]}},Le}let Pe=!1;const Ce=new Set,je=e=>J.has(e)||Ce.has(e);function Ie(e,t=v){if(!Pe||!e||"undefined"==typeof document)return Promise.resolve([]);let n=e;if("string"==typeof e){if(-1===e.indexOf("x-")&&-1===e.indexOf("$")&&-1===e.indexOf("<code"))return Promise.resolve([]);n=document.createElement("template"),n.innerHTML=e,n=n.content}const i=Ae(Q.filter(je).concat("components",P),n);return i.length?Ne(G(i).filter(e=>!je(e)),t):Promise.resolve([])}function Ne(e,t=v){if(!e.length)return Promise.resolve([]);const n=window.ManifestPending?window.ManifestPending.hold("module"):()=>{};return Promise.all(e.map(e=>X(e,t).catch(t=>{Ce.has(e)||(Ce.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t))}))).then(()=>new Promise(e=>setTimeout(e,0))).then(()=>(n(),e))}function Re(e){if("undefined"==typeof MutationObserver)return;const t=new Set;let n=!1;const i=new MutationObserver(o=>{for(const e of o)if("attributes"!==e.type)for(const n of e.addedNodes)1===n.nodeType&&t.add(n);else Te(e.target,e.attributeName);!n&&t.size&&(n=!0,setTimeout(()=>{n=!1;const o=[...t].filter(e=>e.isConnected);t.clear(),o.forEach(t=>Ie(t,e)),K.every(e=>je(e.plugin)||P.includes(e.plugin))&&i.disconnect()},0))});i.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:ae})}function Te(e,t){const n=fe(t);n&&e.hasAttribute(t)&&!ce.has(n.attr.slice(2))&&!window.__manifestHeld(e)&&me(n.plugin)&&ke(n,e,t)}const Oe={"text-edit":"rich-text"};function ze(e){return e.filter(e=>{const t=e.replace(/^\+/,"");return!Oe[t]||(console.warn(`[Manifest Loader] ${t} was renamed to ${Oe[t]}`),!1)})}function qe(){try{return!!document.querySelector("style[data-mnfst-utilities][data-mnfst-utilities-complete]")}catch(e){return!1}}const We="tailwind-engine-cache:v2",De=6048e5;function Ue(){return Array.from(document.querySelectorAll('style[type="text/tailwindcss"]:not(#manifest-tailwind-variants)'),e=>e.textContent)}function Be(e,t){const n=[e,...t].join("\0");let i=2166136261;for(let e=0;e<n.length;e++)i=Math.imul(i^n.charCodeAt(e),16777619);return(i>>>0).toString(36)}function Fe(e){const t=document.getElementById("manifest-styles");document.head.insertBefore(e,t&&t.parentNode===document.head?t:null)}const He=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e);async function Ve(e=v){const t=b.map(t=>`${$(e,t)}/${_(t,"manifest.tailwind.min.js")}`);let n=null;try{return await V(t)}catch(e){n=e}throw console.warn('[Manifest Loader] Tailwind plugin not available from any CDN. Load it directly: <script src="/scripts/tailwind.v4.3.1.js"><\/script>'),n||new Error("Tailwind plugin not available from CDN.")}window.Manifest={loadPlugin:function(e,t=v){if(![...k,...A,...S,...x,"payments","chat","device","native","import","tailwind"].includes(e))return Oe[e]?ze([e]):console.warn(`[Manifest Loader] Unknown module: ${e}`),Promise.reject(new Error(`Unknown module: ${e}`));const n=G([e]);return Promise.all(n.map(e=>X(e,t)))},loadTailwind:Ve,loadVendor:function(e,t){return V(b.map(t=>`${t}/${e}`),{key:e,hash:t,ordered:!1})},fetchVendor:async function(e,t){const n=h?await h:null;let i=t||null;return n&&(i=await H(n,e),i||W(`${e} has no integrity hash in this release.`,"Not loaded.")),D(b.map(t=>`${t}/${e}`),i,e)},get integrity(){return g},getPluginUrl:j,getModuleUrl:j,loadUsed:Ie},window.Manifest.loadModule=window.Manifest.loadPlugin;const Ze="/sw.js";const Je={registered:!1,version:null,kill:()=>Ge(null)};function Xe(e){const t=String(e||"").toLowerCase();return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t||"0.0.0.0"===t||t.endsWith(".localhost")||t.endsWith(".local")}async function Ge(e){Je.registered=!1;try{const t=e||await navigator.serviceWorker.getRegistration(Ze);if(t){const e=t.active||t.waiting||t.installing;try{e&&e.postMessage({type:"manifest:sw",action:"kill"})}catch(e){}await t.unregister()}}catch(e){}try{if(window.caches){const e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith("mnfst-sw:")).map(e=>caches.delete(e)))}}catch(e){}}async function Ke(e){const t=e.sw,n="on"===t,i=n?(...e)=>console.info("[Manifest SW]",...e):()=>{};if(!navigator.serviceWorker)return i("skip: unsupported");const o=window.location,r=!!window.__mnfstRun,a=Xe(o.hostname);let s=window.__manifestLoaded||null;if(!s&&window.__manifestPromise&&(s=await window.__manifestPromise.catch(()=>null)),!s){const e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json";s=await fetch(e).then(e=>e.ok?e.json():null).catch(()=>null)}const c="off"===t||s&&!1===s.sw,l=await navigator.serviceWorker.getRegistration(Ze).catch(()=>null);if(c||r||a&&!n)return i("skip:",c?"kill switch":r?"mnfst-run":"dev origin",l?"(unregistering)":""),void await Ge(l);if(!("https:"===o.protocol||n&&window.isSecureContext))return i("skip: not https");let d=null;try{d=sessionStorage.getItem("manifest:sw-probe")}catch(e){}const u="strict"===w;if("ok"!==d||u){const e=await fetch(Ze,{cache:"no-store"}).catch(()=>null),t=e&&e.headers.get("content-type")||"";if(!e||!e.ok||!/javascript|ecmascript/i.test(t))return i("skip: no stub",e&&e.status,t);if(u&&(f=await e.text().catch(()=>""),(String(f).match(/importScripts\s*\(([^)]*)\)/g)||[]).some(e=>(e.match(/https?:\/\/[^'"`\s)]+/g)||[]).some(e=>{try{return new URL(e).origin!==location.origin}catch(e){return!0}}))))return console.warn(`[Manifest Loader] ${Ze} imports its worker module from another origin, which integrity checks can't cover, so the service worker stays off. Serve the module from this origin (copy lib/manifest.sw.min.js into ${Ze}), set data-sw="off", or set data-integrity="warn" to register it anyway.`),void await Ge(l);try{sessionStorage.setItem("manifest:sw-probe","ok")}catch(e){}}var f;const p=s&&"string"==typeof s.deployment?s.deployment:"",m=`${Ze}?v=${encodeURIComponent(e.version)}&d=${encodeURIComponent(p)}`,h=await navigator.serviceWorker.register(m,{scope:"/"});Je.registered=!0,Je.version=e.version,i("registered",m,h.active?"active":h.installing?"installing":"waiting")}window.Manifest.swStub=function(e=d){const t=`mnfst@${String(e||d).replace(/[^\w.+-]/g,"")}/lib/manifest.sw.min.js`;return`try { importScripts('https://cdn.manifestx.dev/npm/${t}'); } catch (e) { importScripts('https://cdn.jsdelivr.net/npm/${t}'); }\nif (!self.__mnfstSw) self.addEventListener('activate', function () { self.registration.unregister(); });\n`},window.Manifest.sw=Je;const Qe=function(){let e=document.currentScript;if(e||(e=document.querySelector('script[src*="manifest.js"]')),!e)return null;const t=e.getAttribute("data-modules")??e.getAttribute("data-plugins"),n=e.getAttribute("data-omit"),i=null!==e.getAttribute("data-tailwind"),o="cache"===e.getAttribute("data-tailwind"),r=e.getAttribute("data-version")||d,a=!!e.getAttribute("data-version"),s=e.getAttribute("data-alpine"),c=(e.getAttribute("data-integrity")??"").trim().toLowerCase(),l=/^(off|false)$/.test(c)?null:"warn"===c?"warn":e.hasAttribute("data-integrity")||e.getAttribute("integrity")?"strict":null,u=e.getAttribute("data-module-base")??e.getAttribute("data-plugin-base"),f=e.getAttribute("data-cdn"),p=e.getAttribute("data-sw");let m=[],w=[],h=!t;if(t){const e=ze(t.split(",").map(e=>e.trim()).filter(e=>e));w=e.filter(e=>e.startsWith("+")).map(e=>e.slice(1));const n=e.filter(e=>!e.startsWith("+"));n.length>0?m=[...n,...w]:(h=!0,m=k.slice())}else m=k.slice();const g={native:"device","text-edit":"rich-text"},y=n?n.split(",").map(e=>e.trim().toLowerCase()).map(e=>g[e]||e).filter(e=>e&&!E.includes(e)):[];return y.length>0&&m.length>0&&(m=m.filter(e=>!y.includes(e))),m=G(m),{plugins:m,extraPlugins:w,omitted:y,deriveFromManifest:h,tailwind:i,tailwindCache:o,version:r,versionSet:a,alpine:s,alpineIntegrity:e.getAttribute("data-alpine-integrity"),integrity:l,pluginBase:u,cdn:f,sw:p}}();var Ye;if(Qe&&Qe.version&&(v=Qe.version),Qe&&Qe.pluginBase&&(Ye=Qe.pluginBase,M=Ye||null),Qe&&Qe.omitted&&(P=Qe.omitted),Qe&&Qe.cdn&&function(e){if(!e)return;const t=e.split(",").map(e=>e.trim().replace(/\/$/,"")).filter(Boolean);t.length&&(b=t)}(Qe.cdn),Qe&&Qe.integrity&&(w=Qe.integrity,!Qe.versionSet&&f&&(v=Qe.version=u),g=Qe.version===u,y=Qe.alpineIntegrity&&B.test(Qe.alpineIntegrity.trim())?Qe.alpineIntegrity.trim():null,h=async function(e){if(e.version!==u)return W(`Integrity checks cover this loader's own version (${u}), but data-version is "${e.version}". Set data-version="${u}" or remove it.`,"No modules were loaded."),null;const t=M?[`${M.replace(/\/$/,"")}/${p}`]:b.map(e=>`${$(u,e)}/${p}`);try{return await(await D(t,f,p)).json()}catch(e){throw new Error(`${e.message} No modules were loaded.`)}}(Qe),h.catch(()=>{})),function(e){if(!e||window.__manifestSwArmed)return;const t=window.__manifestSwArmed={};let n=!1;const i=()=>{if(!n&&window.__manifestSwArmed===t){n=!0;try{Ke(e).catch(()=>{})}catch(e){}}};setTimeout(()=>{if(window.__manifestReady)return i();window.addEventListener("manifest:ready",i,{once:!0}),window.__manifestLoaderStarted||("complete"===document.readyState?setTimeout(i,0):window.addEventListener("load",i,{once:!0}))},0)}(Qe),Qe&&Qe.plugins.length>0){if(window.__manifestLoaderStarted)return;window.__manifestLoaderStarted=!0;const ot=["data","localization","components","appwrite-auth","appwrite-data","appwrite-presences","payments","chat"],rt=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json",at=new Set,st=e=>{if(null===e||"object"!=typeof e)return;const t=e=>e.replace(/\$\{([^}]+)\}/g,(e,t)=>"undefined"!=typeof window&&window.env&&void 0!==window.env[t]?window.env[t]:(at.has(t)||(at.add(t),t.startsWith("PUBLIC_")?console.warn(`[Manifest] manifest.json references \${${t}}, but it is not present in window.env. Add ${t}=… to .env (read by mnfst-run) or set it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`):console.warn(`[Manifest] manifest.json references \${${t}}, but only PUBLIC_-prefixed env vars are injected into window.env by mnfst-run. Rename to PUBLIC_${t}, hardcode the value, or supply it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`)),e)),n=e=>{if(Array.isArray(e))for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}else for(const i of Object.keys(e)){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}};n(e)},ct=()=>window.__manifestLoaded?Promise.resolve(window.__manifestLoaded):(window.__manifestPromise||(window.__manifestPromise=fetch(rt).then(e=>e.ok?e.json():null).then(e=>(e&&!e.__interpolated&&(st(e),Object.defineProperty(e,"__interpolated",{value:!0,enumerable:!1})),e)).catch(()=>null)),window.__manifestPromise),lt=()=>{if(h||!document.head||!0===window.__manifestRender)return;const e=new Set,t=(t,n,i)=>{if(!n||e.has(t+n))return;e.add(t+n);const o=document.createElement("link");o.rel=t,i&&(o.as=i,o.setAttribute("fetchpriority","low")),o.href=n,o.setAttribute("data-mnfst-hint",""),document.head.appendChild(o)};document.addEventListener("alpine:init",()=>{document.head.querySelectorAll("link[data-mnfst-hint]").forEach(e=>e.remove())},{once:!0});try{(Qe.deriveFromManifest||Qe.plugins.some(e=>ot.includes(e)))&&ct();const e=M?null:b[0];if(e&&new URL(e,location.href).origin!==location.origin&&t("preconnect",new URL(e,location.href).origin),Qe.deriveFromManifest){const e=["data","localization","components","status"];for(const n of[...E,...Qe.plugins])e.includes(n)||t("preload",j(n,Qe.version),"script")}N(()=>{try{if(window.Alpine||document.querySelector('script[src*="alpinejs"]')||t("preload",I(Qe.alpine)[0],"script"),Qe.deriveFromManifest){const e=Me().used.filter(e=>"components"!==e&&!P.includes(e));for(const n of G(e))Qe.plugins.includes(n)||t("preload",j(n,Qe.version),"script")}}catch(e){}})}catch(e){}},dt=async()=>{if(h){(Qe.deriveFromManifest||Qe.plugins.some(e=>ot.includes(e)))&&ct();try{await h}catch(e){return void(e.logged||console.error(`[Manifest Loader] ${e.message}`))}}let e=null,t=Qe.plugins,n=null;if(Qe.deriveFromManifest){e=await ct();const n=function(e){if(!e||"object"!=typeof e)return k.slice();const t=e.data&&"object"==typeof e.data&&Object.keys(e.data).length>0,n=e.components?.length>0||e.preloadedComponents?.length>0,i=(()=>{if(!e.data||"object"!=typeof e.data)return!1;for(const t of Object.values(e.data))if(t&&"object"==typeof t){if("string"==typeof t.locales)return!0;for(const e of Object.keys(t))if(!["url","headers","params","transform","defaultValue","locales"].includes(e)&&/^[a-zA-Z]{2}(-[a-zA-Z]{2})?$/.test(e))return!0}return!1})(),o=e.status&&"object"==typeof e.status&&Object.keys(e.status).length>0;return k.filter(e=>"data"===e?t:"localization"===e?i:"components"===e?n:"status"!==e||o)}(e),o=function(e){if(!e||"object"!=typeof e)return[];if(!(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&(e.appwriteTableId||e.appwriteDatabaseId||e.appwriteBucketId))))return[];const t=[];return e.appwrite?.auth&&t.push("appwrite-auth"),(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&e.appwriteTableId))&&t.push("appwrite-data"),(e.appwrite?.presence||e.appwrite?.presences)&&t.push("appwrite-presences"),t}(e),r=function(e){return e&&"object"==typeof e&&e.payments&&"object"==typeof e.payments?["payments"]:[]}(e),a=function(e){return e&&"object"==typeof e&&(e.ai||e.chat)?["chat"]:[]}(e),s=function(e){if("undefined"!=typeof window&&window.Capacitor)return["device"];const t=e&&"object"==typeof e?e.device??e.native:null;return t&&"object"==typeof t?["device"]:[]}(e);t=G([...E,...(i=[...n,...o,...r,...a,...s,...Qe.extraPlugins||[]],P.length?i.filter(e=>!P.includes(e)):i)])}else{t=G([...E,...t.filter(e=>!E.includes(e))]);Qe.plugins.some(e=>ot.includes(e))&&(n=ct()),"undefined"!=typeof window&&window.Capacitor&&!t.includes("device")&&(t=G([...t,"device"]))}var i;const o=t.map(e=>X(e,Qe.version).catch(t=>{console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)}));Qe.tailwind&&!qe()&&o.push(Qe.tailwindCache?ft.then(e=>e?null:Ve(Qe.version)).catch(()=>{}):Ve(Qe.version).catch(()=>{}));const r=Qe.deriveFromManifest?new Promise(e=>N(()=>{let n=[];try{const e=Me().take(),i=e.filter(e=>P.includes(e)&&!t.includes(e));i.forEach(e=>ue.add(e)),i.length&&console.warn(`[Manifest Loader] data-omit lists ${i.join(", ")}, but this page uses ${i.length>1?"them":"it"}. Not loaded: remove ${i.length>1?"them":"it"} from data-omit to load.`);const o=e.filter(e=>!t.includes(e)&&!P.includes(e));o.length>0&&(n=G(o).filter(e=>!t.includes(e)).map(e=>X(e,Qe.version).catch(t=>{Ce.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)})))}catch(e){}Pe=!0,Re(Qe.version),e(Promise.all(n))})):null;await Promise.all(o),function(e){const t=window.__tailwindCache;if(!t||!t.style||!t.style.isConnected)return;if(!t.armed)return void(t.load=Ve(e).catch(()=>{}));let n=t.style.nextElementSibling;const i=e=>"style"===e.localName&&"manifest-styles"!==e.id&&"text/tailwindcss"!==e.getAttribute("type")||"link"===e.localName&&/\bstylesheet\b/i.test(e.rel);for(;n&&!i(n);)n=n.nextElementSibling;n&&Fe(t.style)}(Qe.version),n&&(e=await n),e&&"undefined"!=typeof window&&(window.__manifestLoaded=e,window.ManifestComponentsRegistry&&(window.ManifestComponentsRegistry.manifest=e)),N(async()=>{var e;r&&await r,ut(t,Qe.tailwind),e=I(Qe.alpine),N(()=>{window.Alpine||document.querySelector('script[src*="alpinejs"]')||V(e,{alpine:!0}).catch(e=>{e.logged||console.error("[Manifest Loader] Alpine.js failed to load from all CDNs.")})})})};function ut(e,t){if(window.__manifestReadyCoordinator)return;window.__manifestReadyCoordinator=!0;const n=window.ManifestPending.hold("ready"),i=!!t,o={data:!e.some(e=>"data"===e||"appwrite-data"===e)||!!window.__manifestRenderReady,utilities:!i||!!window.__manifestUtilitiesReady};let r=!1,a=null;const s=()=>!(window.__manifestMarkdownPending>0),c=()=>!(window.__manifestUtilitiesPending>0),l=()=>{r||(r=!0,n(),window.__manifestReady=!0,window.dispatchEvent(new CustomEvent("manifest:ready")))},d=()=>{r||o.data&&o.utilities&&s()&&c()&&(clearTimeout(a),a=setTimeout(()=>{o.data&&o.utilities&&s()&&c()&&l()},300))};window.addEventListener("manifest:render-ready",()=>{o.data=!0,d()}),window.addEventListener("manifest:utilities-ready",()=>{o.utilities=!0,d()}),window.addEventListener("manifest:utilities-idle",d),window.addEventListener("manifest:markdown-idle",d),setTimeout(l,15e3),d()}const ft=Qe.tailwindCache?function(e){const t=Promise.resolve(!1);try{if(!e.tailwindCache||!0===window.__manifestRender||window.__mnfstRun||Xe(location.hostname))return t;if(!e.plugins.includes("utilities")||qe())return t;if(document.querySelector('[data-mnfst-utilities], link[href*="prerender.tailwind.css"], link[href*="prerender.utilities.css"]'))return t;const n=`${u}|${e.version}|4.3.1`,i=window.__tailwindCache={key:We,v:n,idFor:e=>Be(n,e),pathId:Be("",[location.pathname]),record:null,armed:!1},o=JSON.parse(localStorage.getItem(We)||"null");return o&&He(o.ids)&&o.ids.length?i.decision=new Promise(t=>{let n=!1;const r=()=>{if(n)return;n=!0;const r=function(e,t){try{const n=t.skip&&t.skip[e.pathId];if("number"==typeof n&&Date.now()-n>=0&&Date.now()-n<=De)return!1;const i=Ue(),o=Be(e.v,i),r=JSON.parse(localStorage.getItem(`${We}:${o}`)||"null"),a=r?Date.now()-r.t:-1;if(!r||r.v!==e.v||"string"!=typeof r.css||!He(r.tokens)||!He(r.blocks))return!1;if(!(a>=0&&a<=De)||r.blocks.join("\0")!==i.join("\0")||r.blocks.length!==i.length)return!1;if(r.body)return!1;const s=document.createElement("style");return s.setAttribute("data-tailwind-cache",""),s.textContent=r.css,Fe(s),Object.assign(e,{record:r,style:s,id:o}),!0}catch(e){return!1}}(i,o);r&&function(e,t){const n=new MutationObserver(i=>{for(const o of i)for(const i of o.addedNodes){if("style"!==i.localName||"text/tailwindcss"!==i.getAttribute("type")||"manifest-tailwind-variants"===i.id)continue;const o=Ue();if(!(o.length<=e.record.blocks.length&&o.every((t,n)=>t===e.record.blocks[n])))return n.disconnect(),e.style&&e.style.remove(),Object.assign(e,{style:null,parsedMismatch:!0}),void(e.load=Ve(t).catch(()=>{}))}});n.observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("DOMContentLoaded",()=>n.disconnect(),{once:!0})}(i,e.version),t(r)};if(document.body)return r();const a=new MutationObserver(()=>{document.body&&(a.disconnect(),r())});a.observe(document.documentElement,{childList:!0}),document.addEventListener("DOMContentLoaded",()=>{a.disconnect(),r()},{once:!0})}):t}catch(e){return t}}(Qe):null;lt(),dt()}}();
1
+ !function(){"use strict";const e=document.currentScript;if(!window.ManifestPending){const ut=new Map;let ft=0;window.ManifestPending={hold(e="work"){const t=++ft;return ut.set(t,e),()=>{ut.delete(t)}},get count(){return ut.size+(window.__manifestMarkdownPending||0)+(window.__manifestUtilitiesPending||0)},labels(){const e=[...ut.values()];return window.__manifestMarkdownPending>0&&e.push("markdown"),window.__manifestUtilitiesPending>0&&e.push("utilities"),e},background:e=>("function"==typeof e&&(e.__manifestBackground=!0),e)}}const t=new Set,n=new WeakSet;let i=!1;function o(){for(const e of[...t])e.settle()}function r(){i||(i=!0,queueMicrotask(()=>{i=!1,o()}))}function a(e){for(let t=e.parentNode;t;t=t.parentNode)if(t._x_ignore)return!0;return!1}function s(e,i){const s=window.Alpine,c=e.getAttribute("x-if");let l=!e.closest("[x-data],[x-init]"),d=!1,u=null;const f=()=>!!s.evaluate(e,c),p=()=>{u&&(u(),u=null)},m=()=>{t.delete(y),p()},w=()=>{l=!1,d=!1,p(),i._x_ignore=!0,t.add(y)},h=()=>{m(),s.mutateDom(()=>{s.destroyTree(i),i.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl,r()},g=()=>{l||e._x_currentIfEl!==i||!i.isConnected||a(e)||(l=!0,d=!1,m(),delete i._x_ignore,s.initTree(i),o())},y={settle(){if(!l&&!d)return e._x_currentIfEl!==i?m():void(i.isConnected?e._x_marker&&!a(e)&&f()&&g():i.getRootNode()instanceof DocumentFragment||m())}},v=()=>window.__manifestReady||!window.__manifestReadyCoordinator?h():(queueMicrotask(()=>{e._x_currentIfEl===i&&(e._x_undoIf=v,(()=>{if(u||!d||e._x_currentIfEl!==i||a(e))return;const t=s.evaluateLater(e,c),n=s.effect(()=>t(e=>{e&&queueMicrotask(()=>{d&&f()&&g()})}));u=()=>s.release(n)})())}),a(e)?w():(l&&(l=!1,i._x_ignore=!0,s.destroyTree(i),t.add(y)),void(d||(d=!0,window.addEventListener("manifest:ready",()=>{if(d&&e._x_currentIfEl===i){if(e.isConnected&&a(e))return w();if(e.isConnected&&f())return g();h(),delete e._x_undoIf}},{once:!0})))));e._x_currentIfEl=i,e._x_lastRenderedEl=i,e._x_undoIf=v,n.add(e),l||(i._x_ignore=!0,t.add(y))}function c(e,t){e.querySelectorAll("template").forEach(e=>{const n=t||e.matches("[x-if],[x-for]");n&&e.content.querySelectorAll("[data-pre-rendered]").forEach(e=>{e.tagName.startsWith("X-")&&e.removeAttribute("data-pre-rendered")}),c(e.content,n)})}function l(){try{!function(){if("undefined"==typeof document||!document.querySelector)return;const e=document.querySelector('meta[name="manifest:prerendered"]');if(!e||"0"===e.getAttribute("content"))return;const t=document.getElementById("__manifest_hydrate__");if(!t)return;let n;try{n=JSON.parse(t.textContent||"[]")}catch(e){n=[]}if(!Array.isArray(n)||0===n.length)return void t.remove();const i=e=>String(null==e?"":e).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=[];for(const e of n){const t=document.querySelector('[data-hydrate-id="'+e.id+'"]');if(!t)continue;let n=0;for(let e=t.parentNode;e;e=e.parentNode)n++;r.push({entry:e,el:t,depth:n})}r.sort((e,t)=>t.depth-e.depth);for(const{entry:e,el:t}of r){const n=document.querySelector('[data-hydrate-id="'+e.id+'"]')||t;if(!n||!n.parentNode)continue;if("string"==typeof e.html){const t=n.tagName.toLowerCase(),r={},a=n.attributes;for(let e=0;e<a.length;e++)"data-hydrate-id"!==a[e].name&&(r[a[e].name]=a[e].value);if(e.attrs)for(const t in e.attrs){const n=e.attrs[t];null===n?delete r[t]:r[t]=n}const s=Object.keys(r).map(e=>e+'="'+i(r[e])+'"').join(" "),c=o.has(t)?"<"+t+" "+s+">":"<"+t+" "+s+">"+e.html+"</"+t+">",l=document.createElement("div");l.innerHTML=c;const d=l.firstElementChild;if(d)try{n.parentNode.replaceChild(d,n)}catch(e){}continue}if(!e.attrs)continue;const r=n.tagName.toLowerCase(),a={},s=n.attributes;for(let e=0;e<s.length;e++)"data-hydrate-id"!==s[e].name&&(a[s[e].name]=s[e].value);for(const t in e.attrs){const n=e.attrs[t];null===n?delete a[t]:a[t]=n}const c=Object.keys(a).map(e=>e+'="'+i(a[e])+'"').join(" "),l=o.has(r),d=l?"":n.innerHTML,u=l?"<"+r+" "+c+">":"<"+r+" "+c+">"+d+"</"+r+">",f=document.createElement("div");f.innerHTML=u;const p=f.firstElementChild;if(p)try{n.parentNode.replaceChild(p,n)}catch(e){}}t.remove()}()}catch(e){}}if("undefined"!=typeof document&&document.addEventListener("alpine:init",function(){if("undefined"==typeof document||!document.querySelectorAll)return;c(document);let e=0;if(document.querySelectorAll("[data-mnfst-prerender-clone]").forEach(t=>{if(t.closest&&t.closest("[data-hydrate]"))return;t.removeAttribute("data-mnfst-prerender-clone");const n=t.previousElementSibling;n&&"TEMPLATE"===n.tagName&&n.hasAttribute("x-if")?(s(n,t),e++):t.remove()}),!e)return;const i=window.Alpine;"function"==typeof i.interceptInit&&i.interceptInit(e=>{n.has(e)&&t.size&&r()}),document.addEventListener("alpine:initialized",o,{once:!0})},{once:!0}),"undefined"!=typeof document)if("loading"===document.readyState){let pt=!1;document.addEventListener("readystatechange",()=>{pt||"loading"===document.readyState||(pt=!0,l())})}else l();if("undefined"!=typeof window&&"undefined"!=typeof document){let mt=null;window.addEventListener("resize",()=>{document.documentElement.classList.add("window-resizing"),mt&&clearTimeout(mt),mt=setTimeout(()=>{document.documentElement.classList.remove("window-resizing"),mt=null},200)},{passive:!0})}const d="latest",u="0.5.336",f="sha384-fjgL8yxzJrpIvgOzLZ2X3pI8OdRQukhaNhMnmfjlvTpL3s65XQJ5GhzE0MIUBqoM",p="manifest.modules.integrity.json",m="manifest.vendor.integrity.json";let w=null,h=null,g=!1,y=null,v=d,b=["https://cdn.manifestx.dev/npm","https://cdn.jsdelivr.net/npm","https://unpkg.com"];function _(e,t){return e.includes("unpkg.com")?t.replace(/\.min\.js$/,".js"):t}function $(e=d,t=b[0]){return`${t}/mnfst@${e}/lib`}const k=["components","router","utilities","data","icons","localization","color","toasts","tooltips","dropdowns","computed","tabs","url-parameters","status"],E=["defer","bindings"],x=["edit"],S=["appwrite-auth","appwrite-data","appwrite-presences"],M=["rich-text","submissions","markdown","svg","code","combobox","slides","colorpicker","datepicker","charts","virtual","export"],A={"appwrite-data":["data"],"appwrite-presences":["data","appwrite-auth"],device:["utilities"],edit:["rich-text"]};let L=null;let P=[];function C(e,t=v){const n=e.replace(/-/g,".");if(L){return[`${L.replace(/\/$/,"")}/manifest.${n}.js`]}return b.map(e=>`${$(t,e)}/${_(e,`manifest.${n}.min.js`)}`)}function j(e,t=v){return C(e,t)[0]}function I(e){if(e&&(e.startsWith("http")||e.startsWith("/")))return[e];const t=e||"3.17.5";return b.map(e=>`${e}/alpinejs@${t}/dist/cdn.min.js`)}let N=!1;function T(e){if(function(){if(N||"complete"===document.readyState)return!0;if("loading"===document.readyState)return!1;try{const e=performance.getEntriesByType("navigation")[0];if(e)return e.domContentLoadedEventEnd>0}catch(e){}return!1}())return void e();let t=!1;const n=()=>{t||(t=!0,e())};document.addEventListener("DOMContentLoaded",n,{once:!0}),window.addEventListener("load",n,{once:!0})}function R(t){if(t.hasAttribute("data-mnfst-loaded"))return!0;if(t.hasAttribute("data-mnfst-loading"))return!1;if("complete"===document.readyState)return!0;if(!t.async&&!t.defer&&e&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)return!0;try{if(t.src&&performance.getEntriesByName(t.src).length)return!0}catch(e){}return!1}function O(e,t,n=!0,i=null){return new Promise((o,r)=>{const a=document.querySelector(`script[src="${e}"]`);if(a){if(R(a))return o();let t=!1;const n=()=>{t||(t=!0,o())};a.addEventListener("load",n),a.addEventListener("error",()=>{t||(t=!0,r(new Error(`Failed to load ${e}`)))});const i=setInterval(()=>{R(a)&&(clearInterval(i),n())},50);return void setTimeout(()=>{clearInterval(i),n()},4e3)}const s=document.createElement("script");t&&(s.integrity=t,s.crossOrigin="anonymous"),i&&s.setAttribute("fetchpriority",i),s.src=e,s.async=!n,s.setAttribute("data-mnfst-loading",""),s.onload=()=>{s.removeAttribute("data-mnfst-loading"),s.setAttribute("data-mnfst-loaded",""),o()},s.onerror=()=>{s.removeAttribute("data-mnfst-loading"),s.remove(),r(new Error(`Failed to load ${e}`))},document.head.appendChild(s)})}function z(e){return e.split(/[?#]/)[0].split("/").pop()}function q(e){const t=e.match(/(alpinejs@[^/]+\/dist\/cdn\.min\.js)(?:[?#]|$)/);return t?t[1]:null}function W(e){try{const t=performance.getEntriesByName(new URL(e,location.href).href).pop();return!!t&&200===t.responseStatus}catch(e){return!1}}function D(e,t){if("warn"!==w)throw console.error(`[Manifest Loader] ${e} ${t} data-integrity="warn" loads it unchecked instead.`),Object.assign(new Error(e),{logged:!0});console.warn(`[Manifest Loader] ${e} Loading unchecked (data-integrity="warn").`)}async function U(e,t,n){for(const i of e){try{const e=await fetch(i,t?{integrity:t,mode:"cors",credentials:"omit"}:{mode:"cors",credentials:"omit"});if(e.ok)return e}catch(e){}console.error(`[Manifest Loader] ${n} failed to load${t?" or failed its integrity check":""} from ${i}`)}throw new Error(`${n} could not be ${t?"verified":"loaded"} from any CDN${t?` (expected ${t})`:""}.`)}"undefined"!=typeof document&&"complete"!==document.readyState&&document.addEventListener("DOMContentLoaded",()=>{N=!0},{once:!0});let F=null;const B=/^sha(256|384|512)-[A-Za-z0-9+/=]+$/;function H(e,t){const n=e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:null;return"string"==typeof n&&B.test(n)?n:null}async function J(e,t){const n=H(e,t);if(n)return n;const i=H(e,m);return i&&/\/(languages|langs)\//.test(t)?(F||(F=U(b.map(e=>`${$(u,e)}/${m}`),i,m).then(e=>e.json()).catch(e=>{throw F=null,e})),H(await F,t)):null}async function V(e,{key:t=null,hash:n=null,alpine:i=!1,unchecked:o=!1,ordered:r=!0,priority:a=null}={}){const s=h&&!o?await h:null,c=t||z(e[0]||"");let l=null;for(const o of e){let c=n;if(s){const e=t||(i?q(o):z(o));c=e&&await J(s,e)||(i?y:null),c||(i?D(`No integrity hash is known for Alpine at ${o}. Add data-alpine-integrity="sha384-…" for it, or remove data-alpine to use the default.`,"Alpine was not loaded."):D(`${e||o} has no integrity hash in this release.`,"Not loaded."))}try{return await O(o,c,r,a)}catch(t){l=t,c?console.error(`[Manifest Loader] ${z(o)} ${W(o)?"failed its integrity check":"failed to load or failed its integrity check"} from ${o}${e.length>1?" — trying next CDN":""}`):e.length>1&&console.warn(`[Manifest Loader] ${o} failed — trying fallback CDN`)}}throw s&&console.error(`[Manifest Loader] ${c} did not match its integrity hash on any CDN — not loaded.`),l||new Error(`Failed to load ${c}`)}const Z=new Map,X=new Set,G=new Map,Q=()=>"undefined"!=typeof performance?performance.now():Date.now(),K=e=>G.has(e)?Q()-G.get(e):0;async function Y(e,t=v,n=!0){const i=Z.get(e);if(i)return i.version!==t&&console.warn(`[Manifest Loader] ${e} already loaded at ${i.version} — ignoring request for ${t}`),i.promise;const o=async function(e,t,n=!0){let i=!1;g&&t!==u&&(D(`Integrity checks cover this loader's own version (${u}); ${e} was requested at ${t}.`,"Not loaded."),i=!0);const o=["components","data","localization"].includes(e)?"high":null;return V(C(e,t),{unchecked:i,priority:o,ordered:n})}(e,t,n);return Z.set(e,{version:t,promise:o}),o.then(()=>{X.add(e),G.set(e,Q())},()=>Z.delete(e)),o}function ee(e){const t=[],n=new Set,i={native:"device",import:"export"};function o(e){if(e=i[e]||e,n.has(e))return;const r=A[e];if(r)for(const e of r)n.has(e)||o(e);t.push(e),n.add(e)}for(const t of e)o(t);return t}const te=[{magic:"$chat",plugin:"chat"},{magic:"$presence",plugin:"appwrite-presences"},{magic:"$rich",plugin:"rich-text",attr:"x-rich-text",family:!0},{plugin:"submissions",attr:"x-submit",family:!0},...["$share","$secure","$links","$push","$app","$haptics","$biometric","$camera"].map(e=>({magic:e,plugin:"device"})),{plugin:"charts",attr:"x-chart",magic:"$chart",present:"ensureChartsPluginInitialized"},{plugin:"colorpicker",attr:"x-colorpicker",magic:"$colorpicker",present:"ensureColorpickerPluginInitialized"},{plugin:"datepicker",attr:"x-date",magic:"$date",present:"ensureDatepickerPluginInitialized"},{plugin:"combobox",attr:"x-combobox",present:"ensureComboboxPluginInitialized"},{plugin:"code",attr:"x-code",present:"ensureCodePluginInitialized"},{plugin:"code",attr:"x-code-group",present:"ensureCodePluginInitialized"},{plugin:"markdown",attr:"x-markdown",present:"ensureMarkdownPluginInitialized"},{plugin:"export",attr:"x-export",magic:"$export",present:"ensureExportPluginInitialized",call:!0},{plugin:"export",attr:"x-import",magic:"$import",present:"ensureImportPluginInitialized",call:!0},{plugin:"virtual",attr:"x-virtual",present:"ensureVirtualPluginInitialized"},{plugin:"slides",attr:"x-carousel",present:"ensureSlidesPluginInitialized"},{plugin:"svg",attr:"x-svg",present:"ensureSvgPluginInitialized"}].map(e=>({...e,late:M.includes(e.plugin)&&!["rich-text","submissions"].includes(e.plugin),re:e.magic?new RegExp("\\"+e.magic+"\\b"):null})),ne=[...new Set(te.map(e=>e.plugin))],ie=new Map(te.filter(e=>e.attr).map(e=>[e.attr,e])),oe=te.filter(e=>e.family).map(e=>[e.attr+"-",e]),re=e=>{const t=ae(e);return t&&t.plugin};function ae(e){if(120!==e.charCodeAt(0)||45!==e.charCodeAt(1))return;let t=e.length;for(let n=2;n<t;n++){const i=e.charCodeAt(n);if(46===i||58===i){t=n;break}}const n=t===e.length?e:e.slice(0,t),i=ie.get(n);if(i)return i;for(const[e,t]of oe)if(n.startsWith(e))return t}let se=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||se)return;se=!0;const e=()=>{const e=window.Alpine;if(window.ManifestRichText||!e||!e.magic||!e.reactive||window.__manifestRichStub)return;const t=window.__manifestRichStub=e.reactive({v:0}),n=window.__manifestRichStubWrites=[],i=new WeakMap,o=e=>e&&"function"==typeof e.deref?e.deref():e,r={value:"",link:"",selection:null,all:{},active:()=>!1,can:()=>!1,markdown:()=>"",html:()=>""};e.magic("rich",(e,a)=>(t.v,window.__manifestRichMagic?window.__manifestRichMagic(e,a):(e=>(i.has(e)||i.set(e,new Proxy(r,{get:(t,i)=>{const r=n.find(t=>o(t[0])===e&&t[1]===i);return r?r[2]:i in t?t[i]:"string"==typeof i?()=>{}:void 0},set:(t,i,r)=>{for(let t=n.length-1;t>=0;t--){const r=o(n[t][0]);r&&r.isConnected&&(r!==e||n[t][1]!==i)||n.splice(t,1)}return n.push(["function"==typeof WeakRef?new WeakRef(e):e,i,r]),!0}})),i.get(e)))(e)))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}();let ce=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||ce)return;ce=!0;const e=()=>{const e=window.Alpine;if(window.__manifestEditMagic||!e||!e.magic||!e.reactive||window.__manifestEditStub)return;const t=window.__manifestEditStub=e.reactive({v:0}),n=()=>!1,i=window.__manifestEditStubWrites={},o=new Proxy({active:!1,canUndo:!1,canRedo:!1,version:0,stale:[],conflicts:[],onPublish:null,target:null,can:n,scope:()=>null,block:()=>null,patches:()=>[],export:()=>({log:[],cursor:0}),publish:()=>Promise.resolve({results:[]}),undo:()=>Promise.resolve(!1),redo:()=>Promise.resolve(!1),classes:new Proxy({},{get:()=>n})},{get:(e,t)=>t in i?i[t]:t in e?e[t]:"string"==typeof t?n:void 0,set:(e,t,n)=>(i[t]=n,!0)});e.magic("edit",(e,n)=>(t.v,window.__manifestEditMagic?window.__manifestEditMagic(e,n):o))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}(),"undefined"!=typeof document&&document.addEventListener("alpine:initialized",()=>{window.__manifestAlpineStarted=!0},{once:!0});const le=te.filter(e=>e.late),de=le.filter(e=>e.attr).map(e=>e.attr),ue="undefined"==typeof window?[]:le.filter(e=>window[e.present]).map(e=>e.plugin),fe=new Set,pe=new Map,me=e=>{if(fe.has(e))return Promise.resolve();if(!pe.has(e)){let t;const n=new Promise(e=>{t=e});pe.set(e,{promise:n,resolve:t})}return pe.get(e).promise},we=new Map,he=new Set,ge=e=>{const t=ae(e);return t&&t.late&&!ue.includes(t.plugin)?t:null},ye=new Set;function ve(e){if(We.has(e)||ye.has(e))return null;if(!Z.has(e)){if(!Oe||P.includes(e))return null;Fe(ee([e]).filter(e=>!De(e)))}const t=Z.get(e);return t?t.promise:null}const be=new WeakSet,_e=new WeakSet,$e=new WeakMap;let ke=0,Ee=null;const xe=["markdown","code","svg"];function Se(e,t,n){const i=ve(n.plugin);if(!i)return!1;const o=n.attr.slice(2);be.add(t),_e.add(t),!ke++&&window.ManifestPending&&(Ee=window.ManifestPending.hold("held"));let r=!1;const a=()=>{if(!r&&(r=!0,be.delete(t),_e.delete(t),! --ke&&Ee)){const e=Ee;Ee=null,e()}},s=[];let c=null;try{const e=!t.hasAttribute("x-data")&&t.parentElement&&t.parentElement.closest("[x-data]");if(e){e._x_refs||(e._x_refs={});for(const n of[t,...t.querySelectorAll("[x-ref]")]){const t=n.getAttribute("x-ref");!t||n.closest("[x-data]")!==e||e._x_refs[t]&&!s.some(n=>n[2]===e._x_refs[t])||(e._x_refs[t]=n,s.push([e,t,n]))}}c=xe.includes(n.plugin)?t.style.opacity:null,null!==c&&(t.style.opacity="0")}catch(e){}const l=new Promise(e=>{let t=!1;me(o).then(()=>{t=!0,e()});const r=i=>{t||(ye.add(n.plugin),he.has(n.plugin)||(he.add(n.plugin),console.warn(`[Manifest Loader] ${n.plugin} ${i}: starting the elements that use it now${"failed to load"===i?", without it":"; it applies to them if it starts later"}.`)),e())};i.catch(()=>r("failed to load")),i.then(()=>{return setTimeout(()=>r("has not started 10 s after loading"),(e=n.plugin,Math.max(0,1e4-K(e))));var e},()=>{})}),d=l.then(()=>{let e=null;try{be.delete(t),null!==c&&(t.style.opacity=c);for(const[e,t,n]of s)!n.isConnected&&e._x_refs&&e._x_refs[t]===n&&delete e._x_refs[t];e=function(e){const t=[],n=e.matches("input, textarea, select")?[e]:[];n.push(...e.querySelectorAll("input, textarea, select"));for(const e of n)try{if("file"===e.type){e.files&&e.files.length&&t.push([e,"files",null]);continue}if("radio"===e.type)e.checked&&!e.defaultChecked&&t.push([e,"checked",!0]);else if("checkbox"===e.type)e.checked!==e.defaultChecked&&t.push([e,"checked",e.checked]);else if("SELECT"===e.tagName){const n=[...e.options].map(e=>e.selected);n.some((t,n)=>t!==e.options[n].defaultSelected)&&t.push([e,"options",n])}else e.value!==e.defaultValue&&t.push([e,"value",e.value])}catch(e){}const i=document.activeElement,o=i&&e.contains(i)?[i,i.selectionStart,i.selectionEnd]:null;return()=>{const n=new WeakMap,i=e=>{n.get(e)===e.currentTarget&&e.stopPropagation()},r=[];for(const[n,i,o]of t)try{if(!n.isConnected||n.readOnly||n.disabled)continue;let t=!1;for(let i=n;i&&i!==e;i=i.parentElement)if(_e.has(i)){t=!0;break}if(t){$e.has(n)||$e.set(n,e);continue}const a=$e.get(n)||e;$e.delete(n),r.push([n,i,o,a])}catch(e){}const a=new Set(r.map(e=>e[3]));a.forEach(e=>{e.addEventListener("input",i),e.addEventListener("change",i)});const s=(e,t,i)=>{const o=new Event(t,{bubbles:!0});n.set(o,i),e.dispatchEvent(o)};for(const[e,t,n,i]of r)try{"options"===t?[...e.options].forEach((e,t)=>{e.selected=!!n[t]}):"files"!==t&&(e[t]=n),s(e,"input",i),s(e,"change",i)}catch(e){}if(a.forEach(e=>{e.removeEventListener("input",i),e.removeEventListener("change",i)}),o&&o[0].isConnected)try{o[0].focus({preventScroll:!0}),null!=o[1]&&o[0].setSelectionRange(o[1],o[2])}catch(e){}}}(t)}catch(e){}setTimeout(()=>{try{e&&e()}finally{a()}},0)});try{e.deferInit(t,d)}catch(e){throw a(),e}return!0}let Me=!1;function Ae(){const e="undefined"==typeof window?null:window.Alpine;if(Me||!e||!e.directive||!e.magic)return;Me=!0;const t=e.directive,n=e.magic;if(e.directive=function(e){const n=t.apply(this,arguments);if(!fe.has(e)){fe.add(e);const t=pe.get(e);t&&(pe.delete(e),t.resolve());const n=we.get(e);n&&(we.delete(e),setTimeout(()=>n.forEach(([e,t])=>{const n=Le(e);try{n&&n.isConnected&&n.hasAttribute(t)&&n.setAttribute(t,n.getAttribute(t))}catch(e){}}),0))}return n},"function"==typeof e.interceptInit){const t="function"==typeof e.deferInit,n=e=>{try{i(e)}catch(e){}},i=n=>{if(!be.has(n))for(const i of n.attributes){const o=ge(i.name);if(o&&!fe.has(o.attr.slice(2)))if(ye.has(o.plugin))Pe(o,n,i.name);else if(t){if(Se(e,n,o))return}else ve(o.plugin)&&Pe(o,n,i.name)}};e.interceptInit("function"==typeof e.skipDuringClone?e.skipDuringClone(n):n)}!function(e,t){const n={},i=e.reactive?e.reactive({v:0}):{v:0},o=t=>{window.__manifestProbing=!0;try{return"undefined"!==e.evaluate(document.createElement("div"),`typeof $${t}`)}catch(e){return!1}finally{window.__manifestProbing=!1}},r=(e,t)=>new Proxy(function(){},{get(n,i){const o=e();if(null!=o){const e=o[i];return"function"==typeof e&&"constructor"!==i?e.bind(o):e}return i===Symbol.toPrimitive?()=>"":"symbol"!=typeof i&&"then"!==i?r(()=>{const t=e();return null==t?void 0:t[i]},t):void 0},apply(n,i,o){const a=e();if("function"==typeof a)return a.apply(i,o);if(t)return t().then(()=>{const t=e();return"function"==typeof t?t.apply(i,o):void 0});let s,c=!1;return r(()=>{if(c)return s;const t=e();return"function"==typeof t?(c=!0,s=t.apply(i,o)):void 0},t)}});for(const a of le){if(!a.magic||ue.includes(a.plugin)||X.has(a.plugin))continue;const s=a.magic.slice(1);if(o(s))continue;let c=!1;const l=()=>new Promise(e=>{if(n[s])return e();const t=ve(a.plugin);if(!t)return e();const i=()=>n[s]?e():null;t.then(()=>setTimeout(()=>{i(),setTimeout(e,0)},0),e)});t.call(e,s,(e,t)=>{if(i.v,n[s])return n[s](e,t);if(!(c||window.__manifestProbing||(c=!0,ve(a.plugin)||he.has(s)||he.has(a.plugin)))){he.add(s);const e=P.includes(a.plugin)?`remove ${a.plugin} from data-omit`:`add data-modules="+${a.plugin}"`;console.warn(`[Manifest Loader] ${a.magic} is used but ${a.plugin} is not loaded on this page: ${e}.`)}const o=a.call?"$import"!==a.magic?l:()=>l().then(()=>{const e=navigator.userActivation;!e||e.isActive||he.has("$import:activation")||(he.add("$import:activation"),console.warn('[Manifest Loader] $import waited for its module and the click that called it expired, so the browser may not open the file picker. Add data-modules="+import" to load it with the page.'))}):null;return r(()=>n[s]?n[s](e,t):void 0,o)})}e.magic=function(e,o){return le.some(t=>t.magic==="$"+e)&&(n[e]=o,setTimeout(()=>{i.v++},0)),t.apply(this,arguments)}}(e,n)}const Le=e=>e&&"function"==typeof e.deref?e.deref():e;function Pe(e,t,n){const i=e.attr.slice(2);if(fe.has(i))return;we.has(i)||we.set(i,[]);const o=we.get(i).filter(([e])=>Le(e));o.push(["function"==typeof WeakRef?new WeakRef(t):t,n]),we.set(i,o)}"undefined"!=typeof document&&(document.addEventListener("alpine:init",Ae,{once:!0}),"undefined"!=typeof window&&window.Alpine&&window.Alpine.magic&&Ae()),"undefined"!=typeof window&&(window.__manifestHeld=e=>{if(!ke)return!1;for(let t=e;t;t=t.parentElement)if(be.has(t))return!0;return!1});const Ce=/^x-(code|code-group)$/,je=new RegExp("\\$("+te.filter(e=>e.magic).map(e=>e.magic.slice(1)).join("|")+")\\b"),Ie=new Set;function Ne(e,t=("undefined"==typeof document?null:document)){const n=te.filter(t=>!e.includes(t.plugin)),i=!e.includes("components");if(0===n.length&&!i||!t)return[];const o=new Set,r=new Set(n.map(e=>e.plugin)),a=r.size+(i?1:0),s=()=>o.size===a,c=e=>{e&&r.has(e)&&!o.has(e)&&o.add(e)},l=r.has("code");for(const e of t.querySelectorAll("script:not([src])")){const t=e.textContent||"";for(const e of n)e.re&&!o.has(e.plugin)&&e.re.test(t)&&o.add(e.plugin);if(s())return[...o]}const d=e=>{if(i&&!o.has("components")){const t=e.tagName.toLowerCase();t.startsWith("x-")&&!Ce.test(t)&&o.add("components")}l&&c(function(e){if("CODE"!==e.tagName)return;if(e.hasAttribute("copy"))return"code";const t=e.getAttribute("class");return t&&-1!==t.indexOf("language-")&&e.parentElement&&"PRE"===e.parentElement.tagName?"code":void 0}(e));for(const t of e.attributes||[]){c(re(t.name));const e=t.value;if(e&&-1!==e.indexOf("$")&&!Ie.has(e))if(je.test(e))for(const t of n)t.re&&!o.has(t.plugin)&&t.re.test(e)&&o.add(t.plugin);else Ie.size>2e4&&Ie.clear(),Ie.add(e)}},u=e=>{for(const t of e.querySelectorAll("*")){if(d(t),s())return;if("TEMPLATE"===t.tagName&&t.content&&(u(t.content),s()))return}};return 1===t.nodeType&&(d(t),"TEMPLATE"===t.tagName&&t.content&&u(t.content)),s()||u(t),[...o]}let Te=null;function Re(){if(Te)return Te;const e=new Set,t="undefined"==typeof MutationObserver?null:new MutationObserver(t=>{for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&e.add(t)});t&&t.observe(document.documentElement,{childList:!0,subtree:!0});const n=Ne([]);return Te={used:n,take(){t&&t.disconnect();const i=new Set(n);for(const t of e)t.isConnected&&Ne([...i],t).forEach(e=>i.add(e));return e.clear(),[...i]}},Te}let Oe=!1,ze=!1,qe=null;const We=new Set,De=e=>X.has(e)||We.has(e);function Ue(e,t=v){if(!ze)return qe&&e?qe.promise.then(()=>ze?Ue(e,t):[]):Promise.resolve([]);if(!e||"undefined"==typeof document)return Promise.resolve([]);let n=e;if("string"==typeof e){if(-1===e.indexOf("x-")&&-1===e.indexOf("$")&&-1===e.indexOf("<code"))return Promise.resolve([]);n=document.createElement("template"),n.innerHTML=e,n=n.content}const i=Ne(ne.filter(De).concat("components",P),n);return i.length?Fe(ee(i).filter(e=>!De(e)),t):Promise.resolve([])}function Fe(e,t=v){if(!e.length)return Promise.resolve([]);const n=window.ManifestPending?window.ManifestPending.hold("module"):()=>{},i=Promise.all(e.map(e=>Y(e,t,!le.some(t=>t.plugin===e)).catch(t=>{We.has(e)||(We.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t))}))).then(()=>Promise.all(e.map(He))).then(()=>new Promise(e=>setTimeout(e,0)));return i.then(n),Promise.race([i,new Promise(e=>setTimeout(e,Be))]).then(()=>e)}const Be=1500;function He(e){const t=le.find(t=>t.plugin===e&&t.attr);return!t||!window[t.present]||We.has(e)||ye.has(e)||ue.includes(e)||fe.has(t.attr.slice(2))?null:Promise.race([me(t.attr.slice(2)),new Promise(t=>setTimeout(t,Math.max(0,Be-K(e))))])}function Je(e){if("undefined"==typeof MutationObserver)return;const t=new Set;let n=!1;const i=new MutationObserver(o=>{for(const e of o)if("attributes"!==e.type)for(const n of e.addedNodes)1===n.nodeType&&t.add(n);else Ve(e.target,e.attributeName);!n&&t.size&&(n=!0,setTimeout(()=>{n=!1;const o=[...t].filter(e=>e.isConnected);t.clear(),o.forEach(t=>Ue(t,e)),te.every(e=>De(e.plugin)||P.includes(e.plugin))&&i.disconnect()},0))});i.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:de})}function Ve(e,t){const n=ge(t);n&&e.hasAttribute(t)&&!fe.has(n.attr.slice(2))&&!window.__manifestHeld(e)&&ve(n.plugin)&&Pe(n,e,t)}const Ze={"text-edit":"rich-text"};function Xe(e){return e.filter(e=>{const t=e.replace(/^\+/,"");return!Ze[t]||(console.warn(`[Manifest Loader] ${t} was renamed to ${Ze[t]}`),!1)})}function Ge(){try{return!!document.querySelector("style[data-mnfst-utilities][data-mnfst-utilities-complete]")}catch(e){return!1}}const Qe="tailwind-engine-cache:v2",Ke=6048e5;function Ye(){return Array.from(document.querySelectorAll('style[type="text/tailwindcss"]:not(#manifest-tailwind-variants)'),e=>e.textContent)}function et(e,t){const n=[e,...t].join("\0");let i=2166136261;for(let e=0;e<n.length;e++)i=Math.imul(i^n.charCodeAt(e),16777619);return(i>>>0).toString(36)}function tt(e){const t=document.getElementById("manifest-styles");document.head.insertBefore(e,t&&t.parentNode===document.head?t:null)}const nt=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e);async function it(e=v){const t=b.map(t=>`${$(e,t)}/${_(t,"manifest.tailwind.min.js")}`);let n=null;try{return await V(t)}catch(e){n=e}throw console.warn('[Manifest Loader] Tailwind plugin not available from any CDN. Load it directly: <script src="/scripts/tailwind.v4.3.1.js"><\/script>'),n||new Error("Tailwind plugin not available from CDN.")}window.Manifest={loadPlugin:function(e,t=v){if(![...k,...M,...S,...x,"payments","chat","device","native","import","tailwind"].includes(e))return Ze[e]?Xe([e]):console.warn(`[Manifest Loader] Unknown module: ${e}`),Promise.reject(new Error(`Unknown module: ${e}`));const n=ee([e]);return Promise.all(n.map(e=>Y(e,t)))},loadTailwind:it,loadVendor:function(e,t){return V(b.map(t=>`${t}/${e}`),{key:e,hash:t,ordered:!1})},fetchVendor:async function(e,t){const n=h?await h:null;let i=t||null;return n&&(i=await J(n,e),i||D(`${e} has no integrity hash in this release.`,"Not loaded.")),U(b.map(t=>`${t}/${e}`),i,e)},get integrity(){return g},getPluginUrl:j,getModuleUrl:j,loadUsed:Ue},window.Manifest.loadModule=window.Manifest.loadPlugin;const ot="/sw.js";const rt={registered:!1,version:null,kill:()=>st(null)};function at(e){const t=String(e||"").toLowerCase();return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t||"0.0.0.0"===t||t.endsWith(".localhost")||t.endsWith(".local")}async function st(e){rt.registered=!1;try{const t=e||await navigator.serviceWorker.getRegistration(ot);if(t){const e=t.active||t.waiting||t.installing;try{e&&e.postMessage({type:"manifest:sw",action:"kill"})}catch(e){}await t.unregister()}}catch(e){}try{if(window.caches){const e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith("mnfst-sw:")).map(e=>caches.delete(e)))}}catch(e){}}async function ct(e){const t=e.sw,n="on"===t,i=n?(...e)=>console.info("[Manifest SW]",...e):()=>{};if(!navigator.serviceWorker)return i("skip: unsupported");const o=window.location,r=!!window.__mnfstRun,a=at(o.hostname);let s=window.__manifestLoaded||null;if(!s&&window.__manifestPromise&&(s=await window.__manifestPromise.catch(()=>null)),!s){const e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json";s=await fetch(e).then(e=>e.ok?e.json():null).catch(()=>null)}const c="off"===t||s&&!1===s.sw,l=await navigator.serviceWorker.getRegistration(ot).catch(()=>null);if(c||r||a&&!n)return i("skip:",c?"kill switch":r?"mnfst-run":"dev origin",l?"(unregistering)":""),void await st(l);if(!("https:"===o.protocol||n&&window.isSecureContext))return i("skip: not https");let d=null;try{d=sessionStorage.getItem("manifest:sw-probe")}catch(e){}const u="strict"===w;if("ok"!==d||u){const e=await fetch(ot,{cache:"no-store"}).catch(()=>null),t=e&&e.headers.get("content-type")||"";if(!e||!e.ok||!/javascript|ecmascript/i.test(t))return i("skip: no stub",e&&e.status,t);if(u&&(f=await e.text().catch(()=>""),(String(f).match(/importScripts\s*\(([^)]*)\)/g)||[]).some(e=>(e.match(/https?:\/\/[^'"`\s)]+/g)||[]).some(e=>{try{return new URL(e).origin!==location.origin}catch(e){return!0}}))))return console.warn(`[Manifest Loader] ${ot} imports its worker module from another origin, which integrity checks can't cover, so the service worker stays off. Serve the module from this origin (copy lib/manifest.sw.min.js into ${ot}), set data-sw="off", or set data-integrity="warn" to register it anyway.`),void await st(l);try{sessionStorage.setItem("manifest:sw-probe","ok")}catch(e){}}var f;const p=s&&"string"==typeof s.deployment?s.deployment:"",m=`${ot}?v=${encodeURIComponent(e.version)}&d=${encodeURIComponent(p)}`,h=await navigator.serviceWorker.register(m,{scope:"/"});rt.registered=!0,rt.version=e.version,i("registered",m,h.active?"active":h.installing?"installing":"waiting")}window.Manifest.swStub=function(e=d){const t=`mnfst@${String(e||d).replace(/[^\w.+-]/g,"")}/lib/manifest.sw.min.js`;return`try { importScripts('https://cdn.manifestx.dev/npm/${t}'); } catch (e) { importScripts('https://cdn.jsdelivr.net/npm/${t}'); }\nif (!self.__mnfstSw) self.addEventListener('activate', function () { self.registration.unregister(); });\n`},window.Manifest.sw=rt;const lt=function(){let e=document.currentScript;if(e||(e=document.querySelector('script[src*="manifest.js"]')),!e)return null;const t=e.getAttribute("data-modules")??e.getAttribute("data-plugins"),n=e.getAttribute("data-omit"),i=null!==e.getAttribute("data-tailwind"),o="cache"===e.getAttribute("data-tailwind"),r=e.getAttribute("data-version")||d,a=!!e.getAttribute("data-version"),s=e.getAttribute("data-alpine"),c=(e.getAttribute("data-integrity")??"").trim().toLowerCase(),l=/^(off|false)$/.test(c)?null:"warn"===c?"warn":e.hasAttribute("data-integrity")||e.getAttribute("integrity")?"strict":null,u=e.getAttribute("data-module-base")??e.getAttribute("data-plugin-base"),f=e.getAttribute("data-cdn"),p=e.getAttribute("data-sw");let m=[],w=[],h=!t;if(t){const e=Xe(t.split(",").map(e=>e.trim()).filter(e=>e));w=e.filter(e=>e.startsWith("+")).map(e=>e.slice(1));const n=e.filter(e=>!e.startsWith("+"));n.length>0?m=[...n,...w]:(h=!0,m=k.slice())}else m=k.slice();const g={native:"device","text-edit":"rich-text"},y=n?n.split(",").map(e=>e.trim().toLowerCase()).map(e=>g[e]||e).filter(e=>e&&!E.includes(e)):[];return y.length>0&&m.length>0&&(m=m.filter(e=>!y.includes(e))),m=ee(m),{plugins:m,extraPlugins:w,omitted:y,deriveFromManifest:h,tailwind:i,tailwindCache:o,version:r,versionSet:a,alpine:s,alpineIntegrity:e.getAttribute("data-alpine-integrity"),integrity:l,pluginBase:u,cdn:f,sw:p}}();var dt;if(lt&&lt.version&&(v=lt.version),lt&&lt.pluginBase&&(dt=lt.pluginBase,L=dt||null),lt&&lt.omitted&&(P=lt.omitted),lt&&lt.cdn&&function(e){if(!e)return;const t=e.split(",").map(e=>e.trim().replace(/\/$/,"")).filter(Boolean);t.length&&(b=t)}(lt.cdn),lt&&lt.integrity&&(w=lt.integrity,!lt.versionSet&&f&&(v=lt.version=u),g=lt.version===u,y=lt.alpineIntegrity&&B.test(lt.alpineIntegrity.trim())?lt.alpineIntegrity.trim():null,h=async function(e){if(e.version!==u)return D(`Integrity checks cover this loader's own version (${u}), but data-version is "${e.version}". Set data-version="${u}" or remove it.`,"No modules were loaded."),null;const t=L?[`${L.replace(/\/$/,"")}/${p}`]:b.map(e=>`${$(u,e)}/${p}`);try{return await(await U(t,f,p)).json()}catch(e){throw new Error(`${e.message} No modules were loaded.`)}}(lt),h.catch(()=>{})),function(e){if(!e||window.__manifestSwArmed)return;const t=window.__manifestSwArmed={};let n=!1;const i=()=>{if(!n&&window.__manifestSwArmed===t){n=!0;try{ct(e).catch(()=>{})}catch(e){}}};setTimeout(()=>{if(window.__manifestReady)return i();window.addEventListener("manifest:ready",i,{once:!0}),window.__manifestLoaderStarted||("complete"===document.readyState?setTimeout(i,0):window.addEventListener("load",i,{once:!0}))},0)}(lt),lt&&lt.plugins.length>0){if(window.__manifestLoaderStarted)return;if(window.__manifestLoaderStarted=!0,lt.deriveFromManifest){let Et;qe={promise:new Promise(e=>{Et=e}),resolve:Et}}const wt=["data","localization","components","appwrite-auth","appwrite-data","appwrite-presences","payments","chat"],ht=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json",gt=new Set,yt=e=>{if(null===e||"object"!=typeof e)return;const t=e=>e.replace(/\$\{([^}]+)\}/g,(e,t)=>"undefined"!=typeof window&&window.env&&void 0!==window.env[t]?window.env[t]:(gt.has(t)||(gt.add(t),t.startsWith("PUBLIC_")?console.warn(`[Manifest] manifest.json references \${${t}}, but it is not present in window.env. Add ${t}=… to .env (read by mnfst-run) or set it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`):console.warn(`[Manifest] manifest.json references \${${t}}, but only PUBLIC_-prefixed env vars are injected into window.env by mnfst-run. Rename to PUBLIC_${t}, hardcode the value, or supply it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`)),e)),n=e=>{if(Array.isArray(e))for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}else for(const i of Object.keys(e)){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}};n(e)},vt=()=>window.__manifestLoaded?Promise.resolve(window.__manifestLoaded):(window.__manifestPromise||(window.__manifestPromise=fetch(ht).then(e=>e.ok?e.json():null).then(e=>(e&&!e.__interpolated&&(yt(e),Object.defineProperty(e,"__interpolated",{value:!0,enumerable:!1})),e)).catch(()=>null)),window.__manifestPromise),bt=()=>{if(h||!document.head||!0===window.__manifestRender)return;const e=new Set,t=(t,n,i)=>{if(!n||e.has(t+n))return;e.add(t+n);const o=document.createElement("link");o.rel=t,i&&(o.as=i,o.setAttribute("fetchpriority","low")),o.href=n,o.setAttribute("data-mnfst-hint",""),document.head.appendChild(o)};document.addEventListener("alpine:init",()=>{document.head.querySelectorAll("link[data-mnfst-hint]").forEach(e=>e.remove())},{once:!0});try{(lt.deriveFromManifest||lt.plugins.some(e=>wt.includes(e)))&&vt();const e=L?null:b[0];if(e&&new URL(e,location.href).origin!==location.origin&&t("preconnect",new URL(e,location.href).origin),lt.deriveFromManifest){const e=["data","localization","components","status"];for(const n of[...E,...lt.plugins])e.includes(n)||t("preload",j(n,lt.version),"script")}T(()=>{try{if(window.Alpine||document.querySelector('script[src*="alpinejs"]')||t("preload",I(lt.alpine)[0],"script"),lt.deriveFromManifest){const e=Re().used.filter(e=>"components"!==e&&!P.includes(e));for(const n of ee(e))lt.plugins.includes(n)||Z.has(n)||t("preload",j(n,lt.version),"script")}}catch(e){}})}catch(e){}},_t=async()=>{if(h){(lt.deriveFromManifest||lt.plugins.some(e=>wt.includes(e)))&&vt();try{await h}catch(e){return void(e.logged||console.error(`[Manifest Loader] ${e.message}`))}}let e=null,t=lt.plugins,n=null;if(lt.deriveFromManifest){e=await vt();const n=function(e){if(!e||"object"!=typeof e)return k.slice();const t=e.data&&"object"==typeof e.data&&Object.keys(e.data).length>0,n=e.components?.length>0||e.preloadedComponents?.length>0,i=(()=>{if(!e.data||"object"!=typeof e.data)return!1;for(const t of Object.values(e.data))if(t&&"object"==typeof t){if("string"==typeof t.locales)return!0;for(const e of Object.keys(t))if(!["url","headers","params","transform","defaultValue","locales"].includes(e)&&/^[a-zA-Z]{2}(-[a-zA-Z]{2})?$/.test(e))return!0}return!1})(),o=e.status&&"object"==typeof e.status&&Object.keys(e.status).length>0;return k.filter(e=>"data"===e?t:"localization"===e?i:"components"===e?n:"status"!==e||o)}(e),o=function(e){if(!e||"object"!=typeof e)return[];if(!(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&(e.appwriteTableId||e.appwriteDatabaseId||e.appwriteBucketId))))return[];const t=[];return e.appwrite?.auth&&t.push("appwrite-auth"),(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&e.appwriteTableId))&&t.push("appwrite-data"),(e.appwrite?.presence||e.appwrite?.presences)&&t.push("appwrite-presences"),t}(e),r=function(e){return e&&"object"==typeof e&&e.payments&&"object"==typeof e.payments?["payments"]:[]}(e),a=function(e){return e&&"object"==typeof e&&(e.ai||e.chat)?["chat"]:[]}(e),s=function(e){if("undefined"!=typeof window&&window.Capacitor)return["device"];const t=e&&"object"==typeof e?e.device??e.native:null;return t&&"object"==typeof t?["device"]:[]}(e);t=ee([...E,...(i=[...n,...o,...r,...a,...s,...lt.extraPlugins||[]],P.length?i.filter(e=>!P.includes(e)):i)])}else{t=ee([...E,...t.filter(e=>!E.includes(e))]);lt.plugins.some(e=>wt.includes(e))&&(n=vt()),"undefined"!=typeof window&&window.Capacitor&&!t.includes("device")&&(t=ee([...t,"device"]))}var i;const o=t.map(e=>Y(e,lt.version).catch(t=>{console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)}));lt.deriveFromManifest&&(ze=!0,qe.resolve()),lt.tailwind&&!Ge()&&o.push(lt.tailwindCache?kt.then(e=>e?null:it(lt.version)).catch(()=>{}):it(lt.version).catch(()=>{}));const r=lt.deriveFromManifest?new Promise(e=>T(()=>{let n=[];try{const e=Re().take(),i=e.filter(e=>P.includes(e)&&!t.includes(e));i.forEach(e=>he.add(e)),i.length&&console.warn(`[Manifest Loader] data-omit lists ${i.join(", ")}, but this page uses ${i.length>1?"them":"it"}. Not loaded: remove ${i.length>1?"them":"it"} from data-omit to load.`);const o=e.filter(e=>!t.includes(e)&&!P.includes(e));o.length>0&&(n=ee(o).filter(e=>!t.includes(e)).map(e=>Y(e,lt.version).catch(t=>{We.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)})))}catch(e){}Oe=!0,Je(lt.version),e(Promise.all(n))})):null;await Promise.all(o),function(e){const t=window.__tailwindCache;if(!t||!t.style||!t.style.isConnected)return;if(!t.armed)return void(t.load=it(e).catch(()=>{}));let n=t.style.nextElementSibling;const i=e=>"style"===e.localName&&"manifest-styles"!==e.id&&"text/tailwindcss"!==e.getAttribute("type")||"link"===e.localName&&/\bstylesheet\b/i.test(e.rel);for(;n&&!i(n);)n=n.nextElementSibling;n&&tt(t.style)}(lt.version),n&&(e=await n),e&&"undefined"!=typeof window&&(window.__manifestLoaded=e,window.ManifestComponentsRegistry&&(window.ManifestComponentsRegistry.manifest=e)),T(async()=>{var e;r&&await r,$t(t,lt.tailwind),e=I(lt.alpine),T(()=>{window.Alpine||document.querySelector('script[src*="alpinejs"]')||V(e,{alpine:!0}).catch(e=>{e.logged||console.error("[Manifest Loader] Alpine.js failed to load from all CDNs.")})})})};function $t(e,t){if(window.__manifestReadyCoordinator)return;window.__manifestReadyCoordinator=!0;const n=window.ManifestPending.hold("ready"),i=!!t,o={data:!e.some(e=>"data"===e||"appwrite-data"===e)||!!window.__manifestRenderReady,utilities:!i||!!window.__manifestUtilitiesReady};let r=!1,a=null;const s=()=>!(window.__manifestMarkdownPending>0),c=()=>!(window.__manifestUtilitiesPending>0),l=()=>{r||(r=!0,n(),window.__manifestReady=!0,window.dispatchEvent(new CustomEvent("manifest:ready")))},d=()=>{r||o.data&&o.utilities&&s()&&c()&&(clearTimeout(a),a=setTimeout(()=>{o.data&&o.utilities&&s()&&c()&&l()},300))};window.addEventListener("manifest:render-ready",()=>{o.data=!0,d()}),window.addEventListener("manifest:utilities-ready",()=>{o.utilities=!0,d()}),window.addEventListener("manifest:utilities-idle",d),window.addEventListener("manifest:markdown-idle",d),setTimeout(l,15e3),d()}const kt=lt.tailwindCache?function(e){const t=Promise.resolve(!1);try{if(!e.tailwindCache||!0===window.__manifestRender||window.__mnfstRun||at(location.hostname))return t;if(!e.plugins.includes("utilities")||Ge())return t;if(document.querySelector('[data-mnfst-utilities], link[href*="prerender.tailwind.css"], link[href*="prerender.utilities.css"]'))return t;const n=`${u}|${e.version}|4.3.1`,i=window.__tailwindCache={key:Qe,v:n,idFor:e=>et(n,e),pathId:et("",[location.pathname]),record:null,armed:!1},o=JSON.parse(localStorage.getItem(Qe)||"null");return o&&nt(o.ids)&&o.ids.length?i.decision=new Promise(t=>{let n=!1;const r=()=>{if(n)return;n=!0;const r=function(e,t){try{const n=t.skip&&t.skip[e.pathId];if("number"==typeof n&&Date.now()-n>=0&&Date.now()-n<=Ke)return!1;const i=Ye(),o=et(e.v,i),r=JSON.parse(localStorage.getItem(`${Qe}:${o}`)||"null"),a=r?Date.now()-r.t:-1;if(!r||r.v!==e.v||"string"!=typeof r.css||!nt(r.tokens)||!nt(r.blocks))return!1;if(!(a>=0&&a<=Ke)||r.blocks.join("\0")!==i.join("\0")||r.blocks.length!==i.length)return!1;if(r.body)return!1;const s=document.createElement("style");return s.setAttribute("data-tailwind-cache",""),s.textContent=r.css,tt(s),Object.assign(e,{record:r,style:s,id:o}),!0}catch(e){return!1}}(i,o);r&&function(e,t){const n=new MutationObserver(i=>{for(const o of i)for(const i of o.addedNodes){if("style"!==i.localName||"text/tailwindcss"!==i.getAttribute("type")||"manifest-tailwind-variants"===i.id)continue;const o=Ye();if(!(o.length<=e.record.blocks.length&&o.every((t,n)=>t===e.record.blocks[n])))return n.disconnect(),e.style&&e.style.remove(),Object.assign(e,{style:null,parsedMismatch:!0}),void(e.load=it(t).catch(()=>{}))}});n.observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("DOMContentLoaded",()=>n.disconnect(),{once:!0})}(i,e.version),t(r)};if(document.body)return r();const a=new MutationObserver(()=>{document.body&&(a.disconnect(),r())});a.observe(document.documentElement,{childList:!0}),document.addEventListener("DOMContentLoaded",()=>{a.disconnect(),r()},{once:!0})}):t}catch(e){return t}}(lt):null;bt(),_t().finally(()=>{qe&&qe.resolve()})}}();
2
2
  //# sourceMappingURL=manifest.min.js.map