| 1 | <html> |
| 2 | <head> |
| 3 | <script type="module"> |
| 4 | import { store as modelGateStore } from "/components/chat/model-gate-store.js"; |
| 5 | </script> |
| 6 | </head> |
| 7 | <body> |
| 8 | <div x-data> |
| 9 | <template x-if="$store.modelGate"> |
| 10 | <section class="model-gate" x-create="$store.modelGate.onCardCreate()"> |
| 11 | <template x-if="$store.modelGate.connected"> |
| 12 | <div class="model-gate-chip"> |
| 13 | <x-icon aria-hidden="true" name="check_circle"></x-icon> |
| 14 | <span x-text="$store.modelGate.introText"></span> |
| 15 | </div> |
| 16 | </template> |
| 17 | |
| 18 | <template x-if="!$store.modelGate.connected"> |
| 19 | <div class="model-gate-body"> |
| 20 | <p class="model-gate-intro" x-text="$store.modelGate.introText"></p> |
| 21 | |
| 22 | <div class="model-gate-card"> |
| 23 | <div class="model-gate-fork is-single" x-show="$store.modelGate.accountConnected"> |
| 24 | <button type="button" |
| 25 | class="model-gate-option" |
| 26 | @click="$store.modelGate.openAdvancedModelConfiguration()"> |
| 27 | <span class="model-gate-option-title"> |
| 28 | <x-icon aria-hidden="true" name="tune"></x-icon> |
| 29 | <span>Choose models</span> |
| 30 | </span> |
| 31 | <span class="model-gate-option-sub">Select Main and Utility models</span> |
| 32 | </button> |
| 33 | </div> |
| 34 | |
| 35 | <div class="model-gate-fork" x-show="!$store.modelGate.accountConnected"> |
| 36 | <button type="button" |
| 37 | class="model-gate-option" |
| 38 | :class="{ selected: $store.modelGate.choice === 'cloud' }" |
| 39 | @click="$store.modelGate.openOnboarding('cloud')"> |
| 40 | <span class="model-gate-option-title"> |
| 41 | <x-icon aria-hidden="true" name="cloud"></x-icon> |
| 42 | <span>Cloud provider</span> |
| 43 | </span> |
| 44 | <span class="model-gate-option-sub">Connect with an API key</span> |
| 45 | </button> |
| 46 | <button type="button" |
| 47 | class="model-gate-option" |
| 48 | :class="{ selected: $store.modelGate.choice === 'account' }" |
| 49 | @click="$store.modelGate.openOnboarding('account')"> |
| 50 | <span class="model-gate-option-title"> |
| 51 | <x-icon aria-hidden="true" name="account_circle"></x-icon> |
| 52 | <span>AI account</span> |
| 53 | </span> |
| 54 | <span class="model-gate-option-sub">Codex, Copilot, Gemini, Grok</span> |
| 55 | </button> |
| 56 | <button type="button" |
| 57 | class="model-gate-option" |
| 58 | :class="{ selected: $store.modelGate.choice === 'local' }" |
| 59 | @click="$store.modelGate.openOnboarding('local')"> |
| 60 | <span class="model-gate-option-title"> |
| 61 | <x-icon aria-hidden="true" name="memory"></x-icon> |
| 62 | <span>Local model</span> |
| 63 | </span> |
| 64 | <span class="model-gate-option-sub">Runs on your machine</span> |
| 65 | </button> |
| 66 | </div> |
| 67 | </div> |
| 68 | |
| 69 | <p class="model-gate-footnote"> |
| 70 | <span>Your message sends automatically once a model is connected.</span> |
| 71 | <button type="button" @click="$store.modelGate.openAdvancedModelConfiguration()">Advanced model configuration</button> |
| 72 | </p> |
| 73 | </div> |
| 74 | </template> |
| 75 | </section> |
| 76 | </template> |
| 77 | </div> |
| 78 | |
| 79 | <style> |
| 80 | .model-gate { |
| 81 | width: min(100%, 36rem); |
| 82 | color: var(--color-text); |
| 83 | font-family: var(--font-family-main, "Rubik", Arial, Helvetica, sans-serif); |
| 84 | } |
| 85 | |
| 86 | .model-gate-body { |
| 87 | display: grid; |
| 88 | gap: 0.65rem; |
| 89 | container-type: inline-size; |
| 90 | } |
| 91 | |
| 92 | .model-gate-intro { |
| 93 | margin: 0; |
| 94 | color: color-mix(in srgb, var(--color-text) 84%, transparent); |
| 95 | line-height: 1.45; |
| 96 | } |
| 97 | |
| 98 | .model-gate-card { |
| 99 | display: grid; |
| 100 | gap: 0.75rem; |
| 101 | } |
| 102 | |
| 103 | .model-gate-fork { |
| 104 | display: flex; |
| 105 | gap: 0.6rem; |
| 106 | } |
| 107 | |
| 108 | .model-gate-fork .model-gate-option { |
| 109 | flex: 1 1 0; |
| 110 | min-width: 0; |
| 111 | } |
| 112 | |
| 113 | @container (max-width: 30rem) { |
| 114 | .model-gate-fork { |
| 115 | flex-direction: column; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | .model-gate-option { |
| 120 | border: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent); |
| 121 | border-radius: 8px; |
| 122 | background: color-mix(in srgb, var(--color-background) 52%, transparent); |
| 123 | color: inherit; |
| 124 | font: inherit; |
| 125 | text-align: left; |
| 126 | cursor: pointer; |
| 127 | } |
| 128 | |
| 129 | .model-gate-option { |
| 130 | display: grid; |
| 131 | gap: 0.25rem; |
| 132 | padding: 0.72rem; |
| 133 | } |
| 134 | |
| 135 | .model-gate-option:hover, |
| 136 | .model-gate-option:focus-visible, |
| 137 | .model-gate-option.selected { |
| 138 | border-color: color-mix(in srgb, var(--color-border) 86%, var(--color-text) 14%); |
| 139 | background: color-mix(in srgb, var(--color-background-hover) 60%, var(--color-panel)); |
| 140 | outline: none; |
| 141 | } |
| 142 | |
| 143 | .model-gate-option-title { |
| 144 | display: inline-flex; |
| 145 | align-items: center; |
| 146 | gap: 0.4rem; |
| 147 | font-weight: 560; |
| 148 | } |
| 149 | |
| 150 | .model-gate-option-title .material-symbols-outlined { |
| 151 | font-size: 1.15rem; |
| 152 | color: color-mix(in srgb, var(--color-text) 72%, transparent); |
| 153 | } |
| 154 | |
| 155 | .model-gate-option-sub, |
| 156 | .model-gate-footnote { |
| 157 | color: color-mix(in srgb, var(--color-text) 58%, transparent); |
| 158 | font-size: 0.78rem; |
| 159 | line-height: 1.35; |
| 160 | } |
| 161 | |
| 162 | .model-gate-footnote { |
| 163 | display: flex; |
| 164 | align-items: center; |
| 165 | justify-content: space-between; |
| 166 | gap: 0.7rem; |
| 167 | flex-wrap: wrap; |
| 168 | } |
| 169 | |
| 170 | .model-gate-footnote button { |
| 171 | border: 0; |
| 172 | background: transparent; |
| 173 | color: color-mix(in srgb, #6f8cff 82%, var(--color-text)); |
| 174 | font: inherit; |
| 175 | font-size: 0.8rem; |
| 176 | cursor: pointer; |
| 177 | padding: 0; |
| 178 | } |
| 179 | |
| 180 | .model-gate-chip { |
| 181 | display: inline-flex; |
| 182 | align-items: center; |
| 183 | gap: 0.4rem; |
| 184 | border: 1px solid color-mix(in srgb, #7bc995 44%, var(--color-border)); |
| 185 | border-radius: 999px; |
| 186 | padding: 0.35rem 0.65rem; |
| 187 | color: color-mix(in srgb, var(--color-text) 88%, #7bc995); |
| 188 | background: color-mix(in srgb, #7bc995 10%, var(--color-panel)); |
| 189 | font-size: 0.84rem; |
| 190 | } |
| 191 | |
| 192 | .model-gate-chip .material-symbols-outlined { |
| 193 | font-size: 1rem; |
| 194 | } |
| 195 | |
| 196 | @media (max-width: 480px) { |
| 197 | .model-gate-fork { |
| 198 | flex-direction: column; |
| 199 | } |
| 200 | } |
| 201 | </style> |
| 202 | </body> |
| 203 | </html> |