Auto-indexing service and GraphQL API for AT Protocol Records quickslice.slices.network/
atproto gleam graphql

feat: make lexicon import declarative (wipe-and-replace)

Import now wipes existing lexicons before inserting new ones from the
uploaded ZIP. This makes the import declarative - the uploaded set
defines the complete set of lexicons.

- Add delete_all() call after validation passes in importer
- Remove unused CLI import command from server.gleam
- Update settings copy to note RESET option for full data wipe

+182 -52
+6 -1
client/src/pages/settings.gleam
··· 500 500 event.on_input(fn(_) { SelectLexiconFile }), 501 501 ]), 502 502 ]), 503 + html.p([attribute.class("text-sm text-zinc-500 mb-2")], [ 504 + element.text("Upload a ZIP file containing your lexicon JSON files."), 505 + ]), 503 506 html.p([attribute.class("text-sm text-zinc-500 mb-4")], [ 504 - element.text("Upload a ZIP file containing lexicon JSON files."), 507 + element.text( 508 + "NOTE: If you're swapping out lexicons with a totally new set, consider using RESET instead to clear all records as well.", 509 + ), 505 510 ]), 506 511 html.div([attribute.class("flex gap-3")], [ 507 512 button.button(disabled: False, on_click: UploadLexicons, text: "Upload"),
+168
dev-docs/plans/2025-12-10-wipe-and-replace-lexicon-import.md
··· 1 + # Wipe-and-Replace Lexicon Import Implementation Plan 2 + 3 + > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. 4 + 5 + **Goal:** Change lexicon import to be declarative - the uploaded ZIP defines the complete set of lexicons, wiping any existing ones. 6 + 7 + **Architecture:** Modify `import_lexicons_from_directory()` to call `delete_all()` after validation passes but before inserting. Remove unused CLI import command. 8 + 9 + **Tech Stack:** Gleam, SQLite, existing `lexicons.delete_all()` function 10 + 11 + --- 12 + 13 + ## Task 1: Add delete_all call to importer after validation 14 + 15 + **Files:** 16 + - Modify: `server/src/importer.gleam:83-91` 17 + 18 + **Step 1: Add delete_all call after validation succeeds** 19 + 20 + In `import_lexicons_from_directory()`, after the line `use _ <- result.try(validation_result)` (line 83) and before the comment `// Validation succeeded, import each lexicon` (line 85), add: 21 + 22 + ```gleam 23 + // Wipe existing lexicons before importing new set 24 + logging.log(logging.Info, "[import] Wiping existing lexicons...") 25 + case lexicons.delete_all(db) { 26 + Ok(_) -> Nil 27 + Error(err) -> { 28 + logging.log( 29 + logging.Error, 30 + "[import] Failed to delete existing lexicons: " 31 + <> string.inspect(err), 32 + ) 33 + } 34 + } 35 + ``` 36 + 37 + The full section (lines 79-91) should become: 38 + 39 + ```gleam 40 + logging.log(logging.Info, "") 41 + logging.log(logging.Info, "[import] Importing lexicons to database...") 42 + 43 + // If validation failed, return error immediately 44 + use _ <- result.try(validation_result) 45 + 46 + // Wipe existing lexicons before importing new set 47 + logging.log(logging.Info, "[import] Wiping existing lexicons...") 48 + case lexicons.delete_all(db) { 49 + Ok(_) -> Nil 50 + Error(err) -> { 51 + logging.log( 52 + logging.Error, 53 + "[import] Failed to delete existing lexicons: " 54 + <> string.inspect(err), 55 + ) 56 + } 57 + } 58 + 59 + // Validation succeeded, import each lexicon 60 + let results = 61 + file_contents 62 + |> list.map(fn(pair) { 63 + let #(file_path, json_content) = pair 64 + import_validated_lexicon(db, file_path, json_content) 65 + }) 66 + ``` 67 + 68 + **Step 2: Verify it compiles** 69 + 70 + Run: `cd /Users/chadmiller/code/quickslice/server && gleam build` 71 + Expected: Build succeeds with no errors 72 + 73 + **Step 3: Commit** 74 + 75 + ```bash 76 + git add server/src/importer.gleam 77 + git commit -m "feat: wipe existing lexicons before import 78 + 79 + Import is now declarative - the uploaded set defines the complete 80 + set of lexicons. Old lexicons not in the new set are removed." 81 + ``` 82 + 83 + --- 84 + 85 + ## Task 2: Remove CLI import command from server.gleam 86 + 87 + **Files:** 88 + - Modify: `server/src/server.gleam:39,66-117` 89 + 90 + **Step 1: Remove the importer import** 91 + 92 + Delete line 39: 93 + ```gleam 94 + import importer 95 + ``` 96 + 97 + **Step 2: Remove the import command case and function** 98 + 99 + In the `main()` function (lines 66-72), change from: 100 + 101 + ```gleam 102 + pub fn main() { 103 + // Check for CLI arguments 104 + case argv.load().arguments { 105 + ["import", directory] -> run_import_command(directory) 106 + ["backfill"] -> run_backfill_command() 107 + _ -> start_server_normally() 108 + } 109 + } 110 + ``` 111 + 112 + To: 113 + 114 + ```gleam 115 + pub fn main() { 116 + // Check for CLI arguments 117 + case argv.load().arguments { 118 + ["backfill"] -> run_backfill_command() 119 + _ -> start_server_normally() 120 + } 121 + } 122 + ``` 123 + 124 + **Step 3: Delete the run_import_command function** 125 + 126 + Delete lines 75-117 (the entire `run_import_command` function): 127 + 128 + ```gleam 129 + fn run_import_command(directory: String) { 130 + logging.log(logging.Info, "Importing lexicons from: " <> directory) 131 + // ... entire function ... 132 + } 133 + ``` 134 + 135 + **Step 4: Verify it compiles** 136 + 137 + Run: `cd /Users/chadmiller/code/quickslice/server && gleam build` 138 + Expected: Build succeeds with no errors (may have warning about unused import if importer is used elsewhere) 139 + 140 + **Step 5: Commit** 141 + 142 + ```bash 143 + git add server/src/server.gleam 144 + git commit -m "chore: remove unused CLI import command 145 + 146 + The settings UI is the only supported way to import lexicons." 147 + ``` 148 + 149 + --- 150 + 151 + ## Task 3: Verify end-to-end behavior 152 + 153 + **Step 1: Run tests** 154 + 155 + Run: `cd /Users/chadmiller/code/quickslice/server && gleam test` 156 + Expected: All tests pass 157 + 158 + **Step 2: Manual verification (optional)** 159 + 160 + If you have a running server: 161 + 1. Import a set of lexicons via settings UI 162 + 2. Verify they appear 163 + 3. Import a different/smaller set 164 + 4. Verify only the new set exists (old ones are gone) 165 + 166 + **Step 3: Final commit if any cleanup needed** 167 + 168 + If tests revealed issues, fix and commit.
+5 -5
server/priv/static/quickslice_client.js
··· 2 2 `,"\v","\f","\r","…","\u2028","\u2029"].join(""),Bv=new RegExp(`^[${Yy}]*`),Ov=new RegExp(`[${Yy}]*$`);function Xy(Z){return Z.replace(Bv,"")}function zR(Z){return Z.replace(Ov,"")}function C5(Z){console.log(Z)}function h0(){return Y1.new()}function TJ(Z){return Z.size}function i8(Z){return n0.fromArray(Z.entries())}function kL(Z,J){return J.delete(Z)}function T0(Z,J){let K=Z.get(J,oL);if(K===oL)return new v(EZ);return new E(K)}function bL(Z,J,K){return K.set(Z,J)}function Tv(Z){return decodeURIComponent(Z||"")}function Zy(Z){return decodeURIComponent((Z||"").replace("+"," "))}function NR(Z){try{return new E(Tv(Z))}catch{return new v(EZ)}}function UJ(Z){try{let J=[];for(let K of Z.split("&")){let[X,W]=K.split("=");if(!X)continue;let Y=Zy(X),V=Zy(W);J.push([Y,V])}return new E(n0.fromArray(J))}catch{return new v(EZ)}}function s8(Z){if(typeof Z==="string")return"String";else if(typeof Z==="boolean")return"Bool";else if(Z instanceof l5)return"Result";else if(Z instanceof n0)return"List";else if(Z instanceof TZ)return"BitArray";else if(Z instanceof Y1)return"Dict";else if(Number.isInteger(Z))return"Int";else if(Array.isArray(Z))return"Array";else if(typeof Z==="number")return"Float";else if(Z===null)return"Nil";else if(Z===void 0)return"Nil";else{let J=typeof Z;return J.charAt(0).toUpperCase()+J.slice(1)}}function Wy(Z){return new Qy().inspect(Z)}function c0(Z){let J=Z.toString().replace("+","");if(J.indexOf(".")>=0)return J;else{let K=J.indexOf("e");if(K>=0)return J.slice(0,K)+".0"+J.slice(K);else return J+".0"}}class Qy{#Z=new Set;inspect(Z){let J=typeof Z;if(Z===!0)return"True";if(Z===!1)return"False";if(Z===null)return"//js(null)";if(Z===void 0)return"Nil";if(J==="string")return this.#W(Z);if(J==="bigint"||Number.isInteger(Z))return Z.toString();if(J==="number")return c0(Z);if(Z instanceof gM)return this.#Q(Z);if(Z instanceof TZ)return this.#G(Z);if(Z instanceof RegExp)return`//js(${Z})`;if(Z instanceof Date)return`//js(Date("${Z.toISOString()}"))`;if(Z instanceof globalThis.Error)return`//js(${Z.toString()})`;if(Z instanceof Function){let X=[];for(let W of Array(Z.length).keys())X.push(String.fromCharCode(W+97));return`//fn(${X.join(", ")}) { ... }`}if(this.#Z.size===this.#Z.add(Z).size)return"//js(circular reference)";let K;if(Array.isArray(Z))K=`#(${Z.map((X)=>this.inspect(X)).join(", ")})`;else if(Z instanceof n0)K=this.#J(Z);else if(Z instanceof O)K=this.#Y(Z);else if(Z instanceof Y1)K=this.#K(Z);else if(Z instanceof Set)return`//js(Set(${[...Z].map((X)=>this.inspect(X)).join(", ")}))`;else K=this.#X(Z);return this.#Z.delete(Z),K}#X(Z){let J=Object.getPrototypeOf(Z)?.constructor?.name||"Object",K=[];for(let Y of Object.keys(Z))K.push(`${this.inspect(Y)}: ${this.inspect(Z[Y])}`);let X=K.length?" "+K.join(", ")+" ":"";return`//js(${J==="Object"?"":J+" "}{${X}})`}#K(Z){let J="dict.from_list([",K=!0;return Z.forEach((X,W)=>{if(!K)J=J+", ";J=J+"#("+this.inspect(W)+", "+this.inspect(X)+")",K=!1}),J+"])"}#Y(Z){let J=Object.keys(Z).map((K)=>{let X=this.inspect(Z[K]);return isNaN(parseInt(K))?`${K}: ${X}`:X}).join(", ");return J?`${Z.constructor.name}(${J})`:Z.constructor.name}#J(Z){if(Z instanceof M)return"[]";let J='charlist.from_string("',K="[",X=Z;while(X instanceof f1){let W=X.head;if(X=X.tail,K!=="[")K+=", ";if(K+=this.inspect(W),J)if(Number.isInteger(W)&&W>=32&&W<=126)J+=String.fromCharCode(W);else J=null}if(J)return J+'")';else return K+"]"}#W(Z){let J='"';for(let K=0;K<Z.length;K++){let X=Z[K];switch(X){case` 3 3 `:J+="\\n";break;case"\r":J+="\\r";break;case"\t":J+="\\t";break;case"\f":J+="\\f";break;case"\\":J+="\\\\";break;case'"':J+="\\\"";break;default:if(X<" "||X>"~"&&X<" ")J+="\\u{"+X.charCodeAt(0).toString(16).toUpperCase().padStart(4,"0")+"}";else J+=X}}return J+='"',J}#Q(Z){return`//utfcodepoint(${String.fromCodePoint(Z.value)})`}#G(Z){if(Z.bitSize===0)return"<<>>";let J="<<";for(let K=0;K<Z.byteSize-1;K++)J+=Z.byteAt(K).toString(),J+=", ";if(Z.byteSize*8===Z.bitSize)J+=Z.byteAt(Z.byteSize-1).toString();else{let K=Z.bitSize%8;J+=Z.byteAt(Z.byteSize-1)>>8-K,J+=`:size(${K})`}return J+=">>",J}}function nL(Z,J){if(Z instanceof Y1||Z instanceof WeakMap||Z instanceof Map){let X={},W=Z.get(J,X);if(W===X)return new E(new h);return new E(new L(W))}let K=Number.isInteger(J);if(K&&J>=0&&J<8&&Z instanceof n0){let X=0;for(let W of Z){if(X===J)return new E(new L(W));X++}return new v("Indexable")}if(K&&Array.isArray(Z)||Z&&typeof Z==="object"||Z&&Object.getPrototypeOf(Z)===Object.prototype){if(J in Z)return new E(new L(Z[J]));return new E(new h)}return new v(K?"Indexable":"Dict")}function iL(Z,J,K,X,W){if(!(Z instanceof n0||Array.isArray(Z))){let V=new r8("List",s8(Z),W);return[W,n0.fromArray([V])]}let Y=[];for(let V of Z){let G=J(V),[I,z]=G;if(z instanceof f1){let[N,F]=K(G,X.toString());return[W,F]}Y.push(I),X++}return[n0.fromArray(Y),W]}function sL(Z){if(Z instanceof Y1)return new E(Z);if(Z instanceof Map||Z instanceof WeakMap)return new E(Y1.fromMap(Z));if(Z==null)return new v("Dict");if(typeof Z!=="object")return new v("Dict");let J=Object.getPrototypeOf(Z);if(J===Object.prototype||J===null)return new E(Y1.fromObject(Z));return new v("Dict")}function lL(Z){if(typeof Z==="number")return new E(Z);return new v(0)}function rL(Z){if(Number.isInteger(Z))return new E(Z);return new v(0)}function aL(Z){if(typeof Z==="string")return new E(Z);return new v("")}function tL(Z){return Z===null||Z===void 0}function MJ(Z,J){if(Z>J)return Z;else return J}function Gy(Z,J,K){if(K<=0)return"";else if(J<0){let Y=Y8(Z)+J;if(Y<0)return"";else return IR(Z,Y,K)}else return IR(Z,J,K)}function Cv(Z,J){while(!0){let K=Z,X=J;if(K instanceof M)return X;else{let W=K.head;Z=K.tail,J=X+W}}}function xZ(Z){return Cv(Z,"")}function xv(Z,J,K){while(!0){let X=Z,W=J,Y=K;if(X instanceof M)return Y;else{let V=X.head;Z=X.tail,J=W,K=Y+W+V}}}function a8(Z,J){if(Z instanceof M)return"";else{let{head:K,tail:X}=Z;return xv(X,J,K)}}function J4(Z){let K=Xy(Z);return zR(K)}function K4(Z,J){if(J==="")return CZ(Z);else{let X=N0(Z),W=GR(X,J);return H0(W,N0)}}function jJ(Z){let K=Wy(Z);return N0(K)}function Ny(Z){if(Z instanceof E)return!0;else return!1}function FR(Z,J){if(Z instanceof E){let K=Z[0];return new E(J(K))}else return Z}function Y4(Z,J){if(Z instanceof E)return Z;else{let K=Z[0];return new v(J(K))}}function M1(Z,J){if(Z instanceof E){let K=Z[0];return J(K)}else return Z}function F8(Z,J){if(Z instanceof E)return Z[0];else return J}function Fy(Z){return S5(Z,(J)=>{return J})}function HR(Z){return JSON.stringify(Z)}function Hy(Z){return Object.fromEntries(Z)}function t8(Z){return Z}function Dy(Z){let J=[];while(qL(Z))J.push(EL(Z)),Z=CL(Z);return J}function By(){return null}function Oy(Z){try{let J=JSON.parse(Z);return xL(J)}catch(J){return wL(jv(J,Z))}}function jv(Z,J){if(Lv(Z))return Ty();return yv(Z,J)}function Lv(Z){return/((unexpected (end|eof))|(end of data)|(unterminated string)|(json( parse error|\.parse)\: expected '(\:|\}|\])'))/i.test(Z.message)}function yv(Z,J){let K=[fv,kv,hv,bv];for(let X of K){let W=X(Z,J);if(W)return W}return X4("")}function fv(Z){let K=/unexpected token '(.)', ".+" is not valid JSON/i.exec(Z.message);if(!K)return null;let X=LJ(K[1]);return X4(X)}function kv(Z){let K=/unexpected token (.) in JSON at position (\d+)/i.exec(Z.message);if(!K)return null;let X=LJ(K[1]);return X4(X)}function bv(Z,J){let X=/(unexpected character|expected .*) at line (\d+) column (\d+)/i.exec(Z.message);if(!X)return null;let W=Number(X[2]),Y=Number(X[3]),V=vv(W,Y,J),G=LJ(J[V]);return X4(G)}function hv(Z){let K=/unexpected (identifier|token) "(.)"/i.exec(Z.message);if(!K)return null;let X=LJ(K[2]);return X4(X)}function LJ(Z){return"0x"+Z.charCodeAt(0).toString(16).toUpperCase()}function vv(Z,J,K){if(Z===1)return J-1;let X=1,W=0;return K.split("").find((Y,V)=>{if(Y===` 4 4 `)X+=1;if(X===Z)return W=V+J,!0;return!1}),W}class Py extends O{}var Ty=()=>new Py;class Sy extends O{constructor(Z){super();this[0]=Z}}var X4=(Z)=>new Sy(Z);class Ay extends O{constructor(Z){super();this[0]=Z}}function gv(Z,J){return M1(Oy(Z),(K)=>{let X=z0(K,J);return Y4(X,(W)=>{return new Ay(W)})})}function l1(Z,J){return gv(Z,J)}function j8(Z){return HR(Z)}function c(Z){return t8(Z)}function r1(Z){return t8(Z)}function X1(Z){return t8(Z)}function qy(Z){return t8(Z)}function DR(){return By()}function b(Z){return Hy(Z)}function Ey(Z){return Dy(Z)}function j0(Z,J){let X=H0(Z,J);return Ey(X)}class yJ extends O{constructor(Z){super();this.dict=Z}}function x5(){return new yJ(h0())}function W4(Z,J){let K=Z.dict,X=T0(K,J);return Ny(X)}function Cy(Z,J){return new yJ(N8(Z.dict,J))}function xy(Z){return M8(Z.dict)}var _v=void 0;function wZ(Z,J){return new yJ(i0(Z.dict,J,_v))}class V0 extends O{constructor(Z,J,K,X,W,Y,V){super();this.scheme=Z,this.userinfo=J,this.host=K,this.port=X,this.path=W,this.query=Y,this.fragment=V}}function uv(Z){return 48>=Z&&Z<=57||65>=Z&&Z<=90||97>=Z&&Z<=122||Z===58||Z===46}function X8(Z,J){return new E(new V0(J.scheme,J.userinfo,J.host,J.port,J.path,J.query,new L(Z)))}function dv(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y.startsWith("#"))if(G===0){let I=Y.slice(1);return X8(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,V.host,V.port,V.path,new L(z),V.fragment);return X8(I,N)}else if(Y==="")return new E(new V0(V.scheme,V.userinfo,V.host,V.port,V.path,new L(W),V.fragment));else{let I=q5(Y),z;z=I[1],Z=W,J=z,K=V,X=G+1}}}function L8(Z,J){return dv(Z,Z,J,0)}function cv(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y.startsWith("?")){let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,V.host,V.port,z,V.query,V.fragment);return L8(I,N)}else if(Y.startsWith("#")){let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,V.host,V.port,z,V.query,V.fragment);return X8(I,N)}else if(Y==="")return new E(new V0(V.scheme,V.userinfo,V.host,V.port,W,V.query,V.fragment));else{let I=q5(Y),z;z=I[1],Z=W,J=z,K=V,X=G+1}}}function w5(Z,J){return cv(Z,Z,J,0)}function H8(Z,J,K){while(!0){let X=Z,W=J,Y=K;if(X.startsWith("0"))Z=X.slice(1),J=W,K=Y*10;else if(X.startsWith("1"))Z=X.slice(1),J=W,K=Y*10+1;else if(X.startsWith("2"))Z=X.slice(1),J=W,K=Y*10+2;else if(X.startsWith("3"))Z=X.slice(1),J=W,K=Y*10+3;else if(X.startsWith("4"))Z=X.slice(1),J=W,K=Y*10+4;else if(X.startsWith("5"))Z=X.slice(1),J=W,K=Y*10+5;else if(X.startsWith("6"))Z=X.slice(1),J=W,K=Y*10+6;else if(X.startsWith("7"))Z=X.slice(1),J=W,K=Y*10+7;else if(X.startsWith("8"))Z=X.slice(1),J=W,K=Y*10+8;else if(X.startsWith("9"))Z=X.slice(1),J=W,K=Y*10+9;else if(X.startsWith("?")){let V=X.slice(1),G=new V0(W.scheme,W.userinfo,W.host,new L(Y),W.path,W.query,W.fragment);return L8(V,G)}else if(X.startsWith("#")){let V=X.slice(1),G=new V0(W.scheme,W.userinfo,W.host,new L(Y),W.path,W.query,W.fragment);return X8(V,G)}else if(X.startsWith("/")){let V=new V0(W.scheme,W.userinfo,W.host,new L(Y),W.path,W.query,W.fragment);return w5(X,V)}else if(X==="")return new E(new V0(W.scheme,W.userinfo,W.host,new L(Y),W.path,W.query,W.fragment));else return new v(void 0)}}function fJ(Z,J){if(Z.startsWith(":0")){let K=Z.slice(2);return H8(K,J,0)}else if(Z.startsWith(":1")){let K=Z.slice(2);return H8(K,J,1)}else if(Z.startsWith(":2")){let K=Z.slice(2);return H8(K,J,2)}else if(Z.startsWith(":3")){let K=Z.slice(2);return H8(K,J,3)}else if(Z.startsWith(":4")){let K=Z.slice(2);return H8(K,J,4)}else if(Z.startsWith(":5")){let K=Z.slice(2);return H8(K,J,5)}else if(Z.startsWith(":6")){let K=Z.slice(2);return H8(K,J,6)}else if(Z.startsWith(":7")){let K=Z.slice(2);return H8(K,J,7)}else if(Z.startsWith(":8")){let K=Z.slice(2);return H8(K,J,8)}else if(Z.startsWith(":9")){let K=Z.slice(2);return H8(K,J,9)}else if(Z===":")return new E(J);else if(Z==="")return new E(J);else if(Z.startsWith("?")){let K=Z.slice(1);return L8(K,J)}else if(Z.startsWith(":?")){let K=Z.slice(2);return L8(K,J)}else if(Z.startsWith("#")){let K=Z.slice(1);return X8(K,J)}else if(Z.startsWith(":#")){let K=Z.slice(2);return X8(K,J)}else if(Z.startsWith("/"))return w5(Z,J);else if(Z.startsWith(":")){let K=Z.slice(1);if(K.startsWith("/"))return w5(K,J);else return new v(void 0)}else return new v(void 0)}function wy(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y==="")return new E(new V0(V.scheme,V.userinfo,new L(W),V.port,V.path,V.query,V.fragment));else if(Y.startsWith(":")){let I=G1(W,0,G),z=new V0(V.scheme,V.userinfo,new L(I),V.port,V.path,V.query,V.fragment);return fJ(Y,z)}else if(Y.startsWith("/")){let I=G1(W,0,G),z=new V0(V.scheme,V.userinfo,new L(I),V.port,V.path,V.query,V.fragment);return w5(Y,z)}else if(Y.startsWith("?")){let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,new L(z),V.port,V.path,V.query,V.fragment);return L8(I,N)}else if(Y.startsWith("#")){let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,new L(z),V.port,V.path,V.query,V.fragment);return X8(I,N)}else{let I=q5(Y),z;z=I[1],Z=W,J=z,K=V,X=G+1}}}function pv(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y==="")return new E(new V0(V.scheme,V.userinfo,new L(Y),V.port,V.path,V.query,V.fragment));else if(Y.startsWith("]"))if(G===0){let I=Y.slice(1);return fJ(I,V)}else{let I=Y.slice(1),z=G1(W,0,G+1),N=new V0(V.scheme,V.userinfo,new L(z),V.port,V.path,V.query,V.fragment);return fJ(I,N)}else if(Y.startsWith("/"))if(G===0)return w5(Y,V);else{let I=G1(W,0,G),z=new V0(V.scheme,V.userinfo,new L(I),V.port,V.path,V.query,V.fragment);return w5(Y,z)}else if(Y.startsWith("?"))if(G===0){let I=Y.slice(1);return L8(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,new L(z),V.port,V.path,V.query,V.fragment);return L8(I,N)}else if(Y.startsWith("#"))if(G===0){let I=Y.slice(1);return X8(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,V.userinfo,new L(z),V.port,V.path,V.query,V.fragment);return X8(I,N)}else{let I=q5(Y),z,N;if(z=I[0],N=I[1],uv(z))Z=W,J=N,K=V,X=G+1;else return wy(W,W,V,0)}}}function nv(Z,J){return pv(Z,Z,J,0)}function iv(Z,J){return wy(Z,Z,J,0)}function Q4(Z,J){if(Z.startsWith("["))return nv(Z,J);else if(Z.startsWith(":")){let K=new V0(J.scheme,J.userinfo,new L(""),J.port,J.path,J.query,J.fragment);return fJ(Z,K)}else if(Z==="")return new E(new V0(J.scheme,J.userinfo,new L(""),J.port,J.path,J.query,J.fragment));else return iv(Z,J)}function sv(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y.startsWith("@"))if(G===0){let I=Y.slice(1);return Q4(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(V.scheme,new L(z),V.host,V.port,V.path,V.query,V.fragment);return Q4(I,N)}else if(Y==="")return Q4(W,V);else if(Y.startsWith("/"))return Q4(W,V);else if(Y.startsWith("?"))return Q4(W,V);else if(Y.startsWith("#"))return Q4(W,V);else{let I=q5(Y),z;z=I[1],Z=W,J=z,K=V,X=G+1}}}function lv(Z,J){return sv(Z,Z,J,0)}function BR(Z,J){if(Z==="//")return new E(new V0(J.scheme,J.userinfo,new L(""),J.port,J.path,J.query,J.fragment));else if(Z.startsWith("//")){let K=Z.slice(2);return lv(K,J)}else return w5(Z,J)}function rv(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(Y.startsWith("/"))if(G===0)return BR(Y,V);else{let I=G1(W,0,G),z=new V0(new L(s1(I)),V.userinfo,V.host,V.port,V.path,V.query,V.fragment);return BR(Y,z)}else if(Y.startsWith("?"))if(G===0){let I=Y.slice(1);return L8(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(new L(s1(z)),V.userinfo,V.host,V.port,V.path,V.query,V.fragment);return L8(I,N)}else if(Y.startsWith("#"))if(G===0){let I=Y.slice(1);return X8(I,V)}else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(new L(s1(z)),V.userinfo,V.host,V.port,V.path,V.query,V.fragment);return X8(I,N)}else if(Y.startsWith(":"))if(G===0)return new v(void 0);else{let I=Y.slice(1),z=G1(W,0,G),N=new V0(new L(s1(z)),V.userinfo,V.host,V.port,V.path,V.query,V.fragment);return BR(I,N)}else if(Y==="")return new E(new V0(V.scheme,V.userinfo,V.host,V.port,W,V.query,V.fragment));else{let I=q5(Y),z;z=I[1],Z=W,J=z,K=V,X=G+1}}}function kJ(Z){let J,K=Z.fragment;if(K instanceof L){let w=K[0];J=Q(["#",w])}else J=Q([]);let X=J,W,Y=Z.query;if(Y instanceof L){let w=Y[0];W=A("?",A(w,X))}else W=X;let V=W,G=A(Z.path,V),I,z=Z.host,N=e5(Z.path,"/");if(z instanceof L&&!N)if(z[0]!=="")I=A("/",G);else I=G;else I=G;let F=I,D,B=Z.host,T=Z.port;if(B instanceof L&&T instanceof L){let w=T[0];D=A(":",A(A1(w),F))}else D=F;let P=D,S,q=Z.scheme,C=Z.userinfo,U=Z.host;if(q instanceof L)if(C instanceof L)if(U instanceof L){let w=q[0],f=C[0],$=U[0];S=A(w,A("://",A(f,A("@",A($,P)))))}else{let w=q[0];S=A(w,A(":",P))}else if(U instanceof L){let w=q[0],f=U[0];S=A(w,A("://",A(f,P)))}else{let w=q[0];S=A(w,A(":",P))}else if(C instanceof h&&U instanceof L){let w=U[0];S=A("//",A(w,P))}else S=P;return xZ(S)}var av=new V0(new h,new h,new h,new h,"",new h,new h);function OR(Z){return rv(Z,Z,av,0)}function V4(Z,J,K){if(Z)return J;else return K()}function S0(Z){return Z}var a1=()=>globalThis?.document,hJ="http://www.w3.org/1999/xhtml",vJ=1,SR=3;var jy=!!globalThis.HTMLElement?.prototype?.moveBefore;var e=Q([]),gJ=new h;var Zg=new U8,Jg=new a0,Kg=new t0;function $J(Z,J){if(Z.name===J.name)return Kg;else if(Z.name<J.name)return Jg;else return Zg}class t1 extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class MZ extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class B1 extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.kind=Z,this.name=J,this.handler=K,this.include=X,this.prevent_default=W,this.stop_propagation=Y,this.debounce=V,this.throttle=G}}class RZ extends O{constructor(Z,J,K){super();this.prevent_default=Z,this.stop_propagation=J,this.message=K}}class by extends O{constructor(Z){super();this.kind=Z}}class hy extends O{constructor(Z){super();this.kind=Z}}function Gg(Z,J){while(!0){let K=Z,X=J;if(K instanceof M)return X;else{let W=K.head;if(W instanceof t1){let Y=W.name;if(Y==="")Z=K.tail,J=X;else if(Y==="class"){let V=W.value;if(V==="")Z=K.tail,J=X;else{let G=K.tail;if(G instanceof M){let I=W;Z=G,J=A(I,X)}else{let I=G.head;if(I instanceof t1)if(I.name==="class"){let N=W.kind,F=V,D=G.tail,B=I.value,T=F+" "+B,P=new t1(N,"class",T);Z=A(P,D),J=X}else{let N=W;Z=G,J=A(N,X)}else{let z=W;Z=G,J=A(z,X)}}}}else if(Y==="style"){let V=W.value;if(V==="")Z=K.tail,J=X;else{let G=K.tail;if(G instanceof M){let I=W;Z=G,J=A(I,X)}else{let I=G.head;if(I instanceof t1)if(I.name==="style"){let N=W.kind,F=V,D=G.tail,B=I.value,T=F+";"+B,P=new t1(N,"style",T);Z=A(P,D),J=X}else{let N=W;Z=G,J=A(N,X)}else{let z=W;Z=G,J=A(z,X)}}}}else{let V=W;Z=K.tail,J=A(V,X)}}else{let Y=W;Z=K.tail,J=A(Y,X)}}}}function vy(Z){if(Z instanceof M)return Z;else if(Z.tail instanceof M)return Z;else{let X=KR(Z,(W,Y)=>{return $J(Y,W)});return Gg(X,e)}}var qR=0;function gy(Z,J){return new t1(qR,Z,J)}var ER=1;function $y(Z,J){return new MZ(ER,Z,J)}var CR=2;function _y(Z,J,K,X,W,Y,V){return new B1(CR,Z,J,K,X,W,Y,V)}var xR=0;var wR=new by(xR);var _J=2,my=new hy(_J);function R(Z,J){return gy(Z,J)}function UR(Z,J){return $y(Z,J)}function MR(Z,J){if(J)return R(Z,"");else return UR(Z,r1(!1))}function H(Z){return R("class",Z)}function B8(Z){return R("id",Z)}function h1(Z){return R("href",Z)}function uy(Z){return R("alt",Z)}function dy(Z){return R("src",Z)}function U5(Z){return R("action",Z)}function M5(Z){return R("method",Z)}function cy(Z){return R("accept",a8(Z,","))}function jZ(Z){return MR("disabled",Z)}function py(Z){return R("name",Z)}function q1(Z){return R("placeholder",Z)}function e8(Z){return MR("required",Z)}function RR(Z){return MR("selected",Z)}function M0(Z){return R("type",Z)}function o0(Z){return R("value",Z)}class LZ extends O{constructor(Z,J,K){super();this.synchronous=Z,this.before_paint=J,this.after_paint=K}}class LR extends O{constructor(Z,J,K,X,W){super();this.dispatch=Z,this.emit=J,this.select=K,this.root=X,this.provide=W}}function Ig(Z,J,K){return}function zg(Z,J){return new LR((K)=>{return Z.dispatch(J(K))},Z.emit,(K)=>{return Ig(Z,K,J)},Z.root,Z.provide)}function jR(Z,J){return H0(Z,(K)=>{return(X)=>{return K(zg(X,J))}})}function yR(Z,J){return new LZ(jR(Z.synchronous,J),jR(Z.before_paint,J),jR(Z.after_paint,J))}function ny(Z,J,K,X,W,Y){let V=new LR(J,K,X,W,Y);return _L(Z.synchronous,(G)=>{return G(V)})}var mJ=new LZ(Q([]),Q([]),Q([]));function i(){return mJ}function I1(Z){return new LZ(Q([(K)=>{let X=K.dispatch;return Z(X)}]),mJ.before_paint,mJ.after_paint)}function W1(Z){return v0(Z,mJ,(J,K)=>{return new LZ(v0(K.synchronous,J.synchronous,AJ),v0(K.before_paint,J.before_paint,AJ),v0(K.after_paint,J.after_paint,AJ))})}function E1(){return null}function yZ(Z,J){let K=Z?.get(J);if(K!=null)return new E(K);else return new v(void 0)}function fZ(Z,J){return Z&&Z.has(J)}function R5(Z,J,K){return Z??=new Map,Z.set(J,K),Z}function fR(Z,J){return Z?.delete(J),Z}class kR extends O{}class bR extends O{constructor(Z,J){super();this.key=Z,this.parent=J}}class iy extends O{constructor(Z,J){super();this.index=Z,this.parent=J}}function Ng(Z,J){while(!0){let K=Z,X=J;if(X instanceof M)return!1;else{let{head:W,tail:Y}=X,V=e5(K,W);if(V)return V;else Z=K,J=Y}}}function e1(Z,J,K){if(K==="")return new iy(J,Z);else return new bR(K,Z)}var I4=new kR,bZ="\t";function sy(Z,J){while(!0){let K=Z,X=J;if(K instanceof kR)if(X instanceof M)return"";else{let W=X.tail;return xZ(W)}else if(K instanceof bR){let W=K.key;Z=K.parent,J=A(bZ,A(W,X))}else{let W=K.index;Z=K.parent,J=A(bZ,A(A1(W),X))}}}function ly(Z){return sy(Z,Q([]))}function ry(Z,J){if(J instanceof M)return!1;else return Ng(ly(Z),J)}var hR=` 5 - `;function vR(Z,J){return sy(Z,Q([hR,J]))}class R1 extends O{constructor(Z,J,K,X,W){super();this.kind=Z,this.key=J,this.mapper=K,this.children=X,this.keyed_children=W}}class C1 extends O{constructor(Z,J,K,X,W,Y,V,G,I,z){super();this.kind=Z,this.key=J,this.mapper=K,this.namespace=X,this.tag=W,this.attributes=Y,this.children=V,this.keyed_children=G,this.self_closing=I,this.void=z}}class v1 extends O{constructor(Z,J,K,X){super();this.kind=Z,this.key=J,this.mapper=K,this.content=X}}class Z5 extends O{constructor(Z,J,K,X,W,Y,V){super();this.kind=Z,this.key=J,this.mapper=K,this.namespace=X,this.tag=W,this.attributes=Y,this.inner_html=V}}function z4(Z,J){if(J==="")if(Z==="area")return!0;else if(Z==="base")return!0;else if(Z==="br")return!0;else if(Z==="col")return!0;else if(Z==="embed")return!0;else if(Z==="hr")return!0;else if(Z==="img")return!0;else if(Z==="input")return!0;else if(Z==="link")return!0;else if(Z==="meta")return!0;else if(Z==="param")return!0;else if(Z==="source")return!0;else if(Z==="track")return!0;else if(Z==="wbr")return!0;else return!1;else return!1}function ay(Z,J){if(J instanceof R1)return new R1(J.kind,Z,J.mapper,J.children,J.keyed_children);else if(J instanceof C1)return new C1(J.kind,Z,J.mapper,J.namespace,J.tag,J.attributes,J.children,J.keyed_children,J.self_closing,J.void);else if(J instanceof v1)return new v1(J.kind,Z,J.mapper,J.content);else return new Z5(J.kind,Z,J.mapper,J.namespace,J.tag,J.attributes,J.inner_html)}var W8=0;function dJ(Z,J,K,X){return new R1(W8,Z,J,K,X)}var j5=1;function N4(Z,J,K,X,W,Y,V,G,I){return new C1(j5,Z,J,K,X,vy(W),Y,V,G,I)}var F4=2;function gR(Z,J,K){return new v1(F4,Z,J,K)}var ty=3;var $R=(Z,J)=>Z===J,Q8=(Z,J)=>{if(Z===J)return!0;if(Z==null||J==null)return!1;let K=typeof Z;if(K!==typeof J)return!1;if(K!=="object")return!1;if(Z.constructor!==J.constructor)return!1;if(Array.isArray(Z))return Dg(Z,J);return Bg(Z,J)},Dg=(Z,J)=>{let K=Z.length;if(K!==J.length)return!1;while(K--)if(!Q8(Z[K],J[K]))return!1;return!0},Bg=(Z,J)=>{let K=Object.keys(Z),X=K.length;if(Object.keys(J).length!==X)return!1;while(X--){let W=K[X];if(!Object.hasOwn(J,W))return!1;if(!Q8(Z[W],J[W]))return!1}return!0};class k8 extends O{constructor(Z,J,K){super();this.handlers=Z,this.dispatched_paths=J,this.next_dispatched_paths=K}}class uR extends O{constructor(Z,J){super();this.path=Z,this.handler=J}}class _R extends O{constructor(Z){super();this.path=Z}}function dR(){return new k8(E1(),e,e)}function Jf(Z){return new k8(Z.handlers,Z.next_dispatched_paths,e)}function Kf(Z,J,K){return fR(Z,vR(J,K))}function cJ(Z,J,K){let X=Kf(Z.handlers,J,K);return new k8(X,Z.dispatched_paths,Z.next_dispatched_paths)}function oy(Z,J,K){return v0(K,Z,(X,W)=>{if(W instanceof B1){let Y=W.name;return Kf(X,J,Y)}else return X})}function cR(Z,J,K,X){let W=yZ(Z.handlers,J+hR+K);if(W instanceof E){let Y=W[0],V=z0(X,Y);if(V instanceof E){let G=V[0];return new uR(J,G)}else return new _R(J)}else return new _R(J)}function pR(Z,J){let K=A(J.path,Z.next_dispatched_paths),X=new k8(Z.handlers,Z.dispatched_paths,K);if(J instanceof uR){let W=J.handler;return[X,new E(W)]}else return[X,new v(void 0)]}function pJ(Z,J,K,X){let W=cR(Z,J,K,X);return((Y)=>{return pR(Z,Y)})(W)}function nJ(Z,J){return ry(J,Z.dispatched_paths)}function Yf(Z,J,K,X,W){return R5(Z,vR(K,X),A5(W,(Y)=>{return new RZ(Y.prevent_default,Y.stop_propagation,S0(J)(Y.message))}))}function H4(Z,J,K,X,W){let Y=Yf(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function ey(Z,J,K,X){return v0(X,Z,(W,Y)=>{if(Y instanceof B1){let{name:V,handler:G}=Y;return Yf(W,J,K,V,G)}else return W})}function f8(Z,J){let K=$R(Z,S0);if($R(J,S0))return Z;else if(K)return J;else return(W)=>{return Z(J(W))}}function Zf(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(G instanceof M)return W;else{let{head:I,tail:z}=G;Z=Xf(W,Y,V,I),J=Y,K=V+1,X=z}}}function Xf(Z,J,K,X){if(X instanceof R1){let W=X.children,Y=e1(J,K,X.key);return Zf(Z,Y,0,W)}else if(X instanceof C1){let{attributes:W,children:Y}=X,V=e1(J,K,X.key),I=oy(Z,V,W);return Zf(I,V,0,Y)}else if(X instanceof v1)return Z;else{let W=X.attributes,Y=e1(J,K,X.key);return oy(Z,Y,W)}}function b8(Z,J,K,X){let W=Xf(Z.handlers,J,K,X);return new k8(W,Z.dispatched_paths,Z.next_dispatched_paths)}function mR(Z,J,K,X,W){while(!0){let Y=Z,V=J,G=K,I=X,z=W;if(z instanceof M)return Y;else{let{head:N,tail:F}=z;Z=Wf(Y,V,G,I,N),J=V,K=G,X=I+1,W=F}}}function Wf(Z,J,K,X,W){if(W instanceof R1){let Y=W.children,V=e1(K,X,W.key),G=f8(J,W.mapper);return mR(Z,G,V,0,Y)}else if(W instanceof C1){let{attributes:Y,children:V}=W,G=e1(K,X,W.key),I=f8(J,W.mapper),N=ey(Z,I,G,Y);return mR(N,I,G,0,V)}else if(W instanceof v1)return Z;else{let Y=W.attributes,V=e1(K,X,W.key),G=f8(J,W.mapper);return ey(Z,G,V,Y)}}function h8(Z,J,K,X,W){let Y=Wf(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function nR(Z){return h8(dR(),S0,I4,0,Z)}function Qf(Z,J,K,X,W){let Y=mR(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function R0(Z,J,K){return N4("",S0,"",Z,J,K,E1(),!1,z4(Z,""))}function g1(Z,J,K,X){return N4("",S0,Z,J,K,X,E1(),!1,z4(J,Z))}function x(Z){return gR("",S0,Z)}function G0(){return gR("",S0,"")}function Vf(Z){return dJ("",S0,Z,E1())}function hZ(Z,J){let K=S0(f8(S0(J),Z.mapper));if(Z instanceof R1){let{children:X,keyed_children:W}=Z;return new R1(Z.kind,Z.key,K,S0(X),S0(W))}else if(Z instanceof C1){let{attributes:X,children:W,keyed_children:Y}=Z;return new C1(Z.kind,Z.key,K,Z.namespace,Z.tag,S0(X),S0(W),S0(Y),Z.self_closing,Z.void)}else if(Z instanceof v1)return S0(Z);else{let X=Z.attributes;return new Z5(Z.kind,Z.key,K,Z.namespace,Z.tag,S0(X),Z.inner_html)}}function l0(Z){return x(Z)}function $1(Z,J){return R0("h1",Z,J)}function D4(Z,J){return R0("h2",Z,J)}function B4(Z,J){return R0("h3",Z,J)}function j(Z,J){return R0("div",Z,J)}function y5(Z,J){return R0("li",Z,J)}function x0(Z,J){return R0("p",Z,J)}function iJ(Z,J){return R0("pre",Z,J)}function sJ(Z,J){return R0("ul",Z,J)}function _1(Z,J){return R0("a",Z,J)}function v8(Z,J){return R0("code",Z,J)}function n(Z,J){return R0("span",Z,J)}function Gf(Z){return R0("img",Z,e)}function E0(Z,J){return R0("button",Z,J)}function g8(Z,J){return R0("form",Z,J)}function z1(Z){return R0("input",Z,e)}function r0(Z,J){return R0("label",Z,J)}function iR(Z,J){return R0("option",Z,Q([x(J)]))}function If(Z,J){return R0("select",Z,J)}function sR(Z,J){return R0("textarea",A(UR("value",c(J)),Z),Q([x(J)]))}function zf(Z,J){return R0("details",Z,J)}function Nf(Z,J){return R0("summary",Z,J)}class vZ extends O{constructor(Z,J,K,X){super();this.index=Z,this.removed=J,this.changes=K,this.children=X}}class Ff extends O{constructor(Z,J){super();this.kind=Z,this.content=J}}class Hf extends O{constructor(Z,J){super();this.kind=Z,this.inner_html=J}}class Df extends O{constructor(Z,J,K){super();this.kind=Z,this.added=J,this.removed=K}}class Bf extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.before=K}}class Of extends O{constructor(Z,J,K){super();this.kind=Z,this.index=J,this.with=K}}class Tf extends O{constructor(Z,J){super();this.kind=Z,this.index=J}}class Pf extends O{constructor(Z,J,K){super();this.kind=Z,this.children=J,this.before=K}}function lR(Z,J,K,X){return new vZ(Z,J,K,X)}var rR=0;function Sf(Z){return new Ff(rR,Z)}var aR=1;function Af(Z){return new Hf(aR,Z)}var tR=2;function oR(Z,J){return new Df(tR,Z,J)}var eR=3;function qf(Z,J){return new Bf(eR,Z,J)}var Zj=4;function Ef(Z){return new Tf(Zj,Z)}var Jj=5;function f5(Z,J){return new Of(Jj,Z,J)}var Kj=6;function Yj(Z,J){return new Pf(Kj,Z,J)}class xf extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.kind=Z,this.open_shadow_root=J,this.will_adopt_styles=K,this.observed_attributes=X,this.observed_properties=W,this.requested_contexts=Y,this.provided_contexts=V,this.vdom=G}}class wf extends O{constructor(Z,J){super();this.kind=Z,this.patch=J}}class Uf extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.data=K}}class Mf extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.value=K}}class lJ extends O{constructor(Z,J){super();this.kind=Z,this.messages=J}}class rJ extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class aJ extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class tJ extends O{constructor(Z,J,K,X){super();this.kind=Z,this.path=J,this.name=K,this.event=X}}class Xj extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.value=K}}var Pg=0;function Rf(Z,J,K,X,W,Y,V){return new xf(Pg,Z,J,K,X,W,Y,V)}var Sg=1;function Wj(Z){return new wf(Sg,Z)}var Ag=2;function jf(Z,J){return new Uf(Ag,Z,J)}var qg=3;function Lf(Z,J){return new Mf(qg,Z,J)}class oJ extends O{constructor(Z,J){super();this.patch=Z,this.events=J}}class kf extends O{constructor(Z,J,K){super();this.added=Z,this.removed=J,this.events=K}}function Eg(Z,J,K,X){if(K==="input"&&J==="")return nJ(Z,X);else if(K==="select"&&J==="")return nJ(Z,X);else if(K==="textarea"&&J==="")return nJ(Z,X);else return!1}function ff(Z,J,K,X,W,Y,V,G){while(!0){let I=Z,z=J,N=K,F=X,D=W,B=Y,T=V,P=G;if(D instanceof M)if(B instanceof M)return new kf(T,P,F);else{let S=B.head;if(S instanceof B1){let q=S,C=B.tail,U=S.name,k=S.handler,w=A(q,T),f=H4(F,N,z,U,k);Z=I,J=z,K=N,X=f,W=D,Y=C,V=w,G=P}else{let q=S,C=B.tail,U=A(q,T);Z=I,J=z,K=N,X=F,W=D,Y=C,V=U,G=P}}else if(B instanceof M){let S=D.head;if(S instanceof B1){let q=S,C=D.tail,U=S.name,k=A(q,P),w=cJ(F,z,U);Z=I,J=z,K=N,X=w,W=C,Y=B,V=T,G=k}else{let q=S,C=D.tail,U=A(q,P);Z=I,J=z,K=N,X=F,W=C,Y=B,V=T,G=U}}else{let{head:S,tail:q}=D,C=B.head,U=B.tail,k=$J(S,C);if(k instanceof a0)if(S instanceof B1){let w=S.name,f=A(S,P),$=cJ(F,z,w);Z=I,J=z,K=N,X=$,W=q,Y=B,V=T,G=f}else{let w=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=B,V=T,G=w}else if(k instanceof t0)if(S instanceof t1)if(C instanceof t1){let w,f=C.name;if(f==="value")w=I||S.value!==C.value;else if(f==="checked")w=I||S.value!==C.value;else if(f==="selected")w=I||S.value!==C.value;else w=S.value!==C.value;let $=w,d;if($)d=A(C,T);else d=T;let p=d;Z=I,J=z,K=N,X=F,W=q,Y=U,V=p,G=P}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=A(S,P),p=H4(F,N,z,w,f);Z=I,J=z,K=N,X=p,W=q,Y=U,V=$,G=d}else{let w=A(C,T),f=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=U,V=w,G=f}else if(S instanceof MZ)if(C instanceof MZ){let w,f=C.name;if(f==="scrollLeft")w=!0;else if(f==="scrollRight")w=!0;else if(f==="value")w=I||!Q8(S.value,C.value);else if(f==="checked")w=I||!Q8(S.value,C.value);else if(f==="selected")w=I||!Q8(S.value,C.value);else w=!Q8(S.value,C.value);let $=w,d;if($)d=A(C,T);else d=T;let p=d;Z=I,J=z,K=N,X=F,W=q,Y=U,V=p,G=P}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=A(S,P),p=H4(F,N,z,w,f);Z=I,J=z,K=N,X=p,W=q,Y=U,V=$,G=d}else{let w=A(C,T),f=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=U,V=w,G=f}else if(C instanceof B1){let{name:w,handler:f}=C,$=S.prevent_default.kind!==C.prevent_default.kind||S.stop_propagation.kind!==C.stop_propagation.kind||S.debounce!==C.debounce||S.throttle!==C.throttle,d;if($)d=A(C,T);else d=T;let p=d,r=H4(F,N,z,w,f);Z=I,J=z,K=N,X=r,W=q,Y=U,V=p,G=P}else{let w=S.name,f=A(C,T),$=A(S,P),d=cJ(F,z,w);Z=I,J=z,K=N,X=d,W=q,Y=U,V=f,G=$}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=H4(F,N,z,w,f);Z=I,J=z,K=N,X=d,W=D,Y=U,V=$,G=P}else{let w=A(C,T);Z=I,J=z,K=N,X=F,W=D,Y=U,V=w,G=P}}}}function Qj(Z,J,K,X,W,Y,V,G,I,z,N,F,D,B){while(!0){let T=Z,P=J,S=K,q=X,C=W,U=Y,k=V,w=G,f=I,$=z,d=N,p=F,r=D,X0=B;if(T instanceof M)if(S instanceof M)return new oJ(new vZ(f,k,d,p),X0);else{let B0=Qf(X0,r,$,w,S),L0=Yj(S,w-U),I0=A(L0,d);return new oJ(new vZ(f,k,I0,p),B0)}else if(S instanceof M){let{head:B0,tail:L0}=T,I0;if(B0.key===""||!fZ(C,B0.key))I0=k+1;else I0=k;let W0=I0,J0=b8(X0,$,w,B0);Z=L0,J=P,K=S,X=q,W=C,Y=U,V=W0,G=w,I=f,z=$,N=d,F=p,D=r,B=J0}else{let B0=T.head,L0=S.head;if(B0.key!==L0.key){let I0=T.tail,D0=S.tail,W0=yZ(P,L0.key);if(fZ(q,B0.key))if(W0 instanceof E){let Z0=W0[0];if(fZ(C,B0.key))Z=I0,J=P,K=S,X=q,W=C,Y=U-1,V=k,G=w,I=f,z=$,N=d,F=p,D=r,B=X0;else{let y=w-U,_=A(qf(L0.key,y),d),t=R5(C,L0.key,void 0),o=U+1;Z=A(Z0,T),J=P,K=S,X=q,W=t,Y=o,V=k,G=w,I=f,z=$,N=_,F=p,D=r,B=X0}}else{let Z0=w-U,m=h8(X0,r,$,w,L0),y=Yj(Q([L0]),Z0),_=A(y,d);Z=T,J=P,K=D0,X=q,W=C,Y=U+1,V=k,G=w+1,I=f,z=$,N=_,F=p,D=r,B=m}else if(W0 instanceof E){let Z0=w-U,m=A(Ef(Z0),d),y=b8(X0,$,w,B0),_=U-1;Z=I0,J=P,K=S,X=q,W=C,Y=_,V=k,G=w,I=f,z=$,N=m,F=p,D=r,B=y}else{let Z0=f5(w-U,L0),m,_=b8(X0,$,w,B0);m=h8(_,r,$,w,L0);let t=m;Z=I0,J=P,K=D0,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(Z0,d),F=p,D=r,B=t}}else{let I0=T.head;if(I0 instanceof R1){let D0=S.head;if(D0 instanceof R1){let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f8(r,Z0.mapper),_=e1($,w,Z0.key),t=Qj(W0.children,W0.keyed_children,Z0.children,Z0.keyed_children,E1(),0,0,0,w,_,e,e,y,X0),o,Y0=t.patch;if(Y0.changes instanceof M)if(Y0.children instanceof M)if(Y0.removed===0)o=p;else o=A(t.patch,p);else o=A(t.patch,p);else o=A(t.patch,p);let C0=o;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=C0,D=r,B=t.events}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else if(I0 instanceof C1){let D0=S.head;if(D0 instanceof C1){let W0=I0,J0=D0;if(W0.namespace===J0.namespace&&W0.tag===J0.tag){let Z0=T.tail,m=S.tail,y=f8(r,J0.mapper),_=e1($,w,J0.key),t=Eg(X0,J0.namespace,J0.tag,_),o=ff(t,_,y,X0,W0.attributes,J0.attributes,e,e),Y0,w0,C0;Y0=o.added,w0=o.removed,C0=o.events;let y0;if(Y0 instanceof M&&w0 instanceof M)y0=e;else y0=Q([oR(Y0,w0)]);let F1=y0,T1=Qj(W0.children,W0.keyed_children,J0.children,J0.keyed_children,E1(),0,0,0,w,_,F1,e,y,C0),P1,w1=T1.patch;if(w1.changes instanceof M)if(w1.children instanceof M)if(w1.removed===0)P1=p;else P1=A(T1.patch,p);else P1=A(T1.patch,p);else P1=A(T1.patch,p);let w8=P1;Z=Z0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=w8,D=r,B=T1.events}else{let Z0=I0,m=T.tail,y=D0,_=S.tail,t=f5(w-U,y),o,w0=b8(X0,$,w,Z0);o=h8(w0,r,$,w,y);let C0=o;Z=m,J=P,K=_,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(t,d),F=p,D=r,B=C0}}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else if(I0 instanceof v1){let D0=S.head;if(D0 instanceof v1){let W0=I0,J0=D0;if(W0.content===J0.content){let Z0=T.tail,m=S.tail;Z=Z0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=p,D=r,B=X0}else{let Z0=T.tail,m=D0,y=S.tail,_=lR(w,0,Q([Sf(m.content)]),e);Z=Z0,J=P,K=y,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=A(_,p),D=r,B=X0}}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else{let D0=S.head;if(D0 instanceof Z5){let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f8(r,Z0.mapper),_=e1($,w,Z0.key),t=ff(!1,_,y,X0,W0.attributes,Z0.attributes,e,e),o,Y0,w0;o=t.added,Y0=t.removed,w0=t.events;let C0;if(o instanceof M&&Y0 instanceof M)C0=e;else C0=Q([oR(o,Y0)]);let y0=C0,F1;if(W0.inner_html===Z0.inner_html)F1=y0;else F1=A(Af(Z0.inner_html),y0);let P1=F1,w1;if(P1 instanceof M)w1=p;else w1=A(lR(w,0,P1,Q([])),p);let G8=w1;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=G8,D=r,B=w0}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}}}}}function O4(Z,J,K){return Qj(Q([J]),E1(),Q([K]),E1(),E1(),0,0,0,0,I4,e,e,S0,Jf(Z))}var{setTimeout:Cg,clearTimeout:Vj}=globalThis,xg=(Z,J)=>a1().createElementNS(Z,J),wg=(Z)=>a1().createTextNode(Z),Ug=()=>a1().createDocumentFragment(),T4=(Z,J,K)=>Z.insertBefore(J,K),hf=jy?(Z,J,K)=>Z.moveBefore(J,K):T4,Mg=(Z,J)=>Z.removeChild(J),Rg=(Z,J)=>Z.getAttribute(J),vf=(Z,J,K)=>Z.setAttribute(J,K),jg=(Z,J)=>Z.removeAttribute(J),Lg=(Z,J,K,X)=>Z.addEventListener(J,K,X),gf=(Z,J,K)=>Z.removeEventListener(J,K),yg=(Z,J)=>Z.innerHTML=J,fg=(Z,J)=>Z.data=J,$8=Symbol("lustre");class mf{constructor(Z,J,K,X){this.kind=Z,this.key=X,this.parent=J,this.children=[],this.node=K,this.handlers=new Map,this.throttles=new Map,this.debouncers=new Map}get parentNode(){return this.kind===W8?this.node.parentNode:this.node}}var _8=(Z,J,K,X,W)=>{let Y=new mf(Z,J,K,W);return K[$8]=Y,J?.children.splice(X,0,Y),Y},kg=(Z)=>{let J="";for(let K=Z[$8];K.parent;K=K.parent)if(K.key)J=`${bZ}${K.key}${J}`;else{let X=K.parent.children.indexOf(K);J=`${bZ}${X}${J}`}return J.slice(1)};class Ij{#Z=null;#X;#K;#Y=!1;constructor(Z,J,K,{exposeKeys:X=!1}={}){this.#Z=Z,this.#X=J,this.#K=K,this.#Y=X}mount(Z){_8(j5,null,this.#Z,0,null),this.#P(this.#Z,null,this.#Z[$8],0,Z)}push(Z){this.#J.push({node:this.#Z[$8],patch:Z}),this.#W()}#J=[];#W(){let Z=this.#J;while(Z.length){let{node:J,patch:K}=Z.pop(),{children:X}=J,{changes:W,removed:Y,children:V}=K;if(k5(W,(G)=>this.#Q(J,G)),Y)this.#F(J,X.length-Y,Y);k5(V,(G)=>{let I=X[G.index|0];this.#J.push({node:I,patch:G})})}}#Q(Z,J){switch(J.kind){case rR:this.#C(Z,J);break;case aR:this.#S(Z,J);break;case tR:this.#D(Z,J);break;case eR:this.#z(Z,J);break;case Zj:this.#O(Z,J);break;case Jj:this.#N(Z,J);break;case Kj:this.#G(Z,J);break}}#G(Z,{children:J,before:K}){let X=Ug(),W=this.#I(Z,K);this.#T(X,null,Z,K|0,J),T4(Z.parentNode,X,W)}#N(Z,{index:J,with:K}){this.#F(Z,J|0,1);let X=this.#I(Z,J);this.#P(Z.parentNode,X,Z,J|0,K)}#I(Z,J){J=J|0;let{children:K}=Z,X=K.length;if(J<X)return K[J].node;let W=K[X-1];if(!W&&Z.kind!==W8)return null;if(!W)W=Z;while(W.kind===W8&&W.children.length)W=W.children[W.children.length-1];return W.node.nextSibling}#z(Z,{key:J,before:K}){K=K|0;let{children:X,parentNode:W}=Z,Y=X[K].node,V=X[K];for(let N=K+1;N<X.length;++N){let F=X[N];if(X[N]=V,V=F,F.key===J){X[K]=F;break}}let{kind:G,node:I,children:z}=V;if(hf(W,I,Y),G===W8)this.#V(W,z,Y)}#V(Z,J,K){for(let X=0;X<J.length;++X){let{kind:W,node:Y,children:V}=J[X];if(hf(Z,Y,K),W===W8)this.#V(Z,V,K)}}#O(Z,{index:J}){this.#F(Z,J,1)}#F(Z,J,K){let{children:X,parentNode:W}=Z,Y=X.splice(J,K);for(let V=0;V<Y.length;++V){let{kind:G,node:I,children:z}=Y[V];if(Mg(W,I),this.#H(Y[V]),G===W8)Y.push(...z)}}#H(Z){let{debouncers:J,children:K}=Z;for(let{timeout:X}of J.values())if(X)Vj(X);J.clear(),k5(K,(X)=>this.#H(X))}#D({node:Z,handlers:J,throttles:K,debouncers:X},{added:W,removed:Y}){k5(Y,({name:V})=>{if(J.delete(V))gf(Z,V,Gj),this.#B(K,V,0),this.#B(X,V,0);else jg(Z,V),_f[V]?.removed?.(Z,V)}),k5(W,(V)=>this.#E(Z,V))}#C({node:Z},{content:J}){fg(Z,J??"")}#S({node:Z},{inner_html:J}){yg(Z,J??"")}#T(Z,J,K,X,W){k5(W,(Y)=>this.#P(Z,J,K,X++,Y))}#P(Z,J,K,X,W){switch(W.kind){case j5:{let Y=this.#A(K,X,W);this.#T(Y,null,Y[$8],0,W.children),T4(Z,Y,J);break}case F4:{let Y=this.#q(K,X,W);T4(Z,Y,J);break}case W8:{let Y=this.#q(K,X,W);T4(Z,Y,J),this.#T(Z,J,Y[$8],0,W.children);break}case ty:{let Y=this.#A(K,X,W);this.#S({node:Y},W),T4(Z,Y,J);break}}}#A(Z,J,{kind:K,key:X,tag:W,namespace:Y,attributes:V}){let G=xg(Y||hJ,W);if(_8(K,Z,G,J,X),this.#Y&&X)vf(G,"data-lustre-key",X);return k5(V,(I)=>this.#E(G,I)),G}#q(Z,J,{kind:K,key:X,content:W}){let Y=wg(W??"");return _8(K,Z,Y,J,X),Y}#E(Z,J){let{debouncers:K,handlers:X,throttles:W}=Z[$8],{kind:Y,name:V,value:G,prevent_default:I,debounce:z,throttle:N}=J;switch(Y){case qR:{let F=G??"";if(V==="virtual:defaultValue"){Z.defaultValue=F;return}else if(V==="virtual:defaultChecked"){Z.defaultChecked=!0;return}else if(V==="virtual:defaultSelected"){Z.defaultSelected=!0;return}if(F!==Rg(Z,V))vf(Z,V,F);_f[V]?.added?.(Z,F);break}case ER:Z[V]=G;break;case CR:{if(X.has(V))gf(Z,V,Gj);let F=I.kind===xR;Lg(Z,V,Gj,{passive:F}),this.#B(W,V,N),this.#B(K,V,z),X.set(V,(D)=>this.#x(J,D));break}}}#B(Z,J,K){let X=Z.get(J);if(K>0)if(X)X.delay=K;else Z.set(J,{delay:K});else if(X){let{timeout:W}=X;if(W)Vj(W);Z.delete(J)}}#x(Z,J){let{currentTarget:K,type:X}=J,{debouncers:W,throttles:Y}=K[$8],V=kg(K),{prevent_default:G,stop_propagation:I,include:z}=Z;if(G.kind===_J)J.preventDefault();if(I.kind===_J)J.stopPropagation();if(X==="submit")J.detail??={},J.detail.formData=[...new FormData(J.target,J.submitter).entries()];let N=this.#X(J,V,X,z),F=Y.get(X);if(F){let B=Date.now(),T=F.last||0;if(B>T+F.delay)F.last=B,F.lastEvent=J,this.#K(J,N)}let D=W.get(X);if(D)Vj(D.timeout),D.timeout=Cg(()=>{if(J===Y.get(X)?.lastEvent)return;this.#K(J,N)},D.delay);if(!F&&!D)this.#K(J,N)}}var k5=(Z,J)=>{if(Array.isArray(Z))for(let K=0;K<Z.length;K++)J(Z[K]);else if(Z)for(Z;Z.head;Z=Z.tail)J(Z.head)},Gj=(Z)=>{let{currentTarget:J,type:K}=Z;J[$8].handlers.get(K)(Z)},$f=(Z)=>{return{added(J){J[Z]=!0},removed(J){J[Z]=!1}}},bg=(Z)=>{return{added(J,K){J[Z]=K}}},_f={checked:$f("checked"),selected:$f("selected"),value:bg("value"),autofocus:{added(Z){queueMicrotask(()=>{Z.focus?.()})}},autoplay:{added(Z){try{Z.play?.()}catch(J){console.error(J)}}}};function hg(Z,J,K){while(!0){let X=Z,W=J,Y=K;if(X instanceof M)return[W,F0(Y)];else{let V=X.tail,G=X.head[0],I=X.head[1],z=ay(G,I),N;if(G==="")N=W;else N=R5(W,G,z);let F=N,D=A(z,Y);Z=V,J=F,K=D}}}function zj(Z){return hg(Z,E1(),e)}function uf(Z,J,K){let X=zj(K),W,Y;return W=X[0],Y=X[1],N4("",S0,"",Z,J,Y,W,!1,z4(Z,""))}function df(Z,J,K,X){let W=zj(X),Y,V;return Y=W[0],V=W[1],N4("",S0,Z,J,K,V,Y,!1,z4(J,Z))}function cf(Z){let J=zj(Z),K,X;return K=J[0],X=J[1],dJ("",S0,X,K)}var pf=(Z)=>{let J=_8(j5,null,Z,0,null),K=0;for(let V=Z.firstChild;V;V=V.nextSibling)if(nf(V))K+=1;if(K===0){let V=a1().createTextNode("");return _8(F4,J,V,0,null),Z.replaceChildren(V),G0()}if(K===1)return Nj(J,Z).head[1];let X=a1().createTextNode(""),W=_8(W8,J,X,0,null),Y=Nj(W,Z);return Z.insertBefore(X,Z.firstChild),cf(Y)},nf=(Z)=>{switch(Z.nodeType){case vJ:return!0;case SR:return!!Z.data;default:return!1}},vg=(Z,J,K,X)=>{if(!nf(J))return null;switch(J.nodeType){case vJ:{let W=_8(j5,Z,J,X,K),Y=J.localName,V=J.namespaceURI,G=!V||V===hJ;if(G&&gg.includes(Y))$g(Y,J);let I=_g(J),z=Nj(W,J);return G?uf(Y,I,z):df(V,Y,I,z)}case SR:return _8(F4,Z,J,X,null),x(J.data);default:return null}},gg=["input","select","textarea"],$g=(Z,J)=>{let{value:K,checked:X}=J;if(Z==="input"&&J.type==="checkbox"&&!X)return;if(Z==="input"&&J.type==="radio"&&!X)return;if(J.type!=="checkbox"&&J.type!=="radio"&&!K)return;queueMicrotask(()=>{if(J.value=K,J.checked=X,J.dispatchEvent(new Event("input",{bubbles:!0})),J.dispatchEvent(new Event("change",{bubbles:!0})),a1().activeElement!==J)J.dispatchEvent(new Event("blur",{bubbles:!0}))})},Nj=(Z,J)=>{let K=null,X=J.firstChild,W=null,Y=0;while(X){let V=X.nodeType===vJ?X.getAttribute("data-lustre-key"):null;if(V!=null)X.removeAttribute("data-lustre-key");let G=vg(Z,X,V,Y),I=X.nextSibling;if(G){let z=new f1([V??"",G],null);if(W)W=W.tail=z;else W=K=z;Y+=1}else J.removeChild(X);X=I}if(!W)return e;return W.tail=e,K},_g=(Z)=>{let J=Z.attributes.length,K=e;while(J-- >0){let X=Z.attributes[J];if(X.name==="xmlns")continue;K=new f1(mg(X),K)}return K},mg=(Z)=>{let{localName:J,value:K}=Z;return R(J,K)};var J5=()=>!!a1();class eJ{constructor(Z,[J,K],X,W){this.root=Z,this.#Z=J,this.#X=X,this.#K=W,this.root.addEventListener("context-request",(G)=>{if(!(G.context&&G.callback))return;if(!this.#Q.has(G.context))return;G.stopImmediatePropagation();let I=this.#Q.get(G.context);if(G.subscribe){let z=()=>{I.subscribers=I.subscribers.filter((N)=>N!==G.callback)};I.subscribers.push([G.callback,z]),G.callback(I.value,z)}else G.callback(I.value)});let Y=(G,I,z)=>cR(this.#J,I,z,G),V=(G,I)=>{let[z,N]=pR(this.#J,I);if(this.#J=z,N.isOk()){let F=N[0];if(F.stop_propagation)G.stopPropagation();if(F.prevent_default)G.preventDefault();this.dispatch(F.message,!1)}};this.#W=new Ij(this.root,Y,V),this.#Y=pf(this.root),this.#J=dR(),this.#H(K),this.#D()}root=null;dispatch(Z,J=!1){if(this.#G)this.#N.push(Z);else{let[K,X]=this.#K(this.#Z,Z);this.#Z=K,this.#F(X,J)}}emit(Z,J){(this.root.host??this.root).dispatchEvent(new CustomEvent(Z,{detail:J,bubbles:!0,composed:!0}))}provide(Z,J){if(!this.#Q.has(Z))this.#Q.set(Z,{value:J,subscribers:[]});else{let K=this.#Q.get(Z);if(Q8(K.value,J))return;K.value=J;for(let X=K.subscribers.length-1;X>=0;X--){let[W,Y]=K.subscribers[X];if(!W){K.subscribers.splice(X,1);continue}W(J,Y)}}}#Z;#X;#K;#Y;#J;#W;#Q=new Map;#G=!1;#N=[];#I=e;#z=e;#V=null;#O={dispatch:(Z)=>this.dispatch(Z),emit:(Z,J)=>this.emit(Z,J),select:()=>{},root:()=>this.root,provide:(Z,J)=>this.provide(Z,J)};#F(Z,J=!1){if(this.#H(Z),!this.#V)if(J)this.#V="sync",queueMicrotask(()=>this.#D());else this.#V=requestAnimationFrame(()=>this.#D())}#H(Z){this.#G=!0;while(!0){for(let K=Z.synchronous;K.tail;K=K.tail)K.head(this.#O);if(this.#I=lf(this.#I,Z.before_paint),this.#z=lf(this.#z,Z.after_paint),!this.#N.length)break;let J=this.#N.shift();[this.#Z,Z]=this.#K(this.#Z,J)}this.#G=!1}#D(){this.#V=null;let Z=this.#X(this.#Z),{patch:J,events:K}=O4(this.#J,this.#Y,Z);if(this.#J=K,this.#Y=Z,this.#W.push(J),this.#I instanceof f1){let X=sf(this.#I);this.#I=e,queueMicrotask(()=>{this.#F(X,!0)})}if(this.#z instanceof f1){let X=sf(this.#z);this.#z=e,requestAnimationFrame(()=>{this.#F(X,!0)})}}}function sf(Z){return{synchronous:Z,after_paint:e,before_paint:e}}function lf(Z,J){if(Z instanceof M)return J;else if(J instanceof M)return Z;else return _0(Z,J)}class Hj extends O{constructor(Z){super();this.message=Z}}class Dj extends O{constructor(Z){super();this.callback=Z}}class Bj extends O{constructor(Z){super();this.callback=Z}}class K5 extends O{constructor(Z){super();this.message=Z}}class b5 extends O{constructor(Z,J){super();this.name=Z,this.data=J}}class ZK extends O{constructor(Z,J){super();this.key=Z,this.value=J}}class h5 extends O{}class tf extends O{constructor(Z,J,K,X,W,Y,V,G,I,z){super();this.open_shadow_root=Z,this.adopt_styles=J,this.delegates_focus=K,this.attributes=X,this.properties=W,this.contexts=Y,this.is_form_associated=V,this.on_form_autofill=G,this.on_form_reset=I,this.on_form_restore=z}}function of(Z){let J=new tf(!0,!0,!1,e,e,e,!1,gJ,gJ,gJ);return v0(Z,J,(K,X)=>{return X.apply(K)})}class Zk{#Z;constructor(Z,[J,K],X,W){this.#Z=new eJ(Z,[J,K],W,X)}send(Z){switch(Z.constructor){case K5:{this.dispatch(Z.message,!1);break}case b5:{this.emit(Z.name,Z.data);break}case h5:break}}dispatch(Z){this.#Z.dispatch(Z)}emit(Z,J){this.#Z.emit(Z,J)}}var Jk=({init:Z,update:J,view:K},X,W)=>{if(!J5())return new v(new gZ);let Y=X instanceof HTMLElement?X:a1().querySelector(X);if(!Y)return new v(new Oj(X));return new E(new Zk(Y,Z(W),J,K))};class ug{#Z;#X;#K;#Y;#J;#W;#Q=h0();#G=new Set;constructor([Z,J],K,X,W){this.#Z=Z,this.#X=K,this.#K=X,this.#Y=W,this.#J=this.#K(this.#Z),this.#W=nR(this.#J),this.#V(J)}send(Z){switch(Z.constructor){case Hj:{let{message:J}=Z,K=this.#N(J),X=O4(this.#W,this.#J,K);this.#J=K,this.#W=X.events,this.broadcast(Wj(X.patch));return}case Dj:{let{callback:J}=Z;this.#G.add(J),J(Rf(this.#Y.open_shadow_root,this.#Y.adopt_styles,M8(this.#Y.attributes),M8(this.#Y.properties),M8(this.#Y.contexts),this.#Q,this.#J));return}case Bj:{let{callback:J}=Z;this.#G.delete(J);return}case K5:{let{message:J}=Z,[K,X]=this.#X(this.#Z,J),W=this.#K(K),Y=O4(this.#W,this.#J,W);this.#V(X),this.#Z=K,this.#J=W,this.#W=Y.events,this.broadcast(Wj(Y.patch));return}case b5:{let{name:J,data:K}=Z;this.broadcast(jf(J,K));return}case ZK:{let{key:J,value:K}=Z,X=T0(this.#Q,J);if(X.isOk()&&Q8(X[0],K))return;this.#Q=i0(this.#Q,J,K),this.broadcast(Lf(J,K));return}case h5:{this.#Z=null,this.#X=null,this.#K=null,this.#Y=null,this.#J=null,this.#W=null,this.#Q=null,this.#G.clear();return}default:return}}broadcast(Z){for(let J of this.#G)J(Z)}#N(Z){switch(Z.constructor){case lJ:{let{messages:J}=Z,K=this.#Z,X=i();for(let W=J;W.head;W=W.tail){let Y=this.#N(W.head);if(Y instanceof E){K=Y[0][0],X=W1(n0.fromArray([X,Y[0][1]]));break}}return this.#V(X),this.#Z=K,this.#K(this.#Z)}case rJ:{let{name:J,value:K}=Z,X=this.#I(J,K);if(X instanceof v)return this.#J;else{let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}case aJ:{let{name:J,value:K}=Z,X=this.#z(J,K);if(X instanceof v)return this.#J;else{let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}case tJ:{let{path:J,name:K,event:X}=Z,[W,Y]=pJ(this.#W,J,K,X);if(this.#W=W,Y instanceof v)return this.#J;else{let[V,G]=this.#X(this.#Z,Y[0].message);return this.#V(G),this.#Z=V,this.#K(this.#Z)}}case Xj:{let{key:J,value:K}=Z,X=T0(this.#Y.contexts,J);if(X instanceof v)return this.#J;if(X=z0(K,X[0]),X instanceof v)return this.#J;let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}}#I(Z,J){let K=T0(this.#Y.attributes,Z);switch(K.constructor){case E:return K[0](J);case v:return new v(void 0)}}#z(Z,J){let K=T0(this.#Y.properties,Z);switch(K.constructor){case E:return K[0](J);case v:return new v(void 0)}}#V(Z){let J=(V)=>this.send(new K5(V)),K=(V,G)=>this.send(new b5(V,G)),X=()=>{return},W=()=>{return},Y=(V,G)=>this.send(new ZK(V,G));globalThis.queueMicrotask(()=>{ny(Z,J,K,X,W,Y)})}}class Kk extends O{constructor(Z,J,K,X){super();this.init=Z,this.update=J,this.view=K,this.config=X}}class Oj extends O{constructor(Z){super();this.selector=Z}}class gZ extends O{}function Yk(Z,J,K){return new Kk(Z,J,K,of(e))}function Xk(Z,J,K){return V4(!J5(),new v(new gZ),()=>{return Jk(Z,J,K)})}function Vk(Z,J){return[Z,J]}var pg={handle_external_links:!1,handle_internal_links:!0},Ik=globalThis?.window?.location?.href,Sj=()=>{if(!Ik)return new v(void 0);else return new E(Pj(new URL(Ik)))},Aj=(Z,J=pg)=>{document.addEventListener("click",(K)=>{let X=Nk(K.target);if(!X)return;try{let W=new URL(X.href),Y=Pj(W),V=W.host!==window.location.host||X.target==="_blank";if(!J.handle_external_links&&V)return;if(!J.handle_internal_links&&!V)return;if(K.preventDefault(),!V)window.history.pushState({},"",X.href),window.requestAnimationFrame(()=>{if(W.hash)document.getElementById(W.hash.slice(1))?.scrollIntoView();else window.scrollTo(0,0)});return Z(Y)}catch{return}}),window.addEventListener("popstate",(K)=>{K.preventDefault();let X=new URL(window.location.href),W=Pj(X);window.requestAnimationFrame(()=>{if(X.hash)document.getElementById(X.hash.slice(1))?.scrollIntoView();else window.scrollTo(0,0)}),Z(W)}),window.addEventListener("modem-push",({detail:K})=>{Z(K)}),window.addEventListener("modem-replace",({detail:K})=>{Z(K)})},zk=(Z)=>{window.history.pushState({},"",kJ(Z)),window.requestAnimationFrame(()=>{if(Z.fragment[0])document.getElementById(Z.fragment[0])?.scrollIntoView()}),window.dispatchEvent(new CustomEvent("modem-push",{detail:Z}))};var Nk=(Z)=>{if(!Z||Z.tagName==="BODY")return null;else if(Z.tagName==="A")return Z;else return Nk(Z.parentElement)},Pj=(Z)=>{return new V0(Z.protocol?new L(Z.protocol.slice(0,-1)):new h,new h,Z.hostname?new L(Z.hostname):new h,Z.port?new L(Number(Z.port)):new h,Z.pathname,Z.search?new L(Z.search.slice(1)):new h,Z.hash?new L(Z.hash.slice(1)):new h)};function Hk(Z){return I1((J)=>{return V4(!J5(),void 0,()=>{return Aj((K)=>{let W=Z(K);return J(W)})})})}function Fk(Z){if(Z==="")return new h;else return new L(Z)}var JK=new V0(new h,new h,new h,new h,"",new h,new h);function v5(Z,J,K){return I1((X)=>{return V4(!J5(),void 0,()=>{return zk(new V0(JK.scheme,JK.userinfo,JK.host,JK.port,Z,mM(J,Fk),mM(K,Fk)))})})}class Dk extends O{constructor(Z,J){super();this.query=Z,this.module_path=J}}class qj extends O{constructor(Z){super();this.queries=Z}}function Bk(){return new qj(h0())}function e0(Z,J,K,X){let W=new Dk(K,X);return new qj(i0(Z.queries,J,W))}function Ej(Z,J){return T0(Z.queries,J)}class YK extends O{}class XK extends O{}class Ok extends O{}class Tk extends O{}class Pk extends O{}class Sk extends O{}class Ak extends O{}class qk extends O{}class Ek extends O{}class Cj extends O{}class WK extends O{}function Ck(Z){if(Z instanceof YK)return"GET";else if(Z instanceof XK)return"POST";else if(Z instanceof Ok)return"HEAD";else if(Z instanceof Tk)return"PUT";else if(Z instanceof Pk)return"DELETE";else if(Z instanceof Sk)return"TRACE";else if(Z instanceof Ak)return"CONNECT";else if(Z instanceof qk)return"OPTIONS";else if(Z instanceof Ek)return"PATCH";else return Z[0]}function xk(Z){if(Z instanceof Cj)return"http";else return"https"}function wk(Z){let J=s1(Z);if(J==="http")return new E(new Cj);else if(J==="https")return new E(new WK);else return new v(void 0)}class $Z extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.method=Z,this.headers=J,this.body=K,this.scheme=X,this.host=W,this.port=Y,this.path=V,this.query=G}}function Mk(Z){return new V0(new L(xk(Z.scheme)),new h,new L(Z.host),Z.port,Z.path,Z.query,new h)}function sg(Z){return M1((()=>{let J=Z.scheme,K=UL(J,"");return wk(K)})(),(J)=>{return M1((()=>{let K=Z.host;return $M(K,void 0)})(),(K)=>{let X=new $Z(new YK,Q([]),"",J,K,Z.port,Z.path,Z.query);return new E(X)})})}function xj(Z,J,K){let X=YR(Z.headers,s1(J),K);return new $Z(Z.method,X,Z.body,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function Rk(Z,J){return new $Z(Z.method,Z.headers,J,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function jk(Z,J){return new $Z(J,Z.headers,Z.body,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function Lk(Z){let K=OR(Z);return M1(K,sg)}class wj extends O{constructor(Z,J,K){super();this.status=Z,this.headers=J,this.body=K}}class g5{constructor(Z){this.promise=Z}static wrap(Z){return Z instanceof Promise?new g5(Z):Z}static unwrap(Z){return Z instanceof g5?Z.promise:Z}}function O8(Z){return Promise.resolve(g5.wrap(Z))}function VK(Z,J){return Z.then((K)=>J(g5.unwrap(K)))}function GK(Z,J){return Z.then((K)=>g5.wrap(J(g5.unwrap(K))))}function Mj(Z){return new wj(Z.status,n0.fromArray([...Z.headers]),Z)}function tg(Z){let J=kJ(Mk(Z)),K=Ck(Z.method).toUpperCase(),X={headers:og(Z.headers),method:K};return[J,X]}function Rj(Z){let[J,K]=tg(Z);if(K.method!=="GET"&&K.method!=="HEAD")K.body=Z.body;return new globalThis.Request(J,K)}function og(Z){let J=new globalThis.Headers;for(let[K,X]of Z)J.append(K.toLowerCase(),X);return J}async function IK(Z){let J;try{J=await Z.body.text()}catch(K){return new v(new jj)}return new E(Z.withFields({body:J}))}class zK extends O{constructor(Z){super();this[0]=Z}}class jj extends O{}class fk extends O{constructor(Z,J){super();this.endpoint=Z,this.headers=J}}function Lj(Z,J){return new fk(Z,J)}function J1(Z,J,K){let X=b(Q([["query",c(J)],["variables",K]]));return M1((()=>{let W=Lk(Z.endpoint);return Y4(W,(Y)=>{return"Invalid endpoint URL"})})(),(W)=>{let Y,G=jk(W,new XK),I=Rk(G,j8(X));Y=xj(I,"content-type","application/json");let z=Y,N=v0(Z.headers,z,(F,D)=>{return xj(F,D[0],D[1])});return new E(N)})}function A0(Z,J){return M1((()=>{let K=l1(Z,f0);return Y4(K,(X)=>{return"Failed to decode JSON response"})})(),(K)=>{let X=g("data",J,(Y)=>{return l(Y)}),W=z0(K,X);return Y4(W,(Y)=>{return"Failed to decode response data: "+jJ(Y)+". Response body: "+Z})})}async function yj(Z){try{let J=Rj(Z),K=new Request(J,{credentials:"include"}),X=await fetch(K),W=Mj(X);return new E(W)}catch(J){return new v(new zK(J.toString()))}}var gk="src/squall_cache.gleam";class j1 extends O{}class L1 extends O{constructor(Z){super();this[0]=Z}}class Z8 extends O{constructor(Z){super();this[0]=Z}}class NK extends O{}class $k extends O{}class fj extends O{}class mZ extends O{constructor(Z,J,K){super();this.data=Z,this.timestamp=J,this.status=K}}class y1 extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.entities=Z,this.optimistic_entities=J,this.optimistic_mutations=K,this.queries=X,this.pending_fetches=W,this.get_headers=Y,this.mutation_counter=V,this.endpoint=G}}function _k(Z){return new y1(h0(),h0(),h0(),h0(),x5(),()=>{return Q([])},0,Z)}function FK(Z,J){return Z+":"+j8(J)}function kk(Z){let J=CJ(Z);if(J instanceof E){let K=J[0][0],X=J[0][1];return xJ(K)+X}else return Z}function kj(Z){let K=F0(Z),X=qJ(K,(W)=>{if(W==="data")return new v(void 0);else if(W==="results")return new v(void 0);else if(W==="edges")return new v(void 0);else if(W==="node")return new v(void 0);else if(wJ(W,"s")){let V=Y8(W),G=Gy(W,0,V-1);return new E(kk(G))}else return new E(kk(W))});return F8(X,"Entity")}function J$(Z){if(T0(Z,"node")instanceof E)return!0;else return!1}function K$(Z){let J=z0(Z,U0(f0));if(J instanceof E){let K=J[0];if(K instanceof M)return!1;else{let X=K.head,W=z0(X,R8(u,f0));if(W instanceof E){let Y=W[0];return J$(Y)}else return!1}}else return!1}function Y$(Z,J,K){let X=FK(J,K),W=T0(Z.queries,X);if(W instanceof E){let Y=W[0],V=new mZ(Y.data,Y.timestamp,new fj),G=i0(Z.queries,X,V);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,G,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else{let Y=new mZ("",0,new fj),V=i0(Z.queries,X,Y);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,V,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}}function m0(Z,J,K){let X=FK(J,K),W=N8(Z.queries,X);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,W,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}function X$(Z,J,K,X){let W,Y=T0(Z.optimistic_entities,K);if(Y instanceof E){let I=Y[0];W=new L(I)}else{let I=T0(Z.entities,K);if(I instanceof E){let z=I[0];W=new L(z)}else W=new h}let G=X(W);return new y1(Z.entities,i0(Z.optimistic_entities,K,G),i0(Z.optimistic_mutations,J,K),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}function bj(Z,J){let K=T0(Z.optimistic_mutations,J);if(K instanceof E){let X=K[0];return new y1(Z.entities,N8(Z.optimistic_entities,X),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return Z}function mk(Z){return!eM(Z.optimistic_mutations)}function P4(Z){let J=z0(Z,R8(u,f0));if(J instanceof E){let X=J[0],W=i8(X),Y=H0(W,(V)=>{let G,I;return G=V[0],I=V[1],[G,P4(I)]});return b(Y)}else{let K=z0(Z,U0(f0));if(K instanceof E){let X=K[0];return j0(X,P4)}else{let X=z0(Z,u);if(X instanceof E){let W=X[0];return c(W)}else{let W=z0(Z,p0);if(W instanceof E){let Y=W[0];return X1(Y)}else{let Y=z0(Z,pL);if(Y instanceof E){let V=Y[0];return qy(V)}else{let V=z0(Z,V1);if(V instanceof E){let G=V[0];return r1(G)}else return DR()}}}}}}function W$(Z,J){let K=j8(Z),X=j8(J),W=l1(K,f0),Y=l1(X,f0);if(W instanceof E&&Y instanceof E){let V=W[0],G=Y[0],I=z0(V,R8(u,f0)),z=z0(G,R8(u,f0));if(I instanceof E&&z instanceof E){let N=I[0],F=z[0],D,B=_0(M8(N),M8(F));D=$L(B);let P=S5(D,(S)=>{let q,C=T0(F,S);if(C instanceof E)q=C;else q=T0(N,S);let U=q;if(U instanceof E){let k=U[0];return new E([S,P4(k)])}else return new v(void 0)});return b(P)}else return J}else return J}function m8(Z,J){return r5(J,Z,(K,X,W)=>{let Y=T0(K,X);if(Y instanceof E){let V=Y[0],G=W$(V,W);return i0(K,X,G)}else return i0(K,X,W)})}function bk(Z){let J=E5(Z,":");if(J instanceof E){let K=J[0][0],X=J[0][1],W=l1(X,f0);if(W instanceof E){let Y=W[0];return new E([K,P4(Y)])}else return new E([K,DR()])}else return new v(void 0)}function Q$(Z,J,K,X,W,Y,V){let G=Ej(J,K);if(G instanceof E){let I=G[0];return I1((z)=>{let N=Z.get_headers(),F=Lj(Z.endpoint,N),D=J1(F,I.query,X),B;if(D instanceof E)B=D[0];else throw p8("let_assert",gk,"squall_cache",767,"create_mutation_effect","Pattern match failed, no pattern matched the value.",{value:D,start:24617,end:24701,pattern_start:24628,pattern_end:24635});let T,P=yj(B);T=GK(P,(q)=>{if(q instanceof E){let C=q[0],U=IK(C);return VK(U,(k)=>{if(k instanceof E){let w=k[0],f=Y(w.body);if(f instanceof E){let $=f[0];return z(V(W,new E($),w.body)),O8(void 0)}else{let $=f[0];return z(V(W,new v("Parse error: "+$),w.body)),O8(void 0)}}else return z(V(W,new v("Failed to read response"),"")),O8(void 0)})}else return z(V(W,new v("Failed to fetch"),"")),O8(void 0)});let S=T;return})}else return I1((I)=>{I(V(W,new v("Query not found in registry"),""));return})}function dZ(Z,J,K,X,W,Y,V,G){let I="mutation-"+A1(Z.mutation_counter),z=X$(Z,I,W,Y),N=new y1(z.entities,z.optimistic_entities,z.optimistic_mutations,z.queries,z.pending_fetches,z.get_headers,Z.mutation_counter+1,z.endpoint),F=Q$(N,J,K,X,I,V,G);return[N,I,F]}function V$(Z,J,K,X,W){return I1((Y)=>{let V=Z.get_headers(),G=Lj(Z.endpoint,V),I=J1(G,J,X),z;if(I instanceof E)z=I[0];else throw p8("let_assert",gk,"squall_cache",1073,"create_fetch_effect","Pattern match failed, no pattern matched the value.",{value:I,start:34411,end:34480,pattern_start:34422,pattern_end:34429});let N,F=yj(z);N=GK(F,(B)=>{if(B instanceof E){let T=B[0],P=IK(T);return VK(P,(S)=>{if(S instanceof E){let q=S[0];return Y(W(K,X,new E(q.body))),O8(void 0)}else return Y(W(K,X,new v("Failed to read response"))),O8(void 0)})}else return Y(W(K,X,new v("Failed to fetch"))),O8(void 0)});let D=N;return})}function u0(Z,J,K,X){let W=xy(Z.pending_fetches),Y=S5(W,(I)=>{let z=bk(I);if(z instanceof E){let N=z[0][0],F=z[0][1],D=Ej(J,N);if(D instanceof E){let B=D[0];return new E(V$(Z,B.query,N,F,K))}else return new v(void 0)}else return new v(void 0)}),V=v0(W,Z,(I,z)=>{let N=bk(z);if(N instanceof E){let F=N[0][0],D=N[0][1];return Y$(I,F,D)}else return I});return[new y1(V.entities,V.optimistic_entities,V.optimistic_mutations,V.queries,x5(),V.get_headers,V.mutation_counter,V.endpoint),Y]}function hk(Z,J,K){let X=i8(Z),W=H0(X,(Y)=>{let V,G;return V=Y[0],G=Y[1],[V,hj(G,J,K)]});return b(W)}function hj(Z,J,K){let X=z0(Z,R8(u,f0));if(X instanceof E){let W=X[0],Y=T0(W,"__ref");if(Y instanceof E){let V=Y[0],G=z0(V,u);if(G instanceof E){let I=G[0],z=T0(J,I);if(z instanceof E)return z[0];else{let N=T0(K,I);if(N instanceof E)return N[0];else return b(Q([["__ref",c(I)]]))}}else return hk(W,J,K)}else return hk(W,J,K)}else{let W=z0(Z,U0(f0));if(W instanceof E){let Y=W[0];return j0(Y,(V)=>{return hj(V,J,K)})}else return P4(Z)}}function vk(Z,J,K){let X=l1(Z,f0);if(X instanceof E){let W=X[0],Y=hj(W,J,K);return j8(Y)}else return Z}function a(Z,J,K,X){let W=FK(J,K),Y=T0(Z.queries,W);if(Y instanceof E){let V=Y[0],G=V.status;if(G instanceof NK){let I=vk(V.data,Z.optimistic_entities,Z.entities),z=X(I);if(z instanceof E){let N=z[0];return[Z,new Z8(N)]}else{let N=z[0];return[Z,new L1("Parse error: "+N)]}}else if(G instanceof $k){let I=vk(V.data,Z.optimistic_entities,Z.entities),z=X(I);if(z instanceof E){let N=z[0];return[Z,new Z8(N)]}else{let N=z[0];return[Z,new L1("Parse error: "+N)]}}else return[Z,new j1]}else return[new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,Z.queries,wZ(Z.pending_fetches,W),Z.get_headers,Z.mutation_counter,Z.endpoint),new j1]}function G$(Z,J){let K=v0(Z,[h0(),Q([]),x5()],(Y,V)=>{let G,I,z;G=Y[0],I=Y[1],z=Y[2];let N=z0(V,R8(u,f0));if(N instanceof E){let F=N[0],D=T0(F,"node");if(D instanceof E){let B=D[0],T,P=z0(B,R8(u,f0));if(P instanceof E){let q=P[0],C=T0(q,"id");if(C instanceof E){let U=C[0],k=z0(U,u);if(k instanceof E){let w=k[0],f,$=T0(q,"__typename");if($ instanceof E){let p=$[0],r=z0(p,u);if(r instanceof E)f=r[0];else f="Node"}else f=kj(_0(J,Q(["node"])));T=new L(f+":"+w)}else T=new h}else T=new h}else T=new h;let S=T;if(S instanceof L){let q=S[0];if(W4(z,q))return Y;else{let U=_Z(F,J),k,w;return k=U[0],w=U[1],[m8(G,k),_0(I,Q([w])),wZ(z,q)]}}else{let q=_Z(F,J),C,U;return C=q[0],U=q[1],[m8(G,C),_0(I,Q([U])),z]}}else{let B=_Z(F,J),T,P;return T=B[0],P=B[1],[m8(G,T),_0(I,Q([P])),z]}}else{let F=uZ(V,J),D,B;return D=F[0],B=F[1],[m8(G,D),_0(I,Q([B])),z]}}),X,W;return X=K[0],W=K[1],[X,j0(W,(Y)=>{return Y})]}function uZ(Z,J){let K=z0(Z,R8(u,f0));if(K instanceof E){let X=K[0],W=T0(X,"id");if(W instanceof E){let Y=W[0],V=z0(Y,u);if(V instanceof E){let G=V[0],I,z=T0(X,"__typename");if(z instanceof E){let k=z[0],w=z0(k,u);if(w instanceof E)I=w[0];else I=kj(J)}else I=kj(J);let F=I+":"+G,D,B=i8(X);D=H0(B,(k)=>{let w,f;w=k[0],f=k[1];let $=_0(J,Q([w])),d=uZ(f,$),p,r;return p=d[0],r=d[1],[w,p,r]});let T=D,P=v0(T,h0(),(k,w)=>{let f;return f=w[1],m8(k,f)}),S,q=H0(T,(k)=>{let w,f;return w=k[0],f=k[2],[w,f]});return S=b(q),[i0(P,F,S),b(Q([["__ref",c(F)]]))]}else return _Z(X,J)}else return _Z(X,J)}else{let X=z0(Z,U0(f0));if(X instanceof E){let W=X[0];if(K$(Z))return G$(W,J);else{let V=H0(W,(z)=>{return uZ(z,J)}),G=v0(V,h0(),(z,N)=>{let F;return F=N[0],m8(z,F)}),I=H0(V,(z)=>{let N;return N=z[1],N});return[G,j0(I,(z)=>{return z})]}}else return[h0(),P4(Z)]}}function uk(Z){return uZ(Z,Q([]))}function dk(Z,J,K,X,W){let Y=FK(J,K),V=l1(X,f0);if(V instanceof E){let G=V[0],I=uk(G),z,N;z=I[0],N=I[1];let F=m8(Z.entities,z),D=j8(N),B=new mZ(D,W,new NK),T=i0(Z.queries,Y,B);return new y1(F,Z.optimistic_entities,Z.optimistic_mutations,T,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else{let G=new mZ(X,W,new NK),I=i0(Z.queries,Y,G);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,I,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}}function _Z(Z,J){let K,X=i8(Z);K=H0(X,(z)=>{let N,F;N=z[0],F=z[1];let D=_0(J,Q([N])),B=uZ(F,D),T,P;return T=B[0],P=B[1],[N,T,P]});let W=K,Y=v0(W,h0(),(z,N)=>{let F;return F=N[1],m8(z,F)}),V,G=H0(W,(z)=>{let N,F;return N=z[0],F=z[2],[N,F]});return V=b(G),[Y,V]}function vj(Z,J,K){let X=T0(Z.optimistic_mutations,J);if(X instanceof E){let W=X[0],Y=l1(K,f0);if(Y instanceof E){let V=Y[0],G=uk(V),I;I=G[0];let z=m8(Z.entities,I);return new y1(z,N8(Z.optimistic_entities,W),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return new y1(Z.entities,N8(Z.optimistic_entities,W),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return Z}class ck extends O{constructor(Z){super();this.is_backfilling=Z}}function I$(){return g("isBackfilling",V1,(Z)=>{return l(new ck(Z))})}function cZ(Z){return A0(Z,I$())}class HK extends O{}class u8 extends O{}class T8 extends O{}class $5 extends O{}function nk(Z,J,K){let X=b(Q([])),W=m0(Z,"IsBackfilling",X),Y=a(W,"IsBackfilling",X,cZ),V;return V=Y[0],u0(V,J,K,()=>{return 0})}function ik(Z,J){if(J)if(Z instanceof u8)return new T8;else if(Z instanceof T8)return Z;else return Z;else if(Z instanceof u8)return Z;else if(Z instanceof T8)return new $5;else return Z}function _5(Z){if(Z instanceof u8)return!0;else if(Z instanceof T8)return!0;else return!1}function d8(Z,J){return _y(Z,A5(J,(K)=>{return new RZ(!1,!1,K)}),e,wR,wR,0,0)}function z$(Z){if(Z instanceof B1)return new B1(Z.kind,Z.name,Z.handler,Z.include,my,Z.stop_propagation,Z.debounce,Z.throttle);else return Z}function k0(Z){return d8("click",l(Z))}function K1(Z){return d8("input",qZ(Q(["target","value"]),u,(J)=>{return l(Z(J))}))}function lk(Z){return d8("change",qZ(Q(["target","value"]),u,(J)=>{return l(Z(J))}))}function N$(){let J=g(0,u,(X)=>{return g(1,WR(A5(u,(W)=>{return new E(W)}),Q([l(new v(void 0))])),(W)=>{let V=FR(W,(G)=>{return Vk(X,G)});return l(V)})}),K=U0(J);return A5(K,Fy)}function rk(Z){let J=d8("submit",qZ(Q(["detail","formData"]),N$(),(K)=>{let W=Z(K);return l(W)}));return z$(J)}var S4=null;function ak(Z,J,K){if(S4)clearTimeout(S4);if(!Z||Z.trim()===""){K(new E(Q([])));return}S4=setTimeout(async()=>{try{let X=new URL("https://public.api.bsky.app/xrpc/app.bsky.actor.searchActorsTypeahead");X.searchParams.set("q",Z),X.searchParams.set("limit","5");let W=await fetch(X.toString());if(!W.ok){K(new v("Search failed"));return}let V=((await W.json()).actors||[]).map((G)=>new pZ(G.did||"",G.handle||"",G.displayName||"",G.avatar?new L(G.avatar):new h));K(new E(Q(V)))}catch(X){K(new v(X.message||"Search failed"))}},J)}function tk(){if(S4)clearTimeout(S4),S4=null}class pZ extends O{constructor(Z,J,K,X){super();this.did=Z,this.handle=J,this.display_name=K,this.avatar=X}}class P8 extends O{constructor(Z,J,K,X){super();this.query=Z,this.actors=J,this.highlighted_index=K,this.is_open=X}}class DK extends O{constructor(Z){super();this[0]=Z}}class A4 extends O{constructor(Z){super();this[0]=Z}}class nZ extends O{constructor(Z){super();this[0]=Z}}class BK extends O{}class OK extends O{}class iZ extends O{}class gj extends O{}function ok(){return new P8("",Q([]),-1,!1)}function S8(Z,J){if(J instanceof DK){let K=J[0],X=I1((W)=>{return ak(K,300,(Y)=>{return W(new A4(Y))})});return[new P8(K,Z.actors,Z.highlighted_index,K!==""),X]}else if(J instanceof A4){let K=J[0];if(K instanceof E){let X=K[0];return[new P8(Z.query,X,-1,Z.is_open),i()]}else return[new P8(Z.query,Q([]),-1,Z.is_open),i()]}else if(J instanceof nZ){let K=J[0];return[new P8(K.handle,Q([]),-1,!1),i()]}else if(J instanceof BK){let K=l8(Z.actors),X;if(Z.highlighted_index<K-1)X=Z.highlighted_index+1;else X=0;let Y=X;return[new P8(Z.query,Z.actors,Y,Z.is_open),i()]}else if(J instanceof OK){let K=l8(Z.actors),X;if(Z.highlighted_index>0)X=Z.highlighted_index-1;else X=K-1;let Y=X;return[new P8(Z.query,Z.actors,Y,Z.is_open),i()]}else if(J instanceof iZ)return tk(),[new P8(Z.query,Z.actors,-1,!1),i()];else return[new P8(Z.query,Z.actors,Z.highlighted_index,Z.query!==""),i()]}function ek(Z){if(Z.highlighted_index>=0){let K=Z.actors,X=t5(K,Z.highlighted_index),W=vL(X);return _M(W)}else return new h}function F$(Z,J,K){let X;if(J)X="bg-zinc-700";else X="hover:bg-zinc-700";return j(Q([H("flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors "+X),d8("mousedown",l(K(Z.handle)))]),Q([(()=>{let Y=Z.avatar;if(Y instanceof L){let V=Y[0];return Gf(Q([dy(V),H("w-8 h-8 rounded-full flex-shrink-0"),uy("")]))}else return G0()})(),j(Q([H("flex-1 min-w-0")]),Q([(()=>{let Y=Z.display_name;if(Y==="")return G0();else{let V=Y;return j(Q([H("text-sm text-zinc-200 truncate")]),Q([x(V)]))}})(),j(Q([H("text-xs text-zinc-400 truncate")]),Q([x("@"+Z.handle)]))]))]))}function H$(Z,J){return j(Q([H("absolute z-50 w-full mt-1 bg-zinc-800 border border-zinc-700 rounded shadow-lg max-h-60 overflow-y-auto")]),SJ(Z.actors,(K,X)=>{return F$(K,X===Z.highlighted_index,J)}))}function sZ(Z,J,K,X,W,Y,V,G,I,z){return j(Q([H("relative")]),Q([z1(Q([M0("text"),B8(J),py(K),o0(Z.query),q1(X),H(W),e8(!0),R("autocomplete","off"),K1(Y),d8("blur",l(I())),d8("focus",l(z())),d8("keydown",g("key",u,(N)=>{return l(G(N))}))])),(()=>{if(Z.is_open&&!O0(Z.actors,Q([])))return H$(Z,V);else return G0()})()]))}class V8 extends O{}class m1 extends O{}class u1 extends O{}class _j extends O{}function A8(Z,J){let K;if(Z instanceof V8)K=["bg-green-900/30","border-green-800","text-green-300","✓"];else if(Z instanceof m1)K=["bg-red-900/30","border-red-800","text-red-300","✗"];else if(Z instanceof u1)K=["bg-blue-900/30","border-blue-800","text-blue-300","ℹ"];else K=["bg-yellow-900/30","border-yellow-800","text-yellow-300","⚠"];let X=K,W,Y,V,G;return W=X[0],Y=X[1],V=X[2],G=X[3],j(Q([H("mb-6 p-4 rounded border "+W+" "+Y)]),Q([j(Q([H("flex items-center gap-3")]),Q([n(Q([H("text-lg "+V)]),Q([x(G)])),n(Q([H("text-sm "+V)]),Q([x(J)]))]))]))}function mj(Z,J,K,X){let W;if(Z instanceof V8)W=["bg-green-900/30","border-green-800","text-green-300","✓"];else if(Z instanceof m1)W=["bg-red-900/30","border-red-800","text-red-300","✗"];else if(Z instanceof u1)W=["bg-blue-900/30","border-blue-800","text-blue-300","ℹ"];else W=["bg-yellow-900/30","border-yellow-800","text-yellow-300","⚠"];let Y=W,V,G,I,z;return V=Y[0],G=Y[1],I=Y[2],z=Y[3],j(Q([H("mb-6 p-4 rounded border "+V+" "+G)]),Q([j(Q([H("flex items-center gap-3")]),Q([n(Q([H("text-lg "+I)]),Q([x(z)])),n(Q([H("text-sm "+I)]),Q([x(J+" "),_1(Q([h1(X),H("underline hover:no-underline")]),Q([x(K)]))]))]))]))}var u5="http://www.w3.org/2000/svg";function X5(Z){return g1(u5,"ellipse",Z,e)}function lZ(Z){return g1(u5,"rect",Z,e)}function PK(Z,J){return g1(u5,"defs",Z,J)}function d5(Z,J){return g1(u5,"g",Z,J)}function q4(Z,J){return g1(u5,"svg",Z,J)}function E4(Z,J){return g1(u5,"linearGradient",Z,J)}function q8(Z){return g1(u5,"stop",Z,e)}function Zb(Z){return q4(Q([R("viewBox","0 0 128 128"),R("xmlns","http://www.w3.org/2000/svg"),R("overflow","visible"),H(Z)]),Q([PK(Q([]),Q([E4(Q([B8("backfill-board1"),R("x1","0%"),R("y1","0%"),R("x2","100%"),R("y2","100%")]),Q([q8(Q([R("offset","0%"),R("stop-color","#FF6347"),R("stop-opacity","1")])),q8(Q([R("offset","100%"),R("stop-color","#FF4500"),R("stop-opacity","1")]))])),E4(Q([B8("backfill-board2"),R("x1","0%"),R("y1","0%"),R("x2","100%"),R("y2","100%")]),Q([q8(Q([R("offset","0%"),R("stop-color","#00CED1"),R("stop-opacity","1")])),q8(Q([R("offset","100%"),R("stop-color","#4682B4"),R("stop-opacity","1")]))])),R0("style",Q([]),Q([x(` 5 + `;function vR(Z,J){return sy(Z,Q([hR,J]))}class R1 extends O{constructor(Z,J,K,X,W){super();this.kind=Z,this.key=J,this.mapper=K,this.children=X,this.keyed_children=W}}class C1 extends O{constructor(Z,J,K,X,W,Y,V,G,I,z){super();this.kind=Z,this.key=J,this.mapper=K,this.namespace=X,this.tag=W,this.attributes=Y,this.children=V,this.keyed_children=G,this.self_closing=I,this.void=z}}class v1 extends O{constructor(Z,J,K,X){super();this.kind=Z,this.key=J,this.mapper=K,this.content=X}}class Z5 extends O{constructor(Z,J,K,X,W,Y,V){super();this.kind=Z,this.key=J,this.mapper=K,this.namespace=X,this.tag=W,this.attributes=Y,this.inner_html=V}}function z4(Z,J){if(J==="")if(Z==="area")return!0;else if(Z==="base")return!0;else if(Z==="br")return!0;else if(Z==="col")return!0;else if(Z==="embed")return!0;else if(Z==="hr")return!0;else if(Z==="img")return!0;else if(Z==="input")return!0;else if(Z==="link")return!0;else if(Z==="meta")return!0;else if(Z==="param")return!0;else if(Z==="source")return!0;else if(Z==="track")return!0;else if(Z==="wbr")return!0;else return!1;else return!1}function ay(Z,J){if(J instanceof R1)return new R1(J.kind,Z,J.mapper,J.children,J.keyed_children);else if(J instanceof C1)return new C1(J.kind,Z,J.mapper,J.namespace,J.tag,J.attributes,J.children,J.keyed_children,J.self_closing,J.void);else if(J instanceof v1)return new v1(J.kind,Z,J.mapper,J.content);else return new Z5(J.kind,Z,J.mapper,J.namespace,J.tag,J.attributes,J.inner_html)}var W8=0;function dJ(Z,J,K,X){return new R1(W8,Z,J,K,X)}var j5=1;function N4(Z,J,K,X,W,Y,V,G,I){return new C1(j5,Z,J,K,X,vy(W),Y,V,G,I)}var F4=2;function gR(Z,J,K){return new v1(F4,Z,J,K)}var ty=3;var $R=(Z,J)=>Z===J,Q8=(Z,J)=>{if(Z===J)return!0;if(Z==null||J==null)return!1;let K=typeof Z;if(K!==typeof J)return!1;if(K!=="object")return!1;if(Z.constructor!==J.constructor)return!1;if(Array.isArray(Z))return Dg(Z,J);return Bg(Z,J)},Dg=(Z,J)=>{let K=Z.length;if(K!==J.length)return!1;while(K--)if(!Q8(Z[K],J[K]))return!1;return!0},Bg=(Z,J)=>{let K=Object.keys(Z),X=K.length;if(Object.keys(J).length!==X)return!1;while(X--){let W=K[X];if(!Object.hasOwn(J,W))return!1;if(!Q8(Z[W],J[W]))return!1}return!0};class k8 extends O{constructor(Z,J,K){super();this.handlers=Z,this.dispatched_paths=J,this.next_dispatched_paths=K}}class uR extends O{constructor(Z,J){super();this.path=Z,this.handler=J}}class _R extends O{constructor(Z){super();this.path=Z}}function dR(){return new k8(E1(),e,e)}function Jf(Z){return new k8(Z.handlers,Z.next_dispatched_paths,e)}function Kf(Z,J,K){return fR(Z,vR(J,K))}function cJ(Z,J,K){let X=Kf(Z.handlers,J,K);return new k8(X,Z.dispatched_paths,Z.next_dispatched_paths)}function oy(Z,J,K){return v0(K,Z,(X,W)=>{if(W instanceof B1){let Y=W.name;return Kf(X,J,Y)}else return X})}function cR(Z,J,K,X){let W=yZ(Z.handlers,J+hR+K);if(W instanceof E){let Y=W[0],V=z0(X,Y);if(V instanceof E){let G=V[0];return new uR(J,G)}else return new _R(J)}else return new _R(J)}function pR(Z,J){let K=A(J.path,Z.next_dispatched_paths),X=new k8(Z.handlers,Z.dispatched_paths,K);if(J instanceof uR){let W=J.handler;return[X,new E(W)]}else return[X,new v(void 0)]}function pJ(Z,J,K,X){let W=cR(Z,J,K,X);return((Y)=>{return pR(Z,Y)})(W)}function nJ(Z,J){return ry(J,Z.dispatched_paths)}function Yf(Z,J,K,X,W){return R5(Z,vR(K,X),A5(W,(Y)=>{return new RZ(Y.prevent_default,Y.stop_propagation,S0(J)(Y.message))}))}function H4(Z,J,K,X,W){let Y=Yf(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function ey(Z,J,K,X){return v0(X,Z,(W,Y)=>{if(Y instanceof B1){let{name:V,handler:G}=Y;return Yf(W,J,K,V,G)}else return W})}function f8(Z,J){let K=$R(Z,S0);if($R(J,S0))return Z;else if(K)return J;else return(W)=>{return Z(J(W))}}function Zf(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(G instanceof M)return W;else{let{head:I,tail:z}=G;Z=Xf(W,Y,V,I),J=Y,K=V+1,X=z}}}function Xf(Z,J,K,X){if(X instanceof R1){let W=X.children,Y=e1(J,K,X.key);return Zf(Z,Y,0,W)}else if(X instanceof C1){let{attributes:W,children:Y}=X,V=e1(J,K,X.key),I=oy(Z,V,W);return Zf(I,V,0,Y)}else if(X instanceof v1)return Z;else{let W=X.attributes,Y=e1(J,K,X.key);return oy(Z,Y,W)}}function b8(Z,J,K,X){let W=Xf(Z.handlers,J,K,X);return new k8(W,Z.dispatched_paths,Z.next_dispatched_paths)}function mR(Z,J,K,X,W){while(!0){let Y=Z,V=J,G=K,I=X,z=W;if(z instanceof M)return Y;else{let{head:N,tail:F}=z;Z=Wf(Y,V,G,I,N),J=V,K=G,X=I+1,W=F}}}function Wf(Z,J,K,X,W){if(W instanceof R1){let Y=W.children,V=e1(K,X,W.key),G=f8(J,W.mapper);return mR(Z,G,V,0,Y)}else if(W instanceof C1){let{attributes:Y,children:V}=W,G=e1(K,X,W.key),I=f8(J,W.mapper),N=ey(Z,I,G,Y);return mR(N,I,G,0,V)}else if(W instanceof v1)return Z;else{let Y=W.attributes,V=e1(K,X,W.key),G=f8(J,W.mapper);return ey(Z,G,V,Y)}}function h8(Z,J,K,X,W){let Y=Wf(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function nR(Z){return h8(dR(),S0,I4,0,Z)}function Qf(Z,J,K,X,W){let Y=mR(Z.handlers,J,K,X,W);return new k8(Y,Z.dispatched_paths,Z.next_dispatched_paths)}function R0(Z,J,K){return N4("",S0,"",Z,J,K,E1(),!1,z4(Z,""))}function g1(Z,J,K,X){return N4("",S0,Z,J,K,X,E1(),!1,z4(J,Z))}function x(Z){return gR("",S0,Z)}function G0(){return gR("",S0,"")}function Vf(Z){return dJ("",S0,Z,E1())}function hZ(Z,J){let K=S0(f8(S0(J),Z.mapper));if(Z instanceof R1){let{children:X,keyed_children:W}=Z;return new R1(Z.kind,Z.key,K,S0(X),S0(W))}else if(Z instanceof C1){let{attributes:X,children:W,keyed_children:Y}=Z;return new C1(Z.kind,Z.key,K,Z.namespace,Z.tag,S0(X),S0(W),S0(Y),Z.self_closing,Z.void)}else if(Z instanceof v1)return S0(Z);else{let X=Z.attributes;return new Z5(Z.kind,Z.key,K,Z.namespace,Z.tag,S0(X),Z.inner_html)}}function l0(Z){return x(Z)}function $1(Z,J){return R0("h1",Z,J)}function D4(Z,J){return R0("h2",Z,J)}function B4(Z,J){return R0("h3",Z,J)}function j(Z,J){return R0("div",Z,J)}function y5(Z,J){return R0("li",Z,J)}function C0(Z,J){return R0("p",Z,J)}function iJ(Z,J){return R0("pre",Z,J)}function sJ(Z,J){return R0("ul",Z,J)}function _1(Z,J){return R0("a",Z,J)}function v8(Z,J){return R0("code",Z,J)}function n(Z,J){return R0("span",Z,J)}function Gf(Z){return R0("img",Z,e)}function E0(Z,J){return R0("button",Z,J)}function g8(Z,J){return R0("form",Z,J)}function z1(Z){return R0("input",Z,e)}function r0(Z,J){return R0("label",Z,J)}function iR(Z,J){return R0("option",Z,Q([x(J)]))}function If(Z,J){return R0("select",Z,J)}function sR(Z,J){return R0("textarea",A(UR("value",c(J)),Z),Q([x(J)]))}function zf(Z,J){return R0("details",Z,J)}function Nf(Z,J){return R0("summary",Z,J)}class vZ extends O{constructor(Z,J,K,X){super();this.index=Z,this.removed=J,this.changes=K,this.children=X}}class Ff extends O{constructor(Z,J){super();this.kind=Z,this.content=J}}class Hf extends O{constructor(Z,J){super();this.kind=Z,this.inner_html=J}}class Df extends O{constructor(Z,J,K){super();this.kind=Z,this.added=J,this.removed=K}}class Bf extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.before=K}}class Of extends O{constructor(Z,J,K){super();this.kind=Z,this.index=J,this.with=K}}class Tf extends O{constructor(Z,J){super();this.kind=Z,this.index=J}}class Pf extends O{constructor(Z,J,K){super();this.kind=Z,this.children=J,this.before=K}}function lR(Z,J,K,X){return new vZ(Z,J,K,X)}var rR=0;function Sf(Z){return new Ff(rR,Z)}var aR=1;function Af(Z){return new Hf(aR,Z)}var tR=2;function oR(Z,J){return new Df(tR,Z,J)}var eR=3;function qf(Z,J){return new Bf(eR,Z,J)}var Zj=4;function Ef(Z){return new Tf(Zj,Z)}var Jj=5;function f5(Z,J){return new Of(Jj,Z,J)}var Kj=6;function Yj(Z,J){return new Pf(Kj,Z,J)}class xf extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.kind=Z,this.open_shadow_root=J,this.will_adopt_styles=K,this.observed_attributes=X,this.observed_properties=W,this.requested_contexts=Y,this.provided_contexts=V,this.vdom=G}}class wf extends O{constructor(Z,J){super();this.kind=Z,this.patch=J}}class Uf extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.data=K}}class Mf extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.value=K}}class lJ extends O{constructor(Z,J){super();this.kind=Z,this.messages=J}}class rJ extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class aJ extends O{constructor(Z,J,K){super();this.kind=Z,this.name=J,this.value=K}}class tJ extends O{constructor(Z,J,K,X){super();this.kind=Z,this.path=J,this.name=K,this.event=X}}class Xj extends O{constructor(Z,J,K){super();this.kind=Z,this.key=J,this.value=K}}var Pg=0;function Rf(Z,J,K,X,W,Y,V){return new xf(Pg,Z,J,K,X,W,Y,V)}var Sg=1;function Wj(Z){return new wf(Sg,Z)}var Ag=2;function jf(Z,J){return new Uf(Ag,Z,J)}var qg=3;function Lf(Z,J){return new Mf(qg,Z,J)}class oJ extends O{constructor(Z,J){super();this.patch=Z,this.events=J}}class kf extends O{constructor(Z,J,K){super();this.added=Z,this.removed=J,this.events=K}}function Eg(Z,J,K,X){if(K==="input"&&J==="")return nJ(Z,X);else if(K==="select"&&J==="")return nJ(Z,X);else if(K==="textarea"&&J==="")return nJ(Z,X);else return!1}function ff(Z,J,K,X,W,Y,V,G){while(!0){let I=Z,z=J,N=K,F=X,D=W,B=Y,T=V,P=G;if(D instanceof M)if(B instanceof M)return new kf(T,P,F);else{let S=B.head;if(S instanceof B1){let q=S,C=B.tail,U=S.name,k=S.handler,w=A(q,T),f=H4(F,N,z,U,k);Z=I,J=z,K=N,X=f,W=D,Y=C,V=w,G=P}else{let q=S,C=B.tail,U=A(q,T);Z=I,J=z,K=N,X=F,W=D,Y=C,V=U,G=P}}else if(B instanceof M){let S=D.head;if(S instanceof B1){let q=S,C=D.tail,U=S.name,k=A(q,P),w=cJ(F,z,U);Z=I,J=z,K=N,X=w,W=C,Y=B,V=T,G=k}else{let q=S,C=D.tail,U=A(q,P);Z=I,J=z,K=N,X=F,W=C,Y=B,V=T,G=U}}else{let{head:S,tail:q}=D,C=B.head,U=B.tail,k=$J(S,C);if(k instanceof a0)if(S instanceof B1){let w=S.name,f=A(S,P),$=cJ(F,z,w);Z=I,J=z,K=N,X=$,W=q,Y=B,V=T,G=f}else{let w=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=B,V=T,G=w}else if(k instanceof t0)if(S instanceof t1)if(C instanceof t1){let w,f=C.name;if(f==="value")w=I||S.value!==C.value;else if(f==="checked")w=I||S.value!==C.value;else if(f==="selected")w=I||S.value!==C.value;else w=S.value!==C.value;let $=w,d;if($)d=A(C,T);else d=T;let p=d;Z=I,J=z,K=N,X=F,W=q,Y=U,V=p,G=P}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=A(S,P),p=H4(F,N,z,w,f);Z=I,J=z,K=N,X=p,W=q,Y=U,V=$,G=d}else{let w=A(C,T),f=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=U,V=w,G=f}else if(S instanceof MZ)if(C instanceof MZ){let w,f=C.name;if(f==="scrollLeft")w=!0;else if(f==="scrollRight")w=!0;else if(f==="value")w=I||!Q8(S.value,C.value);else if(f==="checked")w=I||!Q8(S.value,C.value);else if(f==="selected")w=I||!Q8(S.value,C.value);else w=!Q8(S.value,C.value);let $=w,d;if($)d=A(C,T);else d=T;let p=d;Z=I,J=z,K=N,X=F,W=q,Y=U,V=p,G=P}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=A(S,P),p=H4(F,N,z,w,f);Z=I,J=z,K=N,X=p,W=q,Y=U,V=$,G=d}else{let w=A(C,T),f=A(S,P);Z=I,J=z,K=N,X=F,W=q,Y=U,V=w,G=f}else if(C instanceof B1){let{name:w,handler:f}=C,$=S.prevent_default.kind!==C.prevent_default.kind||S.stop_propagation.kind!==C.stop_propagation.kind||S.debounce!==C.debounce||S.throttle!==C.throttle,d;if($)d=A(C,T);else d=T;let p=d,r=H4(F,N,z,w,f);Z=I,J=z,K=N,X=r,W=q,Y=U,V=p,G=P}else{let w=S.name,f=A(C,T),$=A(S,P),d=cJ(F,z,w);Z=I,J=z,K=N,X=d,W=q,Y=U,V=f,G=$}else if(C instanceof B1){let{name:w,handler:f}=C,$=A(C,T),d=H4(F,N,z,w,f);Z=I,J=z,K=N,X=d,W=D,Y=U,V=$,G=P}else{let w=A(C,T);Z=I,J=z,K=N,X=F,W=D,Y=U,V=w,G=P}}}}function Qj(Z,J,K,X,W,Y,V,G,I,z,N,F,D,B){while(!0){let T=Z,P=J,S=K,q=X,C=W,U=Y,k=V,w=G,f=I,$=z,d=N,p=F,r=D,X0=B;if(T instanceof M)if(S instanceof M)return new oJ(new vZ(f,k,d,p),X0);else{let B0=Qf(X0,r,$,w,S),L0=Yj(S,w-U),I0=A(L0,d);return new oJ(new vZ(f,k,I0,p),B0)}else if(S instanceof M){let{head:B0,tail:L0}=T,I0;if(B0.key===""||!fZ(C,B0.key))I0=k+1;else I0=k;let W0=I0,J0=b8(X0,$,w,B0);Z=L0,J=P,K=S,X=q,W=C,Y=U,V=W0,G=w,I=f,z=$,N=d,F=p,D=r,B=J0}else{let B0=T.head,L0=S.head;if(B0.key!==L0.key){let I0=T.tail,D0=S.tail,W0=yZ(P,L0.key);if(fZ(q,B0.key))if(W0 instanceof E){let Z0=W0[0];if(fZ(C,B0.key))Z=I0,J=P,K=S,X=q,W=C,Y=U-1,V=k,G=w,I=f,z=$,N=d,F=p,D=r,B=X0;else{let y=w-U,_=A(qf(L0.key,y),d),t=R5(C,L0.key,void 0),o=U+1;Z=A(Z0,T),J=P,K=S,X=q,W=t,Y=o,V=k,G=w,I=f,z=$,N=_,F=p,D=r,B=X0}}else{let Z0=w-U,m=h8(X0,r,$,w,L0),y=Yj(Q([L0]),Z0),_=A(y,d);Z=T,J=P,K=D0,X=q,W=C,Y=U+1,V=k,G=w+1,I=f,z=$,N=_,F=p,D=r,B=m}else if(W0 instanceof E){let Z0=w-U,m=A(Ef(Z0),d),y=b8(X0,$,w,B0),_=U-1;Z=I0,J=P,K=S,X=q,W=C,Y=_,V=k,G=w,I=f,z=$,N=m,F=p,D=r,B=y}else{let Z0=f5(w-U,L0),m,_=b8(X0,$,w,B0);m=h8(_,r,$,w,L0);let t=m;Z=I0,J=P,K=D0,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(Z0,d),F=p,D=r,B=t}}else{let I0=T.head;if(I0 instanceof R1){let D0=S.head;if(D0 instanceof R1){let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f8(r,Z0.mapper),_=e1($,w,Z0.key),t=Qj(W0.children,W0.keyed_children,Z0.children,Z0.keyed_children,E1(),0,0,0,w,_,e,e,y,X0),o,Y0=t.patch;if(Y0.changes instanceof M)if(Y0.children instanceof M)if(Y0.removed===0)o=p;else o=A(t.patch,p);else o=A(t.patch,p);else o=A(t.patch,p);let x0=o;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=x0,D=r,B=t.events}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else if(I0 instanceof C1){let D0=S.head;if(D0 instanceof C1){let W0=I0,J0=D0;if(W0.namespace===J0.namespace&&W0.tag===J0.tag){let Z0=T.tail,m=S.tail,y=f8(r,J0.mapper),_=e1($,w,J0.key),t=Eg(X0,J0.namespace,J0.tag,_),o=ff(t,_,y,X0,W0.attributes,J0.attributes,e,e),Y0,w0,x0;Y0=o.added,w0=o.removed,x0=o.events;let y0;if(Y0 instanceof M&&w0 instanceof M)y0=e;else y0=Q([oR(Y0,w0)]);let F1=y0,T1=Qj(W0.children,W0.keyed_children,J0.children,J0.keyed_children,E1(),0,0,0,w,_,F1,e,y,x0),P1,w1=T1.patch;if(w1.changes instanceof M)if(w1.children instanceof M)if(w1.removed===0)P1=p;else P1=A(T1.patch,p);else P1=A(T1.patch,p);else P1=A(T1.patch,p);let w8=P1;Z=Z0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=w8,D=r,B=T1.events}else{let Z0=I0,m=T.tail,y=D0,_=S.tail,t=f5(w-U,y),o,w0=b8(X0,$,w,Z0);o=h8(w0,r,$,w,y);let x0=o;Z=m,J=P,K=_,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(t,d),F=p,D=r,B=x0}}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else if(I0 instanceof v1){let D0=S.head;if(D0 instanceof v1){let W0=I0,J0=D0;if(W0.content===J0.content){let Z0=T.tail,m=S.tail;Z=Z0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=p,D=r,B=X0}else{let Z0=T.tail,m=D0,y=S.tail,_=lR(w,0,Q([Sf(m.content)]),e);Z=Z0,J=P,K=y,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=A(_,p),D=r,B=X0}}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}else{let D0=S.head;if(D0 instanceof Z5){let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f8(r,Z0.mapper),_=e1($,w,Z0.key),t=ff(!1,_,y,X0,W0.attributes,Z0.attributes,e,e),o,Y0,w0;o=t.added,Y0=t.removed,w0=t.events;let x0;if(o instanceof M&&Y0 instanceof M)x0=e;else x0=Q([oR(o,Y0)]);let y0=x0,F1;if(W0.inner_html===Z0.inner_html)F1=y0;else F1=A(Af(Z0.inner_html),y0);let P1=F1,w1;if(P1 instanceof M)w1=p;else w1=A(lR(w,0,P1,Q([])),p);let G8=w1;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=d,F=G8,D=r,B=w0}else{let W0=I0,J0=T.tail,Z0=D0,m=S.tail,y=f5(w-U,Z0),_,o=b8(X0,$,w,W0);_=h8(o,r,$,w,Z0);let Y0=_;Z=J0,J=P,K=m,X=q,W=C,Y=U,V=k,G=w+1,I=f,z=$,N=A(y,d),F=p,D=r,B=Y0}}}}}}function O4(Z,J,K){return Qj(Q([J]),E1(),Q([K]),E1(),E1(),0,0,0,0,I4,e,e,S0,Jf(Z))}var{setTimeout:Cg,clearTimeout:Vj}=globalThis,xg=(Z,J)=>a1().createElementNS(Z,J),wg=(Z)=>a1().createTextNode(Z),Ug=()=>a1().createDocumentFragment(),T4=(Z,J,K)=>Z.insertBefore(J,K),hf=jy?(Z,J,K)=>Z.moveBefore(J,K):T4,Mg=(Z,J)=>Z.removeChild(J),Rg=(Z,J)=>Z.getAttribute(J),vf=(Z,J,K)=>Z.setAttribute(J,K),jg=(Z,J)=>Z.removeAttribute(J),Lg=(Z,J,K,X)=>Z.addEventListener(J,K,X),gf=(Z,J,K)=>Z.removeEventListener(J,K),yg=(Z,J)=>Z.innerHTML=J,fg=(Z,J)=>Z.data=J,$8=Symbol("lustre");class mf{constructor(Z,J,K,X){this.kind=Z,this.key=X,this.parent=J,this.children=[],this.node=K,this.handlers=new Map,this.throttles=new Map,this.debouncers=new Map}get parentNode(){return this.kind===W8?this.node.parentNode:this.node}}var _8=(Z,J,K,X,W)=>{let Y=new mf(Z,J,K,W);return K[$8]=Y,J?.children.splice(X,0,Y),Y},kg=(Z)=>{let J="";for(let K=Z[$8];K.parent;K=K.parent)if(K.key)J=`${bZ}${K.key}${J}`;else{let X=K.parent.children.indexOf(K);J=`${bZ}${X}${J}`}return J.slice(1)};class Ij{#Z=null;#X;#K;#Y=!1;constructor(Z,J,K,{exposeKeys:X=!1}={}){this.#Z=Z,this.#X=J,this.#K=K,this.#Y=X}mount(Z){_8(j5,null,this.#Z,0,null),this.#P(this.#Z,null,this.#Z[$8],0,Z)}push(Z){this.#J.push({node:this.#Z[$8],patch:Z}),this.#W()}#J=[];#W(){let Z=this.#J;while(Z.length){let{node:J,patch:K}=Z.pop(),{children:X}=J,{changes:W,removed:Y,children:V}=K;if(k5(W,(G)=>this.#Q(J,G)),Y)this.#F(J,X.length-Y,Y);k5(V,(G)=>{let I=X[G.index|0];this.#J.push({node:I,patch:G})})}}#Q(Z,J){switch(J.kind){case rR:this.#C(Z,J);break;case aR:this.#S(Z,J);break;case tR:this.#D(Z,J);break;case eR:this.#z(Z,J);break;case Zj:this.#O(Z,J);break;case Jj:this.#N(Z,J);break;case Kj:this.#G(Z,J);break}}#G(Z,{children:J,before:K}){let X=Ug(),W=this.#I(Z,K);this.#T(X,null,Z,K|0,J),T4(Z.parentNode,X,W)}#N(Z,{index:J,with:K}){this.#F(Z,J|0,1);let X=this.#I(Z,J);this.#P(Z.parentNode,X,Z,J|0,K)}#I(Z,J){J=J|0;let{children:K}=Z,X=K.length;if(J<X)return K[J].node;let W=K[X-1];if(!W&&Z.kind!==W8)return null;if(!W)W=Z;while(W.kind===W8&&W.children.length)W=W.children[W.children.length-1];return W.node.nextSibling}#z(Z,{key:J,before:K}){K=K|0;let{children:X,parentNode:W}=Z,Y=X[K].node,V=X[K];for(let N=K+1;N<X.length;++N){let F=X[N];if(X[N]=V,V=F,F.key===J){X[K]=F;break}}let{kind:G,node:I,children:z}=V;if(hf(W,I,Y),G===W8)this.#V(W,z,Y)}#V(Z,J,K){for(let X=0;X<J.length;++X){let{kind:W,node:Y,children:V}=J[X];if(hf(Z,Y,K),W===W8)this.#V(Z,V,K)}}#O(Z,{index:J}){this.#F(Z,J,1)}#F(Z,J,K){let{children:X,parentNode:W}=Z,Y=X.splice(J,K);for(let V=0;V<Y.length;++V){let{kind:G,node:I,children:z}=Y[V];if(Mg(W,I),this.#H(Y[V]),G===W8)Y.push(...z)}}#H(Z){let{debouncers:J,children:K}=Z;for(let{timeout:X}of J.values())if(X)Vj(X);J.clear(),k5(K,(X)=>this.#H(X))}#D({node:Z,handlers:J,throttles:K,debouncers:X},{added:W,removed:Y}){k5(Y,({name:V})=>{if(J.delete(V))gf(Z,V,Gj),this.#B(K,V,0),this.#B(X,V,0);else jg(Z,V),_f[V]?.removed?.(Z,V)}),k5(W,(V)=>this.#E(Z,V))}#C({node:Z},{content:J}){fg(Z,J??"")}#S({node:Z},{inner_html:J}){yg(Z,J??"")}#T(Z,J,K,X,W){k5(W,(Y)=>this.#P(Z,J,K,X++,Y))}#P(Z,J,K,X,W){switch(W.kind){case j5:{let Y=this.#A(K,X,W);this.#T(Y,null,Y[$8],0,W.children),T4(Z,Y,J);break}case F4:{let Y=this.#q(K,X,W);T4(Z,Y,J);break}case W8:{let Y=this.#q(K,X,W);T4(Z,Y,J),this.#T(Z,J,Y[$8],0,W.children);break}case ty:{let Y=this.#A(K,X,W);this.#S({node:Y},W),T4(Z,Y,J);break}}}#A(Z,J,{kind:K,key:X,tag:W,namespace:Y,attributes:V}){let G=xg(Y||hJ,W);if(_8(K,Z,G,J,X),this.#Y&&X)vf(G,"data-lustre-key",X);return k5(V,(I)=>this.#E(G,I)),G}#q(Z,J,{kind:K,key:X,content:W}){let Y=wg(W??"");return _8(K,Z,Y,J,X),Y}#E(Z,J){let{debouncers:K,handlers:X,throttles:W}=Z[$8],{kind:Y,name:V,value:G,prevent_default:I,debounce:z,throttle:N}=J;switch(Y){case qR:{let F=G??"";if(V==="virtual:defaultValue"){Z.defaultValue=F;return}else if(V==="virtual:defaultChecked"){Z.defaultChecked=!0;return}else if(V==="virtual:defaultSelected"){Z.defaultSelected=!0;return}if(F!==Rg(Z,V))vf(Z,V,F);_f[V]?.added?.(Z,F);break}case ER:Z[V]=G;break;case CR:{if(X.has(V))gf(Z,V,Gj);let F=I.kind===xR;Lg(Z,V,Gj,{passive:F}),this.#B(W,V,N),this.#B(K,V,z),X.set(V,(D)=>this.#x(J,D));break}}}#B(Z,J,K){let X=Z.get(J);if(K>0)if(X)X.delay=K;else Z.set(J,{delay:K});else if(X){let{timeout:W}=X;if(W)Vj(W);Z.delete(J)}}#x(Z,J){let{currentTarget:K,type:X}=J,{debouncers:W,throttles:Y}=K[$8],V=kg(K),{prevent_default:G,stop_propagation:I,include:z}=Z;if(G.kind===_J)J.preventDefault();if(I.kind===_J)J.stopPropagation();if(X==="submit")J.detail??={},J.detail.formData=[...new FormData(J.target,J.submitter).entries()];let N=this.#X(J,V,X,z),F=Y.get(X);if(F){let B=Date.now(),T=F.last||0;if(B>T+F.delay)F.last=B,F.lastEvent=J,this.#K(J,N)}let D=W.get(X);if(D)Vj(D.timeout),D.timeout=Cg(()=>{if(J===Y.get(X)?.lastEvent)return;this.#K(J,N)},D.delay);if(!F&&!D)this.#K(J,N)}}var k5=(Z,J)=>{if(Array.isArray(Z))for(let K=0;K<Z.length;K++)J(Z[K]);else if(Z)for(Z;Z.head;Z=Z.tail)J(Z.head)},Gj=(Z)=>{let{currentTarget:J,type:K}=Z;J[$8].handlers.get(K)(Z)},$f=(Z)=>{return{added(J){J[Z]=!0},removed(J){J[Z]=!1}}},bg=(Z)=>{return{added(J,K){J[Z]=K}}},_f={checked:$f("checked"),selected:$f("selected"),value:bg("value"),autofocus:{added(Z){queueMicrotask(()=>{Z.focus?.()})}},autoplay:{added(Z){try{Z.play?.()}catch(J){console.error(J)}}}};function hg(Z,J,K){while(!0){let X=Z,W=J,Y=K;if(X instanceof M)return[W,F0(Y)];else{let V=X.tail,G=X.head[0],I=X.head[1],z=ay(G,I),N;if(G==="")N=W;else N=R5(W,G,z);let F=N,D=A(z,Y);Z=V,J=F,K=D}}}function zj(Z){return hg(Z,E1(),e)}function uf(Z,J,K){let X=zj(K),W,Y;return W=X[0],Y=X[1],N4("",S0,"",Z,J,Y,W,!1,z4(Z,""))}function df(Z,J,K,X){let W=zj(X),Y,V;return Y=W[0],V=W[1],N4("",S0,Z,J,K,V,Y,!1,z4(J,Z))}function cf(Z){let J=zj(Z),K,X;return K=J[0],X=J[1],dJ("",S0,X,K)}var pf=(Z)=>{let J=_8(j5,null,Z,0,null),K=0;for(let V=Z.firstChild;V;V=V.nextSibling)if(nf(V))K+=1;if(K===0){let V=a1().createTextNode("");return _8(F4,J,V,0,null),Z.replaceChildren(V),G0()}if(K===1)return Nj(J,Z).head[1];let X=a1().createTextNode(""),W=_8(W8,J,X,0,null),Y=Nj(W,Z);return Z.insertBefore(X,Z.firstChild),cf(Y)},nf=(Z)=>{switch(Z.nodeType){case vJ:return!0;case SR:return!!Z.data;default:return!1}},vg=(Z,J,K,X)=>{if(!nf(J))return null;switch(J.nodeType){case vJ:{let W=_8(j5,Z,J,X,K),Y=J.localName,V=J.namespaceURI,G=!V||V===hJ;if(G&&gg.includes(Y))$g(Y,J);let I=_g(J),z=Nj(W,J);return G?uf(Y,I,z):df(V,Y,I,z)}case SR:return _8(F4,Z,J,X,null),x(J.data);default:return null}},gg=["input","select","textarea"],$g=(Z,J)=>{let{value:K,checked:X}=J;if(Z==="input"&&J.type==="checkbox"&&!X)return;if(Z==="input"&&J.type==="radio"&&!X)return;if(J.type!=="checkbox"&&J.type!=="radio"&&!K)return;queueMicrotask(()=>{if(J.value=K,J.checked=X,J.dispatchEvent(new Event("input",{bubbles:!0})),J.dispatchEvent(new Event("change",{bubbles:!0})),a1().activeElement!==J)J.dispatchEvent(new Event("blur",{bubbles:!0}))})},Nj=(Z,J)=>{let K=null,X=J.firstChild,W=null,Y=0;while(X){let V=X.nodeType===vJ?X.getAttribute("data-lustre-key"):null;if(V!=null)X.removeAttribute("data-lustre-key");let G=vg(Z,X,V,Y),I=X.nextSibling;if(G){let z=new f1([V??"",G],null);if(W)W=W.tail=z;else W=K=z;Y+=1}else J.removeChild(X);X=I}if(!W)return e;return W.tail=e,K},_g=(Z)=>{let J=Z.attributes.length,K=e;while(J-- >0){let X=Z.attributes[J];if(X.name==="xmlns")continue;K=new f1(mg(X),K)}return K},mg=(Z)=>{let{localName:J,value:K}=Z;return R(J,K)};var J5=()=>!!a1();class eJ{constructor(Z,[J,K],X,W){this.root=Z,this.#Z=J,this.#X=X,this.#K=W,this.root.addEventListener("context-request",(G)=>{if(!(G.context&&G.callback))return;if(!this.#Q.has(G.context))return;G.stopImmediatePropagation();let I=this.#Q.get(G.context);if(G.subscribe){let z=()=>{I.subscribers=I.subscribers.filter((N)=>N!==G.callback)};I.subscribers.push([G.callback,z]),G.callback(I.value,z)}else G.callback(I.value)});let Y=(G,I,z)=>cR(this.#J,I,z,G),V=(G,I)=>{let[z,N]=pR(this.#J,I);if(this.#J=z,N.isOk()){let F=N[0];if(F.stop_propagation)G.stopPropagation();if(F.prevent_default)G.preventDefault();this.dispatch(F.message,!1)}};this.#W=new Ij(this.root,Y,V),this.#Y=pf(this.root),this.#J=dR(),this.#H(K),this.#D()}root=null;dispatch(Z,J=!1){if(this.#G)this.#N.push(Z);else{let[K,X]=this.#K(this.#Z,Z);this.#Z=K,this.#F(X,J)}}emit(Z,J){(this.root.host??this.root).dispatchEvent(new CustomEvent(Z,{detail:J,bubbles:!0,composed:!0}))}provide(Z,J){if(!this.#Q.has(Z))this.#Q.set(Z,{value:J,subscribers:[]});else{let K=this.#Q.get(Z);if(Q8(K.value,J))return;K.value=J;for(let X=K.subscribers.length-1;X>=0;X--){let[W,Y]=K.subscribers[X];if(!W){K.subscribers.splice(X,1);continue}W(J,Y)}}}#Z;#X;#K;#Y;#J;#W;#Q=new Map;#G=!1;#N=[];#I=e;#z=e;#V=null;#O={dispatch:(Z)=>this.dispatch(Z),emit:(Z,J)=>this.emit(Z,J),select:()=>{},root:()=>this.root,provide:(Z,J)=>this.provide(Z,J)};#F(Z,J=!1){if(this.#H(Z),!this.#V)if(J)this.#V="sync",queueMicrotask(()=>this.#D());else this.#V=requestAnimationFrame(()=>this.#D())}#H(Z){this.#G=!0;while(!0){for(let K=Z.synchronous;K.tail;K=K.tail)K.head(this.#O);if(this.#I=lf(this.#I,Z.before_paint),this.#z=lf(this.#z,Z.after_paint),!this.#N.length)break;let J=this.#N.shift();[this.#Z,Z]=this.#K(this.#Z,J)}this.#G=!1}#D(){this.#V=null;let Z=this.#X(this.#Z),{patch:J,events:K}=O4(this.#J,this.#Y,Z);if(this.#J=K,this.#Y=Z,this.#W.push(J),this.#I instanceof f1){let X=sf(this.#I);this.#I=e,queueMicrotask(()=>{this.#F(X,!0)})}if(this.#z instanceof f1){let X=sf(this.#z);this.#z=e,requestAnimationFrame(()=>{this.#F(X,!0)})}}}function sf(Z){return{synchronous:Z,after_paint:e,before_paint:e}}function lf(Z,J){if(Z instanceof M)return J;else if(J instanceof M)return Z;else return _0(Z,J)}class Hj extends O{constructor(Z){super();this.message=Z}}class Dj extends O{constructor(Z){super();this.callback=Z}}class Bj extends O{constructor(Z){super();this.callback=Z}}class K5 extends O{constructor(Z){super();this.message=Z}}class b5 extends O{constructor(Z,J){super();this.name=Z,this.data=J}}class ZK extends O{constructor(Z,J){super();this.key=Z,this.value=J}}class h5 extends O{}class tf extends O{constructor(Z,J,K,X,W,Y,V,G,I,z){super();this.open_shadow_root=Z,this.adopt_styles=J,this.delegates_focus=K,this.attributes=X,this.properties=W,this.contexts=Y,this.is_form_associated=V,this.on_form_autofill=G,this.on_form_reset=I,this.on_form_restore=z}}function of(Z){let J=new tf(!0,!0,!1,e,e,e,!1,gJ,gJ,gJ);return v0(Z,J,(K,X)=>{return X.apply(K)})}class Zk{#Z;constructor(Z,[J,K],X,W){this.#Z=new eJ(Z,[J,K],W,X)}send(Z){switch(Z.constructor){case K5:{this.dispatch(Z.message,!1);break}case b5:{this.emit(Z.name,Z.data);break}case h5:break}}dispatch(Z){this.#Z.dispatch(Z)}emit(Z,J){this.#Z.emit(Z,J)}}var Jk=({init:Z,update:J,view:K},X,W)=>{if(!J5())return new v(new gZ);let Y=X instanceof HTMLElement?X:a1().querySelector(X);if(!Y)return new v(new Oj(X));return new E(new Zk(Y,Z(W),J,K))};class ug{#Z;#X;#K;#Y;#J;#W;#Q=h0();#G=new Set;constructor([Z,J],K,X,W){this.#Z=Z,this.#X=K,this.#K=X,this.#Y=W,this.#J=this.#K(this.#Z),this.#W=nR(this.#J),this.#V(J)}send(Z){switch(Z.constructor){case Hj:{let{message:J}=Z,K=this.#N(J),X=O4(this.#W,this.#J,K);this.#J=K,this.#W=X.events,this.broadcast(Wj(X.patch));return}case Dj:{let{callback:J}=Z;this.#G.add(J),J(Rf(this.#Y.open_shadow_root,this.#Y.adopt_styles,M8(this.#Y.attributes),M8(this.#Y.properties),M8(this.#Y.contexts),this.#Q,this.#J));return}case Bj:{let{callback:J}=Z;this.#G.delete(J);return}case K5:{let{message:J}=Z,[K,X]=this.#X(this.#Z,J),W=this.#K(K),Y=O4(this.#W,this.#J,W);this.#V(X),this.#Z=K,this.#J=W,this.#W=Y.events,this.broadcast(Wj(Y.patch));return}case b5:{let{name:J,data:K}=Z;this.broadcast(jf(J,K));return}case ZK:{let{key:J,value:K}=Z,X=T0(this.#Q,J);if(X.isOk()&&Q8(X[0],K))return;this.#Q=i0(this.#Q,J,K),this.broadcast(Lf(J,K));return}case h5:{this.#Z=null,this.#X=null,this.#K=null,this.#Y=null,this.#J=null,this.#W=null,this.#Q=null,this.#G.clear();return}default:return}}broadcast(Z){for(let J of this.#G)J(Z)}#N(Z){switch(Z.constructor){case lJ:{let{messages:J}=Z,K=this.#Z,X=i();for(let W=J;W.head;W=W.tail){let Y=this.#N(W.head);if(Y instanceof E){K=Y[0][0],X=W1(n0.fromArray([X,Y[0][1]]));break}}return this.#V(X),this.#Z=K,this.#K(this.#Z)}case rJ:{let{name:J,value:K}=Z,X=this.#I(J,K);if(X instanceof v)return this.#J;else{let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}case aJ:{let{name:J,value:K}=Z,X=this.#z(J,K);if(X instanceof v)return this.#J;else{let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}case tJ:{let{path:J,name:K,event:X}=Z,[W,Y]=pJ(this.#W,J,K,X);if(this.#W=W,Y instanceof v)return this.#J;else{let[V,G]=this.#X(this.#Z,Y[0].message);return this.#V(G),this.#Z=V,this.#K(this.#Z)}}case Xj:{let{key:J,value:K}=Z,X=T0(this.#Y.contexts,J);if(X instanceof v)return this.#J;if(X=z0(K,X[0]),X instanceof v)return this.#J;let[W,Y]=this.#X(this.#Z,X[0]);return this.#V(Y),this.#Z=W,this.#K(this.#Z)}}}#I(Z,J){let K=T0(this.#Y.attributes,Z);switch(K.constructor){case E:return K[0](J);case v:return new v(void 0)}}#z(Z,J){let K=T0(this.#Y.properties,Z);switch(K.constructor){case E:return K[0](J);case v:return new v(void 0)}}#V(Z){let J=(V)=>this.send(new K5(V)),K=(V,G)=>this.send(new b5(V,G)),X=()=>{return},W=()=>{return},Y=(V,G)=>this.send(new ZK(V,G));globalThis.queueMicrotask(()=>{ny(Z,J,K,X,W,Y)})}}class Kk extends O{constructor(Z,J,K,X){super();this.init=Z,this.update=J,this.view=K,this.config=X}}class Oj extends O{constructor(Z){super();this.selector=Z}}class gZ extends O{}function Yk(Z,J,K){return new Kk(Z,J,K,of(e))}function Xk(Z,J,K){return V4(!J5(),new v(new gZ),()=>{return Jk(Z,J,K)})}function Vk(Z,J){return[Z,J]}var pg={handle_external_links:!1,handle_internal_links:!0},Ik=globalThis?.window?.location?.href,Sj=()=>{if(!Ik)return new v(void 0);else return new E(Pj(new URL(Ik)))},Aj=(Z,J=pg)=>{document.addEventListener("click",(K)=>{let X=Nk(K.target);if(!X)return;try{let W=new URL(X.href),Y=Pj(W),V=W.host!==window.location.host||X.target==="_blank";if(!J.handle_external_links&&V)return;if(!J.handle_internal_links&&!V)return;if(K.preventDefault(),!V)window.history.pushState({},"",X.href),window.requestAnimationFrame(()=>{if(W.hash)document.getElementById(W.hash.slice(1))?.scrollIntoView();else window.scrollTo(0,0)});return Z(Y)}catch{return}}),window.addEventListener("popstate",(K)=>{K.preventDefault();let X=new URL(window.location.href),W=Pj(X);window.requestAnimationFrame(()=>{if(X.hash)document.getElementById(X.hash.slice(1))?.scrollIntoView();else window.scrollTo(0,0)}),Z(W)}),window.addEventListener("modem-push",({detail:K})=>{Z(K)}),window.addEventListener("modem-replace",({detail:K})=>{Z(K)})},zk=(Z)=>{window.history.pushState({},"",kJ(Z)),window.requestAnimationFrame(()=>{if(Z.fragment[0])document.getElementById(Z.fragment[0])?.scrollIntoView()}),window.dispatchEvent(new CustomEvent("modem-push",{detail:Z}))};var Nk=(Z)=>{if(!Z||Z.tagName==="BODY")return null;else if(Z.tagName==="A")return Z;else return Nk(Z.parentElement)},Pj=(Z)=>{return new V0(Z.protocol?new L(Z.protocol.slice(0,-1)):new h,new h,Z.hostname?new L(Z.hostname):new h,Z.port?new L(Number(Z.port)):new h,Z.pathname,Z.search?new L(Z.search.slice(1)):new h,Z.hash?new L(Z.hash.slice(1)):new h)};function Hk(Z){return I1((J)=>{return V4(!J5(),void 0,()=>{return Aj((K)=>{let W=Z(K);return J(W)})})})}function Fk(Z){if(Z==="")return new h;else return new L(Z)}var JK=new V0(new h,new h,new h,new h,"",new h,new h);function v5(Z,J,K){return I1((X)=>{return V4(!J5(),void 0,()=>{return zk(new V0(JK.scheme,JK.userinfo,JK.host,JK.port,Z,mM(J,Fk),mM(K,Fk)))})})}class Dk extends O{constructor(Z,J){super();this.query=Z,this.module_path=J}}class qj extends O{constructor(Z){super();this.queries=Z}}function Bk(){return new qj(h0())}function e0(Z,J,K,X){let W=new Dk(K,X);return new qj(i0(Z.queries,J,W))}function Ej(Z,J){return T0(Z.queries,J)}class YK extends O{}class XK extends O{}class Ok extends O{}class Tk extends O{}class Pk extends O{}class Sk extends O{}class Ak extends O{}class qk extends O{}class Ek extends O{}class Cj extends O{}class WK extends O{}function Ck(Z){if(Z instanceof YK)return"GET";else if(Z instanceof XK)return"POST";else if(Z instanceof Ok)return"HEAD";else if(Z instanceof Tk)return"PUT";else if(Z instanceof Pk)return"DELETE";else if(Z instanceof Sk)return"TRACE";else if(Z instanceof Ak)return"CONNECT";else if(Z instanceof qk)return"OPTIONS";else if(Z instanceof Ek)return"PATCH";else return Z[0]}function xk(Z){if(Z instanceof Cj)return"http";else return"https"}function wk(Z){let J=s1(Z);if(J==="http")return new E(new Cj);else if(J==="https")return new E(new WK);else return new v(void 0)}class $Z extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.method=Z,this.headers=J,this.body=K,this.scheme=X,this.host=W,this.port=Y,this.path=V,this.query=G}}function Mk(Z){return new V0(new L(xk(Z.scheme)),new h,new L(Z.host),Z.port,Z.path,Z.query,new h)}function sg(Z){return M1((()=>{let J=Z.scheme,K=UL(J,"");return wk(K)})(),(J)=>{return M1((()=>{let K=Z.host;return $M(K,void 0)})(),(K)=>{let X=new $Z(new YK,Q([]),"",J,K,Z.port,Z.path,Z.query);return new E(X)})})}function xj(Z,J,K){let X=YR(Z.headers,s1(J),K);return new $Z(Z.method,X,Z.body,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function Rk(Z,J){return new $Z(Z.method,Z.headers,J,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function jk(Z,J){return new $Z(J,Z.headers,Z.body,Z.scheme,Z.host,Z.port,Z.path,Z.query)}function Lk(Z){let K=OR(Z);return M1(K,sg)}class wj extends O{constructor(Z,J,K){super();this.status=Z,this.headers=J,this.body=K}}class g5{constructor(Z){this.promise=Z}static wrap(Z){return Z instanceof Promise?new g5(Z):Z}static unwrap(Z){return Z instanceof g5?Z.promise:Z}}function O8(Z){return Promise.resolve(g5.wrap(Z))}function VK(Z,J){return Z.then((K)=>J(g5.unwrap(K)))}function GK(Z,J){return Z.then((K)=>g5.wrap(J(g5.unwrap(K))))}function Mj(Z){return new wj(Z.status,n0.fromArray([...Z.headers]),Z)}function tg(Z){let J=kJ(Mk(Z)),K=Ck(Z.method).toUpperCase(),X={headers:og(Z.headers),method:K};return[J,X]}function Rj(Z){let[J,K]=tg(Z);if(K.method!=="GET"&&K.method!=="HEAD")K.body=Z.body;return new globalThis.Request(J,K)}function og(Z){let J=new globalThis.Headers;for(let[K,X]of Z)J.append(K.toLowerCase(),X);return J}async function IK(Z){let J;try{J=await Z.body.text()}catch(K){return new v(new jj)}return new E(Z.withFields({body:J}))}class zK extends O{constructor(Z){super();this[0]=Z}}class jj extends O{}class fk extends O{constructor(Z,J){super();this.endpoint=Z,this.headers=J}}function Lj(Z,J){return new fk(Z,J)}function J1(Z,J,K){let X=b(Q([["query",c(J)],["variables",K]]));return M1((()=>{let W=Lk(Z.endpoint);return Y4(W,(Y)=>{return"Invalid endpoint URL"})})(),(W)=>{let Y,G=jk(W,new XK),I=Rk(G,j8(X));Y=xj(I,"content-type","application/json");let z=Y,N=v0(Z.headers,z,(F,D)=>{return xj(F,D[0],D[1])});return new E(N)})}function A0(Z,J){return M1((()=>{let K=l1(Z,f0);return Y4(K,(X)=>{return"Failed to decode JSON response"})})(),(K)=>{let X=g("data",J,(Y)=>{return l(Y)}),W=z0(K,X);return Y4(W,(Y)=>{return"Failed to decode response data: "+jJ(Y)+". Response body: "+Z})})}async function yj(Z){try{let J=Rj(Z),K=new Request(J,{credentials:"include"}),X=await fetch(K),W=Mj(X);return new E(W)}catch(J){return new v(new zK(J.toString()))}}var gk="src/squall_cache.gleam";class j1 extends O{}class L1 extends O{constructor(Z){super();this[0]=Z}}class Z8 extends O{constructor(Z){super();this[0]=Z}}class NK extends O{}class $k extends O{}class fj extends O{}class mZ extends O{constructor(Z,J,K){super();this.data=Z,this.timestamp=J,this.status=K}}class y1 extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.entities=Z,this.optimistic_entities=J,this.optimistic_mutations=K,this.queries=X,this.pending_fetches=W,this.get_headers=Y,this.mutation_counter=V,this.endpoint=G}}function _k(Z){return new y1(h0(),h0(),h0(),h0(),x5(),()=>{return Q([])},0,Z)}function FK(Z,J){return Z+":"+j8(J)}function kk(Z){let J=CJ(Z);if(J instanceof E){let K=J[0][0],X=J[0][1];return xJ(K)+X}else return Z}function kj(Z){let K=F0(Z),X=qJ(K,(W)=>{if(W==="data")return new v(void 0);else if(W==="results")return new v(void 0);else if(W==="edges")return new v(void 0);else if(W==="node")return new v(void 0);else if(wJ(W,"s")){let V=Y8(W),G=Gy(W,0,V-1);return new E(kk(G))}else return new E(kk(W))});return F8(X,"Entity")}function J$(Z){if(T0(Z,"node")instanceof E)return!0;else return!1}function K$(Z){let J=z0(Z,U0(f0));if(J instanceof E){let K=J[0];if(K instanceof M)return!1;else{let X=K.head,W=z0(X,R8(u,f0));if(W instanceof E){let Y=W[0];return J$(Y)}else return!1}}else return!1}function Y$(Z,J,K){let X=FK(J,K),W=T0(Z.queries,X);if(W instanceof E){let Y=W[0],V=new mZ(Y.data,Y.timestamp,new fj),G=i0(Z.queries,X,V);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,G,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else{let Y=new mZ("",0,new fj),V=i0(Z.queries,X,Y);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,V,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}}function m0(Z,J,K){let X=FK(J,K),W=N8(Z.queries,X);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,W,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}function X$(Z,J,K,X){let W,Y=T0(Z.optimistic_entities,K);if(Y instanceof E){let I=Y[0];W=new L(I)}else{let I=T0(Z.entities,K);if(I instanceof E){let z=I[0];W=new L(z)}else W=new h}let G=X(W);return new y1(Z.entities,i0(Z.optimistic_entities,K,G),i0(Z.optimistic_mutations,J,K),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}function bj(Z,J){let K=T0(Z.optimistic_mutations,J);if(K instanceof E){let X=K[0];return new y1(Z.entities,N8(Z.optimistic_entities,X),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return Z}function mk(Z){return!eM(Z.optimistic_mutations)}function P4(Z){let J=z0(Z,R8(u,f0));if(J instanceof E){let X=J[0],W=i8(X),Y=H0(W,(V)=>{let G,I;return G=V[0],I=V[1],[G,P4(I)]});return b(Y)}else{let K=z0(Z,U0(f0));if(K instanceof E){let X=K[0];return j0(X,P4)}else{let X=z0(Z,u);if(X instanceof E){let W=X[0];return c(W)}else{let W=z0(Z,p0);if(W instanceof E){let Y=W[0];return X1(Y)}else{let Y=z0(Z,pL);if(Y instanceof E){let V=Y[0];return qy(V)}else{let V=z0(Z,V1);if(V instanceof E){let G=V[0];return r1(G)}else return DR()}}}}}}function W$(Z,J){let K=j8(Z),X=j8(J),W=l1(K,f0),Y=l1(X,f0);if(W instanceof E&&Y instanceof E){let V=W[0],G=Y[0],I=z0(V,R8(u,f0)),z=z0(G,R8(u,f0));if(I instanceof E&&z instanceof E){let N=I[0],F=z[0],D,B=_0(M8(N),M8(F));D=$L(B);let P=S5(D,(S)=>{let q,C=T0(F,S);if(C instanceof E)q=C;else q=T0(N,S);let U=q;if(U instanceof E){let k=U[0];return new E([S,P4(k)])}else return new v(void 0)});return b(P)}else return J}else return J}function m8(Z,J){return r5(J,Z,(K,X,W)=>{let Y=T0(K,X);if(Y instanceof E){let V=Y[0],G=W$(V,W);return i0(K,X,G)}else return i0(K,X,W)})}function bk(Z){let J=E5(Z,":");if(J instanceof E){let K=J[0][0],X=J[0][1],W=l1(X,f0);if(W instanceof E){let Y=W[0];return new E([K,P4(Y)])}else return new E([K,DR()])}else return new v(void 0)}function Q$(Z,J,K,X,W,Y,V){let G=Ej(J,K);if(G instanceof E){let I=G[0];return I1((z)=>{let N=Z.get_headers(),F=Lj(Z.endpoint,N),D=J1(F,I.query,X),B;if(D instanceof E)B=D[0];else throw p8("let_assert",gk,"squall_cache",767,"create_mutation_effect","Pattern match failed, no pattern matched the value.",{value:D,start:24617,end:24701,pattern_start:24628,pattern_end:24635});let T,P=yj(B);T=GK(P,(q)=>{if(q instanceof E){let C=q[0],U=IK(C);return VK(U,(k)=>{if(k instanceof E){let w=k[0],f=Y(w.body);if(f instanceof E){let $=f[0];return z(V(W,new E($),w.body)),O8(void 0)}else{let $=f[0];return z(V(W,new v("Parse error: "+$),w.body)),O8(void 0)}}else return z(V(W,new v("Failed to read response"),"")),O8(void 0)})}else return z(V(W,new v("Failed to fetch"),"")),O8(void 0)});let S=T;return})}else return I1((I)=>{I(V(W,new v("Query not found in registry"),""));return})}function dZ(Z,J,K,X,W,Y,V,G){let I="mutation-"+A1(Z.mutation_counter),z=X$(Z,I,W,Y),N=new y1(z.entities,z.optimistic_entities,z.optimistic_mutations,z.queries,z.pending_fetches,z.get_headers,Z.mutation_counter+1,z.endpoint),F=Q$(N,J,K,X,I,V,G);return[N,I,F]}function V$(Z,J,K,X,W){return I1((Y)=>{let V=Z.get_headers(),G=Lj(Z.endpoint,V),I=J1(G,J,X),z;if(I instanceof E)z=I[0];else throw p8("let_assert",gk,"squall_cache",1073,"create_fetch_effect","Pattern match failed, no pattern matched the value.",{value:I,start:34411,end:34480,pattern_start:34422,pattern_end:34429});let N,F=yj(z);N=GK(F,(B)=>{if(B instanceof E){let T=B[0],P=IK(T);return VK(P,(S)=>{if(S instanceof E){let q=S[0];return Y(W(K,X,new E(q.body))),O8(void 0)}else return Y(W(K,X,new v("Failed to read response"))),O8(void 0)})}else return Y(W(K,X,new v("Failed to fetch"))),O8(void 0)});let D=N;return})}function u0(Z,J,K,X){let W=xy(Z.pending_fetches),Y=S5(W,(I)=>{let z=bk(I);if(z instanceof E){let N=z[0][0],F=z[0][1],D=Ej(J,N);if(D instanceof E){let B=D[0];return new E(V$(Z,B.query,N,F,K))}else return new v(void 0)}else return new v(void 0)}),V=v0(W,Z,(I,z)=>{let N=bk(z);if(N instanceof E){let F=N[0][0],D=N[0][1];return Y$(I,F,D)}else return I});return[new y1(V.entities,V.optimistic_entities,V.optimistic_mutations,V.queries,x5(),V.get_headers,V.mutation_counter,V.endpoint),Y]}function hk(Z,J,K){let X=i8(Z),W=H0(X,(Y)=>{let V,G;return V=Y[0],G=Y[1],[V,hj(G,J,K)]});return b(W)}function hj(Z,J,K){let X=z0(Z,R8(u,f0));if(X instanceof E){let W=X[0],Y=T0(W,"__ref");if(Y instanceof E){let V=Y[0],G=z0(V,u);if(G instanceof E){let I=G[0],z=T0(J,I);if(z instanceof E)return z[0];else{let N=T0(K,I);if(N instanceof E)return N[0];else return b(Q([["__ref",c(I)]]))}}else return hk(W,J,K)}else return hk(W,J,K)}else{let W=z0(Z,U0(f0));if(W instanceof E){let Y=W[0];return j0(Y,(V)=>{return hj(V,J,K)})}else return P4(Z)}}function vk(Z,J,K){let X=l1(Z,f0);if(X instanceof E){let W=X[0],Y=hj(W,J,K);return j8(Y)}else return Z}function a(Z,J,K,X){let W=FK(J,K),Y=T0(Z.queries,W);if(Y instanceof E){let V=Y[0],G=V.status;if(G instanceof NK){let I=vk(V.data,Z.optimistic_entities,Z.entities),z=X(I);if(z instanceof E){let N=z[0];return[Z,new Z8(N)]}else{let N=z[0];return[Z,new L1("Parse error: "+N)]}}else if(G instanceof $k){let I=vk(V.data,Z.optimistic_entities,Z.entities),z=X(I);if(z instanceof E){let N=z[0];return[Z,new Z8(N)]}else{let N=z[0];return[Z,new L1("Parse error: "+N)]}}else return[Z,new j1]}else return[new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,Z.queries,wZ(Z.pending_fetches,W),Z.get_headers,Z.mutation_counter,Z.endpoint),new j1]}function G$(Z,J){let K=v0(Z,[h0(),Q([]),x5()],(Y,V)=>{let G,I,z;G=Y[0],I=Y[1],z=Y[2];let N=z0(V,R8(u,f0));if(N instanceof E){let F=N[0],D=T0(F,"node");if(D instanceof E){let B=D[0],T,P=z0(B,R8(u,f0));if(P instanceof E){let q=P[0],C=T0(q,"id");if(C instanceof E){let U=C[0],k=z0(U,u);if(k instanceof E){let w=k[0],f,$=T0(q,"__typename");if($ instanceof E){let p=$[0],r=z0(p,u);if(r instanceof E)f=r[0];else f="Node"}else f=kj(_0(J,Q(["node"])));T=new L(f+":"+w)}else T=new h}else T=new h}else T=new h;let S=T;if(S instanceof L){let q=S[0];if(W4(z,q))return Y;else{let U=_Z(F,J),k,w;return k=U[0],w=U[1],[m8(G,k),_0(I,Q([w])),wZ(z,q)]}}else{let q=_Z(F,J),C,U;return C=q[0],U=q[1],[m8(G,C),_0(I,Q([U])),z]}}else{let B=_Z(F,J),T,P;return T=B[0],P=B[1],[m8(G,T),_0(I,Q([P])),z]}}else{let F=uZ(V,J),D,B;return D=F[0],B=F[1],[m8(G,D),_0(I,Q([B])),z]}}),X,W;return X=K[0],W=K[1],[X,j0(W,(Y)=>{return Y})]}function uZ(Z,J){let K=z0(Z,R8(u,f0));if(K instanceof E){let X=K[0],W=T0(X,"id");if(W instanceof E){let Y=W[0],V=z0(Y,u);if(V instanceof E){let G=V[0],I,z=T0(X,"__typename");if(z instanceof E){let k=z[0],w=z0(k,u);if(w instanceof E)I=w[0];else I=kj(J)}else I=kj(J);let F=I+":"+G,D,B=i8(X);D=H0(B,(k)=>{let w,f;w=k[0],f=k[1];let $=_0(J,Q([w])),d=uZ(f,$),p,r;return p=d[0],r=d[1],[w,p,r]});let T=D,P=v0(T,h0(),(k,w)=>{let f;return f=w[1],m8(k,f)}),S,q=H0(T,(k)=>{let w,f;return w=k[0],f=k[2],[w,f]});return S=b(q),[i0(P,F,S),b(Q([["__ref",c(F)]]))]}else return _Z(X,J)}else return _Z(X,J)}else{let X=z0(Z,U0(f0));if(X instanceof E){let W=X[0];if(K$(Z))return G$(W,J);else{let V=H0(W,(z)=>{return uZ(z,J)}),G=v0(V,h0(),(z,N)=>{let F;return F=N[0],m8(z,F)}),I=H0(V,(z)=>{let N;return N=z[1],N});return[G,j0(I,(z)=>{return z})]}}else return[h0(),P4(Z)]}}function uk(Z){return uZ(Z,Q([]))}function dk(Z,J,K,X,W){let Y=FK(J,K),V=l1(X,f0);if(V instanceof E){let G=V[0],I=uk(G),z,N;z=I[0],N=I[1];let F=m8(Z.entities,z),D=j8(N),B=new mZ(D,W,new NK),T=i0(Z.queries,Y,B);return new y1(F,Z.optimistic_entities,Z.optimistic_mutations,T,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else{let G=new mZ(X,W,new NK),I=i0(Z.queries,Y,G);return new y1(Z.entities,Z.optimistic_entities,Z.optimistic_mutations,I,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}}function _Z(Z,J){let K,X=i8(Z);K=H0(X,(z)=>{let N,F;N=z[0],F=z[1];let D=_0(J,Q([N])),B=uZ(F,D),T,P;return T=B[0],P=B[1],[N,T,P]});let W=K,Y=v0(W,h0(),(z,N)=>{let F;return F=N[1],m8(z,F)}),V,G=H0(W,(z)=>{let N,F;return N=z[0],F=z[2],[N,F]});return V=b(G),[Y,V]}function vj(Z,J,K){let X=T0(Z.optimistic_mutations,J);if(X instanceof E){let W=X[0],Y=l1(K,f0);if(Y instanceof E){let V=Y[0],G=uk(V),I;I=G[0];let z=m8(Z.entities,I);return new y1(z,N8(Z.optimistic_entities,W),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return new y1(Z.entities,N8(Z.optimistic_entities,W),N8(Z.optimistic_mutations,J),Z.queries,Z.pending_fetches,Z.get_headers,Z.mutation_counter,Z.endpoint)}else return Z}class ck extends O{constructor(Z){super();this.is_backfilling=Z}}function I$(){return g("isBackfilling",V1,(Z)=>{return l(new ck(Z))})}function cZ(Z){return A0(Z,I$())}class HK extends O{}class u8 extends O{}class T8 extends O{}class $5 extends O{}function nk(Z,J,K){let X=b(Q([])),W=m0(Z,"IsBackfilling",X),Y=a(W,"IsBackfilling",X,cZ),V;return V=Y[0],u0(V,J,K,()=>{return 0})}function ik(Z,J){if(J)if(Z instanceof u8)return new T8;else if(Z instanceof T8)return Z;else return Z;else if(Z instanceof u8)return Z;else if(Z instanceof T8)return new $5;else return Z}function _5(Z){if(Z instanceof u8)return!0;else if(Z instanceof T8)return!0;else return!1}function d8(Z,J){return _y(Z,A5(J,(K)=>{return new RZ(!1,!1,K)}),e,wR,wR,0,0)}function z$(Z){if(Z instanceof B1)return new B1(Z.kind,Z.name,Z.handler,Z.include,my,Z.stop_propagation,Z.debounce,Z.throttle);else return Z}function k0(Z){return d8("click",l(Z))}function K1(Z){return d8("input",qZ(Q(["target","value"]),u,(J)=>{return l(Z(J))}))}function lk(Z){return d8("change",qZ(Q(["target","value"]),u,(J)=>{return l(Z(J))}))}function N$(){let J=g(0,u,(X)=>{return g(1,WR(A5(u,(W)=>{return new E(W)}),Q([l(new v(void 0))])),(W)=>{let V=FR(W,(G)=>{return Vk(X,G)});return l(V)})}),K=U0(J);return A5(K,Fy)}function rk(Z){let J=d8("submit",qZ(Q(["detail","formData"]),N$(),(K)=>{let W=Z(K);return l(W)}));return z$(J)}var S4=null;function ak(Z,J,K){if(S4)clearTimeout(S4);if(!Z||Z.trim()===""){K(new E(Q([])));return}S4=setTimeout(async()=>{try{let X=new URL("https://public.api.bsky.app/xrpc/app.bsky.actor.searchActorsTypeahead");X.searchParams.set("q",Z),X.searchParams.set("limit","5");let W=await fetch(X.toString());if(!W.ok){K(new v("Search failed"));return}let V=((await W.json()).actors||[]).map((G)=>new pZ(G.did||"",G.handle||"",G.displayName||"",G.avatar?new L(G.avatar):new h));K(new E(Q(V)))}catch(X){K(new v(X.message||"Search failed"))}},J)}function tk(){if(S4)clearTimeout(S4),S4=null}class pZ extends O{constructor(Z,J,K,X){super();this.did=Z,this.handle=J,this.display_name=K,this.avatar=X}}class P8 extends O{constructor(Z,J,K,X){super();this.query=Z,this.actors=J,this.highlighted_index=K,this.is_open=X}}class DK extends O{constructor(Z){super();this[0]=Z}}class A4 extends O{constructor(Z){super();this[0]=Z}}class nZ extends O{constructor(Z){super();this[0]=Z}}class BK extends O{}class OK extends O{}class iZ extends O{}class gj extends O{}function ok(){return new P8("",Q([]),-1,!1)}function S8(Z,J){if(J instanceof DK){let K=J[0],X=I1((W)=>{return ak(K,300,(Y)=>{return W(new A4(Y))})});return[new P8(K,Z.actors,Z.highlighted_index,K!==""),X]}else if(J instanceof A4){let K=J[0];if(K instanceof E){let X=K[0];return[new P8(Z.query,X,-1,Z.is_open),i()]}else return[new P8(Z.query,Q([]),-1,Z.is_open),i()]}else if(J instanceof nZ){let K=J[0];return[new P8(K.handle,Q([]),-1,!1),i()]}else if(J instanceof BK){let K=l8(Z.actors),X;if(Z.highlighted_index<K-1)X=Z.highlighted_index+1;else X=0;let Y=X;return[new P8(Z.query,Z.actors,Y,Z.is_open),i()]}else if(J instanceof OK){let K=l8(Z.actors),X;if(Z.highlighted_index>0)X=Z.highlighted_index-1;else X=K-1;let Y=X;return[new P8(Z.query,Z.actors,Y,Z.is_open),i()]}else if(J instanceof iZ)return tk(),[new P8(Z.query,Z.actors,-1,!1),i()];else return[new P8(Z.query,Z.actors,Z.highlighted_index,Z.query!==""),i()]}function ek(Z){if(Z.highlighted_index>=0){let K=Z.actors,X=t5(K,Z.highlighted_index),W=vL(X);return _M(W)}else return new h}function F$(Z,J,K){let X;if(J)X="bg-zinc-700";else X="hover:bg-zinc-700";return j(Q([H("flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors "+X),d8("mousedown",l(K(Z.handle)))]),Q([(()=>{let Y=Z.avatar;if(Y instanceof L){let V=Y[0];return Gf(Q([dy(V),H("w-8 h-8 rounded-full flex-shrink-0"),uy("")]))}else return G0()})(),j(Q([H("flex-1 min-w-0")]),Q([(()=>{let Y=Z.display_name;if(Y==="")return G0();else{let V=Y;return j(Q([H("text-sm text-zinc-200 truncate")]),Q([x(V)]))}})(),j(Q([H("text-xs text-zinc-400 truncate")]),Q([x("@"+Z.handle)]))]))]))}function H$(Z,J){return j(Q([H("absolute z-50 w-full mt-1 bg-zinc-800 border border-zinc-700 rounded shadow-lg max-h-60 overflow-y-auto")]),SJ(Z.actors,(K,X)=>{return F$(K,X===Z.highlighted_index,J)}))}function sZ(Z,J,K,X,W,Y,V,G,I,z){return j(Q([H("relative")]),Q([z1(Q([M0("text"),B8(J),py(K),o0(Z.query),q1(X),H(W),e8(!0),R("autocomplete","off"),K1(Y),d8("blur",l(I())),d8("focus",l(z())),d8("keydown",g("key",u,(N)=>{return l(G(N))}))])),(()=>{if(Z.is_open&&!O0(Z.actors,Q([])))return H$(Z,V);else return G0()})()]))}class V8 extends O{}class m1 extends O{}class u1 extends O{}class _j extends O{}function A8(Z,J){let K;if(Z instanceof V8)K=["bg-green-900/30","border-green-800","text-green-300","✓"];else if(Z instanceof m1)K=["bg-red-900/30","border-red-800","text-red-300","✗"];else if(Z instanceof u1)K=["bg-blue-900/30","border-blue-800","text-blue-300","ℹ"];else K=["bg-yellow-900/30","border-yellow-800","text-yellow-300","⚠"];let X=K,W,Y,V,G;return W=X[0],Y=X[1],V=X[2],G=X[3],j(Q([H("mb-6 p-4 rounded border "+W+" "+Y)]),Q([j(Q([H("flex items-center gap-3")]),Q([n(Q([H("text-lg "+V)]),Q([x(G)])),n(Q([H("text-sm "+V)]),Q([x(J)]))]))]))}function mj(Z,J,K,X){let W;if(Z instanceof V8)W=["bg-green-900/30","border-green-800","text-green-300","✓"];else if(Z instanceof m1)W=["bg-red-900/30","border-red-800","text-red-300","✗"];else if(Z instanceof u1)W=["bg-blue-900/30","border-blue-800","text-blue-300","ℹ"];else W=["bg-yellow-900/30","border-yellow-800","text-yellow-300","⚠"];let Y=W,V,G,I,z;return V=Y[0],G=Y[1],I=Y[2],z=Y[3],j(Q([H("mb-6 p-4 rounded border "+V+" "+G)]),Q([j(Q([H("flex items-center gap-3")]),Q([n(Q([H("text-lg "+I)]),Q([x(z)])),n(Q([H("text-sm "+I)]),Q([x(J+" "),_1(Q([h1(X),H("underline hover:no-underline")]),Q([x(K)]))]))]))]))}var u5="http://www.w3.org/2000/svg";function X5(Z){return g1(u5,"ellipse",Z,e)}function lZ(Z){return g1(u5,"rect",Z,e)}function PK(Z,J){return g1(u5,"defs",Z,J)}function d5(Z,J){return g1(u5,"g",Z,J)}function q4(Z,J){return g1(u5,"svg",Z,J)}function E4(Z,J){return g1(u5,"linearGradient",Z,J)}function q8(Z){return g1(u5,"stop",Z,e)}function Zb(Z){return q4(Q([R("viewBox","0 0 128 128"),R("xmlns","http://www.w3.org/2000/svg"),R("overflow","visible"),H(Z)]),Q([PK(Q([]),Q([E4(Q([B8("backfill-board1"),R("x1","0%"),R("y1","0%"),R("x2","100%"),R("y2","100%")]),Q([q8(Q([R("offset","0%"),R("stop-color","#FF6347"),R("stop-opacity","1")])),q8(Q([R("offset","100%"),R("stop-color","#FF4500"),R("stop-opacity","1")]))])),E4(Q([B8("backfill-board2"),R("x1","0%"),R("y1","0%"),R("x2","100%"),R("y2","100%")]),Q([q8(Q([R("offset","0%"),R("stop-color","#00CED1"),R("stop-opacity","1")])),q8(Q([R("offset","100%"),R("stop-color","#4682B4"),R("stop-opacity","1")]))])),R0("style",Q([]),Q([x(` 6 6 .backfill-ellipse1 { animation: backfill-pulse 1.5s ease-in-out infinite; } 7 7 .backfill-ellipse2 { animation: backfill-pulse 1.5s ease-in-out infinite 0.2s; } 8 8 .backfill-ellipse3 { animation: backfill-pulse 1.5s ease-in-out infinite 0.4s; } ··· 142 142 json 143 143 createdAt 144 144 } 145 - }`,"generated/queries/get_lexicons")}class zb extends O{constructor(Z){super();this.backfill_actor=Z}}function w$(){return g("backfillActor",V1,(Z)=>{return l(new zb(Z))})}function Nb(Z){return A0(Z,w$())}class Fb extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class Hb extends O{constructor(Z){super();this.create_o_auth_client=Z}}function M$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new Fb(Z,J,K,X,W,Y,V))})})})})})})})}function R$(){return g("createOAuthClient",M$(),(Z)=>{return l(new Hb(Z))})}function Db(Z){return A0(Z,R$())}class Bb extends O{constructor(Z){super();this.delete_o_auth_client=Z}}function L$(){return g("deleteOAuthClient",V1,(Z)=>{return l(new Bb(Z))})}function Ob(Z){return A0(Z,L$())}class tZ extends O{}class oZ extends O{}class eZ extends O{}class c5 extends O{}class ZJ extends O{}class Tb extends O{constructor(Z,J,K,X,W){super();this.timestamp=Z,this.total=J,this.creates=K,this.updates=X,this.deletes=W}}class Pb extends O{constructor(Z){super();this.activity_buckets=Z}}function F5(Z){if(Z instanceof tZ)return"ONE_HOUR";else if(Z instanceof oZ)return"THREE_HOURS";else if(Z instanceof eZ)return"SIX_HOURS";else if(Z instanceof c5)return"ONE_DAY";else return"SEVEN_DAYS"}function f$(){return g("timestamp",u,(Z)=>{return g("total",p0,(J)=>{return g("creates",p0,(K)=>{return g("updates",p0,(X)=>{return g("deletes",p0,(W)=>{return l(new Tb(Z,J,K,X,W))})})})})})}function k$(){return g("activityBuckets",U0(f$()),(Z)=>{return l(new Pb(Z))})}function p5(Z){return A0(Z,k$())}class Sb extends O{constructor(Z,J,K){super();this.did=Z,this.handle=J,this.is_admin=K}}class Ab extends O{constructor(Z){super();this.current_session=Z}}function b$(){return g("did",u,(Z)=>{return g("handle",u,(J)=>{return g("isAdmin",V1,(K)=>{return l(new Sb(Z,J,K))})})})}function h$(){return g("currentSession",U1(b$()),(Z)=>{return l(new Ab(Z))})}function lj(Z){return A0(Z,h$())}class qb extends O{constructor(Z,J,K){super();this.id=Z,this.json=J,this.created_at=K}}class Eb extends O{constructor(Z){super();this.lexicons=Z}}function g$(){return g("id",u,(Z)=>{return g("json",u,(J)=>{return g("createdAt",u,(K)=>{return l(new qb(Z,J,K))})})})}function $$(){return g("lexicons",U0(g$()),(Z)=>{return l(new Eb(Z))})}function JJ(Z){return A0(Z,$$())}class xb extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class wb extends O{constructor(Z){super();this.oauth_clients=Z}}function _$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new xb(Z,J,K,X,W,Y,V))})})})})})})})}function m$(){return g("oauthClients",U0(_$()),(Z)=>{return l(new wb(Z))})}function c8(Z){return A0(Z,m$())}class Mb extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.id=Z,this.timestamp=J,this.operation=K,this.collection=X,this.did=W,this.status=Y,this.error_message=V,this.event_json=G}}class Rb extends O{constructor(Z){super();this.recent_activity=Z}}function u$(){return g("id",p0,(Z)=>{return g("timestamp",u,(J)=>{return g("operation",u,(K)=>{return g("collection",u,(X)=>{return g("did",u,(W)=>{return g("status",u,(Y)=>{return g("errorMessage",U1(u),(V)=>{return g("eventJson",U1(u),(G)=>{return l(new Mb(Z,J,K,X,W,Y,V,G))})})})})})})})})}function d$(){return g("recentActivity",U0(u$()),(Z)=>{return l(new Rb(Z))})}function BZ(Z){return A0(Z,d$())}class Lb extends O{constructor(Z,J,K,X,W,Y,V){super();this.id=Z,this.domain_authority=J,this.admin_dids=K,this.relay_url=X,this.plc_directory_url=W,this.jetstream_url=Y,this.oauth_supported_scopes=V}}class yb extends O{constructor(Z){super();this.settings=Z}}function c$(){return g("id",u,(Z)=>{return g("domainAuthority",u,(J)=>{return g("adminDids",U0(u),(K)=>{return g("relayUrl",u,(X)=>{return g("plcDirectoryUrl",u,(W)=>{return g("jetstreamUrl",u,(Y)=>{return g("oauthSupportedScopes",u,(V)=>{return l(new Lb(Z,J,K,X,W,Y,V))})})})})})})})}function p$(){return g("settings",c$(),(Z)=>{return l(new yb(Z))})}function O1(Z){return A0(Z,p$())}class fb extends O{constructor(Z,J,K){super();this.record_count=Z,this.actor_count=J,this.lexicon_count=K}}class kb extends O{constructor(Z){super();this.statistics=Z}}function n$(){return g("recordCount",p0,(Z)=>{return g("actorCount",p0,(J)=>{return g("lexiconCount",p0,(K)=>{return l(new fb(Z,J,K))})})})}function i$(){return g("statistics",n$(),(Z)=>{return l(new kb(Z))})}function H5(Z){return A0(Z,i$())}class bb extends O{constructor(Z){super();this.reset_all=Z}}function s$(){return g("resetAll",V1,(Z)=>{return l(new bb(Z))})}function hb(Z){return A0(Z,s$())}class vb extends O{constructor(Z){super();this.trigger_backfill=Z}}function r$(){return g("triggerBackfill",V1,(Z)=>{return l(new vb(Z))})}function gb(Z){return A0(Z,r$())}class $b extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class _b extends O{constructor(Z){super();this.update_o_auth_client=Z}}function t$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new $b(Z,J,K,X,W,Y,V))})})})})})})})}function o$(){return g("updateOAuthClient",t$(),(Z)=>{return l(new _b(Z))})}function mb(Z){return A0(Z,o$())}class ub extends O{constructor(Z,J,K,X,W,Y,V){super();this.id=Z,this.domain_authority=J,this.admin_dids=K,this.relay_url=X,this.plc_directory_url=W,this.jetstream_url=Y,this.oauth_supported_scopes=V}}class db extends O{constructor(Z){super();this.update_settings=Z}}function Z_(){return g("id",u,(Z)=>{return g("domainAuthority",u,(J)=>{return g("adminDids",U0(u),(K)=>{return g("relayUrl",u,(X)=>{return g("plcDirectoryUrl",u,(W)=>{return g("jetstreamUrl",u,(Y)=>{return g("oauthSupportedScopes",u,(V)=>{return l(new ub(Z,J,K,X,W,Y,V))})})})})})})})}function J_(){return g("updateSettings",Z_(),(Z)=>{return l(new db(Z))})}function KJ(Z){return A0(Z,J_())}class cb extends O{constructor(Z){super();this.upload_lexicons=Z}}function Y_(){return g("uploadLexicons",V1,(Z)=>{return l(new cb(Z))})}function pb(Z){return A0(Z,Y_())}function tj(Z){globalThis.location.href=Z}var nb="font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-800 hover:bg-zinc-700 rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-zinc-800";function J8(Z,J,K){return E0(Q([M0("button"),H(nb),jZ(Z),k0(J)]),Q([l0(K)]))}function nU(Z,J){return E0(Q([M0("submit"),H(nb),jZ(Z)]),Q([l0(J)]))}class sU extends O{constructor(Z){super();this[0]=Z}}class ib extends O{}class D5 extends O{constructor(Z,J,K){super();this.did_input=Z,this.is_submitting=J,this.alert=K}}function sb(){return new D5("",!1,new h)}function oj(Z,J,K){return new D5(Z.did_input,Z.is_submitting,new L([J,K]))}function lU(Z){return new D5(Z.did_input,Z.is_submitting,new h)}function rU(Z,J){return new D5(Z.did_input,J,Z.alert)}function lb(Z){let J="font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full",K="block text-sm font-medium text-zinc-400 mb-2";return j(Q([H("space-y-6")]),Q([j(Q([]),Q([$1(Q([H("text-xl font-bold text-zinc-100 mb-2")]),Q([l0("Backfill Actor")])),x0(Q([H("text-zinc-400 text-sm")]),Q([l0("Sync all collections for a specific actor via CAR file repository sync.")]))])),(()=>{let X=Z.alert;if(X instanceof L){let W=X[0][0],Y=X[0][1],V;if(W==="success")V=new V8;else if(W==="error")V=new m1;else V=new u1;return A8(V,Y)}else return G0()})(),j(Q([H("bg-zinc-900/50 border border-zinc-800 rounded-lg p-6 max-w-xl")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H(K)]),Q([l0("Actor DID")])),z1(Q([M0("text"),H(J),q1("did:plc:... or did:web:..."),o0(Z.did_input),K1((X)=>{return new sU(X)})])),x0(Q([H("text-xs text-zinc-500 mt-1")]),Q([l0("Enter the DID of the actor whose records you want to sync.")]))])),j(Q([H("flex items-center gap-4")]),Q([J8(Z.is_submitting||Z.did_input==="",new ib,(()=>{if(Z.is_submitting)return"Syncing...";else return"Sync Actor"})())]))]))]))}function V_(Z,J){let K=(X)=>{let W="px-3 py-1 text-xs rounded transition-colors cursor-pointer";if(O0(X,Z))return W+" bg-zinc-700 text-zinc-100";else return W+" bg-zinc-800/50 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-300"};return j(Q([H("flex gap-2 mb-4")]),Q([E0(Q([H(K(new tZ)),k0(J(new tZ))]),Q([x("1hr")])),E0(Q([H(K(new oZ)),k0(J(new oZ))]),Q([x("3hr")])),E0(Q([H(K(new eZ)),k0(J(new eZ))]),Q([x("6hr")])),E0(Q([H(K(new c5)),k0(J(new c5))]),Q([x("1 day")])),E0(Q([H(K(new ZJ)),k0(J(new ZJ))]),Q([x("7 day")]))]))}function G_(Z){let K=H0(Z,(W)=>{return W.creates+W.updates+W.deletes}),X=mL(K,MJ);return F8(X,1)}function I_(Z,J,K,X,W,Y){let V=N0(J)*(K+X);if(Z.creates+Z.updates+Z.deletes===0){let I=4,z=W-I;return d5(Q([]),Q([lZ(Q([R("x",c0(V)),R("y",c0(z)),R("width",c0(K)),R("height",c0(I)),R("style","fill: #3f3f46 !important; stroke: none; display: inline")]))]))}else{let I=DJ(W,N0(Y)),z=N0(Z.deletes)*I,N=N0(Z.updates)*I,F=N0(Z.creates)*I,D=W-z,B=D-N,T=B-F;return d5(Q([H("group")]),Q([(()=>{if(Z.deletes>0)return lZ(Q([R("x",c0(V)),R("y",c0(D)),R("width",c0(K)),R("height",c0(z)),R("style","fill: #ef4444 !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})(),(()=>{if(Z.updates>0)return lZ(Q([R("x",c0(V)),R("y",c0(B)),R("width",c0(K)),R("height",c0(N)),R("style","fill: #60a5fa !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})(),(()=>{if(Z.creates>0)return lZ(Q([R("x",c0(V)),R("y",c0(T)),R("width",c0(K)),R("height",c0(F)),R("style","fill: #22c55e !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})()]))}}function z_(Z,J){let K=G_(Z),X;if(J instanceof ZJ)X=[160,12];else X=[30,4];let W=X,Y,V;Y=W[0],V=W[1];let G=l8(Z),I=N0(G)*Y+N0(G-1)*V,z=120;return j(Q([H("w-full")]),Q([q4(Q([R("viewBox","0 0 "+c0(I)+" "+c0(z)),R("width","100%"),R("height",c0(z)),R("style","min-height: 120px"),R("preserveAspectRatio","none")]),SJ(Z,(N,F)=>{return I_(N,F,Y,V,z,K)}))]))}function N_(Z,J){let K=b(Q([["range",c(F5(J))]])),X=a(Z,"GetActivityBuckets",K,p5),W;if(W=X[1],W instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("Loading activity data...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-8 text-center text-red-400 text-xs")]),Q([x("Error: "+Y)]))}else{let V=W[0].activity_buckets;if(V instanceof M)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("No activity data available")]));else return z_(V,J)}}function rb(Z,J,K){return j(Q([H("bg-zinc-800/50 rounded p-4 font-mono mb-8")]),Q([V_(J,K),N_(Z,J)]))}function ej(Z){try{return new Date(Z).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch(J){return Z}}function ZL(Z){try{return new Date(Z).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch(J){return Z}}function aU(Z){if(typeof Z==="string")try{let J=JSON.parse(Z);return aU(J)}catch(J){return Z}else if(Array.isArray(Z))return Z.map(aU);else if(Z!==null&&typeof Z==="object"){let J={};for(let[K,X]of Object.entries(Z))J[K]=aU(X);return J}return Z}function JL(Z){try{let J=JSON.parse(Z),K=aU(J);return JSON.stringify(K,null,2)}catch(J){return Z}}function B_(Z){return j(Q([]),H0(Z,(J)=>{let K,X=J.status;if(X==="success")K="text-green-500";else if(X==="validation_error")K="text-yellow-500";else if(X==="error")K="text-red-500";else if(X==="processing")K="text-blue-500";else K="text-zinc-500";let W=K,Y,V=J.status;if(V==="success")Y="✓";else if(V==="validation_error")Y="⚠";else if(V==="error")Y="✗";else if(V==="processing")Y="⋯";else Y="•";let G=Y,I,z=J.operation;if(z==="create")I="text-green-400";else if(z==="update")I="text-blue-400";else if(z==="delete")I="text-red-400";else I="text-zinc-400";let N=I,F="activity-"+A1(J.id);return j(Q([H("border-l-2 border-zinc-700/50 hover:border-zinc-600 transition-colors"),R("data-entry-id",F)]),Q([j(Q([H("flex items-start gap-2 py-1 text-xs font-mono hover:bg-zinc-900/30 cursor-pointer group"),R("onclick","this.parentElement.classList.toggle('expanded')")]),Q([n(Q([H("text-zinc-600 group-hover:text-zinc-400 shrink-0 select-none transition-transform caret"),R("data-caret","")]),Q([x("›")])),n(Q([H("text-zinc-600 shrink-0 w-16"),R("data-timestamp",J.timestamp)]),Q([x(ej(J.timestamp))])),n(Q([H(W+" shrink-0 w-4")]),Q([x(G)])),n(Q([H(N+" shrink-0 w-12")]),Q([x(J.operation)])),n(Q([H("text-purple-400 shrink-0")]),Q([x(J.collection)])),n(Q([H("text-zinc-500 truncate")]),Q([x(J.did)]))])),j(Q([H("px-6 py-2 text-xs bg-zinc-900/50 border-t border-zinc-800 hidden space-y-1"),R("data-details","")]),Q([j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Timestamp:")])),n(Q([H("text-zinc-400")]),Q([x(ZL(J.timestamp))]))])),j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("DID:")])),n(Q([H("text-zinc-400 font-mono break-all")]),Q([x(J.did)]))])),j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Status:")])),n(Q([H((()=>{let D=J.status;if(D==="success")return"text-green-400";else if(D==="validation_error")return"text-yellow-400";else if(D==="error")return"text-red-400";else return"text-zinc-400"})())]),Q([x(J.status)]))])),(()=>{let D=J.error_message;if(D instanceof L){let B=D[0];return j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Error:")])),n(Q([H("text-red-400")]),Q([x(B)]))]))}else return G0()})(),(()=>{let D=J.event_json;if(D instanceof L){let B=D[0],T=JL(B);return j(Q([H("mt-2")]),Q([j(Q([H("text-zinc-600 mb-1")]),Q([x("Event JSON:")])),iJ(Q([H("text-zinc-400 bg-black/40 p-2 rounded text-[10px] whitespace-pre-wrap block"),R("data-json",B)]),Q([x(T)]))]))}else return G0()})()]))]))}))}function ab(Z,J){let K=b(Q([["hours",X1(J)]])),X=a(Z,"GetRecentActivity",K,BZ),W;return W=X[1],j(Q([H("font-mono mb-8")]),Q([R0("style",Q([]),Q([x(`[data-entry-id].expanded [data-caret] { transform: rotate(90deg); } 146 - [data-entry-id].expanded [data-details] { display: block !important; }`)])),j(Q([H("bg-zinc-800/50 rounded p-4")]),Q([j(Q([H("mb-3")]),Q([j(Q([H("text-sm text-zinc-500")]),Q([x("Jetstream Activity")]))])),j(Q([H("max-h-80 overflow-y-auto")]),Q([(()=>{if(W instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("Loading activity...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-8 text-center text-red-400 text-xs")]),Q([x("Error: "+Y)]))}else{let V=W[0].recent_activity;if(V instanceof M)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("No activity in the last "+A1(J)+" hours")]));else return B_(V)}})()]))]))]))}function YJ(Z){return new Intl.NumberFormat("en-US").format(Z)}function KL(Z,J,K,X){if(K)return _1(Q([h1(X),H("bg-zinc-800/50 rounded p-4 block hover:bg-zinc-800 transition-colors cursor-pointer")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("text-2xl font-semibold text-zinc-200")]),Q([l0(J)]))]));else return j(Q([H("bg-zinc-800/50 rounded p-4")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("text-2xl font-semibold text-zinc-200")]),Q([l0(J)]))]))}function YL(Z){return j(Q([H("bg-zinc-800/50 rounded p-4 animate-pulse")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("h-8 bg-zinc-700 rounded w-24")]),Q([]))]))}function tb(Z){let J=a(Z,"GetStatistics",b(Q([])),H5),K;if(K=J[1],K instanceof j1)return j(Q([H("mb-8 grid grid-cols-1 sm:grid-cols-3 gap-4")]),Q([YL("Total Records"),YL("Total Actors"),YL("Total Lexicons")]));else if(K instanceof L1){let X=K[0];return j(Q([H("mb-8")]),Q([j(Q([H("bg-red-800/50 rounded p-4 text-red-200")]),Q([l0("Error loading statistics: "+X)]))]))}else{let W=K[0].statistics;return j(Q([H("mb-8 grid grid-cols-1 sm:grid-cols-3 gap-4")]),Q([KL("Total Records",YJ(W.record_count),!1,""),KL("Total Actors",YJ(W.actor_count),!1,""),KL("Total Lexicons",YJ(W.lexicon_count),!0,"/lexicons")]))}}class tU extends O{constructor(Z){super();this[0]=Z}}class oU extends O{}class XL extends O{}function S_(Z,J){let K;if(Z==="")K=mj(new _j,"No domain authority configured.","Settings","/settings");else K=G0();let X=K,W;if(J===0)W=mj(new u1,"No lexicons loaded.","Settings","/settings");else W=G0();let Y=W;return j(Q([]),Q([X,Y]))}function ob(Z,J,K,X,W){let Y=a(Z,"GetStatistics",b(Q([])),H5),V;V=Y[1];let G=a(Z,"GetSettings",b(Q([])),O1),I;I=G[1];let z;if(V instanceof Z8&&I instanceof Z8){let F=V[0],D=I[0];z=S_(D.settings.domain_authority,F.statistics.lexicon_count)}else z=G0();let N=z;return j(Q([]),Q([N,(()=>{if(W)return j(Q([H("mb-8 flex gap-3 flex-wrap items-start")]),(()=>{if(X)return Q([J8(!1,new XL,"Open GraphiQL"),j(Q([H("flex items-center gap-3")]),Q([J8(_5(K),new oU,(()=>{if(K instanceof u8)return"Backfilling...";else if(K instanceof T8)return"Backfilling...";else return"Trigger Backfill"})()),(()=>{if(K instanceof $5)return x0(Q([H("text-sm text-green-600")]),Q([l0("Backfill complete!")]));else return G0()})()]))]);else return Q([J8(!1,new XL,"Open GraphiQL")])})());else return G0()})(),tb(Z),rb(Z,J,(F)=>{return new tU(F)}),ab(Z,24)]))}function eb(Z){if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(Z).catch((J)=>{console.error("Failed to copy to clipboard:",J)})}function WL(Z){try{let J=JSON.parse(Z);return JSON.stringify(J,null,2)}catch(J){return Z}}function q_(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(W instanceof M)return G;else{let I=W.head;if(I==='"'){let z=W.tail,N;if(Y)if(V)N=["text-green-400",!0];else N=["text-sky-400",!1];else if(V)N=["text-green-400",!0];else N=["text-sky-400",!1];let F=N,D,B;D=F[0],B=F[1];let T=n(Q([H(D)]),Q([x('"')])),P;if(Y)P=!1;else P=B;let S=P;Z=z,J=!Y,K=S,X=A(T,G)}else if(I==="{"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="}"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="["&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="]"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I===":"&&!Y){let z=W.tail,N=n(Q([H("text-zinc-400")]),Q([x(":")]));Z=z,J=Y,K=!0,X=A(N,G)}else if(I===","&&!Y){let z=W.tail,N=n(Q([H("text-zinc-400")]),Q([x(",")]));Z=z,J=Y,K=!1,X=A(N,G)}else if(I===" "&&!Y){let z=W.tail,N=x((()=>{if(W instanceof M)return"";else{let F=W.head;if(F===" ")return" ";else if(F===` 145 + }`,"generated/queries/get_lexicons")}class zb extends O{constructor(Z){super();this.backfill_actor=Z}}function w$(){return g("backfillActor",V1,(Z)=>{return l(new zb(Z))})}function Nb(Z){return A0(Z,w$())}class Fb extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class Hb extends O{constructor(Z){super();this.create_o_auth_client=Z}}function M$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new Fb(Z,J,K,X,W,Y,V))})})})})})})})}function R$(){return g("createOAuthClient",M$(),(Z)=>{return l(new Hb(Z))})}function Db(Z){return A0(Z,R$())}class Bb extends O{constructor(Z){super();this.delete_o_auth_client=Z}}function L$(){return g("deleteOAuthClient",V1,(Z)=>{return l(new Bb(Z))})}function Ob(Z){return A0(Z,L$())}class tZ extends O{}class oZ extends O{}class eZ extends O{}class c5 extends O{}class ZJ extends O{}class Tb extends O{constructor(Z,J,K,X,W){super();this.timestamp=Z,this.total=J,this.creates=K,this.updates=X,this.deletes=W}}class Pb extends O{constructor(Z){super();this.activity_buckets=Z}}function F5(Z){if(Z instanceof tZ)return"ONE_HOUR";else if(Z instanceof oZ)return"THREE_HOURS";else if(Z instanceof eZ)return"SIX_HOURS";else if(Z instanceof c5)return"ONE_DAY";else return"SEVEN_DAYS"}function f$(){return g("timestamp",u,(Z)=>{return g("total",p0,(J)=>{return g("creates",p0,(K)=>{return g("updates",p0,(X)=>{return g("deletes",p0,(W)=>{return l(new Tb(Z,J,K,X,W))})})})})})}function k$(){return g("activityBuckets",U0(f$()),(Z)=>{return l(new Pb(Z))})}function p5(Z){return A0(Z,k$())}class Sb extends O{constructor(Z,J,K){super();this.did=Z,this.handle=J,this.is_admin=K}}class Ab extends O{constructor(Z){super();this.current_session=Z}}function b$(){return g("did",u,(Z)=>{return g("handle",u,(J)=>{return g("isAdmin",V1,(K)=>{return l(new Sb(Z,J,K))})})})}function h$(){return g("currentSession",U1(b$()),(Z)=>{return l(new Ab(Z))})}function lj(Z){return A0(Z,h$())}class qb extends O{constructor(Z,J,K){super();this.id=Z,this.json=J,this.created_at=K}}class Eb extends O{constructor(Z){super();this.lexicons=Z}}function g$(){return g("id",u,(Z)=>{return g("json",u,(J)=>{return g("createdAt",u,(K)=>{return l(new qb(Z,J,K))})})})}function $$(){return g("lexicons",U0(g$()),(Z)=>{return l(new Eb(Z))})}function JJ(Z){return A0(Z,$$())}class xb extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class wb extends O{constructor(Z){super();this.oauth_clients=Z}}function _$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new xb(Z,J,K,X,W,Y,V))})})})})})})})}function m$(){return g("oauthClients",U0(_$()),(Z)=>{return l(new wb(Z))})}function c8(Z){return A0(Z,m$())}class Mb extends O{constructor(Z,J,K,X,W,Y,V,G){super();this.id=Z,this.timestamp=J,this.operation=K,this.collection=X,this.did=W,this.status=Y,this.error_message=V,this.event_json=G}}class Rb extends O{constructor(Z){super();this.recent_activity=Z}}function u$(){return g("id",p0,(Z)=>{return g("timestamp",u,(J)=>{return g("operation",u,(K)=>{return g("collection",u,(X)=>{return g("did",u,(W)=>{return g("status",u,(Y)=>{return g("errorMessage",U1(u),(V)=>{return g("eventJson",U1(u),(G)=>{return l(new Mb(Z,J,K,X,W,Y,V,G))})})})})})})})})}function d$(){return g("recentActivity",U0(u$()),(Z)=>{return l(new Rb(Z))})}function BZ(Z){return A0(Z,d$())}class Lb extends O{constructor(Z,J,K,X,W,Y,V){super();this.id=Z,this.domain_authority=J,this.admin_dids=K,this.relay_url=X,this.plc_directory_url=W,this.jetstream_url=Y,this.oauth_supported_scopes=V}}class yb extends O{constructor(Z){super();this.settings=Z}}function c$(){return g("id",u,(Z)=>{return g("domainAuthority",u,(J)=>{return g("adminDids",U0(u),(K)=>{return g("relayUrl",u,(X)=>{return g("plcDirectoryUrl",u,(W)=>{return g("jetstreamUrl",u,(Y)=>{return g("oauthSupportedScopes",u,(V)=>{return l(new Lb(Z,J,K,X,W,Y,V))})})})})})})})}function p$(){return g("settings",c$(),(Z)=>{return l(new yb(Z))})}function O1(Z){return A0(Z,p$())}class fb extends O{constructor(Z,J,K){super();this.record_count=Z,this.actor_count=J,this.lexicon_count=K}}class kb extends O{constructor(Z){super();this.statistics=Z}}function n$(){return g("recordCount",p0,(Z)=>{return g("actorCount",p0,(J)=>{return g("lexiconCount",p0,(K)=>{return l(new fb(Z,J,K))})})})}function i$(){return g("statistics",n$(),(Z)=>{return l(new kb(Z))})}function H5(Z){return A0(Z,i$())}class bb extends O{constructor(Z){super();this.reset_all=Z}}function s$(){return g("resetAll",V1,(Z)=>{return l(new bb(Z))})}function hb(Z){return A0(Z,s$())}class vb extends O{constructor(Z){super();this.trigger_backfill=Z}}function r$(){return g("triggerBackfill",V1,(Z)=>{return l(new vb(Z))})}function gb(Z){return A0(Z,r$())}class $b extends O{constructor(Z,J,K,X,W,Y,V){super();this.client_id=Z,this.client_secret=J,this.client_name=K,this.client_type=X,this.redirect_uris=W,this.scope=Y,this.created_at=V}}class _b extends O{constructor(Z){super();this.update_o_auth_client=Z}}function t$(){return g("clientId",u,(Z)=>{return g("clientSecret",U1(u),(J)=>{return g("clientName",u,(K)=>{return g("clientType",u,(X)=>{return g("redirectUris",U0(u),(W)=>{return g("scope",U1(u),(Y)=>{return g("createdAt",p0,(V)=>{return l(new $b(Z,J,K,X,W,Y,V))})})})})})})})}function o$(){return g("updateOAuthClient",t$(),(Z)=>{return l(new _b(Z))})}function mb(Z){return A0(Z,o$())}class ub extends O{constructor(Z,J,K,X,W,Y,V){super();this.id=Z,this.domain_authority=J,this.admin_dids=K,this.relay_url=X,this.plc_directory_url=W,this.jetstream_url=Y,this.oauth_supported_scopes=V}}class db extends O{constructor(Z){super();this.update_settings=Z}}function Z_(){return g("id",u,(Z)=>{return g("domainAuthority",u,(J)=>{return g("adminDids",U0(u),(K)=>{return g("relayUrl",u,(X)=>{return g("plcDirectoryUrl",u,(W)=>{return g("jetstreamUrl",u,(Y)=>{return g("oauthSupportedScopes",u,(V)=>{return l(new ub(Z,J,K,X,W,Y,V))})})})})})})})}function J_(){return g("updateSettings",Z_(),(Z)=>{return l(new db(Z))})}function KJ(Z){return A0(Z,J_())}class cb extends O{constructor(Z){super();this.upload_lexicons=Z}}function Y_(){return g("uploadLexicons",V1,(Z)=>{return l(new cb(Z))})}function pb(Z){return A0(Z,Y_())}function tj(Z){globalThis.location.href=Z}var nb="font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-800 hover:bg-zinc-700 rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-zinc-800";function J8(Z,J,K){return E0(Q([M0("button"),H(nb),jZ(Z),k0(J)]),Q([l0(K)]))}function nU(Z,J){return E0(Q([M0("submit"),H(nb),jZ(Z)]),Q([l0(J)]))}class sU extends O{constructor(Z){super();this[0]=Z}}class ib extends O{}class D5 extends O{constructor(Z,J,K){super();this.did_input=Z,this.is_submitting=J,this.alert=K}}function sb(){return new D5("",!1,new h)}function oj(Z,J,K){return new D5(Z.did_input,Z.is_submitting,new L([J,K]))}function lU(Z){return new D5(Z.did_input,Z.is_submitting,new h)}function rU(Z,J){return new D5(Z.did_input,J,Z.alert)}function lb(Z){let J="font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full",K="block text-sm font-medium text-zinc-400 mb-2";return j(Q([H("space-y-6")]),Q([j(Q([]),Q([$1(Q([H("text-xl font-bold text-zinc-100 mb-2")]),Q([l0("Backfill Actor")])),C0(Q([H("text-zinc-400 text-sm")]),Q([l0("Sync all collections for a specific actor via CAR file repository sync.")]))])),(()=>{let X=Z.alert;if(X instanceof L){let W=X[0][0],Y=X[0][1],V;if(W==="success")V=new V8;else if(W==="error")V=new m1;else V=new u1;return A8(V,Y)}else return G0()})(),j(Q([H("bg-zinc-900/50 border border-zinc-800 rounded-lg p-6 max-w-xl")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H(K)]),Q([l0("Actor DID")])),z1(Q([M0("text"),H(J),q1("did:plc:... or did:web:..."),o0(Z.did_input),K1((X)=>{return new sU(X)})])),C0(Q([H("text-xs text-zinc-500 mt-1")]),Q([l0("Enter the DID of the actor whose records you want to sync.")]))])),j(Q([H("flex items-center gap-4")]),Q([J8(Z.is_submitting||Z.did_input==="",new ib,(()=>{if(Z.is_submitting)return"Syncing...";else return"Sync Actor"})())]))]))]))}function V_(Z,J){let K=(X)=>{let W="px-3 py-1 text-xs rounded transition-colors cursor-pointer";if(O0(X,Z))return W+" bg-zinc-700 text-zinc-100";else return W+" bg-zinc-800/50 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-300"};return j(Q([H("flex gap-2 mb-4")]),Q([E0(Q([H(K(new tZ)),k0(J(new tZ))]),Q([x("1hr")])),E0(Q([H(K(new oZ)),k0(J(new oZ))]),Q([x("3hr")])),E0(Q([H(K(new eZ)),k0(J(new eZ))]),Q([x("6hr")])),E0(Q([H(K(new c5)),k0(J(new c5))]),Q([x("1 day")])),E0(Q([H(K(new ZJ)),k0(J(new ZJ))]),Q([x("7 day")]))]))}function G_(Z){let K=H0(Z,(W)=>{return W.creates+W.updates+W.deletes}),X=mL(K,MJ);return F8(X,1)}function I_(Z,J,K,X,W,Y){let V=N0(J)*(K+X);if(Z.creates+Z.updates+Z.deletes===0){let I=4,z=W-I;return d5(Q([]),Q([lZ(Q([R("x",c0(V)),R("y",c0(z)),R("width",c0(K)),R("height",c0(I)),R("style","fill: #3f3f46 !important; stroke: none; display: inline")]))]))}else{let I=DJ(W,N0(Y)),z=N0(Z.deletes)*I,N=N0(Z.updates)*I,F=N0(Z.creates)*I,D=W-z,B=D-N,T=B-F;return d5(Q([H("group")]),Q([(()=>{if(Z.deletes>0)return lZ(Q([R("x",c0(V)),R("y",c0(D)),R("width",c0(K)),R("height",c0(z)),R("style","fill: #ef4444 !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})(),(()=>{if(Z.updates>0)return lZ(Q([R("x",c0(V)),R("y",c0(B)),R("width",c0(K)),R("height",c0(N)),R("style","fill: #60a5fa !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})(),(()=>{if(Z.creates>0)return lZ(Q([R("x",c0(V)),R("y",c0(T)),R("width",c0(K)),R("height",c0(F)),R("style","fill: #22c55e !important; stroke: none; display: inline; cursor: pointer; transition: opacity 0.2s"),H("group-hover:opacity-80")]));else return G0()})()]))}}function z_(Z,J){let K=G_(Z),X;if(J instanceof ZJ)X=[160,12];else X=[30,4];let W=X,Y,V;Y=W[0],V=W[1];let G=l8(Z),I=N0(G)*Y+N0(G-1)*V,z=120;return j(Q([H("w-full")]),Q([q4(Q([R("viewBox","0 0 "+c0(I)+" "+c0(z)),R("width","100%"),R("height",c0(z)),R("style","min-height: 120px"),R("preserveAspectRatio","none")]),SJ(Z,(N,F)=>{return I_(N,F,Y,V,z,K)}))]))}function N_(Z,J){let K=b(Q([["range",c(F5(J))]])),X=a(Z,"GetActivityBuckets",K,p5),W;if(W=X[1],W instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("Loading activity data...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-8 text-center text-red-400 text-xs")]),Q([x("Error: "+Y)]))}else{let V=W[0].activity_buckets;if(V instanceof M)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("No activity data available")]));else return z_(V,J)}}function rb(Z,J,K){return j(Q([H("bg-zinc-800/50 rounded p-4 font-mono mb-8")]),Q([V_(J,K),N_(Z,J)]))}function ej(Z){try{return new Date(Z).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch(J){return Z}}function ZL(Z){try{return new Date(Z).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch(J){return Z}}function aU(Z){if(typeof Z==="string")try{let J=JSON.parse(Z);return aU(J)}catch(J){return Z}else if(Array.isArray(Z))return Z.map(aU);else if(Z!==null&&typeof Z==="object"){let J={};for(let[K,X]of Object.entries(Z))J[K]=aU(X);return J}return Z}function JL(Z){try{let J=JSON.parse(Z),K=aU(J);return JSON.stringify(K,null,2)}catch(J){return Z}}function B_(Z){return j(Q([]),H0(Z,(J)=>{let K,X=J.status;if(X==="success")K="text-green-500";else if(X==="validation_error")K="text-yellow-500";else if(X==="error")K="text-red-500";else if(X==="processing")K="text-blue-500";else K="text-zinc-500";let W=K,Y,V=J.status;if(V==="success")Y="✓";else if(V==="validation_error")Y="⚠";else if(V==="error")Y="✗";else if(V==="processing")Y="⋯";else Y="•";let G=Y,I,z=J.operation;if(z==="create")I="text-green-400";else if(z==="update")I="text-blue-400";else if(z==="delete")I="text-red-400";else I="text-zinc-400";let N=I,F="activity-"+A1(J.id);return j(Q([H("border-l-2 border-zinc-700/50 hover:border-zinc-600 transition-colors"),R("data-entry-id",F)]),Q([j(Q([H("flex items-start gap-2 py-1 text-xs font-mono hover:bg-zinc-900/30 cursor-pointer group"),R("onclick","this.parentElement.classList.toggle('expanded')")]),Q([n(Q([H("text-zinc-600 group-hover:text-zinc-400 shrink-0 select-none transition-transform caret"),R("data-caret","")]),Q([x("›")])),n(Q([H("text-zinc-600 shrink-0 w-16"),R("data-timestamp",J.timestamp)]),Q([x(ej(J.timestamp))])),n(Q([H(W+" shrink-0 w-4")]),Q([x(G)])),n(Q([H(N+" shrink-0 w-12")]),Q([x(J.operation)])),n(Q([H("text-purple-400 shrink-0")]),Q([x(J.collection)])),n(Q([H("text-zinc-500 truncate")]),Q([x(J.did)]))])),j(Q([H("px-6 py-2 text-xs bg-zinc-900/50 border-t border-zinc-800 hidden space-y-1"),R("data-details","")]),Q([j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Timestamp:")])),n(Q([H("text-zinc-400")]),Q([x(ZL(J.timestamp))]))])),j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("DID:")])),n(Q([H("text-zinc-400 font-mono break-all")]),Q([x(J.did)]))])),j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Status:")])),n(Q([H((()=>{let D=J.status;if(D==="success")return"text-green-400";else if(D==="validation_error")return"text-yellow-400";else if(D==="error")return"text-red-400";else return"text-zinc-400"})())]),Q([x(J.status)]))])),(()=>{let D=J.error_message;if(D instanceof L){let B=D[0];return j(Q([H("flex gap-2")]),Q([n(Q([H("text-zinc-600 w-20")]),Q([x("Error:")])),n(Q([H("text-red-400")]),Q([x(B)]))]))}else return G0()})(),(()=>{let D=J.event_json;if(D instanceof L){let B=D[0],T=JL(B);return j(Q([H("mt-2")]),Q([j(Q([H("text-zinc-600 mb-1")]),Q([x("Event JSON:")])),iJ(Q([H("text-zinc-400 bg-black/40 p-2 rounded text-[10px] whitespace-pre-wrap block"),R("data-json",B)]),Q([x(T)]))]))}else return G0()})()]))]))}))}function ab(Z,J){let K=b(Q([["hours",X1(J)]])),X=a(Z,"GetRecentActivity",K,BZ),W;return W=X[1],j(Q([H("font-mono mb-8")]),Q([R0("style",Q([]),Q([x(`[data-entry-id].expanded [data-caret] { transform: rotate(90deg); } 146 + [data-entry-id].expanded [data-details] { display: block !important; }`)])),j(Q([H("bg-zinc-800/50 rounded p-4")]),Q([j(Q([H("mb-3")]),Q([j(Q([H("text-sm text-zinc-500")]),Q([x("Recent Jetstream Activity")]))])),j(Q([H("max-h-80 overflow-y-auto")]),Q([(()=>{if(W instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("Loading activity...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-8 text-center text-red-400 text-xs")]),Q([x("Error: "+Y)]))}else{let V=W[0].recent_activity;if(V instanceof M)return j(Q([H("py-8 text-center text-zinc-600 text-xs")]),Q([x("No activity in the last "+A1(J)+" hours")]));else return B_(V)}})()]))]))]))}function YJ(Z){return new Intl.NumberFormat("en-US").format(Z)}function KL(Z,J,K,X){if(K)return _1(Q([h1(X),H("bg-zinc-800/50 rounded p-4 block hover:bg-zinc-800 transition-colors cursor-pointer")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("text-2xl font-semibold text-zinc-200")]),Q([l0(J)]))]));else return j(Q([H("bg-zinc-800/50 rounded p-4")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("text-2xl font-semibold text-zinc-200")]),Q([l0(J)]))]))}function YL(Z){return j(Q([H("bg-zinc-800/50 rounded p-4 animate-pulse")]),Q([j(Q([H("text-sm text-zinc-500 mb-1")]),Q([l0(Z)])),j(Q([H("h-8 bg-zinc-700 rounded w-24")]),Q([]))]))}function tb(Z){let J=a(Z,"GetStatistics",b(Q([])),H5),K;if(K=J[1],K instanceof j1)return j(Q([H("mb-8 grid grid-cols-1 sm:grid-cols-3 gap-4")]),Q([YL("Total Records"),YL("Total Actors"),YL("Total Lexicons")]));else if(K instanceof L1){let X=K[0];return j(Q([H("mb-8")]),Q([j(Q([H("bg-red-800/50 rounded p-4 text-red-200")]),Q([l0("Error loading statistics: "+X)]))]))}else{let W=K[0].statistics;return j(Q([H("mb-8 grid grid-cols-1 sm:grid-cols-3 gap-4")]),Q([KL("Total Records",YJ(W.record_count),!1,""),KL("Total Actors",YJ(W.actor_count),!1,""),KL("Total Lexicons",YJ(W.lexicon_count),!0,"/lexicons")]))}}class tU extends O{constructor(Z){super();this[0]=Z}}class oU extends O{}class XL extends O{}function S_(Z,J){let K;if(Z==="")K=mj(new _j,"No domain authority configured.","Settings","/settings");else K=G0();let X=K,W;if(J===0)W=mj(new u1,"No lexicons loaded.","Settings","/settings");else W=G0();let Y=W;return j(Q([]),Q([X,Y]))}function ob(Z,J,K,X,W){let Y=a(Z,"GetStatistics",b(Q([])),H5),V;V=Y[1];let G=a(Z,"GetSettings",b(Q([])),O1),I;I=G[1];let z;if(V instanceof Z8&&I instanceof Z8){let F=V[0],D=I[0];z=S_(D.settings.domain_authority,F.statistics.lexicon_count)}else z=G0();let N=z;return j(Q([]),Q([N,(()=>{if(W)return j(Q([H("mb-8 flex gap-3 flex-wrap items-start")]),(()=>{if(X)return Q([J8(!1,new XL,"Open GraphiQL"),j(Q([H("flex items-center gap-3")]),Q([J8(_5(K),new oU,(()=>{if(K instanceof u8)return"Backfilling...";else if(K instanceof T8)return"Backfilling...";else return"Trigger Backfill"})()),(()=>{if(K instanceof $5)return C0(Q([H("text-sm text-green-600")]),Q([l0("Backfill complete!")]));else return G0()})()]))]);else return Q([J8(!1,new XL,"Open GraphiQL")])})());else return G0()})(),tb(Z),rb(Z,J,(F)=>{return new tU(F)}),ab(Z,24)]))}function eb(Z){if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(Z).catch((J)=>{console.error("Failed to copy to clipboard:",J)})}function WL(Z){try{let J=JSON.parse(Z);return JSON.stringify(J,null,2)}catch(J){return Z}}function q_(Z,J,K,X){while(!0){let W=Z,Y=J,V=K,G=X;if(W instanceof M)return G;else{let I=W.head;if(I==='"'){let z=W.tail,N;if(Y)if(V)N=["text-green-400",!0];else N=["text-sky-400",!1];else if(V)N=["text-green-400",!0];else N=["text-sky-400",!1];let F=N,D,B;D=F[0],B=F[1];let T=n(Q([H(D)]),Q([x('"')])),P;if(Y)P=!1;else P=B;let S=P;Z=z,J=!Y,K=S,X=A(T,G)}else if(I==="{"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="}"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="["&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I==="]"&&!Y){let z=W.tail,N;if(W instanceof M)N="";else N=W.head;let F=N,D=n(Q([H("text-zinc-400")]),Q([x(F)]));Z=z,J=Y,K=!1,X=A(D,G)}else if(I===":"&&!Y){let z=W.tail,N=n(Q([H("text-zinc-400")]),Q([x(":")]));Z=z,J=Y,K=!0,X=A(N,G)}else if(I===","&&!Y){let z=W.tail,N=n(Q([H("text-zinc-400")]),Q([x(",")]));Z=z,J=Y,K=!1,X=A(N,G)}else if(I===" "&&!Y){let z=W.tail,N=x((()=>{if(W instanceof M)return"";else{let F=W.head;if(F===" ")return" ";else if(F===` 147 147 `)return` 148 148 `;else return""}})());Z=z,J=Y,K=V,X=A(N,G)}else if(I===` 149 149 `&&!Y){let z=W.tail,N=x((()=>{if(W instanceof M)return"";else{let F=W.head;if(F===" ")return" ";else if(F===` 150 150 `)return` 151 - `;else return""}})());Z=z,J=Y,K=V,X=A(N,G)}else if(I==="t")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else if(z.head==="r")if(N.head==="u")if(F.head==="e"&&!Y){let P;if(W instanceof M)P="";else{let k=W.tail;if(k instanceof M)P="";else{let w=k.tail;if(w instanceof M)P="";else{let f=w.tail;if(f instanceof M)P="";else{let $=W.head;if($==="t")if(k.head==="r")if(w.head==="u")if(f.head==="e")P="true";else P="";else P="";else P="";else if($==="f"){let d=f.tail;if(d instanceof M)P="";else if(k.head==="a")if(w.head==="l")if(f.head==="s")if(d.head==="e")P="false";else P="";else P="";else P="";else P=""}else if($==="n")if(k.head==="u")if(w.head==="l")if(f.head==="l")P="null";else P="";else P="";else P="";else P=""}}}}let S=P,q=Y8(S),C=n(Q([H("text-red-400")]),Q([x(S)]));Z=t5(W,q),J=Y,K=!1,X=A(C,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}else{let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}}}}else if(I==="f")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else{let D=F.tail;if(D instanceof M){let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}else if(z.head==="a")if(N.head==="l")if(F.head==="s")if(D.head==="e"&&!Y){let q;if(W instanceof M)q="";else{let f=W.tail;if(f instanceof M)q="";else{let $=f.tail;if($ instanceof M)q="";else{let d=$.tail;if(d instanceof M)q="";else{let p=W.head;if(p==="t")if(f.head==="r")if($.head==="u")if(d.head==="e")q="true";else q="";else q="";else q="";else if(p==="f"){let r=d.tail;if(r instanceof M)q="";else if(f.head==="a")if($.head==="l")if(d.head==="s")if(r.head==="e")q="false";else q="";else q="";else q="";else q=""}else if(p==="n")if(f.head==="u")if($.head==="l")if(d.head==="l")q="null";else q="";else q="";else q="";else q=""}}}}let C=q,U=Y8(C),k=n(Q([H("text-red-400")]),Q([x(C)]));Z=t5(W,U),J=Y,K=!1,X=A(k,G)}else{let q=I,C=z,U;if(q==="0")U="text-red-400";else if(q==="1")U="text-red-400";else if(q==="2")U="text-red-400";else if(q==="3")U="text-red-400";else if(q==="4")U="text-red-400";else if(q==="5")U="text-red-400";else if(q==="6")U="text-red-400";else if(q==="7")U="text-red-400";else if(q==="8")U="text-red-400";else if(q==="9")U="text-red-400";else if(q===".")U="text-red-400";else if(q==="-")U="text-red-400";else U="text-zinc-200";let w=n(Q([H(U)]),Q([x(q)]));Z=C,J=Y,K=V,X=A(w,G)}else{let S=I,q=z,C;if(S==="0")C="text-red-400";else if(S==="1")C="text-red-400";else if(S==="2")C="text-red-400";else if(S==="3")C="text-red-400";else if(S==="4")C="text-red-400";else if(S==="5")C="text-red-400";else if(S==="6")C="text-red-400";else if(S==="7")C="text-red-400";else if(S==="8")C="text-red-400";else if(S==="9")C="text-red-400";else if(S===".")C="text-red-400";else if(S==="-")C="text-red-400";else C="text-zinc-200";let k=n(Q([H(C)]),Q([x(S)]));Z=q,J=Y,K=V,X=A(k,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}}}}}else if(I==="n")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else if(z.head==="u")if(N.head==="l")if(F.head==="l"&&!Y){let P;if(W instanceof M)P="";else{let k=W.tail;if(k instanceof M)P="";else{let w=k.tail;if(w instanceof M)P="";else{let f=w.tail;if(f instanceof M)P="";else{let $=W.head;if($==="t")if(k.head==="r")if(w.head==="u")if(f.head==="e")P="true";else P="";else P="";else P="";else if($==="f"){let d=f.tail;if(d instanceof M)P="";else if(k.head==="a")if(w.head==="l")if(f.head==="s")if(d.head==="e")P="false";else P="";else P="";else P="";else P=""}else if($==="n")if(k.head==="u")if(w.head==="l")if(f.head==="l")P="null";else P="";else P="";else P="";else P=""}}}}let S=P,q=Y8(S),C=n(Q([H("text-red-400")]),Q([x(S)]));Z=t5(W,q),J=Y,K=!1,X=A(C,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}else{let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}}}}else if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=I,N=W.tail,F;if(z==="0")F="text-red-400";else if(z==="1")F="text-red-400";else if(z==="2")F="text-red-400";else if(z==="3")F="text-red-400";else if(z==="4")F="text-red-400";else if(z==="5")F="text-red-400";else if(z==="6")F="text-red-400";else if(z==="7")F="text-red-400";else if(z==="8")F="text-red-400";else if(z==="9")F="text-red-400";else if(z===".")F="text-red-400";else if(z==="-")F="text-red-400";else F="text-zinc-200";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}}}}function E_(Z,J,K){return q_(Z,J,!1,K)}function Zh(Z){let K=CZ(Z),X=E_(K,!1,Q([])),W=F0(X);return Vf(W)}class Jh extends O{constructor(Z){super();this[0]=Z}}function Kh(Z){let J=Z[0];return I1((K)=>{return eb(J)})}function x_(){return j(Q([H("py-8 text-center text-zinc-600 text-sm")]),Q([x("Loading lexicons...")]))}function w_(Z){return j(Q([H("py-8 text-center text-red-400 text-sm")]),Q([x("Error: "+Z)]))}function U_(){return j(Q([H("bg-zinc-800/50 rounded p-8 text-center border border-zinc-700")]),Q([x0(Q([H("text-zinc-400 mb-2")]),Q([x("No lexicons found.")])),x0(Q([H("text-sm text-zinc-500")]),Q([x("Upload lexicons from the Settings page to get started.")]))]))}function M_(Z){return j(Q([H("bg-zinc-800/50 rounded p-4 relative")]),Q([E0(Q([H("absolute top-4 right-4 p-1.5 rounded hover:bg-zinc-700 text-zinc-400 hover:text-zinc-300 transition-colors"),M0("button"),k0(new Jh(Z.json))]),Q([aZ("copy",new dU,Q([]))])),zf(Q([H("group")]),Q([Nf(Q([H("cursor-pointer text-base font-mono text-zinc-300 hover:text-zinc-200 select-none list-none pr-10")]),Q([x(Z.id)])),iJ(Q([H("mt-3 bg-zinc-900 rounded p-3 overflow-x-auto text-xs font-mono")]),Q([v8(Q([]),Q([Zh(WL(Z.json))]))]))]))]))}function R_(Z){if(Z instanceof M)return U_();else return j(Q([H("space-y-4")]),Q([x0(Q([H("text-sm text-zinc-500 mb-4")]),Q([x(jJ(l8(Z))+" lexicons")])),j(Q([H("space-y-3")]),H0(Z,M_))]))}function Yh(Z){let J=a(Z,"GetLexicons",b(Q([])),JJ),K;return K=J[1],j(Q([H("space-y-6")]),Q([j(Q([H("mb-2")]),Q([_1(Q([h1("/"),H("text-zinc-400 hover:text-zinc-300 transition-colors text-sm")]),Q([x("← Back")]))])),$1(Q([H("text-2xl font-semibold text-zinc-300 mb-6")]),Q([x("Lexicons")])),(()=>{if(K instanceof j1)return x_();else if(K instanceof L1){let X=K[0];return w_(X)}else{let X=K[0];return R_(X.lexicons)}})()]))}function Xh(Z,J,K,X,W,Y){return j(Q([H("max-w-md mx-auto mt-12")]),Q([j(Q([H("bg-zinc-800/50 rounded p-8 border border-zinc-700")]),Q([j(Q([H("flex justify-center mb-6")]),Q([cU("w-16 h-16")])),$1(Q([H("text-2xl font-semibold text-zinc-300 mb-2 text-center")]),Q([x("Welcome to Quickslice")])),x0(Q([H("text-zinc-400 mb-6 text-center")]),Q([x("Set up an administrator account to get started.")])),g8(Q([U5("/admin/oauth/authorize"),M5("POST"),H("space-y-4")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("AT Protocol Handle")])),sZ(Z,"onboarding-handle","login_hint","user.bsky.social","font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full",J,K,X,W,Y)])),j(Q([H("pt-2")]),Q([nU(Z.query==="","Continue")]))]))]))]))}class eU extends O{constructor(Z){super();this[0]=Z}}class ZM extends O{}class JM extends O{}class KM extends O{constructor(Z){super();this[0]=Z}}class YM extends O{}class XM extends O{constructor(Z){super();this[0]=Z}}class WM extends O{constructor(Z){super();this[0]=Z}}class QM extends O{constructor(Z){super();this[0]=Z}}class VM extends O{constructor(Z){super();this[0]=Z}}class GM extends O{}class WJ extends O{}class IM extends O{constructor(Z){super();this[0]=Z}}class zM extends O{constructor(Z){super();this[0]=Z}}class NM extends O{constructor(Z){super();this[0]=Z}}class FM extends O{constructor(Z){super();this[0]=Z}}class HM extends O{}class DM extends O{constructor(Z){super();this[0]=Z}}class BM extends O{}class OM extends O{constructor(Z){super();this[0]=Z}}class TM extends O{constructor(Z){super();this[0]=Z}}class PM extends O{constructor(Z){super();this[0]=Z}}class SM extends O{}class AM extends O{constructor(Z){super();this[0]=Z}}class qM extends O{constructor(Z){super();this[0]=Z}}class EM extends O{}class CM extends O{}class xM extends O{constructor(Z){super();this[0]=Z}}class wM extends O{}class XJ extends O{constructor(Z){super();this[0]=Z}}class UM extends O{}class Wh extends O{}class K0 extends O{constructor(Z,J,K,X,W,Y,V,G,I,z,N,F,D,B,T,P,S,q,C,U,k,w,f,$,d){super();this.domain_authority_input=Z,this.reset_confirmation=J,this.selected_file=K,this.alert=X,this.relay_url_input=W,this.plc_directory_url_input=Y,this.jetstream_url_input=V,this.oauth_supported_scopes_input=G,this.lexicons_alert=I,this.show_new_client_form=z,this.new_client_name=N,this.new_client_type=F,this.new_client_redirect_uris=D,this.new_client_scope=B,this.editing_client_id=T,this.edit_client_name=P,this.edit_client_redirect_uris=S,this.edit_client_scope=q,this.visible_secrets=C,this.delete_confirm_client_id=U,this.oauth_alert=k,this.new_admin_did=w,this.remove_confirm_did=f,this.admin_alert=$,this.danger_zone_alert=d}}function QJ(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,new L([J,K]),Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function Qh(Z){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,new h,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function C8(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,new L([J,K]),Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function n5(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,new L([J,K]),Z.danger_zone_alert)}function QL(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,new L([J,K]))}function VJ(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,new L([J,K]),Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function Vh(){return new K0("","",new h,new h,"","","","",new h,!1,"","PUBLIC","","atproto transition:generic",new h,"","","",x5(),new h,new h,"",new h,new h,new h)}function y_(Z){return mk(Z)}function f_(Z,J,K){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Basic Settings")])),(()=>{let X=J.alert;if(X instanceof L){let W=X[0][0],Y=X[0][1],V;if(W==="success")V=new V8;else if(W==="error")V=new m1;else V=new u1;return A8(V,Y)}else return G0()})(),g8(Q([H("space-y-6"),rk((X)=>{return new GM})]),Q([j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Domain Authority")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1("e.g. com.example"),o0(J.domain_authority_input),e8(!0),K1((X)=>{return new eU(X)})])),x0(Q([H("text-xs text-zinc-500")]),Q([x('Determines which collections are considered "primary" vs "external" when backfilling records.')]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Relay URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.relay_url),o0(J.relay_url_input),e8(!0),K1((X)=>{return new XM(X)})])),x0(Q([H("text-xs text-zinc-500")]),Q([x("AT Protocol relay URL for backfill operations.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("PLC Directory URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.plc_directory_url),o0(J.plc_directory_url_input),e8(!0),K1((X)=>{return new WM(X)})])),x0(Q([H("text-xs text-zinc-500")]),Q([x("PLC directory URL for DID resolution.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Jetstream URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.jetstream_url),o0(J.jetstream_url_input),e8(!0),K1((X)=>{return new QM(X)})])),x0(Q([H("text-xs text-zinc-500")]),Q([x("Jetstream WebSocket endpoint for real-time indexing.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("OAuth Supported Scopes")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.oauth_supported_scopes),o0(J.oauth_supported_scopes_input),e8(!0),K1((X)=>{return new VM(X)})])),x0(Q([H("text-xs text-zinc-500")]),Q([x("Space-separated OAuth scopes supported by this server.")]))])),j(Q([H("flex gap-3 pt-4")]),Q([nU(K,(()=>{if(K)return"Saving...";else return"Save"})())]))]))]))}function k_(Z){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Lexicons")])),(()=>{let J=Z.lexicons_alert;if(J instanceof L){let K=J[0][0],X=J[0][1],W;if(K==="success")W=new V8;else if(K==="error")W=new m1;else W=new u1;return A8(W,X)}else return G0()})(),j(Q([H("space-y-4")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Upload Lexicons (ZIP)")])),z1(Q([M0("file"),cy(Q([".zip"])),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),B8("lexicon-file-input"),K1((J)=>{return new ZM})]))])),x0(Q([H("text-sm text-zinc-500 mb-4")]),Q([x("Upload a ZIP file containing lexicon JSON files.")])),j(Q([H("flex gap-3")]),Q([J8(!1,new JM,"Upload")]))]))]))}function b_(Z){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Danger Zone")])),(()=>{let J=Z.danger_zone_alert;if(J instanceof L){let K=J[0][0],X=J[0][1],W;if(K==="success")W=new V8;else if(K==="error")W=new m1;else W=new u1;return A8(W,X)}else return G0()})(),x0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("This will clear all indexed data:")])),sJ(Q([H("text-sm text-zinc-400 mb-4 ml-4 list-disc")]),Q([y5(Q([]),Q([x("Domain authority configuration")])),y5(Q([]),Q([x("All lexicon definitions")])),y5(Q([]),Q([x("All indexed records")])),y5(Q([]),Q([x("All actors")]))])),x0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("Records can be re-indexed via backfill.")])),j(Q([H("space-y-4")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Type RESET to confirm")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1("RESET"),o0(Z.reset_confirmation),K1((J)=>{return new KM(J)})]))])),j(Q([H("flex gap-3")]),Q([E0(Q([H("font-mono px-4 py-2 text-sm text-red-400 border border-red-900 hover:bg-red-900/30 rounded transition-colors cursor-pointer"),jZ(Z.reset_confirmation!=="RESET"),k0(new YM)]),Q([x("Reset Everything")]))]))]))]))}function h_(Z){return j(Q([H("bg-zinc-900 rounded p-4 mb-4 border border-zinc-700")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Register New Client")])),j(Q([H("space-y-3")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Name")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),q1("My Application"),o0(Z.new_client_name),K1((J)=>{return new IM(J)})]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Type")])),If(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),lk((J)=>{return new zM(J)})]),Q([iR(Q([o0("PUBLIC"),RR(Z.new_client_type==="PUBLIC")]),"Public"),iR(Q([o0("CONFIDENTIAL"),RR(Z.new_client_type==="CONFIDENTIAL")]),"Confidential")])),x0(Q([H("text-xs text-zinc-500 mt-1")]),Q([x((()=>{if(Z.new_client_type==="CONFIDENTIAL")return"For server-side apps that can securely store a client secret";else return"For browser apps (SPAs) and mobile apps that cannot securely store a secret"})())]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Redirect URIs (one per line)")])),sR(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full h-20"),q1("http://localhost:3000/callback"),o0(Z.new_client_redirect_uris),K1((J)=>{return new NM(J)})]),"")])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Scope")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),q1("atproto transition:generic"),o0(Z.new_client_scope),K1((J)=>{return new FM(J)})])),x0(Q([H("text-xs text-zinc-500 mt-1")]),Q([x("Space-separated OAuth scopes")]))])),j(Q([H("flex gap-2")]),Q([J8(!1,new HM,"Create"),E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new WJ)]),Q([x("Cancel")]))]))]))]))}function v_(Z,J){return j(Q([H("bg-zinc-900 rounded p-4 border border-amber-700")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Edit Client")])),j(Q([H("space-y-3")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client ID")])),v8(Q([H("text-sm text-zinc-500 font-mono")]),Q([x(Z.client_id)]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Name")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),o0(J.edit_client_name),K1((K)=>{return new OM(K)})]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Redirect URIs (one per line)")])),sR(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full h-20"),K1((K)=>{return new TM(K)})]),J.edit_client_redirect_uris)])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Scope")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),o0(J.edit_client_scope),K1((K)=>{return new PM(K)})]))])),j(Q([H("flex gap-2")]),Q([J8(!1,new SM,"Save"),E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new BM)]),Q([x("Cancel")]))]))]))]))}function g_(Z,J){let K=O0(J.editing_client_id,new L(Z.client_id)),X=W4(J.visible_secrets,Z.client_id);if(K)return v_(Z,J);else return j(Q([H("bg-zinc-900 rounded p-4 border border-zinc-700")]),Q([j(Q([H("flex justify-between items-start mb-2")]),Q([j(Q([]),Q([n(Q([H("text-zinc-300 font-medium")]),Q([x(Z.client_name)]))])),j(Q([H("flex gap-2")]),Q([E0(Q([H("text-sm text-zinc-400 hover:text-zinc-300 cursor-pointer"),k0(new DM(Z.client_id))]),Q([x("Edit")])),E0(Q([H("text-sm text-red-400 hover:text-red-300 cursor-pointer"),k0(new qM(Z.client_id))]),Q([x("Delete")]))]))])),j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Client ID: ")])),v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Z.client_id)]))])),j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Type: ")])),n(Q([H("text-xs text-zinc-400")]),Q([x((()=>{let W=Z.client_type;if(W==="PUBLIC")return"Public";else if(W==="CONFIDENTIAL")return"Confidential";else return Z.client_type})())]))])),(()=>{let W=Z.client_secret;if(W instanceof L){let Y=W[0];return j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Secret: ")])),(()=>{if(X)return v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Y)]));else return v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x("••••••••••••••••")]))})(),E0(Q([H("ml-2 text-xs text-zinc-500 hover:text-zinc-400 cursor-pointer"),k0(new AM(Z.client_id))]),Q([x((()=>{if(X)return"Hide";else return"Show"})())]))]))}else return G0()})(),(()=>{let W=Z.redirect_uris;if(W instanceof M)return G0();else{let Y=W;return j(Q([]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Redirect URIs:")])),sJ(Q([H("text-xs text-zinc-400 font-mono ml-4")]),H0(Y,(V)=>{return y5(Q([]),Q([x(V)]))}))]))}})(),(()=>{let W=Z.scope;if(W instanceof L){let Y=W[0];return j(Q([H("mt-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Scope: ")])),v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Y)]))]))}else return G0()})()]))}function $_(Z){return j(Q([H("fixed inset-0 bg-black/50 flex items-center justify-center z-50")]),Q([j(Q([H("bg-zinc-800 rounded p-6 max-w-md")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Delete Client?")])),x0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("Are you sure you want to delete client "),v8(Q([H("text-zinc-300")]),Q([x(Z)])),x("? This action cannot be undone.")])),j(Q([H("flex gap-2 justify-end")]),Q([E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new EM)]),Q([x("Cancel")])),E0(Q([H("font-mono px-4 py-2 text-sm text-red-400 border border-red-900 hover:bg-red-900/30 rounded transition-colors cursor-pointer"),k0(new CM)]),Q([x("Delete")]))]))]))]))}function __(Z,J){let K=b(Q([])),X=a(Z,"GetOAuthClients",K,c8),W;return W=X[1],j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("OAuth Clients")])),(()=>{let Y=J.oauth_alert;if(Y instanceof L){let V=Y[0][0],G=Y[0][1],I;if(V==="success")I=new V8;else if(V==="error")I=new m1;else I=new u1;return A8(I,G)}else return G0()})(),(()=>{if(J.show_new_client_form)return h_(J);else return j(Q([H("mb-4")]),Q([J8(!1,new WJ,"Register New Client")]))})(),(()=>{if(W instanceof j1)return j(Q([H("py-4 text-center text-zinc-600 text-sm")]),Q([x("Loading clients...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-4 text-center text-red-400 text-sm")]),Q([x("Error: "+Y)]))}else{let Y=W[0];return j(Q([H("space-y-3")]),H0(Y.oauth_clients,(V)=>{return g_(V,J)}))}})(),(()=>{let Y=J.delete_confirm_client_id;if(Y instanceof L){let V=Y[0];return $_(V)}else return G0()})()]))}function m_(Z,J){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Admin Management")])),(()=>{let K=J.admin_alert;if(K instanceof L){let X=K[0][0],W=K[0][1],Y;if(X==="success")Y=new V8;else if(X==="error")Y=new m1;else Y=new u1;return A8(Y,W)}else return G0()})(),j(Q([H("mb-6")]),Q([B4(Q([H("text-sm font-medium text-zinc-400 mb-2")]),Q([x("Current Admins")])),sJ(Q([H("space-y-2")]),H0(Z.admin_dids,(K)=>{return y5(Q([H("flex items-center justify-between bg-zinc-900/50 px-3 py-2 rounded border border-zinc-800")]),Q([n(Q([H("font-mono text-sm text-zinc-300 truncate")]),Q([x(K)])),(()=>{let X=J.remove_confirm_did;if(X instanceof L)if(X[0]===K)return j(Q([H("flex gap-2")]),Q([E0(Q([H("text-xs px-2 py-1 text-zinc-400 hover:text-zinc-300 cursor-pointer"),k0(new UM)]),Q([x("Cancel")])),E0(Q([H("text-xs px-2 py-1 text-red-400 hover:bg-red-900/30 rounded cursor-pointer"),k0(new Wh)]),Q([x("Confirm Remove")]))]));else return E0(Q([H("text-xs px-2 py-1 text-zinc-500 hover:text-red-400 transition-colors cursor-pointer"),k0(new XJ(K))]),Q([x("Remove")]));else return E0(Q([H("text-xs px-2 py-1 text-zinc-500 hover:text-red-400 transition-colors cursor-pointer"),k0(new XJ(K))]),Q([x("Remove")]))})()]))}))])),j(Q([H("border-t border-zinc-800 pt-4")]),Q([B4(Q([H("text-sm font-medium text-zinc-400 mb-2")]),Q([x("Add Admin")])),j(Q([H("flex gap-2")]),Q([z1(Q([M0("text"),H("flex-1 font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700"),q1("did:plc:... or did:web:..."),o0(J.new_admin_did),K1((K)=>{return new xM(K)})])),J8(J.new_admin_did==="",new wM,"Add Admin")])),x0(Q([H("text-xs text-zinc-500 mt-2")]),Q([x("Enter the DID of the user you want to make an admin.")]))]))]))}function Gh(Z,J,K){if(K){let X=b(Q([])),W=a(Z,"GetSettings",X,O1),Y;Y=W[1];let V=y_(Z);return j(Q([H("max-w-2xl space-y-6")]),Q([$1(Q([H("text-2xl font-semibold text-zinc-300 mb-8")]),Q([x("Settings")])),(()=>{if(Y instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-sm")]),Q([x("Loading settings...")]));else if(Y instanceof L1){let G=Y[0];return j(Q([H("py-8 text-center text-red-400 text-sm")]),Q([x("Error: "+G)]))}else{let G=Y[0];return j(Q([H("space-y-6")]),Q([f_(G.settings,J,V),k_(J),__(Z,J),m_(G.settings,J),b_(J)]))}})()]))}else return j(Q([H("max-w-2xl space-y-6")]),Q([$1(Q([H("text-2xl font-semibold text-zinc-300 mb-8")]),Q([x("Settings")])),j(Q([H("bg-zinc-800/50 rounded p-8 text-center border border-zinc-700")]),Q([x0(Q([H("text-zinc-400 mb-4")]),Q([x("Access Denied")])),x0(Q([H("text-sm text-zinc-500")]),Q([x("You must be an administrator to access the settings page.")]))]))]))}function Ih(){return window.location.origin}function GJ(Z,J){window.setTimeout(()=>J(),Z)}var d_="src/quickslice_client.gleam";class s5 extends O{}class O5 extends O{}class FJ extends O{}class zL extends O{}class zJ extends O{}class i5 extends O{}class x8 extends O{}class zh extends O{constructor(Z,J,K){super();this.did=Z,this.handle=J,this.is_admin=K}}class s extends O{constructor(Z,J,K,X,W,Y,V,G,I,z,N){super();this.cache=Z,this.registry=J,this.route=K,this.time_range=X,this.settings_page_model=W,this.backfill_page_model=Y,this.backfill_status=V,this.auth_state=G,this.mobile_menu_open=I,this.login_autocomplete=z,this.oauth_error=N}}class d0 extends O{constructor(Z,J,K){super();this[0]=Z,this[1]=J,this[2]=K}}class MM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class RM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class jM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class LM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class NL extends O{constructor(Z){super();this[0]=Z}}class FL extends O{constructor(Z){super();this[0]=Z}}class HL extends O{constructor(Z){super();this[0]=Z}}class yM extends O{constructor(Z){super();this[0]=Z}}class DL extends O{constructor(Z){super();this[0]=Z}}class VL extends O{constructor(Z){super();this[0]=Z}}class IJ extends O{}class BL extends O{}class NJ extends O{constructor(Z){super();this[0]=Z}}class fM extends O{constructor(Z){super();this[0]=Z}}class kM extends O{constructor(Z){super();this[0]=Z}}class bM extends O{}class hM extends O{}class GL extends O{constructor(Z){super();this[0]=Z}}class IL extends O{}function B5(Z){let J=l1(Z,f0);if(J instanceof E){let K=J[0],X=g("errors",U0(g("message",u,(Y)=>{return l(Y)})),(Y)=>{return l(Y)}),W=z0(K,X);if(W instanceof E){let Y=W[0];if(Y instanceof M)return new h;else{let V=Y.head;return new L(V)}}else return new h}else return new h}function c_(Z){let J=Z.query;if(J instanceof L){let K=J[0],X,W=UJ(K);X=F8(W,Q([]));let Y=X,V=AZ(Y,"error");if(V instanceof E){let G=V[0];if(G==="access_denied")return new L("Login was cancelled");else{let I=G,z,N=AZ(Y,"error_description"),F=F8(N,I),D=NR(F);return z=F8(D,I),new L("Login failed: "+z)}}else return new h}else return J}function p_(Z,J){if(J instanceof d0){let K=J[2];if(K instanceof E){let X=J[0],W=J[1],Y=K[0],V=dk(Z.cache,X,W,Y,0),G=u0(V,Z.registry,(m,y,_)=>{return new d0(m,y,_)},()=>{return 0}),I,z;I=G[0],z=G[1];let N;if(X==="IsBackfilling"){let m=cZ(Y);if(m instanceof E){let y=m[0],_=Z.backfill_status;if(y.is_backfilling&&_ instanceof HK)N=new T8;else N=ik(Z.backfill_status,y.is_backfilling)}else N=Z.backfill_status}else N=Z.backfill_status;let F=N,D,B=_5(Z.backfill_status),T=_5(F);if(B)if(T&&X==="IsBackfilling")D=Q([I1((m)=>{return GJ(1e4,()=>{return m(new IJ)})})]);else D=Q([]);else if(T&&X==="IsBackfilling")D=Q([I1((m)=>{return GJ(1e4,()=>{return m(new IJ)})})]);else D=Q([]);let P=D,S,q=Z.backfill_status;if(q instanceof u8&&F instanceof $5)S=!0;else if(q instanceof T8&&F instanceof $5)S=!0;else S=!1;let C=S,U;if(X==="GetCurrentSession"){let m=lj(Y);if(m instanceof E){let _=m[0].current_session;if(_ instanceof L){let t=_[0];U=new zh(t.did,t.handle,t.is_admin)}else U=new x8}else U=new x8}else U=Z.auth_state;let k=U,w;if(X==="UpdateSettings")w=QJ(Z.settings_page_model,"success","Settings updated successfully");else if(X==="UploadLexicons"){ij("lexicon-file-input");let m=B5(Y);if(m instanceof L){let y=m[0];w=VJ(Z.settings_page_model,"error",y)}else w=VJ(Z.settings_page_model,"success","Lexicons uploaded successfully")}else if(X==="ResetAll"){let m,y=Z.settings_page_model;m=new K0("",y.reset_confirmation,y.selected_file,y.alert,y.relay_url_input,y.plc_directory_url_input,y.jetstream_url_input,y.oauth_supported_scopes_input,y.lexicons_alert,y.show_new_client_form,y.new_client_name,y.new_client_type,y.new_client_redirect_uris,y.new_client_scope,y.editing_client_id,y.edit_client_name,y.edit_client_redirect_uris,y.edit_client_scope,y.visible_secrets,y.delete_confirm_client_id,y.oauth_alert,y.new_admin_did,y.remove_confirm_did,y.admin_alert,y.danger_zone_alert),w=QL(m,"success","All data has been reset")}else if(X==="GetSettings"){let m=O1(Y);if(m instanceof E){let y=m[0],_=Z.settings_page_model;w=new K0(y.settings.domain_authority,_.reset_confirmation,_.selected_file,_.alert,y.settings.relay_url,y.settings.plc_directory_url,y.settings.jetstream_url,y.settings.oauth_supported_scopes,_.lexicons_alert,_.show_new_client_form,_.new_client_name,_.new_client_type,_.new_client_redirect_uris,_.new_client_scope,_.editing_client_id,_.edit_client_name,_.edit_client_redirect_uris,_.edit_client_scope,_.visible_secrets,_.delete_confirm_client_id,_.oauth_alert,_.new_admin_did,_.remove_confirm_did,_.admin_alert,_.danger_zone_alert)}else w=Z.settings_page_model}else if(X==="CreateOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="UpdateOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="DeleteOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="AddAdmin"){let m=B5(Y);if(m instanceof L){let y=m[0];w=n5(Z.settings_page_model,"error",y)}else{let y;if(X==="AddAdmin")y="Admin added successfully";else if(X==="RemoveAdmin")y="Admin removed successfully";else y="Operation completed";let _=y;w=n5(Z.settings_page_model,"success",_)}}else if(X==="RemoveAdmin"){let m=B5(Y);if(m instanceof L){let y=m[0];w=n5(Z.settings_page_model,"error",y)}else{let y;if(X==="AddAdmin")y="Admin added successfully";else if(X==="RemoveAdmin")y="Admin removed successfully";else y="Operation completed";let _=y;w=n5(Z.settings_page_model,"success",_)}}else w=Z.settings_page_model;let f=w,$;if(X==="BackfillActor"){let m=Z.backfill_page_model,y=rU(m,!1),_=oj(y,"success","Backfill started for "+Z.backfill_page_model.did_input);$=((t)=>{return new D5("",t.is_submitting,t.alert)})(_)}else $=Z.backfill_page_model;let d=$,p;if(X==="ResetAll"){let m=m0(I,"GetStatistics",b(Q([]))),y=m0(m,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]]))),_=m0(y,"GetRecentActivity",b(Q([["hours",X1(24)]]))),t=a(_,"GetSettings",b(Q([])),O1),o;o=t[0];let Y0=u0(o,Z.registry,(y0,F1,T1)=>{return new d0(y0,F1,T1)},()=>{return 0}),w0,C0;w0=Y0[0],C0=Y0[1],p=[w0,C0]}else if(X==="UploadLexicons")p=[m0(I,"GetStatistics",b(Q([]))),Q([])];else if(X==="CreateOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,C0,y0)=>{return new d0(w0,C0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else if(X==="UpdateOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,C0,y0)=>{return new d0(w0,C0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else if(X==="DeleteOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,C0,y0)=>{return new d0(w0,C0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else p=[I,Q([])];let r=p,X0,B0;X0=r[0],B0=r[1];let L0;if(C){let m=m0(X0,"GetStatistics",b(Q([]))),y=m0(m,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]]))),_=m0(y,"GetRecentActivity",b(Q([["hours",X1(24)]]))),t=a(_,"GetStatistics",b(Q([])),H5),o;o=t[0];let Y0=a(o,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]])),p5),w0;w0=Y0[0];let C0=a(w0,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),y0;y0=C0[0];let F1=u0(y0,Z.registry,(w1,G8,w8)=>{return new d0(w1,G8,w8)},()=>{return 0}),T1,P1;T1=F1[0],P1=F1[1],L0=[T1,P1]}else L0=[X0,Q([])];let I0=L0,D0,W0;D0=I0[0],W0=I0[1];let J0;if(X==="GetCurrentSession"){let m=Z.route;if(k instanceof x8)if(m instanceof O5)J0=Q([v5("/",new h,new h)]);else J0=Q([]);else if(!k.is_admin&&m instanceof O5)J0=Q([v5("/",new h,new h)]);else J0=Q([])}else if(X==="GetSettings"){let m=O1(Y);if(m instanceof E){let y=m[0],_=hL(y.settings.admin_dids),t=Z.route;if(_)if(t instanceof i5)J0=Q([]);else J0=Q([v5("/onboarding",new h,new h)]);else if(t instanceof i5)J0=Q([v5("/",new h,new h)]);else J0=Q([])}else J0=Q([])}else J0=Q([]);let Z0=J0;return[new s(D0,Z.registry,Z.route,Z.time_range,f,d,F,k,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1((()=>{let m=Q([z,B0,W0,Z0,P]);return gL(m)})())]}else{let X=J[0],W=K[0],Y;if(X==="UpdateSettings")Y=QJ(Z.settings_page_model,"error","Error: "+W);else if(X==="TriggerBackfill")Y=QJ(Z.settings_page_model,"error","Error: "+W);else if(X==="ResetAll")Y=QL(Z.settings_page_model,"error","Error: "+W);else if(X==="UploadLexicons")Y=VJ(Z.settings_page_model,"error","Error: "+W);else if(X==="CreateOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else if(X==="UpdateOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else if(X==="DeleteOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else Y=Z.settings_page_model;let V=Y,G;if(X==="BackfillActor"){let z=Z.backfill_page_model,N=rU(z,!1);G=oj(N,"error","Error: "+W)}else G=Z.backfill_page_model;let I=G;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}}else if(J instanceof MM){let K=J[0],X=J[1],W=vj(Z.cache,K,X),Y=QJ(Z.settings_page_model,"success","Settings updated successfully");return[new s(W,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof RM){let K=J[0],X=J[1],W=bj(Z.cache,K),Y,G=a(W,"GetSettings",b(Q([])),O1)[1];if(G instanceof Z8)Y=G[0].settings.domain_authority;else Y=Z.settings_page_model.domain_authority_input;let I=Y,z,N=E5(X,"Response body: ");if(N instanceof E){let P=N[0][1],S=B5(P);if(S instanceof L)z=S[0];else z=X}else z=X;let F=z,D,B=Z.settings_page_model;D=new K0(I,B.reset_confirmation,B.selected_file,new L(["error",F]),B.relay_url_input,B.plc_directory_url_input,B.jetstream_url_input,B.oauth_supported_scopes_input,B.lexicons_alert,B.show_new_client_form,B.new_client_name,B.new_client_type,B.new_client_redirect_uris,B.new_client_scope,B.editing_client_id,B.edit_client_name,B.edit_client_redirect_uris,B.edit_client_scope,B.visible_secrets,B.delete_confirm_client_id,B.oauth_alert,B.new_admin_did,B.remove_confirm_did,B.admin_alert,B.danger_zone_alert);let T=D;return[new s(W,Z.registry,Z.route,Z.time_range,T,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof jM){let K=J[0],X=J[1],W=vj(Z.cache,K,X),Y=n5(Z.settings_page_model,"success","Admin updated successfully");return[new s(W,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof LM){let K=J[0],X=J[1],W=bj(Z.cache,K),Y,V=E5(X,"Response body: ");if(V instanceof E){let z=V[0][1],N=B5(z);if(N instanceof L)Y=N[0];else Y=X}else Y=X;let G=Y,I=n5(Z.settings_page_model,"error",G);return[new s(W,Z.registry,Z.route,Z.time_range,I,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof NL){let K=J[0],X;if(Z.route instanceof O5)X=Qh(Z.settings_page_model);else X=Z.settings_page_model;let Y=X;if(K instanceof s5){let V=a(Z.cache,"GetStatistics",b(Q([])),H5),G;G=V[0];let I=a(G,"GetSettings",b(Q([])),O1),z;z=I[0];let N=a(z,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]])),p5),F;F=N[0];let D=a(F,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),B;B=D[0];let T=u0(B,Z.registry,(q,C,U)=>{return new d0(q,C,U)},()=>{return 0}),P,S;return P=T[0],S=T[1],[new s(P,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(S)]}else if(K instanceof O5){let V,G=Z.auth_state;if(G instanceof x8)V=!1;else V=G.is_admin;if(V){let z=a(Z.cache,"GetSettings",b(Q([])),O1),N;N=z[0];let F=a(N,"GetOAuthClients",b(Q([])),c8),D;D=F[0];let B=u0(D,Z.registry,(S,q,C)=>{return new d0(S,q,C)},()=>{return 0}),T,P;return T=B[0],P=B[1],[new s(T,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(P)]}else return[Z,v5("/",new h,new h)]}else if(K instanceof FJ){let V=a(Z.cache,"GetLexicons",b(Q([])),JJ),G;G=V[0];let I=u0(G,Z.registry,(F,D,B)=>{return new d0(F,D,B)},()=>{return 0}),z,N;return z=I[0],N=I[1],[new s(z,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(N)]}else if(K instanceof zJ)if(Z.auth_state instanceof x8)return[Z,v5("/",new h,new h)];else{let G=lU(Z.backfill_page_model);return[new s(Z.cache,Z.registry,new zJ,Z.time_range,Z.settings_page_model,G,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof i5)return[new s(Z.cache,Z.registry,new i5,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()];else return[new s(Z.cache,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof FL){let K=J[0];if(K instanceof tU){let X=K[0],W=b(Q([["range",c(F5(X))]])),Y=a(Z.cache,"GetActivityBuckets",W,p5),V;V=Y[0];let G=u0(V,Z.registry,(N,F,D)=>{return new d0(N,F,D)},()=>{return 0}),I,z;return I=G[0],z=G[1],[new s(I,Z.registry,Z.route,X,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(z)]}else if(K instanceof oU){let X=b(Q([])),W=m0(Z.cache,"TriggerBackfill",X),Y=a(W,"TriggerBackfill",X,gb),V;V=Y[0];let G=u0(V,Z.registry,(F,D,B)=>{return new d0(F,D,B)},()=>{return 0}),I,z;I=G[0],z=G[1];let N=I1((F)=>{return GJ(1e4,()=>{return F(new IJ)})});return[new s(I,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,new u8,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(Q([W1(z),N]))]}else return tj("/graphiql"),[Z,i()]}else if(J instanceof HL){let K=J[0];if(K instanceof eU){let X=K[0],W,Y=Z.settings_page_model;W=new K0(X,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof ZM)return[Z,i()];else if(K instanceof JM){C5("[UploadLexicons] Button clicked, creating file effect");let X=I1((W)=>{return C5("[UploadLexicons] Effect running, calling read_file_as_base64"),nj("lexicon-file-input",(Y)=>{return C5("[UploadLexicons] Callback received result"),W(new VL(Y))})});return[Z,X]}else if(K instanceof KM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,X,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof YM){let X=b(Q([["confirm",c(Z.settings_page_model.reset_confirmation)]])),W=m0(Z.cache,"ResetAll",X),Y=a(W,"ResetAll",X,hb),V;V=Y[0];let G=u0(V,Z.registry,(B,T,P)=>{return new d0(B,T,P)},()=>{return 0}),I,z;I=G[0],z=G[1];let N,F=Z.settings_page_model;N=new K0(F.domain_authority_input,"",F.selected_file,new h,F.relay_url_input,F.plc_directory_url_input,F.jetstream_url_input,F.oauth_supported_scopes_input,F.lexicons_alert,F.show_new_client_form,F.new_client_name,F.new_client_type,F.new_client_redirect_uris,F.new_client_scope,F.editing_client_id,F.edit_client_name,F.edit_client_redirect_uris,F.edit_client_scope,F.visible_secrets,F.delete_confirm_client_id,F.oauth_alert,F.new_admin_did,F.remove_confirm_did,F.admin_alert,F.danger_zone_alert);let D=N;return[new s(I,Z.registry,Z.route,Z.time_range,D,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(z)]}else if(K instanceof XM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,X,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof WM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,X,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof QM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,X,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof VM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,X,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof GM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,new h,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X,V=b(Q([])),G=a(Z.cache,"GetSettings",V,O1),I;if(I=G[1],I instanceof Z8){let N=I[0].settings.admin_dids,F=Q([]),D,B=Z.settings_page_model.domain_authority_input;if(B==="")D=F;else D=A(["domainAuthority",c(B)],F);let T=D,P,S=Z.settings_page_model.relay_url_input;if(S==="")P=T;else P=A(["relayUrl",c(S)],T);let q=P,C,U=Z.settings_page_model.plc_directory_url_input;if(U==="")C=q;else C=A(["plcDirectoryUrl",c(U)],q);let k=C,w,f=Z.settings_page_model.jetstream_url_input;if(f==="")w=k;else w=A(["jetstreamUrl",c(f)],k);let $=w,d,p=Z.settings_page_model.oauth_supported_scopes_input;if(p==="")d=$;else d=A(["oauthSupportedScopes",c(p)],$);let r=d,X0=A(["adminDids",j0(N,c)],r);if(X0 instanceof M){let B0=b(X0),L0=Q([["id",c("Settings:singleton")]]),I0,D0=Z.settings_page_model.domain_authority_input;if(D0==="")I0=L0;else I0=A(["domainAuthority",c(D0)],L0);let W0=I0,J0,Z0=Z.settings_page_model.relay_url_input;if(Z0==="")J0=W0;else J0=A(["relayUrl",c(Z0)],W0);let m=J0,y,_=Z.settings_page_model.plc_directory_url_input;if(_==="")y=m;else y=A(["plcDirectoryUrl",c(_)],m);let t=y,o,Y0=Z.settings_page_model.jetstream_url_input;if(Y0==="")o=t;else o=A(["jetstreamUrl",c(Y0)],t);let w0=o,C0,y0=Z.settings_page_model.oauth_supported_scopes_input;if(y0==="")C0=w0;else C0=A(["oauthSupportedScopes",c(y0)],w0);let F1=C0,T1=A(["adminDids",j0(N,c)],F1),P1=b(T1),w1=dZ(Z.cache,Z.registry,"UpdateSettings",B0,"Settings:singleton",(d1)=>{return P1},KJ,(d1,c1,HJ)=>{if(c1 instanceof E)return new MM(d1,HJ);else{let vM=c1[0];return new RM(d1,vM)}}),G8,w8;return G8=w1[0],w8=w1[2],[new s(G8,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),w8]}else if(X0.tail instanceof M)return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()];else{let L0=b(X0),I0=Q([["id",c("Settings:singleton")]]),D0,W0=Z.settings_page_model.domain_authority_input;if(W0==="")D0=I0;else D0=A(["domainAuthority",c(W0)],I0);let J0=D0,Z0,m=Z.settings_page_model.relay_url_input;if(m==="")Z0=J0;else Z0=A(["relayUrl",c(m)],J0);let y=Z0,_,t=Z.settings_page_model.plc_directory_url_input;if(t==="")_=y;else _=A(["plcDirectoryUrl",c(t)],y);let o=_,Y0,w0=Z.settings_page_model.jetstream_url_input;if(w0==="")Y0=o;else Y0=A(["jetstreamUrl",c(w0)],o);let C0=Y0,y0,F1=Z.settings_page_model.oauth_supported_scopes_input;if(F1==="")y0=C0;else y0=A(["oauthSupportedScopes",c(F1)],C0);let T1=y0,P1=A(["adminDids",j0(N,c)],T1),w1=b(P1),G8=dZ(Z.cache,Z.registry,"UpdateSettings",L0,"Settings:singleton",(c1)=>{return w1},KJ,(c1,HJ,vM)=>{if(HJ instanceof E)return new MM(c1,vM);else{let Hh=HJ[0];return new RM(c1,Hh)}}),w8,d1;return w8=G8[0],d1=G8[2],[new s(w8,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),d1]}}else return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof WJ){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,!Z.settings_page_model.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof IM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,X,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof zM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,X,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof NM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,X,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof FM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,X,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof HM){let X,W=K4(Z.settings_page_model.new_client_redirect_uris,` 151 + `;else return""}})());Z=z,J=Y,K=V,X=A(N,G)}else if(I==="t")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else if(z.head==="r")if(N.head==="u")if(F.head==="e"&&!Y){let P;if(W instanceof M)P="";else{let k=W.tail;if(k instanceof M)P="";else{let w=k.tail;if(w instanceof M)P="";else{let f=w.tail;if(f instanceof M)P="";else{let $=W.head;if($==="t")if(k.head==="r")if(w.head==="u")if(f.head==="e")P="true";else P="";else P="";else P="";else if($==="f"){let d=f.tail;if(d instanceof M)P="";else if(k.head==="a")if(w.head==="l")if(f.head==="s")if(d.head==="e")P="false";else P="";else P="";else P="";else P=""}else if($==="n")if(k.head==="u")if(w.head==="l")if(f.head==="l")P="null";else P="";else P="";else P="";else P=""}}}}let S=P,q=Y8(S),C=n(Q([H("text-red-400")]),Q([x(S)]));Z=t5(W,q),J=Y,K=!1,X=A(C,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}else{let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}}}}else if(I==="f")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else{let D=F.tail;if(D instanceof M){let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}else if(z.head==="a")if(N.head==="l")if(F.head==="s")if(D.head==="e"&&!Y){let q;if(W instanceof M)q="";else{let f=W.tail;if(f instanceof M)q="";else{let $=f.tail;if($ instanceof M)q="";else{let d=$.tail;if(d instanceof M)q="";else{let p=W.head;if(p==="t")if(f.head==="r")if($.head==="u")if(d.head==="e")q="true";else q="";else q="";else q="";else if(p==="f"){let r=d.tail;if(r instanceof M)q="";else if(f.head==="a")if($.head==="l")if(d.head==="s")if(r.head==="e")q="false";else q="";else q="";else q="";else q=""}else if(p==="n")if(f.head==="u")if($.head==="l")if(d.head==="l")q="null";else q="";else q="";else q="";else q=""}}}}let C=q,U=Y8(C),k=n(Q([H("text-red-400")]),Q([x(C)]));Z=t5(W,U),J=Y,K=!1,X=A(k,G)}else{let q=I,C=z,U;if(q==="0")U="text-red-400";else if(q==="1")U="text-red-400";else if(q==="2")U="text-red-400";else if(q==="3")U="text-red-400";else if(q==="4")U="text-red-400";else if(q==="5")U="text-red-400";else if(q==="6")U="text-red-400";else if(q==="7")U="text-red-400";else if(q==="8")U="text-red-400";else if(q==="9")U="text-red-400";else if(q===".")U="text-red-400";else if(q==="-")U="text-red-400";else U="text-zinc-200";let w=n(Q([H(U)]),Q([x(q)]));Z=C,J=Y,K=V,X=A(w,G)}else{let S=I,q=z,C;if(S==="0")C="text-red-400";else if(S==="1")C="text-red-400";else if(S==="2")C="text-red-400";else if(S==="3")C="text-red-400";else if(S==="4")C="text-red-400";else if(S==="5")C="text-red-400";else if(S==="6")C="text-red-400";else if(S==="7")C="text-red-400";else if(S==="8")C="text-red-400";else if(S==="9")C="text-red-400";else if(S===".")C="text-red-400";else if(S==="-")C="text-red-400";else C="text-zinc-200";let k=n(Q([H(C)]),Q([x(S)]));Z=q,J=Y,K=V,X=A(k,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}}}}}else if(I==="n")if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=W.tail;if(z instanceof M){let N=I,F=z,D;if(N==="0")D="text-red-400";else if(N==="1")D="text-red-400";else if(N==="2")D="text-red-400";else if(N==="3")D="text-red-400";else if(N==="4")D="text-red-400";else if(N==="5")D="text-red-400";else if(N==="6")D="text-red-400";else if(N==="7")D="text-red-400";else if(N==="8")D="text-red-400";else if(N==="9")D="text-red-400";else if(N===".")D="text-red-400";else if(N==="-")D="text-red-400";else D="text-zinc-200";let T=n(Q([H(D)]),Q([x(N)]));Z=F,J=Y,K=V,X=A(T,G)}else{let N=z.tail;if(N instanceof M){let F=I,D=z,B;if(F==="0")B="text-red-400";else if(F==="1")B="text-red-400";else if(F==="2")B="text-red-400";else if(F==="3")B="text-red-400";else if(F==="4")B="text-red-400";else if(F==="5")B="text-red-400";else if(F==="6")B="text-red-400";else if(F==="7")B="text-red-400";else if(F==="8")B="text-red-400";else if(F==="9")B="text-red-400";else if(F===".")B="text-red-400";else if(F==="-")B="text-red-400";else B="text-zinc-200";let P=n(Q([H(B)]),Q([x(F)]));Z=D,J=Y,K=V,X=A(P,G)}else{let F=N.tail;if(F instanceof M){let D=I,B=z,T;if(D==="0")T="text-red-400";else if(D==="1")T="text-red-400";else if(D==="2")T="text-red-400";else if(D==="3")T="text-red-400";else if(D==="4")T="text-red-400";else if(D==="5")T="text-red-400";else if(D==="6")T="text-red-400";else if(D==="7")T="text-red-400";else if(D==="8")T="text-red-400";else if(D==="9")T="text-red-400";else if(D===".")T="text-red-400";else if(D==="-")T="text-red-400";else T="text-zinc-200";let S=n(Q([H(T)]),Q([x(D)]));Z=B,J=Y,K=V,X=A(S,G)}else if(z.head==="u")if(N.head==="l")if(F.head==="l"&&!Y){let P;if(W instanceof M)P="";else{let k=W.tail;if(k instanceof M)P="";else{let w=k.tail;if(w instanceof M)P="";else{let f=w.tail;if(f instanceof M)P="";else{let $=W.head;if($==="t")if(k.head==="r")if(w.head==="u")if(f.head==="e")P="true";else P="";else P="";else P="";else if($==="f"){let d=f.tail;if(d instanceof M)P="";else if(k.head==="a")if(w.head==="l")if(f.head==="s")if(d.head==="e")P="false";else P="";else P="";else P="";else P=""}else if($==="n")if(k.head==="u")if(w.head==="l")if(f.head==="l")P="null";else P="";else P="";else P="";else P=""}}}}let S=P,q=Y8(S),C=n(Q([H("text-red-400")]),Q([x(S)]));Z=t5(W,q),J=Y,K=!1,X=A(C,G)}else{let P=I,S=z,q;if(P==="0")q="text-red-400";else if(P==="1")q="text-red-400";else if(P==="2")q="text-red-400";else if(P==="3")q="text-red-400";else if(P==="4")q="text-red-400";else if(P==="5")q="text-red-400";else if(P==="6")q="text-red-400";else if(P==="7")q="text-red-400";else if(P==="8")q="text-red-400";else if(P==="9")q="text-red-400";else if(P===".")q="text-red-400";else if(P==="-")q="text-red-400";else q="text-zinc-200";let U=n(Q([H(q)]),Q([x(P)]));Z=S,J=Y,K=V,X=A(U,G)}else{let T=I,P=z,S;if(T==="0")S="text-red-400";else if(T==="1")S="text-red-400";else if(T==="2")S="text-red-400";else if(T==="3")S="text-red-400";else if(T==="4")S="text-red-400";else if(T==="5")S="text-red-400";else if(T==="6")S="text-red-400";else if(T==="7")S="text-red-400";else if(T==="8")S="text-red-400";else if(T==="9")S="text-red-400";else if(T===".")S="text-red-400";else if(T==="-")S="text-red-400";else S="text-zinc-200";let C=n(Q([H(S)]),Q([x(T)]));Z=P,J=Y,K=V,X=A(C,G)}else{let B=I,T=z,P;if(B==="0")P="text-red-400";else if(B==="1")P="text-red-400";else if(B==="2")P="text-red-400";else if(B==="3")P="text-red-400";else if(B==="4")P="text-red-400";else if(B==="5")P="text-red-400";else if(B==="6")P="text-red-400";else if(B==="7")P="text-red-400";else if(B==="8")P="text-red-400";else if(B==="9")P="text-red-400";else if(B===".")P="text-red-400";else if(B==="-")P="text-red-400";else P="text-zinc-200";let q=n(Q([H(P)]),Q([x(B)]));Z=T,J=Y,K=V,X=A(q,G)}}}}else if(Y){let z=I,N=W.tail,F;if(V)F="text-green-400";else F="text-sky-400";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}else{let z=I,N=W.tail,F;if(z==="0")F="text-red-400";else if(z==="1")F="text-red-400";else if(z==="2")F="text-red-400";else if(z==="3")F="text-red-400";else if(z==="4")F="text-red-400";else if(z==="5")F="text-red-400";else if(z==="6")F="text-red-400";else if(z==="7")F="text-red-400";else if(z==="8")F="text-red-400";else if(z==="9")F="text-red-400";else if(z===".")F="text-red-400";else if(z==="-")F="text-red-400";else F="text-zinc-200";let B=n(Q([H(F)]),Q([x(z)]));Z=N,J=Y,K=V,X=A(B,G)}}}}function E_(Z,J,K){return q_(Z,J,!1,K)}function Zh(Z){let K=CZ(Z),X=E_(K,!1,Q([])),W=F0(X);return Vf(W)}class Jh extends O{constructor(Z){super();this[0]=Z}}function Kh(Z){let J=Z[0];return I1((K)=>{return eb(J)})}function x_(){return j(Q([H("py-8 text-center text-zinc-600 text-sm")]),Q([x("Loading lexicons...")]))}function w_(Z){return j(Q([H("py-8 text-center text-red-400 text-sm")]),Q([x("Error: "+Z)]))}function U_(){return j(Q([H("bg-zinc-800/50 rounded p-8 text-center border border-zinc-700")]),Q([C0(Q([H("text-zinc-400 mb-2")]),Q([x("No lexicons found.")])),C0(Q([H("text-sm text-zinc-500")]),Q([x("Upload lexicons from the Settings page to get started.")]))]))}function M_(Z){return j(Q([H("bg-zinc-800/50 rounded p-4 relative")]),Q([E0(Q([H("absolute top-4 right-4 p-1.5 rounded hover:bg-zinc-700 text-zinc-400 hover:text-zinc-300 transition-colors"),M0("button"),k0(new Jh(Z.json))]),Q([aZ("copy",new dU,Q([]))])),zf(Q([H("group")]),Q([Nf(Q([H("cursor-pointer text-base font-mono text-zinc-300 hover:text-zinc-200 select-none list-none pr-10")]),Q([x(Z.id)])),iJ(Q([H("mt-3 bg-zinc-900 rounded p-3 overflow-x-auto text-xs font-mono")]),Q([v8(Q([]),Q([Zh(WL(Z.json))]))]))]))]))}function R_(Z){if(Z instanceof M)return U_();else return j(Q([H("space-y-4")]),Q([C0(Q([H("text-sm text-zinc-500 mb-4")]),Q([x(jJ(l8(Z))+" lexicons")])),j(Q([H("space-y-3")]),H0(Z,M_))]))}function Yh(Z){let J=a(Z,"GetLexicons",b(Q([])),JJ),K;return K=J[1],j(Q([H("space-y-6")]),Q([j(Q([H("mb-2")]),Q([_1(Q([h1("/"),H("text-zinc-400 hover:text-zinc-300 transition-colors text-sm")]),Q([x("← Back")]))])),$1(Q([H("text-2xl font-semibold text-zinc-300 mb-6")]),Q([x("Lexicons")])),(()=>{if(K instanceof j1)return x_();else if(K instanceof L1){let X=K[0];return w_(X)}else{let X=K[0];return R_(X.lexicons)}})()]))}function Xh(Z,J,K,X,W,Y){return j(Q([H("max-w-md mx-auto mt-12")]),Q([j(Q([H("bg-zinc-800/50 rounded p-8 border border-zinc-700")]),Q([j(Q([H("flex justify-center mb-6")]),Q([cU("w-16 h-16")])),$1(Q([H("text-2xl font-semibold text-zinc-300 mb-2 text-center")]),Q([x("Welcome to Quickslice")])),C0(Q([H("text-zinc-400 mb-6 text-center")]),Q([x("Set up an administrator account to get started.")])),g8(Q([U5("/admin/oauth/authorize"),M5("POST"),H("space-y-4")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("AT Protocol Handle")])),sZ(Z,"onboarding-handle","login_hint","user.bsky.social","font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full",J,K,X,W,Y)])),j(Q([H("pt-2")]),Q([nU(Z.query==="","Continue")]))]))]))]))}class eU extends O{constructor(Z){super();this[0]=Z}}class ZM extends O{}class JM extends O{}class KM extends O{constructor(Z){super();this[0]=Z}}class YM extends O{}class XM extends O{constructor(Z){super();this[0]=Z}}class WM extends O{constructor(Z){super();this[0]=Z}}class QM extends O{constructor(Z){super();this[0]=Z}}class VM extends O{constructor(Z){super();this[0]=Z}}class GM extends O{}class WJ extends O{}class IM extends O{constructor(Z){super();this[0]=Z}}class zM extends O{constructor(Z){super();this[0]=Z}}class NM extends O{constructor(Z){super();this[0]=Z}}class FM extends O{constructor(Z){super();this[0]=Z}}class HM extends O{}class DM extends O{constructor(Z){super();this[0]=Z}}class BM extends O{}class OM extends O{constructor(Z){super();this[0]=Z}}class TM extends O{constructor(Z){super();this[0]=Z}}class PM extends O{constructor(Z){super();this[0]=Z}}class SM extends O{}class AM extends O{constructor(Z){super();this[0]=Z}}class qM extends O{constructor(Z){super();this[0]=Z}}class EM extends O{}class CM extends O{}class xM extends O{constructor(Z){super();this[0]=Z}}class wM extends O{}class XJ extends O{constructor(Z){super();this[0]=Z}}class UM extends O{}class Wh extends O{}class K0 extends O{constructor(Z,J,K,X,W,Y,V,G,I,z,N,F,D,B,T,P,S,q,C,U,k,w,f,$,d){super();this.domain_authority_input=Z,this.reset_confirmation=J,this.selected_file=K,this.alert=X,this.relay_url_input=W,this.plc_directory_url_input=Y,this.jetstream_url_input=V,this.oauth_supported_scopes_input=G,this.lexicons_alert=I,this.show_new_client_form=z,this.new_client_name=N,this.new_client_type=F,this.new_client_redirect_uris=D,this.new_client_scope=B,this.editing_client_id=T,this.edit_client_name=P,this.edit_client_redirect_uris=S,this.edit_client_scope=q,this.visible_secrets=C,this.delete_confirm_client_id=U,this.oauth_alert=k,this.new_admin_did=w,this.remove_confirm_did=f,this.admin_alert=$,this.danger_zone_alert=d}}function QJ(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,new L([J,K]),Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function Qh(Z){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,new h,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function C8(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,new L([J,K]),Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function n5(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,new L([J,K]),Z.danger_zone_alert)}function QL(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,Z.lexicons_alert,Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,new L([J,K]))}function VJ(Z,J,K){return new K0(Z.domain_authority_input,Z.reset_confirmation,Z.selected_file,Z.alert,Z.relay_url_input,Z.plc_directory_url_input,Z.jetstream_url_input,Z.oauth_supported_scopes_input,new L([J,K]),Z.show_new_client_form,Z.new_client_name,Z.new_client_type,Z.new_client_redirect_uris,Z.new_client_scope,Z.editing_client_id,Z.edit_client_name,Z.edit_client_redirect_uris,Z.edit_client_scope,Z.visible_secrets,Z.delete_confirm_client_id,Z.oauth_alert,Z.new_admin_did,Z.remove_confirm_did,Z.admin_alert,Z.danger_zone_alert)}function Vh(){return new K0("","",new h,new h,"","","","",new h,!1,"","PUBLIC","","atproto transition:generic",new h,"","","",x5(),new h,new h,"",new h,new h,new h)}function y_(Z){return mk(Z)}function f_(Z,J,K){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Basic Settings")])),(()=>{let X=J.alert;if(X instanceof L){let W=X[0][0],Y=X[0][1],V;if(W==="success")V=new V8;else if(W==="error")V=new m1;else V=new u1;return A8(V,Y)}else return G0()})(),g8(Q([H("space-y-6"),rk((X)=>{return new GM})]),Q([j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Domain Authority")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1("e.g. com.example"),o0(J.domain_authority_input),e8(!0),K1((X)=>{return new eU(X)})])),C0(Q([H("text-xs text-zinc-500")]),Q([x('Determines which collections are considered "primary" vs "external" when backfilling records.')]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Relay URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.relay_url),o0(J.relay_url_input),e8(!0),K1((X)=>{return new XM(X)})])),C0(Q([H("text-xs text-zinc-500")]),Q([x("AT Protocol relay URL for backfill operations.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("PLC Directory URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.plc_directory_url),o0(J.plc_directory_url_input),e8(!0),K1((X)=>{return new WM(X)})])),C0(Q([H("text-xs text-zinc-500")]),Q([x("PLC directory URL for DID resolution.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Jetstream URL")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.jetstream_url),o0(J.jetstream_url_input),e8(!0),K1((X)=>{return new QM(X)})])),C0(Q([H("text-xs text-zinc-500")]),Q([x("Jetstream WebSocket endpoint for real-time indexing.")]))])),j(Q([H("space-y-2")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("OAuth Supported Scopes")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1(Z.oauth_supported_scopes),o0(J.oauth_supported_scopes_input),e8(!0),K1((X)=>{return new VM(X)})])),C0(Q([H("text-xs text-zinc-500")]),Q([x("Space-separated OAuth scopes supported by this server.")]))])),j(Q([H("flex gap-3 pt-4")]),Q([nU(K,(()=>{if(K)return"Saving...";else return"Save"})())]))]))]))}function k_(Z){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Lexicons")])),(()=>{let J=Z.lexicons_alert;if(J instanceof L){let K=J[0][0],X=J[0][1],W;if(K==="success")W=new V8;else if(K==="error")W=new m1;else W=new u1;return A8(W,X)}else return G0()})(),j(Q([H("space-y-4")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Upload Lexicons (ZIP)")])),z1(Q([M0("file"),cy(Q([".zip"])),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),B8("lexicon-file-input"),K1((J)=>{return new ZM})]))])),C0(Q([H("text-sm text-zinc-500 mb-2")]),Q([x("Upload a ZIP file containing your lexicon JSON files.")])),C0(Q([H("text-sm text-zinc-500 mb-4")]),Q([x("NOTE: If you're swapping out lexicons with a totally new set, consider using RESET instead to clear all records as well.")])),j(Q([H("flex gap-3")]),Q([J8(!1,new JM,"Upload")]))]))]))}function b_(Z){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Danger Zone")])),(()=>{let J=Z.danger_zone_alert;if(J instanceof L){let K=J[0][0],X=J[0][1],W;if(K==="success")W=new V8;else if(K==="error")W=new m1;else W=new u1;return A8(W,X)}else return G0()})(),C0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("This will clear all indexed data:")])),sJ(Q([H("text-sm text-zinc-400 mb-4 ml-4 list-disc")]),Q([y5(Q([]),Q([x("Domain authority configuration")])),y5(Q([]),Q([x("All lexicon definitions")])),y5(Q([]),Q([x("All indexed records")])),y5(Q([]),Q([x("All actors")]))])),C0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("Records can be re-indexed via backfill.")])),j(Q([H("space-y-4")]),Q([j(Q([H("mb-4")]),Q([r0(Q([H("block text-sm text-zinc-400 mb-2")]),Q([x("Type RESET to confirm")])),z1(Q([M0("text"),H("font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700 w-full"),q1("RESET"),o0(Z.reset_confirmation),K1((J)=>{return new KM(J)})]))])),j(Q([H("flex gap-3")]),Q([E0(Q([H("font-mono px-4 py-2 text-sm text-red-400 border border-red-900 hover:bg-red-900/30 rounded transition-colors cursor-pointer"),jZ(Z.reset_confirmation!=="RESET"),k0(new YM)]),Q([x("Reset Everything")]))]))]))]))}function h_(Z){return j(Q([H("bg-zinc-900 rounded p-4 mb-4 border border-zinc-700")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Register New Client")])),j(Q([H("space-y-3")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Name")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),q1("My Application"),o0(Z.new_client_name),K1((J)=>{return new IM(J)})]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Type")])),If(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),lk((J)=>{return new zM(J)})]),Q([iR(Q([o0("PUBLIC"),RR(Z.new_client_type==="PUBLIC")]),"Public"),iR(Q([o0("CONFIDENTIAL"),RR(Z.new_client_type==="CONFIDENTIAL")]),"Confidential")])),C0(Q([H("text-xs text-zinc-500 mt-1")]),Q([x((()=>{if(Z.new_client_type==="CONFIDENTIAL")return"For server-side apps that can securely store a client secret";else return"For browser apps (SPAs) and mobile apps that cannot securely store a secret"})())]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Redirect URIs (one per line)")])),sR(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full h-20"),q1("http://localhost:3000/callback"),o0(Z.new_client_redirect_uris),K1((J)=>{return new NM(J)})]),"")])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Scope")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),q1("atproto transition:generic"),o0(Z.new_client_scope),K1((J)=>{return new FM(J)})])),C0(Q([H("text-xs text-zinc-500 mt-1")]),Q([x("Space-separated OAuth scopes")]))])),j(Q([H("flex gap-2")]),Q([J8(!1,new HM,"Create"),E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new WJ)]),Q([x("Cancel")]))]))]))]))}function v_(Z,J){return j(Q([H("bg-zinc-900 rounded p-4 border border-amber-700")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Edit Client")])),j(Q([H("space-y-3")]),Q([j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client ID")])),v8(Q([H("text-sm text-zinc-500 font-mono")]),Q([x(Z.client_id)]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Client Name")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),o0(J.edit_client_name),K1((K)=>{return new OM(K)})]))])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Redirect URIs (one per line)")])),sR(Q([H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full h-20"),K1((K)=>{return new TM(K)})]),J.edit_client_redirect_uris)])),j(Q([]),Q([r0(Q([H("block text-sm text-zinc-400 mb-1")]),Q([x("Scope")])),z1(Q([M0("text"),H("font-mono px-3 py-2 text-sm text-zinc-300 bg-zinc-800 border border-zinc-700 rounded w-full"),o0(J.edit_client_scope),K1((K)=>{return new PM(K)})]))])),j(Q([H("flex gap-2")]),Q([J8(!1,new SM,"Save"),E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new BM)]),Q([x("Cancel")]))]))]))]))}function g_(Z,J){let K=O0(J.editing_client_id,new L(Z.client_id)),X=W4(J.visible_secrets,Z.client_id);if(K)return v_(Z,J);else return j(Q([H("bg-zinc-900 rounded p-4 border border-zinc-700")]),Q([j(Q([H("flex justify-between items-start mb-2")]),Q([j(Q([]),Q([n(Q([H("text-zinc-300 font-medium")]),Q([x(Z.client_name)]))])),j(Q([H("flex gap-2")]),Q([E0(Q([H("text-sm text-zinc-400 hover:text-zinc-300 cursor-pointer"),k0(new DM(Z.client_id))]),Q([x("Edit")])),E0(Q([H("text-sm text-red-400 hover:text-red-300 cursor-pointer"),k0(new qM(Z.client_id))]),Q([x("Delete")]))]))])),j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Client ID: ")])),v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Z.client_id)]))])),j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Type: ")])),n(Q([H("text-xs text-zinc-400")]),Q([x((()=>{let W=Z.client_type;if(W==="PUBLIC")return"Public";else if(W==="CONFIDENTIAL")return"Confidential";else return Z.client_type})())]))])),(()=>{let W=Z.client_secret;if(W instanceof L){let Y=W[0];return j(Q([H("mb-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Secret: ")])),(()=>{if(X)return v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Y)]));else return v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x("••••••••••••••••")]))})(),E0(Q([H("ml-2 text-xs text-zinc-500 hover:text-zinc-400 cursor-pointer"),k0(new AM(Z.client_id))]),Q([x((()=>{if(X)return"Hide";else return"Show"})())]))]))}else return G0()})(),(()=>{let W=Z.redirect_uris;if(W instanceof M)return G0();else{let Y=W;return j(Q([]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Redirect URIs:")])),sJ(Q([H("text-xs text-zinc-400 font-mono ml-4")]),H0(Y,(V)=>{return y5(Q([]),Q([x(V)]))}))]))}})(),(()=>{let W=Z.scope;if(W instanceof L){let Y=W[0];return j(Q([H("mt-2")]),Q([n(Q([H("text-xs text-zinc-500")]),Q([x("Scope: ")])),v8(Q([H("text-xs text-zinc-400 font-mono")]),Q([x(Y)]))]))}else return G0()})()]))}function $_(Z){return j(Q([H("fixed inset-0 bg-black/50 flex items-center justify-center z-50")]),Q([j(Q([H("bg-zinc-800 rounded p-6 max-w-md")]),Q([B4(Q([H("text-lg font-semibold text-zinc-300 mb-3")]),Q([x("Delete Client?")])),C0(Q([H("text-sm text-zinc-400 mb-4")]),Q([x("Are you sure you want to delete client "),v8(Q([H("text-zinc-300")]),Q([x(Z)])),x("? This action cannot be undone.")])),j(Q([H("flex gap-2 justify-end")]),Q([E0(Q([H("font-mono px-4 py-2 text-sm text-zinc-400 hover:text-zinc-300 rounded transition-colors cursor-pointer"),k0(new EM)]),Q([x("Cancel")])),E0(Q([H("font-mono px-4 py-2 text-sm text-red-400 border border-red-900 hover:bg-red-900/30 rounded transition-colors cursor-pointer"),k0(new CM)]),Q([x("Delete")]))]))]))]))}function __(Z,J){let K=b(Q([])),X=a(Z,"GetOAuthClients",K,c8),W;return W=X[1],j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("OAuth Clients")])),(()=>{let Y=J.oauth_alert;if(Y instanceof L){let V=Y[0][0],G=Y[0][1],I;if(V==="success")I=new V8;else if(V==="error")I=new m1;else I=new u1;return A8(I,G)}else return G0()})(),(()=>{if(J.show_new_client_form)return h_(J);else return j(Q([H("mb-4")]),Q([J8(!1,new WJ,"Register New Client")]))})(),(()=>{if(W instanceof j1)return j(Q([H("py-4 text-center text-zinc-600 text-sm")]),Q([x("Loading clients...")]));else if(W instanceof L1){let Y=W[0];return j(Q([H("py-4 text-center text-red-400 text-sm")]),Q([x("Error: "+Y)]))}else{let Y=W[0];return j(Q([H("space-y-3")]),H0(Y.oauth_clients,(V)=>{return g_(V,J)}))}})(),(()=>{let Y=J.delete_confirm_client_id;if(Y instanceof L){let V=Y[0];return $_(V)}else return G0()})()]))}function m_(Z,J){return j(Q([H("bg-zinc-800/50 rounded p-6")]),Q([D4(Q([H("text-xl font-semibold text-zinc-300 mb-4")]),Q([x("Admin Management")])),(()=>{let K=J.admin_alert;if(K instanceof L){let X=K[0][0],W=K[0][1],Y;if(X==="success")Y=new V8;else if(X==="error")Y=new m1;else Y=new u1;return A8(Y,W)}else return G0()})(),j(Q([H("mb-6")]),Q([B4(Q([H("text-sm font-medium text-zinc-400 mb-2")]),Q([x("Current Admins")])),sJ(Q([H("space-y-2")]),H0(Z.admin_dids,(K)=>{return y5(Q([H("flex items-center justify-between bg-zinc-900/50 px-3 py-2 rounded border border-zinc-800")]),Q([n(Q([H("font-mono text-sm text-zinc-300 truncate")]),Q([x(K)])),(()=>{let X=J.remove_confirm_did;if(X instanceof L)if(X[0]===K)return j(Q([H("flex gap-2")]),Q([E0(Q([H("text-xs px-2 py-1 text-zinc-400 hover:text-zinc-300 cursor-pointer"),k0(new UM)]),Q([x("Cancel")])),E0(Q([H("text-xs px-2 py-1 text-red-400 hover:bg-red-900/30 rounded cursor-pointer"),k0(new Wh)]),Q([x("Confirm Remove")]))]));else return E0(Q([H("text-xs px-2 py-1 text-zinc-500 hover:text-red-400 transition-colors cursor-pointer"),k0(new XJ(K))]),Q([x("Remove")]));else return E0(Q([H("text-xs px-2 py-1 text-zinc-500 hover:text-red-400 transition-colors cursor-pointer"),k0(new XJ(K))]),Q([x("Remove")]))})()]))}))])),j(Q([H("border-t border-zinc-800 pt-4")]),Q([B4(Q([H("text-sm font-medium text-zinc-400 mb-2")]),Q([x("Add Admin")])),j(Q([H("flex gap-2")]),Q([z1(Q([M0("text"),H("flex-1 font-mono px-4 py-2 text-sm text-zinc-300 bg-zinc-900 border border-zinc-800 rounded focus:outline-none focus:border-zinc-700"),q1("did:plc:... or did:web:..."),o0(J.new_admin_did),K1((K)=>{return new xM(K)})])),J8(J.new_admin_did==="",new wM,"Add Admin")])),C0(Q([H("text-xs text-zinc-500 mt-2")]),Q([x("Enter the DID of the user you want to make an admin.")]))]))]))}function Gh(Z,J,K){if(K){let X=b(Q([])),W=a(Z,"GetSettings",X,O1),Y;Y=W[1];let V=y_(Z);return j(Q([H("max-w-2xl space-y-6")]),Q([$1(Q([H("text-2xl font-semibold text-zinc-300 mb-8")]),Q([x("Settings")])),(()=>{if(Y instanceof j1)return j(Q([H("py-8 text-center text-zinc-600 text-sm")]),Q([x("Loading settings...")]));else if(Y instanceof L1){let G=Y[0];return j(Q([H("py-8 text-center text-red-400 text-sm")]),Q([x("Error: "+G)]))}else{let G=Y[0];return j(Q([H("space-y-6")]),Q([f_(G.settings,J,V),k_(J),__(Z,J),m_(G.settings,J),b_(J)]))}})()]))}else return j(Q([H("max-w-2xl space-y-6")]),Q([$1(Q([H("text-2xl font-semibold text-zinc-300 mb-8")]),Q([x("Settings")])),j(Q([H("bg-zinc-800/50 rounded p-8 text-center border border-zinc-700")]),Q([C0(Q([H("text-zinc-400 mb-4")]),Q([x("Access Denied")])),C0(Q([H("text-sm text-zinc-500")]),Q([x("You must be an administrator to access the settings page.")]))]))]))}function Ih(){return window.location.origin}function GJ(Z,J){window.setTimeout(()=>J(),Z)}var d_="src/quickslice_client.gleam";class s5 extends O{}class O5 extends O{}class FJ extends O{}class zL extends O{}class zJ extends O{}class i5 extends O{}class x8 extends O{}class zh extends O{constructor(Z,J,K){super();this.did=Z,this.handle=J,this.is_admin=K}}class s extends O{constructor(Z,J,K,X,W,Y,V,G,I,z,N){super();this.cache=Z,this.registry=J,this.route=K,this.time_range=X,this.settings_page_model=W,this.backfill_page_model=Y,this.backfill_status=V,this.auth_state=G,this.mobile_menu_open=I,this.login_autocomplete=z,this.oauth_error=N}}class d0 extends O{constructor(Z,J,K){super();this[0]=Z,this[1]=J,this[2]=K}}class MM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class RM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class jM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class LM extends O{constructor(Z,J){super();this[0]=Z,this[1]=J}}class NL extends O{constructor(Z){super();this[0]=Z}}class FL extends O{constructor(Z){super();this[0]=Z}}class HL extends O{constructor(Z){super();this[0]=Z}}class yM extends O{constructor(Z){super();this[0]=Z}}class DL extends O{constructor(Z){super();this[0]=Z}}class VL extends O{constructor(Z){super();this[0]=Z}}class IJ extends O{}class BL extends O{}class NJ extends O{constructor(Z){super();this[0]=Z}}class fM extends O{constructor(Z){super();this[0]=Z}}class kM extends O{constructor(Z){super();this[0]=Z}}class bM extends O{}class hM extends O{}class GL extends O{constructor(Z){super();this[0]=Z}}class IL extends O{}function B5(Z){let J=l1(Z,f0);if(J instanceof E){let K=J[0],X=g("errors",U0(g("message",u,(Y)=>{return l(Y)})),(Y)=>{return l(Y)}),W=z0(K,X);if(W instanceof E){let Y=W[0];if(Y instanceof M)return new h;else{let V=Y.head;return new L(V)}}else return new h}else return new h}function c_(Z){let J=Z.query;if(J instanceof L){let K=J[0],X,W=UJ(K);X=F8(W,Q([]));let Y=X,V=AZ(Y,"error");if(V instanceof E){let G=V[0];if(G==="access_denied")return new L("Login was cancelled");else{let I=G,z,N=AZ(Y,"error_description"),F=F8(N,I),D=NR(F);return z=F8(D,I),new L("Login failed: "+z)}}else return new h}else return J}function p_(Z,J){if(J instanceof d0){let K=J[2];if(K instanceof E){let X=J[0],W=J[1],Y=K[0],V=dk(Z.cache,X,W,Y,0),G=u0(V,Z.registry,(m,y,_)=>{return new d0(m,y,_)},()=>{return 0}),I,z;I=G[0],z=G[1];let N;if(X==="IsBackfilling"){let m=cZ(Y);if(m instanceof E){let y=m[0],_=Z.backfill_status;if(y.is_backfilling&&_ instanceof HK)N=new T8;else N=ik(Z.backfill_status,y.is_backfilling)}else N=Z.backfill_status}else N=Z.backfill_status;let F=N,D,B=_5(Z.backfill_status),T=_5(F);if(B)if(T&&X==="IsBackfilling")D=Q([I1((m)=>{return GJ(1e4,()=>{return m(new IJ)})})]);else D=Q([]);else if(T&&X==="IsBackfilling")D=Q([I1((m)=>{return GJ(1e4,()=>{return m(new IJ)})})]);else D=Q([]);let P=D,S,q=Z.backfill_status;if(q instanceof u8&&F instanceof $5)S=!0;else if(q instanceof T8&&F instanceof $5)S=!0;else S=!1;let C=S,U;if(X==="GetCurrentSession"){let m=lj(Y);if(m instanceof E){let _=m[0].current_session;if(_ instanceof L){let t=_[0];U=new zh(t.did,t.handle,t.is_admin)}else U=new x8}else U=new x8}else U=Z.auth_state;let k=U,w;if(X==="UpdateSettings")w=QJ(Z.settings_page_model,"success","Settings updated successfully");else if(X==="UploadLexicons"){ij("lexicon-file-input");let m=B5(Y);if(m instanceof L){let y=m[0];w=VJ(Z.settings_page_model,"error",y)}else w=VJ(Z.settings_page_model,"success","Lexicons uploaded successfully")}else if(X==="ResetAll"){let m,y=Z.settings_page_model;m=new K0("",y.reset_confirmation,y.selected_file,y.alert,y.relay_url_input,y.plc_directory_url_input,y.jetstream_url_input,y.oauth_supported_scopes_input,y.lexicons_alert,y.show_new_client_form,y.new_client_name,y.new_client_type,y.new_client_redirect_uris,y.new_client_scope,y.editing_client_id,y.edit_client_name,y.edit_client_redirect_uris,y.edit_client_scope,y.visible_secrets,y.delete_confirm_client_id,y.oauth_alert,y.new_admin_did,y.remove_confirm_did,y.admin_alert,y.danger_zone_alert),w=QL(m,"success","All data has been reset")}else if(X==="GetSettings"){let m=O1(Y);if(m instanceof E){let y=m[0],_=Z.settings_page_model;w=new K0(y.settings.domain_authority,_.reset_confirmation,_.selected_file,_.alert,y.settings.relay_url,y.settings.plc_directory_url,y.settings.jetstream_url,y.settings.oauth_supported_scopes,_.lexicons_alert,_.show_new_client_form,_.new_client_name,_.new_client_type,_.new_client_redirect_uris,_.new_client_scope,_.editing_client_id,_.edit_client_name,_.edit_client_redirect_uris,_.edit_client_scope,_.visible_secrets,_.delete_confirm_client_id,_.oauth_alert,_.new_admin_did,_.remove_confirm_did,_.admin_alert,_.danger_zone_alert)}else w=Z.settings_page_model}else if(X==="CreateOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="UpdateOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="DeleteOAuthClient"){let m=B5(Y);if(m instanceof L){let y=m[0];w=C8(Z.settings_page_model,"error",y)}else{let y;if(X==="CreateOAuthClient")y="OAuth client created successfully";else if(X==="UpdateOAuthClient")y="OAuth client updated successfully";else if(X==="DeleteOAuthClient")y="OAuth client deleted successfully";else y="Operation completed";let _=y;w=C8(Z.settings_page_model,"success",_)}}else if(X==="AddAdmin"){let m=B5(Y);if(m instanceof L){let y=m[0];w=n5(Z.settings_page_model,"error",y)}else{let y;if(X==="AddAdmin")y="Admin added successfully";else if(X==="RemoveAdmin")y="Admin removed successfully";else y="Operation completed";let _=y;w=n5(Z.settings_page_model,"success",_)}}else if(X==="RemoveAdmin"){let m=B5(Y);if(m instanceof L){let y=m[0];w=n5(Z.settings_page_model,"error",y)}else{let y;if(X==="AddAdmin")y="Admin added successfully";else if(X==="RemoveAdmin")y="Admin removed successfully";else y="Operation completed";let _=y;w=n5(Z.settings_page_model,"success",_)}}else w=Z.settings_page_model;let f=w,$;if(X==="BackfillActor"){let m=Z.backfill_page_model,y=rU(m,!1),_=oj(y,"success","Backfill started for "+Z.backfill_page_model.did_input);$=((t)=>{return new D5("",t.is_submitting,t.alert)})(_)}else $=Z.backfill_page_model;let d=$,p;if(X==="ResetAll"){let m=m0(I,"GetStatistics",b(Q([]))),y=m0(m,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]]))),_=m0(y,"GetRecentActivity",b(Q([["hours",X1(24)]]))),t=a(_,"GetSettings",b(Q([])),O1),o;o=t[0];let Y0=u0(o,Z.registry,(y0,F1,T1)=>{return new d0(y0,F1,T1)},()=>{return 0}),w0,x0;w0=Y0[0],x0=Y0[1],p=[w0,x0]}else if(X==="UploadLexicons")p=[m0(I,"GetStatistics",b(Q([]))),Q([])];else if(X==="CreateOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,x0,y0)=>{return new d0(w0,x0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else if(X==="UpdateOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,x0,y0)=>{return new d0(w0,x0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else if(X==="DeleteOAuthClient"){let m=m0(I,"GetOAuthClients",b(Q([]))),y=a(m,"GetOAuthClients",b(Q([])),c8),_;_=y[0];let t=u0(_,Z.registry,(w0,x0,y0)=>{return new d0(w0,x0,y0)},()=>{return 0}),o,Y0;o=t[0],Y0=t[1],p=[o,Y0]}else p=[I,Q([])];let r=p,X0,B0;X0=r[0],B0=r[1];let L0;if(C){let m=m0(X0,"GetStatistics",b(Q([]))),y=m0(m,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]]))),_=m0(y,"GetRecentActivity",b(Q([["hours",X1(24)]]))),t=a(_,"GetStatistics",b(Q([])),H5),o;o=t[0];let Y0=a(o,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]])),p5),w0;w0=Y0[0];let x0=a(w0,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),y0;y0=x0[0];let F1=u0(y0,Z.registry,(w1,G8,w8)=>{return new d0(w1,G8,w8)},()=>{return 0}),T1,P1;T1=F1[0],P1=F1[1],L0=[T1,P1]}else L0=[X0,Q([])];let I0=L0,D0,W0;D0=I0[0],W0=I0[1];let J0;if(X==="GetCurrentSession"){let m=Z.route;if(k instanceof x8)if(m instanceof O5)J0=Q([v5("/",new h,new h)]);else J0=Q([]);else if(!k.is_admin&&m instanceof O5)J0=Q([v5("/",new h,new h)]);else J0=Q([])}else if(X==="GetSettings"){let m=O1(Y);if(m instanceof E){let y=m[0],_=hL(y.settings.admin_dids),t=Z.route;if(_)if(t instanceof i5)J0=Q([]);else J0=Q([v5("/onboarding",new h,new h)]);else if(t instanceof i5)J0=Q([v5("/",new h,new h)]);else J0=Q([])}else J0=Q([])}else J0=Q([]);let Z0=J0;return[new s(D0,Z.registry,Z.route,Z.time_range,f,d,F,k,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1((()=>{let m=Q([z,B0,W0,Z0,P]);return gL(m)})())]}else{let X=J[0],W=K[0],Y;if(X==="UpdateSettings")Y=QJ(Z.settings_page_model,"error","Error: "+W);else if(X==="TriggerBackfill")Y=QJ(Z.settings_page_model,"error","Error: "+W);else if(X==="ResetAll")Y=QL(Z.settings_page_model,"error","Error: "+W);else if(X==="UploadLexicons")Y=VJ(Z.settings_page_model,"error","Error: "+W);else if(X==="CreateOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else if(X==="UpdateOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else if(X==="DeleteOAuthClient")Y=C8(Z.settings_page_model,"error","Error: "+W);else Y=Z.settings_page_model;let V=Y,G;if(X==="BackfillActor"){let z=Z.backfill_page_model,N=rU(z,!1);G=oj(N,"error","Error: "+W)}else G=Z.backfill_page_model;let I=G;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}}else if(J instanceof MM){let K=J[0],X=J[1],W=vj(Z.cache,K,X),Y=QJ(Z.settings_page_model,"success","Settings updated successfully");return[new s(W,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof RM){let K=J[0],X=J[1],W=bj(Z.cache,K),Y,G=a(W,"GetSettings",b(Q([])),O1)[1];if(G instanceof Z8)Y=G[0].settings.domain_authority;else Y=Z.settings_page_model.domain_authority_input;let I=Y,z,N=E5(X,"Response body: ");if(N instanceof E){let P=N[0][1],S=B5(P);if(S instanceof L)z=S[0];else z=X}else z=X;let F=z,D,B=Z.settings_page_model;D=new K0(I,B.reset_confirmation,B.selected_file,new L(["error",F]),B.relay_url_input,B.plc_directory_url_input,B.jetstream_url_input,B.oauth_supported_scopes_input,B.lexicons_alert,B.show_new_client_form,B.new_client_name,B.new_client_type,B.new_client_redirect_uris,B.new_client_scope,B.editing_client_id,B.edit_client_name,B.edit_client_redirect_uris,B.edit_client_scope,B.visible_secrets,B.delete_confirm_client_id,B.oauth_alert,B.new_admin_did,B.remove_confirm_did,B.admin_alert,B.danger_zone_alert);let T=D;return[new s(W,Z.registry,Z.route,Z.time_range,T,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof jM){let K=J[0],X=J[1],W=vj(Z.cache,K,X),Y=n5(Z.settings_page_model,"success","Admin updated successfully");return[new s(W,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof LM){let K=J[0],X=J[1],W=bj(Z.cache,K),Y,V=E5(X,"Response body: ");if(V instanceof E){let z=V[0][1],N=B5(z);if(N instanceof L)Y=N[0];else Y=X}else Y=X;let G=Y,I=n5(Z.settings_page_model,"error",G);return[new s(W,Z.registry,Z.route,Z.time_range,I,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof NL){let K=J[0],X;if(Z.route instanceof O5)X=Qh(Z.settings_page_model);else X=Z.settings_page_model;let Y=X;if(K instanceof s5){let V=a(Z.cache,"GetStatistics",b(Q([])),H5),G;G=V[0];let I=a(G,"GetSettings",b(Q([])),O1),z;z=I[0];let N=a(z,"GetActivityBuckets",b(Q([["range",c(F5(Z.time_range))]])),p5),F;F=N[0];let D=a(F,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),B;B=D[0];let T=u0(B,Z.registry,(q,C,U)=>{return new d0(q,C,U)},()=>{return 0}),P,S;return P=T[0],S=T[1],[new s(P,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(S)]}else if(K instanceof O5){let V,G=Z.auth_state;if(G instanceof x8)V=!1;else V=G.is_admin;if(V){let z=a(Z.cache,"GetSettings",b(Q([])),O1),N;N=z[0];let F=a(N,"GetOAuthClients",b(Q([])),c8),D;D=F[0];let B=u0(D,Z.registry,(S,q,C)=>{return new d0(S,q,C)},()=>{return 0}),T,P;return T=B[0],P=B[1],[new s(T,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(P)]}else return[Z,v5("/",new h,new h)]}else if(K instanceof FJ){let V=a(Z.cache,"GetLexicons",b(Q([])),JJ),G;G=V[0];let I=u0(G,Z.registry,(F,D,B)=>{return new d0(F,D,B)},()=>{return 0}),z,N;return z=I[0],N=I[1],[new s(z,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),W1(N)]}else if(K instanceof zJ)if(Z.auth_state instanceof x8)return[Z,v5("/",new h,new h)];else{let G=lU(Z.backfill_page_model);return[new s(Z.cache,Z.registry,new zJ,Z.time_range,Z.settings_page_model,G,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof i5)return[new s(Z.cache,Z.registry,new i5,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()];else return[new s(Z.cache,Z.registry,K,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!1,Z.login_autocomplete,Z.oauth_error),i()]}else if(J instanceof FL){let K=J[0];if(K instanceof tU){let X=K[0],W=b(Q([["range",c(F5(X))]])),Y=a(Z.cache,"GetActivityBuckets",W,p5),V;V=Y[0];let G=u0(V,Z.registry,(N,F,D)=>{return new d0(N,F,D)},()=>{return 0}),I,z;return I=G[0],z=G[1],[new s(I,Z.registry,Z.route,X,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(z)]}else if(K instanceof oU){let X=b(Q([])),W=m0(Z.cache,"TriggerBackfill",X),Y=a(W,"TriggerBackfill",X,gb),V;V=Y[0];let G=u0(V,Z.registry,(F,D,B)=>{return new d0(F,D,B)},()=>{return 0}),I,z;I=G[0],z=G[1];let N=I1((F)=>{return GJ(1e4,()=>{return F(new IJ)})});return[new s(I,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,new u8,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(Q([W1(z),N]))]}else return tj("/graphiql"),[Z,i()]}else if(J instanceof HL){let K=J[0];if(K instanceof eU){let X=K[0],W,Y=Z.settings_page_model;W=new K0(X,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof ZM)return[Z,i()];else if(K instanceof JM){C5("[UploadLexicons] Button clicked, creating file effect");let X=I1((W)=>{return C5("[UploadLexicons] Effect running, calling read_file_as_base64"),nj("lexicon-file-input",(Y)=>{return C5("[UploadLexicons] Callback received result"),W(new VL(Y))})});return[Z,X]}else if(K instanceof KM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,X,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof YM){let X=b(Q([["confirm",c(Z.settings_page_model.reset_confirmation)]])),W=m0(Z.cache,"ResetAll",X),Y=a(W,"ResetAll",X,hb),V;V=Y[0];let G=u0(V,Z.registry,(B,T,P)=>{return new d0(B,T,P)},()=>{return 0}),I,z;I=G[0],z=G[1];let N,F=Z.settings_page_model;N=new K0(F.domain_authority_input,"",F.selected_file,new h,F.relay_url_input,F.plc_directory_url_input,F.jetstream_url_input,F.oauth_supported_scopes_input,F.lexicons_alert,F.show_new_client_form,F.new_client_name,F.new_client_type,F.new_client_redirect_uris,F.new_client_scope,F.editing_client_id,F.edit_client_name,F.edit_client_redirect_uris,F.edit_client_scope,F.visible_secrets,F.delete_confirm_client_id,F.oauth_alert,F.new_admin_did,F.remove_confirm_did,F.admin_alert,F.danger_zone_alert);let D=N;return[new s(I,Z.registry,Z.route,Z.time_range,D,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(z)]}else if(K instanceof XM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,X,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof WM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,X,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof QM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,X,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof VM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,new h,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,X,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof GM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,new h,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X,V=b(Q([])),G=a(Z.cache,"GetSettings",V,O1),I;if(I=G[1],I instanceof Z8){let N=I[0].settings.admin_dids,F=Q([]),D,B=Z.settings_page_model.domain_authority_input;if(B==="")D=F;else D=A(["domainAuthority",c(B)],F);let T=D,P,S=Z.settings_page_model.relay_url_input;if(S==="")P=T;else P=A(["relayUrl",c(S)],T);let q=P,C,U=Z.settings_page_model.plc_directory_url_input;if(U==="")C=q;else C=A(["plcDirectoryUrl",c(U)],q);let k=C,w,f=Z.settings_page_model.jetstream_url_input;if(f==="")w=k;else w=A(["jetstreamUrl",c(f)],k);let $=w,d,p=Z.settings_page_model.oauth_supported_scopes_input;if(p==="")d=$;else d=A(["oauthSupportedScopes",c(p)],$);let r=d,X0=A(["adminDids",j0(N,c)],r);if(X0 instanceof M){let B0=b(X0),L0=Q([["id",c("Settings:singleton")]]),I0,D0=Z.settings_page_model.domain_authority_input;if(D0==="")I0=L0;else I0=A(["domainAuthority",c(D0)],L0);let W0=I0,J0,Z0=Z.settings_page_model.relay_url_input;if(Z0==="")J0=W0;else J0=A(["relayUrl",c(Z0)],W0);let m=J0,y,_=Z.settings_page_model.plc_directory_url_input;if(_==="")y=m;else y=A(["plcDirectoryUrl",c(_)],m);let t=y,o,Y0=Z.settings_page_model.jetstream_url_input;if(Y0==="")o=t;else o=A(["jetstreamUrl",c(Y0)],t);let w0=o,x0,y0=Z.settings_page_model.oauth_supported_scopes_input;if(y0==="")x0=w0;else x0=A(["oauthSupportedScopes",c(y0)],w0);let F1=x0,T1=A(["adminDids",j0(N,c)],F1),P1=b(T1),w1=dZ(Z.cache,Z.registry,"UpdateSettings",B0,"Settings:singleton",(d1)=>{return P1},KJ,(d1,c1,HJ)=>{if(c1 instanceof E)return new MM(d1,HJ);else{let vM=c1[0];return new RM(d1,vM)}}),G8,w8;return G8=w1[0],w8=w1[2],[new s(G8,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),w8]}else if(X0.tail instanceof M)return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()];else{let L0=b(X0),I0=Q([["id",c("Settings:singleton")]]),D0,W0=Z.settings_page_model.domain_authority_input;if(W0==="")D0=I0;else D0=A(["domainAuthority",c(W0)],I0);let J0=D0,Z0,m=Z.settings_page_model.relay_url_input;if(m==="")Z0=J0;else Z0=A(["relayUrl",c(m)],J0);let y=Z0,_,t=Z.settings_page_model.plc_directory_url_input;if(t==="")_=y;else _=A(["plcDirectoryUrl",c(t)],y);let o=_,Y0,w0=Z.settings_page_model.jetstream_url_input;if(w0==="")Y0=o;else Y0=A(["jetstreamUrl",c(w0)],o);let x0=Y0,y0,F1=Z.settings_page_model.oauth_supported_scopes_input;if(F1==="")y0=x0;else y0=A(["oauthSupportedScopes",c(F1)],x0);let T1=y0,P1=A(["adminDids",j0(N,c)],T1),w1=b(P1),G8=dZ(Z.cache,Z.registry,"UpdateSettings",L0,"Settings:singleton",(c1)=>{return w1},KJ,(c1,HJ,vM)=>{if(HJ instanceof E)return new MM(c1,vM);else{let Hh=HJ[0];return new RM(c1,Hh)}}),w8,d1;return w8=G8[0],d1=G8[2],[new s(w8,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),d1]}}else return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof WJ){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,!Z.settings_page_model.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof IM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,X,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof zM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,X,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof NM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,X,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof FM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,X,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof HM){let X,W=K4(Z.settings_page_model.new_client_redirect_uris,` 152 152 `),Y=PJ(W,(C)=>{return Y8(J4(C))>0});X=H0(Y,J4);let V=X,G=b(Q([["clientName",c(Z.settings_page_model.new_client_name)],["clientType",c(Z.settings_page_model.new_client_type)],["redirectUris",j0(V,c)],["scope",c(Z.settings_page_model.new_client_scope)]])),I=m0(Z.cache,"CreateOAuthClient",G),z=a(I,"CreateOAuthClient",G,Db),N;N=z[0];let F=m0(N,"GetOAuthClients",b(Q([]))),D=u0(F,Z.registry,(C,U,k)=>{return new d0(C,U,k)},()=>{return 0}),B,T;B=D[0],T=D[1];let P,S=Z.settings_page_model;P=new K0(S.domain_authority_input,S.reset_confirmation,S.selected_file,S.alert,S.relay_url_input,S.plc_directory_url_input,S.jetstream_url_input,S.oauth_supported_scopes_input,S.lexicons_alert,!1,"","PUBLIC","","atproto transition:generic",S.editing_client_id,S.edit_client_name,S.edit_client_redirect_uris,S.edit_client_scope,S.visible_secrets,S.delete_confirm_client_id,S.oauth_alert,S.new_admin_did,S.remove_confirm_did,S.admin_alert,S.danger_zone_alert);let q=P;return[new s(B,Z.registry,Z.route,Z.time_range,q,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(T)]}else if(K instanceof DM){let X=K[0],W=a(Z.cache,"GetOAuthClients",b(Q([])),c8),Y;Y=W[1];let V;if(Y instanceof Z8){let I=Y[0],z=JR(I.oauth_clients,(N)=>{return N.client_id===X});if(z instanceof E){let N=z[0],F=Z.settings_page_model;V=new K0(F.domain_authority_input,F.reset_confirmation,F.selected_file,F.alert,F.relay_url_input,F.plc_directory_url_input,F.jetstream_url_input,F.oauth_supported_scopes_input,F.lexicons_alert,F.show_new_client_form,F.new_client_name,F.new_client_type,F.new_client_redirect_uris,F.new_client_scope,new L(X),N.client_name,a8(N.redirect_uris,` 153 153 `),(()=>{let D=N.scope;if(D instanceof L)return D[0];else return""})(),F.visible_secrets,F.delete_confirm_client_id,F.oauth_alert,F.new_admin_did,F.remove_confirm_did,F.admin_alert,F.danger_zone_alert)}else V=Z.settings_page_model}else V=Z.settings_page_model;let G=V;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,G,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof BM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,new h,"","","",W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof OM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,X,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof TM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,X,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof PM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,X,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof SM){let X=Z.settings_page_model.editing_client_id;if(X instanceof L){let W=X[0],Y,V=K4(Z.settings_page_model.edit_client_redirect_uris,` 154 - `),G=PJ(V,(k)=>{return Y8(J4(k))>0});Y=H0(G,J4);let I=Y,z=b(Q([["clientId",c(W)],["clientName",c(Z.settings_page_model.edit_client_name)],["redirectUris",j0(I,c)],["scope",c(Z.settings_page_model.edit_client_scope)]])),N=m0(Z.cache,"UpdateOAuthClient",z),F=a(N,"UpdateOAuthClient",z,mb),D;D=F[0];let B=m0(D,"GetOAuthClients",b(Q([]))),T=u0(B,Z.registry,(k,w,f)=>{return new d0(k,w,f)},()=>{return 0}),P,S;P=T[0],S=T[1];let q,C=Z.settings_page_model;q=new K0(C.domain_authority_input,C.reset_confirmation,C.selected_file,C.alert,C.relay_url_input,C.plc_directory_url_input,C.jetstream_url_input,C.oauth_supported_scopes_input,C.lexicons_alert,C.show_new_client_form,C.new_client_name,C.new_client_type,C.new_client_redirect_uris,C.new_client_scope,new h,"","","",C.visible_secrets,C.delete_confirm_client_id,C.oauth_alert,C.new_admin_did,C.remove_confirm_did,C.admin_alert,C.danger_zone_alert);let U=q;return[new s(P,Z.registry,Z.route,Z.time_range,U,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(S)]}else return[Z,i()]}else if(K instanceof AM){let X=K[0],W;if(W4(Z.settings_page_model.visible_secrets,X))W=Cy(Z.settings_page_model.visible_secrets,X);else W=wZ(Z.settings_page_model.visible_secrets,X);let V=W,G,I=Z.settings_page_model;G=new K0(I.domain_authority_input,I.reset_confirmation,I.selected_file,I.alert,I.relay_url_input,I.plc_directory_url_input,I.jetstream_url_input,I.oauth_supported_scopes_input,I.lexicons_alert,I.show_new_client_form,I.new_client_name,I.new_client_type,I.new_client_redirect_uris,I.new_client_scope,I.editing_client_id,I.edit_client_name,I.edit_client_redirect_uris,I.edit_client_scope,V,I.delete_confirm_client_id,I.oauth_alert,I.new_admin_did,I.remove_confirm_did,I.admin_alert,I.danger_zone_alert);let z=G;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,z,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof qM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,new L(X),Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof EM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,new h,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof CM){let X=Z.settings_page_model.delete_confirm_client_id;if(X instanceof L){let W=X[0],Y=b(Q([["clientId",c(W)]])),V=m0(Z.cache,"DeleteOAuthClient",Y),G=a(V,"DeleteOAuthClient",Y,Ob),I;I=G[0];let z=m0(I,"GetOAuthClients",b(Q([]))),N=u0(z,Z.registry,(S,q,C)=>{return new d0(S,q,C)},()=>{return 0}),F,D;F=N[0],D=N[1];let B,T=Z.settings_page_model;B=new K0(T.domain_authority_input,T.reset_confirmation,T.selected_file,T.alert,T.relay_url_input,T.plc_directory_url_input,T.jetstream_url_input,T.oauth_supported_scopes_input,T.lexicons_alert,T.show_new_client_form,T.new_client_name,T.new_client_type,T.new_client_redirect_uris,T.new_client_scope,T.editing_client_id,T.edit_client_name,T.edit_client_redirect_uris,T.edit_client_scope,T.visible_secrets,new h,T.oauth_alert,T.new_admin_did,T.remove_confirm_did,T.admin_alert,T.danger_zone_alert);let P=B;return[new s(F,Z.registry,Z.route,Z.time_range,P,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(D)]}else return[Z,i()]}else if(K instanceof xM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,X,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof wM){let X=b(Q([])),W=a(Z.cache,"GetSettings",X,O1),Y;if(Y=W[1],Y instanceof Z8){let V=Y[0],G=Z.settings_page_model.new_admin_did,I=V.settings.admin_dids,z=V.settings.domain_authority,N;if(ZR(I,G))N=I;else N=_0(I,Q([G]));let D=N,B=b(Q([["domainAuthority",c(z)],["adminDids",j0(D,c)]])),T=b(Q([["id",c("Settings:singleton")],["domainAuthority",c(z)],["adminDids",j0(D,c)]])),P=dZ(Z.cache,Z.registry,"UpdateSettings",B,"Settings:singleton",(w)=>{return T},KJ,(w,f,$)=>{if(f instanceof E)return new jM(w,$);else{let d=f[0];return new LM(w,d)}}),S,q;S=P[0],q=P[2];let C,U=Z.settings_page_model;C=new K0(U.domain_authority_input,U.reset_confirmation,U.selected_file,U.alert,U.relay_url_input,U.plc_directory_url_input,U.jetstream_url_input,U.oauth_supported_scopes_input,U.lexicons_alert,U.show_new_client_form,U.new_client_name,U.new_client_type,U.new_client_redirect_uris,U.new_client_scope,U.editing_client_id,U.edit_client_name,U.edit_client_redirect_uris,U.edit_client_scope,U.visible_secrets,U.delete_confirm_client_id,U.oauth_alert,"",U.remove_confirm_did,U.admin_alert,U.danger_zone_alert);let k=C;return[new s(S,Z.registry,Z.route,Z.time_range,k,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),q]}else return[Z,i()]}else if(K instanceof XJ){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,new L(X),Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof UM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,new h,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else{let X=Z.settings_page_model.remove_confirm_did;if(X instanceof L){let W=X[0],Y=b(Q([])),V=a(Z.cache,"GetSettings",Y,O1),G;if(G=V[1],G instanceof Z8){let I=G[0],z=I.settings.admin_dids,N=I.settings.domain_authority,F=PJ(z,(k)=>{return k!==W}),D=b(Q([["domainAuthority",c(N)],["adminDids",j0(F,c)]])),B=b(Q([["id",c("Settings:singleton")],["domainAuthority",c(N)],["adminDids",j0(F,c)]])),T=dZ(Z.cache,Z.registry,"UpdateSettings",D,"Settings:singleton",(k)=>{return B},KJ,(k,w,f)=>{if(w instanceof E)return new jM(k,f);else{let $=w[0];return new LM(k,$)}}),P,S;P=T[0],S=T[2];let q,C=Z.settings_page_model;q=new K0(C.domain_authority_input,C.reset_confirmation,C.selected_file,C.alert,C.relay_url_input,C.plc_directory_url_input,C.jetstream_url_input,C.oauth_supported_scopes_input,C.lexicons_alert,C.show_new_client_form,C.new_client_name,C.new_client_type,C.new_client_redirect_uris,C.new_client_scope,C.editing_client_id,C.edit_client_name,C.edit_client_redirect_uris,C.edit_client_scope,C.visible_secrets,C.delete_confirm_client_id,C.oauth_alert,C.new_admin_did,new h,C.admin_alert,C.danger_zone_alert);let U=q;return[new s(P,Z.registry,Z.route,Z.time_range,U,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),S]}else return[Z,i()]}else return[Z,i()]}}else if(J instanceof yM){let K=J[0],X=Kh(K);return[Z,yR(X,(W)=>{return new yM(W)})]}else if(J instanceof DL){let K=J[0];if(K instanceof sU){let X=K[0],W,Y,V=Z.backfill_page_model;Y=new D5(X,V.is_submitting,V.alert),W=lU(Y);let I=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else{let X=Z.backfill_page_model.did_input,W=b(Q([["did",c(X)]])),Y,V=Z.backfill_page_model,G=rU(V,!0);Y=lU(G);let I=Y,z=m0(Z.cache,"BackfillActor",W),N=a(z,"BackfillActor",W,Nb),F;F=N[0];let D=u0(F,Z.registry,(P,S,q)=>{return new d0(P,S,q)},()=>{return 0}),B,T;return B=D[0],T=D[1],[new s(B,Z.registry,Z.route,Z.time_range,Z.settings_page_model,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(T)]}}else if(J instanceof VL){let K=J[0];if(K instanceof E){let X=K[0];C5("[FileRead] Successfully read file, uploading...");let W=b(Q([["zipBase64",c(X)]])),Y=m0(Z.cache,"UploadLexicons",W),V=a(Y,"UploadLexicons",W,pb),G;G=V[0];let I=u0(G,Z.registry,(T,P,S)=>{return new d0(T,P,S)},()=>{return 0}),z,N;z=I[0],N=I[1];let F,D=Z.settings_page_model;F=new K0(D.domain_authority_input,D.reset_confirmation,new h,D.alert,D.relay_url_input,D.plc_directory_url_input,D.jetstream_url_input,D.oauth_supported_scopes_input,D.lexicons_alert,D.show_new_client_form,D.new_client_name,D.new_client_type,D.new_client_redirect_uris,D.new_client_scope,D.editing_client_id,D.edit_client_name,D.edit_client_redirect_uris,D.edit_client_scope,D.visible_secrets,D.delete_confirm_client_id,D.oauth_alert,D.new_admin_did,D.remove_confirm_did,D.admin_alert,D.danger_zone_alert);let B=F;return[new s(z,Z.registry,Z.route,Z.time_range,B,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(N)]}else{let X=K[0];C5("[FileRead] Error reading file: "+X);let W=VJ(Z.settings_page_model,"error",X);return[new s(Z.cache,Z.registry,Z.route,Z.time_range,W,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}}else if(J instanceof IJ)if(_5(Z.backfill_status)){let X=nk(Z.cache,Z.registry,(V,G,I)=>{return new d0(V,G,I)}),W,Y;return W=X[0],Y=X[1],[new s(W,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(Y)]}else return[Z,i()];else if(J instanceof BL)return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()];else if(J instanceof NJ){let K=J[0],X=S8(Z.login_autocomplete,new DK(K)),W,Y;return W=X[0],Y=X[1],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),yR(Y,(V)=>{if(V instanceof A4){let G=V[0];return new GL(G)}else return new NJ("")})]}else if(J instanceof fM){let K=J[0];if(K==="ArrowDown"){let X=S8(Z.login_autocomplete,new BK),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(K==="ArrowUp"){let X=S8(Z.login_autocomplete,new OK),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(K==="Enter"){let X=ek(Z.login_autocomplete);if(X instanceof L){let W=X[0],Y=S8(Z.login_autocomplete,new nZ(W)),V;return V=Y[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,V,Z.oauth_error),i()]}else return[Z,i()]}else if(K==="Escape"){let X=S8(Z.login_autocomplete,new iZ),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else return[Z,i()]}else if(J instanceof kM){let K=J[0],X,W=JR(Z.login_autocomplete.actors,(I)=>{return I.handle===K});if(W instanceof E)X=W[0];else X=new pZ("",K,"",new h);let Y=X,V=S8(Z.login_autocomplete,new nZ(Y)),G;return G=V[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,G,Z.oauth_error),i()]}else if(J instanceof bM){let K=I1((X)=>{return GJ(150,()=>{return X(new IL)})});return[Z,K]}else if(J instanceof hM){let K=S8(Z.login_autocomplete,new gj),X;return X=K[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,X,Z.oauth_error),i()]}else if(J instanceof GL){let K=J[0],X=S8(Z.login_autocomplete,new A4(K)),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(J instanceof IL){let K=S8(Z.login_autocomplete,new iZ),X;return X=K[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,X,Z.oauth_error),i()]}else return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,new h),i()]}function n_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=[!1,!1];else J=[K.is_admin,!0];let X=J,W,Y;return W=X[0],Y=X[1],hZ(ob(Z.cache,Z.time_range,Z.backfill_status,W,Y),(V)=>{return new FL(V)})}function i_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=!1;else J=K.is_admin;let X=J;return hZ(Gh(Z.cache,Z.settings_page_model,X),(W)=>{return new HL(W)})}function s_(Z){return hZ(Yh(Z.cache),(J)=>{return new yM(J)})}function l_(Z){return j(Q([]),Q([$1(Q([H("text-xl font-bold text-zinc-100 mb-4")]),Q([l0("Upload")])),x0(Q([H("text-zinc-400")]),Q([l0("Upload and manage data")]))]))}function r_(Z){return hZ(lb(Z.backfill_page_model),(J)=>{return new DL(J)})}function a_(Z){return Xh(Z.login_autocomplete,(J)=>{return new NJ(J)},(J)=>{return new kM(J)},(J)=>{return new fM(J)},()=>{return new bM},()=>{return new hM})}function t_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=new h;else{let{handle:W,is_admin:Y}=K;J=new L([W,Y])}let X=J;return j(Q([H("bg-zinc-950 text-zinc-300 font-mono min-h-screen")]),Q([j(Q([H("max-w-4xl mx-auto px-4 py-6 sm:px-6 sm:py-12")]),Q([(()=>{if(Z.route instanceof i5)return G0();else return Gb(X,_5(Z.backfill_status),Z.mobile_menu_open,new BL,Z.login_autocomplete,(Y)=>{return new NJ(Y)},(Y)=>{return new kM(Y)},(Y)=>{return new fM(Y)},()=>{return new bM},()=>{return new hM})})(),(()=>{let W=Z.oauth_error;if(W instanceof L){let Y=W[0];return A8(new m1,Y)}else return G0()})(),(()=>{let W=Z.route;if(W instanceof s5)return n_(Z);else if(W instanceof O5)return i_(Z);else if(W instanceof FJ)return s_(Z);else if(W instanceof zL)return l_(Z);else if(W instanceof zJ)return r_(Z);else return a_(Z)})()]))]))}function Nh(Z){let J=Z.path;if(J==="/")return new s5;else if(J==="/settings")return new O5;else if(J==="/lexicons")return new FJ;else if(J==="/upload")return new zL;else if(J==="/backfill")return new zJ;else if(J==="/onboarding")return new i5;else return new s5}function o_(Z){return new NL(Nh(Z))}function e_(Z){let J=Ih()+"/admin/graphql",K=_k(J),X=Ib(),W,Y=Sj();if(Y instanceof E){let U=Y[0];W=[Nh(U),c_(U)]}else W=[new s5,new h];let V=W,G,I;G=V[0],I=V[1];let z=a(K,"GetCurrentSession",b(Q([])),lj),N;N=z[0];let F=a(N,"IsBackfilling",b(Q([])),cZ),D;D=F[0];let B;if(G instanceof s5){let U=a(D,"GetStatistics",b(Q([])),H5),k;k=U[0];let w=a(k,"GetSettings",b(Q([])),O1),f;f=w[0];let $=a(f,"GetActivityBuckets",b(Q([["range",c("ONE_DAY")]])),p5),d;d=$[0];let p=a(d,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),r;r=p[0];let X0=u0(r,X,(I0,D0,W0)=>{return new d0(I0,D0,W0)},()=>{return 0}),B0,L0;B0=X0[0],L0=X0[1],B=[B0,L0]}else if(G instanceof O5){let U=a(D,"GetSettings",b(Q([])),O1),k;k=U[0];let w=a(k,"GetOAuthClients",b(Q([])),c8),f;f=w[0];let $=u0(f,X,(r,X0,B0)=>{return new d0(r,X0,B0)},()=>{return 0}),d,p;d=$[0],p=$[1],B=[d,p]}else if(G instanceof FJ){let U=a(D,"GetLexicons",b(Q([])),JJ),k;k=U[0];let w=u0(k,X,(d,p,r)=>{return new d0(d,p,r)},()=>{return 0}),f,$;f=w[0],$=w[1],B=[f,$]}else B=[D,Q([])];let T=B,P,S;P=T[0],S=T[1];let q=Hk(o_),C=W1(A(q,S));return[new s(P,X,G,new c5,Vh(),sb(),new HK,new x8,!1,ok(),I),C]}function Fh(){let Z=Yk(e_,p_,t_),J=Xk(Z,"#app",void 0);if(!(J instanceof E))throw p8("let_assert",d_,"quickslice_client",122,"main","Pattern match failed, no pattern matched the value.",{value:J,start:3390,end:3439,pattern_start:3401,pattern_end:3406});return J}Fh(); 154 + `),G=PJ(V,(k)=>{return Y8(J4(k))>0});Y=H0(G,J4);let I=Y,z=b(Q([["clientId",c(W)],["clientName",c(Z.settings_page_model.edit_client_name)],["redirectUris",j0(I,c)],["scope",c(Z.settings_page_model.edit_client_scope)]])),N=m0(Z.cache,"UpdateOAuthClient",z),F=a(N,"UpdateOAuthClient",z,mb),D;D=F[0];let B=m0(D,"GetOAuthClients",b(Q([]))),T=u0(B,Z.registry,(k,w,f)=>{return new d0(k,w,f)},()=>{return 0}),P,S;P=T[0],S=T[1];let q,C=Z.settings_page_model;q=new K0(C.domain_authority_input,C.reset_confirmation,C.selected_file,C.alert,C.relay_url_input,C.plc_directory_url_input,C.jetstream_url_input,C.oauth_supported_scopes_input,C.lexicons_alert,C.show_new_client_form,C.new_client_name,C.new_client_type,C.new_client_redirect_uris,C.new_client_scope,new h,"","","",C.visible_secrets,C.delete_confirm_client_id,C.oauth_alert,C.new_admin_did,C.remove_confirm_did,C.admin_alert,C.danger_zone_alert);let U=q;return[new s(P,Z.registry,Z.route,Z.time_range,U,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(S)]}else return[Z,i()]}else if(K instanceof AM){let X=K[0],W;if(W4(Z.settings_page_model.visible_secrets,X))W=Cy(Z.settings_page_model.visible_secrets,X);else W=wZ(Z.settings_page_model.visible_secrets,X);let V=W,G,I=Z.settings_page_model;G=new K0(I.domain_authority_input,I.reset_confirmation,I.selected_file,I.alert,I.relay_url_input,I.plc_directory_url_input,I.jetstream_url_input,I.oauth_supported_scopes_input,I.lexicons_alert,I.show_new_client_form,I.new_client_name,I.new_client_type,I.new_client_redirect_uris,I.new_client_scope,I.editing_client_id,I.edit_client_name,I.edit_client_redirect_uris,I.edit_client_scope,V,I.delete_confirm_client_id,I.oauth_alert,I.new_admin_did,I.remove_confirm_did,I.admin_alert,I.danger_zone_alert);let z=G;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,z,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof qM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,new L(X),Y.oauth_alert,Y.new_admin_did,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof EM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,new h,W.oauth_alert,W.new_admin_did,W.remove_confirm_did,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof CM){let X=Z.settings_page_model.delete_confirm_client_id;if(X instanceof L){let W=X[0],Y=b(Q([["clientId",c(W)]])),V=m0(Z.cache,"DeleteOAuthClient",Y),G=a(V,"DeleteOAuthClient",Y,Ob),I;I=G[0];let z=m0(I,"GetOAuthClients",b(Q([]))),N=u0(z,Z.registry,(S,q,C)=>{return new d0(S,q,C)},()=>{return 0}),F,D;F=N[0],D=N[1];let B,T=Z.settings_page_model;B=new K0(T.domain_authority_input,T.reset_confirmation,T.selected_file,T.alert,T.relay_url_input,T.plc_directory_url_input,T.jetstream_url_input,T.oauth_supported_scopes_input,T.lexicons_alert,T.show_new_client_form,T.new_client_name,T.new_client_type,T.new_client_redirect_uris,T.new_client_scope,T.editing_client_id,T.edit_client_name,T.edit_client_redirect_uris,T.edit_client_scope,T.visible_secrets,new h,T.oauth_alert,T.new_admin_did,T.remove_confirm_did,T.admin_alert,T.danger_zone_alert);let P=B;return[new s(F,Z.registry,Z.route,Z.time_range,P,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(D)]}else return[Z,i()]}else if(K instanceof xM){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,X,Y.remove_confirm_did,Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof wM){let X=b(Q([])),W=a(Z.cache,"GetSettings",X,O1),Y;if(Y=W[1],Y instanceof Z8){let V=Y[0],G=Z.settings_page_model.new_admin_did,I=V.settings.admin_dids,z=V.settings.domain_authority,N;if(ZR(I,G))N=I;else N=_0(I,Q([G]));let D=N,B=b(Q([["domainAuthority",c(z)],["adminDids",j0(D,c)]])),T=b(Q([["id",c("Settings:singleton")],["domainAuthority",c(z)],["adminDids",j0(D,c)]])),P=dZ(Z.cache,Z.registry,"UpdateSettings",B,"Settings:singleton",(w)=>{return T},KJ,(w,f,$)=>{if(f instanceof E)return new jM(w,$);else{let d=f[0];return new LM(w,d)}}),S,q;S=P[0],q=P[2];let C,U=Z.settings_page_model;C=new K0(U.domain_authority_input,U.reset_confirmation,U.selected_file,U.alert,U.relay_url_input,U.plc_directory_url_input,U.jetstream_url_input,U.oauth_supported_scopes_input,U.lexicons_alert,U.show_new_client_form,U.new_client_name,U.new_client_type,U.new_client_redirect_uris,U.new_client_scope,U.editing_client_id,U.edit_client_name,U.edit_client_redirect_uris,U.edit_client_scope,U.visible_secrets,U.delete_confirm_client_id,U.oauth_alert,"",U.remove_confirm_did,U.admin_alert,U.danger_zone_alert);let k=C;return[new s(S,Z.registry,Z.route,Z.time_range,k,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),q]}else return[Z,i()]}else if(K instanceof XJ){let X=K[0],W,Y=Z.settings_page_model;W=new K0(Y.domain_authority_input,Y.reset_confirmation,Y.selected_file,Y.alert,Y.relay_url_input,Y.plc_directory_url_input,Y.jetstream_url_input,Y.oauth_supported_scopes_input,Y.lexicons_alert,Y.show_new_client_form,Y.new_client_name,Y.new_client_type,Y.new_client_redirect_uris,Y.new_client_scope,Y.editing_client_id,Y.edit_client_name,Y.edit_client_redirect_uris,Y.edit_client_scope,Y.visible_secrets,Y.delete_confirm_client_id,Y.oauth_alert,Y.new_admin_did,new L(X),Y.admin_alert,Y.danger_zone_alert);let V=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,V,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else if(K instanceof UM){let X,W=Z.settings_page_model;X=new K0(W.domain_authority_input,W.reset_confirmation,W.selected_file,W.alert,W.relay_url_input,W.plc_directory_url_input,W.jetstream_url_input,W.oauth_supported_scopes_input,W.lexicons_alert,W.show_new_client_form,W.new_client_name,W.new_client_type,W.new_client_redirect_uris,W.new_client_scope,W.editing_client_id,W.edit_client_name,W.edit_client_redirect_uris,W.edit_client_scope,W.visible_secrets,W.delete_confirm_client_id,W.oauth_alert,W.new_admin_did,new h,W.admin_alert,W.danger_zone_alert);let Y=X;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Y,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else{let X=Z.settings_page_model.remove_confirm_did;if(X instanceof L){let W=X[0],Y=b(Q([])),V=a(Z.cache,"GetSettings",Y,O1),G;if(G=V[1],G instanceof Z8){let I=G[0],z=I.settings.admin_dids,N=I.settings.domain_authority,F=PJ(z,(k)=>{return k!==W}),D=b(Q([["domainAuthority",c(N)],["adminDids",j0(F,c)]])),B=b(Q([["id",c("Settings:singleton")],["domainAuthority",c(N)],["adminDids",j0(F,c)]])),T=dZ(Z.cache,Z.registry,"UpdateSettings",D,"Settings:singleton",(k)=>{return B},KJ,(k,w,f)=>{if(w instanceof E)return new jM(k,f);else{let $=w[0];return new LM(k,$)}}),P,S;P=T[0],S=T[2];let q,C=Z.settings_page_model;q=new K0(C.domain_authority_input,C.reset_confirmation,C.selected_file,C.alert,C.relay_url_input,C.plc_directory_url_input,C.jetstream_url_input,C.oauth_supported_scopes_input,C.lexicons_alert,C.show_new_client_form,C.new_client_name,C.new_client_type,C.new_client_redirect_uris,C.new_client_scope,C.editing_client_id,C.edit_client_name,C.edit_client_redirect_uris,C.edit_client_scope,C.visible_secrets,C.delete_confirm_client_id,C.oauth_alert,C.new_admin_did,new h,C.admin_alert,C.danger_zone_alert);let U=q;return[new s(P,Z.registry,Z.route,Z.time_range,U,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),S]}else return[Z,i()]}else return[Z,i()]}}else if(J instanceof yM){let K=J[0],X=Kh(K);return[Z,yR(X,(W)=>{return new yM(W)})]}else if(J instanceof DL){let K=J[0];if(K instanceof sU){let X=K[0],W,Y,V=Z.backfill_page_model;Y=new D5(X,V.is_submitting,V.alert),W=lU(Y);let I=W;return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}else{let X=Z.backfill_page_model.did_input,W=b(Q([["did",c(X)]])),Y,V=Z.backfill_page_model,G=rU(V,!0);Y=lU(G);let I=Y,z=m0(Z.cache,"BackfillActor",W),N=a(z,"BackfillActor",W,Nb),F;F=N[0];let D=u0(F,Z.registry,(P,S,q)=>{return new d0(P,S,q)},()=>{return 0}),B,T;return B=D[0],T=D[1],[new s(B,Z.registry,Z.route,Z.time_range,Z.settings_page_model,I,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(T)]}}else if(J instanceof VL){let K=J[0];if(K instanceof E){let X=K[0];C5("[FileRead] Successfully read file, uploading...");let W=b(Q([["zipBase64",c(X)]])),Y=m0(Z.cache,"UploadLexicons",W),V=a(Y,"UploadLexicons",W,pb),G;G=V[0];let I=u0(G,Z.registry,(T,P,S)=>{return new d0(T,P,S)},()=>{return 0}),z,N;z=I[0],N=I[1];let F,D=Z.settings_page_model;F=new K0(D.domain_authority_input,D.reset_confirmation,new h,D.alert,D.relay_url_input,D.plc_directory_url_input,D.jetstream_url_input,D.oauth_supported_scopes_input,D.lexicons_alert,D.show_new_client_form,D.new_client_name,D.new_client_type,D.new_client_redirect_uris,D.new_client_scope,D.editing_client_id,D.edit_client_name,D.edit_client_redirect_uris,D.edit_client_scope,D.visible_secrets,D.delete_confirm_client_id,D.oauth_alert,D.new_admin_did,D.remove_confirm_did,D.admin_alert,D.danger_zone_alert);let B=F;return[new s(z,Z.registry,Z.route,Z.time_range,B,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(N)]}else{let X=K[0];C5("[FileRead] Error reading file: "+X);let W=VJ(Z.settings_page_model,"error",X);return[new s(Z.cache,Z.registry,Z.route,Z.time_range,W,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()]}}else if(J instanceof IJ)if(_5(Z.backfill_status)){let X=nk(Z.cache,Z.registry,(V,G,I)=>{return new d0(V,G,I)}),W,Y;return W=X[0],Y=X[1],[new s(W,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),W1(Y)]}else return[Z,i()];else if(J instanceof BL)return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,!Z.mobile_menu_open,Z.login_autocomplete,Z.oauth_error),i()];else if(J instanceof NJ){let K=J[0],X=S8(Z.login_autocomplete,new DK(K)),W,Y;return W=X[0],Y=X[1],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),yR(Y,(V)=>{if(V instanceof A4){let G=V[0];return new GL(G)}else return new NJ("")})]}else if(J instanceof fM){let K=J[0];if(K==="ArrowDown"){let X=S8(Z.login_autocomplete,new BK),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(K==="ArrowUp"){let X=S8(Z.login_autocomplete,new OK),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(K==="Enter"){let X=ek(Z.login_autocomplete);if(X instanceof L){let W=X[0],Y=S8(Z.login_autocomplete,new nZ(W)),V;return V=Y[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,V,Z.oauth_error),i()]}else return[Z,i()]}else if(K==="Escape"){let X=S8(Z.login_autocomplete,new iZ),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else return[Z,i()]}else if(J instanceof kM){let K=J[0],X,W=JR(Z.login_autocomplete.actors,(I)=>{return I.handle===K});if(W instanceof E)X=W[0];else X=new pZ("",K,"",new h);let Y=X,V=S8(Z.login_autocomplete,new nZ(Y)),G;return G=V[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,G,Z.oauth_error),i()]}else if(J instanceof bM){let K=I1((X)=>{return GJ(150,()=>{return X(new IL)})});return[Z,K]}else if(J instanceof hM){let K=S8(Z.login_autocomplete,new gj),X;return X=K[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,X,Z.oauth_error),i()]}else if(J instanceof GL){let K=J[0],X=S8(Z.login_autocomplete,new A4(K)),W;return W=X[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,W,Z.oauth_error),i()]}else if(J instanceof IL){let K=S8(Z.login_autocomplete,new iZ),X;return X=K[0],[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,X,Z.oauth_error),i()]}else return[new s(Z.cache,Z.registry,Z.route,Z.time_range,Z.settings_page_model,Z.backfill_page_model,Z.backfill_status,Z.auth_state,Z.mobile_menu_open,Z.login_autocomplete,new h),i()]}function n_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=[!1,!1];else J=[K.is_admin,!0];let X=J,W,Y;return W=X[0],Y=X[1],hZ(ob(Z.cache,Z.time_range,Z.backfill_status,W,Y),(V)=>{return new FL(V)})}function i_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=!1;else J=K.is_admin;let X=J;return hZ(Gh(Z.cache,Z.settings_page_model,X),(W)=>{return new HL(W)})}function s_(Z){return hZ(Yh(Z.cache),(J)=>{return new yM(J)})}function l_(Z){return j(Q([]),Q([$1(Q([H("text-xl font-bold text-zinc-100 mb-4")]),Q([l0("Upload")])),C0(Q([H("text-zinc-400")]),Q([l0("Upload and manage data")]))]))}function r_(Z){return hZ(lb(Z.backfill_page_model),(J)=>{return new DL(J)})}function a_(Z){return Xh(Z.login_autocomplete,(J)=>{return new NJ(J)},(J)=>{return new kM(J)},(J)=>{return new fM(J)},()=>{return new bM},()=>{return new hM})}function t_(Z){let J,K=Z.auth_state;if(K instanceof x8)J=new h;else{let{handle:W,is_admin:Y}=K;J=new L([W,Y])}let X=J;return j(Q([H("bg-zinc-950 text-zinc-300 font-mono min-h-screen")]),Q([j(Q([H("max-w-4xl mx-auto px-4 py-6 sm:px-6 sm:py-12")]),Q([(()=>{if(Z.route instanceof i5)return G0();else return Gb(X,_5(Z.backfill_status),Z.mobile_menu_open,new BL,Z.login_autocomplete,(Y)=>{return new NJ(Y)},(Y)=>{return new kM(Y)},(Y)=>{return new fM(Y)},()=>{return new bM},()=>{return new hM})})(),(()=>{let W=Z.oauth_error;if(W instanceof L){let Y=W[0];return A8(new m1,Y)}else return G0()})(),(()=>{let W=Z.route;if(W instanceof s5)return n_(Z);else if(W instanceof O5)return i_(Z);else if(W instanceof FJ)return s_(Z);else if(W instanceof zL)return l_(Z);else if(W instanceof zJ)return r_(Z);else return a_(Z)})()]))]))}function Nh(Z){let J=Z.path;if(J==="/")return new s5;else if(J==="/settings")return new O5;else if(J==="/lexicons")return new FJ;else if(J==="/upload")return new zL;else if(J==="/backfill")return new zJ;else if(J==="/onboarding")return new i5;else return new s5}function o_(Z){return new NL(Nh(Z))}function e_(Z){let J=Ih()+"/admin/graphql",K=_k(J),X=Ib(),W,Y=Sj();if(Y instanceof E){let U=Y[0];W=[Nh(U),c_(U)]}else W=[new s5,new h];let V=W,G,I;G=V[0],I=V[1];let z=a(K,"GetCurrentSession",b(Q([])),lj),N;N=z[0];let F=a(N,"IsBackfilling",b(Q([])),cZ),D;D=F[0];let B;if(G instanceof s5){let U=a(D,"GetStatistics",b(Q([])),H5),k;k=U[0];let w=a(k,"GetSettings",b(Q([])),O1),f;f=w[0];let $=a(f,"GetActivityBuckets",b(Q([["range",c("ONE_DAY")]])),p5),d;d=$[0];let p=a(d,"GetRecentActivity",b(Q([["hours",X1(24)]])),BZ),r;r=p[0];let X0=u0(r,X,(I0,D0,W0)=>{return new d0(I0,D0,W0)},()=>{return 0}),B0,L0;B0=X0[0],L0=X0[1],B=[B0,L0]}else if(G instanceof O5){let U=a(D,"GetSettings",b(Q([])),O1),k;k=U[0];let w=a(k,"GetOAuthClients",b(Q([])),c8),f;f=w[0];let $=u0(f,X,(r,X0,B0)=>{return new d0(r,X0,B0)},()=>{return 0}),d,p;d=$[0],p=$[1],B=[d,p]}else if(G instanceof FJ){let U=a(D,"GetLexicons",b(Q([])),JJ),k;k=U[0];let w=u0(k,X,(d,p,r)=>{return new d0(d,p,r)},()=>{return 0}),f,$;f=w[0],$=w[1],B=[f,$]}else B=[D,Q([])];let T=B,P,S;P=T[0],S=T[1];let q=Hk(o_),C=W1(A(q,S));return[new s(P,X,G,new c5,Vh(),sb(),new HK,new x8,!1,ok(),I),C]}function Fh(){let Z=Yk(e_,p_,t_),J=Xk(Z,"#app",void 0);if(!(J instanceof E))throw p8("let_assert",d_,"quickslice_client",122,"main","Pattern match failed, no pattern matched the value.",{value:J,start:3390,end:3439,pattern_start:3401,pattern_end:3406});return J}Fh();
+3
server/src/importer.gleam
··· 82 82 // If validation failed, return error immediately 83 83 use _ <- result.try(validation_result) 84 84 85 + // Wipe existing lexicons before importing new set 86 + let _ = lexicons.delete_all(db) 87 + 85 88 // Validation succeeded, import each lexicon 86 89 let results = 87 90 file_contents
-46
server/src/server.gleam
··· 36 36 import handlers/oauth/register as oauth_register_handler 37 37 import handlers/oauth/token as oauth_token_handler 38 38 import handlers/upload as upload_handler 39 - import importer 40 39 import jetstream_consumer 41 40 import lib/oauth/did_cache 42 41 import logging ··· 66 65 pub fn main() { 67 66 // Check for CLI arguments 68 67 case argv.load().arguments { 69 - ["import", directory] -> run_import_command(directory) 70 68 ["backfill"] -> run_backfill_command() 71 69 _ -> start_server_normally() 72 - } 73 - } 74 - 75 - fn run_import_command(directory: String) { 76 - logging.log(logging.Info, "Importing lexicons from: " <> directory) 77 - logging.log(logging.Info, "") 78 - 79 - // Get database URL from environment variable or use default 80 - let database_url = case envoy.get("DATABASE_URL") { 81 - Ok(url) -> url 82 - Error(_) -> "quickslice.db" 83 - } 84 - 85 - // Initialize the database 86 - let assert Ok(db) = connection.initialize(database_url) 87 - 88 - case importer.import_lexicons_from_directory(directory, db) { 89 - Ok(stats) -> { 90 - logging.log(logging.Info, "") 91 - logging.log(logging.Info, "Import complete!") 92 - logging.log( 93 - logging.Info, 94 - " Total files: " <> int.to_string(stats.total), 95 - ) 96 - logging.log( 97 - logging.Info, 98 - " Imported: " <> int.to_string(stats.imported), 99 - ) 100 - logging.log(logging.Info, " Failed: " <> int.to_string(stats.failed)) 101 - 102 - case stats.errors { 103 - [] -> Nil 104 - errors -> { 105 - logging.log(logging.Info, "") 106 - logging.log(logging.Warning, "Errors:") 107 - list.each(errors, fn(err) { 108 - logging.log(logging.Warning, " " <> err) 109 - }) 110 - } 111 - } 112 - } 113 - Error(err) -> { 114 - logging.log(logging.Error, "Import failed: " <> err) 115 - } 116 70 } 117 71 } 118 72