@gehennawu/dsh-service 2.0.10 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +28 -14
- package/README.md +28 -14
- package/client.js +1 -1
- package/index.js +34 -2
- package/model-config-routes.js +15 -1
- package/model-smart-fill.js +253 -7
- package/package.json +1 -1
- package/quota-adapters.js +369 -0
- package/quota-routes.js +36 -1
package/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:"@gehennawu/dsh-service",factory:e=>{var t={},a=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});const r=e("react"),s="dsh-service",n={years:[2025,2026],papers:{2025:"https://www.gov.cn/zhengce/zhengceku/202411/content_6986383.htm",2026:"https://www.gov.cn/zhengce/zhengceku/202511/content_7047091.htm"},offDays:{"2025-01-01":"new-year","2025-01-28":"spring-festival","2025-01-29":"spring-festival","2025-01-30":"spring-festival","2025-01-31":"spring-festival","2025-02-01":"spring-festival","2025-02-02":"spring-festival","2025-02-03":"spring-festival","2025-02-04":"spring-festival","2025-04-04":"qingming","2025-04-05":"qingming","2025-04-06":"qingming","2025-05-01":"labour-day","2025-05-02":"labour-day","2025-05-03":"labour-day","2025-05-04":"labour-day","2025-05-05":"labour-day","2025-05-31":"dragon-boat","2025-06-01":"dragon-boat","2025-06-02":"dragon-boat","2025-10-01":"mid-autumn","2025-10-02":"mid-autumn","2025-10-03":"mid-autumn","2025-10-04":"mid-autumn","2025-10-05":"mid-autumn","2025-10-06":"mid-autumn","2025-10-07":"mid-autumn","2025-10-08":"mid-autumn","2026-01-01":"new-year","2026-01-02":"new-year","2026-01-03":"new-year","2026-02-15":"spring-festival","2026-02-16":"spring-festival","2026-02-17":"spring-festival","2026-02-18":"spring-festival","2026-02-19":"spring-festival","2026-02-20":"spring-festival","2026-02-21":"spring-festival","2026-02-22":"spring-festival","2026-02-23":"spring-festival","2026-04-04":"qingming","2026-04-05":"qingming","2026-04-06":"qingming","2026-05-01":"labour-day","2026-05-02":"labour-day","2026-05-03":"labour-day","2026-05-04":"labour-day","2026-05-05":"labour-day","2026-06-19":"dragon-boat","2026-06-20":"dragon-boat","2026-06-21":"dragon-boat","2026-09-25":"mid-autumn","2026-09-26":"mid-autumn","2026-09-27":"mid-autumn","2026-10-01":"national-day","2026-10-02":"national-day","2026-10-03":"national-day","2026-10-04":"national-day","2026-10-05":"national-day","2026-10-06":"national-day","2026-10-07":"national-day"}},o={openai:{v:"-0.04 -0.145 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></g>',c:0},anthropic:{v:"-0.04 -0.285 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></g>',c:0},gemini:{v:"0.94 1.01 22.05 22.05",m:'<path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs>',c:1},vertexai:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z"></path></g>',c:0},xai:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></g>',c:0},mistral:{v:"-0.04 -0.075 24.08 24.08",m:'<path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path>',c:1},deepseek:{v:"-0.04 -0.215 24.08 24.08",m:'<path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path>',c:1,o:1.15},moonshot:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></g>',c:0},kimi:{v:"-0.0667 -0.0667 40.1333 40.1333",m:'<rect width="40" height="40" rx="10" fill="#121316"/><path d="M31.6957 7.11414C32.8305 7.11414 33.7505 8.0341 33.7505 9.16893V9.16893C33.7505 10.3038 32.8305 11.2237 31.6957 11.2237L29.8826 11.2237C29.7491 11.2237 29.6409 11.1155 29.6409 10.982L29.6409 9.16893C29.6409 8.0341 30.5609 7.11414 31.6957 7.11414V7.11414Z" fill="#1783FF"/><path d="M20.1757 19.0798L27.9302 11.3864C28.0761 11.2413 27.9939 10.9498 27.8056 10.9498H23.633C23.5877 10.9498 23.5438 10.9683 23.5084 11.0038L15.1533 19.2911C15.023 19.4192 14.8304 19.305 14.8304 19.0998V11.1951C14.8304 11.0593 14.7411 10.9498 14.6321 10.9498H11.7569C11.6478 10.9498 11.5586 11.0593 11.5586 11.1951V28.2387C11.5586 28.3745 11.6478 28.484 11.7569 28.484H14.6321C14.7411 28.484 14.8304 28.3745 14.8304 28.2387V24.7661C14.8304 24.6921 14.8573 24.6211 14.904 24.5748L17.4945 22.0047C17.5568 21.943 17.6432 21.9337 17.7126 21.98L24.6414 27.0786C25.7759 27.8423 27.0436 28.3112 28.331 28.4501C28.4458 28.4624 28.5449 28.3483 28.5449 28.2048V24.9343C28.5449 24.8093 28.4698 24.7075 28.3693 24.6921C27.6115 24.5733 26.8722 24.2802 26.2037 23.8297L20.2054 19.487C20.0808 19.4037 20.0652 19.1893 20.1757 19.0798Z" fill="#FFFFFF"/>',c:1},minimax:{v:"-0.04 -0.04 24.08 24.08",m:'<defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path>',c:1},zhipu:{v:"-0.04 -0.04 24.08 24.08",m:'<path d="M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z" fill="#3859FF" fill-rule="nonzero"></path>',c:1,o:1.2},xiaomi:{v:"-0.8533 -0.8533 513.7067 513.7067",m:'<path fill="#FF6900" d="M458.634 53.496C410.33 5.378 340.875 0 256 0c-84.982 0-154.542 5.44-202.826 53.688C4.897 101.916 0 171.364 0 256.249c0 84.899 4.897 154.368 53.194 202.613C101.475 507.117 171.027 512 256 512c84.974 0 154.514-4.884 202.795-53.139 48.294-48.254 53.205-117.714 53.205-202.613 0-84.72-4.964-154.243-53.366-202.479z"/><path fill="#FFF" d="M404.554 158.605c1.759 0 3.223 1.417 3.223 3.161v189.386c0 1.715-1.464 3.139-3.223 3.139H363.058c-1.781 0-3.228-1.424-3.228-3.139V161.766c0-1.743 1.446-3.161 3.228-3.161h41.496zM224.476 158.605c31.303 0 64.033 1.435 80.176 17.589 15.871 15.897 17.59 47.549 17.656 78.286v96.671c0 1.715-1.446 3.139-3.219 3.139h-41.49c-1.777 0-3.229-1.424-3.229-3.139V252.817c-.044-17.167-1.031-34.81-9.884-43.692-7.62-7.641-21.839-9.391-36.625-9.754h-75.21c-1.764 0-3.208 1.419-3.208 3.136v148.645c0 1.715-1.462 3.139-3.237 3.139H107.9c-1.774 0-3.201-1.424-3.201-3.139V161.766c0-1.743 1.426-3.161 3.201-3.161h116.576zm9.287 75.427c1.766 0 3.201 1.413 3.201 3.143v113.977c0 1.715-1.436 3.139-3.201 3.139h-43.584c-1.792 0-3.228-1.424-3.228-3.139V237.175c0-1.73 1.436-3.143 3.228-3.143h43.584z"/>',c:1},nvidia:{v:"1.99 0.975 22.05 22.05",m:'<path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path>',c:1},huggingface:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"></path></g>',c:0},qwen:{v:"0.94 0.94 22.12 22.12",m:'<path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs>',c:1},openrouter:{v:"-0.04 0.275 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path></g>',c:0},vercel:{v:"-0.04 -1.65 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0l12 20.785H0L12 0z"></path></g>',c:0},cloudflare:{v:"-0.04 0.45 24.08 24.08",m:'<path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path>',c:1},bedrock:{v:"1.465 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"></path></g>',c:0},azure:{v:"0.38 0.135 23.66 23.66",m:'<g fill-rule="evenodd"><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill-opacity=".75"></path><path d="M8.295.857c-.477 0-.9.304-1.053.756L.495 21.605a1.11 1.11 0 001.052 1.466h5.43c.477 0 .9-.304 1.053-.755l1.341-3.975-2.318-2.163a.51.51 0 01.347-.882h3L15.271.857H8.295z" fill-opacity=".5"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z"></path></g>',c:0},together:{v:"-0.04 0.625 24.15 24.15",m:'<g fill-rule="evenodd"><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z"></path></g>',c:0},fireworks:{v:"-0.04 -1.02 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z"></path></g>',c:0},baseten:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></g>',c:0},cerebras:{v:"0.87 1.29 21.42 21.42",m:'<path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path>',c:1},groq:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></g>',c:0},github:{v:"-0.04 -0.53 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0c6.63 0 12 5.276 12 11.79-.001 5.067-3.29 9.567-8.175 11.187-.6.118-.825-.25-.825-.56 0-.398.015-1.665.015-3.242 0-1.105-.375-1.813-.81-2.181 2.67-.295 5.475-1.297 5.475-5.822 0-1.297-.465-2.344-1.23-3.169.12-.295.54-1.503-.12-3.125 0 0-1.005-.324-3.3 1.209a11.32 11.32 0 00-3-.398c-1.02 0-2.04.133-3 .398-2.295-1.518-3.3-1.209-3.3-1.209-.66 1.622-.24 2.83-.12 3.125-.765.825-1.23 1.887-1.23 3.169 0 4.51 2.79 5.527 5.46 5.822-.345.294-.66.81-.765 1.577-.69.31-2.415.81-3.495-.973-.225-.354-.9-1.223-1.845-1.209-1.005.015-.405.56.015.781.51.28 1.095 1.327 1.23 1.666.24.663 1.02 1.93 4.035 1.385 0 .988.015 1.916.015 2.196 0 .31-.225.664-.825.56C3.303 21.374-.003 16.867 0 11.791 0 5.276 5.37 0 12 0z"></path></g>',c:0},opencode:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></g>',c:0},commandcode:{v:"-11.5383 -11.5383 23.0767 23.0767",m:'<g fill="none" stroke="#000" stroke-width="1.85"><path d="M-7.6 -4.6H7.6M-7.6 4.6H7.6M-4.6 -7.6V7.6M4.6 -7.6V7.6"/><circle cx="-7.6" cy="-7.6" r="3"/><circle cx="7.6" cy="-7.6" r="3"/><circle cx="-7.6" cy="7.6" r="3"/><circle cx="7.6" cy="7.6" r="3"/></g>',c:0,o:.9},cliproxy:{v:"-18.9525 -18.9525 37.905 37.905",m:'<path fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round" d="M 0 -18 Q -5.8 -5.8 -18 0 Q -5.8 5.8 0 18 Q 5.8 5.8 18 0 Q 5.8 -5.8 0 -18 Z"/><g transform="scale(-0.835, 0.835) translate(-12, -12)"><path fill="currentColor" d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"/></g>',c:0},ollama:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></g>',c:0},vllm:{v:"-0.355 -0.04 23.1 23.1",m:'<g fill-rule="evenodd"><path d="M0 4.973h9.324V23L0 4.973z"></path><path d="M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z"></path></g>',c:0},lmstudio:{v:"-0.04 -0.32 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></g>',c:0},perplexity:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"></path></g>',c:0},cohere:{v:"0.94 0.905 22.12 22.12",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"></path></g>',c:0},ai21:{v:"-0.04 0.45 23.1 23.1",m:'<g fill-rule="evenodd"><path d="M6.47 17l-.367-1.189H2.718L2.35 17H0l3.398-9.789h2.026L8.864 17H6.47zm-2.052-6.993l-1.17 4.028H5.56l-1.142-4.028zm4.707-2.796h2.23V17h-2.23V7.211zM11.955 15c.1-.483.277-.946.524-1.37.214-.359.482-.68.795-.951.32-.273.658-.52 1.013-.741.28-.168.54-.33.781-.483.222-.14.433-.296.632-.468.172-.148.317-.325.428-.525.107-.199.16-.423.157-.65 0-.392-.104-.674-.313-.846a1.176 1.176 0 00-.775-.259 1.207 1.207 0 00-.863.329c-.231.219-.347.585-.347 1.098H11.8a3.387 3.387 0 01.224-1.245c.146-.377.371-.716.66-.993.306-.29.667-.514 1.06-.657A4.04 4.04 0 0115.183 7c.42-.002.84.057 1.244.175.376.107.73.287 1.04.531.305.246.55.562.714.923.185.419.275.875.265 1.335.005.39-.084.774-.259 1.12-.167.328-.38.63-.632.894-.246.259-.517.49-.808.693-.29.2-.554.37-.789.51-.326.224-.596.417-.809.58a3.872 3.872 0 00-.51.455 1.229 1.229 0 00-.265.434 1.633 1.633 0 00-.074.517h4.078V17h-6.606a9.24 9.24 0 01.183-2zM18.8 8.93a5.05 5.05 0 001.135-.105c.25-.049.484-.156.686-.314.163-.139.28-.324.34-.532.068-.25.1-.51.095-.77H23V17h-2.243v-6.475H18.8V8.93z"></path></g>',c:0},voyage:{v:"0.45 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"></path></g>',c:0},deepinfra:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M3.294 7.821A2.297 2.297 0 011 5.527a2.297 2.297 0 012.294-2.295A2.297 2.297 0 015.59 5.527 2.297 2.297 0 013.294 7.82zm0-3.688a1.396 1.396 0 000 2.79 1.396 1.396 0 000-2.79zM3.294 14.293A2.297 2.297 0 011 11.998a2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294 2.297 2.297 0 01-2.295 2.295zm0-3.688a1.395 1.395 0 000 2.788 1.395 1.395 0 100-2.788zM3.294 20.761A2.297 2.297 0 011 18.467a2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.295 2.294zm0-3.688a1.396 1.396 0 000 2.79 1.396 1.396 0 000-2.79zM20.738 7.821a2.297 2.297 0 01-2.295-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.294 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM20.738 14.293a2.297 2.297 0 01-2.295-2.295 2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688c-.769 0-1.395.625-1.395 1.393a1.396 1.396 0 002.79 0c0-.77-.626-1.393-1.395-1.393zM20.738 20.761a2.297 2.297 0 01-2.295-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.294 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.016 11.057a2.297 2.297 0 01-2.294-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.295 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.625-1.395-1.395-1.395zM12.017 4.589a2.297 2.297 0 01-2.295-2.295A2.297 2.297 0 0112.017 0a2.297 2.297 0 012.294 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.017 17.529a2.297 2.297 0 01-2.295-2.295 2.297 2.297 0 012.295-2.294 2.297 2.297 0 012.294 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.016 24a2.297 2.297 0 01-2.294-2.295 2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294A2.297 2.297 0 0112.016 24zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.625-1.395-1.395-1.395z"></path><path d="M8.363 8.222a.742.742 0 01-.277-.053l-1.494-.596a.75.75 0 11.557-1.392l1.493.595a.75.75 0 01-.278 1.446h-.001zM8.363 14.566a.743.743 0 01-.277-.053l-1.494-.595a.75.75 0 11.557-1.393l1.493.596a.75.75 0 01-.278 1.445h-.001zM17.124 11.397a.741.741 0 01-.277-.054l-1.493-.595a.75.75 0 11.555-1.392l1.493.595a.75.75 0 01-.278 1.446zM17.124 5.05a.744.744 0 01-.277-.054L15.354 4.4a.75.75 0 01.555-1.392l1.493.596a.75.75 0 01-.278 1.445zM17.124 17.739a.743.743 0 01-.277-.053l-1.494-.596a.75.75 0 11.556-1.392l1.493.596a.75.75 0 01-.278 1.445zM6.91 17.966a.75.75 0 01-.279-1.445l1.494-.595a.749.749 0 11.556 1.392l-1.493.595a.743.743 0 01-.277.053H6.91zM6.91 11.66a.75.75 0 01-.279-1.446l1.494-.595a.75.75 0 01.556 1.392l-1.493.595a.743.743 0 01-.277.053H6.91zM6.91 5.033a.75.75 0 01-.279-1.446l1.494-.595a.75.75 0 01.556 1.392l-1.493.596a.744.744 0 01-.277.053H6.91zM8.363 21.364a.743.743 0 01-.277-.053l-1.494-.596a.75.75 0 01.555-1.392l1.494.595a.75.75 0 01-.278 1.446zM15.63 8.223a.75.75 0 01-.278-1.447l1.494-.595a.75.75 0 01.556 1.393l-1.494.595a.744.744 0 01-.276.054h-.002zM15.63 14.567a.75.75 0 01-.278-1.446l1.494-.596a.75.75 0 01.556 1.394l-1.494.595a.743.743 0 01-.276.053h-.002zM15.63 21.363a.749.749 0 01-.278-1.445l1.494-.595a.75.75 0 11.555 1.392l-1.494.595a.741.741 0 01-.277.053z"></path></g>',c:0},sambanova:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M23 23h-1.223V8.028c0-3.118-2.568-5.806-5.744-5.806H8.027c-3.176 0-5.744 2.565-5.744 5.686 0 3.119 2.568 5.684 5.744 5.684h.794c1.346 0 2.445 1.1 2.445 2.444 0 1.346-1.1 2.446-2.445 2.446H1v-1.223h7.761c.671 0 1.223-.551 1.223-1.16 0-.67-.552-1.16-1.223-1.16h-.794C4.177 14.872 1 11.756 1 7.909 1 4.058 4.176 1 8.027 1h8.066C19.88 1 23 4.239 23 8.028V23z"></path><path d="M8.884 12.672c1.71.06 3.361 1.588 3.361 3.422 0 1.833-1.528 3.421-3.421 3.421H1v1.223h7.761c2.568 0 4.705-2.077 4.705-4.644 0-.672-.123-1.283-.43-1.894-.245-.551-.67-1.1-1.099-1.528-.489-.429-1.039-.734-1.65-.977-.525-.175-1.048-.193-1.594-.212-.218-.008-.441-.016-.669-.034-.428 0-1.406-.245-1.956-.61a3.369 3.369 0 01-1.223-1.406c-.183-.489-.305-.977-.305-1.528A3.417 3.417 0 017.96 4.482h8.066c1.895 0 3.422 1.65 3.422 3.483v15.032h1.223V8.027c0-2.568-2.077-4.768-4.645-4.768h-8c-2.568 0-4.705 2.077-4.705 4.646 0 .67.123 1.282.43 1.894a4.45 4.45 0 001.099 1.528c.429.428 1.039.734 1.588.976.306.123.611.183.976.246.857.06 1.406.123 1.466.123h.003z"></path><path d="M1 23h7.761v-.003c3.85 0 7.03-3.116 7.09-7.026 0-3.79-3.117-6.906-6.967-6.906H8.09c-.672 0-1.222-.552-1.222-1.16 0-.608.487-1.16 1.159-1.16h8.069c.608 0 1.159.611 1.159 1.283v14.97h1.223V8.024c0-1.345-1.1-2.505-2.445-2.505H7.967a2.451 2.451 0 00-2.445 2.445 2.45 2.45 0 002.445 2.445h.794c3.176 0 5.744 2.568 5.744 5.684s-2.568 5.684-5.744 5.684H1V23z"></path></g>',c:0},novita:{v:"-0.04 -0.46 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z"></path></g>',c:0},hyperbolic:{v:"-0.04 -0.04 24.08 24.08",m:'<path d="M.193 19.503a2.413 2.413 0 00-.186.925c0 1.317 1.112 2.518 2.95 3.437a1.337 1.337 0 001.838-.738l2.049-4.93c.359-.857.642-1.745.846-2.652-3.795.637-6.656 2.092-7.448 3.872l-.032.076-.017.01zm7.49-11.047a15.981 15.981 0 00-.846-2.653L4.79.873a1.34 1.34 0 00-1.84-.738C1.112 1.054 0 2.256 0 3.573c0 .317.064.631.186.924v.01l.032.077c.81 1.78 3.67 3.234 7.466 3.872zM21.049.136c1.838.918 2.95 2.12 2.95 3.436a2.454 2.454 0 01-.196.925l-.027.063c-.785 1.792-3.653 3.254-7.46 3.896.204-.907.487-1.795.846-2.653L19.21.873a1.337 1.337 0 011.839-.738zm-4.722 15.409c.201.906.48 1.793.837 2.65l2.048 4.932a1.338 1.338 0 001.838.738c1.839-.92 2.951-2.12 2.951-3.437a2.446 2.446 0 00-.186-.925l-.027-.062c-.782-1.792-3.66-3.256-7.46-3.896zm-.129-6.04c2.695-.415 4.935-1.223 6.48-2.278L22.24 8.28a9.755 9.755 0 000 7.437l.435 1.048c-1.547-1.055-3.787-1.855-6.479-2.275l-.07-.01A27.196 27.196 0 0012 14.172c-1.377-.002-2.752.1-4.114.307l-.071.01c-2.693.413-4.933 1.222-6.48 2.277l.437-1.05a9.755 9.755 0 000-7.437l-.437-1.052c1.54 1.06 3.78 1.863 6.473 2.278l.071.01c2.734.407 5.513.407 8.246 0l.071-.01z" fill="#594CE9"></path>',c:1},targon:{v:"0.7604 0.6875 24.0625 24.0625",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M20.297.7H5.289A4.496 4.496 0 00.793 5.195v15.007a4.496 4.496 0 004.496 4.496h15.008a4.496 4.496 0 004.496-4.496V5.196A4.497 4.497 0 0020.297.699zm-.518 5.134a.03.03 0 01.036-.01.03.03 0 01.018.024c.005.04.009.08.01.12.012.61.015 1.221.01 1.832a4.442 4.442 0 01-.547 2.138 4.162 4.162 0 01-2.277 1.882c-.34.12-.691.189-1.053.205-3.392.004-6.784.004-10.177 0-.071-.004-.149-.04-.159-.11a.156.156 0 01-.001-.014c-.03-1.067.317-1.988 1.042-2.764a3.855 3.855 0 012.43-1.208c2.016-.016 4.033-.025 6.05-.026.484-.025.963-.09 1.437-.195a5.856 5.856 0 001.737-.632c.208-.11.409-.233.6-.368.205-.156.394-.33.566-.524.094-.116.186-.233.278-.35zm.023 6.28c-.006-.042-.056-.05-.08-.016a4.68 4.68 0 01-.199.252 4.758 4.758 0 01-1.098.887 7.493 7.493 0 01-3.343.89l-5.907.05a2.735 2.735 0 00-.687.078 3.83 3.83 0 00-.76.293 4.08 4.08 0 00-1.536 1.398 4.007 4.007 0 00-.605 2.117c.002.037.01.074.021.11.022.048.06.074.113.076 3.417.004 6.834.004 10.25 0a7.12 7.12 0 00.327-.031 4.264 4.264 0 001.627-.627 4.071 4.071 0 001.761-2.498c.094-.425.137-.855.132-1.29 0-.563-.005-1.127-.016-1.69z"></path></g>',c:0},parasail:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M0 15.852c4.5 0 8.147 3.648 8.147 8.148H0v-8.148z"></path><path clip-rule="evenodd" d="M0 7.688v.018C9 7.706 16.294 15 16.294 24h.019l-.018-.036c3.33-.2 8.864-2.447 7.49-9.58A19.95 19.95 0 009.61.213C2.482-1.155.235 4.374.036 7.704L0 7.688z"></path></g>',c:0},lambda:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M2 2h20v20H2V2zm1.768 18.237h16.459V3.761H3.768v16.476zm3.515-14.91l3.479 6.176-3.871 7.154h2.493l2.58-4.883 2.747 4.883h2.54L9.82 5.324l-2.538.002z"></path></g>',c:0},fal:{v:"-0.04 -0.04 24.08 24.08",m:'<path clip-rule="evenodd" d="M15.477 0c.415 0 .749.338.788.752a7.775 7.775 0 006.985 6.984c.413.04.752.373.752.788v6.952c0 .415-.338.748-.752.788a7.775 7.775 0 00-6.985 6.984c-.04.414-.373.752-.788.752H8.525c-.416 0-.749-.338-.789-.752a7.775 7.775 0 00-6.984-6.984c-.414-.04-.752-.373-.752-.788V8.524c0-.415.338-.748.752-.788A7.775 7.775 0 007.736.752C7.776.338 8.11 0 8.526 0h6.95zM4.819 11.98a7.226 7.226 0 007.223 7.23 7.226 7.226 0 007.223-7.23c0-3.994-3.234-7.23-7.223-7.23a7.227 7.227 0 00-7.223 7.23z" fill="#EC0648" fill-rule="evenodd"></path>',c:1},replicate:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M22 10.552v2.26h-7.932V22H11.54V10.552H22zM22 2v2.264H4.528V22H2V2h20zm0 4.276V8.54H9.296V22H6.768V6.276H22z"></path></g>',c:0},midjourney:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M22.369 17.676c-1.387 1.259-3.17 2.378-5.332 3.417.044.03.086.057.13.083l.018.01.019.012c.216.123.42.184.641.184.222 0 .426-.061.642-.184l.018-.011.019-.011c.14-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.304-.174.612-.266.949-.266.337 0 .645.092.949.266l.023.014c.188.109.334.219.602.442l.178.148c.221.184.346.278.483.36l.028.017.018.01c.21.12.407.181.62.185h.022a.31.31 0 110 .618c-.337 0-.645-.092-.95-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.02-.014a5.356 5.356 0 01-.49-.377l-.159-.132a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.641.184l-.02.011-.018.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.95.266c-.337 0-.644-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.026-.017a4.881 4.881 0 01-.425-.325.308.308 0 01-.12-.1l-.098-.081a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.642.184l-.018.011-.019.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.023.014-.022.014-.09.054A1.868 1.868 0 0112 22c-.337 0-.645-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.021-.014a5.356 5.356 0 01-.49-.377l-.158-.132a3.836 3.836 0 00-.483-.36l-.028-.017-.018-.01a1.256 1.256 0 00-.642-.185c-.221 0-.425.061-.641.184l-.019.011-.018.011c-.141.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.511.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.986.264c-.746-.09-1.319-.38-1.89-.866l-.035-.03c-.047-.041-.118-.106-.192-.174l-.196-.181-.107-.1-.011-.01a1.531 1.531 0 00-.336-.253.313.313 0 00-.095-.03h-.005c-.119.022-.238.059-.361.11a.308.308 0 01-.077.061l-.008.005a.309.309 0 01-.126.034 5.66 5.66 0 00-.774.518l-.416.324-.055.043a6.542 6.542 0 01-.324.236c-.305.207-.552.315-.8.315a.31.31 0 01-.01-.618h.01c.09 0 .235-.062.438-.198l.04-.027c.077-.054.163-.117.27-.199l.385-.301.06-.047c.268-.206.506-.373.73-.505l-.633-1.21a.309.309 0 01.254-.451l20.287-1.305a.309.309 0 01.228.537zm-1.118.14L2.369 19.03l.423.809c.128-.045.256-.078.388-.1a.31.31 0 01.052-.005c.132 0 .26.032.386.093.153.073.294.179.483.35l.016.015.092.086.144.134.097.089c.065.06.125.114.16.144.485.418.948.658 1.554.736h.011a1.25 1.25 0 00.6-.172l.021-.011.019-.011.018-.011c.141-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.305-.174.612-.266.95-.266.336 0 .644.092.948.266l.023.014c.188.109.335.219.603.442l.177.148c.222.184.346.278.484.36l.027.017.019.01c.215.124.42.185.641.185.222 0 .426-.061.641-.184l.019-.011.018-.011c.141-.084.267-.178.493-.366l.177-.148c.28-.232.427-.342.626-.456.304-.174.612-.266.949-.266.337 0 .644.092.949.266l.025.015c.187.109.334.22.603.443 1.867-.878 3.448-1.811 4.73-2.832l.02-.016zM3.653 2.026C6.073 3.06 8.69 4.941 10.8 7.258c2.46 2.7 4.109 5.828 4.637 9.149a.31.31 0 01-.421.335c-2.348-.945-4.54-1.258-6.59-1.02-1.739.2-3.337.792-4.816 1.703-.294.182-.62-.182-.405-.454 1.856-2.355 2.581-4.99 2.343-7.794-.195-2.292-1.031-4.61-2.284-6.709a.31.31 0 01.388-.442zM10.04 4.45c1.778.543 3.892 2.102 5.782 4.243 1.984 2.248 3.552 4.934 4.347 7.582a.31.31 0 01-.401.38l-.022-.01-.386-.154a10.594 10.594 0 00-.291-.112l-.016-.006c-.68-.247-1.199-.291-1.944-.101a.31.31 0 01-.375-.218C15.378 11.123 13.073 7.276 9.775 5c-.291-.201-.072-.653.266-.55zM4.273 2.996l.008.015c1.028 1.94 1.708 4.031 1.885 6.113.213 2.513-.31 4.906-1.673 7.092l-.02.031.003-.001c1.198-.581 2.47-.969 3.825-1.132l.055-.006c1.981-.23 4.083.029 6.309.837l.066.025-.007-.039c-.593-2.95-2.108-5.737-4.31-8.179l-.07-.078c-1.785-1.96-3.944-3.6-6.014-4.65l-.057-.028zm7.92 3.238l.048.048c2.237 2.295 3.885 5.431 4.974 9.191l.038.132.022-.004c.71-.133 1.284-.063 1.963.18l.027.01.066.024.046.018-.025-.073c-.811-2.307-2.208-4.62-3.936-6.594l-.058-.065c-1.02-1.155-2.103-2.132-3.15-2.856l-.015-.011z"></path></g>',c:0},stability:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M7.223 21c4.252 0 7.018-2.22 7.018-5.56 0-2.59-1.682-4.236-4.69-4.918l-1.93-.571c-1.694-.375-2.683-.825-2.45-1.975.194-.957.773-1.497 2.122-1.497 4.285 0 5.873 1.497 5.873 1.497v-3.6S11.62 3 7.293 3C3.213 3 1 5.07 1 8.273c0 2.59 1.534 4.097 4.645 4.812l.334.083c.473.144 1.112.335 1.916.572 1.59.375 1.999.773 1.999 1.966 0 1.09-1.15 1.71-2.67 1.71C2.841 17.416 1 15.231 1 15.231v3.989S2.152 21 7.223 21z"></path><path d="M20.374 20.73c1.505 0 2.626-1.073 2.626-2.526 0-1.484-1.089-2.526-2.626-2.526-1.505 0-2.594 1.042-2.594 2.526 0 1.484 1.089 2.526 2.594 2.526z"></path></g>',c:0},suno:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M16.5 0C20.642 0 24 5.373 24 12h-9c0 6.627-3.358 12-7.5 12C3.358 24 0 18.627 0 12h9c0-6.627 3.358-12 7.5-12z"></path></g>',c:0},elevenlabs:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5 0h5v24H5V0zM14 0h5v24h-5V0z"></path></g>',c:0},fishaudio:{v:"-0.04 0.45 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M23.556 12.189c.244 0 .444.126.444.28v.951c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-.952c0-.153.2-.279.444-.279zm-1.764.372c.244 0 .444.126.444.28v2.095c0 .153-.2.279-.444.279-.245 0-.444-.126-.444-.28V12.84c0-.153.2-.28.444-.28zm-1.765.434c.244 0 .444.125.444.279v2.355c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-2.355c0-.154.2-.28.444-.28zm-1.764.359c.244 0 .444.125.444.279v2.33c0 .153-.2.279-.444.279s-.444-.126-.444-.28v-2.33c0-.153.2-.278.444-.278zm-1.765.316c.245 0 .444.126.444.28v2.017c0 .154-.2.28-.444.28s-.444-.126-.444-.28V13.95c0-.154.2-.28.444-.28zm-1.755 1.287c.244 0 .444.125.444.28v.64c0 .153-.2.278-.444.278s-.444-.125-.444-.279v-.64c0-.154.2-.28.444-.28z" opacity=".35"></path><path d="M23.556 9.63c.244 0 .444.125.444.279v1.575c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.909c0-.154.2-.28.444-.28zm-1.764-1.058c.244 0 .444.125.444.28v2.81c0 .153-.2.278-.444.278-.245 0-.444-.125-.444-.279v-2.81c0-.154.2-.28.444-.28zm-1.765-.398c.244 0 .444.126.444.28v3.667c0 .153-.2.28-.444.28s-.444-.127-.444-.28V8.453c0-.153.2-.28.444-.28zM18.263 8c.244 0 .444.126.444.28v4.29c0 .154-.2.28-.444.28s-.444-.126-.444-.28V8.28c0-.154.2-.28.444-.28zm-1.765.109c.245 0 .444.126.444.28v4.355c0 .154-.2.28-.444.28s-.444-.126-.444-.28V8.388c0-.153.2-.28.444-.28zm-1.755.273c.244 0 .444.125.444.28v5.434c0 .153-.2.28-.444.28s-.444-.126-.444-.28V8.66c0-.154.2-.28.444-.28zm-1.801.463c.244 0 .444.125.444.279v6.162c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.124c0-.154.2-.28.444-.28zm-1.764.784c.244 0 .444.126.444.28v5.928c0 .154-.2.28-.444.28-.245 0-.444-.126-.444-.28V9.909c0-.154.2-.28.444-.28zm-1.765 1.022c.245 0 .444.126.444.28v5.161c0 .154-.2.28-.444.28s-.444-.126-.444-.28V10.93c0-.154.2-.28.444-.28zm-1.764.706c.244 0 .444.126.444.28v5.084c0 .153-.2.279-.444.279s-.444-.126-.444-.28v-5.083c0-.154.2-.28.444-.28zm-1.756.585c.245 0 .444.126.444.28v2.705c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-2.706c0-.153.2-.279.444-.279zM4.076 9.304c.244 0 .444.126.444.28v3.771c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.584c0-.154.2-.28.444-.28zm-1.814.247c.244 0 .443.126.443.28v1.16c0 .153-.2.279-.443.279-.245 0-.444-.126-.444-.28V9.83c0-.153.2-.279.444-.279zM.444 9.395c.244 0 .444.126.444.28v.523c0 .153-.2.279-.444.279S0 10.351 0 10.197v-.522c0-.154.2-.28.444-.28zm5.45-.442c.244 0 .443.126.443.28v.392c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-.393c0-.154.2-.28.444-.28z"></path></g>',c:0},assemblyai:{v:"-0.04 -0.145 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M10.595 1.5a3.695 3.695 0 00-3.444 2.355L0 22.26h5.432l5.629-14.486h.002a.96.96 0 011.782 0h.75V4.835h-1.393L13.498 1.5h-2.902z"></path><path d="M7.151 3.855a3.695 3.695 0 013.26-2.35l-.002-.005H13.405c1.524 0 2.893.936 3.444 2.355L24 22.26h-5.525L11.54 4.413a2.528 2.528 0 00-4.609.006l.22-.564z"></path></g>',c:0},siliconcloud:{v:"-0.04 0.205 24.08 24.08",m:'<path clip-rule="evenodd" d="M22.956 6.521H12.522c-.577 0-1.044.468-1.044 1.044v3.13c0 .577-.466 1.044-1.043 1.044H1.044c-.577 0-1.044.467-1.044 1.044v4.174C0 17.533.467 18 1.044 18h10.434c.577 0 1.044-.467 1.044-1.043v-3.13c0-.578.466-1.044 1.043-1.044h9.391c.577 0 1.044-.467 1.044-1.044V7.565c0-.576-.467-1.044-1.044-1.044z" fill="#6E29F6" fill-rule="evenodd"></path>',c:1},volcengine:{v:"0.87 -0.04 22.05 22.05",m:'<g fill-rule="evenodd"><path d="M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z" fill-opacity=".5"></path><path clip-rule="evenodd" d="M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z"></path><path d="M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z" fill-opacity=".5"></path><path clip-rule="evenodd" d="M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z"></path><path d="M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z"></path></g>',c:0},doubao:{v:"0.135 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5.31 15.756c.172-3.75 1.883-5.999 2.549-6.739-3.26 2.058-5.425 5.658-6.358 8.308v1.12C1.501 21.513 4.226 24 7.59 24a6.59 6.59 0 002.2-.375c.353-.12.7-.248 1.039-.378.913-.899 1.65-1.91 2.243-2.992-4.877 2.431-7.974.072-7.763-4.5l.002.001z" fill-opacity=".5"></path><path d="M22.57 10.283c-1.212-.901-4.109-2.404-7.397-2.8.295 3.792.093 8.766-2.1 12.773a12.782 12.782 0 01-2.244 2.992c3.764-1.448 6.746-3.457 8.596-5.219 2.82-2.683 3.353-5.178 3.361-6.66a2.737 2.737 0 00-.216-1.084v-.002zM14.303 1.867C12.955.7 11.248 0 9.39 0 7.532 0 5.883.677 4.545 1.807 2.791 3.29 1.627 5.557 1.5 8.125v9.201c.932-2.65 3.097-6.25 6.357-8.307.5-.318 1.025-.595 1.569-.829 1.883-.801 3.878-.932 5.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z"></path><path d="M17.305 4.961a199.47 199.47 0 01-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648 2.786.869 5.617 3.288.395 6.185 1.898 7.396 2.8-1.306-1.275-3.475-3.487-5.266-5.323z" fill-opacity=".5"></path></g>',c:0},hunyuan:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"></path></g>',c:0},yuanbao:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12.014.648c-6.628 0-12 5.09-12 11.367 0 6.277 5.372 11.366 12 11.366s12-5.09 12-11.366c0-6.277-5.372-11.367-12-11.367zm5.849 15.481c-4.305 3.1-10.584 2.523-13.481-1.444-2.86-3.918-1.351-9.703 2.685-13.02-1.866 1.676-2.67 5.01-1.282 6.909 1.471 2.015 4.794 1.746 6.958.113 2.435-1.84 6.036-1.794 7.234.954.91 2.208.067 4.93-2.114 6.487v.001z"></path><path d="M14.81 14.914a.669.669 0 01-.536-.269l-1.02-1.37a.67.67 0 01.005-.807l1.021-1.328a.669.669 0 011.06.814l-.713.926.72.964a.67.67 0 01-.534 1.067l-.002.003zM10.877 12.913c0 1.797-.357 2.135-1.162 2.135-.805 0-1.162-.338-1.162-2.135 0-1.798.357-2.136 1.162-2.136.805 0 1.162.338 1.162 2.136z"></path></g>',c:0},stepfun:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"></path></g>',c:0},sensenova:{v:"0.975 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M23 8.333h-7.333v7.334H23V8.333z"></path><path d="M1 1v14.667h7.333V8.333h7.334V1H1z" fill-opacity=".33"></path><path d="M14.038 4.333h.17l1.459 1.456v.17l-1.63-1.626zM13.224 4.333h.17l2.273 2.268v.17l-2.443-2.438zM12.41 4.333h.17l3.087 3.08v.17l-3.257-3.25zM11.596 4.333h.17l3.9 3.892v.108h-.06l-4.01-4zM10.782 4.333h.17l4.01 4h-.17l-4.01-4zM9.968 4.333h.17l4.009 4h-.17l-4.01-4zM9.154 4.333h.17l4.009 4h-.17l-4.01-4zM8.34 4.333h.17l4.01 4h-.17l-4.01-4zM7.521 4.333h.17l4.01 4h-.17l-4.01-4zM6.707 4.333h.17l4.01 4h-.17l-4.01-4zM5.892 4.333h.17l4.009 4h-.17l-4.01-4zM5.077 4.333h.17l4.01 4h-.17l-4.01-4zM4.333 4.403v-.07h.1l4.01 4h-.11v.06l-4-3.99zM4.333 5.215v-.17l4 3.991v.17l-4-3.99zM4.333 6.027v-.17l4 3.991v.17l-4-3.99zM4.333 6.84v-.17l4 3.99v.17l-4-3.99zM4.333 7.652v-.17l4 3.99v.17l-4-3.99zM4.333 8.464v-.17l4 3.99v.17l-4-3.99zM4.333 9.276v-.17l4 3.991v.17l-4-3.991zM4.333 10.088v-.17l4 3.991v.17l-4-3.991zM4.333 10.9v-.17l4 3.991v.17l-4-3.991zM4.333 11.712v-.17l4 3.991v.134h-.036l-3.964-3.955zM4.333 12.526v-.17l3.318 3.31h-.17l-3.148-3.14zM4.333 13.34v-.169l2.502 2.496h-.17L4.333 13.34zM4.333 14.152v-.169l1.688 1.684h-.17l-1.518-1.514zM4.333 14.965v-.17l.874.872h-.17l-.704-.702zM15.667 5.146l-.815-.813h.17l.645.644v.169z"></path><path d="M23 15.667h-7.333V23H23v-7.333z" fill-opacity=".33"></path><path d="M15.667 15.667H8.333V23h7.334v-7.333z"></path></g>',c:0},baichuan:{v:"-0.04 0.975 22.05 22.05",m:'<g fill-rule="evenodd"><path d="M7.333 2h-3.2l-2 4.333V17.8L0 22h5.2l2.028-4.2L7.333 2zm7.334 0h-5.2v20h5.2V2zM16.8 7.733H22V22h-5.2V7.733zM22 2h-5.2v4.133H22V2z"></path></g>',c:0},yi:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M18.62 13.927c.611 0 1.107.505 1.107 1.128v5.817c0 .623-.496 1.128-1.108 1.128a1.118 1.118 0 01-1.108-1.128v-5.817c0-.623.496-1.128 1.108-1.128zM16.59 3.052a1.094 1.094 0 011.562-.129c.466.404.522 1.116.126 1.59l-5.938 7.111v9.147c0 .624-.496 1.129-1.108 1.129a1.118 1.118 0 01-1.108-1.129v-9.477l.003-.088.01-.087c.015-.232.102-.462.261-.654l6.192-7.413zM2.906 2.256a1.094 1.094 0 011.559.157l4.387 5.45a1.142 1.142 0 01-.155 1.587 1.094 1.094 0 01-1.559-.157l-4.387-5.45a1.144 1.144 0 01.06-1.498l.095-.09z"></path><ellipse cx="20.146" cy="10.692" rx="1.354" ry="1.379"></ellipse></g>',c:0},codex:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"></path></g>',c:0},grok:{v:"0.03 0.065 23.94 23.94",m:'<g fill-rule="evenodd"><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></g>',c:0},cline:{v:"-0.005 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M17.035 3.991c2.75 0 4.98 2.24 4.98 5.003v1.667l1.45 2.896a1.01 1.01 0 01-.002.909l-1.448 2.864v1.668c0 2.762-2.23 5.002-4.98 5.002H7.074c-2.751 0-4.98-2.24-4.98-5.002V17.33l-1.48-2.855a1.01 1.01 0 01-.003-.927l1.482-2.887V8.994c0-2.763 2.23-5.003 4.98-5.003h9.962zM8.265 9.6a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 004.547 0v-4.042A2.274 2.274 0 008.265 9.6zm7.326 0a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 104.548 0v-4.042A2.274 2.274 0 0015.59 9.6z"></path><path d="M12.054 5.558a2.779 2.779 0 100-5.558 2.779 2.779 0 000 5.558z"></path></g>',c:0}},l={openai:"openai","openai-codex":"openai",anthropic:"anthropic",google:"gemini","google-vertex":"vertexai",xai:"xai",mistral:"mistral",deepseek:"deepseek",moonshotai:"moonshot","moonshotai-cn":"moonshot","kimi-coding":"kimi",minimax:"minimax","minimax-cn":"minimax",zai:"zhipu","zai-coding-cn":"zhipu",xiaomi:"xiaomi","xiaomi-token-plan-ams":"xiaomi","xiaomi-token-plan-cn":"xiaomi","xiaomi-token-plan-sgp":"xiaomi",nvidia:"nvidia",huggingface:"huggingface","qwen-token-plan":"qwen","qwen-token-plan-cn":"qwen","qwen-token-plan-individual":"qwen",openrouter:"openrouter","vercel-ai-gateway":"vercel","cloudflare-ai-gateway":"cloudflare","cloudflare-workers-ai":"cloudflare","amazon-bedrock":"bedrock","azure-openai-responses":"azure",together:"together",fireworks:"fireworks",baseten:"baseten",cerebras:"cerebras",groq:"groq","github-copilot":"github",opencode:"opencode","opencode-go":"opencode","command-goat":"commandcode",commandcode:"commandcode","command-code":"commandcode",cliproxy:"cliproxy",ollama:"ollama",vllm:"vllm",lmstudio:"lmstudio",perplexity:"perplexity",cohere:"cohere",ai21:"ai21",voyage:"voyage",deepinfra:"deepinfra",sambanova:"sambanova",novita:"novita",hyperbolic:"hyperbolic",targon:"targon",parasail:"parasail",lambda:"lambda",fal:"fal",replicate:"replicate",midjourney:"midjourney",stability:"stability",suno:"suno",elevenlabs:"elevenlabs",fishaudio:"fishaudio",assemblyai:"assemblyai",siliconcloud:"siliconcloud",volcengine:"volcengine",doubao:"doubao",hunyuan:"hunyuan",yuanbao:"yuanbao",stepfun:"stepfun",sensenova:"sensenova",baichuan:"baichuan",yi:"yi",codex:"codex",grok:"grok",gemini:"gemini",cline:"cline"},i=[["openrouter","openrouter"],["opencode-go","opencode"],["opencode","opencode"],["openai-codex","openai"],["openai","openai"],["azure","azure"],["bedrock","bedrock"],["anthropic","anthropic"],["claude","anthropic"],["gemini","gemini"],["google","gemini"],["vertex","vertexai"],["deepseek","deepseek"],["moonshot","moonshot"],["kimi","kimi"],["minimax","minimax"],["zhipu","zhipu"],["zai","zhipu"],["glm","zhipu"],["xiaomi","xiaomi"],["mimo","xiaomi"],["qwen","qwen"],["nvidia","nvidia"],["huggingface","huggingface"],["vercel","vercel"],["cloudflare","cloudflare"],["together","together"],["fireworks","fireworks"],["baseten","baseten"],["cerebras","cerebras"],["groq","groq"],["github","github"],["copilot","github"],["cline","cline"],["perplexity","perplexity"],["cohere","cohere"],["ollama","ollama"],["vllm","vllm"],["lmstudio","lmstudio"],["siliconcloud","siliconcloud"],["siliconflow","siliconcloud"],["volcengine","volcengine"],["doubao","doubao"],["hunyuan","hunyuan"],["yuanbao","yuanbao"],["stepfun","stepfun"],["sensenova","sensenova"],["baichuan","baichuan"],["xai","xai"],["grok","grok"],["mistral","mistral"]],d="data-dshsvc-model-icon",c="data-dshsvc-model-icon-seat",u="--dshsvc-model-icon",p="--dshsvc-model-icon-size",m="data-dshsvc-model-icon-trigger",g="conversation.input.model",h='button[aria-haspopup="menu"]',f='button[class*="_7KE1Ra_trigger"]',b="--dsh-composer-model-icon-display",v="data-dshsvc-model-group",y="data-dshsvc-model-group-icon",w="[data-menu-group-heading]",x='[class*="_7KE1Ra_groupTitle"]',k=(e,t)=>{const a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.v||"0 0 24 24"}"${t?' fill="#000" color="#000"':""}>${e.m}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},S={snapshot:{providers:[],serverTime:0},listeners:new Set,subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},getSnapshot(){return this.snapshot},publish(e){this.snapshot=e;for(const e of[...this.listeners])try{e()}catch(e){}}},E={"opencode-go":"opencode","zai-coding-cn":"zhipu",openrouter:"openrouter",kimi:"kimi",siliconflow:"siliconcloud",deepseek:"deepseek",cliproxy:"cliproxy","xiaomi-token-plan-cn":"xiaomi",stepfun:"stepfun","stepfun-step-plan":"stepfun","command-goat":"commandcode"},C=e=>{if("string"!=typeof e||""===e)return null;const t=e.trim().toLowerCase();try{if("object"!=typeof S||null===S||"function"!=typeof S.getSnapshot)return null;const e=S.getSnapshot(),a=(Array.isArray(e?.providers)?e.providers:[]).find(e=>("string"==typeof e?.provider?e.provider.trim().toLowerCase():"")===t&&!0===e.adapted&&(void 0===e.kindSource||"config"===e.kindSource));return void 0!==a&&"string"==typeof a.kind?a.kind:null}catch(e){return null}},T=(e,t={})=>{if("string"!=typeof e||""===e)return null;const a=e.trim().toLowerCase();if(""===a)return null;const r=!0===t.forComposer,s="string"==typeof t.quotaKind?t.quotaKind:null===t.quotaKind?null:C(a),n="cliproxy"===s,d=e=>"cliproxy"===e&&r&&!n,c=l[a];if(void 0!==c&&void 0!==o[c])return d(c)?null:{slug:c,spec:o[c]};for(const[e,t]of i)if((a===e||a.startsWith(e+"-")||a.startsWith(e+"_")||a.startsWith(e+"."))&&!d(t)&&void 0!==o[t])return{slug:t,spec:o[t]};if(void 0!==o[a])return d(a)?null:{slug:a,spec:o[a]};for(const e of a.split(/[-_.]/))if(""!==e&&void 0!==o[e]){if(d(e))continue;return{slug:e,spec:o[e]}}const u=null===s?void 0:E[s];return void 0!==u&&void 0!==o[u]?d(u)?null:{slug:u,spec:o[u]}:null},q=(e,t=14,a={},s)=>{if("string"!=typeof e||""===e)return null;const n=T(e,{forComposer:!0});if(null===n)return null;const o=1!==n.spec.c,l=k(n.spec,o),i={display:"inline-block",width:`${t}px`,height:`${t}px`,flexShrink:0,...a},d=`${l} center / contain no-repeat`;return o?(i.backgroundColor="currentColor",i.WebkitMask=d,i.mask=d):(i.backgroundImage=l,i.backgroundPosition="center",i.backgroundSize="contain",i.backgroundRepeat="no-repeat"),r.createElement("span",{..."string"==typeof s&&""!==s?{"data-testid":s}:{},"data-dshsvc-model-icon":n.slug,"aria-hidden":!0,style:i})},A=`\n/* 宽态:模型名前加厂家图标(::before 是触发钮 flex 行的首个子项)。\n 官方 triggerIcon 在宽态本就 display:none(走 --dsh-composer-model-icon-display\n 的默认值),故宽态不会与官方图标重复。\n 选择器只认**自有属性**:触发钮由引擎运行期按官方稳定锚点找到并打标(见\n MODEL_ICON_TRIGGER_ATTR 的说明——官方类名哈希随构建漂移,桌面端与发行包不是\n 同一套,写死即在桌面端全灭)。当年限定 button 是为了绕开子串匹配把\n triggerLabel / triggerEffort 也命中(首版真机三枚并排);改认自有属性后命中面\n 由打标那一步保证,与类名无关。 */\nhtml [${m}][${d}]::before {\n content: '' !important;\n flex: none !important;\n display: block !important;\n /* 尺寸对齐额度圆环:圆环可见外径 13px(14px 的 SVG 盒,外圈 r=5.5 + 2 描边)。\n 图标是实心块面、圆环是细描边环,同直径下实心更重,故基准取略小的 15px 让\n 「视觉重量」相当(真机像素量测校准,见 scripts/measure-icon-ink.mjs)。\n 能定一个统一数字的前提是生成期已把每个图标的 viewBox 收紧到真实绘制范围——\n 否则各品牌留白不同,同一个数字画出来大小参差(⌘ 曾经只占 55%)。\n 变量留给「形状填充率」这一层:满框形状(如 ⌘)即使外接尺寸相同也更显大,\n 由数据里的光学系数 o 单独修正,见生成器 OPTICAL_SCALE。 */\n width: var(${p}, 15px) !important;\n height: var(${p}, 15px) !important;\n background-color: currentColor !important;\n -webkit-mask: var(${u}) center/contain no-repeat !important;\n mask: var(${u}) center/contain no-repeat !important;\n}\n/* 彩色档:原样上品牌色(去掉 mask,改用 background-image)。\n 选择器与上方单色规则同为「触发钮属性 + 一个档位属性」两个属性门,特异性相同,\n 靠**定义顺序**保证 !important 级联下后定义的 mask:none / transparent 胜出。 */\nhtml [${m}][${c}="color"]::before {\n background-color: transparent !important;\n -webkit-mask: none !important;\n mask: none !important;\n background-image: var(${u}) !important;\n background-position: center !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n}\n/* 窄态「替换」:我方图标已表达厂家,官方那枚通用 IconDataOutline16 必须让位,\n 否则两枚图标并排。两条门覆盖两种进入图标态的方式:\n ① ≤480px —— 本插件移动端显式把模型钮收成图标的那一档;\n ② 官方自己的容器查询 —— 容器 ≤360px 时官方本就切到图标态。\n 两态都只在「已适配」时才有官方图标要藏:属性是 JS 按 provider 命中后才挂的,\n 未命中渠道官方图标完全照旧。\n **选择器必须同时带两个自有属性**(而不是只带 seat 属性):mobile.css 里那条\n 「移动端作用域属性 + triggerIcon → display:block!important」与本规则同为\n !important、特异性也同为 (0,2,1),而 mobile.css 在样式表顺序上排在后面——\n 平局由顺序裁决,官方图标就会赢回来(真机实测:窄态出现两枚图标)。\n 多带一个自身属性把特异性提到 (0,3,1),即与插入顺序解耦,不依赖谁先挂。\n 刻意不引用移动端作用域属性:本规则与移动端适配开关无关(关掉移动端适配、\n 窄窗口下官方同样会收成图标),也避免与移动端引擎的挂载断言互相牵连。\n **下面两条只是老宿主兜底**:选择器里的类名哈希在 DSH 桌面端一个都命中不到(那边是\n 另一套命名空间),桌面端走的是「引擎把 --dsh-composer-model-icon-display 在触发钮上\n 压成 none」——官方 triggerIcon 的 display 读的就是这个变量,而桌面端 mobile.css 的\n 哈希规则同样不命中,没有 !important 竞争者,故变量足以解决。在命中哈希的老发行包上,\n mobile.css 的 display:block!important 会参与竞争,只有这两条 !important 压得住。 */\n@media (max-width: 480px) {\n html [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n}\n@container (width<=360px) {\n html [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n}\nhtml [data-model-compact] [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n/* 模型选择弹窗:分组标题(厂家/渠道商)**前**的同一枚图标。\n 与座上那枚同一套渲染路径(mono 走 mask+currentColor、彩色走 background-image),\n 但挂载机制不同:菜单是运行期才 portal 出来的 DOM、每组是**不同**的 provider,\n 没有稳定独占座可挂,所以由引擎逐组插一个真实节点并打上自有属性门。\n 不能改用标题的伪元素:伪元素只能排在标题既有内容**之后**(表现为「渠道名后」),\n 而需求是名字**前**——插入节点(firstChild 之前)是唯一能满足位置的做法。\n 未命中渠道的组不写属性、不插节点,这里也就没有匹配对象——官方标题零改动。 */\nhtml [${v}] [${y}] {\n display: inline-block !important;\n /* 标题一行 12px(官方 line-height 18px),图标同量级并贴基线;\n 右侧留 5px 让图标与渠道名之间的缝隙与官方行内间距相当。 */\n width: var(${p}, 13px) !important;\n height: var(${p}, 13px) !important;\n margin-right: 5px !important;\n vertical-align: -2px !important;\n background-color: currentColor !important;\n -webkit-mask: var(${u}) center/contain no-repeat !important;\n mask: var(${u}) center/contain no-repeat !important;\n}\n/* 彩色档:与座上同规——去掉 mask、改用 background-image 上品牌色。\n 选择器同样带 [${d}] 保持特异性平齐,保证 !important 级联下后一条胜出;\n 属性同时挂在标题与图标节点上(标题那份让「哪些组被装饰过」在 DOM 上可读)。 */\nhtml [${v}][${c}="color"] [${y}] {\n background-color: transparent !important;\n -webkit-mask: none !important;\n mask: none !important;\n background-image: var(${u}) !important;\n background-position: center !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n}\n`,z=(e,t,a)=>{try{null!=e&&"function"==typeof e.setAttribute&&e.setAttribute(t,a)}catch(e){}},M=(e,t)=>{try{null!=e&&"function"==typeof e.removeAttribute&&e.removeAttribute(t)}catch(e){}},I=(e,t)=>{try{return null!=e&&"function"==typeof e.hasAttribute&&!0===e.hasAttribute(t)}catch(e){return!1}},R=(e,t)=>{try{return null!=e&&"function"==typeof e.getAttribute?e.getAttribute(t):null}catch(e){return null}},O=(e,t,a)=>{try{null!=e&&e.style&&"function"==typeof e.style.setProperty&&e.style.setProperty(t,a)}catch(e){}},H=(e,t)=>{try{null!=e&&e.style&&"function"==typeof e.style.removeProperty&&e.style.removeProperty(t)}catch(e){}},D="@gehennawu/dsh-service/editor",L=["md","markdown","mdx","txt","text","log","ini","toml","conf","cfg","env","json","jsonc","json5","yml","yaml","xml","csv","tsv","diff","patch","ts","mts","cts","js","mjs","cjs","jsx","tsx","vue","svelte","astro","css","scss","sass","less","html","htm","sh","bash","zsh","fish","ps1","bat","cmd","py","pyi","rb","go","rs","java","kt","kts","c","h","cc","cpp","cxx","hpp","hh","cs","php","sql","swift","lua","pl","pm","r","dart","scala","clj","ex","exs","erl","hs","ml","nim","zig","vim","el","emacs","lisp","scm","gradle","properties","dockerfile","makefile","gitignore","gitattributes","gitconfig","editorconfig","npmrc","nvmrc","eslintignore","prettierignore"],N="data-dshsvc-editor-entry",W="data-dshsvc-editor-menu-item",B="[data-document-viewer-menu]",P=()=>{try{return"undefined"==typeof document||null===document?null:document}catch(e){return null}},j=(e,t)=>{try{return Array.from(e.querySelectorAll(t))}catch(e){return[]}},$=e=>String(e?.textContent??"").trim(),_=e=>({borderRadius:e,cornerShape:"round"}),V=e=>{let t="";try{const a=e.search(/[?#]/),r=(-1===a?e:e.slice(0,a)).slice(e.lastIndexOf("/")+1);t=decodeURIComponent(r)}catch(e){return!1}const a=t.toLowerCase();return L.some(e=>a.endsWith("."+e)||a===e)},F=e=>{if(null==e)return null;try{if("function"==typeof e.closest){const t=e.closest("[data-document-preview]");if(null!=t){const e=t.querySelector(B);if(null!=e)return e}}}catch(e){}try{let t="function"==typeof e.closest?e.parentElement:e.parentNode;const a=P();for(;null!=t&&t!==a&&"function"==typeof t.querySelector;){const e=t.querySelector(B);if(null!=e)return e;t=t.parentNode}}catch(e){}return null},U=new Set;let K={isAlive:()=>!1,dispose:()=>{}};const G=(e,t,a={})=>{const r=a?.menu;if(null===e||null==r)return!1;const s="function"==typeof a?.isAlive?a.isAlive:()=>!0;if(!s())return!1;const n=()=>j(e,'[role="menuitem"], [role="option"]').find(e=>!((e,t)=>{try{return"function"==typeof e?.getAttribute&&null!==e.getAttribute(t)}catch(e){return!1}})(e,W)&&t($(e))),o=e=>{try{e.click()}catch(e){return!1}return!0};let l=0;try{l=j(e,B).length}catch(e){l=0}if(l<=1){const e=n();if(void 0!==e)return o(e)}try{r.click()}catch(e){return!1}if(!s())return!1;const i=n();if(void 0!==i)return o(i);let d=12;const c=()=>{d<=0||!s()||(d-=1,"function"==typeof setTimeout&&setTimeout(()=>{if(s()){try{const e=n();if(void 0!==e)return void o(e)}catch(e){}c()}},60))};return c(),!1},Y={"nav.label":"服务控制","nav.restart":"重启","features.cardTitle":"服务控制(dsh-service)","features.cardHint":"控制可选功能和外部能力。开关立即生效,无需重启。","features.external":"外部能力","features.healthDiagnostics":"健康诊断","features.modelUsage":"模型统计","features.quotaLookup":"额度查询","features.backupMaintenance":"备份维护","features.taskNotifications":"任务通知","features.healthz":"/healthz 探活端点","features.skillManager":"技能管理","features.readOnly":"当前设置不可写。","tabs.skills":"技能","tabs.subagent":"子代理","tabs.sessions":"会话管理","features.subagentRoute":"子代理模型","features.mobileAdaptation":"移动端适配","features.sessionManager":"会话管理","sessions.title":"会话管理","sessions.filter.all":"全部","sessions.filter.archived":"仅归档","sessions.filter.deleted":"已删除","sessions.filter.subagent":"仅子代理","sessions.refresh":"刷新","sessions.batch.enter":"批量选择","sessions.batch.exit":"退出批量","sessions.batch.selectAll":"全选","sessions.batch.clearAll":"取消全选","sessions.batch.selectSubagents":"选中子代理","sessions.batch.selected":"已选择 {count} 项","sessions.batch.selectRow":"选择会话:{title}","sessions.batch.export":"导出 ({count})","sessions.batch.archive":"归档 ({count})","sessions.batch.unarchive":"恢复 ({count})","sessions.batch.delete":"删除 ({count})","sessions.batch.clear":"清除 ({count})","sessions.batch.completed":"已完成{action}:{count} 项","sessions.batch.failed":"{action}完成 {done}/{total} 项;{error}","sessions.batch.deleteTitle":"删除 {count} 个会话","sessions.batch.deleteBody":"将永久删除以下已归档会话的日志文件,删除后不可恢复。","sessions.batch.deleteItem":"{title}({bytes})","sessions.batch.clearTitle":"清除 {count} 条已删除记录","sessions.batch.clearBody":"确定要清除以下 {count} 条已删除记录吗?清除后将从记录列表中永久移除。","sessions.status.loading":"加载中…","sessions.status.working":"处理中…","sessions.status.unavailableTime":"时间未知","sessions.glyph.expand":"▸","sessions.glyph.collapse":"▾","sessions.glyph.back":"←","sessions.search.placeholder":"搜索对话内容…","sessions.search.archivedOnly":"仅搜归档","sessions.sort.createdDesc":"创建时间倒序","sessions.sort.createdAsc":"创建时间正序","sessions.sort.title":"按标题","sessions.sort.project":"按项目","sessions.projectGroup.countOne":"1 个会话","sessions.projectGroup.countMany":"{count} 个会话","sessions.projectGroup.noCwd":"(无工作区)","sessions.row.live":"运行中","sessions.row.archived":"已归档","sessions.row.deleted":"已删除","sessions.row.subagent":"子代理","sessions.subagent.hostLegacy":"当前插件宿主较旧,列表未携带子代理标志;升级插件并重启 dsh 后「仅子代理」才会生效","sessions.row.events":"{count} 条事件","sessions.row.noTitle":"(无标题)","sessions.action.view":"查看","sessions.action.export":"导出","sessions.action.archive":"归档","sessions.action.unarchive":"恢复","sessions.action.delete":"删除","sessions.action.clear":"清除","sessions.empty.all":"没有会话","sessions.empty.archived":"没有归档会话","sessions.empty.deleted":"暂无删除记录","sessions.empty.search":"没有命中「{query}」","sessions.error.load":"加载失败:{error}","sessions.error.feature-disabled":"会话管理功能已在设置中关闭","sessions.error.network":"网络错误:无法连接宿主","sessions.error.session-not-found":"会话不存在或已被删除","sessions.error.live-session-rejected":"会话正在运行,无法删除","sessions.error.session-not-archived":"仅已归档会话可以删除","sessions.error.unknown-delete-plan":"删除请求已失效,请重新发起","sessions.error.invalid-session-ids":"无效的会话标识","sessions.error.unarchive-unsupported":"当前宿主不支持恢复归档(需要 DSH ≥ 0.1.6)","sessions.error.export-failed":"导出失败:{error}","sessions.detail.back":"返回列表","sessions.detail.open":"在官方会话中打开","sessions.detail.archiveDisabled":"归档会话/空白会话无法在官方界面打开","sessions.detail.exportAll":"导出全部 ZIP","sessions.detail.exporting":"正在导出…","sessions.detail.loadMore":"加载更多({remaining})","sessions.detail.noMore":"已加载全部 {total} 条事件","sessions.detail.noise":"系统事件","sessions.detail.noiseBlock":"{count} 条系统事件","sessions.detail.noiseExpand":"展开全部","sessions.detail.noiseCollapse":"收起","sessions.detail.toolBlock":"{count} 条工具消息","sessions.detail.toolCollapse":"收起","sessions.detail.cwd":"{cwd}","sessions.detail.created":"创建于 {time}","sessions.md.copy":"复制","sessions.md.copied":"已复制","sessions.md.footnotes":"脚注","sessions.hit.title":"命中 {count} 条","sessions.hit.return":"返回搜索结果","sessions.hit.badge":"命中","sessions.hit.prev":"◀ 上一个","sessions.hit.next":"下一个 ▶","sessions.hit.inSession":"本会话 {count} 处命中","sessions.delete.title":"删除会话","sessions.delete.body":"将永久删除以下会话的日志文件,删除后不可恢复。","sessions.delete.consequence.log":"删除会话日志({bytes})","sessions.delete.consequence.sidebar":"会话从官方侧栏隐藏","sessions.delete.confirm":"确认删除","sessions.delete.cancel":"取消","sessions.delete.done":"已删除","sessions.clear.title":"清除已删除记录","sessions.clear.body":"确定要清除该条已删除记录吗?清除后将从记录列表中永久移除。","sessions.clear.confirm":"确认清除","sessions.clear.cancel":"取消","sessions.export.includes":"含子代理与附件","sessions.navToggle":"设置页左列显示「会话管理」入口","sessions.oneWay":"归档不可恢复","sessions.oneWayHint":"归档后会话从官方侧栏隐藏;官方不支持恢复归档,只能通过本面板删除。","mobile.fab.label":"打开侧栏菜单","mobile.debug.title":"移动端诊断","mobile.debug.viewport":"视口","mobile.debug.drawer":"抽屉","mobile.debug.sidebarPanel":"右栏","mobile.debug.details":"预览列","mobile.debug.rightbar":"右栏","mobile.debug.errors":"JS 错误","mobile.debug.stateOn":"开","mobile.debug.stateOff":"关","mobile.debug.immersive":"沉浸","mobile.debug.immersive.reason.gesture":"滑动回显","mobile.debug.immersive.reason.arrival":"到底回显","mobile.debug.immersive.reason.focus":"聚焦回显","mobile.debug.immersive.reason.button":"回底钮回显","mobile.debug.edge":"边缘","mobile.debug.edge.fieldStart":"起","mobile.debug.edge.fieldMoves":"动","mobile.debug.edge.fieldLast":"末","mobile.debug.edge.fieldCancel":"消","mobile.debug.edge.fieldReason":"因","mobile.debug.edge.open":"开","mobile.debug.edge.leftOpen":"左开","mobile.debug.edge.rightOpen":"右开","mobile.debug.edge.leftClose":"左关","mobile.debug.edge.rightClose":"右关","mobile.debug.edge.reason.multiTouch":"多指","mobile.debug.edge.reason.modal":"模态","mobile.debug.edge.reason.hScroll":"横滚","mobile.debug.edge.reason.noPoint":"无触点","mobile.debug.edge.reason.absentRight":"右栏缺席","mobile.debug.edge.reason.badButton":"右栏钮不可用","mobile.debug.edge.reason.noTracker":"无追踪","conversation.jump.previousReply":"上一条用户回复","subagent.title":"子代理模型","subagent.loading":"读取配置…","subagent.hint":"控制未显式指定模型的子代理所用模型;显式指定的不受影响。切换模式不会清除已保存的自定义模型与回退列表,切回「自定义」即恢复。","subagent.mode.label":"模式","subagent.mode.inherit":"初始(不干预)","subagent.mode.inherit.desc":"不注入任何路由,保持宿主原生继承行为:子代理使用会话创建时烘焙的默认模型。","subagent.mode.follow":"跟随主模型","subagent.mode.follow.desc":"每次派生时读取主对话当前实际使用的模型(最近一次请求的渠道)并注入。","subagent.mode.custom":"自定义","subagent.mode.custom.desc":"所有未显式指定模型的子代理固定使用下方选择的模型。","subagent.preset":"Agent 预设","subagent.preset.inherit":"跟随父代(默认)","subagent.preset.desc":"为派生的子代理统一指定独立 Agent 预设(角色与工具随预设);留空跟随父代当前预设。调用方显式指定的预设优先,且仅对支持独立预设的派生后端生效。","subagent.preset.empty":"宿主未提供可用的预设清单(需要 0.2.1-alpha.3+ 宿主)。","subagent.provider":"供应商","subagent.model":"模型","subagent.reasoningEffort":"思考等级","subagent.reasoningEffort.default":"使用模型默认(不指定)","subagent.reasoningEffort.unavailable":"该模型未声明可选思考等级","subagent.modelsEmpty":"模型清单为空:无法解析宿主 LLM 渠道。","subagent.save":"保存","subagent.saved":"已保存","subagent.reset":"重置回初始配置","subagent.saving":"保存中…","subagent.unavailable":"宿主未提供子代理注册表(subagents 服务缺席),配置不会生效。","subagent.error":"操作失败:{error}","subagent.error.feature-disabled":"子代理模型功能已在设置中关闭","subagent.error.llm-unavailable":"宿主 LLM 服务不可用","subagent.error.unknown-mode":"未知模式","subagent.error.invalid-model-route":"供应商或模型不在宿主清单内","subagent.error.invalid-reasoning-effort":"思考等级不受该模型支持,请重新选择","subagent.error.network":"网络错误:无法连接宿主","subagent.fallback.title":"回退模型(按顺序)","subagent.fallback.item":"回退 {index}","subagent.fallback.hint":"第一路由不可用时(渠道已卸载、额度查询判定不可服务)依次尝试回退;全部不可用则回落原生继承,不让派生失败。","subagent.fallback.add":"添加回退","subagent.fallback.sort":"调整排序","subagent.fallback.sort.done":"完成排序","subagent.fallback.remove":"移除","subagent.fallback.up":"上移","subagent.fallback.down":"下移","subagent.fallback.empty":"未添加回退:第一路由不可用时子代理回落到原生继承。","subagent.fallback.limit":"已达上限({max} 个)","subagent.error.invalid-fallback-route":"回退条目不在宿主清单内,请重新选择","subagent.dock.label":"子代理:","subagent.dock.title":"输入框下方显示子代理信息","skills.error":"操作失败:{error}","skills.error.feature-disabled":"技能管理功能已在设置中关闭","skills.error.network":"网络错误,请稍后重试","skills.error.read-only-source":"该条目位于只读来源,无法修改","skills.error.unknown-skill":"技能未找到,列表可能已变化,请刷新重试","skills.error.invalid-skill":"条目当前无效:{reason}","skills.error.invalid-field":"开关字段无效","skills.error.invalid-enable":"开关值无效","skills.error.invalid-model-route":"模型路由无效,请重新选择模型","skills.error.invalid-description":"描述不能为空","skills.error.describe-timeout":"模型生成超时(90 秒)","skills.error.empty-output":"模型未产出正文(结束原因:{kind})","skills.error.batch-cancelled":"已取消","skills.error.entry-changed":"条目在运行中发生变化,已跳过","skills.error.unknown-batch-plan":"批量计划已失效,请重新生成","skills.error.batch-already-done":"该批量计划已完成","skills.error.batch-already-cancelled":"该批量计划已取消","skills.error.annotated-confirm-required":"已注释技能需再次确认后才能被覆盖","skills.empty":"未发现任何技能","skills.filter":"按名称过滤…","skills.expandAll":"全部展开","skills.collapseAll":"全部折叠","skills.colon":":","skills.group.auto":"自动加载","skills.group.manual":"仅手动调用","skills.group.disabled":"完全停用","skills.source.project-dsh":"项目 .dsh","skills.source.project-agents":"项目 .agents","skills.source.user-dsh":"用户 DSH","skills.source.user-agents":"用户 .agents","skills.source.bundled":"内置","skills.source.custom":"自定义目录","skills.badge.shadowed":"被同名遮蔽","skills.badge.readonly":"只读","skills.badge.annotated":"已注释","skills.note.stale":"正文已变更,待重新补全","skills.note.remove":"移除 AI 注释","skills.note.panelOnly":"注释仅保存在本面板展示,不写入 SKILL.md。","skills.log.title":"运行日志","skills.log.located":"已定位技能 {name}(文件 {chars} 字符)","skills.log.attempt":"第 {n}/{total} 次生成:调用 {route}","skills.log.received":"输出接收完成({chars} 字符),解析 JSON…","skills.log.parsed":"解析成功,草稿就绪","skills.log.failed-retry":"失败:{message},自动重试","skills.log.failed":"失败:{message}","skills.log.wait":"等待模型输出… {secs}s","skills.log.first-delta":"模型已开始返回","skills.log.first-reasoning":"模型已开始返回(先输出推理)","skills.log.progress":"已接收 {chars} 字符","skills.log.finish-reasoning-only":"模型结束:{kind}(仅推理 {chars} 字符,未产出正文)","skills.log.finish-empty":"模型结束:{kind}(无任何输出)","skills.log.block-extract":"从整块输出提取正文({chars} 字符)","skills.log.item-start":"开始生成注释…","skills.batch.toggle":"批量注释","skills.batch.collapse":"收起","skills.batch.already":"已有批量任务在进行中,请等待完成或先取消","skills.invalid.legacy":"存在旧版调用键,已从模型目录剔除","skills.invalid.other":"无效条目:{reason}","skills.fix.legacy":"一键修复旧键","skills.switch.model":"对模型可见","skills.switch.user":"可被 / 调用","skills.switch.confirm":"再次点击生效","skills.describe.button":"AI 补全说明","skills.describe.title":"AI 补全说明 — {name}","skills.describe.model":"模型","skills.describe.models.loading":"获取模型列表…","skills.describe.models.empty":"未发现已配置模型","skills.describe.run":"生成草稿","skills.describe.running":"生成中…","skills.apply.title":"保存 AI 注释 — {name}","skills.apply.description":"描述","skills.apply.usage":"用法","skills.apply.old":"旧","skills.apply.new":"新","skills.apply.confirm":"保存注释","skills.apply.done":"注释已保存","skills.apply.keepusage":"(保留现有)","skills.llm.unavailable":"宿主 LLM 服务不可用,无法 AI 补全。","skills.batch.title":"批量补全技能说明","skills.batch.hint":"逐条调用所选模型为未注释或正文有变的技能生成说明;已注释技能在计划中单列,再次确认后才会被覆盖。结果仅存插件内并展示在条目下方。","skills.batch.plan":"生成计划","skills.batch.candidates":"候选 {count} 项","skills.batch.estBytes":"约发送 {size} 内容","skills.batch.skipped":"跳过 {count} 项(无效 / 被遮蔽)","skills.batch.annotated":"已注释将覆盖 {count} 项","skills.batch.annotatedList":"将覆盖清单","skills.batch.forceConfirm":"确认强制补全(覆盖 {count} 项已注释)","skills.skippedList":"跳过清单","skills.skip.shadowed":"被遮蔽","skills.skip.invalid":"无效({reason})","skills.skip.reason.missing-frontmatter":"缺 frontmatter","skills.skip.reason.missing-name":"缺 name","skills.skip.reason.invalid-name":"name 不合法","skills.skip.reason.missing-description":"缺 description","skills.skip.reason.too-large":"文件过大","skills.skip.reason.legacy-invocation-key":"旧版调用键","skills.batch.start":"开始批量补全","skills.batch.progress":"进度 {done}/{total}","skills.batch.current":"当前:{name}","skills.batch.cancel":"取消","skills.batch.phase.idle":"空闲","skills.batch.phase.planned":"待开始(核对候选后点击「开始批量补全」)","skills.batch.phase.running":"进行中","skills.batch.phase.done":"已完成","skills.batch.phase.cancelled":"已取消","skills.batch.failures":"失败 {count} 项","skills.batch.no-candidates":"没有需要补全的候选","skills.batch.model":"模型","overlay.label":"服务重启状态","recovery.waiting.title":"服务重启中…","recovery.waiting.body":"正在等待新的 DSH Web 进程启动,已等待 {seconds} 秒。","recovery.timeout.title":"服务尚未恢复","recovery.timeout.body":"已等待 60 秒。请确认外部进程管理器已正确配置,或手动刷新页面重试。","recovery.manual":"手动刷新","health.title":"运行状况","health.uptime":"运行时间","health.rss":"内存 RSS","health.platform":"平台","health.nodeVersion":"Node 版本","health.liveSessions":"存活会话","health.persistedSessions":"持久化会话","health.activeAgents":"活跃 Agent","health.activeJobs":"后台任务","health.uptimeValue":"{hours} 小时 {minutes} 分钟","health.error":"无法读取运行状况","health.check":"立即健康检查","health.checking":"检查中…","health.overall.ok":"正常","health.overall.warning":"警告","health.overall.error":"错误","health.alert.title":"健康提醒","health.alert.diagnostics":"检查结果存在{status},请查看下方异常项。","health.status.ok":"正常","health.status.warning":"警告","health.status.error":"错误","health.status.info":"信息","health.check.session-storage":"会话存储","health.check.workspace-registry":"工作区注册表","health.check.dsh-home":"DSH_HOME","health.check.backup-storage":"备份存储","health.check.tar":"tar","health.check.permissions":"文件权限","health.check.runtime-env":"运行环境","health.check.node-version":"Node 运行时","health.detail.runtime-env.managed":"由{kind}管理,重启后会自动拉起","health.detail.runtime-env.declared":"已通过 DSH_SERVICE_RUNTIME_ENV 声明由外部进程管理器管理","health.detail.runtime-env.manual":"疑似终端手动启动,重启后不会自动拉起;一键升级已改为不自动退出","health.detail.runtime-env.unknown":"未检测到进程管理器,无法确认重启后是否自动拉起;如实际有,可设置 DSH_SERVICE_RUNTIME_ENV=managed 声明","health.detail.runtime-env.desktop":"由桌面端托管(Electron);重启由桌面应用负责,请从应用托盘/菜单退出后重新打开","health.detail.node-version.ok":"{version},满足 ≥{required} 要求","health.detail.node-version.warning":"{version} 低于插件要求的 {required}.x,建议升级 Node","health.detail.session-storage.ok":"可用,共 {count} 个会话快照","health.detail.workspace-registry.ok":"可用,共 {count} 个工作区","health.detail.dsh-home.ok":"目录可访问,权限模式 {mode}","health.detail.backup-storage.empty":"备份目录可用,当前暂无备份","health.detail.backup-storage.ok":"备份目录可用,共 {count} 个备份,占用 {size}","health.detail.tar.ok":"tar 可执行文件可用","health.detail.permissions.ok":"文件权限检查正常,未发现异常","health.detail.permissions.warning":"发现 {count} 个文件或目录权限异常","health.detail.generic":"{status}","health.check.usage-index":"使用统计索引","health.detail.usage-index.never":"尚未建立统计索引,打开模型统计页后开始只读建立","health.detail.usage-index.unavailable":"统计索引暂不可读","health.detail.usage-index.ok":"已索引 {indexed} 个会话,更新于 {updated}","health.detail.usage-index.info":"{failed} 个会话未能索引(统计少算),已索引 {indexed} 个,更新于 {updated}","health.detail.usage-index.warning":"{failed} 个会话未能索引(统计少算),已索引 {indexed} 个,更新于 {updated}","health.check.notification-permission":"通知权限","health.detail.notification-permission.granted":"浏览器已授权系统通知","health.detail.notification-permission.default":"浏览器尚未授权系统通知,可在「配置 → 通知」中启用","health.detail.notification-permission.denied":"浏览器已拒绝系统通知,需在浏览器站点设置里恢复","health.detail.notification-permission.unsupported":"当前浏览器不支持系统通知","health.check.plugins":"插件","health.detail.plugins.unavailable":"插件体检不可用(宿主未暴露 Loader)","health.detail.plugins.ok":"共 {total} 个插件,状态正常","plugin.issue.failed":"{failed} 个插件失败","plugin.issue.pending":"{pending} 个插件未就绪","plugin.issue.info":"{count} 个插件状态需确认","plugin.state.pending":"等待依赖","plugin.state.loading":"加载中","plugin.state.failed":"失败","plugin.state.disposed":"已释放","plugin.state.unknown":"未知状态","plugin.state.unloading":"卸载中","plugin.missingDeps":"依赖缺失:{deps}","plugin.error":"错误:{error}","plugin.restart":"重新加载","plugin.restarting":"重新加载中…","plugin.restartConfirm":"确认重新加载","plugin.restartHint":"重新加载「{name}」,其启动逻辑将重新执行,失败状态会随之刷新。","plugin.restartCancel":"取消","plugin.restartFailed":"重新加载失败:{detail}","plugin.error.unknown-plugin":"未找到该插件","plugin.error.loader-unavailable":"宿主 Loader 不可用","plugin.error.plugin-disabled":"插件已停用,无法重新加载","plugin.error.not-failed":"该插件未处于失败状态","plugin.error.restart-failed":"重新加载后仍然失败","tabs.overview":"概览","tabs.notify":"通知","tabs.health":"健康诊断","tabs.usage":"模型统计","tabs.quota":"额度查询","overview.container":"进程与运行环境","overview.errors":"报错信息","overview.status.normal":"所有系统运行正常","overview.status.info":"有 {count} 条提示","overview.status.warning":"有 {count} 项需要注意","overview.status.error":"有 {count} 项需要处理","overview.backupEmpty":"还没有备份,建议创建一份","overview.updateAvailable":"检测到新版本可用","tabs.backup":"备份维护","tabs.restart":"重启","tabs.maintenance":"维护","tabs.configuration":"配置","tabs.models":"模型配置","page.models.desc":"供应商工作台:状态总览、单供应商「检查 → 建议 → 应用 → 验证」与持久化撤销;任意公网 HTTPS 中转都可安全检查。","features.modelCatalog":"模型配置","models.time.justNow":"刚刚","models.time.minAgo":"{n} 分钟前","models.time.hourAgo":"{n} 小时前","models.security.title":"安全与数据说明","models.security.urlTitle":"URL 怎么用","models.security.urlBody":"「检查并修复」只在你显式点击后请求一次该路由的 {baseURL}/models;任意公网 HTTPS 地址都可检查,但插件会先做安全校验(仅 HTTPS、仅默认 443 端口、拒绝内网与保留地址、DNS 解析后直连并钉住 Host),校验不过就拒绝请求。非公网地址仍可保存使用,只是不会被插件在线检查。","models.security.keyTitle":"API key 怎么存","models.security.keyBody":"插件从不读取、回显或记录你的密钥;检查在你显式点击时才授权使用已存凭据,且只发往该路由当前地址;凭据动作不可撤销,也不进撤销快照。","models.security.revertTitle":"配置怎么改回","models.security.revertBody":"写入只落 settings.yaml 的 llm-pi-ai 段:字段级预览 → 两段确认 → 写前完整快照(不含密钥)持久化在本机,可随时撤销;校验不合法的数据会被整体拒绝。","models.routes.title":"供应商列表","models.wb.empty":"暂无供应商:先在 DSH 官方 设置 → 模型 页创建自定义提供方(或启用内置渠道),再回到这里管理。","models.wb.modelCount":"{n} 个模型","models.wb.meta":"容量 {ctx} · 视觉 {vision} · 思考 {reasoning}","models.wb.neverValidated":"从未验证","models.wb.lastValidated":"验证于 {time}","models.wb.validationFailed":"最近验证失败","models.wb.undoAvailable":"可撤销","models.wb.builtin":"内置渠道","models.wb.builtinUser":"官方内置","models.wb.seeImage":"可看图","models.wb.canThink":"可思考","models.wb.attention.dangling":"凭据未配置","models.wb.attention.danglingHint":"该供应商声明了密钥引用,但本机未找到对应密钥。请到 设置 → 模型 页填写密钥,或清除该引用。","models.wb.attention.validation":"最近验证失败","models.wb.attention.validationHint":"最近一次验证未通过。点进去可重新运行验证查看失败项。","models.wb.attention.recovery":"待人工恢复","models.wb.attention.recoveryHint":"上次写入中途失败,恢复前禁止自动写入。请在官方设置页人工处理后解除。","models.wb.attention.invalid":"配置结构有误","models.wb.attention.invalidHint":"模型配置存在无法保存的字段。请检查模型参数(上下文/输出为正整数,思考等级合法)。","models.wb.detail.todos":"该供应商有 {n} 项待办","models.wb.legend":"标记说明:官方内置 = DSH 自带渠道 · 可看图 = 模型支持图像输入 · 可思考 = 模型支持思考等级 · 虚线下划线文字 = 需处理项(悬停看原因)","models.wb.needsAttention":"需处理","models.wb.checkFix":"检查并修复","models.wb.undoWrite":"撤销上次写入","models.wb.phase.inspect":"检查","models.wb.phase.suggest":"建议","models.wb.phase.apply":"应用","models.wb.phase.verify":"验证","models.wb.task.title":"检查并修复({route})","models.wb.task.back":"返回列表","models.wb.check.busy":"检查中…","models.wb.check.start":"开始检查","models.wb.check.recheck":"重新检查","models.wb.check.notProbed":"未探测网关(可添加模型需点击获取)","models.wb.check.fetchAdditions":"获取可添加模型","models.wb.check.ok":"网关返回 {n} 个模型","models.wb.check.failed":"网关连接失败:{error}","models.wb.check.unsupported":"该协议不支持在线列表,已跳过在线发现","models.wb.check.insecure":"地址不是 HTTPS 公网地址,禁止在线检查","models.wb.check.private":"地址解析到内网/保留地址,禁止在线检查","models.wb.check.ipliteral":"地址是 IP 字面量,禁止在线检查","models.wb.check.dns":"域名解析失败","models.wb.check.credential":"已授权使用已存凭据(仅发往该路由当前地址)","models.wb.check.anon":"匿名检查(未找到已存凭据)","models.wb.reasoning":"思考","models.wb.add.online":"在线获取","models.wb.add.manual":"手动输入","models.wb.add.choose":"选择模型…","models.wb.add.detect":"检测模型","models.wb.add.detected":"已检测","models.wb.add.prepare":"准备添加","models.wb.add.unverified":"检测未通过,仍以未验证添加","models.wb.add.unverifiedReason":"检测失败:{error}","models.wb.add.unverifiedHelp":"该模型未通过运行时验证(目录无记录或解析失败)。仍可添加,调用失败风险由您承担。","models.wb.add.probeName":"名称","models.wb.add.probeContext":"上下文","models.wb.add.probeMax":"最大输出","models.wb.add.probeModel":"模型 ID:{id}","models.wb.add.detectHint":"输入模型 ID 后点击「检测模型」,或按回车。","models.wb.verifyOnline":"联网查证","models.wb.verifyOnline.busy":"正在查询模型档案…","models.wb.verifyOnline.title":"模型档案查证({model})","models.wb.verifyOnline.source":"来源:{name}","models.wb.verifyOnline.open":"查看模型页","models.wb.verifyOnline.noMatch":"未找到相关参数说明","models.wb.verifyOnline.notFound":"该模型不在 OpenRouter 目录中","models.wb.verifyOnline.error":"查询失败:{error}","models.wb.verifyOnline.note":"查证结果仅作参考,不会自动写入配置。","models.wb.add.allowUnverified":"仍以未验证添加","models.wb.add.confirmSummary":"即将只保存 Image/思考/上下文设置,其他高级字段保持不变。","models.wb.add.commit":"确认添加","models.wb.detail.models":"已配置模型","models.wb.detail.expand":"展开参数","models.wb.detail.collapse":"收起参数","models.wb.detail.context":"上下文窗口","models.wb.detail.maxTokens":"最大输出","models.wb.detail.image":"图像输入","models.wb.detail.imageState.yes":"支持","models.wb.detail.imageState.no":"不支持","models.wb.detail.imageState.detected":"跟随检测","models.wb.detail.thinking":"思考","models.wb.detail.thinkingState.yes":"支持","models.wb.detail.thinkingState.no":"不支持","models.wb.detail.thinkingState.detected":"跟随检测","models.wb.detail.thinkingState.follow":"跟随默认","models.wb.detail.apply":"应用更改","models.wb.detail.finalConfirm":"最终确认","models.wb.detail.changeSummary":"{changes} 处字段变更 · 新增 {added} · 移除 {removed}","models.wb.detail.advice":"建议","models.wb.detail.useAdvice":"填入建议","models.wb.detail.noAdvice":"暂无建议","models.wb.detail.adviceSource":"建议来源:{source}","models.wb.detail.runtime":"实测","models.wb.detail.split":"来源不一致,请选择","models.wb.detail.hitCount":"{count} 个来源命中此值(共 {total} 个来源)","models.wb.detail.othersCount":"另有 {n} 个不同值","models.wb.detail.empty":"该供应商还没有配置模型。","models.wb.detail.saved":"已应用并热生效","models.wb.detail.notice":"需处理","models.wb.detail.recheck":"最终确认后插件会再次校验参数有效性。","models.wb.chip.safeFill":"补全","models.wb.chip.conflict":"冲突","models.wb.chip.addition":"可添加","models.wb.chip.unknown":"未识别","models.wb.group.safeFill":"安全补全(缺失字段;高置信默认勾选)","models.wb.group.conflict":"冲突(配置与目录不一致;默认不勾选)","models.wb.group.addition":"可添加模型(网关/目录新发现;默认不勾选)","models.wb.group.unknown":"未识别模型(保留,绝不自动删除)","models.wb.group.more":"展开全部({n})","models.wb.group.less":"收起","models.wb.selectRow":"全选","models.wb.clearRow":"清空","models.wb.filter":"筛选模型…","models.wb.selected":"已选 {n} 项","models.wb.confidence.low":"需确认","models.wb.inexpressible":"含 {n} 个 DSH 无法表达的值","models.wb.unknownRow":"未识别:在线列表未返回且目录未命中;保留不动","models.wb.suggestEmpty":"没有待处理项:配置已与网关和目录一致。","models.wb.prepare":"准备应用","models.wb.apply.title":"应用预览","models.wb.apply.summary":"{changes} 处字段变更 · 新增 {added} · 移除 {removed}","models.wb.apply.noCredentialOps":"凭据与密钥:本计划不涉及。","models.wb.apply.empty":"空计划:没有要写入的变更。","models.wb.apply.confirm":"确认应用","models.wb.apply.back":"返回修改","models.wb.applied":"已应用 {n} 项,写入即时热生效","models.wb.conflict":"配置在计划生成后被外部修改,写入已被拒绝以避免覆盖。请重新检查后重试。","models.wb.undo.title":"撤销预览({route})","models.wb.undo.at":"写入于 {time}","models.wb.undo.restorable":"{n} 处可恢复:","models.wb.undo.restoreField":"{model} · {field}:恢复为 {value}","models.wb.undo.removeField":"{model} · {field}:移除显式值","models.wb.undo.nothing":"没有可自动恢复的字段差异。","models.wb.undo.added":"写入后新增了 {n} 个模型(默认保留)","models.wb.undo.dropAdded":"一并移除这些新增模型","models.wb.undo.removed":"写入后被移除了 {n} 个模型(默认保持移除)","models.wb.undo.restoreRemoved":"一并恢复这些被移除的模型","models.wb.undo.confirm":"确认撤销","models.wb.undo.cancel":"取消","models.wb.undo.done":"已撤销并热生效","models.wb.create.title":"添加供应商","models.wb.create.displayName":"显示名称","models.wb.create.baseURL":"API 地址(HTTPS)","models.wb.create.api":"API 协议","models.wb.create.key":"API 密钥(可选;仅存于本次任务内存,创建时写入本机凭据库)","models.wb.create.route":"Provider ID(按显示名建议,可修改;创建后不可重命名)","models.wb.create.begin":"检查并准备","models.wb.create.manual":"手动添加模型 ID(每行一个,可选)","models.wb.create.pick":"选择要创建的模型(默认不选)","models.wb.create.summary":"将创建 {route}:{n} 个模型{credential}。","models.wb.create.credNote":",同时把密钥写入本机凭据库","models.wb.create.confirm":"确认创建","models.wb.create.cancel":"取消","models.wb.create.created":"已创建 {route}","models.plan.confirmArmed":"再点一次确认","models.wb.catalog.title":"模型目录","models.wb.catalog.customized":"已自定义模型目录","models.wb.catalog.inherited":"正在使用适配器默认模型","models.wb.edit.title":"编辑模型({route})","models.wb.edit.name":"名称","models.wb.edit.modelId":"模型 ID","models.wb.edit.modelIdPlaceholder":"模型 ID","models.wb.edit.displayNamePlaceholder":"留空时使用模型 ID","models.wb.edit.context":"上下文窗口","models.wb.edit.contextPlaceholder":"继承目录默认值","models.wb.edit.maxTokens":"最大输出 token","models.wb.edit.maxTokensPlaceholder":"继承目录默认值","models.wb.edit.capacityInvalid":"容量需为正数,可写 K/M 后缀,例如 131072、256K、1M。","models.wb.edit.inputModalities":"输入模态","models.wb.edit.outputModalities":"输出模态","models.wb.edit.modalityText":"文本","models.wb.edit.modalityImage":"图像","models.wb.edit.outputReadonly":"输出模态由适配器与内置目录决定;模型条目没有对应字段,这里只作展示。","models.wb.edit.reasoningLevels":"推理档位","models.wb.edit.reasoningNoneHint":"不勾选即视为非推理模型","models.wb.edit.reasoningFalse":"非推理模型(reasoning=false)","models.wb.edit.wireCustom":"自定义协议值","models.wb.edit.wireHint":"默认发送同名协议值;改写输入框即为自定义。","models.wb.edit.advanced":"模型选项","models.wb.edit.inputImage":"图像输入","models.wb.edit.reasoning":"思考等级","models.wb.edit.reasoningOff":"off(不发送)","models.wb.edit.clearOverride":"清除显式值(继承默认)","models.wb.edit.addModel":"新增模型","models.wb.tab.models":"模型列表","models.wb.tab.connection":"连接信息","models.wb.tab.danger":"撤销与删除","models.wb.state.runtimeLoaded":"运行时已加载","models.wb.state.runtimeMissing":"运行时未加载","models.wb.search.placeholder":"搜索模型 ID 或名称","models.wb.search.none":"没有匹配的模型","models.wb.keyRef":"凭据引用 {ref}","models.wb.conn.displayName":"显示名","models.wb.conn.api":"协议","models.wb.conn.baseURL":"接口地址","models.wb.conn.urlHint":"地址只作为配置数据保存;只有公网 HTTPS 地址才允许在线获取模型列表,其余地址仍可保存与手填模型。","models.wb.conn.key":"更换密钥","models.wb.conn.keyPlaceholder":"输入新密钥(不回显旧值)","models.wb.conn.keyHint":"密钥只提交一次,不显示、不进日志、不进撤销快照与浏览器草稿。删除渠道时凭据保留。","models.wb.conn.save":"保存连接信息","models.wb.conn.probeOk":"该地址允许在线获取模型列表。","models.wb.conn.probeBlocked":"该地址不可在线获取({reason});保存与手填仍可用。","models.wb.conn.credState":"凭据 {ref}:{state}","models.wb.conn.credConfigured":"已配置","models.wb.conn.credAbsent":"未配置","models.wb.conn.credShadowed":"被环境变量遮蔽,无法写入","models.wb.conn.shadowWarn":"{ref} 由环境变量提供,写入会被拒;请先在环境中取消该变量。","models.wb.conn.planTitle":"将写入以下字段","models.wb.conn.planFields":"字段:{fields}","models.wb.conn.planNothing":"(无变化)","models.wb.conn.planKey":"同时替换凭据值。","models.wb.conn.planNoKey":"不改动凭据。","models.wb.conn.confirm":"确认保存","models.wb.conn.saved":"连接信息已保存并热生效","models.wb.leave.body":"有未保存的编辑。离开将丢弃这些草稿。","models.wb.leave.stay":"继续编辑","models.wb.leave.go":"放弃并离开","models.wb.edit.unsaved":"未保存","models.wb.effort.needLevel":"至少需要一档非 off 的映射值。","models.wb.add.title":"添加模型","models.wb.add.count":"发现 {n} 个模型,其中 {added} 个已添加","models.wb.add.already":"已添加","models.wb.add.fetching":"正在获取模型列表…","models.wb.add.fallback":"发现失败不影响手动添加:切到「手动输入 ID」继续即可。","models.wb.add.note":"获取列表成功不代表可以调用;需要实测请保存后用下方测试。","models.wb.add.manualIds":"手动输入模型 ID(每行一个,或用逗号分隔)","models.wb.add.manualHint":"只接受模型 ID 文本,字段值由宿主校验后写入。","models.wb.remove.after":"移除后该渠道剩余 {n} 个模型。","models.wb.remove.blockedHint":"该模型被引用,请先到对应设置解除引用,再回到这里删除。","models.wb.test.title":"真实调用测试(保存后可主动执行)","models.wb.test.note":"先跑基础检查(零费用);深度测试会发送一段固定最小提示词并可能产生费用,失败不会回滚已保存的配置。","models.wb.test.deep":"深度测试(可能计费)","models.wb.test.deepArmed":"再点一次确认付费测试","models.wb.test.cost":"将发送:system「Reply with OK.」+ user「ping」,max_tokens=16,15 秒超时。","models.wb.test.scopeShallow":"本次只核对配置与运行时加载;不代表图片、思考或上下文上限已实测。","models.wb.test.scopeDeep":"本次只证明一次基础调用可成功;不代表图片、思考或上下文上限均已验证。","models.wb.danger.title":"撤销与删除","models.wb.routeDelete.btn":"删除该渠道","models.wb.routeDelete.plan":"删除后将从 settings 移除该渠道({n} 个模型)。","models.wb.routeDelete.key":"凭据 {ref} 会保留,不影响其它使用同一凭据的渠道。","models.wb.routeDelete.noKey":"该渠道没有引用凭据。","models.wb.routeDelete.blocked":"该渠道被代理默认模型引用:请先在官方设置页更换默认。","models.wb.routeDelete.refs":"另有 {n} 处引用会在删除后失效。","models.wb.routeDelete.confirm":"删除渠道","models.wb.routeDelete.confirmArmed":"再点一次确认删除","models.wb.rescue.title":"最近删除的渠道","models.wb.rescue.empty":"没有可恢复的已删除渠道。","models.wb.rescue.restore":"恢复该渠道","models.wb.rescue.taken":"已存在同名渠道,需先改名或删除它才能恢复。","models.wb.rescue.done":"已恢复。凭据引用一并恢复,但旧密钥值不会被恢复,请按需重新输入。","models.wb.rescue.note":"恢复写回删除前的完整渠道配置;旧密钥值不在快照内,不会被恢复。","models.wb.edit.save":"保存编辑","models.wb.edit.confirm":"确认保存","models.wb.edit.done":"已保存并热生效","models.error.last-model-undeletable":"不能删除最后一个模型:空清单会被宿主当成「继承目录」,与禁用渠道不等价。请改用「删除该渠道」,或先添加替代模型。","models.error.builtin-inherited-list":"该内置渠道正在继承内置目录清单,追加模型会整份替换它。请改用「添加自定义渠道」另开一条路由,或用单模型编辑面板只改已有模型的参数。","models.error.nothing-to-restore":"没有可恢复的已删除渠道。","models.error.restore-failed":"恢复失败({detail});快照已保留,可修正后重试。","models.error.connection-failed":"连接信息写入失败:{detail}","models.wb.edit.noop":"没有变更","models.wb.edit.removeHint":"删除模型请用「移除模型」流程(含引用守卫)","models.wb.remove.btn":"移除模型","models.wb.remove.title":"移除模型({route})","models.wb.remove.pick":"选择要移除的模型(移除即写入,可撤销)","models.wb.remove.ref.subagent":"子代理路由当前指向 {model};请选择替代模型,与应用同事务提交","models.wb.remove.ref.default":"该模型被设为代理默认模型(agent-default-model):请先在官方设置页更换默认,再回来移除","models.wb.remove.migrateProvider":"替代提供方","models.wb.remove.migrateModel":"替代模型","models.wb.remove.plan":"准备移除","models.wb.remove.confirm":"确认移除","models.wb.remove.done":"已移除 {n} 个模型(可撤销)","models.wb.verify.run":"运行验证","models.wb.verify.deep":"深度验证(最小真实调用,可能计费)","models.wb.verify.deepArmed":"再点一次确认付费验证","models.wb.verify.busy":"验证中…","models.wb.verify.check.settings":"配置写入","models.wb.verify.check.providers":"供应商可见性","models.wb.verify.check.models":"模型解析","models.wb.verify.check.credential":"凭据","models.wb.verify.check.stream":"真实调用","models.wb.verify.skipped":"跳过","models.wb.verify.ok":"通过","models.wb.verify.fail":"失败:{error}","models.wb.verify.persisted":"验证摘要已保存(每路由最近一次)","models.error.llm-missing":"LLM 服务不可用,无法深度验证","models.plan.field.name":"名称","models.plan.field.contextWindow":"上下文窗口","models.plan.field.maxTokens":"最大输出","models.plan.field.input":"输入模态","models.plan.field.reasoningEfforts":"思考等级","models.error.catalog-unavailable":"目录不可用,请稍后重试","models.error.route-gone":"该提供方已在设置中被移除","models.error.plan-expired":"计划已过期,请重新检查","models.error.inspect-gone":"检查结果已失效,请重新检查","models.error.conflict":"配置已变化,计划被拒绝以避免覆盖外部修改","models.error.unknown-suggestion":"包含未知建议项,请重新检查后再试","models.error.nothing-to-undo":"没有可撤销的写入","models.error.bad-route":"Provider ID 需以小写字母开头,仅含小写字母、数字和短横线","models.error.bad-api":"请选择支持的 API 协议","models.error.bad-base-url":"API 地址需为有效 HTTPS 地址","models.error.route-taken":"已有提供方使用这个 ID","models.error.no-base-url":"该路由未配置 baseURL,且 DSH 内置目录中也未找到对应渠道","models.error.workbenchReadonly":"旧版写入已停用:请在「供应商与模型」工作台操作","models.error.config-unavailable":"模型配置实例不可用,请在原生插件管理页确认 pi-ai 插件已启用。未执行写入。","models.error.config-ambiguous":"检测到多个 pi-ai 配置实例,工作台不会猜测写入目标。请在原生插件管理页处理实例后重试。","models.error.config-expression":"模型配置由动态表达式提供,请在原生配置入口编辑;工作台不会将其替换为静态值。","models.error.config-inherited-route":"该渠道来自上层或内置配置,删除会恢复继承值而不是移除渠道。请在原生配置入口处理来源。","models.error.bad-display-name":"请填写显示名称","models.error.bad-key":"密钥过长(上限 4096 字符)","models.error.no-models":"至少需要一个模型:勾选上面的候选,或填写手动模型 ID","models.error.credential-rejected":"凭据写入被拒绝,未创建任何配置","models.error.create-failed":"创建失败:{detail}","models.error.draft-gone":"创建草稿已失效,请重新开始","models.error.recovery-pending":"该路由处于「需人工恢复」状态,自动写入已被阻止:请先在官方设置页处理,再解除标记","models.error.nothing-to-resolve":"没有需要解除的恢复标记","models.error.bad-models":"模型数据不合法","models.error.migration-required":"子代理路由正引用该模型:请选择替代模型后重试","models.error.removal-blocked":"代理默认模型引用阻止移除:请先在官方设置页更换默认模型","models.error.remove-failed":"移除失败:{detail}","models.error.bad-model-id":"模型 ID 需为 1–256 个字符且不含控制字符","models.error.model-detection-required":"请先检测该模型再继续","models.error.model-unverified":"模型检测未通过,无法写入","models.error.unknown-option":"候选项已失效,请重新获取","models.error.unknown-detection":"检测结果已失效,请重新检测","models.error.duplicate-model":"该模型已在供应商中配置","models.error.builtin-only":"在线获取仅适用于自定义渠道;内置渠道请从内置目录选择","models.error.online-custom-only":"该路由不是内置渠道,不能使用内置目录","models.error.probe-protocol-unsupported":"该协议不支持在线获取模型清单","models.error.unknown":"操作失败:{detail}","tabs.providers":"供应商与模型","tabs.subagentRoute":"子代理路由","tabs.features":"功能","tabs.notifications":"通知","tabs.navOrder":"设置栏标签","config.navOrder.title":"设置栏标签排序与显隐","config.navOrder.moveUp":"上移","config.navOrder.moveDown":"下移","config.navOrder.visible":"显示","config.navOrder.hidden":"隐藏","config.navOrder.locked":"当前面板(不可隐藏)","config.navOrder.reset":"恢复默认排序","config.navOrder.saved":"已保存","config.navOrder.save":"保存排序","config.navOrder.empty":"未检测到已注册的设置栏标签","maintenance.empty":"所有维护子页均已关闭。可在「配置 → 功能」中开启备份、技能、子代理或会话管理。","config.notificationsDisabled":"任务通知功能已在「功能」页关闭,以下设置仅作展示;重新开启后通知才会生效。","features.group.runtime":"运行与观测","features.group.maintenance":"维护","features.group.interaction":"交互","page.configuration.desc":"功能开关与任务通知设置。","tabs.alert.title":"服务控制提醒","tabs.alert.body":"以下功能需要处理:{tabs}","tabs.alert.join":"、","tabs.alert.dot":"此标签存在故障提醒","permissions.title":"文件权限","permissions.description":"检查 Agent 能否读写并进入 DSH_HOME 与工作区。深检跳过 .git;修复补充当前用户所需权限并保留执行位。","permissions.target":"目标属主:{owner}","permissions.repair":"修复权限","permissions.repairing":"修复中…","permissions.confirm":"确认修复","permissions.confirmHint":"跳过 .git,递归恢复当前用户属主并补充 Agent 读写权限,保留已有执行位。","permissions.cancel":"取消","permissions.show":"权限与修复","permissions.hide":"收起","permissions.error":"权限操作失败","permissions.summary.ok":"{count} 个根目录检查正常","permissions.summary.warning":"发现 {count} 个根目录异常","permissions.showDetails":"查看详情","permissions.hideDetails":"隐藏详情","permissions.deep":"深度检查","permissions.deepChecking":"扫描中…","permissions.deepSummary":"扫描 {scanned} 项,用时 {duration} ms;目录不可编辑 {directories},文件不可编辑 {files},无法读取 {unreadable}。","backup.title":"备份管理","backup.description":"备份会话、配置与插件 profile 清单,不含 node_modules 与凭据;不自动清理。","backup.create":"创建备份","backup.creating":"创建中…","backup.progress.copy":"正在复制会话数据({current}/{total})…","backup.progress.archive":"正在打包归档({current}/{total})…","backup.progress.validate":"正在校验归档({current}/{total})…","backup.progress.publish":"正在发布备份({current}/{total})…","backup.total":"总体积:{size}","backup.row.version":"备份时 DSH 版本:{version}","backup.empty":"还没有备份。","backup.delete":"删除","backup.confirm":"确认删除","backup.confirmHint":"确认删除这个备份?此操作无法撤销。","backup.cancel":"取消","backup.error":"备份操作失败","backup.export":"导出","backup.exporting":"导出中…","backup.exportError":"备份导出失败","backup.restore":"恢复","backup.inspecting":"检查中…","backup.restoreConfirm":"确认恢复","backup.restoreHint":"完整性检查通过。确认后会按下方计划覆盖数据;提交前宿主会再次检查归档和当前目标是否发生变化。","backup.restoreError":"备份恢复失败","backup.error.restore-files-locked":"恢复失败:目标文件被占用。请退出桌面应用、暂停同步盘或关闭杀毒实时扫描后重试。","backup.error.restore-mapping-invalid":"目标 profile 选择无效,请重新选择。","backup.integrity.ok":"完整性检查通过","backup.integrity.invalid":"归档不可恢复","backup.integrity.summary":"共 {entries} 个条目,解压后 {size};会话文件 {sessions},配置文件 {config},profile 清单 {profiles}。","backup.integrity.format":"归档格式 {format}","backup.integrity.sourceVersion":"备份时 DSH 版本:{version}","backup.format.v1":"v1(不含 Profile 补丁层)","backup.format.v2":"v2(含 Profile 补丁层)","backup.plan.sessions":"会话目录将整体替换","backup.plan.config":"配置覆盖 {replace} 项,移除 {remove} 项","backup.plan.profiles":"覆盖 {count} 个 profile 的 package.json,保留 node_modules 与其他文件","backup.plan.profilePatches":"恢复 {count} 个 profile 的 cordis.patch.yml(Profile 配置层)","backup.plan.profilePatchesAbsent":"该归档来自旧版备份,未包含 Profile 补丁层(cordis.patch.yml):现有配置保持不变,不会被覆盖或删除。","backup.plan.expires":"恢复计划有效至 {time}","backup.plan.mappingHint":"恢复目标 profile:归档里的 profile 内容写入你选择的本机 profile(候选来自本机实际存在的 profile)。","backup.plan.manifest":"同时覆盖插件清单","backup.notice.source-platform-differs":"这份备份来自 {detail},与当前系统不同:会话仍按原工作区路径归类,凭据、附件与 node_modules 不随备份迁移。","backup.notice.target-case-collision":"归档中存在仅大小写不同的路径({detail}),在当前系统上会折叠为同一个目标,可能相互覆盖。","backup.notice.target-path-length":"目标路径最长将达 {detail} 个字符,超过 Windows 经典上限(260),写入可能失败;可启用系统长路径支持或改用更短的工作区路径。","backup.notice.target-sessions-unwritable":"会话目录当前不可写({detail}):可能被其他进程占用或权限不足,恢复可能失败;请关闭占用方(桌面应用、同步盘、杀毒实时扫描)后重试。","backup.manualRestartTitle":"恢复完成,需要手动重启","backup.manualRestartBody":"数据已恢复,但当前进程仍在运行旧状态。请在运行 dsh 的终端按 Ctrl+C,然后重新启动 dsh。","backup.manualRestartTitleDesktop":"恢复完成,需要重启桌面应用","backup.manualRestartBodyDesktop":"数据已恢复,但当前进程仍在运行旧状态。请在桌面端退出应用后重新打开。","backup.error.backup-gzip-invalid":"归档不是有效的 gzip 文件或已损坏。","backup.error.backup-tar-invalid":"tar 结构或校验和无效。","backup.error.backup-entry-traversal":"归档含越界或不安全路径。","backup.error.backup-entry-absolute":"归档含绝对路径。","backup.error.backup-entry-link":"归档含符号链接或硬链接。","backup.error.backup-entry-type":"归档含不支持的特殊条目。","backup.error.backup-entry-platform":"归档包含其他系统不兼容的文件名。","backup.error.backup-entry-unexpected":"归档含备份范围外的文件。","backup.error.backup-profile-invalid":"profile package.json 无效。","backup.error.backup-section-missing":"归档缺少必要分区。","backup.error.backup-size-limit":"归档超过安全大小或条目限制。","backup.error.backup-archive-invalid":"归档未通过完整性检查。","backup.error.backup-archive-incomplete":"归档内容与备份源不一致(有文件未被完整收录),未发布。","backup.error.backup-source-changed":"会话正在写入,备份未完成,请稍后重试。","backup.error.backup-source-unsafe":"备份源含符号链接或特殊文件,已拒绝创建。","backup.error.tar-failed":"归档工具执行失败,请检查 tar/gzip 是否可用。","backup.error.active-work":"检测到运行中的工作,暂不能恢复。","backup.error.restore-plan-expired":"恢复计划已过期,请重新检查。","backup.error.restore-source-changed":"备份归档在确认前发生变化,请重新检查。","backup.error.restore-target-changed":"当前数据在确认前发生变化,请重新检查。","backup.error.restore-target-unsafe":"当前目标含不安全的链接或特殊文件。","backup.import":"导入备份","backup.importing":"导入中…","backup.showRecords":"展开备份记录","backup.hideRecords":"收起备份记录","version.title":"版本信息","version.current":"DSH:","version.plugin":"dsh-service:","version.loading":"加载中…","update.check":"检查更新","update.checking":"检查中…","update.current":"已是最新版本","update.available":"有新版本:{version}","update.installedPendingRestart":"已安装 {version},重启后生效","update.notes.button":"本次更新内容","update.notes.hide":"收起更新内容","update.notes.loading":"正在读取更新内容…","update.notes.empty":"这一版没有填写更新说明。","update.notes.truncated":"(内容过长,仅显示前 {chars} 个字符)","update.notes.publishedAt":"发布于 {date}","update.notes.version":"版本 {version}","update.notes.prerelease":"预发布","update.notes.error.release-not-found":"这一版的发布说明还没上线(版本先发到 npm、release 稍后补上)。","update.notes.retry":"重试","update.notes.error.release-unavailable":"读取更新内容失败,请稍后重试。","update.unavailable":"暂时无法检查最新版本","update.unpublished":"尚未发布可检查版本","health.recheck":"重新诊断","update.upgrade":"升级插件","update.upgrading":"升级中…","update.upgradeError":"插件升级失败","update.upgradeErrorDetail":"插件升级失败({detail})","update.upgradeSuccess":"升级成功,服务重启中…","update.guardActiveWork":"有活动中的会话或后台任务,请处理完毕后再升级","update.guardLinkInstall":"插件通过 link: 安装(开发模式),不能从 registry 一键升级;请更新源码仓库后重启","update.guardFileInstall":"插件通过 file: 安装,不能从 registry 一键升级","update.guardNoNewer":"registry 最新版不高于当前版本,已拒绝可能回退的升级","update.guardNoProfile":"没有找到安装了本插件的 profile,无法定位升级目标","update.guardAmbiguous":"多个 profile 都安装了本插件且无法确定当前加载的副本,已中止","update.guardStale":"命令报告成功但安装版本没有变化(可能被 pnpm 安全等待期拦下),保持当前版本不重启","update.guardUnreadable":"命令成功但无法确认安装后的版本,已中止重启","update.failPnpmMissing":"找不到 pnpm,无法执行升级;请先安装 pnpm 再重试","update.failNetwork":"拉取依赖时网络临时失败,请稍后重试","update.failFetchTimeout":"下载超时(网络较慢或安装包较大),请稍后重试","update.failReleaseAge":"新版本被 pnpm 安全等待期拦截,已自动放行重试仍失败","update.failHoist":"profile 的 node_modules 由不同版本的 pnpm 创建,已重建重试仍失败","update.failAddingToRoot":"pnpm 拒绝在 workspace 根目录安装(缺少 -w)","update.failNotWorkspace":"profile 不是 pnpm workspace 却传入了 -w","update.failIgnoredBuilds":"依赖构建脚本被 pnpm 默认拦截,无法完成升级","env.kind.docker":"Docker 容器","env.kind.container":"容器(containerd/Kubernetes)","env.kind.systemd":"systemd 服务","env.kind.pm2":"pm2","env.kind.supervisord":"supervisord","env.kind.kubernetes":"Kubernetes","env.kind.declared":"外部进程管理器(手动指定)","update.manualConfirmTitle":"升级前请确认:当前疑似手动启动环境","update.manualConfirm":"未检测到进程管理器。升级完成后 DSH 不会自动重启。","update.manualProceed":"仍要升级","update.manualRestartTitle":"升级完成,需要手动重启","update.manualRestartBody":"新版本已安装,但当前进程仍在运行旧版本。请在运行 dsh 的终端窗口按 Ctrl+C(或直接关闭窗口),然后重新启动 dsh。","update.manualRestartTitleDesktop":"升级完成,需要重启桌面应用","update.manualRestartBodyDesktop":"新版本已安装,但当前进程仍在运行旧版本。请在桌面端退出应用后重新打开。","update.desktopManagedUpgrade":"桌面端的插件由应用自己安装:请在桌面端的插件管理页更新本插件(命令行升级在桌面端不可用)。","restart.title":"服务重启","restart.description":"重启 dsh web 进程。运行中的工作会中断,持久化会话可恢复。","restart.button":"重启 dsh web","restart.sending":"发送中…","restart.confirm":"确认重启","restart.force":"仍要重启","restart.cancel":"取消","restart.sent":"重启指令已发出。","restart.sentHint":"页面连接即将断开,服务恢复后将自动刷新。","restart.idleHint":"当前没有检测到运行中的工作。确认后将断开连接,等待服务自动重启。","restart.manualWarn":"当前疑似终端手动启动环境:确认后进程将退出且不会自动拉起,需要你手动重新运行 dsh。","restart.sentManualHint":"当前为手动启动环境,服务不会自动拉起;请在原终端重新运行 dsh 后刷新。","restart.desktopWarn":"当前是 DSH 桌面端:宿主由应用自身托管,确认后进程不会退出,也不会自动重启;请从应用托盘/菜单退出后重新打开应用。","restart.sentDesktopHint":"桌面端由应用自身托管,服务不会自动拉起;请在桌面端退出应用后重新打开。","restart.navToggle":"设置页左列显示「重启」入口","restart.navToggleHint":"默认关闭;开启后在设置页左侧标签列底部显示快捷重启入口","activity.agent":"Agent","activity.job":"后台任务","activity.terminal":"终端","activity.warning":"检测到 {count} 项运行中的工作,重启将中断。","activity.item":"{type}:{label} ({status})","error.update":"检查失败","error.activity":"检查运行状态失败","error.restart":"重启失败","error.instance":"重启响应缺少进程实例标识","usage.title":"模型使用","usage.tooltip.date":"日期:{date}","usage.tooltip.input":"输入 {value} token","usage.tooltip.output":"输出 {value} token","usage.tooltip.cache":"缓存命中 {value} token","usage.tooltip.total":"token 总量 {value}","usage.tooltip.steps":"成功模型步骤 {value} 次","usage.tooltip.hitRate":"缓存命中率 {value}","usage.axis":"token 纵轴","usage.models.more":"展开其余 {count} 个模型","usage.models.less":"收起模型列表","usage.modelScope.today":"今日","usage.modelScope.week":"近 7 天","usage.modelScope.all":"累计","usage.modelSortHint.today":"按今日 token 从多到少排列","usage.modelSortHint.week":"按近 7 天 token 从多到少排列","usage.modelSortHint.all":"按累计 token 从多到少排列","usage.modelBar.today":"{model}:今日 {total} token","usage.modelBar.week":"{model}:近 7 天 {total} token","usage.modelBar.all":"{model}:累计 {total} token","usage.refresh":"刷新统计","usage.refreshing":"刷新中…","usage.empty":"尚未建立使用统计索引。点击刷新统计开始只读建立索引。","usage.error":"无法读取模型使用统计","usage.allProjects":"全部项目","usage.chartSummary":"七天内累计用量 {total} token","usage.barDay":"{day} 总用量 {total} token","usage.total":"token 总量","usage.steps":"成功模型步骤","usage.stepsValue":"{count} 次","usage.modelLine":"{steps}次 · 缓存命中 {hitRate} · 输入 {input} token · 输出 {output} token","usage.input":"输入 token","usage.output":"输出 token","usage.cache":"缓存 token","usage.hitRate":"缓存命中率","usage.today":"今日","usage.sevenDays":"近 7 天","usage.heatmap.title":"每日用量日历","usage.heatmap.gridLabel":"每日 token 用量热力日历","usage.heatmap.cell":"{date}:{total} token · {steps} 次模型步骤","usage.heatmap.hourTitle":"用量打卡图(星期 × 小时)","usage.heatmap.hourGridLabel":"按星期与小时的 token 用量打卡图","usage.heatmap.hourCell":"{weekday} {hour} 时:{total} token · {steps} 次模型步骤","usage.heatmap.scope.day":"每日","usage.heatmap.scope.hour":"小时","usage.heatmap.less":"少","usage.heatmap.more":"多","usage.errors.title":"模型报错","usage.errors.toggle":"模型报错({count} 类)","usage.errors.recent":"最近 48 小时","usage.errors.empty":"最近 48 小时没有记录到模型报错。","usage.toolErrors.title":"工具报错","usage.toolErrors.toggle":"工具报错({count} 类)","usage.toolErrors.empty":"最近 48 小时没有记录到工具报错。","usage.errors.count":"{count} 次","usage.failures.global":"全局会话统计(不受项目筛选影响):成功统计 {successful} 个会话,跳过 {failed} 个会话。","usage.failures.staleHint":"统计结果可能包含无法重新读取会话的旧缓存数据;这些数据已保留但可能过期。","usage.failures.show":"查看跳过会话详情","usage.failures.hide":"收起跳过会话详情","usage.failures.dismiss":"关闭提示(出现新的跳过会话时会再次提示)","usage.failures.id":"会话 ID","usage.failures.code":"错误类型","usage.failures.message":"原因","usage.failures.stale":"保留上次统计(已过期,仍计入总量)","usage.failures.notStale":"无可用缓存,未计入统计","usage.failures.reason.format-migration-failed":"会话格式转换被拒绝。","usage.failures.reason.session-read-failed":"无法打开或读取会话。","usage.failures.reason.session-fold-failed":"无法统计会话事件。","notification.title":"通知","notification.description":"主会话任务结束,或会话需要授权、抉择时发送浏览器通知;子代理完成任务不通知。","notification.enable":"开启通知","notification.enabled":"通知已开启","notification.disable":"关闭通知","notification.denied":"通知权限被拒绝","notification.master":"通知总开关","notification.done":"任务结束通知","notification.input":"授权与提问通知","notification.doneTitle":"任务完成","notification.doneBody":"{title} 已完成本轮任务","notification.inputTitle":"需要你的确认","notification.inputBody":"{title}({kind})","notification.kind.approval":"等待授权","notification.kind.plan-review":"等待审阅计划","notification.kind.question":"等待选择答案","notification.bellOn":"通知开启","notification.bellOff":"通知关闭","notification.bellShow":"显示输入框旁的铃铛图标","quota.cardTitle":"额度查询","quota.navToggle":"设置页左列显示「额度查询」入口","quota.navToggleHint":"开启后在设置页左侧标签显示入口","models.navToggle":"设置页左列显示「模型配置」入口","models.navToggleHint":"开启后在设置页左侧标签显示入口","quota.window.rolling":"滚动 5 小时","quota.window.tokens-limit-u3-n5":"5 小时 Token","quota.window.tokens-limit-u6-n1":"本周 Token","quota.window.tokens-limit":"Token 额度","quota.window.time-limit-u5-n1":"MCP 配额","quota.window.time-limit":"MCP 配额","quota.window.credit-limit":"点数额度","quota.window.credits":"已用额度","quota.window.balance":"余额","quota.window.weekly":"本周","quota.window.monthly":"本月","quota.window.codex-5h":"5 小时","quota.window.codex-day":"本日","quota.window.codex-week":"本周","quota.window.codex-month":"本月","quota.window.gemini-5h":"5 小时","quota.window.gemini-week":"本周","quota.window.claude-5h":"5 小时","quota.window.claude-week":"本周","quota.panel.title":"额度用量","quota.resetCard.more":"另有 {count} 张","quota.resetCard.less":"收起","quota.panel.used":"已用","quota.panel.remaining":"剩余","quota.ring.label":"额度查询","quota.gauge.baseline":"基准满额","quota.gauge.calibrate":"设当前为满额","quota.gauge.calibrateTip":"将当前余额 {amount} 设为 100% 满额基准","quota.gauge.ratio":"余量 {percent}%","quota.filter.showAll":"查看全部额度 ({count})","quota.filter.currentOnly":"仅看当前模型","quota.updated":"更新于 {time}","quota.refreshing":"刷新中…","quota.empty":"暂无数据","quota.resetIn":"重置于 {time}","quota.window.stale":"缓存","quota.window.staleTip":"该账号实时查询失败,显示的是 CPA 上次缓存的快照(非实时值)","quota.family.gemini":"Gemini","quota.family.claude":"Claude","quota.family.codex":"Codex","quota.family.other":"其他","quota.resetCard.title":"重置卡","quota.resetCard.codexTitle":"Codex 重置卡","quota.resetCard.expires":"{date} 到期","quota.resetCard.expired":"已过期","quota.resetCard.edit":"添加重置卡","quota.advanced":"配置","quota.resetCard.dateLabel":"到期日期","quota.resetCard.nameLabel":"名称(可选)","quota.resetCard.add":"添加","quota.resetCard.cancel":"取消","quota.resetCard.remove":"移除","quota.retryAt":"{time} 后可重试","quota.manualOnly":"自动重试已暂停,请手动重试","quota.refresh":"刷新","quota.refresh.manual":"重试连接","quota.refresh.cooldown":"操作过于频繁,请在 {time} 后再试","quota.reorder":"调整排序与显隐","quota.order.title":"额度卡排序与显隐","quota.order.hint":"可通过拖拽或点击上下箭头调整卡片顺序;关闭开关可隐藏不常用卡片(隐藏只影响展示,不影响查询)。","quota.order.allHidden":"所有已适配卡片都被隐藏了;在「调整排序与显隐」里打开开关即可恢复显示。","quota.usageLink":"打开官网用量页","quota.adapt":"适配","quota.kind.opencode-go":"OpenCode Go","quota.kind.zai-coding-cn":"智谱 GLM Coding Plan","quota.kind.openrouter":"OpenRouter","quota.kind.kimi":"Kimi / Moonshot","quota.kind.siliconflow":"硅基流动","quota.kind.deepseek":"DeepSeek 开放平台","quota.kind.stepfun":"StepFun 余额","quota.kind.stepfun-step-plan":"StepFun Step Plan 订阅","quota.kind.cliproxy":"CLIProxyAPI 账号额度","quota.kind.xiaomi-token-plan-cn":"小米 MiMo Token Plan","quota.kind.command-goat":"Command Code 账号额度","quota.kind.poe":"Poe 积分","quota.kind.clinepass":"ClinePass 套餐额度","quota.kind.vercel-ai-gateway":"Vercel AI Gateway 余额","quota.window.points":"剩余积分","quota.window.total_token":"套餐总额度","quota.window.compensation_total_token":"补偿积分","quota.window.plan-name":"订阅套餐","quota.window.credit-pool":"月度 Credit 池","quota.window.topup-credit":"加油包 Credit","quota.window.five-hour":"5 小时额度","quota.window.period-spend":"本周期已用","quota.error.no-subscription":"当前账号没有生效中的订阅额度","quota.error.credential-rejected":"凭据被上游拒绝,请重新填写(控制台类渠道请重新从浏览器复制登录态)","quota.credential.editCookie":"填写控制台 Cookie(网页登录态)","quota.credential.editToken":"填写控制台令牌(Oasis-Token,浏览器登录态)","quota.kindAuto":"自动识别","quota.noAdapted":"暂无已适配的供应商,可在下方手动适配","quota.disable":"停用查询","quota.followAuto":"跟随自动识别","quota.addAdapt":"手动适配:","quota.addPickProvider":"选择供应商","quota.addPickKind":"选择类型","quota.saveFailed":"保存失败:{error}","quota.unknownProvider":"未知供应商","quota.error.credential-missing":"凭据未配置(请在 DSH 凭据中设置对应 API key)","quota.error.no-base-url":"该供应商未配置 baseURL","quota.error.credentials-unavailable":"凭据服务不可用","quota.error.http-status":"上游返回错误状态","quota.error.network":"网络错误","quota.error.network-transient":"网络不稳定(已自动重试)","quota.error.timeout":"请求超时","quota.error.bad-payload":"响应格式异常","quota.error.mgmt-disabled":"CLIProxyAPI 管理面未启用(remote-management secret-key 为空或未开启 allow-remote-management)","quota.error.mgmt-banned":"已被 CLIProxyAPI 暂时封禁(连续认证失败触发 fail2ban,请等待或更换出口 IP)","quota.error.host-not-pinned":"baseURL 与适配时记录的域名不一致,请重新保存适配","quota.error.upstream-status":"上游官方接口返回错误状态","quota.error.upstream-error":"上游服务故障(额度接口报错,稍后自动重试)","quota.credential.edit":"填写 API 密钥","quota.credential.editExisting":"修改凭据(已配置)","quota.credential.editManagement":"填写管理密钥(网页登录的 key)","quota.credential.nameLabel":"凭据名称","quota.credential.valueLabel":"密钥值","quota.credential.save":"保存","quota.credential.primary":"主名(别名存一即可)","quota.credential.clear":"清除已存","quota.credential.clearConfirm":"再次点击清除","quota.credential.configured":"已配置","quota.credential.notConfigured":"未配置","quota.credential.saveFailed":"凭据保存失败:{error}","quota.credential.unknown-hint":"未知凭据名","quota.credential.invalid-value":"密钥值不能为空","quota.credential.credentials-unavailable":"凭据服务不可用","quota.error.unknown":"未知错误","quota.unadapted":"该供应商未适配,请先在下方选择类型","quota.unit.day":"{count} 天","quota.unit.hour":"{count} 小时","quota.unit.minute":"{count} 分钟","quota.window.granted-balance":"赠送余额(未过期)","quota.peak.nowIdle":"当前空闲时段 · 半价计费","quota.peak.nowPeak":"当前高峰时段 · 标准价","quota.peak.untilIdle":"{time} 转空闲({dur}后)","quota.peak.untilPeak":"{time} 转高峰({dur}后)","quota.peak.tag.peak":"忙时","quota.peak.tag.idle":"闲时","quota.peak.caption":"空闲时段价格为高峰时段价格的一半。高峰时段:北京时间周一至周五(不含中国法定节假日)09:00–12:00、14:00–18:00;其余时段,包括周末及中国法定节假日全天均为空闲时段。","quota.peak.caption.degraded":"暂未收录 {year} 年的中国法定节假日安排,本年度按「周一至周五 09:00–12:00、14:00–18:00」估算,节假日期内可能显示为高峰;更新插件后即可自动收录当年安排。","quota.peak.caption.zai":"非高峰时段模型调用按基础积分的 50% 抵扣。高峰时段:每周一至周五 14:00–18:00(UTC+8);其余时间为非高峰时段,周六和周日全天空闲。","features.fileEditor":"右栏文件编辑","features.modelProviderIcons":"模型厂家图标","editor.viewer":"编辑","editor.loading":"正在读取文件…","editor.preview":"预览","editor.save":"保存","editor.saving":"保存中…","editor.saved":"已保存","editor.unsaved":"未保存","editor.reload":"重新加载","editor.undo":"撤销保存","editor.keyHint":"Ctrl/Cmd + S 保存","editor.conflict.title":"磁盘内容已变化,保存被拒绝","editor.conflict.body":"文件在打开后被其他改动覆盖(Agent 或其他窗口写入)。重新加载会丢弃你的修改,覆盖会把当前编辑内容直接写盘。","editor.conflict.reload":"重新加载(丢弃修改)","editor.conflict.overwrite":"用我的内容覆盖","editor.confirm.previewTitle":"返回预览","editor.confirm.previewBody":"有未保存的修改,返回官方预览将丢弃这些修改。","editor.confirm.saveBack":"保存并返回","editor.confirm.discardBack":"丢弃并返回","editor.confirm.reloadTitle":"重新加载","editor.confirm.reloadBody":"有未保存的修改,重新加载将丢弃这些修改并读取磁盘当前内容。","editor.confirm.reloadGo":"丢弃并重新加载","editor.confirm.undoTitle":"撤销保存","editor.confirm.undoBody":"将把文件恢复为本次保存之前的内容;未保存的修改会一并丢弃。","editor.confirm.cancel":"继续编辑","editor.undoConflict.title":"无法自动撤销","editor.undoConflict.body":"磁盘内容在本次保存之后又发生了变化,不能自动恢复为保存前内容;可重新加载查看当前内容。","editor.undoConflict.dismiss":"关闭","editor.readonlyHint":"只读","editor.retry":"重试","editor.error.file-not-found":"文件不存在(可能已被移动或删除)。","editor.error.not-regular-file":"这不是普通文件,无法编辑。","editor.error.too-large":"文件超过 {limit},右栏编辑器只读:请用其他预览器查看。","editor.error.binary-file":"不是 UTF-8 文本文件,右栏编辑器无法编辑。","editor.error.session-not-live":"该会话当前未激活,无法编辑(可切换到其他预览器查看)。","editor.error.file-forbidden":"当前会话的沙箱策略不允许写入这个文件。","editor.error.unavailable":"宿主文件服务不可用,暂时无法编辑。","editor.error.invalid-address":"文件地址无法识别,无法编辑。","editor.error.file-stale":"磁盘内容已变化,请重新加载后再保存。","editor.error.file-failed":"读写失败,请重试。","editor.error.feature-disabled":"「右栏文件编辑」已在插件配置里关闭。","editor.error.internal":"操作失败,请重试。"},Q={"nav.label":"Service Control","nav.restart":"Restart","features.cardTitle":"Service control (dsh-service)","features.cardHint":"Controls optional features and external capabilities. Switches apply instantly without restart.","features.external":"External capabilities","features.healthDiagnostics":"Health diagnostics","features.modelUsage":"Model statistics","features.quotaLookup":"Quota lookup","features.backupMaintenance":"Backup maintenance","features.taskNotifications":"Task notifications","features.healthz":"/healthz liveness endpoint","features.skillManager":"Skill manager","features.readOnly":"These settings are read-only.","tabs.skills":"Skills","tabs.subagent":"Subagents","tabs.sessions":"Sessions","features.subagentRoute":"Subagent model","features.mobileAdaptation":"Mobile adaptation","features.sessionManager":"Session manager","sessions.title":"Session manager","sessions.filter.all":"All","sessions.filter.archived":"Archived","sessions.filter.deleted":"Deleted","sessions.filter.subagent":"Subagents only","sessions.refresh":"Refresh","sessions.batch.enter":"Select multiple","sessions.batch.exit":"Exit selection","sessions.batch.selectAll":"Select all","sessions.batch.clearAll":"Clear all","sessions.batch.selectSubagents":"Select subagents","sessions.batch.selected":"{count} selected","sessions.batch.selectRow":"Select session: {title}","sessions.batch.export":"Export ({count})","sessions.batch.archive":"Archive ({count})","sessions.batch.unarchive":"Unarchive ({count})","sessions.batch.delete":"Delete ({count})","sessions.batch.clear":"Clear ({count})","sessions.batch.completed":"{action} completed for {count}","sessions.batch.failed":"{action} completed for {done}/{total}; {error}","sessions.batch.deleteTitle":"Delete {count} sessions","sessions.batch.deleteBody":"This permanently deletes the logs of the archived sessions below. This cannot be undone.","sessions.batch.deleteItem":"{title} ({bytes})","sessions.batch.clearTitle":"Clear {count} deleted records","sessions.batch.clearBody":"Are you sure you want to clear the following {count} deleted records? They will be permanently removed from the record list.","sessions.status.loading":"Loading…","sessions.status.working":"Working…","sessions.status.unavailableTime":"Time unavailable","sessions.glyph.expand":"▸","sessions.glyph.collapse":"▾","sessions.glyph.back":"←","sessions.search.placeholder":"Search conversation content…","sessions.search.archivedOnly":"Search archived only","sessions.sort.createdDesc":"Created (newest first)","sessions.sort.createdAsc":"Created (oldest first)","sessions.sort.title":"By title","sessions.sort.project":"By project","sessions.projectGroup.countOne":"1 session","sessions.projectGroup.countMany":"{count} sessions","sessions.projectGroup.noCwd":"(no workspace)","sessions.row.live":"Running","sessions.row.archived":"Archived","sessions.row.deleted":"Deleted","sessions.row.subagent":"Subagent","sessions.subagent.hostLegacy":"The plugin host is outdated and the list carries no subagent flags; upgrade the plugin and restart dsh for “Subagents only” to take effect","sessions.row.events":"{count} events","sessions.row.noTitle":"(No title)","sessions.action.view":"View","sessions.action.export":"Export","sessions.action.archive":"Archive","sessions.action.unarchive":"Unarchive","sessions.action.delete":"Delete","sessions.action.clear":"Clear","sessions.empty.all":"No sessions","sessions.empty.archived":"No archived sessions","sessions.empty.deleted":"No deleted sessions yet","sessions.empty.search":"No matches for “{query}”","sessions.error.load":"Load failed: {error}","sessions.error.feature-disabled":"Session manager is disabled in settings","sessions.error.network":"Network error: cannot reach the host","sessions.error.session-not-found":"Session not found or already deleted","sessions.error.live-session-rejected":"Session is running and cannot be deleted","sessions.error.session-not-archived":"Only archived sessions can be deleted","sessions.error.unknown-delete-plan":"Delete request expired, please retry","sessions.error.invalid-session-ids":"Invalid session IDs","sessions.error.unarchive-unsupported":"Unarchiving is not supported by current host (requires DSH ≥ 0.1.6)","sessions.error.export-failed":"Export failed: {error}","sessions.detail.back":"Back to list","sessions.detail.open":"Open in official view","sessions.detail.archiveDisabled":"Archived or blank sessions cannot be opened in the official view","sessions.detail.exportAll":"Export full ZIP","sessions.detail.exporting":"Exporting…","sessions.detail.loadMore":"Load more ({remaining})","sessions.detail.noMore":"All {total} events loaded","sessions.detail.noise":"System events","sessions.detail.noiseBlock":"{count} system events","sessions.detail.noiseExpand":"Expand all","sessions.detail.noiseCollapse":"Collapse","sessions.detail.toolBlock":"{count} tool messages","sessions.detail.toolCollapse":"Collapse","sessions.detail.cwd":"{cwd}","sessions.detail.created":"Created {time}","sessions.md.copy":"Copy","sessions.md.copied":"Copied","sessions.md.footnotes":"Footnotes","sessions.hit.title":"{count} hits","sessions.hit.return":"Back to search results","sessions.hit.badge":"HIT","sessions.hit.prev":"◀ Prev","sessions.hit.next":"Next ▶","sessions.hit.inSession":"{count} matches in this session","sessions.delete.title":"Delete session","sessions.delete.body":"This permanently deletes the session log below. This cannot be undone.","sessions.delete.consequence.log":"Delete session log ({bytes})","sessions.delete.consequence.sidebar":"Session disappears from the official sidebar","sessions.delete.confirm":"Delete","sessions.delete.cancel":"Cancel","sessions.delete.done":"Deleted","sessions.clear.title":"Clear deleted record","sessions.clear.body":"Are you sure you want to clear this deleted record? It will be permanently removed from the record list.","sessions.clear.confirm":"Clear","sessions.clear.cancel":"Cancel","sessions.export.includes":"Includes subagents and attachments","sessions.navToggle":"Show “Sessions” entry in the settings sidebar","sessions.oneWay":"Archiving cannot be undone","sessions.oneWayHint":"Archived sessions are hidden from the official sidebar; the official UI cannot unarchive, deletion here is the only way out.","mobile.fab.label":"Open sidebar menu","mobile.debug.title":"Mobile diagnostics","mobile.debug.viewport":"Viewport","mobile.debug.drawer":"Drawer","mobile.debug.sidebarPanel":"Side panel","mobile.debug.details":"Details","mobile.debug.rightbar":"Rightbar","mobile.debug.errors":"JS errors","mobile.debug.stateOn":"on","mobile.debug.stateOff":"off","mobile.debug.immersive":"Immersive","mobile.debug.immersive.reason.gesture":"swipe","mobile.debug.immersive.reason.arrival":"arrival","mobile.debug.immersive.reason.focus":"focus","mobile.debug.immersive.reason.button":"to-bottom","mobile.debug.edge":"Edge","mobile.debug.edge.fieldStart":"start","mobile.debug.edge.fieldMoves":"moves","mobile.debug.edge.fieldLast":"last","mobile.debug.edge.fieldCancel":"cancel","mobile.debug.edge.fieldReason":"reason","mobile.debug.edge.open":"open","mobile.debug.edge.leftOpen":"open L","mobile.debug.edge.rightOpen":"open R","mobile.debug.edge.leftClose":"close L","mobile.debug.edge.rightClose":"close R","mobile.debug.edge.reason.multiTouch":"multi-touch","mobile.debug.edge.reason.modal":"modal","mobile.debug.edge.reason.hScroll":"h-scroll","mobile.debug.edge.reason.noPoint":"no point","mobile.debug.edge.reason.absentRight":"right sidebar absent","mobile.debug.edge.reason.badButton":"right sidebar toggle unavailable","mobile.debug.edge.reason.noTracker":"no tracker","conversation.jump.previousReply":"Previous user message","subagent.title":"Subagent model","subagent.loading":"Reading configuration…","subagent.hint":'Controls the model used by subagents without an explicit model; explicitly specified ones are unaffected. Switching modes keeps the saved custom model and fallback list; switch back to "Custom" to reuse them.',"subagent.mode.label":"Mode","subagent.mode.inherit":"Default (no override)","subagent.mode.inherit.desc":"Injects nothing and keeps the native inheritance: subagents use the model baked in when the session was created.","subagent.mode.follow":"Follow main model","subagent.mode.follow.desc":"Each delegation reads the model the main conversation actually uses right now (route of its latest request) and injects it.","subagent.mode.custom":"Custom","subagent.mode.custom.desc":"Every delegation without an explicit model uses the model selected below.","subagent.preset":"Agent preset","subagent.preset.inherit":"Inherit parent (default)","subagent.preset.desc":"Gives every spawned subagent one independent Agent preset (role and tools together); leave empty to follow the parent preset. An explicitly specified preset wins, and only delegation backends that support independent presets are affected.","subagent.preset.empty":"The host exposes no preset list (requires a 0.2.1-alpha.3+ host).","subagent.provider":"Provider","subagent.model":"Model","subagent.reasoningEffort":"Reasoning effort","subagent.reasoningEffort.default":"Use model default (unspecified)","subagent.reasoningEffort.unavailable":"This model does not declare selectable reasoning levels","subagent.modelsEmpty":"Model list is empty: host LLM channels cannot be resolved.","subagent.save":"Save","subagent.saved":"Saved","subagent.reset":"Reset to default","subagent.saving":"Saving…","subagent.unavailable":"The host exposes no subagents registry (service missing); this configuration has no effect.","subagent.error":"Operation failed: {error}","subagent.error.feature-disabled":"Subagent model is switched off in settings","subagent.error.llm-unavailable":"Host LLM service is unavailable","subagent.error.unknown-mode":"Unknown mode","subagent.error.invalid-model-route":"Provider or model is not in the host catalog","subagent.error.invalid-reasoning-effort":"This reasoning effort is not supported by the selected model; choose another","subagent.error.network":"Network error: cannot reach the host","subagent.fallback.title":"Fallback models (in order)","subagent.fallback.item":"Fallback {index}","subagent.fallback.hint":"When the primary route is unavailable (channel unloaded, or quota state marks it unserviceable), try fallbacks in order; if none works, fall back to native inheritance instead of failing the delegation.","subagent.fallback.add":"Add fallback","subagent.fallback.sort":"Reorder","subagent.fallback.sort.done":"Done","subagent.fallback.remove":"Remove","subagent.fallback.up":"Move up","subagent.fallback.down":"Move down","subagent.fallback.empty":"No fallbacks: delegations fall back to native inheritance when the primary route is unavailable.","subagent.fallback.limit":"Limit reached ({max})","subagent.error.invalid-fallback-route":"Fallback entry is not in the host catalog, please choose again","subagent.dock.label":"Subagents: ","subagent.dock.title":"Show subagent info under the composer","skills.error":"Operation failed: {error}","skills.error.feature-disabled":"Skill manager is switched off in settings","skills.error.network":"Network error, try again later","skills.error.read-only-source":"This entry lives in a read-only source","skills.error.unknown-skill":"Skill not found; the list may have changed, refresh and retry","skills.error.invalid-skill":"Entry is currently invalid: {reason}","skills.error.invalid-field":"Invalid switch field","skills.error.invalid-enable":"Invalid switch value","skills.error.invalid-model-route":"Invalid model route; pick a model again","skills.error.invalid-description":"Description cannot be empty","skills.error.describe-timeout":"Model generation timed out (90s)","skills.error.empty-output":"Model produced no body output (finish: {kind})","skills.error.batch-cancelled":"Cancelled","skills.error.entry-changed":"Entry changed during the run; skipped","skills.error.unknown-batch-plan":"Batch plan is stale; regenerate it","skills.error.batch-already-done":"That batch already finished","skills.error.batch-already-cancelled":"That batch was already cancelled","skills.error.annotated-confirm-required":"Annotated skills need an explicit confirm before being overwritten","skills.empty":"No skills found","skills.filter":"Filter by name…","skills.expandAll":"Expand all","skills.collapseAll":"Collapse all","skills.colon":": ","skills.group.auto":"Auto-loaded","skills.group.manual":"Manual only","skills.group.disabled":"Fully disabled","skills.source.project-dsh":"Project .dsh","skills.source.project-agents":"Project .agents","skills.source.user-dsh":"User DSH","skills.source.user-agents":"User .agents","skills.source.bundled":"Bundled","skills.source.custom":"Custom dir","skills.badge.shadowed":"Shadowed","skills.badge.readonly":"Read-only","skills.badge.annotated":"Annotated","skills.note.stale":"Body changed; refill needed","skills.note.remove":"Remove AI note","skills.note.panelOnly":"Notes are stored and shown in this panel only; SKILL.md is never modified.","skills.log.title":"Run log","skills.log.located":"Located skill {name} ({chars} chars)","skills.log.attempt":"Attempt {n}/{total}: calling {route}","skills.log.received":"Output received ({chars} chars), parsing JSON…","skills.log.parsed":"Parsed OK, draft ready","skills.log.failed-retry":"Failed: {message}, retrying","skills.log.failed":"Failed: {message}","skills.log.wait":"Waiting for model output… {secs}s","skills.log.first-delta":"Model started returning","skills.log.first-reasoning":"Model started returning (reasoning first)","skills.log.progress":"Received {chars} chars","skills.log.finish-reasoning-only":"Finished: {kind} (only {chars} reasoning chars, no body)","skills.log.finish-empty":"Finished: {kind} (no output)","skills.log.block-extract":"Extracted body from whole block ({chars} chars)","skills.log.item-start":"Generating note…","skills.batch.toggle":"Batch annotate","skills.batch.collapse":"Collapse","skills.batch.already":"A batch is already running; wait for it or cancel first","skills.invalid.legacy":"Legacy invocation keys present; excluded from the model catalog","skills.invalid.other":"Invalid entry: {reason}","skills.fix.legacy":"Fix legacy keys","skills.switch.model":"Visible to model","skills.switch.user":"Invocable via /","skills.switch.confirm":"Click again to apply","skills.describe.button":"Fill with AI","skills.describe.title":"Fill metadata with AI — {name}","skills.describe.model":"Model","skills.describe.models.loading":"Loading models…","skills.describe.models.empty":"No configured models found","skills.describe.run":"Generate draft","skills.describe.running":"Generating…","skills.apply.title":"Save AI note — {name}","skills.apply.description":"Description","skills.apply.usage":"Usage","skills.apply.old":"Old","skills.apply.new":"New","skills.apply.confirm":"Save note","skills.apply.done":"Note saved","skills.apply.keepusage":"(keep existing)","skills.llm.unavailable":"Host LLM service unavailable; AI fill disabled.","skills.batch.title":"Batch-fill skill descriptions","skills.batch.hint":"Call the selected model per skill to draft explanations for uncommented or changed skills; annotated skills are listed separately and are only overwritten after an explicit confirm. Results stay in the plugin and render below the entry.","skills.batch.plan":"Plan batch","skills.batch.candidates":"{count} candidates","skills.batch.estBytes":"~{size} of content will be sent","skills.batch.skipped":"{count} skipped (invalid / shadowed)","skills.batch.annotated":"{count} annotated will be overwritten","skills.batch.annotatedList":"To be overwritten","skills.batch.forceConfirm":"Confirm forced refill ({count} annotated)","skills.skippedList":"Skipped","skills.skip.shadowed":"shadowed","skills.skip.invalid":"invalid ({reason})","skills.skip.reason.missing-frontmatter":"no frontmatter","skills.skip.reason.missing-name":"missing name","skills.skip.reason.invalid-name":"invalid name","skills.skip.reason.missing-description":"missing description","skills.skip.reason.too-large":"file too large","skills.skip.reason.legacy-invocation-key":"legacy invocation keys","skills.batch.start":"Start batch","skills.batch.progress":"Progress {done}/{total}","skills.batch.current":"Current: {name}","skills.batch.cancel":"Cancel","skills.batch.phase.idle":"Idle","skills.batch.phase.planned":"Planned — review candidates, then press Start","skills.batch.phase.running":"Running","skills.batch.phase.done":"Done","skills.batch.phase.cancelled":"Cancelled","skills.batch.failures":"{count} failed","skills.batch.no-candidates":"Nothing to fill","skills.batch.model":"Model","overlay.label":"Service restart status","recovery.waiting.title":"Restarting service…","recovery.waiting.body":"Waiting for a new DSH Web process. Elapsed: {seconds} seconds.","recovery.timeout.title":"Service has not recovered","recovery.timeout.body":"Waited 60 seconds. Check the external process manager, or refresh the page manually.","recovery.manual":"Manual reload","health.title":"Health","health.uptime":"Uptime","health.rss":"Memory RSS","health.platform":"Platform","health.nodeVersion":"Node version","health.liveSessions":"Live sessions","health.persistedSessions":"Persisted sessions","health.activeAgents":"Active agents","health.activeJobs":"Background jobs","health.uptimeValue":"{hours} h {minutes} min","health.error":"Could not read health metrics","health.check":"Run health check","health.checking":"Checking…","health.overall.ok":"Healthy","health.overall.warning":"Warning","health.overall.error":"Error","health.alert.title":"Health alert","health.alert.diagnostics":"The health check reported {status}. Review the affected items below.","health.status.ok":"Healthy","health.status.warning":"Warning","health.status.error":"Error","health.status.info":"Info","health.check.session-storage":"Session storage","health.check.workspace-registry":"Workspace registry","health.check.dsh-home":"DSH_HOME","health.check.backup-storage":"Backup storage","health.check.tar":"tar","health.check.permissions":"File permissions","health.check.runtime-env":"Runtime environment","health.check.node-version":"Node runtime","health.detail.runtime-env.managed":"Managed by {kind}; the process restarts automatically after exit","health.detail.runtime-env.declared":"Declared externally managed via DSH_SERVICE_RUNTIME_ENV","health.detail.runtime-env.manual":"Likely a manual terminal launch — nothing restarts the process after exit; one-click upgrade already keeps it running","health.detail.runtime-env.unknown":"No process manager detected, so automatic restart cannot be confirmed; set DSH_SERVICE_RUNTIME_ENV=managed if one exists","health.detail.runtime-env.desktop":"Managed by DSH Desktop (Electron); restarting is the app's job — quit it from the tray/menu and open it again","health.detail.node-version.ok":"{version}, meets the >={required} requirement","health.detail.node-version.warning":"{version} is below the required {required}.x; upgrading Node is recommended","health.detail.session-storage.ok":"Available, with {count} session snapshots","health.detail.workspace-registry.ok":"Available, with {count} workspaces","health.detail.dsh-home.ok":"Directory is accessible with mode {mode}","health.detail.backup-storage.empty":"Backup directory is available; no backups exist yet","health.detail.backup-storage.ok":"Backup directory is available, with {count} backups using {size}","health.detail.tar.ok":"The tar executable is available","health.detail.permissions.ok":"Permission check passed with no anomalies","health.detail.permissions.warning":"Found {count} file or directory permission anomalies","health.detail.generic":"{status}","health.check.usage-index":"Usage index","health.detail.usage-index.never":"No usage index yet; open the Model usage page to build it read-only","health.detail.usage-index.unavailable":"The usage index could not be read","health.detail.usage-index.ok":"{indexed} sessions indexed, updated {updated}","health.detail.usage-index.info":"{failed} session(s) could not be indexed (usage is undercounted); {indexed} indexed, updated {updated}","health.detail.usage-index.warning":"{failed} session(s) could not be indexed (usage is undercounted); {indexed} indexed, updated {updated}","health.check.notification-permission":"Notification permission","health.detail.notification-permission.granted":"The browser is allowed to show system notifications","health.detail.notification-permission.default":"The browser has not granted system notifications yet; enable them under Configuration → Notifications","health.detail.notification-permission.denied":"The browser blocked system notifications; restore them in the site settings","health.detail.notification-permission.unsupported":"This browser does not support system notifications","health.check.plugins":"Plugins","health.detail.plugins.unavailable":"Plugin health check unavailable (host loader is not exposed)","health.detail.plugins.ok":"{total} plugins healthy","plugin.issue.failed":"{failed} failed plugin(s)","plugin.issue.pending":"{pending} pending plugin(s)","plugin.issue.info":"{count} plugin state(s) need review","plugin.state.pending":"Waiting","plugin.state.loading":"Loading","plugin.state.failed":"Failed","plugin.state.disposed":"Disposed","plugin.state.unknown":"Unknown state","plugin.state.unloading":"Unloading","plugin.missingDeps":"Missing deps: {deps}","plugin.error":"Error: {error}","plugin.restart":"Reload","plugin.restarting":"Reloading…","plugin.restartConfirm":"Confirm reload","plugin.restartHint":'Reloading "{name}" re-runs its startup logic; the failure state refreshes afterwards.',"plugin.restartCancel":"Cancel","plugin.restartFailed":"Reload failed: {detail}","plugin.error.unknown-plugin":"Plugin not found","plugin.error.loader-unavailable":"Host loader unavailable","plugin.error.plugin-disabled":"The plugin is disabled and cannot be reloaded","plugin.error.not-failed":"The plugin is not in a failed state","plugin.error.restart-failed":"Still failed after reload","tabs.overview":"Overview","tabs.notify":"Notifications","tabs.health":"Health","tabs.usage":"Models","tabs.quota":"Quota lookup","overview.container":"Process and runtime","overview.errors":"Errors","overview.status.normal":"All systems nominal","overview.status.info":"You have {count} note(s)","overview.status.warning":"You have {count} item(s) to review","overview.status.error":"You have {count} item(s) needing attention","overview.backupEmpty":"No backups yet — consider creating one","overview.updateAvailable":"A new version is available","tabs.backup":"Backup","tabs.restart":"Restart","tabs.maintenance":"Maintenance","tabs.configuration":"Configuration","tabs.models":"Models","page.models.desc":"Provider workbench: status overview, per-provider check → suggest → apply → verify, and persistent undo; any public HTTPS relay can be checked safely.","features.modelCatalog":"Model catalog","models.time.justNow":"just now","models.time.minAgo":"{n} min ago","models.time.hourAgo":"{n} h ago","models.security.title":"Security & data notes","models.security.urlTitle":"How URLs are used","models.security.urlBody":'"Check & fix" requests {baseURL}/models once, only when you click it. Any public HTTPS address can be checked, but the plugin validates it first (HTTPS only, default port 443 only, private and reserved ranges refused, DNS resolved and pinned for the direct connection) and refuses the request when validation fails. Non-public addresses still work when saved; the plugin just never checks them online.',"models.security.keyTitle":"How API keys are stored","models.security.keyBody":"The plugin never reads, echoes, or logs your key. A check authorizes the stored credential only when you explicitly click, and sends it only to the route's current address. Credential actions are never undoable and never enter undo snapshots.","models.security.revertTitle":"How config is reverted","models.security.revertBody":"Writes only touch the llm-pi-ai section of settings.yaml: field-level preview → two-step confirmation → a full pre-write snapshot (without keys) persisted locally, undoable anytime. Data failing validation is rejected as a whole.","models.routes.title":"Providers","models.wb.empty":"No providers yet: create a custom provider on the official Settings → Models page (or enable a built-in channel), then manage it here.","models.wb.modelCount":"{n} models","models.wb.meta":"Capacity {ctx} · Vision {vision} · Reasoning {reasoning}","models.wb.neverValidated":"never validated","models.wb.lastValidated":"validated {time}","models.wb.validationFailed":"last validation failed","models.wb.undoAvailable":"undo available","models.wb.builtin":"built-in channel","models.wb.builtinUser":"Official built-in","models.wb.seeImage":"Vision","models.wb.canThink":"Thinking","models.wb.attention.dangling":"Credential is not configured","models.wb.attention.danglingHint":"This provider declares a key reference but no matching key exists locally. Fill it in on Settings → Models, or clear the reference.","models.wb.attention.validation":"Last validation failed","models.wb.attention.validationHint":"The last validation did not pass. Open the provider and re-run validation to see which check failed.","models.wb.attention.recovery":"Manual recovery pending","models.wb.attention.recoveryHint":"A previous write failed midway; automatic writes are blocked until recovered manually on the official settings page.","models.wb.attention.invalid":"Invalid configuration structure","models.wb.attention.invalidHint":"Some model fields cannot be persisted. Check model parameters (positive context/output, valid thinking levels).","models.wb.detail.todos":"This provider has {n} items to address","models.wb.legend":"Legend: Official built-in = a DSH-provided channel · Vision = image input support · Thinking = thinking levels support · Dotted underline text = an item to address (hover for the reason)","models.wb.needsAttention":"Needs attention","models.wb.checkFix":"Check & fix","models.wb.undoWrite":"Undo last write","models.wb.phase.inspect":"Check","models.wb.phase.suggest":"Suggest","models.wb.phase.apply":"Apply","models.wb.phase.verify":"Verify","models.wb.task.title":"Check & fix ({route})","models.wb.task.back":"Back to list","models.wb.check.busy":"Checking…","models.wb.check.start":"Start check","models.wb.check.recheck":"Re-check","models.wb.check.notProbed":"Gateway not probed (fetch addable models on demand)","models.wb.check.fetchAdditions":"Fetch addable models","models.wb.check.ok":"Gateway returned {n} models","models.wb.check.failed":"Gateway check failed: {error}","models.wb.check.unsupported":"Online listing is unsupported for this protocol; skipped","models.wb.check.insecure":"The address is not a public HTTPS URL; online check refused","models.wb.check.private":"The address resolves to a private/reserved range; online check refused","models.wb.check.ipliteral":"The address is an IP literal; online check refused","models.wb.check.dns":"DNS resolution failed","models.wb.check.credential":"Stored credential authorized (sent only to this route's current address)","models.wb.check.anon":"Anonymous check (no stored credential found)","models.wb.reasoning":"Thinking","models.wb.add.online":"Fetch online","models.wb.add.manual":"Enter manually","models.wb.add.choose":"Choose a model…","models.wb.add.detect":"Detect model","models.wb.add.detected":"Detected","models.wb.add.prepare":"Prepare add","models.wb.add.unverified":"Detection failed; add unverified","models.wb.add.unverifiedReason":"Detection failed: {error}","models.wb.add.unverifiedHelp":"This model did not pass runtime validation (no catalog record or resolution failed). You may still add it; call failures are on you.","models.wb.add.probeName":"Name","models.wb.add.probeContext":"Context","models.wb.add.probeMax":"Max output","models.wb.add.probeModel":"Model id: {id}","models.wb.add.detectHint":"Type a model id then press Detect or Enter.","models.wb.verifyOnline":"Verify online","models.wb.verifyOnline.busy":"Querying model profile…","models.wb.verifyOnline.title":"Model profile check ({model})","models.wb.verifyOnline.source":"Source: {name}","models.wb.verifyOnline.open":"View model page","models.wb.verifyOnline.noMatch":"No related parameters found","models.wb.verifyOnline.notFound":"Model not found in the OpenRouter catalog","models.wb.verifyOnline.error":"Query failed: {error}","models.wb.verifyOnline.note":"Results are reference only; nothing is written automatically.","models.wb.add.allowUnverified":"Add unverified anyway","models.wb.add.confirmSummary":"Only Image/thinking/capacity settings will be saved; other advanced fields stay unchanged.","models.wb.add.commit":"Confirm add","models.wb.detail.models":"Configured models","models.wb.detail.expand":"Expand params","models.wb.detail.collapse":"Collapse params","models.wb.detail.context":"Context window","models.wb.detail.maxTokens":"Max output","models.wb.detail.image":"Image input","models.wb.detail.imageState.yes":"Supported","models.wb.detail.imageState.no":"Not supported","models.wb.detail.imageState.detected":"Follow detection","models.wb.detail.thinking":"Thinking","models.wb.detail.thinkingState.yes":"Supported","models.wb.detail.thinkingState.no":"Not supported","models.wb.detail.thinkingState.detected":"Follow detection","models.wb.detail.thinkingState.follow":"Follow default","models.wb.detail.apply":"Apply changes","models.wb.detail.finalConfirm":"Final confirm","models.wb.detail.changeSummary":"{changes} field changes · {added} added · {removed} removed","models.wb.detail.advice":"Suggestion","models.wb.detail.useAdvice":"Apply suggestion","models.wb.detail.noAdvice":"No suggestion","models.wb.detail.adviceSource":"From {source}","models.wb.detail.runtime":"runtime","models.wb.detail.split":"Sources disagree, pick one","models.wb.detail.hitCount":"{count} sources agree on this value ({total} sources total)","models.wb.detail.othersCount":"{n} more distinct values","models.wb.detail.empty":"This provider has no configured models yet.","models.wb.detail.saved":"Applied and live","models.wb.detail.notice":"Needs attention","models.wb.detail.recheck":"The plugin re-validates the parameters again after the final confirm.","models.wb.chip.safeFill":"fills","models.wb.chip.conflict":"conflicts","models.wb.chip.addition":"additions","models.wb.chip.unknown":"unrecognized","models.wb.group.safeFill":"Safe fills (missing fields; high confidence pre-checked)","models.wb.group.conflict":"Conflicts (config differs from catalogs; unchecked by default)","models.wb.group.addition":"Addable models (new from gateway/catalogs; unchecked by default)","models.wb.group.unknown":"Unrecognized models (kept; never auto-removed)","models.wb.group.more":"Show all ({n})","models.wb.group.less":"Collapse","models.wb.selectRow":"All","models.wb.clearRow":"None","models.wb.filter":"Filter models…","models.wb.selected":"{n} selected","models.wb.confidence.low":"needs confirm","models.wb.inexpressible":"includes {n} values DSH cannot express","models.wb.unknownRow":"Unrecognized: absent from the gateway listing and catalogs; kept as-is","models.wb.suggestEmpty":"Nothing to do: the configuration already matches the gateway and catalogs.","models.wb.prepare":"Prepare apply","models.wb.apply.title":"Apply preview","models.wb.apply.summary":"{changes} field changes · {added} added · {removed} removed","models.wb.apply.noCredentialOps":"Credentials & keys: not involved in this plan.","models.wb.apply.empty":"Empty plan: nothing to write.","models.wb.apply.confirm":"Confirm apply","models.wb.apply.back":"Back to edits","models.wb.applied":"Applied {n} items; the write took effect immediately","models.wb.conflict":"The configuration changed after the plan was generated; the write was refused to avoid overwriting. Re-check and retry.","models.wb.undo.title":"Undo preview ({route})","models.wb.undo.at":"written {time}","models.wb.undo.restorable":"{n} fields to restore:","models.wb.undo.restoreField":"{model} · {field}: restore to {value}","models.wb.undo.removeField":"{model} · {field}: remove explicit value","models.wb.undo.nothing":"No field differences to restore.","models.wb.undo.added":"{n} models were added since the write (kept by default)","models.wb.undo.dropAdded":"also remove these additions","models.wb.undo.removed":"{n} models were removed since the write (kept removed by default)","models.wb.undo.restoreRemoved":"also restore these removed models","models.wb.undo.confirm":"Confirm undo","models.wb.undo.cancel":"Cancel","models.wb.undo.done":"Undone and live","models.wb.create.title":"Add provider","models.wb.create.displayName":"Display name","models.wb.create.baseURL":"API address (HTTPS)","models.wb.create.api":"API protocol","models.wb.create.key":"API key (optional; held in task memory only, stored to the local credential store on create)","models.wb.create.route":"Provider ID (suggested from the display name, editable; immutable after creation)","models.wb.create.begin":"Check & prepare","models.wb.create.manual":"Manual model IDs (one per line, optional)","models.wb.create.pick":"Pick models to create (none selected by default)","models.wb.create.summary":"Will create {route}: {n} models{credential}.","models.wb.create.credNote":", and stores the key in the local credential store","models.wb.create.confirm":"Confirm create","models.wb.create.cancel":"Cancel","models.wb.create.created":"Created {route}","models.plan.confirmArmed":"Click again to confirm","models.wb.catalog.title":"Model catalog","models.wb.catalog.customized":"Custom model catalog","models.wb.catalog.inherited":"Using the adapter default models","models.wb.edit.title":"Edit models ({route})","models.wb.edit.name":"Name","models.wb.edit.modelId":"Model ID","models.wb.edit.modelIdPlaceholder":"Model ID","models.wb.edit.displayNamePlaceholder":"Falls back to the model ID when blank","models.wb.edit.context":"Context window","models.wb.edit.contextPlaceholder":"Inherit the catalog default","models.wb.edit.maxTokens":"Max output tokens","models.wb.edit.maxTokensPlaceholder":"Inherit the catalog default","models.wb.edit.capacityInvalid":"Capacity must be positive; a K/M suffix is allowed, e.g. 131072, 256K, 1M.","models.wb.edit.inputModalities":"Input modalities","models.wb.edit.outputModalities":"Output modalities","models.wb.edit.modalityText":"Text","models.wb.edit.modalityImage":"Image","models.wb.edit.outputReadonly":"Output modalities come from the adapter and its built-in catalog; a model entry has no such field, so this is display only.","models.wb.edit.reasoningLevels":"Reasoning levels","models.wb.edit.reasoningNoneHint":"Leaving every level unchecked means a non-reasoning model","models.wb.edit.reasoningFalse":"Non-reasoning model (reasoning=false)","models.wb.edit.wireCustom":"Custom protocol value","models.wb.edit.wireHint":"By default the level name is sent; edit the field to send a custom value.","models.wb.edit.advanced":"Model options","models.wb.edit.inputImage":"Image input","models.wb.edit.reasoning":"Thinking levels","models.wb.edit.reasoningOff":"off (no param)","models.wb.edit.clearOverride":"Clear explicit value (inherit default)","models.wb.edit.addModel":"Add model","models.wb.tab.models":"Models","models.wb.tab.connection":"Connection","models.wb.tab.danger":"Undo & delete","models.wb.state.runtimeLoaded":"Loaded at runtime","models.wb.state.runtimeMissing":"Not loaded at runtime","models.wb.search.placeholder":"Search model id or name","models.wb.search.none":"No matching model","models.wb.keyRef":"credential {ref}","models.wb.conn.displayName":"Display name","models.wb.conn.api":"Protocol","models.wb.conn.baseURL":"Endpoint URL","models.wb.conn.urlHint":"The address is stored as configuration data only. Only public HTTPS addresses may fetch a model list online; other addresses can still be saved and filled in manually.","models.wb.conn.key":"Replace key","models.wb.conn.keyPlaceholder":"Enter the new key (the old one is never shown)","models.wb.conn.keyHint":"The key is submitted once: never displayed, never logged, never in an undo snapshot or a browser draft. Deleting a route keeps the credential.","models.wb.conn.save":"Save connection","models.wb.conn.probeOk":"This address may fetch the model list online.","models.wb.conn.probeBlocked":"Online discovery is unavailable for this address ({reason}); saving and manual entry still work.","models.wb.conn.credState":"Credential {ref}: {state}","models.wb.conn.credConfigured":"configured","models.wb.conn.credAbsent":"not configured","models.wb.conn.credShadowed":"shadowed by an environment variable, cannot be written","models.wb.conn.shadowWarn":"{ref} comes from the environment, so a write would be refused; unset that variable first.","models.wb.conn.planTitle":"These fields will be written","models.wb.conn.planFields":"Fields: {fields}","models.wb.conn.planNothing":"(no change)","models.wb.conn.planKey":"The credential value is replaced too.","models.wb.conn.planNoKey":"The credential is left untouched.","models.wb.conn.confirm":"Confirm save","models.wb.conn.saved":"Connection saved and live","models.wb.leave.body":"You have unsaved edits. Leaving discards these drafts.","models.wb.leave.stay":"Keep editing","models.wb.leave.go":"Discard and leave","models.wb.edit.unsaved":"unsaved","models.wb.effort.needLevel":"At least one non-off mapping value is required.","models.wb.add.title":"Add models","models.wb.add.count":"{n} models discovered, {added} already added","models.wb.add.already":"added","models.wb.add.fetching":"Fetching the model list…","models.wb.add.fallback":'A failed discovery never blocks manual entry: switch to "Enter ids manually" and continue.',"models.wb.add.note":"Listing models does not prove they can be called; use the test below after saving.","models.wb.add.manualIds":"Enter model ids manually (one per line, or comma-separated)","models.wb.add.manualHint":"Only id text is accepted; the host validates and writes the field values.","models.wb.remove.after":"This route keeps {n} models after removal.","models.wb.remove.blockedHint":"This model is referenced; clear the reference in the corresponding setting first, then come back.","models.wb.test.title":"Real call test (available after saving)","models.wb.test.note":"Run the basic check first (no cost); the deep test sends one tiny fixed prompt and may incur cost, and a failure never rolls back saved configuration.","models.wb.test.deep":"Deep test (may incur cost)","models.wb.test.deepArmed":"Click again to confirm the paid test","models.wb.test.cost":'Will send: system "Reply with OK." + user "ping", max_tokens=16, 15s timeout.',"models.wb.test.scopeShallow":"This run only checks configuration and runtime loading; it does not prove image, reasoning or context-limit support.","models.wb.test.scopeDeep":"This run only proves one basic call succeeds; it does not verify image, reasoning or context limits.","models.wb.danger.title":"Undo & delete","models.wb.routeDelete.btn":"Delete this route","models.wb.routeDelete.plan":"This removes the route from settings ({n} models).","models.wb.routeDelete.key":"Credential {ref} is retained and other routes sharing it are unaffected.","models.wb.routeDelete.noKey":"This route references no credential.","models.wb.routeDelete.blocked":"This route is the agent default model: change the default on the official settings first.","models.wb.routeDelete.refs":"{n} other reference(s) break after deletion.","models.wb.routeDelete.confirm":"Delete route","models.wb.routeDelete.confirmArmed":"Click again to confirm deletion","models.wb.rescue.title":"Recently deleted routes","models.wb.rescue.empty":"No deleted route can be restored.","models.wb.rescue.restore":"Restore this route","models.wb.rescue.taken":"A route with this name exists; rename or delete it before restoring.","models.wb.rescue.done":"Restored. The credential reference is restored too, but the old key value is not: re-enter it if needed.","models.wb.rescue.note":"Restore writes the complete pre-deletion configuration back; the old key value is not in the snapshot and cannot be restored.","models.wb.edit.save":"Save edits","models.wb.edit.confirm":"Confirm save","models.wb.edit.done":"Saved and live","models.error.last-model-undeletable":'The last model cannot be removed: an empty list means "inherit the catalog" to the host, which is not the same as disabling the route. Delete the route instead, or add a replacement model first.',"models.error.builtin-inherited-list":"This built-in channel inherits the bundled catalog; adding a model would replace that whole list. Add a custom channel as a separate route instead, or use the per-model panel to edit existing models only.","models.error.nothing-to-restore":"No deleted channel can be restored.","models.error.restore-failed":"Restore failed ({detail}); the snapshot is kept, so fix the cause and retry.","models.error.connection-failed":"Writing the connection failed: {detail}","models.wb.edit.noop":"No changes","models.wb.edit.removeHint":'To remove models use the guarded "Remove models" flow below',"models.wb.remove.btn":"Remove models","models.wb.remove.title":"Remove models ({route})","models.wb.remove.pick":"Pick models to remove (removal writes immediately and is undoable)","models.wb.remove.ref.subagent":"Subagent routing currently points at {model}; pick a replacement, committed in the same transaction","models.wb.remove.ref.default":"This model is the agent default (agent-default-model): change the default on the official settings first, then come back","models.wb.remove.migrateProvider":"Replacement provider","models.wb.remove.migrateModel":"Replacement model","models.wb.remove.plan":"Prepare removal","models.wb.remove.confirm":"Confirm removal","models.wb.remove.done":"Removed {n} models (undoable)","models.wb.verify.run":"Run validation","models.wb.verify.deep":"Deep validation (small real call; may incur cost)","models.wb.verify.deepArmed":"Click again to confirm paid validation","models.wb.verify.busy":"Validating…","models.wb.verify.check.settings":"Config write","models.wb.verify.check.providers":"Provider visibility","models.wb.verify.check.models":"Model resolution","models.wb.verify.check.credential":"Credential","models.wb.verify.check.stream":"Real call","models.wb.verify.skipped":"skipped","models.wb.verify.ok":"ok","models.wb.verify.fail":"failed: {error}","models.wb.verify.persisted":"Validation summary saved (most recent per route)","models.error.llm-missing":"The LLM service is unavailable; deep validation is impossible","models.plan.field.name":"Name","models.plan.field.contextWindow":"Context window","models.plan.field.maxTokens":"Max output","models.plan.field.input":"Input modalities","models.plan.field.reasoningEfforts":"Thinking levels","models.error.catalog-unavailable":"Catalog unavailable; retry later","models.error.route-gone":"The provider was removed from settings","models.error.plan-expired":"The plan expired; re-check first","models.error.inspect-gone":"The check result expired; re-check first","models.error.conflict":"The configuration changed; the plan was refused to avoid overwriting external edits","models.error.unknown-suggestion":"Unknown suggestion ids; re-check and retry","models.error.nothing-to-undo":"Nothing to undo","models.error.bad-route":"Provider ID must start with a lowercase letter and contain only lowercase letters, digits, and dashes","models.error.bad-api":"Pick a supported API protocol","models.error.bad-base-url":"The API address must be a valid HTTPS URL","models.error.route-taken":"A provider already uses this ID","models.error.no-base-url":"This route has no baseURL configured and the built-in catalog has no matching channel","models.error.workbenchReadonly":"Legacy writes are disabled: use the Providers & Models workbench","models.error.config-unavailable":"The model configuration instance is unavailable. Check that pi-ai is enabled in the native Plugin Manager. Nothing was written.","models.error.config-ambiguous":"Multiple pi-ai configuration instances were found. The workbench will not guess a write target. Resolve the instances in the native Plugin Manager and retry.","models.error.config-expression":"The model configuration is expression-backed. Edit it in the native configuration surface; the workbench will not replace it with static values.","models.error.config-inherited-route":"This route is inherited. Deleting it would restore the inherited value rather than remove the route. Manage its source in the native configuration surface.","models.error.bad-display-name":"A display name is required","models.error.bad-key":"The key is too long (max 4096 chars)","models.error.no-models":"At least one model is required: pick candidates or enter manual model IDs","models.error.credential-rejected":"The credential write was refused; nothing was created","models.error.create-failed":"Create failed: {detail}","models.error.draft-gone":"The create draft expired; start over","models.error.recovery-pending":"This route is pending manual recovery; automatic writes are blocked: resolve it on the official settings page first, then clear the flag","models.error.nothing-to-resolve":"Nothing to clear","models.error.bad-models":"Invalid model data","models.error.migration-required":"Subagent routing references this model: pick a replacement and retry","models.error.removal-blocked":"The agent default references this route: change the default on the official settings first","models.error.remove-failed":"Removal failed: {detail}","models.error.bad-model-id":"Model id must be 1–256 characters without control characters","models.error.model-detection-required":"Detect this model first","models.error.model-unverified":"Model detection did not verify; cannot write","models.error.unknown-option":"That candidate expired; fetch it again","models.error.unknown-detection":"That detection expired; re-detect","models.error.duplicate-model":"This model is already configured on the provider","models.error.builtin-only":"Fetch online is for custom routes only; built-in routes use the local catalog","models.error.online-custom-only":"This route is not a built-in channel, so the built-in catalog is unavailable","models.error.probe-protocol-unsupported":"This protocol does not support listing models online","models.error.unknown":"Operation failed: {detail}","tabs.providers":"Providers & Models","tabs.subagentRoute":"Subagent routing","tabs.features":"Features","tabs.notifications":"Notifications","tabs.navOrder":"Settings Nav","config.navOrder.title":"Settings Navigation Order & Visibility","config.navOrder.moveUp":"Move up","config.navOrder.moveDown":"Move down","config.navOrder.visible":"Visible","config.navOrder.hidden":"Hidden","config.navOrder.locked":"Current panel (locked)","config.navOrder.reset":"Reset to default","config.navOrder.saved":"Saved","config.navOrder.save":"Save order","config.navOrder.empty":"No registered settings tabs detected","maintenance.empty":"All maintenance pages are disabled. Enable backup, skills, subagents, or session management under “Configuration → Features”.","config.notificationsDisabled":"Task notifications are turned off on the Features page; these settings are shown for reference only until re-enabled.","features.group.runtime":"Runtime and observation","features.group.maintenance":"Maintenance","features.group.interaction":"Interaction","page.configuration.desc":"Feature switches and task notification settings.","tabs.alert.title":"Service control alert","tabs.alert.body":"These areas need attention: {tabs}","tabs.alert.join":", ","tabs.alert.dot":"Alert on this tab","permissions.title":"File permissions","permissions.description":"Checks whether the Agent can read, write, and enter DSH_HOME and workspaces. Deep scans skip .git; repair adds only the needed permissions and keeps execute bits.","permissions.target":"Target owner: {owner}","permissions.repair":"Repair permissions","permissions.repairing":"Repairing…","permissions.confirm":"Confirm repair","permissions.confirmHint":"Skips .git, restores ownership to the current user, adds Agent read/write access, and keeps existing execute bits.","permissions.cancel":"Cancel","permissions.show":"Permissions & repair","permissions.hide":"Collapse","permissions.error":"Permission operation failed","permissions.summary.ok":"{count} root path(s) passed the check","permissions.summary.warning":"{count} root path(s) need attention","permissions.showDetails":"Show details","permissions.hideDetails":"Hide details","permissions.deep":"Deep check","permissions.deepChecking":"Scanning…","permissions.deepSummary":"Scanned {scanned} entries in {duration} ms; non-editable directories {directories}, non-editable files {files}, unreadable {unreadable}.","backup.title":"Backup management","backup.description":"Backs up sessions, config, and plugin profiles — no node_modules or credentials; never auto-pruned.","backup.create":"Create backup","backup.creating":"Creating…","backup.progress.copy":"Copying session data ({current}/{total})…","backup.progress.archive":"Packing archive ({current}/{total})…","backup.progress.validate":"Verifying archive ({current}/{total})…","backup.progress.publish":"Publishing backup ({current}/{total})…","backup.total":"Total size: {size}","backup.row.version":"DSH version at backup time: {version}","backup.empty":"No backups yet.","backup.delete":"Delete","backup.confirm":"Confirm delete","backup.confirmHint":"Delete this backup? This cannot be undone.","backup.cancel":"Cancel","backup.error":"Backup operation failed","backup.export":"Export","backup.exporting":"Exporting…","backup.exportError":"Backup export failed","backup.restore":"Restore","backup.inspecting":"Inspecting…","backup.restoreConfirm":"Confirm restore","backup.restoreHint":"The integrity check passed. Confirm to apply the plan below; the host will recheck the archive and current targets immediately before committing.","backup.restoreError":"Backup restore failed","backup.error.restore-files-locked":"Restore failed: a target file is in use. Quit the desktop app, pause sync clients, or disable real-time antivirus scanning, then retry.","backup.error.restore-mapping-invalid":"The selected target profile is invalid; choose again.","backup.integrity.ok":"Integrity check passed","backup.integrity.invalid":"Archive cannot be restored","backup.integrity.summary":"{entries} entries, {size} expanded; {sessions} session file(s), {config} config file(s), {profiles} profile manifest(s).","backup.integrity.format":"Archive format {format}","backup.integrity.sourceVersion":"DSH version at backup time: {version}","backup.format.v1":"v1 (no Profile patch layer)","backup.format.v2":"v2 (includes the Profile patch layer)","backup.plan.sessions":"The sessions directory will be replaced in full","backup.plan.config":"Replace {replace} config file(s), remove {remove}","backup.plan.profiles":"Replace package.json for {count} profile(s); keep node_modules and all other files","backup.plan.profilePatches":"Restore cordis.patch.yml (the Profile configuration layer) for {count} profile(s)","backup.plan.profilePatchesAbsent":"This archive predates the Profile patch layer: it carries no cordis.patch.yml, so your current configuration is left untouched rather than overwritten or removed.","backup.plan.expires":"Restore plan expires at {time}","backup.plan.mappingHint":"Restore target profile: the profile content in the archive is written into the local profile you pick (candidates come from profiles that actually exist on this machine).","backup.plan.manifest":"Also overwrite the plugin manifest","backup.notice.source-platform-differs":"This backup comes from {detail}, a different system: sessions stay grouped under their original workspace paths, and credentials, attachments and node_modules do not travel with a backup.","backup.notice.target-case-collision":"The archive contains paths that differ only by case ({detail}); on this system they collapse into one target and may overwrite each other.","backup.notice.target-path-length":"The longest target path will reach {detail} characters, past the classic Windows limit (260), so writing may fail; enable long-path support or use a shorter workspace path.","backup.notice.target-sessions-unwritable":"The sessions directory is currently not writable ({detail}): it may be held by another process or lack permissions. Close the holder (desktop app, sync client, real-time antivirus) and retry.","backup.manualRestartTitle":"Restore completed — manual restart required","backup.manualRestartBody":"The data is restored, but the current process is still running its old state. Press Ctrl+C in the terminal running dsh, then start dsh again.","backup.manualRestartTitleDesktop":"Restore completed — restart the desktop app","backup.manualRestartBodyDesktop":"The data is restored, but the current process is still running its old state. Quit the desktop app and open it again.","backup.error.backup-gzip-invalid":"The archive is not a valid gzip file or is damaged.","backup.error.backup-tar-invalid":"The tar structure or checksum is invalid.","backup.error.backup-entry-traversal":"The archive contains an unsafe path traversal.","backup.error.backup-entry-absolute":"The archive contains an absolute path.","backup.error.backup-entry-link":"The archive contains a symbolic or hard link.","backup.error.backup-entry-type":"The archive contains an unsupported special entry.","backup.error.backup-entry-platform":"The archive contains a filename incompatible with another platform.","backup.error.backup-entry-unexpected":"The archive contains files outside the backup scope.","backup.error.backup-profile-invalid":"A profile package.json is invalid.","backup.error.backup-section-missing":"The archive is missing a required section.","backup.error.backup-size-limit":"The archive exceeds a safe size or entry limit.","backup.error.backup-archive-invalid":"The archive failed its integrity check.","backup.error.backup-archive-incomplete":"The archive does not match the backup source (a file was not captured completely), so it was not published.","backup.error.backup-source-changed":"A session is being written; the backup was not completed. Try again shortly.","backup.error.backup-source-unsafe":"The backup source contains a link or special file, so creation was refused.","backup.error.tar-failed":"The archive tool failed. Check that tar and gzip are available.","backup.error.active-work":"Running work was detected; restore is blocked for now.","backup.error.restore-plan-expired":"The restore plan expired. Inspect the backup again.","backup.error.restore-source-changed":"The backup changed before confirmation. Inspect it again.","backup.error.restore-target-changed":"Current data changed before confirmation. Inspect it again.","backup.error.restore-target-unsafe":"A restore target contains an unsafe link or special file.","backup.import":"Import backup","backup.importing":"Importing…","backup.showRecords":"Show backup records","backup.hideRecords":"Hide backup records","version.title":"Version information","version.current":"DSH: ","version.plugin":"dsh-service: ","version.loading":"Loading…","update.check":"Check for updates","update.checking":"Checking…","update.current":"Up to date","update.available":"New version: {version}","update.installedPendingRestart":"Installed {version} — restart to take effect","update.notes.button":"What's new","update.notes.hide":"Hide what's new","update.notes.loading":"Loading release notes…","update.notes.empty":"This release has no notes.","update.notes.truncated":"(Very long; showing the first {chars} characters)","update.notes.publishedAt":"Published {date}","update.notes.version":"Version {version}","update.notes.prerelease":"Pre-release","update.notes.error.release-not-found":"The release notes are not published yet (the version reached npm first; the release follows later).","update.notes.retry":"Retry","update.notes.error.release-unavailable":"Could not load the release notes. Try again later.","update.unavailable":"Latest version is temporarily unavailable","update.unpublished":"No published version is available to check","health.recheck":"Run again","update.upgrade":"Upgrade plugin","update.upgrading":"Upgrading…","update.upgradeError":"Plugin upgrade failed","update.upgradeErrorDetail":"Plugin upgrade failed ({detail})","update.upgradeSuccess":"Upgrade successful, restarting…","update.guardActiveWork":"Active sessions or background tasks are running; resolve them before upgrading","update.guardLinkInstall":"Installed via link: (development mode) — cannot one-click upgrade from the registry; update the source checkout and restart","update.guardFileInstall":"Installed via file: — cannot one-click upgrade from the registry","update.guardNoNewer":"The registry latest is not higher than the current version; refused a possible downgrade","update.guardNoProfile":"No profile with this plugin installed was found to target the upgrade at","update.guardAmbiguous":"Several profiles install this plugin and the loaded copy could not be determined; aborted","update.guardStale":"The command reported success but the installed version did not change (pnpm safety wait likely blocked it); keeping the current version without restarting","update.guardUnreadable":"The command succeeded but the installed version could not be confirmed; the restart was cancelled","update.failPnpmMissing":"pnpm was not found, so the upgrade cannot run; install pnpm first and retry","update.failNetwork":"A transient network failure occurred while fetching dependencies; please retry shortly","update.failFetchTimeout":"Download timed out (slow network or large package); please retry later","update.failReleaseAge":"The new release is blocked by pnpm's fresh-release safety wait; one automatic bypass retry also failed","update.failHoist":"This profile's node_modules was created by a different pnpm major; the rebuild retry also failed","update.failAddingToRoot":"pnpm refused to add at the workspace root (missing -w)","update.failNotWorkspace":"-w was passed but the profile is not a pnpm workspace","update.failIgnoredBuilds":"Dependency build scripts are blocked by pnpm by default, so the upgrade could not finish","env.kind.docker":"Docker container","env.kind.container":"Container (containerd/Kubernetes)","env.kind.systemd":"systemd service","env.kind.pm2":"pm2","env.kind.supervisord":"supervisord","env.kind.kubernetes":"Kubernetes","env.kind.declared":"External process manager (declared manually)","update.manualConfirmTitle":"Confirm before upgrading: manual launch suspected","update.manualConfirm":"No process manager detected. DSH will not restart automatically after the upgrade.","update.manualProceed":"Upgrade anyway","update.manualRestartTitle":"Upgrade finished — manual restart required","update.manualRestartBody":"The new version is installed, but the current process still runs the old one. Press Ctrl+C in the terminal running dsh (or simply close the window), then start dsh again.","update.manualRestartTitleDesktop":"Upgrade finished — restart the desktop app","update.manualRestartBodyDesktop":"The new version is installed, but the current process still runs the old one. Quit the desktop app and open it again.","update.desktopManagedUpgrade":"DSH Desktop installs its own plugins: update this plugin from the desktop app's plugin manager page (the CLI upgrade path is unavailable there).","restart.title":"Service restart","restart.description":"Restarts the dsh web process. Running work is interrupted; persisted sessions recover.","restart.button":"Restart dsh web","restart.sending":"Sending…","restart.confirm":"Confirm restart","restart.force":"Force restart","restart.cancel":"Cancel","restart.sent":"Restart request sent.","restart.sentHint":"The connection will close shortly. The page will reload automatically after recovery.","restart.idleHint":"No active work was detected. Confirm to disconnect and wait for the service to restart.","restart.manualWarn":"This looks like a manual terminal launch: once confirmed the process exits and nothing restarts it — you must run dsh again yourself.","restart.sentManualHint":"Manual start detected — the service will not relaunch itself. Rerun dsh in the original terminal, then refresh.","restart.desktopWarn":"This is DSH Desktop: the host is owned by the app, so confirming will neither exit nor restart it — quit the app from its tray/menu and open it again.","restart.sentDesktopHint":"DSH Desktop owns this process, so the service will not relaunch itself. Quit the desktop app and open it again.","restart.navToggle":'Show "Restart" entry in settings left nav',"restart.navToggleHint":"Off by default; when enabled, a quick-restart entry appears at the bottom of the settings left navigation","activity.agent":"Agent","activity.job":"Background job","activity.terminal":"Terminal","activity.warning":"Detected {count} active items; restart interrupts them.","activity.item":"{type}: {label} ({status})","error.update":"Update check failed","error.activity":"Could not check active work","error.restart":"Restart failed","error.instance":"Restart response is missing the process instance ID","usage.title":"Model usage","usage.tooltip.date":"Date: {date}","usage.tooltip.input":"Input {value} token","usage.tooltip.output":"Output {value} token","usage.tooltip.cache":"Cache hit {value} token","usage.tooltip.total":"Total tokens {value}","usage.tooltip.steps":"Successful model steps {value}","usage.tooltip.hitRate":"Cache hit rate {value}","usage.axis":"token vertical axis","usage.models.more":"Show {count} more models","usage.models.less":"Collapse model list","usage.modelScope.today":"Today","usage.modelScope.week":"Last 7 days","usage.modelScope.all":"All time","usage.modelSortHint.today":"Sorted by tokens used today, largest first","usage.modelSortHint.week":"Sorted by tokens in the last 7 days, largest first","usage.modelSortHint.all":"Sorted by all-time tokens, largest first","usage.modelBar.today":"{model}: {total} tokens today","usage.modelBar.week":"{model}: {total} tokens in the last 7 days","usage.modelBar.all":"{model}: {total} tokens in total","usage.refresh":"Refresh usage","usage.refreshing":"Refreshing…","usage.empty":"No usage index yet. Select Refresh usage to build the read-only index.","usage.error":"Could not read model usage","usage.allProjects":"All projects","usage.chartSummary":"Total usage over seven days: {total} tokens","usage.barDay":"{day} total {total} tokens","usage.total":"Total tokens","usage.steps":"Successful model steps","usage.stepsValue":"{count} times","usage.modelLine":"{steps} times · Cache hit {hitRate} · Input {input} token · Output {output} token","usage.input":"Input token","usage.output":"Output token","usage.cache":"Cache token","usage.hitRate":"Cache hit rate","usage.today":"Today","usage.sevenDays":"Last 7 days","usage.heatmap.title":"Daily usage calendar","usage.heatmap.gridLabel":"Daily token usage heatmap calendar","usage.heatmap.cell":"{date}: {total} tokens · {steps} model steps","usage.heatmap.hourTitle":"Usage punch card (weekday × hour)","usage.heatmap.hourGridLabel":"Token usage punch card by weekday and hour","usage.heatmap.hourCell":"{weekday} {hour}:00: {total} tokens · {steps} model steps","usage.heatmap.scope.day":"Daily","usage.heatmap.scope.hour":"Hourly","usage.heatmap.less":"Less","usage.heatmap.more":"More","usage.errors.title":"Model errors","usage.errors.toggle":"Model errors ({count} types)","usage.errors.recent":"Last 48 hours","usage.errors.empty":"No model errors were recorded in the last 48 hours.","usage.toolErrors.title":"Tool errors","usage.toolErrors.toggle":"Tool errors ({count} types)","usage.toolErrors.empty":"No tool errors were recorded in the last 48 hours.","usage.errors.count":"{count} occurrence(s)","usage.failures.global":"Global session indexing (not affected by project filter): {successful} sessions indexed successfully, {failed} skipped.","usage.failures.staleHint":"Totals may include retained cached data from sessions that could not be read again; it may be stale.","usage.failures.show":"Show skipped session details","usage.failures.hide":"Hide skipped session details","usage.failures.dismiss":"Dismiss (shown again if new sessions are skipped)","usage.failures.id":"Session ID","usage.failures.code":"Error type","usage.failures.message":"Reason","usage.failures.stale":"Retained stale statistics (included in totals)","usage.failures.notStale":"No cached data, excluded from totals","usage.failures.reason.format-migration-failed":"Session format migration was refused.","usage.failures.reason.session-read-failed":"Session could not be opened or read.","usage.failures.reason.session-fold-failed":"Session events could not be indexed.","notification.title":"Notifications","notification.description":"Browser notifications when a root task finishes or approval/choice is needed; subagent completion stays silent.","notification.enable":"Enable notifications","notification.enabled":"Notifications enabled","notification.disable":"Disable notifications","notification.denied":"Notification permission denied","notification.master":"Master switch","notification.done":"Task completion","notification.input":"Approvals & questions","notification.doneTitle":"Task complete","notification.doneBody":"{title} has finished its turn","notification.inputTitle":"Your attention needed","notification.inputBody":"{title} — {kind}","notification.kind.approval":"approval requested","notification.kind.plan-review":"plan review requested","notification.kind.question":"answer requested","notification.bellOn":"Notifications on","notification.bellOff":"Notifications off","notification.bellShow":"Show composer bell icon","quota.cardTitle":"Quota lookup","quota.navToggle":'Show "Quota lookup" entry in settings left nav',"quota.navToggleHint":"When enabled, an entry appears in the settings left navigation","models.navToggle":'Show "Models" entry in settings left nav',"models.navToggleHint":"When enabled, an entry appears in the settings left navigation","quota.window.rolling":"5h rolling","quota.window.tokens-limit-u3-n5":"5-hour tokens","quota.window.tokens-limit-u6-n1":"Weekly tokens","quota.window.tokens-limit":"Token quota","quota.window.time-limit-u5-n1":"MCP quota","quota.window.time-limit":"MCP quota","quota.window.credit-limit":"Credit quota","quota.window.credits":"Credits used","quota.window.balance":"Balance","quota.window.weekly":"This week","quota.window.monthly":"This month","quota.window.codex-5h":"5-hour","quota.window.codex-day":"Daily","quota.window.codex-week":"Weekly","quota.window.codex-month":"Monthly","quota.window.gemini-5h":"5-hour","quota.window.gemini-week":"Weekly","quota.window.claude-5h":"5-hour","quota.window.claude-week":"Weekly","quota.panel.title":"Quota usage","quota.resetCard.more":"{count} more","quota.resetCard.less":"Collapse","quota.panel.used":"Used","quota.panel.remaining":"Remaining","quota.ring.label":"Quota lookup","quota.gauge.baseline":"Baseline full","quota.gauge.calibrate":"Set current as full","quota.gauge.calibrateTip":"Set current balance {amount} as the 100% baseline","quota.gauge.ratio":"{percent}% remaining","quota.filter.showAll":"Show all quotas ({count})","quota.filter.currentOnly":"Current model only","quota.updated":"Updated {time}","quota.refreshing":"Refreshing…","quota.empty":"No data yet","quota.resetIn":"Resets in {time}","quota.window.stale":"cached","quota.window.staleTip":"Live query failed for this account; showing CPA's last cached snapshot (not realtime)","quota.family.gemini":"Gemini","quota.family.claude":"Claude","quota.family.codex":"Codex","quota.family.other":"Other","quota.resetCard.title":"Reset card","quota.resetCard.codexTitle":"Codex reset cards","quota.resetCard.expires":"expires {date}","quota.resetCard.expired":"expired","quota.resetCard.edit":"Add reset card","quota.advanced":"Configuration","quota.resetCard.dateLabel":"Expiry date","quota.resetCard.nameLabel":"Name (optional)","quota.resetCard.add":"Add","quota.resetCard.cancel":"Cancel","quota.resetCard.remove":"Remove","quota.retryAt":"Retry allowed after {time}","quota.manualOnly":"Auto-retry paused — retry manually","quota.refresh":"Refresh","quota.refresh.manual":"Retry connection","quota.refresh.cooldown":"Too many attempts — try again after {time}","quota.reorder":"Reorder & visibility","quota.order.title":"Quota card order & visibility","quota.order.hint":"Drag items or click the arrows to reorder; toggle off to hide cards you rarely need (hiding only affects display, not querying).","quota.order.allHidden":"All adapted cards are hidden; turn a toggle back on under “Reorder & visibility” to show them again.","quota.usageLink":"Open the official usage page","quota.adapt":"Adapt","quota.kind.opencode-go":"OpenCode Go","quota.kind.zai-coding-cn":"Zhipu GLM Coding Plan","quota.kind.openrouter":"OpenRouter","quota.kind.kimi":"Kimi / Moonshot","quota.kind.siliconflow":"SiliconFlow","quota.kind.cliproxy":"CLIProxyAPI accounts","quota.kind.deepseek":"DeepSeek Platform","quota.kind.stepfun":"StepFun Balance","quota.kind.stepfun-step-plan":"StepFun Step Plan","quota.kind.xiaomi-token-plan-cn":"Xiaomi MiMo Token Plan","quota.kind.command-goat":"Command Code account quota","quota.kind.poe":"Poe points","quota.kind.clinepass":"ClinePass plan quota","quota.kind.vercel-ai-gateway":"Vercel AI Gateway balance","quota.window.points":"Remaining points","quota.window.total_token":"Plan total quota","quota.window.compensation_total_token":"Compensation credits","quota.window.plan-name":"Subscription plan","quota.window.credit-pool":"Monthly credit pool","quota.window.topup-credit":"Top-up credit","quota.window.five-hour":"5-hour quota","quota.window.period-spend":"Spent this period","quota.error.no-subscription":"No active quota subscription on this account","quota.error.credential-rejected":"Credential rejected by upstream; enter it again (for console types, copy the browser session again)","quota.credential.editCookie":"Set console cookie (web session)","quota.credential.editToken":"Set console token (Oasis-Token, browser session)","quota.kindAuto":"Auto-detected","quota.noAdapted":"No adapted providers yet — adapt manually below","quota.disable":"Disable","quota.followAuto":"Follow auto-detect","quota.addAdapt":"Manual adapt:","quota.addPickProvider":"Pick provider","quota.addPickKind":"Pick type","quota.saveFailed":"Save failed: {error}","quota.unknownProvider":"Unknown provider","quota.error.credential-missing":"Credential missing (set the API key in DSH credentials)","quota.error.no-base-url":"This provider has no baseURL configured","quota.error.credentials-unavailable":"Credential service unavailable","quota.error.http-status":"Upstream returned an error status","quota.error.network":"Network error","quota.error.network-transient":"Unstable network (auto-retried)","quota.error.timeout":"Request timed out","quota.error.bad-payload":"Unexpected response format","quota.error.mgmt-disabled":"CLIProxyAPI management API disabled (remote-management secret-key is empty or allow-remote-management is off)","quota.error.mgmt-banned":"Temporarily banned by CLIProxyAPI (fail2ban after repeated auth failures; wait or change the egress IP)","quota.error.host-not-pinned":"baseURL differs from the domain recorded when adapting; save the adapter again","quota.error.upstream-status":"Upstream official API returned an error status","quota.error.upstream-error":"Upstream service error (quota API failed; retrying automatically)","quota.credential.edit":"Set API credential","quota.credential.editExisting":"Edit credential (configured)","quota.credential.editManagement":"Set management key (web login key)","quota.credential.nameLabel":"Credential name","quota.credential.valueLabel":"Secret value","quota.credential.save":"Save","quota.credential.primary":"primary (one alias is enough)","quota.credential.clear":"Clear stored","quota.credential.clearConfirm":"Click again to clear","quota.credential.configured":"configured","quota.credential.notConfigured":"not set","quota.credential.saveFailed":"Failed to save credential: {error}","quota.credential.unknown-hint":"Unknown credential name","quota.credential.invalid-value":"Secret value must not be empty","quota.credential.credentials-unavailable":"Credential service unavailable","quota.error.unknown":"Unknown error","quota.unadapted":"Not adapted: pick a provider kind below first","quota.unit.day":"{count} d","quota.unit.hour":"{count} h","quota.unit.minute":"{count} min","quota.window.granted-balance":"Granted balance (unexpired)","quota.peak.nowIdle":"Off-peak now · half price","quota.peak.nowPeak":"Peak now · standard price","quota.peak.untilIdle":"Half price from {time} (in {dur})","quota.peak.untilPeak":"Peak pricing from {time} (in {dur})","quota.peak.tag.peak":"Peak","quota.peak.tag.idle":"Off-peak","quota.peak.caption":"Off-peak price is half the peak price. Peak hours (GMT+8): Mon–Fri 09:00–12:00 and 14:00–18:00, excluding Chinese public holidays. All other times — including all day on weekends and Chinese public holidays — are off-peak.","quota.peak.caption.degraded":'The {year} Chinese public holiday schedule is not yet included; this year is estimated as "Mon–Fri 09:00–12:00 and 14:00–18:00", so holidays may still show as peak. Updating the plugin picks up the current year\'s schedule automatically.',"quota.peak.caption.zai":"Off-peak calls deduct 50% of the base credits. Peak hours: Mon–Fri 14:00–18:00 (UTC+8). All other times are off-peak, including all day Saturday and Sunday.","features.fileEditor":"Right-Sidebar file editing","features.modelProviderIcons":"Model provider icons","editor.viewer":"Edit","editor.loading":"Reading file…","editor.preview":"Preview","editor.save":"Save","editor.saving":"Saving…","editor.saved":"Saved","editor.unsaved":"Unsaved","editor.reload":"Reload","editor.undo":"Undo save","editor.keyHint":"Ctrl/Cmd + S to save","editor.conflict.title":"The file changed on disk; save rejected","editor.conflict.body":"Another change (an Agent or another window) overwrote this file after it was opened. Reload discards your edits; overwrite writes the current editor content to disk.","editor.conflict.reload":"Reload (discard edits)","editor.conflict.overwrite":"Overwrite with mine","editor.confirm.previewTitle":"Back to preview","editor.confirm.previewBody":"You have unsaved changes; going back to the preview discards them.","editor.confirm.saveBack":"Save & back","editor.confirm.discardBack":"Discard & back","editor.confirm.reloadTitle":"Reload","editor.confirm.reloadBody":"You have unsaved changes; reloading discards them and reads the current disk content.","editor.confirm.reloadGo":"Discard & reload","editor.confirm.undoTitle":"Undo save","editor.confirm.undoBody":"This restores the file to its content before the last save; unsaved changes are discarded as well.","editor.confirm.cancel":"Keep editing","editor.undoConflict.title":"Cannot undo automatically","editor.undoConflict.body":"The file changed on disk again after your save, so the previous content cannot be restored automatically; reload to see the current content.","editor.undoConflict.dismiss":"Dismiss","editor.readonlyHint":"Read-only","editor.retry":"Retry","editor.error.file-not-found":"The file does not exist (it may have been moved or deleted).","editor.error.not-regular-file":"This is not a regular file and cannot be edited.","editor.error.too-large":"The file exceeds {limit}; the right-Sidebar editor is read-only. Use another viewer.","editor.error.binary-file":"This is not a UTF-8 text file, so the right-Sidebar editor cannot edit it.","editor.error.session-not-live":"This session is not active right now, so it cannot be edited (switch to another viewer to read it).","editor.error.file-forbidden":"The sandbox policy of this session does not allow writing this file.","editor.error.unavailable":"The host file service is unavailable, so editing is not possible right now.","editor.error.invalid-address":"The file address is not recognized, so it cannot be edited.","editor.error.file-stale":"The file changed on disk; reload before saving again.","editor.error.file-failed":"Read or write failed. Please retry.","editor.error.feature-disabled":"“Right-Sidebar file editing” is turned off in the plugin configuration.","editor.error.internal":"The operation failed. Please retry."},J="%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E",Z="%3C/svg%3E",X=e=>'-webkit-mask:url("data:image/svg+xml,'+J+e+Z+'") center/contain no-repeat;mask:url("data:image/svg+xml,'+J+e+Z+'") center/contain no-repeat',ee={service:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]],overview:[["rect",{x:"3",y:"3",width:"7",height:"9",rx:"1"}],["rect",{x:"14",y:"3",width:"7",height:"5",rx:"1"}],["rect",{x:"14",y:"12",width:"7",height:"9",rx:"1"}],["rect",{x:"3",y:"16",width:"7",height:"5",rx:"1"}]],models:[["path",{d:"m12 2 10 5-10 5-10-5Z"}],["path",{d:"m2 17 10 5 10-5"}],["path",{d:"m2 12 10 5 10-5"}]],notify:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M16.8607 4.4824A6 6 0 0 0 6 8C6 12.499 4.589 13.956 3.262 15.326"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17H20A1 1 0 0 0 20.74 15.327C20.209 14.779 19.665 14.218 19.203 13.454"}]],health:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]],usage:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]],quota:[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]],backup:[["rect",{x:"2",y:"3",width:"20",height:"5",rx:"1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}],["path",{d:"M10 12h4"}]],skills:[["path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}],["path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}]],subagent:[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]],sessions:[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}],["path",{d:"m9 10 2 2 4-4"}]],restart:[["path",{d:"M12 2v10"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04"}]],maintenance:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"}]],configuration:[["path",{d:"M20 7h-9"}],["path",{d:"M14 17H5"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]]},te=e=>e.map(([e,t])=>"%3C"+e+Object.entries(t).map(([e,t])=>` ${e}=%27${t}%27`).join("")+"/%3E").join(""),ae=te(ee.service),re=te(ee.quota),se=te(ee.models),ne=te(ee.restart),oe=te(ee.sessions);function le({name:e}){const t=ee[e];return void 0===t?null:r.createElement("svg",{viewBox:"0 0 24 24",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,display:"block"}},t.map(([e,t],a)=>r.createElement(e,Object.assign({key:a},t))))}let ie=()=>{};function de(e){if(!Array.isArray(e))return[];const t=[],a=new Map;for(const r of e){if(null===r||"object"!=typeof r)continue;const e="string"==typeof r.provider&&""!==r.provider?r.provider:void 0,s="string"==typeof r.model&&""!==r.model?r.model:void 0;if(void 0===e||void 0===s)continue;const n="string"==typeof r.reasoningEffort&&""!==r.reasoningEffort?r.reasoningEffort:void 0,o=e+"\0"+s+"\0"+(n??"");let l=a.get(o);void 0===l&&(l={provider:e,model:s,...void 0!==n?{reasoningEffort:n}:{},count:0},a.set(o,l),t.push(l)),l.count+=1}return t}function ce(e){return(Array.isArray(e)?e:[]).map(e=>{if(null===e||"object"!=typeof e)return"";const t="string"==typeof e.provider?e.provider:"",a="string"==typeof e.model?e.model:"",r="string"==typeof e.reasoningEffort&&""!==e.reasoningEffort?e.reasoningEffort:void 0;return`${t}/${a}${void 0!==r?` (${r})`:""}${Number.isFinite(e.count)&&e.count>1?` ×${e.count}`:""}`}).filter(e=>""!==e).join(" · ")}function ue(e){if(!e||!1!==e.ok||"object"!=typeof e.error||null===e.error)return e;const t="string"==typeof e.error.details?.detail?e.error.details.detail:e.detail,a="string"==typeof e.error.message?e.error.message:e.error.code;return{...e,error:a||"unknown",...void 0!==t?{detail:t}:{}}}Object.assign(Y,{"models.smart.error.disabled-model-rename":"此模型已停用。请先明确启用,再修改模型 ID,避免改名后绕过停用状态。","models.smart.reasoningSupportedNoLevels":"此模型支持开启思考,但未获取到思考等级建议值。是否默认开启思考,需要看该接口的默认行为,当前资料不足以确定。","models.smart.noReasoningSuggestions":"未获取到思考等级建议值,请手动配置。资料中支持思考不代表已声明具体等级。","models.smart.help":"按模型 ID 查询本机 pi-ai 目录、OpenRouter 和 modelparams 固定资料源,提供名称、上下文容量、最大输出、输入模态及思考等级等可用建议,不以当前渠道筛选。资料可能不完整或过时;一键填入经确认后只更新草稿,仍需保存。不会获取当前渠道模型列表,也不会发送推理请求。","models.smart.currentEfforts":"当前等级","models.smart.suggestedEfforts":"建议等级","models.smart.effort.off":"关闭","models.smart.effort.minimal":"最低","models.smart.effort.low":"低","models.smart.effort.medium":"中","models.smart.effort.high":"高","models.smart.effort.xhigh":"极高","models.smart.effort.max":"最高","models.smart.deleteRoutePrompt":"确定删除以下渠道及其模型配置吗?API 密钥保留。","models.smart.removalConflicts":"无法删除:以下设置仍在引用","models.smart.resolveRemovalConflicts":"请先在子代理设置或默认模型设置中更换这些引用,再重新删除。","models.smart.referenceKind.subagent-route":"子代理主模型","models.smart.referenceKind.subagent-fallback":"子代理回退模型","models.smart.referenceKind.agent-default-model":"主对话默认模型","models.smart.noSuggestions":"此模型未获取到建议值,请手动配置模型参数","models.smart.suggestedValues":"建议值","models.smart.fillAll":"一键填入","models.smart.confirmFill":"确认填入","models.smart.fillConfirmPrompt":"将以下建议值填入对应输入框,覆盖这些字段的当前草稿值。其他字段保持不变,填入后仍需点击保存。","models.smart.keyConfiguredPlaceholder":"已配置,留空保持不变","models.smart.capacityHint":"支持 K/M,不区分大小写(如 200K、1M;K=1,000,M=1,000,000)。","models.smart.parametersJson":"查看参数 JSON(草稿)","models.smart.deleteModelTitle":"删除模型","models.smart.deleteModelPrompt":"确定删除以下模型吗?删除后将从该渠道的模型列表移除。","models.smart.error.credential-missing":"未配置可用的 API Key,无法获取模型列表。请填写并保存密钥后重试;草稿仍保留。","models.smart.error.discovery-auth-failed":"渠道拒绝认证(HTTP 401)。请检查 API Key 是否正确或已过期;草稿仍保留。","models.smart.error.discovery-forbidden":"渠道拒绝访问模型列表(HTTP 403)。请检查 API Key 的权限、账户状态或渠道访问限制;草稿仍保留。","models.smart.error.discovery-rate-limited":"渠道请求限流(HTTP 429)。请稍后重试或检查账户额度;草稿仍保留。","models.smart.testing":"测试中 · 已用 {seconds} 秒","models.smart.editTitle":"编辑模型配置","models.smart.modelEnabled":"启用模型","models.smart.rename":"重命名","models.smart.renameApply":"应用到草稿","models.smart.providerActions":"供应商操作","models.smart.enableBoundary":"关闭后该渠道不再可选,主对话和子代理均不能发起新调用;配置和密钥保留。","models.smart.providerEnabled":"启用供应商","models.smart.enableUnavailable":"当前宿主没有渠道启停配置接口;此处仅显示运行时加载状态,暂不可切换。","models.smart.imageBadge":"视觉","models.smart.reasoningBadge":"思考","models.smart.homeTitle":"模型设置","models.smart.homeDescription":"管理模型供应商,配置后可在聊天时选择使用。","models.smart.providers":"供应商","models.smart.customProviders":"自定义供应商","models.smart.refreshProviders":"刷新供应商列表","models.smart.modelList":"模型列表","models.smart.noModels":"暂无已配置模型","models.smart.protocolUnknown":"内置协议(暂未读取)","models.smart.keyState.configured":"已配置","models.smart.keyState.missing":"当前密钥引用未配置","models.smart.keyState.authorized":"已授权","models.smart.keyState.unknown":"当前密钥状态暂无法确认","models.smart.keyReplacePlaceholder":"留空保持不变,输入新密钥以更换","models.smart.updateKey":"更新密钥","models.navToggle":"设置页左列显示「模型配置」入口","models.navToggleHint":"开启后在设置页左侧标签显示入口","models.smart.template":"渠道模板","models.smart.templateCustom":"自定义渠道","models.smart.templatePlaceholder":"选择内置渠道模板或自定义","models.smart.mixedApiHint":"该渠道目录包含多种协议({apis})。路由级协议会覆盖该路由全部模型——仅在确认所有模型使用同一协议时再设置协议;不设置则各模型走目录自带的协议。","models.smart.selectModelsHint":"选择模型","models.smart.noModelsSelected":"请至少勾选或输入一个模型","models.smart.noProviders":"暂无已配置渠道","models.smart.apiKey":"API Key","models.smart.apiKeyPlaceholder":"输入 API Key","models.smart.layers":"显式 / 继承与恢复","models.smart.explicitValue":"当前 Profile 显式值","models.smart.inheritedValue":"继承层","models.smart.restoreInherited":"恢复继承 / 未声明","models.smart.referenceId":"参考模型 ID / 别名(可选)","models.smart.queryReference":"按参考 ID 查询","models.smart.compareLatest":"读取最新值并对照(保留草稿)","models.smart.latest":"最新配置","models.smart.draft":"我的草稿","models.smart.useLatest":"此字段使用最新值","models.smart.rebaseDraft":"确认对照,以最新基线继续编辑","models.smart.bindSource":"记住参考关联","models.smart.unbindSource":"解除参考关联","models.smart.bindingReview":"地址或身份已变化:原参考关联需要重新核对,不会自动沿用。","models.smart.bindingSaved":"参考关联已保存;关联不代表渠道能力实测,也不会自动采纳参数。","models.smart.title":"智能填充","models.smart.back":"返回","models.smart.newModel":"添加模型","models.smart.refresh":"重新查询","models.smart.save":"保存","models.smart.saveRoute":"保存渠道参数","models.smart.cancel":"取消","models.smart.confirm":"确认执行","models.smart.preview":"预览后果","models.smart.edit":"编辑","models.smart.add":"添加","models.smart.remove":"删除","models.smart.inherit":"未声明 / 继承","models.smart.loading":"正在读取…","models.smart.search":"搜索模型 ID 或名称","models.smart.advanced":"高级模型参数","models.smart.routeAdvanced":"高级渠道参数","models.smart.routeScope":"这些参数影响整个渠道。空白恢复继承;未知高级键保留,不把生效默认值写死。","models.smart.queryBoundary":"默认关闭。开启会查询固定资料源,不会获取渠道模型列表或发送推理请求;一键填入并确认后才进入草稿。","models.smart.pendingNotSaved":"保存只包含手动修改和已采纳项;尚未确认的建议不会写入。","models.smart.reference":"跨渠道参考:采纳前请核对当前渠道;不代表中转透传或实测能力。","models.smart.source":"参考来源","models.smart.candidate":"建议候选","models.smart.choose":"请选择候选 / 来源","models.smart.accept":"采纳建议","models.smart.reject":"本轮拒绝建议","models.smart.readonly":"只读来源依据与参数范围","models.smart.effective":"当前生效值","models.smart.unsaved":"尚未保存","models.smart.leave":"有未保存的修改(包括无效输入)。离开将丢弃草稿,确定离开吗?","models.smart.builtinReadonly":"内置渠道只读:目录随宿主更新。现有覆盖会保留;修改请使用 DSH 原生模型设置,本页不会复制或冻结动态目录。","models.smart.compatHint":"只显示当前协议可写的兼容键;空值继承,true / false 是显式覆盖。未展示键仍保留。","models.smart.reasoning.inherit":"继承 / 未声明","models.smart.reasoning.false":"明确不支持思考","models.smart.reasoning.map":"自定义 wire 映射","models.smart.noWire":"关闭不发参数","models.smart.wireRequired":"必须填写具体 wire 值","models.smart.wireHint":"档位 ID 不等于协议值。思考映射整组编辑;至少声明一个非 off 档位。","models.smart.input.image-only":"仅图片(明确声明)","models.smart.input.inherit":"继承 / 未声明","models.smart.input.text":"文本","models.smart.input.image":"文本 + 图片","models.smart.type":"值类型","models.smart.type.string":"文本","models.smart.type.number":"数值","models.smart.type.boolean":"布尔","models.smart.type.null":"null","models.smart.type.variable":"请求状态变量","models.smart.newKey":"新键名","models.smart.field.name":"模型显示名称","models.smart.field.contextWindow":"上下文容量","models.smart.field.maxTokens":"模型最大输出","models.smart.field.input":"输入模态","models.smart.field.reasoningEfforts":"思考等级与协议值","models.smart.field.compat":"协议兼容参数","models.smart.field.displayName":"渠道显示名称","models.smart.field.api":"协议","models.smart.field.baseURL":"API地址","models.smart.field.defaultContextWindow":"渠道默认上下文(token)","models.smart.field.defaultMaxTokens":"渠道默认输出预算(token)","models.smart.field.defaultInput":"渠道默认输入模态","models.smart.field.headers":"普通请求头","models.smart.field.reasoning":"渠道默认思考档位","models.smart.field.thinkingBudgets":"思考预算(token)","models.smart.field.cacheRetention":"缓存保留策略","models.smart.field.transport":"传输方式","models.smart.field.timeoutMs":"请求超时(ms;0 为禁用)","models.smart.field.websocketConnectTimeoutMs":"WebSocket 连接超时(ms;0 为禁用)","models.smart.field.streamIdleTimeoutMs":"流式空闲超时(ms)","models.smart.field.maxRequestImageBytes":"请求图片总大小上限(byte)","models.smart.field.requestImagePixelBudget":"请求图片像素预算(pixel)","models.smart.field.requestImageMaxBytes":"单图大小上限(byte)","models.smart.field.retryPolicy":"请求重试策略","models.smart.models":"模型","models.smart.key":"API密钥","models.smart.shared":"明确替换共享引用(影响已识别使用者)","models.smart.keyBoundary":"默认分配当前渠道独立凭据引用;不回显、不保存旧密钥。共享替换会列出宿主识别的使用者,不能穷尽外部消费者。","models.smart.keyPartial":"密钥已写入,但配置更新失败。凭据未删除;请检查引用并重试,旧密钥不会自动恢复。","models.smart.discover":"获取模型列表","models.smart.discoverBoundary":"只有点击才使用当前渠道凭据在线发现。支持 OpenAI 与 Anthropic 协议。HTTP / 私网可保存,但本插件禁止在线发现;发现失败仍可手填。","models.smart.manualIds":"手动模型 ID(空白或逗号分隔)","models.smart.added":"已添加","models.smart.selectAll":"选择所有未添加项","models.smart.clear":"清空选择","models.smart.createRoute":"添加供应商","models.smart.routeId":"渠道标识(小写字母、数字、连字符)","models.smart.createBoundary":"创建不会探测渠道或写入密钥;至少填写一个模型 ID。创建后可独立编辑参数和设置凭据。","models.smart.deleteRoute":"删除渠道","models.smart.restore":"预览最近恢复","models.smart.deleted":"最近删除的渠道","models.smart.consequences":"后果与可回滚状态","models.smart.credentialRetained":"仅恢复配置与凭据引用;删除保留凭据,恢复不会写回旧密钥。外部后续修改会阻止恢复。","models.smart.builtin":"内置目录","models.smart.custom":"自定义","models.smart.configSaved":"配置已保存","models.smart.configInherited":"配置继承目录","models.smart.runtimeLoaded":"运行时已加载","models.smart.runtimeMissing":"运行时未加载","models.smart.testNotRun":"尚未做真实调用测试","models.smart.test":"主动测试保存状态","models.smart.testBoundary":"将对已保存模型发送固定短文本,最多 30,000 token / 120 秒,可能计费。只验证基础文本调用,不验证图片、容量或全部思考档位。","models.smart.testPassed":"基础文本调用成功","models.smart.testFailed":"基础文本调用失败或未完成","models.smart.error.generic":"操作未完成:{code}。草稿仍保留。","models.smart.error.conflict":"配置或版本在编辑后发生变化。草稿仍保留,请对照最新配置后重试,不能强制覆盖。","models.smart.error.schema-invalid":"参数组合或输入无效。请检查数值、类型及完整思考映射;草稿仍保留。","models.smart.error.restore-conflict":"该变更之后配置又被修改,拒绝恢复以免覆盖后续修改。","models.smart.error.sensitive-snapshot":"现有配置含敏感值,无法安全保存完整恢复快照。此操作已拒绝;请在原生配置页处理敏感字段。","models.smart.error.snapshot-unavailable":"无法保存安全恢复快照,配置未修改。","models.smart.error.sensitive-header":"普通请求头编辑不允许认证 / Cookie / 密钥字段,现有敏感值保持不变。","models.smart.error.removal-blocked":"模型或渠道仍被主模型 / 子代理引用。请先解除引用,本页不自动迁移。","models.smart.error.last-model-undeletable":"不能删除自定义渠道的最后一个模型。空清单不等于禁用;请删除渠道或保留一个模型。","models.smart.error.compat-not-offered":"该兼容参数不属于当前协议的可写键;请核对协议,未知值不会自动丢弃。","models.smart.error.configuration-rejected":"宿主完整配置校验拒绝写入,配置未保存;草稿仍保留。","models.smart.error.probe-protocol-unsupported":"本插件尚未实现该协议的安全发现,请手填模型 ID。","models.smart.error.builtin-readonly":"内置渠道本轮只查看,不接管动态目录。"}),Object.assign(Q,{"models.smart.error.disabled-model-rename":"This model is disabled. Explicitly enable it before changing its ID so a rename cannot bypass its disabled state.","models.smart.reasoningSupportedNoLevels":"This model supports reasoning, but no reasoning level suggestions were found. Whether reasoning is enabled by default depends on the API’s default behavior; the available metadata is insufficient to determine this.","models.smart.noReasoningSuggestions":"No reasoning level suggestions were found. Please configure them manually. Reasoning support does not imply that specific levels are declared.","models.smart.help":"Looks up the model ID in the local pi-ai catalog and fixed OpenRouter and modelparams sources for available suggestions such as name, context capacity, maximum output, input modalities and reasoning levels, without filtering by your provider. Metadata may be incomplete or outdated. Confirming Fill all only updates the draft; saving is still required. It does not discover models from your provider or send inference requests.","models.smart.currentEfforts":"Current levels","models.smart.suggestedEfforts":"Suggested levels","models.smart.effort.off":"Off","models.smart.effort.minimal":"Minimal","models.smart.effort.low":"Low","models.smart.effort.medium":"Medium","models.smart.effort.high":"High","models.smart.effort.xhigh":"Extra high","models.smart.effort.max":"Maximum","models.smart.deleteRoutePrompt":"Delete this provider and its model configuration? API credentials will be retained.","models.smart.removalConflicts":"Cannot delete: still referenced by these settings","models.smart.resolveRemovalConflicts":"Change these references in Subagent settings or default model settings, then retry deletion.","models.smart.referenceKind.subagent-route":"Subagent primary model","models.smart.referenceKind.subagent-fallback":"Subagent fallback model","models.smart.referenceKind.agent-default-model":"Main chat default model","models.smart.noSuggestions":"No suggested values were found for this model. Please configure its parameters manually.","models.smart.suggestedValues":"Suggested values","models.smart.fillAll":"Fill all","models.smart.confirmFill":"Confirm fill","models.smart.fillConfirmPrompt":"Fill the corresponding inputs with these suggestions, replacing their current draft values. Other fields stay unchanged. You still need to save afterwards.","models.smart.keyConfiguredPlaceholder":"Configured; leave blank to keep unchanged","models.smart.capacityHint":"Supports K/M, case-insensitive (e.g. 200K, 1M; K=1,000, M=1,000,000).","models.smart.parametersJson":"View draft parameters (JSON)","models.smart.deleteModelTitle":"Delete model","models.smart.deleteModelPrompt":"Delete the following model? It will be removed from this provider’s model list.","models.smart.error.credential-missing":"No usable API key is configured. Enter and save the key before fetching models again. Your draft remains.","models.smart.error.discovery-auth-failed":"The provider rejected authentication (HTTP 401). Check whether the API key is valid or expired. Your draft remains.","models.smart.error.discovery-forbidden":"The provider denied model-list access (HTTP 403). Check key permissions, account status or access restrictions. Your draft remains.","models.smart.error.discovery-rate-limited":"The provider rate-limited the request (HTTP 429). Try later or check account quota. Your draft remains.","models.smart.testing":"Testing · {seconds}s elapsed","models.smart.editTitle":"Edit model configuration","models.smart.modelEnabled":"Enable model","models.smart.rename":"Rename","models.smart.renameApply":"Apply to draft","models.smart.providerActions":"Provider actions","models.smart.enableBoundary":"Disabling removes this provider from selection and blocks new chat and subagent calls. Configuration and credentials remain intact.","models.smart.providerEnabled":"Enable provider","models.smart.enableUnavailable":"The current host has no provider enable/disable configuration API. This indicates runtime loading only and cannot be toggled yet.","models.smart.imageBadge":"Vision","models.smart.reasoningBadge":"Reasoning","models.smart.homeTitle":"Model settings","models.smart.homeDescription":"Manage model providers and configure them for use in chat.","models.smart.providers":"Providers","models.smart.customProviders":"Custom providers","models.smart.refreshProviders":"Refresh providers","models.smart.modelList":"Model list","models.smart.noModels":"No configured models","models.smart.protocolUnknown":"Built-in protocol (not available yet)","models.smart.keyState.configured":"Configured","models.smart.keyState.missing":"Current key reference is not configured","models.smart.keyState.authorized":"Authorized","models.smart.keyState.unknown":"Current key status could not be confirmed","models.smart.keyReplacePlaceholder":"Leave blank to keep; enter a new key to replace","models.smart.updateKey":"Update key","models.navToggle":'Show "Models" in settings left nav',"models.navToggleHint":"When enabled, an entry appears in settings left navigation","models.smart.template":"Provider template","models.smart.templateCustom":"Custom provider","models.smart.templatePlaceholder":"Select a built-in template or custom","models.smart.mixedApiHint":"This catalog mixes multiple protocols ({apis}). A route-level protocol overrides every model on the route — only set it when all models share one protocol; leaving it unset lets each model use its catalog protocol.","models.smart.selectModelsHint":"Select models","models.smart.noModelsSelected":"Please select or enter at least one model","models.smart.noProviders":"No configured providers","models.smart.apiKey":"API Key","models.smart.apiKeyPlaceholder":"Enter API key","models.smart.layers":"Explicit / inherited values and reset","models.smart.explicitValue":"Explicit in current Profile","models.smart.inheritedValue":"Inherited layer","models.smart.restoreInherited":"Reset to inherited / undeclared","models.smart.referenceId":"Reference model ID / alias (optional)","models.smart.queryReference":"Query reference ID","models.smart.compareLatest":"Compare latest values (keep draft)","models.smart.latest":"Latest configuration","models.smart.draft":"My draft","models.smart.useLatest":"Use latest for this field","models.smart.rebaseDraft":"Confirm comparison and continue on latest baseline","models.smart.bindSource":"Remember reference association","models.smart.unbindSource":"Remove reference association","models.smart.bindingReview":"Address or identity changed: review the previous reference association; it is not applied automatically.","models.smart.bindingSaved":"Reference association saved. This is not a capability test and never automatically accepts parameters.","models.smart.title":"Smart fill","models.smart.back":"Back","models.smart.newModel":"Add model","models.smart.refresh":"Query again","models.smart.save":"Save","models.smart.saveRoute":"Save provider parameters","models.smart.cancel":"Cancel","models.smart.confirm":"Confirm","models.smart.preview":"Preview consequences","models.smart.edit":"Edit","models.smart.add":"Add","models.smart.remove":"Delete","models.smart.inherit":"Undeclared / inherited","models.smart.loading":"Loading…","models.smart.search":"Search model ID or name","models.smart.advanced":"Advanced model parameters","models.smart.routeAdvanced":"Advanced provider parameters","models.smart.routeScope":"These parameters affect the entire provider. Blank restores inheritance; unknown advanced keys survive and effective defaults are not materialized.","models.smart.queryBoundary":"Off by default. Turning on queries fixed metadata sources, not provider discovery or inference. Suggestions enter the draft only after confirming Fill all.","models.smart.pendingNotSaved":"Save submits manual changes and accepted suggestions only; unresolved suggestions are not written.","models.smart.reference":"Cross-provider reference: verify applicability before accepting. Not evidence of proxy pass-through or tested capability.","models.smart.source":"Reference source","models.smart.candidate":"Suggestion candidate","models.smart.choose":"Choose a candidate / source","models.smart.accept":"Accept suggestion","models.smart.reject":"Reject suggestion for this query","models.smart.readonly":"Read-only source evidence and parameter ranges","models.smart.effective":"Current effective value","models.smart.unsaved":"Unsaved changes","models.smart.leave":"You have unsaved changes, including invalid input. Leaving discards the draft. Leave anyway?","models.smart.builtinReadonly":"Built-in providers are read-only. The catalog follows host updates and existing overrides survive. Use native DSH model settings to edit; this page never copies or freezes the dynamic catalog.","models.smart.compatHint":"Only writable keys for this protocol are shown. Blank inherits; true / false are explicit overrides. Unshown keys survive.","models.smart.reasoning.inherit":"Inherited / undeclared","models.smart.reasoning.false":"Explicitly no reasoning","models.smart.reasoning.map":"Custom wire mapping","models.smart.noWire":"Off sends no parameter","models.smart.wireRequired":"Enter the actual wire value","models.smart.wireHint":"Effort IDs are not wire values. Edit reasoning mappings as a group; at least one non-off effort is required.","models.smart.input.image-only":"Image only (explicit)","models.smart.input.inherit":"Inherited / undeclared","models.smart.input.text":"Text","models.smart.input.image":"Text + image","models.smart.type":"Value type","models.smart.type.string":"Text","models.smart.type.number":"Number","models.smart.type.boolean":"Boolean","models.smart.type.null":"null","models.smart.type.variable":"Request-state variable","models.smart.newKey":"New key","models.smart.field.name":"Model display name","models.smart.field.contextWindow":"Context capacity","models.smart.field.maxTokens":"Model maximum output","models.smart.field.input":"Input modalities","models.smart.field.reasoningEfforts":"Reasoning efforts and wire values","models.smart.field.compat":"Protocol compatibility","models.smart.field.displayName":"Provider display name","models.smart.field.api":"Protocol","models.smart.field.baseURL":"API URL","models.smart.field.defaultContextWindow":"Provider default context (tokens)","models.smart.field.defaultMaxTokens":"Provider default output budget (tokens)","models.smart.field.defaultInput":"Provider default input modalities","models.smart.field.headers":"Ordinary request headers","models.smart.field.reasoning":"Provider default reasoning effort","models.smart.field.thinkingBudgets":"Thinking budgets (tokens)","models.smart.field.cacheRetention":"Cache retention","models.smart.field.transport":"Transport","models.smart.field.timeoutMs":"Request timeout (ms; 0 disables)","models.smart.field.websocketConnectTimeoutMs":"WebSocket connection timeout (ms; 0 disables)","models.smart.field.streamIdleTimeoutMs":"Stream idle timeout (ms)","models.smart.field.maxRequestImageBytes":"Maximum request image bytes","models.smart.field.requestImagePixelBudget":"Request image pixel budget","models.smart.field.requestImageMaxBytes":"Maximum bytes per image","models.smart.field.retryPolicy":"Request retry policy","models.smart.models":"Models","models.smart.key":"API key","models.smart.shared":"Explicitly replace shared reference (affects identified users)","models.smart.keyBoundary":"Defaults to an independent credential reference for this provider. Old keys are neither returned nor snapshotted. Shared replacement lists host-known users, not all external consumers.","models.smart.keyPartial":"The credential was stored, but configuration update failed. It was not deleted; check the reference and retry. The old key is not automatically restored.","models.smart.discover":"Fetch model list","models.smart.discoverBoundary":"Only this button uses the current provider credential for discovery. HTTP / private addresses may be saved, but online discovery is blocked. OpenAI and Anthropic discovery are supported; manual IDs remain available on failure.","models.smart.manualIds":"Manual model IDs (whitespace or comma separated)","models.smart.added":"Already added","models.smart.selectAll":"Select all unadded models","models.smart.clear":"Clear selection","models.smart.createRoute":"Add provider","models.smart.routeId":"Provider ID (lowercase letters, digits and hyphens)","models.smart.createBoundary":"Creating a provider does not discover models or write credentials. Enter at least one model ID. Edit models and set credentials after creation.","models.smart.deleteRoute":"Delete provider","models.smart.restore":"Preview latest restore","models.smart.deleted":"Recently deleted providers","models.smart.consequences":"Consequences and rollback state","models.smart.credentialRetained":"Only configuration and credential references are restored. Deletion retains credentials; restore never reinstates an old secret. Later external edits block restore.","models.smart.builtin":"Built-in catalog","models.smart.custom":"Custom","models.smart.configSaved":"Configuration saved","models.smart.configInherited":"Inherited catalog configuration","models.smart.runtimeLoaded":"Runtime loaded","models.smart.runtimeMissing":"Runtime not loaded","models.smart.testNotRun":"No live call test yet","models.smart.test":"Test saved model","models.smart.testBoundary":"Sends fixed short text using the saved model, at most 30,000 tokens / 120 seconds. Charges may apply. Tests basic text calls only, not images, capacity or every reasoning effort.","models.smart.testPassed":"Basic text call succeeded","models.smart.testFailed":"Basic text call failed or incomplete","models.smart.error.generic":"Operation did not complete: {code}. Your draft is retained.","models.smart.error.conflict":"Configuration or revision changed since editing. The draft is retained. Compare the latest configuration before retrying; no forced overwrite.","models.smart.error.schema-invalid":"Invalid parameters or input. Check numbers, types and complete reasoning mappings. The draft is retained.","models.smart.error.restore-conflict":"Configuration changed after this operation. Restore is refused to protect subsequent edits.","models.smart.error.sensitive-snapshot":"Existing configuration contains sensitive values and cannot be safely snapshotted in full. Operation refused; handle sensitive fields in native settings.","models.smart.error.snapshot-unavailable":"A safe restore snapshot could not be saved. Configuration was not modified.","models.smart.error.sensitive-header":"Ordinary header editing cannot change authentication / cookies / API keys. Existing sensitive values stay intact.","models.smart.error.removal-blocked":"This model or provider is still referenced by the default model or subagents. Remove references first; no automatic migration.","models.smart.error.last-model-undeletable":"A custom provider cannot lose its final model. An empty list is not a disabled provider; delete the provider or keep one model.","models.smart.error.compat-not-offered":"This compatibility key is not writable for the selected protocol. Verify the protocol; unknown values are not silently dropped.","models.smart.error.configuration-rejected":"The host rejected the complete configuration. Nothing was saved; your draft remains.","models.smart.error.probe-protocol-unsupported":"Safe discovery for this protocol is not implemented here. Enter model IDs manually.","models.smart.error.builtin-readonly":"Built-in providers are view-only in this iteration; their dynamic catalog is not taken over."});const pe={minHeight:"var(--dsh-svc-control-h, 36px)",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",cursor:"pointer",fontSize:"13px",fontWeight:550,transition:"border-color 120ms ease, color 120ms ease, background 120ms ease",lineHeight:"20px"},me=e=>"primary"===e?{...pe,background:"var(--dsh-svc-brand)",borderColor:"var(--dsh-svc-brand)",color:"var(--dsh-svc-brand-text)"}:"danger"===e?{...pe,background:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)",color:"var(--dsh-svc-brand-text)"}:"dangerGhost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)"}:"brandGhost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-brand)",borderColor:"var(--dsh-svc-brand)"}:"ghost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"}:"neutral"===e?{...pe,background:"var(--dsh-svc-page-bg)",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"}:{...pe,background:"var(--dsh-svc-content-bg)",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"},ge=e=>Object.assign({},pe,{background:"transparent",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)",minHeight:"28px",padding:"4px 10px",fontSize:"12px",borderRadius:"var(--dsh-svc-radius-control)"},e),he=(e,t)=>Object.assign({display:"inline-flex",alignItems:"center",flex:"none",fontSize:"10px",lineHeight:"16px",padding:"1px 6px",..._(999),whiteSpace:"nowrap",...{success:{background:"rgba(16,185,129,0.16)",color:"var(--dsh-svc-success)"},warning:{background:"rgba(198,128,0,0.14)",color:"var(--dsh-svc-warning)"},danger:{background:"rgba(220,38,38,0.12)",color:"var(--dsh-svc-danger)"},info:{background:"rgba(37,99,235,0.10)",color:"var(--dsh-svc-info)"},neutral:{background:"var(--dsh-svc-page-bg)",color:"var(--dsh-svc-text-muted)"}}[e]||{}},t),fe=e=>Object.assign({background:"var(--dsh-svc-surface-bg)",color:"var(--dsh-svc-text)",border:"1px solid var(--dsh-svc-border)",borderRadius:"var(--dsh-svc-radius-control)",padding:"10px"},e),be=e=>Object.assign({padding:"4px 0 14px",marginBottom:"12px",color:"var(--dsw-alias-label-primary)"},e);function ve({ctx:e,rpcCall:t,t:a,useTranslation:s,restartNavToggle:n}){const{useState:o,useEffect:l}=r,i=new Set;let d={status:"idle",elapsedMs:0},c=0;const u=e=>{d=e;for(const t of i)t(e)},p=new Set;let m={stage:0,activity:null,busy:!1,error:null};const g=e=>{m=e;for(const t of p)t(e)},h=()=>{const[e,t]=o(m);return l(()=>(p.add(t),t(m),()=>p.delete(t)),[]),e},f=new Set;let b=null;const v=()=>{const[e,t]=o(b);return l(()=>(f.add(t),t(b),()=>f.delete(t)),[]),e},y=new Set;let w=null;let x=null;const k=()=>(null===x&&(x=t("version",{}).then(e=>(e&&e.ok&&((e=>{const t=e?e.runtimeEnv:void 0;null!==t&&"object"==typeof t&&"boolean"==typeof t.manualStartLikely&&(void 0!==t.supervisorKind&&null!==t.supervisorKind&&"string"!=typeof t.supervisorKind||(e=>{b=e;for(const t of f)t(e)})({platform:"string"==typeof t.platform?t.platform:"",supervisorKind:void 0===t.supervisorKind||null===t.supervisorKind?null:t.supervisorKind,manualStartLikely:t.manualStartLikely,electronShell:!0===t.electronShell}))})(e.value),(e=>{const t=e?e.installedVersion:void 0,a="string"==typeof t&&t.length>0&&t.length<=64&&!/\s/.test(t)?t:null;a!==w&&(e=>{w=e;for(const t of y)t(e)})(a)})(e.value)),e)).catch(()=>(x=null,null))),x),S=()=>(x=null,k());let E=null;const C=async e=>{const t=await(!0===e?S():k()),a=t&&t.ok?t.value&&t.value.instanceId:void 0;"string"==typeof a&&0!==a.length&&(null!==E?a!==E&&window.location.reload():E=a)};let T=!1;const q=async()=>{g({...m,busy:!0,error:null});try{const e=await t("activity",{});if(e&&!1===e.ok)throw console.error("dsh-service: activity check failed",e.error),new Error(a("error.activity"));const r=e&&e.value?e.value:{hasActive:!1,items:[]};g({...m,activity:r,stage:r.hasActive?3:1,busy:!1,error:null})}catch(e){g({...m,error:e&&e.message?String(e.message):String(e),stage:0,busy:!1})}},A=async e=>{g({...m,busy:!0,error:null});try{const r=await t("web",{force:!0===e});if(r&&!1===r.ok){if("active-work"===r.error&&r.value)return void g({...m,activity:r.value,stage:3,busy:!1,error:null});throw console.error("dsh-service: restart failed",r.error),new Error(a("error.restart"))}const s=r&&r.value?r.value.instanceId:void 0;if(r&&r.value&&!0===r.value.requiresManualRestart)return void g({...m,stage:2,busy:!1,error:null});if("string"!=typeof s||0===s.length)throw new Error(a("error.instance"));g({...m,stage:2,busy:!1,error:null}),z(s).catch(e=>console.error("dsh-service: recovery failed",e))}catch(e){g({...m,error:e&&e.message?String(e.message):String(e),stage:0,busy:!1})}},z=async a=>{const r=++c;let s=0,n=1e3;for(u({status:"waiting",elapsedMs:s});s<6e4&&r===c;){const o=Math.min(n,6e4-s);try{await e.timer.timeout(o)}catch(e){return}if(r!==c)return;s+=o,u({status:"waiting",elapsedMs:s});try{const e=await t("version",{}),r=e&&e.ok?e.value&&e.value.instanceId:void 0;if("string"==typeof r&&r.length>0&&r!==a)return void window.location.reload()}catch(e){}if(s>=6e4)return void u({status:"timeout",elapsedMs:s});n=Math.min(2*n,1e4)}};e.effect(()=>()=>{c+=1,i.clear(),p.clear(),f.clear()},"dsh-service recovery"),e.effect(()=>{const t=e.on("connection/reset",()=>{C(!0).catch(()=>{})});return C(!1).catch(()=>{}),t},"dsh-service process identity");const M=e=>{if("string"!=typeof e)return null;const t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),pre:t[4]?t[4].split("."):null}:null},I=e=>/^\d+$/.test(e)?Number(e):e;function R(){const e=(()=>{const[e,t]=o(d);return l(()=>(i.add(t),t(d),()=>i.delete(t)),[]),e})(),t=s();if("idle"===e.status)return null;const a="timeout"===e.status;return r.createElement("div",{style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:"rgba(12, 14, 20, 0.72)",backdropFilter:"blur(4px)",pointerEvents:"auto"}},r.createElement("div",{style:{width:"min(420px, 100%)",padding:"24px",borderRadius:"12px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 18px 60px rgba(0,0,0,0.35)",textAlign:"center"}},r.createElement("div",{style:{fontSize:"18px",fontWeight:700,marginBottom:"10px"}},t(a?"recovery.timeout.title":"recovery.waiting.title")),r.createElement("p",{style:{margin:0,fontSize:"13px",lineHeight:1.7,color:"var(--dsw-alias-label-secondary)"}},a?t("recovery.timeout.body"):t("recovery.waiting.body",{seconds:Math.floor(e.elapsedMs/1e3)})),a?r.createElement("button",{style:Object.assign({},ge(),{marginTop:"16px",padding:"7px 16px"}),onClick:()=>window.location.reload()},t("recovery.manual")):null))}return{RestartOverlay:function(){return r.createElement(R,null)},RestartSection:function({showNavToggle:e}){const t=s(),a=h(),o=v();l(()=>{k()},[]);const[i,d]=n.useEnabled(),c=me("danger"),u=me("dangerGhost"),p=me("ghost"),f={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},b=be(),y=fe(),w={fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},x=null!==o&&!0===o.electronShell;if(2===a.stage)return r.createElement("div",{"data-testid":"restart-card",style:b},r.createElement("div",{style:w},t("restart.title")),r.createElement("p",{style:{margin:0,fontSize:"13px"}},t("restart.sent")),r.createElement("p",{style:f},t(x?"restart.sentDesktopHint":null!==o&&!0===o.manualStartLikely?"restart.sentManualHint":"restart.sentHint")));const S={agent:t("activity.agent"),job:t("activity.job"),terminal:t("activity.terminal")},E=a.activity&&Array.isArray(a.activity.items)?a.activity.items:[],C=x?r.createElement("p",{"data-testid":"restart-desktop-warn",style:Object.assign({},f,{color:"var(--dsw-alias-state-warn-primary)",margin:"6px 0 0"})},t("restart.desktopWarn")):null!==o&&!0===o.manualStartLikely?r.createElement("p",{"data-testid":"restart-manual-warn",style:Object.assign({},f,{color:"var(--dsw-alias-state-warn-primary)",margin:"6px 0 0"})},t("restart.manualWarn")):null,T=3===a.stage?r.createElement("div",{style:{marginTop:"12px",padding:"10px 12px",borderRadius:"6px",background:"rgba(211,51,51,0.1)",border:"1px solid rgba(211,51,51,0.35)"}},r.createElement("p",{style:{margin:"0 0 8px",color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",fontWeight:600}},t("activity.warning",{count:E.length})),r.createElement("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"12px",lineHeight:1.7}},E.map(e=>r.createElement("li",{key:e.type+":"+e.id},t("activity.item",{type:S[e.type]||e.type,label:e.label,status:e.status}))))):null;return r.createElement("div",{"data-testid":"restart-card",style:b},r.createElement("div",{style:w},t("restart.title")),r.createElement("div",{"data-testid":"restart-region",style:y},r.createElement("p",{style:{margin:0,fontSize:"13px"}},t("restart.description")),C,T,r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},0===a.stage?r.createElement("button",{style:u,"data-variant":"dangerGhost",onClick:q,disabled:a.busy},t(a.busy?"update.checking":"restart.button")):1===a.stage?[r.createElement("button",{key:"confirm",style:c,"data-variant":"danger",onClick:()=>A(!1),disabled:a.busy},t(a.busy?"restart.sending":"restart.confirm")),r.createElement("button",{key:"cancel",style:p,onClick:()=>g({...m,activity:null,stage:0,busy:!1,error:null}),disabled:a.busy},t("restart.cancel"))]:3===a.stage?[r.createElement("button",{key:"force",style:c,"data-variant":"danger",onClick:()=>A(!0),disabled:a.busy},t(a.busy?"restart.sending":"restart.force")),r.createElement("button",{key:"cancel",style:p,onClick:()=>g({...m,activity:null,stage:0,busy:!1,error:null}),disabled:a.busy},t("restart.cancel"))]:null),1===a.stage?r.createElement("p",{style:f},t("restart.idleHint")):null,a.error?r.createElement("p",{style:Object.assign({},f,{color:"var(--dsw-alias-state-error-primary)"})},String(a.error)):null,e?r.createElement("div",{style:{marginTop:"12px",paddingTop:"10px",borderTop:"1px solid var(--dsw-alias-border-l1)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},t("restart.navToggle")),r.createElement("span",{style:f},t("restart.navToggleHint"))),r.createElement("button",{type:"button",role:"switch","data-testid":"restart-nav-switch","aria-checked":String(i),onClick:()=>d(!i),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(i?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:i?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:i?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:i?"#fff":"var(--dsw-alias-label-tertiary)"}}))):null))},compareSemver:(e,t)=>{const a=M(e),r=M(t);if(!a||!r)return null;for(const e of["major","minor","patch"])if(a[e]!==r[e])return a[e]<r[e]?-1:1;if(null===a.pre&&null===r.pre)return 0;if(null===a.pre)return 1;if(null===r.pre)return-1;const s=Math.min(a.pre.length,r.pre.length);for(let e=0;e<s;e+=1){const t=I(a.pre[e]),s=I(r.pre[e]);if(t!==s)return"number"==typeof t&&"number"==typeof s||"string"==typeof t&&"string"==typeof s?t<s?-1:1:"number"==typeof t?-1:1}return a.pre.length<r.pre.length?-1:a.pre.length===r.pre.length?0:1},fetchVersionSnapshot:k,refreshVersionSnapshot:S,startRecovery:z,useInstalledVersion:()=>{const[e,t]=o(w);return l(()=>(y.add(t),t(w),()=>y.delete(t)),[]),e},useRestartFlow:h,useRuntimeEnv:v,isUpgradeInFlight:()=>T,setUpgradeInFlight:e=>{T=e},getRuntimeEnvState:()=>b}}function ye({ctx:e,t,featureEnabled:a,createConversationNav:r}){const s={active:!1,mq:null,mqHandler:null,frameObserver:null,mountObserver:null,workspaceObserver:null,errorHandler:null,resizeHandler:null,styleTag:null,backdrop:null,fab:null,debugChip:null,debugEnabled:!1,errorCount:0,drawerOpen:!1,detailsOpen:!1,rightbarOpen:!1,workspaceOpen:!1,edgeGesture:null,edgeTelemetry:null,lastFabDisplay:null,lastBackdropDisplay:null,immersive:!1,repinTimer:null,repinAnchor:null,repinToBottom:!1,chatAvailable:!1,chatScrollLastY:null,gestureAt:0,immersiveAcc:0,immersiveLockDir:null,zoneArmed:null,arrivalDone:!1,lastRevealReason:null,headerEl:null,headerRO:null},n=r(),o=()=>{try{return"function"==typeof e.get?e.get("layout"):void 0}catch(e){return}},l=()=>{if(s.detailsOpen){const e=o();if(void 0!==e)try{e.closeDetails()}catch(e){}s.detailsOpen=!1}const e=s.drawerOpen||s.workspaceOpen||s.rightbarOpen?"none":"flex";null!==s.fab&&s.lastFabDisplay!==e&&(s.lastFabDisplay=e,s.fab.style.display=e);const t=s.drawerOpen?"block":"none";null!==s.backdrop&&s.lastBackdropDisplay!==t&&(s.lastBackdropDisplay=t,s.backdrop.style.display=t),s.debugEnabled&&null!==s.debugChip&&V()};let i=!1;const d=()=>{const e=document.querySelector("[data-dshsvc-frame]");s.drawerOpen=null!==e&&!e.hasAttribute("data-sidebar-collapsed"),s.rightbarOpen=T();const t=o(),a=void 0!==t&&"function"==typeof t.openRightbar||s.rightbarOpen;s.detailsOpen=!a&&null!==e&&!e.hasAttribute("data-details-collapsed"),s.workspaceOpen=!1;try{for(const e of document.querySelectorAll('[class*="nArs4W_panel"]')){const t="string"==typeof e.className?e.className:"";if(/nArs4W_panelHidden/.test(t))continue;const a=e.getBoundingClientRect();if(a.width>0&&a.left<window.innerWidth-2&&"hidden"!==getComputedStyle(e).visibility){s.workspaceOpen=!0;break}}}catch(e){s.workspaceOpen=!1}y()},c=e=>{const t=document.documentElement.style;(e=>"function"==typeof e.setProperty)(t)&&t.setProperty("--dshsvc-header-h",`${Math.max(0,Math.round(e))}px`)},u=()=>{let e=null;try{e=document.querySelector("[data-conversation-scroll]")}catch(e){return null}if(null===e||!1===e.isConnected)return null;let t=e.parentNode;if(null===t||t===document.documentElement)return null;let a=null;try{a=t.getAttribute("data-phase")}catch(e){}let r=t;for(let e=0;null===a&&e<2&&(r=null==r?null:r.parentNode,null!==r&&r!==document.documentElement);e+=1){try{a=r.getAttribute("data-phase")}catch(e){break}null!==a&&(t=r)}return{scroller:e,rootEl:t,phase:a}},p=(e,t)=>{if(t<=0||null===e||void 0===e.children||null===e.children)return null;for(const a of e.children||[]){if("HEADER"===("string"==typeof a.tagName?a.tagName.toUpperCase():""))return a;const e=p(a,t-1);if(null!==e)return e}return null},m=(e,t)=>{let a=t;for(;null!=a;){if(a===e)return!0;a=a.parentNode}return!1},g=()=>{s.repinTimer=null;const e=s.repinAnchor,t=s.repinToBottom;s.repinAnchor=null,s.repinToBottom=!1;const a=u();if(null!==a&&null!==a.scroller)try{const r=Number(a.scroller.scrollTop),s=Number(a.scroller.scrollHeight),n=Number(a.scroller.clientHeight);if(!Number.isFinite(r)||!Number.isFinite(s)||!Number.isFinite(n))return;const o=Math.max(0,s-n);if(t){if(o-r>80)return;return void(a.scroller.scrollTop=o)}if(null===e)return;if(r<e-4)return;a.scroller.scrollTop=o}catch(e){}},h=(e,t=!1)=>{f(),s.repinAnchor=e,s.repinToBottom=t;try{s.repinTimer=setTimeout(g,260)}catch(e){g()}},f=()=>{if(s.repinAnchor=null,s.repinToBottom=!1,null!==s.repinTimer){try{clearTimeout(s.repinTimer)}catch(e){}s.repinTimer=null}},b=(e,t=null)=>{if(s.active&&s.chatAvailable||(e=!1),s.immersive===e)return;const a=!e&&(()=>{const e=u();if(null===e||null===e.scroller)return!1;try{const t=Number(e.scroller.scrollTop),a=Number(e.scroller.scrollHeight),r=Number(e.scroller.clientHeight);return!!(Number.isFinite(t)&&Number.isFinite(a)&&Number.isFinite(r))&&a-r-t<=80}catch(e){return!1}})()?Number((u()||{}).scroller?.scrollTop):null,r=null!==a&&Number.isFinite(a);s.immersive=e,e||null===t||(s.lastRevealReason=t);const n=document.documentElement;try{e?n.setAttribute("data-dshsvc-immersive",""):n.removeAttribute("data-dshsvc-immersive")}catch(e){}e?f():r&&h(a),s.debugEnabled&&V()},v=()=>{s.chatScrollLastY=null,s.immersiveAcc=0,s.immersiveLockDir=null,s.zoneArmed=null,s.arrivalDone=!1,b(!1)},y=()=>{const e=u();let t=!1;if(null!==e&&"active"===e.phase){(e=>{const t=null!==e?e.rootEl:null;if(null===t||void 0===t.children)return s.headerEl;if(null!==s.headerEl&&s.headerEl.isConnected){try{s.headerEl.setAttribute("data-dshsvc-chat-header","")}catch(e){}return s.headerEl}let a=null;for(const e of t.children||[])if("HEADER"===("string"==typeof e.tagName?e.tagName.toUpperCase():"")){a=e;break}if(null===a)for(const e of t.children||[]){const t=p(e,3);if(null!==t){a=t;break}}null!==a&&(a.setAttribute("data-dshsvc-chat-header",""),s.headerEl=a,(e=>{if("function"==typeof ResizeObserver&&(null===s.headerRO||s.headerRO.__el!==e)){if(null!==s.headerRO)try{s.headerRO.disconnect()}catch(e){}try{const t=new ResizeObserver(()=>{try{const t=e.offsetHeight;"number"==typeof t&&t>0&&c(t)}catch(e){}});t.__el=e,t.observe(e),s.headerRO=t;const a=e.offsetHeight;"number"==typeof a&&a>0&&c(a)}catch(e){s.headerRO=null}}})(a))})(e);const a=(()=>{try{return document.querySelector("[data-composer-seat]")}catch(e){return null}})();if(null!==a&&m(e.scroller,a)){let a=NaN,r=NaN,s=NaN;try{a=Number(e.scroller.scrollTop),r=Number(e.scroller.scrollHeight),s=Number(e.scroller.clientHeight)}catch(e){}t=Number.isFinite(a)&&Number.isFinite(r)&&Number.isFinite(s)&&r-s>24}}s.chatAvailable=t,t||v()},w=e=>{if(!s.active||!s.chatAvailable)return;let t=NaN,a=NaN,r=NaN;try{t=Number(e.scrollTop),a=Number(e.scrollHeight),r=Number(e.clientHeight)}catch(e){return}if(!Number.isFinite(t)||!Number.isFinite(a)||!Number.isFinite(r))return;const n=null===s.chatScrollLastY?t:s.chatScrollLastY,o=t-n;if(s.chatScrollLastY=t,!(()=>{const e=Date.now();return s.gestureAt>0&&e-s.gestureAt<=800})()||Math.abs(o)>200)return void(s.immersiveAcc=0);if(s.immersive&&o<0&&n+r>=a-1)return s.immersiveAcc=0,s.immersiveLockDir=-1,void b(!1,"gesture");const l=t+r>=a-80;if(null===s.zoneArmed&&(s.zoneArmed=l),!1===s.zoneArmed&&l&&!s.arrivalDone&&s.immersive&&o>0)return s.arrivalDone=!0,s.immersiveAcc=0,s.immersiveLockDir=1,void b(!1,"arrival");const i=Math.sign(o);if(0!==i&&null!==s.immersiveLockDir){if(i!==-s.immersiveLockDir)return void(s.immersiveAcc=0);s.immersiveLockDir=null}(s.immersiveAcc>0&&o<0||s.immersiveAcc<0&&o>0)&&(s.immersiveAcc=0),s.immersiveAcc+=o,s.immersiveAcc>240?s.immersiveAcc=240:s.immersiveAcc<-240&&(s.immersiveAcc=-240),s.immersiveAcc>=64?(s.immersiveAcc=0,s.immersiveLockDir=1,b(!0)):s.immersiveAcc<=-24&&(s.immersiveAcc=0,s.immersiveLockDir=-1,b(!1,"gesture"))},x=()=>{s.gestureAt=Date.now(),s.immersiveLockDir=null,s.zoneArmed=null,s.arrivalDone=!1},k=e=>{try{const t=null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>0?e.touches:null!=e?e.changedTouches:null;if(null==t||0===t.length)return null;const a=Number(t[0].clientX),r=Number(t[0].clientY);return Number.isFinite(a)&&Number.isFinite(r)?{x:a,y:r}:null}catch(e){return null}},S=()=>{try{const e=document.querySelector("[data-dshsvc-frame]");return null===e||e.hasAttribute("data-sidebar-collapsed")}catch(e){return!0}},E=()=>{try{return"function"==typeof e.get?e.get("sidebarRight"):void 0}catch(e){return}},C=()=>{try{if(null!==document.querySelector("[data-sidebar-right-expand], [data-sidebar-right-toggle], [data-sidebar-right-panel]"))return!0}catch(e){}const e=E();return void 0!==e&&"function"==typeof e.toggleExpanded&&void 0!==e.active()},T=()=>{if(!C())return!1;const e=E();if(void 0!==e&&"function"==typeof e.isExpanded)try{const t=e.isExpanded();if("boolean"==typeof t)return t}catch(e){}try{if(null!==document.querySelector("[data-sidebar-right-open]"))return!0}catch(e){}try{if(null!==document.querySelector("[data-sidebar-right-expand]"))return!1}catch(e){}try{const e=document.querySelector("[data-dshsvc-frame]");if(null!==e&&!e.hasAttribute("data-rightbar-collapsed"))return!0}catch(e){}return!1},q=e=>{try{let t=e;for(let e=0;null!=t&&e<8;e+=1){if(t===document.body||t===document.documentElement)return!1;if("number"==typeof t.scrollWidth&&"number"==typeof t.clientWidth&&t.scrollWidth>t.clientWidth+1){if("function"!=typeof getComputedStyle)return!0;const e=getComputedStyle(t),a=null!=e?String(e.overflowX||""):"";if("auto"===a||"scroll"===a||"overlay"===a)return!0}t=t.parentNode}}catch(e){}return!1},A="open",z="left-close",M="right-close",I="left-open",R="right-open",O="multi-touch",H="modal",D="h-scroll",L="no-point",N="right-absent",W="toggle-unavailable",B="no-tracker",P={left:{opened:()=>!S(),toggle:()=>{const e=o();if(void 0===e)return!1;try{return e.toggleSidebar(),!0}catch(e){return!1}}},right:{opened:()=>T(),toggle:e=>(e=>{try{const t=e?document.querySelector("[data-sidebar-right-expand]"):document.querySelector("[data-sidebar-right-open] [data-sidebar-right-toggle]")||(T()?document.querySelector("[data-sidebar-right-toggle]"):null);if(null!==t&&"function"==typeof t.click)return t.click(),!0}catch(e){}const t=E();if(void 0!==t&&"function"==typeof t.toggleExpanded)try{if("function"!=typeof t.isExpanded||t.isExpanded()!==e)return t.toggleExpanded(),!0}catch(e){}const a=o();if(void 0!==a)try{if(e&&"function"==typeof a.openRightbar)return a.openRightbar(!1,!0),!0;if(!e&&"function"==typeof a.closeRightbar)return a.closeRightbar(),!0}catch(e){}return!1})(e)}},j=(e,t,a)=>{if(null===e||e.fired||null===t)return!1;const r=t.x-e.startX,n=t.y-e.startY;if(Math.abs(n)>Math.abs(r)&&Math.abs(n)>12)return s.edgeGesture=null,!1;let o=null,l=!1,i=null;if(e.kind===A){if(r>=a)o="left",l=!0,i=I;else if(r<=-a&&(o="right",l=!0,i=R,!C()))return null!==s.edgeTelemetry&&(s.edgeTelemetry.reason=N),!0}else e.kind===z?r<=-a&&(o="left",i=z):e.kind===M&&r>=a&&(o="right",i=M);if(null===o)return!1;const d=((e,t)=>{const a=P[e];return void 0!==a&&a.opened()!==t&&!0===a.toggle(t)})(o,l);return e.fired=!0,null!==s.edgeTelemetry&&(s.edgeTelemetry.fired=d,s.edgeTelemetry.kind=i,d||i!==R||(s.edgeTelemetry.reason=W)),!0},$=[["scroll",e=>{if(!s.active)return;let t=e&&e.target;for(let e=0;null!=t&&e<6;e+=1){if("function"==typeof t.hasAttribute)try{if(t.hasAttribute("data-conversation-scroll"))return void w(t)}catch(e){}t=t.parentNode}},{capture:!0,passive:!0}],["touchstart",x,{capture:!0,passive:!0}],["touchmove",x,{capture:!0,passive:!0}],["touchstart",e=>{if(!s.active)return;s.edgeGesture=null;const t=s.debugEnabled?{start:"—",kind:"—",moves:0,last:"—",cancel:"—",fired:!1}:null;s.edgeTelemetry=t;try{if(null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>1)return void(null!==t&&(t.kind=O))}catch(e){}if((()=>{try{return null!==document.querySelector('[role="dialog"][aria-modal="true"]')}catch(e){return!1}})())return void(null!==t&&(t.kind=H));const a=k(e);if(null===a)return void(null!==t&&(t.kind=L));null!==t&&(t.start=`${Math.round(a.x)},${Math.round(a.y)}`);const r=!S(),n=C()&&T();if(r||n)return q(e?.target)?void(null!==t&&(t.kind=D)):(s.edgeGesture={kind:r?z:M,edge:null,startX:a.x,startY:a.y,at:Date.now(),fired:!1},void(null!==t&&(t.kind=r?z:M)));if(q(e?.target))return void(null!==t&&(t.kind=D));const o=Number(window.innerWidth);let l=null;a.x<=32?l="left":Number.isFinite(o)&&a.x>=o-32&&(l="right"),s.edgeGesture={kind:A,edge:l,startX:a.x,startY:a.y,at:Date.now(),fired:!1},null!==t&&(t.kind="left"===l?I:"right"===l?R:A),s.debugEnabled&&V()},{capture:!0,passive:!0}],["touchmove",e=>{const t=s.edgeGesture;if(null===t||t.fired)return;try{if(null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>1)return s.edgeGesture=null,null!==s.edgeTelemetry&&(s.edgeTelemetry.reason=O),void(s.debugEnabled&&V())}catch(e){}const a=k(e),r=s.edgeTelemetry;null!==r&&null!==a&&(r.moves+=1,r.last=`${Math.round(a.x-t.startX)},${Math.round(a.y-t.startY)}`);const n=j(t,a,56);s.debugEnabled&&n&&V()},{capture:!0,passive:!0}],["touchend",e=>{const t=s.edgeGesture;if(null===t||t.fired)return void(s.edgeGesture=null);const a="open"===t.kind&&null!==t.edge,r=a?k(e):null;a&&null!==r&&Date.now()-t.at<=260&&j(t,r,32),s.edgeGesture=null,s.debugEnabled&&t.fired&&V()},{capture:!0,passive:!0}],["touchcancel",e=>{const t=s.edgeGesture,a=s.edgeTelemetry;if(null===t)return null!==a&&(a.cancel=B),void(s.debugEnabled&&V());const r="open"===t.kind&&null!==t.edge,n=k(e);null!==a&&null!==n&&(a.cancel=`${Math.round(n.x-t.startX)},${Math.round(n.y-t.startY)}`),r&&j(t,n,6),s.edgeGesture=null,s.debugEnabled&&V()},{capture:!0,passive:!0}],["wheel",x,{capture:!0,passive:!0}],["focusin",e=>{if(!s.active)return;let t=null;try{t=document.querySelector("[data-composer-seat]")}catch(e){return}null!==t&&m(t,e?.target)&&(s.immersiveAcc=0,s.immersive&&b(!1,"focus"))},{capture:!0}],["click",e=>{s.active&&s.chatAvailable&&s.immersive&&n.isToBottomButton(e&&e.target)&&(s.immersiveAcc=0,s.immersiveLockDir=1,b(!1,"button"),h(null,!0))},{capture:!0}]];let _=!1;const V=()=>{const e=s.debugChip;if(null===e)return;const a=e=>t(e?"mobile.debug.stateOn":"mobile.debug.stateOff"),r=[[`${t("mobile.debug.viewport")} ${window.innerWidth}×${window.innerHeight}`,`≤1023 ${a(s.active)}`,`${t("mobile.debug.drawer")} ${a(s.drawerOpen)}`,`${t("mobile.debug.details")} ${a(s.detailsOpen)}`,`${t("mobile.debug.rightbar")} ${a(s.rightbarOpen)}`,`${t("mobile.debug.immersive")} ${a(s.immersive)}`+(null===s.lastRevealReason?"":`(${n=s.lastRevealReason,"gesture"===n?t("mobile.debug.immersive.reason.gesture"):"arrival"===n?t("mobile.debug.immersive.reason.arrival"):"focus"===n?t("mobile.debug.immersive.reason.focus"):"button"===n?t("mobile.debug.immersive.reason.button"):n})`),`${t("mobile.debug.errors")} ${s.errorCount}`].join(" · ")];var n;const o=e=>e===I?t("mobile.debug.edge.leftOpen"):e===R?t("mobile.debug.edge.rightOpen"):e===z?t("mobile.debug.edge.leftClose"):e===M?t("mobile.debug.edge.rightClose"):e===A?t("mobile.debug.edge.open"):e===O?t("mobile.debug.edge.reason.multiTouch"):e===H?t("mobile.debug.edge.reason.modal"):e===D?t("mobile.debug.edge.reason.hScroll"):e===L?t("mobile.debug.edge.reason.noPoint"):e===N?t("mobile.debug.edge.reason.absentRight"):e===W?t("mobile.debug.edge.reason.badButton"):e===B?t("mobile.debug.edge.reason.noTracker"):e,l=s.edgeTelemetry;if(null!==l&&void 0!==l.start){let e=`${t("mobile.debug.edge")} ${t("mobile.debug.edge.fieldStart")}(${l.start}) ${o(l.kind)} ${t("mobile.debug.edge.fieldMoves")}${l.moves} ${t("mobile.debug.edge.fieldLast")}(${l.last}) ${t("mobile.debug.edge.fieldCancel")}(${o(l.cancel)})`;void 0!==l.reason&&(e+=` ${t("mobile.debug.edge.fieldReason")}(${o(l.reason)})`),l.fired&&(e+=" ✓"),r.push(e)}e.textContent=r.join("\n")},F=()=>{if(null!==s.fab)return!0;if(!(()=>{const e=document.querySelector("[data-shell-overlay]"),t=null!==e?e.parentNode:null;if(null===t||t===document.documentElement)return!1;t.setAttribute("data-dshsvc-frame","");let a=!1,r=!1,s=!1,n=!1;for(const e of t.children){const t="string"==typeof e.className?e.className:"";!a&&/sidebarCol/.test(t)?(e.setAttribute("data-dshsvc-sidebar",""),a=!0):!r&&/centerCol/.test(t)?(e.setAttribute("data-dshsvc-center",""),r=!0):!s&&/detailsCol/.test(t)?(e.setAttribute("data-dshsvc-details",""),s=!0):!n&&/rightbarCol/.test(t)&&(e.setAttribute("data-dshsvc-rightbar",""),n=!0)}return!0})())return!1;s.backdrop=document.createElement("div"),s.backdrop.setAttribute("data-dshsvc-backdrop",""),s.backdrop.setAttribute("aria-hidden","true"),Object.assign(s.backdrop.style,{position:"fixed",inset:"0",zIndex:"31",display:"none",background:"rgba(0,0,0,.42)",backdropFilter:"blur(1px)"}),s.backdrop.addEventListener("click",()=>{const e=o();void 0!==e&&s.drawerOpen&&e.toggleSidebar()}),document.body.appendChild(s.backdrop),s.fab=document.createElement("button"),s.fab.type="button",s.fab.setAttribute("data-dshsvc-fab",""),s.fab.setAttribute("aria-label",t("mobile.fab.label")),Object.assign(s.fab.style,{position:"fixed",left:"calc(env(safe-area-inset-left, 0px) + 10px)",top:"calc(env(safe-area-inset-top, 0px) + 12px)",width:"32px",height:"32px",borderRadius:"16px",zIndex:"33",display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",color:"var(--dsw-alias-label-primary)",padding:"0",cursor:"pointer",touchAction:"manipulation"}),s.fab.innerHTML='<svg width="18" height="18" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="1.75" y="2.75" width="12.5" height="10.5" rx="2" stroke="currentColor" stroke-width="1.5"/><line x1="6.25" y1="3.5" x2="6.25" y2="12.5" stroke="currentColor" stroke-width="1.5"/></svg>',s.fab.addEventListener("click",()=>{const e=o();void 0!==e&&e.toggleSidebar()}),document.body.appendChild(s.fab),d();try{s.workspaceObserver=new MutationObserver(()=>{(()=>{if(!i&&s.active){i=!0,setTimeout(()=>{if(i=!1,s.active)try{d(),l()}catch(e){}},50);for(const e of[400,900])setTimeout(()=>{if(s.active)try{d(),l()}catch(e){}},e)}})()}),s.workspaceObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0})}catch(e){s.workspaceObserver=null}s.frameObserver=new MutationObserver(()=>{d(),l()});const e=document.querySelector("[data-dshsvc-frame]");return null!==e&&s.frameObserver.observe(e,{attributes:!0,attributeFilter:["data-sidebar-collapsed","data-details-collapsed","data-rightbar-collapsed"]}),null!==s.mountObserver&&(s.mountObserver.disconnect(),s.mountObserver=null),l(),!0},U=()=>{if(!s.active)return;if(s.active=!1,s.drawerOpen=!1,s.detailsOpen=!1,s.rightbarOpen=!1,s.edgeGesture=null,s.edgeTelemetry=null,(()=>{if(_){_=!1;for(const[e,t,a]of $)try{document.documentElement.removeEventListener(e,t,a)}catch(e){}}})(),document.documentElement.removeAttribute("data-dshsvc-mobile"),document.documentElement.removeAttribute("data-dshsvc-immersive"),null!==s.headerRO){try{s.headerRO.disconnect()}catch(e){}s.headerRO=null}s.headerEl=null,null!==s.frameObserver&&(s.frameObserver.disconnect(),s.frameObserver=null),null!==s.workspaceObserver&&(s.workspaceObserver.disconnect(),s.workspaceObserver=null),null!==s.mountObserver&&(s.mountObserver.disconnect(),s.mountObserver=null),null!==s.errorHandler&&window.removeEventListener("error",s.errorHandler),null!==s.resizeHandler&&window.removeEventListener("resize",s.resizeHandler),s.errorHandler=null,s.resizeHandler=null;for(const e of[s.styleTag,s.backdrop,s.fab,s.debugChip])null!==e&&e.isConnected&&e.remove();for(const e of document.querySelectorAll("[data-dshsvc-frame],[data-dshsvc-sidebar],[data-dshsvc-center],[data-dshsvc-details],[data-dshsvc-rightbar],[data-dshsvc-chat-header]"))e.removeAttribute("data-dshsvc-frame"),e.removeAttribute("data-dshsvc-sidebar"),e.removeAttribute("data-dshsvc-center"),e.removeAttribute("data-dshsvc-details"),e.removeAttribute("data-dshsvc-rightbar"),e.removeAttribute("data-dshsvc-chat-header");const e=(()=>{try{return document.documentElement.style}catch(e){return null}})();if(null!==e)try{e.removeProperty("--dshsvc-header-h")}catch(t){e["--dshsvc-header-h"]=""}s.styleTag=null,s.backdrop=null,s.fab=null,f(),s.debugChip=null,s.debugEnabled=!1,v()},K=()=>{a("mobileAdaptation")&&s.mmqMatches()?(()=>{if(s.active)return;if(void 0===o())return;s.active=!0,document.documentElement.setAttribute("data-dshsvc-mobile",""),(()=>{for(const e of document.querySelectorAll('meta[name="viewport"]')){const t=e.getAttribute("content")||"";/(^|,)\s*viewport-fit\s*=/.test(t)||e.setAttribute("content",""===t.trim()?"viewport-fit=cover":t.trim()+", viewport-fit=cover")}})(),s.styleTag=document.createElement("style"),s.styleTag.dataset.plugin="@gehennawu/dsh-service",s.styleTag.dataset.pluginCss="@gehennawu/dsh-service/mobile.css",s.styleTag.textContent='\n/* 侧栏/详情列改 absolute 后会退出 grid 排版流,中列会被自动放置进第 1 轨\n (0px)而整屏变黑 —— 三列必须用 grid-column 显式钉位,绝不依赖子元素顺序。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] { grid-template-columns: 0px minmax(0, 1fr) 0px !important; }\n/* 0.1.5+ 右栏列(rightbarCol):官方右栏自有窄屏语义(<768 开=浮层全屏 portal 到\n body,闭=0 轨),第三轨改 auto 让官方宽度生效——钉 0px 会把 push 态面板挤没。\n :has 特异性高于上一条,天然覆盖;旧宿主无 rightbar 标记时仍走 0px 模板。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame]:has([data-dshsvc-rightbar]) { grid-template-columns: 0px minmax(0, 1fr) auto !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-sidebar] { grid-column: 1 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-center] { grid-column: 2 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-details] { grid-column: 3 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-rightbar] { grid-column: 3 !important; grid-row: 1 !important; }\n/* 侧栏/详情列 → overlay 抽屉。两条铁律:\n ① 隐藏禁用 transform —— 设置模态(未 portal)长在本列子树里,\n transform 会成为其 fixed 定位的包含块;\n ② 离屏偏移必须用 vw 长度而非百分比 —— 这些列带显式 grid-column 钉位\n (修中列黑屏所需),绝对定位子项的包含块会变成那格 grid area(0px 宽),\n 百分比对 0 取值全变 0,元素被超约束解算推回屏内盖住会话。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-sidebar] {\n position: absolute !important;\n top: 0 !important;\n bottom: 0 !important;\n left: calc(-100vw - 24px) !important;\n /* 外壳 sidebar slot 的原生展开内容固定 280px;外层也必须同宽,否则右侧\n 会露出一条只有 sidebarCol 背景、没有内容的空带。窄于 280px 时按视口裁切。 */\n width: min(100vw, 280px) !important;\n border-right: none !important;\n z-index: 32;\n transition: left var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile] [data-dshsvc-frame]:not([data-sidebar-collapsed]) [data-dshsvc-sidebar] {\n left: 0 !important;\n box-shadow: 8px 0 32px rgba(0, 0, 0, .22);\n}\n/* 详情列(预览/文件树)→ 移动端永久离屏。官方 computeColumns 在窄视口恒为\n 0 宽(原生手机本就不显示该列),抽屉化只会用空态盖住会话且关闭路径\n 与 backdrop/抽屉状态纠缠(真机反馈)。引擎在激活与属性观察时会自愈式\n closeDetails(),保证 store 也是干净的关闭态。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-details] {\n position: absolute !important;\n top: 0 !important;\n bottom: 0 !important;\n right: calc(-100vw - 24px) !important;\n width: min(92vw, 420px) !important;\n z-index: 30;\n}\n/* 模态 → 全屏面板:外壳 portal 根是 fixed inset:0 flex 容器(无 transform,\n 无 containing-block 陷阱),dialog 改 absolute 四边拉满即可。\n 真机反馈:底部 sheet 顶部留空难看 → 顶部贴顶、圆角归零;\n 刘海/home 条遮挡由 dialog 自身 env() padding 补回。 */\nhtml[data-dshsvc-mobile] div[role="presentation"]:has(> [role="dialog"][aria-modal="true"]) {\n padding: 0 !important;\n}\nhtml[data-dshsvc-mobile] [role="dialog"][aria-modal="true"] {\n position: absolute !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n width: 100% !important;\n max-width: none !important;\n max-height: none !important;\n height: 100% !important;\n border-radius: 0 !important;\n overflow: hidden auto !important;\n flex-direction: column !important;\n padding-top: env(safe-area-inset-top, 0px) !important;\n padding-bottom: env(safe-area-inset-bottom, 0px) !important;\n}\n/* 插件市场(dshmarket)在 ≤560px 媒体查询里把设置导航 display:none 藏掉\n 独占面板(其自有 CSS:[role=dialog]:has([data-dsh-market-root])>nav),\n 手机上会把用户困在市场分区 —— 用更高优先级把横滑标签条顶回来。 */\nhtml[data-dshsvc-mobile] [role="dialog"]:has([data-dsh-market-root]) > nav { display: flex !important; }\n/* 设置页标签条:nav 从 188px 竖列变顶部横滑条(宽度与列向必须显式推翻)。\n 右侧留 52px 给钉到角落的关闭钮。 */\nhtml[data-dshsvc-mobile] [role="dialog"] nav {\n flex-direction: row !important;\n align-items: center !important;\n gap: 6px !important;\n width: auto !important;\n flex: none !important;\n padding: 8px 52px 0 12px !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n border-right: none !important;\n border-bottom: 1px solid var(--dsw-alias-border-l2);\n}\nhtml[data-dshsvc-mobile] [role="dialog"] nav > div { flex: none !important; }\nhtml[data-dshsvc-mobile] [role="dialog"] [class*="navList"] { flex-direction: row !important; }\nhtml[data-dshsvc-mobile] [role="dialog"] [class*="navCell"] { white-space: nowrap !important; flex: none !important; }\n/* 关闭钮钉到设置页右上角并压到面板顶层(原生在内容区头行、导航条下方,\n 会被横滑条/内容重叠遮挡——用户点名要顶层);加不透明圆形底衬保证任何\n 内容上都可辨识,底衬与钮同节点、随之置顶。类哈希 VOzbGW_ 取自\n dsh-client-ui-settings-general SettingsRoot.module.css(rc.2),升级需复核 */\nhtml[data-dshsvc-mobile] [role="dialog"][aria-modal="true"] [class*="VOzbGW_close"] {\n position: absolute !important;\n top: calc(env(safe-area-inset-top, 0px) + 9px) !important;\n right: 10px !important;\n z-index: 60;\n background-color: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-1)) !important;\n border: 1px solid var(--dsw-alias-border-l2) !important;\n border-radius: 999px !important;\n corner-shape: round !important;\n box-shadow: var(--dsw-shadow-lv2, 0 4px 12px rgba(0, 0, 0, .12)) !important;\n}\n/* 设置内容列利用率:手机全屏后内容仍被\n 宿主 options 24px → 插件看板卡 12px → 汇总小卡 10px 的多层内边距套娃收窄\n (单侧 ~46px、约一成屏宽)。只收紧间距不动物料:options 是宿主滚动容器、\n 全分区生效(24→14);看板/图表卡按 testid 收紧;汇总行禁折行——label/value\n 两个 span 在窄卡会被 flex 按比例收缩成 40~70px 盒子导致短标签折行\n (2026-09-18 真机 360/390px 实测),nowrap 后装不下时值列省略兜底。 */\nhtml[data-dshsvc-mobile] [class*="VOzbGW_options"] { padding: 0 14px 18px !important; }\nhtml[data-dshsvc-mobile] [data-testid="usage-statistics-region"] { padding: 8px !important; }\nhtml[data-dshsvc-mobile] [data-testid="usage-chart"] { padding: 8px 8px 2px !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] { column-gap: 8px !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] > span { white-space: nowrap !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] > span:last-child {\n min-width: 0 !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n}\n/* 设置/任意模态打开时藏抽屉钮:抽屉列自带 z-index:32 层叠上下文会把模态的\n z1000 封顶在 32,body 级 z33 的钮反而浮在设置页上(真机实测)。:has 不支持时\n 退化为旧行为(钮仍显示),无副作用。 */\nhtml[data-dshsvc-mobile] body:has([role="dialog"][aria-modal="true"]) [data-dshsvc-fab] {\n display: none !important;\n}\n/* composer 底行单行紧凑:收紧间距与左右内边距,换出可用宽度。\n 类哈希 uV2eYG_/Sh0Q9G_/pXSMma_ 取自 dsh-client-ui-conversation composer\n (rc.2,0.1.6-alpha.1 漂移至 JObwrW_ 并存),升级需复核。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_row"] {\n column-gap: 4px !important;\n padding-left: 10px !important;\n padding-right: 10px !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_tools"],\nhtml[data-dshsvc-mobile] [class*="uV2eYG_modes"],\nhtml[data-dshsvc-mobile] [class*="uV2eYG_trailing"] { gap: 6px !important; min-width: 0 !important; }\nhtml[data-dshsvc-mobile] [class*="uV2eYG_trailing"] { margin-left: auto !important; }\n/* 0.1.7-alpha.1 在 trailing 内新包了一层 standardControls(会话右槽 + 模型触发钮同组,\n 官方 gap:12px)。外层 trailing 的 gap 收紧管不到它,≤480px 时这 12px 会把整组顶出\n 容器、触发换行错位。老宿主没有这个类,规则不命中,纯增量。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_standardControls"] { gap: 6px !important; min-width: 0 !important; flex: 0 1 auto !important; }\nhtml[data-dshsvc-mobile] [class*="Sh0Q9G_trigger"],\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] { max-width: 38vw !important; }\nhtml[data-dshsvc-mobile] [class*="pXSMma_workspace"] { max-width: 30vw !important; }\n/* 模型选择按钮自适应形态(移动端零截断 + 思考程度常驻):\n 1. 放宽官方 45cqw 硬限宽(max-width: none),使 observeControlRow 能按真实无截断全宽测算;\n 2. 空间充裕时完整展示「厂家图标 + 模型全名 + 思考程度」(零截断);\n 3. 空间不足时(小屏手机、长模型名或被其他插件占用工具栏),模型全名自动收缩,\n 但思考程度(如 High / Low)在紧凑态下依然保持显示([厂家图标] High ▾),\n 无思考程度的模型则收成 45px 纯图标钮,全程单行不折行、不截断文字。 */\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_trigger"] {\n max-width: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_row"][data-model-compact] [class*="_7KE1Ra_triggerEffort"] {\n display: inline-block !important;\n flex-shrink: 0 !important;\n color: var(--dsw-alias-label-caption) !important;\n font-size: 12px !important;\n}\n/* 移动端模型选择弹窗:隐藏「搜索模型」输入框。\n 手机触屏打开下拉菜单时,官方 autoFocus 的搜索框会立即强制唤起软键盘,\n 遮挡大半屏幕与列表项;移动端列表已按厂家分组且篇幅有限,隐藏搜索行更清爽直接。 */\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_searchRow"],\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_menu"] > div:has([role="searchbox"]) {\n display: none !important;\n}\n/* 工作区侧板(fixed z25 层内的 nArs4W_panel z40)开屏后会盖住它自己的外部\n 开关钮(tab bar 行 nArs4W_toggleButton)——手机上抽屉一开就再没有任何\n 可点的关闭入口(真机反馈「关不上」本体)。把开关钮提到面板之上,\n 恢复「同一颗钮开/关」语义。 */\nhtml[data-dshsvc-mobile] [class*="nArs4W_toggleButton"] {\n position: relative !important;\n z-index: 45 !important;\n}\n/* 会话底部统计条(composer 下方两枚统计:轮/步/tok/s | tok/缓存命中):\n 官方这条行自带左右各 32px 内边距 + 12px 列间距,手机上先吃掉 76px;两枚 pill\n 完整显示需 ~380px,于是官方让它们各自收缩、把每枚的文字截断(0.1.5-rc.2 的\n 截断落在每枚 pill 自己的 bOPqQW_label 上)。用户点名(2026-09-15):「不要换行,\n 保持一行、把空间利用最大化」。\n 修法:只收紧这条行自身的内边距/间距(32→2px、12→3px),行内两枚按官方\n justify-content 居中排开、flex-wrap:nowrap 保持一行;宽度不够时两枚按 shrink\n 比例各让一点(比官方的固定截断少一个数量级),全程不换行、不横向滚动。\n 注意「用满宽度」是靠**收窄行的内边距**换来的,不是靠子项 flex-grow——grow 会把\n 整组推向左侧(老宿主形态,见下方 bOPqQW_root 规则注)。\n 旧宿主(0.1.2-alpha.2 ~ 0.1.4)的单行横滑规则(NDN2W_root)原样保留。 */\n/* 统计条与外部上下文圆环的单行布局:\n 0.1.6 官方把上下文圆环(JObwrW_root / JObwrW_trigger)移入输入框外部下方的\n uV2eYG_dock,与统计胶囊(bOPqQW_root)并列,挤占了移动端可用宽度。\n 修法:\n ① 收紧 uV2eYG_root 两侧内边距至 8px,uV2eYG_dock 间距收至 3px;换行保持开启——\n 圆环与统计胶囊共占第一行,插件的子代理累计行(flex-basis:100%,见 apply.js svcStyle)\n 独占第二行,官方条目之间仍不换行;\n ② 降低统计条与上下文圆环字号至 11px(≤375px 极窄视口阶梯降至 10px),行高 16px;\n ③ 收紧 pill 内边距、sep 间隔及 svg 尺寸(11px),上下文圆环内边距收至 1px 3px;\n 保证从 360px 起所有移动端视口下统计与上下文圆环均零截断、单行排开。\n 旧宿主(0.1.2-alpha.2 ~ 0.1.4)的单行横滑规则(NDN2W_root)原样保留。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_root"] {\n padding-left: 8px !important;\n padding-right: 8px !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_dock"] {\n gap: 0 3px !important;\n max-width: 100% !important;\n flex-wrap: wrap !important;\n justify-content: center !important;\n}\nhtml[data-dshsvc-mobile] [class*="NDN2W_root"] {\n overflow-x: auto !important;\n overflow-y: hidden !important;\n text-overflow: clip !important;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="NDN2W_root"]::-webkit-scrollbar { display: none !important; }\n/* 统计行在老宿主上是「整行宽 + 居中」,子项 flex-grow 一旦非 0 整组就会左偏:\n 官方这条行的盒子随版本变过两次形态——\n · 0.1.5-rc.2:width:100% + padding:0 32px + justify-content:center,宽度\n **等于整行**(它是 composer 卡片里的一行),行内必有富余宽度;\n · 0.1.6 起:max-width:100%,行**收缩到内容宽**,再由外层 dock 居中,行内零富余。\n 富余宽度落在 justify-content:center 上才是「两枚统计居中」;若给子项 flex-grow,\n 两枚 anchor 先把富余吃干,而行内每枚 pill 是默认 justify-content:flex-start\n ⇒ 文字贴着行内容盒左端、右端留出与富余等宽的空洞(实测 606px 视口尾空 144.7px、\n 整组中心偏移 −72.3px,即「统计是歪的」)。故子项 grow 必须为 0:老宿主上交还给\n 官方 justify-content 居中,新宿主上行本就无富余、写成 0 与 1 等效(空操作)。\n 收缩仍保留 shrink:1,窄视口按比例让位的既定行为不变。 */\nhtml[data-dshsvc-mobile] [class*="bOPqQW_root"] {\n flex-wrap: nowrap !important;\n padding-left: 2px !important;\n padding-right: 2px !important;\n column-gap: 3px !important;\n font-size: 11px !important;\n line-height: 16px !important;\n}\n/* 子项用 flex:0 1 auto(= flex 初始值)而非 flex:1 1 auto:\n grow 必须为 0,否则老宿主把统计整组推歪(见上方 rc.2 注)。 */\nhtml[data-dshsvc-mobile] [class*="bOPqQW_root"] > * { flex: 0 1 auto !important; min-width: 0 !important; }\n/* DSH 0.2.1-alpha.1 起官方把这条统计行拆成两个 dock 条目(id \'activity\' / \'usage\'),\n 行根 .root 被整体删除(bOPqQW_root 在产物中归零,上面两条 bOPqQW_root 规则只在老宿主命中),\n 行级布局改由 dock 承担(uV2eYG_dock 的 gap/padding 规则同上)。\n 新宿主里等价于旧「行内子项」的是条目根:官方新钩子 data-composer-stat 打在\n bOPqQW_anchor 上(形如 span[data-composer-stat] > span.pill),故补一条同形约束;\n bOPqQW_pill/label/sep 两级规则两版同名,继续覆盖新宿主。\n 两套选择器并存:老宿主命中旧锚、新宿主命中新锚,互不干扰。 */\nhtml[data-dshsvc-mobile] [data-composer-stat] {\n flex: 0 1 auto !important;\n min-width: 0 !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_pill"] {\n min-width: 0 !important;\n padding-left: 2px !important;\n padding-right: 2px !important;\n gap: 2px !important;\n font-size: 11px !important;\n line-height: 16px !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_pill"] svg {\n width: 11px !important;\n height: 11px !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_sep"] {\n margin: 0 1px !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_label"] {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_root"] {\n flex: none !important;\n min-width: 0 !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] {\n font-size: 11px !important;\n line-height: 16px !important;\n padding: 1px 3px !important;\n gap: 2px !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] svg {\n width: 11px !important;\n height: 11px !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [data-dsh-service-subagent-models-dock] {\n font-size: 11px !important;\n line-height: 16px !important;\n padding: 1px 2px !important;\n}\n@media (max-width: 375px) {\n html[data-dshsvc-mobile] [class*="bOPqQW_root"],\n html[data-dshsvc-mobile] [data-composer-stat],\n html[data-dshsvc-mobile] [class*="bOPqQW_pill"],\n html[data-dshsvc-mobile] [class*="JObwrW_trigger"],\n html[data-dshsvc-mobile] [data-dsh-service-subagent-models-dock] {\n font-size: 10px !important;\n }\n}\n/* Assistant 回合尾部的运行元信息行(MessageIconActions)使用官方目录属性\n data-chat-flow-kind="turn-tail" 定位,内层兜底走回合尾节点自带的稳定\n data-turn-tail(0.1.2-alpha.2 起 data-time-hover-root 已删除):\n 「带 data-turn-tail 的节点」的最后一个子项 = actions 行,其最后一个 span =\n end-clock 时间文本(bundle 源码核实:clock:"end" 渲染在 children 末位)。\n 行容器 min-width:0、时间文本可收缩并省略,以免移动端时间信息把复制/分支\n 按钮挤出可视区域。 */\nhtml[data-dshsvc-mobile] [data-chat-flow-kind="turn-tail"] [data-turn-tail] > :last-child {\n min-width: 0 !important;\n max-width: 100% !important;\n}\nhtml[data-dshsvc-mobile] [data-chat-flow-kind="turn-tail"] [data-turn-tail] > :last-child > span:last-child {\n flex: 1 1 auto !important;\n min-width: 0 !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n padding-inline: 2px !important;\n}\n/* 回到底部按钮簇(官方 *_toBottom 词干后缀,rc.2 Md3f7G_ → 0.1.2-alpha.2 EvIC1a_,\n 自有上箭头 data-dshsvc-user-jump):\n 移动端右侧还有约一行留白(scroll 的 --dsh-composer-side-clearance 侧清理),\n 官方按钮纯位移右移贴边(transform 只动绘制不动布局,sticky 定位不受影响)。\n :not([class*="Slot"]) 排除命名含 Slot 的 sticky 槽层,只移官方按钮本体。自有上箭头的\n right 已由 JS 按官方按钮实测右缘计算,再做同一平移会重复右移(实测偏差 28px)。\n 方向:正 translateX 向右;位移量 = 侧清理 +16(scroll 右 padding)再留 4px 缓冲。 */\nhtml[data-dshsvc-mobile] [class*="_toBottom"]:not([class*="Slot"]):not([data-dshsvc-user-jump]) {\n transform: translateX(calc(var(--dsh-composer-side-clearance, 16px) + 16px - 4px)) !important;\n}\n/* 左上角抽屉钮:悬停/按压用外壳交互底色 */\nhtml[data-dshsvc-mobile] [data-dshsvc-fab]:hover,\nhtml[data-dshsvc-mobile] [data-dshsvc-fab]:active { background: var(--dsw-alias-interactive-bg-hover) !important; }\n/* 抽屉钮让位内边距:FAB 是 fixed 覆盖件,中心列里**每一屏**的头行都要给它让位,\n 所以选择器按几何泛化(任意 header);但让位**只写 padding-left** ——\n 旧写法把整条 padding 按会话头部的几何一起写死(10px 20px 0 46px),连带改写\n 了官方其它页面头部自己的内边距:官方插件面板页头部(PluginManagerPage\n .X_2TxG_pageHead)官方只有 padding-top:28px,被改成 10px/20px 后头行可用宽度\n 再少 20px,412px 视口实测简介与「添加插件」双双折行(详见下方插件面板页组)。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header { padding-left: 46px !important; }\n/* 会话头部自己的移动端内边距(官方 10px 28px 0 [10px] 的收紧版:右 28→20)\n 只作用于会话头部本体:引擎标记属性优先,官方类哈希兜底覆盖未打标的空头部\n (wSkVaW_ 取自 dsh-client-ui-conversation,0.1.5-rc.2 与 0.2.0-rc.1 两代同名同值,\n 升级需复核)。其余页面头部保持官方纵向与右侧内边距不变。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header[class*="wSkVaW_header"],\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header[data-dshsvc-chat-header] { padding: 10px 20px 0 46px !important; }\n/* 官方插件面板页(dsh-client-ui-plugin-manager 的 main 面板,页面根\n section[data-plugin-panel],头行 = 直接子 header[data-window-drag])移动端适配。\n 官方 pageHead 是**不换行**的单行 flex:左「标题+简介」、右「刷新+添加插件」,\n 两块固有宽度 ≈ 154 + 16 + 140;移动端中心列还要扣掉抽屉钮让位的 46px 与页面\n 自身的左右各 24px。视口 ≲404px 起两块互相挤压(真机 412px 实测:简介折两行、\n 末字孤行;「添加插件」被压到 90px 后按钮内文案折两行、溢出 32px 高的胶囊)。\n 修法:头行允许换行 + 工具栏保持固有宽度并右对齐 —— 放得下仍是一行,放不下\n 工具栏整体落到第二行右缘,标题/简介/按钮文案各自单行,不再互相借宽度;\n 按钮文案 nowrap 是第二道保险(任何容器宽度下都不许在胶囊内折行)。\n data-plugin-panel / data-window-drag 为官方稳定钩子;类哈希 X_2TxG_ 取自\n dsh-client-ui-plugin-manager PluginManagerPage.module.css(0.2.0-rc.1),\n 升级需复核(与 uV2eYG_ 等同规)。 */\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] { flex-wrap: wrap !important; }\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] > :first-child { min-width: 0 !important; }\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] > [class*="X_2TxG_toolbar"] {\n margin-left: auto !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [data-plugin-panel] [class*="X_2TxG_addButton"] { white-space: nowrap !important; }\n/* 会话顶栏移动端适配:\n titleRow 里 标题crumb / 「N 个子代理」计数芯片 / 预设芯片(创造模式)互相挤压——\n 官方 crumbs 自带 overflow:hidden,放不下的尾部被**硬裁**:计数芯片拦腰截断\n (真机 390px 实测裁掉 49px,视觉即「1 个子代…」),标题缩到 ~119px。\n 只收紧固定几何 + 改收缩优先级,不重挂 DOM、不藏任何信息:\n ① 头部右内边距 28→20:corner 钮自带 margin-right:-16px 悬出,20 仍留 4px 边距;\n ② 更多操作钮的 utilities 左距 20→4(blank 空头部该层 :empty 隐藏,不受影响);\n ③ titleCluster 列距 10→6;\n ④ 计数组(分隔符+计数触发钮)列距 10→4,并 flex:none 不可挤压——标题按钮\n 自带 overflow:hidden + ellipsis(min-content=0)天生是收缩担当,让省出的\n 宽度全部归标题;计数文案与触发钮 aria-label(「N 个子代理」)原样保留。\n :not(:has(switcherTrigger)) 守卫带 lineage 切换器的根(其内部自有\n min-width:0 收缩链,钉死会溢出);:has 不支持时整条失效,退回官方行为。\n 类哈希 wSkVaW_ 取自 dsh-client-ui-conversation ConversationRoot.module.css、\n ZKlsPq_ 取自 dsh-client-ui-subagent SubagentHeaderLineage.module.css\n (均 0.1.6-alpha.2),升级需复核。 */\nhtml[data-dshsvc-mobile] [class*="wSkVaW_headerUtilities"] { margin-left: 4px !important; }\nhtml[data-dshsvc-mobile] [class*="wSkVaW_titleCluster"] { gap: 6px !important; }\nhtml[data-dshsvc-mobile] [class*="ZKlsPq_root"] { gap: 4px !important; }\nhtml[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) { flex: none !important; }\n/* 动作芯片泊位 v2(模式回标题行,子代理+任务下标签行\n 右锚成对;官方标签行没有第三方挂载点,泊位=自有 CSS absolute 定位):\n · 标签行官方 gap 36→20,标签内容尾按含 SSH 时 ≈172px;\n · 任务芯片(headerActions 内任务 div:has(> QsffPG_trigger),alpha.2 无 QsffPG_root 类;运行中带箭头自然宽 ~151.5px)right:110 —— 右侧 94px\n 让给子代理芯片(本次会话实测宽 93.5px,任务与子代理间隔至少 0.5px),右锚成\n 「[任务][子代理]」两枚一排(第三方插件将来若也泊到此带,右缘 16px 起排不受影响);\n max-width calc(100vw − 282px) 封顶(右距 110 + 含 SSH 的标签尾约 172),\n ≤390 档计数文字省略,320 档可用宽仅 38px;\n · 子代理芯片(ZKlsPq_root)right:16 最贴右;泊离标题后分隔符「/」失去对象,隐藏;\n · 计数文字 nowrap+ellipsis 可省;下拉箭头保留;\n 320 档任务文字宽 0,但 spinner/箭头可见,完整 aria-label 保留;\n · 旧宿主两枚芯片的下拉菜单(锚在各自 root 上 top:100%+5、left:0)改右锚展开并按\n 视口封顶(旧版 max-width 100vw−122 沿用既有菜单预算),否则贴右泊位时\n 336px 菜单会越出屏幕(旧宿主 390 档实测左越 46px);alpha.2 任务菜单 portal\n 至 body 后按触发器位置算 fixed 坐标,不能覆盖其 left/right;\n · 预设芯片(SVAs4q_label)不再泊动——随官方 headerActions 留在标题行\n (「模式=会话身份」与标题同级),第三方动作芯片同样留官方原位不受泊位管辖;\n 子代理计数离开 crumbs 后标题吃满整行(390 档 198px);\n · ≤560 门:561~1023 行宽足够(标题 ≥115px),保持官方在流。blank 空头部\n :not 守卫不泊。类哈希 QsffPG_ 取自 dsh-client-ui-jobs JobListAction.module.css\n (旧版仍有根类;新版仅有触发按钮)。结构化锚只匹配 headerActions 子树中直属包含任务按钮的 div(alpha.2 中间多一层 data-slot 包装),\n :has 不支持时回落官方布局;未来版本仍须复核哈希。 */\n@media (max-width: 560px) {\n html[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header:not([class*="wSkVaW_headerBlank"]) { position: relative !important; }\n html[data-dshsvc-mobile] [class*="wSkVaW_tabs"] { gap: 20px !important; }\n html[data-dshsvc-mobile] [class*="wSkVaW_headerActions"] div:has(> button[class*="QsffPG_trigger"]),\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) {\n position: absolute !important;\n bottom: 4px !important;\n z-index: 2;\n }\n html[data-dshsvc-mobile] [class*="wSkVaW_headerActions"] div:has(> button[class*="QsffPG_trigger"]) {\n right: 110px !important;\n max-width: calc(100vw - 282px) !important;\n }\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) {\n right: 16px !important;\n }\n /* 分隔符/箭头/收缩只作用于已泊出的子代理根;带 lineage 切换器而留在\n crumbs 里的根(:has 守卫排除的那支)保持官方形态不受影响。 */\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_separator"] { display: none !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_trigger"],\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_trigger"] { min-width: 0 !important; max-width: 100% !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_trigger"] > svg:last-child,\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_trigger"] > svg:last-child { flex: none !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_count"] {\n min-width: 0 !important;\n flex: 0 1 auto !important;\n margin: 0 2px !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n }\n html[data-dshsvc-mobile] [class*="QsffPG_root"] > [class*="QsffPG_menu"],\n html[data-dshsvc-mobile] [class*="ZKlsPq_menu"] {\n left: auto !important;\n right: 0 !important;\n max-width: calc(100vw - 122px) !important;\n }\n /* 预设芯片右靠:margin-left:auto 把 crumbs 与\n 动作组之间的全部富余收到中间——标题贴左、模式芯片贴住更多钮(间距 4px),\n 标题长短变化时芯片位置稳定不飘。 */\n html[data-dshsvc-mobile] header:not([class*="wSkVaW_headerBlank"]) [class*="wSkVaW_headerActions"] { margin-left: auto !important; }\n}\n/* 模式芯片(创造/默认等预设名)恢复可见 —— 官方 0.1.7-rc.1 起的窄屏隐藏语义\n 与移动端「模式=会话身份」的定稿冲突(todo-82 方案二:模式芯片留标题行)。\n 取证(0.1.7-rc.2 真机 + npm 产物逐版对照):\n · 隐藏来源是官方 dsh-client-ui-agent-preset 的 AgentPresetLabel.module.css\n ".SVAs4q_label{display:none}",容器是官方 dsh-client-ui-conversation\n ".wSkVaW_titleRow{container-type:inline-size}";0.1.7-alpha.2 及以前两处都不存在。\n · 判定宽度是 titleRow(非视口):本插件移动端下 titleRow = 视口 − 66px,\n 540 阈值 ⇒ 606px 视口起才显示,320~606 全档(所有手机)均被隐藏。\n · 覆盖只在 "html[data-dshsvc-mobile]" 内生效(≥1024 引擎拆卸后官方语义逐字不变);\n 与官方规则同为 (0,1,0) 特异性,靠 !important 取胜。\n 恢复后余量实测:390px+ 标题完整不裁(198px),仅 320/360/375 档标题按省略号\n 收缩(分别 -70/-30/-15px),文档零横向溢出、titleRow 溢出恒为官方 corner 钮\n 固有的 16px —— 与恢复前逐字相同。 */\nhtml[data-dshsvc-mobile] [class*="SVAs4q_label"] { display: inline-flex !important; }\n/* Agent Team 弹窗右锚:修复移动端面板右侧超出视口。\n 面板 = 官方 @deepseek-ai/dsh-experimental-client-ui-agent-team 的 TeamAction,\n 注册在 conversation.session.header.actions(与任务/子代理芯片同槽)。它自己的\n CSS 是 position:absolute; left:0; top:calc(100% + 5px);\n width:min(560px,100vw - 32px)——**左锚在触发钮左缘**,而该槽位在移动端位于\n 头部右侧(右锚泊位之外),面板便整体右移越屏:真机实测 320~560px 越出\n 112~352px、768/1023 越出 198/140px(面板右缘 = 触发钮左缘 + 面板宽)。\n\n 修法(三条规则,均基于稳定属性而非类哈希):\n ① 面板的包含块要落在**头部**而不是触发钮:会话头部在 ≥561px 官方为 static,\n 而 .root{position:relative} 会让面板锚在触发钮上 → 引擎已打的\n data-dshsvc-chat-header 上补 position:relative(≤560 档泊位组已设过,\n 这里把覆盖面扩到整个移动端,幂等),再把 TeamAction 根改 static 把\n 包含块让给头部;\n ② 面板本身改右锚:left:auto + right:16px,与它自带的\n 100vw − 32px 宽度公式(两侧各 16px)对称,并补 max-width 封顶以防\n 官方改宽。桌面 ≥1024 引擎拆卸、标记与属性同时下线 → 官方几何逐字不变。\n\n 选右锚而非 fixed:沉浸态头部带 transform(translateY(-100%)),被变换的\n 祖先会成为 fixed 后代的包含块——本文件顶部记载的 containing-block 陷阱;\n 真机实测 fixed 变体在沉浸态随头部一起位移(top 84→-68),与 absolute 无异,\n 却另外硬编码了一份纵向几何。右锚复用头部包含块,两者行为一致且不写死 top。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-chat-header] { position: relative !important; }\nhtml[data-dshsvc-mobile] [data-team-action] { position: static !important; }\nhtml[data-dshsvc-mobile] [data-team-action] [role="dialog"] {\n left: auto !important;\n right: 16px !important;\n max-width: calc(100vw - 32px) !important;\n}\n/* 刘海安全区:viewport-fit=cover 后由 env() 补回遮挡区 */\nhtml[data-dshsvc-mobile] body {\n padding-top: env(safe-area-inset-top, 0px);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n box-sizing: border-box;\n}\n/* 双击缩放与 iOS 聚焦放大 */\nhtml[data-dshsvc-mobile] button,\nhtml[data-dshsvc-mobile] a,\nhtml[data-dshsvc-mobile] [role="button"],\nhtml[data-dshsvc-mobile] input,\nhtml[data-dshsvc-mobile] textarea,\nhtml[data-dshsvc-mobile] select { touch-action: manipulation; }\nhtml[data-dshsvc-mobile] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),\nhtml[data-dshsvc-mobile] textarea { font-size: max(16px, 1em) !important; }\n/* composer 防挤压:真机反馈后迭代。0.1.5-rc.2 起外壳已无含 "toolbar"/"inputTriggers"\n 的类名(活页面命中 0,2026-09-15 死规则审计),两条泛化规则删除;只留仍命中的\n "composer"(composerSeat 等)——min-width:0 + max-width:100% 防子项撑破容器。 */\nhtml[data-dshsvc-mobile] [class*="composer" i] { min-width: 0 !important; max-width: 100% !important; }\n/* —— 滑动沉浸(v0.36;2026-09-15 几何返工)——\n 原先用 transform: translateY(115%) 把 composer 座滑出视口:**变换后的视觉溢出会被\n 计入滚动容器的可滚动区域**(实测 +147px),于是「沉浸态滑到底」时内容被抬高、底部露出\n 291px 空带(用户反馈「对话框和输出空一大段」);回显时这 147px 又消失,滚动位置随之\n 错位、最后一段被输入框压住(用户反馈「输出跑到对话框下面去了」)。\n 现改为沉浸时把该座**移出文档流**(让出 128px 占位、内容真正铺满整屏)+ 淡出:既不加\n 可滚动溢出,也不改 --dsh-composer-height(ResizeObserver 仍读到座高,外壳的浮钮偏移\n 与贴底锚定不受影响)。回显侧因占位收回会改变可滚动长度,由 setImmersive 做「贴底补偿」。 */\nhtml[data-dshsvc-mobile] [data-composer-seat] {\n transition: opacity var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease) !important;\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-composer-seat] {\n position: absolute !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n opacity: 0 !important;\n visibility: hidden !important;\n pointer-events: none !important;\n}\n/* 会话头部(面包屑+视图标签)在滚动体外面,藏在根列里:translateY(-100%) 上滑出\n data-phase=active 根的 overflow:hidden 裁剪区,负 margin-top 用引擎测得的高度\n (--dshsvc-header-h,ResizeObserver 实时校正;老内核无 RO 时回退常量)补位,\n 否则留一条空带。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-chat-header] {\n transition: transform var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease),\n margin-top var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-chat-header] {\n transform: translateY(-100%) !important;\n margin-top: calc(0px - var(--dshsvc-header-h, 76px)) !important;\n}\n/* 左上角侧栏抽屉图标(FAB)在进入对话框隐藏全屏模式(沉浸态)时同步向上滑出淡出,\n 参照右上角右侧栏抽屉按钮随顶栏上滑隐藏的体验,保持全屏阅读区域整洁。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-fab] {\n transition: transform var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease),\n opacity var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-fab] {\n transform: translateY(calc(0px - var(--dshsvc-header-h, 76px) - env(safe-area-inset-top, 0px))) !important;\n opacity: 0 !important;\n pointer-events: none !important;\n}\n@media (prefers-reduced-motion: reduce) {\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-composer-seat],\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-chat-header],\n html[data-dshsvc-mobile] [data-dshsvc-chat-header],\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-fab],\n html[data-dshsvc-mobile] [data-dshsvc-fab] { transition: none !important; }\n}\n',document.head.appendChild(s.styleTag),F()||(()=>{if(null===s.mountObserver&&"function"==typeof MutationObserver)try{s.mountObserver=new MutationObserver(()=>{F()}),s.mountObserver.observe(document.documentElement,{childList:!0,subtree:!0})}catch(e){s.mountObserver=null}})(),(()=>{if(!_){_=!0;for(const[e,t,a]of $)try{document.documentElement.addEventListener(e,t,a)}catch(e){}}})(),y();let e=!1;try{e=new URLSearchParams(window.location.search).has("dshsvc-mobile-debug")}catch(e){}e&&(s.debugEnabled=!0,s.errorHandler=()=>{s.errorCount+=1,V()},window.addEventListener("error",s.errorHandler),s.resizeHandler=()=>V(),window.addEventListener("resize",s.resizeHandler),s.debugChip=document.createElement("div"),s.debugChip.setAttribute("data-dshsvc-debug",""),Object.assign(s.debugChip.style,{position:"fixed",left:"8px",bottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)",zIndex:"60",maxWidth:"94vw",padding:"4px 8px",borderRadius:"8px",font:"11px/1.5 var(--ds-font-family-code, monospace)",background:"var(--dsw-alias-bg-layer-2, #333)",color:"var(--dsw-alias-label-primary, #eee)",pointerEvents:"none",whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis"}),s.debugChip.title=t("mobile.debug.title"),document.body.appendChild(s.debugChip),V()),l()})():U()};try{s.mq=window.matchMedia("(max-width: 1023px)")}catch(e){s.mq=null}return s.mmqMatches=()=>{try{return null!==s.mq&&!0===s.mq.matches}catch(e){return!1}},null!==s.mq&&(s.mqHandler=()=>K(),"function"==typeof s.mq.addEventListener?s.mq.addEventListener("change",s.mqHandler):"function"==typeof s.mq.addListener&&s.mq.addListener(s.mqHandler)),{evaluate:K,dispose:()=>{U(),null!==s.mq&&null!==s.mqHandler&&("function"==typeof s.mq.removeEventListener?s.mq.removeEventListener("change",s.mqHandler):"function"==typeof s.mq.removeListener&&s.mq.removeListener("change",s.mqHandler)),s.mqHandler=null}}}const we=()=>{const e=e=>{if("function"==typeof e.hasAttribute)try{return e.hasAttribute("data-conversation-scroll")}catch(e){return!1}try{return null!==e.attributes&&"function"==typeof e.attributes.getNamedItem&&null!==e.attributes.getNamedItem("data-conversation-scroll")}catch(e){return!1}};return{toBottomSlot:()=>{try{return document.querySelector('[class*="_toBottomSlot"]')}catch(e){return null}},toBottomButton:e=>{try{return e.querySelector('[class*="_toBottom"]:not([class*="Slot"])')}catch(e){return null}},isToBottomButton:e=>{try{return null!=e&&"function"==typeof e.closest&&null!==e.closest('[class*="_toBottom"]:not([class*="Slot"])')}catch(e){return!1}},scrollportOf:t=>{try{let a=t;for(;null!==a&&a!==document.documentElement&&!e(a);)a=a.parentNode;return null!==a&&a!==document.documentElement?a:t.parentNode}catch(e){return null}},officialTurnNavigatorVisible:e=>{try{if("function"!=typeof getComputedStyle)return!1;if(null===e||"function"!=typeof e.querySelector)return!1;const t=e.querySelector('[class*="_rail"]');return null!==t&&"none"!==getComputedStyle(t).display}catch(e){return!1}},userRows:e=>{const t=[];try{if("function"!=typeof e.querySelectorAll)return t;for(const a of e.querySelectorAll('[data-chat-flow-kind="user"]'))t.push(a)}catch(e){}return t},flowTopOf:(e,t)=>{try{return t.getBoundingClientRect().top-e.getBoundingClientRect().top}catch(e){return 0}},loadOlderButton:e=>{try{return"function"==typeof e.querySelector?e.querySelector('[class*="_older"] button'):null}catch(e){return null}}}};const xe=({ctx:e,getModelDirectories:t})=>{const a={styleTag:null,observer:null,observerCreated:!1,unsubscribe:null,unsubscribeSessions:null,unsubscribeQuota:null,seat:null,trigger:null,lastProvider:null,lastSession:void 0,disposed:!1,menuOpen:!1},r=e=>{try{const t=String(e?.textContent??"").trim();return""===t?null:t}catch(e){return null}},s=e=>{try{if(null==e||"function"!=typeof e.querySelectorAll)return;for(const t of Array.from(e.querySelectorAll(`[${y}]`)))try{t.remove()}catch(e){}}catch(e){}},n=e=>{s(e),M(e,v),M(e,d),M(e,c),H(e,u),H(e,p)},o=()=>{const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return;try{for(const t of Array.from(e.querySelectorAll(`[${y}]`)))try{t.remove()}catch(e){}}catch(e){}let t=[];try{t=Array.from(e.querySelectorAll(`[${v}]`))}catch(e){t=[]}for(const e of t)n(e)},l=()=>{try{const t=e.sessions;if(t&&t.list&&"function"==typeof t.list.getSnapshot){const e=t.list.getSnapshot();if(e&&"string"==typeof e.current&&""!==e.current)return e.current;if(e&&e.byId){const t=Object.values(e.byId).find(e=>(e?.retainedBy?.mainView??0)>0);if(t&&"string"==typeof t.id&&""!==t.id)return t.id;if(t&&"string"==typeof t.sessionId&&""!==t.sessionId)return t.sessionId;const a=Object.keys(e.byId);if(1===a.length)return a[0]}}}catch(e){}},i=e=>{const t=P();if(null===t)return null;const a=[];null!=e&&"function"==typeof e.querySelector&&a.push(e),"function"==typeof t.querySelector&&a.push(t);for(const e of a)try{const t=e.querySelector(`[data-slot="${g}"] button`);if(null!=t)return t}catch(e){}for(const e of a)try{const t=e.querySelector(f);if(null!=t)return t}catch(e){}if(null!=e&&"function"==typeof e.querySelectorAll)try{for(const t of Array.from(e.querySelectorAll(h))){const e=`${R(t,"aria-label")??""} ${R(t,"title")??""}`;if(/模型|Model/i.test(e))return t}}catch(e){}return null},E=e=>{null!=e&&(M(e,m),M(e,d),M(e,c),H(e,u),H(e,p),H(e,b))},C=()=>{if(a.disposed)return;const e=(()=>{const e=P();if(null===e)return null;try{return e.querySelector("[data-composer-seat]")}catch(e){return null}})();if(null!==e){const t=i(e);null!==t&&(a.trigger=t)}if((()=>{if(a.disposed)return;const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return;let t=[];try{t=(()=>{const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return[];const t=(e,t)=>{try{return null!=e&&"function"==typeof e.querySelectorAll?Array.from(e.querySelectorAll(t)):[]}catch(e){return[]}},r=(e=>{const t=P();if(null===t||null==e)return null;const a=R(e,"aria-controls");if("string"!=typeof a||""===a)return null;try{return"function"==typeof t.getElementById?t.getElementById(a):null}catch(e){return null}})(a.trigger);if(null!=r){const e=t(r,w);if(e.length>0)return e;const a=t(r,x);if(a.length>0)return a}return t(e,x)})()}catch(e){return}if(0!==t.length){a.menuOpen=!0;for(const a of t){const t=r(a);if(null===t)continue;const o=T(t,{forComposer:!0});if(null===o){n(a);continue}const l=1!==o.spec.c,i=R(a,d);if((!(()=>{try{return null!==a.querySelector(`[${y}]`)}catch(e){return!1}})()||i!==o.slug)&&(s(a),"function"==typeof e.createElement)){try{const t=e.createElement("span");if(t.setAttribute(y,o.slug),t.setAttribute(d,o.slug),t.setAttribute(c,l?"mono":"color"),t.setAttribute("aria-hidden","true"),t.style&&"function"==typeof t.style.setProperty){t.style.setProperty(u,k(o.spec,l));const e="number"==typeof o.spec.o&&o.spec.o>0?o.spec.o:1;1!==e&&t.style.setProperty(p,`${(13*e).toFixed(2)}px`)}a.insertBefore(t,a.firstChild)}catch(e){}z(a,v,o.slug),z(a,d,o.slug),z(a,c,l?"mono":"color")}}}else a.menuOpen&&(a.menuOpen=!1,o())})(),null===e)return void(a.seat=null);a.seat=e,l()!==a.lastSession&&(a.lastProvider=null,D(),L());const g=i(e);a.trigger=g;const h=(()=>{const e=l();if(null==e)return null;try{const a=t();if(void 0===a||"function"!=typeof a.directoryFor)return null;const r=a.directoryFor(e),s=r&&r.store&&"function"==typeof r.store.getSnapshot?r.store.getSnapshot():null,n=s&&s.current?s.current.provider:void 0;return"string"==typeof n&&""!==n?n:null}catch(e){return null}})();if(h===a.lastProvider&&I(e,c)&&(null===g||I(g,m)))return;a.lastProvider=h;const f=null===h?null:T(h,{forComposer:!0});if(null===f)return q(e),void E(g);const S=1!==f.spec.c;O(e,u,k(f.spec,S));const C="number"==typeof f.spec.o&&f.spec.o>0?f.spec.o:1;1===C?H(e,p):O(e,p,`${(15*C).toFixed(2)}px`),z(e,d,f.slug),z(e,c,S?"mono":"color"),((e,t)=>{if(null==e)return;const a=1!==t.spec.c;z(e,m,t.slug),z(e,d,t.slug),z(e,c,a?"mono":"color"),O(e,u,k(t.spec,a));const r="number"==typeof t.spec.o&&t.spec.o>0?t.spec.o:1;1===r?H(e,p):O(e,p,`${(15*r).toFixed(2)}px`),O(e,b,"none")})(g,f)},q=e=>{M(e,d),M(e,c),H(e,u),H(e,p)},D=()=>{const e=P(),t=[];if(null!==e&&"function"==typeof e.querySelectorAll){let a=[];try{a=Array.from(e.querySelectorAll(`[${m}]`))}catch(e){a=[]}for(const e of a)t.push(e)}null!==a.trigger&&t.push(a.trigger);for(const e of t)E(e);if(a.trigger=null,null!==a.seat&&q(a.seat),null!==e&&"function"==typeof e.querySelectorAll){let t=[];try{t=Array.from(e.querySelectorAll(`[${c}]`))}catch(e){t=[]}for(const e of t)q(e)}o(),a.seat=null,a.lastProvider=null},L=()=>{if(null!==a.unsubscribe){try{a.unsubscribe()}catch(e){}a.unsubscribe=null}const e=l();if(a.lastSession=e,null!=e)try{const r=t();if(void 0===r||"function"!=typeof r.directoryFor)return;const s=r.directoryFor(e);if(s&&s.store&&"function"==typeof s.store.subscribe){const e=s.store.subscribe(()=>C());if(a.unsubscribe="function"==typeof e?e:null,"function"==typeof s.load)try{const e=s.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}}catch(e){}};return{start:()=>{const t=P();if(null===a.styleTag&&null!==t)try{const e=t.createElement("style");e.dataset.plugin="@gehennawu/dsh-service",e.dataset.pluginCss="@gehennawu/dsh-service/model-icons.css",e.textContent=A,t.head.appendChild(e),a.styleTag=e}catch(e){}if((()=>{if(null===a.unsubscribeQuota)try{if(void 0===S||"function"!=typeof S.subscribe)return;const e=S.subscribe(()=>{a.disposed||(a.lastProvider=null,C())});a.unsubscribeQuota="function"==typeof e?e:null}catch(e){}})(),(()=>{if(null===a.unsubscribeSessions)try{const t=e.sessions;if(!t||!t.list||"function"!=typeof t.list.subscribe)return;const r=t.list.subscribe(()=>{a.disposed||l()!==a.lastSession&&(a.lastProvider=null,D(),L(),C())});a.unsubscribeSessions="function"==typeof r?r:null}catch(e){}})(),L(),C(),null===a.observer&&null!==t&&"function"==typeof MutationObserver&&!a.observerCreated){a.observerCreated=!0;try{a.observer=new MutationObserver(()=>{null===a.seat||"function"!=typeof t.contains||t.contains(a.seat)||(a.seat=null,a.lastProvider=null),C()}),a.observer.observe(t.documentElement,{childList:!0,subtree:!0})}catch(e){a.observer=null}}},stop:()=>{if(a.disposed=!0,null!==a.unsubscribe){try{a.unsubscribe()}catch(e){}a.unsubscribe=null}if(null!==a.unsubscribeSessions){try{a.unsubscribeSessions()}catch(e){}a.unsubscribeSessions=null}if(null!==a.unsubscribeQuota){try{a.unsubscribeQuota()}catch(e){}a.unsubscribeQuota=null}if(null!==a.observer){try{a.observer.disconnect()}catch(e){}a.observer=null}if(D(),null!==a.styleTag){try{a.styleTag.remove()}catch(e){}a.styleTag=null}},apply:C,clear:D,revive:()=>{a.disposed=!1,a.observerCreated=!1,a.lastSession=void 0,a.lastProvider=null,a.seat=null,a.trigger=null,a.menuOpen=!1}}};function ke(e){const t=null!==e&&"object"==typeof e?e:{};return{status:"ready"===t.status||"loading"===t.status||"unavailable"===t.status?t.status:"unavailable",value:void 0!==t.value&&null!==t.value&&"object"==typeof t.value?t.value:void 0,base:t.base,user:t.user,revision:t.revision,writable:!0===t.writable,mode:"host"===t.mode?"host":"memory"}}function Se({ctx:e,namespace:t,defaults:a,React:r}){const s=new Set,n=()=>ke({status:"ready",value:l(),revision:0,writable:!1,mode:"memory"});let o=Object.assign({},a);const l=()=>Object.assign({},o);let i=n(),d=null,c=null,u=!1;const p=e=>{i=e;for(const e of[...s])try{e()}catch(e){}},m=()=>{u||p((()=>{if(null===d)return n();try{return ke(d.getSnapshot())}catch(e){return n()}})())};let g="memory";const h=(e,a)=>{if(!u){if(null!==c){try{c()}catch(e){}c=null}if(d=null==a?null:function(e,t){if(null===e||"object"!=typeof e)return null;let a;try{"function"==typeof e.get?a=e.get(t):"function"==typeof e.bind&&(a=e.bind({namespace:t}))}catch(e){return null}return null===a||"object"!=typeof a||"function"!=typeof a.getSnapshot||"function"!=typeof a.subscribe?null:a}(a,t),g=null===d?"memory":e,null!==d){if("function"==typeof d.subscribe)try{c=d.subscribe(m)}catch(e){c=null}m()}else p(n())}},f=(e,t)=>{if(null!=t)return"configForms"===e?"function"==typeof t.get?e:void 0:"settingsScope"===e&&"function"==typeof t.bind?e:void 0},b=(()=>{for(const t of["configForms","settingsScope"]){let a;try{a="function"==typeof e.get?e.get(t):void 0}catch(e){a=void 0}if(void 0!==f(t,a))return{name:t,service:a}}})();void 0!==b&&h(b.name,b.service);for(const t of["configForms","settingsScope"]){if("function"!=typeof e.inject)break;try{e.inject([t],e=>{if(u)return;const a=null!==e&&"object"==typeof e?e[t]:void 0;void 0!==f(t,a)&&("settingsScope"===t&&"configForms"===g||h(t,a))})}catch(e){}}const v={getSnapshot:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e)),set:async(e,t)=>{if(null!==d&&"function"==typeof d.set)return d.set(e,t);o=Object.assign({},o,{[e]:t}),p(n())},unset:async e=>{if(null!==d&&"function"==typeof d.unset)return d.unset(e);o=Object.assign({},o),delete o[e],p(n())},kind:()=>g,dispose:()=>{if(u=!0,null!==c){try{c()}catch(e){}c=null}d=null,s.clear()}},y=()=>i,w=()=>Object.assign({},a,i.value||{});return{featureScope:v,featureSnapshot:y,featureValue:w,featureEnabled:e=>!1!==w()[e],useFeatures:()=>{const[e,t]=r.useState(y());return r.useEffect(()=>v.subscribe(()=>t(y())),[]),{snapshot:e,value:Object.assign({},a,e.value||{})}}}}return a.inject=["slots","connection","timer","locale","sessions"],a.apply=function(t){const{useState:a,useEffect:o,useRef:l}=r,i=new Set(["quota","quota-reset-card","health"]),d=(e,a)=>{const r=null===a||"object"!=typeof a||Array.isArray(a)?{}:a,s=i.has(e)&&void 0===r.timezoneOffsetMinutes?{...r,timezoneOffsetMinutes:(new Date).getTimezoneOffset()}:r,n=i.has(e)?{...s,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}:s;if("quota-reset-card"===e&&"string"==typeof n.expiresAt&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?$/.test(n.expiresAt)){const e=new Date(n.expiresAt);Number.isFinite(e.getTime())&&(n.expiresAt=e.toISOString())}return Promise.resolve(t.connection.rpc.call("/dsh-service",e,n)).then(ue)};let c;"undefined"!=typeof document&&document.head&&(c=document.createElement("style"),c.dataset.plugin="@gehennawu/dsh-service",c.dataset.pluginCss="@gehennawu/dsh-service/theme-tokens.css",c.textContent=["body{--dsh-svc-page-bg:#f4f5f7;--dsh-svc-content-bg:var(--dsw-alias-bg-layer-2,#ffffff);--dsh-svc-raised-bg:var(--dsw-alias-bg-layer-3,#ffffff);--dsh-svc-text:var(--dsw-alias-label-primary,#202124);--dsh-svc-text-muted:var(--dsw-alias-label-secondary,#6b7280);--dsh-svc-border:var(--dsw-alias-border-l1,#e5e7eb);--dsh-svc-brand:var(--dsw-alias-brand-primary,#2563eb);--dsh-svc-brand-text:var(--dsw-alias-label-primary-foreground,#ffffff);--dsh-svc-info:#2563eb;--dsh-svc-success:var(--dsw-alias-state-success-primary,#16a34a);--dsh-svc-warning:var(--dsw-alias-state-warn-primary,#d97706);--dsh-svc-danger:var(--dsw-alias-state-error-primary,#dc2626)}","body{--dsh-svc-card-bg:#eceef1}","body{--dsh-svc-border-strong:#b9c0ca}","body[data-ds-dark-theme]{--dsh-svc-border-strong:#52565f}","body[data-ds-dark-theme]{--dsh-svc-card-bg:var(--dsw-alias-bg-layer-2,#202126)}","body[data-ds-dark-theme]{--dsh-svc-page-bg:var(--dsw-alias-bg-layer-1,#17181c);--dsh-svc-content-bg:var(--dsw-alias-bg-layer-2,#202126);--dsh-svc-raised-bg:var(--dsw-alias-bg-layer-3,#292a31);--dsh-svc-text:var(--dsw-alias-label-primary,#f3f4f6);--dsh-svc-text-muted:var(--dsw-alias-label-secondary,#a1a1aa);--dsh-svc-border:var(--dsw-alias-border-l1,#3f414a)}","body[data-ds-dark-theme]{--dsh-svc-brand-text:#111318}",":root{--dsh-svc-space-1:4px;--dsh-svc-space-2:8px;--dsh-svc-space-3:12px;--dsh-svc-space-4:16px;--dsh-svc-space-5:20px;--dsh-svc-space-6:24px;--dsh-svc-space-8:32px;--dsh-svc-radius-control:8px;--dsh-svc-radius-card:12px;--dsh-svc-radius-panel:16px;--dsh-svc-radius-pill:999px;--dsh-svc-control-h:36px;--dsh-svc-control-h-compact:32px;--dsh-svc-control-h-primary:40px;--dsh-svc-content-max:800px;--dsh-svc-dur-fast:120ms;--dsh-svc-dur-view:170ms;--dsh-svc-font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}","body{--dsh-svc-surface-bg:var(--dsh-svc-card-bg);--dsh-svc-tab-active-bg:var(--dsh-svc-text);--dsh-svc-tab-active-danger:var(--dsh-svc-text);--dsh-svc-tab-active-text:#ffffff}","body[data-ds-dark-theme]{--dsh-svc-tab-active-text:#111318}","[data-dsh-service-nav]>svg:first-child,[data-dsh-service-quota-nav]>svg:first-child,[data-dsh-service-models-nav]>svg:first-child,[data-dsh-service-restart-nav]>svg:first-child,[data-dsh-service-sessions-nav]>svg:first-child{display:none}","[data-dsh-service-nav]::before,[data-dsh-service-quota-nav]::before,[data-dsh-service-models-nav]::before,[data-dsh-service-restart-nav]::before,[data-dsh-service-sessions-nav]::before{content:'';flex:none;width:16px;height:16px;background:currentColor}","[data-dsh-service-nav]::before{"+X(ae)+"}","[data-dsh-service-quota-nav]::before{"+X(re)+"}","[data-dsh-service-models-nav]::before{"+X(se)+"}","[data-dsh-service-sessions-nav]::before{"+X(oe)+"}","[data-dsh-service-restart-nav]::before{"+X(ne)+"}","@media (max-width:640px){","[data-dshsvc-root] .dshsvc-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:3px}","[data-dshsvc-root] .dshsvc-tabs::-webkit-scrollbar{display:none}","[data-dshsvc-root] .dshsvc-tab{padding:9px 13px;min-height:36px;box-sizing:border-box;font-size:13px;white-space:nowrap;flex:none}","[data-dshsvc-root] .dshsvc-tab svg{flex:none}","}","@supports (grid-template-columns:subgrid){","[data-dshsvc-root] .dshsvc-version-surface{display:grid !important;grid-template-columns:max-content max-content max-content minmax(0,1fr);column-gap:16px}","[data-dshsvc-root] .dshsvc-version-surface>*{grid-column:1/-1}","[data-dshsvc-root] .dshsvc-version-row{display:grid !important;grid-template-columns:subgrid;justify-content:normal !important;align-items:center}","[data-dshsvc-root] .dshsvc-version-identity{display:contents !important}","[data-dshsvc-root] .dshsvc-version-identity>a,[data-dshsvc-root] .dshsvc-version-identity>code{margin-left:0 !important;justify-self:end}","[data-dshsvc-root] .dshsvc-version-status{grid-column:4;justify-self:end}","}",'[data-dshsvc-root] [data-testid="version-card"]{container-type:inline-size;container-name:dshsvc-version}',"@container dshsvc-version (max-width:480px){","[data-dshsvc-root] .dshsvc-version-surface{display:block !important}","[data-dshsvc-root] .dshsvc-version-row{display:flex !important;justify-content:space-between !important;gap:6px !important;padding:12px 2px !important}","[data-dshsvc-root] .dshsvc-version-identity{flex-basis:100%;display:flex !important;flex-wrap:wrap;align-items:center;gap:8px}","[data-dshsvc-root] .dshsvc-version-identity>a,[data-dshsvc-root] .dshsvc-version-identity>code{margin-left:0 !important;white-space:normal !important;overflow-wrap:anywhere;min-width:0;justify-self:auto !important;flex:1 1 auto;text-align:right}","[data-dshsvc-root] .dshsvc-version-identity>button{flex:none;margin-left:auto}","[data-dshsvc-root] .dshsvc-version-status{grid-column:auto !important;justify-self:stretch !important;flex-basis:100%;justify-content:flex-start !important}","}","@keyframes dshsv-locate-flash{0%,100%{background-color:rgba(198,128,0,0.10)}30%,70%{background-color:rgba(198,128,0,0.45)}}.dshsv-locate-flash{animation:dshsv-locate-flash 2s ease}",'[class*="uV2eYG_dock"]:has([data-dsh-service-subagent-models-dock]){flex-wrap:wrap;width:100%;row-gap:0}','[class*="uV2eYG_dock"] [data-dsh-service-subagent-models-dock]{flex:0 0 100%}',"[data-dshsvc-root]{color:var(--dsh-svc-text);font-size:14px;line-height:1.55;background:var(--dsh-svc-page-bg);border-radius:var(--dsh-svc-radius-card);padding:2px}","[data-dshsvc-root] .dshsvc-page{width:100%;max-width:var(--dsh-svc-content-max);margin:0 auto}",'[data-dshsvc-root] button:focus-visible,[data-dshsvc-root] [role="switch"]:focus-visible,[data-dshsvc-root] select:focus-visible,[data-dshsvc-root] input:focus-visible{outline:2px solid var(--dsh-svc-brand);outline-offset:2px;border-radius:var(--dsh-svc-radius-control)}',"@media (prefers-reduced-motion:reduce){[data-dshsvc-root] *,[data-dshsvc-root] *::before,[data-dshsvc-root] *::after{transition-duration:0.01ms !important;animation-duration:0.01ms !important}}",'[data-testid^="sessions-project-header-"]{transition:background var(--dsh-svc-dur-fast,120ms)}','[data-testid^="sessions-project-header-"]:hover{background:var(--dsw-alias-bg-layer-3,#f2f3f5)}',"[data-dshsvc-root] .dshsvc-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:2px;width:100%;box-sizing:border-box;border:0.5px solid var(--dsh-svc-border);border-radius:var(--dsh-svc-radius-card);overflow:hidden}","[data-dshsvc-root] .dshsvc-tab{position:relative;display:inline-flex;align-items:center;gap:5px;padding:8px 12px;margin:0;border:0;border-radius:0;background:transparent;color:var(--dsh-svc-text-muted);font:inherit;font-size:12px;font-weight:550;line-height:16px;cursor:pointer;transition:color var(--dsh-svc-dur-fast) ease,background var(--dsh-svc-dur-fast) ease}",'[data-dshsvc-root] .dshsvc-tab[aria-selected="true"]{background:var(--dsh-svc-tab-active-bg);color:var(--dsh-svc-tab-active-text);font-weight:650;border-radius:8px}',".dshsvc-subtabs,[data-dshsvc-root] .dshsvc-subtabs{display:flex;flex-wrap:wrap;gap:2px;margin:10px 0 0;border-bottom:1px solid var(--dsh-svc-border)}",".dshsvc-subtab,[data-dshsvc-root] .dshsvc-subtab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;padding:8px 10px;font:inherit;font-size:13px;font-weight:550;color:var(--dsh-svc-text-muted);cursor:pointer;transition:color var(--dsh-svc-dur-fast) ease,border-color var(--dsh-svc-dur-fast) ease}",'.dshsvc-subtab[aria-selected="true"],[data-dshsvc-root] .dshsvc-subtab[aria-selected="true"]{color:var(--dsh-svc-brand);border-bottom-color:var(--dsh-svc-brand);font-weight:700}',"[data-dshsvc-root] .dshsvc-page-header{margin:14px 2px 2px}","[data-dshsvc-root] .dshsvc-page-header-row{display:flex;align-items:center;justify-content:space-between;gap:var(--dsh-svc-space-3);flex-wrap:wrap}"].join(""),document.head.appendChild(c)),t.effect(()=>()=>{c&&c.remove()},"dsh-service theme styles"),t.effect(()=>t.locale.register(s,{zh:Y,en:Q}),"dsh-service dictionaries");const u=t.locale.bind(s),p=()=>"zh"===t.locale?.getSnapshot?.()?.active?"zh":"en",m=(e,t={})=>{const a=Number(e);return Number.isFinite(a)?!0===t.billions&&a>=1e9?Math.round(a/1e8)/10+"B":a>=1e6?Math.round(a/1e5)/10+"M":a>=1e3?Math.round(a/100)/10+"K":a.toLocaleString():t.invalid??""},{featureScope:g,featureSnapshot:h,featureValue:f,featureEnabled:b,useFeatures:v}=Se({ctx:t,namespace:s,defaults:{healthDiagnostics:!0,modelUsage:!0,quotaLookup:!0,backupMaintenance:!0,taskNotifications:!0,healthz:!0,skillManager:!0,subagentRoute:!0,subagentModelsDock:!0,mobileAdaptation:!1,sessionManager:!0,fileEditor:!0,modelProviderIcons:!0,modelCatalog:!0},React:r});t.effect(()=>()=>g.dispose(),"dsh-service feature settings facade"),t.effect(()=>function(e){if("undefined"==typeof document||!document.body)return()=>{};let t=!1,a=null,r=null,s=null;const n=()=>{t||null!==a||("function"==typeof requestAnimationFrame?a=requestAnimationFrame(()=>{a=null,o()}):o())},o=()=>{if(t)return;const a="function"==typeof document.querySelector?document.querySelector('[role="dialog"] nav'):null;if(a!==r&&(null!==s&&s.disconnect(),s=null,r=a,null!==r&&(s=new MutationObserver(n),s.observe(r,{childList:!0,subtree:!0,characterData:!0}))),null===r)return;const o="function"==typeof r.querySelectorAll?r.querySelectorAll("button"):document.querySelectorAll('[role="dialog"] nav button');for(const t of o){const a=(t.textContent||"").trim();for(const r of e){const e=String(r.label()||"").trim();e&&a===e?t.setAttribute(r.attr,""):t.removeAttribute(r.attr)}}ie()};o();const l=new MutationObserver(n);return l.observe(document.body,{childList:!0,subtree:!0}),()=>{t=!0,l.disconnect(),null!==s&&s.disconnect(),s=null,r=null,null!==a&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(a),a=null;for(const t of e)for(const e of document.querySelectorAll("["+t.attr+"]"))e.removeAttribute(t.attr)}}([{attr:"data-dsh-service-nav",label:()=>u("nav.label")},{attr:"data-dsh-service-quota-nav",label:()=>u("tabs.quota")},{attr:"data-dsh-service-models-nav",label:()=>u("tabs.models")},{attr:"data-dsh-service-restart-nav",label:()=>u("nav.restart")},{attr:"data-dsh-service-sessions-nav",label:()=>u("tabs.sessions")}]),"dsh-service settings nav icons");const{settingsNavBackend:y,createSectionBackendSync:w,SETTINGS_NAV_MAX_ITEMS:x,getRawSettingsSections:k,navOrderListeners:E,notifyNavOrderChanged:C,readSettingsNavHidden:T,readSettingsNavOrder:A,resolveSectionLabel:z,writeSettingsNavHidden:M,writeSettingsNavOrder:I,ensureSettingsNavBackendSynced:R}=function({ctx:e,rpcCall:t}){const a="dsh-service-settings-nav-order",r="dsh-service-settings-nav-hidden",s=/^[A-Za-z0-9._-]{1,64}$/,n=(e,t,a={})=>{try{const r=localStorage.getItem(e);if(!r)return t;const n=JSON.parse(r);return!Array.isArray(n)||n.length>64?t:n.every(e=>"string"==typeof e&&s.test(e))?!0===a.excludeHost?n.filter(e=>"dsh-service"!==e):n:t}catch(e){return t}},o=()=>n(a,null),l=e=>{try{null===e?localStorage.removeItem(a):localStorage.setItem(a,JSON.stringify(e))}catch(e){}},i=()=>n(r,[],{excludeHost:!0}),d=e=>{try{if(null===e||0===e.length)localStorage.removeItem(r);else{const t=e.filter(e=>"dsh-service"!==e);localStorage.setItem(r,JSON.stringify(t))}}catch(e){}};let c=0;const u=new Set,p=()=>{try{const t=e.slots?._core;if(t&&"function"==typeof t.record)return t.record("settings.section")||null}catch(e){}return null},m=e=>{const t=new Set;try{const a=e&&e.listeners;if(a&&"function"==typeof a[Symbol.iterator])for(const e of a)"function"==typeof e&&t.add(e)}catch(e){}return t},g=()=>{c++;const t=p(),a=new Set;for(const e of u)a.add(e);for(const e of m(t))a.add(e);const r=e=>{if(u.has(e))return!0;const t=p();return m(t).has(e)};for(const e of a)if("function"==typeof e&&r(e))try{e()}catch(e){}try{if(t){const a=e.slots?._core;a&&"function"==typeof a.markDirty&&a.markDirty("settings.section",t),a&&"function"==typeof a.flush&&a.flush()}}catch(e){}try{if("function"==typeof e.slots?.register){const t=e.slots.register({name:"settings.section",id:"__dsh_nav_bump__"},()=>null);"function"==typeof t&&t()}}catch(e){}ie()};let h=null,f=null;if(e.slots&&"function"==typeof e.slots.entries){const t=e.slots.entries.bind(e.slots);h=t;const a="function"==typeof e.slots.getVersion?e.slots.getVersion.bind(e.slots):null,r="function"==typeof e.slots.subscribe?e.slots.subscribe.bind(e.slots):null;e.slots.entries=function(e){const a=t(e);if("settings.section"!==e)return a;const r=o(),s=i(),n=new Set(s),l=a.filter(e=>{const t=e.options?.id??e.options?.key??"";return"__dsh_nav_bump__"!==t&&("dsh-service"===t||!n.has(t))});return r&&0!==r.length?l.map(e=>{const t=e.options?.id??e.options?.key??"",a=r.indexOf(t),s=-1!==a?10*a:1e4+(e.options?.order??0);return Object.assign({},e,{options:Object.assign({},e.options,{order:s})})}):l},a&&(e.slots.getVersion=function(e){const t=a(e);return"settings.section"===e?t+1e5*c:t});const s=new Set;r&&(e.slots.subscribe=function(e,t){if("settings.section"===e){u.add(t);const a=r(e,t),n=()=>{s.delete(n)&&(u.delete(t),"function"==typeof a&&a())};return s.add(n),n}return r(e,t)}),f=()=>{e.slots.entries=t,a&&(e.slots.getVersion=a),r&&(e.slots.subscribe=r);for(const e of Array.from(s))e();u.clear()}}e.effect(()=>()=>{f&&f()},"dsh-service settings nav slot wrapping");const b=()=>{let t=[];return h?t=h("settings.section"):"function"==typeof e.slots?.entries&&(t=e.slots.entries("settings.section")),t.filter(e=>"__dsh_nav_bump__"!==(e.options?.id??e.options?.key))},v=e=>{if(!e)return"";const t=e.label;if("function"==typeof t)try{const e=t();if(e)return String(e)}catch(e){}else if("string"==typeof t&&t)return t;return String(e.id??e.key??"")};ie=()=>{if("undefined"==typeof document||!document.body)return;const e="function"==typeof document.querySelector?document.querySelector('[role="dialog"] nav'):null;if(!e)return;x();const t="function"==typeof e.querySelectorAll?e.querySelectorAll("button"):[];if(!t||0===t.length)return;const a=i(),r=new Set(a),s=o(),n=b(),l=new Map;for(const e of n){const t=e.options?.id??e.options?.key??"";if(!t||"__dsh_nav_bump__"===t)continue;const a=v(e.options);a&&l.set(a.trim(),t),l.set(t,t)}for(const e of t){const t=t=>{if("function"!=typeof e.getAttribute)return null;try{return e.getAttribute(t)}catch(e){return null}},a=t=>"function"==typeof e.hasAttribute?e.hasAttribute(t):!(!e.attrs||"function"!=typeof e.attrs.has)&&e.attrs.has(t),n="function"==typeof e.querySelector?e.querySelector("span"):null,o=(n?n.textContent:e.textContent||"").trim(),i=(t("title")||"").trim(),d=(t("aria-label")||"").trim(),c=l.get(o)||l.get(i)||l.get(d)||null;if(c){if(t("data-dsh-section-id")!==c&&"function"==typeof e.setAttribute)try{e.setAttribute("data-dsh-section-id",c)}catch(e){}if(e.style)if("dsh-service"===c?e.style.display="":r.has(c)?e.style.display="none":e.style.display="",s&&s.length>0){const t=s.indexOf(c);e.style.order=-1!==t?String(t):"9999"}else e.style.order=""}else{if(a("data-dsh-section-id")&&"function"==typeof e.removeAttribute)try{e.removeAttribute("data-dsh-section-id")}catch(e){}e.style&&(e.style.display="",e.style.order="")}}const d=e.children,c="function"==typeof e.querySelector&&(e.querySelector('[class*="navList"]')||d&&d[1])||null;c&&c.style&&s&&s.length>0&&(c.style.display="flex")};const y=({section:e,readOrder:a,readHidden:r,writeLocal:s})=>{const n={synced:!1,pushPending:!1},o=(a,r)=>{t("config-set",{section:e,value:{order:a,hidden:r}}).then(e=>{e&&!0===e.ok||(n.pushPending=!0)}).catch(()=>{n.pushPending=!0})},l=()=>{t("config-set",{section:e,value:null}).then(e=>{e&&!0===e.ok||(n.pushPending=!0)}).catch(()=>{n.pushPending=!0})},i=()=>{const e=a(),t=r();e&&e.length>0||t&&t.length>0?o(e,t):l()};return{persist:o,persistReset:l,ensureSynced:()=>{n.synced?n.pushPending&&(n.pushPending=!1,i()):(n.synced=!0,(async()=>{try{const a=await t("config-get",{section:e});if(!a||!0!==a.ok||void 0===a.value)return void(n.synced=!1);if(n.pushPending)return n.pushPending=!1,void i();const r=a.value;if(null!==r&&"object"==typeof r&&(Array.isArray(r.order)||Array.isArray(r.hidden)))return void s(Array.isArray(r.order)?r.order:null,Array.isArray(r.hidden)?r.hidden:[]);i()}catch(e){n.synced=!1}})())}}},w=y({section:"settingsNav",readOrder:()=>o(),readHidden:()=>i(),writeLocal:(e,t)=>{l(e),d(t),g()}}),x=w.ensureSynced;return{settingsNavBackend:w,createSectionBackendSync:y,SETTINGS_NAV_MAX_ITEMS:64,getRawSettingsSections:b,navOrderListeners:u,notifyNavOrderChanged:g,readSettingsNavHidden:i,readSettingsNavOrder:o,resolveSectionLabel:v,writeSettingsNavHidden:d,writeSettingsNavOrder:l,ensureSettingsNavBackendSynced:x}}({ctx:t,rpcCall:d}),O=y.persist,H=y.persistReset,J=()=>{const[,e]=a(t.locale.getSnapshot());return o(()=>t.locale.subscribe(()=>e(t.locale.getSnapshot())),[]),u},{SubagentModelsDock:Z}=function({ctx:e,rpcCall:t,useTranslation:a}){const{useState:s,useEffect:n}=r,o=new Map,l=new Map,i=new Map,d=(e,a=!1)=>{if("string"!=typeof e||""===e)return Promise.resolve([]);const r=Date.now();if(!a&&r-(l.get(e)??0)<1e4)return Promise.resolve(o.get(e)??[]);let s=i.get(e);return void 0===s&&(s=t("subagent-dispatches",{parentId:e,limit:400}).then(t=>{const a=t&&!0===t.ok&&Array.isArray(t.value?.records)?t.value.records:[],r=[];for(const e of a)null!==e&&"object"==typeof e&&r.push(e);return o.set(e,r),l.set(e,Date.now()),r}).catch(()=>(l.set(e,Date.now()),null)),i.set(e,s),s.finally(()=>i.delete(e)).catch(()=>{})),s};return{SubagentModelsDock:function(t){const l=a(),[i,c]=s("");return n(()=>{let a=!1;const r="string"==typeof t.sessionId?t.sessionId:void 0;if(void 0===r)return void c("");const s=()=>{const e=de(o.get(r)??[]);c(0===e.length?"":`${l("subagent.dock.label")}${ce(e)}`)},n=()=>d(r).then(e=>!a&&(s(),null!==e)).catch(()=>(a||c(""),!1));n();const i=()=>{a||(d(r,!0).then(()=>{a||s()}).catch(()=>{a||c("")}),u=e.timer?.timeout?.(i,2e4))};let u;return Promise.resolve(n()).then(t=>{!a&&t&&(u=e.timer?.timeout?.(i,2e4))}),()=>{a=!0,"function"==typeof u&&u()}},[t.sessionId]),""===i?null:r.createElement("div",{"data-testid":"subagent-models-dock","data-dsh-service-subagent-models-dock":!0,style:{boxSizing:"border-box",order:1,textAlign:"center",fontSize:"12px",lineHeight:"18px",color:"var(--dsh-svc-text-muted, var(--dsw-alias-label-secondary, #6b7280))",padding:"0 4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}},i)}}}({ctx:t,rpcCall:d,useTranslation:J}),ee=["overview","usage","quota","models","diagnostics","maintenance","configuration"],te={overview:"tabs.overview",usage:"tabs.usage",quota:"tabs.quota",models:"tabs.models",diagnostics:"tabs.health",maintenance:"tabs.maintenance",configuration:"tabs.configuration"},pe={usage:"modelUsage",quota:"quotaLookup",models:["modelCatalog","subagentRoute"],diagnostics:"healthDiagnostics"},ke=["sessions","skills","backup","restart"],Ee={sessions:"tabs.sessions",skills:"tabs.skills",subagent:"tabs.subagent",backup:"tabs.backup",restart:"tabs.restart"},Ce={sessions:"sessionManager",skills:"skillManager",subagent:"subagentRoute",backup:"backupMaintenance"},Te=e=>ke.filter(t=>void 0===Ce[t]||!1!==e[Ce[t]]).map(e=>({id:e,labelKey:Ee[e]})),qe=(e,t)=>{const a=Te(t);return 0===a.length?null:a.some(t=>t.id===e)?e:a[0].id},Ae=[{id:"features",labelKey:"tabs.features"},{id:"notifications",labelKey:"tabs.notifications"},{id:"navOrder",labelKey:"tabs.navOrder"}],ze={configuration:"page.configuration.desc"};function Me({title:e,description:t,action:a,secondary:s}){return r.createElement("header",{"data-testid":"svc-page-header",className:"dshsvc-page-header"},r.createElement("div",{className:"dshsvc-page-header-row"},r.createElement("h2",{className:"dshsvc-page-title",style:{margin:0,fontSize:"18px",fontWeight:700,lineHeight:1.4,color:"var(--dsh-svc-text)"}},e),null!=a?a:null,null!=s?r.createElement("div",{className:"dshsvc-page-secondary",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},s):null),t?r.createElement("p",{className:"dshsvc-page-desc",style:{margin:"2px 0 0",fontSize:"12px",color:"var(--dsh-svc-text-muted)",lineHeight:1.5}},t):null)}function Ie({items:e,activeId:t,onChange:a,testIdPrefix:s,variant:n,dotLabel:o,ariaLabel:l}){const i="sub"===n;return r.createElement("div",{role:"tablist","aria-label":l,className:i?"dshsvc-subtabs":"dshsvc-tabs","data-testid":s+"-list"},e.map(e=>{const n=e.id===t,l=i?n?{color:"var(--dsh-svc-brand)",borderBottom:"2px solid var(--dsh-svc-brand)",fontWeight:700}:null:n?{background:"var(--dsh-svc-tab-active-bg)",color:"var(--dsh-svc-tab-active-text)",fontWeight:650,borderRadius:"8px"}:null;return r.createElement("button",{key:e.id,type:"button",role:"tab","aria-selected":String(n),"data-testid":s+"-"+e.id,className:i?"dshsvc-subtab":"dshsvc-tab",style:l,onClick:()=>a(e.id)},void 0!==e.icon?r.createElement(le,{name:e.icon}):null,e.label,e.warning?r.createElement("span",{"data-testid":"tab-dot-"+e.id,"aria-label":o,style:{position:"absolute",top:"-3px",right:"-3px",width:"8px",height:"8px",..._("50%"),background:"var(--dsw-alias-state-warn-primary)",boxShadow:"0 0 0 2px var(--dsw-alias-bg-layer-1)"}}):null,e.badge?r.createElement("span",{"data-testid":e.badge.testid,style:{position:"absolute",top:"-7px",right:"-10px",fontSize:"9px",lineHeight:"14px",padding:"0 4px",..._("999px"),background:"var(--dsw-alias-state-warn-primary)",color:"var(--dsh-svc-brand-text)",fontWeight:700}},e.badge.text):null)}))}const{notifyState:Re,useNotifyState:Oe,NOTIFY_KIND_KEYS:He,fireNotification:De,subscribeBellVisible:Le}=function(){const{useState:e,useEffect:t}=r,a={current:{enabled:!1,done:!0,input:!0,bellVisible:!0}};try{a.current.enabled="true"===localStorage.getItem("dsh-service-notify")}catch(e){}try{a.current.done="false"!==localStorage.getItem("dsh-service-notify-done")}catch(e){}try{a.current.input="false"!==localStorage.getItem("dsh-service-notify-input")}catch(e){}try{a.current.bellVisible="false"!==localStorage.getItem("dsh-service-notify-bell")}catch(e){}const s=new Set,n=new Set,o=(e,t)=>{try{localStorage.setItem(e,t?"true":"false")}catch(e){}},l=()=>{for(const e of s)e()},i=e=>{a.current.bellVisible=!0===e,o("dsh-service-notify-bell",a.current.bellVisible),(()=>{for(const e of n)e()})()};return{notifyState:a,useNotifyState:()=>{const[,t]=e(0),[d,c]=e(a.current.enabled),[u,p]=e(a.current.done),[m,g]=e(a.current.input),[h,f]=e(a.current.bellVisible);return r.useEffect(()=>{const e=()=>{c(a.current.enabled),p(a.current.done),g(a.current.input),f(a.current.bellVisible),t(e=>e+1)};return s.add(e),n.add(e),()=>{s.delete(e),n.delete(e)}},[]),{enabled:d,done:u,input:m,bell:h,setEnabled:e=>{return t=e,a.current.enabled=t,o("dsh-service-notify",t),void l();var t},setDone:e=>{return t=e,a.current.done=t,o("dsh-service-notify-done",t),void l();var t},setInput:e=>{return t=e,a.current.input=t,o("dsh-service-notify-input",t),void l();var t},setBell:i}},NOTIFY_KIND_KEYS:{approval:"notification.kind.approval","plan-review":"notification.kind.plan-review",question:"notification.kind.question"},fireNotification:(e,t)=>{if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{const a=new Notification(e,{body:t});a.onclick=()=>{try{window.focus()}catch(e){}try{a.close()}catch(e){}}}catch(e){}},subscribeBellVisible:e=>(n.add(e),()=>n.delete(e))}}(),Ne=({storageKey:e,legacyStorageKey:r,sectionId:s,order:n,labelKey:l,feature:i,renderContent:d})=>{let c=!1;try{let t=localStorage.getItem(e);if(null===t&&void 0!==r){const a=localStorage.getItem(r);if(null!==a){try{localStorage.setItem(e,a)}catch(e){}t=a}}c="true"===t}catch(e){}let p=null;const m=new Set,g=()=>{p&&(p(),p=null),c&&(void 0===i||b(i))&&(p=t.slots.register({name:"settings.section",id:s,order:n,label:()=>u(l)},d))},h=t=>{c=!0===t;try{localStorage.setItem(e,c?"true":"false")}catch(e){}g(),"function"==typeof C&&C();for(const e of m)e()};return{sync:g,setEnabled:h,useEnabled:()=>{const[e,t]=a(c);return o(()=>{const e=()=>t(c);return m.add(e),t(c),()=>m.delete(e)},[]),[e,h]},disposeEntry:()=>{p&&(p(),p=null)}}},We=Ne({storageKey:"dsh-service-shortcut-restart",legacyStorageKey:"dsh-service-restart-nav",sectionId:"dsh-service-restart",order:499,labelKey:"nav.restart",renderContent:()=>r.createElement(Fe,null)}),Be=Ne({storageKey:"dsh-service-shortcut-quota",legacyStorageKey:"dsh-service-quota-nav",sectionId:"dsh-service-quota",order:498,labelKey:"tabs.quota",feature:"quotaLookup",renderContent:()=>r.createElement(ya,null)}),Pe=Ne({storageKey:"dsh-service-shortcut-models",legacyStorageKey:"dsh-service-models-nav",sectionId:"dsh-service-models",order:497,labelKey:"tabs.models",feature:["modelCatalog","subagentRoute"],renderContent:()=>r.createElement(Ra,{SubagentSection:ta})}),je=Ne({storageKey:"dsh-service-shortcut-sessions",legacyStorageKey:"dsh-service-sessions-nav",sectionId:"dsh-service-sessions",order:495,labelKey:"tabs.sessions",feature:"sessionManager",renderContent:()=>r.createElement(za,null)}),$e=()=>{try{if("function"==typeof t.get)return t.get("modelDirectories")}catch(e){}},_e={runningSessionIds:new Set},{RestartOverlay:Ve,RestartSection:Fe,compareSemver:Ue,fetchVersionSnapshot:Ke,refreshVersionSnapshot:Ge,startRecovery:Ye,useInstalledVersion:Qe,useRestartFlow:Je,useRuntimeEnv:Ze,isUpgradeInFlight:Xe,setUpgradeInFlight:et,getRuntimeEnvState:tt}=ve({ctx:t,rpcCall:d,t:u,useTranslation:J,restartNavToggle:We}),{QUOTA_KIND_OPTIONS:at,acquireQuotaLoop:rt,applyQuotaCardOrder:st,formatClockTime:nt,formatShortDate:ot,humanizeDuration:lt,subscribeQuotaCards:it,commitQuotaCards:dt,resetQuotaCards:ct,ensureQuotaCardsSynced:ut,quotaWindowDisplayLabel:pt,quotaWindowValueText:mt,readQuotaCardHidden:gt,readQuotaCardOrder:ht,releaseQuotaLoop:ft,quotaExtractBalance:bt,resolveBalanceBaseline:vt,setManualBalanceBaseline:yt,computeBalanceGaugeState:wt,fetchQuotaSnapshot:xt}=function({ctx:e,rpcCall:t,featureEnabled:a,getModelDirectories:s,sessionActivity:n,createSectionBackendSync:o,SETTINGS_NAV_MAX_ITEMS:l,formatCompactCount:i}){const{useState:d,useEffect:c}=r,u="dsh-service-quota-card-order",p="dsh-service-quota-card-hidden",m=(e,t)=>{try{const a=localStorage.getItem(e);if(!a)return t;const r=JSON.parse(a);return!Array.isArray(r)||r.length>l?t:r.every(e=>"string"==typeof e&&""!==e.trim()&&e.trim().length<=128)?r.map(e=>e.trim()):t}catch(e){return t}},g=()=>m(u,[]),h=()=>m(p,[]),f=e=>{try{null===e?localStorage.removeItem(u):localStorage.setItem(u,JSON.stringify(e.slice(0,l)))}catch(e){}},b=e=>{try{null===e||0===e.length?localStorage.removeItem(p):localStorage.setItem(p,JSON.stringify(e.slice(0,l)))}catch(e){}},v=new Set,y=()=>{for(const e of v)try{e()}catch(e){}},w=o({section:"quotaCards",readOrder:()=>g(),readHidden:()=>h(),writeLocal:(e,t)=>{f(e),b(t),y()}});let x=null,k=null;function E(e){return"all"===e?.scope?{scope:"all"}:{providers:Array.isArray(e?.providers)?[...new Set(e.providers.filter(e=>"string"==typeof e&&""!==e))].sort():[]}}async function C(a={providers:[]}){const r=E(a);return null!==x?(s=k,n=r,k="all"===s?.scope||"all"===n?.scope?{scope:"all"}:E({providers:[...s?.providers??[],...n?.providers??[]]}),x):(x=Promise.resolve().then(async()=>{try{const a=await t("quota",r);if(!0===a?.ok&&a.value&&"object"==typeof a.value&&Array.isArray(a.value.providers))return S.publish(a.value),function(t,a={providers:[]}){Array.isArray(t?.providers)&&t.providers.some(e=>!0===e.adapted&&!0===e.refreshing)&&0!==z.refs?null!==q.dispose||q.pulls>=A.length||(q.dispose=e.timer.timeout(()=>{q.dispose=null,C(a)},A[q.pulls]),q.pulls+=1):q.pulls=0}(a.value,r),!0}catch(e){}return!1}).finally(()=>{x=null;const e=k;k=null,null!==e&&C(e)}),x);var s,n}function T(){const e=s();if(void 0===e||"function"!=typeof e.directoryFor)return[];const t=[];for(const a of n.runningSessionIds)try{const r=e.directoryFor(a)?.store?.getSnapshot?.()?.current;"string"==typeof r?.provider&&""!==r.provider&&t.push(r.provider)}catch(e){}return[...new Set(t)]}const q={pulls:0,dispose:null},A=[800,2400,4800,8e3,12e3],z={refs:0,allRefs:0,running:!1};e.effect(()=>()=>{null!==q.dispose&&q.dispose()},"dsh-service quota snapshot disposal");const M="dsh-service-quota-balance-baseline";function I(){try{const e=localStorage.getItem(M);if(!e)return{};const t=JSON.parse(e);return null===t||"object"!=typeof t||Array.isArray(t)?{}:t}catch(e){return{}}}function R(e){try{e&&0!==Object.keys(e).length?localStorage.setItem(M,JSON.stringify(e)):localStorage.removeItem(M)}catch(e){}}return{QUOTA_KIND_OPTIONS:["opencode-go","zai-coding-cn","openrouter","kimi","siliconflow","deepseek","stepfun","stepfun-step-plan","xiaomi-token-plan-cn","cliproxy","command-goat","poe","clinepass","vercel-ai-gateway"],acquireQuotaLoop:function(e={}){a("quotaLookup")&&(z.refs+=1,!0===e.all&&(z.allRefs+=1),!0===e.all?C({scope:"all"}):function(){if(!a("quotaLookup")||0===z.refs||!0===z.running)return;const e=z.allRefs>0?{scope:"all"}:{providers:T()};"all"!==e.scope&&0===e.providers.length||(z.running=!0,Promise.resolve(C(e)).catch(()=>!1).then(()=>{z.running=!1}))}())},applyQuotaCardOrder:function(e,t){const a=new Map(t.map((e,t)=>[e,t]));return e.map((e,r)=>({row:e,key:a.has(e.provider)?a.get(e.provider):t.length+r})).sort((e,t)=>e.key-t.key).map(e=>e.row)},formatClockTime:function(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})}catch(e){return""}},formatShortDate:function(e){const t=new Date(e),a=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${a(t.getMonth()+1)}-${a(t.getDate())}`},humanizeDuration:function(e,t){const a=Math.max(0,Math.floor(e/6e4)),r=Math.floor(a/1440),s=Math.floor(a%1440/60),n=a%60,o=[];return r>0&&o.push(t("quota.unit.day",{count:r})),s>0&&o.push(t("quota.unit.hour",{count:s})),n>0&&o.push(t("quota.unit.minute",{count:n})),0===o.length&&o.push(t("quota.unit.minute",{count:0})),o.slice(0,2).join(" ")},subscribeQuotaCards:e=>(v.add(e),()=>v.delete(e)),commitQuotaCards:(e,t)=>{f(e),b(t),y(),w.persist(e,t)},resetQuotaCards:()=>{f(null),b(null),y(),w.persistReset()},ensureQuotaCardsSynced:()=>w.ensureSynced(),quotaWindowDisplayLabel:function(e,t){const a="string"==typeof e.kindKey&&""!==e.kindKey,r=a?e.kindKey:e.id;let s=t(`quota.window.${r}`);if(s===`quota.window.${r}`)if(a){const a=t(`quota.window.${e.id}`);s=a!==`quota.window.${e.id}`?a:r}else s=function(e,t){const a=t(`quota.window.${e}`);if(a!==`quota.window.${e}`)return a;const r=String(e).split("-"),s=r.length>=2?`${r[0]}-${r[1]}`:r[0],n=t(`quota.window.${s}`);return n===`quota.window.${s}`?e:n}(e.id,t);const n="string"==typeof e.label?e.label.trim():"";return""!==n?`${n} · ${s}`:s},quotaWindowValueText:function(e){const t=`${e.percent}%`,a=Number(e.used),r=Number(e.limit);return!Number.isFinite(a)||!Number.isFinite(r)||r<=0?t:"usd"===e.unit?`${t} · $${a.toFixed(2)} / $${r.toFixed(2)}`:`${t} · ${i(a,{billions:!0})} / ${i(r,{billions:!0})}`},readQuotaCardHidden:h,readQuotaCardOrder:g,releaseQuotaLoop:function(e={}){(a("quotaLookup")||0!==z.refs)&&(z.refs=Math.max(0,z.refs-1),!0===e.all&&(z.allRefs=Math.max(0,z.allRefs-1)),z.refs>0||null!==q.dispose&&(q.dispose(),q.dispose=null))},quotaExtractBalance:function(e){if(!Array.isArray(e)||0===e.length)return null;const t=e.find(e=>"balance"===e.kindKey)||e.find(e=>"string"==typeof e.id&&e.id.startsWith("balance"))||e.find(e=>"string"==typeof e.text&&/^[¥$€£]|\b(CNY|USD|EUR|GBP)\b/.test(e.text));if(!t||"string"!=typeof t.text)return null;const a=t.text.trim();let r="CNY",s="¥";a.startsWith("$")||"USD"===t.label||a.toUpperCase().includes("USD")?(r="USD",s="$"):a.startsWith("€")||"EUR"===t.label||a.toUpperCase().includes("EUR")?(r="EUR",s="€"):(a.startsWith("£")||"GBP"===t.label||a.toUpperCase().includes("GBP"))&&(r="GBP",s="£");const n=a.replace(/[^0-9.]/g,""),o=Number(n);return Number.isFinite(o)?{amount:o,currency:r,symbol:s,rawText:a,window:t}:null},resolveBalanceBaseline:function(e,t,a){if("string"!=typeof e||""===e||!Number.isFinite(t))return null;const r="USD"===a?5:20,s=I(),n=s[e];let o=r;if(n&&"number"==typeof n.baseline&&Number.isFinite(n.baseline)){o=n.baseline;const a="number"==typeof n.lastBalance?n.lastBalance:o;t>o||t>a+.5?(o=Math.max(t,r),s[e]={baseline:o,lastBalance:t,updatedAt:Date.now()},R(s)):Math.abs(t-a)>.001&&(s[e]={...n,lastBalance:t,updatedAt:Date.now()},R(s))}else o=Math.max(t,r),s[e]={baseline:o,lastBalance:t,updatedAt:Date.now()},R(s);return o},setManualBalanceBaseline:function(e,t,a){if("string"!=typeof e||""===e||!Number.isFinite(t)||t<=0)return null;const r=Math.round(100*t)/100,s=I();return s[e]={baseline:r,lastBalance:t,updatedAt:Date.now()},R(s),r},computeBalanceGaugeState:function(e,t,a){const r=Number.isFinite(t)&&t>0?t:"USD"===a?5:20,s=e/r*100,n=Math.min(100,Math.max(0,Math.round(s))),o="USD"===a?e<=.5:e<=2,l="USD"===a?e>=10:e>=50;let i="high",d="var(--dsw-alias-state-success-primary)";return e<=0||o?(i="low",d="var(--dsw-alias-state-error-primary)"):n<20?l?(i="mid",d="var(--dsw-alias-state-warn-primary)"):(i="low",d="var(--dsw-alias-state-error-primary)"):n<50?(i="mid",d="var(--dsw-alias-state-warn-primary)"):(i="high",d="var(--dsw-alias-state-success-primary)"),{ratio:n,gear:i,color:d,needleAngle:n/100*180-90,baseline:r,isExtremeLow:o,isComfortableHigh:l}},fetchQuotaSnapshot:C}}({ctx:t,rpcCall:d,featureEnabled:b,getModelDirectories:$e,sessionActivity:_e,createSectionBackendSync:w,SETTINGS_NAV_MAX_ITEMS:x,formatCompactCount:m});!function({ctx:e,sessionActivity:t,t:a,featureEnabled:r,featureScope:s,notifyState:n,fireNotification:o,NOTIFY_KIND_KEYS:l}){if(e.sessions&&"function"==typeof e.sessions.list?.subscribe){const i=new Map;let d=!1,c=null,u=null;const p=t=>{if(null!=t&&void 0!==t.uiSession)return t.uiSession;try{if("function"==typeof e.get)return e.get("uiSession")}catch(e){}};let m,g=null;const h=new Map;let f=!1,b=null,v=null;const y=()=>{null!==b&&(b(),b=null),null!==v&&(v(),v=null),h.clear(),f=!1},w=()=>m??p(),x=()=>{const s=e.sessions.list.getSnapshot();if(s&&s.byId)if(t.runningSessionIds=new Set(Object.entries(s.byId).filter(([,e])=>!0===e.running).map(([e])=>e)),d){for(const[e,t]of Object.entries(s.byId)){const s={running:!0===t.running},l=i.get(e);void 0!==l&&l.running&&!s.running&&"subagent"!==t.origin&&r("taskNotifications")&&n.current.enabled&&n.current.done&&o(a("notification.doneTitle"),a("notification.doneBody",{title:t.displayTitle||e})),i.set(e,s)}for(const e of[...i.keys()])e in s.byId||i.delete(e)}else{d=!0;for(const[e,t]of Object.entries(s.byId))i.set(e,{running:!0===t.running})}},k=()=>{const t=w();if(!t||"function"!=typeof t.sessionStatus?.subscribe)return;const s=t.sessionStatus.getSnapshot();if(s&&"function"==typeof s.entries)if(f){for(const[t,i]of s.entries()){const s={pending:void 0!==i?.pendingInteraction},d=h.get(t);if(void 0!==d&&!d.pending&&s.pending&&r("taskNotifications")&&n.current.enabled&&n.current.input){const r=l[i.pendingInteraction.kind],s=r?a(r):String(i.pendingInteraction.kind),n=e.sessions.list.getSnapshot().byId[t];o(a("notification.inputTitle"),a("notification.inputBody",{title:n?.displayTitle||t,kind:s}))}h.set(t,s)}for(const e of[...h.keys()])s.has(e)||h.delete(e)}else{f=!0;for(const[e,t]of s.entries())h.set(e,{pending:void 0!==t?.pendingInteraction})}},S=()=>{null!==c&&(c(),c=null),null!==u&&(u(),u=null),y(),i.clear(),d=!1,t.runningSessionIds=new Set},E=()=>{const t=w();t&&"function"==typeof t.sessionStatus?.subscribe&&r("taskNotifications")?null===b&&(b=t.sessionStatus.subscribe(()=>k()),v=e.on("connection/reset",()=>{h.clear(),f=!1}),k()):null!==b&&y()},C=()=>{r("taskNotifications")||r("quotaLookup")?(null===c&&(c=e.sessions.list.subscribe(()=>x()),u=e.on("connection/reset",()=>{i.clear(),d=!1}),x()),E()):S()};"function"==typeof e.inject&&(g=e.inject(["uiSession"],e=>(y(),m=p(e),E(),()=>{m=void 0,y()}))),C();const T=s.subscribe(C);e.effect(()=>()=>{if(T(),"function"==typeof g)try{g()}catch(e){}S()},"dsh-service: shared session observation")}}({ctx:t,sessionActivity:_e,t:u,featureEnabled:b,featureScope:g,notifyState:Re,fireNotification:De,NOTIFY_KIND_KEYS:He});const kt=Object.assign(Object.create(null),{deepseek:{segments:[[540,720],[840,1080]],captionKey:"quota.peak.caption",holidays:!0},"zai-coding-cn":{segments:[[840,1080]],captionKey:"quota.peak.caption.zai",holidays:!1}}),St="#f0952f",Et="var(--dsw-alias-state-success-primary)",Ct=3e4,Tt=(()=>{let e=0;const t=Array.isArray(n?.years)?n.years:[];for(const a of t){const t=Number(a);Number.isFinite(t)&&t>e&&(e=t)}return 0===e?8:Math.max(8,Math.ceil((new Date(Date.UTC(e,11,31)).getTime()-Date.now())/864e5)+8)})(),qt=new Set(Array.isArray(n?.years)?n.years.map(e=>String(e)):[]),At=n?.offDays&&"object"==typeof n.offDays?n.offDays:{};function zt(e){const t=new Date(e+288e5),a=e=>String(e).padStart(2,"0");return`${t.getUTCFullYear()}-${a(t.getUTCMonth()+1)}-${a(t.getUTCDate())}`}function Mt(e){return qt.has(e)}function It(e,t){const a=function(e){const t=new Date(e+288e5);return{dayIndex:t.getUTCDay(),minutesOfDay:60*t.getUTCHours()+t.getUTCMinutes()}}(t);if(0===a.dayIndex||6===a.dayIndex)return!1;if(!0===e.holidays){const e=zt(t);if(Mt(e.slice(0,4))&&function(e){return"string"==typeof At[e]}(e))return!1}return e.segments.some(([e,t])=>a.minutesOfDay>=e&&a.minutesOfDay<t)}function Rt(e){const t=new Date(e+288e5),a=e=>String(e).padStart(2,"0");return`${a(t.getUTCHours())}:${a(t.getUTCMinutes())}`}function Ot(e,t){return!1===Array.isArray(t)||0===t.length?null:kt[e?.kind]??null}function Ht({showCaption:e,schedule:s}){const n=J(),[l,i]=a(Date.now());o(()=>{let e=!1,a=null;const r=()=>{e||(a=t.timer.timeout(()=>{i(Date.now()),r()},Ct))};return r(),()=>{e=!0,null!=a&&a()}},[]);const d=It(s,l),c=function(e,t){const a=new Date(t+288e5);a.setUTCHours(0,0,0,0);const r=a.getTime()-288e5,s=e.segments.flat(),n=[];let o=It(e,t);for(let a=0;a<=Tt&&n.length<2;a++){const l=r+864e5*a,i=s.map(e=>l+6e4*e);i.push(l+864e5);for(const a of i){if(a<=t)continue;const r=It(e,a);if(r!==o&&(n.push(a),o=r,n.length>=2))return n}}return n}(s,l),u=c[0]??null,p=d?St:Et,m=n(d?"quota.peak.nowPeak":"quota.peak.nowIdle"),g=zt(l),h=!0===s.holidays&&!Mt(g.slice(0,4)),f=e=>Math.round(e/1440*1e6)/1e4;return r.createElement("div",{"data-testid":"quota-peak-timeline",style:{display:"flex",flexDirection:"column",gap:"4px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",minHeight:"16px"}},r.createElement("span",{"data-testid":"quota-peak-state","data-in-peak":String(d),style:{display:"inline-flex",alignItems:"center",gap:"5px",fontSize:"12px",lineHeight:"16px",color:p,whiteSpace:"nowrap",flexShrink:0}},r.createElement("span",{style:{width:"7px",height:"7px",..._("50%"),background:p,flexShrink:0}}),m),null!==u?r.createElement("span",{"data-testid":"quota-peak-next",style:{marginLeft:"auto",fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"}},n(d?"quota.peak.untilIdle":"quota.peak.untilPeak",{time:Rt(u),dur:lt(u-l,n)})):null),r.createElement("div",{"data-testid":"quota-peak-bar",style:{position:"relative",height:"14px",..._(999),overflow:"hidden",background:"var(--dsw-alias-interactive-bg-hover)"}},(c.length>0?[{peak:d,weight:c[0]-l},...c.length>1?[{peak:!d,weight:c[1]-c[0]}]:[]]:[{peak:d,weight:1}]).map((e,t,a)=>{const s=a.reduce((e,t)=>e+t.weight,0),o=f(e.weight/s*1440);return r.createElement("span",{key:t,"data-testid":`quota-peak-segment-${t}`,"data-peak":String(e.peak),style:{position:"absolute",top:0,bottom:0,left:`${0===t?0:f(a[0].weight/s*1440)}%`,width:`${o}%`,background:e.peak?St:Et,overflow:"hidden"}},o>=11?r.createElement("span",{style:{position:"absolute",inset:0,textAlign:"center",fontSize:"9px",lineHeight:"14px",fontWeight:500,color:"rgba(255,255,255,0.95)"}},n(e.peak?"quota.peak.tag.peak":"quota.peak.tag.idle")):null)}),r.createElement("span",{"data-testid":"quota-peak-now",style:{position:"absolute",top:0,bottom:0,left:0,width:"3px",borderRadius:"3px",background:"var(--dsw-specific-menu)"}})),!0===e?r.createElement("div",{"data-testid":"quota-peak-caption",style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",marginTop:"2px"}},n(s.captionKey)):null,!0===e&&h?r.createElement("div",{"data-testid":"quota-peak-caption-degraded",style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",marginTop:"2px"}},n("quota.peak.caption.degraded",{year:g.slice(0,4)})):null)}function Dt(e){if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;const a=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T23:59:59.999`:t);return Number.isFinite(a)?a:null}function Lt(e,t){const a="string"==typeof e.expiresAt&&""!==e.expiresAt.trim()?e.expiresAt.trim():"",r=Dt(a),s=null!==r&&r<Date.now();let n="";if(""!==a){let e=a;null!==r&&(e=a.length>10?`${ot(r)} ${nt(r)}`:ot(r),e=s?`${e} ${t("quota.resetCard.expired")}`:t("quota.resetCard.expires",{date:e})),n=e}const o="string"==typeof e.label&&""!==e.label?` · ${e.label}`:"";return{expired:s,title:`${t("quota.resetCard.title")}${o}`,expiry:n,iconColor:s?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",textColor:s?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-secondary)"}}function Nt(e,t=Date.now()){return(Array.isArray(e)?e:[]).map((e,a)=>{const r=Dt(e?.expiresAt);return{card:e,index:a,key:null!==r&&r>=t?r:Number.POSITIVE_INFINITY}}).sort((e,t)=>e.key-t.key||e.index-t.index).map(e=>e.card)}function Wt(e,t){const a="string"==typeof e?.errorCode?e.errorCode:"",r=a.indexOf(":"),s=-1===r?a:a.slice(0,r),n=-1===r?"":a.slice(r+1),o=[/^\d{3}$/.test(n)?`HTTP ${n}`:void 0,"string"==typeof e?.errorEndpoint&&""!==e.errorEndpoint?e.errorEndpoint:void 0,"string"==typeof e?.errorAccount&&""!==e.errorAccount?e.errorAccount:void 0,"string"==typeof e?.errorDetail&&""!==e.errorDetail?e.errorDetail:void 0].filter(e=>void 0!==e),l=!0===e?.manualOnly?` · ${t("quota.manualOnly")}`:"number"==typeof e?.nextAllowedAt&&e.nextAllowedAt>Date.now()?` · ${t("quota.retryAt",{time:nt(e.nextAllowedAt)})}`:"";return`${function(e,t){const a=`quota.error.${e}`,r=t(a);return r===a?t("quota.error.unknown"):r}(s,t)}${o.length>0?` (${o.join(" · ")})`:""}${l}`}function Bt(e,t,a){const s=null!=a,n=pt(e,t),o={color:"var(--dsw-alias-label-secondary)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},l={color:"var(--dsw-alias-label-primary)",fontWeight:500,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",flexShrink:0};let i=null;if("string"==typeof e.resetsAt){const n=Date.parse(e.resetsAt);Number.isFinite(n)&&n>Date.now()&&(i=r.createElement("div",{"data-testid":s?`quota-card-reset-${a}-${e.id}`:`quota-reset-${e.id}`,style:{fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)"}},t("quota.resetIn",{time:lt(n-Date.now(),t)})))}return"string"==typeof e.text?r.createElement("div",{key:e.id,...s?{"data-testid":`quota-card-window-${a}-${e.id}`}:{}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"10px",fontSize:"12px",lineHeight:"18px"}},r.createElement("span",{style:o,title:n},n),r.createElement("span",{"data-testid":s?`quota-card-text-${a}-${e.id}`:`quota-text-${e.id}`,style:l},e.text)),i):r.createElement("div",{key:e.id,...s?{"data-testid":`quota-card-window-${a}-${e.id}`}:{}},r.createElement("div",{"data-value":e.percent,style:{display:"flex",justifyContent:"space-between",gap:"10px",fontSize:"12px",lineHeight:"18px"}},r.createElement("span",{style:o,title:n},n),r.createElement("span",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0}},r.createElement("span",{style:l},mt(e)),!0===e.stale?r.createElement("span",{"data-testid":s?`quota-card-stale-${a}-${e.id}`:`quota-stale-${e.id}`,title:t("quota.window.staleTip"),style:he("warning",{padding:"1px 7px",flexShrink:0})},t("quota.window.stale")):null)),function(e,t,a,s){const n=!0===s?t<=20:t>=80;return r.createElement("div",{"data-testid":e,style:{height:"4px",..._(999),background:"var(--dsw-alias-interactive-bg-hover)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:`${Math.max(0,Math.min(100,t))}%`,..._(999),background:n?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)"}}))}(s?`quota-card-bar-${a}-${e.id}`:`quota-window-bar-${e.id}`,e.percent,0,!0===e.remaining),i)}let Pt=null;try{const t=e("react-dom");null!=t&&"function"==typeof t.createPortal&&(Pt=t.createPortal)}catch(e){Pt=null}function jt(){if("undefined"==typeof window||null===window)return!1;if("function"==typeof window.matchMedia){const e=window.matchMedia("(max-width: 1023px)");return"boolean"==typeof e.matches&&e.matches}return"number"==typeof window.innerWidth&&window.innerWidth<=1023}const $t=["gemini","claude","codex"];function _t(e){const t=String(e?.kindKey?e.kindKey:e?.id??"").toLowerCase();return t.includes("gemini")?"gemini":t.includes("claude")||t.includes("gpt-oss")?"claude":t.includes("codex")||t.includes("chatgpt")?"codex":"other"}function Vt(e){const t=new Map;for(const a of e){const e=_t(a),r=t.get(e)||[];r.push(a),t.set(e,r)}const a=[];for(const e of[...$t,"other"]){const r=t.get(e);r&&r.length>0&&a.push({family:e,windows:r})}return a}function Ft(e){const{balanceInfo:t,gaugeState:s,onCalibrate:n,translate:o}=e,[l,i]=a(!1),d=s.needleAngle,c=`${t.symbol}${s.baseline.toFixed(2)}`,u=t.rawText;return r.createElement("div",{"data-testid":"quota-big-fuel-gauge",style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"8px",marginBottom:"8px",padding:"10px 4px 8px",borderRadius:"10px",background:"var(--dsw-alias-surface-l1, rgba(127, 127, 127, 0.05))",border:"1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.1))"}},r.createElement("svg",{viewBox:"0 0 180 96",width:"180",height:"96",style:{overflow:"visible",display:"block"},"aria-hidden":!0},r.createElement("path",{d:"M 25 82 A 65 65 0 0 1 155 82",fill:"none",stroke:"var(--dsw-alias-border-l2)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("path",{d:"M 25 82 A 65 65 0 0 1 37.4 43.8",fill:"none",stroke:"var(--dsw-alias-state-error-primary)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("path",{d:"M 37.4 43.8 A 65 65 0 0 1 90 17",fill:"none",stroke:"var(--dsw-alias-state-warn-primary)",strokeWidth:"7"}),r.createElement("path",{d:"M 90 17 A 65 65 0 0 1 155 82",fill:"none",stroke:"var(--dsw-alias-state-success-primary)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("text",{x:"18",y:"86",fontSize:"11",fontWeight:"700",fill:"var(--dsw-alias-state-error-primary)",textAnchor:"end"},"E"),r.createElement("text",{x:"162",y:"86",fontSize:"11",fontWeight:"700",fill:"var(--dsw-alias-state-success-primary)",textAnchor:"start"},"F"),r.createElement("line",{x1:"90",y1:"17",x2:"90",y2:"23",stroke:"var(--dsw-specific-menu)",strokeWidth:"1.5"}),r.createElement("circle",{cx:"90",cy:"82",r:"7",fill:"var(--dsw-alias-label-secondary)"}),r.createElement("g",{style:{transformOrigin:"90px 82px",transform:`rotate(${d}deg)`,transition:"transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1)"}},r.createElement("line",{x1:"90",y1:"82",x2:"90",y2:"26",stroke:"var(--dsw-alias-label-primary)",strokeWidth:"2.4",strokeLinecap:"round"}),r.createElement("circle",{cx:"90",cy:"27",r:"1.8",fill:s.color})),r.createElement("circle",{cx:"90",cy:"82",r:"3.5",fill:"var(--dsw-specific-menu)"})),r.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"-6px",gap:"2px"}},r.createElement("div",{"data-testid":"quota-gauge-balance-text",style:{fontSize:"20px",fontWeight:700,color:"var(--dsw-alias-label-primary)",lineHeight:"26px"}},u),r.createElement("div",{style:{fontSize:"11px",color:s.color,fontWeight:600}},o("quota.gauge.ratio",{percent:s.ratio})),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},r.createElement("span",null,`${o("quota.gauge.baseline")}: ${c}`),r.createElement("button",{type:"button","data-testid":"quota-gauge-calibrate-btn",title:o("quota.gauge.calibrateTip",{amount:u}),onClick:n,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{background:"none",border:"none",padding:"1px 4px",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",cursor:"pointer",textDecoration:l?"underline":"none"}},`[${o("quota.gauge.calibrate")}]`))))}function Ut(e){const s=J(),[n,i]=a(S.getSnapshot());o(()=>S.subscribe(()=>i(S.getSnapshot())),[]);const[d,c]=a(new Set),u=e=>c(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a}),[p,m]=a(!1),g=e&&e.directoryStore,h=e&&"string"==typeof e.sessionId&&""!==e.sessionId?e.sessionId:void 0,[f,b]=a(null),v=null!=g?g:f;o(()=>{if(null!=g)return;if(void 0===h)return;let e=!1,a=null;const r=[250,500,1e3,2e3,4e3,8e3,15e3],s=n=>{if(e)return;let o=null;try{o=$e()}catch(e){o=null}if(null==o||"function"!=typeof o.directoryFor)return;let l=null;try{l=o.directoryFor(h)}catch(e){l=null}if(null==l||void 0===l.store||null===l.store)n>=r.length||(a=t.timer.timeout(()=>{a=null,s(n+1)},r[n]));else{b(l.store);try{const e=l.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}};return s(0),()=>{e=!0,null!==a&&a()}},[g,h]),o(()=>{if(v)return rt(),ft},[v]);const[y,w]=a(v?v.getSnapshot():null);o(()=>{if(v)return w(v.getSnapshot()),v.subscribe(()=>w(v.getSnapshot()))},[v]),o(()=>{v&&(null===y||null==y?.current)&&e&&"function"==typeof e.loadDirectory&&e.loadDirectory()},[v,y,e&&e.loadDirectory]);const[x,k]=a(!1),E=l(null),C=l(null),[T,q]=a(jt);o(()=>{if("undefined"==typeof window||null===window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia("(max-width: 1023px)"),t=()=>q(e.matches);return t(),"function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t)}},[]);const[A,z]=a(!1),M=y?.current?.provider??null,I=y?.current?.model??null,R=null!==M?(n.providers||[]).find(e=>e.provider===M&&!0===e.adapted):null,O=Array.isArray(R?.windows)?R.windows:[],H="cliproxy"===R?.kind?function(e){if("string"!=typeof e||""===e.trim())return null;const t=e.trim().toLowerCase();return t.includes("claude")||t.includes("gpt-oss")?"claude":t.includes("gemini")?"gemini":t.includes("codex")||t.includes("gpt")||t.includes("chatgpt")||/(?:^|[-_/])o[134](?:[-_/]|$)/.test(t)?"codex":null}(I):null,D="claude"===H?"Claude":"gemini"===H?"Gemini":"codex"===H?"Codex":null,L=null!==H?O.filter(e=>function(e,t){return!t||_t(e)===t}(e,H)):O,N=L.length>0&&!A?L:O,W=(L.length>0?L:O).filter(e=>"number"==typeof e.percent),B=e=>!0===e.remaining?100-e.percent:e.percent,P=W.length>0?W.reduce((e,t)=>B(t)>B(e)?t:e,W[0]):null,j=null===P?bt(N):null,$=null!==j,[,V]=a(0),F=$?vt(M,j.amount,j.currency):0,U=$?wt(j.amount,F,j.currency):null;o(()=>{z(!1)},[M,I,x]);const K=l(new Set);o(()=>{if(null===M)return;const e=(n.providers||[]).find(e=>e.provider===M&&!0===e.adapted);(void 0===e||!1===Array.isArray(e.windows)&&!0!==e.refreshing&&void 0===e.errorCode)&&!K.current.has(M)&&(K.current.add(M),xt({providers:[M]}))},[M,n]),o(()=>{if(!x||"undefined"==typeof document)return;const e=e=>{E.current&&e.target instanceof Node&&E.current.contains(e.target)||C.current&&e.target instanceof Node&&C.current.contains(e.target)||k(!1)},t=e=>{"Escape"===e.key&&k(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[x]);const G=x&&T&&null!==Pt&&"undefined"!=typeof document&&null!==document.body&&void 0!==document.body,[Y,Q]=a(null);if(o(()=>{if(!x||!G)return;const e=()=>{if(E.current&&"function"==typeof E.current.getBoundingClientRect&&"undefined"!=typeof window)try{const e=E.current.getBoundingClientRect();e&&"number"==typeof e.top&&Number.isFinite(e.top)&&Q(Math.max(16,Math.round(window.innerHeight-e.top+8)))}catch(e){}};return e(),"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("resize",e),window.addEventListener("scroll",e,!0)),()=>{"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0))}},[x,G]),null==R)return null;const Z=null===P?0:P.percent,X=null!==P,ee=!X||!0===P.remaining,te=s(ee?"quota.panel.remaining":"quota.panel.used"),ae=$?U.color:(ee?Z<=20:Z>=80)?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",re=2*Math.PI*5.5,se=R?.displayName||M,ne=D?`${se} · ${D}`:se,oe=X?`${s("quota.ring.label")} · ${ne} · ${te} ${Z}%`:`${s("quota.ring.label")} · ${ne}`,le=void 0!==R.errorCode?r.createElement("div",{style:{marginTop:"8px",fontSize:"12px",lineHeight:"18px",color:"var(--dsw-alias-state-error-primary)"}},Wt(R,s)):null,ie=!0===R.refreshing||"number"==typeof R.fetchedAt?r.createElement("div",{style:{marginTop:"8px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},!0===R.refreshing?s("quota.refreshing"):s("quota.updated",{time:nt(R.fetchedAt)})):null,de=Ot(R,O),ce=r.createElement("button",{type:"button","data-testid":"quota-ring-trigger","aria-label":oe,"aria-haspopup":"dialog","aria-expanded":x,title:oe,onClick:()=>{const e=!x;if(e&&E.current&&"function"==typeof E.current.getBoundingClientRect&&"undefined"!=typeof window)try{const e=E.current.getBoundingClientRect();e&&"number"==typeof e.top&&Number.isFinite(e.top)&&Q(Math.max(16,Math.round(window.innerHeight-e.top+8)))}catch(e){}k(e),e&&xt({providers:null===M?[]:[M]})},style:{width:"28px",height:"28px",border:"none",..._("999px"),background:"transparent",cursor:"pointer",display:"grid",placeItems:"center",padding:0,color:"var(--dsw-alias-label-secondary)"}},$?r.createElement("svg",{viewBox:"0 0 20 20",width:"17",height:"17","aria-hidden":!0,style:{display:"block"}},r.createElement("path",{d:"M 3.8 15 A 7.5 7.5 0 1 1 16.2 15",fill:"none",stroke:"var(--dsw-alias-border-l3)",strokeWidth:"2.2",strokeLinecap:"round"}),r.createElement("path",{d:"high"===U.gear?"M 3.8 15 A 7.5 7.5 0 1 1 16.2 15":"mid"===U.gear?"M 3.8 15 A 7.5 7.5 0 0 1 10 3.0":"M 3.8 15 A 7.5 7.5 0 0 1 2.6 9.2",fill:"none",stroke:U.color,strokeWidth:"2.2",strokeLinecap:"round"}),r.createElement("circle",{cx:"10",cy:"10.5",r:"2.0",fill:U.color}),r.createElement("line",{x1:"10",y1:"10.5",x2:"high"===U.gear?"13.9":"mid"===U.gear?"10":"6.1",y2:"high"===U.gear?"8.25":"mid"===U.gear?"5.5":"12.8",stroke:U.color,strokeWidth:"2.0",strokeLinecap:"round"})):r.createElement("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0},r.createElement("circle",{cx:"7",cy:"7",r:5.5,fill:"none",stroke:"var(--dsw-alias-border-l3)",strokeWidth:"2"}),r.createElement("circle",{cx:"7",cy:"7",r:5.5,fill:"none",stroke:ae,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${re*Z/100} ${re}`,transform:"rotate(-90 7 7)"}))),ue=x?r.createElement("div",{ref:C,role:"dialog","aria-label":s("quota.panel.title"),"data-testid":"quota-ring-panel",style:G?{position:"fixed",left:"50%",bottom:(null!==Y?Y:80)+"px",transform:"translateX(-50%)",zIndex:1e3,boxSizing:"border-box",width:"min(280px, calc(100vw - 32px))",maxHeight:`min(560px, calc(100dvh - ${(null!==Y?Y:80)+16}px))`,overflowY:"auto",padding:"12px",borderRadius:"12px",background:"var(--dsw-specific-menu)",border:"1px solid var(--dsw-alias-border-inverted)",boxShadow:"var(--dsw-shadow-lv3)"}:{position:"absolute",bottom:"calc(100% + 8px)",right:0,zIndex:100,boxSizing:"border-box",width:"max-content",minWidth:"240px",maxWidth:"min(480px, calc(100vw - 32px))",padding:"12px",borderRadius:"12px",background:"var(--dsw-specific-menu)",border:"1px solid var(--dsw-alias-border-inverted)",boxShadow:"var(--dsw-shadow-lv3)"}},r.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},te),r.createElement("span",{style:{marginLeft:"auto",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},ne)),...$?[r.createElement(Ft,{key:"panel-big-fuel-gauge",balanceInfo:j,gaugeState:U,onCalibrate:()=>{$&&M&&j&&null!==yt(M,j.amount,j.currency)&&V(e=>e+1)},translate:s})]:[],r.createElement("div",{style:{marginTop:$?"4px":"10px",display:"flex",flexDirection:"column",gap:"8px"}},(()=>{const e="cliproxy"!==R?.kind||!A&&null!==H?null:Vt(N);return e&&e.length>1?e.map((e,t)=>r.createElement("div",{key:`ring-family-${e.family}`,"data-testid":`quota-ring-family-${e.family}`,style:{display:"flex",flexDirection:"column",gap:"6px",marginTop:0===t?"0":"4px",paddingTop:0===t?"0":"8px",borderTop:0===t?"none":"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{"data-testid":`quota-ring-family-title-${e.family}`,style:{fontSize:"11px",fontWeight:600,color:"var(--dsw-alias-label-secondary)"}},s("quota.family."+e.family)),e.windows.map(e=>Bt(e,s,null)))):N.map(e=>Bt(e,s,null))})()),O.length>L.length&&L.length>0?r.createElement("div",{style:{marginTop:"6px",textAlign:"center"}},r.createElement("button",{type:"button","data-testid":"quota-ring-toggle-all",onClick:()=>z(!A),style:{fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"2px 6px",textDecoration:"underline"}},A?s("quota.filter.currentOnly"):s("quota.filter.showAll",{count:O.length}))):null,...null!==de?[r.createElement(Ht,{key:"panel-peak-timeline",showCaption:!1,schedule:de})]:[],...(()=>{const e=function(e,t=Date.now()){if(!Array.isArray(e)||0===e.length)return[];const a=[],r=new Map;for(const t of e){const e="string"==typeof t?.account?t.account.trim():"",s=""===e?"\0provider":e;let n=r.get(s);void 0===n&&(n=a.length,r.set(s,n),a.push({account:e,cards:[]})),a[n].cards.push(t)}for(const e of a)e.cards=Nt(e.cards,t);return a}(R.resetCards);return 0===e.length?[]:[r.createElement("div",{key:"panel-reset-cards","data-testid":"panel-reset-cards",style:{marginTop:"10px",paddingTop:"8px",borderTop:"1px solid var(--dsw-alias-border-l1)",display:"flex",flexDirection:"column",gap:"6px"}},"cliproxy"===R?.kind?r.createElement("button",{key:"panel-reset-title",type:"button","data-testid":"quota-panel-reset-title","aria-expanded":String(p),onClick:()=>m(!p),style:{display:"flex",alignItems:"center",alignSelf:"flex-start",fontSize:"11px",fontWeight:600,color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:0,textAlign:"left"}},`${p?"▾":"▸"} ${s("quota.resetCard.codexTitle")}`):null,..."cliproxy"!==R?.kind||p?e.map((t,a)=>{const n=d.has(`panel:${a}`),o=n?t.cards:t.cards.slice(0,1),l=t.cards.length-o.length,i=""!==t.account?t.account:s("quota.resetCard.title");return r.createElement("div",{key:`panel-reset-group-${a}`,"data-testid":`quota-panel-reset-group-${a}`,style:{display:"flex",flexDirection:"column",gap:"2px"}},e.length>1||""!==t.account?r.createElement("div",{"data-testid":`quota-panel-reset-owner-${a}`,title:i,style:{fontSize:"11px",color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i):null,o.map((e,t)=>{const n=Lt(e,s);return r.createElement("div",{key:`panel-reset-card-${t}`,"data-testid":`quota-panel-reset-card-${a}-${t}`,style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",lineHeight:"16px",color:n.textColor}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:n.iconColor,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0}},r.createElement("rect",{x:2,y:5,width:20,height:14,rx:2}),r.createElement("line",{x1:2,y1:10,x2:22,y2:10})),r.createElement("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},""!==n.expiry?`${n.title} · ${n.expiry}`:n.title))}),l>0?r.createElement("button",{type:"button","data-testid":`quota-panel-reset-more-${a}`,onClick:()=>u(`panel:${a}`),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},s("quota.resetCard.more",{count:l})):null,n&&t.cards.length>1?r.createElement("button",{type:"button","data-testid":`quota-panel-reset-less-${a}`,onClick:()=>u(`panel:${a}`),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},s("quota.resetCard.less")):null)}):[])]})(),le,ie):null;return r.createElement("span",{ref:E,style:{position:"relative",display:"inline-flex"}},ce,G?Pt(ue,document.body):ue)}function Kt(){const e=J(),{snapshot:t}=v(),[a,s]=r.useState(!1),n="ready"===t.status&&!0===t.writable;return r.createElement("li",{style:{listStyle:"none",border:"1px solid "+(a?"var(--dsw-alias-label-dimmed)":"var(--dsw-alias-border-l2)"),borderRadius:"12px",color:"var(--dsw-alias-label-primary)",background:a?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)"}},r.createElement("button",{type:"button","data-testid":"feature-card-toggle","aria-expanded":String(a),onClick:()=>s(!a),style:{appearance:"none",width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",border:0,borderRadius:"12px",background:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer"}},r.createElement("span",{style:{display:"flex",minWidth:0,flex:1,flexDirection:"column",gap:"4px"}},r.createElement("span",{style:{fontSize:"15px",fontWeight:600,lineHeight:1.4}},e("features.cardTitle")),r.createElement("span",{style:{fontSize:"13px",lineHeight:1.5,color:"var(--dsw-alias-label-tertiary)"}},e("features.cardHint"))),r.createElement("svg",{viewBox:"0 0 14 14",width:14,height:14,"aria-hidden":"true",style:{flex:"none",color:"var(--dsw-alias-label-tertiary)",transform:a?"rotate(180deg)":"none",transition:"transform .16s"}},r.createElement("path",{d:"M3 5.25 7 9l4-3.75",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"}))),a?r.createElement("div",{style:{margin:"0 16px",padding:"12px 0 8px",borderTop:"1px solid var(--dsw-alias-border-l2)"}},r.createElement(Yt,null),n?null:r.createElement("p",{style:{margin:"6px 0 0",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("features.readOnly"))):null)}const Gt=[["features.group.runtime",["healthDiagnostics","modelUsage","quotaLookup"],!0],["features.group.maintenance",["backupMaintenance","skillManager","subagentRoute","sessionManager","modelCatalog"],!0],["features.group.interaction",["taskNotifications","mobileAdaptation","modelProviderIcons","fileEditor"],!0],["features.external",["healthz"],!1]];function Yt(){const e=J(),{snapshot:t,value:s}=v(),[n,o]=a(""),l="ready"===t.status&&!0===t.writable,i=t=>r.createElement("div",{key:t,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"14px",padding:"7px 0"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},e("features."+t)),r.createElement("button",{type:"button",role:"switch","data-testid":"feature-switch-"+t,"aria-checked":String(!1!==s[t]),disabled:!l||n===t,onClick:async()=>{o(t);try{await g.set(t,!1===s[t])}catch(e){}o("")},style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(!1!==s[t]?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:!1!==s[t]?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:l&&""===n?"pointer":"default",opacity:l?1:.5,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:!1!==s[t]?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:!1!==s[t]?"#fff":"var(--dsw-alias-label-tertiary)"}})));return r.createElement("div",null,Gt.map(([t,a])=>r.createElement("div",{key:t,style:{marginTop:"10px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"2px"}},e(t)),a.map(i))))}function Qt(){const e=J(),[s,n]=a(A()),[i,d]=a(T()),[c,u]=a(!1),[p,m]=a(null),g=l(null),[,h]=a(0),f=()=>{u(!0),null!==g.current&&g.current(),g.current=t.timer.timeout(()=>{g.current=null,u(!1)},2e3)};o(()=>()=>{null!==g.current&&g.current(),g.current=null},[]),o(()=>{if("function"==typeof t.slots?.subscribe)return t.slots.subscribe("settings.section",()=>h(e=>e+1))},[]),o(()=>{const e=()=>{n(A()),d(T())};return E.add(e),()=>E.delete(e)},[]);const b=k(),v=new Map;for(const e of b){const t=e.options?.id??e.options?.key??"";t&&!v.has(t)&&v.set(t,{id:t,label:z(e.options),defaultOrder:e.options?.order??0})}let y=[];if(s&&s.length>0)for(const e of s)v.has(e)&&(y.push(v.get(e)),v.delete(e));const w=Array.from(v.values()).sort((e,t)=>e.defaultOrder-t.defaultOrder);y=y.concat(w);const x=(e,t)=>{if(e<0||t<0||e>=y.length||t>=y.length||e===t)return;const a=y.map(e=>e.id),[r]=a.splice(e,1);a.splice(t,0,r),n(a),I(a),C(),O(a,Array.isArray(i)?i:[])},S=new Set(Array.isArray(i)?i:[]);return r.createElement("div",{"data-testid":"config-nav-order-page",style:{display:"flex",flexDirection:"column",gap:"12px"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("div",{style:{minWidth:0,flex:"1 1 260px"}},r.createElement("div",{"data-testid":"nav-order-title",style:{fontSize:"14px",fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("config.navOrder.title"))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"}},c?r.createElement("span",{"data-testid":"nav-order-saved-tip",style:{fontSize:"12px",color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("config.navOrder.saved")):null,r.createElement("button",{type:"button","data-testid":"nav-order-reset",onClick:()=>{n(null),d([]),I(null),M(null),C(),f(),H()},style:me("ghost")},e("config.navOrder.reset")),r.createElement("button",{type:"button","data-testid":"nav-order-save",onClick:()=>{const e=y.map(e=>e.id);n(e),I(e),M(i),C(),f(),O(e,Array.isArray(i)?i:[])},style:me("primary")},e("config.navOrder.save")))),0===y.length?r.createElement("div",{style:{padding:"16px",textAlign:"center",color:"var(--dsw-alias-label-tertiary)",fontSize:"13px"}},e("config.navOrder.empty")):r.createElement("div",{"data-testid":"nav-order-list",style:{display:"flex",flexDirection:"column",gap:"8px"}},y.map((t,a)=>{const n="dsh-service"===t.id||!S.has(t.id),o="dsh-service"===t.id,l=p===a;return r.createElement("div",{key:t.id,"data-testid":"nav-order-item-"+t.id,draggable:!0,onDragStart:e=>{try{e.dataTransfer.setData("text/plain",String(a)),e.dataTransfer.effectAllowed="move"}catch(e){}m(a)},onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch(e){}},onDrop:e=>{e.preventDefault();let t=a;try{const a=e.dataTransfer.getData("text/plain");t=Number.parseInt(a,10)}catch(e){}Number.isNaN(t)||t===a||x(t,a),m(null)},onDragEnd:()=>m(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"9px 14px",borderRadius:"var(--dsh-svc-radius-control, 8px)",border:"1px solid "+(l?"var(--dsh-svc-brand)":"var(--dsw-alias-border-l1)"),background:l?"var(--dsw-alias-interactive-bg-hover)":"var(--dsh-svc-card-bg)",opacity:n?1:.5,transition:"border-color 120ms, background 120ms, opacity 120ms",cursor:"grab",userSelect:"none"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},r.createElement("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:"13px",cursor:"grab",letterSpacing:"-1px"},"aria-hidden":"true"},"⋮⋮"),r.createElement("span",{style:{fontSize:"13px",fontWeight:550,color:"var(--dsw-alias-label-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},t.label||t.id),r.createElement("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-tertiary)",fontFamily:"monospace"}},t.id),o?r.createElement("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"rgba(59,130,246,0.12)",color:"var(--dsh-svc-brand)",fontWeight:500}},e("config.navOrder.locked")):null),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}},r.createElement("button",{type:"button","data-testid":"nav-order-up-"+t.id,"aria-label":e("config.navOrder.moveUp"),title:e("config.navOrder.moveUp"),disabled:0===a,onClick:e=>{e.stopPropagation(),x(a,a-1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:0===a?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:0===a?"default":"pointer",opacity:0===a?.35:1,fontSize:"12px",lineHeight:"24px"}},"↑"),r.createElement("button",{type:"button","data-testid":"nav-order-down-"+t.id,"aria-label":e("config.navOrder.moveDown"),title:e("config.navOrder.moveDown"),disabled:a===y.length-1,onClick:e=>{e.stopPropagation(),x(a,a+1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:a===y.length-1?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:a===y.length-1?"default":"pointer",opacity:a===y.length-1?.35:1,fontSize:"12px",lineHeight:"24px"}},"↓"),r.createElement("button",{type:"button",role:"switch","data-testid":"nav-order-toggle-"+t.id,"aria-checked":String(n),"aria-label":e(n?"config.navOrder.visible":"config.navOrder.hidden"),title:e(o?"config.navOrder.locked":n?"config.navOrder.visible":"config.navOrder.hidden"),disabled:o,onClick:e=>{e.stopPropagation(),(e=>{if("dsh-service"===e)return;const t=Array.isArray(i)?i:[],a=new Set(t);a.has(e)?a.delete(e):a.add(e);const r=Array.from(a);d(r),M(r),C(),O(Array.isArray(s)?s:null,r)})(t.id)},style:{width:"34px",height:"20px",..._("10px"),padding:0,position:"relative",flexShrink:0,border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:o?"not-allowed":"pointer",opacity:o?.6:1,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 120ms ease"}}))))})))}const Jt=["inherit","follow","custom"],Zt="dsh-service-subagent-route-cache",Xt=e=>null!==e&&"object"==typeof e&&"string"==typeof e.provider&&"string"==typeof e.id;function ea(){try{const e=JSON.parse(localStorage.getItem(Zt)||"null");return null===e||"object"!=typeof e?null:Jt.includes(e.mode)&&Array.isArray(e.models)&&e.models.every(Xt)?{mode:e.mode,provider:"string"==typeof e.provider?e.provider:"",model:"string"==typeof e.model?e.model:"",reasoningEffort:"string"==typeof e.reasoningEffort?e.reasoningEffort:"",fallbacks:Array.isArray(e.fallbacks)?e.fallbacks:[],models:e.models,...null!==e.current&&"object"==typeof e.current?{current:e.current}:{},..."boolean"==typeof e.available?{available:e.available}:{}}:null}catch(e){return null}}function ta(){const e=J(),{useState:t,useEffect:a}=r,s=r.useRef(null);null===s.current&&(s.current={cached:ea()});const n=!1!==v().value.subagentModelsDock,o=s.current.cached,[l,i]=t(o),[c,u]=t(null!==o?o.mode:"inherit"),[p,m]=t(null!==o?o.provider:""),[h,f]=t(null!==o?o.model:""),[b,y]=t(!0),[w,x]=t(!1),[k,S]=t(0),[E,C]=t(""),[T,q]=t(null!==o?o.reasoningEffort:""),[A,z]=t(null!==o?o.fallbacks:[]),[M,I]=t(null!==o&&"string"==typeof o.preset?o.preset:""),[R,O]=t(!1),H={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},D={fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"},L=async()=>{y(!0);try{const e=await d("subagent-route",{});e.ok?(i(e.value),u(e.value.mode),z(Array.isArray(e.value.fallbacks)?e.value.fallbacks:[]),"string"==typeof e.value.provider&&m(e.value.provider),"string"==typeof e.value.model&&f(e.value.model),q("string"==typeof e.value.reasoningEffort?e.value.reasoningEffort:""),I("string"==typeof e.value.preset?e.value.preset:""),function(e){if(null!==e&&"object"==typeof e&&Jt.includes(e.mode)&&Array.isArray(e.models))try{localStorage.setItem(Zt,JSON.stringify({mode:e.mode,provider:"string"==typeof e.provider?e.provider:"",model:"string"==typeof e.model?e.model:"",reasoningEffort:"string"==typeof e.reasoningEffort?e.reasoningEffort:"",fallbacks:Array.isArray(e.fallbacks)?e.fallbacks:[],models:e.models.filter(Xt),...null!==e.current&&"object"==typeof e.current?{current:e.current}:{},..."boolean"==typeof e.available?{available:e.available}:{}}))}catch(e){}}(e.value),C("")):C(e.error||"unknown")}catch(e){C("network")}finally{y(!1)}};a(()=>{L()},[]);const N=null!==l&&Array.isArray(l.models)?l.models:[],W=[],B={};for(const e of N)void 0===B[e.provider]&&(B[e.provider]=e.providerName,W.push(e.provider));const P=e=>N.filter(t=>t.provider===e),j=e=>{const t=[],a=new Set;for(const r of e?.reasoning?.efforts??[]){if(null===r||"object"!=typeof r)continue;const e="string"==typeof r.id?r.id:"";""===e||a.has(e)||(a.add(e),t.push({id:e,name:"string"==typeof r.name&&""!==r.name?r.name:e,description:"string"==typeof r.description&&""!==r.description?r.description:void 0}))}return t},$=W.includes(p)?p:W[0]??"",V=P($),F=V.some(e=>e.id===h)?h:V[0]?.id??"",U=V.find(e=>e.id===F)??null,K=j(U),G=K.some(e=>e.id===T)?T:"",Y=(e,t)=>{z(a=>a.map((a,r)=>r===e?{...a,...t}:a))},Q=(e,t)=>{z(a=>{const r=e+t;if(r<0||r>=a.length)return a;const s=[...a],n=s.splice(e,1)[0];return s.splice(r,0,n),s})};a(()=>{R&&A.length<2&&O(!1)},[A.length]);const Z=async e=>{x(!0),C("");try{const t=("custom"===e||"follow"===e)&&A.length>0?{fallbacks:A}:{},a="custom"===e?{mode:"custom",provider:$,model:F,...""!==G?{reasoningEffort:G}:{},...t}:{mode:e,...t};!0===l?.presetSupported&&(a.preset=M);const r=await d("subagent-route-save",a);r.ok?(S(e=>e+1),await L()):C(r.error||"unknown")}catch(e){C("network")}finally{x(!1)}},X=be(),ee=(e,t,a,s)=>r.createElement("button",{type:"button","data-testid":e,disabled:t||w,onClick:a,style:{fontSize:"12px",lineHeight:"14px",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsh-svc-text)",cursor:t||w?"default":"pointer",opacity:t||w?.55:1}},s),te={fontSize:"12px",color:"var(--dsw-alias-label-secondary)",width:"88px",flexShrink:0};return r.createElement("div",{"data-testid":"subagent-section",style:X},r.createElement("div",{style:{fontSize:"14px",fontWeight:700}},e("subagent.title")),r.createElement("p",{style:H},e("subagent.hint")),r.createElement("div",{"data-testid":"subagent-dock-toggle-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"12px",padding:"10px 12px",border:"1px solid var(--dsh-svc-border)",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{flex:1,minWidth:0}},r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("subagent.dock.title"))),r.createElement("button",{type:"button",role:"switch","aria-checked":String(n),"data-testid":"subagent-dock-toggle",onClick:()=>{g.set("subagentModelsDock",!n).catch(()=>{})},style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 150ms ease"}}))),null!==l&&!1===l.available?r.createElement("p",{"data-testid":"subagent-unavailable",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.unavailable")):null,b&&null===l?r.createElement("p",{"data-testid":"subagent-loading",style:H},e("subagent.loading")):null,r.createElement("div",{"data-testid":"subagent-modes",style:{display:"flex",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},Jt.map(t=>r.createElement("button",{type:"button",key:t,"data-testid":"subagent-mode-"+t,"aria-pressed":String(c===t),disabled:b,onClick:()=>u(t),style:Object.assign({},ge(),{cursor:b?"default":"pointer",background:c===t?"var(--dsh-svc-tab-active-bg)":"transparent",color:c===t?"var(--dsh-svc-tab-active-text)":"var(--dsh-svc-text)",opacity:b?.55:1})},e("subagent.mode."+t)))),r.createElement("p",{"data-testid":"subagent-mode-desc",style:{...H,marginTop:"8px"}},e("subagent.mode."+c+".desc")),r.createElement("div",{"data-testid":"subagent-preset-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"10px",flexWrap:"wrap"}},r.createElement("span",{style:te},e("subagent.preset")),r.createElement("select",{"data-testid":"subagent-preset",value:M,disabled:b||w||!l?.presetSupported||0===(l?.presets??[]).length,onChange:e=>I(e.target.value),style:D},r.createElement("option",{value:""},e("subagent.preset.inherit")),...(l?.presets??[]).map(e=>r.createElement("option",{key:e.id,value:e.id,...e.broken?{disabled:!0}:{}},e.name?e.name+" ("+e.id+")":e.id))),l?.presetSupported&&0!==(l?.presets??[]).length?null:r.createElement("span",{"data-testid":"subagent-preset-empty",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("subagent.preset.empty"))),r.createElement("p",{"data-testid":"subagent-preset-desc",style:{...H,marginTop:"6px"}},e("subagent.preset.desc")),"custom"===c?r.createElement("div",{"data-testid":"subagent-custom",style:{marginTop:"8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.provider")),r.createElement("select",{"data-testid":"subagent-provider",value:$,disabled:0===W.length||w,onChange:e=>m(e.target.value),style:D},W.map(e=>r.createElement("option",{key:e,value:e},B[e]??e)))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.model")),r.createElement("select",{"data-testid":"subagent-model",value:F,disabled:0===V.length||w,onChange:e=>f(e.target.value),style:D},V.map(e=>r.createElement("option",{key:e.id,value:e.id},e.name??e.id)))),""!==F?r.createElement("div",{"data-testid":"subagent-reasoning-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px",flexWrap:"wrap"}},r.createElement("span",{style:te},e("subagent.reasoningEffort")),r.createElement("select",{"data-testid":"subagent-reasoning-effort",value:G,disabled:w||0===K.length,onChange:e=>q(e.target.value),style:D},r.createElement("option",{value:""},e("subagent.reasoningEffort.default")),...K.map(e=>r.createElement("option",{key:e.id,value:e.id,...void 0!==e.description?{title:e.description}:{}},e.name))),0===K.length?r.createElement("span",{"data-testid":"subagent-reasoning-effort-unavailable",style:{fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.reasoningEffort.unavailable")):null):null):null,"custom"!==c||0!==N.length||b?null:r.createElement("p",{"data-testid":"subagent-models-empty",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.modelsEmpty")),"custom"===c||"follow"===c?r.createElement("div",{"data-testid":"subagent-fallback-block",style:{marginTop:"14px",borderTop:"1px solid var(--dsh-svc-border)",paddingTop:"12px"}},r.createElement("div",{style:{fontSize:"13px",fontWeight:700}},e("subagent.fallback.title")),r.createElement("p",{style:H},e("subagent.fallback.hint")),0===A.length?r.createElement("p",{"data-testid":"subagent-fallback-empty",style:{...H,color:"var(--dsw-alias-label-secondary)"}},e("subagent.fallback.empty")):null,A.map((t,a)=>{const s=W.includes(t.provider),n=s?P(t.provider):[],o=n.find(e=>e.id===t.model)??null,l=j(o),i=l.map(e=>e.id);return r.createElement("div",{key:a,"data-testid":"subagent-fallback-row",style:{marginTop:"8px",border:"1px solid var(--dsh-svc-border)",borderRadius:"8px",padding:"7px 10px 8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"2px"}},r.createElement("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("subagent.fallback.item",{index:String(a+1)})),r.createElement("span",{style:{marginLeft:"auto"}}),((e,t,a,s,n=!1)=>r.createElement("button",{type:"button","data-testid":e,disabled:t||w,onClick:a,style:{fontSize:"12px",padding:"3px 8px",borderRadius:"6px",border:"1px solid "+(n?"var(--dsw-alias-state-error-primary)":"var(--dsh-svc-border-strong)"),background:"transparent",color:n?"var(--dsw-alias-state-error-primary)":"var(--dsh-svc-text)",cursor:t||w?"default":"pointer",opacity:t||w?.55:1}},s))("subagent-fallback-remove-"+a,!1,()=>(e=>{z(t=>t.filter((t,a)=>a!==e))})(a),e("subagent.fallback.remove"),!0),R?ee("subagent-fallback-up-"+a,0===a,()=>Q(a,-1),"▲"):null,R?ee("subagent-fallback-down-"+a,a===A.length-1,()=>Q(a,1),"▼"):null),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.provider")),r.createElement("select",{"data-testid":"subagent-fallback-provider-"+a,value:s?t.provider:"",disabled:w,onChange:e=>{const t=e.target.value;Y(a,{provider:t,model:P(t)[0]?.id??""})},style:D},r.createElement("option",{value:""},""),W.map(e=>r.createElement("option",{key:e,value:e},B[e]??e)))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.model")),r.createElement("select",{"data-testid":"subagent-fallback-model-"+a,value:n.some(e=>e.id===t.model)?t.model:"",disabled:0===n.length||w,onChange:e=>{const r=e.target.value,s=n.find(e=>e.id===r)??null,o=j(s).map(e=>e.id);Y(a,{model:r,..."string"!=typeof t.reasoningEffort||""===t.reasoningEffort||o.includes(t.reasoningEffort)?{}:{reasoningEffort:void 0}})},style:D},n.map(e=>r.createElement("option",{key:e.id,value:e.id},e.name??e.id)))),l.length>0?r.createElement("div",{"data-testid":"subagent-fallback-reasoning-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.reasoningEffort")),r.createElement("select",{"data-testid":"subagent-fallback-effort-"+a,value:i.includes(t.reasoningEffort)?t.reasoningEffort:"",disabled:w,onChange:e=>Y(a,{reasoningEffort:""===e.target.value?void 0:e.target.value}),style:D},r.createElement("option",{value:""},e("subagent.reasoningEffort.default")),...l.map(e=>r.createElement("option",{key:e.id,value:e.id,...void 0!==e.description?{title:e.description}:{}},e.name)))):r.createElement("span",{"data-testid":"subagent-fallback-effort-unavailable-"+a,style:{display:"inline-block",marginTop:"4px",fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.reasoningEffort.unavailable")))}),A.length>=10?r.createElement("p",{"data-testid":"subagent-fallback-limit",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.fallback.limit",{max:String(10)})):r.createElement("div",{style:{display:"flex",gap:"10px",marginTop:"8px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"subagent-fallback-add",disabled:w||0===W.length,onClick:()=>{z(e=>{if(e.length>=10)return e;const t=W[0]??"";return[...e,{provider:t,model:P(t)[0]?.id??""}]})},style:{fontSize:"12px",padding:"5px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px dashed var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsh-svc-text)",cursor:w||0===W.length?"default":"pointer",opacity:w||0===W.length?.55:1}},e("subagent.fallback.add")),A.length>1?r.createElement("button",{type:"button","data-testid":"subagent-fallback-sort",disabled:w,onClick:()=>O(e=>!e),style:{fontSize:"12px",padding:"5px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsh-svc-border-strong)",background:R?"var(--dsh-svc-tab-active-bg)":"transparent",color:R?"var(--dsh-svc-tab-active-text)":"var(--dsh-svc-text)",cursor:w?"default":"pointer",opacity:w?.55:1}},e(R?"subagent.fallback.sort.done":"subagent.fallback.sort")):null)):null,""!==E?r.createElement("p",{"data-testid":"subagent-error",style:{...H,color:"var(--dsw-alias-state-error-primary)"}},function(e,t){return"feature-disabled"===t?e("subagent.error.feature-disabled"):"llm-unavailable"===t?e("subagent.error.llm-unavailable"):"unknown-mode"===t?e("subagent.error.unknown-mode"):"invalid-model-route"===t?e("subagent.error.invalid-model-route"):"invalid-reasoning-effort"===t?e("subagent.error.invalid-reasoning-effort"):"network"===t?e("subagent.error.network"):t}(e,E)):null,k>0&&""===E?r.createElement("p",{"data-testid":"subagent-saved",style:{...H,color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("subagent.saved")):null,r.createElement("div",{style:{display:"flex",gap:"10px",marginTop:"12px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"subagent-save",disabled:w||b||"custom"===c&&(""===$||""===F),onClick:()=>{Z(c)},style:{fontSize:"12px",padding:"6px 16px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:w?"default":"pointer",opacity:w||b||"custom"===c&&(""===$||""===F)?.55:1}},e(w?"subagent.saving":"subagent.save")),"inherit"!==c?r.createElement("button",{type:"button","data-testid":"subagent-reset",disabled:w||b,onClick:()=>{u("inherit"),Z("inherit")},style:{fontSize:"12px",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:w?"default":"pointer",opacity:w||b?.55:1}},e("subagent.reset")):null))}const aa="dsh-service-skills-model",ra=(e,t)=>d(e,t);function sa(e){return e.provider+"\0"+e.id}function na(){try{const e=JSON.parse(localStorage.getItem(aa)||"null");if(e&&"string"==typeof e.provider&&"string"==typeof e.model)return e}catch(e){}return null}const oa=(e,t)=>{let a=function(e,t){const a="object"==typeof t&&null!==t?t:na();if(null!==a){const t=e.find(e=>e.provider===a.provider&&e.id===a.model);if(void 0!==t)return t}return e[0]??null}(e,na());return null===a&&void 0!==t&&(a=e.find(e=>e.provider===t.provider&&e.id===t.model)??null),a},{adoptSkillsBatchStatus:la,cancelSkillsBatchShared:ia,changeSkillsBatchModel:da,fetchSkillsBatchModels:ca,planSkillsBatchShared:ua,publishSkillsBatch:pa,skillsBatchListDirtyRef:ma,startSkillsBatchShared:ga,useSkillsBatch:ha}=function({ctx:e,rpcCall:t,featureEnabled:a,featureScope:s,currentUiLocale:n,SKILLS_MODEL_STORAGE_KEY:o,skillModelKey:l,resolveSkillModelChoice:i}){const{useState:d,useEffect:c}=r;let u=null,p=null,m=null,g=null,h="";const f={current:!1};let b=null,v=null,y=!1;const w="dsh-service-skills-batch-pending",x=new Set,k=()=>{for(const e of x)e()},S=e=>{try{e?localStorage.setItem(w,"true"):localStorage.removeItem(w)}catch(e){}},E=e=>{S("planned"===e||"running"===e)},C=()=>{null!==b&&(clearInterval(b),b=null)},T=(e=!0)=>{if(null!==u&&"running"===u.phase&&a("skillManager")&&null===b){const a=async()=>{try{const e=await t("skills-batch-status",{});if(!e.ok)return;const a=null!==u?u.phase:null;u=e.value,E(e.value.phase),"running"===a&&"running"!==e.value.phase&&(C(),f.current=!0),k()}catch(e){}};e&&a(),b=setInterval(()=>{a()},2e3)}},q=async()=>{if(null!==m)return m;try{const e=await t("skills-models",{});if(!e.ok)return m=[],m;m=e.value.models??[],null===g&&(g=i(m,e.value.current))}catch(e){m=[]}return m},A=()=>y?Promise.resolve(u):(null!==v||(v=(async()=>{try{const e=await t("skills-batch-status",{});e.ok&&(y=!0,E(e.value.phase),"idle"!==e.value.phase&&(u=e.value,T(!1),k()))}catch(e){}return u})().finally(()=>{v=null})),v);return e.effect(()=>{const e=s.subscribe(()=>{a("skillManager")||C()});return()=>{e(),C()}},"dsh-service skills batch polling lifecycle"),(()=>{try{return"true"===localStorage.getItem(w)}catch(e){return!1}})()&&A(),{adoptSkillsBatchStatus:A,cancelSkillsBatchShared:async()=>{try{await t("skills-batch-cancel",{}),S(!1)}catch(e){}},changeSkillsBatchModel:e=>{const t=(m??[]).find(t=>l(t)===e)??null;if(g=t,null!==t)try{localStorage.setItem(o,JSON.stringify({provider:t.provider,model:t.id}))}catch(e){}k()},fetchSkillsBatchModels:q,planSkillsBatchShared:async()=>{if(h="",k(),0===(await q()).length||null===g)return h="models-empty",k(),!1;try{localStorage.setItem(o,JSON.stringify({provider:g.provider,model:g.id}))}catch(e){}const e=await t("skills-batch-plan",{provider:g.provider,model:g.id});if(!e.ok)return h=e.error||"unknown",k(),!1;p={...e.value,modelItem:g};const a=Array.isArray(e.value.annotated)?e.value.annotated.length:0;return u={phase:"planned",total:e.value.candidates.length+a,done:0,failures:[],current:null,estBytes:e.value.estBytes,logs:[]},E("planned"),T(),k(),!0},publishSkillsBatch:k,skillsBatchListDirtyRef:f,startSkillsBatchShared:async(e=!1)=>{if(null===p||null===u)return!1;const a=await t("skills-batch-run",{planId:p.planId,lang:n(),...!0===e?{forceAnnotated:!0}:{}});return a.ok?(u={...u,phase:"running"},E("running"),T(),k(),!0):(h=a.error||"unknown",k(),!1)},useSkillsBatch:()=>{const[,e]=d(0);return c(()=>{const t=()=>e(e=>e+1);return x.add(t),()=>x.delete(t)},[]),{batch:u,plan:p,models:m,modelItem:g,error:h}}}}({ctx:t,rpcCall:d,featureEnabled:b,featureScope:g,currentUiLocale:p,SKILLS_MODEL_STORAGE_KEY:aa,skillModelKey:sa,resolveSkillModelChoice:oa}),fa=(e,t)=>{if(null===t||"object"!=typeof t)return String(t);const a=new Date(t.at),r=e=>String(e).padStart(2,"0"),s=Number.isFinite(a.getTime())?r(a.getHours())+":"+r(a.getMinutes())+":"+r(a.getSeconds()):"--:--:--",n="skills.log."+t.code,o=e(n,t.params??{});return"["+s+"]"+(void 0!==t.name?" ["+t.name+"]":"")+" "+(o===n?t.code:o)};function ba(e,t){if("models-empty"===t)return e("skills.describe.models.empty");if("llm-unavailable"===t)return e("skills.llm.unavailable");if("batch-already-running"===t)return e("skills.batch.already");if("feature-disabled"===t)return e("skills.error.feature-disabled");if("network"===t)return e("skills.error.network");if("read-only-source"===t)return e("skills.error.read-only-source");if("unknown-skill"===t)return e("skills.error.unknown-skill");if("invalid-field"===t)return e("skills.error.invalid-field");if("invalid-enable"===t)return e("skills.error.invalid-enable");if("invalid-model-route"===t)return e("skills.error.invalid-model-route");if("invalid-description"===t)return e("skills.error.invalid-description");if("describe-timeout"===t)return e("skills.error.describe-timeout");if("batch-cancelled"===t)return e("skills.error.batch-cancelled");if("entry-changed"===t)return e("skills.error.entry-changed");if("unknown-batch-plan"===t)return e("skills.error.unknown-batch-plan");if("batch-already-done"===t)return e("skills.error.batch-already-done");if("batch-already-cancelled"===t)return e("skills.error.batch-already-cancelled");if("annotated-confirm-required"===t)return e("skills.error.annotated-confirm-required");if("string"==typeof t&&t.startsWith("empty-output")){const a=t.slice(13);return e("skills.error.empty-output",{kind:""===a?"?":a})}return"string"==typeof t&&t.startsWith("invalid-skill")?e("skills.error.invalid-skill",{reason:t.startsWith("invalid-skill:")?t.slice(14):""}):e("skills.error",{error:t})}function va(){const e=J(),[t,s]=a(null),[n,l]=a(""),[i,d]=a(!0),[c,u]=a(""),[m,g]=a([]),[h,f]=a(null),[b,v]=a(null),[y,w]=a(!1),[x,k]=a([]),[S,E]=a(!1),[C,T]=a(!1),[q,A]=a(!1),[z,M]=a(!1),{batch:I,plan:R,models:O,modelItem:H,error:D}=ha(),L=null!==I?I.phase:null;o(()=>{E("running"===L)},[L]);const N=async()=>{d(!0);try{const e=await ra("skills-list",{});e.ok?(s(e.value),l("")):l(e.error||"unknown")}catch(e){l("network")}finally{d(!1)}};o(()=>{N(),la(),ca().then(pa)},[]),o(()=>{null===I||"done"!==I.phase&&"cancelled"!==I.phase||!ma.current||(ma.current=!1,N())},[null!==I&&I.phase]),o(()=>{if(null===b||!b.busy)return;const e=b.entry.id;let t;const a=async()=>{try{const t=await ra("skills-describe-log",{id:e});t.ok&&k(t.value.logs??[])}catch(e){}};return a(),t=setInterval(()=>{a()},800),()=>clearInterval(t)},[null!==b&&b.busy]),o(()=>{if(null===b||b.busy)return;const e=b.entry.id;(async()=>{try{const t=await ra("skills-describe-log",{id:e});t.ok&&k(t.value.logs??[])}catch(e){}})()},[null!==b&&b.busy]);const W=e=>{s(t=>null===t?t:{...t,entries:t.entries.map(t=>t.id===e.id?e:t)})};o(()=>{if(null===h)return;const e=setTimeout(()=>f(null),3e3);return()=>clearTimeout(e)},[h]),o(()=>{if(!q)return;const e=setTimeout(()=>A(!1),3e3);return()=>clearTimeout(e)},[q]),o(()=>{A(!1)},[L,R]);const B=async(e,t)=>{const a=e.id+":"+t;if(h!==a)return void f(a);f(null);const r="model"===t?!0!==e.invocation.model:!0!==e.invocation.user;try{const a=await ra("skills-toggle",{id:e.id,field:t,enable:r});a.ok?W(a.value.entry):l(a.error+(a.detail?":"+a.detail:"")||"unknown")}catch(e){l("network")}},P={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},j=(e,t)=>r.createElement("span",{key:e,style:he("warn"===t?"warning":"danger"===t?"danger":"neutral",{marginLeft:"6px",padding:"1px 7px",verticalAlign:"middle"})},e),$=(e,t)=>r.createElement("button",{type:"button",role:"switch","data-testid":t.testid,"aria-checked":String(e),title:t.title,disabled:t.disabled,onClick:t.onClick,style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",cursor:t.disabled?"default":"pointer",lineHeight:0,border:"1px solid "+(t.armed?"var(--dsw-alias-state-warn-primary)":e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:t.armed?"transparent":e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",opacity:t.disabled?.5:1}},r.createElement("span",{style:{position:"absolute",top:"1px",left:e&&!t.armed?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:t.armed?"var(--dsw-alias-state-warn-primary)":e?"#fff":"var(--dsw-alias-label-tertiary)"}})),V={border:"1px solid var(--dsh-alias-border-l2)",borderRadius:"10px",padding:"11px 13px",marginBottom:"8px",background:"var(--dsh-svc-card-bg)"},F=(t,a,s)=>0===a.length?null:r.createElement("div",{"data-testid":t,style:{marginTop:"9px",padding:"7px 10px",borderRadius:"7px",background:"var(--dsw-alias-bg-layer-3)",border:"1px solid var(--dsw-alias-border-l2)",maxHeight:"130px",overflowY:"auto"}},s?r.createElement("div",{style:{fontSize:"11px",fontWeight:700,color:"var(--dsw-alias-label-secondary)",marginBottom:"3px"}},e("skills.log.title")):null,...a.map((e,t)=>r.createElement("div",{key:t,style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",overflowWrap:"anywhere"}},e))),U=t=>{if(null===b)return null;const a=t??b.entry,{models:s,modelItem:n,draft:o,busy:l,error:i,applied:d}=b,c=null===o?null:[["description",void 0!==a.note?a.note.description:"",o.description],["usage",void 0!==a.note?a.note.usage:"",""===o.usage?null:o.usage]].map(([t,a,s])=>r.createElement("div",{key:t,"data-testid":"skill-diff-"+t,style:{marginBottom:"9px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"3px"}},e("skills.apply."+t)),r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)",textDecoration:"line-through",lineHeight:1.45}},e("skills.apply.old")+":"+(""===a?"—":a)),r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",lineHeight:1.45}},e("skills.apply.new")+":"+(null===s?e("skills.apply.keepusage"):s))));return r.createElement("div",{key:"skill-describe-"+a.id,"data-testid":"skill-describe-dialog",style:{border:"1px solid var(--dsw-alias-border-l1)",borderRadius:"12px",padding:"14px 16px",marginBottom:"14px",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px"}},r.createElement("div",{style:{fontSize:"14px",fontWeight:700}},e("skills.describe.title",{name:a.name})),r.createElement("button",{type:"button",onClick:()=>v(null),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"15px"}},"✕")),null===s&&""===i?r.createElement("p",{style:P},e("skills.describe.models.loading")):null,null!==s&&0===s.length?r.createElement("p",{style:P},e("skills.describe.models.empty")):null,null!==s&&s.length>0?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",flexWrap:"wrap"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.describe.model")),r.createElement("select",{"data-testid":"skill-describe-model",value:null===n?"":sa(n),onChange:e=>v(t=>null===t?t:{...t,modelItem:s.find(t=>sa(t)===e.target.value)??null}),style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"}},s.map(e=>r.createElement("option",{key:sa(e),value:sa(e)},e.providerName+" / "+e.name))),null===o?r.createElement("button",{type:"button","data-testid":"skill-describe-run",disabled:l||null===n,onClick:()=>{(async()=>{if(null===b||null===b.modelItem)return;const{entry:e,modelItem:t}=b;v(e=>({...e,busy:!0,error:""}));const a=await ra("skills-describe",{id:e.id,provider:t.provider,model:t.id,lang:p()});if(a.ok){try{localStorage.setItem(aa,JSON.stringify({provider:t.provider,model:t.id}))}catch(e){}v(e=>({...e,draft:a.value.draft,busy:!1}))}else v(e=>({...e,busy:!1,error:a.error+(a.detail?":"+a.detail:"")}))})()},style:Object.assign({},me("neutral"),{fontSize:"12px",minHeight:"28px",padding:"4px 12px",cursor:l?"default":"pointer",opacity:l||null===n?.55:1})},e(l?"skills.describe.running":"skills.describe.run")):null):null,""!==i?r.createElement("p",{"data-testid":"skill-describe-error",style:{...P,color:"var(--dsw-alias-state-error-primary)"}},ba(e,i)):null,F("skill-describe-log",x.map(t=>fa(e,t))),c,d?r.createElement("p",{"data-testid":"skill-apply-done",style:{...P,color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("skills.apply.done")):null,null===o||d?null:r.createElement("p",{"data-testid":"skill-note-disclaimer",style:{...P,fontSize:"11px"}},e("skills.note.panelOnly")),null===o||d?null:r.createElement("button",{type:"button","data-testid":"skill-apply-confirm",disabled:l,onClick:()=>{(async()=>{if(null===b||null===b.draft||null===b.modelItem)return;const{entry:e,draft:t,modelItem:a}=b;v(e=>({...e,busy:!0}));const r=await ra("skills-note-save",{id:e.id,patch:{description:t.description,usage:t.usage},model:a.provider+"/"+a.id});r.ok?(W(r.value.entry),v(e=>({...e,busy:!1,applied:!0}))):v(e=>({...e,busy:!1,error:r.error||"unknown"}))})()},style:{fontSize:"12px",padding:"6px 16px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:l?"default":"pointer",opacity:l?.55:1}},e("skills.apply.confirm")))},K=c.trim().toLowerCase(),G=null===t?[]:""===K?t.entries:t.entries.filter(e=>e.name.toLowerCase().includes(K)),Y=G.length>0&&G.every(e=>m.includes(e.id)),[Q,Z]=a(!1);return o(()=>{null===I||"running"!==I.phase&&"planned"!==I.phase||Z(!0)},[null!==I&&I.phase]),r.createElement("div",{"data-testid":"skills-section",style:be()},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("input",{"data-testid":"skills-filter",value:c,placeholder:e("skills.filter"),onChange:e=>u(e.target.value),style:{fontSize:"12px",padding:"6px 10px",borderRadius:"7px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"200px"}}),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"skills-expand-all","data-variant":"neutral",disabled:0===G.length,style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px",cursor:0===G.length?"default":"pointer",opacity:0===G.length?.55:1}),onClick:()=>(()=>{const e=G.map(e=>e.id);g(Y?t=>t.filter(t=>!e.includes(t)):t=>e.reduce((e,t)=>e.includes(t)?e:e.concat([t]),t))})()},e(Y?"skills.collapseAll":"skills.expandAll")),r.createElement("button",{type:"button","data-testid":"skills-refresh","data-variant":"neutral",style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:()=>{N()}},"↻"))),i&&null===t?r.createElement("p",{style:P},"…"):null,""!==n||""!==D?r.createElement("p",{"data-testid":"skills-error",style:{...P,color:"var(--dsw-alias-state-error-primary)"}},ba(e,""!==n?n:D)):null,null!==t&&t.llmAvailable?r.createElement("button",{type:"button","data-testid":"skills-batch-toggle","aria-expanded":String(Q),onClick:()=>Z(e=>!e),style:{margin:"0 0 12px",fontSize:"12px",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid "+(Q?"var(--dsw-alias-label-dimmed)":"var(--dsh-svc-border-strong)"),background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer"}},(Q?"▾ ":"▸ ")+e("skills.batch.toggle")):null,Q&&null!==t&&t.llmAvailable?(()=>{const t=null!==I&&"planned"===I.phase&&null===R?"idle":null!==I?I.phase:"idle",a=t,s=null!==I&&I.total>0?Math.round(I.done/I.total*100):0,n=Array.isArray(R?.annotated)?R.annotated.length:0;return r.createElement("div",{"data-testid":"skills-batch-card",style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"12px",padding:"13px 15px",margin:"14px 0"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px"}},r.createElement("div",{style:{fontSize:"13.5px",fontWeight:700}},e("skills.batch.title")),r.createElement("button",{type:"button","data-testid":"skills-batch-collapse",onClick:()=>Z(!1),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"12px"}},e("skills.batch.collapse")+" ▴")),r.createElement("p",{style:{...P,marginTop:"4px"}},e("skills.batch.hint")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"9px",flexWrap:"wrap"}},null!==O&&O.length>0?r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.batch.model"),r.createElement("select",{"data-testid":"skills-batch-model",value:null===H?"":sa(H),disabled:y||null!==I&&"running"===I.phase,onChange:e=>da(e.target.value),style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"}},O.map(e=>r.createElement("option",{key:sa(e),value:sa(e)},e.providerName+" / "+e.name)))):null,"idle"===t||"done"===t||"cancelled"===t?r.createElement("button",{type:"button","data-testid":"skills-batch-plan",disabled:y,onClick:()=>{(async()=>{w(!0);try{await ua()}finally{w(!1)}})()},style:Object.assign({},me("neutral"),{cursor:y?"default":"pointer",opacity:y?.55:1})},e("skills.batch.plan")):null,null!==R?r.createElement("span",{"data-testid":"skills-batch-candidates",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.batch.candidates",{count:R.candidates.length})+(R.estBytes>0?" · "+e("skills.batch.estBytes",{size:(o=R.estBytes,o>=1048576?(o/1024/1024).toFixed(1)+" MB":o>=1024?(o/1024).toFixed(1)+" KB":String(o)+" B")}):"")+(n>0?" · "+e("skills.batch.annotated",{count:n}):"")+" · "+e("skills.batch.skipped",{count:R.skipped.length})):null,null!==R&&"planned"===t?r.createElement("button",{type:"button","data-testid":"skills-batch-start",disabled:y||0===R.candidates.length&&0===n,onClick:()=>{(async()=>{const e=Array.isArray(R?.annotated)?R.annotated.length:0;if(e>0&&!q)A(!0);else{A(!1),w(!0);try{await ga(e>0)}finally{w(!1)}}})()},title:q?e("skills.switch.confirm"):void 0,style:{fontSize:"12px",padding:"5px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:q?"var(--dsh-svc-warning)":"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:y?"default":"pointer",opacity:y?.55:1}},q&&n>0?e("skills.batch.forceConfirm",{count:n}):e("skills.batch.start")):null,null!==I&&"running"===I.phase?r.createElement("button",{type:"button","data-testid":"skills-batch-cancel",onClick:()=>{(async()=>{await ia()})()},style:{fontSize:"12px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:"pointer"}},e("skills.batch.cancel")):null,null!==I?r.createElement("span",{"data-testid":"skills-batch-phase",style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("skills.batch.phase."+a)):null),null!==R&&0===R.candidates.length&&0===n?r.createElement("p",{style:P},e("skills.batch.no-candidates")):null,null===R||0===R.skipped.length?null:r.createElement("div",{"data-testid":"skills-batch-skipped",style:{marginTop:"6px"}},r.createElement("button",{type:"button","data-testid":"skills-batch-skipped-toggle",onClick:()=>T(e=>!e),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(C?"▾ ":"▸ ")+e("skills.skippedList")+"("+R.skipped.length+")"),C?r.createElement("div",{style:{marginTop:"4px",fontSize:"11.5px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)"}},R.skipped.map((t,a)=>r.createElement("div",{key:t.id??a,"data-testid":"skills-batch-skipped-item"},(""===t.name?t.id:t.name)+e("skills.colon")+(t=>{if("shadowed"===t)return e("skills.skip.shadowed");if("string"==typeof t&&t.startsWith("legacy-invocation-key"))return e("skills.skip.reason.legacy-invocation-key");const a=e("skills.skip.reason."+t);return a==="skills.skip.reason."+t?t:a})(t.reason)))):null),(()=>{const t=Array.isArray(R?.annotated)?R.annotated:[];return null===R||0===t.length?null:r.createElement("div",{"data-testid":"skills-batch-annotated",style:{marginTop:"6px"}},r.createElement("button",{type:"button","data-testid":"skills-batch-annotated-toggle",onClick:()=>M(e=>!e),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(z?"▾ ":"▸ ")+e("skills.batch.annotatedList")+"("+t.length+")"),z?r.createElement("div",{style:{marginTop:"4px",fontSize:"11.5px",lineHeight:1.6,color:"var(--dsh-svc-warning)"}},t.map((e,t)=>r.createElement("div",{key:e.id??t,"data-testid":"skills-batch-annotated-item"},""===e.name?e.id:e.name))):null)})(),null!==I&&I.total>0&&"idle"!==t?(()=>{const t=Array.isArray(I.failures)&&I.failures.length>0?r.createElement("div",{"data-testid":"skills-batch-failures",style:{marginTop:"7px",fontSize:"11.5px",color:"var(--dsw-alias-state-error-primary)",lineHeight:1.5}},e("skills.batch.failures",{count:I.failures.length})+":"+I.failures.map(e=>e.name+"("+e.reason+")").join("、")):null,a=Array.isArray(I.logs)?I.logs:[],n=0===a.length?null:r.createElement("div",null,r.createElement("button",{type:"button","data-testid":"skills-batch-log-toggle",onClick:()=>E(e=>!e),style:{marginTop:"7px",border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(S?"▾ ":"▸ ")+e("skills.log.title")+"("+a.length+")"),S?F("skills-batch-log",a.slice(-30).map(t=>fa(e,t)),!1):null);return r.createElement("div",{style:{marginTop:"10px"}},r.createElement("div",{"data-testid":"skills-batch-progress",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginBottom:"4px"}},e("skills.batch.progress",{done:I.done,total:I.total})+(null!==I.current?" · "+e("skills.batch.current",{name:I.current}):"")),r.createElement("div",{style:{height:"6px",borderRadius:"3px",background:"var(--dsw-alias-bg-layer-3)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:s+"%",background:"var(--dsw-alias-state-success-primary)",transition:"width .3s"}})),t,n)})():null);var o})():null,(()=>{if(null===t||0===t.entries.length)return r.createElement("p",{style:P},e("skills.empty"));const a=G.filter(e=>void 0!==e.invalid),s=G.filter(e=>void 0===e.invalid),n=[["skills.group.auto",s.filter(e=>e.invocation.model)],["skills.group.manual",s.filter(e=>!e.invocation.model&&e.invocation.user)],["skills.group.disabled",s.filter(e=>!e.invocation.model&&!e.invocation.user)]],o=a=>{const s=(a=>{const s=m.includes(a.id),n="string"==typeof a.invalid&&a.invalid.startsWith("legacy-invocation-key:"),o=r.createElement("div",{style:{fontSize:"14px",fontWeight:650,color:"var(--dsw-alias-label-primary)",overflowWrap:"anywhere"}},a.name,j(e("skills.source."+a.source)==="skills.source."+a.source?a.source:e("skills.source."+a.source)),a.shadowed?j(e("skills.badge.shadowed"),"warn"):null,a.writable?null:j(e("skills.badge.readonly"),"danger"),a.annotated?j(e("skills.badge.annotated")):null),i=r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginTop:"3px",lineHeight:1.45,overflowWrap:"anywhere"}},a.description),d=""===a.usage?null:r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)",marginTop:"2px",lineHeight:1.45,overflowWrap:"anywhere"}},e("skills.apply.usage")+":"+a.usage),c=void 0!==a.note?r.createElement("div",{"data-testid":"skill-note-"+a.name,style:{marginTop:"5px",padding:"6px 9px",borderRadius:"7px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l2)",fontSize:"11.5px",lineHeight:1.55,color:"var(--dsw-alias-label-secondary)",display:"flex",gap:"8px",alignItems:"flex-start"}},r.createElement("div",{style:{minWidth:0,flex:1}},!0===a.note.stale?r.createElement("div",{style:{marginBottom:"3px",color:"var(--dsw-alias-state-warn-primary)"}},"⚠ "+e("skills.note.stale")):null,r.createElement("div",{style:{overflowWrap:"anywhere"}},r.createElement("span",{style:{fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("skills.apply.description")+":"),r.createElement("span",null,a.note.description)),""===a.note.usage?null:r.createElement("div",{style:{overflowWrap:"anywhere",marginTop:"3px"}},r.createElement("span",{style:{fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("skills.apply.usage")+":"),r.createElement("span",null,a.note.usage))),r.createElement("button",{type:"button","data-testid":"skill-note-remove-"+a.name,onClick:()=>{(async e=>{const t=await ra("skills-note-clear",{id:e.id});t.ok?W(t.value.entry):l(t.error||"unknown")})(a)},title:e("skills.note.remove"),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"13px",flexShrink:0,lineHeight:1}},"✕")):null,u=void 0!==a.invalid?r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)",marginTop:"4px",display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},"⚠ ",n?e("skills.invalid.legacy"):e("skills.invalid.other",{reason:a.invalid}),n&&a.writable?r.createElement("button",{type:"button","data-testid":"skill-fix-"+a.name,onClick:()=>{(async e=>{const t=e.id+":fix";if(h===t){f(null);try{const t=await ra("skills-fix-keys",{id:e.id});t.ok?W(t.value.entry):l(t.error+(t.detail?":"+t.detail:"")||"unknown")}catch(e){l("network")}}else f(t)})(a)},title:h===a.id+":fix"?e("skills.switch.confirm"):void 0,style:{fontSize:"11px",padding:"2px 9px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-warn-primary)",background:h===a.id+":fix"?"rgba(198,128,0,0.14)":"transparent",color:"var(--dsw-alias-state-warn-primary)",cursor:"pointer"}},h===a.id+":fix"?e("skills.switch.confirm"):e("skills.fix.legacy")):null):null,p=void 0===a.invalid?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"7px",alignItems:"flex-end",flexShrink:0}},r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"7px",fontSize:"11.5px",color:"var(--dsw-alias-label-secondary)"}},e("skills.switch.model"),$(a.invocation.model,{testid:"skill-switch-model-"+a.name,disabled:!a.writable,armed:h===a.id+":model",title:h===a.id+":model"?e("skills.switch.confirm"):void 0,onClick:()=>{B(a,"model")}})),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"7px",fontSize:"11.5px",color:"var(--dsw-alias-label-secondary)"}},e("skills.switch.user"),$(a.invocation.user,{testid:"skill-switch-user-"+a.name,disabled:!a.writable,armed:h===a.id+":user",title:h===a.id+":user"?e("skills.switch.confirm"):void 0,onClick:()=>{B(a,"user")}})),null!==t&&t.llmAvailable?r.createElement("button",{type:"button","data-testid":"skill-describe-"+a.name,onClick:()=>{(async e=>{const t=na();v({entry:e,models:null,modelItem:null,draft:null,busy:!1,error:"",applied:!1,preferred:t}),k([]);const a=await ra("skills-models",{});if(!a.ok)return void v(e=>({...e,error:a.error||"unknown"}));const r=a.value.models??[];v(e=>({...e,models:r,modelItem:oa(r,a.value.current)}))})(a)},style:Object.assign({},ge(),{fontSize:"11px",padding:"3px 10px"})},"✨ "+e("skills.describe.button")):null):null,b=r.createElement("button",{type:"button","data-testid":"skill-header-"+a.name,"aria-expanded":String(s),onClick:()=>{return e=a.id,g(t=>t.includes(e)?t.filter(t=>t!==e):t.concat([e]));var e},style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%",padding:0,border:0,background:"transparent",color:"inherit",textAlign:"left",cursor:"pointer"}},r.createElement("span",{"aria-hidden":"true",style:{flexShrink:0,fontSize:"11px",lineHeight:"20px",color:"var(--dsw-alias-label-tertiary)"}},s?"▾":"▸"),r.createElement("div",{style:{minWidth:0,flex:1}},o)),y=s?r.createElement("div",{"data-testid":"skill-body-"+a.name,style:{marginTop:"2px"}},r.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start",justifyContent:"space-between"}},r.createElement("div",{style:{minWidth:0,flex:1}},i,d),p),c):null;return r.createElement("div",{key:a.id,"data-testid":"skill-entry-"+a.name,style:V},b,u,y)})(a);return null!==b&&b.entry.id===a.id?[s,U(a)]:[s]};return r.createElement("div",null,a.length>0?r.createElement("div",{"data-testid":"skills-invalid-group",style:{marginBottom:"12px"}},a.flatMap(o)):null,n.map(([t,a])=>0===a.length?null:r.createElement("div",{key:t,"data-testid":"skills-group-"+t.split(".").pop(),style:{marginBottom:"14px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,margin:"0 0 7px",color:"var(--dsw-alias-label-secondary)"}},e(t)+" · "+a.length),a.flatMap(o))))})())}function ya(){return r.createElement(Ma,null)}function wa(e){if("number"!=typeof e||!Number.isFinite(e)||e<0)return"";if(0===e)return"0 B";const t=["B","KB","MB","GB"];let a=e,r=0;for(;a>=1024&&r<t.length-1;)a/=1024,r+=1;return(0===r?String(a):a.toFixed(1))+" "+t[r]}function xa(e,t){if("number"!=typeof e||e<=0)return t("sessions.status.unavailableTime");try{return new Date(e).toLocaleString()}catch(t){return String(e)}}function ka(e,t){if("string"!=typeof t){const e=t&&"object"==typeof t?t:{};return"string"==typeof e.message&&""!==e.message?e.message:"string"==typeof e.code&&""!==e.code?e.code:"unknown"}return"feature-disabled"===t?e("sessions.error.feature-disabled"):"session-not-found"===t?e("sessions.error.session-not-found"):"live-session-rejected"===t?e("sessions.error.live-session-rejected"):"session-not-archived"===t?e("sessions.error.session-not-archived"):"unknown-delete-plan"===t?e("sessions.error.unknown-delete-plan"):"invalid-session-ids"===t?e("sessions.error.invalid-session-ids"):"unarchive-unsupported"===t?e("sessions.error.unarchive-unsupported"):"network"===t?e("sessions.error.network"):t}const Sa={all:void 0,archived:void 0,deleted:void 0},Ea=new Map,Ca=[Symbol.for("react.memo"),Symbol.for("react.forward_ref"),Symbol.for("react.lazy")],Ta=e=>"function"==typeof e||null!==e&&"object"==typeof e&&"symbol"==typeof e.$$typeof&&Ca.includes(e.$$typeof);let qa=null;const Aa=e=>{const t=e("sessions.md.copy"),a=e("sessions.md.copied"),r=e("sessions.md.footnotes");return{code:{copyLabel:"string"==typeof t&&""!==t?t:"Copy",copiedLabel:"string"==typeof a&&""!==a?a:"Copied"},footnotes:"string"==typeof r&&""!==r?r:"Footnotes"}};try{const t=e("@deepseek-ai/dsh-client-ui-primitives");let a=null==t?null:t.MarkdownText;if(Ta(a))qa=a;else if(null!==a&&"object"==typeof a)if(a="function"==typeof a.default?a.default:"function"==typeof a.MarkdownText?a.MarkdownText:null,Ta(a))qa=a;else{let e=String(typeof a);try{e+=" keys=["+Object.keys(a).join(",")+"]"}catch(e){}console.warn("[dsh-service-md] MarkdownText is an unexpected value ("+e+") — falling back to plain text")}else console.warn("[dsh-service-md] ui-primitives seed present, but MarkdownText unavailable ("+typeof a+") — falling back to plain text")}catch(e){console.warn("[dsh-service-md] ui-primitives require failed: "+(e&&e.message?e.message:String(e)))}function za(){const e=J(),{useState:a,useEffect:s,useRef:n}=r,[o,l]=je.useEnabled(),i=Sa.archived,[c,u]=a(void 0!==i?i:null),[p,m]=a(void 0===i),[g,h]=a(""),[f,b]=a(Object.fromEntries(Ea)),v=n(new Set),[y,w]=a("archived"),[x,k]=a(!1),[S,E]=a("createdDesc"),[C,T]=a([]),[q,A]=a(!1),[z,M]=a([]),[I,R]=a(""),[O,H]=a(!1),[D,L]=a(!1),[N,W]=a(null),[B,P]=a(null),[j,$]=a(!1),[V,F]=a(""),[U,K]=a({}),G=n(null),Y=()=>y+"\0"+S+"\0"+I+"\0"+(O?1:0),[Q,Z]=a(""),[X,ee]=a(""),[te,ae]=a(""),[re,se]=a(""),[ne,oe]=a(""),[le,ie]=a(null),[de,ce]=a(!1),[ue,pe]=a(""),[fe,ve]=a(0),[ye,we]=a(null),[xe,ke]=a(!1),[Se,Ee]=a(""),[Ce,Te]=a(""),[qe,Ae]=a(""),[ze,Me]=a(""),Ie={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},Re=ge(),Oe=Object.assign({},Re,{background:"transparent",borderColor:"var(--dsw-alias-state-error-primary)",color:"var(--dsw-alias-state-error-primary)"}),He=Object.assign({},Re,{background:"var(--dsw-alias-state-error-primary)",borderColor:"transparent",color:"var(--dsh-svc-brand-text)"}),De=e=>"archived"===e?"archived":"deleted"===e?"deleted":"all",Le=n(y);Le.current=y;const Ne=async(t,a={})=>{const r=void 0!==t?t:De(y),s=Sa[r],n=!a.force&&void 0!==s;if(n){if(u(s),h(""),m(!1),!0!==a.silent)return}else m(!0);try{const t=await d("sessions-list",{scope:r});t.ok?(Sa[r]=t.value,De(Le.current)===r&&(u(t.value),h(""))):n&&a.silent||h(ka(e,t.error||"unknown"))}catch(t){n&&a.silent||h(e("sessions.error.network"))}finally{n&&a.silent||m(!1)}};s(()=>{Ne("archived",{silent:!0})},[]),s(()=>{if(null===c)return;const e=Array.isArray(c.items)?c.items:[],t=[];for(const a of e){const e=a.id;void 0!==f[e]||v.current.has(e)||(v.current.add(e),t.push(e))}if(0===t.length)return;let a=!1;const r=async e=>{try{const t=await d("sessions-bytes",{ids:e});if(a)return;const r=t&&t.ok&&t.value&&"object"==typeof t.value.bytes?t.value.bytes:{};if(Object.keys(r).length>0){for(const t of e)void 0!==r[t]&&Ea.set(t,r[t]);b(t=>{const a={...t};for(const t of e)void 0!==r[t]&&(a[t]=r[t]);return a})}}catch(e){}finally{if(!a)for(const t of e)v.current.delete(t)}};for(let e=0;e<t.length;e+=100)r(t.slice(e,e+100));return()=>{a=!0;for(const e of t)v.current.delete(e)}},[c]),s(()=>{if("deleted"!==y){if(""!==I.trim())return t.timer.timeout(()=>{(async e=>{if(""!==e.trim()){L(!0);try{const t=await d("sessions-search",{query:e.trim(),scope:O?"archived":"all"});t.ok?W(t.value):W({available:!0,query:e,scope:"all",hits:[],error:t.error})}catch(t){W({available:!0,query:e,scope:O?"archived":"all",hits:[],error:"network"})}finally{L(!1)}}else W(null)})(I)},300);W(null)}},[I,O,y]);const We=(e,t,a,r,s)=>{A(!1),M([]),se(""),oe(""),we(null),Ee("");const n=function(e){let t=null!=e&&e.currentTarget?e.currentTarget:null;const a="undefined"!=typeof document?document:null;for(;null!=t&&1===t.nodeType;){let e="";if(null!==a&&a.defaultView&&"function"==typeof a.defaultView.getComputedStyle)try{const r=a.defaultView.getComputedStyle(t);e=r?String(r.overflowY||""):""}catch(e){}else t.style&&(e=String(t.style.overflowY||t.style.overflow||""));if(("auto"===e||"scroll"===e||"overlay"===e)&&"number"==typeof t.scrollHeight&&"number"==typeof t.clientHeight&&t.scrollHeight>t.clientHeight+1)return t;t=t.parentNode}return null}(r);if(null!==n&&(G.current={key:Y(),container:n,scrollTop:n.scrollTop}),K({}),P({sessionId:e,view:t||"events",cursor:void 0,items:[],total:0,hitItems:a||null,loadedTitle:"",centerSeq:void 0}),F(""),$(!1),"search"===(t||"events")&&Array.isArray(a)&&a.length>0){const t=Number.isSafeInteger(s)?Number(s):Number(a[0].seq);Pe(e,Number.isSafeInteger(t)?t:0)}else Be(e,void 0,t||"events")},Be=async(t,a,r)=>{$(!0);try{const s=await d("sessions-view",{id:t,cursor:a});s.ok?(P(e=>{const n=null===e?{}:e,o=void 0===a?s.value.items||[]:[...n.items||[],...s.value.items||[]];return{...n,sessionId:t,view:r||n.view||"events",cursor:s.value.nextCursor,items:o,total:s.value.total,loadedTitle:n.loadedTitle||(s.value.session&&s.value.session.id,"")}}),F("")):F(ka(e,s.error||"unknown"))}catch(t){F(e("sessions.error.network"))}finally{$(!1)}},Pe=async(t,a)=>{$(!0),F("");try{const r=await d("sessions-view",{id:t,center:a});r.ok?(P(e=>{const s=null===e?{}:e;return{...s,sessionId:t,view:"search",cursor:r.value.nextCursor,items:r.value.items||[],total:r.value.total,centerSeq:Number.isSafeInteger(r.value.centerSeq)?r.value.centerSeq:a,loadedTitle:s.loadedTitle||""}}),F("")):F(ka(e,r.error||"unknown"))}catch(t){F(e("sessions.error.network"))}finally{$(!1)}},$e=async t=>{try{const a=await d("sessions-export",{id:t});if(!a.ok)return{ok:!1,error:ka(e,a.error||"unknown")};const r=a.value.url,s=await fetch(r,{method:"HEAD"});if(!s.ok)return{ok:!1,error:e("sessions.error.export-failed",{error:"HTTP "+s.status})};const n=document.createElement("a");return n.href=r,n.download="dsh-session-"+t.replace(/[^A-Za-z0-9_-]/g,"_")+".zip",n.click(),{ok:!0}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},_e=async e=>{Z(e),ee("");const t=await $e(e);return t.ok||ee(t.error),Z(""),t},Ve=async t=>{try{const a=await d("sessions-archive",{id:t});return a.ok?((e=>{const t=Sa.all;void 0!==t&&Array.isArray(t.items)&&(Sa.all={...t,items:t.items.map(t=>t.id===e?{...t,archived:!0}:t)});const a=Sa.archived;if(void 0!==a&&Array.isArray(a.items)){const r=a.items.some(t=>t.id===e),s=t?.items?.find(t=>t.id===e);Sa.archived=r?{...a,items:a.items.map(t=>t.id===e?{...t,archived:!0}:t)}:void 0!==s?{...a,items:[{...s,archived:!0},...a.items]}:a}u(t=>null!==t&&Array.isArray(t.items)?{...t,items:t.items.map(t=>t.id===e?{...t,archived:!0}:t)}:t)})(t),{ok:!0}):{ok:!1,error:ka(e,a.error||"unknown")}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},Fe=async t=>{try{const a=await d("sessions-unarchive",{id:t});return a.ok?((e=>{const t=Sa.all;void 0!==t&&Array.isArray(t.items)&&(Sa.all={...t,items:t.items.map(t=>t.id===e?{...t,archived:!1}:t)});const a=Sa.archived;void 0!==a&&Array.isArray(a.items)&&(Sa.archived={...a,items:a.items.filter(t=>t.id!==e)}),u(t=>null!==t&&Array.isArray(t.items)?"archived"===Le.current?{...t,items:t.items.filter(t=>t.id!==e)}:{...t,items:t.items.map(t=>t.id===e?{...t,archived:!1}:t)}:t)})(t),{ok:!0}):{ok:!1,error:ka(e,a.error||"unknown")}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},Ue=e=>{const t=e?.id??"";if(""===t)return;const a=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===t):void 0,r={id:t,title:"string"==typeof e?.title?e.title:a?.title??"",cwd:e?.cwd??a?.cwd??null,deletedAt:Date.now()};for(const e of["all","archived"]){const a=Sa[e];void 0!==a&&Array.isArray(a.items)&&(Sa[e]={...a,items:a.items.filter(e=>e.id!==t)})}const s=Sa.deleted;void 0!==s&&(Sa.deleted={...s,deleted:[r,...(Array.isArray(s.deleted)?s.deleted:[]).filter(e=>e.id!==t)]}),Ea.delete(t),u(e=>{if(null===e)return e;const a=Array.isArray(e.items)?e.items:[];return{...e,items:a.filter(e=>e.id!==t),deleted:[r,...(Array.isArray(e.deleted)?e.deleted:[]).filter(e=>e.id!==t)]}}),b(e=>{const a={...e};return delete a[t],a}),v.current.delete(t)};s(()=>{fe>0&&P(null)},[fe]),s(()=>{if(null!==B)return;const e=G.current;if(G.current=null,null===e)return;if(e.key!==Y())return;if(null===e.container||void 0===e.container)return;const t="number"==typeof e.scrollTop?e.scrollTop:0;try{"number"==typeof e.container.scrollTop&&(e.container.scrollTop=t)}catch(e){}},[B]);const Ke=null!==B&&"search"===B.view?B.centerSeq:null,Ge=null!==B&&"search"===B.view&&Array.isArray(B.items)?B.items.length:0;s(()=>{if(null!==Ke&&"number"==typeof Ke)return function(e){if("undefined"==typeof document||null===document)return()=>{};try{const a=document.querySelector('[data-testid="sessions-jump-target-'+e+'"]');if(null==a)return()=>{};try{a.scrollIntoView({behavior:"smooth",block:"center"})}catch(e){try{a.scrollIntoView()}catch(e){}}if(a.classList&&"function"==typeof a.classList.add){a.classList.add("dshsv-locate-flash");const e=t.timer.timeout(()=>{try{a.classList&&"function"==typeof a.classList.remove&&a.classList.remove("dshsv-locate-flash")}catch(e){}},2e3);return()=>{e();try{a.classList&&"function"==typeof a.classList.remove&&a.classList.remove("dshsv-locate-flash")}catch(e){}}}}catch(e){}return()=>{}}(Ke)},[Ke,Ge]);const Ye=(()=>{if(null===c)return[];if("deleted"===y)return(Array.isArray(c.deleted)?c.deleted:[]).slice().sort((e,t)=>(t.deletedAt||0)-(e.deletedAt||0)).map(e=>({...e,_deleted:!0,archived:!0}));let e=(Array.isArray(c.items)?c.items:[]).slice();return x&&(e=e.filter(e=>!0===e.subagent)),"createdAsc"===S?e.sort((e,t)=>(e.createdAt||0)-(t.createdAt||0)):"title"===S?e.sort((e,t)=>String(e.title||"").localeCompare(String(t.title||""))):"project"===S?e.sort((e,t)=>String(e.cwd||"").localeCompare(String(t.cwd||""))||(t.createdAt||0)-(e.createdAt||0)):e.sort((e,t)=>(t.createdAt||0)-(e.createdAt||0)),e})(),Qe=""!==I.trim()?[]:"deleted"===y?Ye.map(e=>e.id):Ye.filter(e=>!0!==e._deleted).map(e=>e.id),Je=new Set(z),Ze=Ye.filter(e=>Je.has(e.id)),Xe=Ze.filter(e=>!0!==e._deleted),et=Ze.filter(e=>!0!==e._deleted&&!0!==e.live&&!0!==e.archived),tt=Ze.filter(e=>!0!==e._deleted&&!0===e.archived),at=Ze.filter(e=>!0!==e._deleted&&!0!==e.live&&!0===e.archived),rt=Ze.filter(e=>!0===e._deleted),st=Qe.length>0&&Qe.every(e=>Je.has(e));s(()=>{if(!q)return;const e=new Set(Qe);M(t=>{const a=t.filter(t=>e.has(t));return a.length===t.length?t:a})},[c,y,q,x]);const nt=()=>{A(!1),M([]),se(""),oe("")},ot=e=>{M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},lt="deleted"===y?[]:Ye.filter(e=>!0===e.subagent).map(e=>e.id),it=t=>{const a=!0===t._deleted,s=t.id,n=a?t.title||e("sessions.row.noTitle"):""!==t.title?t.title:e("sessions.row.noTitle"),o=!0===t.live,l=a||!0===t.archived,i=Je.has(s),u=(()=>{const e=f[s];return"number"==typeof e&&e>0?wa(e):null})(),p=[o?e("sessions.row.live"):l?e("sessions.row.archived"):null,a?e("sessions.row.deleted"):null,t.cwd?e("sessions.detail.cwd",{cwd:t.cwd}):null,a?t.deletedAt?xa(t.deletedAt,e):null:u].filter(Boolean),m=[];return a?m.push(r.createElement("button",{key:"clear",type:"button","data-testid":"sessions-row-clear-"+s,style:Oe,onClick:()=>{(e=>{null!==ye||xe||(Ee(""),we({batch:!1,items:[{id:e.id,title:e.title}]}))})(t)}},e("sessions.action.clear"))):(m.push(r.createElement("button",{key:"view",type:"button","data-testid":"sessions-row-view-"+s,style:Re,onClick:e=>We(s,"events",null,e)},e("sessions.action.view"))),m.push(r.createElement("button",{key:"export",type:"button","data-testid":"sessions-row-export-"+s,style:Re,disabled:Q===s,onClick:()=>{_e(s)}},e(Q===s?"sessions.detail.exporting":"sessions.action.export"))),o||l||m.push(r.createElement("button",{key:"archive",type:"button","data-testid":"sessions-row-archive-"+s,style:Re,disabled:Ce===s,onClick:()=>{(async e=>{Te(e),Me("");const t=await Ve(e);t.ok||Me(t.error),Te("")})(s)}},e(Ce===s?"sessions.status.working":"sessions.action.archive"))),l&&!1!==c?.canUnarchive&&m.push(r.createElement("button",{key:"unarchive",type:"button","data-testid":"sessions-row-unarchive-"+s,style:Re,disabled:qe===s,onClick:()=>{(async e=>{Ae(e),Me("");const t=await Fe(e);t.ok||Me(t.error),Ae("")})(s)}},e(qe===s?"sessions.status.working":"sessions.action.unarchive"))),!o&&l&&m.push(r.createElement("button",{key:"delete",type:"button","data-testid":"sessions-row-delete-"+s,style:Oe,onClick:()=>{(async t=>{if(null===le&&!de){pe("");try{const a=await d("sessions-delete-plan",{id:t});a.ok?ie(a.value):pe(ka(e,a.error||"unknown"))}catch(t){pe(e("sessions.error.network"))}}})(s)}},e("sessions.action.delete")))),r.createElement("div",{key:s,"data-testid":"sessions-row-"+s,"data-selected":q&&i?"true":void 0,onClick:q?()=>ot(s):void 0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",padding:q?"9px 2px 9px 8px":"9px 2px",borderBottom:"1px solid var(--dsh-svc-border)",background:"transparent",borderRadius:"4px",boxShadow:q&&i?"inset 3px 0 0 var(--dsw-alias-brand-primary)":"none",cursor:q?"pointer":"default"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"9px",minWidth:0,flex:"1 1 auto"}},q?r.createElement("input",{type:"checkbox","data-testid":"sessions-select-"+s,"aria-label":e("sessions.batch.selectRow",{title:n}),checked:i,onClick:e=>e.stopPropagation(),onChange:()=>ot(s),style:{width:"16px",height:"16px",flexShrink:0,accentColor:"var(--dsw-alias-brand-primary)",cursor:"pointer"}}):null,r.createElement("div",{style:{minWidth:0}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},r.createElement("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n),o?r.createElement("span",{"data-testid":"sessions-tag-live-"+s,style:he("success")},e("sessions.row.live")):null,l?r.createElement("span",{"data-testid":"sessions-tag-archived-"+s,style:he("warning")},e("sessions.row.archived")):null,a?r.createElement("span",{style:he("danger")},e("sessions.row.deleted")):null,a||!0!==t.subagent?null:r.createElement("span",{"data-testid":"sessions-tag-subagent-"+s,style:he("info")},e("sessions.row.subagent"))),r.createElement("div",{"data-testid":"sessions-meta-"+s,style:{fontSize:"11.5px",color:"var(--dsw-alias-label-tertiary)",marginTop:"3px"}},p.join(" · ")))),q?null:r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,flexWrap:"wrap",justifyContent:"flex-end"}},...m))},dt=(t,a)=>{const s=!0===t.noise,n="string"==typeof t.text&&""!==t.text?r.createElement("div",{"data-testid":"sessions-event-text-"+t.seq,style:{marginTop:"4px"}},null!==qa?r.createElement(qa,{text:t.text,labels:Aa(e)}):r.createElement("div",{style:{fontSize:"12px",lineHeight:1.55,color:"var(--dsw-alias-label-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word"}},t.text)):null;return r.createElement("div",{key:String(t.seq),"data-testid":"sessions-event-"+t.seq,style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:s?"transparent":"var(--dsw-alias-bg-layer-3)",marginBottom:"5px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},r.createElement("span",{"data-testid":"sessions-event-type-"+t.seq,style:{fontWeight:600,color:s?"inherit":"var(--dsw-alias-label-secondary)"}},s?e("sessions.detail.noise"):t.type),t.time?r.createElement("span",null,xa(t.time,e)):null),n)};return r.createElement("div",{"data-testid":"sessions-section",style:be()},r.createElement("div",{style:{fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"}},e("sessions.title")),r.createElement("div",{"data-testid":"sessions-nav-toggle",style:{margin:"2px 0 8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},e("sessions.navToggle"))),r.createElement("button",{type:"button",role:"switch","data-testid":"sessions-nav-switch","aria-checked":String(o),onClick:()=>l(!o),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(o?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:o?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:o?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:o?"#fff":"var(--dsw-alias-label-tertiary)"}})))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",margin:"0 0 10px"}},["all","archived","deleted"].map(t=>r.createElement("button",{key:t,type:"button","data-testid":"sessions-filter-"+t,style:{...Re,background:y===t?"var(--dsh-svc-tab-active-bg)":"transparent",color:y===t?"var(--dsh-svc-tab-active-text)":"var(--dsw-alias-label-primary)",fontWeight:y===t?650:400},onClick:()=>(e=>{e!==y&&(w(e),A(!1),M([]),se(""),oe(""),R(""),W(null),P(null),we(null),Ee(""),Ne(e))})(t)},e("sessions.filter."+t))),r.createElement("select",{"data-testid":"sessions-sort",style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"},value:S,onChange:e=>E(e.target.value)},r.createElement("option",{value:"createdDesc"},e("sessions.sort.createdDesc")),r.createElement("option",{value:"createdAsc"},e("sessions.sort.createdAsc")),r.createElement("option",{value:"title"},e("sessions.sort.title")),r.createElement("option",{value:"project"},e("sessions.sort.project"))),r.createElement("button",{type:"button","data-testid":"sessions-refresh","data-variant":"neutral",style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:()=>{Ne(void 0,{force:!0})}},e("sessions.refresh")),null===B&&""===I.trim()?r.createElement("button",{type:"button","data-testid":"sessions-batch-toggle","data-variant":q?"primary":"neutral",style:Object.assign({},me(q?"primary":"neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:q?nt:()=>{A(!0),M([]),se(""),oe("")}},e(q?"sessions.batch.exit":"sessions.batch.enter")):null),null===B&&q?r.createElement("div",{"data-testid":"sessions-batch-bar",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",margin:"0 0 10px",padding:"8px 10px",border:"1px solid var(--dsw-alias-border-l1)",borderRadius:"8px",background:"var(--dsw-alias-bg-layer-3)"}},r.createElement("button",{type:"button","data-testid":"sessions-select-all",style:Re,disabled:0===Qe.length||""!==te||de||xe,onClick:()=>{M(st?[]:Qe.slice())}},e(st?"sessions.batch.clearAll":"sessions.batch.selectAll")),"deleted"!==y&<.length>0?r.createElement("button",{type:"button","data-testid":"sessions-batch-select-subagents",style:Re,disabled:""!==te||de||xe,onClick:()=>{M(e=>{const t=lt.filter(t=>!e.includes(t));return 0===t.length?e:[...e,...t]})}},e("sessions.batch.selectSubagents")):null,r.createElement("span",{"data-testid":"sessions-selected-count",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginRight:"auto"}},e("sessions.batch.selected",{count:z.length})),"deleted"===y?r.createElement("button",{type:"button","data-testid":"sessions-batch-clear",style:Oe,disabled:0===rt.length||""!==te||de||xe,onClick:()=>{null!==ye||xe||0===rt.length||(Ee(""),we({batch:!0,items:rt.map(e=>({id:e.id,title:e.title}))}))}},e("sessions.batch.clear",{count:rt.length})):[r.createElement("button",{key:"export",type:"button","data-testid":"sessions-batch-export",style:Re,disabled:0===Xe.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===Xe.length)return;ae("export"),se(""),oe("");let t=0,a="";for(const e of Xe){const r=await $e(e.id);r.ok?t+=1:""===a&&(a=r.error)}""===a?se(e("sessions.batch.completed",{action:e("sessions.action.export"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.export"),done:t,total:Xe.length,error:a})),ae("")})()}},"export"===te?e("sessions.status.working"):e("sessions.batch.export",{count:Xe.length})),r.createElement("button",{key:"archive",type:"button","data-testid":"sessions-batch-archive",style:Re,disabled:0===et.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===et.length)return;ae("archive"),se(""),oe("");let t=0,a="";const r=et.map(e=>e.id),s=[];for(const e of r){const r=await Ve(e);r.ok?(t+=1,s.push(e)):""===a&&(a=r.error)}s.length>0&&M(e=>e.filter(e=>!s.includes(e))),""===a?se(e("sessions.batch.completed",{action:e("sessions.action.archive"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.archive"),done:t,total:r.length,error:a})),ae("")})()}},"archive"===te?e("sessions.status.working"):e("sessions.batch.archive",{count:et.length})),!1!==c?.canUnarchive?r.createElement("button",{key:"unarchive",type:"button","data-testid":"sessions-batch-unarchive",style:Re,disabled:0===tt.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===tt.length)return;ae("unarchive"),se(""),oe("");let t=0,a="";const r=tt.map(e=>e.id),s=[];for(const e of r){const r=await Fe(e);r.ok?(t+=1,s.push(e)):""===a&&(a=r.error)}s.length>0&&M(e=>e.filter(e=>!s.includes(e))),""===a?se(e("sessions.batch.completed",{action:e("sessions.action.unarchive"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.unarchive"),done:t,total:r.length,error:a})),ae("")})()}},"unarchive"===te?e("sessions.status.working"):e("sessions.batch.unarchive",{count:tt.length})):null,r.createElement("button",{key:"delete",type:"button","data-testid":"sessions-batch-delete",style:Oe,disabled:0===at.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||null!==le||0===at.length)return;ae("delete-plan"),se(""),oe("");const t=[];let a="";for(const r of at)try{const s=await d("sessions-delete-plan",{id:r.id});s.ok?t.push(s.value):""===a&&(a=ka(e,s.error||"unknown"))}catch(t){""===a&&(a=e("sessions.error.network"))}ae(""),""===a&&t.length===at.length?ie({batch:!0,plans:t,sessions:t.map(e=>e.session),consequences:["deletes-session-log"]}):oe(e("sessions.batch.failed",{action:e("sessions.action.delete"),done:t.length,total:at.length,error:a||e("sessions.error.network")}))})()}},"delete-plan"===te?e("sessions.status.working"):e("sessions.batch.delete",{count:at.length}))]):null,null===B&&"deleted"!==y?r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"10px",flexWrap:"wrap"}},r.createElement("input",{"data-testid":"sessions-search-input",type:"text",placeholder:e("sessions.search.placeholder"),value:I,onChange:e=>{q&&nt(),R(e.target.value)},style:{fontSize:"12px",padding:"6px 10px",borderRadius:"7px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"100%",boxSizing:"border-box"}}),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},r.createElement("input",{type:"checkbox","data-testid":"sessions-search-archived",checked:O,onChange:e=>H(e.target.checked)}),e("sessions.search.archivedOnly")),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},r.createElement("input",{type:"checkbox","data-testid":"sessions-filter-subagent",checked:x,onChange:e=>k(e.target.checked)}),e("sessions.filter.subagent"))):null,""!==ze?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ze+(!1!==c?.canUnarchive?"":" · "+e("sessions.oneWayHint"))):null,""!==X?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},X):null,""!==re?r.createElement("p",{"data-testid":"sessions-batch-result",style:{...Ie,color:"var(--dsw-alias-state-success-primary)"}},re):null,""!==ne?r.createElement("p",{"data-testid":"sessions-batch-error",style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ne):null,(()=>{const t=null!==c&&Array.isArray(c.items)?c.items:[];return x&&"deleted"!==y&&t.length>0&&t.every(e=>void 0===e.subagent)?r.createElement("p",{"data-testid":"sessions-subagent-legacy-hint",style:{...Ie,color:"var(--dsh-svc-warning)"}},e("sessions.subagent.hostLegacy")):null})(),(()=>{if(null===B)return null;const a=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===B.sessionId):void 0,s=""!==I&&"search"===B.view&&null!==N?N.hits.find(e=>e.sessionId===B.sessionId)?.title||"":void 0!==a&&""!==a.title?a.title:"",n=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===B.sessionId):void 0,o="search"===B.view&&Array.isArray(B.hitItems)?B.hitItems.map(e=>Number(e.seq)).filter(e=>Number.isSafeInteger(e)):[],l="search"===B.view&&"number"==typeof B.centerSeq?o.indexOf(B.centerSeq):-1,i=l>0?o[l-1]:void 0,d=l>=0&&l<o.length-1?o[l+1]:void 0,u=new Set(o),p={noise:{testId:"sessions-noisewall-",countKey:"sessions.detail.noiseBlock",collapseKey:"sessions.detail.noiseCollapse"},tool:{testId:"sessions-toolwall-",countKey:"sessions.detail.toolBlock",collapseKey:"sessions.detail.toolCollapse"}},m=(t,a)=>{const s=(t,s)=>null!==a&&a.has(Number(t.seq))?r.createElement("div",{key:"jump-"+t.seq,"data-testid":"sessions-jump-target-"+t.seq,style:{borderRadius:"8px",border:"1px solid rgba(198,128,0,0.55)",background:"rgba(198,128,0,0.10)",padding:"6px 8px",marginBottom:"6px"}},r.createElement("div",{"data-testid":"sessions-jump-badge-"+t.seq,style:{fontSize:"10.5px",fontWeight:700,color:"var(--dsw-alias-state-warn-primary)",marginBottom:"3px"}},e("sessions.hit.badge")),dt(t)):dt(t);return function(e){const t=[],a=Array.isArray(e)?e:[];for(let e=0;e<a.length;e+=1){const r=a[e],s=!0===r.noise?"noise":!0===r.tool?"tool":null;if(null===s){t.push(r);continue}const n=t[t.length-1];void 0!==n&&n._block===s?(n.count+=1,n.lastSeq=r.seq,n.lastIndex=e):t.push({_block:s,count:1,firstSeq:r.seq,lastSeq:r.seq,firstIndex:e,lastIndex:e})}return t}(t).map((n,o)=>{if(void 0!==n._block){const o=p[n._block],l=Array.isArray(t)?t.slice(n.firstIndex,n.lastIndex+1):[],i=U[n.firstSeq],d=null!==a&&l.some(e=>a.has(Number(e.seq))),c=void 0===i?d:!0===i;return r.createElement("div",{key:n._block+"-"+n.firstSeq,"data-testid":o.testId+n.firstSeq,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"transparent",marginBottom:"5px"}},r.createElement("button",{type:"button","data-testid":o.testId+"toggle-"+n.firstSeq,style:{...Re,border:0,padding:0,color:"var(--dsw-alias-label-tertiary)",fontSize:"11px"},onClick:()=>((e,t)=>K(a=>({...a,[e]:!t})))(n.firstSeq,c)},e(c?"sessions.glyph.collapse":"sessions.glyph.expand")+" "+e(c?o.collapseKey:o.countKey,{count:n.count})),c&&l.length>0?r.createElement("div",{style:{marginTop:"6px"}},l.map(e=>s(e))):null)}return s(n)})};return r.createElement("div",{"data-testid":"sessions-detail"},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginBottom:"10px"}},r.createElement("button",{type:"button","data-testid":"sessions-detail-back",style:Re,onClick:()=>P(null)},e("sessions.glyph.back")+" "+e("sessions.detail.back")),r.createElement("span",{style:{fontSize:"14px",fontWeight:700,color:"var(--dsw-alias-label-primary)",minWidth:0}},""!==s?s:e("sessions.row.noTitle")),n?.archived?r.createElement("span",{title:e("sessions.detail.archiveDisabled"),style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("sessions.detail.archiveDisabled")):r.createElement("button",{type:"button","data-testid":"sessions-detail-open",style:Re,onClick:()=>{try{(t.get?.("uiWorkspace")?.openSession??t.sessions?.open)?.(B.sessionId)}catch(e){}}},e("sessions.detail.open")),r.createElement("button",{type:"button","data-testid":"sessions-detail-export",style:Re,disabled:Q===B.sessionId,onClick:()=>{_e(B.sessionId)}},Q===B.sessionId?e("sessions.detail.exporting"):e("sessions.detail.exportAll"))),"search"===B.view&&null!==B.hitItems?r.createElement("div",{"data-testid":"sessions-jump-view",style:{marginBottom:"10px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",marginBottom:"6px"}},r.createElement("button",{type:"button","data-testid":"sessions-detail-return-search",style:Re,onClick:()=>P(null)},e("sessions.glyph.back")+" "+e("sessions.hit.return")),r.createElement("span",{style:{fontSize:"11.5px",color:"var(--dsw-alias-label-tertiary)"}},e("sessions.hit.inSession",{count:Array.isArray(B.hitItems)?B.hitItems.length:0})),r.createElement("button",{type:"button","data-testid":"sessions-jump-prev",style:Re,disabled:void 0===i||j,onClick:()=>{void 0!==i&&Pe(B.sessionId,i)}},e("sessions.hit.prev")),r.createElement("button",{type:"button","data-testid":"sessions-jump-next",style:Re,disabled:void 0===d||j,onClick:()=>{void 0!==d&&Pe(B.sessionId,d)}},e("sessions.hit.next"))),r.createElement("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginBottom:"8px"}},o.map(e=>r.createElement("button",{key:e,type:"button","data-testid":"sessions-jump-chip-"+e,style:{...Re,padding:"1px 8px",fontSize:"11px",..._("999px"),background:e===B.centerSeq?"var(--dsh-svc-tab-active-bg)":"transparent",color:e===B.centerSeq?"var(--dsh-svc-tab-active-text)":"var(--dsw-alias-label-secondary)"},onClick:()=>{Pe(B.sessionId,e)}},"#"+e))),j&&0===B.items.length?r.createElement("p",{style:Ie},e("sessions.status.loading")):null,m(B.items,u),void 0!==B.cursor&&B.items.length>0?r.createElement("button",{type:"button","data-testid":"sessions-detail-more",style:Re,disabled:j,onClick:()=>{Be(B.sessionId,B.cursor,B.view)}},e("sessions.detail.loadMore",{remaining:Math.max(0,B.total-B.items.length)})):null,void 0===B.cursor&&B.items.length>0?r.createElement("p",{style:Ie},e("sessions.detail.noMore",{total:B.total})):null):null,""!==V?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},V):null,"search"!==B.view?m(B.items,null):null,"search"!==B.view&&void 0!==B.cursor?r.createElement("button",{type:"button","data-testid":"sessions-detail-more",style:Re,disabled:j,onClick:()=>{Be(B.sessionId,B.cursor,B.view)}},e("sessions.detail.loadMore",{remaining:Math.max(0,B.total-B.items.length)})):null,"search"!==B.view&&void 0===B.cursor&&B.items.length>0?r.createElement("p",{style:Ie},e("sessions.detail.noMore",{total:B.total})):null)})()??(()=>{if(p)return r.createElement("p",{style:Ie},e("sessions.status.loading"));if(""!==g)return r.createElement("p",{"data-testid":"sessions-error",style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},g);if(""!==I.trim()&&"deleted"!==y)return null===N?r.createElement("p",{style:Ie},e(D?"sessions.status.loading":"sessions.search.placeholder")):N.error?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ka(e,N.error)):0===N.hits.length?r.createElement("p",{style:Ie},e("sessions.empty.search",{query:I})):N.hits.map(t=>r.createElement("div",{key:t.sessionId,"data-testid":"sessions-hit-"+t.sessionId,style:{padding:"9px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsw-alias-bg-layer-3)",marginBottom:"6px"}},r.createElement("button",{type:"button","data-testid":"sessions-hit-open-"+t.sessionId,style:{...Re,border:0,padding:0,textAlign:"left",display:"inline",maxWidth:"100%"},onClick:e=>We(t.sessionId,"search",t.items,e)},r.createElement("span",{style:{fontWeight:600,color:"var(--dsw-alias-label-primary)"}},""!==t.title?t.title:e("sessions.row.noTitle")),r.createElement("span",{style:{color:"var(--dsw-alias-label-secondary)",marginLeft:"6px",fontSize:"11.5px"}},e("sessions.hit.title",{count:t.items.length}))),t.items.length>1?r.createElement("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"5px"}},t.items.map(e=>r.createElement("button",{key:e.seq,type:"button","data-testid":"sessions-hit-seq-"+t.sessionId+"-"+e.seq,style:{...Re,padding:"1px 8px",fontSize:"11px",..._("999px"),color:"var(--dsw-alias-label-tertiary)"},onClick:a=>We(t.sessionId,"search",t.items,a,Number(e.seq))},"#"+e.seq))):null,t.items.slice(0,1).map((e,a)=>r.createElement("div",{key:a,"data-testid":"sessions-hit-snippet-"+t.sessionId,style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginTop:"5px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},function(e,t,a){const s="string"==typeof e?e:"",n="string"==typeof t?t.trim().split(/\s+/).filter(Boolean):[];if(""===s||0===n.length)return s;let o;try{o=new RegExp(n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+"),"gi")}catch(e){return s}const l=[];let i,d=0,c=0;for(;null!==(i=o.exec(s));)i.index>d&&l.push(s.slice(d,i.index)),l.push(r.createElement("mark",{key:a+"-"+c,"data-testid":a+"-"+c,style:{background:"rgba(198,128,0,0.24)",color:"inherit",borderRadius:"3px",padding:"0 1px"}},i[0])),d=i.index+i[0].length,c+=1;return 0===l.length?s:(d<s.length&&l.push(s.slice(d)),l)}(e.snippet,N.query||I,"sessions-hit-highlight-"+t.sessionId)))));if(0===Ye.length){const t="archived"===y?"sessions.empty.archived":"deleted"===y?"sessions.empty.deleted":"sessions.empty.all";return r.createElement("p",{style:Ie},e(t))}if("project"!==S||"deleted"===y)return Ye.map(it);const t=[];for(const e of Ye){const a=String(e.cwd||""),r=t.length>0&&t[t.length-1].project===a?t[t.length-1]:null;null===r?t.push({project:a,items:[e]}):r.items.push(e)}return t.map((t,a)=>{const s=!C.includes(t.project);return r.createElement("div",{key:"project-group-"+(""===t.project?"__none__":t.project),"data-testid":"sessions-project-group-"+a,style:{marginBottom:"14px"}},r.createElement("div",{"data-testid":"sessions-project-header-"+a,"data-project":t.project,"data-collapsed":s?"true":"false",role:"button","aria-expanded":String(!s),onClick:()=>{return e=t.project,T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);var e},style:{display:"flex",alignItems:"baseline",gap:"8px",margin:"0 2px 4px",padding:"2px 5px",borderRadius:"6px",cursor:"pointer",userSelect:"none"}},r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",flex:"none"}},e(s?"sessions.glyph.expand":"sessions.glyph.collapse")),r.createElement("span",{style:{fontSize:"11.5px",fontWeight:650,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},""===t.project?e("sessions.projectGroup.noCwd"):t.project),r.createElement("span",{"data-testid":"sessions-project-count-"+a,style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",flexShrink:0}},1===t.items.length?e("sessions.projectGroup.countOne"):e("sessions.projectGroup.countMany",{count:t.items.length}))),s?null:t.items.map(it))})})(),(()=>{if(null===le)return null;const t=!0===le.batch&&Array.isArray(le.sessions)?le.sessions:null,a=null===t&&le.session||{};return r.createElement("div",{"data-testid":"sessions-delete-modal",style:{position:"fixed",inset:0,zIndex:1200,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.45)"}},r.createElement("div",{style:{width:"min(480px, calc(100vw - 32px))",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"14px",padding:"18px",boxShadow:"0 12px 40px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:"var(--dsw-alias-label-primary)",marginBottom:"8px"}},null===t?e("sessions.delete.title"):e("sessions.batch.deleteTitle",{count:t.length})),r.createElement("p",{style:{fontSize:"13px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.5,margin:"0 0 10px"}},e(null===t?"sessions.delete.body":"sessions.batch.deleteBody")),null===t?r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"6px"}},a.title||e("sessions.row.noTitle")):r.createElement("ul",{"data-testid":"sessions-batch-delete-list",style:{margin:"0 0 12px",paddingLeft:"18px",maxHeight:"220px",overflowY:"auto",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},t.map(t=>r.createElement("li",{key:t.id},e("sessions.batch.deleteItem",{title:t.title||e("sessions.row.noTitle"),bytes:wa(t.bytes)})))),null===t?r.createElement("ul",{style:{margin:"0 0 12px",paddingLeft:"18px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},r.createElement("li",null,e("sessions.delete.consequence.log",{bytes:wa(a.bytes)})),le.consequences&&le.consequences.includes("hides-from-official-sidebar")?r.createElement("li",null,e("sessions.delete.consequence.sidebar")):null):null,""!==ue?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ue):null,r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},r.createElement("button",{type:"button","data-testid":"sessions-delete-cancel",style:Re,disabled:de,onClick:()=>{ie(null),pe("")}},e("sessions.delete.cancel")),r.createElement("button",{type:"button","data-testid":"sessions-delete-confirm",style:He,disabled:de,onClick:()=>{(async()=>{if(null===le||de)return;ce(!0),pe("");const t=!0===le.batch&&Array.isArray(le.plans)?le.plans:[le];let a=0,r="";for(const s of t)try{const t=await d("sessions-delete",{planId:s.planId});t.ok?(a+=1,Ue(s.session)):""===r&&(r=ka(e,t.error||"unknown"))}catch(t){""===r&&(r=e("sessions.error.network"))}!0===le.batch?(ie(null),ve(e=>e+1),""===r?(se(e("sessions.batch.completed",{action:e("sessions.action.delete"),count:a})),oe("")):(se(""),oe(e("sessions.batch.failed",{action:e("sessions.action.delete"),done:a,total:t.length,error:r})))):""===r?(ie(null),ve(e=>e+1)):pe(r),ce(!1)})()}},e(de?"sessions.status.working":"sessions.delete.confirm")))))})(),(()=>{if(null===ye)return null;const t=!0===ye.batch,a=Array.isArray(ye.items)?ye.items:[],s=a.length;return r.createElement("div",{"data-testid":"sessions-clear-modal",style:{position:"fixed",inset:0,zIndex:1200,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.45)"}},r.createElement("div",{style:{width:"min(480px, calc(100vw - 32px))",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"14px",padding:"18px",boxShadow:"0 12px 40px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:"var(--dsw-alias-label-primary)",marginBottom:"8px"}},t?e("sessions.batch.clearTitle",{count:s}):e("sessions.clear.title")),r.createElement("p",{style:{fontSize:"13px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.5,margin:"0 0 10px"}},t?e("sessions.batch.clearBody",{count:s}):e("sessions.clear.body")),t?r.createElement("ul",{"data-testid":"sessions-clear-list",style:{margin:"0 0 12px",paddingLeft:"18px",maxHeight:"220px",overflowY:"auto",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},a.map(t=>r.createElement("li",{key:t.id},t.title||e("sessions.row.noTitle")))):r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"12px"}},a[0]?.title||e("sessions.row.noTitle")),""!==Se?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},Se):null,r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},r.createElement("button",{type:"button","data-testid":"sessions-clear-cancel",style:Re,disabled:xe,onClick:()=>{we(null),Ee("")}},e("sessions.clear.cancel")),r.createElement("button",{type:"button","data-testid":"sessions-clear-confirm",style:He,disabled:xe,onClick:()=>{(async()=>{if(null===ye||xe)return;ke(!0),Ee("");const t=(Array.isArray(ye.items)?ye.items:[]).map(e=>e.id),a=!0===ye.batch;try{const r=await d("sessions-clear-deleted",{ids:t});if(r.ok)(e=>{const t=new Set(e),a=Sa.deleted;void 0!==a&&Array.isArray(a.deleted)&&(Sa.deleted={...a,deleted:a.deleted.filter(e=>!t.has(e.id))}),u(e=>{if(null===e)return e;const a=Array.isArray(e.deleted)?e.deleted:[];return{...e,deleted:a.filter(e=>!t.has(e.id))}}),M(e=>e.filter(e=>!t.has(e)))})(t),we(null),a&&(se(e("sessions.batch.completed",{action:e("sessions.action.clear"),count:t.length})),oe(""));else{const s=ka(e,r.error||"unknown");a?oe(e("sessions.batch.failed",{action:e("sessions.action.clear"),done:0,total:t.length,error:s})):Ee(s)}}catch(r){const s=e("sessions.error.network");a?oe(e("sessions.batch.failed",{action:e("sessions.action.clear"),done:0,total:t.length,error:s})):Ee(s)}finally{ke(!1)}})()}},e(xe?"sessions.status.working":"sessions.clear.confirm")))))})())}function Ma(){const e=J(),{value:s}=v(),[n,i]=Be.useEnabled(),c={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},[u,p]=a(S.getSnapshot());o(()=>S.subscribe(()=>p(S.getSnapshot())),[]),o(()=>(rt({all:!0}),()=>ft({all:!0})),[]);const[m,g]=a(new Set),h=e=>g(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a});o(()=>(ut(),it(()=>{$(ht()),F(gt())})),[]);const[f,b]=a(""),y=u.providers||[],[w,x]=a(null),[k,E]=a(null),[C,T]=a({expiresAt:"",label:""}),A=(e,t="")=>{x({provider:e.provider,account:t}),T({expiresAt:"",label:""})},[z,M]=a(null),[I,R]=a({name:"",value:""}),[O,H]=a(!1);o(()=>{if(!O)return;const e=setTimeout(()=>H(!1),3e3);return()=>clearTimeout(e)},[O]);const D=()=>{M(null),R({name:"",value:""}),H(!1)},L=t=>{const a=String(t?.error??""),r=["unknown-hint","invalid-value","credentials-unavailable"].includes(a)?e(`quota.credential.${a}`):`${a}${t?.detail?` (${t.detail})`:""}`;return e("quota.credential.saveFailed",{error:r})},N=async()=>{if(null!==w){b("");try{const t={provider:w.provider};"string"==typeof w.account&&""!==w.account&&(t.account=w.account),""!==C.expiresAt&&(t.expiresAt=C.expiresAt),""!==C.label&&(t.label=C.label);const a=await d("quota-reset-card",t);if(!0!==a?.ok)return void b(e("quota.saveFailed",{error:String(a?.error??"")}));T({expiresAt:"",label:""}),await xt({scope:"all"})}catch(t){const a=t instanceof Error&&"string"==typeof t.message&&""!==t.message.trim()?t.message.trim():"network";b(e("quota.saveFailed",{error:a}))}}},W=async t=>{b("");try{const a=await d("quota-refresh",{provider:t});if(!0!==a?.ok){const t=String(a?.error??"");return"refresh-cooldown"===t&&"number"==typeof a?.nextAllowedAt?void b(e("quota.refresh.cooldown",{time:nt(a.nextAllowedAt)})):void b("unknown-provider"===t?e("quota.unknownProvider"):"not-adapted"===t?e("quota.unadapted"):e("quota.saveFailed",{error:t}))}await xt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}},B=async t=>{b("");try{const a=await d("quota-config",t);if(!0!==a?.ok)return void b("unknown-provider"===a?.error?e("quota.unknownProvider"):e("quota.saveFailed",{error:String(a?.error??"")}));await xt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}},P=(e,t)=>B({provider:e,kind:t}),[j,$]=a(ht()),[V,F]=a(gt()),[U,K]=a(!1),[G,Y]=a(!1),[Q,Z]=a(null),X=l(null);o(()=>()=>{null!==X.current&&X.current(),X.current=null},[]);const ee=st(y.filter(e=>!0===e.adapted),j),te=new Set(V),ae=ee.filter(e=>!te.has(e.provider)),re=y.filter(e=>!0!==e.adapted),se={fontSize:"12px",padding:"3px 6px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},ne=()=>{Y(!0),null!==X.current&&X.current(),X.current=t.timer.timeout(()=>{X.current=null,Y(!1)},2e3)},oe=(e,t)=>{$(e),F(t),dt(e,t)},le=st(ee,j).map(e=>({id:e.provider,label:e.displayName||e.provider})),ie=(e,t)=>{const a=le.map(e=>e.id),r=a.indexOf(e),s=r+t;r<0||s<0||s>=a.length||r===s||(a.splice(s,0,a.splice(r,1)[0]),oe(a,V))},[de,ce]=a(""),[ue,pe]=a("");return r.createElement("div",{"data-testid":"remote-quota-card",style:be()},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginBottom:"8px"}},r.createElement("div",{style:Object.assign({},{fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},{margin:0})},e("quota.cardTitle")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},r.createElement("span",{style:{fontSize:"12px",lineHeight:1.5,color:"var(--dsw-alias-label-secondary)",textAlign:"right"}},e("quota.navToggleHint")),r.createElement("button",{type:"button",role:"switch","data-testid":"quota-nav-switch","aria-checked":String(n),"aria-label":e("quota.navToggle"),title:e("quota.navToggle"),onClick:()=>i(!n),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)"}})))),""!==f?r.createElement("p",{"data-testid":"quota-config-error",style:Object.assign({},c,{color:"var(--dsw-alias-state-error-primary)"})},f):null,...ee.length>=2?[r.createElement("div",{key:"quota-reorder-row",style:{display:"flex",justifyContent:"flex-end",margin:"2px 0 8px"}},r.createElement("button",{type:"button","data-testid":"quota-reorder-toggle","aria-expanded":String(U),title:e("quota.reorder"),onClick:()=>K(!U),style:{fontSize:"12px",lineHeight:"20px",padding:"2px 12px",..._(999),border:"1px solid "+(U?"var(--dsw-alias-brand-primary)":"var(--dsh-svc-border-strong)"),background:"transparent",color:U?"var(--dsw-alias-brand-primary)":"var(--dsw-alias-label-primary)",cursor:"pointer"}},e("quota.reorder")))]:[],U&&ee.length>=2?r.createElement("div",{"data-testid":"quota-card-order-panel",style:{display:"flex",flexDirection:"column",gap:"10px",margin:"0 0 12px",padding:"10px 12px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("div",{style:{minWidth:0,flex:"1 1 240px"}},r.createElement("div",{"data-testid":"quota-card-order-title",style:{fontSize:"13px",fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("quota.order.title")),r.createElement("div",{style:{marginTop:"3px",fontSize:"12px",lineHeight:1.6,color:"var(--dsw-alias-label-secondary)"}},e("quota.order.hint"))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},G?r.createElement("span",{"data-testid":"quota-card-order-saved",style:{fontSize:"12px",color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("config.navOrder.saved")):null,r.createElement("button",{type:"button","data-testid":"quota-card-order-reset",onClick:()=>{$([]),F([]),ct(),ne()},style:me("ghost")},e("config.navOrder.reset")),r.createElement("button",{type:"button","data-testid":"quota-card-order-save",onClick:()=>{oe(le.map(e=>e.id),V),ne()},style:me("primary")},e("config.navOrder.save")))),r.createElement("div",{"data-testid":"quota-card-order-list",style:{display:"flex",flexDirection:"column",gap:"8px"}},le.map((t,a)=>{const s=!te.has(t.id),n=Q===a;return r.createElement("div",{key:t.id,"data-testid":"quota-card-order-item-"+t.id,draggable:!0,onDragStart:e=>{try{e.dataTransfer.setData("text/plain",String(a)),e.dataTransfer.effectAllowed="move"}catch(e){}Z(a)},onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch(e){}},onDrop:e=>{e.preventDefault();let t=a;try{const a=e.dataTransfer.getData("text/plain");t=Number.parseInt(a,10)}catch(e){}if(!Number.isNaN(t)&&t!==a){const e=le.map(e=>e.id),[r]=e.splice(t,1);e.splice(a,0,r),oe(e,V)}Z(null)},onDragEnd:()=>Z(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"7px 10px",borderRadius:"var(--dsh-svc-radius-control, 8px)",border:"1px solid "+(n?"var(--dsw-alias-brand-primary)":"var(--dsw-alias-border-l1)"),background:n?"var(--dsw-alias-interactive-bg-hover)":"var(--dsh-svc-card-bg)",opacity:s?1:.5,transition:"border-color 120ms, background 120ms, opacity 120ms",cursor:"grab",userSelect:"none"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0}},r.createElement("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:"13px",letterSpacing:"-1px"},"aria-hidden":"true"},"⋮⋮"),r.createElement("span",{style:{fontSize:"13px",fontWeight:550,color:"var(--dsw-alias-label-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},t.label)),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}},r.createElement("button",{type:"button","data-testid":"quota-card-order-up-"+t.id,"aria-label":e("config.navOrder.moveUp"),title:e("config.navOrder.moveUp"),disabled:0===a,onClick:e=>{e.stopPropagation(),ie(t.id,-1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:0===a?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:0===a?"default":"pointer",opacity:0===a?.35:1,fontSize:"12px",lineHeight:"24px"}},"↑"),r.createElement("button",{type:"button","data-testid":"quota-card-order-down-"+t.id,"aria-label":e("config.navOrder.moveDown"),title:e("config.navOrder.moveDown"),disabled:a===le.length-1,onClick:e=>{e.stopPropagation(),ie(t.id,1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:a===le.length-1?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:a===le.length-1?"default":"pointer",opacity:a===le.length-1?.35:1,fontSize:"12px",lineHeight:"24px"}},"↓"),r.createElement("button",{type:"button",role:"switch","data-testid":"quota-card-order-toggle-"+t.id,"aria-checked":String(s),"aria-label":e(s?"config.navOrder.visible":"config.navOrder.hidden"),title:e(s?"config.navOrder.visible":"config.navOrder.hidden"),onClick:e=>{e.stopPropagation(),(e=>{const t=new Set(V);t.has(e)?t.delete(e):t.add(e),oe(le.map(e=>e.id),Array.from(t))})(t.id)},style:{width:"34px",height:"20px",..._("10px"),padding:0,position:"relative",flexShrink:0,border:"1px solid "+(s?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:s?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:s?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:s?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 120ms ease"}}))))}))):null,0===ee.length?r.createElement("p",{style:c},e("quota.noAdapted")):0===ae.length?r.createElement("p",{"data-testid":"quota-cards-all-hidden",style:c},e("quota.order.allHidden")):r.createElement("div",{"data-testid":"quota-card-list",style:{display:"flex",flexDirection:"column",gap:"10px"}},ae.map((t,a)=>{const n=r.createElement("span",{style:{fontWeight:600,fontSize:"12px",overflowWrap:"anywhere"}},!1===s.modelProviderIcons?null:q(t.provider,14,{verticalAlign:"-2px",marginRight:"5px"},`quota-provider-icon-${t.provider}`),"string"==typeof t.usageUrl&&""!==t.usageUrl?r.createElement("a",{"data-testid":`quota-usage-link-${t.provider}`,href:t.usageUrl,target:"_blank",rel:"noreferrer",title:e("quota.usageLink"),style:{color:"var(--dsw-alias-brand-primary)",textDecoration:"underline"}},t.displayName||t.provider):t.displayName||t.provider,"auto"===t.kindSource?r.createElement("span",{"data-testid":`quota-auto-tag-${t.provider}`,style:he("neutral",{marginLeft:"6px",verticalAlign:"middle"})},e("quota.kindAuto")):null),o=Array.isArray(t.windows)?t.windows:[],l=k===t.provider,i=(e,t)=>String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||`acct-${t}`,c=o.map(a=>Bt(a,e,t.provider)),u=Array.isArray(t.resetCards)?t.resetCards:[],p=u.filter(e=>"string"!=typeof e.account||""===e.account),g=(a,s)=>{const n=Lt(a,e),o="string"==typeof a.id&&""!==a.id?a.id:`idx-${s}`,i="string"==typeof a.account&&""!==a.account?` · ${a.account}`:"";return r.createElement("div",{key:o,"data-testid":`quota-reset-card-${t.provider}-${o}`,style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",lineHeight:"16px",color:n.textColor}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:n.iconColor,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0}},r.createElement("rect",{x:2,y:5,width:20,height:14,rx:2}),r.createElement("line",{x1:2,y1:10,x2:22,y2:10})),r.createElement("span",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",null,`${n.title}${i}`),""!==n.expiry?r.createElement("span",null,n.expiry):null),l?r.createElement("button",{type:"button","data-testid":`quota-remove-${t.provider}-${o}`,onClick:()=>(async(t,a)=>{b("");try{await d("quota-reset-card",{provider:t,remove:!0,id:a}),await xt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider,o),style:{fontSize:"11px",padding:"2px 10px",..._(999),border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"}},e("quota.resetCard.remove")):null)},f=p.map(g),v=u.filter(e=>"string"==typeof e.account&&""!==e.account),y=[],S=new Map;for(const e of v)S.has(e.account)||(S.set(e.account,[]),y.push(e.account)),S.get(e.account).push(e);const j=(a,s,n)=>r.createElement("div",{key:`codex-account-${s}`,"data-testid":`quota-cpa-account-${t.provider}-${s}`,style:{display:"flex",flexDirection:"column",gap:"10px"}},n.length>0?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},n):null,...((a,s)=>{const n=Nt(S.get(a)??[]),o=`card:${t.provider}:${s}`,l=m.has(o),i=l?n:n.slice(0,1),d=n.length-i.length;return[...i.map(g),d>0?r.createElement("button",{key:"reset-more",type:"button","data-testid":`quota-reset-more-${t.provider}-${s}`,onClick:()=>h(o),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},e("quota.resetCard.more",{count:d})):null,l&&n.length>1?r.createElement("button",{key:"reset-less",type:"button","data-testid":`quota-reset-less-${t.provider}-${s}`,onClick:()=>h(o),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},e("quota.resetCard.less")):null]})(a,s),l?r.createElement("div",{key:"reset-add-row",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-card-edit-${t.provider}-${s}`,onClick:()=>A(t,a),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e("quota.resetCard.edit"))):null,F(a,s)),$={fontSize:"12px",padding:"3px 6px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"130px"},V=(e,t,a,s)=>r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e,r.createElement("input",{type:a,"data-testid":t,value:C[s],onChange:e=>T({...C,[s]:e.target.value}),style:$})),F=(a,s)=>{const n="string"==typeof a?a:"";if(!l||null===w||w.provider!==t.provider)return null;if(("string"==typeof w.account?w.account:"")!==n)return null;const o=void 0===s?"":`-${s}`;return r.createElement("div",{key:`reset-editor${o}`,"data-testid":`quota-reset-editor-${t.provider}${o}`,style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"flex-end",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},V(e("quota.resetCard.dateLabel"),"quota-reset-input-date","datetime-local","expiresAt"),V(e("quota.resetCard.nameLabel"),"quota-reset-input-name","text","label"),r.createElement("button",{type:"button","data-testid":"quota-reset-card-save",onClick:N,style:{minHeight:"28px",padding:"4px 12px",borderRadius:"7px",border:"1px solid var(--dsw-alias-brand-primary)",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:"pointer",fontSize:"12px"}},e("quota.resetCard.add")),r.createElement("button",{type:"button","data-testid":"quota-reset-cancel",onClick:()=>x(null),style:ge()},e("quota.resetCard.cancel")))};let U;const K=()=>0===y.length?null:r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},y.map((e,t)=>j(e,i(e,t),[])));if(!0===t.refreshing&&0===o.length)U=r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.refreshing")),K());else if(void 0!==t.errorCode&&0===o.length)U=r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},r.createElement("span",{"data-testid":`quota-error-${t.provider}`,style:{fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},Wt(t,e)),K());else if(o.length>0){const a=a=>{const r=[],s=new Map;for(const e of a.windows){const t="string"==typeof e.label?e.label.trim():"";let a=s.get(t);void 0===a&&(a=r.length,s.set(t,a),r.push({account:t,windows:[]})),r[a].windows.push(e)}for(const e of y)s.has(e)||(s.set(e,r.length),r.push({account:e,windows:[]}));return r.map((a,r)=>j(a.account,i(a.account,r),a.windows.map(a=>Bt(a,e,t.provider))))},s="cliproxy"===t.kind?Vt(o):null;U=s&&s.length>0?r.createElement("div",{"data-testid":`quota-card-families-${t.provider}`,style:{display:"flex",flexDirection:"column",gap:"10px"}},s.map((s,n)=>r.createElement("div",{key:`family-${s.family}`,"data-testid":`quota-card-family-${t.provider}-${s.family}`,style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:0===n?"0":"4px",paddingTop:0===n?"0":"10px",borderTop:0===n?"none":"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{"data-testid":`quota-card-family-title-${t.provider}-${s.family}`,style:{fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("quota.family."+s.family)),"codex"===s.family?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},a(s)):r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},s.windows.map(a=>Bt(a,e,t.provider)))))):r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},c)}else U=r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.empty"));const G=Ot(t,o),Y=null!==G?r.createElement(Ht,{key:"peak-timeline",showCaption:!0,schedule:G}):null;return r.createElement("div",{key:t.provider,"data-testid":`quota-provider-card-${t.provider}`,style:{display:"flex",flexDirection:"column",gap:"8px",padding:"10px 12px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-card-bg)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"10px"}},n,r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px"}},r.createElement("button",{type:"button","data-testid":`quota-refresh-${t.provider}`,"aria-label":!0===t.manualOnly?e("quota.refresh.manual"):e("quota.refresh"),title:!0===t.manualOnly?e("quota.refresh.manual"):e("quota.refresh"),disabled:!0===t.refreshing,onClick:()=>W(t.provider),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"2px",border:"none",background:"transparent",color:!0===t.refreshing?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-secondary)",cursor:!0===t.refreshing?"default":"pointer",opacity:!0===t.refreshing?.45:1}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},r.createElement("path",{d:"M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.73 10h-2.08A6 6 0 1 1 12 6c1.66 0 3.14.69 4.22 1.77L13 11h7V4l-2.35 2.35z"}))),"number"==typeof t.fetchedAt?r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.updated",{time:nt(t.fetchedAt)})):null)),U,...null!==Y?[Y]:[],r.createElement("div",{key:"advanced-toggle-row",style:{display:"flex",marginTop:"2px"}},r.createElement("button",{type:"button","data-testid":`quota-advanced-toggle-${t.provider}`,"aria-expanded":String(l),onClick:()=>E(l?null:t.provider),style:{fontSize:"11px",lineHeight:"20px",padding:"2px 10px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer"}},`${l?"▾":"▸"} ${e("quota.advanced")}`)),...l&&Array.isArray(t.credentialHints)&&t.credentialHints.length>0?(()=>{const a=null!==z&&z.provider===t.provider,s=t.credentialHints,n=s.some(e=>e.name===I.name)?I.name:s[0]?.name??"",o=s.find(e=>e.name===n),l=s.some(e=>!0===e.configured);return[a?r.createElement("div",{key:"cred-editor","data-testid":`quota-cred-editor-${t.provider}`,style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"flex-end",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},s.length>1?r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e("quota.credential.nameLabel"),r.createElement("select",{"data-testid":"quota-cred-name-select",value:n,onChange:e=>{R({...I,name:e.target.value}),H(!1)},style:se},s.map((t,a)=>r.createElement("option",{key:t.name,value:t.name},`${t.name}${0===a?` · ${e("quota.credential.primary")}`:""} · ${!0===t.configured?e("quota.credential.configured"):e("quota.credential.notConfigured")}`)))):r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",alignSelf:"center"}},`${n}${!0===o?.configured?` · ${e("quota.credential.configured")}`:""}`),r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e("quota.credential.valueLabel"),r.createElement("input",{type:"password","data-testid":"quota-cred-input-value",value:I.value,onChange:e=>R({...I,value:e.target.value}),autoComplete:"off",style:$})),r.createElement("button",{type:"button","data-testid":"quota-cred-save",onClick:()=>(async t=>{b("");try{const e=await d("quota-credential-set",{provider:t,name:I.name,value:I.value});if(!0!==e?.ok)return void b(L(e));D(),await W(t)}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider),disabled:""===I.value.trim(),style:{minHeight:"28px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-brand-primary)",background:""===I.value.trim()?"transparent":"var(--dsw-alias-brand-primary)",color:""===I.value.trim()?"var(--dsw-alias-label-tertiary)":"var(--dsh-svc-brand-text)",cursor:""===I.value.trim()?"default":"pointer",fontSize:"12px"}},e("quota.credential.save")),...!0===o?.configured&&!1!==o?.writable?[r.createElement("button",{type:"button",key:"cred-clear","data-testid":"quota-cred-clear",title:O?e("quota.credential.clearConfirm"):void 0,onClick:()=>{O?(H(!1),(async(t,a)=>{b("");try{const e=await d("quota-credential-unset",{provider:t,name:a});if(!0!==e?.ok)return void b(L(e));await W(t)}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider,n)):H(!0)},style:{minHeight:"28px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:O?"var(--dsw-alias-state-error-primary)":"transparent",color:O?"var(--dsh-svc-brand-text)":"var(--dsw-alias-state-error-primary)",cursor:"pointer",fontSize:"12px",whiteSpace:"nowrap"}},e(O?"quota.credential.clearConfirm":"quota.credential.clear"))]:[],r.createElement("button",{type:"button","data-testid":"quota-cred-cancel",onClick:D,style:ge()},e("quota.resetCard.cancel"))):r.createElement("div",{key:"cred-entry",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-cred-edit-${t.provider}`,onClick:()=>(e=>{const t=Array.isArray(e.credentialHints)?e.credentialHints:[];x(null),M({provider:e.provider}),R({name:(t.find(e=>!0===e.configured)??t[0])?.name??"",value:""}),H(!1)})(t),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsw-alias-brand-primary)",background:"transparent",color:"var(--dsw-alias-brand-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e(l?"quota.credential.editExisting":`quota.credential.${"string"==typeof t.credentialEntryKey&&""!==t.credentialEntryKey?t.credentialEntryKey:"edit"}`)))]})():[],...f,F(""),...l?[r.createElement("div",{key:"advanced-footer",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},r.createElement("select",{"data-testid":`quota-kind-select-${t.provider}`,value:t.kind,"aria-label":`${e("quota.adapt")} · ${t.displayName||t.provider}`,onChange:e=>{var a;""===e.target.value?P(t.provider,null):"__auto__"===e.target.value?(a=t.provider,B({provider:a,clear:!0})):P(t.provider,e.target.value)},style:se},at.map(t=>r.createElement("option",{key:t,value:t},e(`quota.kind.${t}`))),r.createElement("option",{value:"__auto__"},e("quota.followAuto")),r.createElement("option",{value:""},e("quota.disable")))),..."zai-coding-cn"===t.kind?[r.createElement("div",{key:"reset-add-row",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-card-edit-${t.provider}`,onClick:()=>A(t),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e("quota.resetCard.edit")))]:[]]:[])})),...re.length>0?[r.createElement("div",{key:"quota-add-adapt","data-testid":"quota-add-adapt",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginTop:ee.length>0?"2px":"4px",paddingTop:"10px",borderTop:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.addAdapt")),r.createElement("select",{"data-testid":"quota-add-provider",value:de,onChange:e=>ce(e.target.value),style:se},r.createElement("option",{value:""},e("quota.addPickProvider")),re.map(e=>r.createElement("option",{key:e.provider,value:e.provider},e.displayName||e.provider))),r.createElement("select",{"data-testid":"quota-add-kind",value:ue,onChange:e=>pe(e.target.value),style:se},r.createElement("option",{value:""},e("quota.addPickKind")),at.map(t=>r.createElement("option",{key:t,value:t},e(`quota.kind.${t}`)))),r.createElement("button",{type:"button","data-testid":"quota-add-submit",disabled:""===de||""===ue,onClick:()=>{P(de,ue),ce(""),pe("")},style:{fontSize:"12px",padding:"3px 12px",borderRadius:"7px",border:"1px solid var(--dsw-alias-brand-primary)",background:""===de||""===ue?"transparent":"var(--dsw-alias-brand-primary)",color:""===de||""===ue?"var(--dsw-alias-label-tertiary)":"var(--dsh-svc-brand-text)",cursor:""===de||""===ue?"default":"pointer"}},e("quota.adapt")))]:[])}null!==qa&&console.info("[dsh-service-md] session detail markdown renderer ready");const Ia="dsh-service-usage-failures-dismissed",{ModelsSection:Ra,canLeave:Oa}=function({useTranslation:t,rpcCall:a,SvcTabs:s,useFeatures:n,modelsNavToggle:o}){const l=r.createElement,{useState:i,useEffect:d,useRef:c}=r;function u(t){const{Modal:a}=e("@deepseek-ai/dsh-client-ui-primitives");return l(a,t)}const p={padding:"16px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"12px",background:"var(--dsw-alias-bg-layer-3)",minWidth:0,overflowWrap:"anywhere",marginBottom:"12px"},m={padding:"12px 14px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"10px",background:"var(--dsw-alias-bg-layer-2)",minWidth:0,marginBottom:"8px"},g={width:"100%",minWidth:0,boxSizing:"border-box",minHeight:"var(--dsh-svc-control-h, 36px)",padding:"6px 10px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsh-svc-border-strong)",background:"var(--dsh-svc-content-bg)",color:"var(--dsh-svc-text)",font:"inherit",fontSize:"13px",lineHeight:"20px"},h={fontSize:"12px",color:"var(--dsh-svc-text-muted)"},f={display:"block",fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"4px"},b={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"12px",marginBottom:"12px"},v={display:"flex",gap:"8px",flexWrap:"wrap",alignItems:"center"},y=["name","contextWindow","maxTokens","input","reasoningEfforts","compat"],w=["displayName","api","baseURL"],x=["contextWindow","maxTokens","defaultContextWindow","defaultMaxTokens","timeoutMs","websocketConnectTimeoutMs","streamIdleTimeoutMs","maxRequestImageBytes","requestImagePixelBudget","requestImageMaxBytes"],k=["minimal","low","medium","high","xhigh","max"],S=e=>{if(!String(e).trim())return;const t=/^(\d+(?:\.\d+)?)([km])?$/i.exec(String(e).trim());if(!t)throw new Error("schema-invalid");const a=Number(t[1])*("m"===t[2]?.toLowerCase()?1e6:"k"===t[2]?.toLowerCase()?1e3:1);if(!Number.isSafeInteger(a)||a<=0)throw new Error("schema-invalid");return a},E=e=>!Number.isInteger(e)||e<=0?"":e>=1e6&&e%1e5==0?e/1e6+"M":e>=1e3&&e%100==0?e/1e3+"K":String(e),C=(e,t)=>JSON.stringify(e)===JSON.stringify(t),T=e=>void 0===e?"—":"object"==typeof e?JSON.stringify(e):String(e),A=(e,t)=>Object.fromEntries(t.map(t=>[t,x.includes(t)?void 0===e[t]?"":String(e[t]):void 0===e[t]?"":e[t]])),z=(e,t,a,r,s={})=>{const n=A(t,r),o=A(a,r);return Object.fromEntries(r.map(t=>[t,!s[t]&&C(e[t],n[t])?o[t]:e[t]]))},M=e=>{if("string"!=typeof e)return e;if(!e.trim()||!Number.isFinite(Number(e)))throw new Error("schema-invalid");return Number(e)},I=(e,t)=>"thinkingBudgets"===e&&t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([e,t])=>[e,M(t)])):"retryPolicy"===e&&t&&"object"==typeof t?{...t,...void 0===t.maxRetries?{}:{maxRetries:M(t.maxRetries)},...void 0===t.backoff?{}:{backoff:Object.fromEntries(Object.entries(t.backoff).map(([e,t])=>[e,M(t)]))}}:"compat"===e&&t&&"object"==typeof t&&void 0!==t.vllmPriority?{...t,vllmPriority:M(t.vllmPriority)}:t,R=(e,t,a)=>{const r={},s=[];for(const n of a){let a=e[n];if(x.includes(n))if(""===String(a??"").trim())a=void 0;else if("timeoutMs"===n||"websocketConnectTimeoutMs"===n||"streamIdleTimeoutMs"===n){if(a=Number(a),!Number.isFinite(a)||a<0)throw new Error("schema-invalid")}else a=S(a);else a=""===a?void 0:I(n,a);C(a,t[n])||(void 0===a?s.push(n):r[n]=a)}return{patch:r,unset:s}},O=new Set,H=()=>[...O].every(e=>e());function D(e,t){const a=c({dirty:e,tr:t});a.current={dirty:e,tr:t},d(()=>{const e=()=>!a.current.dirty||"undefined"!=typeof window&&"function"==typeof window.confirm&&window.confirm(a.current.tr("models.smart.leave"));O.add(e);const t=e=>{a.current.dirty&&(e.preventDefault(),e.returnValue="")},r=t=>{"Escape"===t.key&&a.current.dirty&&!e()&&(t.preventDefault(),t.stopImmediatePropagation?.())},s=t=>{if(!a.current.dirty||"undefined"==typeof document)return;const r=document.querySelector?.('[role="dialog"][data-shortcut-modal="settings"]'),s=t.target?.closest?t.target:t.target?.parentElement;if(!r||!s)return;const n=s.closest('[class*="_close"]'),o=s.closest("nav button"),l=s.closest('[class*="_mask"]');(n&&r.contains(n)||o&&r.contains(o)&&!o.closest('[data-testid="service-panel-root"]')||l&&l.parentElement===r.parentElement)&&!e()&&(t.preventDefault(),t.stopImmediatePropagation?.())};return"undefined"!=typeof window&&window.addEventListener?.("beforeunload",t),"undefined"!=typeof document&&(document.addEventListener?.("keydown",r,!0),document.addEventListener?.("click",s,!0)),()=>{O.delete(e),"undefined"!=typeof window&&window.removeEventListener?.("beforeunload",t),"undefined"!=typeof document&&(document.removeEventListener?.("keydown",r,!0),document.removeEventListener?.("click",s,!0))}},[])}function L({id:e,onClick:t,children:a,danger:r=!1,compact:s=!1,disabled:n=!1,style:o,...i}){const d=s?ge(r?{color:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)"}:{}):me(r?"dangerGhost":"neutral");return l("button",{...i,type:"button","data-testid":e,disabled:n,style:{...d,whiteSpace:"nowrap",flexShrink:0,...o},onClick:t},a)}function N({kind:e}){return l("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},"test"===e?l("g",{transform:"rotate(-45 12 12)",fill:"currentColor",stroke:"none"},l("path",{d:"M1 11h3V8h4v1h3v2H8v2h3v2H8v1H4v-3H1Z"}),l("path",{d:"M23 11h-3V8h-4v1h-3v2h3v2h-3v2h3v1h4v-3h3Z"})):l("path","edit"===e?{d:"m15 5 4 4M4 20l4-1L20 7a2.8 2.8 0 0 0-4-4L4 15l-1 6Z"}:{d:"M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6m4-6v6"}))}function W({error:e}){const a=t();if(!e)return null;const r="models.smart.error."+e;return l("p",{role:"alert","data-testid":"model-config-error",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",margin:"8px 0",overflowWrap:"anywhere"}},a(r)===r?a("models.smart.error.generic").replace("{code}",e):a(r))}function B({value:e,onChange:a,label:r,template:s=!1}){const n=t(),o=e&&"object"==typeof e&&!Array.isArray(e)?Object.entries(e):[],[d,c]=i("");return l("fieldset",{style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",padding:"10px",minWidth:0,marginTop:"8px"}},l("legend",{style:f},r),...o.map(([t,r])=>l("div",{key:t,style:{marginBottom:"6px",minWidth:0,display:"flex",alignItems:"center",gap:"8px"}},l("span",{style:{minWidth:"90px",fontSize:"12px"}},t),l("div",{style:{flex:1}},((t,r)=>{const o=r=>a({...e,[t]:r});return s?l("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minWidth:0}},l("select",{style:g,"aria-label":t+" "+n("models.smart.type"),value:null!==r&&"object"==typeof r?"variable":null===r?"null":typeof r,onChange:e=>o("variable"===e.target.value?{$var:"thinking.enabled"}:"null"===e.target.value?null:"boolean"!==e.target.value&&("number"===e.target.value?0:""))},["string","number","boolean","null","variable"].map(e=>l("option",{key:e,value:e},n("models.smart.type."+e)))),"boolean"==typeof r?l("select",{style:g,value:String(r),onChange:e=>o("true"===e.target.value),"aria-label":t},["true","false"].map(e=>l("option",{key:e},e))):null!==r&&"object"==typeof r?l("div",null,l("select",{style:g,value:r.$var,"aria-label":t,onChange:e=>o({...r,$var:e.target.value})},["thinking.enabled","thinking.effort","thinking.budget"].map(e=>l("option",{key:e},e))),l("label",null,l("input",{type:"checkbox",checked:!0===r.omitWhenOff,onChange:e=>o({...r,omitWhenOff:e.target.checked})}),"omitWhenOff")):null===r?null:l("input",{style:g,value:r,"aria-label":t,onChange:e=>o("number"==typeof r?Number(e.target.value):e.target.value)})):l("input",{style:g,value:r??"","aria-label":t,onChange:e=>o(e.target.value)})})(t,r)),l(L,{onClick:()=>{const r={...e};delete r[t],a(r)},danger:!0},n("models.smart.remove")))),l("div",{style:{...v,marginTop:"6px"}},l("input",{style:{...g,width:"180px"},value:d,"aria-label":n("models.smart.newKey"),placeholder:n("models.smart.newKey"),onChange:e=>c(e.target.value)}),l(L,{onClick:()=>{!d||["__proto__","constructor","prototype","__jsExpr"].includes(d)||Object.hasOwn(e??{},d)||(a({...e,[d]:""}),c(""))}},n("models.smart.add"))))}function P({value:e,onChange:a,schema:r,api:s}){const n=t(),o=r.compatGates[s]??[],i=r.compatEnums,d=(t,r)=>{const s={...e||{}};""===r?delete s[t]:s[t]=r,a(s)};return l("div",{"data-testid":"model-compat-editor",style:{marginTop:"8px"}},...o.map(t=>"chatTemplateArgs"===t||"chatTemplateKwargs"===t?l(B,{key:t,label:t,template:!0,value:e?.[t],onChange:e=>d(t,e)}):l("label",{key:t,style:{display:"block",marginTop:"6px"}},l("span",{style:f},t),"vllmPriority"===t?l("input",{style:g,"aria-label":t,value:e?.[t]??"",onChange:e=>d(t,e.target.value)}):l("select",{style:g,"aria-label":t,value:void 0===e?.[t]?"":String(e[t]),onChange:e=>d(t,""===e.target.value?"":i[t]?e.target.value:"true"===e.target.value)},l("option",{value:""},n("models.smart.inherit")),...(i[t]??["true","false"]).map(e=>l("option",{key:e,value:e},e))))),l("p",{style:{...h,marginTop:"6px"}},n("models.smart.compatHint")))}function j({field:e,value:a,onChange:r,schema:s,api:n,effective:o,displayValue:i}){const d=t(),c=d("models.smart.field."+e)==="models.smart.field."+e?e:d("models.smart.field."+e);if("compat"===e)return l(P,{value:a,onChange:r,schema:s,api:n});if("headers"===e)return l(B,{value:a,onChange:r,label:c});if("thinkingBudgets"===e)return l("fieldset",{style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",padding:"10px",minWidth:0,marginTop:"8px"}},l("legend",{style:f},c),...["minimal","low","medium","high"].map(e=>l("label",{key:e,style:{display:"block",marginTop:"4px"}},l("span",{style:{fontSize:"12px"}},e),l("input",{style:g,value:a?.[e]??"","aria-label":"thinkingBudgets."+e,onChange:t=>{const s={...a||{}};""===t.target.value?delete s[e]:s[e]=t.target.value,r(s)}}))));if("retryPolicy"===e)return l("fieldset",{style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",padding:"10px",minWidth:0,marginTop:"8px"}},l("legend",{style:f},c),l("select",{style:g,"aria-label":c,value:a?.mode??"",onChange:e=>r(e.target.value?{...a,mode:e.target.value}:"")},l("option",{value:""},d("models.smart.inherit")),...["normal","always"].map(e=>l("option",{key:e},e))),"normal"===a?.mode?l("label",{style:{display:"block",marginTop:"6px"}},l("span",{style:f},"maxRetries"),l("input",{style:g,"aria-label":"maxRetries",value:a.maxRetries??"",onChange:e=>{const t={...a};e.target.value?t.maxRetries=e.target.value:delete t.maxRetries,r(t)}})):null,"normal"===a?.mode?l("label",{style:{display:"block",marginTop:"6px"}},l("span",{style:f},"retryableCodes"),l("input",{style:g,"aria-label":"retryableCodes",value:(a.retryableCodes??[]).join(", "),onChange:e=>{const t={...a};e.target.value?t.retryableCodes=e.target.value.split(",").map(e=>e.trim()):delete t.retryableCodes,r(t)}})):null,a?.mode?["initialDelayMs","maxDelayMs","jitterRatio"].map(e=>l("label",{key:e,style:{display:"block",marginTop:"6px"}},l("span",{style:f},"backoff."+e),l("input",{style:g,"aria-label":"backoff."+e,value:a.backoff?.[e]??"",onChange:t=>{const s={...a.backoff||{}};t.target.value?s[e]=t.target.value:delete s[e],r({...a,backoff:s})}}))):null);const u=s?.routeEnums?.[e];return l("label",{style:{display:"block",minWidth:0}},l("span",{style:f},c),u?l("select",{style:g,"aria-label":c,value:a??"",onChange:e=>r(e.target.value)},l("option",{value:""},d("models.smart.inherit")),...u.map(e=>l("option",{key:e},e))):l("input",{style:g,"aria-label":c,"data-testid":"model-field-"+e,value:""===a||void 0===a?i??"":a,onChange:e=>r(e.target.value),placeholder:d("models.smart.inherit")}),void 0!==o?l("small",{style:h},d("models.smart.effective")+": "+T(o)):null)}function $({groups:e,draft:a}){const r=t();return l("div",{"data-testid":"model-smart-groups",style:{marginTop:"8px"}},...e.map(e=>{const t=e.path?.length?e.path.reduce((e,t)=>e?.[t],a):a[e.field],s=r("models.smart.field."+e.field),n=t=>"input"===e.field&&Array.isArray(t)?[...new Set(t)].sort():t,o=n(t),i=n(e.candidate.value),d=C(o,i)||"object"!=typeof o&&"object"!=typeof i&&String(o)===String(i),c=e=>!1===e?l("span",{style:h},r("models.smart.reasoning.false")):e&&"object"==typeof e&&0!==Object.keys(e).length?l("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"4px"}},...k.filter(t=>Object.hasOwn(e,t)).map(e=>l("span",{key:e,style:he("neutral")},e))):l("span",{style:h},r("models.smart.reasoning.inherit"));return l("div",{key:e.key,style:{marginTop:"8px",fontSize:"12px",overflowWrap:"anywhere"},"data-testid":"model-suggestion-"+e.key},l("b",null,e.path?.length>1?e.key:s),"reasoningEfforts"===e.field?l("div",{"data-testid":"model-suggestion-diff-"+e.key,style:{marginTop:"6px"}},d?null:l("div",{style:{marginBottom:"8px"}},l("span",{style:h},r("models.smart.currentEfforts")),c(o)),l("span",{style:h},r("models.smart.suggestedEfforts")),c(i)):l("div",{"data-testid":"model-suggestion-diff-"+e.key},d?T(i):T(""===o?void 0:o)+" → "+T(i)))}))}function V({text:e,title:t,checked:a,disabled:r=!1,onClick:s}){return l("label",{title:t,style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"6px 8px",..._("8px"),border:"1px solid var(--dsw-alias-border-l2)",background:a?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)",cursor:r?"default":"pointer",fontSize:"13px"}},l("input",{type:"checkbox","aria-label":t,checked:a,disabled:r,onChange:s,style:{margin:0,width:"16px",height:"16px",accentColor:"var(--dsw-alias-button-primary-fill)"}}),e)}function F({opened:e,model:r,isNew:s=!1,onBack:n,onSaved:o}){const w=t(),S=r,q=c(null);d(()=>{q.current?.scrollIntoView?.({block:"start",behavior:"instant"})},[]);const[M,I]=i(A(r,y)),[O,N]=i(r.id??""),[B,P]=i(!1),[F,U]=i(null),[K,G]=i(null),[Y,Q]=i(!1),[J,Z]=i(""),[X,ee]=i(!1),[te,ae]=i(""),[re,se]=i(0),[ne,oe]=i(null),le=function(e){return(e?.groups??[]).flatMap(e=>{const t=e.candidates?.find(e=>"exact-channel-protocol"===e.evidence)??e.candidates?.[0];return t&&y.includes(e.field)?[{...e,candidate:t}]:[]})}(K),[ie,de]=i(null),[ce,ue]=i(null),[pe,ge]=i(null),[he,fe]=i(null),[be,ve]=i({}),ye=pe??e,we=he??S,xe={...ye.catalogModels?.find(e=>e.id===O&&(!r.api||e.api===r.api))??{},...ye.effective?.models?.find(e=>e.id===O)??{},...ye.resolved?.models?.find(e=>e.id===O)??{}};void 0===xe.contextWindow&&(xe.contextWindow=ye.profile.defaultContextWindow),void 0===xe.maxTokens&&(xe.maxTokens=ye.profile.defaultMaxTokens),void 0===xe.input&&(xe.input=ye.profile.defaultInput);const ke=e.profile.api||xe.api||e.resolvedApi||e.effective?.api||e.catalogModels?.find(e=>e.api)?.api,Se=c(0),Ee=!C(M,A(we,y))||O!==(we.id??"");D(Ee,w),d(()=>{const t=++Se.current;if(!B||!O.trim())return G(null),void Q(!1);let r=!0;return G(null),oe(null),Q(!0),a("models3-fill",{route:e.route,modelId:O.trim(),api:ke}).then(e=>{r&&Se.current===t&&(Q(!1),e.ok?(G(e.value),Z(e=>"conflict"===e||"schema-invalid"===e||"configuration-rejected"===e?e:"")):Z(e.error))}).catch(()=>{r&&Se.current===t&&(Q(!1),Z("operation-failed"))}),()=>{r=!1,Se.current++}},[B,O,e.route,ke,re]);const Ce=()=>{const e=""===M.input||void 0===M.input?xe.input:M.input;return Array.isArray(e)&&e.length>0?e:"image"===e?["text","image"]:"image-only"===e?["image"]:["text"]},Te=e=>{if("text"===e)return;const t=[...new Set(["text",...Ce()])];let a;if(t.includes(e)){if(1===t.length&&"text"===e)return;a=t.filter(t=>t!==e)}else a=[...t,e];I({...M,input:a})},qe=""===M.reasoningEfforts||void 0===M.reasoningEfforts?xe.reasoningEfforts:M.reasoningEfforts,Ae=!1===qe,ze="object"==typeof qe&&null!==qe?qe:{};return l("article",{ref:q,style:p,"data-testid":"model-detail","data-model-id":O},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"16px",flexWrap:"wrap"}},l("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l(L,{id:"model-detail-back",onClick:()=>{H()&&n()}},w("models.smart.back")),l("h3",{style:{margin:0,fontSize:"16px",fontWeight:600}},w("models.smart.editTitle")))),ne?l(u,{open:!0,title:w("models.smart.fillAll"),closeLabel:w("models.smart.cancel"),onClose:()=>oe(null),footer:l("div",{style:v},l(L,{onClick:()=>oe(null)},w("models.smart.cancel")),l(L,{id:"model-smart-fill-confirm",style:me("primary"),onClick:()=>{I(e=>function(e,t){const a={...e};for(const e of t){const t=e.candidate.value;e.path?.length>1?a[e.path[0]]={...a[e.path[0]]||{},[e.path[1]]:t}:(a[e.field]=x.includes(e.field)?void 0===t?"":String(t):void 0===t?"":t,"input"===e.field&&Array.isArray(t)&&(a.input=[...new Set(["text",...t])]))}return a}(e,ne)),oe(null)}},w("models.smart.confirmFill")))},l("p",{style:h},w("models.smart.fillConfirmPrompt")),l($,{groups:ne,draft:M})):null,l("div",{style:b},l("div",null,l("label",{style:f},w("models.wb.edit.modelId")||"模型 ID"),l("input",{style:g,value:O,placeholder:w("models.wb.edit.modelIdPlaceholder"),"aria-label":"模型 ID","data-testid":s?"model-new-id":void 0,onChange:e=>N(e.target.value)})),l("div",null,l("label",{style:f},w("models.smart.field.name")),l("input",{style:g,value:""===M.name?xe.name||"":M.name,"aria-label":w("models.smart.field.name"),"data-testid":"model-field-name",placeholder:xe.name||w("models.wb.edit.displayNamePlaceholder"),onChange:e=>I({...M,name:e.target.value})}))),l("div",{style:{...v,margin:"36px 0 12px"}},l("span",{style:{fontSize:"13px"}},w("models.smart.title")),l("button",{type:"button",role:"switch","aria-checked":B,"data-testid":"model-smart-toggle","aria-label":w("models.smart.title"),"aria-describedby":F?"model-smart-help":void 0,onMouseEnter:e=>{const t=e.currentTarget.getBoundingClientRect();U({x:t.left,y:t.bottom})},onMouseLeave:()=>U(null),onFocus:e=>{const t=e.currentTarget.getBoundingClientRect();U({x:t.left,y:t.bottom})},onBlur:()=>U(null),style:{width:"38px",height:"22px",..._("999px"),border:0,padding:"2px",display:"inline-flex",alignItems:"center",justifyContent:B?"flex-end":"flex-start",background:B?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)",cursor:"pointer"},onClick:()=>P(!B)},l("span",{style:{width:"18px",height:"18px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}})),B?l(L,{id:"model-smart-refresh",onClick:()=>se(re+1)},w("models.smart.refresh")):null),F?l("div",{id:"model-smart-help",role:"tooltip",style:{position:"fixed",zIndex:1e3,left:Math.max(12,Math.min(F.x,window.innerWidth-312)),top:Math.max(12,Math.min(F.y+8,window.innerHeight-180)),width:"300px",maxWidth:"calc(100vw - 24px)",boxSizing:"border-box",padding:"10px 12px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",fontSize:"12px",lineHeight:"18px",overflowWrap:"anywhere",pointerEvents:"none"}},w("models.smart.help")):null,B?l("div",{style:{padding:"8px 12px",background:"var(--dsw-alias-bg-layer-2)",borderRadius:"8px",marginBottom:"14px",border:"1px solid var(--dsw-alias-border-l2)"}},Y?l("p",{role:"status","data-testid":"model-smart-loading",style:{...h,margin:0}},w("models.smart.loading")):null,K?l("div",null,le.length>0?l("div",{"data-testid":"model-smart-inline-bar",style:{...v,justifyContent:"space-between",marginBottom:"8px"}},l("b",{style:{fontSize:"12px"}},w("models.smart.suggestedValues")),l(L,{id:"model-smart-auto-fill","data-testid":"model-smart-auto-fill",style:me("primary"),onClick:()=>oe(le)},w("models.smart.fillAll"))):null,0===le.length?l("p",{role:"status","data-testid":"model-smart-empty",style:{...h,margin:0}},w("models.smart.noSuggestions")):l($,{groups:le,draft:M}),le.some(e=>"reasoningEfforts"===e.field)?null:l("p",{role:"status","data-testid":"model-smart-reasoning-empty",style:{...h,margin:"10px 0 0"}},w(K.reasoningSupported?"models.smart.reasoningSupportedNoLevels":"models.smart.noReasoningSuggestions"))):null):null,l("div",{style:b},l("div",null,l("label",{style:f},w("models.wb.edit.context")||"上下文窗口"),l("input",{style:g,"data-testid":"model-field-contextWindow","aria-label":w("models.smart.field.contextWindow"),value:""===M.contextWindow?E(xe.contextWindow):M.contextWindow,placeholder:E(xe.contextWindow)||w("models.wb.edit.contextPlaceholder"),onChange:e=>I({...M,contextWindow:e.target.value})}),xe.contextWindow?l("small",{style:h},w("models.smart.effective")+": "+E(xe.contextWindow)):null),l("div",null,l("label",{style:f},w("models.wb.edit.maxTokens")||"最大输出 token"),l("input",{style:g,"data-testid":"model-field-maxTokens","aria-label":w("models.smart.field.maxTokens"),value:""===M.maxTokens?E(xe.maxTokens):M.maxTokens,placeholder:E(xe.maxTokens)||w("models.wb.edit.maxTokensPlaceholder"),onChange:e=>I({...M,maxTokens:e.target.value})}),xe.maxTokens?l("small",{style:h},w("models.smart.effective")+": "+E(xe.maxTokens)):null)),l("section",{style:{margin:"18px 0"},"data-testid":"model-advanced-options"},l("div",{"data-testid":"model-modalities-row",style:{display:"grid",gridTemplateColumns:"minmax(0, 2fr) minmax(0, 1fr)",gap:"8px",marginBottom:"18px"}},l("div",null,l("label",{style:f},w("models.wb.edit.inputModalities")||"输入模态"),l("select",{style:{display:"none"},"aria-label":w("models.smart.field.input"),value:Ce().includes("image")?"image":"text",onChange:e=>I({...M,input:"image"===e.target.value?["text","image"]:["text"]})},l("option",{value:"text"},"text"),l("option",{value:"image"},"image")),l("div",{style:{display:"flex",gap:"8px"}},l(V,{text:"文本",title:"文本输入",checked:!0,disabled:!0,onClick:()=>Te("text")}),l(V,{text:"图片",title:"图片输入",checked:Ce().includes("image"),onClick:()=>Te("image")}))),l("div",null,l("label",{style:f},w("models.wb.edit.outputModalities")||"输出模态"),l("div",{style:{display:"flex",gap:"8px"}},l(V,{text:"文本",title:"文本输出",checked:!0,disabled:!0})))),l("div",{style:{marginBottom:"14px"}},l("label",{style:f},w("models.wb.edit.reasoningLevels")||"推理档位"),l("select",{style:{display:"none"},"aria-label":w("models.smart.field.reasoningEfforts"),value:Ae?"false":Object.keys(ze).length>0?"map":"inherit",onChange:e=>I({...M,reasoningEfforts:"false"!==e.target.value&&("map"===e.target.value?{}:"")})},l("option",{value:"inherit"},"inherit"),l("option",{value:"false"},"false"),l("option",{value:"map"},"map")),l("div",{className:"dsh-model-efforts","data-testid":"model-efforts-row",style:{display:"flex",flexWrap:"nowrap",gap:"2px",alignItems:"stretch",margin:"6px 0",minWidth:0}},l("style",null,".dsh-model-efforts { container-type:inline-size; } .dsh-model-efforts .dsh-model-effort-label { width:100%; box-sizing:border-box; justify-content:center; font-size:clamp(6px, 2.7cqw, 14px); gap:clamp(1px, .4cqw, 4px); padding:8px 1px; } .dsh-model-efforts .dsh-model-effort-check { width:clamp(8px, 2.9cqw, 16px); height:clamp(8px, 2.9cqw, 16px); }"),k.map(e=>{const t=(e=>!Ae&&Object.hasOwn(ze,e))(e);return l("span",{key:e,style:{display:"flex",alignItems:"stretch",minWidth:0,flex:"1 1 0"}},l("label",{"data-testid":"models-effort-"+e,className:"dsh-model-effort-label",style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",..._("6px"),cursor:"pointer",border:"1px solid "+(t?"var(--dsh-svc-brand, #3b82f6)":"var(--dsw-alias-border-l2)"),background:t?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)",color:t?"var(--dsw-alias-label-primary)":"var(--dsh-svc-text-muted)",fontWeight:t?600:400}},l("input",{type:"checkbox",className:"dsh-model-effort-check",checked:t,"aria-label":e,onChange:()=>(e=>{const t={...ze};Object.hasOwn(t,e)?delete t[e]:t[e]="off"===e?null:e,I({...M,reasoningEfforts:0===Object.keys(t).length?void 0:t})})(e),style:{margin:0,flexShrink:0,accentColor:"var(--dsw-alias-button-primary-fill)"}}),e),t?l("input",{style:{display:"none"},"aria-label":e+" wire",value:"string"==typeof ze[e]?ze[e]:"",placeholder:e,onChange:t=>((e,t)=>{const a={...ze,[e]:t};I({...M,reasoningEfforts:a})})(e,t.target.value)}):null)})))),l("div",{style:{display:"none"}},l(j,{field:"compat",value:M.compat,schema:e.schema,api:e.profile.api,onChange:e=>I({...M,compat:e})})),s?l("details",{style:{margin:"16px 0"},"data-testid":"model-new-parameters"},l("summary",{style:{cursor:"pointer",...h}},w("models.smart.parametersJson")),l("pre",{style:{padding:"12px",background:"var(--dsw-alias-bg-layer-2)",borderRadius:"8px",fontSize:"12px",whiteSpace:"pre-wrap",overflowWrap:"anywhere"}},JSON.stringify({id:O,...Object.fromEntries(Object.entries(M).filter(([,e])=>""!==e&&void 0!==e))},null,2))):null,l(W,{error:J}),te?l("p",{role:"status",style:{color:te===w("models.smart.testFailed")?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-state-success-primary)",fontSize:"13px"}},te):null,"conflict"===J?l("section",{style:m,"data-testid":"model-conflict"},l(L,{id:"model-conflict-compare",onClick:async()=>{const t=await a("models3-open",{route:e.route});t.ok?ue(t.value):Z(t.error)}},w("models.smart.compareLatest")),ce?l("div",{style:{marginTop:"8px"}},...y.map(e=>l("div",{key:e,style:{marginTop:"6px"}},l("b",{style:{fontSize:"12px"}},e),l("p",{style:h},w("models.smart.latest")+": "+T(ce.profile.models.find(e=>e.id===we.id)?.[e])+" · "+w("models.smart.draft")+": "+T(M[e])),l(L,{onClick:()=>{const t=ce.profile.models.find(e=>e.id===we.id)?.[e];I({...M,[e]:x.includes(e)?void 0===t?"":String(t):void 0===t?"":t}),ve({...be,[e]:!0})}},w("models.smart.useLatest")))),l(L,{id:"model-conflict-rebase",style:{marginTop:"8px"},onClick:()=>{const e=ce.profile.models.find(e=>e.id===we.id)??{id:O};I(z(M,we,e,y,be)),ge(ce),fe(e),ve({}),Z(""),ue(null)}},w("models.smart.rebaseDraft"))):null):null,ie?l("section",{style:m},l("p",{style:{margin:"0 0 6px 0",fontSize:"12px"}},w("models.smart.testBoundary")),l("code",{style:{fontSize:"12px",display:"block",marginBottom:"8px"}},ie.text+" · maxTokens="+ie.maxTokens+" · "+ie.timeoutMs+"ms"),l("div",{style:v},l(L,{id:"model-test-confirm",style:me("primary"),onClick:async()=>{const e=await a("models3-test-commit",{planId:ie.planId});de(null),e.ok?ae(w(e.value.ok?"models.smart.testPassed":"models.smart.testFailed")):Z(e.error)}},w("models.smart.confirm")),l(L,{onClick:()=>de(null)},w("models.smart.cancel")))):null,l("div",{style:{...v,justifyContent:"flex-end",marginTop:"20px",paddingTop:"16px",borderTop:"1px solid var(--dsw-alias-border-l2)"}},l(L,{onClick:()=>{H()&&n()}},w("models.smart.cancel")),Ee?l("span",{role:"status",style:h},w("models.smart.unsaved")):null,l(L,{id:"model-detail-save",disabled:X||!Ee,onClick:()=>{(async()=>{if(!O.trim())return void Z("bad-model-id");let e;ee(!0),Z(""),ae("");try{e=R(M,we,y)}catch(e){return ee(!1),void Z("schema-invalid")}const t=await a("models3-save-model",{sessionId:ye.sessionId,modelId:O.trim(),...s?{}:{originalModelId:we.id},patch:e.patch,unset:e.unset,add:s});ee(!1),t.ok?o():Z(t.error)})()},style:{...me(Ee?"primary":"neutral"),...Ee?{}:{opacity:.5,cursor:"not-allowed"}}},w("models.smart.save"))))}function U({row:e,size:t=18}){const{value:a}=n();return!1!==a.modelProviderIcons&&(q(e.route,t,{flexShrink:0},"model-provider-icon-"+e.route)||q(e.displayName,t,{flexShrink:0},"model-provider-icon-"+e.route))||l("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0,style:{flexShrink:0},"data-testid":"model-provider-fallback-"+e.route},l("path",{d:"M12 3 21 8v10l-9 5-9-5V8l9-5Zm0 10 9-5M12 13 3 8m9 5v10M7.5 5.5l9 5"}))}function K({row:e,onBack:s,reload:n,onModelsChanged:o}){const c=t(),[b,y]=i(null),[x,k]=i(null),[S,q]=i(null),[M,I]=i(""),[O,B]=i(""),[P,$]=i(null),[V,K]=i(0);d(()=>{if(!P)return;const e=()=>K(Math.floor((Date.now()-P.startedAt)/1e3));e();const t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[P]);const[G,Y]=i(null),[Q,J]=i(!1),[Z,X]=i(!1),[ee,te]=i(""),[ae,re]=i(null),[se,ne]=i({}),[oe,le]=i(!1),[ie,de]=i(""),[ce,ue]=i(null),[pe,ge]=i(""),[fe,be]=i(!1),[ve,ye]=i([]),[we,xe]=i(""),[ke,Se]=i(null),[Ee,Ce]=i(""),Te=null!==x&&null!==b&&!C(x,A(b.profile,w)),qe=Te||""!==Ee||""!==we||ve.length>0;D(null===S&&qe,c);const Ae=async()=>{const t=await a("models3-open",{route:e.route});t.ok?(y(t.value),I(""),k(A(t.value.profile,w))):I(t.error)};d(()=>{let t=!0;return a("models3-open",{route:e.route}).then(e=>{t&&(e.ok?(y(e.value),k(A(e.value.profile,w))):I(e.error))}),()=>{t=!1}},[e.route]);const ze=()=>{q(null),ue(null),ye([]),xe(""),Ce(""),I(""),Ae(),n()};if(S&&b)return l(F,{key:S.id??"new",opened:b,model:S,isNew:!0===S.isNew,onBack:()=>q(null),onSaved:ze});if(!b||!x)return l("div",{style:p},l(W,{error:M}),c("models.smart.loading"));const Me=w,Ie=async(e,t,r)=>{const s=await a(e,t);s.ok?Se({...s.value,kind:r}):I(s.error)},Re=b.profile?.models&&b.profile.models.length>0?b.profile.models:[];return l("article",{style:{minWidth:0},"data-testid":"model-route-detail"},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"14px",flexWrap:"wrap"}},l("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l(U,{row:e,size:22}),l("h3",{style:{margin:0,fontSize:"20px",fontWeight:700,overflowWrap:"anywhere"}},x.displayName||e.displayName)),l("div",{style:{...v,position:"relative"}},l("button",{type:"button",role:"switch","aria-checked":!1!==e.enabled,"aria-label":c("models.smart.providerEnabled"),"aria-description":c("models.smart.enableBoundary"),disabled:oe,onMouseEnter:e=>Y({x:e.clientX,y:e.clientY}),onMouseMove:e=>Y({x:e.clientX,y:e.clientY}),onMouseLeave:()=>Y(null),onFocus:e=>{const t=e.currentTarget.getBoundingClientRect();Y({x:t.right,y:t.bottom})},onBlur:()=>Y(null),onKeyDown:e=>{"Escape"===e.key&&Y(null)},onClick:async()=>{Y(null),le(!0),I("");try{const t=await a("models3-enabled-preview",{sessionId:b.sessionId,enabled:!1===e.enabled});if(!t.ok)return void I(t.error);const r=await a("models3-enabled-commit",{planId:t.value.planId});r.ok?n():I(r.error)}catch(e){I("operation-failed")}finally{le(!1)}},"data-testid":"model-route-enabled",style:{width:"38px",height:"22px",border:0,..._("999px"),padding:"2px",background:!1!==e.enabled?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:!1!==e.enabled?"flex-end":"flex-start"}},l("span",{style:{width:"18px",height:"18px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}})),G?l("div",{role:"tooltip","data-testid":"model-route-enabled-help",style:{position:"fixed",zIndex:1e3,left:Math.max(12,G.x-Math.min(300,G.x-12)),top:Math.min(G.y+16,window.innerHeight-100),width:Math.max(0,Math.min(300,G.x-12)),boxSizing:"border-box",padding:"10px 12px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",fontSize:"12px",lineHeight:"18px",overflowWrap:"anywhere",pointerEvents:"none"}},c("models.smart.enableBoundary")):null,l(L,{id:"model-route-menu","aria-label":c("models.smart.providerActions"),"aria-expanded":Q,"aria-haspopup":"menu",compact:!0,onClick:()=>J(!Q)},"⋯"),Q?l("div",{role:"menu",style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:2,minWidth:"160px",padding:"4px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"10px",background:"var(--dsw-alias-bg-overlay)",boxShadow:"0 6px 18px var(--dsw-alias-bg-mask-drop)"},onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),J(!1))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||J(!1)}},l(L,{id:"model-route-rename",role:"menuitem",style:{width:"100%",justifyContent:"flex-start",border:0},onClick:()=>{J(!1),te(x.displayName||e.displayName),X(!0)}},c("models.smart.rename")),l(L,{id:"model-route-delete",role:"menuitem",danger:!0,style:{width:"100%",justifyContent:"flex-start",border:0,borderTop:"1px solid var(--dsw-alias-border-l2)"},onClick:()=>{J(!1),Ie("models3-remove-preview",{sessionId:b.sessionId},"remove")}},c("models.smart.deleteRoute"))):null)),Z?l(u,{open:!0,title:c("models.smart.rename"),closeLabel:c("models.smart.cancel"),onClose:()=>X(!1),footer:l(r.Fragment,null,l(L,{onClick:()=>X(!1)},c("models.smart.cancel")),l(L,{id:"model-route-rename-confirm",disabled:!ee.trim(),style:me("primary"),onClick:()=>{k({...x,displayName:ee.trim()}),X(!1)}},c("models.smart.renameApply")))},l("input",{autoFocus:!0,style:g,value:ee,"aria-label":c("models.smart.field.displayName"),onChange:e=>te(e.target.value)})):null,l("section",{style:{minWidth:0,marginBottom:"24px",display:"grid",gap:"14px"}},l(j,{field:"baseURL",value:x.baseURL,displayValue:b.resolved?.baseURL,schema:b.schema,api:x.api,onChange:e=>{oe||k({...x,baseURL:e})}}),l("div",{style:{display:"grid",gap:"14px"}},b.builtin||"builtin"===e.source?l("label",null,l("span",{style:f},c("models.smart.field.api")),l("input",{style:g,readOnly:!0,"aria-label":c("models.smart.field.api"),value:b.resolvedApi||x.api||b.effective?.api||b.catalogModels?.find(e=>e.api)?.api||c("models.smart.protocolUnknown")})):l(j,{field:"api",value:x.api,schema:b.schema,api:x.api,onChange:e=>{oe||k({...x,api:e})}}),Array.isArray(b.catalogApis)&&b.catalogApis.length>1?l("p",{"data-testid":"model-mixed-api-hint",role:"note",style:{...h,margin:0}},c("models.smart.mixedApiHint").replace("{apis}",b.catalogApis.join(", "))):null),l("div",null,l("label",{style:f},c("models.smart.key")),["missing","authorized"].includes(b.credentialState)?l("p",{role:"status",style:{...h,margin:"0 0 6px"}},c("models.smart.keyState."+b.credentialState)):null,l("div",{style:{display:"flex",gap:"8px",alignItems:"center",flexWrap:"wrap"}},l("input",{type:"password",autoComplete:"new-password",style:{...g,flex:1,minWidth:"200px"},"aria-label":c("models.smart.key"),value:Ee,placeholder:c("configured"===b.credentialState?"models.smart.keyConfiguredPlaceholder":"models.smart.keyReplacePlaceholder"),onChange:e=>Ce(e.target.value)}),l(L,{id:"model-key-preview",disabled:!Ee.trim(),onClick:()=>{Ie("models3-credential-preview",{sessionId:b.sessionId,shared:!1},"credential")}},c("models.smart.updateKey"))))),l("section",{style:{minWidth:0,marginBottom:"16px"}},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"10px",flexWrap:"wrap"}},l("h4",{style:{...h,margin:0,fontSize:"14px",fontWeight:500}},c("models.smart.modelList")),l("div",{style:v},l(L,{id:"model-add",onClick:()=>{H()&&q({isNew:!0})}},"+ "+c("models.smart.newModel")),l(L,{id:"model-discover",disabled:fe,onClick:async()=>{be(!0),I("");try{const e=await a("models3-discover",{sessionId:b.sessionId});e.ok?(ye([]),ge(""),ue(e.value.candidates)):I(e.error)}catch(e){I("operation-failed")}finally{be(!1)}}},c(fe?"models.smart.loading":"models.smart.discover")))),null!==ce?l(u,{open:!0,title:c("models.smart.discover"),closeLabel:c("models.smart.cancel"),onClose:()=>{oe||(ue(null),ye([]))},footer:l(r.Fragment,null,l(L,{disabled:oe,onClick:()=>{ue(null),ye([])}},c("models.smart.cancel")),l(L,{id:"model-add-batch",disabled:oe||0===ve.length,style:me("primary"),onClick:async()=>{le(!0),I("");try{const e=await a("models3-add-models",{sessionId:b.sessionId,modelIds:ve});e.ok?ze():I(e.error)}catch(e){I("operation-failed")}finally{le(!1)}}},c("models.smart.add")))},l("div",{"data-testid":"model-discovery"},l("input",{type:"search",style:{...g,marginBottom:"8px"},"aria-label":c("models.smart.search"),value:pe,placeholder:c("models.smart.search"),onChange:e=>ge(e.target.value)}),l("div",{style:{...v,marginBottom:"8px"}},l(L,{compact:!0,disabled:oe,onClick:()=>ye(ce.filter(e=>!Re.some(t=>t.id===e.id)&&(e.id+" "+(e.name??"")).toLowerCase().includes(pe.toLowerCase())).map(e=>e.id))},c("models.smart.selectAll")),l(L,{compact:!0,disabled:oe,onClick:()=>ye([])},c("models.smart.clear"))),l("div",{style:{maxHeight:"min(360px, 45dvh)",overflowY:"auto"}},...ce.filter(e=>(e.id+" "+(e.name??"")).toLowerCase().includes(pe.toLowerCase())).map(e=>l("label",{key:e.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 4px",fontSize:"13px",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},l("input",{type:"checkbox",checked:ve.includes(e.id),disabled:oe||Re.some(t=>t.id===e.id),onChange:t=>ye(t.target.checked?[...ve,e.id]:ve.filter(t=>t!==e.id))}),l("span",{style:{minWidth:0,overflowWrap:"anywhere"}},e.id),Re.some(t=>t.id===e.id)?l("span",{style:he("neutral")},c("models.smart.added")):null))),l(W,{error:M}))):null,Re.length>5?l("input",{style:{...g,marginBottom:"8px"},"aria-label":c("models.smart.search"),value:ie,placeholder:c("models.smart.search"),onChange:e=>de(e.target.value)}):null,...Re.filter(e=>(e.id+" "+(e.name??"")).toLowerCase().includes(ie.toLowerCase())).map((e,t)=>l("div",{key:e.id+":"+(e.api??t),style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"10px",alignItems:"center",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-3)",marginBottom:"6px"}},l("div",{className:"dsh-model-row-copy",style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0,flexWrap:"wrap"}},l("span",{className:"dsh-model-row-name",title:e.id,style:{fontWeight:700,maxWidth:"100%","--model-name-length":String(Math.max((e.name?.trim()||e.id).length,1))}},e.name?.trim()||e.id),l("div",{className:"dsh-model-row-capabilities"},Array.isArray(e.input)&&e.input.includes("image")?l("span",{style:he("neutral")},c("models.smart.imageBadge")):null,void 0!==e.reasoningEfforts?l("span",{style:he("neutral")},c("models.smart.reasoningBadge")):null,e.contextWindow?l("span",{style:{fontSize:"11px",color:"var(--dsh-svc-text-muted)"}},E(e.contextWindow)):null)),l("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},l(L,{id:"model-test-"+e.id,compact:!0,title:c("models.smart.test"),"aria-label":c("models.smart.test")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},disabled:oe,onClick:async()=>{le(!0),I(""),B(""),K(0),$({modelId:e.id,startedAt:Date.now()});try{const t=await a("models3-test-preview",{sessionId:b.sessionId,modelId:e.id});if(!t.ok)return void I(t.error);const r=await a("models3-test-commit",{planId:t.value.planId});r.ok?r.value.ok?B(c("models.smart.testPassed")):I([c("models.smart.testFailed"),r.value.failure?.code,r.value.failure?.status?"HTTP "+r.value.failure.status:"",r.value.finishReason,r.value.failure?.message].filter(Boolean).join(" · ")):I(r.error)}catch(e){I("operation-failed")}finally{$(null),le(!1)}}},l(N,{kind:"test"})),l(L,{id:"model-open-"+e.id,compact:!0,title:c("models.smart.edit"),"aria-label":c("models.smart.edit")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},onClick:()=>{H()&&q(e)}},l(N,{kind:"edit"})),l(L,{id:"model-delete-"+e.id,compact:!0,title:c("models.smart.remove"),"aria-label":c("models.smart.remove")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},onClick:()=>{Ie("models3-remove-preview",{sessionId:b.sessionId,modelIds:[e.id]},"remove")}},l(N,{kind:"delete"})),l("button",{type:"button",role:"switch","data-testid":"model-enabled-"+e.id,"aria-label":c("models.smart.modelEnabled")+" "+e.id,"aria-checked":!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled,disabled:oe,onClick:async()=>{const t=!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled;le(!0),I("");try{const r=await a("models3-model-enabled",{sessionId:b.sessionId,modelId:e.id,enabled:!t,expected:t});r.ok?(y({...b,modelAvailability:[...(b.modelAvailability??[]).filter(t=>t.id!==e.id),{id:e.id,enabled:!t}]}),n()):I(r.error)}catch(e){I("operation-failed")}finally{le(!1)}},style:{width:"34px",height:"20px",..._("999px"),border:0,padding:"2px",flexShrink:0,display:"flex",alignItems:"center",cursor:"pointer",justifyContent:!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled?"flex-end":"flex-start",background:!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)"}},l("span",{style:{width:"16px",height:"16px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}}))))),0===Re.length?l("p",{style:{...h,textAlign:"center",padding:"8px 0"}},c("models.smart.noModels")):null),l("div",{style:{...v,marginTop:"12px"}},Te?l("span",{role:"status",style:h},c("models.smart.unsaved")):null,b.readOnly?null:l(L,{id:"model-route-save",disabled:oe||!Te,style:{...me(Te?"primary":"neutral"),...Te?{}:{opacity:.5,cursor:"not-allowed"}},onClick:async()=>{let e;try{e=R(x,b.profile,Me)}catch(e){return void I("schema-invalid")}const t=await a("models3-save-route",{sessionId:b.sessionId,...e});t.ok?ze():I(t.error)}},c("models.smart.saveRoute"))),"remove"===ke?.kind?l(u,{open:!0,title:c(ke.removeRoute?"models.smart.deleteRoute":"models.smart.deleteModelTitle"),closeLabel:c("models.smart.cancel"),onClose:()=>{oe||Se(null)},footer:l(r.Fragment,null,l(L,{disabled:oe,onClick:()=>Se(null)},c("models.smart.cancel")),l(L,{id:"model-plan-confirm",danger:!0,disabled:oe||ke.blocked,onClick:async t=>{t?.stopPropagation?.(),le(!0),I("");try{const t=await a("models3-remove-commit",{planId:ke.planId});t.ok?ke.removeRoute?(Se(null),n(),s()):(Se(null),await Ae(),o?o(e):n()):(I(t.error),Se(null))}catch(e){I("operation-failed"),Se(null)}finally{le(!1)}}},c("models.smart.remove")))},l("div",{"data-testid":"model-plan"},l("p",{style:{fontSize:"14px",margin:"0 0 12px"}},c(ke.removeRoute?"models.smart.deleteRoutePrompt":"models.smart.deleteModelPrompt")),ke.removeRoute?l("code",{style:{display:"block",marginBottom:"8px",overflowWrap:"anywhere"}},ke.route):null,...(ke.modelsRemoved??[]).map(e=>l("code",{key:e,style:{display:"block",fontSize:"13px",overflowWrap:"anywhere",marginBottom:"8px"}},e)),(ke.references??[]).length?l("div",{role:"alert","data-testid":"model-removal-conflicts",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",overflowWrap:"anywhere"}},l("b",null,c("models.smart.removalConflicts")),l("ul",{style:{margin:"8px 0",paddingLeft:"20px"}},...ke.references.map((e,t)=>l("li",{key:t},c("models.smart.referenceKind."+e.kind)+":",l("code",null,e.provider+" / "+e.model)))),l("p",{style:{margin:"8px 0"}},c("models.smart.resolveRemovalConflicts"))):null,ke.blocked?l("p",{role:"alert",style:{...h,color:"var(--dsw-alias-state-error-primary)"}},c("models.smart.error.removal-blocked")):null)):ke?l("section",{style:{...m,marginTop:"12px"},"data-testid":"model-plan"},l("h4",{style:{margin:"0 0 6px 0",fontSize:"13px"}},c("test"===ke.kind?"models.smart.test":"models.smart.consequences")),l("p",{style:{...h,overflowWrap:"anywhere"}},ke.route||e.displayName),l("p",{style:h},c("test"===ke.kind?"models.smart.testBoundary":"models.smart.credentialRetained")),l("div",{style:v},l(L,{id:"model-plan-confirm",danger:"remove"===ke.kind,disabled:ke.blocked,onClick:async()=>{const e=ke.kind,t=await a("models3-"+("test"===e?"test":"availability"===e?"enabled":"credential"===e?"credential":"remove"===e?"remove":"restore")+"-commit",{planId:ke.planId,..."credential"===e?{key:Ee}:{}});Se(null),t.ok?t.value.configurationFailed?(Ce(""),B(c("models.smart.keyPartial"))):"test"===e?B(c(t.value.ok?"models.smart.testPassed":"models.smart.testFailed")):"availability"===e?n():"remove"!==e||ke.modelsRemoved?.length?ze():(n(),s()):I(t.error)}},c("models.smart.confirm")),l(L,{onClick:()=>Se(null)},c("models.smart.cancel")))):null,l(W,{error:M}),O?l("p",{role:"status",style:{color:O===c("models.smart.testFailed")?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-state-success-primary)",fontSize:"13px"}},O):null,P?l("p",{role:"status","aria-live":"polite","data-testid":"model-test-progress",style:{...h,fontSize:"13px",overflowWrap:"anywhere"}},P.modelId+" · "+c("models.smart.testing").replace("{seconds}",String(V))):null,"conflict"===M?l("section",{style:m,"data-testid":"model-route-conflict"},l(L,{id:"model-route-compare",onClick:async()=>{const t=await a("models3-open",{route:e.route});t.ok?re(t.value):I(t.error)}},c("models.smart.compareLatest")),ae?l("div",{style:{marginTop:"8px"}},...Me.map(e=>l("div",{key:e,style:{marginTop:"6px"}},l("b",{style:{fontSize:"12px"}},e),l("p",{style:h},c("models.smart.latest")+": "+T(ae.profile[e])+" · "+c("models.smart.draft")+": "+T(x[e])),l(L,{onClick:()=>{k({...x,[e]:A(ae.profile,Me)[e]}),ne({...se,[e]:!0})}},c("models.smart.useLatest")))),l(L,{id:"model-route-rebase",style:{marginTop:"8px"},onClick:()=>{k(z(x,b.profile,ae.profile,Me,se)),y(ae),ne({}),re(null),I(""),Se(null)}},c("models.smart.rebaseDraft"))):null):null)}function G({onBack:e,onCreated:r,templates:s=[]}){const n=t(),[o,d]=i(""),[c,u]=i(""),[y,w]=i(""),[x,k]=i("openai-completions"),[S,E]=i(""),[C,T]=i(""),[q,A]=i(""),[z,M]=i([]),[I,R]=i(null),[O,N]=i([]),[B,P]=i(!1),[j,$]=i(""),_=!!(c||y||S||C||q||O.length>0||"openai-completions"!==x);D(_,n);const V=e=>t=>{e(t.target.value),$("")},F=async()=>{if(!S.trim())return void $("schema-invalid");P(!0),$("");const e=await a("models3-discover",{baseURL:S.trim(),api:x,key:C.trim()});P(!1),e.ok?R(e.value.candidates||[]):$(e.error)},U=null!==I?I:z;return l("article",{style:p,"data-testid":"model-create-route"},l("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"14px"}},l(L,{onClick:()=>{H()&&e()}},n("models.smart.back")),l("h3",{style:{margin:0,fontSize:"14px",fontWeight:700}},n("models.smart.createRoute"))),s.length>0?l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.template")),l("select",{style:g,"aria-label":n("models.smart.template"),"data-testid":"model-create-template",value:o,onChange:e=>{const t=e.target.value;if(d(t),R(null),N([]),$(""),t&&"custom"!==t){const e=s.find(e=>e.id===t);if(e)return u(e.id),w(e.name),k(e.api||"openai-completions"),E(e.baseURL||""),void M(e.models||[])}u(""),w(""),k("openai-completions"),E(""),M([])}},l("option",{value:"custom"},n("models.smart.templateCustom")),...s.map(e=>l("option",{key:e.id,value:e.id},e.name+" ("+e.id+")")))):null,(()=>{const e=s.find(e=>e.id===o);return void 0!==e&&Array.isArray(e.apis)&&e.apis.length>1?l("p",{"data-testid":"model-create-mixed-api-hint",role:"note",style:{...h,margin:"-6px 0 12px"}},n("models.smart.mixedApiHint").replace("{apis}",e.apis.join(", "))):null})(),l("div",{style:b},l("div",null,l("label",{style:f},n("models.smart.routeId")),l("input",{style:g,value:c,"aria-label":n("models.smart.routeId"),placeholder:"deepseek, openai...",onChange:V(u)})),l("div",null,l("label",{style:f},n("models.smart.field.displayName")),l("input",{style:g,value:y,"aria-label":n("models.smart.field.displayName"),placeholder:"DeepSeek, OpenAI...",onChange:V(w)}))),l("div",{style:b},l("div",null,l("label",{style:f},n("models.smart.field.api")),l("select",{style:g,"aria-label":n("models.smart.field.api"),value:x,onChange:V(k)},...["openai-completions","openai-responses","anthropic-messages"].map(e=>l("option",{key:e},e)))),l("div",null,l("label",{style:f},n("models.smart.field.baseURL")),l("input",{style:g,value:S,"aria-label":n("models.smart.field.baseURL"),placeholder:"https://api.openai.com/v1",onChange:V(E)}))),l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.apiKey")),l("input",{type:"password",autoComplete:"new-password",style:g,value:C,placeholder:n("models.smart.apiKeyPlaceholder"),"aria-label":n("models.smart.apiKey"),onChange:V(T)})),U.length>0?l("div",{style:{...m,marginTop:"8px"}},l("p",{style:{...f,margin:"0 0 6px 0"}},n("models.smart.selectModelsHint")),l("div",{style:{maxHeight:"160px",overflowY:"auto",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"6px",padding:"6px",background:"var(--dsw-alias-bg-layer-2)"}},...U.map(e=>l("label",{key:e.id,style:{display:"block",padding:"3px 0",fontSize:"13px"}},l("input",{type:"checkbox",checked:O.includes(e.id),onChange:t=>N(t.target.checked?[...O,e.id]:O.filter(t=>t!==e.id))})," "+e.id+(e.name&&e.name!==e.id?" ("+e.name+")":"")))),l("div",{style:{...v,marginTop:"8px"}},l(L,{onClick:()=>N(U.map(e=>e.id))},n("models.smart.selectAll")),l(L,{onClick:()=>N([])},n("models.smart.clear")),l(L,{id:"model-create-discover",disabled:B,onClick:()=>{F()}},n(B?"models.smart.loading":"models.smart.discover")))):S.trim()?l("div",{style:{marginBottom:"8px"}},l(L,{id:"model-create-discover",disabled:B,onClick:()=>{F()}},n(B?"models.smart.loading":"models.smart.discover"))):null,l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.manualIds")),l("textarea",{style:{...g,minHeight:"60px"},value:q,"aria-label":n("models.smart.manualIds"),placeholder:"gpt-4o, claude-3-5-sonnet...",onChange:V(A)})),_?l("p",{role:"status",style:h},n("models.smart.unsaved")):null,l(L,{id:"model-create-save",disabled:!_,style:{...me(_?"primary":"neutral"),..._?{}:{opacity:.5,cursor:"not-allowed"}},onClick:async()=>{const e=[...new Set([...O,...q.split(/[\s,]+/).filter(Boolean)])];if(0===e.length)return void $("noModelsSelected");const t=e.map(e=>({id:e})),s={route:c.trim(),profile:{displayName:y.trim()||c.trim(),api:x,baseURL:S.trim(),models:t},...C.trim()?{key:C.trim()}:{}},n=await a("models3-create-preview",s);if(!n.ok)return void $(n.error);const o=await a("models3-create-commit",{planId:n.value.planId});o.ok?r(c.trim()):$(o.error)}},n("models.smart.save")),l(W,{error:"noModelsSelected"===j?n("models.smart.noModelsSelected"):j}))}function Y(){const e=t(),[r,s]=i(null),[n,o]=i(""),[c,u]=i(null),[p,g]=i(!1),[f,b]=i(null),y=async()=>{const e=await a("models3-snapshot",{});e.ok?(s(e.value),o("")):o(e.error)};if(d(()=>{let e=!0;return a("models3-snapshot",{}).then(t=>{e&&(t.ok?(s(t.value),o("")):o(t.error))}),()=>{e=!1}},[]),p)return l(G,{onBack:()=>g(!1),onCreated:e=>{g(!1),u({route:e,displayName:e}),y()},templates:r?.templates??[]});const w=r?.routes??[],x=c?w.find(e=>e.route===c.route)??c:null;return l("section",{style:{minWidth:0},"data-testid":"model-providers"},l("style",null,"\n .dsh-model-workspace { display:flex; flex-direction:column; gap:16px; min-width:0; }\n .dsh-model-provider-card { min-width:0; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; background:var(--dsw-alias-bg-layer-3); margin-bottom:8px; }\n .dsh-model-content { min-width:0; padding:20px; border-top:1px solid var(--dsw-alias-border-l2); }\n .dsh-model-provider:hover { background:var(--dsw-alias-interactive-bg-hover)!important; }\n .dsh-model-provider:focus-visible { outline:2px solid var(--dsw-focus-ring-color); outline-offset:2px; }\n .dsh-model-row-name { font-size:13px; overflow-wrap:anywhere; }\n .dsh-model-row-capabilities { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }\n @media(max-width:640px) {\n .dsh-model-content { padding:16px 12px; }\n .dsh-model-row-copy { container-type:inline-size; }\n .dsh-model-row-name { width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; font-size:clamp(10px, calc(160cqw / var(--model-name-length)), 13px); }\n .dsh-model-row-capabilities { flex-basis:100%; }\n }\n "),l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"14px",flexWrap:"wrap"}},l("div",{style:{minWidth:0}},l("h3",{style:{margin:0,fontSize:"24px",fontWeight:700}},e("models.smart.homeTitle"))),l("div",{style:v},l(L,{id:"model-routes-refresh","aria-label":e("models.smart.refreshProviders"),title:e("models.smart.refreshProviders"),onClick:()=>{H()&&y()}},"↻"),l(L,{id:"model-route-create",style:me("primary"),onClick:()=>{H()&&g(!0)}},"+ "+e("models.smart.createRoute")))),l(W,{error:n}),null!==r||n?null:l("p",{style:h},e("models.smart.loading")),0!==w.length||null===r||n?null:l("p",{style:{...h,padding:"16px 0",textAlign:"center"},"data-testid":"models-empty-notice"},e("models.smart.noProviders")),w.length?l("div",{className:"dsh-model-workspace","data-testid":"model-workspace"},l("div",{"aria-label":e("models.smart.providers"),"data-testid":"model-provider-list"},...["builtin","custom"].map(t=>{const a=w.filter(e=>("builtin"===e.source?"builtin":"custom")===t);return a.length?l("section",{key:t,style:{marginBottom:"18px"}},l("h4",{style:{...h,margin:"4px 10px 12px",fontWeight:600}},e("builtin"===t?"models.smart.builtin":"models.smart.customProviders")),...a.map(t=>l("div",{key:t.route,className:"dsh-model-provider-card"},l("button",{type:"button",className:"dsh-model-provider","data-testid":"model-route-open-"+t.route,"aria-expanded":x?.route===t.route,onClick:()=>(e=>{H()&&u(e.route===x?.route?null:e)})(t),style:{display:"flex",width:"100%",minWidth:0,alignItems:"center",gap:"10px",padding:"14px 16px",borderRadius:"11px",cursor:"pointer",font:"inherit",textAlign:"left",color:"var(--dsw-alias-label-primary)",border:0,background:"transparent"}},l(U,{row:t}),l("span",{style:{flex:1,minWidth:0,overflowWrap:"anywhere",fontSize:"14px",fontWeight:600}},t.displayName),l("span",{title:e(t.configured?"models.smart.configSaved":"models.smart.configInherited"),"aria-label":e(t.configured?"models.smart.configSaved":"models.smart.configInherited"),style:{width:"7px",height:"7px",borderRadius:"50%",flexShrink:0,background:!1!==t.enabled&&t.configured?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-state-idle-primary)"}}),l("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0,style:{flexShrink:0,transition:"transform 150ms",transform:x?.route===t.route?"rotate(180deg)":"none"}},l("path",{d:"m6 9 6 6 6-6"}))),x?.route===t.route?l("div",{className:"dsh-model-content","data-testid":"model-provider-content"},l(K,{key:t.route,row:x,reload:()=>{y()},onModelsChanged:e=>{u(e),y()},onBack:()=>{u(null),y()}})):null))):null}))):null,(r?.removedRoutes??[]).length?l("section",{"data-testid":"model-removed-routes",style:{marginTop:"16px",borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:"12px"}},l("h4",{style:{margin:"0 0 8px 0",fontSize:"13px"}},e("models.smart.deleted")),...r.removedRoutes.map(e=>l(L,{key:e.route,id:"model-removed-"+e.route,disabled:e.taken,style:{marginRight:"6px"},onClick:async()=>{const t=await a("models3-restore-preview",{route:e.route});t.ok?b(t.value):o(t.error)}},e.displayName))):null,f?l("section",{style:{...m,marginTop:"12px"}},l("h4",{style:{margin:"0 0 6px 0",fontSize:"13px"}},e("models.smart.consequences")),l("p",{style:{...h,overflowWrap:"anywhere"}},f.restore?.route||""),l("p",{style:h},e("models.smart.credentialRetained")),l("div",{style:v},l(L,{id:"model-restore-confirm",style:me("primary"),onClick:async()=>{const e=await a("models3-restore-commit",{planId:f.planId});e.ok?(b(null),y()):o(e.error)}},e("models.smart.confirm")),l(L,{onClick:()=>b(null)},e("models.smart.cancel")))):null)}return{ModelsSection:function({SubagentSection:e}){const a=t(),{value:r}=n(),[d,c]=o?o.useEnabled():[!1,()=>{}],[u,p]=i("providers"),m=[...!1!==r.modelCatalog?[{id:"providers",label:a("tabs.providers")}]:[],...!1!==r.subagentRoute?[{id:"subagent",label:a("tabs.subagentRoute")}]:[]],g=m.some(e=>e.id===u)?u:m[0]?.id,h=o?l("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginBottom:"4px"}},l("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},a("models.navToggleHint")),l("button",{type:"button",role:"switch","data-testid":"models-nav-switch","aria-checked":String(d),"aria-label":a("models.navToggle"),title:a("models.navToggle"),onClick:()=>c(!d),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(d?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:d?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},l("span",{style:{position:"absolute",top:"1px",left:d?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:d?"#fff":"var(--dsw-alias-label-tertiary)"}}))):null;return l("div",{"data-testid":"models-page","data-dshsvc-root":""},h,m.length>1?l(s,{items:m,activeId:g,onChange:e=>{H()&&p(e)},testIdPrefix:"models-tab",variant:"sub",ariaLabel:a("tabs.models")}):null,"providers"===g?l(Y,null):"subagent"===g?l(e,null):null)},canLeave:H,ModelDetail:F,RouteDetail:K,parseDraft:R,capacity:S,formatCapacity:E}}({useTranslation:J,rpcCall:d,SvcTabs:Ie,useFeatures:v,modelsNavToggle:Pe});function Ha(){const e=J(),{value:s}=v(),[n,i]=a(null),[c,u]=a(null),[g,h]=a(null),[f,y]=a(!1),[w,x]=a(0),[k,S]=a(null),[E,C]=a(null),[T,q]=a(null),[A,z]=a(null),[M,I]=a(!1),[O,H]=a(!1),[D,L]=a(null),[N,W]=a(!1),[B,P]=a(!1),[j,$]=a(null),[V,F]=a(!1),[U,K]=a({items:[],totalBytes:0}),[G,Y]=a(!1),[Q,Z]=a(null),X=l(0),[ae,re]=a(null),[se,ne]=a(null),[oe,le]=a(null),[ie,de]=a(null),[ce,ue]=a(null),[he,ve]=a(null),[ye,we]=a({}),[xe,ke]=a(!1),[Se,Ee]=a(!1),[Ce,Re]=a(!1),[He,De]=a(!1),[Le,Ne]=a(null),[We,Be]=a(null),[Pe,je]=a(null),[$e,_e]=a(null),[Ve,at]=a(null),[rt,st]=a(!1),[lt,it]=a(null),[dt,ct]=a(!1),[ut,pt]=a(null),[mt,gt]=a(!1),[ht,ft]=a(null),[bt,vt]=a(!1),[yt,wt]=a(!1),[xt,kt]=a(null),[St,Et]=a(null),[Ct,Tt]=a("day"),[qt,At]=a("all"),zt=l(null),Mt=l(null),It=l(!1),[Rt,Ot]=a(!1),[Ht,Dt]=a(!1),[Lt,Nt]=a(!1),[Wt,Bt]=a("today"),[Pt,jt]=a("overview"),$t=l({}),_t=l(!1),Vt=l(!1),[Ft,Ut]=a({kind:null,variant:null,phase:"idle",value:null,error:null}),Kt=l(0),Gt=l(null),Jt=Je(),Zt=Ze(),Xt=Qe(),ea={timezoneOffsetMinutes:(new Date).getTimezoneOffset()};o(()=>{R()},[]),o(()=>{Ke().then(e=>{e&&e.ok&&(Ne(e.value.current),Be(e.value.pluginVersion||null))})},[]);const aa=t=>{t&&!1!==t.ok?(je(t.value),_e(null)):_e(e("update.unavailable"))};o(()=>{let t=!0;return d("check-update",{}).then(e=>{t&&aa(e)}).catch(()=>{t&&_e(e("update.unavailable"))}),()=>{t=!1}},[]);const ra=(e,t)=>`${e}@${t}`,sa=async(e,t)=>{const a=Kt.current+=1,r=()=>Kt.current!==a;Ut({kind:e,variant:t,phase:"loading",value:null,error:null});let s=null;try{s=await d("latest"===t?"release-notes-latest":"release-notes",{kind:e})}catch(e){s=null}if(s&&!1!==s.ok&&s.value){if($t.current[ra(e,t)]=s.value,r())return;return void Ut({kind:e,variant:t,phase:"ready",value:s.value,error:null})}if(r())return;if("unknown-endpoint"===s?.error)return"latest"===t?Vt.current=!0:_t.current=!0,void Ut({kind:null,variant:null,phase:"idle",value:null,error:null});const n=(o=s?.error,"release-not-found"===o?"release-not-found":"release-unavailable");var o;Ut({kind:e,variant:t,phase:"release-not-found"===n?"pending":"error",value:null,error:n})},na=()=>{Kt.current+=1,Ut({kind:null,variant:null,phase:"idle",value:null,error:null})},oa=async(e,t)=>{if(!0===_t.current)return;const a=Ft.kind===e&&Ft.variant===t?Ft:null;if(null!==a&&("ready"===a.phase||"loading"===a.phase))return void na();const r=$t.current[ra(e,t)];if(void 0!==r)return Kt.current+=1,void Ut({kind:e,variant:t,phase:"ready",value:r,error:null});await sa(e,t)},la=null!==Ft.kind&&"idle"!==Ft.phase;o(()=>{if(!la||"undefined"==typeof document)return;const e=e=>{const t=e?.target;if(null!=t&&"function"==typeof t.closest)try{if(null!==t.closest('[data-testid="version-card"]'))return}catch(e){}const a=Gt.current;if(null!=a&&"function"==typeof a.contains)try{if(a.contains(t))return}catch(e){}na()},t=e=>{"Escape"===e?.key&&na()};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[la]),o(()=>{if(!b("healthDiagnostics"))return()=>{};let t=!0;return d("permissions-plan",{}).then(a=>{t&&(a&&!1!==a.ok?z(a.value):L(e("permissions.error")))}).catch(()=>{t&&L(e("permissions.error"))}),()=>{t=!1}},[s.healthDiagnostics]),o(()=>{try{pt(localStorage.getItem(Ia))}catch(e){pt(null)}},[]),o(()=>{if(!b("modelUsage"))return()=>{};let t=!0;const a=async a=>{if(!It.current){It.current=!0,st(!0);try{const r=await d("usage",ea);if(!t)return;if(!r||!1===r.ok)return void(a&&it(e("usage.error")));it(null),ct(!1),at(r.value);const s=await d("usage-refresh",ea).catch(()=>null);if(!t)return;s&&s.ok&&(it(null),ct(!1),at(s.value))}catch(r){t&&a&&it(e("usage.error"))}finally{It.current=!1,t&&st(!1)}}};return Mt.current=a,a(!0),()=>{t=!1,Mt.current=null}},[s.modelUsage]),o(()=>{if(!b("modelUsage"))return()=>{};if("usage"!==Pt)return()=>{};let e=!0,a=null;const r=()=>{if(!e)return;const t=Mt.current;if(null!=t)try{t(!1)}catch(e){}},s=()=>{if(!e)return;const n=new Date(Date.now()),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1,0,0,1,0),l=Math.max(1e3,o.getTime()-n.getTime());a=t.timer.timeout(()=>{e&&(r(),s())},l)};s();const n=()=>{if(!e)return;let t=!1;try{t="undefined"!=typeof document&&"hidden"===document.visibilityState}catch(e){}t||r()};return"undefined"!=typeof document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",n),r(),()=>{e=!1,null!=a&&a(),"undefined"!=typeof document&&"function"==typeof document.removeEventListener&&document.removeEventListener("visibilitychange",n)}},[s.modelUsage,Pt]),o(()=>{if(!b("backupMaintenance"))return()=>{};let t=!0;return d("backup-list",{}).then(a=>{t&&(a&&!1!==a.ok?K(a.value):re(e("backup.error")))}).catch(()=>{t&&re(e("backup.error"))}),()=>{t=!1}},[s.backupMaintenance]),o(()=>{let a=!0,r=()=>{};const s=async()=>{try{const e=await d("health",{});if(!a)return;if(!e||!1===e.ok)throw new Error(e&&e.error?e.error:"health failed");i(e.value),u(null)}catch(t){if(!a)return;u(e("health.error"))}a&&(r=t.timer.timeout(s,5e3))};return s(),()=>{a=!1,r()}},[]);const ia=async(t=!1)=>{if(b("healthDiagnostics")&&!(!t&&w>0&&Date.now()-w<=3e4)){y(!0);try{const e=await d("diagnostics",{});if(!e||!1===e.ok)throw new Error("diagnostics failed");h(e.value),x(Date.now())}catch(t){u(e("health.error"))}finally{y(!1)}}},da=async()=>{if(!It.current){It.current=!0,st(!0),it(null);try{const e=await d("usage-refresh",ea);if(!e||!1===e.ok)throw new Error("usage refresh failed");at(e.value)}catch(t){it(e("usage.error"))}finally{It.current=!1,st(!1)}}},ca=t=>{const a="backup.error."+String(t||""),r=e(a);return r===a?e("backup.restoreError"):r},ua=async(e,t)=>{Y(!0),re(null),ke(!1),void 0===t&&(de(null),ue(null),le(e),ve(null),we({}));try{const a=await d("backup-inspect",{id:e});if(!a||!1===a.ok)throw Object.assign(new Error("backup inspect failed"),{code:a?.error});if(void 0===t&&de(a.value),!0!==a.value.validForRestore)return;const r=await d("backup-restore-prepare",void 0===t?{id:e}:{id:e,profiles:t});if(!r||!1===r.ok)throw Object.assign(new Error("backup prepare failed"),{code:r?.error});if(ue(r.value),void 0===t){const e=r.value?.targets?.profiles?.mapping??[],t={};for(const a of e)t[a.source]={target:a.target,manifest:!0===a.manifest};if(we(t),e.length>0){const e=await d("backup-target-profiles",{});e&&!1!==e.ok&&ve(e.value)}}}catch(e){re(ca(e?.code))}finally{Y(!1)}},pa=async()=>{if(ce&&!G){Y(!0),re(null);try{const e=await d("backup-restore-commit",{planId:ce.planId});if(!e||!1===e.ok)throw Object.assign(new Error("backup restore failed"),{code:e?.error});if(le(null),de(null),ue(null),!0===e.value?.restart?.requiresManualRestart)ke(!0);else{const t=e.value?.restart?.previousInstanceId||e.value?.previousInstanceId;"string"==typeof t&&t.length>0&&Ye(t).catch(()=>{})}}catch(e){ue(null),re(ca(e?.code))}finally{Y(!1)}}},ma=()=>{G||(le(null),de(null),ue(null),ve(null),we({}))},ga={"active-work":"update.guardActiveWork","link-install":"update.guardLinkInstall","file-install":"update.guardFileInstall","no-newer-version":"update.guardNoNewer","no-profile-found":"update.guardNoProfile","ambiguous-profile":"update.guardAmbiguous","upgrade-stale":"update.guardStale","installed-version-unreadable":"update.guardUnreadable","pnpm-missing":"update.failPnpmMissing","transient-network":"update.failNetwork","fetch-timeout":"update.failFetchTimeout","release-age-violation":"update.failReleaseAge","hoist-pattern-diff":"update.failHoist","adding-to-root":"update.failAddingToRoot","not-a-workspace":"update.failNotWorkspace","ignored-builds":"update.failIgnoredBuilds","desktop-managed-upgrade":"update.desktopManagedUpgrade"},fa=async()=>{if(!Xe()){et(!0);try{let t=Zt;if(null===t&&(await Ke(),t=tt()),!bt&&null!==t&&!0===t.manualStartLikely)return ft(null),void vt(!0);vt(!1),gt(!0),ft(null);const a=await Ke(),r=a&&a.ok?a.value.instanceId:void 0,s=await d("upgrade",{});if(!s||!1===s.ok){const t=s&&"string"==typeof s.error?s.error.trim():"",a="string"==typeof t&&t.length>0?ga[t]:void 0;return void ft(void 0!==a?e(a):e("update.upgradeErrorDetail",{detail:t||"upgrade failed"}))}s.value&&!0===s.value.requiresManualRestart?wt(!0):"string"==typeof r&&r.length>0&&Ye(r).catch(()=>{}),Ge().catch(()=>{}),(async()=>{const e=await d("check-update",{}).catch(()=>null);e&&aa(e)})().catch(()=>{})}catch(t){const a=t instanceof Error&&"string"==typeof t.message&&"upgrade failed"!==t.message?t.message.trim():"";console.error("dsh-service: upgrade failed",a||t),ft(a?e("update.upgradeErrorDetail",{detail:a}):e("update.upgradeError"))}finally{et(!1),gt(!1)}}},ba=me(),ya=(me("primary"),me("brandGhost")),wa=me("neutral"),xa=me("danger"),ka=me("dangerGhost"),Sa=me("ghost"),Ea=Object.assign({},ba,{background:"transparent",color:"var(--dsw-alias-label-primary)",border:0,borderTop:"1px solid var(--dsw-alias-border-l1)",borderRadius:0,padding:"10px 2px",width:"100%",textAlign:"left",fontWeight:600}),Ca={display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",flexWrap:"wrap"},Ta={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},Ha=be(),Da=fe(),La={background:"transparent",color:"var(--dsw-alias-label-secondary)",border:0,borderBottom:"2px solid transparent",padding:"8px 10px",cursor:"pointer",fontSize:"13px",fontWeight:550,transition:"color 120ms, border-color 120ms"},Na={color:"var(--dsw-alias-brand-primary)",borderBottom:"2px solid var(--dsw-alias-brand-primary)",fontWeight:700},Wa=Object.assign({},La,{padding:"3px 6px",fontSize:"11px"}),Ba={fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},Pa=e=>{const t=Number(e);return t<1024?t+" B":t<1048576?Math.round(t/102.4)/10+" KB":t<1073741824?Math.round(t/1048576*10)/10+" MB":Math.round(t/1073741824*10)/10+" GB"},ja=(t,a)=>r.createElement("div",{key:t,style:{padding:"8px 10px",borderRadius:"6px",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginBottom:"2px"}},e(t)),r.createElement("div",{style:{fontSize:"14px",fontWeight:600}},a)),$a=e=>{const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},_a=[];for(let e=6;e>=0;e-=1){const t=new Date;t.setHours(0,0,0,0),t.setDate(t.getDate()-e),_a.push({key:$a(t),label:`${t.getMonth()+1}/${t.getDate()}`})}const Va=[["inputTokens","usage.input","#79aaf7"],["outputTokens","usage.output","#f1b35b"],["cacheTokens","usage.cache","#48c7b0"]],Fa=e=>{const t=Ve&&Ve.days?Ve.days[e]:null;if(!t)return{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,cacheHitRate:0};if("all"===qt)return t.totals;const a=t.projects.find(e=>e.id===qt);return a?a.totals:{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,cacheHitRate:0}},Ua=e=>{const t=Number(e.inputTokens||0)+Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0);return 0===t?0:Number(e.cacheReadTokens||0)/t},Ka=e=>Number(e.inputTokens||0)+Number(e.outputTokens||0)+Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0),Ga=(e,t)=>"cacheTokens"===t?e.cacheReadTokens+e.cacheWriteTokens:e[t]||0,Ya=e=>m(e,{invalid:"0"}),Qa=(t,a)=>"cacheHitRate"===a?(100*Number(t)).toFixed(1)+"%":"steps"===a?e("usage.stepsValue",{count:Number(t).toLocaleString()}):Ya(t),Ja=_a.map(e=>Fa(e.key)),Za=Ja.map(e=>Va.reduce((t,[a])=>t+Ga(e,a),0)),Xa=Math.max(1,...Za),er=[Xa,.75*Xa,.5*Xa,.25*Xa,0],tr=Fa(_a[6].key),ar=_a.reduce((e,t)=>{const a=Fa(t.key);return e.steps+=a.steps||0,e.inputTokens+=a.inputTokens||0,e.outputTokens+=a.outputTokens||0,e.cacheReadTokens+=a.cacheReadTokens||0,e.cacheWriteTokens+=a.cacheWriteTokens||0,e},{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0}),rr=ar.inputTokens+ar.cacheReadTokens+ar.cacheWriteTokens;ar.cacheHitRate=0===rr?0:ar.cacheReadTokens/rr;const sr="zh"===p()?"zh-CN":"en-US",nr=e=>{const[t,a,r]=e.split("-").map(Number);return new Date(t,a-1,r)},or=e=>e.toLocaleDateString(sr,{month:"short",day:"numeric"}),lr=e=>e.toLocaleDateString(sr,{month:"short"}),ir=`${Ve?.updatedAt||0}:${qt}:${sr}:${$a(new Date)}`;if(!zt.current||zt.current.key!==ir){const e=Object.keys(Ve?.days||{}).filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(nr(e).getTime())),t=new Map;for(const a of e){const e=Fa(a);t.set(a,{total:Va.reduce((t,[a])=>t+Ga(e,a),0),steps:Number(e.steps||0)})}const a=[],r=new Date;if(r.setHours(0,0,0,0),e.length>0){const t=e.map(nr).reduce((e,t)=>t<e?t:e),s=new Date(r);s.setDate(s.getDate()-(s.getDay()+6)%7);const n=new Date(s);n.setDate(n.getDate()-133);const o=new Date(t);o.setDate(o.getDate()-(o.getDay()+6)%7);for(const e=new Date(o<n?n:o);e<=r;e.setDate(e.getDate()+1))a.push(new Date(e))}const s=a.reduce((e,a)=>Math.max(e,t.get($a(a))?.total||0),0),n=[];for(let e=0;e<a.length;e+=7){const t=a.slice(e,e+7),r=t[0],s=0===e?null:a[e-7];n.push({key:$a(r),monthLabel:null!==s&&s.getMonth()===r.getMonth()?"":lr(r),days:t})}const o=new Date(2024,0,1),l=[0,1,2,3,4,5,6].map(e=>{const t=new Date(o);return t.setDate(t.getDate()+e),t.toLocaleDateString(sr,{weekday:"short"})}),i="all"===qt?(Ve?.projects||[]).map(e=>e.id):[qt],d=e=>("all"===qt?e.totals:(e.projects||[]).find(e=>e.id===qt)?.totals)||{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0},c=Array.isArray(Ve?.hours)?Ve.hours:[],u=new Map;for(const e of c){const t=Number(e?.weekday),a=Number(e?.hour);if(!Number.isInteger(t)||!Number.isInteger(a)||t<0||t>6||a<0||a>23)continue;const r=d(e);u.set(`${t}-${a}`,{total:Va.reduce((e,[t])=>e+Ga(r,t),0),steps:Number(r.steps||0)})}const p=[...u.values()].reduce((e,t)=>Math.max(e,t.total),0),m=e=>e<=0||s<=0?0:e<=.25*s?1:e<=.5*s?2:e<=.75*s?3:4,g=e=>e<=0||p<=0?0:e<=.25*p?1:e<=.5*p?2:e<=.75*p?3:4,h=e=>({id:e,steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0}),f=(e,t)=>{const a=e.get(t.id)||h(t.id);a.steps+=t.totals.steps||0,a.inputTokens+=t.totals.inputTokens||0,a.outputTokens+=t.totals.outputTokens||0,a.cacheReadTokens+=t.totals.cacheReadTokens||0,a.cacheWriteTokens+=t.totals.cacheWriteTokens||0,e.set(t.id,a)},b=new Map,v=new Map,y=new Map,w=new Set(_a.map(e=>e.key)),x=_a[_a.length-1].key;for(const[e,t]of Object.entries(Ve?.days||{})){const a=[y];w.has(e)&&a.push(v),e===x&&a.push(b);for(const e of t.projects)if(i.includes(e.id))for(const t of e.models)for(const e of a)f(e,t)}zt.current={key:ir,heatTotalsByDay:t,heatDays:a,heatMax:s,heatColumns:n,heatWeekdays:l,heatLevel:m,punchBuckets:c,punchBySlot:u,punchMax:p,punchLevel:g,modelTodayTotals:b,modelWeekTotals:v,modelAllTotals:y}}const dr=e=>e<=0?1:[1,.25,.45,.7,1][e],{heatTotalsByDay:cr,heatDays:ur,heatMax:pr,heatColumns:mr,heatWeekdays:gr,heatLevel:hr,punchBuckets:fr,punchBySlot:br,punchMax:vr,punchLevel:yr,modelTodayTotals:wr,modelWeekTotals:xr,modelAllTotals:kr}=zt.current,Sr=t=>{const a=String(t.detail??"");if("usage-index"===t.id){if("never"===a)return e("health.detail.usage-index.never");if("unavailable"===a)return e("health.detail.usage-index.unavailable");const[r="0",s="0",n="0"]=a.split(":"),o=Number(n),l={failed:r,indexed:s,updated:o>0?`${ot(o)} ${nt(o)}`:"—"};return e(Number(r)>0?"warning"===t.status?"health.detail.usage-index.warning":"health.detail.usage-index.info":"health.detail.usage-index.ok",l)}if("session-storage"===t.id&&"ok"===t.status)return e("health.detail.session-storage.ok",{count:a});if("workspace-registry"===t.id&&"ok"===t.status)return e("health.detail.workspace-registry.ok",{count:a});if("dsh-home"===t.id&&"ok"===t.status)return e("health.detail.dsh-home.ok",{mode:a});if("backup-storage"===t.id){const[t="0",r="0"]=a.split(":");return 0===Number(t)?e("health.detail.backup-storage.empty"):e("health.detail.backup-storage.ok",{count:t,size:Pa(r)})}if("tar"===t.id&&"ok"===t.status)return e("health.detail.tar.ok");if("permissions"===t.id)return e("ok"===t.status?"health.detail.permissions.ok":"health.detail.permissions.warning",{count:a||"0"});if("runtime-env"===t.id)return"desktop"===a?e("health.detail.runtime-env.desktop"):"manual"===a?e("health.detail.runtime-env.manual"):"declared"===a?e("health.detail.runtime-env.declared"):"unknown"===a?e("health.detail.runtime-env.unknown"):e("health.detail.runtime-env.managed",{kind:e(`env.kind.${a}`)});if("node-version"===t.id){const[r="",s=""]=a.split(":");return e("ok"===t.status?"health.detail.node-version.ok":"health.detail.node-version.warning",{version:r,required:s})}if("plugins"===t.id){if("unavailable"===a)return e("health.detail.plugins.unavailable");const[r,s,n,o]=a.split(":");if("ok"===t.status)return e("health.detail.plugins.ok",{total:r});const l=[];return(Number(s)||0)>0&&l.push(e("plugin.issue.failed",{failed:s})),(Number(n)||0)>0&&l.push(e("plugin.issue.pending",{pending:n})),(Number(o)||0)>0&&l.push(e("plugin.issue.info",{count:o})),l.join(",")}return e("health.detail.generic",{status:e(`health.status.${t.status}`)})},Er=(t,a,s)=>r.createElement("div",{style:{padding:"10px",borderRadius:"7px",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"5px"}},e(a)),(e=>[["usage.total",Ya(Ga(e,"inputTokens")+Ga(e,"outputTokens")+Ga(e,"cacheTokens"))],...Va.map(([t,a])=>[a,Ya(Ga(e,t))]),["usage.steps",Qa(e.steps,"steps")],["usage.hitRate",Qa(e.cacheHitRate,"cacheHitRate")]])(s).map(([a,s],n)=>r.createElement("div",{key:a,"data-testid":`usage-summary-${t}-${n}`,style:{display:"flex",justifyContent:"space-between",gap:"12px",padding:"4px 0",fontSize:"12px",borderTop:0===n?0:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("span",{style:{color:"var(--dsw-alias-label-secondary)"}},e(a)),r.createElement("span",{style:{fontWeight:650}},s)))),Cr=[...("today"===Wt?wr:"all"===Wt?kr:xr).values()].sort((e,t)=>Ka(t)-Ka(e)||t.steps-e.steps||e.id.localeCompare(t.id)),Tr=Lt?Cr:Cr.slice(0,3),qr=Math.max(0,Cr.length-3),Ar=Math.max(1,...Tr.map(e=>Ka(e))),zr=e=>(e||[]).filter(e=>"all"===qt||e.projectId===qt).sort((e,t)=>t.count-e.count||e.key.localeCompare(t.key)),Mr=zr(Ve?.errors?.models),Ir=zr(Ve?.errors?.tools),Rr=Array.isArray(Ve?.failedSessions)?Ve.failedSessions:[],Or=Number.isFinite(Number(Ve?.successfulSessions))?Number(Ve.successfulSessions):Math.max(0,Number(Ve?.indexedSessions||0)-Rr.filter(e=>e&&!0===e.stale).length),Hr=Rr.map(e=>`${e&&"string"==typeof e.id?e.id:""}\0${e&&"string"==typeof e.code?e.code:""}`).sort().join(""),Dr=0===Rr.length||ut===Hr?null:r.createElement("div",{"data-testid":"usage-failure-warning",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsh-svc-warning)",background:"var(--dsh-svc-raised-bg)",color:"var(--dsh-svc-text)"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px"}},r.createElement("div",{style:{flex:"1 1 auto",minWidth:0}},r.createElement("div",{style:{fontSize:"12px",lineHeight:1.5,fontWeight:650}},e("usage.failures.global",{successful:Or.toLocaleString(),failed:Rr.length.toLocaleString()})),Rr.some(e=>e&&!0===e.stale)?r.createElement("div",{style:{marginTop:"4px",fontSize:"11px",lineHeight:1.5,color:"var(--dsh-svc-text-muted)"}},e("usage.failures.staleHint")):null),r.createElement("button",{type:"button","data-testid":"usage-failure-dismiss","aria-label":e("usage.failures.dismiss"),title:e("usage.failures.dismiss"),style:{flex:"none",background:"transparent",border:0,padding:"0 2px",cursor:"pointer",color:"var(--dsh-svc-text-muted)",fontSize:"16px",lineHeight:1},onClick:()=>{pt(Hr);try{localStorage.setItem(Ia,Hr)}catch(e){}}},"×")),r.createElement("button",{type:"button","data-testid":"usage-failure-details-toggle","aria-expanded":String(dt),style:Object.assign({},Ea,{marginTop:"5px",padding:0}),onClick:()=>ct(e=>!e)},`${dt?"▾":"▸"} ${e(dt?"usage.failures.hide":"usage.failures.show")}`),dt?r.createElement("div",{"data-testid":"usage-failure-details",style:{display:"grid",gap:"6px",marginTop:"8px"}},Rr.map((t,a)=>{const s=t&&"object"==typeof t?t:{};return r.createElement("div",{key:`${String(s.id||"unknown")}:${a}`,style:{padding:"7px 9px",borderRadius:"6px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-card-bg)",fontSize:"11px",lineHeight:1.5}},r.createElement("div",{style:{overflowWrap:"anywhere"}},`${e("usage.failures.id")}: ${"string"==typeof s.id&&""!==s.id?s.id:"—"}`),r.createElement("div",{style:{overflowWrap:"anywhere"}},`${e("usage.failures.code")}: ${"string"==typeof s.code&&""!==s.code?s.code:"—"}`),r.createElement("div",{style:{overflowWrap:"anywhere",color:"var(--dsh-svc-text-muted)"}},`${e("usage.failures.message")}: ${["format-migration-failed","session-read-failed","session-fold-failed"].includes(s.code)?e(`usage.failures.reason.${s.code}`):"string"==typeof s.message&&""!==s.message?s.message:"—"}`),r.createElement("div",{style:{marginTop:"2px",color:"var(--dsh-svc-warning)"}},e(!0===s.stale?"usage.failures.stale":"usage.failures.notStale")))})):null),Lr=(t,a)=>r.createElement("div",{key:t,style:{display:"grid",gap:"6px",marginTop:"8px"}},0===a.length?r.createElement("p",{style:Ta},e("model"===t?"usage.errors.empty":"usage.toolErrors.empty")):a.map(a=>r.createElement("div",{key:`${t}:${a.projectId}:${a.key}`,style:{padding:"8px 10px",borderRadius:"6px",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-state-error-primary)",color:"var(--dsw-alias-label-primary)",fontSize:"12px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",fontWeight:600}},r.createElement("span",null,"model"===t?`${a.provider}/${a.model} · ${a.code}${null===a.status?"":` · ${a.status}`}`:`${a.tool} · ${a.code}`),r.createElement("span",null,e("usage.errors.count",{count:a.count}))),r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",marginTop:"3px",overflowWrap:"anywhere"}},a.message)))),Nr=r.createElement("div",{"data-testid":"usage-heatmap-scope-tabs",style:{display:"flex",gap:"2px"}},["day","hour"].map(t=>r.createElement("button",{key:t,type:"button","data-testid":`usage-heatmap-scope-${t}`,style:Object.assign({},Wa,Ct===t?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>Tt(t)},e(`usage.heatmap.scope.${t}`)))),Wr=r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",overflowX:"auto",paddingBottom:"2px"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none",paddingTop:"19px"}},gr.map((e,t)=>r.createElement("div",{key:t,style:{height:"16px",fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-secondary)"}},e))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0,flex:"none"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",gap:"4px",height:"15px"}},Array.from({length:24},(e,t)=>r.createElement("div",{key:`hour-${t}`,style:{width:"16px",flex:"none",fontSize:"10px",lineHeight:"15px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},(e=>e%3==0?String(e).padStart(2,"0"):"")(t)))),r.createElement("div",{"data-testid":"usage-punch-grid",role:"img","aria-label":e("usage.heatmap.hourGridLabel"),style:{display:"flex",flexDirection:"column",gap:"4px"}},[0,1,2,3,4,5,6].map(t=>r.createElement("div",{key:t,style:{display:"flex",gap:"4px"}},Array.from({length:24},(a,s)=>r.createElement("div",((t,a)=>{const r=br.get(`${t}-${a}`)||{total:0,steps:0},s=yr(r.total),n=e("usage.heatmap.hourCell",{weekday:gr[t],hour:String(a).padStart(2,"0"),total:Ya(r.total),steps:Number(r.steps||0).toLocaleString()});return{key:`${t}-${a}`,"data-testid":`usage-punch-cell-${t}-${a}`,"data-value":r.total,"data-level":s,"aria-label":n,onMouseEnter:e=>Et({id:`punch-${t}-${a}`,label:n,x:e.clientX,y:e.clientY}),onMouseMove:e=>Et(r=>r&&r.id===`punch-${t}-${a}`?r.x===e.clientX&&r.y===e.clientY?r:Object.assign({},r,{x:e.clientX,y:e.clientY}):r),onMouseLeave:()=>Et(null),style:{width:"16px",height:"16px",borderRadius:"3px",flex:"none",cursor:r.total>0?"pointer":"default",background:r.total>0?"var(--dsh-svc-success)":"var(--dsw-alias-border-l1)",opacity:dr(s)}}})(t,s)))))))),Br=0===ur.length&&0===fr.length?null:r.createElement("div",{key:"usage-heatmap","data-testid":"usage-heatmap",style:{marginTop:"10px",padding:"8px 10px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"10px",flexWrap:"wrap",marginBottom:"8px"}},r.createElement("div",{"data-testid":"usage-heatmap-title",style:{fontSize:"12px",fontWeight:650}},e("hour"===Ct?"usage.heatmap.hourTitle":"usage.heatmap.title")),Nr),"hour"===Ct?Wr:r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",overflowX:"auto",paddingBottom:"2px"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none",paddingTop:"19px"}},gr.map((e,t)=>r.createElement("div",{key:t,style:{height:"20px",fontSize:"11px",lineHeight:"20px",color:"var(--dsw-alias-label-secondary)"}},t%2==0?e:""))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0,flex:"none"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",gap:"4px",height:"15px"}},mr.map(e=>r.createElement("div",{key:`month-${e.key}`,style:{width:"20px",flex:"none",fontSize:"11px",lineHeight:"15px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},e.monthLabel))),r.createElement("div",{"data-testid":"usage-heatmap-grid",role:"img","aria-label":e("usage.heatmap.gridLabel"),style:{display:"flex",gap:"4px"}},mr.map(t=>r.createElement("div",{key:t.key,style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none"}},t.days.map(t=>r.createElement("div",(t=>{const a=cr.get($a(t))||{total:0,steps:0},r=hr(a.total),s=e("usage.heatmap.cell",{date:or(t),total:Ya(a.total),steps:Number(a.steps||0).toLocaleString()});return{key:$a(t),"data-testid":`usage-heatmap-cell-${$a(t)}`,"data-value":a.total,"data-level":r,"aria-label":s,onMouseEnter:e=>Et({id:$a(t),label:s,x:e.clientX,y:e.clientY}),onMouseMove:e=>Et(a=>a&&a.id===$a(t)?a.x===e.clientX&&a.y===e.clientY?a:Object.assign({},a,{x:e.clientX,y:e.clientY}):a),onMouseLeave:()=>Et(null),style:{width:"20px",height:"20px",borderRadius:"4px",flex:"none",cursor:a.total>0?"pointer":"default",background:a.total>0?"var(--dsh-svc-success)":"var(--dsw-alias-border-l1)",opacity:dr(r)}}})(t)))))))),r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"5px",marginTop:"8px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},r.createElement("span",null,e("usage.heatmap.less")),[0,1,2,3,4].map(e=>r.createElement("span",{key:e,"data-testid":`usage-heatmap-legend-${e}`,style:{width:"12px",height:"12px",borderRadius:"3px",background:0===e?"var(--dsw-alias-border-l1)":"var(--dsh-svc-success)",opacity:dr(e)}})),r.createElement("span",null,e("usage.heatmap.more"))),St?r.createElement("div",{"data-testid":"usage-heatmap-tooltip",style:{position:"fixed",left:`${St.x+12}px`,top:`${St.y+12}px`,zIndex:1e3,pointerEvents:"none",padding:"7px 9px",borderRadius:"6px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",fontSize:"12px",fontWeight:600,whiteSpace:"pre-line",textAlign:"left"}},St.label):null),Pr=r.createElement("div",{key:"usage-section","data-testid":"usage-card",style:Ha},Ve&&Array.isArray(Ve.projects)&&Ve.projects.length>0?r.createElement("div",{"data-testid":"usage-project-tabs",style:{display:"flex",flexWrap:"wrap",gap:"14px",marginBottom:"12px",borderBottom:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("button",{style:Object.assign({},La,"all"===qt?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>At("all")},e("usage.allProjects")),Ve.projects.filter(e=>!0!==e.missing).map(e=>r.createElement("button",{key:e.id,style:Object.assign({},La,qt===e.id?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>At(e.id)},e.title))):null,Dr,Ve&&Ve.indexedSessions>0?r.createElement("div",{"data-testid":"usage-statistics-region",style:Object.assign({},Da,{padding:"12px",borderRadius:"9px"})},r.createElement("div",{"data-testid":"usage-region-header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",flexWrap:"wrap",marginBottom:"8px"}},r.createElement("div",{style:{display:"flex",gap:"14px",flexWrap:"wrap",fontSize:"11px"}},Va.map(([,t,a])=>r.createElement("span",{key:t,style:{display:"inline-flex",alignItems:"center",gap:"5px"}},r.createElement("span",{style:{width:"9px",height:"9px",borderRadius:"2px",background:a}}),e(t)))),r.createElement("button",{type:"button","data-testid":"usage-refresh","data-variant":"neutral",style:wa,onClick:da,disabled:rt},e(rt?"usage.refreshing":"usage.refresh"))),r.createElement("div",{"data-testid":"usage-chart",style:{position:"relative",display:"grid",gridTemplateColumns:"42px minmax(0, 1fr)",height:"180px",padding:"12px 10px 4px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l1)",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},r.createElement("div",{"data-testid":"usage-y-axis","aria-label":e("usage.axis"),style:{position:"relative",height:"144px",fontSize:"10px",color:"var(--dsw-alias-label-secondary)"}},er.map((e,t)=>r.createElement("span",{key:t,style:{position:"absolute",right:"7px",top:25*t+"%",transform:4===t?"translateY(-100%)":"translateY(-50%)"}},Ya(e)))),r.createElement("div",{"data-testid":"usage-plot",style:{position:"relative",height:"164px"}},r.createElement("div",{style:{position:"absolute",inset:"0 0 20px",display:"flex",alignItems:"end",gap:"8px",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},er.map((e,t)=>r.createElement("div",{key:t,"data-testid":`usage-grid-${t}`,style:{position:"absolute",left:0,right:0,top:25*t+"%",borderTop:"1px solid var(--dsw-alias-border-l1)",pointerEvents:"none"}})),_a.map((t,a)=>r.createElement("div",{key:t.key,"aria-label":e("usage.barDay",{day:t.label,total:Ya(Za[a])}),style:{position:"relative",zIndex:1,flex:1,minWidth:0,alignSelf:"end"}},r.createElement("div",{"data-testid":`usage-bar-${t.key}`,style:{height:`${Math.max(2,Za[a]/Xa*144)}px`,display:"flex",flexDirection:"column-reverse",justifyContent:"flex-start",borderRadius:"4px 4px 0 0",overflow:"hidden"}},Va.map(([e,s,n])=>{const o=Ga(Ja[a],e),l=0===Za[a]?0:o/Za[a]*100,i=`${t.key}-${e}`,d=xt&&xt.id===i;return r.createElement("div",{key:e,"data-testid":`usage-segment-${i}`,"data-value":o,onMouseEnter:e=>kt({id:i,date:t.key,totals:Ja[a],x:e.clientX,y:e.clientY}),onMouseMove:e=>kt(t=>t&&t.id===i?t.x===e.clientX&&t.y===e.clientY?t:Object.assign({},t,{x:e.clientX,y:e.clientY}):t),onMouseLeave:()=>kt(null),style:{height:`${l}%`,minHeight:o>0?"2px":0,background:n,opacity:xt&&!d?.42:1,cursor:o>0?"pointer":"default",transition:"opacity 120ms ease"}})}))))),r.createElement("div",{"data-testid":"usage-x-axis",style:{position:"absolute",left:0,right:0,bottom:"0",height:"20px",display:"flex",gap:"8px",alignItems:"end"}},_a.map(e=>r.createElement("div",{key:e.key,style:{flex:1,minWidth:0,textAlign:"center",fontSize:"10px",color:"var(--dsw-alias-label-secondary)"}},e.label))))),r.createElement("div",{"data-testid":"usage-chart-summary",style:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}},e("usage.chartSummary",{total:Ya(Za.reduce((e,t)=>e+t,0))})),xt?r.createElement("div",{"data-testid":"usage-tooltip",style:{position:"fixed",left:`${xt.x+12}px`,top:`${xt.y+12}px`,zIndex:1e3,pointerEvents:"none",padding:"7px 9px",borderRadius:"6px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",fontSize:"12px",fontWeight:600,whiteSpace:"pre-line",textAlign:"left"}},(()=>{const t=xt.totals||{},a=Ga(t,"inputTokens")+Ga(t,"outputTokens")+Ga(t,"cacheTokens"),r=Number(t.inputTokens||0)+Number(t.cacheReadTokens||0)+Number(t.cacheWriteTokens||0),s=Number.isFinite(Number(t.cacheHitRate))?Number(t.cacheHitRate):0===r?0:Number(t.cacheReadTokens||0)/r;return`${e("usage.tooltip.date",{date:xt.date})}\n${e("usage.tooltip.input",{value:Number(t.inputTokens||0).toLocaleString()})}\n${e("usage.tooltip.output",{value:Number(t.outputTokens||0).toLocaleString()})}\n${e("usage.tooltip.cache",{value:Number((t.cacheReadTokens||0)+(t.cacheWriteTokens||0)).toLocaleString()})}\n${e("usage.tooltip.total",{value:Ya(a)})}\n${e("usage.tooltip.steps",{value:Number(t.steps||0).toLocaleString()})}\n${e("usage.tooltip.hitRate",{value:(100*s).toFixed(1)+"%"})}`})()):null,r.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"8px",marginTop:"10px"}},Er("today","usage.today",tr),Er("seven","usage.sevenDays",ar)),r.createElement("div",{"data-testid":"usage-model-list",style:{marginTop:"10px",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",flexWrap:"wrap",marginBottom:"4px"}},r.createElement("div",{"data-testid":"usage-model-sort-hint",style:{fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e(`usage.modelSortHint.${Wt}`)),r.createElement("div",{"data-testid":"usage-model-scope-tabs",style:{display:"flex",gap:"2px"}},["today","week","all"].map(t=>r.createElement("button",{key:t,"data-testid":`usage-model-scope-${t}`,style:Object.assign({},Wa,Wt===t?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>Bt(t)},e(`usage.modelScope.${t}`))))),Tr.map((t,a)=>{const s=Ka(t),n=Math.round(s/Ar*1e4)/100+"%";return r.createElement("div",{key:t.id,"data-testid":`usage-model-row-${t.id}`,style:{padding:"8px 2px",borderTop:0===a?0:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"baseline",fontSize:"12px"}},r.createElement("span",{style:{overflowWrap:"anywhere"}},t.id),r.createElement("span",{style:{fontWeight:650,whiteSpace:"nowrap"}},Ya(s))),r.createElement("div",{"data-testid":`usage-model-bar-${t.id}`,"data-value":s,"aria-label":e(`usage.modelBar.${Wt}`,{model:t.id,total:Ya(s)}),style:{height:"8px",borderRadius:"4px",marginTop:"6px",overflow:"hidden",background:"var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",height:"100%",width:n}},Va.map(([e,,a])=>{const n=((e,t)=>"cacheTokens"===t?Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0):Number(e[t]||0))(t,e);return n>0?r.createElement("div",{key:e,"data-testid":`usage-model-segment-${t.id}-${e}`,style:{width:n/s*100+"%",background:a}}):null}))),r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"4px",textAlign:"right"}},e("usage.modelLine",{steps:Number(t.steps||0).toLocaleString(),hitRate:Qa(Ua(t),"cacheHitRate"),input:Ya(t.inputTokens),output:Ya(t.outputTokens)})))}),qr>0?r.createElement("button",{style:Object.assign({},Ea,{borderTop:"1px solid var(--dsw-alias-border-l1)",marginTop:"2px"}),onClick:()=>Nt(e=>!e)},`${Lt?"▾":"▸"} ${e(Lt?"usage.models.less":"usage.models.more",{count:qr})}`):null),Br):r.createElement("p",{style:Ta},lt||e("usage.empty")),...Ve&&Ve.indexedSessions>0?[]:[r.createElement("div",{key:"usage-refresh-fallback",style:Ca},r.createElement("button",{style:wa,"data-variant":"neutral",onClick:da,disabled:rt},e(rt?"usage.refreshing":"usage.refresh")))]),jr=n&&"string"==typeof n.platform&&n.platform?`${{win32:"Windows",darwin:"macOS",linux:"Linux",freebsd:"FreeBSD",openbsd:"OpenBSD"}[n.platform]||n.platform}${"string"==typeof n.arch&&n.arch?` · ${n.arch}`:""}`:"—",$r=r.createElement("div",{key:"container-info",style:Ha},r.createElement("div",{style:Ba},e("overview.container")),n?r.createElement("div",{"data-testid":"health-display",style:Object.assign({},Da,{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"8px"})},ja("health.platform",jr),ja("health.nodeVersion","string"==typeof n.nodeVersion&&n.nodeVersion?n.nodeVersion:"—"),ja("health.uptime",(t=>{const a=Math.floor(Number(t)/60);return e("health.uptimeValue",{hours:Math.floor(a/60),minutes:a%60})})(n.uptimeSeconds)),ja("health.rss",(e=>{const t=Number(e)/1048576;return(Math.round(10*t)/10).toLocaleString(void 0,{maximumFractionDigits:1})+" MB"})(n.rssBytes)),ja("health.liveSessions",String(n.liveSessions)),ja("health.persistedSessions",String(n.persistedSessions)),ja("health.activeAgents",String(n.activeAgents)),ja("health.activeJobs",String(n.activeJobs))):r.createElement("p",{style:Ta},c||e("version.loading"))),_r=r.createElement("div",{key:"overview-errors",style:Ha},r.createElement("div",{"data-testid":"overview-errors-title",style:Ba},e("overview.errors")),r.createElement("div",{"data-testid":"overview-errors-region",style:Da},r.createElement("div",{style:Object.assign({},Ta,{margin:"-3px 0 7px"})},e("usage.errors.recent")),r.createElement("div",{style:{display:"grid",gap:"7px"}},r.createElement("div",null,r.createElement("button",{style:Ea,onClick:()=>Ot(e=>!e)},`${Rt?"▾":"▸"} ${e("usage.errors.toggle",{count:Mr.length})}`),Rt?r.createElement("div",{style:{padding:"0 2px 8px"}},Lr("model",Mr)):null),r.createElement("div",null,r.createElement("button",{style:Ea,onClick:()=>Dt(e=>!e)},`${Ht?"▾":"▸"} ${e("usage.toolErrors.toggle",{count:Ir.length})}`),Ht?r.createElement("div",{style:{padding:"0 2px 8px"}},Lr("tool",Ir)):null)))),Vr=(t,a,s)=>{const n="error"===t.status||"warning"===t.status&&!0!==t.advisory,o="ok"===t.status?"var(--dsh-svc-success)":"warning"===t.status?"var(--dsh-svc-warning)":"info"===t.status?"var(--dsh-svc-info)":"var(--dsh-svc-danger)";return r.createElement("div",{key:t.id,"data-testid":`health-check-${t.id}`,style:{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 10px",borderRadius:"6px",borderTop:0===a?0:"1px solid var(--dsh-svc-border)",background:n?"error"===t.status?"rgba(211,51,51,0.08)":"rgba(198,128,0,0.10)":"transparent"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),marginTop:"5px",background:o}}),r.createElement("div",{style:{minWidth:0,flex:1}},r.createElement("div",{style:{fontSize:"12px",fontWeight:n?650:550,color:"var(--dsh-svc-text)"}},e("health.check."+t.id)),r.createElement("div",{style:{fontSize:"11px",lineHeight:1.5,marginTop:"2px",color:"ok"===t.status?"var(--dsh-svc-text-muted)":n?"error"===t.status?"var(--dsh-svc-danger)":"var(--dsh-svc-warning)":"var(--dsh-svc-text-muted)"}},s)))},Fr=!1===s.taskNotifications?null:"undefined"==typeof Notification?{status:"info",detail:e("health.detail.notification-permission.unsupported")}:"granted"===Notification.permission?{status:"ok",detail:e("health.detail.notification-permission.granted")}:{status:"warning",detail:e("denied"===Notification.permission?"health.detail.notification-permission.denied":"health.detail.notification-permission.default")},Ur=r.createElement("div",{"data-testid":"health-diagnostics-region",style:Da},g&&"ok"!==g.status?r.createElement("div",{style:{marginTop:"10px",padding:"9px 11px",borderRadius:"7px",background:"error"===g.status?"rgba(211,51,51,0.1)":"rgba(198,128,0,0.12)",border:"1px solid "+("error"===g.status?"rgba(211,51,51,0.3)":"rgba(198,128,0,0.3)")}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700}},e("health.alert.title")),r.createElement("div",{style:Ta},e("health.alert.diagnostics",{status:e("health.overall."+g.status)}))):null,g?r.createElement("div",{"data-testid":"health-check-list",style:Object.assign({},Da,{marginTop:"10px",padding:"8px 10px"})},...g.checks.map((e,t)=>Vr(e,t,Sr(e))),...null===Fr?[]:[Vr({id:"notification-permission",status:Fr.status},g.checks.length,Fr.detail)]):null),Kr=Array.isArray(g?.pluginIssues)?g.pluginIssues:[],Gr=0===Kr.length?null:r.createElement("div",{"data-testid":"plugin-issue-list",style:{marginTop:"6px",padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-raised-bg)"}},Kr.map((t,a)=>{const s="failed"===t.phase,n="disposed"===t.phase||"unknown"===t.phase,o=s?"var(--dsh-svc-danger)":n?"var(--dsh-svc-info)":"var(--dsh-svc-warning)",l=k===t.entryId,i=E===t.entryId;return r.createElement("div",{key:t.entryId,"data-testid":`plugin-issue-${t.entryId}`,style:{display:"flex",alignItems:"flex-start",gap:"9px",padding:"8px 2px",borderTop:0===a?0:"1px solid var(--dsh-svc-border)"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),marginTop:"6px",background:o}}),r.createElement("div",{style:{minWidth:0,flex:1}},r.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"}},r.createElement("span",{style:{fontFamily:"var(--ds-font-family-code, monospace)",fontSize:"12px",fontWeight:600,overflowWrap:"anywhere",color:"var(--dsw-alias-label-primary)"}},t.moduleName),r.createElement("span",{style:{fontSize:"11px",fontWeight:650,color:o}},e("plugin.state."+t.phase))),void 0!==t.error&&null!==t.error?r.createElement("div",{style:{fontSize:"11px",marginTop:"3px",color:"var(--dsh-svc-danger)",lineHeight:1.5,overflowWrap:"anywhere"}},e("plugin.error",{error:t.error})):null,void 0!==t.missingDeps&&t.missingDeps.length>0?r.createElement("div",{style:{fontSize:"11px",marginTop:"3px",color:"var(--dsh-svc-warning)",lineHeight:1.5,overflowWrap:"anywhere"}},e("plugin.missingDeps",{deps:t.missingDeps.join(", ")})):null,s?r.createElement("div",{style:{marginTop:"6px"}},l?r.createElement("div",{style:{padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--dsw-alias-state-error-primary)",background:"rgba(211,51,51,0.08)"}},r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 6px",color:"var(--dsw-alias-state-error-primary)"})},e("plugin.restartHint",{name:t.moduleName})),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{type:"button","data-testid":`plugin-restart-confirm-${t.entryId}`,style:xa,disabled:i,onClick:()=>(async t=>{if(null!==t&&"object"==typeof t&&null===E){C(t.entryId),q(null);try{const e=await d("plugin-restart",{entryId:t.entryId});if(!e||!0!==e.ok)throw Object.assign(new Error("plugin restart failed"),{code:e?.error});S(null),await ia(!0)}catch(t){S(null),q((t=>{const a="string"==typeof t&&t.length>0?t:"internal-error";if(a.startsWith("restart-failed:")){const t=a.slice(15).trim(),r=e("plugin.error.restart-failed");return e("plugin.restartFailed",{detail:""===t?r:`${r}(${t})`})}const r={"unknown-plugin":"plugin.error.unknown-plugin","loader-unavailable":"plugin.error.loader-unavailable","plugin-disabled":"plugin.error.plugin-disabled","not-failed":"plugin.error.not-failed"}[a];return e("plugin.restartFailed",{detail:void 0===r?a:e(r)})})(t?.code??String(t?.message||t)))}finally{C(null)}}})(t)},e(i?"plugin.restarting":"plugin.restartConfirm")),r.createElement("button",{type:"button",style:Sa,disabled:i,onClick:()=>{S(null),q(null)}},e("plugin.restartCancel")))):r.createElement("button",{type:"button","data-testid":`plugin-restart-${t.entryId}`,style:ka,disabled:i,onClick:()=>{S(t.entryId),q(null)}},e(i?"plugin.restarting":"plugin.restart"))):null,T?r.createElement("p",{"data-testid":"plugin-restart-error",style:Object.assign({},Ta,{margin:"4px 0 0",color:"var(--dsw-alias-state-error-primary)"})},T):null))})),Yr=A&&!0===A.supported?A.items.filter(e=>!1===e.writable).length:0,Qr=Yr>0||j&&(j.ownerIssues>0||j.directoryModeIssues>0||j.fileModeIssues>0||j.unreadable>0),Jr=A&&!0===A.supported?r.createElement("div",{key:"permissions-section",style:{marginTop:"18px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",flexWrap:"wrap"}},r.createElement("div",{style:Ba},e("permissions.title")),r.createElement("button",{type:"button","data-testid":"permissions-toggle","aria-expanded":String(B),onClick:()=>P(e=>!e),style:{fontSize:"12px",lineHeight:"20px",padding:"2px 12px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:Yr>0?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-primary)",cursor:"pointer"}},`${B?"▾":"▸"} ${e(B?"permissions.hide":"permissions.show")}${Yr>0?` · ${Yr}`:""}`)),B?r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("permissions.description")),Yr>0?r.createElement("div",{style:{marginTop:"8px",padding:"9px 11px",borderRadius:"7px",background:"rgba(198,128,0,0.12)",border:"1px solid rgba(198,128,0,0.3)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700}},e("health.alert.title")),r.createElement("div",{style:Ta},e("permissions.summary.warning",{count:Yr}))):null,r.createElement("p",{style:Object.assign({},Ta,{fontWeight:600,color:Yr>0?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-primary)"})},e(Yr>0?"permissions.summary.warning":"permissions.summary.ok",{count:Yr>0?Yr:A.items.length})),r.createElement("p",{style:Object.assign({},Ta,{fontWeight:600})},e("permissions.target",{owner:A.targetOwner})),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},r.createElement("button",{style:wa,onClick:()=>W(e=>!e)},e(N?"permissions.hideDetails":"permissions.showDetails")),r.createElement("button",{style:wa,"data-variant":"neutral",onClick:async()=>{if(A&&!0===A.supported){F(!0),L(null);try{const e=await d("permissions-deep",{planId:A.planId});if(!e||!1===e.ok)throw new Error("deep permission check failed");$(e.value)}catch(t){L(e("permissions.error"))}finally{F(!1)}}},disabled:V},e(V?"permissions.deepChecking":"permissions.deep"))),j?r.createElement("p",{style:Ta},e("permissions.deepSummary",{scanned:j.scanned,duration:j.durationMs,owner:j.ownerIssues,directories:j.directoryModeIssues,files:j.fileModeIssues,unreadable:j.unreadable})):null,N?r.createElement("div",{style:{display:"grid",gap:"8px",marginTop:"8px"}},A.items.map(e=>r.createElement("div",{key:e.path,style:{padding:"9px 10px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:600}},e.label),r.createElement("div",{style:{fontFamily:"monospace",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",overflowWrap:"anywhere"}},e.path),r.createElement("div",{style:{fontFamily:"monospace",fontSize:"12px",marginTop:"3px"}},`${e.owner} · ${e.mode}`)))):null,M?r.createElement("div",{style:{marginTop:"10px"}},r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},e("permissions.confirmHint")),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:O,onClick:async()=>{if(A&&!0===A.supported){H(!0),L(null);try{const e=await d("permissions-repair",{planId:A.planId});if(!e||!1===e.ok)throw new Error("permission repair failed");z(e.value),I(!1)}catch(t){L(e("permissions.error"))}finally{H(!1)}}}},e(O?"permissions.repairing":"permissions.confirm")),r.createElement("button",{style:Sa,disabled:O,onClick:()=>I(!1)},e("permissions.cancel")))):Qr?r.createElement("button",{style:Object.assign({},ka,{marginTop:"10px"}),"data-variant":"dangerGhost",disabled:O,onClick:()=>I(!0)},e("permissions.repair")):null,D?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},D):null):null):null,Zr=r.createElement("div",{key:"health-section","data-testid":"health-card",style:Ha},Ur,Gr,Jr),Xr=G&&!0===Q?.active,es=Xr&&Q.phase||"copy",ts={copy:1,archive:2,validate:3,publish:4}[es]||1,as=(()=>{if(!Xr)return 0;const e=Number(Q.totalBytes)||0;let t;if("copy"===es)t=e>0?Math.min(30,Math.floor(Q.copiedBytes/e*30)):0;else if("archive"===es){const a=e>0?Math.min(1,Number(Q.archiveBytes)/e):0;t=Math.min(70,30+Math.floor(40*a))}else t="validate"===es?70:100;const a=Math.max(X.current,t);return X.current=a,a})(),rs=Xr?"copy"===es?`${Pa(Q.copiedBytes)} / ${Pa(Q.totalBytes)}`:Q.archiveBytes>0?Pa(Q.archiveBytes):"":"",ss=r.createElement("div",{key:"backup-section"},r.createElement("div",{style:Ba},e("backup.title")),r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("backup.description")),r.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},r.createElement("button",{style:Object.assign({},ya,{flex:1,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center"}),"data-variant":"brandGhost",onClick:async()=>{Y(!0),re(null),Z(null),X.current=0;let e=!1,a=()=>{};const r=async()=>{if(!e){try{const t=await d("backup-progress",{});!e&&t&&t.ok&&Z(!0===t.value?.active?t.value:null)}catch(e){}e||(a=t.timer.timeout(r,400))}};r();try{const e=await d("backup-create",{});if(!e||!1===e.ok)throw Object.assign(new Error("backup failed"),{code:e?.error});K({items:e.value.items,totalBytes:e.value.totalBytes})}catch(e){re(ca(e?.code))}finally{e=!0,a(),Z(null),Y(!1)}},disabled:G},e(G?"backup.creating":"backup.create")),r.createElement("label",{style:Object.assign({},wa,{flex:1,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:Ce?"default":"pointer"})},e(Ce?"backup.importing":"backup.import"),r.createElement("input",{type:"file",accept:".tar.gz,application/gzip",disabled:Ce,onChange:t=>{const a=t.target.files&&t.target.files[0];if(t.target.value="",!a)return;Re(!0),re(null);const r=new FileReader;r.onload=async()=>{try{const e=new Uint8Array(r.result);let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));const s=await d("backup-import",{name:a.name,data:btoa(t)});if(!s||!1===s.ok)throw Object.assign(new Error("backup import failed"),{code:s?.error});K(s.value)}catch(t){re(t?.code?ca(t.code):e("backup.error"))}finally{Re(!1)}},r.onerror=()=>{Re(!1),re(e("backup.error"))},r.readAsArrayBuffer(a)},style:{display:"none"}}))),G&&!0===Q?.active?r.createElement("div",{"data-testid":"backup-progress",style:{marginTop:"10px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},r.createElement("span",null,e("backup.progress."+es,{current:ts,total:4})),r.createElement("span",null,rs)),r.createElement("div",{style:{marginTop:"5px",height:"6px",..._("999px"),background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:as+"%",background:"var(--dsw-alias-brand-primary)",transition:"width 240ms ease"}}))):null,r.createElement("p",{style:Ta},e("backup.total",{size:Pa(U.totalBytes)})),xe?r.createElement("div",{"data-testid":"backup-manual-restart",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"rgba(198,128,0,0.10)"}},r.createElement("div",{style:{fontWeight:650,color:"var(--dsw-alias-state-warn-primary)"}},e(null!==Zt&&!0===Zt.electronShell?"backup.manualRestartTitleDesktop":"backup.manualRestartTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:"4px 0 0"})},e(null!==Zt&&!0===Zt.electronShell?"backup.manualRestartBodyDesktop":"backup.manualRestartBody"))):null,ae?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},ae):null,0===U.items.length?r.createElement("p",{style:Ta},e("backup.empty")):U.items.length>10?r.createElement("button",{style:Object.assign({},Sa,{marginTop:"8px"}),onClick:()=>De(e=>!e)},e(He?"backup.hideRecords":"backup.showRecords")):null,U.items.length>0&&(U.items.length<=10||He)?r.createElement("div",{style:{marginTop:"10px",display:"grid",gap:"8px"}},U.items.map(t=>r.createElement("div",{key:t.id,style:{padding:"9px 2px",borderBottom:"1px solid var(--dsh-svc-border)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"flex-start"}},r.createElement("div",null,r.createElement("div",{style:{fontFamily:"monospace",fontSize:"12px",overflowWrap:"anywhere"}},t.name),t.dshVersion?r.createElement("div",{"data-testid":`backup-row-version-${t.id}`,style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"3px"}},e("backup.row.version",{version:t.dshVersion})):null,r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"3px"}},`${Pa(t.sizeBytes)} · ${new Date(t.createdAt).toLocaleString()}`)),r.createElement("div",{style:{display:"flex",gap:"6px",flexShrink:0}},se===t.id||oe===t.id?null:r.createElement("button",{style:ge(),disabled:Se||G,onClick:()=>(async t=>{Ee(!0),re(null);try{const e=await d("backup-export",{id:t});if(!e||!1===e.ok)throw new Error("export failed");const a=document.createElement("a");a.href=e.value.url,a.download=e.value.name,document.body.appendChild(a),a.click(),document.body.removeChild(a)}catch(t){re(e("backup.exportError"))}finally{Ee(!1)}})(t.id)},e(Se?"backup.exporting":"backup.export")),se===t.id||oe===t.id?null:r.createElement("button",{style:ge(),disabled:G,onClick:()=>ua(t.id)},e(G&&oe===t.id?"backup.inspecting":"backup.restore")),se===t.id||oe===t.id?null:r.createElement("button",{style:Object.assign({},ka,{minHeight:"28px",padding:"4px 9px"}),"data-variant":"dangerGhost",disabled:G,onClick:()=>ne(t.id)},e("backup.delete")))),se===t.id?r.createElement("div",{style:{marginTop:"8px"}},r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)",margin:"0 0 6px"})},e("backup.confirmHint")),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:G,onClick:()=>(async t=>{Y(!0),re(null);try{const e=await d("backup-delete",{id:t});if(!e||!1===e.ok)throw new Error("backup failed");K(e.value),ne(null)}catch(t){re(e("backup.error"))}finally{Y(!1)}})(t.id)},e("backup.confirm")),r.createElement("button",{style:Sa,disabled:G,onClick:()=>ne(null)},e("backup.cancel")))):oe===t.id?r.createElement("div",{"data-testid":"backup-restore-preflight",style:{marginTop:"8px",padding:"10px",borderRadius:"8px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-raised-bg)"}},G&&null===ie?r.createElement("p",{style:Ta},e("backup.inspecting")):null!==ie?r.createElement("div",null,r.createElement("div",{style:{fontWeight:650,color:ie.validForRestore?"var(--dsh-svc-success)":"var(--dsh-svc-danger)"}},e(ie.validForRestore?"backup.integrity.ok":"backup.integrity.invalid")),r.createElement("p",{style:Object.assign({},Ta,{margin:"4px 0 0"})},e("backup.integrity.summary",{entries:ie.archive?.entryCount||0,size:Pa(ie.archive?.logicalBytes||0),sessions:ie.sections?.sessions?.files||0,config:ie.sections?.config?.files?.length||0,profiles:ie.sections?.profiles?.count||0})),r.createElement("p",{"data-testid":"backup-archive-format",style:Object.assign({},Ta,{margin:"2px 0 0"})},e("backup.integrity.format",{format:e("v2"===ie.archiveFormat?"backup.format.v2":"backup.format.v1")})),ie.dshVersion??ce?.reportSummary?.dshVersion?r.createElement("p",{"data-testid":"backup-source-version",style:Object.assign({},Ta,{margin:"2px 0 0"})},e("backup.integrity.sourceVersion",{version:ie.dshVersion??ce.reportSummary.dshVersion})):null,!0!==ie.validForRestore?r.createElement("ul",{style:Object.assign({},Ta,{margin:"6px 0 0",paddingLeft:"18px",color:"var(--dsh-svc-danger)"})},(ie.issues||[]).map((e,t)=>r.createElement("li",{key:t},ca(e.code)))):null):null,null!==ce?r.createElement("div",{style:{marginTop:"8px"}},ce.notices?.length||ie?.notices?.length?r.createElement("ul",{"data-testid":"backup-restore-notices",style:Object.assign({},Ta,{margin:"0 0 8px",paddingLeft:"18px",color:"var(--dsw-alias-state-warn-primary)"})},(ce.notices?.length?ce.notices:ie.notices).map((t,a)=>r.createElement("li",{key:`${t.code}-${a}`,"data-notice":t.code},e(`backup.notice.${t.code}`,{detail:t.detail||""})))):null,(ce.targets?.profiles?.mapping?.length||0)>0?r.createElement("div",{"data-testid":"backup-restore-mapping",style:{margin:"0 0 8px"}},r.createElement("div",{style:Object.assign({},Ta,{margin:"0 0 4px"})},e("backup.plan.mappingHint")),ce.targets.profiles.mapping.map(t=>{const a=ye[t.source]??{target:t.target,manifest:!0===t.manifest},s=[...new Set([t.source,...(he?.profiles??[]).map(e=>e.name)])].sort(),n=e=>((e,t)=>{we(t);const a=Object.keys(t).sort().map(e=>({source:e,target:t[e].target,manifest:!0===t[e].manifest}));return ua(e,a)})(oe,Object.assign({},ye,{[t.source]:e}));return r.createElement("div",{key:t.source,style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",margin:"2px 0"}},r.createElement("span",{style:{fontFamily:"monospace",fontSize:"11px"}},t.source),r.createElement("span",{style:Ta},"→"),r.createElement("select",{"data-testid":`backup-mapping-target-${t.source}`,"aria-label":e("backup.plan.mappingHint"),value:a.target,disabled:G,onChange:e=>n({target:e.target.value,manifest:!0===a.manifest}),style:{fontSize:"11px",padding:"2px 4px"}},s.map(e=>r.createElement("option",{key:e,value:e},e))),r.createElement("label",{style:Object.assign({},Ta,{display:"inline-flex",alignItems:"center",gap:"4px"})},r.createElement("input",{type:"checkbox","data-testid":`backup-mapping-manifest-${t.source}`,checked:!0===a.manifest,disabled:G,onChange:e=>n({target:a.target,manifest:e.target.checked})}),e("backup.plan.manifest")))})):null,r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-warn-primary)",margin:"0 0 6px"})},e("backup.restoreHint")),r.createElement("ul",{style:Object.assign({},Ta,{margin:"0 0 8px",paddingLeft:"18px"})},r.createElement("li",null,e("backup.plan.sessions")),r.createElement("li",null,e("backup.plan.config",{replace:ce.targets?.config?.replace?.length||0,remove:ce.targets?.config?.remove?.length||0})),r.createElement("li",null,e("backup.plan.profiles",{count:ce.targets?.profiles?.upsert?.length||0})),r.createElement("li",{"data-testid":"backup-plan-profile-patches"},(ce.targets?.profiles?.patches?.length||0)>0?e("backup.plan.profilePatches",{count:ce.targets.profiles.patches.length}):e("backup.plan.profilePatchesAbsent"))),r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 8px"})},e("backup.plan.expires",{time:new Date(ce.expiresAt).toLocaleTimeString()})),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:G,onClick:pa},e("backup.restoreConfirm")),r.createElement("button",{style:Sa,disabled:G,onClick:ma},e("backup.cancel")))):r.createElement("button",{style:Sa,disabled:G,onClick:ma},e("backup.cancel"))):null))):null)),ns=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",transition:"transform 150ms ease",transform:e?"rotate(90deg)":"none"}},r.createElement("path",{d:"M9 6l6 6-6 6"})),os=(t,a,s,n,o,l,i)=>{const d=n?n.restartPending?e("update.installedPendingRestart",{version:n.current||s||""}):"unpublished"===n.status?e("update.unpublished"):"unavailable"===n.status?e("update.unavailable"):n.upToDate?e("update.current"):e("update.available",{version:n.latest}):$e||e("update.checking"),c=n?n.restartPending?"var(--dsw-alias-state-warn-primary)":n.upToDate?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-secondary)",u=void 0!==l&&Ft.kind===l&&"latest"===Ft.variant&&"idle"!==Ft.phase,p=void 0!==l&&!0!==Vt.current&&n&&"unpublished"!==n.status&&"unavailable"!==n.status&&!n.upToDate?r.createElement("button",{type:"button",title:e(u?"update.notes.hide":"update.notes.button"),style:{background:"transparent",border:0,padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"5px",fontSize:"12px",fontWeight:600,color:c},onClick:()=>{oa(l,"latest")}},ns(u),r.createElement("span",null,d)):r.createElement("div",{style:{color:c,fontWeight:600}},d);return r.createElement("div",{key:t,className:"dshsvc-version-row",style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",gap:"8px 16px",padding:"10px 2px",borderTop:i?"1px solid var(--dsw-alias-border-l1)":0}},r.createElement("div",{className:"dshsvc-version-identity",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",minWidth:0}},r.createElement("span",{style:{fontSize:"13px",fontWeight:650,whiteSpace:"nowrap"}},`${a} `),n?.url?r.createElement("a",{"data-testid":`version-${t}-link`,href:n.url,target:"_blank",rel:"noreferrer",style:{color:"var(--dsw-alias-label-primary)",textDecoration:"underline",fontSize:"12px",whiteSpace:"nowrap",marginLeft:"16px"}},n.current||s||e("version.loading")):r.createElement("code",{style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",marginLeft:"16px",whiteSpace:"nowrap"}},n?.current||s||e("version.loading")),(t=>{if(!0===_t.current)return null;const a=Ft.kind===t&&"current"===Ft.variant&&"idle"!==Ft.phase;return r.createElement("button",{type:"button","data-testid":`version-${t}-notes-toggle`,"aria-expanded":String(a),title:e(a?"update.notes.hide":"update.notes.button"),onClick:()=>{oa(t,"current")},style:Object.assign({},Sa,{minHeight:"22px",padding:"1px 8px",fontSize:"11px",display:"inline-flex",alignItems:"center",gap:"4px"})},a?null:ns(!1),r.createElement("span",null,e("update.notes.button")))})(t)),r.createElement("div",{className:"dshsvc-version-status",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:"8px",fontSize:"12px",minWidth:0,overflowWrap:"anywhere"}},p,o||null))},ls=Pe?.dsh,is=Pe?.plugin&&!Pe.plugin.upToDate&&"available"===Pe.plugin.status,ds=1===Ue(Xt,We||Pe?.plugin?.current||null),cs=yt||ds,us=cs&&null!==Xt?Object.assign({},Pe?.plugin,{current:Xt,restartPending:!0}):Pe?.plugin,ps=null!==Zt&&!0===Zt.electronShell,ms=!is||cs||bt?null:r.createElement("button",{style:Object.assign({},wa,{minHeight:"24px",padding:"2px 8px",fontSize:"11px"},ps?{opacity:.5,cursor:"default"}:{}),disabled:mt||ps,title:ps?e("update.desktopManagedUpgrade"):void 0,onClick:fa},e(mt?"update.upgrading":"update.upgrade")),gs=ps&&(is||cs)?r.createElement("p",{"data-testid":"upgrade-desktop-note",style:Object.assign({},Ta,{margin:"6px 0 0"})},e("update.desktopManagedUpgrade")):null,hs=yt||ds&&null!==Zt&&(!0===Zt.manualStartLikely||ps),fs=t=>{if(Ft.kind!==t||"idle"===Ft.phase)return null;const a="latest"===Ft.variant?"latest":"current",s=e=>`version-${t}-notes-${a}${e}`,n="ready"===Ft.phase?Ft.value:null,o="loading"===Ft.phase?r.createElement("p",{"data-testid":s("-loading"),style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("update.notes.loading")):"pending"===Ft.phase?r.createElement("div",{"data-testid":s("-pending"),style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("update.notes.error.release-not-found")),r.createElement("button",{type:"button","data-testid":s("-retry"),onClick:()=>{sa(t,a)},style:Object.assign({},Sa,{minHeight:"22px",padding:"1px 8px",fontSize:"11px"})},e("update.notes.retry"))):"error"===Ft.phase?r.createElement("p",{"data-testid":s("-error"),role:"alert",style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},e("update.notes.error."+("string"==typeof Ft.error&&""!==Ft.error?Ft.error:"release-unavailable"))):"string"==typeof n?.notes&&""!==n.notes.trim()?r.createElement("div",{"data-testid":s("-body"),style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",overflowWrap:"anywhere"}},null!==qa?r.createElement(qa,{text:n.notes,labels:Aa(e)}):r.createElement("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.6}},n.notes)):r.createElement("p",{"data-testid":s("-empty"),style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("update.notes.empty")),l=null===n?[]:["latest"===a&&"string"==typeof n.version&&""!==n.version?r.createElement("span",{key:"version",style:{color:"var(--dsw-alias-label-secondary)",fontWeight:600}},e("update.notes.version",{version:n.version})):null,n.publishedAt?r.createElement("span",{key:"published"},e("update.notes.publishedAt",{date:String(n.publishedAt).slice(0,10)})):null,!0===n.prerelease?r.createElement("span",{key:"prerelease",style:{color:"var(--dsw-alias-state-warn-primary)"}},e("update.notes.prerelease")):null,!0===n.truncated?r.createElement("span",{key:"truncated"},e("update.notes.truncated",{chars:Number(n.notesLimit)>0?n.notesLimit:2e4})):null].filter(e=>null!==e);return r.createElement("div",{"data-testid":`version-${t}-notes`,"data-dshsvc-notes-panel":"",ref:Gt,style:{marginTop:"6px",marginBottom:"4px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)",display:"flex",flexDirection:"column",gap:"8px"}},o,l.length>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},...l):null)},bs=r.createElement("div",{key:"version-card","data-testid":"version-card",style:Ha},r.createElement("div",{key:"title",style:Ba},e("version.title")),r.createElement("div",{className:"dshsvc-version-surface",style:Da},os("plugin","dsh-service",We,us,ms,"plugin",!1),fs("plugin"),os("dsh","DSH",Le,ls,null,"dsh",!0),fs("dsh"),bt?r.createElement("div",{"data-testid":"upgrade-manual-confirm",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"6px",background:"rgba(211,51,51,0.08)",border:"1px solid rgba(211,51,51,0.3)"}},r.createElement("p",{style:{margin:"0 0 6px",color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",fontWeight:600}},e("update.manualConfirmTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 8px"})},e("update.manualConfirm")),r.createElement("div",{style:Ca},r.createElement("button",{style:ka,"data-variant":"dangerGhost",disabled:mt,onClick:fa},e(mt?"update.upgrading":"update.manualProceed")),r.createElement("button",{style:Sa,disabled:mt,onClick:()=>vt(!1)},e("restart.cancel")))):null,hs?r.createElement("div",{"data-testid":"upgrade-manual-pending",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"6px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg)"}},r.createElement("p",{style:{margin:"0 0 4px",color:"var(--dsw-alias-state-warn-primary)",fontSize:"13px",fontWeight:650}},e(ps?"update.manualRestartTitleDesktop":"update.manualRestartTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:0})},e(ps?"update.manualRestartBodyDesktop":"update.manualRestartBody"))):null,gs,ht?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)",margin:"4px 0 0"})},ht):null)),vs=r.createElement(Fe,{showNavToggle:!0}),{enabled:ys,done:ws,input:xs,bell:ks,setEnabled:Ss,setDone:Es,setInput:Cs,setBell:Ts}=Oe(),qs="undefined"!=typeof Notification,As=qs?Notification.permission:"denied",zs=(e,t,a,s,n,o)=>r.createElement("div",{"data-testid":e,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"5px 0"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},t),a?r.createElement("span",{style:Ta},a):null),((e,t,a)=>r.createElement("button",{type:"button",role:"switch","aria-checked":String(!0===e),"aria-disabled":a?"true":void 0,onClick:a?void 0:()=>t(!e),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:a?"default":"pointer",opacity:a?.5:1,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:e?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:e?"#fff":"var(--dsw-alias-label-tertiary)"}})))(s,n,o)),Ms=qs?r.createElement("div",null,r.createElement("div",{style:Ba},e("notification.title")),r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("notification.description")),"granted"!==As?r.createElement("div",{style:{marginTop:"8px",display:"flex",alignItems:"center",gap:"8px"}},r.createElement("button",{style:wa,onClick:()=>{Notification.requestPermission().then(e=>{"granted"===e&&Ss(!0)})}},e("notification.enable")),r.createElement("span",{style:Ta},"denied"===As?e("notification.denied"):"")):r.createElement("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column"}},zs("notify-row-master",e("notification.master"),null,ys,Ss,!1),zs("notify-row-done",e("notification.done"),null,ws,Es,!ys),zs("notify-row-input",e("notification.input"),null,xs,Cs,!ys),zs("notify-row-bell",e("notification.bellShow"),null,ks,Ts,!1)))):null,Is=null!=Pe&&(Pe.dsh&&!1===Pe.dsh.upToDate||Pe.plugin&&!1===Pe.plugin.upToDate),Rs=null!==U&&!G&&!ae,Os=(g?.checks||[]).filter(e=>"error"===e.status||"warning"===e.status&&!0!==e.advisory&&"permissions"!==e.id),Hs=[];c&&Hs.push({level:"error",text:c}),lt&&Hs.push({level:"error",text:lt}),ae&&Hs.push({level:"error",text:ae}),Jt.error&&Hs.push({level:"error",text:String(Jt.error)}),D&&Hs.push({level:"error",text:D});for(const t of Os)Hs.push({level:"error"===t.status?"error":"warning",text:e(`health.check.${t.id}`)+":"+Sr(t)});Yr>0&&Hs.push({level:"warning",text:e("permissions.summary.warning",{count:Yr})}),Is&&Hs.push({level:"info",text:e("overview.updateAvailable")}),Rs&&0===U.items.length&&Hs.push({level:"info",text:e("overview.backupEmpty")});const Ds=Hs.some(e=>"error"===e.level)?"error":Hs.some(e=>"warning"===e.level)?"warning":Hs.some(e=>"info"===e.level)?"info":"normal",Ls="normal"===Ds?e("overview.status.normal"):e(`overview.status.${Ds}`,{count:Hs.length}),Ns=r.createElement("div",{"data-testid":"overview-status",style:Object.assign({},Da,{display:"flex",alignItems:"center",gap:"10px"})},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"10px",height:"10px",..._("50%"),background:"normal"===Ds?"var(--dsh-svc-success)":"warning"===Ds?"var(--dsh-svc-warning)":"error"===Ds?"var(--dsh-svc-danger)":"var(--dsh-svc-info)"}}),r.createElement("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsh-svc-text)"}},Ls)),Ws=0===Hs.length?null:r.createElement("div",{"data-testid":"overview-actionables",style:Object.assign({},Da,{marginTop:"10px",padding:"4px 10px"})},Hs.map((e,t)=>r.createElement("div",{key:`${e.level}-${t}`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 2px",fontSize:"12px",borderTop:0===t?0:"1px solid var(--dsh-svc-border)"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),background:"error"===e.level?"var(--dsh-svc-danger)":"warning"===e.level?"var(--dsh-svc-warning)":"var(--dsh-svc-info)"}}),r.createElement("span",{style:{color:"var(--dsh-svc-text)"}},e.text)))),Bs=r.createElement("div",null,Ns,Ws,bs,$r,Mr.length>0||Ir.length>0?_r:null),Ps=r.createElement("div",{key:"maintenance-card","data-testid":"maintenance-card",style:Ha},ss),js=!0===g?.checks?.some(e=>"error"===e.status||"warning"===e.status&&!0!==e.advisory),{batch:$s}=ha(),_s={overview:!1,usage:Boolean(lt),quota:!1,diagnostics:Boolean(c||D||js||Yr>0),maintenance:Boolean(ae||Jt.error),configuration:!1},[Vs,Fs]=a("subagent"),[Us,Ks]=a("features");o(()=>{let e=null;try{e=localStorage.getItem("dsh-service-maintenance-tab")}catch(e){}Fs(qe(e,s))},[]);const Gs=((e,t)=>ee.filter(t=>void 0===pe[t]||(Array.isArray(pe[t])?pe[t].some(t=>!1!==e[t]):!1!==e[pe[t]])).map(e=>({id:e,labelKey:te[e],warning:void 0!==t&&!0===t[e]})))(s,_s),Ys=Te(s),Qs=Gs.filter(e=>e.warning).map(t=>e(t.labelKey)),Js=Gs.some(e=>e.id===Pt)?Pt:"overview",Zs=qe(Vs,s),Xs="overview"===Js?Bs:"usage"===Js?Pr:"quota"===Js?r.createElement(Ma,null):"models"===Js?r.createElement(Ra,{SubagentSection:ta}):"diagnostics"===Js?Zr:"maintenance"===Js?null===Zs?r.createElement("div",{"data-testid":"maintenance-empty",style:Da},e("maintenance.empty")):"restart"===Zs?vs:"backup"===Zs?Ps:"skills"===Zs?r.createElement(va,null):"subagent"===Zs?r.createElement(ta,null):r.createElement(za,null):"notifications"===Us?r.createElement("div",{"data-testid":"config-notifications-page",style:Object.assign({},Ha,!1===s.taskNotifications?{opacity:.55}:{})},Ms,...!1===s.taskNotifications?[r.createElement("p",{key:"notify-off-hint",style:Object.assign({},Ta,{marginTop:"8px"})},e("config.notificationsDisabled"))]:[]):"navOrder"===Us?r.createElement(Qt,null):r.createElement("div",{style:Ha},r.createElement(Yt,null));return r.createElement("div",{"data-testid":"service-panel-root","data-dshsvc-root":"","data-dshsvc-page":Js,className:"dshsvc-page"},Qs.length>0?r.createElement("div",{role:"alert",style:{marginBottom:"12px",padding:"11px 13px",borderRadius:"8px",background:"rgba(198,128,0,0.16)",border:"1px solid rgba(198,128,0,0.48)"}},r.createElement("div",{style:{fontSize:"13px",fontWeight:700}},e("tabs.alert.title")),r.createElement("div",{style:Object.assign({},Ta,{marginTop:"3px"})},e("tabs.alert.body",{tabs:Qs.join(e("tabs.alert.join"))}))):null,r.createElement(Ie,{items:Gs.map(t=>({id:t.id,label:e(t.labelKey),icon:"diagnostics"===t.id?"health":t.id,warning:t.warning,badge:"maintenance"===t.id&&null!==$s&&"running"===$s.phase?{testid:"skills-tab-badge",text:$s.done+"/"+$s.total}:null})),activeId:Js,onChange:e=>{Oa()&&(jt(e),"diagnostics"===e&&ia(!1))},testIdPrefix:"service-tab",dotLabel:e("tabs.alert.dot"),ariaLabel:e("nav.label")}),r.createElement(Me,{title:e(te[Js]),description:void 0!==ze[Js]?e(ze[Js]):null,action:"diagnostics"===Js?r.createElement("button",{type:"button","data-testid":"diagnostics-recheck","data-variant":"neutral",style:wa,onClick:()=>ia(!0),disabled:f},e(f?"health.checking":g?"health.recheck":"health.check")):null}),"maintenance"===Js&&Ys.length>0?r.createElement(Ie,{items:Ys.map(t=>({id:t.id,label:e(t.labelKey)})),activeId:Zs,onChange:e=>{Fs(e);try{localStorage.setItem("dsh-service-maintenance-tab",e)}catch(e){}},testIdPrefix:"maintenance-tab",variant:"sub",ariaLabel:e("tabs.maintenance")}):null,"configuration"===Js?r.createElement(Ie,{items:Ae.map(t=>({id:t.id,label:e(t.labelKey)})),activeId:Us,onChange:Ks,testIdPrefix:"config-tab",variant:"sub",ariaLabel:e("tabs.configuration")}):null,r.createElement("div",{"data-testid":"tab-panel",style:{padding:"14px 2px 2px",color:"var(--dsw-alias-label-primary)"}},Xs))}const Da=["M10.268 21a2 2 0 0 0 3.464 0","m15 8 2 2 4-4","M16.8607 4.4824A6 6 0 0 0 6 8C6 12.499 4.589 13.956 3.262 15.326","M3.262 15.326A1 1 0 0 0 4 17H20A1 1 0 0 0 20.74 15.327C20.209 14.779 19.665 14.218 19.203 13.454"],La=["M10.268 21a2 2 0 0 0 3.464 0","M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742","m2 2 20 20","M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05"];function Na(){const{enabled:e,setEnabled:t}=Oe(),a=J();return r.createElement("button",{type:"button",title:a(e?"notification.bellOn":"notification.bellOff"),style:{background:"transparent",border:0,cursor:"pointer",padding:"2px 4px",color:"inherit",opacity:e?1:.45,lineHeight:0},onClick:()=>{"undefined"!=typeof Notification&&("granted"===Notification.permission?t(!e):Notification.requestPermission().then(e=>{"granted"===e&&t(!0)}))}},(s=e,r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"}},(s?Da:La).map(function(e,t){return r.createElement("path",{key:t,d:e})}))));var s}t.slots.inject("conversation.input.left",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("taskNotifications")&&Re.current.bellVisible&&(e=t.slots.register({name:"conversation.input.left",id:"dsh-service-notify",order:90,label:()=>u("notification.bellOn")},()=>r.createElement(Na,null)))};a();const s=g.subscribe(a),n=Le(a);return()=>{s(),n(),null!==e&&e()}}),t.slots.inject("settings.plugin.item",()=>t.slots.register({name:"settings.plugin.item",id:"dsh-service",key:"dsh-service",order:40},()=>r.createElement(Kt,null))),t.slots.inject("plugins.bundle.config",()=>t.slots.register({name:"plugins.bundle.config",key:"@gehennawu/dsh-service"},e=>"page"===e?.view?r.createElement(Kt,null):null)),t.slots.inject("settings.section",()=>{const e=t.slots.register({name:"settings.section",id:"dsh-service",order:99,label:()=>u("nav.label")},()=>r.createElement(Ha,null));We.sync(),Be.sync(),Pe.sync(),je.sync();const a=g.subscribe(Be.sync),s=g.subscribe(Pe.sync),n=g.subscribe(je.sync);return()=>{a(),s(),n(),e(),We.disposeEntry(),Be.disposeEntry(),Pe.disposeEntry(),je.disposeEntry()}}),t.slots.inject("shell.overlay",()=>t.slots.register({name:"shell.overlay",id:"dsh-service-restart",order:100,label:()=>u("overlay.label")},()=>r.createElement(Ve,null))),t.slots.inject("conversation.input.right",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("quotaLookup")&&(e=t.slots.register({name:"conversation.input.right",id:"dsh-service-quota-ring",order:95,label:()=>u("quota.ring.label"),inject:e=>{if(null==e)return{};try{const t=$e();if(void 0===t||"function"!=typeof t.directoryFor)return{sessionId:e};const a=t.directoryFor(e);return{sessionId:e,directoryStore:a.store,loadDirectory:()=>{try{const e=a.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}}}catch(t){return{sessionId:e}}}},e=>r.createElement(Ut,e)))};a();const s=g.subscribe(a);return()=>{s(),null!==e&&e()}}),t.slots.inject("conversation.composer.dock",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("subagentRoute")&&b("subagentModelsDock")&&(e=t.slots.register({name:"conversation.composer.dock",id:"dsh-service-subagent-models-dock",order:60,label:()=>u("subagent.dock.label"),inject:e=>({sessionId:e})},e=>r.createElement(Z,e)))};a();const s=g.subscribe(a);return()=>{s(),null!==e&&e()}});const Wa=L,Ba=(e,t)=>{const a="editor.error."+("string"==typeof t&&""!==t?t:"internal"),r=e(a,{limit:"2 MiB"});return r===a?e("editor.error.internal"):r},Pa=[],ja=e=>{const t=Pa[e];try{t.button.remove()}catch(e){}Pa.splice(e,1)},$a=()=>{for(;Pa.length>0;)ja(Pa.length-1)},_a=()=>{const e=P();if(null===e)return;const t=u("editor.viewer"),a=b("fileEditor"),r=a?j(e,B):[];for(let e=Pa.length-1;e>=0;e-=1){const a=Pa[e];r.includes(a.menu)&&$(a.menu)!==t||ja(e)}if(a){for(const e of Pa)if(e.button.textContent!==t){e.button.textContent=t;try{e.button.setAttribute("aria-label",t),e.button.setAttribute("title",t)}catch(e){}}for(const a of r){if($(a)===t)continue;if(Pa.some(e=>e.menu===a))continue;const r=a.parentNode;if(null==r||"function"!=typeof e.createElement||"function"!=typeof r.insertBefore)continue;const s=e.createElement("button");s.type="button",s.setAttribute(N,""),s.setAttribute("aria-label",t),s.setAttribute("title",t),s.textContent=t,Object.assign(s.style,{minHeight:"22px",marginRight:"4px",padding:"1px 8px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"var(--dsh-svc-radius-control, 6px)",background:"transparent",color:"var(--dsw-alias-label-secondary)",font:"inherit",fontSize:"12px",lineHeight:"18px",cursor:"pointer",flex:"none"}),s.addEventListener("click",a=>{try{a?.preventDefault?.()}catch(e){}try{a?.stopPropagation?.()}catch(e){}G(e,e=>e===t,{menu:F(s),isAlive:()=>K.isAlive()})}),r.insertBefore(s,a),Pa.push({menu:a,button:s})}}};function Va(e){const t=J(),a="string"==typeof e?.tab?.contentId?e.tab.contentId:"";if(!a.startsWith("dsh-resource://file/")||!V(a))return null;const s=P();return(null===s?[]:j(s,B)).some(e=>$(e)===t("editor.viewer"))?null:r.createElement("button",{type:"button",role:"menuitem","data-testid":"file-editor-menu-item",[W]:"",onClick:()=>{try{e?.dismiss?.()}catch(e){}const a=P(),r=null===a?[]:j(a,B);1===r.length&&G(a,e=>e===t("editor.viewer"),{menu:r[0],isAlive:()=>K.isAlive()})},style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",border:0,background:"transparent",color:"var(--dsw-alias-label-primary)",font:"inherit",fontSize:"12px",lineHeight:"18px",cursor:"pointer",whiteSpace:"nowrap"}},t("editor.viewer"))}function Fa(e){const t=J(),a="string"==typeof e?.resourceAddress?e.resourceAddress:"",s=!1!==e?.wrap,n=e?.content,[o,l]=r.useState({phase:"loading",text:"",version:"",path:"",bytes:0,error:""}),[i,c]=r.useState(null),[u,p]=r.useState(!1),[m,g]=r.useState(""),[h,f]=r.useState(null),[b,v]=r.useState(null),[y,w]=r.useState(null),x=r.useRef(0),k=r.useRef(n),S=r.useRef(o),E=r.useRef(null),C=r.useRef(!1),T=r.useRef(null),q=r.useRef(null),A=r.useRef(null),z=e=>{S.current=e,l(e)},M=e=>{E.current=e,c(e)},I=e=>{C.current=e,p(e)},R=e=>{T.current=e,v(e)},O=()=>(x.current+=1,x.current),H=e=>x.current===e,D=()=>{if(!0===C.current)return;const e=O();z({phase:"loading",text:"",version:"",path:"",bytes:0,error:""}),M(null),f(null),R(null),g(""),I(!1),d("file-read",{address:a}).then(t=>{if(!H(e))return;if(!t||!0!==t.ok)return void z({phase:"error",text:"",version:"",path:"",bytes:0,error:"string"==typeof t?.error?t.error:"internal"});const a=t.value||{};z({phase:"ready",text:"string"==typeof a.text?a.text:"",version:"string"==typeof a.version?a.version:"",path:"string"==typeof a.path?a.path:"",bytes:Number.isFinite(a.bytes)?a.bytes:0,error:""})}).catch(()=>{H(e)&&z({phase:"error",text:"",version:"",path:"",bytes:0,error:"internal"})})},L=(e,t,r={})=>{const s="undo"===r?.kind?"undo":"save";if(!0===C.current)return;if("string"!=typeof e)return;const n=O();I(!0),g(""),d("file-write",{address:a,text:e,version:t,force:!0===r?.force}).then(a=>{if(!H(n))return;if(I(!1),!a||!0!==a.ok){const e="string"==typeof a?.error?a.error:"internal";return"file-stale"===e?void f({kind:s}):void g(e)}const o=a.value||{},l="string"==typeof o.version&&""!==o.version?o.version:"string"==typeof t?t:"",i=S.current;z({phase:"ready",text:e,version:l,path:"string"==typeof o.path&&""!==o.path?o.path:i.path,bytes:Number.isFinite(o.bytes)?o.bytes:i.bytes,error:""}),R("undo"===s?null:"string"==typeof o.before?{text:o.before,version:l}:null);const d=E.current;null===d||d===e?(M(null),f(null),g("saved"),"preview"===r?.leaveAfter&&V()):f(null)}).catch(()=>{H(n)&&(I(!1),g("internal"))})};r.useEffect(()=>(k.current=n,D(),()=>{x.current+=1}),[a]),r.useEffect(()=>{if(k.current===n)return;if(k.current=n,!0===C.current)return;const e=E.current;null!==e&&e!==S.current.text||D()},[n]);const N=null!==i&&i!==o.text,W="error"===o.phase?o.error:"",B=!0===u?t("editor.saving"):!0===N?t("editor.unsaved"):"saved"===m?t("editor.saved"):"",j=!0===u?"var(--dsw-alias-label-secondary)":!0===N?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",$=e=>({minHeight:"26px",padding:"2px 9px",fontSize:"12px",borderRadius:"var(--dsh-svc-radius-control, 6px)",border:"1px solid "+("primary"===e?"var(--dsh-svc-brand)":"var(--dsw-alias-border-l2)"),background:"primary"===e?"var(--dsh-svc-brand)":"transparent",color:"primary"===e?"var(--dsh-svc-brand-text)":"var(--dsw-alias-label-primary)",cursor:"pointer"}),_=(e,a,s,n,o)=>r.createElement("button",{type:"button","data-testid":e,disabled:!0===o,onClick:s,style:Object.assign($(n),!0===o?{opacity:.5,cursor:"default"}:{})},t(a)),V=()=>{const e=F(q.current);return null!=e&&G(P(),e=>e!==t("editor.viewer"),{menu:e,isAlive:()=>K.isAlive()})},U=r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",padding:"6px 10px",borderBottom:"1px solid var(--dsw-alias-border-l1)",fontSize:"12px"}},r.createElement("span",{"data-testid":"file-editor-path",title:""!==o.path?o.path:a,style:{flex:"1 1 90px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--ds-font-family-code, monospace)",color:"var(--dsw-alias-label-secondary)"}},""!==o.path?o.path:a),""!==B?r.createElement("span",{"data-testid":"file-editor-status",role:"status","aria-live":"polite",style:{flex:"none",fontWeight:600,color:j}},B):null,r.createElement("span",{style:{display:"flex",gap:"6px",marginLeft:"auto",flex:"none"}},_("file-editor-preview","editor.preview",()=>{!0!==C.current&&(!0!==N?V():w("preview"))},"ghost",u),null!==b?_("file-editor-undo","editor.undo",()=>{!0!==C.current&&null!==b&&w("undo")},"ghost",u):null,_("file-editor-reload","editor.reload",()=>{!0!==C.current&&(!0!==N?D():w("reload"))},"ghost",u),_("file-editor-save","editor.save",()=>L(E.current??o.text,o.version,{kind:"save"}),"primary",u||!N))),Y=null!==h&&"save"===h.kind?r.createElement("div",{"data-testid":"file-editor-conflict",style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700,color:"var(--dsw-alias-state-warn-primary)"}},t("editor.conflict.title")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t("editor.conflict.body")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},_("file-editor-conflict-reload","editor.conflict.reload",()=>D(),"ghost",u),_("file-editor-conflict-overwrite","editor.conflict.overwrite",()=>L(E.current??o.text,o.version,{kind:"save",force:!0}),"primary",u))):null,Q=null!==h&&"undo"===h.kind?r.createElement("div",{"data-testid":"file-editor-undo-conflict",style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700,color:"var(--dsw-alias-state-warn-primary)"}},t("editor.undoConflict.title")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t("editor.undoConflict.body")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},_("file-editor-undo-conflict-reload","editor.conflict.reload",()=>D(),"ghost",u),_("file-editor-undo-conflict-dismiss","editor.undoConflict.dismiss",()=>f(null),"ghost",!1))):null,Z={preview:"editor.confirm.previewTitle",reload:"editor.confirm.reloadTitle",undo:"editor.confirm.undoTitle"},X=null===y?null:r.createElement("div",{"data-testid":"file-editor-confirm",role:"alertdialog","aria-label":t(Z[y]??"editor.confirm.previewTitle"),style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700}},t(Z[y]??"editor.confirm.previewTitle")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t({preview:"editor.confirm.previewBody",reload:"editor.confirm.reloadBody",undo:"editor.confirm.undoBody"}[y]??"editor.confirm.previewBody")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},"preview"===y?_("file-editor-confirm-save","editor.confirm.saveBack",()=>{w(null),L(E.current??o.text,o.version,{kind:"save",leaveAfter:"preview"})},"primary",u):null,"undo"===y?_("file-editor-confirm-save","editor.undo",()=>(()=>{const e=T.current;w(null),null!=e&&(M(null),L(e.text,e.version,{kind:"undo"}))})(),"primary",u):null,"reload"===y?_("file-editor-confirm-discard","editor.confirm.reloadGo",()=>{w(null),D()},"primary",u):null,"preview"===y?_("file-editor-confirm-discard","editor.confirm.discardBack",()=>{w(null),V()},"ghost",!1):null,_("file-editor-confirm-cancel","editor.confirm.cancel",()=>(()=>{w(null);try{A.current?.focus?.()}catch(e){}})(),"ghost",!1))),ee=""===m||"saved"===m?null:r.createElement("p",{"data-testid":"file-editor-notice",style:{margin:"8px 10px 0",fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},Ba(t,m)),te="loading"===o.phase?r.createElement("p",{"data-testid":"file-editor-loading",style:{margin:"12px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},t("editor.loading")):"error"===o.phase?r.createElement("div",{"data-testid":"file-editor-error",style:{margin:"12px 10px",fontSize:"12px",lineHeight:1.6,color:"var(--dsw-alias-label-secondary)"}},r.createElement("p",{style:{margin:"0 0 8px"}},Ba(t,W)),_("file-editor-retry","editor.retry",()=>D(),"ghost",!1)):r.createElement("textarea",{"data-testid":"file-editor-textarea",ref:A,"aria-label":t("editor.viewer"),value:null!==i?i:o.text,spellCheck:!1,onChange:e=>M("string"==typeof e?.target?.value?e.target.value:""),onKeyDown:e=>{!0!==e?.ctrlKey&&!0!==e?.metaKey||"s"!==e?.key&&"S"!==e?.key||(e.preventDefault(),!0!==C.current&&N&&L(E.current??o.text,o.version,{kind:"save"}))},style:{flex:"1 1 auto",minHeight:"160px",margin:0,padding:"8px 10px",border:0,outline:"none",resize:"none",background:"transparent",color:"var(--dsw-alias-label-primary)",fontFamily:"var(--ds-font-family-code, monospace)",fontSize:"12px",lineHeight:1.6,tabSize:2,whiteSpace:s?"pre-wrap":"pre",overflow:"auto",overflowWrap:s?"anywhere":"normal"}});return r.createElement("div",{"data-dshsvc-editor":"",ref:q,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,color:"var(--dsw-alias-label-primary)"}},U,X,Y,Q,ee,te,r.createElement("div",{style:{flex:"none",padding:"4px 10px 6px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},t("editor.keyHint")))}const Ua=()=>{if(!b("fileEditor"))return;const e=[],a=e=>{if(null!=e&&void 0!==e.documentPreviews)return e.documentPreviews;try{return"function"==typeof t.get?t.get("documentPreviews"):void 0}catch(e){return}},n=a=>{if(null==a||"function"!=typeof a.register)return;let n=null;try{n=a.register({id:D,extensions:Wa,priority:"builtin",title:()=>u("editor.viewer"),loading:"text-pages",wrap:!0})}catch(e){return}e.push(n),e.push(t.slots.inject("sidebar.right.tab.document",()=>t.slots.register({name:"sidebar.right.tab.document",key:D,locale:s},Fa))),e.push(t.slots.inject("sidebar.right.tab.menu.item",()=>t.slots.register({name:"sidebar.right.tab.menu.item",id:"dsh-service-editor",order:40},e=>r.createElement(Va,e)))),e.push((()=>{K=(()=>{const e={alive:!0};return U.add(e),{isAlive:()=>!0===e.alive,dispose:()=>{e.alive=!1,U.delete(e)}}})(),_a();let e=()=>{};try{if("function"==typeof t.locale?.subscribe){const a=t.locale.subscribe(()=>{try{_a()}catch(e){}});"function"==typeof a&&(e=a)}}catch(e){}const a=P();if(null===a||"function"!=typeof MutationObserver)return()=>{e(),$a()};let r=!1;const s=()=>{r||(r=!0,Promise.resolve().then(()=>{r=!1;try{_a()}catch(e){}}))};let n=null;try{n=new MutationObserver(s),n.observe(a.documentElement??a.body??a,{childList:!0,subtree:!0,characterData:!0})}catch(e){n=null}return()=>{try{n?.disconnect()}catch(e){}e(),$a(),K.dispose(),(()=>{for(const e of U)e.alive=!1;U.clear()})()}})())};return"function"==typeof t.inject?e.push(t.inject(["documentPreviews"],e=>{n(a(e))})):n(a(void 0)),()=>{for(const t of e)try{t()}catch(e){}}};t.effect(()=>{let e=b("fileEditor"),t=!0===e?Ua():void 0;const a=g.subscribe(()=>{const a=b("fileEditor");a!==e&&(e=a,"function"==typeof t&&t(),t=!0===a?Ua():void 0)});return()=>{a(),"function"==typeof t&&t()}},"dsh-service file editor");const Ka=(()=>{const e={observer:null,btn:null,styleTag:null,retryTimer:null,retryLeft:0,scrollHandler:null,rafId:null,slotRO:null},a=we(),r=()=>{if(null!==e.retryTimer){try{e.retryTimer()}catch(e){}e.retryTimer=null}},s=()=>{if(null!==e.btn&&e.btn.isConnected)try{const t=a.toBottomSlot();if(null===t)return;const r=a.scrollportOf(t);if(null===r||"function"!=typeof r.querySelectorAll)return;let s=!1;for(const e of a.userRows(r))if(a.flowTopOf(r,e)<4){s=!0;break}const o=null!==a.loadOlderButton(r);e.btn.style.display=s||o?"flex":"none",n()}catch(e){}},n=()=>{if(null!==e.btn&&e.btn.isConnected)try{const t=a.toBottomSlot();if(null===t||"function"!=typeof t.querySelector)return;const r=a.toBottomButton(t);let s=0;if(null!==r){const e=t.getBoundingClientRect().right,a=r.getBoundingClientRect().right;s=Math.max(0,Math.round(e-a))}const n=`${s}px`;e.btn.style.right!==n&&(e.btn.style.right=n)}catch(e){}},o=()=>{if(null===e.btn||!e.btn.isConnected)try{const o=a.toBottomSlot();if(null===o||"function"!=typeof o.appendChild||"function"!=typeof o.querySelector)return;const l=a.toBottomButton(o),i=document.createElement("button");i.type="button",i.setAttribute("data-dshsvc-user-jump",""),i.setAttribute("aria-label",u("conversation.jump.previousReply"));let d=0;try{if(null!==l){const e=o.getBoundingClientRect().right,t=l.getBoundingClientRect().right;d=Math.max(0,Math.round(e-t))}}catch(e){}Object.assign(i.style,{position:"absolute",right:`${d}px`,bottom:"42px",zIndex:"1",width:"34px",height:"34px",padding:"0",cursor:"pointer",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-button-floating-fill)",color:"var(--dsw-alias-label-primary)",boxShadow:"var(--dsw-shadow-lv2)",..._("100px"),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto"}),i.innerHTML=(e=>{try{const t=a.toBottomButton(e),r=null!==t?t.querySelector("svg"):null;if(null!==r&&"string"==typeof r.outerHTML)return r.outerHTML.replace(/<svg/i,'<svg style="transform:rotate(180deg)"')}catch(e){}return'<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"><path d="M7 10.5V3.5M3.5 7 7 3.5 10.5 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'})(o),i.addEventListener("click",()=>{const s=a.scrollportOf(o);if(null===s||"function"!=typeof s.querySelectorAll)return;const n=Number(s.scrollTop)||0,l=()=>{e.retryTimer=null;const r=Number(s.scrollTop)||0;if(Math.abs(r-n)>40)try{s.scrollTop=n}catch(e){}const o=a.userRows(s);let i=null;for(let e=o.length-1;e>=0;e-=1)if(a.flowTopOf(s,o[e])<4){i=o[e];break}if(null!==i){const e=Math.max(0,n+a.flowTopOf(s,i)-12);try{s.scrollTop=e}catch(e){}return}if(e.retryLeft<=0)return;e.retryLeft-=1;const d=a.loadOlderButton(s);if(null!==d){if(!0!==d.disabled)try{d.click()}catch(e){}e.retryTimer=t.timer.timeout(l,220)}};r(),e.retryLeft=20,l()}),o.appendChild(i),e.btn=i,(()=>{if("function"==typeof ResizeObserver){if(null!==e.slotRO){try{e.slotRO.disconnect()}catch(e){}e.slotRO=null}try{const t=a.toBottomSlot();if(null===t)return;const r=new ResizeObserver(()=>{n()});r.observe(t),e.slotRO=r}catch(t){e.slotRO=null}}})(),s()}catch(e){}};return{start:()=>{try{if(null===e.styleTag){const t=document.createElement("style");t.dataset.plugin="@gehennawu/dsh-service",t.dataset.pluginCss="@gehennawu/dsh-service/user-jump.css",t.textContent="[data-dshsvc-user-jump]:hover,[data-dshsvc-user-jump]:active{background:var(--dsw-alias-button-floating-hover)!important}",document.head.appendChild(t),e.styleTag=t}}catch(e){}if(o(),null===e.observer){try{e.observer=new MutationObserver(()=>{o(),s()}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0})}catch(t){e.observer=null}if(null===e.scrollHandler)try{e.scrollHandler=()=>{if("function"==typeof requestAnimationFrame){if(null!==e.rafId)return;e.rafId=requestAnimationFrame(()=>{e.rafId=null,s()})}else s()},document.documentElement.addEventListener("scroll",e.scrollHandler,!0)}catch(t){e.scrollHandler=null}}},stop:()=>{if(r(),null!==e.slotRO){try{e.slotRO.disconnect()}catch(e){}e.slotRO=null}if(null!==e.scrollHandler){try{document.documentElement.removeEventListener("scroll",e.scrollHandler,!0)}catch(e){}e.scrollHandler=null}if(null!==e.rafId){try{cancelAnimationFrame(e.rafId)}catch(e){}e.rafId=null}if(null!==e.observer){try{e.observer.disconnect()}catch(e){}e.observer=null}if(null!==e.btn){try{e.btn.remove()}catch(e){}e.btn=null}if(null!==e.styleTag){try{e.styleTag.remove()}catch(e){}e.styleTag=null}}}})();t.effect(()=>(Ka.start(),()=>Ka.stop()),"dsh-service user reply jump");const Ga=xe({ctx:t,getModelDirectories:$e});t.effect(()=>{let e=!1;const t=()=>{const t=b("modelProviderIcons");t&&!e?(e=!0,Ga.revive(),Ga.start()):!t&&e&&(e=!1,Ga.stop())},a=g.subscribe(t);return t(),()=>{a(),e&&Ga.stop()}},"dsh-service model provider icons");const Ya=ye({ctx:t,t:u,featureEnabled:b,createConversationNav:we});t.effect(()=>{const e=g.subscribe(()=>Ya.evaluate());return Ya.evaluate(),()=>{e(),Ya.dispose()}},"dsh-service mobile adaptation")},a.subagentLine={aggregateSubagentRoutes:de,subagentRouteListText:ce},a.featureSettings={create:Se},a.fileEditor={id:D,extensions:L,selectViewerItem:G,editorExtensionMatches:V,attr:N,menuItemAttr:W},a.modelProviderIcons={resolve:T,dataUri:k,attr:d,seatAttr:c,triggerAttr:m,officialIconVar:b,slotKey:g,ariaTriggerSelector:h,triggerLegacySelector:f,groupTitleSelector:w,groupTitleLegacySelector:x,sizeVar:p,basePx:15,menuGroupAttr:v,menuGroupIconAttr:y,menuGroupPx:13,css:A,slugs:Object.keys(o),providerCount:Object.keys(l).length,quotaAdaptedKind:C,quotaKindSlugs:E,quotaStore:S},t}});
|
|
1
|
+
window.__ModuleLoader__.load({id:"@gehennawu/dsh-service",factory:e=>{var t={},a=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});const r=e("react"),s="dsh-service",n={years:[2025,2026],papers:{2025:"https://www.gov.cn/zhengce/zhengceku/202411/content_6986383.htm",2026:"https://www.gov.cn/zhengce/zhengceku/202511/content_7047091.htm"},offDays:{"2025-01-01":"new-year","2025-01-28":"spring-festival","2025-01-29":"spring-festival","2025-01-30":"spring-festival","2025-01-31":"spring-festival","2025-02-01":"spring-festival","2025-02-02":"spring-festival","2025-02-03":"spring-festival","2025-02-04":"spring-festival","2025-04-04":"qingming","2025-04-05":"qingming","2025-04-06":"qingming","2025-05-01":"labour-day","2025-05-02":"labour-day","2025-05-03":"labour-day","2025-05-04":"labour-day","2025-05-05":"labour-day","2025-05-31":"dragon-boat","2025-06-01":"dragon-boat","2025-06-02":"dragon-boat","2025-10-01":"mid-autumn","2025-10-02":"mid-autumn","2025-10-03":"mid-autumn","2025-10-04":"mid-autumn","2025-10-05":"mid-autumn","2025-10-06":"mid-autumn","2025-10-07":"mid-autumn","2025-10-08":"mid-autumn","2026-01-01":"new-year","2026-01-02":"new-year","2026-01-03":"new-year","2026-02-15":"spring-festival","2026-02-16":"spring-festival","2026-02-17":"spring-festival","2026-02-18":"spring-festival","2026-02-19":"spring-festival","2026-02-20":"spring-festival","2026-02-21":"spring-festival","2026-02-22":"spring-festival","2026-02-23":"spring-festival","2026-04-04":"qingming","2026-04-05":"qingming","2026-04-06":"qingming","2026-05-01":"labour-day","2026-05-02":"labour-day","2026-05-03":"labour-day","2026-05-04":"labour-day","2026-05-05":"labour-day","2026-06-19":"dragon-boat","2026-06-20":"dragon-boat","2026-06-21":"dragon-boat","2026-09-25":"mid-autumn","2026-09-26":"mid-autumn","2026-09-27":"mid-autumn","2026-10-01":"national-day","2026-10-02":"national-day","2026-10-03":"national-day","2026-10-04":"national-day","2026-10-05":"national-day","2026-10-06":"national-day","2026-10-07":"national-day"}},o={openai:{v:"-0.04 -0.145 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></g>',c:0},anthropic:{v:"-0.04 -0.285 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></g>',c:0},gemini:{v:"0.94 1.01 22.05 22.05",m:'<path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs>',c:1},vertexai:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z"></path></g>',c:0},xai:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></g>',c:0},mistral:{v:"-0.04 -0.075 24.08 24.08",m:'<path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path>',c:1},deepseek:{v:"-0.04 -0.215 24.08 24.08",m:'<path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path>',c:1,o:1.15},moonshot:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></g>',c:0},kimi:{v:"-0.0667 -0.0667 40.1333 40.1333",m:'<rect width="40" height="40" rx="10" fill="#121316"/><path d="M31.6957 7.11414C32.8305 7.11414 33.7505 8.0341 33.7505 9.16893V9.16893C33.7505 10.3038 32.8305 11.2237 31.6957 11.2237L29.8826 11.2237C29.7491 11.2237 29.6409 11.1155 29.6409 10.982L29.6409 9.16893C29.6409 8.0341 30.5609 7.11414 31.6957 7.11414V7.11414Z" fill="#1783FF"/><path d="M20.1757 19.0798L27.9302 11.3864C28.0761 11.2413 27.9939 10.9498 27.8056 10.9498H23.633C23.5877 10.9498 23.5438 10.9683 23.5084 11.0038L15.1533 19.2911C15.023 19.4192 14.8304 19.305 14.8304 19.0998V11.1951C14.8304 11.0593 14.7411 10.9498 14.6321 10.9498H11.7569C11.6478 10.9498 11.5586 11.0593 11.5586 11.1951V28.2387C11.5586 28.3745 11.6478 28.484 11.7569 28.484H14.6321C14.7411 28.484 14.8304 28.3745 14.8304 28.2387V24.7661C14.8304 24.6921 14.8573 24.6211 14.904 24.5748L17.4945 22.0047C17.5568 21.943 17.6432 21.9337 17.7126 21.98L24.6414 27.0786C25.7759 27.8423 27.0436 28.3112 28.331 28.4501C28.4458 28.4624 28.5449 28.3483 28.5449 28.2048V24.9343C28.5449 24.8093 28.4698 24.7075 28.3693 24.6921C27.6115 24.5733 26.8722 24.2802 26.2037 23.8297L20.2054 19.487C20.0808 19.4037 20.0652 19.1893 20.1757 19.0798Z" fill="#FFFFFF"/>',c:1},minimax:{v:"-0.04 -0.04 24.08 24.08",m:'<defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path>',c:1},zhipu:{v:"-0.04 -0.04 24.08 24.08",m:'<path d="M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z" fill="#3859FF" fill-rule="nonzero"></path>',c:1,o:1.2},xiaomi:{v:"-0.8533 -0.8533 513.7067 513.7067",m:'<path fill="#FF6900" d="M458.634 53.496C410.33 5.378 340.875 0 256 0c-84.982 0-154.542 5.44-202.826 53.688C4.897 101.916 0 171.364 0 256.249c0 84.899 4.897 154.368 53.194 202.613C101.475 507.117 171.027 512 256 512c84.974 0 154.514-4.884 202.795-53.139 48.294-48.254 53.205-117.714 53.205-202.613 0-84.72-4.964-154.243-53.366-202.479z"/><path fill="#FFF" d="M404.554 158.605c1.759 0 3.223 1.417 3.223 3.161v189.386c0 1.715-1.464 3.139-3.223 3.139H363.058c-1.781 0-3.228-1.424-3.228-3.139V161.766c0-1.743 1.446-3.161 3.228-3.161h41.496zM224.476 158.605c31.303 0 64.033 1.435 80.176 17.589 15.871 15.897 17.59 47.549 17.656 78.286v96.671c0 1.715-1.446 3.139-3.219 3.139h-41.49c-1.777 0-3.229-1.424-3.229-3.139V252.817c-.044-17.167-1.031-34.81-9.884-43.692-7.62-7.641-21.839-9.391-36.625-9.754h-75.21c-1.764 0-3.208 1.419-3.208 3.136v148.645c0 1.715-1.462 3.139-3.237 3.139H107.9c-1.774 0-3.201-1.424-3.201-3.139V161.766c0-1.743 1.426-3.161 3.201-3.161h116.576zm9.287 75.427c1.766 0 3.201 1.413 3.201 3.143v113.977c0 1.715-1.436 3.139-3.201 3.139h-43.584c-1.792 0-3.228-1.424-3.228-3.139V237.175c0-1.73 1.436-3.143 3.228-3.143h43.584z"/>',c:1},nvidia:{v:"1.99 0.975 22.05 22.05",m:'<path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path>',c:1},huggingface:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"></path></g>',c:0},qwen:{v:"0.94 0.94 22.12 22.12",m:'<path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs>',c:1},openrouter:{v:"-0.04 0.275 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path></g>',c:0},vercel:{v:"-0.04 -1.65 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0l12 20.785H0L12 0z"></path></g>',c:0},cloudflare:{v:"-0.04 0.45 24.08 24.08",m:'<path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path>',c:1},bedrock:{v:"1.465 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"></path></g>',c:0},azure:{v:"0.38 0.135 23.66 23.66",m:'<g fill-rule="evenodd"><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill-opacity=".75"></path><path d="M8.295.857c-.477 0-.9.304-1.053.756L.495 21.605a1.11 1.11 0 001.052 1.466h5.43c.477 0 .9-.304 1.053-.755l1.341-3.975-2.318-2.163a.51.51 0 01.347-.882h3L15.271.857H8.295z" fill-opacity=".5"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z"></path></g>',c:0},together:{v:"-0.04 0.625 24.15 24.15",m:'<g fill-rule="evenodd"><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z"></path></g>',c:0},fireworks:{v:"-0.04 -1.02 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z"></path></g>',c:0},baseten:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></g>',c:0},cerebras:{v:"0.87 1.29 21.42 21.42",m:'<path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path>',c:1},groq:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></g>',c:0},github:{v:"-0.04 -0.53 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0c6.63 0 12 5.276 12 11.79-.001 5.067-3.29 9.567-8.175 11.187-.6.118-.825-.25-.825-.56 0-.398.015-1.665.015-3.242 0-1.105-.375-1.813-.81-2.181 2.67-.295 5.475-1.297 5.475-5.822 0-1.297-.465-2.344-1.23-3.169.12-.295.54-1.503-.12-3.125 0 0-1.005-.324-3.3 1.209a11.32 11.32 0 00-3-.398c-1.02 0-2.04.133-3 .398-2.295-1.518-3.3-1.209-3.3-1.209-.66 1.622-.24 2.83-.12 3.125-.765.825-1.23 1.887-1.23 3.169 0 4.51 2.79 5.527 5.46 5.822-.345.294-.66.81-.765 1.577-.69.31-2.415.81-3.495-.973-.225-.354-.9-1.223-1.845-1.209-1.005.015-.405.56.015.781.51.28 1.095 1.327 1.23 1.666.24.663 1.02 1.93 4.035 1.385 0 .988.015 1.916.015 2.196 0 .31-.225.664-.825.56C3.303 21.374-.003 16.867 0 11.791 0 5.276 5.37 0 12 0z"></path></g>',c:0},opencode:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></g>',c:0},commandcode:{v:"-11.5383 -11.5383 23.0767 23.0767",m:'<g fill="none" stroke="#000" stroke-width="1.85"><path d="M-7.6 -4.6H7.6M-7.6 4.6H7.6M-4.6 -7.6V7.6M4.6 -7.6V7.6"/><circle cx="-7.6" cy="-7.6" r="3"/><circle cx="7.6" cy="-7.6" r="3"/><circle cx="-7.6" cy="7.6" r="3"/><circle cx="7.6" cy="7.6" r="3"/></g>',c:0,o:.9},cliproxy:{v:"-18.9525 -18.9525 37.905 37.905",m:'<path fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round" d="M 0 -18 Q -5.8 -5.8 -18 0 Q -5.8 5.8 0 18 Q 5.8 5.8 18 0 Q 5.8 -5.8 0 -18 Z"/><g transform="scale(-0.835, 0.835) translate(-12, -12)"><path fill="currentColor" d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"/></g>',c:0},workbuddy:{v:"-0.0667 -0.0667 40.1333 40.1333",m:'<g clip-path="url(#clip0_542_3370)"> <rect width="40" height="40" rx="20" fill="url(#paint0_linear_542_3370)"/> <g filter="url(#filter0_f_542_3370)"> <circle cx="31.3411" cy="43.6183" r="12.8704" fill="#FFE355" fill-opacity="0.49" style="fill:#FFE355;fill:color(display-p3 1.0000 0.8891 0.3348);fill-opacity:0.49;"/> </g> <path d="M28.5931 3.12762C28.9853 2.77585 29.0091 2.76226 29.2968 2.74499C29.7628 2.71096 30.1894 2.93488 30.916 3.59634C32.6132 5.13875 34.9769 8.30904 36.4462 11.0168L37.0138 12.0682L37.8156 12.4668C38.5896 12.8579 39.8593 13.6593 40.3898 14.0895C40.6297 14.2878 40.6638 14.2925 40.9133 14.1954C42.0388 13.7572 43.6506 14.3382 45.0727 15.7024C46.3529 16.9294 47.5794 19.026 48.0491 20.7757C48.1177 21.0574 48.2087 21.6628 48.2419 22.1134C48.349 23.6964 47.8414 24.9608 46.8637 25.5331C46.664 25.6484 46.6505 25.6795 46.6561 26.1774C46.7011 28.5481 46.0621 30.9144 44.7785 33.2221C43.3293 35.8133 40.7489 38.4945 37.2566 41.0199C35.3813 42.3846 30.9445 44.9701 28.9382 45.8778C24.1324 48.0414 20.2794 48.8709 16.9329 48.4609C14.9368 48.219 12.6769 47.44 11.34 46.5355C10.9885 46.2925 10.9325 46.2774 10.6637 46.3543C9.2327 46.7651 7.35867 45.9207 5.76659 44.1535C5.13165 43.4471 4.1065 41.7127 3.77404 40.7843C3.0054 38.6118 3.15852 36.6506 4.18236 35.4799C4.44671 35.1785 4.45511 35.1658 4.39735 34.6589C4.30195 33.8289 4.25837 32.6008 4.30192 31.808L4.33666 31.0674L3.22502 29.101C1.5033 26.0375 0.409325 23.4645 -0.012563 21.4992C-0.235219 20.4218 -0.221193 19.9436 0.0522186 19.5899C0.21871 19.3763 0.764928 19.1545 1.42322 19.0329C3.08041 18.742 6.69466 19.0056 10.7155 19.7155L11.1329 19.788L12.0511 18.976C13.5747 17.6264 14.587 16.8696 16.4531 15.706C18.3981 14.4891 20.5929 13.4877 23.0648 12.695L23.8577 12.4414L24.2939 11.2964C25.8547 7.17615 27.4533 4.13844 28.5931 3.12762ZM15.5182 24.243C13.7542 25.2615 12.8718 25.7706 12.2236 26.3413C9.59893 28.6526 8.61811 32.3134 9.73545 35.6274C10.0114 36.4457 10.5201 37.3283 11.5386 39.0923C12.5571 40.8564 13.0671 41.7383 13.6378 42.3864C15.9491 45.0112 19.6103 45.9929 22.9243 44.8755C23.7426 44.5995 24.6249 44.0899 26.3888 43.0714L36.5375 37.2121C38.3016 36.1936 39.184 35.6845 39.8321 35.1137C42.4568 32.8024 43.4373 29.1409 42.3198 25.8269C42.0438 25.0086 41.5342 24.1264 40.5158 22.3624C39.4973 20.5983 38.9882 19.7159 38.4175 19.0678C36.1062 16.4432 32.4454 15.4622 29.1314 16.5796C28.3131 16.8556 27.431 17.3651 25.6669 18.3836L15.5182 24.243Z" fill="url(#paint1_linear_542_3370)"/> <rect x="16.4961" y="31.3344" width="4.00904" height="8.32646" rx="2.00452" transform="rotate(-30 16.4961 31.3344)" fill="white" style="fill:white;fill-opacity:1;"/> <rect x="27.3125" y="25.0894" width="4.00904" height="8.32646" rx="2.00452" transform="rotate(-30 27.3125 25.0894)" fill="white" style="fill:white;fill-opacity:1;"/> </g> <defs> <filter id="filter0_f_542_3370" x="7.47033" y="19.7475" width="47.742" height="47.7416" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="5.50019" result="effect1_foregroundBlur_542_3370"/> </filter> <linearGradient id="paint0_linear_542_3370" x1="20" y1="0" x2="20" y2="40" gradientUnits="userSpaceOnUse"> <stop stop-color="#0EC8A9" style="stop-color:#0EC8A9;stop-color:color(display-p3 0.0565 0.7837 0.6625);stop-opacity:1;"/> <stop offset="1" stop-color="#01C886" style="stop-color:#01C886;stop-color:color(display-p3 0.0021 0.7858 0.5246);stop-opacity:1;"/> </linearGradient> <linearGradient id="paint1_linear_542_3370" x1="14.6642" y1="11.0783" x2="33.3762" y2="43.4885" gradientUnits="userSpaceOnUse"> <stop stop-color="white" stop-opacity="0.8" style="stop-color:white;stop-opacity:0.8;"/> <stop offset="0.437689" stop-color="white" style="stop-color:white;stop-opacity:1;"/> </linearGradient> <clipPath id="clip0_542_3370"> <rect width="40" height="40" rx="20" fill="white" style="fill:white;fill-opacity:1;"/> </clipPath> </defs>',c:1},ollama:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></g>',c:0},vllm:{v:"-0.355 -0.04 23.1 23.1",m:'<g fill-rule="evenodd"><path d="M0 4.973h9.324V23L0 4.973z"></path><path d="M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z"></path></g>',c:0},lmstudio:{v:"-0.04 -0.32 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></g>',c:0},perplexity:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"></path></g>',c:0},cohere:{v:"0.94 0.905 22.12 22.12",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"></path></g>',c:0},ai21:{v:"-0.04 0.45 23.1 23.1",m:'<g fill-rule="evenodd"><path d="M6.47 17l-.367-1.189H2.718L2.35 17H0l3.398-9.789h2.026L8.864 17H6.47zm-2.052-6.993l-1.17 4.028H5.56l-1.142-4.028zm4.707-2.796h2.23V17h-2.23V7.211zM11.955 15c.1-.483.277-.946.524-1.37.214-.359.482-.68.795-.951.32-.273.658-.52 1.013-.741.28-.168.54-.33.781-.483.222-.14.433-.296.632-.468.172-.148.317-.325.428-.525.107-.199.16-.423.157-.65 0-.392-.104-.674-.313-.846a1.176 1.176 0 00-.775-.259 1.207 1.207 0 00-.863.329c-.231.219-.347.585-.347 1.098H11.8a3.387 3.387 0 01.224-1.245c.146-.377.371-.716.66-.993.306-.29.667-.514 1.06-.657A4.04 4.04 0 0115.183 7c.42-.002.84.057 1.244.175.376.107.73.287 1.04.531.305.246.55.562.714.923.185.419.275.875.265 1.335.005.39-.084.774-.259 1.12-.167.328-.38.63-.632.894-.246.259-.517.49-.808.693-.29.2-.554.37-.789.51-.326.224-.596.417-.809.58a3.872 3.872 0 00-.51.455 1.229 1.229 0 00-.265.434 1.633 1.633 0 00-.074.517h4.078V17h-6.606a9.24 9.24 0 01.183-2zM18.8 8.93a5.05 5.05 0 001.135-.105c.25-.049.484-.156.686-.314.163-.139.28-.324.34-.532.068-.25.1-.51.095-.77H23V17h-2.243v-6.475H18.8V8.93z"></path></g>',c:0},voyage:{v:"0.45 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"></path></g>',c:0},deepinfra:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M3.294 7.821A2.297 2.297 0 011 5.527a2.297 2.297 0 012.294-2.295A2.297 2.297 0 015.59 5.527 2.297 2.297 0 013.294 7.82zm0-3.688a1.396 1.396 0 000 2.79 1.396 1.396 0 000-2.79zM3.294 14.293A2.297 2.297 0 011 11.998a2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294 2.297 2.297 0 01-2.295 2.295zm0-3.688a1.395 1.395 0 000 2.788 1.395 1.395 0 100-2.788zM3.294 20.761A2.297 2.297 0 011 18.467a2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.295 2.294zm0-3.688a1.396 1.396 0 000 2.79 1.396 1.396 0 000-2.79zM20.738 7.821a2.297 2.297 0 01-2.295-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.294 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM20.738 14.293a2.297 2.297 0 01-2.295-2.295 2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688c-.769 0-1.395.625-1.395 1.393a1.396 1.396 0 002.79 0c0-.77-.626-1.393-1.395-1.393zM20.738 20.761a2.297 2.297 0 01-2.295-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.294 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.016 11.057a2.297 2.297 0 01-2.294-2.294 2.297 2.297 0 012.294-2.295 2.297 2.297 0 012.295 2.295 2.297 2.297 0 01-2.295 2.294zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.625-1.395-1.395-1.395zM12.017 4.589a2.297 2.297 0 01-2.295-2.295A2.297 2.297 0 0112.017 0a2.297 2.297 0 012.294 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.017 17.529a2.297 2.297 0 01-2.295-2.295 2.297 2.297 0 012.295-2.294 2.297 2.297 0 012.294 2.294 2.297 2.297 0 01-2.294 2.295zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.626-1.395-1.395-1.395zM12.016 24a2.297 2.297 0 01-2.294-2.295 2.297 2.297 0 012.294-2.294 2.297 2.297 0 012.295 2.294A2.297 2.297 0 0112.016 24zm0-3.688a1.396 1.396 0 101.395 1.395c0-.77-.625-1.395-1.395-1.395z"></path><path d="M8.363 8.222a.742.742 0 01-.277-.053l-1.494-.596a.75.75 0 11.557-1.392l1.493.595a.75.75 0 01-.278 1.446h-.001zM8.363 14.566a.743.743 0 01-.277-.053l-1.494-.595a.75.75 0 11.557-1.393l1.493.596a.75.75 0 01-.278 1.445h-.001zM17.124 11.397a.741.741 0 01-.277-.054l-1.493-.595a.75.75 0 11.555-1.392l1.493.595a.75.75 0 01-.278 1.446zM17.124 5.05a.744.744 0 01-.277-.054L15.354 4.4a.75.75 0 01.555-1.392l1.493.596a.75.75 0 01-.278 1.445zM17.124 17.739a.743.743 0 01-.277-.053l-1.494-.596a.75.75 0 11.556-1.392l1.493.596a.75.75 0 01-.278 1.445zM6.91 17.966a.75.75 0 01-.279-1.445l1.494-.595a.749.749 0 11.556 1.392l-1.493.595a.743.743 0 01-.277.053H6.91zM6.91 11.66a.75.75 0 01-.279-1.446l1.494-.595a.75.75 0 01.556 1.392l-1.493.595a.743.743 0 01-.277.053H6.91zM6.91 5.033a.75.75 0 01-.279-1.446l1.494-.595a.75.75 0 01.556 1.392l-1.493.596a.744.744 0 01-.277.053H6.91zM8.363 21.364a.743.743 0 01-.277-.053l-1.494-.596a.75.75 0 01.555-1.392l1.494.595a.75.75 0 01-.278 1.446zM15.63 8.223a.75.75 0 01-.278-1.447l1.494-.595a.75.75 0 01.556 1.393l-1.494.595a.744.744 0 01-.276.054h-.002zM15.63 14.567a.75.75 0 01-.278-1.446l1.494-.596a.75.75 0 01.556 1.394l-1.494.595a.743.743 0 01-.276.053h-.002zM15.63 21.363a.749.749 0 01-.278-1.445l1.494-.595a.75.75 0 11.555 1.392l-1.494.595a.741.741 0 01-.277.053z"></path></g>',c:0},sambanova:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M23 23h-1.223V8.028c0-3.118-2.568-5.806-5.744-5.806H8.027c-3.176 0-5.744 2.565-5.744 5.686 0 3.119 2.568 5.684 5.744 5.684h.794c1.346 0 2.445 1.1 2.445 2.444 0 1.346-1.1 2.446-2.445 2.446H1v-1.223h7.761c.671 0 1.223-.551 1.223-1.16 0-.67-.552-1.16-1.223-1.16h-.794C4.177 14.872 1 11.756 1 7.909 1 4.058 4.176 1 8.027 1h8.066C19.88 1 23 4.239 23 8.028V23z"></path><path d="M8.884 12.672c1.71.06 3.361 1.588 3.361 3.422 0 1.833-1.528 3.421-3.421 3.421H1v1.223h7.761c2.568 0 4.705-2.077 4.705-4.644 0-.672-.123-1.283-.43-1.894-.245-.551-.67-1.1-1.099-1.528-.489-.429-1.039-.734-1.65-.977-.525-.175-1.048-.193-1.594-.212-.218-.008-.441-.016-.669-.034-.428 0-1.406-.245-1.956-.61a3.369 3.369 0 01-1.223-1.406c-.183-.489-.305-.977-.305-1.528A3.417 3.417 0 017.96 4.482h8.066c1.895 0 3.422 1.65 3.422 3.483v15.032h1.223V8.027c0-2.568-2.077-4.768-4.645-4.768h-8c-2.568 0-4.705 2.077-4.705 4.646 0 .67.123 1.282.43 1.894a4.45 4.45 0 001.099 1.528c.429.428 1.039.734 1.588.976.306.123.611.183.976.246.857.06 1.406.123 1.466.123h.003z"></path><path d="M1 23h7.761v-.003c3.85 0 7.03-3.116 7.09-7.026 0-3.79-3.117-6.906-6.967-6.906H8.09c-.672 0-1.222-.552-1.222-1.16 0-.608.487-1.16 1.159-1.16h8.069c.608 0 1.159.611 1.159 1.283v14.97h1.223V8.024c0-1.345-1.1-2.505-2.445-2.505H7.967a2.451 2.451 0 00-2.445 2.445 2.45 2.45 0 002.445 2.445h.794c3.176 0 5.744 2.568 5.744 5.684s-2.568 5.684-5.744 5.684H1V23z"></path></g>',c:0},novita:{v:"-0.04 -0.46 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z"></path></g>',c:0},hyperbolic:{v:"-0.04 -0.04 24.08 24.08",m:'<path d="M.193 19.503a2.413 2.413 0 00-.186.925c0 1.317 1.112 2.518 2.95 3.437a1.337 1.337 0 001.838-.738l2.049-4.93c.359-.857.642-1.745.846-2.652-3.795.637-6.656 2.092-7.448 3.872l-.032.076-.017.01zm7.49-11.047a15.981 15.981 0 00-.846-2.653L4.79.873a1.34 1.34 0 00-1.84-.738C1.112 1.054 0 2.256 0 3.573c0 .317.064.631.186.924v.01l.032.077c.81 1.78 3.67 3.234 7.466 3.872zM21.049.136c1.838.918 2.95 2.12 2.95 3.436a2.454 2.454 0 01-.196.925l-.027.063c-.785 1.792-3.653 3.254-7.46 3.896.204-.907.487-1.795.846-2.653L19.21.873a1.337 1.337 0 011.839-.738zm-4.722 15.409c.201.906.48 1.793.837 2.65l2.048 4.932a1.338 1.338 0 001.838.738c1.839-.92 2.951-2.12 2.951-3.437a2.446 2.446 0 00-.186-.925l-.027-.062c-.782-1.792-3.66-3.256-7.46-3.896zm-.129-6.04c2.695-.415 4.935-1.223 6.48-2.278L22.24 8.28a9.755 9.755 0 000 7.437l.435 1.048c-1.547-1.055-3.787-1.855-6.479-2.275l-.07-.01A27.196 27.196 0 0012 14.172c-1.377-.002-2.752.1-4.114.307l-.071.01c-2.693.413-4.933 1.222-6.48 2.277l.437-1.05a9.755 9.755 0 000-7.437l-.437-1.052c1.54 1.06 3.78 1.863 6.473 2.278l.071.01c2.734.407 5.513.407 8.246 0l.071-.01z" fill="#594CE9"></path>',c:1},targon:{v:"0.7604 0.6875 24.0625 24.0625",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M20.297.7H5.289A4.496 4.496 0 00.793 5.195v15.007a4.496 4.496 0 004.496 4.496h15.008a4.496 4.496 0 004.496-4.496V5.196A4.497 4.497 0 0020.297.699zm-.518 5.134a.03.03 0 01.036-.01.03.03 0 01.018.024c.005.04.009.08.01.12.012.61.015 1.221.01 1.832a4.442 4.442 0 01-.547 2.138 4.162 4.162 0 01-2.277 1.882c-.34.12-.691.189-1.053.205-3.392.004-6.784.004-10.177 0-.071-.004-.149-.04-.159-.11a.156.156 0 01-.001-.014c-.03-1.067.317-1.988 1.042-2.764a3.855 3.855 0 012.43-1.208c2.016-.016 4.033-.025 6.05-.026.484-.025.963-.09 1.437-.195a5.856 5.856 0 001.737-.632c.208-.11.409-.233.6-.368.205-.156.394-.33.566-.524.094-.116.186-.233.278-.35zm.023 6.28c-.006-.042-.056-.05-.08-.016a4.68 4.68 0 01-.199.252 4.758 4.758 0 01-1.098.887 7.493 7.493 0 01-3.343.89l-5.907.05a2.735 2.735 0 00-.687.078 3.83 3.83 0 00-.76.293 4.08 4.08 0 00-1.536 1.398 4.007 4.007 0 00-.605 2.117c.002.037.01.074.021.11.022.048.06.074.113.076 3.417.004 6.834.004 10.25 0a7.12 7.12 0 00.327-.031 4.264 4.264 0 001.627-.627 4.071 4.071 0 001.761-2.498c.094-.425.137-.855.132-1.29 0-.563-.005-1.127-.016-1.69z"></path></g>',c:0},parasail:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M0 15.852c4.5 0 8.147 3.648 8.147 8.148H0v-8.148z"></path><path clip-rule="evenodd" d="M0 7.688v.018C9 7.706 16.294 15 16.294 24h.019l-.018-.036c3.33-.2 8.864-2.447 7.49-9.58A19.95 19.95 0 009.61.213C2.482-1.155.235 4.374.036 7.704L0 7.688z"></path></g>',c:0},lambda:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M2 2h20v20H2V2zm1.768 18.237h16.459V3.761H3.768v16.476zm3.515-14.91l3.479 6.176-3.871 7.154h2.493l2.58-4.883 2.747 4.883h2.54L9.82 5.324l-2.538.002z"></path></g>',c:0},fal:{v:"-0.04 -0.04 24.08 24.08",m:'<path clip-rule="evenodd" d="M15.477 0c.415 0 .749.338.788.752a7.775 7.775 0 006.985 6.984c.413.04.752.373.752.788v6.952c0 .415-.338.748-.752.788a7.775 7.775 0 00-6.985 6.984c-.04.414-.373.752-.788.752H8.525c-.416 0-.749-.338-.789-.752a7.775 7.775 0 00-6.984-6.984c-.414-.04-.752-.373-.752-.788V8.524c0-.415.338-.748.752-.788A7.775 7.775 0 007.736.752C7.776.338 8.11 0 8.526 0h6.95zM4.819 11.98a7.226 7.226 0 007.223 7.23 7.226 7.226 0 007.223-7.23c0-3.994-3.234-7.23-7.223-7.23a7.227 7.227 0 00-7.223 7.23z" fill="#EC0648" fill-rule="evenodd"></path>',c:1},replicate:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M22 10.552v2.26h-7.932V22H11.54V10.552H22zM22 2v2.264H4.528V22H2V2h20zm0 4.276V8.54H9.296V22H6.768V6.276H22z"></path></g>',c:0},midjourney:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M22.369 17.676c-1.387 1.259-3.17 2.378-5.332 3.417.044.03.086.057.13.083l.018.01.019.012c.216.123.42.184.641.184.222 0 .426-.061.642-.184l.018-.011.019-.011c.14-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.304-.174.612-.266.949-.266.337 0 .645.092.949.266l.023.014c.188.109.334.219.602.442l.178.148c.221.184.346.278.483.36l.028.017.018.01c.21.12.407.181.62.185h.022a.31.31 0 110 .618c-.337 0-.645-.092-.95-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.02-.014a5.356 5.356 0 01-.49-.377l-.159-.132a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.641.184l-.02.011-.018.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.95.266c-.337 0-.644-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.026-.017a4.881 4.881 0 01-.425-.325.308.308 0 01-.12-.1l-.098-.081a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.642.184l-.018.011-.019.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.023.014-.022.014-.09.054A1.868 1.868 0 0112 22c-.337 0-.645-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.021-.014a5.356 5.356 0 01-.49-.377l-.158-.132a3.836 3.836 0 00-.483-.36l-.028-.017-.018-.01a1.256 1.256 0 00-.642-.185c-.221 0-.425.061-.641.184l-.019.011-.018.011c-.141.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.511.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.986.264c-.746-.09-1.319-.38-1.89-.866l-.035-.03c-.047-.041-.118-.106-.192-.174l-.196-.181-.107-.1-.011-.01a1.531 1.531 0 00-.336-.253.313.313 0 00-.095-.03h-.005c-.119.022-.238.059-.361.11a.308.308 0 01-.077.061l-.008.005a.309.309 0 01-.126.034 5.66 5.66 0 00-.774.518l-.416.324-.055.043a6.542 6.542 0 01-.324.236c-.305.207-.552.315-.8.315a.31.31 0 01-.01-.618h.01c.09 0 .235-.062.438-.198l.04-.027c.077-.054.163-.117.27-.199l.385-.301.06-.047c.268-.206.506-.373.73-.505l-.633-1.21a.309.309 0 01.254-.451l20.287-1.305a.309.309 0 01.228.537zm-1.118.14L2.369 19.03l.423.809c.128-.045.256-.078.388-.1a.31.31 0 01.052-.005c.132 0 .26.032.386.093.153.073.294.179.483.35l.016.015.092.086.144.134.097.089c.065.06.125.114.16.144.485.418.948.658 1.554.736h.011a1.25 1.25 0 00.6-.172l.021-.011.019-.011.018-.011c.141-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.305-.174.612-.266.95-.266.336 0 .644.092.948.266l.023.014c.188.109.335.219.603.442l.177.148c.222.184.346.278.484.36l.027.017.019.01c.215.124.42.185.641.185.222 0 .426-.061.641-.184l.019-.011.018-.011c.141-.084.267-.178.493-.366l.177-.148c.28-.232.427-.342.626-.456.304-.174.612-.266.949-.266.337 0 .644.092.949.266l.025.015c.187.109.334.22.603.443 1.867-.878 3.448-1.811 4.73-2.832l.02-.016zM3.653 2.026C6.073 3.06 8.69 4.941 10.8 7.258c2.46 2.7 4.109 5.828 4.637 9.149a.31.31 0 01-.421.335c-2.348-.945-4.54-1.258-6.59-1.02-1.739.2-3.337.792-4.816 1.703-.294.182-.62-.182-.405-.454 1.856-2.355 2.581-4.99 2.343-7.794-.195-2.292-1.031-4.61-2.284-6.709a.31.31 0 01.388-.442zM10.04 4.45c1.778.543 3.892 2.102 5.782 4.243 1.984 2.248 3.552 4.934 4.347 7.582a.31.31 0 01-.401.38l-.022-.01-.386-.154a10.594 10.594 0 00-.291-.112l-.016-.006c-.68-.247-1.199-.291-1.944-.101a.31.31 0 01-.375-.218C15.378 11.123 13.073 7.276 9.775 5c-.291-.201-.072-.653.266-.55zM4.273 2.996l.008.015c1.028 1.94 1.708 4.031 1.885 6.113.213 2.513-.31 4.906-1.673 7.092l-.02.031.003-.001c1.198-.581 2.47-.969 3.825-1.132l.055-.006c1.981-.23 4.083.029 6.309.837l.066.025-.007-.039c-.593-2.95-2.108-5.737-4.31-8.179l-.07-.078c-1.785-1.96-3.944-3.6-6.014-4.65l-.057-.028zm7.92 3.238l.048.048c2.237 2.295 3.885 5.431 4.974 9.191l.038.132.022-.004c.71-.133 1.284-.063 1.963.18l.027.01.066.024.046.018-.025-.073c-.811-2.307-2.208-4.62-3.936-6.594l-.058-.065c-1.02-1.155-2.103-2.132-3.15-2.856l-.015-.011z"></path></g>',c:0},stability:{v:"0.94 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M7.223 21c4.252 0 7.018-2.22 7.018-5.56 0-2.59-1.682-4.236-4.69-4.918l-1.93-.571c-1.694-.375-2.683-.825-2.45-1.975.194-.957.773-1.497 2.122-1.497 4.285 0 5.873 1.497 5.873 1.497v-3.6S11.62 3 7.293 3C3.213 3 1 5.07 1 8.273c0 2.59 1.534 4.097 4.645 4.812l.334.083c.473.144 1.112.335 1.916.572 1.59.375 1.999.773 1.999 1.966 0 1.09-1.15 1.71-2.67 1.71C2.841 17.416 1 15.231 1 15.231v3.989S2.152 21 7.223 21z"></path><path d="M20.374 20.73c1.505 0 2.626-1.073 2.626-2.526 0-1.484-1.089-2.526-2.626-2.526-1.505 0-2.594 1.042-2.594 2.526 0 1.484 1.089 2.526 2.594 2.526z"></path></g>',c:0},suno:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M16.5 0C20.642 0 24 5.373 24 12h-9c0 6.627-3.358 12-7.5 12C3.358 24 0 18.627 0 12h9c0-6.627 3.358-12 7.5-12z"></path></g>',c:0},elevenlabs:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5 0h5v24H5V0zM14 0h5v24h-5V0z"></path></g>',c:0},fishaudio:{v:"-0.04 0.45 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M23.556 12.189c.244 0 .444.126.444.28v.951c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-.952c0-.153.2-.279.444-.279zm-1.764.372c.244 0 .444.126.444.28v2.095c0 .153-.2.279-.444.279-.245 0-.444-.126-.444-.28V12.84c0-.153.2-.28.444-.28zm-1.765.434c.244 0 .444.125.444.279v2.355c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-2.355c0-.154.2-.28.444-.28zm-1.764.359c.244 0 .444.125.444.279v2.33c0 .153-.2.279-.444.279s-.444-.126-.444-.28v-2.33c0-.153.2-.278.444-.278zm-1.765.316c.245 0 .444.126.444.28v2.017c0 .154-.2.28-.444.28s-.444-.126-.444-.28V13.95c0-.154.2-.28.444-.28zm-1.755 1.287c.244 0 .444.125.444.28v.64c0 .153-.2.278-.444.278s-.444-.125-.444-.279v-.64c0-.154.2-.28.444-.28z" opacity=".35"></path><path d="M23.556 9.63c.244 0 .444.125.444.279v1.575c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.909c0-.154.2-.28.444-.28zm-1.764-1.058c.244 0 .444.125.444.28v2.81c0 .153-.2.278-.444.278-.245 0-.444-.125-.444-.279v-2.81c0-.154.2-.28.444-.28zm-1.765-.398c.244 0 .444.126.444.28v3.667c0 .153-.2.28-.444.28s-.444-.127-.444-.28V8.453c0-.153.2-.28.444-.28zM18.263 8c.244 0 .444.126.444.28v4.29c0 .154-.2.28-.444.28s-.444-.126-.444-.28V8.28c0-.154.2-.28.444-.28zm-1.765.109c.245 0 .444.126.444.28v4.355c0 .154-.2.28-.444.28s-.444-.126-.444-.28V8.388c0-.153.2-.28.444-.28zm-1.755.273c.244 0 .444.125.444.28v5.434c0 .153-.2.28-.444.28s-.444-.126-.444-.28V8.66c0-.154.2-.28.444-.28zm-1.801.463c.244 0 .444.125.444.279v6.162c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.124c0-.154.2-.28.444-.28zm-1.764.784c.244 0 .444.126.444.28v5.928c0 .154-.2.28-.444.28-.245 0-.444-.126-.444-.28V9.909c0-.154.2-.28.444-.28zm-1.765 1.022c.245 0 .444.126.444.28v5.161c0 .154-.2.28-.444.28s-.444-.126-.444-.28V10.93c0-.154.2-.28.444-.28zm-1.764.706c.244 0 .444.126.444.28v5.084c0 .153-.2.279-.444.279s-.444-.126-.444-.28v-5.083c0-.154.2-.28.444-.28zm-1.756.585c.245 0 .444.126.444.28v2.705c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-2.706c0-.153.2-.279.444-.279zM4.076 9.304c.244 0 .444.126.444.28v3.771c0 .154-.2.28-.444.28s-.444-.126-.444-.28V9.584c0-.154.2-.28.444-.28zm-1.814.247c.244 0 .443.126.443.28v1.16c0 .153-.2.279-.443.279-.245 0-.444-.126-.444-.28V9.83c0-.153.2-.279.444-.279zM.444 9.395c.244 0 .444.126.444.28v.523c0 .153-.2.279-.444.279S0 10.351 0 10.197v-.522c0-.154.2-.28.444-.28zm5.45-.442c.244 0 .443.126.443.28v.392c0 .154-.2.28-.444.28s-.444-.126-.444-.28v-.393c0-.154.2-.28.444-.28z"></path></g>',c:0},assemblyai:{v:"-0.04 -0.145 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M10.595 1.5a3.695 3.695 0 00-3.444 2.355L0 22.26h5.432l5.629-14.486h.002a.96.96 0 011.782 0h.75V4.835h-1.393L13.498 1.5h-2.902z"></path><path d="M7.151 3.855a3.695 3.695 0 013.26-2.35l-.002-.005H13.405c1.524 0 2.893.936 3.444 2.355L24 22.26h-5.525L11.54 4.413a2.528 2.528 0 00-4.609.006l.22-.564z"></path></g>',c:0},siliconcloud:{v:"-0.04 0.205 24.08 24.08",m:'<path clip-rule="evenodd" d="M22.956 6.521H12.522c-.577 0-1.044.468-1.044 1.044v3.13c0 .577-.466 1.044-1.043 1.044H1.044c-.577 0-1.044.467-1.044 1.044v4.174C0 17.533.467 18 1.044 18h10.434c.577 0 1.044-.467 1.044-1.043v-3.13c0-.578.466-1.044 1.043-1.044h9.391c.577 0 1.044-.467 1.044-1.044V7.565c0-.576-.467-1.044-1.044-1.044z" fill="#6E29F6" fill-rule="evenodd"></path>',c:1},volcengine:{v:"0.87 -0.04 22.05 22.05",m:'<g fill-rule="evenodd"><path d="M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z" fill-opacity=".5"></path><path clip-rule="evenodd" d="M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z"></path><path d="M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z" fill-opacity=".5"></path><path clip-rule="evenodd" d="M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z"></path><path d="M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z"></path></g>',c:0},doubao:{v:"0.135 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M5.31 15.756c.172-3.75 1.883-5.999 2.549-6.739-3.26 2.058-5.425 5.658-6.358 8.308v1.12C1.501 21.513 4.226 24 7.59 24a6.59 6.59 0 002.2-.375c.353-.12.7-.248 1.039-.378.913-.899 1.65-1.91 2.243-2.992-4.877 2.431-7.974.072-7.763-4.5l.002.001z" fill-opacity=".5"></path><path d="M22.57 10.283c-1.212-.901-4.109-2.404-7.397-2.8.295 3.792.093 8.766-2.1 12.773a12.782 12.782 0 01-2.244 2.992c3.764-1.448 6.746-3.457 8.596-5.219 2.82-2.683 3.353-5.178 3.361-6.66a2.737 2.737 0 00-.216-1.084v-.002zM14.303 1.867C12.955.7 11.248 0 9.39 0 7.532 0 5.883.677 4.545 1.807 2.791 3.29 1.627 5.557 1.5 8.125v9.201c.932-2.65 3.097-6.25 6.357-8.307.5-.318 1.025-.595 1.569-.829 1.883-.801 3.878-.932 5.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z"></path><path d="M17.305 4.961a199.47 199.47 0 01-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648 2.786.869 5.617 3.288.395 6.185 1.898 7.396 2.8-1.306-1.275-3.475-3.487-5.266-5.323z" fill-opacity=".5"></path></g>',c:0},hunyuan:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"></path></g>',c:0},yuanbao:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12.014.648c-6.628 0-12 5.09-12 11.367 0 6.277 5.372 11.366 12 11.366s12-5.09 12-11.366c0-6.277-5.372-11.367-12-11.367zm5.849 15.481c-4.305 3.1-10.584 2.523-13.481-1.444-2.86-3.918-1.351-9.703 2.685-13.02-1.866 1.676-2.67 5.01-1.282 6.909 1.471 2.015 4.794 1.746 6.958.113 2.435-1.84 6.036-1.794 7.234.954.91 2.208.067 4.93-2.114 6.487v.001z"></path><path d="M14.81 14.914a.669.669 0 01-.536-.269l-1.02-1.37a.67.67 0 01.005-.807l1.021-1.328a.669.669 0 011.06.814l-.713.926.72.964a.67.67 0 01-.534 1.067l-.002.003zM10.877 12.913c0 1.797-.357 2.135-1.162 2.135-.805 0-1.162-.338-1.162-2.135 0-1.798.357-2.136 1.162-2.136.805 0 1.162.338 1.162 2.136z"></path></g>',c:0},stepfun:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"></path></g>',c:0},sensenova:{v:"0.975 0.94 22.12 22.12",m:'<g fill-rule="evenodd"><path d="M23 8.333h-7.333v7.334H23V8.333z"></path><path d="M1 1v14.667h7.333V8.333h7.334V1H1z" fill-opacity=".33"></path><path d="M14.038 4.333h.17l1.459 1.456v.17l-1.63-1.626zM13.224 4.333h.17l2.273 2.268v.17l-2.443-2.438zM12.41 4.333h.17l3.087 3.08v.17l-3.257-3.25zM11.596 4.333h.17l3.9 3.892v.108h-.06l-4.01-4zM10.782 4.333h.17l4.01 4h-.17l-4.01-4zM9.968 4.333h.17l4.009 4h-.17l-4.01-4zM9.154 4.333h.17l4.009 4h-.17l-4.01-4zM8.34 4.333h.17l4.01 4h-.17l-4.01-4zM7.521 4.333h.17l4.01 4h-.17l-4.01-4zM6.707 4.333h.17l4.01 4h-.17l-4.01-4zM5.892 4.333h.17l4.009 4h-.17l-4.01-4zM5.077 4.333h.17l4.01 4h-.17l-4.01-4zM4.333 4.403v-.07h.1l4.01 4h-.11v.06l-4-3.99zM4.333 5.215v-.17l4 3.991v.17l-4-3.99zM4.333 6.027v-.17l4 3.991v.17l-4-3.99zM4.333 6.84v-.17l4 3.99v.17l-4-3.99zM4.333 7.652v-.17l4 3.99v.17l-4-3.99zM4.333 8.464v-.17l4 3.99v.17l-4-3.99zM4.333 9.276v-.17l4 3.991v.17l-4-3.991zM4.333 10.088v-.17l4 3.991v.17l-4-3.991zM4.333 10.9v-.17l4 3.991v.17l-4-3.991zM4.333 11.712v-.17l4 3.991v.134h-.036l-3.964-3.955zM4.333 12.526v-.17l3.318 3.31h-.17l-3.148-3.14zM4.333 13.34v-.169l2.502 2.496h-.17L4.333 13.34zM4.333 14.152v-.169l1.688 1.684h-.17l-1.518-1.514zM4.333 14.965v-.17l.874.872h-.17l-.704-.702zM15.667 5.146l-.815-.813h.17l.645.644v.169z"></path><path d="M23 15.667h-7.333V23H23v-7.333z" fill-opacity=".33"></path><path d="M15.667 15.667H8.333V23h7.334v-7.333z"></path></g>',c:0},baichuan:{v:"-0.04 0.975 22.05 22.05",m:'<g fill-rule="evenodd"><path d="M7.333 2h-3.2l-2 4.333V17.8L0 22h5.2l2.028-4.2L7.333 2zm7.334 0h-5.2v20h5.2V2zM16.8 7.733H22V22h-5.2V7.733zM22 2h-5.2v4.133H22V2z"></path></g>',c:0},yi:{v:"1.99 1.99 20.02 20.02",m:'<g fill-rule="evenodd"><path d="M18.62 13.927c.611 0 1.107.505 1.107 1.128v5.817c0 .623-.496 1.128-1.108 1.128a1.118 1.118 0 01-1.108-1.128v-5.817c0-.623.496-1.128 1.108-1.128zM16.59 3.052a1.094 1.094 0 011.562-.129c.466.404.522 1.116.126 1.59l-5.938 7.111v9.147c0 .624-.496 1.129-1.108 1.129a1.118 1.118 0 01-1.108-1.129v-9.477l.003-.088.01-.087c.015-.232.102-.462.261-.654l6.192-7.413zM2.906 2.256a1.094 1.094 0 011.559.157l4.387 5.45a1.142 1.142 0 01-.155 1.587 1.094 1.094 0 01-1.559-.157l-4.387-5.45a1.144 1.144 0 01.06-1.498l.095-.09z"></path><ellipse cx="20.146" cy="10.692" rx="1.354" ry="1.379"></ellipse></g>',c:0},codex:{v:"-0.04 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path clip-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"></path></g>',c:0},grok:{v:"0.03 0.065 23.94 23.94",m:'<g fill-rule="evenodd"><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></g>',c:0},cline:{v:"-0.005 -0.04 24.08 24.08",m:'<g fill-rule="evenodd"><path d="M17.035 3.991c2.75 0 4.98 2.24 4.98 5.003v1.667l1.45 2.896a1.01 1.01 0 01-.002.909l-1.448 2.864v1.668c0 2.762-2.23 5.002-4.98 5.002H7.074c-2.751 0-4.98-2.24-4.98-5.002V17.33l-1.48-2.855a1.01 1.01 0 01-.003-.927l1.482-2.887V8.994c0-2.763 2.23-5.003 4.98-5.003h9.962zM8.265 9.6a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 004.547 0v-4.042A2.274 2.274 0 008.265 9.6zm7.326 0a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 104.548 0v-4.042A2.274 2.274 0 0015.59 9.6z"></path><path d="M12.054 5.558a2.779 2.779 0 100-5.558 2.779 2.779 0 000 5.558z"></path></g>',c:0}},l={openai:"openai","openai-codex":"openai",anthropic:"anthropic",google:"gemini","google-vertex":"vertexai",xai:"xai",mistral:"mistral",deepseek:"deepseek",moonshotai:"moonshot","moonshotai-cn":"moonshot","kimi-coding":"kimi",minimax:"minimax","minimax-cn":"minimax",zai:"zhipu","zai-coding-cn":"zhipu",xiaomi:"xiaomi","xiaomi-token-plan-ams":"xiaomi","xiaomi-token-plan-cn":"xiaomi","xiaomi-token-plan-sgp":"xiaomi",nvidia:"nvidia",huggingface:"huggingface","qwen-token-plan":"qwen","qwen-token-plan-cn":"qwen","qwen-token-plan-individual":"qwen",openrouter:"openrouter","vercel-ai-gateway":"vercel","cloudflare-ai-gateway":"cloudflare","cloudflare-workers-ai":"cloudflare","amazon-bedrock":"bedrock","azure-openai-responses":"azure",together:"together",fireworks:"fireworks",baseten:"baseten",cerebras:"cerebras",groq:"groq","github-copilot":"github",opencode:"opencode","opencode-go":"opencode","command-goat":"commandcode",commandcode:"commandcode","command-code":"commandcode",cliproxy:"cliproxy","workbuddy2api-panel":"workbuddy",workbuddy2api:"workbuddy",workbuddy:"workbuddy",ollama:"ollama",vllm:"vllm",lmstudio:"lmstudio",perplexity:"perplexity",cohere:"cohere",ai21:"ai21",voyage:"voyage",deepinfra:"deepinfra",sambanova:"sambanova",novita:"novita",hyperbolic:"hyperbolic",targon:"targon",parasail:"parasail",lambda:"lambda",fal:"fal",replicate:"replicate",midjourney:"midjourney",stability:"stability",suno:"suno",elevenlabs:"elevenlabs",fishaudio:"fishaudio",assemblyai:"assemblyai",siliconcloud:"siliconcloud",volcengine:"volcengine",doubao:"doubao",hunyuan:"hunyuan",yuanbao:"yuanbao",stepfun:"stepfun",sensenova:"sensenova",baichuan:"baichuan",yi:"yi",codex:"codex",grok:"grok",gemini:"gemini",cline:"cline"},i=[["openrouter","openrouter"],["opencode-go","opencode"],["opencode","opencode"],["openai-codex","openai"],["openai","openai"],["azure","azure"],["bedrock","bedrock"],["anthropic","anthropic"],["claude","anthropic"],["gemini","gemini"],["google","gemini"],["vertex","vertexai"],["deepseek","deepseek"],["moonshot","moonshot"],["kimi","kimi"],["minimax","minimax"],["zhipu","zhipu"],["zai","zhipu"],["glm","zhipu"],["xiaomi","xiaomi"],["mimo","xiaomi"],["qwen","qwen"],["nvidia","nvidia"],["huggingface","huggingface"],["vercel","vercel"],["cloudflare","cloudflare"],["together","together"],["fireworks","fireworks"],["baseten","baseten"],["cerebras","cerebras"],["groq","groq"],["github","github"],["copilot","github"],["cline","cline"],["workbuddy2api","workbuddy"],["workbuddy","workbuddy"],["wb2api","workbuddy"],["perplexity","perplexity"],["cohere","cohere"],["ollama","ollama"],["vllm","vllm"],["lmstudio","lmstudio"],["siliconcloud","siliconcloud"],["siliconflow","siliconcloud"],["volcengine","volcengine"],["doubao","doubao"],["hunyuan","hunyuan"],["yuanbao","yuanbao"],["stepfun","stepfun"],["sensenova","sensenova"],["baichuan","baichuan"],["xai","xai"],["grok","grok"],["mistral","mistral"]],d="data-dshsvc-model-icon",c="data-dshsvc-model-icon-seat",u="--dshsvc-model-icon",p="--dshsvc-model-icon-size",m="data-dshsvc-model-icon-trigger",g="conversation.input.model",h='button[aria-haspopup="menu"]',f='button[class*="_7KE1Ra_trigger"]',b="--dsh-composer-model-icon-display",v="data-dshsvc-model-group",y="data-dshsvc-model-group-icon",w="[data-menu-group-heading]",x='[class*="_7KE1Ra_groupTitle"]',k=(e,t)=>{const a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.v||"0 0 24 24"}"${t?' fill="#000" color="#000"':""}>${e.m}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},S={snapshot:{providers:[],serverTime:0},listeners:new Set,subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},getSnapshot(){return this.snapshot},publish(e){this.snapshot=e;for(const e of[...this.listeners])try{e()}catch(e){}}},E={"opencode-go":"opencode","zai-coding-cn":"zhipu",openrouter:"openrouter",kimi:"kimi",siliconflow:"siliconcloud",deepseek:"deepseek",cliproxy:"cliproxy","xiaomi-token-plan-cn":"xiaomi",stepfun:"stepfun","stepfun-step-plan":"stepfun","command-goat":"commandcode",workbuddy:"workbuddy"},C=e=>{if("string"!=typeof e||""===e)return null;const t=e.trim().toLowerCase();try{if("object"!=typeof S||null===S||"function"!=typeof S.getSnapshot)return null;const e=S.getSnapshot(),a=(Array.isArray(e?.providers)?e.providers:[]).find(e=>("string"==typeof e?.provider?e.provider.trim().toLowerCase():"")===t&&!0===e.adapted&&(void 0===e.kindSource||"config"===e.kindSource));return void 0!==a&&"string"==typeof a.kind?a.kind:null}catch(e){return null}},T=(e,t={})=>{if("string"!=typeof e||""===e)return null;const a=e.trim().toLowerCase();if(""===a)return null;const r=!0===t.forComposer,s="string"==typeof t.quotaKind?t.quotaKind:null===t.quotaKind?null:C(a),n="cliproxy"===s,d=e=>"cliproxy"===e&&r&&!n,c=l[a];if(void 0!==c&&void 0!==o[c])return d(c)?null:{slug:c,spec:o[c]};for(const[e,t]of i)if((a===e||a.startsWith(e+"-")||a.startsWith(e+"_")||a.startsWith(e+"."))&&!d(t)&&void 0!==o[t])return{slug:t,spec:o[t]};if(void 0!==o[a])return d(a)?null:{slug:a,spec:o[a]};for(const e of a.split(/[-_.]/))if(""!==e&&void 0!==o[e]){if(d(e))continue;return{slug:e,spec:o[e]}}const u=null===s?void 0:E[s];return void 0!==u&&void 0!==o[u]?d(u)?null:{slug:u,spec:o[u]}:null},q=(e,t=14,a={},s)=>{if("string"!=typeof e||""===e)return null;const n=T(e,{forComposer:!0});if(null===n)return null;const o=1!==n.spec.c,l=k(n.spec,o),i={display:"inline-block",width:`${t}px`,height:`${t}px`,flexShrink:0,...a},d=`${l} center / contain no-repeat`;return o?(i.backgroundColor="currentColor",i.WebkitMask=d,i.mask=d):(i.backgroundImage=l,i.backgroundPosition="center",i.backgroundSize="contain",i.backgroundRepeat="no-repeat"),r.createElement("span",{..."string"==typeof s&&""!==s?{"data-testid":s}:{},"data-dshsvc-model-icon":n.slug,"aria-hidden":!0,style:i})},A=`\n/* 宽态:模型名前加厂家图标(::before 是触发钮 flex 行的首个子项)。\n 官方 triggerIcon 在宽态本就 display:none(走 --dsh-composer-model-icon-display\n 的默认值),故宽态不会与官方图标重复。\n 选择器只认**自有属性**:触发钮由引擎运行期按官方稳定锚点找到并打标(见\n MODEL_ICON_TRIGGER_ATTR 的说明——官方类名哈希随构建漂移,桌面端与发行包不是\n 同一套,写死即在桌面端全灭)。当年限定 button 是为了绕开子串匹配把\n triggerLabel / triggerEffort 也命中(首版真机三枚并排);改认自有属性后命中面\n 由打标那一步保证,与类名无关。 */\nhtml [${m}][${d}]::before {\n content: '' !important;\n flex: none !important;\n display: block !important;\n /* 尺寸对齐额度圆环:圆环可见外径 13px(14px 的 SVG 盒,外圈 r=5.5 + 2 描边)。\n 图标是实心块面、圆环是细描边环,同直径下实心更重,故基准取略小的 15px 让\n 「视觉重量」相当(真机像素量测校准,见 scripts/measure-icon-ink.mjs)。\n 能定一个统一数字的前提是生成期已把每个图标的 viewBox 收紧到真实绘制范围——\n 否则各品牌留白不同,同一个数字画出来大小参差(⌘ 曾经只占 55%)。\n 变量留给「形状填充率」这一层:满框形状(如 ⌘)即使外接尺寸相同也更显大,\n 由数据里的光学系数 o 单独修正,见生成器 OPTICAL_SCALE。 */\n width: var(${p}, 15px) !important;\n height: var(${p}, 15px) !important;\n background-color: currentColor !important;\n -webkit-mask: var(${u}) center/contain no-repeat !important;\n mask: var(${u}) center/contain no-repeat !important;\n}\n/* 彩色档:原样上品牌色(去掉 mask,改用 background-image)。\n 选择器与上方单色规则同为「触发钮属性 + 一个档位属性」两个属性门,特异性相同,\n 靠**定义顺序**保证 !important 级联下后定义的 mask:none / transparent 胜出。 */\nhtml [${m}][${c}="color"]::before {\n background-color: transparent !important;\n -webkit-mask: none !important;\n mask: none !important;\n background-image: var(${u}) !important;\n background-position: center !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n}\n/* 窄态「替换」:我方图标已表达厂家,官方那枚通用 IconDataOutline16 必须让位,\n 否则两枚图标并排。两条门覆盖两种进入图标态的方式:\n ① ≤480px —— 本插件移动端显式把模型钮收成图标的那一档;\n ② 官方自己的容器查询 —— 容器 ≤360px 时官方本就切到图标态。\n 两态都只在「已适配」时才有官方图标要藏:属性是 JS 按 provider 命中后才挂的,\n 未命中渠道官方图标完全照旧。\n **选择器必须同时带两个自有属性**(而不是只带 seat 属性):mobile.css 里那条\n 「移动端作用域属性 + triggerIcon → display:block!important」与本规则同为\n !important、特异性也同为 (0,2,1),而 mobile.css 在样式表顺序上排在后面——\n 平局由顺序裁决,官方图标就会赢回来(真机实测:窄态出现两枚图标)。\n 多带一个自身属性把特异性提到 (0,3,1),即与插入顺序解耦,不依赖谁先挂。\n 刻意不引用移动端作用域属性:本规则与移动端适配开关无关(关掉移动端适配、\n 窄窗口下官方同样会收成图标),也避免与移动端引擎的挂载断言互相牵连。\n **下面两条只是老宿主兜底**:选择器里的类名哈希在 DSH 桌面端一个都命中不到(那边是\n 另一套命名空间),桌面端走的是「引擎把 --dsh-composer-model-icon-display 在触发钮上\n 压成 none」——官方 triggerIcon 的 display 读的就是这个变量,而桌面端 mobile.css 的\n 哈希规则同样不命中,没有 !important 竞争者,故变量足以解决。在命中哈希的老发行包上,\n mobile.css 的 display:block!important 会参与竞争,只有这两条 !important 压得住。 */\n@media (max-width: 480px) {\n html [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n}\n@container (width<=360px) {\n html [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n}\nhtml [data-model-compact] [${c}][${d}] [class*="_7KE1Ra_triggerIcon"] { display: none !important; }\n/* 模型选择弹窗:分组标题(厂家/渠道商)**前**的同一枚图标。\n 与座上那枚同一套渲染路径(mono 走 mask+currentColor、彩色走 background-image),\n 但挂载机制不同:菜单是运行期才 portal 出来的 DOM、每组是**不同**的 provider,\n 没有稳定独占座可挂,所以由引擎逐组插一个真实节点并打上自有属性门。\n 不能改用标题的伪元素:伪元素只能排在标题既有内容**之后**(表现为「渠道名后」),\n 而需求是名字**前**——插入节点(firstChild 之前)是唯一能满足位置的做法。\n 未命中渠道的组不写属性、不插节点,这里也就没有匹配对象——官方标题零改动。 */\nhtml [${v}] [${y}] {\n display: inline-block !important;\n /* 标题一行 12px(官方 line-height 18px),图标同量级并贴基线;\n 右侧留 5px 让图标与渠道名之间的缝隙与官方行内间距相当。 */\n width: var(${p}, 13px) !important;\n height: var(${p}, 13px) !important;\n margin-right: 5px !important;\n vertical-align: -2px !important;\n background-color: currentColor !important;\n -webkit-mask: var(${u}) center/contain no-repeat !important;\n mask: var(${u}) center/contain no-repeat !important;\n}\n/* 彩色档:与座上同规——去掉 mask、改用 background-image 上品牌色。\n 选择器同样带 [${d}] 保持特异性平齐,保证 !important 级联下后一条胜出;\n 属性同时挂在标题与图标节点上(标题那份让「哪些组被装饰过」在 DOM 上可读)。 */\nhtml [${v}][${c}="color"] [${y}] {\n background-color: transparent !important;\n -webkit-mask: none !important;\n mask: none !important;\n background-image: var(${u}) !important;\n background-position: center !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n}\n`,z=(e,t,a)=>{try{null!=e&&"function"==typeof e.setAttribute&&e.setAttribute(t,a)}catch(e){}},M=(e,t)=>{try{null!=e&&"function"==typeof e.removeAttribute&&e.removeAttribute(t)}catch(e){}},I=(e,t)=>{try{return null!=e&&"function"==typeof e.hasAttribute&&!0===e.hasAttribute(t)}catch(e){return!1}},R=(e,t)=>{try{return null!=e&&"function"==typeof e.getAttribute?e.getAttribute(t):null}catch(e){return null}},O=(e,t,a)=>{try{null!=e&&e.style&&"function"==typeof e.style.setProperty&&e.style.setProperty(t,a)}catch(e){}},H=(e,t)=>{try{null!=e&&e.style&&"function"==typeof e.style.removeProperty&&e.style.removeProperty(t)}catch(e){}},D="@gehennawu/dsh-service/editor",L=["md","markdown","mdx","txt","text","log","ini","toml","conf","cfg","env","json","jsonc","json5","yml","yaml","xml","csv","tsv","diff","patch","ts","mts","cts","js","mjs","cjs","jsx","tsx","vue","svelte","astro","css","scss","sass","less","html","htm","sh","bash","zsh","fish","ps1","bat","cmd","py","pyi","rb","go","rs","java","kt","kts","c","h","cc","cpp","cxx","hpp","hh","cs","php","sql","swift","lua","pl","pm","r","dart","scala","clj","ex","exs","erl","hs","ml","nim","zig","vim","el","emacs","lisp","scm","gradle","properties","dockerfile","makefile","gitignore","gitattributes","gitconfig","editorconfig","npmrc","nvmrc","eslintignore","prettierignore"],N="data-dshsvc-editor-entry",W="data-dshsvc-editor-menu-item",B="[data-document-viewer-menu]",P=()=>{try{return"undefined"==typeof document||null===document?null:document}catch(e){return null}},j=(e,t)=>{try{return Array.from(e.querySelectorAll(t))}catch(e){return[]}},$=e=>String(e?.textContent??"").trim(),_=e=>({borderRadius:e,cornerShape:"round"}),V=e=>{let t="";try{const a=e.search(/[?#]/),r=(-1===a?e:e.slice(0,a)).slice(e.lastIndexOf("/")+1);t=decodeURIComponent(r)}catch(e){return!1}const a=t.toLowerCase();return L.some(e=>a.endsWith("."+e)||a===e)},F=e=>{if(null==e)return null;try{if("function"==typeof e.closest){const t=e.closest("[data-document-preview]");if(null!=t){const e=t.querySelector(B);if(null!=e)return e}}}catch(e){}try{let t="function"==typeof e.closest?e.parentElement:e.parentNode;const a=P();for(;null!=t&&t!==a&&"function"==typeof t.querySelector;){const e=t.querySelector(B);if(null!=e)return e;t=t.parentNode}}catch(e){}return null},U=new Set;let K={isAlive:()=>!1,dispose:()=>{}};const G=(e,t,a={})=>{const r=a?.menu;if(null===e||null==r)return!1;const s="function"==typeof a?.isAlive?a.isAlive:()=>!0;if(!s())return!1;const n=()=>j(e,'[role="menuitem"], [role="option"]').find(e=>!((e,t)=>{try{return"function"==typeof e?.getAttribute&&null!==e.getAttribute(t)}catch(e){return!1}})(e,W)&&t($(e))),o=e=>{try{e.click()}catch(e){return!1}return!0};let l=0;try{l=j(e,B).length}catch(e){l=0}if(l<=1){const e=n();if(void 0!==e)return o(e)}try{r.click()}catch(e){return!1}if(!s())return!1;const i=n();if(void 0!==i)return o(i);let d=12;const c=()=>{d<=0||!s()||(d-=1,"function"==typeof setTimeout&&setTimeout(()=>{if(s()){try{const e=n();if(void 0!==e)return void o(e)}catch(e){}c()}},60))};return c(),!1},Y={"nav.label":"服务控制","nav.restart":"重启","settingsEntry.label":"设置","features.cardTitle":"服务控制(dsh-service)","features.cardHint":"控制可选功能和外部能力。开关立即生效,无需重启。","features.external":"外部能力","features.healthDiagnostics":"健康诊断","features.modelUsage":"模型统计","features.quotaLookup":"额度查询","features.backupMaintenance":"备份维护","features.taskNotifications":"任务通知","features.healthz":"/healthz 探活端点","features.skillManager":"技能管理","features.readOnly":"当前设置不可写。","tabs.skills":"技能","tabs.subagent":"子代理","tabs.sessions":"会话管理","features.subagentRoute":"子代理模型","features.mobileAdaptation":"移动端适配","features.sessionManager":"会话管理","sessions.title":"会话管理","sessions.filter.all":"全部","sessions.filter.archived":"仅归档","sessions.filter.deleted":"已删除","sessions.filter.subagent":"仅子代理","sessions.refresh":"刷新","sessions.batch.enter":"批量选择","sessions.batch.exit":"退出批量","sessions.batch.selectAll":"全选","sessions.batch.clearAll":"取消全选","sessions.batch.selectSubagents":"选中子代理","sessions.batch.selected":"已选择 {count} 项","sessions.batch.selectRow":"选择会话:{title}","sessions.batch.export":"导出 ({count})","sessions.batch.archive":"归档 ({count})","sessions.batch.unarchive":"恢复 ({count})","sessions.batch.delete":"删除 ({count})","sessions.batch.clear":"清除 ({count})","sessions.batch.completed":"已完成{action}:{count} 项","sessions.batch.failed":"{action}完成 {done}/{total} 项;{error}","sessions.batch.deleteTitle":"删除 {count} 个会话","sessions.batch.deleteBody":"将永久删除以下已归档会话的日志文件,删除后不可恢复。","sessions.batch.deleteItem":"{title}({bytes})","sessions.batch.clearTitle":"清除 {count} 条已删除记录","sessions.batch.clearBody":"确定要清除以下 {count} 条已删除记录吗?清除后将从记录列表中永久移除。","sessions.status.loading":"加载中…","sessions.status.working":"处理中…","sessions.status.unavailableTime":"时间未知","sessions.glyph.expand":"▸","sessions.glyph.collapse":"▾","sessions.glyph.back":"←","sessions.search.placeholder":"搜索对话内容…","sessions.search.archivedOnly":"仅搜归档","sessions.sort.createdDesc":"创建时间倒序","sessions.sort.createdAsc":"创建时间正序","sessions.sort.title":"按标题","sessions.sort.project":"按项目","sessions.projectGroup.countOne":"1 个会话","sessions.projectGroup.countMany":"{count} 个会话","sessions.projectGroup.noCwd":"(无工作区)","sessions.row.live":"运行中","sessions.row.archived":"已归档","sessions.row.deleted":"已删除","sessions.row.subagent":"子代理","sessions.subagent.hostLegacy":"当前插件宿主较旧,列表未携带子代理标志;升级插件并重启 dsh 后「仅子代理」才会生效","sessions.row.events":"{count} 条事件","sessions.row.noTitle":"(无标题)","sessions.action.view":"查看","sessions.action.export":"导出","sessions.action.archive":"归档","sessions.action.unarchive":"恢复","sessions.action.delete":"删除","sessions.action.clear":"清除","sessions.empty.all":"没有会话","sessions.empty.archived":"没有归档会话","sessions.empty.deleted":"暂无删除记录","sessions.empty.search":"没有命中「{query}」","sessions.error.load":"加载失败:{error}","sessions.error.feature-disabled":"会话管理功能已在设置中关闭","sessions.error.network":"网络错误:无法连接宿主","sessions.error.session-not-found":"会话不存在或已被删除","sessions.error.live-session-rejected":"会话正在运行,无法删除","sessions.error.session-not-archived":"仅已归档会话可以删除","sessions.error.unknown-delete-plan":"删除请求已失效,请重新发起","sessions.error.invalid-session-ids":"无效的会话标识","sessions.error.unarchive-unsupported":"当前宿主不支持恢复归档(需要 DSH ≥ 0.1.6)","sessions.error.export-failed":"导出失败:{error}","sessions.detail.back":"返回列表","sessions.detail.open":"在官方会话中打开","sessions.detail.archiveDisabled":"归档会话/空白会话无法在官方界面打开","sessions.detail.exportAll":"导出全部 ZIP","sessions.detail.exporting":"正在导出…","sessions.detail.loadMore":"加载更多({remaining})","sessions.detail.noMore":"已加载全部 {total} 条事件","sessions.detail.noise":"系统事件","sessions.detail.noiseBlock":"{count} 条系统事件","sessions.detail.noiseExpand":"展开全部","sessions.detail.noiseCollapse":"收起","sessions.detail.toolBlock":"{count} 条工具消息","sessions.detail.toolCollapse":"收起","sessions.detail.cwd":"{cwd}","sessions.detail.created":"创建于 {time}","sessions.md.copy":"复制","sessions.md.copied":"已复制","sessions.md.footnotes":"脚注","sessions.hit.title":"命中 {count} 条","sessions.hit.return":"返回搜索结果","sessions.hit.badge":"命中","sessions.hit.prev":"◀ 上一个","sessions.hit.next":"下一个 ▶","sessions.hit.inSession":"本会话 {count} 处命中","sessions.delete.title":"删除会话","sessions.delete.body":"将永久删除以下会话的日志文件,删除后不可恢复。","sessions.delete.consequence.log":"删除会话日志({bytes})","sessions.delete.consequence.sidebar":"会话从官方侧栏隐藏","sessions.delete.confirm":"确认删除","sessions.delete.cancel":"取消","sessions.delete.done":"已删除","sessions.clear.title":"清除已删除记录","sessions.clear.body":"确定要清除该条已删除记录吗?清除后将从记录列表中永久移除。","sessions.clear.confirm":"确认清除","sessions.clear.cancel":"取消","sessions.export.includes":"含子代理与附件","sessions.navToggle":"设置页左列显示「会话管理」入口","sessions.oneWay":"归档不可恢复","sessions.oneWayHint":"归档后会话从官方侧栏隐藏;官方不支持恢复归档,只能通过本面板删除。","mobile.fab.label":"打开侧栏菜单","mobile.debug.title":"移动端诊断","mobile.debug.viewport":"视口","mobile.debug.drawer":"抽屉","mobile.debug.sidebarPanel":"右栏","mobile.debug.details":"预览列","mobile.debug.rightbar":"右栏","mobile.debug.errors":"JS 错误","mobile.debug.stateOn":"开","mobile.debug.stateOff":"关","mobile.debug.immersive":"沉浸","mobile.debug.immersive.reason.gesture":"滑动回显","mobile.debug.immersive.reason.arrival":"到底回显","mobile.debug.immersive.reason.focus":"聚焦回显","mobile.debug.immersive.reason.button":"回底钮回显","mobile.debug.edge":"边缘","mobile.debug.edge.fieldStart":"起","mobile.debug.edge.fieldMoves":"动","mobile.debug.edge.fieldLast":"末","mobile.debug.edge.fieldCancel":"消","mobile.debug.edge.fieldReason":"因","mobile.debug.edge.open":"开","mobile.debug.edge.leftOpen":"左开","mobile.debug.edge.rightOpen":"右开","mobile.debug.edge.leftClose":"左关","mobile.debug.edge.rightClose":"右关","mobile.debug.edge.reason.multiTouch":"多指","mobile.debug.edge.reason.modal":"模态","mobile.debug.edge.reason.hScroll":"横滚","mobile.debug.edge.reason.noPoint":"无触点","mobile.debug.edge.reason.absentRight":"右栏缺席","mobile.debug.edge.reason.badButton":"右栏钮不可用","mobile.debug.edge.reason.noTracker":"无追踪","conversation.jump.previousReply":"上一条用户回复","subagent.title":"子代理模型","subagent.loading":"读取配置…","subagent.hint":"控制未显式指定模型的子代理所用模型;显式指定的不受影响。切换模式不会清除已保存的自定义模型与回退列表,切回「自定义」即恢复。","subagent.mode.label":"模式","subagent.mode.inherit":"初始(不干预)","subagent.mode.inherit.desc":"不注入任何路由,保持宿主原生继承行为:子代理使用会话创建时烘焙的默认模型。","subagent.mode.follow":"跟随主模型","subagent.mode.follow.desc":"每次派生时读取主对话当前实际使用的模型(最近一次请求的渠道)并注入。","subagent.mode.custom":"自定义","subagent.mode.custom.desc":"所有未显式指定模型的子代理固定使用下方选择的模型。","subagent.preset":"Agent 预设","subagent.preset.inherit":"跟随父代(默认)","subagent.preset.desc":"为派生的子代理统一指定独立 Agent 预设(角色与工具随预设);留空跟随父代当前预设。调用方显式指定的预设优先,且仅对支持独立预设的派生后端生效。","subagent.preset.empty":"宿主未提供可用的预设清单(需要 0.2.1-alpha.3+ 宿主)。","subagent.provider":"供应商","subagent.model":"模型","subagent.reasoningEffort":"思考等级","subagent.reasoningEffort.default":"使用模型默认(不指定)","subagent.reasoningEffort.unavailable":"该模型未声明可选思考等级","subagent.modelsEmpty":"模型清单为空:无法解析宿主 LLM 渠道。","subagent.save":"保存","subagent.saved":"已保存","subagent.reset":"重置回初始配置","subagent.saving":"保存中…","subagent.unavailable":"宿主未提供子代理注册表(subagents 服务缺席),配置不会生效。","subagent.error":"操作失败:{error}","subagent.error.feature-disabled":"子代理模型功能已在设置中关闭","subagent.error.llm-unavailable":"宿主 LLM 服务不可用","subagent.error.unknown-mode":"未知模式","subagent.error.invalid-model-route":"供应商或模型不在宿主清单内","subagent.error.invalid-reasoning-effort":"思考等级不受该模型支持,请重新选择","subagent.error.network":"网络错误:无法连接宿主","subagent.fallback.title":"回退模型(按顺序)","subagent.fallback.item":"回退 {index}","subagent.fallback.hint":"第一路由不可用时(渠道已卸载、额度查询判定不可服务)依次尝试回退;全部不可用则回落原生继承,不让派生失败。","subagent.fallback.add":"添加回退","subagent.fallback.sort":"调整排序","subagent.fallback.sort.done":"完成排序","subagent.fallback.remove":"移除","subagent.fallback.up":"上移","subagent.fallback.down":"下移","subagent.fallback.empty":"未添加回退:第一路由不可用时子代理回落到原生继承。","subagent.fallback.limit":"已达上限({max} 个)","subagent.error.invalid-fallback-route":"回退条目不在宿主清单内,请重新选择","subagent.dock.label":"子代理:","subagent.dock.title":"输入框下方显示子代理信息","skills.error":"操作失败:{error}","skills.error.feature-disabled":"技能管理功能已在设置中关闭","skills.error.network":"网络错误,请稍后重试","skills.error.read-only-source":"该条目位于只读来源,无法修改","skills.error.unknown-skill":"技能未找到,列表可能已变化,请刷新重试","skills.error.invalid-skill":"条目当前无效:{reason}","skills.error.invalid-field":"开关字段无效","skills.error.invalid-enable":"开关值无效","skills.error.invalid-model-route":"模型路由无效,请重新选择模型","skills.error.invalid-description":"描述不能为空","skills.error.describe-timeout":"模型生成超时(90 秒)","skills.error.empty-output":"模型未产出正文(结束原因:{kind})","skills.error.batch-cancelled":"已取消","skills.error.entry-changed":"条目在运行中发生变化,已跳过","skills.error.unknown-batch-plan":"批量计划已失效,请重新生成","skills.error.batch-already-done":"该批量计划已完成","skills.error.batch-already-cancelled":"该批量计划已取消","skills.error.annotated-confirm-required":"已注释技能需再次确认后才能被覆盖","skills.empty":"未发现任何技能","skills.filter":"按名称过滤…","skills.expandAll":"全部展开","skills.collapseAll":"全部折叠","skills.colon":":","skills.group.auto":"自动加载","skills.group.manual":"仅手动调用","skills.group.disabled":"完全停用","skills.source.project-dsh":"项目 .dsh","skills.source.project-agents":"项目 .agents","skills.source.user-dsh":"用户 DSH","skills.source.user-agents":"用户 .agents","skills.source.bundled":"内置","skills.source.custom":"自定义目录","skills.badge.shadowed":"被同名遮蔽","skills.badge.readonly":"只读","skills.badge.annotated":"已注释","skills.note.stale":"正文已变更,待重新补全","skills.note.remove":"移除 AI 注释","skills.note.panelOnly":"注释仅保存在本面板展示,不写入 SKILL.md。","skills.log.title":"运行日志","skills.log.located":"已定位技能 {name}(文件 {chars} 字符)","skills.log.attempt":"第 {n}/{total} 次生成:调用 {route}","skills.log.received":"输出接收完成({chars} 字符),解析 JSON…","skills.log.parsed":"解析成功,草稿就绪","skills.log.failed-retry":"失败:{message},自动重试","skills.log.failed":"失败:{message}","skills.log.wait":"等待模型输出… {secs}s","skills.log.first-delta":"模型已开始返回","skills.log.first-reasoning":"模型已开始返回(先输出推理)","skills.log.progress":"已接收 {chars} 字符","skills.log.finish-reasoning-only":"模型结束:{kind}(仅推理 {chars} 字符,未产出正文)","skills.log.finish-empty":"模型结束:{kind}(无任何输出)","skills.log.block-extract":"从整块输出提取正文({chars} 字符)","skills.log.item-start":"开始生成注释…","skills.batch.toggle":"批量注释","skills.batch.collapse":"收起","skills.batch.already":"已有批量任务在进行中,请等待完成或先取消","skills.invalid.legacy":"存在旧版调用键,已从模型目录剔除","skills.invalid.other":"无效条目:{reason}","skills.fix.legacy":"一键修复旧键","skills.switch.model":"对模型可见","skills.switch.user":"可被 / 调用","skills.switch.confirm":"再次点击生效","skills.describe.button":"AI 补全说明","skills.describe.title":"AI 补全说明 — {name}","skills.describe.model":"模型","skills.describe.models.loading":"获取模型列表…","skills.describe.models.empty":"未发现已配置模型","skills.describe.run":"生成草稿","skills.describe.running":"生成中…","skills.apply.title":"保存 AI 注释 — {name}","skills.apply.description":"描述","skills.apply.usage":"用法","skills.apply.old":"旧","skills.apply.new":"新","skills.apply.confirm":"保存注释","skills.apply.done":"注释已保存","skills.apply.keepusage":"(保留现有)","skills.llm.unavailable":"宿主 LLM 服务不可用,无法 AI 补全。","skills.batch.title":"批量补全技能说明","skills.batch.hint":"逐条调用所选模型为未注释或正文有变的技能生成说明;已注释技能在计划中单列,再次确认后才会被覆盖。结果仅存插件内并展示在条目下方。","skills.batch.plan":"生成计划","skills.batch.candidates":"候选 {count} 项","skills.batch.estBytes":"约发送 {size} 内容","skills.batch.skipped":"跳过 {count} 项(无效 / 被遮蔽)","skills.batch.annotated":"已注释将覆盖 {count} 项","skills.batch.annotatedList":"将覆盖清单","skills.batch.forceConfirm":"确认强制补全(覆盖 {count} 项已注释)","skills.skippedList":"跳过清单","skills.skip.shadowed":"被遮蔽","skills.skip.invalid":"无效({reason})","skills.skip.reason.missing-frontmatter":"缺 frontmatter","skills.skip.reason.missing-name":"缺 name","skills.skip.reason.invalid-name":"name 不合法","skills.skip.reason.missing-description":"缺 description","skills.skip.reason.too-large":"文件过大","skills.skip.reason.legacy-invocation-key":"旧版调用键","skills.batch.start":"开始批量补全","skills.batch.progress":"进度 {done}/{total}","skills.batch.current":"当前:{name}","skills.batch.cancel":"取消","skills.batch.phase.idle":"空闲","skills.batch.phase.planned":"待开始(核对候选后点击「开始批量补全」)","skills.batch.phase.running":"进行中","skills.batch.phase.done":"已完成","skills.batch.phase.cancelled":"已取消","skills.batch.failures":"失败 {count} 项","skills.batch.no-candidates":"没有需要补全的候选","skills.batch.model":"模型","overlay.label":"服务重启状态","recovery.waiting.title":"服务重启中…","recovery.waiting.body":"正在等待新的 DSH Web 进程启动,已等待 {seconds} 秒。","recovery.timeout.title":"服务尚未恢复","recovery.timeout.body":"已等待 60 秒。请确认外部进程管理器已正确配置,或手动刷新页面重试。","recovery.manual":"手动刷新","health.title":"运行状况","health.uptime":"运行时间","health.rss":"内存 RSS","health.platform":"平台","health.nodeVersion":"Node 版本","health.liveSessions":"存活会话","health.persistedSessions":"持久化会话","health.activeAgents":"活跃 Agent","health.activeJobs":"后台任务","health.uptimeValue":"{hours} 小时 {minutes} 分钟","health.error":"无法读取运行状况","health.check":"立即健康检查","health.checking":"检查中…","health.overall.ok":"正常","health.overall.warning":"警告","health.overall.error":"错误","health.alert.title":"健康提醒","health.alert.diagnostics":"检查结果存在{status},请查看下方异常项。","health.status.ok":"正常","health.status.warning":"警告","health.status.error":"错误","health.status.info":"信息","health.check.session-storage":"会话存储","health.check.workspace-registry":"工作区注册表","health.check.dsh-home":"DSH_HOME","health.check.backup-storage":"备份存储","health.check.tar":"tar","health.check.permissions":"文件权限","health.check.runtime-env":"运行环境","health.check.node-version":"Node 运行时","health.detail.runtime-env.managed":"由{kind}管理,重启后会自动拉起","health.detail.runtime-env.declared":"已通过 DSH_SERVICE_RUNTIME_ENV 声明由外部进程管理器管理","health.detail.runtime-env.manual":"疑似终端手动启动,重启后不会自动拉起;一键升级已改为不自动退出","health.detail.runtime-env.unknown":"未检测到进程管理器,无法确认重启后是否自动拉起;如实际有,可设置 DSH_SERVICE_RUNTIME_ENV=managed 声明","health.detail.runtime-env.desktop":"由桌面端托管(Electron);重启由桌面应用负责,请从应用托盘/菜单退出后重新打开","health.detail.node-version.ok":"{version},满足 ≥{required} 要求","health.detail.node-version.warning":"{version} 低于插件要求的 {required}.x,建议升级 Node","health.detail.session-storage.ok":"可用,共 {count} 个会话快照","health.detail.workspace-registry.ok":"可用,共 {count} 个工作区","health.detail.dsh-home.ok":"目录可访问,权限模式 {mode}","health.detail.backup-storage.empty":"备份目录可用,当前暂无备份","health.detail.backup-storage.ok":"备份目录可用,共 {count} 个备份,占用 {size}","health.detail.tar.ok":"tar 可执行文件可用","health.detail.permissions.ok":"文件权限检查正常,未发现异常","health.detail.permissions.warning":"发现 {count} 个文件或目录权限异常","health.detail.generic":"{status}","health.check.usage-index":"使用统计索引","health.detail.usage-index.never":"尚未建立统计索引,打开模型统计页后开始只读建立","health.detail.usage-index.unavailable":"统计索引暂不可读","health.detail.usage-index.ok":"已索引 {indexed} 个会话,更新于 {updated}","health.detail.usage-index.info":"{failed} 个会话未能索引(统计少算),已索引 {indexed} 个,更新于 {updated}","health.detail.usage-index.warning":"{failed} 个会话未能索引(统计少算),已索引 {indexed} 个,更新于 {updated}","health.check.notification-permission":"通知权限","health.detail.notification-permission.granted":"浏览器已授权系统通知","health.detail.notification-permission.default":"浏览器尚未授权系统通知,可在「配置 → 通知」中启用","health.detail.notification-permission.denied":"浏览器已拒绝系统通知,需在浏览器站点设置里恢复","health.detail.notification-permission.unsupported":"当前浏览器不支持系统通知","health.check.plugins":"插件","health.detail.plugins.unavailable":"插件体检不可用(宿主未暴露 Loader)","health.detail.plugins.ok":"共 {total} 个插件,状态正常","plugin.issue.failed":"{failed} 个插件失败","plugin.issue.pending":"{pending} 个插件未就绪","plugin.issue.info":"{count} 个插件状态需确认","plugin.state.pending":"等待依赖","plugin.state.loading":"加载中","plugin.state.failed":"失败","plugin.state.disposed":"已释放","plugin.state.unknown":"未知状态","plugin.state.unloading":"卸载中","plugin.missingDeps":"依赖缺失:{deps}","plugin.error":"错误:{error}","plugin.restart":"重新加载","plugin.restarting":"重新加载中…","plugin.restartConfirm":"确认重新加载","plugin.restartHint":"重新加载「{name}」,其启动逻辑将重新执行,失败状态会随之刷新。","plugin.restartCancel":"取消","plugin.restartFailed":"重新加载失败:{detail}","plugin.error.unknown-plugin":"未找到该插件","plugin.error.loader-unavailable":"宿主 Loader 不可用","plugin.error.plugin-disabled":"插件已停用,无法重新加载","plugin.error.not-failed":"该插件未处于失败状态","plugin.error.restart-failed":"重新加载后仍然失败","tabs.overview":"概览","tabs.notify":"通知","tabs.health":"健康诊断","tabs.usage":"模型统计","tabs.quota":"额度查询","overview.container":"进程与运行环境","overview.errors":"报错信息","overview.status.normal":"所有系统运行正常","overview.status.info":"有 {count} 条提示","overview.status.warning":"有 {count} 项需要注意","overview.status.error":"有 {count} 项需要处理","overview.backupEmpty":"还没有备份,建议创建一份","overview.updateAvailable":"检测到新版本可用","tabs.backup":"备份维护","tabs.restart":"重启","tabs.maintenance":"维护","tabs.configuration":"配置","tabs.models":"模型配置","page.models.desc":"供应商工作台:状态总览、单供应商「检查 → 建议 → 应用 → 验证」与持久化撤销;任意公网 HTTPS 中转都可安全检查。","features.modelCatalog":"模型配置","models.time.justNow":"刚刚","models.time.minAgo":"{n} 分钟前","models.time.hourAgo":"{n} 小时前","models.security.title":"安全与数据说明","models.security.urlTitle":"URL 怎么用","models.security.urlBody":"「检查并修复」只在你显式点击后请求一次该路由的 {baseURL}/models;任意公网 HTTPS 地址都可检查,但插件会先做安全校验(仅 HTTPS、仅默认 443 端口、拒绝内网与保留地址、DNS 解析后直连并钉住 Host),校验不过就拒绝请求。非公网地址仍可保存使用,只是不会被插件在线检查。","models.security.keyTitle":"API key 怎么存","models.security.keyBody":"插件从不读取、回显或记录你的密钥;检查在你显式点击时才授权使用已存凭据,且只发往该路由当前地址;凭据动作不可撤销,也不进撤销快照。","models.security.revertTitle":"配置怎么改回","models.security.revertBody":"写入只落 settings.yaml 的 llm-pi-ai 段:字段级预览 → 两段确认 → 写前完整快照(不含密钥)持久化在本机,可随时撤销;校验不合法的数据会被整体拒绝。","models.routes.title":"供应商列表","models.wb.empty":"暂无供应商:先在 DSH 官方 设置 → 模型 页创建自定义提供方(或启用内置渠道),再回到这里管理。","models.wb.modelCount":"{n} 个模型","models.wb.meta":"容量 {ctx} · 视觉 {vision} · 思考 {reasoning}","models.wb.neverValidated":"从未验证","models.wb.lastValidated":"验证于 {time}","models.wb.validationFailed":"最近验证失败","models.wb.undoAvailable":"可撤销","models.wb.builtin":"内置渠道","models.wb.builtinUser":"官方内置","models.wb.seeImage":"可看图","models.wb.canThink":"可思考","models.wb.attention.dangling":"凭据未配置","models.wb.attention.danglingHint":"该供应商声明了密钥引用,但本机未找到对应密钥。请到 设置 → 模型 页填写密钥,或清除该引用。","models.wb.attention.validation":"最近验证失败","models.wb.attention.validationHint":"最近一次验证未通过。点进去可重新运行验证查看失败项。","models.wb.attention.recovery":"待人工恢复","models.wb.attention.recoveryHint":"上次写入中途失败,恢复前禁止自动写入。请在官方设置页人工处理后解除。","models.wb.attention.invalid":"配置结构有误","models.wb.attention.invalidHint":"模型配置存在无法保存的字段。请检查模型参数(上下文/输出为正整数,思考等级合法)。","models.wb.detail.todos":"该供应商有 {n} 项待办","models.wb.legend":"标记说明:官方内置 = DSH 自带渠道 · 可看图 = 模型支持图像输入 · 可思考 = 模型支持思考等级 · 虚线下划线文字 = 需处理项(悬停看原因)","models.wb.needsAttention":"需处理","models.wb.checkFix":"检查并修复","models.wb.undoWrite":"撤销上次写入","models.wb.phase.inspect":"检查","models.wb.phase.suggest":"建议","models.wb.phase.apply":"应用","models.wb.phase.verify":"验证","models.wb.task.title":"检查并修复({route})","models.wb.task.back":"返回列表","models.wb.check.busy":"检查中…","models.wb.check.start":"开始检查","models.wb.check.recheck":"重新检查","models.wb.check.notProbed":"未探测网关(可添加模型需点击获取)","models.wb.check.fetchAdditions":"获取可添加模型","models.wb.check.ok":"网关返回 {n} 个模型","models.wb.check.failed":"网关连接失败:{error}","models.wb.check.unsupported":"该协议不支持在线列表,已跳过在线发现","models.wb.check.insecure":"地址不是 HTTPS 公网地址,禁止在线检查","models.wb.check.private":"地址解析到内网/保留地址,禁止在线检查","models.wb.check.ipliteral":"地址是 IP 字面量,禁止在线检查","models.wb.check.dns":"域名解析失败","models.wb.check.credential":"已授权使用已存凭据(仅发往该路由当前地址)","models.wb.check.anon":"匿名检查(未找到已存凭据)","models.wb.reasoning":"思考","models.wb.add.online":"在线获取","models.wb.add.manual":"手动输入","models.wb.add.choose":"选择模型…","models.wb.add.detect":"检测模型","models.wb.add.detected":"已检测","models.wb.add.prepare":"准备添加","models.wb.add.unverified":"检测未通过,仍以未验证添加","models.wb.add.unverifiedReason":"检测失败:{error}","models.wb.add.unverifiedHelp":"该模型未通过运行时验证(目录无记录或解析失败)。仍可添加,调用失败风险由您承担。","models.wb.add.probeName":"名称","models.wb.add.probeContext":"上下文","models.wb.add.probeMax":"最大输出","models.wb.add.probeModel":"模型 ID:{id}","models.wb.add.detectHint":"输入模型 ID 后点击「检测模型」,或按回车。","models.wb.verifyOnline":"联网查证","models.wb.verifyOnline.busy":"正在查询模型档案…","models.wb.verifyOnline.title":"模型档案查证({model})","models.wb.verifyOnline.source":"来源:{name}","models.wb.verifyOnline.open":"查看模型页","models.wb.verifyOnline.noMatch":"未找到相关参数说明","models.wb.verifyOnline.notFound":"该模型不在 OpenRouter 目录中","models.wb.verifyOnline.error":"查询失败:{error}","models.wb.verifyOnline.note":"查证结果仅作参考,不会自动写入配置。","models.wb.add.allowUnverified":"仍以未验证添加","models.wb.add.confirmSummary":"即将只保存 Image/思考/上下文设置,其他高级字段保持不变。","models.wb.add.commit":"确认添加","models.wb.detail.models":"已配置模型","models.wb.detail.expand":"展开参数","models.wb.detail.collapse":"收起参数","models.wb.detail.context":"上下文窗口","models.wb.detail.maxTokens":"最大输出","models.wb.detail.image":"图像输入","models.wb.detail.imageState.yes":"支持","models.wb.detail.imageState.no":"不支持","models.wb.detail.imageState.detected":"跟随检测","models.wb.detail.thinking":"思考","models.wb.detail.thinkingState.yes":"支持","models.wb.detail.thinkingState.no":"不支持","models.wb.detail.thinkingState.detected":"跟随检测","models.wb.detail.thinkingState.follow":"跟随默认","models.wb.detail.apply":"应用更改","models.wb.detail.finalConfirm":"最终确认","models.wb.detail.changeSummary":"{changes} 处字段变更 · 新增 {added} · 移除 {removed}","models.wb.detail.advice":"建议","models.wb.detail.useAdvice":"填入建议","models.wb.detail.noAdvice":"暂无建议","models.wb.detail.adviceSource":"建议来源:{source}","models.wb.detail.runtime":"实测","models.wb.detail.split":"来源不一致,请选择","models.wb.detail.hitCount":"{count} 个来源命中此值(共 {total} 个来源)","models.wb.detail.othersCount":"另有 {n} 个不同值","models.wb.detail.empty":"该供应商还没有配置模型。","models.wb.detail.saved":"已应用并热生效","models.wb.detail.notice":"需处理","models.wb.detail.recheck":"最终确认后插件会再次校验参数有效性。","models.wb.chip.safeFill":"补全","models.wb.chip.conflict":"冲突","models.wb.chip.addition":"可添加","models.wb.chip.unknown":"未识别","models.wb.group.safeFill":"安全补全(缺失字段;高置信默认勾选)","models.wb.group.conflict":"冲突(配置与目录不一致;默认不勾选)","models.wb.group.addition":"可添加模型(网关/目录新发现;默认不勾选)","models.wb.group.unknown":"未识别模型(保留,绝不自动删除)","models.wb.group.more":"展开全部({n})","models.wb.group.less":"收起","models.wb.selectRow":"全选","models.wb.clearRow":"清空","models.wb.filter":"筛选模型…","models.wb.selected":"已选 {n} 项","models.wb.confidence.low":"需确认","models.wb.inexpressible":"含 {n} 个 DSH 无法表达的值","models.wb.unknownRow":"未识别:在线列表未返回且目录未命中;保留不动","models.wb.suggestEmpty":"没有待处理项:配置已与网关和目录一致。","models.wb.prepare":"准备应用","models.wb.apply.title":"应用预览","models.wb.apply.summary":"{changes} 处字段变更 · 新增 {added} · 移除 {removed}","models.wb.apply.noCredentialOps":"凭据与密钥:本计划不涉及。","models.wb.apply.empty":"空计划:没有要写入的变更。","models.wb.apply.confirm":"确认应用","models.wb.apply.back":"返回修改","models.wb.applied":"已应用 {n} 项,写入即时热生效","models.wb.conflict":"配置在计划生成后被外部修改,写入已被拒绝以避免覆盖。请重新检查后重试。","models.wb.undo.title":"撤销预览({route})","models.wb.undo.at":"写入于 {time}","models.wb.undo.restorable":"{n} 处可恢复:","models.wb.undo.restoreField":"{model} · {field}:恢复为 {value}","models.wb.undo.removeField":"{model} · {field}:移除显式值","models.wb.undo.nothing":"没有可自动恢复的字段差异。","models.wb.undo.added":"写入后新增了 {n} 个模型(默认保留)","models.wb.undo.dropAdded":"一并移除这些新增模型","models.wb.undo.removed":"写入后被移除了 {n} 个模型(默认保持移除)","models.wb.undo.restoreRemoved":"一并恢复这些被移除的模型","models.wb.undo.confirm":"确认撤销","models.wb.undo.cancel":"取消","models.wb.undo.done":"已撤销并热生效","models.wb.create.title":"添加供应商","models.wb.create.displayName":"显示名称","models.wb.create.baseURL":"API 地址(HTTPS)","models.wb.create.api":"API 协议","models.wb.create.key":"API 密钥(可选;仅存于本次任务内存,创建时写入本机凭据库)","models.wb.create.route":"Provider ID(按显示名建议,可修改;创建后不可重命名)","models.wb.create.begin":"检查并准备","models.wb.create.manual":"手动添加模型 ID(每行一个,可选)","models.wb.create.pick":"选择要创建的模型(默认不选)","models.wb.create.summary":"将创建 {route}:{n} 个模型{credential}。","models.wb.create.credNote":",同时把密钥写入本机凭据库","models.wb.create.confirm":"确认创建","models.wb.create.cancel":"取消","models.wb.create.created":"已创建 {route}","models.plan.confirmArmed":"再点一次确认","models.wb.catalog.title":"模型目录","models.wb.catalog.customized":"已自定义模型目录","models.wb.catalog.inherited":"正在使用适配器默认模型","models.wb.edit.title":"编辑模型({route})","models.wb.edit.name":"名称","models.wb.edit.modelId":"模型 ID","models.wb.edit.modelIdPlaceholder":"模型 ID","models.wb.edit.displayNamePlaceholder":"留空时使用模型 ID","models.wb.edit.context":"上下文窗口","models.wb.edit.contextPlaceholder":"继承目录默认值","models.wb.edit.maxTokens":"最大输出 token","models.wb.edit.maxTokensPlaceholder":"继承目录默认值","models.wb.edit.capacityInvalid":"容量需为正数,可写 K/M 后缀,例如 131072、256K、1M。","models.wb.edit.inputModalities":"输入模态","models.wb.edit.outputModalities":"输出模态","models.wb.edit.modalityText":"文本","models.wb.edit.modalityImage":"图像","models.wb.edit.outputReadonly":"输出模态由适配器与内置目录决定;模型条目没有对应字段,这里只作展示。","models.wb.edit.reasoningLevels":"推理档位","models.wb.edit.reasoningNoneHint":"不勾选即视为非推理模型","models.wb.edit.reasoningFalse":"非推理模型(reasoning=false)","models.wb.edit.wireCustom":"自定义协议值","models.wb.edit.wireHint":"默认发送同名协议值;改写输入框即为自定义。","models.wb.edit.advanced":"模型选项","models.wb.edit.inputImage":"图像输入","models.wb.edit.reasoning":"思考等级","models.wb.edit.reasoningOff":"off(不发送)","models.wb.edit.clearOverride":"清除显式值(继承默认)","models.wb.edit.addModel":"新增模型","models.wb.tab.models":"模型列表","models.wb.tab.connection":"连接信息","models.wb.tab.danger":"撤销与删除","models.wb.state.runtimeLoaded":"运行时已加载","models.wb.state.runtimeMissing":"运行时未加载","models.wb.search.placeholder":"搜索模型 ID 或名称","models.wb.search.none":"没有匹配的模型","models.wb.keyRef":"凭据引用 {ref}","models.wb.conn.displayName":"显示名","models.wb.conn.api":"协议","models.wb.conn.baseURL":"接口地址","models.wb.conn.urlHint":"地址只作为配置数据保存;只有公网 HTTPS 地址才允许在线获取模型列表,其余地址仍可保存与手填模型。","models.wb.conn.key":"更换密钥","models.wb.conn.keyPlaceholder":"输入新密钥(不回显旧值)","models.wb.conn.keyHint":"密钥只提交一次,不显示、不进日志、不进撤销快照与浏览器草稿。删除渠道时凭据保留。","models.wb.conn.save":"保存连接信息","models.wb.conn.probeOk":"该地址允许在线获取模型列表。","models.wb.conn.probeBlocked":"该地址不可在线获取({reason});保存与手填仍可用。","models.wb.conn.credState":"凭据 {ref}:{state}","models.wb.conn.credConfigured":"已配置","models.wb.conn.credAbsent":"未配置","models.wb.conn.credShadowed":"被环境变量遮蔽,无法写入","models.wb.conn.shadowWarn":"{ref} 由环境变量提供,写入会被拒;请先在环境中取消该变量。","models.wb.conn.planTitle":"将写入以下字段","models.wb.conn.planFields":"字段:{fields}","models.wb.conn.planNothing":"(无变化)","models.wb.conn.planKey":"同时替换凭据值。","models.wb.conn.planNoKey":"不改动凭据。","models.wb.conn.confirm":"确认保存","models.wb.conn.saved":"连接信息已保存并热生效","models.wb.leave.body":"有未保存的编辑。离开将丢弃这些草稿。","models.wb.leave.stay":"继续编辑","models.wb.leave.go":"放弃并离开","models.wb.edit.unsaved":"未保存","models.wb.effort.needLevel":"至少需要一档非 off 的映射值。","models.wb.add.title":"添加模型","models.wb.add.count":"发现 {n} 个模型,其中 {added} 个已添加","models.wb.add.already":"已添加","models.wb.add.fetching":"正在获取模型列表…","models.wb.add.fallback":"发现失败不影响手动添加:切到「手动输入 ID」继续即可。","models.wb.add.note":"获取列表成功不代表可以调用;需要实测请保存后用下方测试。","models.wb.add.manualIds":"手动输入模型 ID(每行一个,或用逗号分隔)","models.wb.add.manualHint":"只接受模型 ID 文本,字段值由宿主校验后写入。","models.wb.remove.after":"移除后该渠道剩余 {n} 个模型。","models.wb.remove.blockedHint":"该模型被引用,请先到对应设置解除引用,再回到这里删除。","models.wb.test.title":"真实调用测试(保存后可主动执行)","models.wb.test.note":"先跑基础检查(零费用);深度测试会发送一段固定最小提示词并可能产生费用,失败不会回滚已保存的配置。","models.wb.test.deep":"深度测试(可能计费)","models.wb.test.deepArmed":"再点一次确认付费测试","models.wb.test.cost":"将发送:system「Reply with OK.」+ user「ping」,max_tokens=16,15 秒超时。","models.wb.test.scopeShallow":"本次只核对配置与运行时加载;不代表图片、思考或上下文上限已实测。","models.wb.test.scopeDeep":"本次只证明一次基础调用可成功;不代表图片、思考或上下文上限均已验证。","models.wb.danger.title":"撤销与删除","models.wb.routeDelete.btn":"删除该渠道","models.wb.routeDelete.plan":"删除后将从 settings 移除该渠道({n} 个模型)。","models.wb.routeDelete.key":"凭据 {ref} 会保留,不影响其它使用同一凭据的渠道。","models.wb.routeDelete.noKey":"该渠道没有引用凭据。","models.wb.routeDelete.blocked":"该渠道被代理默认模型引用:请先在官方设置页更换默认。","models.wb.routeDelete.refs":"另有 {n} 处引用会在删除后失效。","models.wb.routeDelete.confirm":"删除渠道","models.wb.routeDelete.confirmArmed":"再点一次确认删除","models.wb.rescue.title":"最近删除的渠道","models.wb.rescue.empty":"没有可恢复的已删除渠道。","models.wb.rescue.restore":"恢复该渠道","models.wb.rescue.taken":"已存在同名渠道,需先改名或删除它才能恢复。","models.wb.rescue.done":"已恢复。凭据引用一并恢复,但旧密钥值不会被恢复,请按需重新输入。","models.wb.rescue.note":"恢复写回删除前的完整渠道配置;旧密钥值不在快照内,不会被恢复。","models.wb.edit.save":"保存编辑","models.wb.edit.confirm":"确认保存","models.wb.edit.done":"已保存并热生效","models.error.last-model-undeletable":"不能删除最后一个模型:空清单会被宿主当成「继承目录」,与禁用渠道不等价。请改用「删除该渠道」,或先添加替代模型。","models.error.builtin-inherited-list":"该内置渠道正在继承内置目录清单,追加模型会整份替换它。请改用「添加自定义渠道」另开一条路由,或用单模型编辑面板只改已有模型的参数。","models.error.nothing-to-restore":"没有可恢复的已删除渠道。","models.error.restore-failed":"恢复失败({detail});快照已保留,可修正后重试。","models.error.connection-failed":"连接信息写入失败:{detail}","models.wb.edit.noop":"没有变更","models.wb.edit.removeHint":"删除模型请用「移除模型」流程(含引用守卫)","models.wb.remove.btn":"移除模型","models.wb.remove.title":"移除模型({route})","models.wb.remove.pick":"选择要移除的模型(移除即写入,可撤销)","models.wb.remove.ref.subagent":"子代理路由当前指向 {model};请选择替代模型,与应用同事务提交","models.wb.remove.ref.default":"该模型被设为代理默认模型(agent-default-model):请先在官方设置页更换默认,再回来移除","models.wb.remove.migrateProvider":"替代提供方","models.wb.remove.migrateModel":"替代模型","models.wb.remove.plan":"准备移除","models.wb.remove.confirm":"确认移除","models.wb.remove.done":"已移除 {n} 个模型(可撤销)","models.wb.verify.run":"运行验证","models.wb.verify.deep":"深度验证(最小真实调用,可能计费)","models.wb.verify.deepArmed":"再点一次确认付费验证","models.wb.verify.busy":"验证中…","models.wb.verify.check.settings":"配置写入","models.wb.verify.check.providers":"供应商可见性","models.wb.verify.check.models":"模型解析","models.wb.verify.check.credential":"凭据","models.wb.verify.check.stream":"真实调用","models.wb.verify.skipped":"跳过","models.wb.verify.ok":"通过","models.wb.verify.fail":"失败:{error}","models.wb.verify.persisted":"验证摘要已保存(每路由最近一次)","models.error.llm-missing":"LLM 服务不可用,无法深度验证","models.plan.field.name":"名称","models.plan.field.contextWindow":"上下文窗口","models.plan.field.maxTokens":"最大输出","models.plan.field.input":"输入模态","models.plan.field.reasoningEfforts":"思考等级","models.error.catalog-unavailable":"目录不可用,请稍后重试","models.error.route-gone":"该提供方已在设置中被移除","models.error.plan-expired":"计划已过期,请重新检查","models.error.inspect-gone":"检查结果已失效,请重新检查","models.error.conflict":"配置已变化,计划被拒绝以避免覆盖外部修改","models.error.unknown-suggestion":"包含未知建议项,请重新检查后再试","models.error.nothing-to-undo":"没有可撤销的写入","models.error.bad-route":"Provider ID 需以小写字母开头,仅含小写字母、数字和短横线","models.error.bad-api":"请选择支持的 API 协议","models.error.bad-base-url":"API 地址需为有效 HTTPS 地址","models.error.route-taken":"已有提供方使用这个 ID","models.error.no-base-url":"该路由未配置 baseURL,且 DSH 内置目录中也未找到对应渠道","models.error.workbenchReadonly":"旧版写入已停用:请在「供应商与模型」工作台操作","models.error.config-unavailable":"模型配置实例不可用,请在原生插件管理页确认 pi-ai 插件已启用。未执行写入。","models.error.config-ambiguous":"检测到多个 pi-ai 配置实例,工作台不会猜测写入目标。请在原生插件管理页处理实例后重试。","models.error.config-expression":"模型配置由动态表达式提供,请在原生配置入口编辑;工作台不会将其替换为静态值。","models.error.config-inherited-route":"该渠道来自上层或内置配置,删除会恢复继承值而不是移除渠道。请在原生配置入口处理来源。","models.error.bad-display-name":"请填写显示名称","models.error.bad-key":"密钥过长(上限 4096 字符)","models.error.no-models":"至少需要一个模型:勾选上面的候选,或填写手动模型 ID","models.error.credential-rejected":"凭据写入被拒绝,未创建任何配置","models.error.create-failed":"创建失败:{detail}","models.error.draft-gone":"创建草稿已失效,请重新开始","models.error.recovery-pending":"该路由处于「需人工恢复」状态,自动写入已被阻止:请先在官方设置页处理,再解除标记","models.error.nothing-to-resolve":"没有需要解除的恢复标记","models.error.bad-models":"模型数据不合法","models.error.migration-required":"子代理路由正引用该模型:请选择替代模型后重试","models.error.removal-blocked":"代理默认模型引用阻止移除:请先在官方设置页更换默认模型","models.error.remove-failed":"移除失败:{detail}","models.error.bad-model-id":"模型 ID 需为 1–256 个字符且不含控制字符","models.error.model-detection-required":"请先检测该模型再继续","models.error.model-unverified":"模型检测未通过,无法写入","models.error.unknown-option":"候选项已失效,请重新获取","models.error.unknown-detection":"检测结果已失效,请重新检测","models.error.duplicate-model":"该模型已在供应商中配置","models.error.builtin-only":"在线获取仅适用于自定义渠道;内置渠道请从内置目录选择","models.error.online-custom-only":"该路由不是内置渠道,不能使用内置目录","models.error.probe-protocol-unsupported":"该协议不支持在线获取模型清单","models.error.unknown":"操作失败:{detail}","tabs.providers":"供应商与模型","tabs.subagentRoute":"子代理路由","tabs.features":"功能","tabs.notifications":"通知","tabs.navOrder":"设置栏标签","config.navOrder.title":"设置栏标签排序与显隐","config.navOrder.moveUp":"上移","config.navOrder.moveDown":"下移","config.navOrder.visible":"显示","config.navOrder.hidden":"隐藏","config.navOrder.locked":"当前面板(不可隐藏)","config.navOrder.reset":"恢复默认排序","config.navOrder.saved":"已保存","config.navOrder.save":"保存排序","config.navOrder.empty":"未检测到已注册的设置栏标签","maintenance.empty":"所有维护子页均已关闭。可在「配置 → 功能」中开启备份、技能、子代理或会话管理。","config.notificationsDisabled":"任务通知功能已在「功能」页关闭,以下设置仅作展示;重新开启后通知才会生效。","features.group.runtime":"运行与观测","features.group.maintenance":"维护","features.group.interaction":"交互","page.configuration.desc":"功能开关与任务通知设置。","tabs.alert.title":"服务控制提醒","tabs.alert.body":"以下功能需要处理:{tabs}","tabs.alert.join":"、","tabs.alert.dot":"此标签存在故障提醒","permissions.title":"文件权限","permissions.description":"检查 Agent 能否读写并进入 DSH_HOME 与工作区。深检跳过 .git;修复补充当前用户所需权限并保留执行位。","permissions.target":"目标属主:{owner}","permissions.repair":"修复权限","permissions.repairing":"修复中…","permissions.confirm":"确认修复","permissions.confirmHint":"跳过 .git,递归恢复当前用户属主并补充 Agent 读写权限,保留已有执行位。","permissions.cancel":"取消","permissions.show":"权限与修复","permissions.hide":"收起","permissions.error":"权限操作失败","permissions.summary.ok":"{count} 个根目录检查正常","permissions.summary.warning":"发现 {count} 个根目录异常","permissions.showDetails":"查看详情","permissions.hideDetails":"隐藏详情","permissions.deep":"深度检查","permissions.deepChecking":"扫描中…","permissions.deepSummary":"扫描 {scanned} 项,用时 {duration} ms;目录不可编辑 {directories},文件不可编辑 {files},无法读取 {unreadable}。","backup.title":"备份管理","backup.description":"备份会话、配置与插件 profile 清单,不含 node_modules 与凭据;不自动清理。","backup.create":"创建备份","backup.creating":"创建中…","backup.progress.copy":"正在复制会话数据({current}/{total})…","backup.progress.archive":"正在打包归档({current}/{total})…","backup.progress.validate":"正在校验归档({current}/{total})…","backup.progress.publish":"正在发布备份({current}/{total})…","backup.total":"总体积:{size}","backup.row.version":"备份时 DSH 版本:{version}","backup.empty":"还没有备份。","backup.delete":"删除","backup.confirm":"确认删除","backup.confirmHint":"确认删除这个备份?此操作无法撤销。","backup.cancel":"取消","backup.error":"备份操作失败","backup.export":"导出","backup.exporting":"导出中…","backup.exportError":"备份导出失败","backup.restore":"恢复","backup.inspecting":"检查中…","backup.restoreConfirm":"确认恢复","backup.restoreHint":"完整性检查通过。确认后会按下方计划覆盖数据;提交前宿主会再次检查归档和当前目标是否发生变化。","backup.restoreError":"备份恢复失败","backup.error.restore-files-locked":"恢复失败:目标文件被占用。请退出桌面应用、暂停同步盘或关闭杀毒实时扫描后重试。","backup.error.restore-mapping-invalid":"目标 profile 选择无效,请重新选择。","backup.integrity.ok":"完整性检查通过","backup.integrity.invalid":"归档不可恢复","backup.integrity.summary":"共 {entries} 个条目,解压后 {size};会话文件 {sessions},配置文件 {config},profile 清单 {profiles}。","backup.integrity.format":"归档格式 {format}","backup.integrity.sourceVersion":"备份时 DSH 版本:{version}","backup.format.v1":"v1(不含 Profile 补丁层)","backup.format.v2":"v2(含 Profile 补丁层)","backup.plan.sessions":"会话目录将整体替换","backup.plan.config":"配置覆盖 {replace} 项,移除 {remove} 项","backup.plan.profiles":"覆盖 {count} 个 profile 的 package.json,保留 node_modules 与其他文件","backup.plan.profilePatches":"恢复 {count} 个 profile 的 cordis.patch.yml(Profile 配置层)","backup.plan.profilePatchesAbsent":"该归档来自旧版备份,未包含 Profile 补丁层(cordis.patch.yml):现有配置保持不变,不会被覆盖或删除。","backup.plan.expires":"恢复计划有效至 {time}","backup.plan.mappingHint":"恢复目标 profile:归档里的 profile 内容写入你选择的本机 profile(候选来自本机实际存在的 profile)。","backup.plan.manifest":"同时覆盖插件清单","backup.notice.source-platform-differs":"这份备份来自 {detail},与当前系统不同:会话仍按原工作区路径归类,凭据、附件与 node_modules 不随备份迁移。","backup.notice.target-case-collision":"归档中存在仅大小写不同的路径({detail}),在当前系统上会折叠为同一个目标,可能相互覆盖。","backup.notice.target-path-length":"目标路径最长将达 {detail} 个字符,超过 Windows 经典上限(260),写入可能失败;可启用系统长路径支持或改用更短的工作区路径。","backup.notice.target-sessions-unwritable":"会话目录当前不可写({detail}):可能被其他进程占用或权限不足,恢复可能失败;请关闭占用方(桌面应用、同步盘、杀毒实时扫描)后重试。","backup.manualRestartTitle":"恢复完成,需要手动重启","backup.manualRestartBody":"数据已恢复,但当前进程仍在运行旧状态。请在运行 dsh 的终端按 Ctrl+C,然后重新启动 dsh。","backup.manualRestartTitleDesktop":"恢复完成,需要重启桌面应用","backup.manualRestartBodyDesktop":"数据已恢复,但当前进程仍在运行旧状态。请在桌面端退出应用后重新打开。","backup.error.backup-gzip-invalid":"归档不是有效的 gzip 文件或已损坏。","backup.error.backup-tar-invalid":"tar 结构或校验和无效。","backup.error.backup-entry-traversal":"归档含越界或不安全路径。","backup.error.backup-entry-absolute":"归档含绝对路径。","backup.error.backup-entry-link":"归档含符号链接或硬链接。","backup.error.backup-entry-type":"归档含不支持的特殊条目。","backup.error.backup-entry-platform":"归档包含其他系统不兼容的文件名。","backup.error.backup-entry-unexpected":"归档含备份范围外的文件。","backup.error.backup-profile-invalid":"profile package.json 无效。","backup.error.backup-section-missing":"归档缺少必要分区。","backup.error.backup-size-limit":"归档超过安全大小或条目限制。","backup.error.backup-archive-invalid":"归档未通过完整性检查。","backup.error.backup-archive-incomplete":"归档内容与备份源不一致(有文件未被完整收录),未发布。","backup.error.backup-source-changed":"会话正在写入,备份未完成,请稍后重试。","backup.error.backup-source-unsafe":"备份源含符号链接或特殊文件,已拒绝创建。","backup.error.tar-failed":"归档工具执行失败,请检查 tar/gzip 是否可用。","backup.error.active-work":"检测到运行中的工作,暂不能恢复。","backup.error.restore-plan-expired":"恢复计划已过期,请重新检查。","backup.error.restore-source-changed":"备份归档在确认前发生变化,请重新检查。","backup.error.restore-target-changed":"当前数据在确认前发生变化,请重新检查。","backup.error.restore-target-unsafe":"当前目标含不安全的链接或特殊文件。","backup.import":"导入备份","backup.importing":"导入中…","backup.showRecords":"展开备份记录","backup.hideRecords":"收起备份记录","version.title":"版本信息","version.current":"DSH:","version.plugin":"dsh-service:","version.loading":"加载中…","update.check":"检查更新","update.checking":"检查中…","update.current":"已是最新版本","update.available":"有新版本:{version}","update.installedPendingRestart":"已安装 {version},重启后生效","update.notes.button":"本次更新内容","update.notes.hide":"收起更新内容","update.notes.loading":"正在读取更新内容…","update.notes.empty":"这一版没有填写更新说明。","update.notes.truncated":"(内容过长,仅显示前 {chars} 个字符)","update.notes.publishedAt":"发布于 {date}","update.notes.version":"版本 {version}","update.notes.prerelease":"预发布","update.notes.error.release-not-found":"这一版的发布说明还没上线(版本先发到 npm、release 稍后补上)。","update.notes.retry":"重试","update.notes.error.release-unavailable":"读取更新内容失败,请稍后重试。","update.unavailable":"暂时无法检查最新版本","update.unpublished":"尚未发布可检查版本","health.recheck":"重新诊断","update.upgrade":"升级插件","update.upgrading":"升级中…","update.upgradeError":"插件升级失败","update.upgradeErrorDetail":"插件升级失败({detail})","update.upgradeSuccess":"升级成功,服务重启中…","update.guardActiveWork":"有活动中的会话或后台任务,请处理完毕后再升级","update.guardLinkInstall":"插件通过 link: 安装(开发模式),不能从 registry 一键升级;请更新源码仓库后重启","update.guardFileInstall":"插件通过 file: 安装,不能从 registry 一键升级","update.guardNoNewer":"registry 最新版不高于当前版本,已拒绝可能回退的升级","update.guardNoProfile":"没有找到安装了本插件的 profile,无法定位升级目标","update.guardAmbiguous":"多个 profile 都安装了本插件且无法确定当前加载的副本,已中止","update.guardStale":"命令报告成功但安装版本没有变化(可能被 pnpm 安全等待期拦下),保持当前版本不重启","update.guardUnreadable":"命令成功但无法确认安装后的版本,已中止重启","update.failPnpmMissing":"找不到 pnpm,无法执行升级;请先安装 pnpm 再重试","update.failNetwork":"拉取依赖时网络临时失败,请稍后重试","update.failFetchTimeout":"下载超时(网络较慢或安装包较大),请稍后重试","update.failReleaseAge":"新版本被 pnpm 安全等待期拦截,已自动放行重试仍失败","update.failHoist":"profile 的 node_modules 由不同版本的 pnpm 创建,已重建重试仍失败","update.failAddingToRoot":"pnpm 拒绝在 workspace 根目录安装(缺少 -w)","update.failNotWorkspace":"profile 不是 pnpm workspace 却传入了 -w","update.failIgnoredBuilds":"依赖构建脚本被 pnpm 默认拦截,无法完成升级","env.kind.docker":"Docker 容器","env.kind.container":"容器(containerd/Kubernetes)","env.kind.systemd":"systemd 服务","env.kind.pm2":"pm2","env.kind.supervisord":"supervisord","env.kind.kubernetes":"Kubernetes","env.kind.declared":"外部进程管理器(手动指定)","update.manualConfirmTitle":"升级前请确认:当前疑似手动启动环境","update.manualConfirm":"未检测到进程管理器。升级完成后 DSH 不会自动重启。","update.manualProceed":"仍要升级","update.manualRestartTitle":"升级完成,需要手动重启","update.manualRestartBody":"新版本已安装,但当前进程仍在运行旧版本。请在运行 dsh 的终端窗口按 Ctrl+C(或直接关闭窗口),然后重新启动 dsh。","update.manualRestartTitleDesktop":"升级完成,需要重启桌面应用","update.manualRestartBodyDesktop":"新版本已安装,但当前进程仍在运行旧版本。请在桌面端退出应用后重新打开。","update.desktopManagedUpgrade":"桌面端的插件由应用自己安装:请在桌面端的插件管理页更新本插件(命令行升级在桌面端不可用)。","restart.title":"服务重启","restart.description":"重启 dsh web 进程。运行中的工作会中断,持久化会话可恢复。","restart.button":"重启 dsh web","restart.sending":"发送中…","restart.confirm":"确认重启","restart.force":"仍要重启","restart.cancel":"取消","restart.sent":"重启指令已发出。","restart.sentHint":"页面连接即将断开,服务恢复后将自动刷新。","restart.idleHint":"当前没有检测到运行中的工作。确认后将断开连接,等待服务自动重启。","restart.manualWarn":"当前疑似终端手动启动环境:确认后进程将退出且不会自动拉起,需要你手动重新运行 dsh。","restart.sentManualHint":"当前为手动启动环境,服务不会自动拉起;请在原终端重新运行 dsh 后刷新。","restart.desktopWarn":"当前是 DSH 桌面端:宿主由应用自身托管,确认后进程不会退出,也不会自动重启;请从应用托盘/菜单退出后重新打开应用。","restart.sentDesktopHint":"桌面端由应用自身托管,服务不会自动拉起;请在桌面端退出应用后重新打开。","restart.navToggle":"设置页左列显示「重启」入口","restart.navToggleHint":"默认关闭;开启后在设置页左侧标签列底部显示快捷重启入口","activity.agent":"Agent","activity.job":"后台任务","activity.terminal":"终端","activity.warning":"检测到 {count} 项运行中的工作,重启将中断。","activity.item":"{type}:{label} ({status})","error.update":"检查失败","error.activity":"检查运行状态失败","error.restart":"重启失败","error.instance":"重启响应缺少进程实例标识","usage.title":"模型使用","usage.tooltip.date":"日期:{date}","usage.tooltip.input":"输入 {value} token","usage.tooltip.output":"输出 {value} token","usage.tooltip.cache":"缓存命中 {value} token","usage.tooltip.total":"token 总量 {value}","usage.tooltip.steps":"成功模型步骤 {value} 次","usage.tooltip.hitRate":"缓存命中率 {value}","usage.axis":"token 纵轴","usage.models.more":"展开其余 {count} 个模型","usage.models.less":"收起模型列表","usage.modelScope.today":"今日","usage.modelScope.week":"近 7 天","usage.modelScope.all":"累计","usage.modelSortHint.today":"按今日 token 从多到少排列","usage.modelSortHint.week":"按近 7 天 token 从多到少排列","usage.modelSortHint.all":"按累计 token 从多到少排列","usage.modelBar.today":"{model}:今日 {total} token","usage.modelBar.week":"{model}:近 7 天 {total} token","usage.modelBar.all":"{model}:累计 {total} token","usage.refresh":"刷新统计","usage.refreshing":"刷新中…","usage.empty":"尚未建立使用统计索引。点击刷新统计开始只读建立索引。","usage.error":"无法读取模型使用统计","usage.allProjects":"全部项目","usage.chartSummary":"七天内累计用量 {total} token","usage.barDay":"{day} 总用量 {total} token","usage.total":"token 总量","usage.steps":"成功模型步骤","usage.stepsValue":"{count} 次","usage.modelLine":"{steps}次 · 缓存命中 {hitRate} · 输入 {input} token · 输出 {output} token","usage.input":"输入 token","usage.output":"输出 token","usage.cache":"缓存 token","usage.hitRate":"缓存命中率","usage.today":"今日","usage.sevenDays":"近 7 天","usage.heatmap.title":"每日用量日历","usage.heatmap.gridLabel":"每日 token 用量热力日历","usage.heatmap.cell":"{date}:{total} token · {steps} 次模型步骤","usage.heatmap.hourTitle":"用量打卡图(星期 × 小时)","usage.heatmap.hourGridLabel":"按星期与小时的 token 用量打卡图","usage.heatmap.hourCell":"{weekday} {hour} 时:{total} token · {steps} 次模型步骤","usage.heatmap.scope.day":"每日","usage.heatmap.scope.hour":"小时","usage.heatmap.less":"少","usage.heatmap.more":"多","usage.errors.title":"模型报错","usage.errors.toggle":"模型报错({count} 类)","usage.errors.recent":"最近 48 小时","usage.errors.empty":"最近 48 小时没有记录到模型报错。","usage.toolErrors.title":"工具报错","usage.toolErrors.toggle":"工具报错({count} 类)","usage.toolErrors.empty":"最近 48 小时没有记录到工具报错。","usage.errors.count":"{count} 次","usage.failures.global":"全局会话统计(不受项目筛选影响):成功统计 {successful} 个会话,跳过 {failed} 个会话。","usage.failures.staleHint":"统计结果可能包含无法重新读取会话的旧缓存数据;这些数据已保留但可能过期。","usage.failures.show":"查看跳过会话详情","usage.failures.hide":"收起跳过会话详情","usage.failures.dismiss":"关闭提示(出现新的跳过会话时会再次提示)","usage.failures.id":"会话 ID","usage.failures.code":"错误类型","usage.failures.message":"原因","usage.failures.stale":"保留上次统计(已过期,仍计入总量)","usage.failures.notStale":"无可用缓存,未计入统计","usage.failures.reason.format-migration-failed":"会话格式转换被拒绝。","usage.failures.reason.session-read-failed":"无法打开或读取会话。","usage.failures.reason.session-fold-failed":"无法统计会话事件。","notification.title":"通知","notification.description":"主会话任务结束,或会话需要授权、抉择时发送浏览器通知;子代理完成任务不通知。","notification.enable":"开启通知","notification.enabled":"通知已开启","notification.disable":"关闭通知","notification.denied":"通知权限被拒绝","notification.master":"通知总开关","notification.done":"任务结束通知","notification.input":"授权与提问通知","notification.doneTitle":"任务完成","notification.doneBody":"{title} 已完成本轮任务","notification.inputTitle":"需要你的确认","notification.inputBody":"{title}({kind})","notification.kind.approval":"等待授权","notification.kind.plan-review":"等待审阅计划","notification.kind.question":"等待选择答案","notification.bellOn":"通知开启","notification.bellOff":"通知关闭","notification.bellShow":"显示输入框旁的铃铛图标","quota.cardTitle":"额度查询","quota.navToggle":"设置页左列显示「额度查询」入口","quota.navToggleHint":"开启后在设置页左侧标签显示入口","models.navToggle":"设置页左列显示「模型配置」入口","models.navToggleHint":"开启后在设置页左侧标签显示入口","quota.window.rolling":"滚动 5 小时","quota.window.tokens-limit-u3-n5":"5 小时 Token","quota.window.tokens-limit-u6-n1":"本周 Token","quota.window.tokens-limit":"Token 额度","quota.window.time-limit-u5-n1":"MCP 配额","quota.window.time-limit":"MCP 配额","quota.window.credit-limit":"点数额度","quota.window.credits":"已用额度","quota.window.balance":"余额","quota.window.weekly":"本周","quota.window.monthly":"本月","quota.window.codex-5h":"5 小时","quota.window.codex-day":"本日","quota.window.codex-week":"本周","quota.window.codex-month":"本月","quota.window.gemini-5h":"5 小时","quota.window.gemini-week":"本周","quota.window.claude-5h":"5 小时","quota.window.claude-week":"本周","quota.panel.title":"额度用量","quota.resetCard.more":"另有 {count} 张","quota.resetCard.less":"收起","quota.panel.used":"已用","quota.panel.remaining":"剩余","quota.ring.label":"额度查询","quota.gauge.baseline":"基准满额","quota.gauge.calibrate":"设当前为满额","quota.gauge.calibrateTip":"将当前余额 {amount} 设为 100% 满额基准","quota.gauge.ratio":"余量 {percent}%","quota.filter.showAll":"查看全部额度 ({count})","quota.filter.currentOnly":"仅看当前模型","quota.updated":"更新于 {time}","quota.refreshing":"刷新中…","quota.empty":"暂无数据","quota.resetIn":"重置于 {time}","quota.window.stale":"缓存","quota.window.staleTip":"该账号实时查询失败,显示的是 CPA 上次缓存的快照(非实时值)","quota.family.gemini":"Gemini","quota.family.claude":"Claude","quota.family.codex":"Codex","quota.family.other":"其他","quota.realmCap.edit":"设置每日模型量","quota.realmCap.unit":"M tokens","quota.realmCap.save":"保存","quota.realmCap.reset":"恢复默认","quota.realmCap.invalid":"请填写大于 0 的每日上限(单位 M tokens)","quota.realmCap.hint":"区域油表的分母:达到上限即 100%,超上限时右侧仍显示真实用量。","quota.resetCard.title":"重置卡","quota.resetCard.codexTitle":"Codex 重置卡","quota.resetCard.expires":"{date} 到期","quota.resetCard.expired":"已过期","quota.resetCard.edit":"添加重置卡","quota.advanced":"配置","quota.resetCard.dateLabel":"到期日期","quota.resetCard.nameLabel":"名称(可选)","quota.resetCard.add":"添加","quota.resetCard.cancel":"取消","quota.resetCard.remove":"移除","quota.retryAt":"{time} 后可重试","quota.manualOnly":"自动重试已暂停,请手动重试","quota.refresh":"刷新","quota.refresh.manual":"重试连接","quota.refresh.cooldown":"操作过于频繁,请在 {time} 后再试","quota.reorder":"调整排序与显隐","quota.order.title":"额度卡排序与显隐","quota.order.hint":"可通过拖拽或点击上下箭头调整卡片顺序;关闭开关可隐藏不常用卡片(隐藏只影响展示,不影响查询)。","quota.order.allHidden":"所有已适配卡片都被隐藏了;在「调整排序与显隐」里打开开关即可恢复显示。","quota.usageLink":"打开官网用量页","quota.adapt":"适配","quota.kind.opencode-go":"OpenCode Go","quota.kind.zai-coding-cn":"智谱 GLM Coding Plan","quota.kind.openrouter":"OpenRouter","quota.kind.kimi":"Kimi / Moonshot","quota.kind.siliconflow":"硅基流动","quota.kind.deepseek":"DeepSeek 开放平台","quota.kind.stepfun":"StepFun 余额","quota.kind.stepfun-step-plan":"StepFun Step Plan 订阅","quota.kind.cliproxy":"CLIProxyAPI 账号额度","quota.kind.xiaomi-token-plan-cn":"小米 MiMo Token Plan","quota.kind.command-goat":"Command Code 账号额度","quota.kind.poe":"Poe 积分","quota.kind.clinepass":"ClinePass 套餐额度","quota.kind.vercel-ai-gateway":"Vercel AI Gateway 余额","quota.kind.workbuddy":"workbuddy2api panel 用量","quota.window.points":"剩余积分","quota.window.total_token":"套餐总额度","quota.window.compensation_total_token":"补偿积分","quota.window.plan-name":"订阅套餐","quota.window.credit-pool":"月度 Credit 池","quota.window.topup-credit":"加油包 Credit","quota.window.five-hour":"5 小时额度","quota.window.period-spend":"本周期已用","quota.window.usage-window":"统计窗口","quota.window.requests":"请求数","quota.window.errors":"错误数","quota.window.prompt-tokens":"输入 Token","quota.window.completion-tokens":"输出 Token","quota.window.total-tokens":"总 Token","quota.window.usage-credits":"积分消耗","quota.window.avg-latency":"平均延迟","quota.window.cache-hit-rate":"缓存命中率","quota.window.realm-usage":"区域用量","quota.window.realm-daily-tokens":"每日模型量","quota.window.account-usage":"账号用量","quota.window.limit-models":"限流模型","quota.window.rate-limits":"限流状态","quota.window.account-cooling":"账号限流","quota.part.requests":"请求","quota.part.tokens":"Token","quota.part.credits":"积分","quota.part.credit-balance":"剩余积分","quota.part.reset-at":"重置","quota.part.reason":"原因","quota.error.no-subscription":"当前账号没有生效中的订阅额度","quota.error.credential-rejected":"凭据被上游拒绝,请重新填写(控制台类渠道请重新从浏览器复制登录态)","quota.credential.editCookie":"填写控制台 Cookie(网页登录态)","quota.credential.editToken":"填写控制台令牌(Oasis-Token,浏览器登录态)","quota.kindAuto":"自动识别","quota.noAdapted":"暂无已适配的供应商,可在下方手动适配","quota.disable":"停用查询","quota.followAuto":"跟随自动识别","quota.addAdapt":"手动适配:","quota.addPickProvider":"选择供应商","quota.addPickKind":"选择类型","quota.saveFailed":"保存失败:{error}","quota.unknownProvider":"未知供应商","quota.error.credential-missing":"凭据未配置(请在 DSH 凭据中设置对应 API key)","quota.error.no-base-url":"该供应商未配置 baseURL","quota.error.credentials-unavailable":"凭据服务不可用","quota.error.http-status":"上游返回错误状态","quota.error.network":"网络错误","quota.error.network-transient":"网络不稳定(已自动重试)","quota.error.timeout":"请求超时","quota.error.bad-payload":"响应格式异常","quota.error.mgmt-disabled":"CLIProxyAPI 管理面未启用(remote-management secret-key 为空或未开启 allow-remote-management)","quota.error.mgmt-banned":"已被 CLIProxyAPI 暂时封禁(连续认证失败触发 fail2ban,请等待或更换出口 IP)","quota.error.host-not-pinned":"baseURL 与适配时记录的域名不一致,请重新保存适配","quota.error.upstream-status":"上游官方接口返回错误状态","quota.error.upstream-error":"上游服务故障(额度接口报错,稍后自动重试)","quota.credential.edit":"填写 API 密钥","quota.credential.editExisting":"修改凭据(已配置)","quota.credential.editManagement":"填写管理密钥(网页登录的 key)","quota.credential.nameLabel":"凭据名称","quota.credential.valueLabel":"密钥值","quota.credential.save":"保存","quota.credential.primary":"主名(别名存一即可)","quota.credential.clear":"清除已存","quota.credential.clearConfirm":"再次点击清除","quota.credential.configured":"已配置","quota.credential.notConfigured":"未配置","quota.credential.saveFailed":"凭据保存失败:{error}","quota.credential.unknown-hint":"未知凭据名","quota.credential.invalid-value":"密钥值不能为空","quota.credential.credentials-unavailable":"凭据服务不可用","quota.error.unknown":"未知错误","quota.unadapted":"该供应商未适配,请先在下方选择类型","quota.unit.day":"{count} 天","quota.unit.hour":"{count} 小时","quota.unit.minute":"{count} 分钟","quota.window.granted-balance":"赠送余额(未过期)","quota.peak.nowIdle":"当前空闲时段 · 半价计费","quota.peak.nowPeak":"当前高峰时段 · 标准价","quota.peak.untilIdle":"{time} 转空闲({dur}后)","quota.peak.untilPeak":"{time} 转高峰({dur}后)","quota.peak.tag.peak":"忙时","quota.peak.tag.idle":"闲时","quota.peak.caption":"空闲时段价格为高峰时段价格的一半。高峰时段:北京时间周一至周五(不含中国法定节假日)09:00–12:00、14:00–18:00;其余时段,包括周末及中国法定节假日全天均为空闲时段。","quota.peak.caption.degraded":"暂未收录 {year} 年的中国法定节假日安排,本年度按「周一至周五 09:00–12:00、14:00–18:00」估算,节假日期内可能显示为高峰;更新插件后即可自动收录当年安排。","quota.peak.caption.zai":"非高峰时段模型调用按基础积分的 50% 抵扣。高峰时段:每周一至周五 14:00–18:00(UTC+8);其余时间为非高峰时段,周六和周日全天空闲。","features.fileEditor":"右栏文件编辑","features.modelProviderIcons":"模型厂家图标","editor.viewer":"编辑","editor.loading":"正在读取文件…","editor.preview":"预览","editor.save":"保存","editor.saving":"保存中…","editor.saved":"已保存","editor.unsaved":"未保存","editor.reload":"重新加载","editor.undo":"撤销保存","editor.keyHint":"Ctrl/Cmd + S 保存","editor.conflict.title":"磁盘内容已变化,保存被拒绝","editor.conflict.body":"文件在打开后被其他改动覆盖(Agent 或其他窗口写入)。重新加载会丢弃你的修改,覆盖会把当前编辑内容直接写盘。","editor.conflict.reload":"重新加载(丢弃修改)","editor.conflict.overwrite":"用我的内容覆盖","editor.confirm.previewTitle":"返回预览","editor.confirm.previewBody":"有未保存的修改,返回官方预览将丢弃这些修改。","editor.confirm.saveBack":"保存并返回","editor.confirm.discardBack":"丢弃并返回","editor.confirm.reloadTitle":"重新加载","editor.confirm.reloadBody":"有未保存的修改,重新加载将丢弃这些修改并读取磁盘当前内容。","editor.confirm.reloadGo":"丢弃并重新加载","editor.confirm.undoTitle":"撤销保存","editor.confirm.undoBody":"将把文件恢复为本次保存之前的内容;未保存的修改会一并丢弃。","editor.confirm.cancel":"继续编辑","editor.undoConflict.title":"无法自动撤销","editor.undoConflict.body":"磁盘内容在本次保存之后又发生了变化,不能自动恢复为保存前内容;可重新加载查看当前内容。","editor.undoConflict.dismiss":"关闭","editor.readonlyHint":"只读","editor.retry":"重试","editor.error.file-not-found":"文件不存在(可能已被移动或删除)。","editor.error.not-regular-file":"这不是普通文件,无法编辑。","editor.error.too-large":"文件超过 {limit},右栏编辑器只读:请用其他预览器查看。","editor.error.binary-file":"不是 UTF-8 文本文件,右栏编辑器无法编辑。","editor.error.session-not-live":"该会话当前未激活,无法编辑(可切换到其他预览器查看)。","editor.error.file-forbidden":"当前会话的沙箱策略不允许写入这个文件。","editor.error.unavailable":"宿主文件服务不可用,暂时无法编辑。","editor.error.invalid-address":"文件地址无法识别,无法编辑。","editor.error.file-stale":"磁盘内容已变化,请重新加载后再保存。","editor.error.file-failed":"读写失败,请重试。","editor.error.feature-disabled":"「右栏文件编辑」已在插件配置里关闭。","editor.error.internal":"操作失败,请重试。"},Q={"nav.label":"Service Control","nav.restart":"Restart","settingsEntry.label":"Settings","features.cardTitle":"Service control (dsh-service)","features.cardHint":"Controls optional features and external capabilities. Switches apply instantly without restart.","features.external":"External capabilities","features.healthDiagnostics":"Health diagnostics","features.modelUsage":"Model statistics","features.quotaLookup":"Quota lookup","features.backupMaintenance":"Backup maintenance","features.taskNotifications":"Task notifications","features.healthz":"/healthz liveness endpoint","features.skillManager":"Skill manager","features.readOnly":"These settings are read-only.","tabs.skills":"Skills","tabs.subagent":"Subagents","tabs.sessions":"Sessions","features.subagentRoute":"Subagent model","features.mobileAdaptation":"Mobile adaptation","features.sessionManager":"Session manager","sessions.title":"Session manager","sessions.filter.all":"All","sessions.filter.archived":"Archived","sessions.filter.deleted":"Deleted","sessions.filter.subagent":"Subagents only","sessions.refresh":"Refresh","sessions.batch.enter":"Select multiple","sessions.batch.exit":"Exit selection","sessions.batch.selectAll":"Select all","sessions.batch.clearAll":"Clear all","sessions.batch.selectSubagents":"Select subagents","sessions.batch.selected":"{count} selected","sessions.batch.selectRow":"Select session: {title}","sessions.batch.export":"Export ({count})","sessions.batch.archive":"Archive ({count})","sessions.batch.unarchive":"Unarchive ({count})","sessions.batch.delete":"Delete ({count})","sessions.batch.clear":"Clear ({count})","sessions.batch.completed":"{action} completed for {count}","sessions.batch.failed":"{action} completed for {done}/{total}; {error}","sessions.batch.deleteTitle":"Delete {count} sessions","sessions.batch.deleteBody":"This permanently deletes the logs of the archived sessions below. This cannot be undone.","sessions.batch.deleteItem":"{title} ({bytes})","sessions.batch.clearTitle":"Clear {count} deleted records","sessions.batch.clearBody":"Are you sure you want to clear the following {count} deleted records? They will be permanently removed from the record list.","sessions.status.loading":"Loading…","sessions.status.working":"Working…","sessions.status.unavailableTime":"Time unavailable","sessions.glyph.expand":"▸","sessions.glyph.collapse":"▾","sessions.glyph.back":"←","sessions.search.placeholder":"Search conversation content…","sessions.search.archivedOnly":"Search archived only","sessions.sort.createdDesc":"Created (newest first)","sessions.sort.createdAsc":"Created (oldest first)","sessions.sort.title":"By title","sessions.sort.project":"By project","sessions.projectGroup.countOne":"1 session","sessions.projectGroup.countMany":"{count} sessions","sessions.projectGroup.noCwd":"(no workspace)","sessions.row.live":"Running","sessions.row.archived":"Archived","sessions.row.deleted":"Deleted","sessions.row.subagent":"Subagent","sessions.subagent.hostLegacy":"The plugin host is outdated and the list carries no subagent flags; upgrade the plugin and restart dsh for “Subagents only” to take effect","sessions.row.events":"{count} events","sessions.row.noTitle":"(No title)","sessions.action.view":"View","sessions.action.export":"Export","sessions.action.archive":"Archive","sessions.action.unarchive":"Unarchive","sessions.action.delete":"Delete","sessions.action.clear":"Clear","sessions.empty.all":"No sessions","sessions.empty.archived":"No archived sessions","sessions.empty.deleted":"No deleted sessions yet","sessions.empty.search":"No matches for “{query}”","sessions.error.load":"Load failed: {error}","sessions.error.feature-disabled":"Session manager is disabled in settings","sessions.error.network":"Network error: cannot reach the host","sessions.error.session-not-found":"Session not found or already deleted","sessions.error.live-session-rejected":"Session is running and cannot be deleted","sessions.error.session-not-archived":"Only archived sessions can be deleted","sessions.error.unknown-delete-plan":"Delete request expired, please retry","sessions.error.invalid-session-ids":"Invalid session IDs","sessions.error.unarchive-unsupported":"Unarchiving is not supported by current host (requires DSH ≥ 0.1.6)","sessions.error.export-failed":"Export failed: {error}","sessions.detail.back":"Back to list","sessions.detail.open":"Open in official view","sessions.detail.archiveDisabled":"Archived or blank sessions cannot be opened in the official view","sessions.detail.exportAll":"Export full ZIP","sessions.detail.exporting":"Exporting…","sessions.detail.loadMore":"Load more ({remaining})","sessions.detail.noMore":"All {total} events loaded","sessions.detail.noise":"System events","sessions.detail.noiseBlock":"{count} system events","sessions.detail.noiseExpand":"Expand all","sessions.detail.noiseCollapse":"Collapse","sessions.detail.toolBlock":"{count} tool messages","sessions.detail.toolCollapse":"Collapse","sessions.detail.cwd":"{cwd}","sessions.detail.created":"Created {time}","sessions.md.copy":"Copy","sessions.md.copied":"Copied","sessions.md.footnotes":"Footnotes","sessions.hit.title":"{count} hits","sessions.hit.return":"Back to search results","sessions.hit.badge":"HIT","sessions.hit.prev":"◀ Prev","sessions.hit.next":"Next ▶","sessions.hit.inSession":"{count} matches in this session","sessions.delete.title":"Delete session","sessions.delete.body":"This permanently deletes the session log below. This cannot be undone.","sessions.delete.consequence.log":"Delete session log ({bytes})","sessions.delete.consequence.sidebar":"Session disappears from the official sidebar","sessions.delete.confirm":"Delete","sessions.delete.cancel":"Cancel","sessions.delete.done":"Deleted","sessions.clear.title":"Clear deleted record","sessions.clear.body":"Are you sure you want to clear this deleted record? It will be permanently removed from the record list.","sessions.clear.confirm":"Clear","sessions.clear.cancel":"Cancel","sessions.export.includes":"Includes subagents and attachments","sessions.navToggle":"Show “Sessions” entry in the settings sidebar","sessions.oneWay":"Archiving cannot be undone","sessions.oneWayHint":"Archived sessions are hidden from the official sidebar; the official UI cannot unarchive, deletion here is the only way out.","mobile.fab.label":"Open sidebar menu","mobile.debug.title":"Mobile diagnostics","mobile.debug.viewport":"Viewport","mobile.debug.drawer":"Drawer","mobile.debug.sidebarPanel":"Side panel","mobile.debug.details":"Details","mobile.debug.rightbar":"Rightbar","mobile.debug.errors":"JS errors","mobile.debug.stateOn":"on","mobile.debug.stateOff":"off","mobile.debug.immersive":"Immersive","mobile.debug.immersive.reason.gesture":"swipe","mobile.debug.immersive.reason.arrival":"arrival","mobile.debug.immersive.reason.focus":"focus","mobile.debug.immersive.reason.button":"to-bottom","mobile.debug.edge":"Edge","mobile.debug.edge.fieldStart":"start","mobile.debug.edge.fieldMoves":"moves","mobile.debug.edge.fieldLast":"last","mobile.debug.edge.fieldCancel":"cancel","mobile.debug.edge.fieldReason":"reason","mobile.debug.edge.open":"open","mobile.debug.edge.leftOpen":"open L","mobile.debug.edge.rightOpen":"open R","mobile.debug.edge.leftClose":"close L","mobile.debug.edge.rightClose":"close R","mobile.debug.edge.reason.multiTouch":"multi-touch","mobile.debug.edge.reason.modal":"modal","mobile.debug.edge.reason.hScroll":"h-scroll","mobile.debug.edge.reason.noPoint":"no point","mobile.debug.edge.reason.absentRight":"right sidebar absent","mobile.debug.edge.reason.badButton":"right sidebar toggle unavailable","mobile.debug.edge.reason.noTracker":"no tracker","conversation.jump.previousReply":"Previous user message","subagent.title":"Subagent model","subagent.loading":"Reading configuration…","subagent.hint":'Controls the model used by subagents without an explicit model; explicitly specified ones are unaffected. Switching modes keeps the saved custom model and fallback list; switch back to "Custom" to reuse them.',"subagent.mode.label":"Mode","subagent.mode.inherit":"Default (no override)","subagent.mode.inherit.desc":"Injects nothing and keeps the native inheritance: subagents use the model baked in when the session was created.","subagent.mode.follow":"Follow main model","subagent.mode.follow.desc":"Each delegation reads the model the main conversation actually uses right now (route of its latest request) and injects it.","subagent.mode.custom":"Custom","subagent.mode.custom.desc":"Every delegation without an explicit model uses the model selected below.","subagent.preset":"Agent preset","subagent.preset.inherit":"Inherit parent (default)","subagent.preset.desc":"Gives every spawned subagent one independent Agent preset (role and tools together); leave empty to follow the parent preset. An explicitly specified preset wins, and only delegation backends that support independent presets are affected.","subagent.preset.empty":"The host exposes no preset list (requires a 0.2.1-alpha.3+ host).","subagent.provider":"Provider","subagent.model":"Model","subagent.reasoningEffort":"Reasoning effort","subagent.reasoningEffort.default":"Use model default (unspecified)","subagent.reasoningEffort.unavailable":"This model does not declare selectable reasoning levels","subagent.modelsEmpty":"Model list is empty: host LLM channels cannot be resolved.","subagent.save":"Save","subagent.saved":"Saved","subagent.reset":"Reset to default","subagent.saving":"Saving…","subagent.unavailable":"The host exposes no subagents registry (service missing); this configuration has no effect.","subagent.error":"Operation failed: {error}","subagent.error.feature-disabled":"Subagent model is switched off in settings","subagent.error.llm-unavailable":"Host LLM service is unavailable","subagent.error.unknown-mode":"Unknown mode","subagent.error.invalid-model-route":"Provider or model is not in the host catalog","subagent.error.invalid-reasoning-effort":"This reasoning effort is not supported by the selected model; choose another","subagent.error.network":"Network error: cannot reach the host","subagent.fallback.title":"Fallback models (in order)","subagent.fallback.item":"Fallback {index}","subagent.fallback.hint":"When the primary route is unavailable (channel unloaded, or quota state marks it unserviceable), try fallbacks in order; if none works, fall back to native inheritance instead of failing the delegation.","subagent.fallback.add":"Add fallback","subagent.fallback.sort":"Reorder","subagent.fallback.sort.done":"Done","subagent.fallback.remove":"Remove","subagent.fallback.up":"Move up","subagent.fallback.down":"Move down","subagent.fallback.empty":"No fallbacks: delegations fall back to native inheritance when the primary route is unavailable.","subagent.fallback.limit":"Limit reached ({max})","subagent.error.invalid-fallback-route":"Fallback entry is not in the host catalog, please choose again","subagent.dock.label":"Subagents: ","subagent.dock.title":"Show subagent info under the composer","skills.error":"Operation failed: {error}","skills.error.feature-disabled":"Skill manager is switched off in settings","skills.error.network":"Network error, try again later","skills.error.read-only-source":"This entry lives in a read-only source","skills.error.unknown-skill":"Skill not found; the list may have changed, refresh and retry","skills.error.invalid-skill":"Entry is currently invalid: {reason}","skills.error.invalid-field":"Invalid switch field","skills.error.invalid-enable":"Invalid switch value","skills.error.invalid-model-route":"Invalid model route; pick a model again","skills.error.invalid-description":"Description cannot be empty","skills.error.describe-timeout":"Model generation timed out (90s)","skills.error.empty-output":"Model produced no body output (finish: {kind})","skills.error.batch-cancelled":"Cancelled","skills.error.entry-changed":"Entry changed during the run; skipped","skills.error.unknown-batch-plan":"Batch plan is stale; regenerate it","skills.error.batch-already-done":"That batch already finished","skills.error.batch-already-cancelled":"That batch was already cancelled","skills.error.annotated-confirm-required":"Annotated skills need an explicit confirm before being overwritten","skills.empty":"No skills found","skills.filter":"Filter by name…","skills.expandAll":"Expand all","skills.collapseAll":"Collapse all","skills.colon":": ","skills.group.auto":"Auto-loaded","skills.group.manual":"Manual only","skills.group.disabled":"Fully disabled","skills.source.project-dsh":"Project .dsh","skills.source.project-agents":"Project .agents","skills.source.user-dsh":"User DSH","skills.source.user-agents":"User .agents","skills.source.bundled":"Bundled","skills.source.custom":"Custom dir","skills.badge.shadowed":"Shadowed","skills.badge.readonly":"Read-only","skills.badge.annotated":"Annotated","skills.note.stale":"Body changed; refill needed","skills.note.remove":"Remove AI note","skills.note.panelOnly":"Notes are stored and shown in this panel only; SKILL.md is never modified.","skills.log.title":"Run log","skills.log.located":"Located skill {name} ({chars} chars)","skills.log.attempt":"Attempt {n}/{total}: calling {route}","skills.log.received":"Output received ({chars} chars), parsing JSON…","skills.log.parsed":"Parsed OK, draft ready","skills.log.failed-retry":"Failed: {message}, retrying","skills.log.failed":"Failed: {message}","skills.log.wait":"Waiting for model output… {secs}s","skills.log.first-delta":"Model started returning","skills.log.first-reasoning":"Model started returning (reasoning first)","skills.log.progress":"Received {chars} chars","skills.log.finish-reasoning-only":"Finished: {kind} (only {chars} reasoning chars, no body)","skills.log.finish-empty":"Finished: {kind} (no output)","skills.log.block-extract":"Extracted body from whole block ({chars} chars)","skills.log.item-start":"Generating note…","skills.batch.toggle":"Batch annotate","skills.batch.collapse":"Collapse","skills.batch.already":"A batch is already running; wait for it or cancel first","skills.invalid.legacy":"Legacy invocation keys present; excluded from the model catalog","skills.invalid.other":"Invalid entry: {reason}","skills.fix.legacy":"Fix legacy keys","skills.switch.model":"Visible to model","skills.switch.user":"Invocable via /","skills.switch.confirm":"Click again to apply","skills.describe.button":"Fill with AI","skills.describe.title":"Fill metadata with AI — {name}","skills.describe.model":"Model","skills.describe.models.loading":"Loading models…","skills.describe.models.empty":"No configured models found","skills.describe.run":"Generate draft","skills.describe.running":"Generating…","skills.apply.title":"Save AI note — {name}","skills.apply.description":"Description","skills.apply.usage":"Usage","skills.apply.old":"Old","skills.apply.new":"New","skills.apply.confirm":"Save note","skills.apply.done":"Note saved","skills.apply.keepusage":"(keep existing)","skills.llm.unavailable":"Host LLM service unavailable; AI fill disabled.","skills.batch.title":"Batch-fill skill descriptions","skills.batch.hint":"Call the selected model per skill to draft explanations for uncommented or changed skills; annotated skills are listed separately and are only overwritten after an explicit confirm. Results stay in the plugin and render below the entry.","skills.batch.plan":"Plan batch","skills.batch.candidates":"{count} candidates","skills.batch.estBytes":"~{size} of content will be sent","skills.batch.skipped":"{count} skipped (invalid / shadowed)","skills.batch.annotated":"{count} annotated will be overwritten","skills.batch.annotatedList":"To be overwritten","skills.batch.forceConfirm":"Confirm forced refill ({count} annotated)","skills.skippedList":"Skipped","skills.skip.shadowed":"shadowed","skills.skip.invalid":"invalid ({reason})","skills.skip.reason.missing-frontmatter":"no frontmatter","skills.skip.reason.missing-name":"missing name","skills.skip.reason.invalid-name":"invalid name","skills.skip.reason.missing-description":"missing description","skills.skip.reason.too-large":"file too large","skills.skip.reason.legacy-invocation-key":"legacy invocation keys","skills.batch.start":"Start batch","skills.batch.progress":"Progress {done}/{total}","skills.batch.current":"Current: {name}","skills.batch.cancel":"Cancel","skills.batch.phase.idle":"Idle","skills.batch.phase.planned":"Planned — review candidates, then press Start","skills.batch.phase.running":"Running","skills.batch.phase.done":"Done","skills.batch.phase.cancelled":"Cancelled","skills.batch.failures":"{count} failed","skills.batch.no-candidates":"Nothing to fill","skills.batch.model":"Model","overlay.label":"Service restart status","recovery.waiting.title":"Restarting service…","recovery.waiting.body":"Waiting for a new DSH Web process. Elapsed: {seconds} seconds.","recovery.timeout.title":"Service has not recovered","recovery.timeout.body":"Waited 60 seconds. Check the external process manager, or refresh the page manually.","recovery.manual":"Manual reload","health.title":"Health","health.uptime":"Uptime","health.rss":"Memory RSS","health.platform":"Platform","health.nodeVersion":"Node version","health.liveSessions":"Live sessions","health.persistedSessions":"Persisted sessions","health.activeAgents":"Active agents","health.activeJobs":"Background jobs","health.uptimeValue":"{hours} h {minutes} min","health.error":"Could not read health metrics","health.check":"Run health check","health.checking":"Checking…","health.overall.ok":"Healthy","health.overall.warning":"Warning","health.overall.error":"Error","health.alert.title":"Health alert","health.alert.diagnostics":"The health check reported {status}. Review the affected items below.","health.status.ok":"Healthy","health.status.warning":"Warning","health.status.error":"Error","health.status.info":"Info","health.check.session-storage":"Session storage","health.check.workspace-registry":"Workspace registry","health.check.dsh-home":"DSH_HOME","health.check.backup-storage":"Backup storage","health.check.tar":"tar","health.check.permissions":"File permissions","health.check.runtime-env":"Runtime environment","health.check.node-version":"Node runtime","health.detail.runtime-env.managed":"Managed by {kind}; the process restarts automatically after exit","health.detail.runtime-env.declared":"Declared externally managed via DSH_SERVICE_RUNTIME_ENV","health.detail.runtime-env.manual":"Likely a manual terminal launch — nothing restarts the process after exit; one-click upgrade already keeps it running","health.detail.runtime-env.unknown":"No process manager detected, so automatic restart cannot be confirmed; set DSH_SERVICE_RUNTIME_ENV=managed if one exists","health.detail.runtime-env.desktop":"Managed by DSH Desktop (Electron); restarting is the app's job — quit it from the tray/menu and open it again","health.detail.node-version.ok":"{version}, meets the >={required} requirement","health.detail.node-version.warning":"{version} is below the required {required}.x; upgrading Node is recommended","health.detail.session-storage.ok":"Available, with {count} session snapshots","health.detail.workspace-registry.ok":"Available, with {count} workspaces","health.detail.dsh-home.ok":"Directory is accessible with mode {mode}","health.detail.backup-storage.empty":"Backup directory is available; no backups exist yet","health.detail.backup-storage.ok":"Backup directory is available, with {count} backups using {size}","health.detail.tar.ok":"The tar executable is available","health.detail.permissions.ok":"Permission check passed with no anomalies","health.detail.permissions.warning":"Found {count} file or directory permission anomalies","health.detail.generic":"{status}","health.check.usage-index":"Usage index","health.detail.usage-index.never":"No usage index yet; open the Model usage page to build it read-only","health.detail.usage-index.unavailable":"The usage index could not be read","health.detail.usage-index.ok":"{indexed} sessions indexed, updated {updated}","health.detail.usage-index.info":"{failed} session(s) could not be indexed (usage is undercounted); {indexed} indexed, updated {updated}","health.detail.usage-index.warning":"{failed} session(s) could not be indexed (usage is undercounted); {indexed} indexed, updated {updated}","health.check.notification-permission":"Notification permission","health.detail.notification-permission.granted":"The browser is allowed to show system notifications","health.detail.notification-permission.default":"The browser has not granted system notifications yet; enable them under Configuration → Notifications","health.detail.notification-permission.denied":"The browser blocked system notifications; restore them in the site settings","health.detail.notification-permission.unsupported":"This browser does not support system notifications","health.check.plugins":"Plugins","health.detail.plugins.unavailable":"Plugin health check unavailable (host loader is not exposed)","health.detail.plugins.ok":"{total} plugins healthy","plugin.issue.failed":"{failed} failed plugin(s)","plugin.issue.pending":"{pending} pending plugin(s)","plugin.issue.info":"{count} plugin state(s) need review","plugin.state.pending":"Waiting","plugin.state.loading":"Loading","plugin.state.failed":"Failed","plugin.state.disposed":"Disposed","plugin.state.unknown":"Unknown state","plugin.state.unloading":"Unloading","plugin.missingDeps":"Missing deps: {deps}","plugin.error":"Error: {error}","plugin.restart":"Reload","plugin.restarting":"Reloading…","plugin.restartConfirm":"Confirm reload","plugin.restartHint":'Reloading "{name}" re-runs its startup logic; the failure state refreshes afterwards.',"plugin.restartCancel":"Cancel","plugin.restartFailed":"Reload failed: {detail}","plugin.error.unknown-plugin":"Plugin not found","plugin.error.loader-unavailable":"Host loader unavailable","plugin.error.plugin-disabled":"The plugin is disabled and cannot be reloaded","plugin.error.not-failed":"The plugin is not in a failed state","plugin.error.restart-failed":"Still failed after reload","tabs.overview":"Overview","tabs.notify":"Notifications","tabs.health":"Health","tabs.usage":"Models","tabs.quota":"Quota lookup","overview.container":"Process and runtime","overview.errors":"Errors","overview.status.normal":"All systems nominal","overview.status.info":"You have {count} note(s)","overview.status.warning":"You have {count} item(s) to review","overview.status.error":"You have {count} item(s) needing attention","overview.backupEmpty":"No backups yet — consider creating one","overview.updateAvailable":"A new version is available","tabs.backup":"Backup","tabs.restart":"Restart","tabs.maintenance":"Maintenance","tabs.configuration":"Configuration","tabs.models":"Models","page.models.desc":"Provider workbench: status overview, per-provider check → suggest → apply → verify, and persistent undo; any public HTTPS relay can be checked safely.","features.modelCatalog":"Model catalog","models.time.justNow":"just now","models.time.minAgo":"{n} min ago","models.time.hourAgo":"{n} h ago","models.security.title":"Security & data notes","models.security.urlTitle":"How URLs are used","models.security.urlBody":'"Check & fix" requests {baseURL}/models once, only when you click it. Any public HTTPS address can be checked, but the plugin validates it first (HTTPS only, default port 443 only, private and reserved ranges refused, DNS resolved and pinned for the direct connection) and refuses the request when validation fails. Non-public addresses still work when saved; the plugin just never checks them online.',"models.security.keyTitle":"How API keys are stored","models.security.keyBody":"The plugin never reads, echoes, or logs your key. A check authorizes the stored credential only when you explicitly click, and sends it only to the route's current address. Credential actions are never undoable and never enter undo snapshots.","models.security.revertTitle":"How config is reverted","models.security.revertBody":"Writes only touch the llm-pi-ai section of settings.yaml: field-level preview → two-step confirmation → a full pre-write snapshot (without keys) persisted locally, undoable anytime. Data failing validation is rejected as a whole.","models.routes.title":"Providers","models.wb.empty":"No providers yet: create a custom provider on the official Settings → Models page (or enable a built-in channel), then manage it here.","models.wb.modelCount":"{n} models","models.wb.meta":"Capacity {ctx} · Vision {vision} · Reasoning {reasoning}","models.wb.neverValidated":"never validated","models.wb.lastValidated":"validated {time}","models.wb.validationFailed":"last validation failed","models.wb.undoAvailable":"undo available","models.wb.builtin":"built-in channel","models.wb.builtinUser":"Official built-in","models.wb.seeImage":"Vision","models.wb.canThink":"Thinking","models.wb.attention.dangling":"Credential is not configured","models.wb.attention.danglingHint":"This provider declares a key reference but no matching key exists locally. Fill it in on Settings → Models, or clear the reference.","models.wb.attention.validation":"Last validation failed","models.wb.attention.validationHint":"The last validation did not pass. Open the provider and re-run validation to see which check failed.","models.wb.attention.recovery":"Manual recovery pending","models.wb.attention.recoveryHint":"A previous write failed midway; automatic writes are blocked until recovered manually on the official settings page.","models.wb.attention.invalid":"Invalid configuration structure","models.wb.attention.invalidHint":"Some model fields cannot be persisted. Check model parameters (positive context/output, valid thinking levels).","models.wb.detail.todos":"This provider has {n} items to address","models.wb.legend":"Legend: Official built-in = a DSH-provided channel · Vision = image input support · Thinking = thinking levels support · Dotted underline text = an item to address (hover for the reason)","models.wb.needsAttention":"Needs attention","models.wb.checkFix":"Check & fix","models.wb.undoWrite":"Undo last write","models.wb.phase.inspect":"Check","models.wb.phase.suggest":"Suggest","models.wb.phase.apply":"Apply","models.wb.phase.verify":"Verify","models.wb.task.title":"Check & fix ({route})","models.wb.task.back":"Back to list","models.wb.check.busy":"Checking…","models.wb.check.start":"Start check","models.wb.check.recheck":"Re-check","models.wb.check.notProbed":"Gateway not probed (fetch addable models on demand)","models.wb.check.fetchAdditions":"Fetch addable models","models.wb.check.ok":"Gateway returned {n} models","models.wb.check.failed":"Gateway check failed: {error}","models.wb.check.unsupported":"Online listing is unsupported for this protocol; skipped","models.wb.check.insecure":"The address is not a public HTTPS URL; online check refused","models.wb.check.private":"The address resolves to a private/reserved range; online check refused","models.wb.check.ipliteral":"The address is an IP literal; online check refused","models.wb.check.dns":"DNS resolution failed","models.wb.check.credential":"Stored credential authorized (sent only to this route's current address)","models.wb.check.anon":"Anonymous check (no stored credential found)","models.wb.reasoning":"Thinking","models.wb.add.online":"Fetch online","models.wb.add.manual":"Enter manually","models.wb.add.choose":"Choose a model…","models.wb.add.detect":"Detect model","models.wb.add.detected":"Detected","models.wb.add.prepare":"Prepare add","models.wb.add.unverified":"Detection failed; add unverified","models.wb.add.unverifiedReason":"Detection failed: {error}","models.wb.add.unverifiedHelp":"This model did not pass runtime validation (no catalog record or resolution failed). You may still add it; call failures are on you.","models.wb.add.probeName":"Name","models.wb.add.probeContext":"Context","models.wb.add.probeMax":"Max output","models.wb.add.probeModel":"Model id: {id}","models.wb.add.detectHint":"Type a model id then press Detect or Enter.","models.wb.verifyOnline":"Verify online","models.wb.verifyOnline.busy":"Querying model profile…","models.wb.verifyOnline.title":"Model profile check ({model})","models.wb.verifyOnline.source":"Source: {name}","models.wb.verifyOnline.open":"View model page","models.wb.verifyOnline.noMatch":"No related parameters found","models.wb.verifyOnline.notFound":"Model not found in the OpenRouter catalog","models.wb.verifyOnline.error":"Query failed: {error}","models.wb.verifyOnline.note":"Results are reference only; nothing is written automatically.","models.wb.add.allowUnverified":"Add unverified anyway","models.wb.add.confirmSummary":"Only Image/thinking/capacity settings will be saved; other advanced fields stay unchanged.","models.wb.add.commit":"Confirm add","models.wb.detail.models":"Configured models","models.wb.detail.expand":"Expand params","models.wb.detail.collapse":"Collapse params","models.wb.detail.context":"Context window","models.wb.detail.maxTokens":"Max output","models.wb.detail.image":"Image input","models.wb.detail.imageState.yes":"Supported","models.wb.detail.imageState.no":"Not supported","models.wb.detail.imageState.detected":"Follow detection","models.wb.detail.thinking":"Thinking","models.wb.detail.thinkingState.yes":"Supported","models.wb.detail.thinkingState.no":"Not supported","models.wb.detail.thinkingState.detected":"Follow detection","models.wb.detail.thinkingState.follow":"Follow default","models.wb.detail.apply":"Apply changes","models.wb.detail.finalConfirm":"Final confirm","models.wb.detail.changeSummary":"{changes} field changes · {added} added · {removed} removed","models.wb.detail.advice":"Suggestion","models.wb.detail.useAdvice":"Apply suggestion","models.wb.detail.noAdvice":"No suggestion","models.wb.detail.adviceSource":"From {source}","models.wb.detail.runtime":"runtime","models.wb.detail.split":"Sources disagree, pick one","models.wb.detail.hitCount":"{count} sources agree on this value ({total} sources total)","models.wb.detail.othersCount":"{n} more distinct values","models.wb.detail.empty":"This provider has no configured models yet.","models.wb.detail.saved":"Applied and live","models.wb.detail.notice":"Needs attention","models.wb.detail.recheck":"The plugin re-validates the parameters again after the final confirm.","models.wb.chip.safeFill":"fills","models.wb.chip.conflict":"conflicts","models.wb.chip.addition":"additions","models.wb.chip.unknown":"unrecognized","models.wb.group.safeFill":"Safe fills (missing fields; high confidence pre-checked)","models.wb.group.conflict":"Conflicts (config differs from catalogs; unchecked by default)","models.wb.group.addition":"Addable models (new from gateway/catalogs; unchecked by default)","models.wb.group.unknown":"Unrecognized models (kept; never auto-removed)","models.wb.group.more":"Show all ({n})","models.wb.group.less":"Collapse","models.wb.selectRow":"All","models.wb.clearRow":"None","models.wb.filter":"Filter models…","models.wb.selected":"{n} selected","models.wb.confidence.low":"needs confirm","models.wb.inexpressible":"includes {n} values DSH cannot express","models.wb.unknownRow":"Unrecognized: absent from the gateway listing and catalogs; kept as-is","models.wb.suggestEmpty":"Nothing to do: the configuration already matches the gateway and catalogs.","models.wb.prepare":"Prepare apply","models.wb.apply.title":"Apply preview","models.wb.apply.summary":"{changes} field changes · {added} added · {removed} removed","models.wb.apply.noCredentialOps":"Credentials & keys: not involved in this plan.","models.wb.apply.empty":"Empty plan: nothing to write.","models.wb.apply.confirm":"Confirm apply","models.wb.apply.back":"Back to edits","models.wb.applied":"Applied {n} items; the write took effect immediately","models.wb.conflict":"The configuration changed after the plan was generated; the write was refused to avoid overwriting. Re-check and retry.","models.wb.undo.title":"Undo preview ({route})","models.wb.undo.at":"written {time}","models.wb.undo.restorable":"{n} fields to restore:","models.wb.undo.restoreField":"{model} · {field}: restore to {value}","models.wb.undo.removeField":"{model} · {field}: remove explicit value","models.wb.undo.nothing":"No field differences to restore.","models.wb.undo.added":"{n} models were added since the write (kept by default)","models.wb.undo.dropAdded":"also remove these additions","models.wb.undo.removed":"{n} models were removed since the write (kept removed by default)","models.wb.undo.restoreRemoved":"also restore these removed models","models.wb.undo.confirm":"Confirm undo","models.wb.undo.cancel":"Cancel","models.wb.undo.done":"Undone and live","models.wb.create.title":"Add provider","models.wb.create.displayName":"Display name","models.wb.create.baseURL":"API address (HTTPS)","models.wb.create.api":"API protocol","models.wb.create.key":"API key (optional; held in task memory only, stored to the local credential store on create)","models.wb.create.route":"Provider ID (suggested from the display name, editable; immutable after creation)","models.wb.create.begin":"Check & prepare","models.wb.create.manual":"Manual model IDs (one per line, optional)","models.wb.create.pick":"Pick models to create (none selected by default)","models.wb.create.summary":"Will create {route}: {n} models{credential}.","models.wb.create.credNote":", and stores the key in the local credential store","models.wb.create.confirm":"Confirm create","models.wb.create.cancel":"Cancel","models.wb.create.created":"Created {route}","models.plan.confirmArmed":"Click again to confirm","models.wb.catalog.title":"Model catalog","models.wb.catalog.customized":"Custom model catalog","models.wb.catalog.inherited":"Using the adapter default models","models.wb.edit.title":"Edit models ({route})","models.wb.edit.name":"Name","models.wb.edit.modelId":"Model ID","models.wb.edit.modelIdPlaceholder":"Model ID","models.wb.edit.displayNamePlaceholder":"Falls back to the model ID when blank","models.wb.edit.context":"Context window","models.wb.edit.contextPlaceholder":"Inherit the catalog default","models.wb.edit.maxTokens":"Max output tokens","models.wb.edit.maxTokensPlaceholder":"Inherit the catalog default","models.wb.edit.capacityInvalid":"Capacity must be positive; a K/M suffix is allowed, e.g. 131072, 256K, 1M.","models.wb.edit.inputModalities":"Input modalities","models.wb.edit.outputModalities":"Output modalities","models.wb.edit.modalityText":"Text","models.wb.edit.modalityImage":"Image","models.wb.edit.outputReadonly":"Output modalities come from the adapter and its built-in catalog; a model entry has no such field, so this is display only.","models.wb.edit.reasoningLevels":"Reasoning levels","models.wb.edit.reasoningNoneHint":"Leaving every level unchecked means a non-reasoning model","models.wb.edit.reasoningFalse":"Non-reasoning model (reasoning=false)","models.wb.edit.wireCustom":"Custom protocol value","models.wb.edit.wireHint":"By default the level name is sent; edit the field to send a custom value.","models.wb.edit.advanced":"Model options","models.wb.edit.inputImage":"Image input","models.wb.edit.reasoning":"Thinking levels","models.wb.edit.reasoningOff":"off (no param)","models.wb.edit.clearOverride":"Clear explicit value (inherit default)","models.wb.edit.addModel":"Add model","models.wb.tab.models":"Models","models.wb.tab.connection":"Connection","models.wb.tab.danger":"Undo & delete","models.wb.state.runtimeLoaded":"Loaded at runtime","models.wb.state.runtimeMissing":"Not loaded at runtime","models.wb.search.placeholder":"Search model id or name","models.wb.search.none":"No matching model","models.wb.keyRef":"credential {ref}","models.wb.conn.displayName":"Display name","models.wb.conn.api":"Protocol","models.wb.conn.baseURL":"Endpoint URL","models.wb.conn.urlHint":"The address is stored as configuration data only. Only public HTTPS addresses may fetch a model list online; other addresses can still be saved and filled in manually.","models.wb.conn.key":"Replace key","models.wb.conn.keyPlaceholder":"Enter the new key (the old one is never shown)","models.wb.conn.keyHint":"The key is submitted once: never displayed, never logged, never in an undo snapshot or a browser draft. Deleting a route keeps the credential.","models.wb.conn.save":"Save connection","models.wb.conn.probeOk":"This address may fetch the model list online.","models.wb.conn.probeBlocked":"Online discovery is unavailable for this address ({reason}); saving and manual entry still work.","models.wb.conn.credState":"Credential {ref}: {state}","models.wb.conn.credConfigured":"configured","models.wb.conn.credAbsent":"not configured","models.wb.conn.credShadowed":"shadowed by an environment variable, cannot be written","models.wb.conn.shadowWarn":"{ref} comes from the environment, so a write would be refused; unset that variable first.","models.wb.conn.planTitle":"These fields will be written","models.wb.conn.planFields":"Fields: {fields}","models.wb.conn.planNothing":"(no change)","models.wb.conn.planKey":"The credential value is replaced too.","models.wb.conn.planNoKey":"The credential is left untouched.","models.wb.conn.confirm":"Confirm save","models.wb.conn.saved":"Connection saved and live","models.wb.leave.body":"You have unsaved edits. Leaving discards these drafts.","models.wb.leave.stay":"Keep editing","models.wb.leave.go":"Discard and leave","models.wb.edit.unsaved":"unsaved","models.wb.effort.needLevel":"At least one non-off mapping value is required.","models.wb.add.title":"Add models","models.wb.add.count":"{n} models discovered, {added} already added","models.wb.add.already":"added","models.wb.add.fetching":"Fetching the model list…","models.wb.add.fallback":'A failed discovery never blocks manual entry: switch to "Enter ids manually" and continue.',"models.wb.add.note":"Listing models does not prove they can be called; use the test below after saving.","models.wb.add.manualIds":"Enter model ids manually (one per line, or comma-separated)","models.wb.add.manualHint":"Only id text is accepted; the host validates and writes the field values.","models.wb.remove.after":"This route keeps {n} models after removal.","models.wb.remove.blockedHint":"This model is referenced; clear the reference in the corresponding setting first, then come back.","models.wb.test.title":"Real call test (available after saving)","models.wb.test.note":"Run the basic check first (no cost); the deep test sends one tiny fixed prompt and may incur cost, and a failure never rolls back saved configuration.","models.wb.test.deep":"Deep test (may incur cost)","models.wb.test.deepArmed":"Click again to confirm the paid test","models.wb.test.cost":'Will send: system "Reply with OK." + user "ping", max_tokens=16, 15s timeout.',"models.wb.test.scopeShallow":"This run only checks configuration and runtime loading; it does not prove image, reasoning or context-limit support.","models.wb.test.scopeDeep":"This run only proves one basic call succeeds; it does not verify image, reasoning or context limits.","models.wb.danger.title":"Undo & delete","models.wb.routeDelete.btn":"Delete this route","models.wb.routeDelete.plan":"This removes the route from settings ({n} models).","models.wb.routeDelete.key":"Credential {ref} is retained and other routes sharing it are unaffected.","models.wb.routeDelete.noKey":"This route references no credential.","models.wb.routeDelete.blocked":"This route is the agent default model: change the default on the official settings first.","models.wb.routeDelete.refs":"{n} other reference(s) break after deletion.","models.wb.routeDelete.confirm":"Delete route","models.wb.routeDelete.confirmArmed":"Click again to confirm deletion","models.wb.rescue.title":"Recently deleted routes","models.wb.rescue.empty":"No deleted route can be restored.","models.wb.rescue.restore":"Restore this route","models.wb.rescue.taken":"A route with this name exists; rename or delete it before restoring.","models.wb.rescue.done":"Restored. The credential reference is restored too, but the old key value is not: re-enter it if needed.","models.wb.rescue.note":"Restore writes the complete pre-deletion configuration back; the old key value is not in the snapshot and cannot be restored.","models.wb.edit.save":"Save edits","models.wb.edit.confirm":"Confirm save","models.wb.edit.done":"Saved and live","models.error.last-model-undeletable":'The last model cannot be removed: an empty list means "inherit the catalog" to the host, which is not the same as disabling the route. Delete the route instead, or add a replacement model first.',"models.error.builtin-inherited-list":"This built-in channel inherits the bundled catalog; adding a model would replace that whole list. Add a custom channel as a separate route instead, or use the per-model panel to edit existing models only.","models.error.nothing-to-restore":"No deleted channel can be restored.","models.error.restore-failed":"Restore failed ({detail}); the snapshot is kept, so fix the cause and retry.","models.error.connection-failed":"Writing the connection failed: {detail}","models.wb.edit.noop":"No changes","models.wb.edit.removeHint":'To remove models use the guarded "Remove models" flow below',"models.wb.remove.btn":"Remove models","models.wb.remove.title":"Remove models ({route})","models.wb.remove.pick":"Pick models to remove (removal writes immediately and is undoable)","models.wb.remove.ref.subagent":"Subagent routing currently points at {model}; pick a replacement, committed in the same transaction","models.wb.remove.ref.default":"This model is the agent default (agent-default-model): change the default on the official settings first, then come back","models.wb.remove.migrateProvider":"Replacement provider","models.wb.remove.migrateModel":"Replacement model","models.wb.remove.plan":"Prepare removal","models.wb.remove.confirm":"Confirm removal","models.wb.remove.done":"Removed {n} models (undoable)","models.wb.verify.run":"Run validation","models.wb.verify.deep":"Deep validation (small real call; may incur cost)","models.wb.verify.deepArmed":"Click again to confirm paid validation","models.wb.verify.busy":"Validating…","models.wb.verify.check.settings":"Config write","models.wb.verify.check.providers":"Provider visibility","models.wb.verify.check.models":"Model resolution","models.wb.verify.check.credential":"Credential","models.wb.verify.check.stream":"Real call","models.wb.verify.skipped":"skipped","models.wb.verify.ok":"ok","models.wb.verify.fail":"failed: {error}","models.wb.verify.persisted":"Validation summary saved (most recent per route)","models.error.llm-missing":"The LLM service is unavailable; deep validation is impossible","models.plan.field.name":"Name","models.plan.field.contextWindow":"Context window","models.plan.field.maxTokens":"Max output","models.plan.field.input":"Input modalities","models.plan.field.reasoningEfforts":"Thinking levels","models.error.catalog-unavailable":"Catalog unavailable; retry later","models.error.route-gone":"The provider was removed from settings","models.error.plan-expired":"The plan expired; re-check first","models.error.inspect-gone":"The check result expired; re-check first","models.error.conflict":"The configuration changed; the plan was refused to avoid overwriting external edits","models.error.unknown-suggestion":"Unknown suggestion ids; re-check and retry","models.error.nothing-to-undo":"Nothing to undo","models.error.bad-route":"Provider ID must start with a lowercase letter and contain only lowercase letters, digits, and dashes","models.error.bad-api":"Pick a supported API protocol","models.error.bad-base-url":"The API address must be a valid HTTPS URL","models.error.route-taken":"A provider already uses this ID","models.error.no-base-url":"This route has no baseURL configured and the built-in catalog has no matching channel","models.error.workbenchReadonly":"Legacy writes are disabled: use the Providers & Models workbench","models.error.config-unavailable":"The model configuration instance is unavailable. Check that pi-ai is enabled in the native Plugin Manager. Nothing was written.","models.error.config-ambiguous":"Multiple pi-ai configuration instances were found. The workbench will not guess a write target. Resolve the instances in the native Plugin Manager and retry.","models.error.config-expression":"The model configuration is expression-backed. Edit it in the native configuration surface; the workbench will not replace it with static values.","models.error.config-inherited-route":"This route is inherited. Deleting it would restore the inherited value rather than remove the route. Manage its source in the native configuration surface.","models.error.bad-display-name":"A display name is required","models.error.bad-key":"The key is too long (max 4096 chars)","models.error.no-models":"At least one model is required: pick candidates or enter manual model IDs","models.error.credential-rejected":"The credential write was refused; nothing was created","models.error.create-failed":"Create failed: {detail}","models.error.draft-gone":"The create draft expired; start over","models.error.recovery-pending":"This route is pending manual recovery; automatic writes are blocked: resolve it on the official settings page first, then clear the flag","models.error.nothing-to-resolve":"Nothing to clear","models.error.bad-models":"Invalid model data","models.error.migration-required":"Subagent routing references this model: pick a replacement and retry","models.error.removal-blocked":"The agent default references this route: change the default on the official settings first","models.error.remove-failed":"Removal failed: {detail}","models.error.bad-model-id":"Model id must be 1–256 characters without control characters","models.error.model-detection-required":"Detect this model first","models.error.model-unverified":"Model detection did not verify; cannot write","models.error.unknown-option":"That candidate expired; fetch it again","models.error.unknown-detection":"That detection expired; re-detect","models.error.duplicate-model":"This model is already configured on the provider","models.error.builtin-only":"Fetch online is for custom routes only; built-in routes use the local catalog","models.error.online-custom-only":"This route is not a built-in channel, so the built-in catalog is unavailable","models.error.probe-protocol-unsupported":"This protocol does not support listing models online","models.error.unknown":"Operation failed: {detail}","tabs.providers":"Providers & Models","tabs.subagentRoute":"Subagent routing","tabs.features":"Features","tabs.notifications":"Notifications","tabs.navOrder":"Settings Nav","config.navOrder.title":"Settings Navigation Order & Visibility","config.navOrder.moveUp":"Move up","config.navOrder.moveDown":"Move down","config.navOrder.visible":"Visible","config.navOrder.hidden":"Hidden","config.navOrder.locked":"Current panel (locked)","config.navOrder.reset":"Reset to default","config.navOrder.saved":"Saved","config.navOrder.save":"Save order","config.navOrder.empty":"No registered settings tabs detected","maintenance.empty":"All maintenance pages are disabled. Enable backup, skills, subagents, or session management under “Configuration → Features”.","config.notificationsDisabled":"Task notifications are turned off on the Features page; these settings are shown for reference only until re-enabled.","features.group.runtime":"Runtime and observation","features.group.maintenance":"Maintenance","features.group.interaction":"Interaction","page.configuration.desc":"Feature switches and task notification settings.","tabs.alert.title":"Service control alert","tabs.alert.body":"These areas need attention: {tabs}","tabs.alert.join":", ","tabs.alert.dot":"Alert on this tab","permissions.title":"File permissions","permissions.description":"Checks whether the Agent can read, write, and enter DSH_HOME and workspaces. Deep scans skip .git; repair adds only the needed permissions and keeps execute bits.","permissions.target":"Target owner: {owner}","permissions.repair":"Repair permissions","permissions.repairing":"Repairing…","permissions.confirm":"Confirm repair","permissions.confirmHint":"Skips .git, restores ownership to the current user, adds Agent read/write access, and keeps existing execute bits.","permissions.cancel":"Cancel","permissions.show":"Permissions & repair","permissions.hide":"Collapse","permissions.error":"Permission operation failed","permissions.summary.ok":"{count} root path(s) passed the check","permissions.summary.warning":"{count} root path(s) need attention","permissions.showDetails":"Show details","permissions.hideDetails":"Hide details","permissions.deep":"Deep check","permissions.deepChecking":"Scanning…","permissions.deepSummary":"Scanned {scanned} entries in {duration} ms; non-editable directories {directories}, non-editable files {files}, unreadable {unreadable}.","backup.title":"Backup management","backup.description":"Backs up sessions, config, and plugin profiles — no node_modules or credentials; never auto-pruned.","backup.create":"Create backup","backup.creating":"Creating…","backup.progress.copy":"Copying session data ({current}/{total})…","backup.progress.archive":"Packing archive ({current}/{total})…","backup.progress.validate":"Verifying archive ({current}/{total})…","backup.progress.publish":"Publishing backup ({current}/{total})…","backup.total":"Total size: {size}","backup.row.version":"DSH version at backup time: {version}","backup.empty":"No backups yet.","backup.delete":"Delete","backup.confirm":"Confirm delete","backup.confirmHint":"Delete this backup? This cannot be undone.","backup.cancel":"Cancel","backup.error":"Backup operation failed","backup.export":"Export","backup.exporting":"Exporting…","backup.exportError":"Backup export failed","backup.restore":"Restore","backup.inspecting":"Inspecting…","backup.restoreConfirm":"Confirm restore","backup.restoreHint":"The integrity check passed. Confirm to apply the plan below; the host will recheck the archive and current targets immediately before committing.","backup.restoreError":"Backup restore failed","backup.error.restore-files-locked":"Restore failed: a target file is in use. Quit the desktop app, pause sync clients, or disable real-time antivirus scanning, then retry.","backup.error.restore-mapping-invalid":"The selected target profile is invalid; choose again.","backup.integrity.ok":"Integrity check passed","backup.integrity.invalid":"Archive cannot be restored","backup.integrity.summary":"{entries} entries, {size} expanded; {sessions} session file(s), {config} config file(s), {profiles} profile manifest(s).","backup.integrity.format":"Archive format {format}","backup.integrity.sourceVersion":"DSH version at backup time: {version}","backup.format.v1":"v1 (no Profile patch layer)","backup.format.v2":"v2 (includes the Profile patch layer)","backup.plan.sessions":"The sessions directory will be replaced in full","backup.plan.config":"Replace {replace} config file(s), remove {remove}","backup.plan.profiles":"Replace package.json for {count} profile(s); keep node_modules and all other files","backup.plan.profilePatches":"Restore cordis.patch.yml (the Profile configuration layer) for {count} profile(s)","backup.plan.profilePatchesAbsent":"This archive predates the Profile patch layer: it carries no cordis.patch.yml, so your current configuration is left untouched rather than overwritten or removed.","backup.plan.expires":"Restore plan expires at {time}","backup.plan.mappingHint":"Restore target profile: the profile content in the archive is written into the local profile you pick (candidates come from profiles that actually exist on this machine).","backup.plan.manifest":"Also overwrite the plugin manifest","backup.notice.source-platform-differs":"This backup comes from {detail}, a different system: sessions stay grouped under their original workspace paths, and credentials, attachments and node_modules do not travel with a backup.","backup.notice.target-case-collision":"The archive contains paths that differ only by case ({detail}); on this system they collapse into one target and may overwrite each other.","backup.notice.target-path-length":"The longest target path will reach {detail} characters, past the classic Windows limit (260), so writing may fail; enable long-path support or use a shorter workspace path.","backup.notice.target-sessions-unwritable":"The sessions directory is currently not writable ({detail}): it may be held by another process or lack permissions. Close the holder (desktop app, sync client, real-time antivirus) and retry.","backup.manualRestartTitle":"Restore completed — manual restart required","backup.manualRestartBody":"The data is restored, but the current process is still running its old state. Press Ctrl+C in the terminal running dsh, then start dsh again.","backup.manualRestartTitleDesktop":"Restore completed — restart the desktop app","backup.manualRestartBodyDesktop":"The data is restored, but the current process is still running its old state. Quit the desktop app and open it again.","backup.error.backup-gzip-invalid":"The archive is not a valid gzip file or is damaged.","backup.error.backup-tar-invalid":"The tar structure or checksum is invalid.","backup.error.backup-entry-traversal":"The archive contains an unsafe path traversal.","backup.error.backup-entry-absolute":"The archive contains an absolute path.","backup.error.backup-entry-link":"The archive contains a symbolic or hard link.","backup.error.backup-entry-type":"The archive contains an unsupported special entry.","backup.error.backup-entry-platform":"The archive contains a filename incompatible with another platform.","backup.error.backup-entry-unexpected":"The archive contains files outside the backup scope.","backup.error.backup-profile-invalid":"A profile package.json is invalid.","backup.error.backup-section-missing":"The archive is missing a required section.","backup.error.backup-size-limit":"The archive exceeds a safe size or entry limit.","backup.error.backup-archive-invalid":"The archive failed its integrity check.","backup.error.backup-archive-incomplete":"The archive does not match the backup source (a file was not captured completely), so it was not published.","backup.error.backup-source-changed":"A session is being written; the backup was not completed. Try again shortly.","backup.error.backup-source-unsafe":"The backup source contains a link or special file, so creation was refused.","backup.error.tar-failed":"The archive tool failed. Check that tar and gzip are available.","backup.error.active-work":"Running work was detected; restore is blocked for now.","backup.error.restore-plan-expired":"The restore plan expired. Inspect the backup again.","backup.error.restore-source-changed":"The backup changed before confirmation. Inspect it again.","backup.error.restore-target-changed":"Current data changed before confirmation. Inspect it again.","backup.error.restore-target-unsafe":"A restore target contains an unsafe link or special file.","backup.import":"Import backup","backup.importing":"Importing…","backup.showRecords":"Show backup records","backup.hideRecords":"Hide backup records","version.title":"Version information","version.current":"DSH: ","version.plugin":"dsh-service: ","version.loading":"Loading…","update.check":"Check for updates","update.checking":"Checking…","update.current":"Up to date","update.available":"New version: {version}","update.installedPendingRestart":"Installed {version} — restart to take effect","update.notes.button":"What's new","update.notes.hide":"Hide what's new","update.notes.loading":"Loading release notes…","update.notes.empty":"This release has no notes.","update.notes.truncated":"(Very long; showing the first {chars} characters)","update.notes.publishedAt":"Published {date}","update.notes.version":"Version {version}","update.notes.prerelease":"Pre-release","update.notes.error.release-not-found":"The release notes are not published yet (the version reached npm first; the release follows later).","update.notes.retry":"Retry","update.notes.error.release-unavailable":"Could not load the release notes. Try again later.","update.unavailable":"Latest version is temporarily unavailable","update.unpublished":"No published version is available to check","health.recheck":"Run again","update.upgrade":"Upgrade plugin","update.upgrading":"Upgrading…","update.upgradeError":"Plugin upgrade failed","update.upgradeErrorDetail":"Plugin upgrade failed ({detail})","update.upgradeSuccess":"Upgrade successful, restarting…","update.guardActiveWork":"Active sessions or background tasks are running; resolve them before upgrading","update.guardLinkInstall":"Installed via link: (development mode) — cannot one-click upgrade from the registry; update the source checkout and restart","update.guardFileInstall":"Installed via file: — cannot one-click upgrade from the registry","update.guardNoNewer":"The registry latest is not higher than the current version; refused a possible downgrade","update.guardNoProfile":"No profile with this plugin installed was found to target the upgrade at","update.guardAmbiguous":"Several profiles install this plugin and the loaded copy could not be determined; aborted","update.guardStale":"The command reported success but the installed version did not change (pnpm safety wait likely blocked it); keeping the current version without restarting","update.guardUnreadable":"The command succeeded but the installed version could not be confirmed; the restart was cancelled","update.failPnpmMissing":"pnpm was not found, so the upgrade cannot run; install pnpm first and retry","update.failNetwork":"A transient network failure occurred while fetching dependencies; please retry shortly","update.failFetchTimeout":"Download timed out (slow network or large package); please retry later","update.failReleaseAge":"The new release is blocked by pnpm's fresh-release safety wait; one automatic bypass retry also failed","update.failHoist":"This profile's node_modules was created by a different pnpm major; the rebuild retry also failed","update.failAddingToRoot":"pnpm refused to add at the workspace root (missing -w)","update.failNotWorkspace":"-w was passed but the profile is not a pnpm workspace","update.failIgnoredBuilds":"Dependency build scripts are blocked by pnpm by default, so the upgrade could not finish","env.kind.docker":"Docker container","env.kind.container":"Container (containerd/Kubernetes)","env.kind.systemd":"systemd service","env.kind.pm2":"pm2","env.kind.supervisord":"supervisord","env.kind.kubernetes":"Kubernetes","env.kind.declared":"External process manager (declared manually)","update.manualConfirmTitle":"Confirm before upgrading: manual launch suspected","update.manualConfirm":"No process manager detected. DSH will not restart automatically after the upgrade.","update.manualProceed":"Upgrade anyway","update.manualRestartTitle":"Upgrade finished — manual restart required","update.manualRestartBody":"The new version is installed, but the current process still runs the old one. Press Ctrl+C in the terminal running dsh (or simply close the window), then start dsh again.","update.manualRestartTitleDesktop":"Upgrade finished — restart the desktop app","update.manualRestartBodyDesktop":"The new version is installed, but the current process still runs the old one. Quit the desktop app and open it again.","update.desktopManagedUpgrade":"DSH Desktop installs its own plugins: update this plugin from the desktop app's plugin manager page (the CLI upgrade path is unavailable there).","restart.title":"Service restart","restart.description":"Restarts the dsh web process. Running work is interrupted; persisted sessions recover.","restart.button":"Restart dsh web","restart.sending":"Sending…","restart.confirm":"Confirm restart","restart.force":"Force restart","restart.cancel":"Cancel","restart.sent":"Restart request sent.","restart.sentHint":"The connection will close shortly. The page will reload automatically after recovery.","restart.idleHint":"No active work was detected. Confirm to disconnect and wait for the service to restart.","restart.manualWarn":"This looks like a manual terminal launch: once confirmed the process exits and nothing restarts it — you must run dsh again yourself.","restart.sentManualHint":"Manual start detected — the service will not relaunch itself. Rerun dsh in the original terminal, then refresh.","restart.desktopWarn":"This is DSH Desktop: the host is owned by the app, so confirming will neither exit nor restart it — quit the app from its tray/menu and open it again.","restart.sentDesktopHint":"DSH Desktop owns this process, so the service will not relaunch itself. Quit the desktop app and open it again.","restart.navToggle":'Show "Restart" entry in settings left nav',"restart.navToggleHint":"Off by default; when enabled, a quick-restart entry appears at the bottom of the settings left navigation","activity.agent":"Agent","activity.job":"Background job","activity.terminal":"Terminal","activity.warning":"Detected {count} active items; restart interrupts them.","activity.item":"{type}: {label} ({status})","error.update":"Update check failed","error.activity":"Could not check active work","error.restart":"Restart failed","error.instance":"Restart response is missing the process instance ID","usage.title":"Model usage","usage.tooltip.date":"Date: {date}","usage.tooltip.input":"Input {value} token","usage.tooltip.output":"Output {value} token","usage.tooltip.cache":"Cache hit {value} token","usage.tooltip.total":"Total tokens {value}","usage.tooltip.steps":"Successful model steps {value}","usage.tooltip.hitRate":"Cache hit rate {value}","usage.axis":"token vertical axis","usage.models.more":"Show {count} more models","usage.models.less":"Collapse model list","usage.modelScope.today":"Today","usage.modelScope.week":"Last 7 days","usage.modelScope.all":"All time","usage.modelSortHint.today":"Sorted by tokens used today, largest first","usage.modelSortHint.week":"Sorted by tokens in the last 7 days, largest first","usage.modelSortHint.all":"Sorted by all-time tokens, largest first","usage.modelBar.today":"{model}: {total} tokens today","usage.modelBar.week":"{model}: {total} tokens in the last 7 days","usage.modelBar.all":"{model}: {total} tokens in total","usage.refresh":"Refresh usage","usage.refreshing":"Refreshing…","usage.empty":"No usage index yet. Select Refresh usage to build the read-only index.","usage.error":"Could not read model usage","usage.allProjects":"All projects","usage.chartSummary":"Total usage over seven days: {total} tokens","usage.barDay":"{day} total {total} tokens","usage.total":"Total tokens","usage.steps":"Successful model steps","usage.stepsValue":"{count} times","usage.modelLine":"{steps} times · Cache hit {hitRate} · Input {input} token · Output {output} token","usage.input":"Input token","usage.output":"Output token","usage.cache":"Cache token","usage.hitRate":"Cache hit rate","usage.today":"Today","usage.sevenDays":"Last 7 days","usage.heatmap.title":"Daily usage calendar","usage.heatmap.gridLabel":"Daily token usage heatmap calendar","usage.heatmap.cell":"{date}: {total} tokens · {steps} model steps","usage.heatmap.hourTitle":"Usage punch card (weekday × hour)","usage.heatmap.hourGridLabel":"Token usage punch card by weekday and hour","usage.heatmap.hourCell":"{weekday} {hour}:00: {total} tokens · {steps} model steps","usage.heatmap.scope.day":"Daily","usage.heatmap.scope.hour":"Hourly","usage.heatmap.less":"Less","usage.heatmap.more":"More","usage.errors.title":"Model errors","usage.errors.toggle":"Model errors ({count} types)","usage.errors.recent":"Last 48 hours","usage.errors.empty":"No model errors were recorded in the last 48 hours.","usage.toolErrors.title":"Tool errors","usage.toolErrors.toggle":"Tool errors ({count} types)","usage.toolErrors.empty":"No tool errors were recorded in the last 48 hours.","usage.errors.count":"{count} occurrence(s)","usage.failures.global":"Global session indexing (not affected by project filter): {successful} sessions indexed successfully, {failed} skipped.","usage.failures.staleHint":"Totals may include retained cached data from sessions that could not be read again; it may be stale.","usage.failures.show":"Show skipped session details","usage.failures.hide":"Hide skipped session details","usage.failures.dismiss":"Dismiss (shown again if new sessions are skipped)","usage.failures.id":"Session ID","usage.failures.code":"Error type","usage.failures.message":"Reason","usage.failures.stale":"Retained stale statistics (included in totals)","usage.failures.notStale":"No cached data, excluded from totals","usage.failures.reason.format-migration-failed":"Session format migration was refused.","usage.failures.reason.session-read-failed":"Session could not be opened or read.","usage.failures.reason.session-fold-failed":"Session events could not be indexed.","notification.title":"Notifications","notification.description":"Browser notifications when a root task finishes or approval/choice is needed; subagent completion stays silent.","notification.enable":"Enable notifications","notification.enabled":"Notifications enabled","notification.disable":"Disable notifications","notification.denied":"Notification permission denied","notification.master":"Master switch","notification.done":"Task completion","notification.input":"Approvals & questions","notification.doneTitle":"Task complete","notification.doneBody":"{title} has finished its turn","notification.inputTitle":"Your attention needed","notification.inputBody":"{title} — {kind}","notification.kind.approval":"approval requested","notification.kind.plan-review":"plan review requested","notification.kind.question":"answer requested","notification.bellOn":"Notifications on","notification.bellOff":"Notifications off","notification.bellShow":"Show composer bell icon","quota.cardTitle":"Quota lookup","quota.navToggle":'Show "Quota lookup" entry in settings left nav',"quota.navToggleHint":"When enabled, an entry appears in the settings left navigation","models.navToggle":'Show "Models" entry in settings left nav',"models.navToggleHint":"When enabled, an entry appears in the settings left navigation","quota.window.rolling":"5h rolling","quota.window.tokens-limit-u3-n5":"5-hour tokens","quota.window.tokens-limit-u6-n1":"Weekly tokens","quota.window.tokens-limit":"Token quota","quota.window.time-limit-u5-n1":"MCP quota","quota.window.time-limit":"MCP quota","quota.window.credit-limit":"Credit quota","quota.window.credits":"Credits used","quota.window.balance":"Balance","quota.window.weekly":"This week","quota.window.monthly":"This month","quota.window.codex-5h":"5-hour","quota.window.codex-day":"Daily","quota.window.codex-week":"Weekly","quota.window.codex-month":"Monthly","quota.window.gemini-5h":"5-hour","quota.window.gemini-week":"Weekly","quota.window.claude-5h":"5-hour","quota.window.claude-week":"Weekly","quota.panel.title":"Quota usage","quota.resetCard.more":"{count} more","quota.resetCard.less":"Collapse","quota.panel.used":"Used","quota.panel.remaining":"Remaining","quota.ring.label":"Quota lookup","quota.gauge.baseline":"Baseline full","quota.gauge.calibrate":"Set current as full","quota.gauge.calibrateTip":"Set current balance {amount} as the 100% baseline","quota.gauge.ratio":"{percent}% remaining","quota.filter.showAll":"Show all quotas ({count})","quota.filter.currentOnly":"Current model only","quota.updated":"Updated {time}","quota.refreshing":"Refreshing…","quota.empty":"No data yet","quota.resetIn":"Resets in {time}","quota.window.stale":"cached","quota.window.staleTip":"Live query failed for this account; showing CPA's last cached snapshot (not realtime)","quota.family.gemini":"Gemini","quota.family.claude":"Claude","quota.family.codex":"Codex","quota.family.other":"Other","quota.realmCap.edit":"Set daily volume","quota.realmCap.unit":"M tokens","quota.realmCap.save":"Save","quota.realmCap.reset":"Reset to default","quota.realmCap.invalid":"Enter a daily cap greater than 0 (M tokens)","quota.realmCap.hint":"Denominator of the realm gauge: reaching the cap shows 100%; the real figure stays visible when exceeded.","quota.resetCard.title":"Reset card","quota.resetCard.codexTitle":"Codex reset cards","quota.resetCard.expires":"expires {date}","quota.resetCard.expired":"expired","quota.resetCard.edit":"Add reset card","quota.advanced":"Configuration","quota.resetCard.dateLabel":"Expiry date","quota.resetCard.nameLabel":"Name (optional)","quota.resetCard.add":"Add","quota.resetCard.cancel":"Cancel","quota.resetCard.remove":"Remove","quota.retryAt":"Retry allowed after {time}","quota.manualOnly":"Auto-retry paused — retry manually","quota.refresh":"Refresh","quota.refresh.manual":"Retry connection","quota.refresh.cooldown":"Too many attempts — try again after {time}","quota.reorder":"Reorder & visibility","quota.order.title":"Quota card order & visibility","quota.order.hint":"Drag items or click the arrows to reorder; toggle off to hide cards you rarely need (hiding only affects display, not querying).","quota.order.allHidden":"All adapted cards are hidden; turn a toggle back on under “Reorder & visibility” to show them again.","quota.usageLink":"Open the official usage page","quota.adapt":"Adapt","quota.kind.opencode-go":"OpenCode Go","quota.kind.zai-coding-cn":"Zhipu GLM Coding Plan","quota.kind.openrouter":"OpenRouter","quota.kind.kimi":"Kimi / Moonshot","quota.kind.siliconflow":"SiliconFlow","quota.kind.cliproxy":"CLIProxyAPI accounts","quota.kind.deepseek":"DeepSeek Platform","quota.kind.stepfun":"StepFun Balance","quota.kind.stepfun-step-plan":"StepFun Step Plan","quota.kind.xiaomi-token-plan-cn":"Xiaomi MiMo Token Plan","quota.kind.command-goat":"Command Code account quota","quota.kind.poe":"Poe points","quota.kind.clinepass":"ClinePass plan quota","quota.kind.vercel-ai-gateway":"Vercel AI Gateway balance","quota.kind.workbuddy":"workbuddy2api panel usage","quota.window.points":"Remaining points","quota.window.total_token":"Plan total quota","quota.window.compensation_total_token":"Compensation credits","quota.window.plan-name":"Subscription plan","quota.window.credit-pool":"Monthly credit pool","quota.window.topup-credit":"Top-up credit","quota.window.five-hour":"5-hour quota","quota.window.period-spend":"Spent this period","quota.window.usage-window":"Window","quota.window.requests":"Requests","quota.window.errors":"Errors","quota.window.prompt-tokens":"Input tokens","quota.window.completion-tokens":"Output tokens","quota.window.total-tokens":"Total tokens","quota.window.usage-credits":"Credits consumed","quota.window.avg-latency":"Average latency","quota.window.cache-hit-rate":"Cache hit rate","quota.window.realm-usage":"Realm usage","quota.window.realm-daily-tokens":"Daily volume","quota.window.account-usage":"Account usage","quota.window.limit-models":"Limited models","quota.window.rate-limits":"Rate limits","quota.window.account-cooling":"Account throttled","quota.part.requests":"requests","quota.part.tokens":"tokens","quota.part.credits":"credits","quota.part.credit-balance":"credits left","quota.part.reset-at":"resets","quota.part.reason":"reason","quota.error.no-subscription":"No active quota subscription on this account","quota.error.credential-rejected":"Credential rejected by upstream; enter it again (for console types, copy the browser session again)","quota.credential.editCookie":"Set console cookie (web session)","quota.credential.editToken":"Set console token (Oasis-Token, browser session)","quota.kindAuto":"Auto-detected","quota.noAdapted":"No adapted providers yet — adapt manually below","quota.disable":"Disable","quota.followAuto":"Follow auto-detect","quota.addAdapt":"Manual adapt:","quota.addPickProvider":"Pick provider","quota.addPickKind":"Pick type","quota.saveFailed":"Save failed: {error}","quota.unknownProvider":"Unknown provider","quota.error.credential-missing":"Credential missing (set the API key in DSH credentials)","quota.error.no-base-url":"This provider has no baseURL configured","quota.error.credentials-unavailable":"Credential service unavailable","quota.error.http-status":"Upstream returned an error status","quota.error.network":"Network error","quota.error.network-transient":"Unstable network (auto-retried)","quota.error.timeout":"Request timed out","quota.error.bad-payload":"Unexpected response format","quota.error.mgmt-disabled":"CLIProxyAPI management API disabled (remote-management secret-key is empty or allow-remote-management is off)","quota.error.mgmt-banned":"Temporarily banned by CLIProxyAPI (fail2ban after repeated auth failures; wait or change the egress IP)","quota.error.host-not-pinned":"baseURL differs from the domain recorded when adapting; save the adapter again","quota.error.upstream-status":"Upstream official API returned an error status","quota.error.upstream-error":"Upstream service error (quota API failed; retrying automatically)","quota.credential.edit":"Set API credential","quota.credential.editExisting":"Edit credential (configured)","quota.credential.editManagement":"Set management key (web login key)","quota.credential.nameLabel":"Credential name","quota.credential.valueLabel":"Secret value","quota.credential.save":"Save","quota.credential.primary":"primary (one alias is enough)","quota.credential.clear":"Clear stored","quota.credential.clearConfirm":"Click again to clear","quota.credential.configured":"configured","quota.credential.notConfigured":"not set","quota.credential.saveFailed":"Failed to save credential: {error}","quota.credential.unknown-hint":"Unknown credential name","quota.credential.invalid-value":"Secret value must not be empty","quota.credential.credentials-unavailable":"Credential service unavailable","quota.error.unknown":"Unknown error","quota.unadapted":"Not adapted: pick a provider kind below first","quota.unit.day":"{count} d","quota.unit.hour":"{count} h","quota.unit.minute":"{count} min","quota.window.granted-balance":"Granted balance (unexpired)","quota.peak.nowIdle":"Off-peak now · half price","quota.peak.nowPeak":"Peak now · standard price","quota.peak.untilIdle":"Half price from {time} (in {dur})","quota.peak.untilPeak":"Peak pricing from {time} (in {dur})","quota.peak.tag.peak":"Peak","quota.peak.tag.idle":"Off-peak","quota.peak.caption":"Off-peak price is half the peak price. Peak hours (GMT+8): Mon–Fri 09:00–12:00 and 14:00–18:00, excluding Chinese public holidays. All other times — including all day on weekends and Chinese public holidays — are off-peak.","quota.peak.caption.degraded":'The {year} Chinese public holiday schedule is not yet included; this year is estimated as "Mon–Fri 09:00–12:00 and 14:00–18:00", so holidays may still show as peak. Updating the plugin picks up the current year\'s schedule automatically.',"quota.peak.caption.zai":"Off-peak calls deduct 50% of the base credits. Peak hours: Mon–Fri 14:00–18:00 (UTC+8). All other times are off-peak, including all day Saturday and Sunday.","features.fileEditor":"Right-Sidebar file editing","features.modelProviderIcons":"Model provider icons","editor.viewer":"Edit","editor.loading":"Reading file…","editor.preview":"Preview","editor.save":"Save","editor.saving":"Saving…","editor.saved":"Saved","editor.unsaved":"Unsaved","editor.reload":"Reload","editor.undo":"Undo save","editor.keyHint":"Ctrl/Cmd + S to save","editor.conflict.title":"The file changed on disk; save rejected","editor.conflict.body":"Another change (an Agent or another window) overwrote this file after it was opened. Reload discards your edits; overwrite writes the current editor content to disk.","editor.conflict.reload":"Reload (discard edits)","editor.conflict.overwrite":"Overwrite with mine","editor.confirm.previewTitle":"Back to preview","editor.confirm.previewBody":"You have unsaved changes; going back to the preview discards them.","editor.confirm.saveBack":"Save & back","editor.confirm.discardBack":"Discard & back","editor.confirm.reloadTitle":"Reload","editor.confirm.reloadBody":"You have unsaved changes; reloading discards them and reads the current disk content.","editor.confirm.reloadGo":"Discard & reload","editor.confirm.undoTitle":"Undo save","editor.confirm.undoBody":"This restores the file to its content before the last save; unsaved changes are discarded as well.","editor.confirm.cancel":"Keep editing","editor.undoConflict.title":"Cannot undo automatically","editor.undoConflict.body":"The file changed on disk again after your save, so the previous content cannot be restored automatically; reload to see the current content.","editor.undoConflict.dismiss":"Dismiss","editor.readonlyHint":"Read-only","editor.retry":"Retry","editor.error.file-not-found":"The file does not exist (it may have been moved or deleted).","editor.error.not-regular-file":"This is not a regular file and cannot be edited.","editor.error.too-large":"The file exceeds {limit}; the right-Sidebar editor is read-only. Use another viewer.","editor.error.binary-file":"This is not a UTF-8 text file, so the right-Sidebar editor cannot edit it.","editor.error.session-not-live":"This session is not active right now, so it cannot be edited (switch to another viewer to read it).","editor.error.file-forbidden":"The sandbox policy of this session does not allow writing this file.","editor.error.unavailable":"The host file service is unavailable, so editing is not possible right now.","editor.error.invalid-address":"The file address is not recognized, so it cannot be edited.","editor.error.file-stale":"The file changed on disk; reload before saving again.","editor.error.file-failed":"Read or write failed. Please retry.","editor.error.feature-disabled":"“Right-Sidebar file editing” is turned off in the plugin configuration.","editor.error.internal":"The operation failed. Please retry."},J="%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E",Z="%3C/svg%3E",X=e=>'-webkit-mask:url("data:image/svg+xml,'+J+e+Z+'") center/contain no-repeat;mask:url("data:image/svg+xml,'+J+e+Z+'") center/contain no-repeat',ee={service:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]],overview:[["rect",{x:"3",y:"3",width:"7",height:"9",rx:"1"}],["rect",{x:"14",y:"3",width:"7",height:"5",rx:"1"}],["rect",{x:"14",y:"12",width:"7",height:"9",rx:"1"}],["rect",{x:"3",y:"16",width:"7",height:"5",rx:"1"}]],models:[["path",{d:"m12 2 10 5-10 5-10-5Z"}],["path",{d:"m2 17 10 5 10-5"}],["path",{d:"m2 12 10 5 10-5"}]],notify:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M16.8607 4.4824A6 6 0 0 0 6 8C6 12.499 4.589 13.956 3.262 15.326"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17H20A1 1 0 0 0 20.74 15.327C20.209 14.779 19.665 14.218 19.203 13.454"}]],health:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]],usage:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]],quota:[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]],backup:[["rect",{x:"2",y:"3",width:"20",height:"5",rx:"1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}],["path",{d:"M10 12h4"}]],skills:[["path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}],["path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}]],subagent:[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]],sessions:[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}],["path",{d:"m9 10 2 2 4-4"}]],restart:[["path",{d:"M12 2v10"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04"}]],maintenance:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"}]],configuration:[["path",{d:"M20 7h-9"}],["path",{d:"M14 17H5"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]]},te=e=>e.map(([e,t])=>"%3C"+e+Object.entries(t).map(([e,t])=>` ${e}=%27${t}%27`).join("")+"/%3E").join(""),ae=te(ee.service),re=te(ee.quota),se=te(ee.models),ne=te(ee.restart),oe=te(ee.sessions);function le({name:e}){const t=ee[e];return void 0===t?null:r.createElement("svg",{viewBox:"0 0 24 24",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,display:"block"}},t.map(([e,t],a)=>r.createElement(e,Object.assign({key:a},t))))}let ie=()=>{};function de(e){if(!Array.isArray(e))return[];const t=[],a=new Map;for(const r of e){if(null===r||"object"!=typeof r)continue;const e="string"==typeof r.provider&&""!==r.provider?r.provider:void 0,s="string"==typeof r.model&&""!==r.model?r.model:void 0;if(void 0===e||void 0===s)continue;const n="string"==typeof r.reasoningEffort&&""!==r.reasoningEffort?r.reasoningEffort:void 0,o=e+"\0"+s+"\0"+(n??"");let l=a.get(o);void 0===l&&(l={provider:e,model:s,...void 0!==n?{reasoningEffort:n}:{},count:0},a.set(o,l),t.push(l)),l.count+=1}return t}function ce(e){return(Array.isArray(e)?e:[]).map(e=>{if(null===e||"object"!=typeof e)return"";const t="string"==typeof e.provider?e.provider:"",a="string"==typeof e.model?e.model:"",r="string"==typeof e.reasoningEffort&&""!==e.reasoningEffort?e.reasoningEffort:void 0;return`${t}/${a}${void 0!==r?` (${r})`:""}${Number.isFinite(e.count)&&e.count>1?` ×${e.count}`:""}`}).filter(e=>""!==e).join(" · ")}function ue(e){if(!e||!1!==e.ok||"object"!=typeof e.error||null===e.error)return e;const t="string"==typeof e.error.details?.detail?e.error.details.detail:e.detail,a="string"==typeof e.error.message?e.error.message:e.error.code;return{...e,error:a||"unknown",...void 0!==t?{detail:t}:{}}}Object.assign(Y,{"models.smart.error.disabled-model-rename":"此模型已停用。请先明确启用,再修改模型 ID,避免改名后绕过停用状态。","models.smart.reasoningSupportedNoLevels":"此模型支持开启思考,但未获取到思考等级建议值。是否默认开启思考,需要看该接口的默认行为,当前资料不足以确定。","models.smart.noReasoningSuggestions":"未获取到思考等级建议值,请手动配置。资料中支持思考不代表已声明具体等级。","models.smart.help":"按模型 ID 查询本机 pi-ai 目录、OpenRouter 和 modelparams 固定资料源,提供名称、上下文容量、最大输出、输入模态及思考等级等可用建议,不以当前渠道筛选。资料可能不完整或过时;一键填入经确认后只更新草稿,仍需保存。不会获取当前渠道模型列表,也不会发送推理请求。","models.smart.currentEfforts":"当前等级","models.smart.suggestedEfforts":"建议等级","models.smart.effort.off":"关闭","models.smart.effort.minimal":"最低","models.smart.effort.low":"低","models.smart.effort.medium":"中","models.smart.effort.high":"高","models.smart.effort.xhigh":"极高","models.smart.effort.max":"最高","models.smart.deleteRoutePrompt":"确定删除以下渠道及其模型配置吗?API 密钥保留。","models.smart.removalConflicts":"无法删除:以下设置仍在引用","models.smart.resolveRemovalConflicts":"请先在子代理设置或默认模型设置中更换这些引用,再重新删除。","models.smart.referenceKind.subagent-route":"子代理主模型","models.smart.referenceKind.subagent-fallback":"子代理回退模型","models.smart.referenceKind.agent-default-model":"主对话默认模型","models.smart.noSuggestions":"此模型未获取到建议值,请手动配置模型参数","models.smart.suggestedValues":"建议值","models.smart.fillAll":"一键填入","models.smart.confirmFill":"确认填入","models.smart.fillConfirmPrompt":"将以下建议值填入对应输入框,覆盖这些字段的当前草稿值。其他字段保持不变,填入后仍需点击保存。","models.smart.keyConfiguredPlaceholder":"已配置,留空保持不变","models.smart.capacityHint":"支持 K/M,不区分大小写(如 200K、1M;K=1,000,M=1,000,000)。","models.smart.parametersJson":"查看参数 JSON(草稿)","models.smart.deleteModelTitle":"删除模型","models.smart.deleteModelPrompt":"确定删除以下模型吗?删除后将从该渠道的模型列表移除。","models.smart.error.credential-missing":"未配置可用的 API Key,无法获取模型列表。请填写并保存密钥后重试;草稿仍保留。","models.smart.error.discovery-auth-failed":"渠道拒绝认证(HTTP 401)。请检查 API Key 是否正确或已过期;草稿仍保留。","models.smart.error.discovery-forbidden":"渠道拒绝访问模型列表(HTTP 403)。请检查 API Key 的权限、账户状态或渠道访问限制;草稿仍保留。","models.smart.error.discovery-rate-limited":"渠道请求限流(HTTP 429)。请稍后重试或检查账户额度;草稿仍保留。","models.smart.testing":"测试中 · 已用 {seconds} 秒","models.smart.editTitle":"编辑模型配置","models.smart.modelEnabled":"启用模型","models.smart.rename":"重命名","models.smart.renameApply":"应用到草稿","models.smart.providerActions":"供应商操作","models.smart.enableBoundary":"关闭后该渠道不再可选,主对话和子代理均不能发起新调用;配置和密钥保留。","models.smart.providerEnabled":"启用供应商","models.smart.enableUnavailable":"当前宿主没有渠道启停配置接口;此处仅显示运行时加载状态,暂不可切换。","models.smart.imageBadge":"视觉","models.smart.reasoningBadge":"思考","models.smart.homeTitle":"模型设置","models.smart.homeDescription":"管理模型供应商,配置后可在聊天时选择使用。","models.smart.providers":"供应商","models.smart.customProviders":"自定义供应商","models.smart.refreshProviders":"刷新供应商列表","models.smart.modelList":"模型列表","models.smart.noModels":"暂无已配置模型","models.smart.noSearchMatch":"没有匹配的模型","models.smart.aliasIdentity":"用于查询的模型 ID「{requested}」在固定来源没有记录,已按别名「{matched}」查询;建议仅作模型身份参考,需逐项确认。","models.smart.protocolUnknown":"内置协议(暂未读取)","models.smart.keyState.configured":"已配置","models.smart.keyState.missing":"当前密钥引用未配置","models.smart.keyState.authorized":"已授权","models.smart.keyState.unknown":"当前密钥状态暂无法确认","models.smart.keyReplacePlaceholder":"留空保持不变,输入新密钥以更换","models.smart.updateKey":"更新密钥","models.navToggle":"设置页左列显示「模型配置」入口","models.navToggleHint":"开启后在设置页左侧标签显示入口","models.smart.template":"渠道模板","models.smart.templateCustom":"自定义渠道","models.smart.templatePlaceholder":"选择内置渠道模板或自定义","models.smart.mixedApiHint":"该渠道目录包含多种协议({apis})。路由级协议会覆盖该路由全部模型——仅在确认所有模型使用同一协议时再设置协议;不设置则各模型走目录自带的协议。","models.smart.selectModelsHint":"选择模型","models.smart.noModelsSelected":"请至少勾选或输入一个模型","models.smart.noProviders":"暂无已配置渠道","models.smart.apiKey":"API Key","models.smart.apiKeyPlaceholder":"输入 API Key","models.smart.layers":"显式 / 继承与恢复","models.smart.explicitValue":"当前 Profile 显式值","models.smart.inheritedValue":"继承层","models.smart.restoreInherited":"恢复继承 / 未声明","models.smart.referenceId":"参考模型 ID / 别名(可选)","models.smart.queryReference":"按参考 ID 查询","models.smart.compareLatest":"读取最新值并对照(保留草稿)","models.smart.latest":"最新配置","models.smart.draft":"我的草稿","models.smart.useLatest":"此字段使用最新值","models.smart.rebaseDraft":"确认对照,以最新基线继续编辑","models.smart.bindSource":"记住参考关联","models.smart.unbindSource":"解除参考关联","models.smart.bindingReview":"地址或身份已变化:原参考关联需要重新核对,不会自动沿用。","models.smart.bindingSaved":"参考关联已保存;关联不代表渠道能力实测,也不会自动采纳参数。","models.smart.title":"智能填充","models.smart.back":"返回","models.smart.newModel":"添加模型","models.smart.refresh":"重新查询","models.smart.save":"保存","models.smart.saveRoute":"保存渠道参数","models.smart.cancel":"取消","models.smart.confirm":"确认执行","models.smart.preview":"预览后果","models.smart.edit":"编辑","models.smart.add":"添加","models.smart.remove":"删除","models.smart.inherit":"未声明 / 继承","models.smart.loading":"正在读取…","models.smart.search":"搜索模型 ID 或名称","models.smart.advanced":"高级模型参数","models.smart.routeAdvanced":"高级渠道参数","models.smart.routeScope":"这些参数影响整个渠道。空白恢复继承;未知高级键保留,不把生效默认值写死。","models.smart.queryBoundary":"默认关闭。开启会查询固定资料源,不会获取渠道模型列表或发送推理请求;一键填入并确认后才进入草稿。","models.smart.pendingNotSaved":"保存只包含手动修改和已采纳项;尚未确认的建议不会写入。","models.smart.reference":"跨渠道参考:采纳前请核对当前渠道;不代表中转透传或实测能力。","models.smart.source":"参考来源","models.smart.candidate":"建议候选","models.smart.choose":"请选择候选 / 来源","models.smart.accept":"采纳建议","models.smart.reject":"本轮拒绝建议","models.smart.readonly":"只读来源依据与参数范围","models.smart.effective":"当前生效值","models.smart.unsaved":"尚未保存","models.smart.leave":"有未保存的修改(包括无效输入)。离开将丢弃草稿,确定离开吗?","models.smart.builtinReadonly":"内置渠道只读:目录随宿主更新。现有覆盖会保留;修改请使用 DSH 原生模型设置,本页不会复制或冻结动态目录。","models.smart.compatHint":"只显示当前协议可写的兼容键;空值继承,true / false 是显式覆盖。未展示键仍保留。","models.smart.reasoning.inherit":"继承 / 未声明","models.smart.reasoning.false":"明确不支持思考","models.smart.reasoning.map":"自定义 wire 映射","models.smart.noWire":"关闭不发参数","models.smart.wireRequired":"必须填写具体 wire 值","models.smart.wireHint":"档位 ID 不等于协议值。思考映射整组编辑;至少声明一个非 off 档位。","models.smart.input.image-only":"仅图片(明确声明)","models.smart.input.inherit":"继承 / 未声明","models.smart.input.text":"文本","models.smart.input.image":"文本 + 图片","models.smart.type":"值类型","models.smart.type.string":"文本","models.smart.type.number":"数值","models.smart.type.boolean":"布尔","models.smart.type.null":"null","models.smart.type.variable":"请求状态变量","models.smart.newKey":"新键名","models.smart.field.name":"模型显示名称","models.smart.field.contextWindow":"上下文容量","models.smart.field.maxTokens":"模型最大输出","models.smart.field.input":"输入模态","models.smart.maxTokensHelpLabel":"最大输出 token 说明","models.smart.maxTokensHint":"单次请求的输出预留,不是模型能力上限。DSH 自动压缩阈值 ≈ min(窗口×80%, 窗口 − maxTokens − 65536);该值越大阈值越低、压缩越早,挤占过度会使自动压缩不可用。","models.smart.maxTokensThreshold":"按 DSH 默认压缩配置估算:约 {tokens} tokens 触发自动压缩。","models.smart.maxTokensUnsafe":"按 DSH 默认压缩配置估算:该值会使自动压力压缩不可用(阈值 ≤ 0 或压缩后保留长度不小于阈值),只能依赖请求溢出后的强制压缩或手动压缩;请调小或清空后按实际需要填写。","models.smart.maxTokensCapability":"模型目录声明上限:{value}(仅参考,不自动填入)。","models.smart.maxTokensRecommend":"建议 {value}(按 {window} 上下文估算;填入后约 {threshold} tokens 触发压缩)。留空时压缩预留按 0,但部分协议仍按模型默认发 max_tokens。","models.smart.maxTokensRecommendEmpty":"建议留空:当前窗口可安全预留的输出预算不足 2K(或模型目录上限过低),再大就会禁用或明显提前自动压缩。","models.smart.field.reasoningEfforts":"思考等级与协议值","models.smart.field.compat":"协议兼容参数","models.smart.field.displayName":"渠道显示名称","models.smart.field.api":"协议","models.smart.field.baseURL":"API地址","models.smart.field.defaultContextWindow":"渠道默认上下文(token)","models.smart.field.defaultMaxTokens":"渠道默认输出预算(token)","models.smart.field.defaultInput":"渠道默认输入模态","models.smart.field.headers":"普通请求头","models.smart.field.reasoning":"渠道默认思考档位","models.smart.field.thinkingBudgets":"思考预算(token)","models.smart.field.cacheRetention":"缓存保留策略","models.smart.field.transport":"传输方式","models.smart.field.timeoutMs":"请求超时(ms;0 为禁用)","models.smart.field.websocketConnectTimeoutMs":"WebSocket 连接超时(ms;0 为禁用)","models.smart.field.streamIdleTimeoutMs":"流式空闲超时(ms)","models.smart.field.maxRequestImageBytes":"请求图片总大小上限(byte)","models.smart.field.requestImagePixelBudget":"请求图片像素预算(pixel)","models.smart.field.requestImageMaxBytes":"单图大小上限(byte)","models.smart.field.retryPolicy":"请求重试策略","models.smart.models":"模型","models.smart.key":"API密钥","models.smart.shared":"明确替换共享引用(影响已识别使用者)","models.smart.keyBoundary":"默认分配当前渠道独立凭据引用;不回显、不保存旧密钥。共享替换会列出宿主识别的使用者,不能穷尽外部消费者。","models.smart.keyPartial":"密钥已写入,但配置更新失败。凭据未删除;请检查引用并重试,旧密钥不会自动恢复。","models.smart.discover":"获取模型列表","models.smart.discoverBoundary":"只有点击才使用当前渠道凭据在线发现。支持 OpenAI 与 Anthropic 协议。HTTP / 私网可保存,但本插件禁止在线发现;发现失败仍可手填。","models.smart.manualIds":"手动模型 ID(空白或逗号分隔)","models.smart.added":"已添加","models.smart.selectAll":"选择所有未添加项","models.smart.clear":"清空选择","models.smart.createRoute":"添加供应商","models.smart.routeId":"渠道标识(小写字母、数字、连字符)","models.smart.createBoundary":"创建不会探测渠道或写入密钥;至少填写一个模型 ID。创建后可独立编辑参数和设置凭据。","models.smart.deleteRoute":"删除渠道","models.smart.restore":"预览最近恢复","models.smart.deleted":"最近删除的渠道","models.smart.consequences":"后果与可回滚状态","models.smart.credentialRetained":"仅恢复配置与凭据引用;删除保留凭据,恢复不会写回旧密钥。外部后续修改会阻止恢复。","models.smart.builtin":"内置目录","models.smart.custom":"自定义","models.smart.configSaved":"配置已保存","models.smart.configInherited":"配置继承目录","models.smart.runtimeLoaded":"运行时已加载","models.smart.runtimeMissing":"运行时未加载","models.smart.testNotRun":"尚未做真实调用测试","models.smart.test":"主动测试保存状态","models.smart.testBoundary":"将对已保存模型发送固定短文本,最多 30,000 token / 120 秒,可能计费。只验证基础文本调用,不验证图片、容量或全部思考档位。","models.smart.testPassed":"基础文本调用成功","models.smart.testFailed":"基础文本调用失败或未完成","models.smart.error.generic":"操作未完成:{code}。草稿仍保留。","models.smart.error.conflict":"配置或版本在编辑后发生变化。草稿仍保留,请对照最新配置后重试,不能强制覆盖。","models.smart.error.schema-invalid":"参数组合或输入无效。请检查数值、类型及完整思考映射;草稿仍保留。","models.smart.error.restore-conflict":"该变更之后配置又被修改,拒绝恢复以免覆盖后续修改。","models.smart.error.sensitive-snapshot":"现有配置含敏感值,无法安全保存完整恢复快照。此操作已拒绝;请在原生配置页处理敏感字段。","models.smart.error.snapshot-unavailable":"无法保存安全恢复快照,配置未修改。","models.smart.error.sensitive-header":"普通请求头编辑不允许认证 / Cookie / 密钥字段,现有敏感值保持不变。","models.smart.error.removal-blocked":"模型或渠道仍被主模型 / 子代理引用。请先解除引用,本页不自动迁移。","models.smart.error.last-model-undeletable":"不能删除自定义渠道的最后一个模型。空清单不等于禁用;请删除渠道或保留一个模型。","models.smart.error.compat-not-offered":"该兼容参数不属于当前协议的可写键;请核对协议,未知值不会自动丢弃。","models.smart.error.configuration-rejected":"宿主完整配置校验拒绝写入,配置未保存;草稿仍保留。","models.smart.error.probe-protocol-unsupported":"本插件尚未实现该协议的安全发现,请手填模型 ID。","models.smart.error.builtin-readonly":"内置渠道本轮只查看,不接管动态目录。","models.smart.compatNeedsProtocol":"该渠道协议来自继承,可写兼容键按解析后的协议展示;写入前请先在本页显式设置协议。","models.smart.field.modelId":"模型 ID","models.smart.modality.text":"文本","models.smart.modality.image":"图片","models.smart.modality.textInput":"文本输入","models.smart.modality.imageInput":"图片输入","models.smart.modality.textOutput":"文本输出","models.smart.wireValue":"协议值","models.smart.wireEditor":"协议值映射(高级)","models.smart.testMayCharge":"该调用可能计费。","models.smart.testNeedsSaved":"保存当前草稿后才能测试;测试只针对已保存状态。","models.smart.disableProvider":"停用渠道","models.smart.disableBoundary":"停用后该渠道不再可选,主对话与子代理均不能发起新调用;配置与密钥保留。","models.smart.disableReferences":"停用会影响以下引用","models.smart.selectedCount":"已选择 {count} 项","models.smart.hiddenPicks":"{count} 项不在当前列表中","models.smart.removeHiddenPicks":"移除筛选外选择"}),Object.assign(Q,{"models.smart.error.disabled-model-rename":"This model is disabled. Explicitly enable it before changing its ID so a rename cannot bypass its disabled state.","models.smart.reasoningSupportedNoLevels":"This model supports reasoning, but no reasoning level suggestions were found. Whether reasoning is enabled by default depends on the API’s default behavior; the available metadata is insufficient to determine this.","models.smart.noReasoningSuggestions":"No reasoning level suggestions were found. Please configure them manually. Reasoning support does not imply that specific levels are declared.","models.smart.help":"Looks up the model ID in the local pi-ai catalog and fixed OpenRouter and modelparams sources for available suggestions such as name, context capacity, maximum output, input modalities and reasoning levels, without filtering by your provider. Metadata may be incomplete or outdated. Confirming Fill all only updates the draft; saving is still required. It does not discover models from your provider or send inference requests.","models.smart.currentEfforts":"Current levels","models.smart.suggestedEfforts":"Suggested levels","models.smart.effort.off":"Off","models.smart.effort.minimal":"Minimal","models.smart.effort.low":"Low","models.smart.effort.medium":"Medium","models.smart.effort.high":"High","models.smart.effort.xhigh":"Extra high","models.smart.effort.max":"Maximum","models.smart.deleteRoutePrompt":"Delete this provider and its model configuration? API credentials will be retained.","models.smart.removalConflicts":"Cannot delete: still referenced by these settings","models.smart.resolveRemovalConflicts":"Change these references in Subagent settings or default model settings, then retry deletion.","models.smart.referenceKind.subagent-route":"Subagent primary model","models.smart.referenceKind.subagent-fallback":"Subagent fallback model","models.smart.referenceKind.agent-default-model":"Main chat default model","models.smart.noSuggestions":"No suggested values were found for this model. Please configure its parameters manually.","models.smart.suggestedValues":"Suggested values","models.smart.fillAll":"Fill all","models.smart.confirmFill":"Confirm fill","models.smart.fillConfirmPrompt":"Fill the corresponding inputs with these suggestions, replacing their current draft values. Other fields stay unchanged. You still need to save afterwards.","models.smart.keyConfiguredPlaceholder":"Configured; leave blank to keep unchanged","models.smart.capacityHint":"Supports K/M, case-insensitive (e.g. 200K, 1M; K=1,000, M=1,000,000).","models.smart.parametersJson":"View draft parameters (JSON)","models.smart.deleteModelTitle":"Delete model","models.smart.deleteModelPrompt":"Delete the following model? It will be removed from this provider’s model list.","models.smart.error.credential-missing":"No usable API key is configured. Enter and save the key before fetching models again. Your draft remains.","models.smart.error.discovery-auth-failed":"The provider rejected authentication (HTTP 401). Check whether the API key is valid or expired. Your draft remains.","models.smart.error.discovery-forbidden":"The provider denied model-list access (HTTP 403). Check key permissions, account status or access restrictions. Your draft remains.","models.smart.error.discovery-rate-limited":"The provider rate-limited the request (HTTP 429). Try later or check account quota. Your draft remains.","models.smart.testing":"Testing · {seconds}s elapsed","models.smart.editTitle":"Edit model configuration","models.smart.modelEnabled":"Enable model","models.smart.rename":"Rename","models.smart.renameApply":"Apply to draft","models.smart.providerActions":"Provider actions","models.smart.enableBoundary":"Disabling removes this provider from selection and blocks new chat and subagent calls. Configuration and credentials remain intact.","models.smart.providerEnabled":"Enable provider","models.smart.enableUnavailable":"The current host has no provider enable/disable configuration API. This indicates runtime loading only and cannot be toggled yet.","models.smart.imageBadge":"Vision","models.smart.reasoningBadge":"Reasoning","models.smart.homeTitle":"Model settings","models.smart.homeDescription":"Manage model providers and configure them for use in chat.","models.smart.providers":"Providers","models.smart.customProviders":"Custom providers","models.smart.refreshProviders":"Refresh providers","models.smart.modelList":"Model list","models.smart.noModels":"No configured models","models.smart.protocolUnknown":"Built-in protocol (not available yet)","models.smart.keyState.configured":"Configured","models.smart.keyState.missing":"Current key reference is not configured","models.smart.keyState.authorized":"Authorized","models.smart.keyState.unknown":"Current key status could not be confirmed","models.smart.keyReplacePlaceholder":"Leave blank to keep; enter a new key to replace","models.smart.updateKey":"Update key","models.navToggle":'Show "Models" in settings left nav',"models.navToggleHint":"When enabled, an entry appears in settings left navigation","models.smart.template":"Provider template","models.smart.templateCustom":"Custom provider","models.smart.templatePlaceholder":"Select a built-in template or custom","models.smart.mixedApiHint":"This catalog mixes multiple protocols ({apis}). A route-level protocol overrides every model on the route — only set it when all models share one protocol; leaving it unset lets each model use its catalog protocol.","models.smart.selectModelsHint":"Select models","models.smart.noSearchMatch":"No matching models","models.smart.aliasIdentity":'No fixed-source record for queried model ID "{requested}"; queried by the normalized alias "{matched}" instead. Treat these suggestions as model-identity references only and confirm each one.',"models.smart.noModelsSelected":"Please select or enter at least one model","models.smart.noProviders":"No configured providers","models.smart.apiKey":"API Key","models.smart.apiKeyPlaceholder":"Enter API key","models.smart.layers":"Explicit / inherited values and reset","models.smart.explicitValue":"Explicit in current Profile","models.smart.inheritedValue":"Inherited layer","models.smart.restoreInherited":"Reset to inherited / undeclared","models.smart.referenceId":"Reference model ID / alias (optional)","models.smart.queryReference":"Query reference ID","models.smart.compareLatest":"Compare latest values (keep draft)","models.smart.latest":"Latest configuration","models.smart.draft":"My draft","models.smart.useLatest":"Use latest for this field","models.smart.rebaseDraft":"Confirm comparison and continue on latest baseline","models.smart.bindSource":"Remember reference association","models.smart.unbindSource":"Remove reference association","models.smart.bindingReview":"Address or identity changed: review the previous reference association; it is not applied automatically.","models.smart.bindingSaved":"Reference association saved. This is not a capability test and never automatically accepts parameters.","models.smart.title":"Smart fill","models.smart.back":"Back","models.smart.newModel":"Add model","models.smart.refresh":"Query again","models.smart.save":"Save","models.smart.saveRoute":"Save provider parameters","models.smart.cancel":"Cancel","models.smart.confirm":"Confirm","models.smart.preview":"Preview consequences","models.smart.edit":"Edit","models.smart.add":"Add","models.smart.remove":"Delete","models.smart.inherit":"Undeclared / inherited","models.smart.loading":"Loading…","models.smart.search":"Search model ID or name","models.smart.advanced":"Advanced model parameters","models.smart.routeAdvanced":"Advanced provider parameters","models.smart.routeScope":"These parameters affect the entire provider. Blank restores inheritance; unknown advanced keys survive and effective defaults are not materialized.","models.smart.queryBoundary":"Off by default. Turning on queries fixed metadata sources, not provider discovery or inference. Suggestions enter the draft only after confirming Fill all.","models.smart.pendingNotSaved":"Save submits manual changes and accepted suggestions only; unresolved suggestions are not written.","models.smart.reference":"Cross-provider reference: verify applicability before accepting. Not evidence of proxy pass-through or tested capability.","models.smart.source":"Reference source","models.smart.candidate":"Suggestion candidate","models.smart.choose":"Choose a candidate / source","models.smart.accept":"Accept suggestion","models.smart.reject":"Reject suggestion for this query","models.smart.readonly":"Read-only source evidence and parameter ranges","models.smart.effective":"Current effective value","models.smart.unsaved":"Unsaved changes","models.smart.leave":"You have unsaved changes, including invalid input. Leaving discards the draft. Leave anyway?","models.smart.builtinReadonly":"Built-in providers are read-only. The catalog follows host updates and existing overrides survive. Use native DSH model settings to edit; this page never copies or freezes the dynamic catalog.","models.smart.compatHint":"Only writable keys for this protocol are shown. Blank inherits; true / false are explicit overrides. Unshown keys survive.","models.smart.reasoning.inherit":"Inherited / undeclared","models.smart.reasoning.false":"Explicitly no reasoning","models.smart.reasoning.map":"Custom wire mapping","models.smart.noWire":"Off sends no parameter","models.smart.wireRequired":"Enter the actual wire value","models.smart.wireHint":"Effort IDs are not wire values. Edit reasoning mappings as a group; at least one non-off effort is required.","models.smart.input.image-only":"Image only (explicit)","models.smart.input.inherit":"Inherited / undeclared","models.smart.input.text":"Text","models.smart.input.image":"Text + image","models.smart.type":"Value type","models.smart.type.string":"Text","models.smart.type.number":"Number","models.smart.type.boolean":"Boolean","models.smart.type.null":"null","models.smart.type.variable":"Request-state variable","models.smart.newKey":"New key","models.smart.field.name":"Model display name","models.smart.field.contextWindow":"Context capacity","models.smart.field.maxTokens":"Model maximum output","models.smart.field.input":"Input modalities","models.smart.maxTokensHelpLabel":"About max output tokens","models.smart.maxTokensHint":"Output reservation for one request, not the model capability ceiling. DSH auto-compaction threshold ≈ min(80% window, window − maxTokens − 65536): a larger value lowers the threshold and compacts earlier; pushed too far it disables automatic compaction.","models.smart.maxTokensThreshold":"Estimated with the default DSH compaction config: auto-compaction at ~{tokens} tokens.","models.smart.maxTokensUnsafe":"With the default DSH compaction config this value disables automatic pressure compaction (threshold ≤ 0, or the retained tail is not smaller than the threshold); only overflow-triggered or manual compaction remains. Lower it or clear the field and set what you actually need.","models.smart.maxTokensCapability":"Model catalog ceiling: {value} (reference only; never auto-filled).","models.smart.maxTokensRecommend":"Suggested value: {value} (estimated for a {window} context; about {threshold} tokens would trigger compaction). Leaving it empty keeps the compaction reservation at 0, though some protocols still send the model default max_tokens.","models.smart.maxTokensRecommendEmpty":"Leave this empty: less than ~2K of this window can be reserved safely (or the catalog ceiling is too low); a larger value disables or materially advances automatic compaction.","models.smart.field.reasoningEfforts":"Reasoning efforts and wire values","models.smart.field.compat":"Protocol compatibility","models.smart.field.displayName":"Provider display name","models.smart.field.api":"Protocol","models.smart.field.baseURL":"API URL","models.smart.field.defaultContextWindow":"Provider default context (tokens)","models.smart.field.defaultMaxTokens":"Provider default output budget (tokens)","models.smart.field.defaultInput":"Provider default input modalities","models.smart.field.headers":"Ordinary request headers","models.smart.field.reasoning":"Provider default reasoning effort","models.smart.field.thinkingBudgets":"Thinking budgets (tokens)","models.smart.field.cacheRetention":"Cache retention","models.smart.field.transport":"Transport","models.smart.field.timeoutMs":"Request timeout (ms; 0 disables)","models.smart.field.websocketConnectTimeoutMs":"WebSocket connection timeout (ms; 0 disables)","models.smart.field.streamIdleTimeoutMs":"Stream idle timeout (ms)","models.smart.field.maxRequestImageBytes":"Maximum request image bytes","models.smart.field.requestImagePixelBudget":"Request image pixel budget","models.smart.field.requestImageMaxBytes":"Maximum bytes per image","models.smart.field.retryPolicy":"Request retry policy","models.smart.models":"Models","models.smart.key":"API key","models.smart.shared":"Explicitly replace shared reference (affects identified users)","models.smart.keyBoundary":"Defaults to an independent credential reference for this provider. Old keys are neither returned nor snapshotted. Shared replacement lists host-known users, not all external consumers.","models.smart.keyPartial":"The credential was stored, but configuration update failed. It was not deleted; check the reference and retry. The old key is not automatically restored.","models.smart.discover":"Fetch model list","models.smart.discoverBoundary":"Only this button uses the current provider credential for discovery. HTTP / private addresses may be saved, but online discovery is blocked. OpenAI and Anthropic discovery are supported; manual IDs remain available on failure.","models.smart.manualIds":"Manual model IDs (whitespace or comma separated)","models.smart.added":"Already added","models.smart.selectAll":"Select all unadded models","models.smart.clear":"Clear selection","models.smart.createRoute":"Add provider","models.smart.routeId":"Provider ID (lowercase letters, digits and hyphens)","models.smart.createBoundary":"Creating a provider does not discover models or write credentials. Enter at least one model ID. Edit models and set credentials after creation.","models.smart.deleteRoute":"Delete provider","models.smart.restore":"Preview latest restore","models.smart.deleted":"Recently deleted providers","models.smart.consequences":"Consequences and rollback state","models.smart.credentialRetained":"Only configuration and credential references are restored. Deletion retains credentials; restore never reinstates an old secret. Later external edits block restore.","models.smart.builtin":"Built-in catalog","models.smart.custom":"Custom","models.smart.configSaved":"Configuration saved","models.smart.configInherited":"Inherited catalog configuration","models.smart.runtimeLoaded":"Runtime loaded","models.smart.runtimeMissing":"Runtime not loaded","models.smart.testNotRun":"No live call test yet","models.smart.test":"Test saved model","models.smart.testBoundary":"Sends fixed short text using the saved model, at most 30,000 tokens / 120 seconds. Charges may apply. Tests basic text calls only, not images, capacity or every reasoning effort.","models.smart.testPassed":"Basic text call succeeded","models.smart.testFailed":"Basic text call failed or incomplete","models.smart.error.generic":"Operation did not complete: {code}. Your draft is retained.","models.smart.error.conflict":"Configuration or revision changed since editing. The draft is retained. Compare the latest configuration before retrying; no forced overwrite.","models.smart.error.schema-invalid":"Invalid parameters or input. Check numbers, types and complete reasoning mappings. The draft is retained.","models.smart.error.restore-conflict":"Configuration changed after this operation. Restore is refused to protect subsequent edits.","models.smart.error.sensitive-snapshot":"Existing configuration contains sensitive values and cannot be safely snapshotted in full. Operation refused; handle sensitive fields in native settings.","models.smart.error.snapshot-unavailable":"A safe restore snapshot could not be saved. Configuration was not modified.","models.smart.error.sensitive-header":"Ordinary header editing cannot change authentication / cookies / API keys. Existing sensitive values stay intact.","models.smart.error.removal-blocked":"This model or provider is still referenced by the default model or subagents. Remove references first; no automatic migration.","models.smart.error.last-model-undeletable":"A custom provider cannot lose its final model. An empty list is not a disabled provider; delete the provider or keep one model.","models.smart.error.compat-not-offered":"This compatibility key is not writable for the selected protocol. Verify the protocol; unknown values are not silently dropped.","models.smart.error.configuration-rejected":"The host rejected the complete configuration. Nothing was saved; your draft remains.","models.smart.error.probe-protocol-unsupported":"Safe discovery for this protocol is not implemented here. Enter model IDs manually.","models.smart.error.builtin-readonly":"Built-in providers are view-only in this iteration; their dynamic catalog is not taken over.","models.smart.compatNeedsProtocol":"This provider protocol is inherited. Writable compatibility keys are shown for the resolved protocol; set the protocol explicitly on this page before writing them.","models.smart.field.modelId":"Model ID","models.smart.modality.text":"Text","models.smart.modality.image":"Image","models.smart.modality.textInput":"Text input","models.smart.modality.imageInput":"Image input","models.smart.modality.textOutput":"Text output","models.smart.wireValue":"wire value","models.smart.wireEditor":"Wire value mapping (advanced)","models.smart.testMayCharge":"This call may be billed.","models.smart.testNeedsSaved":"Save the current draft before testing; the test targets the saved state only.","models.smart.disableProvider":"Disable provider","models.smart.disableBoundary":"Disabling removes this provider from selection and blocks new chat and subagent calls. Configuration and credentials remain intact.","models.smart.disableReferences":"Disabling affects these references","models.smart.selectedCount":"{count} selected","models.smart.hiddenPicks":"{count} outside the current list","models.smart.removeHiddenPicks":"Remove hidden selections"});const pe={minHeight:"var(--dsh-svc-control-h, 36px)",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",cursor:"pointer",fontSize:"13px",fontWeight:550,transition:"border-color 120ms ease, color 120ms ease, background 120ms ease",lineHeight:"20px"},me=e=>"primary"===e?{...pe,background:"var(--dsh-svc-brand)",borderColor:"var(--dsh-svc-brand)",color:"var(--dsh-svc-brand-text)"}:"danger"===e?{...pe,background:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)",color:"var(--dsh-svc-brand-text)"}:"dangerGhost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)"}:"brandGhost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-brand)",borderColor:"var(--dsh-svc-brand)"}:"ghost"===e?{...pe,background:"transparent",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"}:"neutral"===e?{...pe,background:"var(--dsh-svc-page-bg)",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"}:{...pe,background:"var(--dsh-svc-content-bg)",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)"},ge=e=>Object.assign({},pe,{background:"transparent",color:"var(--dsh-svc-text)",borderColor:"var(--dsh-svc-border-strong)",minHeight:"28px",padding:"4px 10px",fontSize:"12px",borderRadius:"var(--dsh-svc-radius-control)"},e),he=(e,t)=>Object.assign({display:"inline-flex",alignItems:"center",flex:"none",fontSize:"10px",lineHeight:"16px",padding:"1px 6px",..._(999),whiteSpace:"nowrap",...{success:{background:"rgba(16,185,129,0.16)",color:"var(--dsh-svc-success)"},warning:{background:"rgba(198,128,0,0.14)",color:"var(--dsh-svc-warning)"},danger:{background:"rgba(220,38,38,0.12)",color:"var(--dsh-svc-danger)"},info:{background:"rgba(37,99,235,0.10)",color:"var(--dsh-svc-info)"},neutral:{background:"var(--dsh-svc-page-bg)",color:"var(--dsh-svc-text-muted)"}}[e]||{}},t),fe=e=>Object.assign({background:"var(--dsh-svc-surface-bg)",color:"var(--dsh-svc-text)",border:"1px solid var(--dsh-svc-border)",borderRadius:"var(--dsh-svc-radius-control)",padding:"10px"},e),be=e=>Object.assign({padding:"4px 0 14px",marginBottom:"12px",color:"var(--dsw-alias-label-primary)"},e);function ve({ctx:e,rpcCall:t,t:a,useTranslation:s,restartNavToggle:n}){const{useState:o,useEffect:l}=r,i=new Set;let d={status:"idle",elapsedMs:0},c=0;const u=e=>{d=e;for(const t of i)t(e)},p=new Set;let m={stage:0,activity:null,busy:!1,error:null};const g=e=>{m=e;for(const t of p)t(e)},h=()=>{const[e,t]=o(m);return l(()=>(p.add(t),t(m),()=>p.delete(t)),[]),e},f=new Set;let b=null;const v=()=>{const[e,t]=o(b);return l(()=>(f.add(t),t(b),()=>f.delete(t)),[]),e},y=new Set;let w=null;let x=null;const k=()=>(null===x&&(x=t("version",{}).then(e=>(e&&e.ok&&((e=>{const t=e?e.runtimeEnv:void 0;null!==t&&"object"==typeof t&&"boolean"==typeof t.manualStartLikely&&(void 0!==t.supervisorKind&&null!==t.supervisorKind&&"string"!=typeof t.supervisorKind||(e=>{b=e;for(const t of f)t(e)})({platform:"string"==typeof t.platform?t.platform:"",supervisorKind:void 0===t.supervisorKind||null===t.supervisorKind?null:t.supervisorKind,manualStartLikely:t.manualStartLikely,electronShell:!0===t.electronShell}))})(e.value),(e=>{const t=e?e.installedVersion:void 0,a="string"==typeof t&&t.length>0&&t.length<=64&&!/\s/.test(t)?t:null;a!==w&&(e=>{w=e;for(const t of y)t(e)})(a)})(e.value)),e)).catch(()=>(x=null,null))),x),S=()=>(x=null,k());let E=null;const C=async e=>{const t=await(!0===e?S():k()),a=t&&t.ok?t.value&&t.value.instanceId:void 0;"string"==typeof a&&0!==a.length&&(null!==E?a!==E&&window.location.reload():E=a)};let T=!1;const q=async()=>{g({...m,busy:!0,error:null});try{const e=await t("activity",{});if(e&&!1===e.ok)throw console.error("dsh-service: activity check failed",e.error),new Error(a("error.activity"));const r=e&&e.value?e.value:{hasActive:!1,items:[]};g({...m,activity:r,stage:r.hasActive?3:1,busy:!1,error:null})}catch(e){g({...m,error:e&&e.message?String(e.message):String(e),stage:0,busy:!1})}},A=async e=>{g({...m,busy:!0,error:null});try{const r=await t("web",{force:!0===e});if(r&&!1===r.ok){if("active-work"===r.error&&r.value)return void g({...m,activity:r.value,stage:3,busy:!1,error:null});throw console.error("dsh-service: restart failed",r.error),new Error(a("error.restart"))}const s=r&&r.value?r.value.instanceId:void 0;if(r&&r.value&&!0===r.value.requiresManualRestart)return void g({...m,stage:2,busy:!1,error:null});if("string"!=typeof s||0===s.length)throw new Error(a("error.instance"));g({...m,stage:2,busy:!1,error:null}),z(s).catch(e=>console.error("dsh-service: recovery failed",e))}catch(e){g({...m,error:e&&e.message?String(e.message):String(e),stage:0,busy:!1})}},z=async a=>{const r=++c;let s=0,n=1e3;for(u({status:"waiting",elapsedMs:s});s<6e4&&r===c;){const o=Math.min(n,6e4-s);try{await e.timer.timeout(o)}catch(e){return}if(r!==c)return;s+=o,u({status:"waiting",elapsedMs:s});try{const e=await t("version",{}),r=e&&e.ok?e.value&&e.value.instanceId:void 0;if("string"==typeof r&&r.length>0&&r!==a)return void window.location.reload()}catch(e){}if(s>=6e4)return void u({status:"timeout",elapsedMs:s});n=Math.min(2*n,1e4)}};e.effect(()=>()=>{c+=1,i.clear(),p.clear(),f.clear()},"dsh-service recovery"),e.effect(()=>{const t=e.on("connection/reset",()=>{C(!0).catch(()=>{})});return C(!1).catch(()=>{}),t},"dsh-service process identity");const M=e=>{if("string"!=typeof e)return null;const t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),pre:t[4]?t[4].split("."):null}:null},I=e=>/^\d+$/.test(e)?Number(e):e;function R(){const e=(()=>{const[e,t]=o(d);return l(()=>(i.add(t),t(d),()=>i.delete(t)),[]),e})(),t=s();if("idle"===e.status)return null;const a="timeout"===e.status;return r.createElement("div",{style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:"rgba(12, 14, 20, 0.72)",backdropFilter:"blur(4px)",pointerEvents:"auto"}},r.createElement("div",{style:{width:"min(420px, 100%)",padding:"24px",borderRadius:"12px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 18px 60px rgba(0,0,0,0.35)",textAlign:"center"}},r.createElement("div",{style:{fontSize:"18px",fontWeight:700,marginBottom:"10px"}},t(a?"recovery.timeout.title":"recovery.waiting.title")),r.createElement("p",{style:{margin:0,fontSize:"13px",lineHeight:1.7,color:"var(--dsw-alias-label-secondary)"}},a?t("recovery.timeout.body"):t("recovery.waiting.body",{seconds:Math.floor(e.elapsedMs/1e3)})),a?r.createElement("button",{style:Object.assign({},ge(),{marginTop:"16px",padding:"7px 16px"}),onClick:()=>window.location.reload()},t("recovery.manual")):null))}return{RestartOverlay:function(){return r.createElement(R,null)},RestartSection:function({showNavToggle:e}){const t=s(),a=h(),o=v();l(()=>{k()},[]);const[i,d]=n.useEnabled(),c=me("danger"),u=me("dangerGhost"),p=me("ghost"),f={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},b=be(),y=fe(),w={fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},x=null!==o&&!0===o.electronShell;if(2===a.stage)return r.createElement("div",{"data-testid":"restart-card",style:b},r.createElement("div",{style:w},t("restart.title")),r.createElement("p",{style:{margin:0,fontSize:"13px"}},t("restart.sent")),r.createElement("p",{style:f},t(x?"restart.sentDesktopHint":null!==o&&!0===o.manualStartLikely?"restart.sentManualHint":"restart.sentHint")));const S={agent:t("activity.agent"),job:t("activity.job"),terminal:t("activity.terminal")},E=a.activity&&Array.isArray(a.activity.items)?a.activity.items:[],C=x?r.createElement("p",{"data-testid":"restart-desktop-warn",style:Object.assign({},f,{color:"var(--dsw-alias-state-warn-primary)",margin:"6px 0 0"})},t("restart.desktopWarn")):null!==o&&!0===o.manualStartLikely?r.createElement("p",{"data-testid":"restart-manual-warn",style:Object.assign({},f,{color:"var(--dsw-alias-state-warn-primary)",margin:"6px 0 0"})},t("restart.manualWarn")):null,T=3===a.stage?r.createElement("div",{style:{marginTop:"12px",padding:"10px 12px",borderRadius:"6px",background:"rgba(211,51,51,0.1)",border:"1px solid rgba(211,51,51,0.35)"}},r.createElement("p",{style:{margin:"0 0 8px",color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",fontWeight:600}},t("activity.warning",{count:E.length})),r.createElement("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"12px",lineHeight:1.7}},E.map(e=>r.createElement("li",{key:e.type+":"+e.id},t("activity.item",{type:S[e.type]||e.type,label:e.label,status:e.status}))))):null;return r.createElement("div",{"data-testid":"restart-card",style:b},r.createElement("div",{style:w},t("restart.title")),r.createElement("div",{"data-testid":"restart-region",style:y},r.createElement("p",{style:{margin:0,fontSize:"13px"}},t("restart.description")),C,T,r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},0===a.stage?r.createElement("button",{style:u,"data-variant":"dangerGhost",onClick:q,disabled:a.busy},t(a.busy?"update.checking":"restart.button")):1===a.stage?[r.createElement("button",{key:"confirm",style:c,"data-variant":"danger",onClick:()=>A(!1),disabled:a.busy},t(a.busy?"restart.sending":"restart.confirm")),r.createElement("button",{key:"cancel",style:p,onClick:()=>g({...m,activity:null,stage:0,busy:!1,error:null}),disabled:a.busy},t("restart.cancel"))]:3===a.stage?[r.createElement("button",{key:"force",style:c,"data-variant":"danger",onClick:()=>A(!0),disabled:a.busy},t(a.busy?"restart.sending":"restart.force")),r.createElement("button",{key:"cancel",style:p,onClick:()=>g({...m,activity:null,stage:0,busy:!1,error:null}),disabled:a.busy},t("restart.cancel"))]:null),1===a.stage?r.createElement("p",{style:f},t("restart.idleHint")):null,a.error?r.createElement("p",{style:Object.assign({},f,{color:"var(--dsw-alias-state-error-primary)"})},String(a.error)):null,e?r.createElement("div",{style:{marginTop:"12px",paddingTop:"10px",borderTop:"1px solid var(--dsw-alias-border-l1)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},t("restart.navToggle")),r.createElement("span",{style:f},t("restart.navToggleHint"))),r.createElement("button",{type:"button",role:"switch","data-testid":"restart-nav-switch","aria-checked":String(i),onClick:()=>d(!i),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(i?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:i?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:i?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:i?"#fff":"var(--dsw-alias-label-tertiary)"}}))):null))},compareSemver:(e,t)=>{const a=M(e),r=M(t);if(!a||!r)return null;for(const e of["major","minor","patch"])if(a[e]!==r[e])return a[e]<r[e]?-1:1;if(null===a.pre&&null===r.pre)return 0;if(null===a.pre)return 1;if(null===r.pre)return-1;const s=Math.min(a.pre.length,r.pre.length);for(let e=0;e<s;e+=1){const t=I(a.pre[e]),s=I(r.pre[e]);if(t!==s)return"number"==typeof t&&"number"==typeof s||"string"==typeof t&&"string"==typeof s?t<s?-1:1:"number"==typeof t?-1:1}return a.pre.length<r.pre.length?-1:a.pre.length===r.pre.length?0:1},fetchVersionSnapshot:k,refreshVersionSnapshot:S,startRecovery:z,useInstalledVersion:()=>{const[e,t]=o(w);return l(()=>(y.add(t),t(w),()=>y.delete(t)),[]),e},useRestartFlow:h,useRuntimeEnv:v,isUpgradeInFlight:()=>T,setUpgradeInFlight:e=>{T=e},getRuntimeEnvState:()=>b}}function ye({ctx:e,t,featureEnabled:a,createConversationNav:r}){const s={active:!1,mq:null,mqHandler:null,frameObserver:null,mountObserver:null,workspaceObserver:null,errorHandler:null,resizeHandler:null,styleTag:null,backdrop:null,fab:null,debugChip:null,debugEnabled:!1,errorCount:0,drawerOpen:!1,detailsOpen:!1,rightbarOpen:!1,workspaceOpen:!1,edgeGesture:null,edgeTelemetry:null,lastFabDisplay:null,lastBackdropDisplay:null,immersive:!1,repinTimer:null,repinAnchor:null,repinToBottom:!1,chatAvailable:!1,chatScrollLastY:null,gestureAt:0,immersiveAcc:0,immersiveLockDir:null,zoneArmed:null,arrivalDone:!1,lastRevealReason:null,headerEl:null,headerRO:null},n=r(),o=()=>{try{return"function"==typeof e.get?e.get("layout"):void 0}catch(e){return}},l=()=>{if(s.detailsOpen){const e=o();if(void 0!==e)try{e.closeDetails()}catch(e){}s.detailsOpen=!1}const e=s.drawerOpen||s.workspaceOpen||s.rightbarOpen?"none":"flex";null!==s.fab&&s.lastFabDisplay!==e&&(s.lastFabDisplay=e,s.fab.style.display=e);const t=s.drawerOpen?"block":"none";null!==s.backdrop&&s.lastBackdropDisplay!==t&&(s.lastBackdropDisplay=t,s.backdrop.style.display=t),s.debugEnabled&&null!==s.debugChip&&V()};let i=!1;const d=()=>{const e=document.querySelector("[data-dshsvc-frame]");s.drawerOpen=null!==e&&!e.hasAttribute("data-sidebar-collapsed"),s.rightbarOpen=T();const t=o(),a=void 0!==t&&"function"==typeof t.openRightbar||s.rightbarOpen;s.detailsOpen=!a&&null!==e&&!e.hasAttribute("data-details-collapsed"),s.workspaceOpen=!1;try{for(const e of document.querySelectorAll('[class*="nArs4W_panel"]')){const t="string"==typeof e.className?e.className:"";if(/nArs4W_panelHidden/.test(t))continue;const a=e.getBoundingClientRect();if(a.width>0&&a.left<window.innerWidth-2&&"hidden"!==getComputedStyle(e).visibility){s.workspaceOpen=!0;break}}}catch(e){s.workspaceOpen=!1}y()},c=e=>{const t=document.documentElement.style;(e=>"function"==typeof e.setProperty)(t)&&t.setProperty("--dshsvc-header-h",`${Math.max(0,Math.round(e))}px`)},u=()=>{let e=null;try{e=document.querySelector("[data-conversation-scroll]")}catch(e){return null}if(null===e||!1===e.isConnected)return null;let t=e.parentNode;if(null===t||t===document.documentElement)return null;let a=null;try{a=t.getAttribute("data-phase")}catch(e){}let r=t;for(let e=0;null===a&&e<2&&(r=null==r?null:r.parentNode,null!==r&&r!==document.documentElement);e+=1){try{a=r.getAttribute("data-phase")}catch(e){break}null!==a&&(t=r)}return{scroller:e,rootEl:t,phase:a}},p=(e,t)=>{if(t<=0||null===e||void 0===e.children||null===e.children)return null;for(const a of e.children||[]){if("HEADER"===("string"==typeof a.tagName?a.tagName.toUpperCase():""))return a;const e=p(a,t-1);if(null!==e)return e}return null},m=(e,t)=>{let a=t;for(;null!=a;){if(a===e)return!0;a=a.parentNode}return!1},g=()=>{s.repinTimer=null;const e=s.repinAnchor,t=s.repinToBottom;s.repinAnchor=null,s.repinToBottom=!1;const a=u();if(null!==a&&null!==a.scroller)try{const r=Number(a.scroller.scrollTop),s=Number(a.scroller.scrollHeight),n=Number(a.scroller.clientHeight);if(!Number.isFinite(r)||!Number.isFinite(s)||!Number.isFinite(n))return;const o=Math.max(0,s-n);if(t){if(o-r>80)return;return void(a.scroller.scrollTop=o)}if(null===e)return;if(r<e-4)return;a.scroller.scrollTop=o}catch(e){}},h=(e,t=!1)=>{f(),s.repinAnchor=e,s.repinToBottom=t;try{s.repinTimer=setTimeout(g,260)}catch(e){g()}},f=()=>{if(s.repinAnchor=null,s.repinToBottom=!1,null!==s.repinTimer){try{clearTimeout(s.repinTimer)}catch(e){}s.repinTimer=null}},b=(e,t=null)=>{if(s.active&&s.chatAvailable||(e=!1),s.immersive===e)return;const a=!e&&(()=>{const e=u();if(null===e||null===e.scroller)return!1;try{const t=Number(e.scroller.scrollTop),a=Number(e.scroller.scrollHeight),r=Number(e.scroller.clientHeight);return!!(Number.isFinite(t)&&Number.isFinite(a)&&Number.isFinite(r))&&a-r-t<=80}catch(e){return!1}})()?Number((u()||{}).scroller?.scrollTop):null,r=null!==a&&Number.isFinite(a);s.immersive=e,e||null===t||(s.lastRevealReason=t);const n=document.documentElement;try{e?n.setAttribute("data-dshsvc-immersive",""):n.removeAttribute("data-dshsvc-immersive")}catch(e){}e?f():r&&h(a),s.debugEnabled&&V()},v=()=>{s.chatScrollLastY=null,s.immersiveAcc=0,s.immersiveLockDir=null,s.zoneArmed=null,s.arrivalDone=!1,b(!1)},y=()=>{const e=u();let t=!1;if(null!==e&&"active"===e.phase){(e=>{const t=null!==e?e.rootEl:null;if(null===t||void 0===t.children)return s.headerEl;if(null!==s.headerEl&&s.headerEl.isConnected){try{s.headerEl.setAttribute("data-dshsvc-chat-header","")}catch(e){}return s.headerEl}let a=null;for(const e of t.children||[])if("HEADER"===("string"==typeof e.tagName?e.tagName.toUpperCase():"")){a=e;break}if(null===a)for(const e of t.children||[]){const t=p(e,3);if(null!==t){a=t;break}}null!==a&&(a.setAttribute("data-dshsvc-chat-header",""),s.headerEl=a,(e=>{if("function"==typeof ResizeObserver&&(null===s.headerRO||s.headerRO.__el!==e)){if(null!==s.headerRO)try{s.headerRO.disconnect()}catch(e){}try{const t=new ResizeObserver(()=>{try{const t=e.offsetHeight;"number"==typeof t&&t>0&&c(t)}catch(e){}});t.__el=e,t.observe(e),s.headerRO=t;const a=e.offsetHeight;"number"==typeof a&&a>0&&c(a)}catch(e){s.headerRO=null}}})(a))})(e);const a=(()=>{try{return document.querySelector("[data-composer-seat]")}catch(e){return null}})();if(null!==a&&m(e.scroller,a)){let a=NaN,r=NaN,s=NaN;try{a=Number(e.scroller.scrollTop),r=Number(e.scroller.scrollHeight),s=Number(e.scroller.clientHeight)}catch(e){}t=Number.isFinite(a)&&Number.isFinite(r)&&Number.isFinite(s)&&r-s>24}}s.chatAvailable=t,t||v()},w=e=>{if(!s.active||!s.chatAvailable)return;let t=NaN,a=NaN,r=NaN;try{t=Number(e.scrollTop),a=Number(e.scrollHeight),r=Number(e.clientHeight)}catch(e){return}if(!Number.isFinite(t)||!Number.isFinite(a)||!Number.isFinite(r))return;const n=null===s.chatScrollLastY?t:s.chatScrollLastY,o=t-n;if(s.chatScrollLastY=t,!(()=>{const e=Date.now();return s.gestureAt>0&&e-s.gestureAt<=800})()||Math.abs(o)>200)return void(s.immersiveAcc=0);if(s.immersive&&o<0&&n+r>=a-1)return s.immersiveAcc=0,s.immersiveLockDir=-1,void b(!1,"gesture");const l=t+r>=a-80;if(null===s.zoneArmed&&(s.zoneArmed=l),!1===s.zoneArmed&&l&&!s.arrivalDone&&s.immersive&&o>0)return s.arrivalDone=!0,s.immersiveAcc=0,s.immersiveLockDir=1,void b(!1,"arrival");const i=Math.sign(o);if(0!==i&&null!==s.immersiveLockDir){if(i!==-s.immersiveLockDir)return void(s.immersiveAcc=0);s.immersiveLockDir=null}(s.immersiveAcc>0&&o<0||s.immersiveAcc<0&&o>0)&&(s.immersiveAcc=0),s.immersiveAcc+=o,s.immersiveAcc>240?s.immersiveAcc=240:s.immersiveAcc<-240&&(s.immersiveAcc=-240),s.immersiveAcc>=64?(s.immersiveAcc=0,s.immersiveLockDir=1,b(!0)):s.immersiveAcc<=-24&&(s.immersiveAcc=0,s.immersiveLockDir=-1,b(!1,"gesture"))},x=()=>{s.gestureAt=Date.now(),s.immersiveLockDir=null,s.zoneArmed=null,s.arrivalDone=!1},k=e=>{try{const t=null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>0?e.touches:null!=e?e.changedTouches:null;if(null==t||0===t.length)return null;const a=Number(t[0].clientX),r=Number(t[0].clientY);return Number.isFinite(a)&&Number.isFinite(r)?{x:a,y:r}:null}catch(e){return null}},S=()=>{try{const e=document.querySelector("[data-dshsvc-frame]");return null===e||e.hasAttribute("data-sidebar-collapsed")}catch(e){return!0}},E=()=>{try{return"function"==typeof e.get?e.get("sidebarRight"):void 0}catch(e){return}},C=()=>{try{if(null!==document.querySelector("[data-sidebar-right-expand], [data-sidebar-right-toggle], [data-sidebar-right-panel]"))return!0}catch(e){}const e=E();return void 0!==e&&"function"==typeof e.toggleExpanded&&void 0!==e.active()},T=()=>{if(!C())return!1;const e=E();if(void 0!==e&&"function"==typeof e.isExpanded)try{const t=e.isExpanded();if("boolean"==typeof t)return t}catch(e){}try{if(null!==document.querySelector("[data-sidebar-right-open]"))return!0}catch(e){}try{if(null!==document.querySelector("[data-sidebar-right-expand]"))return!1}catch(e){}try{const e=document.querySelector("[data-dshsvc-frame]");if(null!==e&&!e.hasAttribute("data-rightbar-collapsed"))return!0}catch(e){}return!1},q=e=>{try{let t=e;for(let e=0;null!=t&&e<8;e+=1){if(t===document.body||t===document.documentElement)return!1;if("number"==typeof t.scrollWidth&&"number"==typeof t.clientWidth&&t.scrollWidth>t.clientWidth+1){if("function"!=typeof getComputedStyle)return!0;const e=getComputedStyle(t),a=null!=e?String(e.overflowX||""):"";if("auto"===a||"scroll"===a||"overlay"===a)return!0}t=t.parentNode}}catch(e){}return!1},A="open",z="left-close",M="right-close",I="left-open",R="right-open",O="multi-touch",H="modal",D="h-scroll",L="no-point",N="right-absent",W="toggle-unavailable",B="no-tracker",P={left:{opened:()=>!S(),toggle:()=>{const e=o();if(void 0===e)return!1;try{return e.toggleSidebar(),!0}catch(e){return!1}}},right:{opened:()=>T(),toggle:e=>(e=>{try{const t=e?document.querySelector("[data-sidebar-right-expand]"):document.querySelector("[data-sidebar-right-open] [data-sidebar-right-toggle]")||(T()?document.querySelector("[data-sidebar-right-toggle]"):null);if(null!==t&&"function"==typeof t.click)return t.click(),!0}catch(e){}const t=E();if(void 0!==t&&"function"==typeof t.toggleExpanded)try{if("function"!=typeof t.isExpanded||t.isExpanded()!==e)return t.toggleExpanded(),!0}catch(e){}const a=o();if(void 0!==a)try{if(e&&"function"==typeof a.openRightbar)return a.openRightbar(!1,!0),!0;if(!e&&"function"==typeof a.closeRightbar)return a.closeRightbar(),!0}catch(e){}return!1})(e)}},j=(e,t,a)=>{if(null===e||e.fired||null===t)return!1;const r=t.x-e.startX,n=t.y-e.startY;if(Math.abs(n)>Math.abs(r)&&Math.abs(n)>12)return s.edgeGesture=null,!1;let o=null,l=!1,i=null;if(e.kind===A){if(r>=a)o="left",l=!0,i=I;else if(r<=-a&&(o="right",l=!0,i=R,!C()))return null!==s.edgeTelemetry&&(s.edgeTelemetry.reason=N),!0}else e.kind===z?r<=-a&&(o="left",i=z):e.kind===M&&r>=a&&(o="right",i=M);if(null===o)return!1;const d=((e,t)=>{const a=P[e];return void 0!==a&&a.opened()!==t&&!0===a.toggle(t)})(o,l);return e.fired=!0,null!==s.edgeTelemetry&&(s.edgeTelemetry.fired=d,s.edgeTelemetry.kind=i,d||i!==R||(s.edgeTelemetry.reason=W)),!0},$=[["scroll",e=>{if(!s.active)return;let t=e&&e.target;for(let e=0;null!=t&&e<6;e+=1){if("function"==typeof t.hasAttribute)try{if(t.hasAttribute("data-conversation-scroll"))return void w(t)}catch(e){}t=t.parentNode}},{capture:!0,passive:!0}],["touchstart",x,{capture:!0,passive:!0}],["touchmove",x,{capture:!0,passive:!0}],["touchstart",e=>{if(!s.active)return;s.edgeGesture=null;const t=s.debugEnabled?{start:"—",kind:"—",moves:0,last:"—",cancel:"—",fired:!1}:null;s.edgeTelemetry=t;try{if(null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>1)return void(null!==t&&(t.kind=O))}catch(e){}if((()=>{try{return null!==document.querySelector('[role="dialog"][aria-modal="true"]')}catch(e){return!1}})())return void(null!==t&&(t.kind=H));const a=k(e);if(null===a)return void(null!==t&&(t.kind=L));null!==t&&(t.start=`${Math.round(a.x)},${Math.round(a.y)}`);const r=!S(),n=C()&&T();if(r||n)return q(e?.target)?void(null!==t&&(t.kind=D)):(s.edgeGesture={kind:r?z:M,edge:null,startX:a.x,startY:a.y,at:Date.now(),fired:!1},void(null!==t&&(t.kind=r?z:M)));if(q(e?.target))return void(null!==t&&(t.kind=D));const o=Number(window.innerWidth);let l=null;a.x<=32?l="left":Number.isFinite(o)&&a.x>=o-32&&(l="right"),s.edgeGesture={kind:A,edge:l,startX:a.x,startY:a.y,at:Date.now(),fired:!1},null!==t&&(t.kind="left"===l?I:"right"===l?R:A),s.debugEnabled&&V()},{capture:!0,passive:!0}],["touchmove",e=>{const t=s.edgeGesture;if(null===t||t.fired)return;try{if(null!=e&&void 0!==e.touches&&null!==e.touches&&e.touches.length>1)return s.edgeGesture=null,null!==s.edgeTelemetry&&(s.edgeTelemetry.reason=O),void(s.debugEnabled&&V())}catch(e){}const a=k(e),r=s.edgeTelemetry;null!==r&&null!==a&&(r.moves+=1,r.last=`${Math.round(a.x-t.startX)},${Math.round(a.y-t.startY)}`);const n=j(t,a,56);s.debugEnabled&&n&&V()},{capture:!0,passive:!0}],["touchend",e=>{const t=s.edgeGesture;if(null===t||t.fired)return void(s.edgeGesture=null);const a="open"===t.kind&&null!==t.edge,r=a?k(e):null;a&&null!==r&&Date.now()-t.at<=260&&j(t,r,32),s.edgeGesture=null,s.debugEnabled&&t.fired&&V()},{capture:!0,passive:!0}],["touchcancel",e=>{const t=s.edgeGesture,a=s.edgeTelemetry;if(null===t)return null!==a&&(a.cancel=B),void(s.debugEnabled&&V());const r="open"===t.kind&&null!==t.edge,n=k(e);null!==a&&null!==n&&(a.cancel=`${Math.round(n.x-t.startX)},${Math.round(n.y-t.startY)}`),r&&j(t,n,6),s.edgeGesture=null,s.debugEnabled&&V()},{capture:!0,passive:!0}],["wheel",x,{capture:!0,passive:!0}],["focusin",e=>{if(!s.active)return;let t=null;try{t=document.querySelector("[data-composer-seat]")}catch(e){return}null!==t&&m(t,e?.target)&&(s.immersiveAcc=0,s.immersive&&b(!1,"focus"))},{capture:!0}],["click",e=>{s.active&&s.chatAvailable&&s.immersive&&n.isToBottomButton(e&&e.target)&&(s.immersiveAcc=0,s.immersiveLockDir=1,b(!1,"button"),h(null,!0))},{capture:!0}]];let _=!1;const V=()=>{const e=s.debugChip;if(null===e)return;const a=e=>t(e?"mobile.debug.stateOn":"mobile.debug.stateOff"),r=[[`${t("mobile.debug.viewport")} ${window.innerWidth}×${window.innerHeight}`,`≤1023 ${a(s.active)}`,`${t("mobile.debug.drawer")} ${a(s.drawerOpen)}`,`${t("mobile.debug.details")} ${a(s.detailsOpen)}`,`${t("mobile.debug.rightbar")} ${a(s.rightbarOpen)}`,`${t("mobile.debug.immersive")} ${a(s.immersive)}`+(null===s.lastRevealReason?"":`(${n=s.lastRevealReason,"gesture"===n?t("mobile.debug.immersive.reason.gesture"):"arrival"===n?t("mobile.debug.immersive.reason.arrival"):"focus"===n?t("mobile.debug.immersive.reason.focus"):"button"===n?t("mobile.debug.immersive.reason.button"):n})`),`${t("mobile.debug.errors")} ${s.errorCount}`].join(" · ")];var n;const o=e=>e===I?t("mobile.debug.edge.leftOpen"):e===R?t("mobile.debug.edge.rightOpen"):e===z?t("mobile.debug.edge.leftClose"):e===M?t("mobile.debug.edge.rightClose"):e===A?t("mobile.debug.edge.open"):e===O?t("mobile.debug.edge.reason.multiTouch"):e===H?t("mobile.debug.edge.reason.modal"):e===D?t("mobile.debug.edge.reason.hScroll"):e===L?t("mobile.debug.edge.reason.noPoint"):e===N?t("mobile.debug.edge.reason.absentRight"):e===W?t("mobile.debug.edge.reason.badButton"):e===B?t("mobile.debug.edge.reason.noTracker"):e,l=s.edgeTelemetry;if(null!==l&&void 0!==l.start){let e=`${t("mobile.debug.edge")} ${t("mobile.debug.edge.fieldStart")}(${l.start}) ${o(l.kind)} ${t("mobile.debug.edge.fieldMoves")}${l.moves} ${t("mobile.debug.edge.fieldLast")}(${l.last}) ${t("mobile.debug.edge.fieldCancel")}(${o(l.cancel)})`;void 0!==l.reason&&(e+=` ${t("mobile.debug.edge.fieldReason")}(${o(l.reason)})`),l.fired&&(e+=" ✓"),r.push(e)}e.textContent=r.join("\n")},F=()=>{if(null!==s.fab)return!0;if(!(()=>{const e=document.querySelector("[data-shell-overlay]"),t=null!==e?e.parentNode:null;if(null===t||t===document.documentElement)return!1;t.setAttribute("data-dshsvc-frame","");let a=!1,r=!1,s=!1,n=!1;for(const e of t.children){const t="string"==typeof e.className?e.className:"";!a&&/sidebarCol/.test(t)?(e.setAttribute("data-dshsvc-sidebar",""),a=!0):!r&&/centerCol/.test(t)?(e.setAttribute("data-dshsvc-center",""),r=!0):!s&&/detailsCol/.test(t)?(e.setAttribute("data-dshsvc-details",""),s=!0):!n&&/rightbarCol/.test(t)&&(e.setAttribute("data-dshsvc-rightbar",""),n=!0)}return!0})())return!1;s.backdrop=document.createElement("div"),s.backdrop.setAttribute("data-dshsvc-backdrop",""),s.backdrop.setAttribute("aria-hidden","true"),Object.assign(s.backdrop.style,{position:"fixed",inset:"0",zIndex:"31",display:"none",background:"rgba(0,0,0,.42)",backdropFilter:"blur(1px)"}),s.backdrop.addEventListener("click",()=>{const e=o();void 0!==e&&s.drawerOpen&&e.toggleSidebar()}),document.body.appendChild(s.backdrop),s.fab=document.createElement("button"),s.fab.type="button",s.fab.setAttribute("data-dshsvc-fab",""),s.fab.setAttribute("aria-label",t("mobile.fab.label")),Object.assign(s.fab.style,{position:"fixed",left:"calc(env(safe-area-inset-left, 0px) + 10px)",top:"calc(env(safe-area-inset-top, 0px) + 12px)",width:"32px",height:"32px",borderRadius:"16px",zIndex:"33",display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",color:"var(--dsw-alias-label-primary)",padding:"0",cursor:"pointer",touchAction:"manipulation"}),s.fab.innerHTML='<svg width="18" height="18" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="1.75" y="2.75" width="12.5" height="10.5" rx="2" stroke="currentColor" stroke-width="1.5"/><line x1="6.25" y1="3.5" x2="6.25" y2="12.5" stroke="currentColor" stroke-width="1.5"/></svg>',s.fab.addEventListener("click",()=>{const e=o();void 0!==e&&e.toggleSidebar()}),document.body.appendChild(s.fab),d();try{s.workspaceObserver=new MutationObserver(()=>{(()=>{if(!i&&s.active){i=!0,setTimeout(()=>{if(i=!1,s.active)try{d(),l()}catch(e){}},50);for(const e of[400,900])setTimeout(()=>{if(s.active)try{d(),l()}catch(e){}},e)}})()}),s.workspaceObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0})}catch(e){s.workspaceObserver=null}s.frameObserver=new MutationObserver(()=>{d(),l()});const e=document.querySelector("[data-dshsvc-frame]");return null!==e&&s.frameObserver.observe(e,{attributes:!0,attributeFilter:["data-sidebar-collapsed","data-details-collapsed","data-rightbar-collapsed"]}),null!==s.mountObserver&&(s.mountObserver.disconnect(),s.mountObserver=null),l(),!0},U=()=>{if(!s.active)return;if(s.active=!1,s.drawerOpen=!1,s.detailsOpen=!1,s.rightbarOpen=!1,s.edgeGesture=null,s.edgeTelemetry=null,(()=>{if(_){_=!1;for(const[e,t,a]of $)try{document.documentElement.removeEventListener(e,t,a)}catch(e){}}})(),document.documentElement.removeAttribute("data-dshsvc-mobile"),document.documentElement.removeAttribute("data-dshsvc-immersive"),null!==s.headerRO){try{s.headerRO.disconnect()}catch(e){}s.headerRO=null}s.headerEl=null,null!==s.frameObserver&&(s.frameObserver.disconnect(),s.frameObserver=null),null!==s.workspaceObserver&&(s.workspaceObserver.disconnect(),s.workspaceObserver=null),null!==s.mountObserver&&(s.mountObserver.disconnect(),s.mountObserver=null),null!==s.errorHandler&&window.removeEventListener("error",s.errorHandler),null!==s.resizeHandler&&window.removeEventListener("resize",s.resizeHandler),s.errorHandler=null,s.resizeHandler=null;for(const e of[s.styleTag,s.backdrop,s.fab,s.debugChip])null!==e&&e.isConnected&&e.remove();for(const e of document.querySelectorAll("[data-dshsvc-frame],[data-dshsvc-sidebar],[data-dshsvc-center],[data-dshsvc-details],[data-dshsvc-rightbar],[data-dshsvc-chat-header]"))e.removeAttribute("data-dshsvc-frame"),e.removeAttribute("data-dshsvc-sidebar"),e.removeAttribute("data-dshsvc-center"),e.removeAttribute("data-dshsvc-details"),e.removeAttribute("data-dshsvc-rightbar"),e.removeAttribute("data-dshsvc-chat-header");const e=(()=>{try{return document.documentElement.style}catch(e){return null}})();if(null!==e)try{e.removeProperty("--dshsvc-header-h")}catch(t){e["--dshsvc-header-h"]=""}s.styleTag=null,s.backdrop=null,s.fab=null,f(),s.debugChip=null,s.debugEnabled=!1,v()},K=()=>{a("mobileAdaptation")&&s.mmqMatches()?(()=>{if(s.active)return;if(void 0===o())return;s.active=!0,document.documentElement.setAttribute("data-dshsvc-mobile",""),(()=>{for(const e of document.querySelectorAll('meta[name="viewport"]')){const t=e.getAttribute("content")||"";/(^|,)\s*viewport-fit\s*=/.test(t)||e.setAttribute("content",""===t.trim()?"viewport-fit=cover":t.trim()+", viewport-fit=cover")}})(),s.styleTag=document.createElement("style"),s.styleTag.dataset.plugin="@gehennawu/dsh-service",s.styleTag.dataset.pluginCss="@gehennawu/dsh-service/mobile.css",s.styleTag.textContent='\n/* 侧栏/详情列改 absolute 后会退出 grid 排版流,中列会被自动放置进第 1 轨\n (0px)而整屏变黑 —— 三列必须用 grid-column 显式钉位,绝不依赖子元素顺序。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] { grid-template-columns: 0px minmax(0, 1fr) 0px !important; }\n/* 0.1.5+ 右栏列(rightbarCol):官方右栏自有窄屏语义(<768 开=浮层全屏 portal 到\n body,闭=0 轨),第三轨改 auto 让官方宽度生效——钉 0px 会把 push 态面板挤没。\n :has 特异性高于上一条,天然覆盖;旧宿主无 rightbar 标记时仍走 0px 模板。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame]:has([data-dshsvc-rightbar]) { grid-template-columns: 0px minmax(0, 1fr) auto !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-sidebar] { grid-column: 1 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-center] { grid-column: 2 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-details] { grid-column: 3 !important; grid-row: 1 !important; }\nhtml[data-dshsvc-mobile] [data-dshsvc-rightbar] { grid-column: 3 !important; grid-row: 1 !important; }\n/* 侧栏/详情列 → overlay 抽屉。两条铁律:\n ① 隐藏禁用 transform —— 设置模态(未 portal)长在本列子树里,\n transform 会成为其 fixed 定位的包含块;\n ② 离屏偏移必须用 vw 长度而非百分比 —— 这些列带显式 grid-column 钉位\n (修中列黑屏所需),绝对定位子项的包含块会变成那格 grid area(0px 宽),\n 百分比对 0 取值全变 0,元素被超约束解算推回屏内盖住会话。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-sidebar] {\n position: absolute !important;\n top: 0 !important;\n bottom: 0 !important;\n left: calc(-100vw - 24px) !important;\n /* 外壳 sidebar slot 的原生展开内容固定 280px;外层也必须同宽,否则右侧\n 会露出一条只有 sidebarCol 背景、没有内容的空带。窄于 280px 时按视口裁切。 */\n width: min(100vw, 280px) !important;\n border-right: none !important;\n z-index: 32;\n transition: left var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile] [data-dshsvc-frame]:not([data-sidebar-collapsed]) [data-dshsvc-sidebar] {\n left: 0 !important;\n box-shadow: 8px 0 32px rgba(0, 0, 0, .22);\n}\n/* 详情列(预览/文件树)→ 移动端永久离屏。官方 computeColumns 在窄视口恒为\n 0 宽(原生手机本就不显示该列),抽屉化只会用空态盖住会话且关闭路径\n 与 backdrop/抽屉状态纠缠(真机反馈)。引擎在激活与属性观察时会自愈式\n closeDetails(),保证 store 也是干净的关闭态。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-details] {\n position: absolute !important;\n top: 0 !important;\n bottom: 0 !important;\n right: calc(-100vw - 24px) !important;\n width: min(92vw, 420px) !important;\n z-index: 30;\n}\n/* 模态 → 全屏面板:外壳 portal 根是 fixed inset:0 flex 容器(无 transform,\n 无 containing-block 陷阱),dialog 改 absolute 四边拉满即可。\n 真机反馈:底部 sheet 顶部留空难看 → 顶部贴顶、圆角归零;\n 刘海/home 条遮挡由 dialog 自身 env() padding 补回。 */\nhtml[data-dshsvc-mobile] div[role="presentation"]:has(> [role="dialog"][aria-modal="true"]) {\n padding: 0 !important;\n}\nhtml[data-dshsvc-mobile] [role="dialog"][aria-modal="true"] {\n position: absolute !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n width: 100% !important;\n max-width: none !important;\n max-height: none !important;\n height: 100% !important;\n border-radius: 0 !important;\n overflow: hidden auto !important;\n flex-direction: column !important;\n padding-top: env(safe-area-inset-top, 0px) !important;\n padding-bottom: env(safe-area-inset-bottom, 0px) !important;\n}\n/* 插件市场(dshmarket)在 ≤560px 媒体查询里把设置导航 display:none 藏掉\n 独占面板(其自有 CSS:[role=dialog]:has([data-dsh-market-root])>nav),\n 手机上会把用户困在市场分区 —— 用更高优先级把横滑标签条顶回来。 */\nhtml[data-dshsvc-mobile] [role="dialog"]:has([data-dsh-market-root]) > nav { display: flex !important; }\n/* 设置页标签条:nav 从 188px 竖列变顶部横滑条(宽度与列向必须显式推翻)。\n 右侧留 52px 给钉到角落的关闭钮。 */\nhtml[data-dshsvc-mobile] [role="dialog"] nav {\n flex-direction: row !important;\n align-items: center !important;\n gap: 6px !important;\n width: auto !important;\n flex: none !important;\n padding: 8px 52px 0 12px !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n border-right: none !important;\n border-bottom: 1px solid var(--dsw-alias-border-l2);\n}\nhtml[data-dshsvc-mobile] [role="dialog"] nav > div { flex: none !important; }\nhtml[data-dshsvc-mobile] [role="dialog"] [class*="navList"] { flex-direction: row !important; }\nhtml[data-dshsvc-mobile] [role="dialog"] [class*="navCell"] { white-space: nowrap !important; flex: none !important; }\n/* 关闭钮钉到设置页右上角并压到面板顶层(原生在内容区头行、导航条下方,\n 会被横滑条/内容重叠遮挡——用户点名要顶层);加不透明圆形底衬保证任何\n 内容上都可辨识,底衬与钮同节点、随之置顶。类哈希 VOzbGW_ 取自\n dsh-client-ui-settings-general SettingsRoot.module.css(rc.2),升级需复核 */\nhtml[data-dshsvc-mobile] [role="dialog"][aria-modal="true"] [class*="VOzbGW_close"] {\n position: absolute !important;\n top: calc(env(safe-area-inset-top, 0px) + 9px) !important;\n right: 10px !important;\n z-index: 60;\n background-color: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-1)) !important;\n border: 1px solid var(--dsw-alias-border-l2) !important;\n border-radius: 999px !important;\n corner-shape: round !important;\n box-shadow: var(--dsw-shadow-lv2, 0 4px 12px rgba(0, 0, 0, .12)) !important;\n}\n/* 设置内容列利用率:手机全屏后内容仍被\n 宿主 options 24px → 插件看板卡 12px → 汇总小卡 10px 的多层内边距套娃收窄\n (单侧 ~46px、约一成屏宽)。只收紧间距不动物料:options 是宿主滚动容器、\n 全分区生效(24→14);看板/图表卡按 testid 收紧;汇总行禁折行——label/value\n 两个 span 在窄卡会被 flex 按比例收缩成 40~70px 盒子导致短标签折行\n (2026-09-18 真机 360/390px 实测),nowrap 后装不下时值列省略兜底。 */\nhtml[data-dshsvc-mobile] [class*="VOzbGW_options"] { padding: 0 14px 18px !important; }\nhtml[data-dshsvc-mobile] [data-testid="usage-statistics-region"] { padding: 8px !important; }\nhtml[data-dshsvc-mobile] [data-testid="usage-chart"] { padding: 8px 8px 2px !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] { column-gap: 8px !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] > span { white-space: nowrap !important; }\nhtml[data-dshsvc-mobile] [data-testid^="usage-summary-"] > span:last-child {\n min-width: 0 !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n}\n/* 设置/任意模态打开时藏抽屉钮:抽屉列自带 z-index:32 层叠上下文会把模态的\n z1000 封顶在 32,body 级 z33 的钮反而浮在设置页上(真机实测)。:has 不支持时\n 退化为旧行为(钮仍显示),无副作用。 */\nhtml[data-dshsvc-mobile] body:has([role="dialog"][aria-modal="true"]) [data-dshsvc-fab] {\n display: none !important;\n}\n/* composer 底行单行紧凑:收紧间距与左右内边距,换出可用宽度。\n 类哈希 uV2eYG_/Sh0Q9G_/pXSMma_ 取自 dsh-client-ui-conversation composer\n (rc.2,0.1.6-alpha.1 漂移至 JObwrW_ 并存),升级需复核。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_row"] {\n column-gap: 4px !important;\n padding-left: 10px !important;\n padding-right: 10px !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_tools"],\nhtml[data-dshsvc-mobile] [class*="uV2eYG_modes"],\nhtml[data-dshsvc-mobile] [class*="uV2eYG_trailing"] { gap: 6px !important; min-width: 0 !important; }\nhtml[data-dshsvc-mobile] [class*="uV2eYG_trailing"] { margin-left: auto !important; }\n/* 0.1.7-alpha.1 在 trailing 内新包了一层 standardControls(会话右槽 + 模型触发钮同组,\n 官方 gap:12px)。外层 trailing 的 gap 收紧管不到它,≤480px 时这 12px 会把整组顶出\n 容器、触发换行错位。老宿主没有这个类,规则不命中,纯增量。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_standardControls"] { gap: 6px !important; min-width: 0 !important; flex: 0 1 auto !important; }\nhtml[data-dshsvc-mobile] [class*="Sh0Q9G_trigger"],\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] { max-width: 38vw !important; }\nhtml[data-dshsvc-mobile] [class*="pXSMma_workspace"] { max-width: 30vw !important; }\n/* 模型选择按钮自适应形态(移动端零截断 + 思考程度常驻):\n 1. 放宽官方 45cqw 硬限宽(max-width: none),使 observeControlRow 能按真实无截断全宽测算;\n 2. 空间充裕时完整展示「厂家图标 + 模型全名 + 思考程度」(零截断);\n 3. 空间不足时(小屏手机、长模型名或被其他插件占用工具栏),模型全名自动收缩,\n 但思考程度(如 High / Low)在紧凑态下依然保持显示([厂家图标] High ▾),\n 无思考程度的模型则收成 45px 纯图标钮,全程单行不折行、不截断文字。 */\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_trigger"] {\n max-width: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_row"][data-model-compact] [class*="_7KE1Ra_triggerEffort"] {\n display: inline-block !important;\n flex-shrink: 0 !important;\n color: var(--dsw-alias-label-caption) !important;\n font-size: 12px !important;\n}\n/* 移动端模型选择弹窗:隐藏「搜索模型」输入框。\n 手机触屏打开下拉菜单时,官方 autoFocus 的搜索框会立即强制唤起软键盘,\n 遮挡大半屏幕与列表项;移动端列表已按厂家分组且篇幅有限,隐藏搜索行更清爽直接。 */\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_searchRow"],\nhtml[data-dshsvc-mobile] [class*="_7KE1Ra_menu"] > div:has([role="searchbox"]) {\n display: none !important;\n}\n/* 工作区侧板(fixed z25 层内的 nArs4W_panel z40)开屏后会盖住它自己的外部\n 开关钮(tab bar 行 nArs4W_toggleButton)——手机上抽屉一开就再没有任何\n 可点的关闭入口(真机反馈「关不上」本体)。把开关钮提到面板之上,\n 恢复「同一颗钮开/关」语义。 */\nhtml[data-dshsvc-mobile] [class*="nArs4W_toggleButton"] {\n position: relative !important;\n z-index: 45 !important;\n}\n/* 会话底部统计条(composer 下方两枚统计:轮/步/tok/s | tok/缓存命中):\n 官方这条行自带左右各 32px 内边距 + 12px 列间距,手机上先吃掉 76px;两枚 pill\n 完整显示需 ~380px,于是官方让它们各自收缩、把每枚的文字截断(0.1.5-rc.2 的\n 截断落在每枚 pill 自己的 bOPqQW_label 上)。用户点名(2026-09-15):「不要换行,\n 保持一行、把空间利用最大化」。\n 修法:只收紧这条行自身的内边距/间距(32→2px、12→3px),行内两枚按官方\n justify-content 居中排开、flex-wrap:nowrap 保持一行;宽度不够时两枚按 shrink\n 比例各让一点(比官方的固定截断少一个数量级),全程不换行、不横向滚动。\n 注意「用满宽度」是靠**收窄行的内边距**换来的,不是靠子项 flex-grow——grow 会把\n 整组推向左侧(老宿主形态,见下方 bOPqQW_root 规则注)。\n 旧宿主(0.1.2-alpha.2 ~ 0.1.4)的单行横滑规则(NDN2W_root)原样保留。 */\n/* 统计条与外部上下文圆环的单行布局:\n 0.1.6 官方把上下文圆环(JObwrW_root / JObwrW_trigger)移入输入框外部下方的\n uV2eYG_dock,与统计胶囊(bOPqQW_root)并列,挤占了移动端可用宽度。\n 修法:\n ① 收紧 uV2eYG_root 两侧内边距至 8px,uV2eYG_dock 间距收至 3px;换行保持开启——\n 圆环与统计胶囊共占第一行,插件的子代理累计行(flex-basis:100%,见 apply.js svcStyle)\n 独占第二行,官方条目之间仍不换行;\n ② 降低统计条与上下文圆环字号至 11px(≤375px 极窄视口阶梯降至 10px),行高 16px;\n ③ 收紧 pill 内边距、sep 间隔及 svg 尺寸(11px),上下文圆环内边距收至 1px 3px;\n 保证从 360px 起所有移动端视口下统计与上下文圆环均零截断、单行排开。\n 旧宿主(0.1.2-alpha.2 ~ 0.1.4)的单行横滑规则(NDN2W_root)原样保留。 */\nhtml[data-dshsvc-mobile] [class*="uV2eYG_root"] {\n padding-left: 8px !important;\n padding-right: 8px !important;\n}\nhtml[data-dshsvc-mobile] [class*="uV2eYG_dock"] {\n gap: 0 3px !important;\n max-width: 100% !important;\n flex-wrap: wrap !important;\n justify-content: center !important;\n}\nhtml[data-dshsvc-mobile] [class*="NDN2W_root"] {\n overflow-x: auto !important;\n overflow-y: hidden !important;\n text-overflow: clip !important;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="NDN2W_root"]::-webkit-scrollbar { display: none !important; }\n/* 统计行在老宿主上是「整行宽 + 居中」,子项 flex-grow 一旦非 0 整组就会左偏:\n 官方这条行的盒子随版本变过两次形态——\n · 0.1.5-rc.2:width:100% + padding:0 32px + justify-content:center,宽度\n **等于整行**(它是 composer 卡片里的一行),行内必有富余宽度;\n · 0.1.6 起:max-width:100%,行**收缩到内容宽**,再由外层 dock 居中,行内零富余。\n 富余宽度落在 justify-content:center 上才是「两枚统计居中」;若给子项 flex-grow,\n 两枚 anchor 先把富余吃干,而行内每枚 pill 是默认 justify-content:flex-start\n ⇒ 文字贴着行内容盒左端、右端留出与富余等宽的空洞(实测 606px 视口尾空 144.7px、\n 整组中心偏移 −72.3px,即「统计是歪的」)。故子项 grow 必须为 0:老宿主上交还给\n 官方 justify-content 居中,新宿主上行本就无富余、写成 0 与 1 等效(空操作)。\n 收缩仍保留 shrink:1,窄视口按比例让位的既定行为不变。 */\nhtml[data-dshsvc-mobile] [class*="bOPqQW_root"] {\n flex-wrap: nowrap !important;\n padding-left: 2px !important;\n padding-right: 2px !important;\n column-gap: 3px !important;\n font-size: 11px !important;\n line-height: 16px !important;\n}\n/* 子项用 flex:0 1 auto(= flex 初始值)而非 flex:1 1 auto:\n grow 必须为 0,否则老宿主把统计整组推歪(见上方 rc.2 注)。 */\nhtml[data-dshsvc-mobile] [class*="bOPqQW_root"] > * { flex: 0 1 auto !important; min-width: 0 !important; }\n/* DSH 0.2.1-alpha.1 起官方把这条统计行拆成两个 dock 条目(id \'activity\' / \'usage\'),\n 行根 .root 被整体删除(bOPqQW_root 在产物中归零,上面两条 bOPqQW_root 规则只在老宿主命中),\n 行级布局改由 dock 承担(uV2eYG_dock 的 gap/padding 规则同上)。\n 新宿主里等价于旧「行内子项」的是条目根:官方新钩子 data-composer-stat 打在\n bOPqQW_anchor 上(形如 span[data-composer-stat] > span.pill),故补一条同形约束;\n bOPqQW_pill/label/sep 两级规则两版同名,继续覆盖新宿主。\n 两套选择器并存:老宿主命中旧锚、新宿主命中新锚,互不干扰。 */\nhtml[data-dshsvc-mobile] [data-composer-stat] {\n flex: 0 1 auto !important;\n min-width: 0 !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_pill"] {\n min-width: 0 !important;\n padding-left: 2px !important;\n padding-right: 2px !important;\n gap: 2px !important;\n font-size: 11px !important;\n line-height: 16px !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_pill"] svg {\n width: 11px !important;\n height: 11px !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_sep"] {\n margin: 0 1px !important;\n}\nhtml[data-dshsvc-mobile] [class*="bOPqQW_label"] {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_root"] {\n flex: none !important;\n min-width: 0 !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] {\n font-size: 11px !important;\n line-height: 16px !important;\n padding: 1px 3px !important;\n gap: 2px !important;\n}\nhtml[data-dshsvc-mobile] [class*="JObwrW_trigger"] svg {\n width: 11px !important;\n height: 11px !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [data-dsh-service-subagent-models-dock] {\n font-size: 11px !important;\n line-height: 16px !important;\n padding: 1px 2px !important;\n}\n@media (max-width: 375px) {\n html[data-dshsvc-mobile] [class*="bOPqQW_root"],\n html[data-dshsvc-mobile] [data-composer-stat],\n html[data-dshsvc-mobile] [class*="bOPqQW_pill"],\n html[data-dshsvc-mobile] [class*="JObwrW_trigger"],\n html[data-dshsvc-mobile] [data-dsh-service-subagent-models-dock] {\n font-size: 10px !important;\n }\n}\n/* Assistant 回合尾部的运行元信息行(MessageIconActions)使用官方目录属性\n data-chat-flow-kind="turn-tail" 定位,内层兜底走回合尾节点自带的稳定\n data-turn-tail(0.1.2-alpha.2 起 data-time-hover-root 已删除):\n 「带 data-turn-tail 的节点」的最后一个子项 = actions 行,其最后一个 span =\n end-clock 时间文本(bundle 源码核实:clock:"end" 渲染在 children 末位)。\n 行容器 min-width:0、时间文本可收缩并省略,以免移动端时间信息把复制/分支\n 按钮挤出可视区域。 */\nhtml[data-dshsvc-mobile] [data-chat-flow-kind="turn-tail"] [data-turn-tail] > :last-child {\n min-width: 0 !important;\n max-width: 100% !important;\n}\nhtml[data-dshsvc-mobile] [data-chat-flow-kind="turn-tail"] [data-turn-tail] > :last-child > span:last-child {\n flex: 1 1 auto !important;\n min-width: 0 !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n padding-inline: 2px !important;\n}\n/* 回到底部按钮簇(官方 *_toBottom 词干后缀,rc.2 Md3f7G_ → 0.1.2-alpha.2 EvIC1a_,\n 自有上箭头 data-dshsvc-user-jump):\n 移动端右侧还有约一行留白(scroll 的 --dsh-composer-side-clearance 侧清理),\n 官方按钮纯位移右移贴边(transform 只动绘制不动布局,sticky 定位不受影响)。\n :not([class*="Slot"]) 排除命名含 Slot 的 sticky 槽层,只移官方按钮本体。自有上箭头的\n right 已由 JS 按官方按钮实测右缘计算,再做同一平移会重复右移(实测偏差 28px)。\n 方向:正 translateX 向右;位移量 = 侧清理 +16(scroll 右 padding)再留 4px 缓冲。 */\nhtml[data-dshsvc-mobile] [class*="_toBottom"]:not([class*="Slot"]):not([data-dshsvc-user-jump]) {\n transform: translateX(calc(var(--dsh-composer-side-clearance, 16px) + 16px - 4px)) !important;\n}\n/* 左上角抽屉钮:悬停/按压用外壳交互底色 */\nhtml[data-dshsvc-mobile] [data-dshsvc-fab]:hover,\nhtml[data-dshsvc-mobile] [data-dshsvc-fab]:active { background: var(--dsw-alias-interactive-bg-hover) !important; }\n/* 抽屉钮让位内边距:FAB 是 fixed 覆盖件,中心列里**每一屏**的头行都要给它让位,\n 所以选择器按几何泛化(任意 header);但让位**只写 padding-left** ——\n 旧写法把整条 padding 按会话头部的几何一起写死(10px 20px 0 46px),连带改写\n 了官方其它页面头部自己的内边距:官方插件面板页头部(PluginManagerPage\n .X_2TxG_pageHead)官方只有 padding-top:28px,被改成 10px/20px 后头行可用宽度\n 再少 20px,412px 视口实测简介与「添加插件」双双折行(详见下方插件面板页组)。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header { padding-left: 46px !important; }\n/* 会话头部自己的移动端内边距(官方 10px 28px 0 [10px] 的收紧版:右 28→20)\n 只作用于会话头部本体:引擎标记属性优先,官方类哈希兜底覆盖未打标的空头部\n (wSkVaW_ 取自 dsh-client-ui-conversation,0.1.5-rc.2 与 0.2.0-rc.1 两代同名同值,\n 升级需复核)。其余页面头部保持官方纵向与右侧内边距不变。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header[class*="wSkVaW_header"],\nhtml[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header[data-dshsvc-chat-header] { padding: 10px 20px 0 46px !important; }\n/* 官方插件面板页(dsh-client-ui-plugin-manager 的 main 面板,页面根\n section[data-plugin-panel],头行 = 直接子 header[data-window-drag])移动端适配。\n 官方 pageHead 是**不换行**的单行 flex:左「标题+简介」、右「刷新+添加插件」,\n 两块固有宽度 ≈ 154 + 16 + 140;移动端中心列还要扣掉抽屉钮让位的 46px 与页面\n 自身的左右各 24px。视口 ≲404px 起两块互相挤压(真机 412px 实测:简介折两行、\n 末字孤行;「添加插件」被压到 90px 后按钮内文案折两行、溢出 32px 高的胶囊)。\n 修法:头行允许换行 + 工具栏保持固有宽度并右对齐 —— 放得下仍是一行,放不下\n 工具栏整体落到第二行右缘,标题/简介/按钮文案各自单行,不再互相借宽度;\n 按钮文案 nowrap 是第二道保险(任何容器宽度下都不许在胶囊内折行)。\n data-plugin-panel / data-window-drag 为官方稳定钩子;类哈希 X_2TxG_ 取自\n dsh-client-ui-plugin-manager PluginManagerPage.module.css(0.2.0-rc.1),\n 升级需复核(与 uV2eYG_ 等同规)。 */\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] { flex-wrap: wrap !important; }\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] > :first-child { min-width: 0 !important; }\nhtml[data-dshsvc-mobile] [data-plugin-panel] > [data-window-drag] > [class*="X_2TxG_toolbar"] {\n margin-left: auto !important;\n flex: none !important;\n}\nhtml[data-dshsvc-mobile] [data-plugin-panel] [class*="X_2TxG_addButton"] { white-space: nowrap !important; }\n/* 会话顶栏移动端适配:\n titleRow 里 标题crumb / 「N 个子代理」计数芯片 / 预设芯片(创造模式)互相挤压——\n 官方 crumbs 自带 overflow:hidden,放不下的尾部被**硬裁**:计数芯片拦腰截断\n (真机 390px 实测裁掉 49px,视觉即「1 个子代…」),标题缩到 ~119px。\n 只收紧固定几何 + 改收缩优先级,不重挂 DOM、不藏任何信息:\n ① 头部右内边距 28→20:corner 钮自带 margin-right:-16px 悬出,20 仍留 4px 边距;\n ② 更多操作钮的 utilities 左距 20→4(blank 空头部该层 :empty 隐藏,不受影响);\n ③ titleCluster 列距 10→6;\n ④ 计数组(分隔符+计数触发钮)列距 10→4,并 flex:none 不可挤压——标题按钮\n 自带 overflow:hidden + ellipsis(min-content=0)天生是收缩担当,让省出的\n 宽度全部归标题;计数文案与触发钮 aria-label(「N 个子代理」)原样保留。\n :not(:has(switcherTrigger)) 守卫带 lineage 切换器的根(其内部自有\n min-width:0 收缩链,钉死会溢出);:has 不支持时整条失效,退回官方行为。\n 类哈希 wSkVaW_ 取自 dsh-client-ui-conversation ConversationRoot.module.css、\n ZKlsPq_ 取自 dsh-client-ui-subagent SubagentHeaderLineage.module.css\n (均 0.1.6-alpha.2),升级需复核。 */\nhtml[data-dshsvc-mobile] [class*="wSkVaW_headerUtilities"] { margin-left: 4px !important; }\nhtml[data-dshsvc-mobile] [class*="wSkVaW_titleCluster"] { gap: 6px !important; }\nhtml[data-dshsvc-mobile] [class*="ZKlsPq_root"] { gap: 4px !important; }\nhtml[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) { flex: none !important; }\n/* 动作芯片泊位 v2(模式回标题行,子代理+任务下标签行\n 右锚成对;官方标签行没有第三方挂载点,泊位=自有 CSS absolute 定位):\n · 标签行官方 gap 36→20,标签内容尾按含 SSH 时 ≈172px;\n · 任务芯片(headerActions 内任务 div:has(> QsffPG_trigger),alpha.2 无 QsffPG_root 类;运行中带箭头自然宽 ~151.5px)right:110 —— 右侧 94px\n 让给子代理芯片(本次会话实测宽 93.5px,任务与子代理间隔至少 0.5px),右锚成\n 「[任务][子代理]」两枚一排(第三方插件将来若也泊到此带,右缘 16px 起排不受影响);\n max-width calc(100vw − 282px) 封顶(右距 110 + 含 SSH 的标签尾约 172),\n ≤390 档计数文字省略,320 档可用宽仅 38px;\n · 子代理芯片(ZKlsPq_root)right:16 最贴右;泊离标题后分隔符「/」失去对象,隐藏;\n · 计数文字 nowrap+ellipsis 可省;下拉箭头保留;\n 320 档任务文字宽 0,但 spinner/箭头可见,完整 aria-label 保留;\n · 旧宿主两枚芯片的下拉菜单(锚在各自 root 上 top:100%+5、left:0)改右锚展开并按\n 视口封顶(旧版 max-width 100vw−122 沿用既有菜单预算),否则贴右泊位时\n 336px 菜单会越出屏幕(旧宿主 390 档实测左越 46px);alpha.2 任务菜单 portal\n 至 body 后按触发器位置算 fixed 坐标,不能覆盖其 left/right;\n · 预设芯片(SVAs4q_label)不再泊动——随官方 headerActions 留在标题行\n (「模式=会话身份」与标题同级),第三方动作芯片同样留官方原位不受泊位管辖;\n 子代理计数离开 crumbs 后标题吃满整行(390 档 198px);\n · ≤560 门:561~1023 行宽足够(标题 ≥115px),保持官方在流。blank 空头部\n :not 守卫不泊。类哈希 QsffPG_ 取自 dsh-client-ui-jobs JobListAction.module.css\n (旧版仍有根类;新版仅有触发按钮)。结构化锚只匹配 headerActions 子树中直属包含任务按钮的 div(alpha.2 中间多一层 data-slot 包装),\n :has 不支持时回落官方布局;未来版本仍须复核哈希。 */\n@media (max-width: 560px) {\n html[data-dshsvc-mobile] [data-dshsvc-frame] > :nth-child(2) header:not([class*="wSkVaW_headerBlank"]) { position: relative !important; }\n html[data-dshsvc-mobile] [class*="wSkVaW_tabs"] { gap: 20px !important; }\n html[data-dshsvc-mobile] [class*="wSkVaW_headerActions"] div:has(> button[class*="QsffPG_trigger"]),\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) {\n position: absolute !important;\n bottom: 4px !important;\n z-index: 2;\n }\n html[data-dshsvc-mobile] [class*="wSkVaW_headerActions"] div:has(> button[class*="QsffPG_trigger"]) {\n right: 110px !important;\n max-width: calc(100vw - 282px) !important;\n }\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) {\n right: 16px !important;\n }\n /* 分隔符/箭头/收缩只作用于已泊出的子代理根;带 lineage 切换器而留在\n crumbs 里的根(:has 守卫排除的那支)保持官方形态不受影响。 */\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_separator"] { display: none !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_trigger"],\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_trigger"] { min-width: 0 !important; max-width: 100% !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_trigger"] > svg:last-child,\n html[data-dshsvc-mobile] [class*="ZKlsPq_root"]:not(:has([class*="ZKlsPq_switcherTrigger"])) [class*="ZKlsPq_trigger"] > svg:last-child { flex: none !important; }\n html[data-dshsvc-mobile] [class*="QsffPG_count"] {\n min-width: 0 !important;\n flex: 0 1 auto !important;\n margin: 0 2px !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n }\n html[data-dshsvc-mobile] [class*="QsffPG_root"] > [class*="QsffPG_menu"],\n html[data-dshsvc-mobile] [class*="ZKlsPq_menu"] {\n left: auto !important;\n right: 0 !important;\n max-width: calc(100vw - 122px) !important;\n }\n /* 预设芯片右靠:margin-left:auto 把 crumbs 与\n 动作组之间的全部富余收到中间——标题贴左、模式芯片贴住更多钮(间距 4px),\n 标题长短变化时芯片位置稳定不飘。 */\n html[data-dshsvc-mobile] header:not([class*="wSkVaW_headerBlank"]) [class*="wSkVaW_headerActions"] { margin-left: auto !important; }\n}\n/* 模式芯片(创造/默认等预设名)恢复可见 —— 官方 0.1.7-rc.1 起的窄屏隐藏语义\n 与移动端「模式=会话身份」的定稿冲突(todo-82 方案二:模式芯片留标题行)。\n 取证(0.1.7-rc.2 真机 + npm 产物逐版对照):\n · 隐藏来源是官方 dsh-client-ui-agent-preset 的 AgentPresetLabel.module.css\n ".SVAs4q_label{display:none}",容器是官方 dsh-client-ui-conversation\n ".wSkVaW_titleRow{container-type:inline-size}";0.1.7-alpha.2 及以前两处都不存在。\n · 判定宽度是 titleRow(非视口):本插件移动端下 titleRow = 视口 − 66px,\n 540 阈值 ⇒ 606px 视口起才显示,320~606 全档(所有手机)均被隐藏。\n · 覆盖只在 "html[data-dshsvc-mobile]" 内生效(≥1024 引擎拆卸后官方语义逐字不变);\n 与官方规则同为 (0,1,0) 特异性,靠 !important 取胜。\n 恢复后余量实测:390px+ 标题完整不裁(198px),仅 320/360/375 档标题按省略号\n 收缩(分别 -70/-30/-15px),文档零横向溢出、titleRow 溢出恒为官方 corner 钮\n 固有的 16px —— 与恢复前逐字相同。 */\nhtml[data-dshsvc-mobile] [class*="SVAs4q_label"] { display: inline-flex !important; }\n/* Agent Team 弹窗右锚:修复移动端面板右侧超出视口。\n 面板 = 官方 @deepseek-ai/dsh-experimental-client-ui-agent-team 的 TeamAction,\n 注册在 conversation.session.header.actions(与任务/子代理芯片同槽)。它自己的\n CSS 是 position:absolute; left:0; top:calc(100% + 5px);\n width:min(560px,100vw - 32px)——**左锚在触发钮左缘**,而该槽位在移动端位于\n 头部右侧(右锚泊位之外),面板便整体右移越屏:真机实测 320~560px 越出\n 112~352px、768/1023 越出 198/140px(面板右缘 = 触发钮左缘 + 面板宽)。\n\n 修法(三条规则,均基于稳定属性而非类哈希):\n ① 面板的包含块要落在**头部**而不是触发钮:会话头部在 ≥561px 官方为 static,\n 而 .root{position:relative} 会让面板锚在触发钮上 → 引擎已打的\n data-dshsvc-chat-header 上补 position:relative(≤560 档泊位组已设过,\n 这里把覆盖面扩到整个移动端,幂等),再把 TeamAction 根改 static 把\n 包含块让给头部;\n ② 面板本身改右锚:left:auto + right:16px,与它自带的\n 100vw − 32px 宽度公式(两侧各 16px)对称,并补 max-width 封顶以防\n 官方改宽。桌面 ≥1024 引擎拆卸、标记与属性同时下线 → 官方几何逐字不变。\n\n 选右锚而非 fixed:沉浸态头部带 transform(translateY(-100%)),被变换的\n 祖先会成为 fixed 后代的包含块——本文件顶部记载的 containing-block 陷阱;\n 真机实测 fixed 变体在沉浸态随头部一起位移(top 84→-68),与 absolute 无异,\n 却另外硬编码了一份纵向几何。右锚复用头部包含块,两者行为一致且不写死 top。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-chat-header] { position: relative !important; }\nhtml[data-dshsvc-mobile] [data-team-action] { position: static !important; }\nhtml[data-dshsvc-mobile] [data-team-action] [role="dialog"] {\n left: auto !important;\n right: 16px !important;\n max-width: calc(100vw - 32px) !important;\n}\n/* 刘海安全区:viewport-fit=cover 后由 env() 补回遮挡区 */\nhtml[data-dshsvc-mobile] body {\n padding-top: env(safe-area-inset-top, 0px);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n box-sizing: border-box;\n}\n/* 双击缩放与 iOS 聚焦放大 */\nhtml[data-dshsvc-mobile] button,\nhtml[data-dshsvc-mobile] a,\nhtml[data-dshsvc-mobile] [role="button"],\nhtml[data-dshsvc-mobile] input,\nhtml[data-dshsvc-mobile] textarea,\nhtml[data-dshsvc-mobile] select { touch-action: manipulation; }\nhtml[data-dshsvc-mobile] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),\nhtml[data-dshsvc-mobile] textarea { font-size: max(16px, 1em) !important; }\n/* composer 防挤压:真机反馈后迭代。0.1.5-rc.2 起外壳已无含 "toolbar"/"inputTriggers"\n 的类名(活页面命中 0,2026-09-15 死规则审计),两条泛化规则删除;只留仍命中的\n "composer"(composerSeat 等)——min-width:0 + max-width:100% 防子项撑破容器。 */\nhtml[data-dshsvc-mobile] [class*="composer" i] { min-width: 0 !important; max-width: 100% !important; }\n/* —— 滑动沉浸(v0.36;2026-09-15 几何返工)——\n 原先用 transform: translateY(115%) 把 composer 座滑出视口:**变换后的视觉溢出会被\n 计入滚动容器的可滚动区域**(实测 +147px),于是「沉浸态滑到底」时内容被抬高、底部露出\n 291px 空带(用户反馈「对话框和输出空一大段」);回显时这 147px 又消失,滚动位置随之\n 错位、最后一段被输入框压住(用户反馈「输出跑到对话框下面去了」)。\n 现改为沉浸时把该座**移出文档流**(让出 128px 占位、内容真正铺满整屏)+ 淡出:既不加\n 可滚动溢出,也不改 --dsh-composer-height(ResizeObserver 仍读到座高,外壳的浮钮偏移\n 与贴底锚定不受影响)。回显侧因占位收回会改变可滚动长度,由 setImmersive 做「贴底补偿」。 */\nhtml[data-dshsvc-mobile] [data-composer-seat] {\n transition: opacity var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease) !important;\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-composer-seat] {\n position: absolute !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n opacity: 0 !important;\n visibility: hidden !important;\n pointer-events: none !important;\n}\n/* 会话头部(面包屑+视图标签)在滚动体外面,藏在根列里:translateY(-100%) 上滑出\n data-phase=active 根的 overflow:hidden 裁剪区,负 margin-top 用引擎测得的高度\n (--dshsvc-header-h,ResizeObserver 实时校正;老内核无 RO 时回退常量)补位,\n 否则留一条空带。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-chat-header] {\n transition: transform var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease),\n margin-top var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-chat-header] {\n transform: translateY(-100%) !important;\n margin-top: calc(0px - var(--dshsvc-header-h, 76px)) !important;\n}\n/* 左上角侧栏抽屉图标(FAB)在进入对话框隐藏全屏模式(沉浸态)时同步向上滑出淡出,\n 参照右上角右侧栏抽屉按钮随顶栏上滑隐藏的体验,保持全屏阅读区域整洁。 */\nhtml[data-dshsvc-mobile] [data-dshsvc-fab] {\n transition: transform var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease),\n opacity var(--ds-transition-duration-slow, .25s) var(--ds-ease-in-out, ease);\n}\nhtml[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-fab] {\n transform: translateY(calc(0px - var(--dshsvc-header-h, 76px) - env(safe-area-inset-top, 0px))) !important;\n opacity: 0 !important;\n pointer-events: none !important;\n}\n@media (prefers-reduced-motion: reduce) {\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-composer-seat],\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-chat-header],\n html[data-dshsvc-mobile] [data-dshsvc-chat-header],\n html[data-dshsvc-mobile][data-dshsvc-immersive] [data-dshsvc-fab],\n html[data-dshsvc-mobile] [data-dshsvc-fab] { transition: none !important; }\n}\n',document.head.appendChild(s.styleTag),F()||(()=>{if(null===s.mountObserver&&"function"==typeof MutationObserver)try{s.mountObserver=new MutationObserver(()=>{F()}),s.mountObserver.observe(document.documentElement,{childList:!0,subtree:!0})}catch(e){s.mountObserver=null}})(),(()=>{if(!_){_=!0;for(const[e,t,a]of $)try{document.documentElement.addEventListener(e,t,a)}catch(e){}}})(),y();let e=!1;try{e=new URLSearchParams(window.location.search).has("dshsvc-mobile-debug")}catch(e){}e&&(s.debugEnabled=!0,s.errorHandler=()=>{s.errorCount+=1,V()},window.addEventListener("error",s.errorHandler),s.resizeHandler=()=>V(),window.addEventListener("resize",s.resizeHandler),s.debugChip=document.createElement("div"),s.debugChip.setAttribute("data-dshsvc-debug",""),Object.assign(s.debugChip.style,{position:"fixed",left:"8px",bottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)",zIndex:"60",maxWidth:"94vw",padding:"4px 8px",borderRadius:"8px",font:"11px/1.5 var(--ds-font-family-code, monospace)",background:"var(--dsw-alias-bg-layer-2, #333)",color:"var(--dsw-alias-label-primary, #eee)",pointerEvents:"none",whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis"}),s.debugChip.title=t("mobile.debug.title"),document.body.appendChild(s.debugChip),V()),l()})():U()};try{s.mq=window.matchMedia("(max-width: 1023px)")}catch(e){s.mq=null}return s.mmqMatches=()=>{try{return null!==s.mq&&!0===s.mq.matches}catch(e){return!1}},null!==s.mq&&(s.mqHandler=()=>K(),"function"==typeof s.mq.addEventListener?s.mq.addEventListener("change",s.mqHandler):"function"==typeof s.mq.addListener&&s.mq.addListener(s.mqHandler)),{evaluate:K,dispose:()=>{U(),null!==s.mq&&null!==s.mqHandler&&("function"==typeof s.mq.removeEventListener?s.mq.removeEventListener("change",s.mqHandler):"function"==typeof s.mq.removeListener&&s.mq.removeListener("change",s.mqHandler)),s.mqHandler=null}}}const we=()=>{const e=e=>{if("function"==typeof e.hasAttribute)try{return e.hasAttribute("data-conversation-scroll")}catch(e){return!1}try{return null!==e.attributes&&"function"==typeof e.attributes.getNamedItem&&null!==e.attributes.getNamedItem("data-conversation-scroll")}catch(e){return!1}};return{toBottomSlot:()=>{try{return document.querySelector('[class*="_toBottomSlot"]')}catch(e){return null}},toBottomButton:e=>{try{return e.querySelector('[class*="_toBottom"]:not([class*="Slot"])')}catch(e){return null}},isToBottomButton:e=>{try{return null!=e&&"function"==typeof e.closest&&null!==e.closest('[class*="_toBottom"]:not([class*="Slot"])')}catch(e){return!1}},scrollportOf:t=>{try{let a=t;for(;null!==a&&a!==document.documentElement&&!e(a);)a=a.parentNode;return null!==a&&a!==document.documentElement?a:t.parentNode}catch(e){return null}},officialTurnNavigatorVisible:e=>{try{if("function"!=typeof getComputedStyle)return!1;if(null===e||"function"!=typeof e.querySelector)return!1;const t=e.querySelector('[class*="_rail"]');return null!==t&&"none"!==getComputedStyle(t).display}catch(e){return!1}},userRows:e=>{const t=[];try{if("function"!=typeof e.querySelectorAll)return t;for(const a of e.querySelectorAll('[data-chat-flow-kind="user"]'))t.push(a)}catch(e){}return t},flowTopOf:(e,t)=>{try{return t.getBoundingClientRect().top-e.getBoundingClientRect().top}catch(e){return 0}},loadOlderButton:e=>{try{return"function"==typeof e.querySelector?e.querySelector('[class*="_older"] button'):null}catch(e){return null}}}};const xe=({ctx:e,getModelDirectories:t})=>{const a={styleTag:null,observer:null,observerCreated:!1,unsubscribe:null,unsubscribeSessions:null,unsubscribeQuota:null,seat:null,trigger:null,lastProvider:null,lastSession:void 0,disposed:!1,menuOpen:!1},r=e=>{try{const t=String(e?.textContent??"").trim();return""===t?null:t}catch(e){return null}},s=e=>{try{if(null==e||"function"!=typeof e.querySelectorAll)return;for(const t of Array.from(e.querySelectorAll(`[${y}]`)))try{t.remove()}catch(e){}}catch(e){}},n=e=>{s(e),M(e,v),M(e,d),M(e,c),H(e,u),H(e,p)},o=()=>{const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return;try{for(const t of Array.from(e.querySelectorAll(`[${y}]`)))try{t.remove()}catch(e){}}catch(e){}let t=[];try{t=Array.from(e.querySelectorAll(`[${v}]`))}catch(e){t=[]}for(const e of t)n(e)},l=()=>{try{const t=e.sessions;if(t&&t.list&&"function"==typeof t.list.getSnapshot){const e=t.list.getSnapshot();if(e&&"string"==typeof e.current&&""!==e.current)return e.current;if(e&&e.byId){const t=Object.values(e.byId).find(e=>(e?.retainedBy?.mainView??0)>0);if(t&&"string"==typeof t.id&&""!==t.id)return t.id;if(t&&"string"==typeof t.sessionId&&""!==t.sessionId)return t.sessionId;const a=Object.keys(e.byId);if(1===a.length)return a[0]}}}catch(e){}},i=e=>{const t=P();if(null===t)return null;const a=[];null!=e&&"function"==typeof e.querySelector&&a.push(e),"function"==typeof t.querySelector&&a.push(t);for(const e of a)try{const t=e.querySelector(`[data-slot="${g}"] button`);if(null!=t)return t}catch(e){}for(const e of a)try{const t=e.querySelector(f);if(null!=t)return t}catch(e){}if(null!=e&&"function"==typeof e.querySelectorAll)try{for(const t of Array.from(e.querySelectorAll(h))){const e=`${R(t,"aria-label")??""} ${R(t,"title")??""}`;if(/模型|Model/i.test(e))return t}}catch(e){}return null},E=e=>{null!=e&&(M(e,m),M(e,d),M(e,c),H(e,u),H(e,p),H(e,b))},C=()=>{if(a.disposed)return;const e=(()=>{const e=P();if(null===e)return null;try{return e.querySelector("[data-composer-seat]")}catch(e){return null}})();if(null!==e){const t=i(e);null!==t&&(a.trigger=t)}if((()=>{if(a.disposed)return;const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return;let t=[];try{t=(()=>{const e=P();if(null===e||"function"!=typeof e.querySelectorAll)return[];const t=(e,t)=>{try{return null!=e&&"function"==typeof e.querySelectorAll?Array.from(e.querySelectorAll(t)):[]}catch(e){return[]}},r=(e=>{const t=P();if(null===t||null==e)return null;const a=R(e,"aria-controls");if("string"!=typeof a||""===a)return null;try{return"function"==typeof t.getElementById?t.getElementById(a):null}catch(e){return null}})(a.trigger);if(null!=r){const e=t(r,w);if(e.length>0)return e;const a=t(r,x);if(a.length>0)return a}return t(e,x)})()}catch(e){return}if(0!==t.length){a.menuOpen=!0;for(const a of t){const t=r(a);if(null===t)continue;const o=T(t,{forComposer:!0});if(null===o){n(a);continue}const l=1!==o.spec.c,i=R(a,d);if((!(()=>{try{return null!==a.querySelector(`[${y}]`)}catch(e){return!1}})()||i!==o.slug)&&(s(a),"function"==typeof e.createElement)){try{const t=e.createElement("span");if(t.setAttribute(y,o.slug),t.setAttribute(d,o.slug),t.setAttribute(c,l?"mono":"color"),t.setAttribute("aria-hidden","true"),t.style&&"function"==typeof t.style.setProperty){t.style.setProperty(u,k(o.spec,l));const e="number"==typeof o.spec.o&&o.spec.o>0?o.spec.o:1;1!==e&&t.style.setProperty(p,`${(13*e).toFixed(2)}px`)}a.insertBefore(t,a.firstChild)}catch(e){}z(a,v,o.slug),z(a,d,o.slug),z(a,c,l?"mono":"color")}}}else a.menuOpen&&(a.menuOpen=!1,o())})(),null===e)return void(a.seat=null);a.seat=e,l()!==a.lastSession&&(a.lastProvider=null,D(),L());const g=i(e);a.trigger=g;const h=(()=>{const e=l();if(null==e)return null;try{const a=t();if(void 0===a||"function"!=typeof a.directoryFor)return null;const r=a.directoryFor(e),s=r&&r.store&&"function"==typeof r.store.getSnapshot?r.store.getSnapshot():null,n=s&&s.current?s.current.provider:void 0;return"string"==typeof n&&""!==n?n:null}catch(e){return null}})();if(h===a.lastProvider&&I(e,c)&&(null===g||I(g,m)))return;a.lastProvider=h;const f=null===h?null:T(h,{forComposer:!0});if(null===f)return q(e),void E(g);const S=1!==f.spec.c;O(e,u,k(f.spec,S));const C="number"==typeof f.spec.o&&f.spec.o>0?f.spec.o:1;1===C?H(e,p):O(e,p,`${(15*C).toFixed(2)}px`),z(e,d,f.slug),z(e,c,S?"mono":"color"),((e,t)=>{if(null==e)return;const a=1!==t.spec.c;z(e,m,t.slug),z(e,d,t.slug),z(e,c,a?"mono":"color"),O(e,u,k(t.spec,a));const r="number"==typeof t.spec.o&&t.spec.o>0?t.spec.o:1;1===r?H(e,p):O(e,p,`${(15*r).toFixed(2)}px`),O(e,b,"none")})(g,f)},q=e=>{M(e,d),M(e,c),H(e,u),H(e,p)},D=()=>{const e=P(),t=[];if(null!==e&&"function"==typeof e.querySelectorAll){let a=[];try{a=Array.from(e.querySelectorAll(`[${m}]`))}catch(e){a=[]}for(const e of a)t.push(e)}null!==a.trigger&&t.push(a.trigger);for(const e of t)E(e);if(a.trigger=null,null!==a.seat&&q(a.seat),null!==e&&"function"==typeof e.querySelectorAll){let t=[];try{t=Array.from(e.querySelectorAll(`[${c}]`))}catch(e){t=[]}for(const e of t)q(e)}o(),a.seat=null,a.lastProvider=null},L=()=>{if(null!==a.unsubscribe){try{a.unsubscribe()}catch(e){}a.unsubscribe=null}const e=l();if(a.lastSession=e,null!=e)try{const r=t();if(void 0===r||"function"!=typeof r.directoryFor)return;const s=r.directoryFor(e);if(s&&s.store&&"function"==typeof s.store.subscribe){const e=s.store.subscribe(()=>C());if(a.unsubscribe="function"==typeof e?e:null,"function"==typeof s.load)try{const e=s.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}}catch(e){}};return{start:()=>{const t=P();if(null===a.styleTag&&null!==t)try{const e=t.createElement("style");e.dataset.plugin="@gehennawu/dsh-service",e.dataset.pluginCss="@gehennawu/dsh-service/model-icons.css",e.textContent=A,t.head.appendChild(e),a.styleTag=e}catch(e){}if((()=>{if(null===a.unsubscribeQuota)try{if(void 0===S||"function"!=typeof S.subscribe)return;const e=S.subscribe(()=>{a.disposed||(a.lastProvider=null,C())});a.unsubscribeQuota="function"==typeof e?e:null}catch(e){}})(),(()=>{if(null===a.unsubscribeSessions)try{const t=e.sessions;if(!t||!t.list||"function"!=typeof t.list.subscribe)return;const r=t.list.subscribe(()=>{a.disposed||l()!==a.lastSession&&(a.lastProvider=null,D(),L(),C())});a.unsubscribeSessions="function"==typeof r?r:null}catch(e){}})(),L(),C(),null===a.observer&&null!==t&&"function"==typeof MutationObserver&&!a.observerCreated){a.observerCreated=!0;try{a.observer=new MutationObserver(()=>{null===a.seat||"function"!=typeof t.contains||t.contains(a.seat)||(a.seat=null,a.lastProvider=null),C()}),a.observer.observe(t.documentElement,{childList:!0,subtree:!0})}catch(e){a.observer=null}}},stop:()=>{if(a.disposed=!0,null!==a.unsubscribe){try{a.unsubscribe()}catch(e){}a.unsubscribe=null}if(null!==a.unsubscribeSessions){try{a.unsubscribeSessions()}catch(e){}a.unsubscribeSessions=null}if(null!==a.unsubscribeQuota){try{a.unsubscribeQuota()}catch(e){}a.unsubscribeQuota=null}if(null!==a.observer){try{a.observer.disconnect()}catch(e){}a.observer=null}if(D(),null!==a.styleTag){try{a.styleTag.remove()}catch(e){}a.styleTag=null}},apply:C,clear:D,revive:()=>{a.disposed=!1,a.observerCreated=!1,a.lastSession=void 0,a.lastProvider=null,a.seat=null,a.trigger=null,a.menuOpen=!1}}};function ke(e){const t=null!==e&&"object"==typeof e?e:{};return{status:"ready"===t.status||"loading"===t.status||"unavailable"===t.status?t.status:"unavailable",value:void 0!==t.value&&null!==t.value&&"object"==typeof t.value?t.value:void 0,base:t.base,user:t.user,revision:t.revision,writable:!0===t.writable,mode:"host"===t.mode?"host":"memory"}}function Se({ctx:e,namespace:t,defaults:a,React:r}){const s=new Set,n=()=>ke({status:"ready",value:l(),revision:0,writable:!1,mode:"memory"});let o=Object.assign({},a);const l=()=>Object.assign({},o);let i=n(),d=null,c=null,u=!1;const p=e=>{i=e;for(const e of[...s])try{e()}catch(e){}},m=()=>{u||p((()=>{if(null===d)return n();try{return ke(d.getSnapshot())}catch(e){return n()}})())};let g="memory";const h=(e,a)=>{if(!u){if(null!==c){try{c()}catch(e){}c=null}if(d=null==a?null:function(e,t){if(null===e||"object"!=typeof e)return null;let a;try{"function"==typeof e.get?a=e.get(t):"function"==typeof e.bind&&(a=e.bind({namespace:t}))}catch(e){return null}return null===a||"object"!=typeof a||"function"!=typeof a.getSnapshot||"function"!=typeof a.subscribe?null:a}(a,t),g=null===d?"memory":e,null!==d){if("function"==typeof d.subscribe)try{c=d.subscribe(m)}catch(e){c=null}m()}else p(n())}},f=(e,t)=>{if(null!=t)return"configForms"===e?"function"==typeof t.get?e:void 0:"settingsScope"===e&&"function"==typeof t.bind?e:void 0},b=(()=>{for(const t of["configForms","settingsScope"]){let a;try{a="function"==typeof e.get?e.get(t):void 0}catch(e){a=void 0}if(void 0!==f(t,a))return{name:t,service:a}}})();void 0!==b&&h(b.name,b.service);for(const t of["configForms","settingsScope"]){if("function"!=typeof e.inject)break;try{e.inject([t],e=>{if(u)return;const a=null!==e&&"object"==typeof e?e[t]:void 0;void 0!==f(t,a)&&("settingsScope"===t&&"configForms"===g||h(t,a))})}catch(e){}}const v={getSnapshot:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e)),set:async(e,t)=>{if(null!==d&&"function"==typeof d.set)return d.set(e,t);o=Object.assign({},o,{[e]:t}),p(n())},unset:async e=>{if(null!==d&&"function"==typeof d.unset)return d.unset(e);o=Object.assign({},o),delete o[e],p(n())},kind:()=>g,dispose:()=>{if(u=!0,null!==c){try{c()}catch(e){}c=null}d=null,s.clear()}},y=()=>i,w=()=>Object.assign({},a,i.value||{});return{featureScope:v,featureSnapshot:y,featureValue:w,featureEnabled:e=>!1!==w()[e],useFeatures:()=>{const[e,t]=r.useState(y());return r.useEffect(()=>v.subscribe(()=>t(y())),[]),{snapshot:e,value:Object.assign({},a,e.value||{})}}}}return a.inject=["slots","connection","timer","locale","sessions"],a.apply=function(t){const{useState:a,useEffect:o,useRef:l}=r,i=new Set(["quota","quota-reset-card","health"]),d=(e,a)=>{const r=null===a||"object"!=typeof a||Array.isArray(a)?{}:a,s=i.has(e)&&void 0===r.timezoneOffsetMinutes?{...r,timezoneOffsetMinutes:(new Date).getTimezoneOffset()}:r,n=i.has(e)?{...s,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}:s;if("quota-reset-card"===e&&"string"==typeof n.expiresAt&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?$/.test(n.expiresAt)){const e=new Date(n.expiresAt);Number.isFinite(e.getTime())&&(n.expiresAt=e.toISOString())}return Promise.resolve(t.connection.rpc.call("/dsh-service",e,n)).then(ue)};let c;"undefined"!=typeof document&&document.head&&(c=document.createElement("style"),c.dataset.plugin="@gehennawu/dsh-service",c.dataset.pluginCss="@gehennawu/dsh-service/theme-tokens.css",c.textContent=["body{--dsh-svc-page-bg:#f4f5f7;--dsh-svc-content-bg:var(--dsw-alias-bg-layer-2,#ffffff);--dsh-svc-raised-bg:var(--dsw-alias-bg-layer-3,#ffffff);--dsh-svc-text:var(--dsw-alias-label-primary,#202124);--dsh-svc-text-muted:var(--dsw-alias-label-secondary,#6b7280);--dsh-svc-border:var(--dsw-alias-border-l1,#e5e7eb);--dsh-svc-brand:var(--dsw-alias-brand-primary,#2563eb);--dsh-svc-brand-text:var(--dsw-alias-label-primary-foreground,#ffffff);--dsh-svc-info:#2563eb;--dsh-svc-success:var(--dsw-alias-state-success-primary,#16a34a);--dsh-svc-warning:var(--dsw-alias-state-warn-primary,#d97706);--dsh-svc-danger:var(--dsw-alias-state-error-primary,#dc2626)}","body{--dsh-svc-card-bg:#eceef1}","body{--dsh-svc-border-strong:#b9c0ca}","body[data-ds-dark-theme]{--dsh-svc-border-strong:#52565f}","body[data-ds-dark-theme]{--dsh-svc-card-bg:var(--dsw-alias-bg-layer-2,#202126)}","body[data-ds-dark-theme]{--dsh-svc-page-bg:var(--dsw-alias-bg-layer-1,#17181c);--dsh-svc-content-bg:var(--dsw-alias-bg-layer-2,#202126);--dsh-svc-raised-bg:var(--dsw-alias-bg-layer-3,#292a31);--dsh-svc-text:var(--dsw-alias-label-primary,#f3f4f6);--dsh-svc-text-muted:var(--dsw-alias-label-secondary,#a1a1aa);--dsh-svc-border:var(--dsw-alias-border-l1,#3f414a)}","body[data-ds-dark-theme]{--dsh-svc-brand-text:#111318}",":root{--dsh-svc-space-1:4px;--dsh-svc-space-2:8px;--dsh-svc-space-3:12px;--dsh-svc-space-4:16px;--dsh-svc-space-5:20px;--dsh-svc-space-6:24px;--dsh-svc-space-8:32px;--dsh-svc-radius-control:8px;--dsh-svc-radius-card:12px;--dsh-svc-radius-panel:16px;--dsh-svc-radius-pill:999px;--dsh-svc-control-h:36px;--dsh-svc-control-h-compact:32px;--dsh-svc-control-h-primary:40px;--dsh-svc-content-max:800px;--dsh-svc-dur-fast:120ms;--dsh-svc-dur-view:170ms;--dsh-svc-font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}","body{--dsh-svc-surface-bg:var(--dsh-svc-card-bg);--dsh-svc-tab-active-bg:var(--dsh-svc-text);--dsh-svc-tab-active-danger:var(--dsh-svc-text);--dsh-svc-tab-active-text:#ffffff}","body[data-ds-dark-theme]{--dsh-svc-tab-active-text:#111318}","[data-dsh-service-nav]>svg:first-child,[data-dsh-service-quota-nav]>svg:first-child,[data-dsh-service-models-nav]>svg:first-child,[data-dsh-service-restart-nav]>svg:first-child,[data-dsh-service-sessions-nav]>svg:first-child{display:none}","[data-dsh-service-nav]::before,[data-dsh-service-quota-nav]::before,[data-dsh-service-models-nav]::before,[data-dsh-service-restart-nav]::before,[data-dsh-service-sessions-nav]::before{content:'';flex:none;width:16px;height:16px;background:currentColor}","[data-dsh-service-nav]::before{"+X(ae)+"}","[data-dsh-service-quota-nav]::before{"+X(re)+"}","[data-dsh-service-models-nav]::before{"+X(se)+"}","[data-dsh-service-sessions-nav]::before{"+X(oe)+"}","[data-dsh-service-restart-nav]::before{"+X(ne)+"}","[data-dshsvc-settings-entry]{box-sizing:border-box;width:calc(100% + 4px);height:44px;border:0;border-radius:var(--dsw-radius-md);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:22px;display:flex;align-items:center;gap:8px;padding:0 10px 0 6px;margin:0 -2px;cursor:pointer;overflow:hidden;flex:none;text-align:left}","[data-dshsvc-settings-entry]:hover{background:var(--dsw-alias-interactive-bg-hover)}",'[data-dshsvc-settings-entry][data-collapsed="true"]{width:36px;height:36px;padding:0;margin:0;justify-content:center;gap:0}',"[data-dshsvc-settings-entry-icon]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;flex:none}","[data-dshsvc-settings-entry-label]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}","@media (max-width:640px){","[data-dshsvc-root] .dshsvc-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:3px}","[data-dshsvc-root] .dshsvc-tabs::-webkit-scrollbar{display:none}","[data-dshsvc-root] .dshsvc-tab{padding:9px 13px;min-height:36px;box-sizing:border-box;font-size:13px;white-space:nowrap;flex:none}","[data-dshsvc-root] .dshsvc-tab svg{flex:none}","}","@supports (grid-template-columns:subgrid){","[data-dshsvc-root] .dshsvc-version-surface{display:grid !important;grid-template-columns:max-content max-content max-content minmax(0,1fr);column-gap:16px}","[data-dshsvc-root] .dshsvc-version-surface>*{grid-column:1/-1}","[data-dshsvc-root] .dshsvc-version-row{display:grid !important;grid-template-columns:subgrid;justify-content:normal !important;align-items:center}","[data-dshsvc-root] .dshsvc-version-identity{display:contents !important}","[data-dshsvc-root] .dshsvc-version-identity>a,[data-dshsvc-root] .dshsvc-version-identity>code{margin-left:0 !important;justify-self:end}","[data-dshsvc-root] .dshsvc-version-status{grid-column:4;justify-self:end}","}",'[data-dshsvc-root] [data-testid="version-card"]{container-type:inline-size;container-name:dshsvc-version}',"@container dshsvc-version (max-width:480px){","[data-dshsvc-root] .dshsvc-version-surface{display:block !important}","[data-dshsvc-root] .dshsvc-version-row{display:flex !important;justify-content:space-between !important;gap:6px !important;padding:12px 2px !important}","[data-dshsvc-root] .dshsvc-version-identity{flex-basis:100%;display:flex !important;flex-wrap:wrap;align-items:center;gap:8px}","[data-dshsvc-root] .dshsvc-version-identity>a,[data-dshsvc-root] .dshsvc-version-identity>code{margin-left:0 !important;white-space:normal !important;overflow-wrap:anywhere;min-width:0;justify-self:auto !important;flex:1 1 auto;text-align:right}","[data-dshsvc-root] .dshsvc-version-identity>button{flex:none;margin-left:auto}","[data-dshsvc-root] .dshsvc-version-status{grid-column:auto !important;justify-self:stretch !important;flex-basis:100%;justify-content:flex-start !important}","}","@keyframes dshsv-locate-flash{0%,100%{background-color:rgba(198,128,0,0.10)}30%,70%{background-color:rgba(198,128,0,0.45)}}.dshsv-locate-flash{animation:dshsv-locate-flash 2s ease}",'[class*="uV2eYG_dock"]:has([data-dsh-service-subagent-models-dock]){flex-wrap:wrap;width:100%;row-gap:0}','[class*="uV2eYG_dock"] [data-dsh-service-subagent-models-dock]{flex:0 0 100%}',"[data-dshsvc-root]{color:var(--dsh-svc-text);font-size:14px;line-height:1.55;background:var(--dsh-svc-page-bg);border-radius:var(--dsh-svc-radius-card);padding:2px}","[data-dshsvc-root] .dshsvc-page{width:100%;max-width:var(--dsh-svc-content-max);margin:0 auto}",'[data-dshsvc-root] button:focus-visible,[data-dshsvc-root] [role="switch"]:focus-visible,[data-dshsvc-root] select:focus-visible,[data-dshsvc-root] input:focus-visible{outline:2px solid var(--dsh-svc-brand);outline-offset:2px;border-radius:var(--dsh-svc-radius-control)}',"@media (prefers-reduced-motion:reduce){[data-dshsvc-root] *,[data-dshsvc-root] *::before,[data-dshsvc-root] *::after{transition-duration:0.01ms !important;animation-duration:0.01ms !important}}",'[data-testid^="sessions-project-header-"]{transition:background var(--dsh-svc-dur-fast,120ms)}','[data-testid^="sessions-project-header-"]:hover{background:var(--dsw-alias-bg-layer-3,#f2f3f5)}',"[data-dshsvc-root] .dshsvc-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:2px;width:100%;box-sizing:border-box;border:0.5px solid var(--dsh-svc-border);border-radius:var(--dsh-svc-radius-card);overflow:hidden}","[data-dshsvc-root] .dshsvc-tab{position:relative;display:inline-flex;align-items:center;gap:5px;padding:8px 12px;margin:0;border:0;border-radius:0;background:transparent;color:var(--dsh-svc-text-muted);font:inherit;font-size:12px;font-weight:550;line-height:16px;cursor:pointer;transition:color var(--dsh-svc-dur-fast) ease,background var(--dsh-svc-dur-fast) ease}",'[data-dshsvc-root] .dshsvc-tab[aria-selected="true"]{background:var(--dsh-svc-tab-active-bg);color:var(--dsh-svc-tab-active-text);font-weight:650;border-radius:8px}',".dshsvc-subtabs,[data-dshsvc-root] .dshsvc-subtabs{display:flex;flex-wrap:wrap;gap:2px;margin:10px 0 0;border-bottom:1px solid var(--dsh-svc-border)}",".dshsvc-subtab,[data-dshsvc-root] .dshsvc-subtab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;padding:8px 10px;font:inherit;font-size:13px;font-weight:550;color:var(--dsh-svc-text-muted);cursor:pointer;transition:color var(--dsh-svc-dur-fast) ease,border-color var(--dsh-svc-dur-fast) ease}",'.dshsvc-subtab[aria-selected="true"],[data-dshsvc-root] .dshsvc-subtab[aria-selected="true"]{color:var(--dsh-svc-brand);border-bottom-color:var(--dsh-svc-brand);font-weight:700}',"[data-dshsvc-root] .dshsvc-page-header{margin:14px 2px 2px}","[data-dshsvc-root] .dshsvc-page-header-row{display:flex;align-items:center;justify-content:space-between;gap:var(--dsh-svc-space-3);flex-wrap:wrap}"].join(""),document.head.appendChild(c)),t.effect(()=>()=>{c&&c.remove()},"dsh-service theme styles"),t.effect(()=>t.locale.register(s,{zh:Y,en:Q}),"dsh-service dictionaries");const u=t.locale.bind(s),p=()=>"zh"===t.locale?.getSnapshot?.()?.active?"zh":"en",m=(e,t={})=>{const a=Number(e);return Number.isFinite(a)?!0===t.billions&&a>=1e9?Math.round(a/1e8)/10+"B":a>=1e6?Math.round(a/1e5)/10+"M":a>=1e3?Math.round(a/100)/10+"K":a.toLocaleString():t.invalid??""},{featureScope:g,featureSnapshot:h,featureValue:f,featureEnabled:b,useFeatures:v}=Se({ctx:t,namespace:s,defaults:{healthDiagnostics:!0,modelUsage:!0,quotaLookup:!0,backupMaintenance:!0,taskNotifications:!0,healthz:!0,skillManager:!0,subagentRoute:!0,subagentModelsDock:!0,mobileAdaptation:!1,sessionManager:!0,fileEditor:!0,modelProviderIcons:!0,modelCatalog:!0},React:r});t.effect(()=>()=>g.dispose(),"dsh-service feature settings facade"),t.effect(()=>function(e){if("undefined"==typeof document||!document.body)return()=>{};let t=!1,a=null,r=null,s=null;const n=()=>{t||null!==a||("function"==typeof requestAnimationFrame?a=requestAnimationFrame(()=>{a=null,o()}):o())},o=()=>{if(t)return;const a="function"==typeof document.querySelector?document.querySelector('[role="dialog"] nav'):null;if(a!==r&&(null!==s&&s.disconnect(),s=null,r=a,null!==r&&(s=new MutationObserver(n),s.observe(r,{childList:!0,subtree:!0,characterData:!0}))),null===r)return;const o="function"==typeof r.querySelectorAll?r.querySelectorAll("button"):document.querySelectorAll('[role="dialog"] nav button');for(const t of o){const a=(t.textContent||"").trim();for(const r of e){const e=String(r.label()||"").trim();e&&a===e?t.setAttribute(r.attr,""):t.removeAttribute(r.attr)}}ie()};o();const l=new MutationObserver(n);return l.observe(document.body,{childList:!0,subtree:!0}),()=>{t=!0,l.disconnect(),null!==s&&s.disconnect(),s=null,r=null,null!==a&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(a),a=null;for(const t of e)for(const e of document.querySelectorAll("["+t.attr+"]"))e.removeAttribute(t.attr)}}([{attr:"data-dsh-service-nav",label:()=>u("nav.label")},{attr:"data-dsh-service-quota-nav",label:()=>u("tabs.quota")},{attr:"data-dsh-service-models-nav",label:()=>u("tabs.models")},{attr:"data-dsh-service-restart-nav",label:()=>u("nav.restart")},{attr:"data-dsh-service-sessions-nav",label:()=>u("tabs.sessions")}]),"dsh-service settings nav icons");const{settingsNavBackend:y,createSectionBackendSync:w,SETTINGS_NAV_MAX_ITEMS:x,getRawSettingsSections:k,navOrderListeners:E,notifyNavOrderChanged:C,readSettingsNavHidden:T,readSettingsNavOrder:A,resolveSectionLabel:z,writeSettingsNavHidden:M,writeSettingsNavOrder:I,ensureSettingsNavBackendSynced:R}=function({ctx:e,rpcCall:t}){const a="dsh-service-settings-nav-order",r="dsh-service-settings-nav-hidden",s=/^[A-Za-z0-9._-]{1,64}$/,n=(e,t,a={})=>{try{const r=localStorage.getItem(e);if(!r)return t;const n=JSON.parse(r);return!Array.isArray(n)||n.length>64?t:n.every(e=>"string"==typeof e&&s.test(e))?!0===a.excludeHost?n.filter(e=>"dsh-service"!==e):n:t}catch(e){return t}},o=()=>n(a,null),l=e=>{try{null===e?localStorage.removeItem(a):localStorage.setItem(a,JSON.stringify(e))}catch(e){}},i=()=>n(r,[],{excludeHost:!0}),d=e=>{try{if(null===e||0===e.length)localStorage.removeItem(r);else{const t=e.filter(e=>"dsh-service"!==e);localStorage.setItem(r,JSON.stringify(t))}}catch(e){}};let c=0;const u=new Set,p=()=>{try{const t=e.slots?._core;if(t&&"function"==typeof t.record)return t.record("settings.section")||null}catch(e){}return null},m=e=>{const t=new Set;try{const a=e&&e.listeners;if(a&&"function"==typeof a[Symbol.iterator])for(const e of a)"function"==typeof e&&t.add(e)}catch(e){}return t},g=()=>{c++;const t=p(),a=new Set;for(const e of u)a.add(e);for(const e of m(t))a.add(e);const r=e=>{if(u.has(e))return!0;const t=p();return m(t).has(e)};for(const e of a)if("function"==typeof e&&r(e))try{e()}catch(e){}try{if(t){const a=e.slots?._core;a&&"function"==typeof a.markDirty&&a.markDirty("settings.section",t),a&&"function"==typeof a.flush&&a.flush()}}catch(e){}try{if("function"==typeof e.slots?.register){const t=e.slots.register({name:"settings.section",id:"__dsh_nav_bump__"},()=>null);"function"==typeof t&&t()}}catch(e){}ie()};let h=null,f=null;if(e.slots&&"function"==typeof e.slots.entries){const t=e.slots.entries.bind(e.slots);h=t;const a="function"==typeof e.slots.getVersion?e.slots.getVersion.bind(e.slots):null,r="function"==typeof e.slots.subscribe?e.slots.subscribe.bind(e.slots):null;e.slots.entries=function(e){const a=t(e);if("settings.section"!==e)return a;const r=o(),s=i(),n=new Set(s),l=a.filter(e=>{const t=e.options?.id??e.options?.key??"";return"__dsh_nav_bump__"!==t&&("dsh-service"===t||!n.has(t))});return r&&0!==r.length?l.map(e=>{const t=e.options?.id??e.options?.key??"",a=r.indexOf(t),s=-1!==a?10*a:1e4+(e.options?.order??0);return Object.assign({},e,{options:Object.assign({},e.options,{order:s})})}):l},a&&(e.slots.getVersion=function(e){const t=a(e);return"settings.section"===e?t+1e5*c:t});const s=new Set;r&&(e.slots.subscribe=function(e,t){if("settings.section"===e){u.add(t);const a=r(e,t),n=()=>{s.delete(n)&&(u.delete(t),"function"==typeof a&&a())};return s.add(n),n}return r(e,t)}),f=()=>{e.slots.entries=t,a&&(e.slots.getVersion=a),r&&(e.slots.subscribe=r);for(const e of Array.from(s))e();u.clear()}}e.effect(()=>()=>{f&&f()},"dsh-service settings nav slot wrapping");const b=()=>{let t=[];return h?t=h("settings.section"):"function"==typeof e.slots?.entries&&(t=e.slots.entries("settings.section")),t.filter(e=>"__dsh_nav_bump__"!==(e.options?.id??e.options?.key))},v=e=>{if(!e)return"";const t=e.label;if("function"==typeof t)try{const e=t();if(e)return String(e)}catch(e){}else if("string"==typeof t&&t)return t;return String(e.id??e.key??"")};ie=()=>{if("undefined"==typeof document||!document.body)return;const e="function"==typeof document.querySelector?document.querySelector('[role="dialog"] nav'):null;if(!e)return;x();const t="function"==typeof e.querySelectorAll?e.querySelectorAll("button"):[];if(!t||0===t.length)return;const a=i(),r=new Set(a),s=o(),n=b(),l=new Map;for(const e of n){const t=e.options?.id??e.options?.key??"";if(!t||"__dsh_nav_bump__"===t)continue;const a=v(e.options);a&&l.set(a.trim(),t),l.set(t,t)}for(const e of t){const t=t=>{if("function"!=typeof e.getAttribute)return null;try{return e.getAttribute(t)}catch(e){return null}},a=t=>"function"==typeof e.hasAttribute?e.hasAttribute(t):!(!e.attrs||"function"!=typeof e.attrs.has)&&e.attrs.has(t),n="function"==typeof e.querySelector?e.querySelector("span"):null,o=(n?n.textContent:e.textContent||"").trim(),i=(t("title")||"").trim(),d=(t("aria-label")||"").trim(),c=l.get(o)||l.get(i)||l.get(d)||null;if(c){if(t("data-dsh-section-id")!==c&&"function"==typeof e.setAttribute)try{e.setAttribute("data-dsh-section-id",c)}catch(e){}if(e.style)if("dsh-service"===c?e.style.display="":r.has(c)?e.style.display="none":e.style.display="",s&&s.length>0){const t=s.indexOf(c);e.style.order=-1!==t?String(t):"9999"}else e.style.order=""}else{if(a("data-dsh-section-id")&&"function"==typeof e.removeAttribute)try{e.removeAttribute("data-dsh-section-id")}catch(e){}e.style&&(e.style.display="",e.style.order="")}}const d=e.children,c="function"==typeof e.querySelector&&(e.querySelector('[class*="navList"]')||d&&d[1])||null;c&&c.style&&s&&s.length>0&&(c.style.display="flex")};const y=({section:e,readOrder:a,readHidden:r,writeLocal:s})=>{const n={synced:!1,pushPending:!1},o=(a,r)=>{t("config-set",{section:e,value:{order:a,hidden:r}}).then(e=>{e&&!0===e.ok||(n.pushPending=!0)}).catch(()=>{n.pushPending=!0})},l=()=>{t("config-set",{section:e,value:null}).then(e=>{e&&!0===e.ok||(n.pushPending=!0)}).catch(()=>{n.pushPending=!0})},i=()=>{const e=a(),t=r();e&&e.length>0||t&&t.length>0?o(e,t):l()};return{persist:o,persistReset:l,ensureSynced:()=>{n.synced?n.pushPending&&(n.pushPending=!1,i()):(n.synced=!0,(async()=>{try{const a=await t("config-get",{section:e});if(!a||!0!==a.ok||void 0===a.value)return void(n.synced=!1);if(n.pushPending)return n.pushPending=!1,void i();const r=a.value;if(null!==r&&"object"==typeof r&&(Array.isArray(r.order)||Array.isArray(r.hidden)))return void s(Array.isArray(r.order)?r.order:null,Array.isArray(r.hidden)?r.hidden:[]);i()}catch(e){n.synced=!1}})())}}},w=y({section:"settingsNav",readOrder:()=>o(),readHidden:()=>i(),writeLocal:(e,t)=>{l(e),d(t),g()}}),x=w.ensureSynced;return{settingsNavBackend:w,createSectionBackendSync:y,SETTINGS_NAV_MAX_ITEMS:64,getRawSettingsSections:b,navOrderListeners:u,notifyNavOrderChanged:g,readSettingsNavHidden:i,readSettingsNavOrder:o,resolveSectionLabel:v,writeSettingsNavHidden:d,writeSettingsNavOrder:l,ensureSettingsNavBackendSynced:x}}({ctx:t,rpcCall:d}),O=y.persist,H=y.persistReset,J=()=>{const[,e]=a(t.locale.getSnapshot());return o(()=>t.locale.subscribe(()=>e(t.locale.getSnapshot())),[]),u},{SubagentModelsDock:Z}=function({ctx:e,rpcCall:t,useTranslation:a}){const{useState:s,useEffect:n}=r,o=new Map,l=new Map,i=new Map,d=(e,a=!1)=>{if("string"!=typeof e||""===e)return Promise.resolve([]);const r=Date.now();if(!a&&r-(l.get(e)??0)<1e4)return Promise.resolve(o.get(e)??[]);let s=i.get(e);return void 0===s&&(s=t("subagent-dispatches",{parentId:e,limit:400}).then(t=>{const a=t&&!0===t.ok&&Array.isArray(t.value?.records)?t.value.records:[],r=[];for(const e of a)null!==e&&"object"==typeof e&&r.push(e);return o.set(e,r),l.set(e,Date.now()),r}).catch(()=>(l.set(e,Date.now()),null)),i.set(e,s),s.finally(()=>i.delete(e)).catch(()=>{})),s};return{SubagentModelsDock:function(t){const l=a(),[i,c]=s("");return n(()=>{let a=!1;const r="string"==typeof t.sessionId?t.sessionId:void 0;if(void 0===r)return void c("");const s=()=>{const e=de(o.get(r)??[]);c(0===e.length?"":`${l("subagent.dock.label")}${ce(e)}`)},n=()=>d(r).then(e=>!a&&(s(),null!==e)).catch(()=>(a||c(""),!1));n();const i=()=>{a||(d(r,!0).then(()=>{a||s()}).catch(()=>{a||c("")}),u=e.timer?.timeout?.(i,2e4))};let u;return Promise.resolve(n()).then(t=>{!a&&t&&(u=e.timer?.timeout?.(i,2e4))}),()=>{a=!0,"function"==typeof u&&u()}},[t.sessionId]),""===i?null:r.createElement("div",{"data-testid":"subagent-models-dock","data-dsh-service-subagent-models-dock":!0,style:{boxSizing:"border-box",order:1,textAlign:"center",fontSize:"12px",lineHeight:"18px",color:"var(--dsh-svc-text-muted, var(--dsw-alias-label-secondary, #6b7280))",padding:"0 4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}},i)}}}({ctx:t,rpcCall:d,useTranslation:J}),ee=["overview","usage","quota","models","diagnostics","maintenance","configuration"],te={overview:"tabs.overview",usage:"tabs.usage",quota:"tabs.quota",models:"tabs.models",diagnostics:"tabs.health",maintenance:"tabs.maintenance",configuration:"tabs.configuration"},pe={usage:"modelUsage",quota:"quotaLookup",models:["modelCatalog","subagentRoute"],diagnostics:"healthDiagnostics"},ke=["sessions","skills","backup","restart"],Ee={sessions:"tabs.sessions",skills:"tabs.skills",subagent:"tabs.subagent",backup:"tabs.backup",restart:"tabs.restart"},Ce={sessions:"sessionManager",skills:"skillManager",subagent:"subagentRoute",backup:"backupMaintenance"},Te=e=>ke.filter(t=>void 0===Ce[t]||!1!==e[Ce[t]]).map(e=>({id:e,labelKey:Ee[e]})),qe=(e,t)=>{const a=Te(t);return 0===a.length?null:a.some(t=>t.id===e)?e:a[0].id},Ae=[{id:"features",labelKey:"tabs.features"},{id:"notifications",labelKey:"tabs.notifications"},{id:"navOrder",labelKey:"tabs.navOrder"}],ze={configuration:"page.configuration.desc"};function Me({title:e,description:t,action:a,secondary:s}){return r.createElement("header",{"data-testid":"svc-page-header",className:"dshsvc-page-header"},r.createElement("div",{className:"dshsvc-page-header-row"},r.createElement("h2",{className:"dshsvc-page-title",style:{margin:0,fontSize:"18px",fontWeight:700,lineHeight:1.4,color:"var(--dsh-svc-text)"}},e),null!=a?a:null,null!=s?r.createElement("div",{className:"dshsvc-page-secondary",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},s):null),t?r.createElement("p",{className:"dshsvc-page-desc",style:{margin:"2px 0 0",fontSize:"12px",color:"var(--dsh-svc-text-muted)",lineHeight:1.5}},t):null)}function Ie({items:e,activeId:t,onChange:a,testIdPrefix:s,variant:n,dotLabel:o,ariaLabel:l}){const i="sub"===n;return r.createElement("div",{role:"tablist","aria-label":l,className:i?"dshsvc-subtabs":"dshsvc-tabs","data-testid":s+"-list"},e.map(e=>{const n=e.id===t,l=i?n?{color:"var(--dsh-svc-brand)",borderBottom:"2px solid var(--dsh-svc-brand)",fontWeight:700}:null:n?{background:"var(--dsh-svc-tab-active-bg)",color:"var(--dsh-svc-tab-active-text)",fontWeight:650,borderRadius:"8px"}:null;return r.createElement("button",{key:e.id,type:"button",role:"tab","aria-selected":String(n),"data-testid":s+"-"+e.id,className:i?"dshsvc-subtab":"dshsvc-tab",style:l,onClick:()=>a(e.id)},void 0!==e.icon?r.createElement(le,{name:e.icon}):null,e.label,e.warning?r.createElement("span",{"data-testid":"tab-dot-"+e.id,"aria-label":o,style:{position:"absolute",top:"-3px",right:"-3px",width:"8px",height:"8px",..._("50%"),background:"var(--dsw-alias-state-warn-primary)",boxShadow:"0 0 0 2px var(--dsw-alias-bg-layer-1)"}}):null,e.badge?r.createElement("span",{"data-testid":e.badge.testid,style:{position:"absolute",top:"-7px",right:"-10px",fontSize:"9px",lineHeight:"14px",padding:"0 4px",..._("999px"),background:"var(--dsw-alias-state-warn-primary)",color:"var(--dsh-svc-brand-text)",fontWeight:700}},e.badge.text):null)}))}const{notifyState:Re,useNotifyState:Oe,NOTIFY_KIND_KEYS:He,fireNotification:De,subscribeBellVisible:Le}=function(){const{useState:e,useEffect:t}=r,a={current:{enabled:!1,done:!0,input:!0,bellVisible:!0}};try{a.current.enabled="true"===localStorage.getItem("dsh-service-notify")}catch(e){}try{a.current.done="false"!==localStorage.getItem("dsh-service-notify-done")}catch(e){}try{a.current.input="false"!==localStorage.getItem("dsh-service-notify-input")}catch(e){}try{a.current.bellVisible="false"!==localStorage.getItem("dsh-service-notify-bell")}catch(e){}const s=new Set,n=new Set,o=(e,t)=>{try{localStorage.setItem(e,t?"true":"false")}catch(e){}},l=()=>{for(const e of s)e()},i=e=>{a.current.bellVisible=!0===e,o("dsh-service-notify-bell",a.current.bellVisible),(()=>{for(const e of n)e()})()};return{notifyState:a,useNotifyState:()=>{const[,t]=e(0),[d,c]=e(a.current.enabled),[u,p]=e(a.current.done),[m,g]=e(a.current.input),[h,f]=e(a.current.bellVisible);return r.useEffect(()=>{const e=()=>{c(a.current.enabled),p(a.current.done),g(a.current.input),f(a.current.bellVisible),t(e=>e+1)};return s.add(e),n.add(e),()=>{s.delete(e),n.delete(e)}},[]),{enabled:d,done:u,input:m,bell:h,setEnabled:e=>{return t=e,a.current.enabled=t,o("dsh-service-notify",t),void l();var t},setDone:e=>{return t=e,a.current.done=t,o("dsh-service-notify-done",t),void l();var t},setInput:e=>{return t=e,a.current.input=t,o("dsh-service-notify-input",t),void l();var t},setBell:i}},NOTIFY_KIND_KEYS:{approval:"notification.kind.approval","plan-review":"notification.kind.plan-review",question:"notification.kind.question"},fireNotification:(e,t)=>{if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{const a=new Notification(e,{body:t});a.onclick=()=>{try{window.focus()}catch(e){}try{a.close()}catch(e){}}}catch(e){}},subscribeBellVisible:e=>(n.add(e),()=>n.delete(e))}}(),Ne=({storageKey:e,legacyStorageKey:r,sectionId:s,order:n,labelKey:l,feature:i,renderContent:d})=>{let c=!1;try{let t=localStorage.getItem(e);if(null===t&&void 0!==r){const a=localStorage.getItem(r);if(null!==a){try{localStorage.setItem(e,a)}catch(e){}t=a}}c="true"===t}catch(e){}let p=null;const m=new Set,g=()=>{p&&(p(),p=null),c&&(void 0===i||b(i))&&(p=t.slots.register({name:"settings.section",id:s,order:n,label:()=>u(l)},d))},h=t=>{c=!0===t;try{localStorage.setItem(e,c?"true":"false")}catch(e){}g(),"function"==typeof C&&C();for(const e of m)e()};return{sync:g,setEnabled:h,useEnabled:()=>{const[e,t]=a(c);return o(()=>{const e=()=>t(c);return m.add(e),t(c),()=>m.delete(e)},[]),[e,h]},disposeEntry:()=>{p&&(p(),p=null)}}},We=Ne({storageKey:"dsh-service-shortcut-restart",legacyStorageKey:"dsh-service-restart-nav",sectionId:"dsh-service-restart",order:499,labelKey:"nav.restart",renderContent:()=>r.createElement(Fe,null)}),Be=Ne({storageKey:"dsh-service-shortcut-quota",legacyStorageKey:"dsh-service-quota-nav",sectionId:"dsh-service-quota",order:498,labelKey:"tabs.quota",feature:"quotaLookup",renderContent:()=>r.createElement(wa,null)}),Pe=Ne({storageKey:"dsh-service-shortcut-models",legacyStorageKey:"dsh-service-models-nav",sectionId:"dsh-service-models",order:497,labelKey:"tabs.models",feature:["modelCatalog","subagentRoute"],renderContent:()=>r.createElement(Oa,{SubagentSection:aa})}),je=Ne({storageKey:"dsh-service-shortcut-sessions",legacyStorageKey:"dsh-service-sessions-nav",sectionId:"dsh-service-sessions",order:495,labelKey:"tabs.sessions",feature:"sessionManager",renderContent:()=>r.createElement(Ma,null)}),$e=()=>{try{if("function"==typeof t.get)return t.get("modelDirectories")}catch(e){}},_e={runningSessionIds:new Set},{RestartOverlay:Ve,RestartSection:Fe,compareSemver:Ue,fetchVersionSnapshot:Ke,refreshVersionSnapshot:Ge,startRecovery:Ye,useInstalledVersion:Qe,useRestartFlow:Je,useRuntimeEnv:Ze,isUpgradeInFlight:Xe,setUpgradeInFlight:et,getRuntimeEnvState:tt}=ve({ctx:t,rpcCall:d,t:u,useTranslation:J,restartNavToggle:We}),{QUOTA_KIND_OPTIONS:at,acquireQuotaLoop:rt,applyQuotaCardOrder:st,formatClockTime:nt,formatShortDate:ot,humanizeDuration:lt,subscribeQuotaCards:it,commitQuotaCards:dt,resetQuotaCards:ct,ensureQuotaCardsSynced:ut,quotaWindowDisplayLabel:pt,quotaWindowPartsText:mt,quotaWindowValueText:gt,readQuotaCardHidden:ht,readQuotaCardOrder:ft,releaseQuotaLoop:bt,quotaExtractBalance:vt,resolveBalanceBaseline:yt,setManualBalanceBaseline:wt,computeBalanceGaugeState:xt,fetchQuotaSnapshot:kt}=function({ctx:e,rpcCall:t,featureEnabled:a,getModelDirectories:s,sessionActivity:n,createSectionBackendSync:o,SETTINGS_NAV_MAX_ITEMS:l,formatCompactCount:i}){const{useState:d,useEffect:c}=r,u="dsh-service-quota-card-order",p="dsh-service-quota-card-hidden",m=(e,t)=>{try{const a=localStorage.getItem(e);if(!a)return t;const r=JSON.parse(a);return!Array.isArray(r)||r.length>l?t:r.every(e=>"string"==typeof e&&""!==e.trim()&&e.trim().length<=128)?r.map(e=>e.trim()):t}catch(e){return t}},g=()=>m(u,[]),h=()=>m(p,[]),f=e=>{try{null===e?localStorage.removeItem(u):localStorage.setItem(u,JSON.stringify(e.slice(0,l)))}catch(e){}},b=e=>{try{null===e||0===e.length?localStorage.removeItem(p):localStorage.setItem(p,JSON.stringify(e.slice(0,l)))}catch(e){}},v=new Set,y=()=>{for(const e of v)try{e()}catch(e){}},w=o({section:"quotaCards",readOrder:()=>g(),readHidden:()=>h(),writeLocal:(e,t)=>{f(e),b(t),y()}});let x=null,k=null;function E(e){return"all"===e?.scope?{scope:"all"}:{providers:Array.isArray(e?.providers)?[...new Set(e.providers.filter(e=>"string"==typeof e&&""!==e))].sort():[]}}async function C(a={providers:[]}){const r=E(a);return null!==x?(s=k,n=r,k="all"===s?.scope||"all"===n?.scope?{scope:"all"}:E({providers:[...s?.providers??[],...n?.providers??[]]}),x):(x=Promise.resolve().then(async()=>{try{const a=await t("quota",r);if(!0===a?.ok&&a.value&&"object"==typeof a.value&&Array.isArray(a.value.providers))return S.publish(a.value),function(t,a={providers:[]}){Array.isArray(t?.providers)&&t.providers.some(e=>!0===e.adapted&&!0===e.refreshing)&&0!==z.refs?null!==q.dispose||q.pulls>=A.length||(q.dispose=e.timer.timeout(()=>{q.dispose=null,C(a)},A[q.pulls]),q.pulls+=1):q.pulls=0}(a.value,r),!0}catch(e){}return!1}).finally(()=>{x=null;const e=k;k=null,null!==e&&C(e)}),x);var s,n}function T(){const e=s();if(void 0===e||"function"!=typeof e.directoryFor)return[];const t=[];for(const a of n.runningSessionIds)try{const r=e.directoryFor(a)?.store?.getSnapshot?.()?.current;"string"==typeof r?.provider&&""!==r.provider&&t.push(r.provider)}catch(e){}return[...new Set(t)]}const q={pulls:0,dispose:null},A=[800,2400,4800,8e3,12e3],z={refs:0,allRefs:0,running:!1};function M(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})}catch(e){return""}}function I(e){const t=new Date(e),a=e=>String(e).padStart(2,"0");return`${a(t.getMonth()+1)}-${a(t.getDate())}`}e.effect(()=>()=>{null!==q.dispose&&q.dispose()},"dsh-service quota snapshot disposal");const R="dsh-service-quota-balance-baseline";function O(){try{const e=localStorage.getItem(R);if(!e)return{};const t=JSON.parse(e);return null===t||"object"!=typeof t||Array.isArray(t)?{}:t}catch(e){return{}}}function H(e){try{e&&0!==Object.keys(e).length?localStorage.setItem(R,JSON.stringify(e)):localStorage.removeItem(R)}catch(e){}}return{QUOTA_KIND_OPTIONS:["opencode-go","zai-coding-cn","openrouter","kimi","siliconflow","deepseek","stepfun","stepfun-step-plan","xiaomi-token-plan-cn","cliproxy","command-goat","workbuddy","poe","clinepass","vercel-ai-gateway"],acquireQuotaLoop:function(e={}){a("quotaLookup")&&(z.refs+=1,!0===e.all&&(z.allRefs+=1),!0===e.all?C({scope:"all"}):function(){if(!a("quotaLookup")||0===z.refs||!0===z.running)return;const e=z.allRefs>0?{scope:"all"}:{providers:T()};"all"!==e.scope&&0===e.providers.length||(z.running=!0,Promise.resolve(C(e)).catch(()=>!1).then(()=>{z.running=!1}))}())},applyQuotaCardOrder:function(e,t){const a=new Map(t.map((e,t)=>[e,t]));return e.map((e,r)=>({row:e,key:a.has(e.provider)?a.get(e.provider):t.length+r})).sort((e,t)=>e.key-t.key).map(e=>e.row)},formatClockTime:M,formatShortDate:function(e){const t=new Date(e),a=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${a(t.getMonth()+1)}-${a(t.getDate())}`},humanizeDuration:function(e,t){const a=Math.max(0,Math.floor(e/6e4)),r=Math.floor(a/1440),s=Math.floor(a%1440/60),n=a%60,o=[];return r>0&&o.push(t("quota.unit.day",{count:r})),s>0&&o.push(t("quota.unit.hour",{count:s})),n>0&&o.push(t("quota.unit.minute",{count:n})),0===o.length&&o.push(t("quota.unit.minute",{count:0})),o.slice(0,2).join(" ")},subscribeQuotaCards:e=>(v.add(e),()=>v.delete(e)),commitQuotaCards:(e,t)=>{f(e),b(t),y(),w.persist(e,t)},resetQuotaCards:()=>{f(null),b(null),y(),w.persistReset()},ensureQuotaCardsSynced:()=>w.ensureSynced(),quotaWindowDisplayLabel:function(e,t){const a="string"==typeof e.kindKey&&""!==e.kindKey,r=a?e.kindKey:e.id;let s=t(`quota.window.${r}`);if(s===`quota.window.${r}`)if(a){const a=t(`quota.window.${e.id}`);s=a!==`quota.window.${e.id}`?a:r}else s=function(e,t){const a=t(`quota.window.${e}`);if(a!==`quota.window.${e}`)return a;const r=String(e).split("-"),s=r.length>=2?`${r[0]}-${r[1]}`:r[0],n=t(`quota.window.${s}`);return n===`quota.window.${s}`?e:n}(e.id,t);const n="string"==typeof e.label?e.label.trim():"";return""!==n?`${n} · ${s}`:s},quotaWindowPartsText:function(e,t){const a=Array.isArray(e?.parts)?e.parts:[],r=[];for(const e of a){if(null===e||"object"!=typeof e)continue;let a="string"==typeof e.text?e.text.trim():"";if(""===a&&"string"==typeof e.iso){const t=Date.parse(e.iso);Number.isFinite(t)&&(a=`${I(t)} ${M(t)}`)}if(""===a)continue;const s="string"==typeof e.kindKey&&""!==e.kindKey?e.kindKey:"",n=""===s?"":t(`quota.part.${s}`),o=""===n||n===`quota.part.${s}`?s:n;r.push(""===o?a:`${o} ${a}`)}return r.length>0?r.join(" · "):null},quotaWindowValueText:function(e){const t=`${e.percent}%`,a=Number(e.used),r=Number(e.limit);return!Number.isFinite(a)||!Number.isFinite(r)||r<=0?t:"usd"===e.unit?`${t} · $${a.toFixed(2)} / $${r.toFixed(2)}`:`${t} · ${i(a,{billions:!0})} / ${i(r,{billions:!0})}`},readQuotaCardHidden:h,readQuotaCardOrder:g,releaseQuotaLoop:function(e={}){(a("quotaLookup")||0!==z.refs)&&(z.refs=Math.max(0,z.refs-1),!0===e.all&&(z.allRefs=Math.max(0,z.allRefs-1)),z.refs>0||null!==q.dispose&&(q.dispose(),q.dispose=null))},quotaExtractBalance:function(e){if(!Array.isArray(e)||0===e.length)return null;const t=e.find(e=>"balance"===e.kindKey)||e.find(e=>"string"==typeof e.id&&e.id.startsWith("balance"))||e.find(e=>"string"==typeof e.text&&/^[¥$€£]|\b(CNY|USD|EUR|GBP)\b/.test(e.text));if(!t||"string"!=typeof t.text)return null;const a=t.text.trim();let r="CNY",s="¥";a.startsWith("$")||"USD"===t.label||a.toUpperCase().includes("USD")?(r="USD",s="$"):a.startsWith("€")||"EUR"===t.label||a.toUpperCase().includes("EUR")?(r="EUR",s="€"):(a.startsWith("£")||"GBP"===t.label||a.toUpperCase().includes("GBP"))&&(r="GBP",s="£");const n=a.replace(/[^0-9.]/g,""),o=Number(n);return Number.isFinite(o)?{amount:o,currency:r,symbol:s,rawText:a,window:t}:null},resolveBalanceBaseline:function(e,t,a){if("string"!=typeof e||""===e||!Number.isFinite(t))return null;const r="USD"===a?5:20,s=O(),n=s[e];let o=r;if(n&&"number"==typeof n.baseline&&Number.isFinite(n.baseline)){o=n.baseline;const a="number"==typeof n.lastBalance?n.lastBalance:o;t>o||t>a+.5?(o=Math.max(t,r),s[e]={baseline:o,lastBalance:t,updatedAt:Date.now()},H(s)):Math.abs(t-a)>.001&&(s[e]={...n,lastBalance:t,updatedAt:Date.now()},H(s))}else o=Math.max(t,r),s[e]={baseline:o,lastBalance:t,updatedAt:Date.now()},H(s);return o},setManualBalanceBaseline:function(e,t,a){if("string"!=typeof e||""===e||!Number.isFinite(t)||t<=0)return null;const r=Math.round(100*t)/100,s=O();return s[e]={baseline:r,lastBalance:t,updatedAt:Date.now()},H(s),r},computeBalanceGaugeState:function(e,t,a){const r=Number.isFinite(t)&&t>0?t:"USD"===a?5:20,s=e/r*100,n=Math.min(100,Math.max(0,Math.round(s))),o="USD"===a?e<=.5:e<=2,l="USD"===a?e>=10:e>=50;let i="high",d="var(--dsw-alias-state-success-primary)";return e<=0||o?(i="low",d="var(--dsw-alias-state-error-primary)"):n<20?l?(i="mid",d="var(--dsw-alias-state-warn-primary)"):(i="low",d="var(--dsw-alias-state-error-primary)"):n<50?(i="mid",d="var(--dsw-alias-state-warn-primary)"):(i="high",d="var(--dsw-alias-state-success-primary)"),{ratio:n,gear:i,color:d,needleAngle:n/100*180-90,baseline:r,isExtremeLow:o,isComfortableHigh:l}},fetchQuotaSnapshot:C}}({ctx:t,rpcCall:d,featureEnabled:b,getModelDirectories:$e,sessionActivity:_e,createSectionBackendSync:w,SETTINGS_NAV_MAX_ITEMS:x,formatCompactCount:m});!function({ctx:e,sessionActivity:t,t:a,featureEnabled:r,featureScope:s,notifyState:n,fireNotification:o,NOTIFY_KIND_KEYS:l}){if(e.sessions&&"function"==typeof e.sessions.list?.subscribe){const i=new Map;let d=!1,c=null,u=null;const p=t=>{if(null!=t&&void 0!==t.uiSession)return t.uiSession;try{if("function"==typeof e.get)return e.get("uiSession")}catch(e){}};let m,g=null;const h=new Map;let f=!1,b=null,v=null;const y=()=>{null!==b&&(b(),b=null),null!==v&&(v(),v=null),h.clear(),f=!1},w=()=>m??p(),x=()=>{const s=e.sessions.list.getSnapshot();if(s&&s.byId)if(t.runningSessionIds=new Set(Object.entries(s.byId).filter(([,e])=>!0===e.running).map(([e])=>e)),d){for(const[e,t]of Object.entries(s.byId)){const s={running:!0===t.running},l=i.get(e);void 0!==l&&l.running&&!s.running&&"subagent"!==t.origin&&r("taskNotifications")&&n.current.enabled&&n.current.done&&o(a("notification.doneTitle"),a("notification.doneBody",{title:t.displayTitle||e})),i.set(e,s)}for(const e of[...i.keys()])e in s.byId||i.delete(e)}else{d=!0;for(const[e,t]of Object.entries(s.byId))i.set(e,{running:!0===t.running})}},k=()=>{const t=w();if(!t||"function"!=typeof t.sessionStatus?.subscribe)return;const s=t.sessionStatus.getSnapshot();if(s&&"function"==typeof s.entries)if(f){for(const[t,i]of s.entries()){const s={pending:void 0!==i?.pendingInteraction},d=h.get(t);if(void 0!==d&&!d.pending&&s.pending&&r("taskNotifications")&&n.current.enabled&&n.current.input){const r=l[i.pendingInteraction.kind],s=r?a(r):String(i.pendingInteraction.kind),n=e.sessions.list.getSnapshot().byId[t];o(a("notification.inputTitle"),a("notification.inputBody",{title:n?.displayTitle||t,kind:s}))}h.set(t,s)}for(const e of[...h.keys()])s.has(e)||h.delete(e)}else{f=!0;for(const[e,t]of s.entries())h.set(e,{pending:void 0!==t?.pendingInteraction})}},S=()=>{null!==c&&(c(),c=null),null!==u&&(u(),u=null),y(),i.clear(),d=!1,t.runningSessionIds=new Set},E=()=>{const t=w();t&&"function"==typeof t.sessionStatus?.subscribe&&r("taskNotifications")?null===b&&(b=t.sessionStatus.subscribe(()=>k()),v=e.on("connection/reset",()=>{h.clear(),f=!1}),k()):null!==b&&y()},C=()=>{r("taskNotifications")||r("quotaLookup")?(null===c&&(c=e.sessions.list.subscribe(()=>x()),u=e.on("connection/reset",()=>{i.clear(),d=!1}),x()),E()):S()};"function"==typeof e.inject&&(g=e.inject(["uiSession"],e=>(y(),m=p(e),E(),()=>{m=void 0,y()}))),C();const T=s.subscribe(C);e.effect(()=>()=>{if(T(),"function"==typeof g)try{g()}catch(e){}S()},"dsh-service: shared session observation")}}({ctx:t,sessionActivity:_e,t:u,featureEnabled:b,featureScope:g,notifyState:Re,fireNotification:De,NOTIFY_KIND_KEYS:He});const St=Object.assign(Object.create(null),{deepseek:{segments:[[540,720],[840,1080]],captionKey:"quota.peak.caption",holidays:!0},"zai-coding-cn":{segments:[[840,1080]],captionKey:"quota.peak.caption.zai",holidays:!1}}),Et="#f0952f",Ct="var(--dsw-alias-state-success-primary)",Tt=3e4,qt=(()=>{let e=0;const t=Array.isArray(n?.years)?n.years:[];for(const a of t){const t=Number(a);Number.isFinite(t)&&t>e&&(e=t)}return 0===e?8:Math.max(8,Math.ceil((new Date(Date.UTC(e,11,31)).getTime()-Date.now())/864e5)+8)})(),At=new Set(Array.isArray(n?.years)?n.years.map(e=>String(e)):[]),zt=n?.offDays&&"object"==typeof n.offDays?n.offDays:{};function Mt(e){const t=new Date(e+288e5),a=e=>String(e).padStart(2,"0");return`${t.getUTCFullYear()}-${a(t.getUTCMonth()+1)}-${a(t.getUTCDate())}`}function It(e){return At.has(e)}function Rt(e,t){const a=function(e){const t=new Date(e+288e5);return{dayIndex:t.getUTCDay(),minutesOfDay:60*t.getUTCHours()+t.getUTCMinutes()}}(t);if(0===a.dayIndex||6===a.dayIndex)return!1;if(!0===e.holidays){const e=Mt(t);if(It(e.slice(0,4))&&function(e){return"string"==typeof zt[e]}(e))return!1}return e.segments.some(([e,t])=>a.minutesOfDay>=e&&a.minutesOfDay<t)}function Ot(e){const t=new Date(e+288e5),a=e=>String(e).padStart(2,"0");return`${a(t.getUTCHours())}:${a(t.getUTCMinutes())}`}function Ht(e,t){return!1===Array.isArray(t)||0===t.length?null:St[e?.kind]??null}function Dt({showCaption:e,schedule:s}){const n=J(),[l,i]=a(Date.now());o(()=>{let e=!1,a=null;const r=()=>{e||(a=t.timer.timeout(()=>{i(Date.now()),r()},Tt))};return r(),()=>{e=!0,null!=a&&a()}},[]);const d=Rt(s,l),c=function(e,t){const a=new Date(t+288e5);a.setUTCHours(0,0,0,0);const r=a.getTime()-288e5,s=e.segments.flat(),n=[];let o=Rt(e,t);for(let a=0;a<=qt&&n.length<2;a++){const l=r+864e5*a,i=s.map(e=>l+6e4*e);i.push(l+864e5);for(const a of i){if(a<=t)continue;const r=Rt(e,a);if(r!==o&&(n.push(a),o=r,n.length>=2))return n}}return n}(s,l),u=c[0]??null,p=d?Et:Ct,m=n(d?"quota.peak.nowPeak":"quota.peak.nowIdle"),g=Mt(l),h=!0===s.holidays&&!It(g.slice(0,4)),f=e=>Math.round(e/1440*1e6)/1e4;return r.createElement("div",{"data-testid":"quota-peak-timeline",style:{display:"flex",flexDirection:"column",gap:"4px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",minHeight:"16px"}},r.createElement("span",{"data-testid":"quota-peak-state","data-in-peak":String(d),style:{display:"inline-flex",alignItems:"center",gap:"5px",fontSize:"12px",lineHeight:"16px",color:p,whiteSpace:"nowrap",flexShrink:0}},r.createElement("span",{style:{width:"7px",height:"7px",..._("50%"),background:p,flexShrink:0}}),m),null!==u?r.createElement("span",{"data-testid":"quota-peak-next",style:{marginLeft:"auto",fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"}},n(d?"quota.peak.untilIdle":"quota.peak.untilPeak",{time:Ot(u),dur:lt(u-l,n)})):null),r.createElement("div",{"data-testid":"quota-peak-bar",style:{position:"relative",height:"14px",..._(999),overflow:"hidden",background:"var(--dsw-alias-interactive-bg-hover)"}},(c.length>0?[{peak:d,weight:c[0]-l},...c.length>1?[{peak:!d,weight:c[1]-c[0]}]:[]]:[{peak:d,weight:1}]).map((e,t,a)=>{const s=a.reduce((e,t)=>e+t.weight,0),o=f(e.weight/s*1440);return r.createElement("span",{key:t,"data-testid":`quota-peak-segment-${t}`,"data-peak":String(e.peak),style:{position:"absolute",top:0,bottom:0,left:`${0===t?0:f(a[0].weight/s*1440)}%`,width:`${o}%`,background:e.peak?Et:Ct,overflow:"hidden"}},o>=11?r.createElement("span",{style:{position:"absolute",inset:0,textAlign:"center",fontSize:"9px",lineHeight:"14px",fontWeight:500,color:"rgba(255,255,255,0.95)"}},n(e.peak?"quota.peak.tag.peak":"quota.peak.tag.idle")):null)}),r.createElement("span",{"data-testid":"quota-peak-now",style:{position:"absolute",top:0,bottom:0,left:0,width:"3px",borderRadius:"3px",background:"var(--dsw-specific-menu)"}})),!0===e?r.createElement("div",{"data-testid":"quota-peak-caption",style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",marginTop:"2px"}},n(s.captionKey)):null,!0===e&&h?r.createElement("div",{"data-testid":"quota-peak-caption-degraded",style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",marginTop:"2px"}},n("quota.peak.caption.degraded",{year:g.slice(0,4)})):null)}function Lt(e){if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;const a=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T23:59:59.999`:t);return Number.isFinite(a)?a:null}function Nt(e,t){const a="string"==typeof e.expiresAt&&""!==e.expiresAt.trim()?e.expiresAt.trim():"",r=Lt(a),s=null!==r&&r<Date.now();let n="";if(""!==a){let e=a;null!==r&&(e=a.length>10?`${ot(r)} ${nt(r)}`:ot(r),e=s?`${e} ${t("quota.resetCard.expired")}`:t("quota.resetCard.expires",{date:e})),n=e}const o="string"==typeof e.label&&""!==e.label?` · ${e.label}`:"";return{expired:s,title:`${t("quota.resetCard.title")}${o}`,expiry:n,iconColor:s?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",textColor:s?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-secondary)"}}function Wt(e,t=Date.now()){return(Array.isArray(e)?e:[]).map((e,a)=>{const r=Lt(e?.expiresAt);return{card:e,index:a,key:null!==r&&r>=t?r:Number.POSITIVE_INFINITY}}).sort((e,t)=>e.key-t.key||e.index-t.index).map(e=>e.card)}function Bt(e,t){const a="string"==typeof e?.errorCode?e.errorCode:"",r=a.indexOf(":"),s=-1===r?a:a.slice(0,r),n=-1===r?"":a.slice(r+1),o=[/^\d{3}$/.test(n)?`HTTP ${n}`:void 0,"string"==typeof e?.errorEndpoint&&""!==e.errorEndpoint?e.errorEndpoint:void 0,"string"==typeof e?.errorAccount&&""!==e.errorAccount?e.errorAccount:void 0,"string"==typeof e?.errorDetail&&""!==e.errorDetail?e.errorDetail:void 0].filter(e=>void 0!==e),l=!0===e?.manualOnly?` · ${t("quota.manualOnly")}`:"number"==typeof e?.nextAllowedAt&&e.nextAllowedAt>Date.now()?` · ${t("quota.retryAt",{time:nt(e.nextAllowedAt)})}`:"";return`${function(e,t){const a=`quota.error.${e}`,r=t(a);return r===a?t("quota.error.unknown"):r}(s,t)}${o.length>0?` (${o.join(" · ")})`:""}${l}`}function Pt(e,t,a){const s=null!=a,n=pt(e,t),o={color:"var(--dsw-alias-label-secondary)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},l={color:"var(--dsw-alias-label-primary)",fontWeight:500,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",flexShrink:0};let i=null;if("string"==typeof e.resetsAt){const n=Date.parse(e.resetsAt);Number.isFinite(n)&&n>Date.now()&&(i=r.createElement("div",{"data-testid":s?`quota-card-reset-${a}-${e.id}`:`quota-reset-${e.id}`,style:{fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)"}},t("quota.resetIn",{time:lt(n-Date.now(),t)})))}const d="string"==typeof e.text?null:mt(e,t);return"string"==typeof e.text||null!==d?r.createElement("div",{key:e.id,...s?{"data-testid":`quota-card-window-${a}-${e.id}`}:{}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"10px",fontSize:"12px",lineHeight:"18px"}},r.createElement("span",{style:o,title:n},n),r.createElement("span",{"data-testid":s?`quota-card-text-${a}-${e.id}`:`quota-text-${e.id}`,style:l},"string"==typeof e.text?e.text:d)),i):r.createElement("div",{key:e.id,...s?{"data-testid":`quota-card-window-${a}-${e.id}`}:{}},r.createElement("div",{"data-value":e.percent,style:{display:"flex",justifyContent:"space-between",gap:"10px",fontSize:"12px",lineHeight:"18px"}},r.createElement("span",{style:o,title:n},n),r.createElement("span",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0}},r.createElement("span",{style:l},gt(e)),!0===e.stale?r.createElement("span",{"data-testid":s?`quota-card-stale-${a}-${e.id}`:`quota-stale-${e.id}`,title:t("quota.window.staleTip"),style:he("warning",{padding:"1px 7px",flexShrink:0})},t("quota.window.stale")):null)),function(e,t,a,s){const n=!0===s?t<=20:t>=80;return r.createElement("div",{"data-testid":e,style:{height:"4px",..._(999),background:"var(--dsw-alias-interactive-bg-hover)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:`${Math.max(0,Math.min(100,t))}%`,..._(999),background:n?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)"}}))}(s?`quota-card-bar-${a}-${e.id}`:`quota-window-bar-${e.id}`,e.percent,0,!0===e.remaining),i)}let jt=null;try{const t=e("react-dom");null!=t&&"function"==typeof t.createPortal&&(jt=t.createPortal)}catch(e){jt=null}function $t(){if("undefined"==typeof window||null===window)return!1;if("function"==typeof window.matchMedia){const e=window.matchMedia("(max-width: 1023px)");return"boolean"==typeof e.matches&&e.matches}return"number"==typeof window.innerWidth&&window.innerWidth<=1023}const _t=["gemini","claude","codex"];function Vt(e){const t=String(e?.kindKey?e.kindKey:e?.id??"").toLowerCase();return t.includes("gemini")?"gemini":t.includes("claude")||t.includes("gpt-oss")?"claude":t.includes("codex")||t.includes("chatgpt")?"codex":"other"}function Ft(e){const t=new Map;for(const a of e){const e=Vt(a),r=t.get(e)||[];r.push(a),t.set(e,r)}const a=[];for(const e of[..._t,"other"]){const r=t.get(e);r&&r.length>0&&a.push({family:e,windows:r})}return a}function Ut(e){const{balanceInfo:t,gaugeState:s,onCalibrate:n,translate:o}=e,[l,i]=a(!1),d=s.needleAngle,c=`${t.symbol}${s.baseline.toFixed(2)}`,u=t.rawText;return r.createElement("div",{"data-testid":"quota-big-fuel-gauge",style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"8px",marginBottom:"8px",padding:"10px 4px 8px",borderRadius:"10px",background:"var(--dsw-alias-surface-l1, rgba(127, 127, 127, 0.05))",border:"1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.1))"}},r.createElement("svg",{viewBox:"0 0 180 96",width:"180",height:"96",style:{overflow:"visible",display:"block"},"aria-hidden":!0},r.createElement("path",{d:"M 25 82 A 65 65 0 0 1 155 82",fill:"none",stroke:"var(--dsw-alias-border-l2)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("path",{d:"M 25 82 A 65 65 0 0 1 37.4 43.8",fill:"none",stroke:"var(--dsw-alias-state-error-primary)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("path",{d:"M 37.4 43.8 A 65 65 0 0 1 90 17",fill:"none",stroke:"var(--dsw-alias-state-warn-primary)",strokeWidth:"7"}),r.createElement("path",{d:"M 90 17 A 65 65 0 0 1 155 82",fill:"none",stroke:"var(--dsw-alias-state-success-primary)",strokeWidth:"7",strokeLinecap:"round"}),r.createElement("text",{x:"18",y:"86",fontSize:"11",fontWeight:"700",fill:"var(--dsw-alias-state-error-primary)",textAnchor:"end"},"E"),r.createElement("text",{x:"162",y:"86",fontSize:"11",fontWeight:"700",fill:"var(--dsw-alias-state-success-primary)",textAnchor:"start"},"F"),r.createElement("line",{x1:"90",y1:"17",x2:"90",y2:"23",stroke:"var(--dsw-specific-menu)",strokeWidth:"1.5"}),r.createElement("circle",{cx:"90",cy:"82",r:"7",fill:"var(--dsw-alias-label-secondary)"}),r.createElement("g",{style:{transformOrigin:"90px 82px",transform:`rotate(${d}deg)`,transition:"transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1)"}},r.createElement("line",{x1:"90",y1:"82",x2:"90",y2:"26",stroke:"var(--dsw-alias-label-primary)",strokeWidth:"2.4",strokeLinecap:"round"}),r.createElement("circle",{cx:"90",cy:"27",r:"1.8",fill:s.color})),r.createElement("circle",{cx:"90",cy:"82",r:"3.5",fill:"var(--dsw-specific-menu)"})),r.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"-6px",gap:"2px"}},r.createElement("div",{"data-testid":"quota-gauge-balance-text",style:{fontSize:"20px",fontWeight:700,color:"var(--dsw-alias-label-primary)",lineHeight:"26px"}},u),r.createElement("div",{style:{fontSize:"11px",color:s.color,fontWeight:600}},o("quota.gauge.ratio",{percent:s.ratio})),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},r.createElement("span",null,`${o("quota.gauge.baseline")}: ${c}`),r.createElement("button",{type:"button","data-testid":"quota-gauge-calibrate-btn",title:o("quota.gauge.calibrateTip",{amount:u}),onClick:n,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{background:"none",border:"none",padding:"1px 4px",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",cursor:"pointer",textDecoration:l?"underline":"none"}},`[${o("quota.gauge.calibrate")}]`))))}function Kt(e){const s=J(),[n,i]=a(S.getSnapshot());o(()=>S.subscribe(()=>i(S.getSnapshot())),[]);const[d,c]=a(new Set),u=e=>c(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a}),[p,m]=a(!1),g=e&&e.directoryStore,h=e&&"string"==typeof e.sessionId&&""!==e.sessionId?e.sessionId:void 0,[f,b]=a(null),v=null!=g?g:f;o(()=>{if(null!=g)return;if(void 0===h)return;let e=!1,a=null;const r=[250,500,1e3,2e3,4e3,8e3,15e3],s=n=>{if(e)return;let o=null;try{o=$e()}catch(e){o=null}if(null==o||"function"!=typeof o.directoryFor)return;let l=null;try{l=o.directoryFor(h)}catch(e){l=null}if(null==l||void 0===l.store||null===l.store)n>=r.length||(a=t.timer.timeout(()=>{a=null,s(n+1)},r[n]));else{b(l.store);try{const e=l.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}};return s(0),()=>{e=!0,null!==a&&a()}},[g,h]),o(()=>{if(v)return rt(),bt},[v]);const[y,w]=a(v?v.getSnapshot():null);o(()=>{if(v)return w(v.getSnapshot()),v.subscribe(()=>w(v.getSnapshot()))},[v]),o(()=>{v&&(null===y||null==y?.current)&&e&&"function"==typeof e.loadDirectory&&e.loadDirectory()},[v,y,e&&e.loadDirectory]);const[x,k]=a(!1),E=l(null),C=l(null),[T,q]=a($t);o(()=>{if("undefined"==typeof window||null===window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia("(max-width: 1023px)"),t=()=>q(e.matches);return t(),"function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t)}},[]);const[A,z]=a(!1),M=y?.current?.provider??null,I=y?.current?.model??null,R=null!==M?(n.providers||[]).find(e=>e.provider===M&&!0===e.adapted):null,O=Array.isArray(R?.windows)?R.windows:[],H="cliproxy"===R?.kind?function(e){if("string"!=typeof e||""===e.trim())return null;const t=e.trim().toLowerCase();return t.includes("claude")||t.includes("gpt-oss")?"claude":t.includes("gemini")?"gemini":t.includes("codex")||t.includes("gpt")||t.includes("chatgpt")||/(?:^|[-_/])o[134](?:[-_/]|$)/.test(t)?"codex":null}(I):null,D="claude"===H?"Claude":"gemini"===H?"Gemini":"codex"===H?"Codex":null,L=null!==H?O.filter(e=>function(e,t){return!t||Vt(e)===t}(e,H)):O,N=L.length>0&&!A?L:O,W=function(e){if("string"!=typeof e)return null;const t=e.trim().match(/^([A-Za-z][A-Za-z0-9_-]{0,31})\s*[:/]/);return null===t?null:t[1].toLowerCase()}(I),B=null===W?[]:O.filter(e=>"realm-daily-tokens"===e.kindKey&&String(e.label??"").trim().toLowerCase()===W),P=0===B.length?N:[...B,...N.filter(e=>-1===B.indexOf(e))],j=(B.length>0?B:L.length>0?L:O).filter(e=>"number"==typeof e.percent),$=e=>!0===e.remaining?100-e.percent:e.percent,V=j.length>0?j.reduce((e,t)=>$(t)>$(e)?t:e,j[0]):null,F=null===V?vt(N):null,U=null!==F,[,K]=a(0),G=U?yt(M,F.amount,F.currency):0,Y=U?xt(F.amount,G,F.currency):null;o(()=>{z(!1)},[M,I,x]);const Q=l(new Set);o(()=>{if(null===M)return;const e=(n.providers||[]).find(e=>e.provider===M&&!0===e.adapted);(void 0===e||!1===Array.isArray(e.windows)&&!0!==e.refreshing&&void 0===e.errorCode)&&!Q.current.has(M)&&(Q.current.add(M),kt({providers:[M]}))},[M,n]),o(()=>{if(!x||"undefined"==typeof document)return;const e=e=>{E.current&&e.target instanceof Node&&E.current.contains(e.target)||C.current&&e.target instanceof Node&&C.current.contains(e.target)||k(!1)},t=e=>{"Escape"===e.key&&k(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[x]);const Z=x&&T&&null!==jt&&"undefined"!=typeof document&&null!==document.body&&void 0!==document.body,[X,ee]=a(null);if(o(()=>{if(!x||!Z)return;const e=()=>{if(E.current&&"function"==typeof E.current.getBoundingClientRect&&"undefined"!=typeof window)try{const e=E.current.getBoundingClientRect();e&&"number"==typeof e.top&&Number.isFinite(e.top)&&ee(Math.max(16,Math.round(window.innerHeight-e.top+8)))}catch(e){}};return e(),"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("resize",e),window.addEventListener("scroll",e,!0)),()=>{"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0))}},[x,Z]),null==R)return null;if(O.length>0&&null===V&&null===F)return null;const te=null===V?0:V.percent,ae=null!==V,re=!ae||!0===V.remaining,se=s(re?"quota.panel.remaining":"quota.panel.used"),ne=U?Y.color:(re?te<=20:te>=80)?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",oe=2*Math.PI*5.5,le=[R?.displayName||M,D,B.length>0?W:null].filter(e=>"string"==typeof e&&""!==e).join(" · "),ie=ae?`${s("quota.ring.label")} · ${le} · ${se} ${te}%`:`${s("quota.ring.label")} · ${le}`,de=void 0!==R.errorCode?r.createElement("div",{style:{marginTop:"8px",fontSize:"12px",lineHeight:"18px",color:"var(--dsw-alias-state-error-primary)"}},Bt(R,s)):null,ce=!0===R.refreshing||"number"==typeof R.fetchedAt?r.createElement("div",{style:{marginTop:"8px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},!0===R.refreshing?s("quota.refreshing"):s("quota.updated",{time:nt(R.fetchedAt)})):null,ue=Ht(R,O),pe=r.createElement("button",{type:"button","data-testid":"quota-ring-trigger","aria-label":ie,"aria-haspopup":"dialog","aria-expanded":x,title:ie,onClick:()=>{const e=!x;if(e&&E.current&&"function"==typeof E.current.getBoundingClientRect&&"undefined"!=typeof window)try{const e=E.current.getBoundingClientRect();e&&"number"==typeof e.top&&Number.isFinite(e.top)&&ee(Math.max(16,Math.round(window.innerHeight-e.top+8)))}catch(e){}k(e),e&&kt({providers:null===M?[]:[M]})},style:{width:"28px",height:"28px",border:"none",..._("999px"),background:"transparent",cursor:"pointer",display:"grid",placeItems:"center",padding:0,color:"var(--dsw-alias-label-secondary)"}},U?r.createElement("svg",{viewBox:"0 0 20 20",width:"17",height:"17","aria-hidden":!0,style:{display:"block"}},r.createElement("path",{d:"M 3.8 15 A 7.5 7.5 0 1 1 16.2 15",fill:"none",stroke:"var(--dsw-alias-border-l3)",strokeWidth:"2.2",strokeLinecap:"round"}),r.createElement("path",{d:"high"===Y.gear?"M 3.8 15 A 7.5 7.5 0 1 1 16.2 15":"mid"===Y.gear?"M 3.8 15 A 7.5 7.5 0 0 1 10 3.0":"M 3.8 15 A 7.5 7.5 0 0 1 2.6 9.2",fill:"none",stroke:Y.color,strokeWidth:"2.2",strokeLinecap:"round"}),r.createElement("circle",{cx:"10",cy:"10.5",r:"2.0",fill:Y.color}),r.createElement("line",{x1:"10",y1:"10.5",x2:"high"===Y.gear?"13.9":"mid"===Y.gear?"10":"6.1",y2:"high"===Y.gear?"8.25":"mid"===Y.gear?"5.5":"12.8",stroke:Y.color,strokeWidth:"2.0",strokeLinecap:"round"})):r.createElement("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0},r.createElement("circle",{cx:"7",cy:"7",r:5.5,fill:"none",stroke:"var(--dsw-alias-border-l3)",strokeWidth:"2"}),r.createElement("circle",{cx:"7",cy:"7",r:5.5,fill:"none",stroke:ne,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${oe*te/100} ${oe}`,transform:"rotate(-90 7 7)"}))),me=x?r.createElement("div",{ref:C,role:"dialog","aria-label":s("quota.panel.title"),"data-testid":"quota-ring-panel",style:Z?{position:"fixed",left:"50%",bottom:(null!==X?X:80)+"px",transform:"translateX(-50%)",zIndex:1e3,boxSizing:"border-box",width:"min(280px, calc(100vw - 32px))",maxHeight:`min(560px, calc(100dvh - ${(null!==X?X:80)+16}px))`,overflowY:"auto",padding:"12px",borderRadius:"12px",background:"var(--dsw-specific-menu)",border:"1px solid var(--dsw-alias-border-inverted)",boxShadow:"var(--dsw-shadow-lv3)"}:{position:"absolute",bottom:"calc(100% + 8px)",right:0,zIndex:100,boxSizing:"border-box",width:"max-content",minWidth:"240px",maxWidth:"min(480px, calc(100vw - 32px))",padding:"12px",borderRadius:"12px",background:"var(--dsw-specific-menu)",border:"1px solid var(--dsw-alias-border-inverted)",boxShadow:"var(--dsw-shadow-lv3)"}},r.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},se),r.createElement("span",{style:{marginLeft:"auto",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},le)),...U?[r.createElement(Ut,{key:"panel-big-fuel-gauge",balanceInfo:F,gaugeState:Y,onCalibrate:()=>{U&&M&&F&&null!==wt(M,F.amount,F.currency)&&K(e=>e+1)},translate:s})]:[],r.createElement("div",{style:{marginTop:U?"4px":"10px",display:"flex",flexDirection:"column",gap:"8px"}},(()=>{const e="cliproxy"!==R?.kind||!A&&null!==H?null:Ft(N);return e&&e.length>1?e.map((e,t)=>r.createElement("div",{key:`ring-family-${e.family}`,"data-testid":`quota-ring-family-${e.family}`,style:{display:"flex",flexDirection:"column",gap:"6px",marginTop:0===t?"0":"4px",paddingTop:0===t?"0":"8px",borderTop:0===t?"none":"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{"data-testid":`quota-ring-family-title-${e.family}`,style:{fontSize:"11px",fontWeight:600,color:"var(--dsw-alias-label-secondary)"}},s("quota.family."+e.family)),e.windows.map(e=>Pt(e,s,null)))):P.map(e=>Pt(e,s,null))})()),O.length>L.length&&L.length>0?r.createElement("div",{style:{marginTop:"6px",textAlign:"center"}},r.createElement("button",{type:"button","data-testid":"quota-ring-toggle-all",onClick:()=>z(!A),style:{fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"2px 6px",textDecoration:"underline"}},A?s("quota.filter.currentOnly"):s("quota.filter.showAll",{count:O.length}))):null,...null!==ue?[r.createElement(Dt,{key:"panel-peak-timeline",showCaption:!1,schedule:ue})]:[],...(()=>{const e=function(e,t=Date.now()){if(!Array.isArray(e)||0===e.length)return[];const a=[],r=new Map;for(const t of e){const e="string"==typeof t?.account?t.account.trim():"",s=""===e?"\0provider":e;let n=r.get(s);void 0===n&&(n=a.length,r.set(s,n),a.push({account:e,cards:[]})),a[n].cards.push(t)}for(const e of a)e.cards=Wt(e.cards,t);return a}(R.resetCards);return 0===e.length?[]:[r.createElement("div",{key:"panel-reset-cards","data-testid":"panel-reset-cards",style:{marginTop:"10px",paddingTop:"8px",borderTop:"1px solid var(--dsw-alias-border-l1)",display:"flex",flexDirection:"column",gap:"6px"}},"cliproxy"===R?.kind?r.createElement("button",{key:"panel-reset-title",type:"button","data-testid":"quota-panel-reset-title","aria-expanded":String(p),onClick:()=>m(!p),style:{display:"flex",alignItems:"center",alignSelf:"flex-start",fontSize:"11px",fontWeight:600,color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:0,textAlign:"left"}},`${p?"▾":"▸"} ${s("quota.resetCard.codexTitle")}`):null,..."cliproxy"!==R?.kind||p?e.map((t,a)=>{const n=d.has(`panel:${a}`),o=n?t.cards:t.cards.slice(0,1),l=t.cards.length-o.length,i=""!==t.account?t.account:s("quota.resetCard.title");return r.createElement("div",{key:`panel-reset-group-${a}`,"data-testid":`quota-panel-reset-group-${a}`,style:{display:"flex",flexDirection:"column",gap:"2px"}},e.length>1||""!==t.account?r.createElement("div",{"data-testid":`quota-panel-reset-owner-${a}`,title:i,style:{fontSize:"11px",color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i):null,o.map((e,t)=>{const n=Nt(e,s);return r.createElement("div",{key:`panel-reset-card-${t}`,"data-testid":`quota-panel-reset-card-${a}-${t}`,style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",lineHeight:"16px",color:n.textColor}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:n.iconColor,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0}},r.createElement("rect",{x:2,y:5,width:20,height:14,rx:2}),r.createElement("line",{x1:2,y1:10,x2:22,y2:10})),r.createElement("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},""!==n.expiry?`${n.title} · ${n.expiry}`:n.title))}),l>0?r.createElement("button",{type:"button","data-testid":`quota-panel-reset-more-${a}`,onClick:()=>u(`panel:${a}`),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},s("quota.resetCard.more",{count:l})):null,n&&t.cards.length>1?r.createElement("button",{type:"button","data-testid":`quota-panel-reset-less-${a}`,onClick:()=>u(`panel:${a}`),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},s("quota.resetCard.less")):null)}):[])]})(),de,ce):null;return r.createElement("span",{ref:E,style:{position:"relative",display:"inline-flex"}},pe,Z?jt(me,document.body):me)}function Gt(){const e=J(),{snapshot:t}=v(),[a,s]=r.useState(!1),n="ready"===t.status&&!0===t.writable;return r.createElement("li",{style:{listStyle:"none",border:"1px solid "+(a?"var(--dsw-alias-label-dimmed)":"var(--dsw-alias-border-l2)"),borderRadius:"12px",color:"var(--dsw-alias-label-primary)",background:a?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)"}},r.createElement("button",{type:"button","data-testid":"feature-card-toggle","aria-expanded":String(a),onClick:()=>s(!a),style:{appearance:"none",width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",border:0,borderRadius:"12px",background:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer"}},r.createElement("span",{style:{display:"flex",minWidth:0,flex:1,flexDirection:"column",gap:"4px"}},r.createElement("span",{style:{fontSize:"15px",fontWeight:600,lineHeight:1.4}},e("features.cardTitle")),r.createElement("span",{style:{fontSize:"13px",lineHeight:1.5,color:"var(--dsw-alias-label-tertiary)"}},e("features.cardHint"))),r.createElement("svg",{viewBox:"0 0 14 14",width:14,height:14,"aria-hidden":"true",style:{flex:"none",color:"var(--dsw-alias-label-tertiary)",transform:a?"rotate(180deg)":"none",transition:"transform .16s"}},r.createElement("path",{d:"M3 5.25 7 9l4-3.75",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"}))),a?r.createElement("div",{style:{margin:"0 16px",padding:"12px 0 8px",borderTop:"1px solid var(--dsw-alias-border-l2)"}},r.createElement(Qt,null),n?null:r.createElement("p",{style:{margin:"6px 0 0",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("features.readOnly"))):null)}const Yt=[["features.group.runtime",["healthDiagnostics","modelUsage","quotaLookup"],!0],["features.group.maintenance",["backupMaintenance","skillManager","subagentRoute","sessionManager","modelCatalog"],!0],["features.group.interaction",["taskNotifications","mobileAdaptation","modelProviderIcons","fileEditor"],!0],["features.external",["healthz"],!1]];function Qt(){const e=J(),{snapshot:t,value:s}=v(),[n,o]=a(""),l="ready"===t.status&&!0===t.writable,i=t=>r.createElement("div",{key:t,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"14px",padding:"7px 0"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},e("features."+t)),r.createElement("button",{type:"button",role:"switch","data-testid":"feature-switch-"+t,"aria-checked":String(!1!==s[t]),disabled:!l||n===t,onClick:async()=>{o(t);try{await g.set(t,!1===s[t])}catch(e){}o("")},style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(!1!==s[t]?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:!1!==s[t]?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:l&&""===n?"pointer":"default",opacity:l?1:.5,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:!1!==s[t]?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:!1!==s[t]?"#fff":"var(--dsw-alias-label-tertiary)"}})));return r.createElement("div",null,Yt.map(([t,a])=>r.createElement("div",{key:t,style:{marginTop:"10px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"2px"}},e(t)),a.map(i))))}function Jt(){const e=J(),[s,n]=a(A()),[i,d]=a(T()),[c,u]=a(!1),[p,m]=a(null),g=l(null),[,h]=a(0),f=()=>{u(!0),null!==g.current&&g.current(),g.current=t.timer.timeout(()=>{g.current=null,u(!1)},2e3)};o(()=>()=>{null!==g.current&&g.current(),g.current=null},[]),o(()=>{if("function"==typeof t.slots?.subscribe)return t.slots.subscribe("settings.section",()=>h(e=>e+1))},[]),o(()=>{const e=()=>{n(A()),d(T())};return E.add(e),()=>E.delete(e)},[]);const b=k(),v=new Map;for(const e of b){const t=e.options?.id??e.options?.key??"";t&&!v.has(t)&&v.set(t,{id:t,label:z(e.options),defaultOrder:e.options?.order??0})}let y=[];if(s&&s.length>0)for(const e of s)v.has(e)&&(y.push(v.get(e)),v.delete(e));const w=Array.from(v.values()).sort((e,t)=>e.defaultOrder-t.defaultOrder);y=y.concat(w);const x=(e,t)=>{if(e<0||t<0||e>=y.length||t>=y.length||e===t)return;const a=y.map(e=>e.id),[r]=a.splice(e,1);a.splice(t,0,r),n(a),I(a),C(),O(a,Array.isArray(i)?i:[])},S=new Set(Array.isArray(i)?i:[]);return r.createElement("div",{"data-testid":"config-nav-order-page",style:{display:"flex",flexDirection:"column",gap:"12px"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("div",{style:{minWidth:0,flex:"1 1 260px"}},r.createElement("div",{"data-testid":"nav-order-title",style:{fontSize:"14px",fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("config.navOrder.title"))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"}},c?r.createElement("span",{"data-testid":"nav-order-saved-tip",style:{fontSize:"12px",color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("config.navOrder.saved")):null,r.createElement("button",{type:"button","data-testid":"nav-order-reset",onClick:()=>{n(null),d([]),I(null),M(null),C(),f(),H()},style:me("ghost")},e("config.navOrder.reset")),r.createElement("button",{type:"button","data-testid":"nav-order-save",onClick:()=>{const e=y.map(e=>e.id);n(e),I(e),M(i),C(),f(),O(e,Array.isArray(i)?i:[])},style:me("primary")},e("config.navOrder.save")))),0===y.length?r.createElement("div",{style:{padding:"16px",textAlign:"center",color:"var(--dsw-alias-label-tertiary)",fontSize:"13px"}},e("config.navOrder.empty")):r.createElement("div",{"data-testid":"nav-order-list",style:{display:"flex",flexDirection:"column",gap:"8px"}},y.map((t,a)=>{const n="dsh-service"===t.id||!S.has(t.id),o="dsh-service"===t.id,l=p===a;return r.createElement("div",{key:t.id,"data-testid":"nav-order-item-"+t.id,draggable:!0,onDragStart:e=>{try{e.dataTransfer.setData("text/plain",String(a)),e.dataTransfer.effectAllowed="move"}catch(e){}m(a)},onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch(e){}},onDrop:e=>{e.preventDefault();let t=a;try{const a=e.dataTransfer.getData("text/plain");t=Number.parseInt(a,10)}catch(e){}Number.isNaN(t)||t===a||x(t,a),m(null)},onDragEnd:()=>m(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"9px 14px",borderRadius:"var(--dsh-svc-radius-control, 8px)",border:"1px solid "+(l?"var(--dsh-svc-brand)":"var(--dsw-alias-border-l1)"),background:l?"var(--dsw-alias-interactive-bg-hover)":"var(--dsh-svc-card-bg)",opacity:n?1:.5,transition:"border-color 120ms, background 120ms, opacity 120ms",cursor:"grab",userSelect:"none"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},r.createElement("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:"13px",cursor:"grab",letterSpacing:"-1px"},"aria-hidden":"true"},"⋮⋮"),r.createElement("span",{style:{fontSize:"13px",fontWeight:550,color:"var(--dsw-alias-label-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},t.label||t.id),r.createElement("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-tertiary)",fontFamily:"monospace"}},t.id),o?r.createElement("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"rgba(59,130,246,0.12)",color:"var(--dsh-svc-brand)",fontWeight:500}},e("config.navOrder.locked")):null),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}},r.createElement("button",{type:"button","data-testid":"nav-order-up-"+t.id,"aria-label":e("config.navOrder.moveUp"),title:e("config.navOrder.moveUp"),disabled:0===a,onClick:e=>{e.stopPropagation(),x(a,a-1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:0===a?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:0===a?"default":"pointer",opacity:0===a?.35:1,fontSize:"12px",lineHeight:"24px"}},"↑"),r.createElement("button",{type:"button","data-testid":"nav-order-down-"+t.id,"aria-label":e("config.navOrder.moveDown"),title:e("config.navOrder.moveDown"),disabled:a===y.length-1,onClick:e=>{e.stopPropagation(),x(a,a+1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:a===y.length-1?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:a===y.length-1?"default":"pointer",opacity:a===y.length-1?.35:1,fontSize:"12px",lineHeight:"24px"}},"↓"),r.createElement("button",{type:"button",role:"switch","data-testid":"nav-order-toggle-"+t.id,"aria-checked":String(n),"aria-label":e(n?"config.navOrder.visible":"config.navOrder.hidden"),title:e(o?"config.navOrder.locked":n?"config.navOrder.visible":"config.navOrder.hidden"),disabled:o,onClick:e=>{e.stopPropagation(),(e=>{if("dsh-service"===e)return;const t=Array.isArray(i)?i:[],a=new Set(t);a.has(e)?a.delete(e):a.add(e);const r=Array.from(a);d(r),M(r),C(),O(Array.isArray(s)?s:null,r)})(t.id)},style:{width:"34px",height:"20px",..._("10px"),padding:0,position:"relative",flexShrink:0,border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:o?"not-allowed":"pointer",opacity:o?.6:1,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 120ms ease"}}))))})))}const Zt=["inherit","follow","custom"],Xt="dsh-service-subagent-route-cache",ea=e=>null!==e&&"object"==typeof e&&"string"==typeof e.provider&&"string"==typeof e.id;function ta(){try{const e=JSON.parse(localStorage.getItem(Xt)||"null");return null===e||"object"!=typeof e?null:Zt.includes(e.mode)&&Array.isArray(e.models)&&e.models.every(ea)?{mode:e.mode,provider:"string"==typeof e.provider?e.provider:"",model:"string"==typeof e.model?e.model:"",reasoningEffort:"string"==typeof e.reasoningEffort?e.reasoningEffort:"",fallbacks:Array.isArray(e.fallbacks)?e.fallbacks:[],models:e.models,...null!==e.current&&"object"==typeof e.current?{current:e.current}:{},..."boolean"==typeof e.available?{available:e.available}:{}}:null}catch(e){return null}}function aa(){const e=J(),{useState:t,useEffect:a}=r,s=r.useRef(null);null===s.current&&(s.current={cached:ta()});const n=!1!==v().value.subagentModelsDock,o=s.current.cached,[l,i]=t(o),[c,u]=t(null!==o?o.mode:"inherit"),[p,m]=t(null!==o?o.provider:""),[h,f]=t(null!==o?o.model:""),[b,y]=t(!0),[w,x]=t(!1),[k,S]=t(0),[E,C]=t(""),[T,q]=t(null!==o?o.reasoningEffort:""),[A,z]=t(null!==o?o.fallbacks:[]),[M,I]=t(null!==o&&"string"==typeof o.preset?o.preset:""),[R,O]=t(!1),H={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},D={fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"},L=async()=>{y(!0);try{const e=await d("subagent-route",{});e.ok?(i(e.value),u(e.value.mode),z(Array.isArray(e.value.fallbacks)?e.value.fallbacks:[]),"string"==typeof e.value.provider&&m(e.value.provider),"string"==typeof e.value.model&&f(e.value.model),q("string"==typeof e.value.reasoningEffort?e.value.reasoningEffort:""),I("string"==typeof e.value.preset?e.value.preset:""),function(e){if(null!==e&&"object"==typeof e&&Zt.includes(e.mode)&&Array.isArray(e.models))try{localStorage.setItem(Xt,JSON.stringify({mode:e.mode,provider:"string"==typeof e.provider?e.provider:"",model:"string"==typeof e.model?e.model:"",reasoningEffort:"string"==typeof e.reasoningEffort?e.reasoningEffort:"",fallbacks:Array.isArray(e.fallbacks)?e.fallbacks:[],models:e.models.filter(ea),...null!==e.current&&"object"==typeof e.current?{current:e.current}:{},..."boolean"==typeof e.available?{available:e.available}:{}}))}catch(e){}}(e.value),C("")):C(e.error||"unknown")}catch(e){C("network")}finally{y(!1)}};a(()=>{L()},[]);const N=null!==l&&Array.isArray(l.models)?l.models:[],W=[],B={};for(const e of N)void 0===B[e.provider]&&(B[e.provider]=e.providerName,W.push(e.provider));const P=e=>N.filter(t=>t.provider===e),j=e=>{const t=[],a=new Set;for(const r of e?.reasoning?.efforts??[]){if(null===r||"object"!=typeof r)continue;const e="string"==typeof r.id?r.id:"";""===e||a.has(e)||(a.add(e),t.push({id:e,name:"string"==typeof r.name&&""!==r.name?r.name:e,description:"string"==typeof r.description&&""!==r.description?r.description:void 0}))}return t},$=W.includes(p)?p:W[0]??"",V=P($),F=V.some(e=>e.id===h)?h:V[0]?.id??"",U=V.find(e=>e.id===F)??null,K=j(U),G=K.some(e=>e.id===T)?T:"",Y=(e,t)=>{z(a=>a.map((a,r)=>r===e?{...a,...t}:a))},Q=(e,t)=>{z(a=>{const r=e+t;if(r<0||r>=a.length)return a;const s=[...a],n=s.splice(e,1)[0];return s.splice(r,0,n),s})};a(()=>{R&&A.length<2&&O(!1)},[A.length]);const Z=async e=>{x(!0),C("");try{const t=("custom"===e||"follow"===e)&&A.length>0?{fallbacks:A}:{},a="custom"===e?{mode:"custom",provider:$,model:F,...""!==G?{reasoningEffort:G}:{},...t}:{mode:e,...t};!0===l?.presetSupported&&(a.preset=M);const r=await d("subagent-route-save",a);r.ok?(S(e=>e+1),await L()):C(r.error||"unknown")}catch(e){C("network")}finally{x(!1)}},X=be(),ee=(e,t,a,s)=>r.createElement("button",{type:"button","data-testid":e,disabled:t||w,onClick:a,style:{fontSize:"12px",lineHeight:"14px",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsh-svc-text)",cursor:t||w?"default":"pointer",opacity:t||w?.55:1}},s),te={fontSize:"12px",color:"var(--dsw-alias-label-secondary)",width:"88px",flexShrink:0};return r.createElement("div",{"data-testid":"subagent-section",style:X},r.createElement("div",{style:{fontSize:"14px",fontWeight:700}},e("subagent.title")),r.createElement("p",{style:H},e("subagent.hint")),r.createElement("div",{"data-testid":"subagent-dock-toggle-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"12px",padding:"10px 12px",border:"1px solid var(--dsh-svc-border)",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{flex:1,minWidth:0}},r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("subagent.dock.title"))),r.createElement("button",{type:"button",role:"switch","aria-checked":String(n),"data-testid":"subagent-dock-toggle",onClick:()=>{g.set("subagentModelsDock",!n).catch(()=>{})},style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 150ms ease"}}))),null!==l&&!1===l.available?r.createElement("p",{"data-testid":"subagent-unavailable",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.unavailable")):null,b&&null===l?r.createElement("p",{"data-testid":"subagent-loading",style:H},e("subagent.loading")):null,r.createElement("div",{"data-testid":"subagent-modes",style:{display:"flex",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},Zt.map(t=>r.createElement("button",{type:"button",key:t,"data-testid":"subagent-mode-"+t,"aria-pressed":String(c===t),disabled:b,onClick:()=>u(t),style:Object.assign({},ge(),{cursor:b?"default":"pointer",background:c===t?"var(--dsh-svc-tab-active-bg)":"transparent",color:c===t?"var(--dsh-svc-tab-active-text)":"var(--dsh-svc-text)",opacity:b?.55:1})},e("subagent.mode."+t)))),r.createElement("p",{"data-testid":"subagent-mode-desc",style:{...H,marginTop:"8px"}},e("subagent.mode."+c+".desc")),r.createElement("div",{"data-testid":"subagent-preset-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"10px",flexWrap:"wrap"}},r.createElement("span",{style:te},e("subagent.preset")),r.createElement("select",{"data-testid":"subagent-preset",value:M,disabled:b||w||!l?.presetSupported||0===(l?.presets??[]).length,onChange:e=>I(e.target.value),style:D},r.createElement("option",{value:""},e("subagent.preset.inherit")),...(l?.presets??[]).map(e=>r.createElement("option",{key:e.id,value:e.id,...e.broken?{disabled:!0}:{}},e.name?e.name+" ("+e.id+")":e.id))),l?.presetSupported&&0!==(l?.presets??[]).length?null:r.createElement("span",{"data-testid":"subagent-preset-empty",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("subagent.preset.empty"))),r.createElement("p",{"data-testid":"subagent-preset-desc",style:{...H,marginTop:"6px"}},e("subagent.preset.desc")),"custom"===c?r.createElement("div",{"data-testid":"subagent-custom",style:{marginTop:"8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.provider")),r.createElement("select",{"data-testid":"subagent-provider",value:$,disabled:0===W.length||w,onChange:e=>m(e.target.value),style:D},W.map(e=>r.createElement("option",{key:e,value:e},B[e]??e)))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.model")),r.createElement("select",{"data-testid":"subagent-model",value:F,disabled:0===V.length||w,onChange:e=>f(e.target.value),style:D},V.map(e=>r.createElement("option",{key:e.id,value:e.id},e.name??e.id)))),""!==F?r.createElement("div",{"data-testid":"subagent-reasoning-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px",flexWrap:"wrap"}},r.createElement("span",{style:te},e("subagent.reasoningEffort")),r.createElement("select",{"data-testid":"subagent-reasoning-effort",value:G,disabled:w||0===K.length,onChange:e=>q(e.target.value),style:D},r.createElement("option",{value:""},e("subagent.reasoningEffort.default")),...K.map(e=>r.createElement("option",{key:e.id,value:e.id,...void 0!==e.description?{title:e.description}:{}},e.name))),0===K.length?r.createElement("span",{"data-testid":"subagent-reasoning-effort-unavailable",style:{fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.reasoningEffort.unavailable")):null):null):null,"custom"!==c||0!==N.length||b?null:r.createElement("p",{"data-testid":"subagent-models-empty",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.modelsEmpty")),"custom"===c||"follow"===c?r.createElement("div",{"data-testid":"subagent-fallback-block",style:{marginTop:"14px",borderTop:"1px solid var(--dsh-svc-border)",paddingTop:"12px"}},r.createElement("div",{style:{fontSize:"13px",fontWeight:700}},e("subagent.fallback.title")),r.createElement("p",{style:H},e("subagent.fallback.hint")),0===A.length?r.createElement("p",{"data-testid":"subagent-fallback-empty",style:{...H,color:"var(--dsw-alias-label-secondary)"}},e("subagent.fallback.empty")):null,A.map((t,a)=>{const s=W.includes(t.provider),n=s?P(t.provider):[],o=n.find(e=>e.id===t.model)??null,l=j(o),i=l.map(e=>e.id);return r.createElement("div",{key:a,"data-testid":"subagent-fallback-row",style:{marginTop:"8px",border:"1px solid var(--dsh-svc-border)",borderRadius:"8px",padding:"7px 10px 8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"2px"}},r.createElement("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("subagent.fallback.item",{index:String(a+1)})),r.createElement("span",{style:{marginLeft:"auto"}}),((e,t,a,s,n=!1)=>r.createElement("button",{type:"button","data-testid":e,disabled:t||w,onClick:a,style:{fontSize:"12px",padding:"3px 8px",borderRadius:"6px",border:"1px solid "+(n?"var(--dsw-alias-state-error-primary)":"var(--dsh-svc-border-strong)"),background:"transparent",color:n?"var(--dsw-alias-state-error-primary)":"var(--dsh-svc-text)",cursor:t||w?"default":"pointer",opacity:t||w?.55:1}},s))("subagent-fallback-remove-"+a,!1,()=>(e=>{z(t=>t.filter((t,a)=>a!==e))})(a),e("subagent.fallback.remove"),!0),R?ee("subagent-fallback-up-"+a,0===a,()=>Q(a,-1),"▲"):null,R?ee("subagent-fallback-down-"+a,a===A.length-1,()=>Q(a,1),"▼"):null),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.provider")),r.createElement("select",{"data-testid":"subagent-fallback-provider-"+a,value:s?t.provider:"",disabled:w,onChange:e=>{const t=e.target.value;Y(a,{provider:t,model:P(t)[0]?.id??""})},style:D},r.createElement("option",{value:""},""),W.map(e=>r.createElement("option",{key:e,value:e},B[e]??e)))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.model")),r.createElement("select",{"data-testid":"subagent-fallback-model-"+a,value:n.some(e=>e.id===t.model)?t.model:"",disabled:0===n.length||w,onChange:e=>{const r=e.target.value,s=n.find(e=>e.id===r)??null,o=j(s).map(e=>e.id);Y(a,{model:r,..."string"!=typeof t.reasoningEffort||""===t.reasoningEffort||o.includes(t.reasoningEffort)?{}:{reasoningEffort:void 0}})},style:D},n.map(e=>r.createElement("option",{key:e.id,value:e.id},e.name??e.id)))),l.length>0?r.createElement("div",{"data-testid":"subagent-fallback-reasoning-row",style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"}},r.createElement("span",{style:te},e("subagent.reasoningEffort")),r.createElement("select",{"data-testid":"subagent-fallback-effort-"+a,value:i.includes(t.reasoningEffort)?t.reasoningEffort:"",disabled:w,onChange:e=>Y(a,{reasoningEffort:""===e.target.value?void 0:e.target.value}),style:D},r.createElement("option",{value:""},e("subagent.reasoningEffort.default")),...l.map(e=>r.createElement("option",{key:e.id,value:e.id,...void 0!==e.description?{title:e.description}:{}},e.name)))):r.createElement("span",{"data-testid":"subagent-fallback-effort-unavailable-"+a,style:{display:"inline-block",marginTop:"4px",fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.reasoningEffort.unavailable")))}),A.length>=10?r.createElement("p",{"data-testid":"subagent-fallback-limit",style:{...H,color:"var(--dsw-alias-state-warn-primary)"}},e("subagent.fallback.limit",{max:String(10)})):r.createElement("div",{style:{display:"flex",gap:"10px",marginTop:"8px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"subagent-fallback-add",disabled:w||0===W.length,onClick:()=>{z(e=>{if(e.length>=10)return e;const t=W[0]??"";return[...e,{provider:t,model:P(t)[0]?.id??""}]})},style:{fontSize:"12px",padding:"5px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px dashed var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsh-svc-text)",cursor:w||0===W.length?"default":"pointer",opacity:w||0===W.length?.55:1}},e("subagent.fallback.add")),A.length>1?r.createElement("button",{type:"button","data-testid":"subagent-fallback-sort",disabled:w,onClick:()=>O(e=>!e),style:{fontSize:"12px",padding:"5px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsh-svc-border-strong)",background:R?"var(--dsh-svc-tab-active-bg)":"transparent",color:R?"var(--dsh-svc-tab-active-text)":"var(--dsh-svc-text)",cursor:w?"default":"pointer",opacity:w?.55:1}},e(R?"subagent.fallback.sort.done":"subagent.fallback.sort")):null)):null,""!==E?r.createElement("p",{"data-testid":"subagent-error",style:{...H,color:"var(--dsw-alias-state-error-primary)"}},function(e,t){return"feature-disabled"===t?e("subagent.error.feature-disabled"):"llm-unavailable"===t?e("subagent.error.llm-unavailable"):"unknown-mode"===t?e("subagent.error.unknown-mode"):"invalid-model-route"===t?e("subagent.error.invalid-model-route"):"invalid-reasoning-effort"===t?e("subagent.error.invalid-reasoning-effort"):"network"===t?e("subagent.error.network"):t}(e,E)):null,k>0&&""===E?r.createElement("p",{"data-testid":"subagent-saved",style:{...H,color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("subagent.saved")):null,r.createElement("div",{style:{display:"flex",gap:"10px",marginTop:"12px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"subagent-save",disabled:w||b||"custom"===c&&(""===$||""===F),onClick:()=>{Z(c)},style:{fontSize:"12px",padding:"6px 16px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:w?"default":"pointer",opacity:w||b||"custom"===c&&(""===$||""===F)?.55:1}},e(w?"subagent.saving":"subagent.save")),"inherit"!==c?r.createElement("button",{type:"button","data-testid":"subagent-reset",disabled:w||b,onClick:()=>{u("inherit"),Z("inherit")},style:{fontSize:"12px",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:w?"default":"pointer",opacity:w||b?.55:1}},e("subagent.reset")):null))}const ra="dsh-service-skills-model",sa=(e,t)=>d(e,t);function na(e){return e.provider+"\0"+e.id}function oa(){try{const e=JSON.parse(localStorage.getItem(ra)||"null");if(e&&"string"==typeof e.provider&&"string"==typeof e.model)return e}catch(e){}return null}const la=(e,t)=>{let a=function(e,t){const a="object"==typeof t&&null!==t?t:oa();if(null!==a){const t=e.find(e=>e.provider===a.provider&&e.id===a.model);if(void 0!==t)return t}return e[0]??null}(e,oa());return null===a&&void 0!==t&&(a=e.find(e=>e.provider===t.provider&&e.id===t.model)??null),a},{adoptSkillsBatchStatus:ia,cancelSkillsBatchShared:da,changeSkillsBatchModel:ca,fetchSkillsBatchModels:ua,planSkillsBatchShared:pa,publishSkillsBatch:ma,skillsBatchListDirtyRef:ga,startSkillsBatchShared:ha,useSkillsBatch:fa}=function({ctx:e,rpcCall:t,featureEnabled:a,featureScope:s,currentUiLocale:n,SKILLS_MODEL_STORAGE_KEY:o,skillModelKey:l,resolveSkillModelChoice:i}){const{useState:d,useEffect:c}=r;let u=null,p=null,m=null,g=null,h="";const f={current:!1};let b=null,v=null,y=!1;const w="dsh-service-skills-batch-pending",x=new Set,k=()=>{for(const e of x)e()},S=e=>{try{e?localStorage.setItem(w,"true"):localStorage.removeItem(w)}catch(e){}},E=e=>{S("planned"===e||"running"===e)},C=()=>{null!==b&&(clearInterval(b),b=null)},T=(e=!0)=>{if(null!==u&&"running"===u.phase&&a("skillManager")&&null===b){const a=async()=>{try{const e=await t("skills-batch-status",{});if(!e.ok)return;const a=null!==u?u.phase:null;u=e.value,E(e.value.phase),"running"===a&&"running"!==e.value.phase&&(C(),f.current=!0),k()}catch(e){}};e&&a(),b=setInterval(()=>{a()},2e3)}},q=async()=>{if(null!==m)return m;try{const e=await t("skills-models",{});if(!e.ok)return m=[],m;m=e.value.models??[],null===g&&(g=i(m,e.value.current))}catch(e){m=[]}return m},A=()=>y?Promise.resolve(u):(null!==v||(v=(async()=>{try{const e=await t("skills-batch-status",{});e.ok&&(y=!0,E(e.value.phase),"idle"!==e.value.phase&&(u=e.value,T(!1),k()))}catch(e){}return u})().finally(()=>{v=null})),v);return e.effect(()=>{const e=s.subscribe(()=>{a("skillManager")||C()});return()=>{e(),C()}},"dsh-service skills batch polling lifecycle"),(()=>{try{return"true"===localStorage.getItem(w)}catch(e){return!1}})()&&A(),{adoptSkillsBatchStatus:A,cancelSkillsBatchShared:async()=>{try{await t("skills-batch-cancel",{}),S(!1)}catch(e){}},changeSkillsBatchModel:e=>{const t=(m??[]).find(t=>l(t)===e)??null;if(g=t,null!==t)try{localStorage.setItem(o,JSON.stringify({provider:t.provider,model:t.id}))}catch(e){}k()},fetchSkillsBatchModels:q,planSkillsBatchShared:async()=>{if(h="",k(),0===(await q()).length||null===g)return h="models-empty",k(),!1;try{localStorage.setItem(o,JSON.stringify({provider:g.provider,model:g.id}))}catch(e){}const e=await t("skills-batch-plan",{provider:g.provider,model:g.id});if(!e.ok)return h=e.error||"unknown",k(),!1;p={...e.value,modelItem:g};const a=Array.isArray(e.value.annotated)?e.value.annotated.length:0;return u={phase:"planned",total:e.value.candidates.length+a,done:0,failures:[],current:null,estBytes:e.value.estBytes,logs:[]},E("planned"),T(),k(),!0},publishSkillsBatch:k,skillsBatchListDirtyRef:f,startSkillsBatchShared:async(e=!1)=>{if(null===p||null===u)return!1;const a=await t("skills-batch-run",{planId:p.planId,lang:n(),...!0===e?{forceAnnotated:!0}:{}});return a.ok?(u={...u,phase:"running"},E("running"),T(),k(),!0):(h=a.error||"unknown",k(),!1)},useSkillsBatch:()=>{const[,e]=d(0);return c(()=>{const t=()=>e(e=>e+1);return x.add(t),()=>x.delete(t)},[]),{batch:u,plan:p,models:m,modelItem:g,error:h}}}}({ctx:t,rpcCall:d,featureEnabled:b,featureScope:g,currentUiLocale:p,SKILLS_MODEL_STORAGE_KEY:ra,skillModelKey:na,resolveSkillModelChoice:la}),ba=(e,t)=>{if(null===t||"object"!=typeof t)return String(t);const a=new Date(t.at),r=e=>String(e).padStart(2,"0"),s=Number.isFinite(a.getTime())?r(a.getHours())+":"+r(a.getMinutes())+":"+r(a.getSeconds()):"--:--:--",n="skills.log."+t.code,o=e(n,t.params??{});return"["+s+"]"+(void 0!==t.name?" ["+t.name+"]":"")+" "+(o===n?t.code:o)};function va(e,t){if("models-empty"===t)return e("skills.describe.models.empty");if("llm-unavailable"===t)return e("skills.llm.unavailable");if("batch-already-running"===t)return e("skills.batch.already");if("feature-disabled"===t)return e("skills.error.feature-disabled");if("network"===t)return e("skills.error.network");if("read-only-source"===t)return e("skills.error.read-only-source");if("unknown-skill"===t)return e("skills.error.unknown-skill");if("invalid-field"===t)return e("skills.error.invalid-field");if("invalid-enable"===t)return e("skills.error.invalid-enable");if("invalid-model-route"===t)return e("skills.error.invalid-model-route");if("invalid-description"===t)return e("skills.error.invalid-description");if("describe-timeout"===t)return e("skills.error.describe-timeout");if("batch-cancelled"===t)return e("skills.error.batch-cancelled");if("entry-changed"===t)return e("skills.error.entry-changed");if("unknown-batch-plan"===t)return e("skills.error.unknown-batch-plan");if("batch-already-done"===t)return e("skills.error.batch-already-done");if("batch-already-cancelled"===t)return e("skills.error.batch-already-cancelled");if("annotated-confirm-required"===t)return e("skills.error.annotated-confirm-required");if("string"==typeof t&&t.startsWith("empty-output")){const a=t.slice(13);return e("skills.error.empty-output",{kind:""===a?"?":a})}return"string"==typeof t&&t.startsWith("invalid-skill")?e("skills.error.invalid-skill",{reason:t.startsWith("invalid-skill:")?t.slice(14):""}):e("skills.error",{error:t})}function ya(){const e=J(),[t,s]=a(null),[n,l]=a(""),[i,d]=a(!0),[c,u]=a(""),[m,g]=a([]),[h,f]=a(null),[b,v]=a(null),[y,w]=a(!1),[x,k]=a([]),[S,E]=a(!1),[C,T]=a(!1),[q,A]=a(!1),[z,M]=a(!1),{batch:I,plan:R,models:O,modelItem:H,error:D}=fa(),L=null!==I?I.phase:null;o(()=>{E("running"===L)},[L]);const N=async()=>{d(!0);try{const e=await sa("skills-list",{});e.ok?(s(e.value),l("")):l(e.error||"unknown")}catch(e){l("network")}finally{d(!1)}};o(()=>{N(),ia(),ua().then(ma)},[]),o(()=>{null===I||"done"!==I.phase&&"cancelled"!==I.phase||!ga.current||(ga.current=!1,N())},[null!==I&&I.phase]),o(()=>{if(null===b||!b.busy)return;const e=b.entry.id;let t;const a=async()=>{try{const t=await sa("skills-describe-log",{id:e});t.ok&&k(t.value.logs??[])}catch(e){}};return a(),t=setInterval(()=>{a()},800),()=>clearInterval(t)},[null!==b&&b.busy]),o(()=>{if(null===b||b.busy)return;const e=b.entry.id;(async()=>{try{const t=await sa("skills-describe-log",{id:e});t.ok&&k(t.value.logs??[])}catch(e){}})()},[null!==b&&b.busy]);const W=e=>{s(t=>null===t?t:{...t,entries:t.entries.map(t=>t.id===e.id?e:t)})};o(()=>{if(null===h)return;const e=setTimeout(()=>f(null),3e3);return()=>clearTimeout(e)},[h]),o(()=>{if(!q)return;const e=setTimeout(()=>A(!1),3e3);return()=>clearTimeout(e)},[q]),o(()=>{A(!1)},[L,R]);const B=async(e,t)=>{const a=e.id+":"+t;if(h!==a)return void f(a);f(null);const r="model"===t?!0!==e.invocation.model:!0!==e.invocation.user;try{const a=await sa("skills-toggle",{id:e.id,field:t,enable:r});a.ok?W(a.value.entry):l(a.error+(a.detail?":"+a.detail:"")||"unknown")}catch(e){l("network")}},P={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},j=(e,t)=>r.createElement("span",{key:e,style:he("warn"===t?"warning":"danger"===t?"danger":"neutral",{marginLeft:"6px",padding:"1px 7px",verticalAlign:"middle"})},e),$=(e,t)=>r.createElement("button",{type:"button",role:"switch","data-testid":t.testid,"aria-checked":String(e),title:t.title,disabled:t.disabled,onClick:t.onClick,style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",cursor:t.disabled?"default":"pointer",lineHeight:0,border:"1px solid "+(t.armed?"var(--dsw-alias-state-warn-primary)":e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:t.armed?"transparent":e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",opacity:t.disabled?.5:1}},r.createElement("span",{style:{position:"absolute",top:"1px",left:e&&!t.armed?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:t.armed?"var(--dsw-alias-state-warn-primary)":e?"#fff":"var(--dsw-alias-label-tertiary)"}})),V={border:"1px solid var(--dsh-alias-border-l2)",borderRadius:"10px",padding:"11px 13px",marginBottom:"8px",background:"var(--dsh-svc-card-bg)"},F=(t,a,s)=>0===a.length?null:r.createElement("div",{"data-testid":t,style:{marginTop:"9px",padding:"7px 10px",borderRadius:"7px",background:"var(--dsw-alias-bg-layer-3)",border:"1px solid var(--dsw-alias-border-l2)",maxHeight:"130px",overflowY:"auto"}},s?r.createElement("div",{style:{fontSize:"11px",fontWeight:700,color:"var(--dsw-alias-label-secondary)",marginBottom:"3px"}},e("skills.log.title")):null,...a.map((e,t)=>r.createElement("div",{key:t,style:{fontSize:"11px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",overflowWrap:"anywhere"}},e))),U=t=>{if(null===b)return null;const a=t??b.entry,{models:s,modelItem:n,draft:o,busy:l,error:i,applied:d}=b,c=null===o?null:[["description",void 0!==a.note?a.note.description:"",o.description],["usage",void 0!==a.note?a.note.usage:"",""===o.usage?null:o.usage]].map(([t,a,s])=>r.createElement("div",{key:t,"data-testid":"skill-diff-"+t,style:{marginBottom:"9px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"3px"}},e("skills.apply."+t)),r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)",textDecoration:"line-through",lineHeight:1.45}},e("skills.apply.old")+":"+(""===a?"—":a)),r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",lineHeight:1.45}},e("skills.apply.new")+":"+(null===s?e("skills.apply.keepusage"):s))));return r.createElement("div",{key:"skill-describe-"+a.id,"data-testid":"skill-describe-dialog",style:{border:"1px solid var(--dsw-alias-border-l1)",borderRadius:"12px",padding:"14px 16px",marginBottom:"14px",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px"}},r.createElement("div",{style:{fontSize:"14px",fontWeight:700}},e("skills.describe.title",{name:a.name})),r.createElement("button",{type:"button",onClick:()=>v(null),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"15px"}},"✕")),null===s&&""===i?r.createElement("p",{style:P},e("skills.describe.models.loading")):null,null!==s&&0===s.length?r.createElement("p",{style:P},e("skills.describe.models.empty")):null,null!==s&&s.length>0?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",flexWrap:"wrap"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.describe.model")),r.createElement("select",{"data-testid":"skill-describe-model",value:null===n?"":na(n),onChange:e=>v(t=>null===t?t:{...t,modelItem:s.find(t=>na(t)===e.target.value)??null}),style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"}},s.map(e=>r.createElement("option",{key:na(e),value:na(e)},e.providerName+" / "+e.name))),null===o?r.createElement("button",{type:"button","data-testid":"skill-describe-run",disabled:l||null===n,onClick:()=>{(async()=>{if(null===b||null===b.modelItem)return;const{entry:e,modelItem:t}=b;v(e=>({...e,busy:!0,error:""}));const a=await sa("skills-describe",{id:e.id,provider:t.provider,model:t.id,lang:p()});if(a.ok){try{localStorage.setItem(ra,JSON.stringify({provider:t.provider,model:t.id}))}catch(e){}v(e=>({...e,draft:a.value.draft,busy:!1}))}else v(e=>({...e,busy:!1,error:a.error+(a.detail?":"+a.detail:"")}))})()},style:Object.assign({},me("neutral"),{fontSize:"12px",minHeight:"28px",padding:"4px 12px",cursor:l?"default":"pointer",opacity:l||null===n?.55:1})},e(l?"skills.describe.running":"skills.describe.run")):null):null,""!==i?r.createElement("p",{"data-testid":"skill-describe-error",style:{...P,color:"var(--dsw-alias-state-error-primary)"}},va(e,i)):null,F("skill-describe-log",x.map(t=>ba(e,t))),c,d?r.createElement("p",{"data-testid":"skill-apply-done",style:{...P,color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("skills.apply.done")):null,null===o||d?null:r.createElement("p",{"data-testid":"skill-note-disclaimer",style:{...P,fontSize:"11px"}},e("skills.note.panelOnly")),null===o||d?null:r.createElement("button",{type:"button","data-testid":"skill-apply-confirm",disabled:l,onClick:()=>{(async()=>{if(null===b||null===b.draft||null===b.modelItem)return;const{entry:e,draft:t,modelItem:a}=b;v(e=>({...e,busy:!0}));const r=await sa("skills-note-save",{id:e.id,patch:{description:t.description,usage:t.usage},model:a.provider+"/"+a.id});r.ok?(W(r.value.entry),v(e=>({...e,busy:!1,applied:!0}))):v(e=>({...e,busy:!1,error:r.error||"unknown"}))})()},style:{fontSize:"12px",padding:"6px 16px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:l?"default":"pointer",opacity:l?.55:1}},e("skills.apply.confirm")))},K=c.trim().toLowerCase(),G=null===t?[]:""===K?t.entries:t.entries.filter(e=>e.name.toLowerCase().includes(K)),Y=G.length>0&&G.every(e=>m.includes(e.id)),[Q,Z]=a(!1);return o(()=>{null===I||"running"!==I.phase&&"planned"!==I.phase||Z(!0)},[null!==I&&I.phase]),r.createElement("div",{"data-testid":"skills-section",style:be()},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("input",{"data-testid":"skills-filter",value:c,placeholder:e("skills.filter"),onChange:e=>u(e.target.value),style:{fontSize:"12px",padding:"6px 10px",borderRadius:"7px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"200px"}}),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"}},r.createElement("button",{type:"button","data-testid":"skills-expand-all","data-variant":"neutral",disabled:0===G.length,style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px",cursor:0===G.length?"default":"pointer",opacity:0===G.length?.55:1}),onClick:()=>(()=>{const e=G.map(e=>e.id);g(Y?t=>t.filter(t=>!e.includes(t)):t=>e.reduce((e,t)=>e.includes(t)?e:e.concat([t]),t))})()},e(Y?"skills.collapseAll":"skills.expandAll")),r.createElement("button",{type:"button","data-testid":"skills-refresh","data-variant":"neutral",style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:()=>{N()}},"↻"))),i&&null===t?r.createElement("p",{style:P},"…"):null,""!==n||""!==D?r.createElement("p",{"data-testid":"skills-error",style:{...P,color:"var(--dsw-alias-state-error-primary)"}},va(e,""!==n?n:D)):null,null!==t&&t.llmAvailable?r.createElement("button",{type:"button","data-testid":"skills-batch-toggle","aria-expanded":String(Q),onClick:()=>Z(e=>!e),style:{margin:"0 0 12px",fontSize:"12px",padding:"6px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid "+(Q?"var(--dsw-alias-label-dimmed)":"var(--dsh-svc-border-strong)"),background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer"}},(Q?"▾ ":"▸ ")+e("skills.batch.toggle")):null,Q&&null!==t&&t.llmAvailable?(()=>{const t=null!==I&&"planned"===I.phase&&null===R?"idle":null!==I?I.phase:"idle",a=t,s=null!==I&&I.total>0?Math.round(I.done/I.total*100):0,n=Array.isArray(R?.annotated)?R.annotated.length:0;return r.createElement("div",{"data-testid":"skills-batch-card",style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"12px",padding:"13px 15px",margin:"14px 0"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px"}},r.createElement("div",{style:{fontSize:"13.5px",fontWeight:700}},e("skills.batch.title")),r.createElement("button",{type:"button","data-testid":"skills-batch-collapse",onClick:()=>Z(!1),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"12px"}},e("skills.batch.collapse")+" ▴")),r.createElement("p",{style:{...P,marginTop:"4px"}},e("skills.batch.hint")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"9px",flexWrap:"wrap"}},null!==O&&O.length>0?r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.batch.model"),r.createElement("select",{"data-testid":"skills-batch-model",value:null===H?"":na(H),disabled:y||null!==I&&"running"===I.phase,onChange:e=>ca(e.target.value),style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"}},O.map(e=>r.createElement("option",{key:na(e),value:na(e)},e.providerName+" / "+e.name)))):null,"idle"===t||"done"===t||"cancelled"===t?r.createElement("button",{type:"button","data-testid":"skills-batch-plan",disabled:y,onClick:()=>{(async()=>{w(!0);try{await pa()}finally{w(!1)}})()},style:Object.assign({},me("neutral"),{cursor:y?"default":"pointer",opacity:y?.55:1})},e("skills.batch.plan")):null,null!==R?r.createElement("span",{"data-testid":"skills-batch-candidates",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("skills.batch.candidates",{count:R.candidates.length})+(R.estBytes>0?" · "+e("skills.batch.estBytes",{size:(o=R.estBytes,o>=1048576?(o/1024/1024).toFixed(1)+" MB":o>=1024?(o/1024).toFixed(1)+" KB":String(o)+" B")}):"")+(n>0?" · "+e("skills.batch.annotated",{count:n}):"")+" · "+e("skills.batch.skipped",{count:R.skipped.length})):null,null!==R&&"planned"===t?r.createElement("button",{type:"button","data-testid":"skills-batch-start",disabled:y||0===R.candidates.length&&0===n,onClick:()=>{(async()=>{const e=Array.isArray(R?.annotated)?R.annotated.length:0;if(e>0&&!q)A(!0);else{A(!1),w(!0);try{await ha(e>0)}finally{w(!1)}}})()},title:q?e("skills.switch.confirm"):void 0,style:{fontSize:"12px",padding:"5px 14px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid transparent",background:q?"var(--dsh-svc-warning)":"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:y?"default":"pointer",opacity:y?.55:1}},q&&n>0?e("skills.batch.forceConfirm",{count:n}):e("skills.batch.start")):null,null!==I&&"running"===I.phase?r.createElement("button",{type:"button","data-testid":"skills-batch-cancel",onClick:()=>{(async()=>{await da()})()},style:{fontSize:"12px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:"pointer"}},e("skills.batch.cancel")):null,null!==I?r.createElement("span",{"data-testid":"skills-batch-phase",style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("skills.batch.phase."+a)):null),null!==R&&0===R.candidates.length&&0===n?r.createElement("p",{style:P},e("skills.batch.no-candidates")):null,null===R||0===R.skipped.length?null:r.createElement("div",{"data-testid":"skills-batch-skipped",style:{marginTop:"6px"}},r.createElement("button",{type:"button","data-testid":"skills-batch-skipped-toggle",onClick:()=>T(e=>!e),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(C?"▾ ":"▸ ")+e("skills.skippedList")+"("+R.skipped.length+")"),C?r.createElement("div",{style:{marginTop:"4px",fontSize:"11.5px",lineHeight:1.6,color:"var(--dsw-alias-label-tertiary)"}},R.skipped.map((t,a)=>r.createElement("div",{key:t.id??a,"data-testid":"skills-batch-skipped-item"},(""===t.name?t.id:t.name)+e("skills.colon")+(t=>{if("shadowed"===t)return e("skills.skip.shadowed");if("string"==typeof t&&t.startsWith("legacy-invocation-key"))return e("skills.skip.reason.legacy-invocation-key");const a=e("skills.skip.reason."+t);return a==="skills.skip.reason."+t?t:a})(t.reason)))):null),(()=>{const t=Array.isArray(R?.annotated)?R.annotated:[];return null===R||0===t.length?null:r.createElement("div",{"data-testid":"skills-batch-annotated",style:{marginTop:"6px"}},r.createElement("button",{type:"button","data-testid":"skills-batch-annotated-toggle",onClick:()=>M(e=>!e),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(z?"▾ ":"▸ ")+e("skills.batch.annotatedList")+"("+t.length+")"),z?r.createElement("div",{style:{marginTop:"4px",fontSize:"11.5px",lineHeight:1.6,color:"var(--dsh-svc-warning)"}},t.map((e,t)=>r.createElement("div",{key:e.id??t,"data-testid":"skills-batch-annotated-item"},""===e.name?e.id:e.name))):null)})(),null!==I&&I.total>0&&"idle"!==t?(()=>{const t=Array.isArray(I.failures)&&I.failures.length>0?r.createElement("div",{"data-testid":"skills-batch-failures",style:{marginTop:"7px",fontSize:"11.5px",color:"var(--dsw-alias-state-error-primary)",lineHeight:1.5}},e("skills.batch.failures",{count:I.failures.length})+":"+I.failures.map(e=>e.name+"("+e.reason+")").join("、")):null,a=Array.isArray(I.logs)?I.logs:[],n=0===a.length?null:r.createElement("div",null,r.createElement("button",{type:"button","data-testid":"skills-batch-log-toggle",onClick:()=>E(e=>!e),style:{marginTop:"7px",border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"11.5px",padding:0}},(S?"▾ ":"▸ ")+e("skills.log.title")+"("+a.length+")"),S?F("skills-batch-log",a.slice(-30).map(t=>ba(e,t)),!1):null);return r.createElement("div",{style:{marginTop:"10px"}},r.createElement("div",{"data-testid":"skills-batch-progress",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginBottom:"4px"}},e("skills.batch.progress",{done:I.done,total:I.total})+(null!==I.current?" · "+e("skills.batch.current",{name:I.current}):"")),r.createElement("div",{style:{height:"6px",borderRadius:"3px",background:"var(--dsw-alias-bg-layer-3)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:s+"%",background:"var(--dsw-alias-state-success-primary)",transition:"width .3s"}})),t,n)})():null);var o})():null,(()=>{if(null===t||0===t.entries.length)return r.createElement("p",{style:P},e("skills.empty"));const a=G.filter(e=>void 0!==e.invalid),s=G.filter(e=>void 0===e.invalid),n=[["skills.group.auto",s.filter(e=>e.invocation.model)],["skills.group.manual",s.filter(e=>!e.invocation.model&&e.invocation.user)],["skills.group.disabled",s.filter(e=>!e.invocation.model&&!e.invocation.user)]],o=a=>{const s=(a=>{const s=m.includes(a.id),n="string"==typeof a.invalid&&a.invalid.startsWith("legacy-invocation-key:"),o=r.createElement("div",{style:{fontSize:"14px",fontWeight:650,color:"var(--dsw-alias-label-primary)",overflowWrap:"anywhere"}},a.name,j(e("skills.source."+a.source)==="skills.source."+a.source?a.source:e("skills.source."+a.source)),a.shadowed?j(e("skills.badge.shadowed"),"warn"):null,a.writable?null:j(e("skills.badge.readonly"),"danger"),a.annotated?j(e("skills.badge.annotated")):null),i=r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginTop:"3px",lineHeight:1.45,overflowWrap:"anywhere"}},a.description),d=""===a.usage?null:r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)",marginTop:"2px",lineHeight:1.45,overflowWrap:"anywhere"}},e("skills.apply.usage")+":"+a.usage),c=void 0!==a.note?r.createElement("div",{"data-testid":"skill-note-"+a.name,style:{marginTop:"5px",padding:"6px 9px",borderRadius:"7px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l2)",fontSize:"11.5px",lineHeight:1.55,color:"var(--dsw-alias-label-secondary)",display:"flex",gap:"8px",alignItems:"flex-start"}},r.createElement("div",{style:{minWidth:0,flex:1}},!0===a.note.stale?r.createElement("div",{style:{marginBottom:"3px",color:"var(--dsw-alias-state-warn-primary)"}},"⚠ "+e("skills.note.stale")):null,r.createElement("div",{style:{overflowWrap:"anywhere"}},r.createElement("span",{style:{fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("skills.apply.description")+":"),r.createElement("span",null,a.note.description)),""===a.note.usage?null:r.createElement("div",{style:{overflowWrap:"anywhere",marginTop:"3px"}},r.createElement("span",{style:{fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("skills.apply.usage")+":"),r.createElement("span",null,a.note.usage))),r.createElement("button",{type:"button","data-testid":"skill-note-remove-"+a.name,onClick:()=>{(async e=>{const t=await sa("skills-note-clear",{id:e.id});t.ok?W(t.value.entry):l(t.error||"unknown")})(a)},title:e("skills.note.remove"),style:{border:0,background:"transparent",color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontSize:"13px",flexShrink:0,lineHeight:1}},"✕")):null,u=void 0!==a.invalid?r.createElement("div",{style:{fontSize:"12px",color:"var(--dsw-alias-state-warn-primary)",marginTop:"4px",display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},"⚠ ",n?e("skills.invalid.legacy"):e("skills.invalid.other",{reason:a.invalid}),n&&a.writable?r.createElement("button",{type:"button","data-testid":"skill-fix-"+a.name,onClick:()=>{(async e=>{const t=e.id+":fix";if(h===t){f(null);try{const t=await sa("skills-fix-keys",{id:e.id});t.ok?W(t.value.entry):l(t.error+(t.detail?":"+t.detail:"")||"unknown")}catch(e){l("network")}}else f(t)})(a)},title:h===a.id+":fix"?e("skills.switch.confirm"):void 0,style:{fontSize:"11px",padding:"2px 9px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-warn-primary)",background:h===a.id+":fix"?"rgba(198,128,0,0.14)":"transparent",color:"var(--dsw-alias-state-warn-primary)",cursor:"pointer"}},h===a.id+":fix"?e("skills.switch.confirm"):e("skills.fix.legacy")):null):null,p=void 0===a.invalid?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"7px",alignItems:"flex-end",flexShrink:0}},r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"7px",fontSize:"11.5px",color:"var(--dsw-alias-label-secondary)"}},e("skills.switch.model"),$(a.invocation.model,{testid:"skill-switch-model-"+a.name,disabled:!a.writable,armed:h===a.id+":model",title:h===a.id+":model"?e("skills.switch.confirm"):void 0,onClick:()=>{B(a,"model")}})),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"7px",fontSize:"11.5px",color:"var(--dsw-alias-label-secondary)"}},e("skills.switch.user"),$(a.invocation.user,{testid:"skill-switch-user-"+a.name,disabled:!a.writable,armed:h===a.id+":user",title:h===a.id+":user"?e("skills.switch.confirm"):void 0,onClick:()=>{B(a,"user")}})),null!==t&&t.llmAvailable?r.createElement("button",{type:"button","data-testid":"skill-describe-"+a.name,onClick:()=>{(async e=>{const t=oa();v({entry:e,models:null,modelItem:null,draft:null,busy:!1,error:"",applied:!1,preferred:t}),k([]);const a=await sa("skills-models",{});if(!a.ok)return void v(e=>({...e,error:a.error||"unknown"}));const r=a.value.models??[];v(e=>({...e,models:r,modelItem:la(r,a.value.current)}))})(a)},style:Object.assign({},ge(),{fontSize:"11px",padding:"3px 10px"})},"✨ "+e("skills.describe.button")):null):null,b=r.createElement("button",{type:"button","data-testid":"skill-header-"+a.name,"aria-expanded":String(s),onClick:()=>{return e=a.id,g(t=>t.includes(e)?t.filter(t=>t!==e):t.concat([e]));var e},style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%",padding:0,border:0,background:"transparent",color:"inherit",textAlign:"left",cursor:"pointer"}},r.createElement("span",{"aria-hidden":"true",style:{flexShrink:0,fontSize:"11px",lineHeight:"20px",color:"var(--dsw-alias-label-tertiary)"}},s?"▾":"▸"),r.createElement("div",{style:{minWidth:0,flex:1}},o)),y=s?r.createElement("div",{"data-testid":"skill-body-"+a.name,style:{marginTop:"2px"}},r.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start",justifyContent:"space-between"}},r.createElement("div",{style:{minWidth:0,flex:1}},i,d),p),c):null;return r.createElement("div",{key:a.id,"data-testid":"skill-entry-"+a.name,style:V},b,u,y)})(a);return null!==b&&b.entry.id===a.id?[s,U(a)]:[s]};return r.createElement("div",null,a.length>0?r.createElement("div",{"data-testid":"skills-invalid-group",style:{marginBottom:"12px"}},a.flatMap(o)):null,n.map(([t,a])=>0===a.length?null:r.createElement("div",{key:t,"data-testid":"skills-group-"+t.split(".").pop(),style:{marginBottom:"14px"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,margin:"0 0 7px",color:"var(--dsw-alias-label-secondary)"}},e(t)+" · "+a.length),a.flatMap(o))))})())}function wa(){return r.createElement(Ia,null)}function xa(e){if("number"!=typeof e||!Number.isFinite(e)||e<0)return"";if(0===e)return"0 B";const t=["B","KB","MB","GB"];let a=e,r=0;for(;a>=1024&&r<t.length-1;)a/=1024,r+=1;return(0===r?String(a):a.toFixed(1))+" "+t[r]}function ka(e,t){if("number"!=typeof e||e<=0)return t("sessions.status.unavailableTime");try{return new Date(e).toLocaleString()}catch(t){return String(e)}}function Sa(e,t){if("string"!=typeof t){const e=t&&"object"==typeof t?t:{};return"string"==typeof e.message&&""!==e.message?e.message:"string"==typeof e.code&&""!==e.code?e.code:"unknown"}return"feature-disabled"===t?e("sessions.error.feature-disabled"):"session-not-found"===t?e("sessions.error.session-not-found"):"live-session-rejected"===t?e("sessions.error.live-session-rejected"):"session-not-archived"===t?e("sessions.error.session-not-archived"):"unknown-delete-plan"===t?e("sessions.error.unknown-delete-plan"):"invalid-session-ids"===t?e("sessions.error.invalid-session-ids"):"unarchive-unsupported"===t?e("sessions.error.unarchive-unsupported"):"network"===t?e("sessions.error.network"):t}const Ea={all:void 0,archived:void 0,deleted:void 0},Ca=new Map,Ta=[Symbol.for("react.memo"),Symbol.for("react.forward_ref"),Symbol.for("react.lazy")],qa=e=>"function"==typeof e||null!==e&&"object"==typeof e&&"symbol"==typeof e.$$typeof&&Ta.includes(e.$$typeof);let Aa=null;const za=e=>{const t=e("sessions.md.copy"),a=e("sessions.md.copied"),r=e("sessions.md.footnotes");return{code:{copyLabel:"string"==typeof t&&""!==t?t:"Copy",copiedLabel:"string"==typeof a&&""!==a?a:"Copied"},footnotes:"string"==typeof r&&""!==r?r:"Footnotes"}};try{const t=e("@deepseek-ai/dsh-client-ui-primitives");let a=null==t?null:t.MarkdownText;if(qa(a))Aa=a;else if(null!==a&&"object"==typeof a)if(a="function"==typeof a.default?a.default:"function"==typeof a.MarkdownText?a.MarkdownText:null,qa(a))Aa=a;else{let e=String(typeof a);try{e+=" keys=["+Object.keys(a).join(",")+"]"}catch(e){}console.warn("[dsh-service-md] MarkdownText is an unexpected value ("+e+") — falling back to plain text")}else console.warn("[dsh-service-md] ui-primitives seed present, but MarkdownText unavailable ("+typeof a+") — falling back to plain text")}catch(e){console.warn("[dsh-service-md] ui-primitives require failed: "+(e&&e.message?e.message:String(e)))}function Ma(){const e=J(),{useState:a,useEffect:s,useRef:n}=r,[o,l]=je.useEnabled(),i=Ea.archived,[c,u]=a(void 0!==i?i:null),[p,m]=a(void 0===i),[g,h]=a(""),[f,b]=a(Object.fromEntries(Ca)),v=n(new Set),[y,w]=a("archived"),[x,k]=a(!1),[S,E]=a("createdDesc"),[C,T]=a([]),[q,A]=a(!1),[z,M]=a([]),[I,R]=a(""),[O,H]=a(!1),[D,L]=a(!1),[N,W]=a(null),[B,P]=a(null),[j,$]=a(!1),[V,F]=a(""),[U,K]=a({}),G=n(null),Y=()=>y+"\0"+S+"\0"+I+"\0"+(O?1:0),[Q,Z]=a(""),[X,ee]=a(""),[te,ae]=a(""),[re,se]=a(""),[ne,oe]=a(""),[le,ie]=a(null),[de,ce]=a(!1),[ue,pe]=a(""),[fe,ve]=a(0),[ye,we]=a(null),[xe,ke]=a(!1),[Se,Ee]=a(""),[Ce,Te]=a(""),[qe,Ae]=a(""),[ze,Me]=a(""),Ie={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},Re=ge(),Oe=Object.assign({},Re,{background:"transparent",borderColor:"var(--dsw-alias-state-error-primary)",color:"var(--dsw-alias-state-error-primary)"}),He=Object.assign({},Re,{background:"var(--dsw-alias-state-error-primary)",borderColor:"transparent",color:"var(--dsh-svc-brand-text)"}),De=e=>"archived"===e?"archived":"deleted"===e?"deleted":"all",Le=n(y);Le.current=y;const Ne=async(t,a={})=>{const r=void 0!==t?t:De(y),s=Ea[r],n=!a.force&&void 0!==s;if(n){if(u(s),h(""),m(!1),!0!==a.silent)return}else m(!0);try{const t=await d("sessions-list",{scope:r});t.ok?(Ea[r]=t.value,De(Le.current)===r&&(u(t.value),h(""))):n&&a.silent||h(Sa(e,t.error||"unknown"))}catch(t){n&&a.silent||h(e("sessions.error.network"))}finally{n&&a.silent||m(!1)}};s(()=>{Ne("archived",{silent:!0})},[]),s(()=>{if(null===c)return;const e=Array.isArray(c.items)?c.items:[],t=[];for(const a of e){const e=a.id;void 0!==f[e]||v.current.has(e)||(v.current.add(e),t.push(e))}if(0===t.length)return;let a=!1;const r=async e=>{try{const t=await d("sessions-bytes",{ids:e});if(a)return;const r=t&&t.ok&&t.value&&"object"==typeof t.value.bytes?t.value.bytes:{};if(Object.keys(r).length>0){for(const t of e)void 0!==r[t]&&Ca.set(t,r[t]);b(t=>{const a={...t};for(const t of e)void 0!==r[t]&&(a[t]=r[t]);return a})}}catch(e){}finally{if(!a)for(const t of e)v.current.delete(t)}};for(let e=0;e<t.length;e+=100)r(t.slice(e,e+100));return()=>{a=!0;for(const e of t)v.current.delete(e)}},[c]),s(()=>{if("deleted"!==y){if(""!==I.trim())return t.timer.timeout(()=>{(async e=>{if(""!==e.trim()){L(!0);try{const t=await d("sessions-search",{query:e.trim(),scope:O?"archived":"all"});t.ok?W(t.value):W({available:!0,query:e,scope:"all",hits:[],error:t.error})}catch(t){W({available:!0,query:e,scope:O?"archived":"all",hits:[],error:"network"})}finally{L(!1)}}else W(null)})(I)},300);W(null)}},[I,O,y]);const We=(e,t,a,r,s)=>{A(!1),M([]),se(""),oe(""),we(null),Ee("");const n=function(e){let t=null!=e&&e.currentTarget?e.currentTarget:null;const a="undefined"!=typeof document?document:null;for(;null!=t&&1===t.nodeType;){let e="";if(null!==a&&a.defaultView&&"function"==typeof a.defaultView.getComputedStyle)try{const r=a.defaultView.getComputedStyle(t);e=r?String(r.overflowY||""):""}catch(e){}else t.style&&(e=String(t.style.overflowY||t.style.overflow||""));if(("auto"===e||"scroll"===e||"overlay"===e)&&"number"==typeof t.scrollHeight&&"number"==typeof t.clientHeight&&t.scrollHeight>t.clientHeight+1)return t;t=t.parentNode}return null}(r);if(null!==n&&(G.current={key:Y(),container:n,scrollTop:n.scrollTop}),K({}),P({sessionId:e,view:t||"events",cursor:void 0,items:[],total:0,hitItems:a||null,loadedTitle:"",centerSeq:void 0}),F(""),$(!1),"search"===(t||"events")&&Array.isArray(a)&&a.length>0){const t=Number.isSafeInteger(s)?Number(s):Number(a[0].seq);Pe(e,Number.isSafeInteger(t)?t:0)}else Be(e,void 0,t||"events")},Be=async(t,a,r)=>{$(!0);try{const s=await d("sessions-view",{id:t,cursor:a});s.ok?(P(e=>{const n=null===e?{}:e,o=void 0===a?s.value.items||[]:[...n.items||[],...s.value.items||[]];return{...n,sessionId:t,view:r||n.view||"events",cursor:s.value.nextCursor,items:o,total:s.value.total,loadedTitle:n.loadedTitle||(s.value.session&&s.value.session.id,"")}}),F("")):F(Sa(e,s.error||"unknown"))}catch(t){F(e("sessions.error.network"))}finally{$(!1)}},Pe=async(t,a)=>{$(!0),F("");try{const r=await d("sessions-view",{id:t,center:a});r.ok?(P(e=>{const s=null===e?{}:e;return{...s,sessionId:t,view:"search",cursor:r.value.nextCursor,items:r.value.items||[],total:r.value.total,centerSeq:Number.isSafeInteger(r.value.centerSeq)?r.value.centerSeq:a,loadedTitle:s.loadedTitle||""}}),F("")):F(Sa(e,r.error||"unknown"))}catch(t){F(e("sessions.error.network"))}finally{$(!1)}},$e=async t=>{try{const a=await d("sessions-export",{id:t});if(!a.ok)return{ok:!1,error:Sa(e,a.error||"unknown")};const r=a.value.url,s=await fetch(r,{method:"HEAD"});if(!s.ok)return{ok:!1,error:e("sessions.error.export-failed",{error:"HTTP "+s.status})};const n=document.createElement("a");return n.href=r,n.download="dsh-session-"+t.replace(/[^A-Za-z0-9_-]/g,"_")+".zip",n.click(),{ok:!0}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},_e=async e=>{Z(e),ee("");const t=await $e(e);return t.ok||ee(t.error),Z(""),t},Ve=async t=>{try{const a=await d("sessions-archive",{id:t});return a.ok?((e=>{const t=Ea.all;void 0!==t&&Array.isArray(t.items)&&(Ea.all={...t,items:t.items.map(t=>t.id===e?{...t,archived:!0}:t)});const a=Ea.archived;if(void 0!==a&&Array.isArray(a.items)){const r=a.items.some(t=>t.id===e),s=t?.items?.find(t=>t.id===e);Ea.archived=r?{...a,items:a.items.map(t=>t.id===e?{...t,archived:!0}:t)}:void 0!==s?{...a,items:[{...s,archived:!0},...a.items]}:a}u(t=>null!==t&&Array.isArray(t.items)?{...t,items:t.items.map(t=>t.id===e?{...t,archived:!0}:t)}:t)})(t),{ok:!0}):{ok:!1,error:Sa(e,a.error||"unknown")}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},Fe=async t=>{try{const a=await d("sessions-unarchive",{id:t});return a.ok?((e=>{const t=Ea.all;void 0!==t&&Array.isArray(t.items)&&(Ea.all={...t,items:t.items.map(t=>t.id===e?{...t,archived:!1}:t)});const a=Ea.archived;void 0!==a&&Array.isArray(a.items)&&(Ea.archived={...a,items:a.items.filter(t=>t.id!==e)}),u(t=>null!==t&&Array.isArray(t.items)?"archived"===Le.current?{...t,items:t.items.filter(t=>t.id!==e)}:{...t,items:t.items.map(t=>t.id===e?{...t,archived:!1}:t)}:t)})(t),{ok:!0}):{ok:!1,error:Sa(e,a.error||"unknown")}}catch(t){return{ok:!1,error:e("sessions.error.network")}}},Ue=e=>{const t=e?.id??"";if(""===t)return;const a=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===t):void 0,r={id:t,title:"string"==typeof e?.title?e.title:a?.title??"",cwd:e?.cwd??a?.cwd??null,deletedAt:Date.now()};for(const e of["all","archived"]){const a=Ea[e];void 0!==a&&Array.isArray(a.items)&&(Ea[e]={...a,items:a.items.filter(e=>e.id!==t)})}const s=Ea.deleted;void 0!==s&&(Ea.deleted={...s,deleted:[r,...(Array.isArray(s.deleted)?s.deleted:[]).filter(e=>e.id!==t)]}),Ca.delete(t),u(e=>{if(null===e)return e;const a=Array.isArray(e.items)?e.items:[];return{...e,items:a.filter(e=>e.id!==t),deleted:[r,...(Array.isArray(e.deleted)?e.deleted:[]).filter(e=>e.id!==t)]}}),b(e=>{const a={...e};return delete a[t],a}),v.current.delete(t)};s(()=>{fe>0&&P(null)},[fe]),s(()=>{if(null!==B)return;const e=G.current;if(G.current=null,null===e)return;if(e.key!==Y())return;if(null===e.container||void 0===e.container)return;const t="number"==typeof e.scrollTop?e.scrollTop:0;try{"number"==typeof e.container.scrollTop&&(e.container.scrollTop=t)}catch(e){}},[B]);const Ke=null!==B&&"search"===B.view?B.centerSeq:null,Ge=null!==B&&"search"===B.view&&Array.isArray(B.items)?B.items.length:0;s(()=>{if(null!==Ke&&"number"==typeof Ke)return function(e){if("undefined"==typeof document||null===document)return()=>{};try{const a=document.querySelector('[data-testid="sessions-jump-target-'+e+'"]');if(null==a)return()=>{};try{a.scrollIntoView({behavior:"smooth",block:"center"})}catch(e){try{a.scrollIntoView()}catch(e){}}if(a.classList&&"function"==typeof a.classList.add){a.classList.add("dshsv-locate-flash");const e=t.timer.timeout(()=>{try{a.classList&&"function"==typeof a.classList.remove&&a.classList.remove("dshsv-locate-flash")}catch(e){}},2e3);return()=>{e();try{a.classList&&"function"==typeof a.classList.remove&&a.classList.remove("dshsv-locate-flash")}catch(e){}}}}catch(e){}return()=>{}}(Ke)},[Ke,Ge]);const Ye=(()=>{if(null===c)return[];if("deleted"===y)return(Array.isArray(c.deleted)?c.deleted:[]).slice().sort((e,t)=>(t.deletedAt||0)-(e.deletedAt||0)).map(e=>({...e,_deleted:!0,archived:!0}));let e=(Array.isArray(c.items)?c.items:[]).slice();return x&&(e=e.filter(e=>!0===e.subagent)),"createdAsc"===S?e.sort((e,t)=>(e.createdAt||0)-(t.createdAt||0)):"title"===S?e.sort((e,t)=>String(e.title||"").localeCompare(String(t.title||""))):"project"===S?e.sort((e,t)=>String(e.cwd||"").localeCompare(String(t.cwd||""))||(t.createdAt||0)-(e.createdAt||0)):e.sort((e,t)=>(t.createdAt||0)-(e.createdAt||0)),e})(),Qe=""!==I.trim()?[]:"deleted"===y?Ye.map(e=>e.id):Ye.filter(e=>!0!==e._deleted).map(e=>e.id),Je=new Set(z),Ze=Ye.filter(e=>Je.has(e.id)),Xe=Ze.filter(e=>!0!==e._deleted),et=Ze.filter(e=>!0!==e._deleted&&!0!==e.live&&!0!==e.archived),tt=Ze.filter(e=>!0!==e._deleted&&!0===e.archived),at=Ze.filter(e=>!0!==e._deleted&&!0!==e.live&&!0===e.archived),rt=Ze.filter(e=>!0===e._deleted),st=Qe.length>0&&Qe.every(e=>Je.has(e));s(()=>{if(!q)return;const e=new Set(Qe);M(t=>{const a=t.filter(t=>e.has(t));return a.length===t.length?t:a})},[c,y,q,x]);const nt=()=>{A(!1),M([]),se(""),oe("")},ot=e=>{M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},lt="deleted"===y?[]:Ye.filter(e=>!0===e.subagent).map(e=>e.id),it=t=>{const a=!0===t._deleted,s=t.id,n=a?t.title||e("sessions.row.noTitle"):""!==t.title?t.title:e("sessions.row.noTitle"),o=!0===t.live,l=a||!0===t.archived,i=Je.has(s),u=(()=>{const e=f[s];return"number"==typeof e&&e>0?xa(e):null})(),p=[o?e("sessions.row.live"):l?e("sessions.row.archived"):null,a?e("sessions.row.deleted"):null,t.cwd?e("sessions.detail.cwd",{cwd:t.cwd}):null,a?t.deletedAt?ka(t.deletedAt,e):null:u].filter(Boolean),m=[];return a?m.push(r.createElement("button",{key:"clear",type:"button","data-testid":"sessions-row-clear-"+s,style:Oe,onClick:()=>{(e=>{null!==ye||xe||(Ee(""),we({batch:!1,items:[{id:e.id,title:e.title}]}))})(t)}},e("sessions.action.clear"))):(m.push(r.createElement("button",{key:"view",type:"button","data-testid":"sessions-row-view-"+s,style:Re,onClick:e=>We(s,"events",null,e)},e("sessions.action.view"))),m.push(r.createElement("button",{key:"export",type:"button","data-testid":"sessions-row-export-"+s,style:Re,disabled:Q===s,onClick:()=>{_e(s)}},e(Q===s?"sessions.detail.exporting":"sessions.action.export"))),o||l||m.push(r.createElement("button",{key:"archive",type:"button","data-testid":"sessions-row-archive-"+s,style:Re,disabled:Ce===s,onClick:()=>{(async e=>{Te(e),Me("");const t=await Ve(e);t.ok||Me(t.error),Te("")})(s)}},e(Ce===s?"sessions.status.working":"sessions.action.archive"))),l&&!1!==c?.canUnarchive&&m.push(r.createElement("button",{key:"unarchive",type:"button","data-testid":"sessions-row-unarchive-"+s,style:Re,disabled:qe===s,onClick:()=>{(async e=>{Ae(e),Me("");const t=await Fe(e);t.ok||Me(t.error),Ae("")})(s)}},e(qe===s?"sessions.status.working":"sessions.action.unarchive"))),!o&&l&&m.push(r.createElement("button",{key:"delete",type:"button","data-testid":"sessions-row-delete-"+s,style:Oe,onClick:()=>{(async t=>{if(null===le&&!de){pe("");try{const a=await d("sessions-delete-plan",{id:t});a.ok?ie(a.value):pe(Sa(e,a.error||"unknown"))}catch(t){pe(e("sessions.error.network"))}}})(s)}},e("sessions.action.delete")))),r.createElement("div",{key:s,"data-testid":"sessions-row-"+s,"data-selected":q&&i?"true":void 0,onClick:q?()=>ot(s):void 0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",padding:q?"9px 2px 9px 8px":"9px 2px",borderBottom:"1px solid var(--dsh-svc-border)",background:"transparent",borderRadius:"4px",boxShadow:q&&i?"inset 3px 0 0 var(--dsw-alias-brand-primary)":"none",cursor:q?"pointer":"default"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"9px",minWidth:0,flex:"1 1 auto"}},q?r.createElement("input",{type:"checkbox","data-testid":"sessions-select-"+s,"aria-label":e("sessions.batch.selectRow",{title:n}),checked:i,onClick:e=>e.stopPropagation(),onChange:()=>ot(s),style:{width:"16px",height:"16px",flexShrink:0,accentColor:"var(--dsw-alias-brand-primary)",cursor:"pointer"}}):null,r.createElement("div",{style:{minWidth:0}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},r.createElement("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n),o?r.createElement("span",{"data-testid":"sessions-tag-live-"+s,style:he("success")},e("sessions.row.live")):null,l?r.createElement("span",{"data-testid":"sessions-tag-archived-"+s,style:he("warning")},e("sessions.row.archived")):null,a?r.createElement("span",{style:he("danger")},e("sessions.row.deleted")):null,a||!0!==t.subagent?null:r.createElement("span",{"data-testid":"sessions-tag-subagent-"+s,style:he("info")},e("sessions.row.subagent"))),r.createElement("div",{"data-testid":"sessions-meta-"+s,style:{fontSize:"11.5px",color:"var(--dsw-alias-label-tertiary)",marginTop:"3px"}},p.join(" · ")))),q?null:r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,flexWrap:"wrap",justifyContent:"flex-end"}},...m))},dt=(t,a)=>{const s=!0===t.noise,n="string"==typeof t.text&&""!==t.text?r.createElement("div",{"data-testid":"sessions-event-text-"+t.seq,style:{marginTop:"4px"}},null!==Aa?r.createElement(Aa,{text:t.text,labels:za(e)}):r.createElement("div",{style:{fontSize:"12px",lineHeight:1.55,color:"var(--dsw-alias-label-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word"}},t.text)):null;return r.createElement("div",{key:String(t.seq),"data-testid":"sessions-event-"+t.seq,style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:s?"transparent":"var(--dsw-alias-bg-layer-3)",marginBottom:"5px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},r.createElement("span",{"data-testid":"sessions-event-type-"+t.seq,style:{fontWeight:600,color:s?"inherit":"var(--dsw-alias-label-secondary)"}},s?e("sessions.detail.noise"):t.type),t.time?r.createElement("span",null,ka(t.time,e)):null),n)};return r.createElement("div",{"data-testid":"sessions-section",style:be()},r.createElement("div",{style:{fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"}},e("sessions.title")),r.createElement("div",{"data-testid":"sessions-nav-toggle",style:{margin:"2px 0 8px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},e("sessions.navToggle"))),r.createElement("button",{type:"button",role:"switch","data-testid":"sessions-nav-switch","aria-checked":String(o),onClick:()=>l(!o),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(o?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:o?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:o?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:o?"#fff":"var(--dsw-alias-label-tertiary)"}})))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",margin:"0 0 10px"}},["all","archived","deleted"].map(t=>r.createElement("button",{key:t,type:"button","data-testid":"sessions-filter-"+t,style:{...Re,background:y===t?"var(--dsh-svc-tab-active-bg)":"transparent",color:y===t?"var(--dsh-svc-tab-active-text)":"var(--dsw-alias-label-primary)",fontWeight:y===t?650:400},onClick:()=>(e=>{e!==y&&(w(e),A(!1),M([]),se(""),oe(""),R(""),W(null),P(null),we(null),Ee(""),Ne(e))})(t)},e("sessions.filter."+t))),r.createElement("select",{"data-testid":"sessions-sort",style:{fontSize:"12px",padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",maxWidth:"100%"},value:S,onChange:e=>E(e.target.value)},r.createElement("option",{value:"createdDesc"},e("sessions.sort.createdDesc")),r.createElement("option",{value:"createdAsc"},e("sessions.sort.createdAsc")),r.createElement("option",{value:"title"},e("sessions.sort.title")),r.createElement("option",{value:"project"},e("sessions.sort.project"))),r.createElement("button",{type:"button","data-testid":"sessions-refresh","data-variant":"neutral",style:Object.assign({},me("neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:()=>{Ne(void 0,{force:!0})}},e("sessions.refresh")),null===B&&""===I.trim()?r.createElement("button",{type:"button","data-testid":"sessions-batch-toggle","data-variant":q?"primary":"neutral",style:Object.assign({},me(q?"primary":"neutral"),{minHeight:"28px",padding:"4px 10px",fontSize:"12px"}),onClick:q?nt:()=>{A(!0),M([]),se(""),oe("")}},e(q?"sessions.batch.exit":"sessions.batch.enter")):null),null===B&&q?r.createElement("div",{"data-testid":"sessions-batch-bar",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",margin:"0 0 10px",padding:"8px 10px",border:"1px solid var(--dsw-alias-border-l1)",borderRadius:"8px",background:"var(--dsw-alias-bg-layer-3)"}},r.createElement("button",{type:"button","data-testid":"sessions-select-all",style:Re,disabled:0===Qe.length||""!==te||de||xe,onClick:()=>{M(st?[]:Qe.slice())}},e(st?"sessions.batch.clearAll":"sessions.batch.selectAll")),"deleted"!==y&<.length>0?r.createElement("button",{type:"button","data-testid":"sessions-batch-select-subagents",style:Re,disabled:""!==te||de||xe,onClick:()=>{M(e=>{const t=lt.filter(t=>!e.includes(t));return 0===t.length?e:[...e,...t]})}},e("sessions.batch.selectSubagents")):null,r.createElement("span",{"data-testid":"sessions-selected-count",style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginRight:"auto"}},e("sessions.batch.selected",{count:z.length})),"deleted"===y?r.createElement("button",{type:"button","data-testid":"sessions-batch-clear",style:Oe,disabled:0===rt.length||""!==te||de||xe,onClick:()=>{null!==ye||xe||0===rt.length||(Ee(""),we({batch:!0,items:rt.map(e=>({id:e.id,title:e.title}))}))}},e("sessions.batch.clear",{count:rt.length})):[r.createElement("button",{key:"export",type:"button","data-testid":"sessions-batch-export",style:Re,disabled:0===Xe.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===Xe.length)return;ae("export"),se(""),oe("");let t=0,a="";for(const e of Xe){const r=await $e(e.id);r.ok?t+=1:""===a&&(a=r.error)}""===a?se(e("sessions.batch.completed",{action:e("sessions.action.export"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.export"),done:t,total:Xe.length,error:a})),ae("")})()}},"export"===te?e("sessions.status.working"):e("sessions.batch.export",{count:Xe.length})),r.createElement("button",{key:"archive",type:"button","data-testid":"sessions-batch-archive",style:Re,disabled:0===et.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===et.length)return;ae("archive"),se(""),oe("");let t=0,a="";const r=et.map(e=>e.id),s=[];for(const e of r){const r=await Ve(e);r.ok?(t+=1,s.push(e)):""===a&&(a=r.error)}s.length>0&&M(e=>e.filter(e=>!s.includes(e))),""===a?se(e("sessions.batch.completed",{action:e("sessions.action.archive"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.archive"),done:t,total:r.length,error:a})),ae("")})()}},"archive"===te?e("sessions.status.working"):e("sessions.batch.archive",{count:et.length})),!1!==c?.canUnarchive?r.createElement("button",{key:"unarchive",type:"button","data-testid":"sessions-batch-unarchive",style:Re,disabled:0===tt.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||0===tt.length)return;ae("unarchive"),se(""),oe("");let t=0,a="";const r=tt.map(e=>e.id),s=[];for(const e of r){const r=await Fe(e);r.ok?(t+=1,s.push(e)):""===a&&(a=r.error)}s.length>0&&M(e=>e.filter(e=>!s.includes(e))),""===a?se(e("sessions.batch.completed",{action:e("sessions.action.unarchive"),count:t})):oe(e("sessions.batch.failed",{action:e("sessions.action.unarchive"),done:t,total:r.length,error:a})),ae("")})()}},"unarchive"===te?e("sessions.status.working"):e("sessions.batch.unarchive",{count:tt.length})):null,r.createElement("button",{key:"delete",type:"button","data-testid":"sessions-batch-delete",style:Oe,disabled:0===at.length||""!==te||de||xe,onClick:()=>{(async()=>{if(""!==te||null!==le||0===at.length)return;ae("delete-plan"),se(""),oe("");const t=[];let a="";for(const r of at)try{const s=await d("sessions-delete-plan",{id:r.id});s.ok?t.push(s.value):""===a&&(a=Sa(e,s.error||"unknown"))}catch(t){""===a&&(a=e("sessions.error.network"))}ae(""),""===a&&t.length===at.length?ie({batch:!0,plans:t,sessions:t.map(e=>e.session),consequences:["deletes-session-log"]}):oe(e("sessions.batch.failed",{action:e("sessions.action.delete"),done:t.length,total:at.length,error:a||e("sessions.error.network")}))})()}},"delete-plan"===te?e("sessions.status.working"):e("sessions.batch.delete",{count:at.length}))]):null,null===B&&"deleted"!==y?r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"10px",flexWrap:"wrap"}},r.createElement("input",{"data-testid":"sessions-search-input",type:"text",placeholder:e("sessions.search.placeholder"),value:I,onChange:e=>{q&&nt(),R(e.target.value)},style:{fontSize:"12px",padding:"6px 10px",borderRadius:"7px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"100%",boxSizing:"border-box"}}),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},r.createElement("input",{type:"checkbox","data-testid":"sessions-search-archived",checked:O,onChange:e=>H(e.target.checked)}),e("sessions.search.archivedOnly")),r.createElement("label",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},r.createElement("input",{type:"checkbox","data-testid":"sessions-filter-subagent",checked:x,onChange:e=>k(e.target.checked)}),e("sessions.filter.subagent"))):null,""!==ze?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ze+(!1!==c?.canUnarchive?"":" · "+e("sessions.oneWayHint"))):null,""!==X?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},X):null,""!==re?r.createElement("p",{"data-testid":"sessions-batch-result",style:{...Ie,color:"var(--dsw-alias-state-success-primary)"}},re):null,""!==ne?r.createElement("p",{"data-testid":"sessions-batch-error",style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ne):null,(()=>{const t=null!==c&&Array.isArray(c.items)?c.items:[];return x&&"deleted"!==y&&t.length>0&&t.every(e=>void 0===e.subagent)?r.createElement("p",{"data-testid":"sessions-subagent-legacy-hint",style:{...Ie,color:"var(--dsh-svc-warning)"}},e("sessions.subagent.hostLegacy")):null})(),(()=>{if(null===B)return null;const a=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===B.sessionId):void 0,s=""!==I&&"search"===B.view&&null!==N?N.hits.find(e=>e.sessionId===B.sessionId)?.title||"":void 0!==a&&""!==a.title?a.title:"",n=null!==c&&Array.isArray(c.items)?c.items.find(e=>e.id===B.sessionId):void 0,o="search"===B.view&&Array.isArray(B.hitItems)?B.hitItems.map(e=>Number(e.seq)).filter(e=>Number.isSafeInteger(e)):[],l="search"===B.view&&"number"==typeof B.centerSeq?o.indexOf(B.centerSeq):-1,i=l>0?o[l-1]:void 0,d=l>=0&&l<o.length-1?o[l+1]:void 0,u=new Set(o),p={noise:{testId:"sessions-noisewall-",countKey:"sessions.detail.noiseBlock",collapseKey:"sessions.detail.noiseCollapse"},tool:{testId:"sessions-toolwall-",countKey:"sessions.detail.toolBlock",collapseKey:"sessions.detail.toolCollapse"}},m=(t,a)=>{const s=(t,s)=>null!==a&&a.has(Number(t.seq))?r.createElement("div",{key:"jump-"+t.seq,"data-testid":"sessions-jump-target-"+t.seq,style:{borderRadius:"8px",border:"1px solid rgba(198,128,0,0.55)",background:"rgba(198,128,0,0.10)",padding:"6px 8px",marginBottom:"6px"}},r.createElement("div",{"data-testid":"sessions-jump-badge-"+t.seq,style:{fontSize:"10.5px",fontWeight:700,color:"var(--dsw-alias-state-warn-primary)",marginBottom:"3px"}},e("sessions.hit.badge")),dt(t)):dt(t);return function(e){const t=[],a=Array.isArray(e)?e:[];for(let e=0;e<a.length;e+=1){const r=a[e],s=!0===r.noise?"noise":!0===r.tool?"tool":null;if(null===s){t.push(r);continue}const n=t[t.length-1];void 0!==n&&n._block===s?(n.count+=1,n.lastSeq=r.seq,n.lastIndex=e):t.push({_block:s,count:1,firstSeq:r.seq,lastSeq:r.seq,firstIndex:e,lastIndex:e})}return t}(t).map((n,o)=>{if(void 0!==n._block){const o=p[n._block],l=Array.isArray(t)?t.slice(n.firstIndex,n.lastIndex+1):[],i=U[n.firstSeq],d=null!==a&&l.some(e=>a.has(Number(e.seq))),c=void 0===i?d:!0===i;return r.createElement("div",{key:n._block+"-"+n.firstSeq,"data-testid":o.testId+n.firstSeq,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"transparent",marginBottom:"5px"}},r.createElement("button",{type:"button","data-testid":o.testId+"toggle-"+n.firstSeq,style:{...Re,border:0,padding:0,color:"var(--dsw-alias-label-tertiary)",fontSize:"11px"},onClick:()=>((e,t)=>K(a=>({...a,[e]:!t})))(n.firstSeq,c)},e(c?"sessions.glyph.collapse":"sessions.glyph.expand")+" "+e(c?o.collapseKey:o.countKey,{count:n.count})),c&&l.length>0?r.createElement("div",{style:{marginTop:"6px"}},l.map(e=>s(e))):null)}return s(n)})};return r.createElement("div",{"data-testid":"sessions-detail"},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginBottom:"10px"}},r.createElement("button",{type:"button","data-testid":"sessions-detail-back",style:Re,onClick:()=>P(null)},e("sessions.glyph.back")+" "+e("sessions.detail.back")),r.createElement("span",{style:{fontSize:"14px",fontWeight:700,color:"var(--dsw-alias-label-primary)",minWidth:0}},""!==s?s:e("sessions.row.noTitle")),n?.archived?r.createElement("span",{title:e("sessions.detail.archiveDisabled"),style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("sessions.detail.archiveDisabled")):r.createElement("button",{type:"button","data-testid":"sessions-detail-open",style:Re,onClick:()=>{try{(t.get?.("uiWorkspace")?.openSession??t.sessions?.open)?.(B.sessionId)}catch(e){}}},e("sessions.detail.open")),r.createElement("button",{type:"button","data-testid":"sessions-detail-export",style:Re,disabled:Q===B.sessionId,onClick:()=>{_e(B.sessionId)}},Q===B.sessionId?e("sessions.detail.exporting"):e("sessions.detail.exportAll"))),"search"===B.view&&null!==B.hitItems?r.createElement("div",{"data-testid":"sessions-jump-view",style:{marginBottom:"10px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",marginBottom:"6px"}},r.createElement("button",{type:"button","data-testid":"sessions-detail-return-search",style:Re,onClick:()=>P(null)},e("sessions.glyph.back")+" "+e("sessions.hit.return")),r.createElement("span",{style:{fontSize:"11.5px",color:"var(--dsw-alias-label-tertiary)"}},e("sessions.hit.inSession",{count:Array.isArray(B.hitItems)?B.hitItems.length:0})),r.createElement("button",{type:"button","data-testid":"sessions-jump-prev",style:Re,disabled:void 0===i||j,onClick:()=>{void 0!==i&&Pe(B.sessionId,i)}},e("sessions.hit.prev")),r.createElement("button",{type:"button","data-testid":"sessions-jump-next",style:Re,disabled:void 0===d||j,onClick:()=>{void 0!==d&&Pe(B.sessionId,d)}},e("sessions.hit.next"))),r.createElement("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginBottom:"8px"}},o.map(e=>r.createElement("button",{key:e,type:"button","data-testid":"sessions-jump-chip-"+e,style:{...Re,padding:"1px 8px",fontSize:"11px",..._("999px"),background:e===B.centerSeq?"var(--dsh-svc-tab-active-bg)":"transparent",color:e===B.centerSeq?"var(--dsh-svc-tab-active-text)":"var(--dsw-alias-label-secondary)"},onClick:()=>{Pe(B.sessionId,e)}},"#"+e))),j&&0===B.items.length?r.createElement("p",{style:Ie},e("sessions.status.loading")):null,m(B.items,u),void 0!==B.cursor&&B.items.length>0?r.createElement("button",{type:"button","data-testid":"sessions-detail-more",style:Re,disabled:j,onClick:()=>{Be(B.sessionId,B.cursor,B.view)}},e("sessions.detail.loadMore",{remaining:Math.max(0,B.total-B.items.length)})):null,void 0===B.cursor&&B.items.length>0?r.createElement("p",{style:Ie},e("sessions.detail.noMore",{total:B.total})):null):null,""!==V?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},V):null,"search"!==B.view?m(B.items,null):null,"search"!==B.view&&void 0!==B.cursor?r.createElement("button",{type:"button","data-testid":"sessions-detail-more",style:Re,disabled:j,onClick:()=>{Be(B.sessionId,B.cursor,B.view)}},e("sessions.detail.loadMore",{remaining:Math.max(0,B.total-B.items.length)})):null,"search"!==B.view&&void 0===B.cursor&&B.items.length>0?r.createElement("p",{style:Ie},e("sessions.detail.noMore",{total:B.total})):null)})()??(()=>{if(p)return r.createElement("p",{style:Ie},e("sessions.status.loading"));if(""!==g)return r.createElement("p",{"data-testid":"sessions-error",style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},g);if(""!==I.trim()&&"deleted"!==y)return null===N?r.createElement("p",{style:Ie},e(D?"sessions.status.loading":"sessions.search.placeholder")):N.error?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},Sa(e,N.error)):0===N.hits.length?r.createElement("p",{style:Ie},e("sessions.empty.search",{query:I})):N.hits.map(t=>r.createElement("div",{key:t.sessionId,"data-testid":"sessions-hit-"+t.sessionId,style:{padding:"9px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsw-alias-bg-layer-3)",marginBottom:"6px"}},r.createElement("button",{type:"button","data-testid":"sessions-hit-open-"+t.sessionId,style:{...Re,border:0,padding:0,textAlign:"left",display:"inline",maxWidth:"100%"},onClick:e=>We(t.sessionId,"search",t.items,e)},r.createElement("span",{style:{fontWeight:600,color:"var(--dsw-alias-label-primary)"}},""!==t.title?t.title:e("sessions.row.noTitle")),r.createElement("span",{style:{color:"var(--dsw-alias-label-secondary)",marginLeft:"6px",fontSize:"11.5px"}},e("sessions.hit.title",{count:t.items.length}))),t.items.length>1?r.createElement("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"5px"}},t.items.map(e=>r.createElement("button",{key:e.seq,type:"button","data-testid":"sessions-hit-seq-"+t.sessionId+"-"+e.seq,style:{...Re,padding:"1px 8px",fontSize:"11px",..._("999px"),color:"var(--dsw-alias-label-tertiary)"},onClick:a=>We(t.sessionId,"search",t.items,a,Number(e.seq))},"#"+e.seq))):null,t.items.slice(0,1).map((e,a)=>r.createElement("div",{key:a,"data-testid":"sessions-hit-snippet-"+t.sessionId,style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)",marginTop:"5px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},function(e,t,a){const s="string"==typeof e?e:"",n="string"==typeof t?t.trim().split(/\s+/).filter(Boolean):[];if(""===s||0===n.length)return s;let o;try{o=new RegExp(n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+"),"gi")}catch(e){return s}const l=[];let i,d=0,c=0;for(;null!==(i=o.exec(s));)i.index>d&&l.push(s.slice(d,i.index)),l.push(r.createElement("mark",{key:a+"-"+c,"data-testid":a+"-"+c,style:{background:"rgba(198,128,0,0.24)",color:"inherit",borderRadius:"3px",padding:"0 1px"}},i[0])),d=i.index+i[0].length,c+=1;return 0===l.length?s:(d<s.length&&l.push(s.slice(d)),l)}(e.snippet,N.query||I,"sessions-hit-highlight-"+t.sessionId)))));if(0===Ye.length){const t="archived"===y?"sessions.empty.archived":"deleted"===y?"sessions.empty.deleted":"sessions.empty.all";return r.createElement("p",{style:Ie},e(t))}if("project"!==S||"deleted"===y)return Ye.map(it);const t=[];for(const e of Ye){const a=String(e.cwd||""),r=t.length>0&&t[t.length-1].project===a?t[t.length-1]:null;null===r?t.push({project:a,items:[e]}):r.items.push(e)}return t.map((t,a)=>{const s=!C.includes(t.project);return r.createElement("div",{key:"project-group-"+(""===t.project?"__none__":t.project),"data-testid":"sessions-project-group-"+a,style:{marginBottom:"14px"}},r.createElement("div",{"data-testid":"sessions-project-header-"+a,"data-project":t.project,"data-collapsed":s?"true":"false",role:"button","aria-expanded":String(!s),onClick:()=>{return e=t.project,T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);var e},style:{display:"flex",alignItems:"baseline",gap:"8px",margin:"0 2px 4px",padding:"2px 5px",borderRadius:"6px",cursor:"pointer",userSelect:"none"}},r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",flex:"none"}},e(s?"sessions.glyph.expand":"sessions.glyph.collapse")),r.createElement("span",{style:{fontSize:"11.5px",fontWeight:650,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},""===t.project?e("sessions.projectGroup.noCwd"):t.project),r.createElement("span",{"data-testid":"sessions-project-count-"+a,style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",flexShrink:0}},1===t.items.length?e("sessions.projectGroup.countOne"):e("sessions.projectGroup.countMany",{count:t.items.length}))),s?null:t.items.map(it))})})(),(()=>{if(null===le)return null;const t=!0===le.batch&&Array.isArray(le.sessions)?le.sessions:null,a=null===t&&le.session||{};return r.createElement("div",{"data-testid":"sessions-delete-modal",style:{position:"fixed",inset:0,zIndex:1200,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.45)"}},r.createElement("div",{style:{width:"min(480px, calc(100vw - 32px))",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"14px",padding:"18px",boxShadow:"0 12px 40px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:"var(--dsw-alias-label-primary)",marginBottom:"8px"}},null===t?e("sessions.delete.title"):e("sessions.batch.deleteTitle",{count:t.length})),r.createElement("p",{style:{fontSize:"13px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.5,margin:"0 0 10px"}},e(null===t?"sessions.delete.body":"sessions.batch.deleteBody")),null===t?r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"6px"}},a.title||e("sessions.row.noTitle")):r.createElement("ul",{"data-testid":"sessions-batch-delete-list",style:{margin:"0 0 12px",paddingLeft:"18px",maxHeight:"220px",overflowY:"auto",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},t.map(t=>r.createElement("li",{key:t.id},e("sessions.batch.deleteItem",{title:t.title||e("sessions.row.noTitle"),bytes:xa(t.bytes)})))),null===t?r.createElement("ul",{style:{margin:"0 0 12px",paddingLeft:"18px",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},r.createElement("li",null,e("sessions.delete.consequence.log",{bytes:xa(a.bytes)})),le.consequences&&le.consequences.includes("hides-from-official-sidebar")?r.createElement("li",null,e("sessions.delete.consequence.sidebar")):null):null,""!==ue?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},ue):null,r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},r.createElement("button",{type:"button","data-testid":"sessions-delete-cancel",style:Re,disabled:de,onClick:()=>{ie(null),pe("")}},e("sessions.delete.cancel")),r.createElement("button",{type:"button","data-testid":"sessions-delete-confirm",style:He,disabled:de,onClick:()=>{(async()=>{if(null===le||de)return;ce(!0),pe("");const t=!0===le.batch&&Array.isArray(le.plans)?le.plans:[le];let a=0,r="";for(const s of t)try{const t=await d("sessions-delete",{planId:s.planId});t.ok?(a+=1,Ue(s.session)):""===r&&(r=Sa(e,t.error||"unknown"))}catch(t){""===r&&(r=e("sessions.error.network"))}!0===le.batch?(ie(null),ve(e=>e+1),""===r?(se(e("sessions.batch.completed",{action:e("sessions.action.delete"),count:a})),oe("")):(se(""),oe(e("sessions.batch.failed",{action:e("sessions.action.delete"),done:a,total:t.length,error:r})))):""===r?(ie(null),ve(e=>e+1)):pe(r),ce(!1)})()}},e(de?"sessions.status.working":"sessions.delete.confirm")))))})(),(()=>{if(null===ye)return null;const t=!0===ye.batch,a=Array.isArray(ye.items)?ye.items:[],s=a.length;return r.createElement("div",{"data-testid":"sessions-clear-modal",style:{position:"fixed",inset:0,zIndex:1200,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.45)"}},r.createElement("div",{style:{width:"min(480px, calc(100vw - 32px))",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"14px",padding:"18px",boxShadow:"0 12px 40px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:"var(--dsw-alias-label-primary)",marginBottom:"8px"}},t?e("sessions.batch.clearTitle",{count:s}):e("sessions.clear.title")),r.createElement("p",{style:{fontSize:"13px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.5,margin:"0 0 10px"}},t?e("sessions.batch.clearBody",{count:s}):e("sessions.clear.body")),t?r.createElement("ul",{"data-testid":"sessions-clear-list",style:{margin:"0 0 12px",paddingLeft:"18px",maxHeight:"220px",overflowY:"auto",fontSize:"12px",color:"var(--dsw-alias-label-secondary)",lineHeight:1.7}},a.map(t=>r.createElement("li",{key:t.id},t.title||e("sessions.row.noTitle")))):r.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"12px"}},a[0]?.title||e("sessions.row.noTitle")),""!==Se?r.createElement("p",{style:{...Ie,color:"var(--dsw-alias-state-error-primary)"}},Se):null,r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},r.createElement("button",{type:"button","data-testid":"sessions-clear-cancel",style:Re,disabled:xe,onClick:()=>{we(null),Ee("")}},e("sessions.clear.cancel")),r.createElement("button",{type:"button","data-testid":"sessions-clear-confirm",style:He,disabled:xe,onClick:()=>{(async()=>{if(null===ye||xe)return;ke(!0),Ee("");const t=(Array.isArray(ye.items)?ye.items:[]).map(e=>e.id),a=!0===ye.batch;try{const r=await d("sessions-clear-deleted",{ids:t});if(r.ok)(e=>{const t=new Set(e),a=Ea.deleted;void 0!==a&&Array.isArray(a.deleted)&&(Ea.deleted={...a,deleted:a.deleted.filter(e=>!t.has(e.id))}),u(e=>{if(null===e)return e;const a=Array.isArray(e.deleted)?e.deleted:[];return{...e,deleted:a.filter(e=>!t.has(e.id))}}),M(e=>e.filter(e=>!t.has(e)))})(t),we(null),a&&(se(e("sessions.batch.completed",{action:e("sessions.action.clear"),count:t.length})),oe(""));else{const s=Sa(e,r.error||"unknown");a?oe(e("sessions.batch.failed",{action:e("sessions.action.clear"),done:0,total:t.length,error:s})):Ee(s)}}catch(r){const s=e("sessions.error.network");a?oe(e("sessions.batch.failed",{action:e("sessions.action.clear"),done:0,total:t.length,error:s})):Ee(s)}finally{ke(!1)}})()}},e(xe?"sessions.status.working":"sessions.clear.confirm")))))})())}function Ia(){const e=J(),{value:s}=v(),[n,i]=Be.useEnabled(),c={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},[u,p]=a(S.getSnapshot());o(()=>S.subscribe(()=>p(S.getSnapshot())),[]),o(()=>(rt({all:!0}),()=>bt({all:!0})),[]);const[m,g]=a(new Set),h=e=>g(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a});o(()=>(ut(),it(()=>{K(ft()),Y(ht())})),[]);const[f,b]=a(""),y=u.providers||[],[w,x]=a(null),[k,E]=a(null),[C,T]=a({expiresAt:"",label:""}),A=(e,t="")=>{x({provider:e.provider,account:t}),T({expiresAt:"",label:""})},[z,M]=a(null),[I,R]=a({name:"",value:""}),[O,H]=a(!1);o(()=>{if(!O)return;const e=setTimeout(()=>H(!1),3e3);return()=>clearTimeout(e)},[O]);const D=()=>{M(null),R({name:"",value:""}),H(!1)},L=t=>{const a=String(t?.error??""),r=["unknown-hint","invalid-value","credentials-unavailable"].includes(a)?e(`quota.credential.${a}`):`${a}${t?.detail?` (${t.detail})`:""}`;return e("quota.credential.saveFailed",{error:r})},N=async()=>{if(null!==w){b("");try{const t={provider:w.provider};"string"==typeof w.account&&""!==w.account&&(t.account=w.account),""!==C.expiresAt&&(t.expiresAt=C.expiresAt),""!==C.label&&(t.label=C.label);const a=await d("quota-reset-card",t);if(!0!==a?.ok)return void b(e("quota.saveFailed",{error:String(a?.error??"")}));T({expiresAt:"",label:""}),await kt({scope:"all"})}catch(t){const a=t instanceof Error&&"string"==typeof t.message&&""!==t.message.trim()?t.message.trim():"network";b(e("quota.saveFailed",{error:a}))}}},W=async t=>{b("");try{const a=await d("quota-refresh",{provider:t});if(!0!==a?.ok){const t=String(a?.error??"");return"refresh-cooldown"===t&&"number"==typeof a?.nextAllowedAt?void b(e("quota.refresh.cooldown",{time:nt(a.nextAllowedAt)})):void b("unknown-provider"===t?e("quota.unknownProvider"):"not-adapted"===t?e("quota.unadapted"):e("quota.saveFailed",{error:t}))}await kt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}},B=async t=>{b("");try{const a=await d("quota-config",t);if(!0!==a?.ok)return void b("unknown-provider"===a?.error?e("quota.unknownProvider"):e("quota.saveFailed",{error:String(a?.error??"")}));await kt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}},P=(e,t)=>B({provider:e,kind:t}),[j,$]=a(null),[V,F]=a(!1),[U,K]=a(ft()),[G,Y]=a(ht()),[Q,Z]=a(!1),[X,ee]=a(!1),[te,ae]=a(null),re=l(null);o(()=>()=>{null!==re.current&&re.current(),re.current=null},[]);const se=st(y.filter(e=>!0===e.adapted),U),ne=new Set(G),oe=se.filter(e=>!ne.has(e.provider)),le=y.filter(e=>!0!==e.adapted),ie={fontSize:"12px",padding:"3px 6px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},de=()=>{ee(!0),null!==re.current&&re.current(),re.current=t.timer.timeout(()=>{re.current=null,ee(!1)},2e3)},ce=(e,t)=>{K(e),Y(t),dt(e,t)},ue=st(se,U).map(e=>({id:e.provider,label:e.displayName||e.provider})),pe=(e,t)=>{const a=ue.map(e=>e.id),r=a.indexOf(e),s=r+t;r<0||s<0||s>=a.length||r===s||(a.splice(s,0,a.splice(r,1)[0]),ce(a,G))},[fe,ve]=a(""),[ye,we]=a("");return r.createElement("div",{"data-testid":"remote-quota-card",style:be()},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginBottom:"8px"}},r.createElement("div",{style:Object.assign({},{fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},{margin:0})},e("quota.cardTitle")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},r.createElement("span",{style:{fontSize:"12px",lineHeight:1.5,color:"var(--dsw-alias-label-secondary)",textAlign:"right"}},e("quota.navToggleHint")),r.createElement("button",{type:"button",role:"switch","data-testid":"quota-nav-switch","aria-checked":String(n),"aria-label":e("quota.navToggle"),title:e("quota.navToggle"),onClick:()=>i(!n),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:n?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:n?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:n?"#fff":"var(--dsw-alias-label-tertiary)"}})))),""!==f?r.createElement("p",{"data-testid":"quota-config-error",style:Object.assign({},c,{color:"var(--dsw-alias-state-error-primary)"})},f):null,...se.length>=2?[r.createElement("div",{key:"quota-reorder-row",style:{display:"flex",justifyContent:"flex-end",margin:"2px 0 8px"}},r.createElement("button",{type:"button","data-testid":"quota-reorder-toggle","aria-expanded":String(Q),title:e("quota.reorder"),onClick:()=>Z(!Q),style:{fontSize:"12px",lineHeight:"20px",padding:"2px 12px",..._(999),border:"1px solid "+(Q?"var(--dsw-alias-brand-primary)":"var(--dsh-svc-border-strong)"),background:"transparent",color:Q?"var(--dsw-alias-brand-primary)":"var(--dsw-alias-label-primary)",cursor:"pointer"}},e("quota.reorder")))]:[],Q&&se.length>=2?r.createElement("div",{"data-testid":"quota-card-order-panel",style:{display:"flex",flexDirection:"column",gap:"10px",margin:"0 0 12px",padding:"10px 12px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"}},r.createElement("div",{style:{minWidth:0,flex:"1 1 240px"}},r.createElement("div",{"data-testid":"quota-card-order-title",style:{fontSize:"13px",fontWeight:700,color:"var(--dsw-alias-label-primary)"}},e("quota.order.title")),r.createElement("div",{style:{marginTop:"3px",fontSize:"12px",lineHeight:1.6,color:"var(--dsw-alias-label-secondary)"}},e("quota.order.hint"))),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},X?r.createElement("span",{"data-testid":"quota-card-order-saved",style:{fontSize:"12px",color:"var(--dsw-alias-state-success-primary)"}},"✓ "+e("config.navOrder.saved")):null,r.createElement("button",{type:"button","data-testid":"quota-card-order-reset",onClick:()=>{K([]),Y([]),ct(),de()},style:me("ghost")},e("config.navOrder.reset")),r.createElement("button",{type:"button","data-testid":"quota-card-order-save",onClick:()=>{ce(ue.map(e=>e.id),G),de()},style:me("primary")},e("config.navOrder.save")))),r.createElement("div",{"data-testid":"quota-card-order-list",style:{display:"flex",flexDirection:"column",gap:"8px"}},ue.map((t,a)=>{const s=!ne.has(t.id),n=te===a;return r.createElement("div",{key:t.id,"data-testid":"quota-card-order-item-"+t.id,draggable:!0,onDragStart:e=>{try{e.dataTransfer.setData("text/plain",String(a)),e.dataTransfer.effectAllowed="move"}catch(e){}ae(a)},onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch(e){}},onDrop:e=>{e.preventDefault();let t=a;try{const a=e.dataTransfer.getData("text/plain");t=Number.parseInt(a,10)}catch(e){}if(!Number.isNaN(t)&&t!==a){const e=ue.map(e=>e.id),[r]=e.splice(t,1);e.splice(a,0,r),ce(e,G)}ae(null)},onDragEnd:()=>ae(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"7px 10px",borderRadius:"var(--dsh-svc-radius-control, 8px)",border:"1px solid "+(n?"var(--dsw-alias-brand-primary)":"var(--dsw-alias-border-l1)"),background:n?"var(--dsw-alias-interactive-bg-hover)":"var(--dsh-svc-card-bg)",opacity:s?1:.5,transition:"border-color 120ms, background 120ms, opacity 120ms",cursor:"grab",userSelect:"none"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0}},r.createElement("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:"13px",letterSpacing:"-1px"},"aria-hidden":"true"},"⋮⋮"),r.createElement("span",{style:{fontSize:"13px",fontWeight:550,color:"var(--dsw-alias-label-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},t.label)),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}},r.createElement("button",{type:"button","data-testid":"quota-card-order-up-"+t.id,"aria-label":e("config.navOrder.moveUp"),title:e("config.navOrder.moveUp"),disabled:0===a,onClick:e=>{e.stopPropagation(),pe(t.id,-1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:0===a?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:0===a?"default":"pointer",opacity:0===a?.35:1,fontSize:"12px",lineHeight:"24px"}},"↑"),r.createElement("button",{type:"button","data-testid":"quota-card-order-down-"+t.id,"aria-label":e("config.navOrder.moveDown"),title:e("config.navOrder.moveDown"),disabled:a===ue.length-1,onClick:e=>{e.stopPropagation(),pe(t.id,1)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",padding:0,borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:a===ue.length-1?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-primary)",cursor:a===ue.length-1?"default":"pointer",opacity:a===ue.length-1?.35:1,fontSize:"12px",lineHeight:"24px"}},"↓"),r.createElement("button",{type:"button",role:"switch","data-testid":"quota-card-order-toggle-"+t.id,"aria-checked":String(s),"aria-label":e(s?"config.navOrder.visible":"config.navOrder.hidden"),title:e(s?"config.navOrder.visible":"config.navOrder.hidden"),onClick:e=>{e.stopPropagation(),(e=>{const t=new Set(G);t.has(e)?t.delete(e):t.add(e),ce(ue.map(e=>e.id),Array.from(t))})(t.id)},style:{width:"34px",height:"20px",..._("10px"),padding:0,position:"relative",flexShrink:0,border:"1px solid "+(s?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:s?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:s?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:s?"#fff":"var(--dsw-alias-label-tertiary)",transition:"left 120ms ease"}}))))}))):null,0===se.length?r.createElement("p",{style:c},e("quota.noAdapted")):0===oe.length?r.createElement("p",{"data-testid":"quota-cards-all-hidden",style:c},e("quota.order.allHidden")):r.createElement("div",{"data-testid":"quota-card-list",style:{display:"flex",flexDirection:"column",gap:"10px"}},oe.map((t,a)=>{const n=r.createElement("span",{style:{fontWeight:600,fontSize:"12px",overflowWrap:"anywhere"}},!1===s.modelProviderIcons?null:q(t.provider,14,{verticalAlign:"-2px",marginRight:"5px"},`quota-provider-icon-${t.provider}`),"string"==typeof t.usageUrl&&""!==t.usageUrl?r.createElement("a",{"data-testid":`quota-usage-link-${t.provider}`,href:t.usageUrl,target:"_blank",rel:"noreferrer",title:e("quota.usageLink"),style:{color:"var(--dsw-alias-brand-primary)",textDecoration:"underline"}},t.displayName||t.provider):t.displayName||t.provider,"auto"===t.kindSource?r.createElement("span",{"data-testid":`quota-auto-tag-${t.provider}`,style:he("neutral",{marginLeft:"6px",verticalAlign:"middle"})},e("quota.kindAuto")):null),o=Array.isArray(t.windows)?t.windows:[],l=k===t.provider,i=(e,t)=>String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||`acct-${t}`,c=o.map(a=>Pt(a,e,t.provider)),u=Array.isArray(t.resetCards)?t.resetCards:[],p=u.filter(e=>"string"!=typeof e.account||""===e.account),g=(a,s)=>{const n=Nt(a,e),o="string"==typeof a.id&&""!==a.id?a.id:`idx-${s}`,i="string"==typeof a.account&&""!==a.account?` · ${a.account}`:"";return r.createElement("div",{key:o,"data-testid":`quota-reset-card-${t.provider}-${o}`,style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",lineHeight:"16px",color:n.textColor}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:n.iconColor,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0}},r.createElement("rect",{x:2,y:5,width:20,height:14,rx:2}),r.createElement("line",{x1:2,y1:10,x2:22,y2:10})),r.createElement("span",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",null,`${n.title}${i}`),""!==n.expiry?r.createElement("span",null,n.expiry):null),l?r.createElement("button",{type:"button","data-testid":`quota-remove-${t.provider}-${o}`,onClick:()=>(async(t,a)=>{b("");try{await d("quota-reset-card",{provider:t,remove:!0,id:a}),await kt({scope:"all"})}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider,o),style:{fontSize:"11px",padding:"2px 10px",..._(999),border:"1px solid var(--dsw-alias-state-error-primary)",background:"transparent",color:"var(--dsw-alias-state-error-primary)",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"}},e("quota.resetCard.remove")):null)},f=p.map(g),v=u.filter(e=>"string"==typeof e.account&&""!==e.account),y=[],S=new Map;for(const e of v)S.has(e.account)||(S.set(e.account,[]),y.push(e.account)),S.get(e.account).push(e);const j=(a,s,n)=>r.createElement("div",{key:`codex-account-${s}`,"data-testid":`quota-cpa-account-${t.provider}-${s}`,style:{display:"flex",flexDirection:"column",gap:"10px"}},n.length>0?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},n):null,...((a,s)=>{const n=Wt(S.get(a)??[]),o=`card:${t.provider}:${s}`,l=m.has(o),i=l?n:n.slice(0,1),d=n.length-i.length;return[...i.map(g),d>0?r.createElement("button",{key:"reset-more",type:"button","data-testid":`quota-reset-more-${t.provider}-${s}`,onClick:()=>h(o),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-brand-primary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},e("quota.resetCard.more",{count:d})):null,l&&n.length>1?r.createElement("button",{key:"reset-less",type:"button","data-testid":`quota-reset-less-${t.provider}-${s}`,onClick:()=>h(o),style:{alignSelf:"flex-start",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",background:"transparent",border:"none",cursor:"pointer",padding:"0 2px",textDecoration:"underline"}},e("quota.resetCard.less")):null]})(a,s),l?r.createElement("div",{key:"reset-add-row",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-card-edit-${t.provider}-${s}`,onClick:()=>A(t,a),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e("quota.resetCard.edit"))):null,F(a,s)),$={fontSize:"12px",padding:"3px 6px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",width:"130px"},V=(e,t,a,s)=>r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e,r.createElement("input",{type:a,"data-testid":t,value:C[s],onChange:e=>T({...C,[s]:e.target.value}),style:$})),F=(a,s)=>{const n="string"==typeof a?a:"";if(!l||null===w||w.provider!==t.provider)return null;if(("string"==typeof w.account?w.account:"")!==n)return null;const o=void 0===s?"":`-${s}`;return r.createElement("div",{key:`reset-editor${o}`,"data-testid":`quota-reset-editor-${t.provider}${o}`,style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"flex-end",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},V(e("quota.resetCard.dateLabel"),"quota-reset-input-date","datetime-local","expiresAt"),V(e("quota.resetCard.nameLabel"),"quota-reset-input-name","text","label"),r.createElement("button",{type:"button","data-testid":"quota-reset-card-save",onClick:N,style:{minHeight:"28px",padding:"4px 12px",borderRadius:"7px",border:"1px solid var(--dsw-alias-brand-primary)",background:"var(--dsw-alias-brand-primary)",color:"var(--dsh-svc-brand-text)",cursor:"pointer",fontSize:"12px"}},e("quota.resetCard.add")),r.createElement("button",{type:"button","data-testid":"quota-reset-cancel",onClick:()=>x(null),style:ge()},e("quota.resetCard.cancel")))};let U;const K=()=>0===y.length?null:r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},y.map((e,t)=>j(e,i(e,t),[])));if(!0===t.refreshing&&0===o.length)U=r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.refreshing")),K());else if(void 0!==t.errorCode&&0===o.length)U=r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},r.createElement("span",{"data-testid":`quota-error-${t.provider}`,style:{fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},Bt(t,e)),K());else if(o.length>0){const a=a=>{const r=[],s=new Map;for(const e of a.windows){const t="string"==typeof e.label?e.label.trim():"";let a=s.get(t);void 0===a&&(a=r.length,s.set(t,a),r.push({account:t,windows:[]})),r[a].windows.push(e)}for(const e of y)s.has(e)||(s.set(e,r.length),r.push({account:e,windows:[]}));return r.map((a,r)=>j(a.account,i(a.account,r),a.windows.map(a=>Pt(a,e,t.provider))))},s="cliproxy"===t.kind?Ft(o):null;U=s&&s.length>0?r.createElement("div",{"data-testid":`quota-card-families-${t.provider}`,style:{display:"flex",flexDirection:"column",gap:"10px"}},s.map((s,n)=>r.createElement("div",{key:`family-${s.family}`,"data-testid":`quota-card-family-${t.provider}-${s.family}`,style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:0===n?"0":"4px",paddingTop:0===n?"0":"10px",borderTop:0===n?"none":"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{"data-testid":`quota-card-family-title-${t.provider}-${s.family}`,style:{fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)"}},e("quota.family."+s.family)),"codex"===s.family?r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},a(s)):r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},s.windows.map(a=>Pt(a,e,t.provider)))))):r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"14px"}},c)}else U=r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.empty"));const G=Ht(t,o),Y=null!==G?r.createElement(Dt,{key:"peak-timeline",showCaption:!0,schedule:G}):null;return r.createElement("div",{key:t.provider,"data-testid":`quota-provider-card-${t.provider}`,style:{display:"flex",flexDirection:"column",gap:"8px",padding:"10px 12px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-card-bg)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"10px"}},n,r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px"}},r.createElement("button",{type:"button","data-testid":`quota-refresh-${t.provider}`,"aria-label":!0===t.manualOnly?e("quota.refresh.manual"):e("quota.refresh"),title:!0===t.manualOnly?e("quota.refresh.manual"):e("quota.refresh"),disabled:!0===t.refreshing,onClick:()=>W(t.provider),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"2px",border:"none",background:"transparent",color:!0===t.refreshing?"var(--dsw-alias-label-tertiary)":"var(--dsw-alias-label-secondary)",cursor:!0===t.refreshing?"default":"pointer",opacity:!0===t.refreshing?.45:1}},r.createElement("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},r.createElement("path",{d:"M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.73 10h-2.08A6 6 0 1 1 12 6c1.66 0 3.14.69 4.22 1.77L13 11h7V4l-2.35 2.35z"}))),"number"==typeof t.fetchedAt?r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.updated",{time:nt(t.fetchedAt)})):null)),U,...null!==Y?[Y]:[],r.createElement("div",{key:"advanced-toggle-row",style:{display:"flex",marginTop:"2px"}},r.createElement("button",{type:"button","data-testid":`quota-advanced-toggle-${t.provider}`,"aria-expanded":String(l),onClick:()=>E(l?null:t.provider),style:{fontSize:"11px",lineHeight:"20px",padding:"2px 10px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer"}},`${l?"▾":"▸"} ${e("quota.advanced")}`)),...l&&Array.isArray(t.credentialHints)&&t.credentialHints.length>0?(()=>{const a=null!==z&&z.provider===t.provider,s=t.credentialHints,n=s.some(e=>e.name===I.name)?I.name:s[0]?.name??"",o=s.find(e=>e.name===n),l=s.some(e=>!0===e.configured);return[a?r.createElement("div",{key:"cred-editor","data-testid":`quota-cred-editor-${t.provider}`,style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"flex-end",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)"}},s.length>1?r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e("quota.credential.nameLabel"),r.createElement("select",{"data-testid":"quota-cred-name-select",value:n,onChange:e=>{R({...I,name:e.target.value}),H(!1)},style:ie},s.map((t,a)=>r.createElement("option",{key:t.name,value:t.name},`${t.name}${0===a?` · ${e("quota.credential.primary")}`:""} · ${!0===t.configured?e("quota.credential.configured"):e("quota.credential.notConfigured")}`)))):r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)",alignSelf:"center"}},`${n}${!0===o?.configured?` · ${e("quota.credential.configured")}`:""}`),r.createElement("label",{style:{display:"flex",flexDirection:"column",gap:"2px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e("quota.credential.valueLabel"),r.createElement("input",{type:"password","data-testid":"quota-cred-input-value",value:I.value,onChange:e=>R({...I,value:e.target.value}),autoComplete:"off",style:$})),r.createElement("button",{type:"button","data-testid":"quota-cred-save",onClick:()=>(async t=>{b("");try{const e=await d("quota-credential-set",{provider:t,name:I.name,value:I.value});if(!0!==e?.ok)return void b(L(e));D(),await W(t)}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider),disabled:""===I.value.trim(),style:{minHeight:"28px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-brand-primary)",background:""===I.value.trim()?"transparent":"var(--dsw-alias-brand-primary)",color:""===I.value.trim()?"var(--dsw-alias-label-tertiary)":"var(--dsh-svc-brand-text)",cursor:""===I.value.trim()?"default":"pointer",fontSize:"12px"}},e("quota.credential.save")),...!0===o?.configured&&!1!==o?.writable?[r.createElement("button",{type:"button",key:"cred-clear","data-testid":"quota-cred-clear",title:O?e("quota.credential.clearConfirm"):void 0,onClick:()=>{O?(H(!1),(async(t,a)=>{b("");try{const e=await d("quota-credential-unset",{provider:t,name:a});if(!0!==e?.ok)return void b(L(e));await W(t)}catch(t){b(e("quota.saveFailed",{error:"network"}))}})(t.provider,n)):H(!0)},style:{minHeight:"28px",padding:"4px 12px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsw-alias-state-error-primary)",background:O?"var(--dsw-alias-state-error-primary)":"transparent",color:O?"var(--dsh-svc-brand-text)":"var(--dsw-alias-state-error-primary)",cursor:"pointer",fontSize:"12px",whiteSpace:"nowrap"}},e(O?"quota.credential.clearConfirm":"quota.credential.clear"))]:[],r.createElement("button",{type:"button","data-testid":"quota-cred-cancel",onClick:D,style:ge()},e("quota.resetCard.cancel"))):r.createElement("div",{key:"cred-entry",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-cred-edit-${t.provider}`,onClick:()=>(e=>{const t=Array.isArray(e.credentialHints)?e.credentialHints:[];x(null),M({provider:e.provider}),R({name:(t.find(e=>!0===e.configured)??t[0])?.name??"",value:""}),H(!1)})(t),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsw-alias-brand-primary)",background:"transparent",color:"var(--dsw-alias-brand-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e(l?"quota.credential.editExisting":`quota.credential.${"string"==typeof t.credentialEntryKey&&""!==t.credentialEntryKey?t.credentialEntryKey:"edit"}`)))]})():[],...f,F(""),...l?[r.createElement("div",{key:"advanced-footer",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},r.createElement("select",{"data-testid":`quota-kind-select-${t.provider}`,value:t.kind,"aria-label":`${e("quota.adapt")} · ${t.displayName||t.provider}`,onChange:e=>{var a;""===e.target.value?P(t.provider,null):"__auto__"===e.target.value?(a=t.provider,B({provider:a,clear:!0})):P(t.provider,e.target.value)},style:ie},at.map(t=>r.createElement("option",{key:t,value:t},e(`quota.kind.${t}`))),r.createElement("option",{value:"__auto__"},e("quota.followAuto")),r.createElement("option",{value:""},e("quota.disable")))),..."zai-coding-cn"===t.kind?[r.createElement("div",{key:"reset-add-row",style:{display:"flex"}},r.createElement("button",{type:"button","data-testid":`quota-card-edit-${t.provider}`,onClick:()=>A(t),style:{fontSize:"12px",lineHeight:"20px",padding:"4px 14px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:"var(--dsw-alias-label-primary)",cursor:"pointer",width:"auto",minWidth:0,overflow:"visible",flex:"0 0 auto",whiteSpace:"nowrap"}},e("quota.resetCard.edit")))]:[]]:[])})),...le.length>0?[r.createElement("div",{key:"quota-add-adapt","data-testid":"quota-add-adapt",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginTop:se.length>0?"2px":"4px",paddingTop:"10px",borderTop:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("span",{style:{fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},e("quota.addAdapt")),r.createElement("select",{"data-testid":"quota-add-provider",value:fe,onChange:e=>ve(e.target.value),style:ie},r.createElement("option",{value:""},e("quota.addPickProvider")),le.map(e=>r.createElement("option",{key:e.provider,value:e.provider},e.displayName||e.provider))),r.createElement("select",{"data-testid":"quota-add-kind",value:ye,onChange:e=>we(e.target.value),style:ie},r.createElement("option",{value:""},e("quota.addPickKind")),at.map(t=>r.createElement("option",{key:t,value:t},e(`quota.kind.${t}`)))),r.createElement("button",{type:"button","data-testid":"quota-add-submit",disabled:""===fe||""===ye,onClick:()=>{P(fe,ye),ve(""),we("")},style:{fontSize:"12px",padding:"3px 12px",borderRadius:"7px",border:"1px solid var(--dsw-alias-brand-primary)",background:""===fe||""===ye?"transparent":"var(--dsw-alias-brand-primary)",color:""===fe||""===ye?"var(--dsw-alias-label-tertiary)":"var(--dsh-svc-brand-text)",cursor:""===fe||""===ye?"default":"pointer"}},e("quota.adapt")))]:[])}null!==Aa&&console.info("[dsh-service-md] session detail markdown renderer ready");const Ra="dsh-service-usage-failures-dismissed",{ModelsSection:Oa,canLeave:Ha}=function({useTranslation:t,rpcCall:a,SvcTabs:s,useFeatures:n,modelsNavToggle:o}){const l=r.createElement,{useState:i,useEffect:d,useRef:c}=r;function u(t){const{Modal:a}=e("@deepseek-ai/dsh-client-ui-primitives");return l(a,t)}const p={padding:"16px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"12px",background:"var(--dsw-alias-bg-layer-3)",minWidth:0,overflowWrap:"anywhere",marginBottom:"12px"},m={padding:"12px 14px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"10px",background:"var(--dsw-alias-bg-layer-2)",minWidth:0,marginBottom:"8px"},g={width:"100%",minWidth:0,boxSizing:"border-box",minHeight:"var(--dsh-svc-control-h, 36px)",padding:"6px 10px",borderRadius:"var(--dsh-svc-radius-control)",border:"1px solid var(--dsh-svc-border-strong)",background:"var(--dsh-svc-content-bg)",color:"var(--dsh-svc-text)",font:"inherit",fontSize:"13px",lineHeight:"20px"},h={fontSize:"12px",color:"var(--dsh-svc-text-muted)"},f={display:"block",fontSize:"12px",fontWeight:600,color:"var(--dsw-alias-label-primary)",marginBottom:"4px"},b={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"12px",marginBottom:"12px"},v={display:"flex",gap:"8px",flexWrap:"wrap",alignItems:"center"},y=["name","contextWindow","maxTokens","input","reasoningEfforts","compat"],w=["displayName","api","baseURL"],x=["contextWindow","maxTokens","defaultContextWindow","defaultMaxTokens","timeoutMs","websocketConnectTimeoutMs","streamIdleTimeoutMs","maxRequestImageBytes","requestImagePixelBudget","requestImageMaxBytes"],k=["minimal","low","medium","high","xhigh","max"],S=e=>{if(!String(e).trim())return;const t=/^(\d+(?:\.\d+)?)([km])?$/i.exec(String(e).trim());if(!t)throw new Error("schema-invalid");const a=Number(t[1])*("m"===t[2]?.toLowerCase()?1e6:"k"===t[2]?.toLowerCase()?1e3:1);if(!Number.isSafeInteger(a)||a<=0)throw new Error("schema-invalid");return a},E=e=>!Number.isInteger(e)||e<=0?"":e>=1e6&&e%1e5==0?e/1e6+"M":e>=1e3&&e%100==0?e/1e3+"K":String(e),C=(e,t)=>JSON.stringify(e)===JSON.stringify(t),T=e=>void 0===e?"—":"object"==typeof e?JSON.stringify(e):String(e),A=(e,t)=>Object.fromEntries(t.map(t=>[t,x.includes(t)?void 0===e[t]?"":String(e[t]):void 0===e[t]?"":e[t]])),z=(e,t,a,r,s={})=>{const n=A(t,r),o=A(a,r);return Object.fromEntries(r.map(t=>[t,!s[t]&&C(e[t],n[t])?o[t]:e[t]]))},M=e=>{if("string"!=typeof e)return e;if(!e.trim()||!Number.isFinite(Number(e)))throw new Error("schema-invalid");return Number(e)},I=(e,t)=>"thinkingBudgets"===e&&t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([e,t])=>[e,M(t)])):"retryPolicy"===e&&t&&"object"==typeof t?{...t,...void 0===t.maxRetries?{}:{maxRetries:M(t.maxRetries)},...void 0===t.backoff?{}:{backoff:Object.fromEntries(Object.entries(t.backoff).map(([e,t])=>[e,M(t)]))}}:"compat"===e&&t&&"object"==typeof t&&void 0!==t.vllmPriority?{...t,vllmPriority:M(t.vllmPriority)}:t,R=(e,t,a)=>{const r={},s=[];for(const n of a){let a=e[n];if(x.includes(n))if(""===String(a??"").trim())a=void 0;else if("timeoutMs"===n||"websocketConnectTimeoutMs"===n||"streamIdleTimeoutMs"===n){if(a=Number(a),!Number.isFinite(a)||a<0)throw new Error("schema-invalid")}else a=S(a);else a=""===a?void 0:I(n,a);C(a,t[n])||(void 0===a?s.push(n):r[n]=a)}return{patch:r,unset:s}},O=new Set,H=()=>[...O].every(e=>e());function D(e,t){const a=c({dirty:e,tr:t});a.current={dirty:e,tr:t},d(()=>{const e=()=>!a.current.dirty||"undefined"!=typeof window&&"function"==typeof window.confirm&&window.confirm(a.current.tr("models.smart.leave"));O.add(e);const t=e=>{a.current.dirty&&(e.preventDefault(),e.returnValue="")},r=t=>{"Escape"===t.key&&a.current.dirty&&!e()&&(t.preventDefault(),t.stopImmediatePropagation?.())},s=t=>{if(!a.current.dirty||"undefined"==typeof document)return;const r=document.querySelector?.('[role="dialog"][data-shortcut-modal="settings"]'),s=t.target?.closest?t.target:t.target?.parentElement;if(!r||!s)return;const n=s.closest('[class*="_close"]'),o=s.closest("nav button"),l=s.closest('[class*="_mask"]');(n&&r.contains(n)||o&&r.contains(o)&&!o.closest('[data-testid="service-panel-root"]')||l&&l.parentElement===r.parentElement)&&!e()&&(t.preventDefault(),t.stopImmediatePropagation?.())};return"undefined"!=typeof window&&window.addEventListener?.("beforeunload",t),"undefined"!=typeof document&&(document.addEventListener?.("keydown",r,!0),document.addEventListener?.("click",s,!0)),()=>{O.delete(e),"undefined"!=typeof window&&window.removeEventListener?.("beforeunload",t),"undefined"!=typeof document&&(document.removeEventListener?.("keydown",r,!0),document.removeEventListener?.("click",s,!0))}},[])}function L({id:e,onClick:t,children:a,danger:r=!1,compact:s=!1,disabled:n=!1,style:o,...i}){const d=s?ge(r?{color:"var(--dsh-svc-danger)",borderColor:"var(--dsh-svc-danger)"}:{}):me(r?"dangerGhost":"neutral");return l("button",{...i,type:"button","data-testid":e,disabled:n,style:{...d,whiteSpace:"nowrap",flexShrink:0,...o},onClick:t},a)}function N({kind:e}){return l("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},"test"===e?l("g",{transform:"rotate(-45 12 12)",fill:"currentColor",stroke:"none"},l("path",{d:"M1 11h3V8h4v1h3v2H8v2h3v2H8v1H4v-3H1Z"}),l("path",{d:"M23 11h-3V8h-4v1h-3v2h3v2h-3v2h3v1h4v-3h3Z"})):l("path","edit"===e?{d:"m15 5 4 4M4 20l4-1L20 7a2.8 2.8 0 0 0-4-4L4 15l-1 6Z"}:{d:"M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6m4-6v6"}))}function W({error:e}){const a=t();if(!e)return null;const r="models.smart.error."+e;return l("p",{role:"alert","data-testid":"model-config-error",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",margin:"8px 0",overflowWrap:"anywhere"}},a(r)===r?a("models.smart.error.generic").replace("{code}",e):a(r))}function B(e,t){return[e("models.smart.testFailed"),t?.failure?.code,t?.failure?.status?"HTTP "+t.failure.status:"",t?.finishReason,t?.failure?.message].filter(Boolean).join(" · ")}function P({field:e,value:a,onChange:r,schema:s,testId:n}){const o=t(),i=o("models.smart.field."+e)==="models.smart.field."+e?e:o("models.smart.field."+e),d=s?.routeEnums?.[e],c=d?l("select",{style:g,"aria-label":i,"data-testid":"model-field-"+e,value:a??"",onChange:e=>r(e.target.value)},...d.map(e=>l("option",{key:e},e))):l("input",{style:g,"aria-label":i,"data-testid":n??"model-field-"+e,value:void 0===a?"":a,onChange:e=>r(e.target.value)});return l("div",{style:{minWidth:0}},l("label",{style:{display:"block"}},l("span",{style:f},i),c))}function j({groups:e,draft:a}){const r=t();return l("div",{"data-testid":"model-smart-groups",style:{marginTop:"8px"}},...e.map(e=>{const t=e.path?.length?e.path.reduce((e,t)=>e?.[t],a):a[e.field],s=r("models.smart.field."+e.field),n=t=>"input"===e.field&&Array.isArray(t)?[...new Set(t)].sort():t,o=n(t),i=n(e.candidate.value),d=C(o,i)||"object"!=typeof o&&"object"!=typeof i&&String(o)===String(i),c=e=>!1===e?l("span",{style:h},r("models.smart.reasoning.false")):e&&"object"==typeof e&&0!==Object.keys(e).length?l("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"4px"}},...k.filter(t=>Object.hasOwn(e,t)).map(e=>l("span",{key:e,style:he("neutral")},e))):l("span",{style:h},r("models.smart.reasoning.inherit"));return l("div",{key:e.key,style:{marginTop:"8px",fontSize:"12px",overflowWrap:"anywhere"},"data-testid":"model-suggestion-"+e.key},l("b",null,e.path?.length>1?e.key:s),"reasoningEfforts"===e.field?l("div",{"data-testid":"model-suggestion-diff-"+e.key,style:{marginTop:"6px"}},d?null:l("div",{style:{marginBottom:"8px"}},l("span",{style:h},r("models.smart.currentEfforts")),c(o)),l("span",{style:h},r("models.smart.suggestedEfforts")),c(i)):l("div",{"data-testid":"model-suggestion-diff-"+e.key},d?T(i):T(""===o?void 0:o)+" → "+T(i)))}))}const $=["name","contextWindow","maxTokens","input","reasoningEfforts"];function V({text:e,title:t,checked:a,disabled:r=!1,onClick:s}){return l("label",{title:t,style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"6px 8px",..._("8px"),border:"1px solid var(--dsw-alias-border-l2)",background:a?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)",cursor:r?"default":"pointer",fontSize:"13px"}},l("input",{type:"checkbox","aria-label":t,checked:a,disabled:r,onChange:s,style:{margin:0,width:"16px",height:"16px",accentColor:"var(--dsw-alias-button-primary-fill)"}}),e)}function F({opened:e,model:r,isNew:s=!1,onBack:n,onSaved:o}){const w=t(),q=r,M=c(null);d(()=>{M.current?.scrollIntoView?.({block:"start",behavior:"instant"})},[]);const[I,O]=i(A(r,y)),[N,P]=i(r.id??""),[F,U]=i(!1),[K,G]=i(null),[Y,Q]=i(null),[J,Z]=i(null),[X,ee]=i(!1),[te,ae]=i(""),[re,se]=i(!1),[ne,oe]=i(""),[le,ie]=i(0),[de,ce]=i(null),ue=function(e){return(e?.groups??[]).flatMap(e=>{const t=e.candidates?.find(e=>"exact-channel-protocol"===e.evidence)??e.candidates?.[0];return t&&$.includes(e.field)?[{...e,candidate:t}]:[]})}(J),[pe,ge]=i(null),[he,fe]=i(null),[be,ve]=i(null),[ye,we]=i(null),[xe,ke]=i({}),Se=be??e,Ee=ye??q,Ce={...Se.catalogModels?.find(e=>e.id===N&&(!r.api||e.api===r.api))??{},...Se.effective?.models?.find(e=>e.id===N)??{},...Se.resolved?.models?.find(e=>e.id===N)??{}};void 0===Ce.contextWindow&&(Ce.contextWindow=Se.profile.defaultContextWindow),void 0===Ce.maxTokens&&(Ce.maxTokens=Se.profile.defaultMaxTokens),void 0===Ce.input&&(Ce.input=Se.profile.defaultInput);const Te=Se.inherited?.models?.find(e=>e.id===(Ee.id??N))??{},qe=e.profile.api||Ce.api||e.resolvedApi||e.effective?.api||e.catalogModels?.find(e=>e.api)?.api,Ae=c(0),ze=!C(I,A(Ee,y))||N!==(Ee.id??"");D(ze,w);const Me=(e,t)=>{if(""===e||void 0===e)return t;if("number"==typeof e)return e;try{return S(e)}catch(e){return t}},Ie=Me(I.contextWindow,Ce.contextWindow),Re=""===I.maxTokens?Number.isSafeInteger(Te.maxTokens)?Te.maxTokens:void 0:Me(I.maxTokens,void 0),Oe=Number.isInteger(Re)&&Re>0?Re:0;let He,De=!1;if(Number.isInteger(Ie)&&Ie>0){He=Math.floor(Math.min(.8*Ie,Ie-Oe-65536));const e=Math.floor(.16*(Ie-Oe));De=He<=0||e>=He}const Le=Array.isArray(J?.readonly)?J.readonly.find(e=>"maxTokens"===e?.field&&"capability-ceiling"===e?.kind&&"number"==typeof e.value):void 0,Ne=((e,t)=>{if(!Number.isInteger(e)||e<=0)return{kind:"unknown"};const a=e-78020;if(a<2048)return{kind:"leave-empty"};const r=Math.floor(.4*e-65536);let s=8192;for(;2*s<=r&&2*s<=65536;)s*=2;let n=Math.min(s,65536,a);return Number.isInteger(t)&&t>0&&t<n&&(n=t),n<1024?{kind:"leave-empty"}:(n%1024!=0&&(n=1024*Math.floor(n/1024)),{kind:"value",value:n})})(Ie,Le?.value),We="value"===Ne.kind?Math.floor(Math.min(.8*Ie,Ie-Ne.value-65536)):void 0,Be=e=>e%1024==0?e/1024+"K":String(e),Pe="value"!==Ne.kind||String(Me(I.maxTokens,Ee.maxTokens??"")).trim()===String(Ne.value)?ue:[...ue,{key:"maxTokensRecommendation",field:"maxTokens",path:["maxTokens"],candidate:{value:Ne.value,source:"context-window"},candidates:[{id:"context-window",value:Ne.value,source:"context-window"}]}];d(()=>{const t=++Ae.current;if(!F||!N.trim())return Z(null),void ee(!1);let r=!0;return Z(null),ce(null),ee(!0),a("models3-fill",{route:e.route,modelId:N.trim(),api:qe}).then(e=>{r&&Ae.current===t&&(ee(!1),e.ok?(Z(e.value),ae(e=>"conflict"===e||"schema-invalid"===e||"configuration-rejected"===e?e:"")):ae(e.error))}).catch(()=>{r&&Ae.current===t&&(ee(!1),ae("operation-failed"))}),()=>{r=!1,Ae.current++}},[F,N,e.route,qe,le]);const je=()=>{const e=""===I.input||void 0===I.input?Ce.input:I.input;return Array.isArray(e)&&e.length>0?e:"image"===e?["text","image"]:"image-only"===e?["image"]:["text"]},$e=e=>{if("text"===e)return;const t=[...new Set(["text",...je()])];let a;if(t.includes(e)){if(1===t.length&&"text"===e)return;a=t.filter(t=>t!==e)}else a=[...t,e];O({...I,input:a})},_e=""===I.reasoningEfforts||void 0===I.reasoningEfforts?Ce.reasoningEfforts:I.reasoningEfforts,Ve=!1===_e,Fe="object"==typeof _e&&null!==_e?_e:{};return l("article",{ref:M,style:p,"data-testid":"model-detail","data-model-id":N},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"16px",flexWrap:"wrap"}},l("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l(L,{id:"model-detail-back",onClick:()=>{H()&&n()}},w("models.smart.back")),l("h3",{style:{margin:0,fontSize:"16px",fontWeight:600}},w("models.smart.editTitle")))),de?l(u,{open:!0,title:w("models.smart.fillAll"),closeLabel:w("models.smart.cancel"),onClose:()=>ce(null),footer:l("div",{style:v},l(L,{onClick:()=>ce(null)},w("models.smart.cancel")),l(L,{id:"model-smart-fill-confirm",style:me("primary"),onClick:()=>{O(e=>function(e,t){const a={...e};for(const e of t){const t=e.candidate.value;e.path?.length>1?a[e.path[0]]={...a[e.path[0]]||{},[e.path[1]]:t}:(a[e.field]=x.includes(e.field)?void 0===t?"":String(t):void 0===t?"":t,"input"===e.field&&Array.isArray(t)&&(a.input=[...new Set(["text",...t])]))}return a}(e,de)),ce(null)}},w("models.smart.confirmFill")))},l("p",{style:h},w("models.smart.fillConfirmPrompt")),l(j,{groups:de,draft:I})):null,l("div",{style:b},l("div",null,l("label",{style:f},w("models.wb.edit.modelId")||"模型 ID"),l("input",{style:g,value:N,placeholder:w("models.wb.edit.modelIdPlaceholder"),"aria-label":w("models.smart.field.modelId"),"data-testid":s?"model-new-id":void 0,onChange:e=>P(e.target.value)})),l("div",null,l("label",{style:f},w("models.smart.field.name")),l("input",{style:g,value:""===I.name?Ce.name||"":I.name,"aria-label":w("models.smart.field.name"),"data-testid":"model-field-name",placeholder:Ce.name||w("models.wb.edit.displayNamePlaceholder"),onChange:e=>O({...I,name:e.target.value})}))),l("div",{style:{...v,margin:"36px 0 12px"}},l("span",{style:{fontSize:"13px"}},w("models.smart.title")),l("button",{type:"button",role:"switch","aria-checked":F,"data-testid":"model-smart-toggle","aria-label":w("models.smart.title"),"aria-describedby":K?"model-smart-help":void 0,onMouseEnter:e=>{const t=e.currentTarget.getBoundingClientRect();G({x:t.left,y:t.bottom})},onMouseLeave:()=>G(null),onFocus:e=>{const t=e.currentTarget.getBoundingClientRect();G({x:t.left,y:t.bottom})},onBlur:()=>G(null),style:{width:"38px",height:"22px",..._("999px"),border:0,padding:"2px",display:"inline-flex",alignItems:"center",justifyContent:F?"flex-end":"flex-start",background:F?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)",cursor:"pointer"},onClick:()=>U(!F)},l("span",{style:{width:"18px",height:"18px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}})),F?l(L,{id:"model-smart-refresh",onClick:()=>ie(le+1)},w("models.smart.refresh")):null),K?l("div",{id:"model-smart-help",role:"tooltip",style:{position:"fixed",zIndex:1e3,left:Math.max(12,Math.min(K.x,window.innerWidth-312)),top:Math.max(12,Math.min(K.y+8,window.innerHeight-180)),width:"300px",maxWidth:"calc(100vw - 24px)",boxSizing:"border-box",padding:"10px 12px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",fontSize:"12px",lineHeight:"18px",overflowWrap:"anywhere",pointerEvents:"none"}},w("models.smart.help")):null,F?l("div",{style:{padding:"8px 12px",background:"var(--dsw-alias-bg-layer-2)",borderRadius:"8px",marginBottom:"14px",border:"1px solid var(--dsw-alias-border-l2)"}},X?l("p",{role:"status","data-testid":"model-smart-loading",style:{...h,margin:0}},w("models.smart.loading")):null,J?l("div",null,Pe.length>0?l("div",{"data-testid":"model-smart-inline-bar",style:{...v,justifyContent:"space-between",marginBottom:"8px"}},l("b",{style:{fontSize:"12px"}},w("models.smart.suggestedValues")),l(L,{id:"model-smart-auto-fill","data-testid":"model-smart-auto-fill",style:me("primary"),onClick:()=>ce(Pe)},w("models.smart.fillAll"))):null,0===Pe.length?l("p",{role:"status","data-testid":"model-smart-empty",style:{...h,margin:0}},w("models.smart.noSuggestions")):l(j,{groups:Pe,draft:I}),"alias"===J.identity?.via?l("p",{role:"status","data-testid":"model-smart-alias",style:{...h,margin:"10px 0 0",lineHeight:"18px",overflowWrap:"anywhere"}},w("models.smart.aliasIdentity").replace("{requested}",String(J.identity.requestedModelId??"")).replace("{matched}",String(J.identity.modelId??""))):null,ue.some(e=>"reasoningEfforts"===e.field)?null:l("p",{role:"status","data-testid":"model-smart-reasoning-empty",style:{...h,margin:"10px 0 0"}},w(J.reasoningSupported?"models.smart.reasoningSupportedNoLevels":"models.smart.noReasoningSuggestions"))):null):null,l("div",{style:b},l("div",null,l("label",{style:f},w("models.wb.edit.context")||"上下文窗口"),l("input",{style:g,"data-testid":"model-field-contextWindow","aria-label":w("models.smart.field.contextWindow"),value:I.contextWindow,placeholder:E(Ce.contextWindow)||w("models.wb.edit.contextPlaceholder"),onChange:e=>O({...I,contextWindow:e.target.value})})),l("div",null,l("label",{style:{...f,display:"inline-flex",alignItems:"center",gap:"5px"}},w("models.wb.edit.maxTokens")||"最大输出 token",l("button",{type:"button","data-testid":"model-maxTokens-help","aria-label":w("models.smart.maxTokensHelpLabel"),"aria-describedby":Y?"model-maxTokens-help-popup":void 0,onMouseEnter:e=>{const t=e.currentTarget.getBoundingClientRect();Q({x:t.left,y:t.bottom})},onMouseLeave:()=>Q(null),onFocus:e=>{const t=e.currentTarget.getBoundingClientRect();Q({x:t.left,y:t.bottom})},onBlur:()=>Q(null),onKeyDown:e=>{"Escape"===e.key&&Q(null)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",padding:0,border:0,background:"transparent",color:"var(--dsh-svc-text-muted)",cursor:"help"}},l("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round","aria-hidden":!0},l("circle",{cx:12,cy:12,r:9.2}),l("path",{d:"M9.7 9.4a2.4 2.4 0 1 1 3.4 2.1c-.7.4-1.1.9-1.1 1.7v.4"}),l("circle",{cx:12,cy:17.1,r:.95,fill:"currentColor",stroke:"none"})))),l("input",{style:g,"data-testid":"model-field-maxTokens","aria-label":w("models.smart.field.maxTokens"),value:I.maxTokens,placeholder:E(Ce.maxTokens)||w("models.wb.edit.maxTokensPlaceholder"),onChange:e=>O({...I,maxTokens:e.target.value})}),Y?l("div",{id:"model-maxTokens-help-popup",role:"tooltip","data-testid":"model-maxTokens-help-popup",style:{position:"fixed",zIndex:1e3,width:"320px",maxWidth:"calc(100vw - 24px)",boxSizing:"border-box",left:Math.max(12,Math.min(Y.x,window.innerWidth-332)),top:Math.max(12,Math.min(Y.y+8,window.innerHeight-160)),padding:"10px 12px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",fontSize:"12px",lineHeight:"18px",overflowWrap:"anywhere",pointerEvents:"none"}},l("p",{"data-testid":"model-maxTokens-hint",style:{margin:"0 0 6px"}},w("models.smart.maxTokensHint")),void 0!==He?l("p",{role:"status","data-testid":"model-maxTokens-budget",style:{margin:"0 0 6px",color:De?"var(--dsw-alias-state-error-primary)":"inherit"}},De?w("models.smart.maxTokensUnsafe"):w("models.smart.maxTokensThreshold").replace("{tokens}",String(He))):null,"value"===Ne.kind?l("p",{"data-testid":"model-maxTokens-recommend",style:{margin:"0 0 6px",color:"var(--dsw-alias-label-secondary)"}},w("models.smart.maxTokensRecommend").replace("{value}",Be(Ne.value)).replace("{window}",String(Ie)).replace("{threshold}",String(We))):null,"leave-empty"===Ne.kind?l("p",{"data-testid":"model-maxTokens-recommend",style:{margin:"0 0 6px",color:"var(--dsw-alias-state-warn-primary)"}},w("models.smart.maxTokensRecommendEmpty")):null,void 0!==Le?l("p",{"data-testid":"model-maxTokens-capability",style:{margin:0}},w("models.smart.maxTokensCapability").replace("{value}",Be(Le.value))):null):null)),l("section",{style:{margin:"18px 0"},"data-testid":"model-advanced-options"},l("div",{"data-testid":"model-modalities-row",style:{display:"grid",gridTemplateColumns:"minmax(0, 2fr) minmax(0, 1fr)",gap:"8px",marginBottom:"18px"}},l("div",null,l("label",{style:f},w("models.wb.edit.inputModalities")||"输入模态"),l("select",{style:{display:"none"},"aria-label":w("models.smart.field.input"),value:je().includes("image")?"image":"text",onChange:e=>O({...I,input:"image"===e.target.value?["text","image"]:["text"]})},l("option",{value:"text"},"text"),l("option",{value:"image"},"image")),l("div",{style:{display:"flex",gap:"8px"}},l(V,{text:w("models.smart.modality.text"),title:w("models.smart.modality.textInput"),checked:!0,disabled:!0,onClick:()=>$e("text")}),l(V,{text:w("models.smart.modality.image"),title:w("models.smart.modality.imageInput"),checked:je().includes("image"),onClick:()=>$e("image")}))),l("div",null,l("label",{style:f},w("models.wb.edit.outputModalities")||"输出模态"),l("div",{style:{display:"flex",gap:"8px"}},l(V,{text:w("models.smart.modality.text"),title:w("models.smart.modality.textOutput"),checked:!0,disabled:!0})))),l("div",{style:{marginBottom:"14px"}},l("label",{style:f},w("models.wb.edit.reasoningLevels")||"推理档位"),l("select",{style:{...g,marginBottom:"6px"},"aria-label":w("models.smart.field.reasoningEfforts"),"data-testid":"model-reasoning-mode",value:Ve?"false":Object.keys(Fe).length>0?"map":"inherit",onChange:e=>O({...I,reasoningEfforts:"false"!==e.target.value&&("map"===e.target.value?{}:"")})},l("option",{value:"inherit"},w("models.smart.reasoning.inherit")),l("option",{value:"false"},w("models.smart.reasoning.false")),l("option",{value:"map"},w("models.smart.reasoning.map"))),l("div",{className:"dsh-model-efforts","data-testid":"model-efforts-row",style:{display:"flex",flexWrap:"nowrap",gap:"2px",alignItems:"stretch",margin:"6px 0",minWidth:0}},l("style",null,".dsh-model-efforts { container-type:inline-size; } .dsh-model-efforts .dsh-model-effort-label { width:100%; box-sizing:border-box; justify-content:center; font-size:clamp(6px, 2.7cqw, 14px); gap:clamp(1px, .4cqw, 4px); padding:8px 1px; } .dsh-model-efforts .dsh-model-effort-check { width:clamp(8px, 2.9cqw, 16px); height:clamp(8px, 2.9cqw, 16px); }"),k.map(e=>{const t=(e=>!Ve&&Object.hasOwn(Fe,e))(e);return l("span",{key:e,style:{display:"flex",alignItems:"stretch",minWidth:0,flex:"1 1 0"}},l("label",{"data-testid":"models-effort-"+e,className:"dsh-model-effort-label",style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",..._("6px"),cursor:"pointer",border:"1px solid "+(t?"var(--dsh-svc-brand, #3b82f6)":"var(--dsw-alias-border-l2)"),background:t?"var(--dsw-alias-bg-layer-2)":"var(--dsw-alias-bg-layer-3)",color:t?"var(--dsw-alias-label-primary)":"var(--dsh-svc-text-muted)",fontWeight:t?600:400}},l("input",{type:"checkbox",className:"dsh-model-effort-check",checked:t,"aria-label":e,onChange:()=>(e=>{const t={...Fe};Object.hasOwn(t,e)?delete t[e]:t[e]="off"===e?null:e,O({...I,reasoningEfforts:0===Object.keys(t).length?void 0:t})})(e),style:{margin:0,flexShrink:0,accentColor:"var(--dsw-alias-button-primary-fill)"}}),e))})),Object.keys(Fe).length>0?l("details",{"data-testid":"model-reasoning-wire-editor",style:{marginTop:"4px"}},l("summary",{style:{cursor:"pointer",...h}},w("models.smart.wireEditor")),l("div",{"data-testid":"model-reasoning-wires",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:"8px",margin:"8px 0 6px"}},...k.filter(e=>Object.hasOwn(Fe,e)).map(e=>l("label",{key:e,style:{minWidth:0}},l("span",{style:{...f,fontSize:"11px"}},e+" → "+w("models.smart.wireValue")),l("input",{style:{...g,minHeight:"30px",fontSize:"12px"},"aria-label":e+" wire","data-testid":"model-wire-"+e,value:"string"==typeof Fe[e]?Fe[e]:"",placeholder:w("models.smart.wireRequired"),onChange:t=>((e,t)=>{const a={...Fe,[e]:t};O({...I,reasoningEfforts:a})})(e,t.target.value)})))),l("small",{style:{...h,display:"block",lineHeight:"17px"}},w("models.smart.wireHint"))):null)),s?l("details",{style:{margin:"16px 0"},"data-testid":"model-new-parameters"},l("summary",{style:{cursor:"pointer",...h}},w("models.smart.parametersJson")),l("pre",{style:{padding:"12px",background:"var(--dsw-alias-bg-layer-2)",borderRadius:"8px",fontSize:"12px",whiteSpace:"pre-wrap",overflowWrap:"anywhere"}},JSON.stringify({id:N,...Object.fromEntries(Object.entries(I).filter(([,e])=>""!==e&&void 0!==e))},null,2))):null,l(W,{error:te}),ne?l("p",{role:"status",style:{color:ne===w("models.smart.testFailed")?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-state-success-primary)",fontSize:"13px"}},ne):null,"conflict"===te?l("section",{style:m,"data-testid":"model-conflict"},l(L,{id:"model-conflict-compare",onClick:async()=>{const t=await a("models3-open",{route:e.route});t.ok?fe(t.value):ae(t.error)}},w("models.smart.compareLatest")),he?l("div",{style:{marginTop:"8px"}},...y.map(e=>l("div",{key:e,style:{marginTop:"6px"}},l("b",{style:{fontSize:"12px"}},e),l("p",{style:h},w("models.smart.latest")+": "+T(he.profile.models.find(e=>e.id===Ee.id)?.[e])+" · "+w("models.smart.draft")+": "+T(I[e])),l(L,{onClick:()=>{const t=he.profile.models.find(e=>e.id===Ee.id)?.[e];O({...I,[e]:x.includes(e)?void 0===t?"":String(t):void 0===t?"":t}),ke({...xe,[e]:!0})}},w("models.smart.useLatest")))),l(L,{id:"model-conflict-rebase",style:{marginTop:"8px"},onClick:()=>{const e=he.profile.models.find(e=>e.id===Ee.id)??{id:N};O(z(I,Ee,e,y,xe)),ve(he),we(e),ke({}),ae(""),fe(null)}},w("models.smart.rebaseDraft"))):null):null,pe?l("section",{style:m,"data-testid":"model-test-plan"},l("p",{style:{margin:"0 0 6px 0",fontSize:"12px"}},w("models.smart.testBoundary")),l("code",{style:{fontSize:"12px",display:"block",marginBottom:"4px",overflowWrap:"anywhere"}},(pe.text??"ping")+" · maxTokens="+pe.maxTokens+" · "+pe.timeoutMs+"ms"),!0===pe.mayCharge?l("small",{style:{...h,display:"block",marginBottom:"8px"}},w("models.smart.testMayCharge")):null,l("div",{style:v},l(L,{id:"model-test-confirm",disabled:re,style:me("primary"),onClick:async()=>{se(!0);try{const e=await a("models3-test-commit",{planId:pe.planId});ge(null),e.ok?e.value.ok?oe(w("models.smart.testPassed")):ae(B(w,e.value)):ae(e.error)}catch(e){ge(null),ae("operation-failed")}finally{se(!1)}}},w("models.smart.confirm")),l(L,{onClick:()=>ge(null)},w("models.smart.cancel")))):null,l("div",{style:{...v,justifyContent:"flex-end",marginTop:"20px",paddingTop:"16px",borderTop:"1px solid var(--dsw-alias-border-l2)"}},l(L,{onClick:()=>{H()&&n()}},w("models.smart.cancel")),ze?l("span",{role:"status",style:h},w("models.smart.unsaved")):null,l(L,{id:"model-detail-test",disabled:re||ze,title:w(ze?"models.smart.testNeedsSaved":"models.smart.test"),onClick:()=>{(async()=>{ae(""),oe("");try{const e=await a("models3-test-preview",{sessionId:Se.sessionId,modelId:r.id});e.ok?ge(e.value):ae(e.error)}catch(e){ae("operation-failed")}})()}},w("models.smart.test")),l(L,{id:"model-detail-save",disabled:re||!ze,onClick:()=>{(async()=>{if(N.trim()){se(!0),ae(""),oe("");try{let e;try{e=R(I,Ee,y)}catch(e){return void ae("schema-invalid")}const t=await a("models3-save-model",{sessionId:Se.sessionId,modelId:N.trim(),...s?{}:{originalModelId:Ee.id},patch:e.patch,unset:e.unset,add:s});t.ok?o():ae(t.error)}catch(e){ae("operation-failed")}finally{se(!1)}}else ae("bad-model-id")})()},style:{...me(ze?"primary":"neutral"),...ze?{}:{opacity:.5,cursor:"not-allowed"}}},w("models.smart.save"))))}function U({row:e,size:t=18}){const{value:a}=n();return!1!==a.modelProviderIcons&&(q(e.route,t,{flexShrink:0},"model-provider-icon-"+e.route)||q(e.displayName,t,{flexShrink:0},"model-provider-icon-"+e.route))||l("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0,style:{flexShrink:0},"data-testid":"model-provider-fallback-"+e.route},l("path",{d:"M12 3 21 8v10l-9 5-9-5V8l9-5Zm0 10 9-5M12 13 3 8m9 5v10M7.5 5.5l9 5"}))}function K({row:e,onBack:s,reload:n,onModelsChanged:o}){const c=t(),[b,y]=i(null),[x,k]=i(null),[S,q]=i(null),[M,I]=i(""),[O,j]=i(""),[$,V]=i(null),[K,G]=i(0);d(()=>{if(!$)return;const e=()=>G(Math.floor((Date.now()-$.startedAt)/1e3));e();const t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[$]);const[Y,Q]=i(null),[J,Z]=i(!1),[X,ee]=i(!1),[te,ae]=i(""),[re,se]=i(null),[ne,oe]=i({}),[le,ie]=i(!1),[de,ce]=i(""),[ue,pe]=i(null),[ge,fe]=i(""),[be,ve]=i(!1),[ye,we]=i([]),[xe,ke]=i(""),[Se,Ee]=i(null),[Ce,Te]=i(""),qe=null!==x&&null!==b&&!C(x,A(b.profile,w)),Ae=qe||""!==Ce||""!==xe||ye.length>0;D(null===S&&Ae,c);const ze=async()=>{const t=await a("models3-open",{route:e.route});t.ok?(y(t.value),I(""),k(A(t.value.profile,w))):I(t.error)};d(()=>{let t=!0;return a("models3-open",{route:e.route}).then(e=>{t&&(e.ok?(y(e.value),k(A(e.value.profile,w))):I(e.error))}),()=>{t=!1}},[e.route]);const Me=()=>{q(null),pe(null),we([]),ke(""),Te(""),I(""),ze(),n()};if(S&&b)return l(F,{key:S.id??"new",opened:b,model:S,isNew:!0===S.isNew,onBack:()=>q(null),onSaved:Me});if(!b||!x)return l("div",{style:p},l(W,{error:M}),c("models.smart.loading"));const Ie=w,Re=async(e,t,r)=>{I("");try{const s=await a(e,t);s.ok?Ee({...s.value,kind:r}):I(s.error)}catch(e){I("operation-failed")}},Oe=b.profile?.models&&b.profile.models.length>0?b.profile.models:[];return l("article",{style:{minWidth:0},"data-testid":"model-route-detail"},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"14px",flexWrap:"wrap"}},l("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l(U,{row:e,size:22}),l("h3",{style:{margin:0,fontSize:"20px",fontWeight:700,overflowWrap:"anywhere"}},x.displayName||e.displayName)),l("div",{style:{...v,position:"relative"}},l("button",{type:"button",role:"switch","aria-checked":!1!==e.enabled,"aria-label":c("models.smart.providerEnabled"),"aria-description":c("models.smart.enableBoundary"),disabled:le,onMouseEnter:e=>Q({x:e.clientX,y:e.clientY}),onMouseMove:e=>Q({x:e.clientX,y:e.clientY}),onMouseLeave:()=>Q(null),onFocus:e=>{const t=e.currentTarget.getBoundingClientRect();Q({x:t.right,y:t.bottom})},onBlur:()=>Q(null),onKeyDown:e=>{"Escape"===e.key&&Q(null)},onClick:async()=>{Q(null),ie(!0),I("");try{const t=!1===e.enabled,r=await a("models3-enabled-preview",{sessionId:b.sessionId,enabled:t});if(!r.ok)return void I(r.error);const s=r.value.references??[];if(!t&&s.length>0)return void Ee({...r.value,kind:"availability"});const o=await a("models3-enabled-commit",{planId:r.value.planId});o.ok?n():I(o.error)}catch(e){I("operation-failed")}finally{ie(!1)}},"data-testid":"model-route-enabled",style:{width:"38px",height:"22px",border:0,..._("999px"),padding:"2px",background:!1!==e.enabled?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:!1!==e.enabled?"flex-end":"flex-start"}},l("span",{style:{width:"18px",height:"18px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}})),Y?l("div",{role:"tooltip","data-testid":"model-route-enabled-help",style:{position:"fixed",zIndex:1e3,left:Math.max(12,Y.x-Math.min(300,Y.x-12)),top:Math.min(Y.y+16,window.innerHeight-100),width:Math.max(0,Math.min(300,Y.x-12)),boxSizing:"border-box",padding:"10px 12px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"8px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",fontSize:"12px",lineHeight:"18px",overflowWrap:"anywhere",pointerEvents:"none"}},c("models.smart.enableBoundary")):null,l(L,{id:"model-route-menu","aria-label":c("models.smart.providerActions"),"aria-expanded":J,"aria-haspopup":"menu",compact:!0,onClick:()=>Z(!J)},"⋯"),J?l("div",{role:"menu",style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:2,minWidth:"160px",padding:"4px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"10px",background:"var(--dsw-alias-bg-overlay)",boxShadow:"0 6px 18px var(--dsw-alias-bg-mask-drop)"},onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),Z(!1))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Z(!1)}},l(L,{id:"model-route-rename",role:"menuitem",style:{width:"100%",justifyContent:"flex-start",border:0},onClick:()=>{Z(!1),ae(x.displayName||e.displayName),ee(!0)}},c("models.smart.rename")),l(L,{id:"model-route-delete",role:"menuitem",danger:!0,style:{width:"100%",justifyContent:"flex-start",border:0,borderTop:"1px solid var(--dsw-alias-border-l2)"},onClick:()=>{Z(!1),Re("models3-remove-preview",{sessionId:b.sessionId},"remove")}},c("models.smart.deleteRoute"))):null)),X?l(u,{open:!0,title:c("models.smart.rename"),closeLabel:c("models.smart.cancel"),onClose:()=>ee(!1),footer:l(r.Fragment,null,l(L,{onClick:()=>ee(!1)},c("models.smart.cancel")),l(L,{id:"model-route-rename-confirm",disabled:!te.trim(),style:me("primary"),onClick:()=>{k({...x,displayName:te.trim()}),ee(!1)}},c("models.smart.renameApply")))},l("input",{autoFocus:!0,style:g,value:te,"aria-label":c("models.smart.field.displayName"),onChange:e=>ae(e.target.value)})):null,l("section",{style:{minWidth:0,marginBottom:"24px",display:"grid",gap:"14px"}},l(P,{field:"baseURL",value:x.baseURL,schema:b.schema,onChange:e=>{le||k({...x,baseURL:e})}}),l("div",{style:{display:"grid",gap:"14px"}},b.builtin||"builtin"===e.source?l("label",null,l("span",{style:f},c("models.smart.field.api")),l("input",{style:g,readOnly:!0,"aria-label":c("models.smart.field.api"),value:b.resolvedApi||x.api||b.effective?.api||b.catalogModels?.find(e=>e.api)?.api||c("models.smart.protocolUnknown")})):l(P,{field:"api",value:x.api,schema:b.schema,onChange:e=>{le||k({...x,api:e})}}),Array.isArray(b.catalogApis)&&b.catalogApis.length>1?l("p",{"data-testid":"model-mixed-api-hint",role:"note",style:{...h,margin:0}},c("models.smart.mixedApiHint").replace("{apis}",b.catalogApis.join(", "))):null),l("div",null,l("label",{style:f},c("models.smart.key")),["missing","authorized"].includes(b.credentialState)?l("p",{role:"status",style:{...h,margin:"0 0 6px"}},c("models.smart.keyState."+b.credentialState)):null,l("div",{style:{display:"flex",gap:"8px",alignItems:"center",flexWrap:"wrap"}},l("input",{type:"password",autoComplete:"new-password",style:{...g,flex:1,minWidth:"200px"},"aria-label":c("models.smart.key"),value:Ce,placeholder:c("configured"===b.credentialState?"models.smart.keyConfiguredPlaceholder":"models.smart.keyReplacePlaceholder"),onChange:e=>Te(e.target.value)}),l(L,{id:"model-key-preview",disabled:!Ce.trim(),onClick:()=>{Re("models3-credential-preview",{sessionId:b.sessionId,shared:!1},"credential")}},c("models.smart.updateKey"))))),l("section",{style:{minWidth:0,marginBottom:"16px"}},l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"10px",flexWrap:"wrap"}},l("h4",{style:{...h,margin:0,fontSize:"14px",fontWeight:500}},c("models.smart.modelList")),l("div",{style:v},l(L,{id:"model-add",onClick:()=>{H()&&q({isNew:!0})}},"+ "+c("models.smart.newModel")),l(L,{id:"model-discover",disabled:be,onClick:async()=>{ve(!0),I("");try{const e=await a("models3-discover",{sessionId:b.sessionId});e.ok?(fe(""),pe(e.value.candidates)):I(e.error)}catch(e){I("operation-failed")}finally{ve(!1)}}},c(be?"models.smart.loading":"models.smart.discover")))),null!==ue?(()=>{const e=ge.trim().toLowerCase(),t=ue.filter(t=>(t.id+" "+(t.name??"")).toLowerCase().includes(e)),s=t.filter(e=>!Oe.some(t=>t.id===e.id)).map(e=>e.id),n=ye.filter(e=>!ue.some(t=>t.id===e));return l(u,{open:!0,title:c("models.smart.discover"),closeLabel:c("models.smart.cancel"),onClose:()=>{le||(pe(null),we([]))},footer:l(r.Fragment,null,l(L,{disabled:le,onClick:()=>{pe(null),we([])}},c("models.smart.cancel")),l(L,{id:"model-add-batch",disabled:le||0===ye.length,style:me("primary"),onClick:async()=>{ie(!0),I("");try{const e=await a("models3-add-models",{sessionId:b.sessionId,modelIds:ye});e.ok?Me():I(e.error)}catch(e){I("operation-failed")}finally{ie(!1)}}},c("models.smart.add")))},l("div",{"data-testid":"model-discovery"},l("input",{type:"search",style:{...g,marginBottom:"8px"},"aria-label":c("models.smart.search"),value:ge,placeholder:c("models.smart.search"),onChange:e=>fe(e.target.value)}),l("div",{style:{...v,marginBottom:"8px"}},l(L,{compact:!0,disabled:le,onClick:()=>we([...new Set([...ye,...s])])},c("models.smart.selectAll")),l(L,{compact:!0,disabled:le,onClick:()=>we([])},c("models.smart.clear"))),ye.length>0?l("div",{"data-testid":"model-discovery-selected",style:{...h,marginBottom:"8px",lineHeight:"18px"}},l("span",null,c("models.smart.selectedCount").replace("{count}",String(ye.length))),n.length>0?l("span",null," · ",c("models.smart.hiddenPicks").replace("{count}",String(n.length)),l(L,{id:"model-discovery-remove-hidden",compact:!0,style:{marginLeft:"6px"},onClick:()=>we(e=>e.filter(e=>!n.includes(e)))},c("models.smart.removeHiddenPicks"))):null):null,l("div",{style:{maxHeight:"min(360px, 45dvh)",overflowY:"auto"}},0===t.length?l("p",{"data-testid":"model-discovery-no-match",role:"status",style:{...h,margin:"2px 0"}},c("models.smart.noSearchMatch")):null,...t.map(e=>l("label",{key:e.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 4px",fontSize:"13px",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},l("input",{type:"checkbox",checked:ye.includes(e.id),disabled:le||Oe.some(t=>t.id===e.id),onChange:t=>we(t.target.checked?[...ye,e.id]:ye.filter(t=>t!==e.id))}),l("span",{style:{minWidth:0,overflowWrap:"anywhere"}},e.id),Oe.some(t=>t.id===e.id)?l("span",{style:he("neutral")},c("models.smart.added")):null))),l(W,{error:M})))})():null,Oe.length>5?l("input",{style:{...g,marginBottom:"8px"},"aria-label":c("models.smart.search"),value:de,placeholder:c("models.smart.search"),onChange:e=>ce(e.target.value)}):null,...Oe.filter(e=>(e.id+" "+(e.name??"")).toLowerCase().includes(de.toLowerCase())).map((e,t)=>l("div",{key:e.id+":"+(e.api??t),style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"10px",alignItems:"center",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-3)",marginBottom:"6px"}},l("div",{className:"dsh-model-row-copy",style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0,flexWrap:"wrap"}},l("span",{className:"dsh-model-row-name",title:e.id,style:{fontWeight:700,maxWidth:"100%","--model-name-length":String(Math.max((e.name?.trim()||e.id).length,1))}},e.name?.trim()||e.id),l("div",{className:"dsh-model-row-capabilities"},Array.isArray(e.input)&&e.input.includes("image")?l("span",{style:he("neutral")},c("models.smart.imageBadge")):null,void 0!==e.reasoningEfforts?l("span",{style:he("neutral")},c("models.smart.reasoningBadge")):null,e.contextWindow?l("span",{style:{fontSize:"11px",color:"var(--dsh-svc-text-muted)"}},E(e.contextWindow)):null)),l("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},l(L,{id:"model-test-"+e.id,compact:!0,title:c("models.smart.test"),"aria-label":c("models.smart.test")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},disabled:le,onClick:()=>{I(""),j(""),Re("models3-test-preview",{sessionId:b.sessionId,modelId:e.id},"test")}},l(N,{kind:"test"})),l(L,{id:"model-open-"+e.id,compact:!0,title:c("models.smart.edit"),"aria-label":c("models.smart.edit")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},onClick:()=>{H()&&q(e)}},l(N,{kind:"edit"})),l(L,{id:"model-delete-"+e.id,compact:!0,title:c("models.smart.remove"),"aria-label":c("models.smart.remove")+" "+e.id,style:{border:0,background:"transparent",color:"var(--dsw-alias-label-secondary)",padding:"4px"},onClick:()=>{Re("models3-remove-preview",{sessionId:b.sessionId,modelIds:[e.id]},"remove")}},l(N,{kind:"delete"})),l("button",{type:"button",role:"switch","data-testid":"model-enabled-"+e.id,"aria-label":c("models.smart.modelEnabled")+" "+e.id,"aria-checked":!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled,disabled:le,onClick:async()=>{const t=!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled;ie(!0),I("");try{const r=await a("models3-model-enabled",{sessionId:b.sessionId,modelId:e.id,enabled:!t,expected:t});r.ok?(y({...b,modelAvailability:[...(b.modelAvailability??[]).filter(t=>t.id!==e.id),{id:e.id,enabled:!t}]}),n()):I(r.error)}catch(e){I("operation-failed")}finally{ie(!1)}},style:{width:"34px",height:"20px",..._("999px"),border:0,padding:"2px",flexShrink:0,display:"flex",alignItems:"center",cursor:"pointer",justifyContent:!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled?"flex-end":"flex-start",background:!1!==b.modelAvailability?.find(t=>t.id===e.id)?.enabled?"var(--dsw-alias-button-primary-fill)":"var(--dsw-alias-state-idle-primary)"}},l("span",{style:{width:"16px",height:"16px",..._("50%"),background:"var(--dsw-alias-bg-layer-3)"}}))))),0===Oe.length?l("p",{style:{...h,textAlign:"center",padding:"8px 0"}},c("models.smart.noModels")):null),l("div",{style:{...v,marginTop:"12px"}},qe?l("span",{role:"status",style:h},c("models.smart.unsaved")):null,b.readOnly?null:l(L,{id:"model-route-save",disabled:le||!qe,style:{...me(qe?"primary":"neutral"),...qe?{}:{opacity:.5,cursor:"not-allowed"}},onClick:async()=>{let e;I("");try{e=R(x,b.profile,Ie)}catch(e){return void I("schema-invalid")}ie(!0);try{const t=await a("models3-save-route",{sessionId:b.sessionId,...e});t.ok?Me():I(t.error)}catch(e){I("operation-failed")}finally{ie(!1)}}},c("models.smart.saveRoute"))),"remove"===Se?.kind?l(u,{open:!0,title:c(Se.removeRoute?"models.smart.deleteRoute":"models.smart.deleteModelTitle"),closeLabel:c("models.smart.cancel"),onClose:()=>{le||Ee(null)},footer:l(r.Fragment,null,l(L,{disabled:le,onClick:()=>Ee(null)},c("models.smart.cancel")),l(L,{id:"model-plan-confirm",danger:!0,disabled:le||Se.blocked,onClick:async t=>{t?.stopPropagation?.(),ie(!0),I("");try{const t=await a("models3-remove-commit",{planId:Se.planId});t.ok?Se.removeRoute?(Ee(null),n(),s()):(Ee(null),await ze(),o?o(e):n()):(I(t.error),Ee(null))}catch(e){I("operation-failed"),Ee(null)}finally{ie(!1)}}},c("models.smart.remove")))},l("div",{"data-testid":"model-plan"},l("p",{style:{fontSize:"14px",margin:"0 0 12px"}},c(Se.removeRoute?"models.smart.deleteRoutePrompt":"models.smart.deleteModelPrompt")),Se.removeRoute?l("code",{style:{display:"block",marginBottom:"8px",overflowWrap:"anywhere"}},Se.route):null,...(Se.modelsRemoved??[]).map(e=>l("code",{key:e,style:{display:"block",fontSize:"13px",overflowWrap:"anywhere",marginBottom:"8px"}},e)),(Se.references??[]).length?l("div",{role:"alert","data-testid":"model-removal-conflicts",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",overflowWrap:"anywhere"}},l("b",null,c("models.smart.removalConflicts")),l("ul",{style:{margin:"8px 0",paddingLeft:"20px"}},...Se.references.map((e,t)=>l("li",{key:t},c("models.smart.referenceKind."+e.kind)+":",l("code",null,e.provider+" / "+e.model)))),l("p",{style:{margin:"8px 0"}},c("models.smart.resolveRemovalConflicts"))):null,Se.blocked?l("p",{role:"alert",style:{...h,color:"var(--dsw-alias-state-error-primary)"}},c("models.smart.error.removal-blocked")):null)):Se?l("section",{style:{...m,marginTop:"12px"},"data-testid":"model-plan"},l("h4",{style:{margin:"0 0 6px 0",fontSize:"13px"}},c("test"===Se.kind?"models.smart.test":"availability"===Se.kind?"models.smart.disableProvider":"models.smart.consequences")),l("p",{style:{...h,overflowWrap:"anywhere"}},Se.route||e.displayName),"availability"===Se.kind?l("div",{"data-testid":"model-availability-references"},l("p",{style:{...h,margin:"0 0 6px"}},c("models.smart.disableBoundary")),(Se.references??[]).length>0?l("div",{role:"alert",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",overflowWrap:"anywhere"}},l("b",null,c("models.smart.disableReferences")),l("ul",{style:{margin:"8px 0",paddingLeft:"20px"}},...(Se.references??[]).map((e,t)=>l("li",{key:t},c("models.smart.referenceKind."+e.kind)+":",l("code",null,e.provider+" / "+e.model))))):null,l("p",{style:h},c("models.smart.credentialRetained"))):null,"test"===Se.kind?l("div",{"data-testid":"model-test-details"},l("p",{style:{...h,margin:"0 0 6px"}},c("models.smart.testBoundary")),l("code",{style:{fontSize:"12px",display:"block",marginBottom:"4px",overflowWrap:"anywhere"}},(Se.text??"ping")+" · maxTokens="+Se.maxTokens+" · "+Se.timeoutMs+"ms"),!0===Se.mayCharge?l("small",{style:{...h,display:"block"}},c("models.smart.testMayCharge")):null):null,"availability"!==Se.kind&&"test"!==Se.kind?l("p",{style:h},c("models.smart.credentialRetained")):null,l("div",{style:v},l(L,{id:"model-plan-confirm",danger:"remove"===Se.kind,disabled:Se.blocked||le,onClick:async()=>{const e=Se.kind;ie(!0),I(""),"test"===e&&(G(0),V({modelId:Se.modelId,startedAt:Date.now()}));try{const t=await a("models3-"+("test"===e?"test":"availability"===e?"enabled":"credential"===e?"credential":"remove"===e?"remove":"restore")+"-commit",{planId:Se.planId,..."credential"===e?{key:Ce}:{}});Ee(null),t.ok?t.value.configurationFailed?(Te(""),j(c("models.smart.keyPartial"))):"test"===e?t.value.ok?j(c("models.smart.testPassed")):I(B(c,t.value)):"availability"===e?n():"remove"!==e||Se.modelsRemoved?.length?Me():(n(),s()):I(t.error)}catch(e){Ee(null),I("operation-failed")}finally{V(null),ie(!1)}}},c("models.smart.confirm")),l(L,{disabled:le,onClick:()=>Ee(null)},c("models.smart.cancel")))):null,l(W,{error:M}),O?l("p",{role:"status",style:{color:O===c("models.smart.testFailed")?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-state-success-primary)",fontSize:"13px"}},O):null,$?l("p",{role:"status","aria-live":"polite","data-testid":"model-test-progress",style:{...h,fontSize:"13px",overflowWrap:"anywhere"}},$.modelId+" · "+c("models.smart.testing").replace("{seconds}",String(K))):null,"conflict"===M?l("section",{style:m,"data-testid":"model-route-conflict"},l(L,{id:"model-route-compare",onClick:async()=>{const t=await a("models3-open",{route:e.route});t.ok?se(t.value):I(t.error)}},c("models.smart.compareLatest")),re?l("div",{style:{marginTop:"8px"}},...Ie.map(e=>l("div",{key:e,style:{marginTop:"6px"}},l("b",{style:{fontSize:"12px"}},e),l("p",{style:h},c("models.smart.latest")+": "+T(re.profile[e])+" · "+c("models.smart.draft")+": "+T(x[e])),l(L,{onClick:()=>{k({...x,[e]:A(re.profile,Ie)[e]}),oe({...ne,[e]:!0})}},c("models.smart.useLatest")))),l(L,{id:"model-route-rebase",style:{marginTop:"8px"},onClick:()=>{k(z(x,b.profile,re.profile,Ie,ne)),y(re),oe({}),se(null),I(""),Ee(null)}},c("models.smart.rebaseDraft"))):null):null)}function G({onBack:e,onCreated:r,templates:s=[]}){const n=t(),[o,d]=i(""),[c,u]=i(""),[y,w]=i(""),[x,k]=i("openai-completions"),[S,E]=i(""),[C,T]=i(""),[q,A]=i(""),[z,M]=i([]),[I,R]=i(null),[O,N]=i(""),[B,P]=i([]),[j,$]=i(!1),[_,V]=i(!1),[F,U]=i(""),K=!!(c||y||S||C||q||B.length>0||"openai-completions"!==x);D(K,n);const G=e=>t=>{e(t.target.value),U("")},Y=async()=>{if(S.trim()){$(!0),U("");try{const e=await a("models3-discover",{baseURL:S.trim(),api:x,key:C.trim()});e.ok?(N(""),R(e.value.candidates||[])):U(e.error)}catch(e){U("operation-failed")}finally{$(!1)}}else U("schema-invalid")},Q=null!==I?I:z,J=O.trim().toLowerCase(),Z=J?Q.filter(e=>(e.id+" "+(e.name??"")).toLowerCase().includes(J)):Q,X=B.filter(e=>!Q.some(t=>t.id===e));return l("article",{style:p,"data-testid":"model-create-route"},l("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"14px"}},l(L,{onClick:()=>{H()&&e()}},n("models.smart.back")),l("h3",{style:{margin:0,fontSize:"14px",fontWeight:700}},n("models.smart.createRoute"))),s.length>0?l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.template")),l("select",{style:g,"aria-label":n("models.smart.template"),"data-testid":"model-create-template",value:o,onChange:e=>{const t=e.target.value;if(d(t),R(null),N(""),P([]),U(""),t&&"custom"!==t){const e=s.find(e=>e.id===t);if(e)return u(e.id),w(e.name),k(e.api||"openai-completions"),E(e.baseURL||""),void M(e.models||[])}u(""),w(""),k("openai-completions"),E(""),M([])}},l("option",{value:"custom"},n("models.smart.templateCustom")),...s.map(e=>l("option",{key:e.id,value:e.id},e.name+" ("+e.id+")")))):null,(()=>{const e=s.find(e=>e.id===o);return void 0!==e&&Array.isArray(e.apis)&&e.apis.length>1?l("p",{"data-testid":"model-create-mixed-api-hint",role:"note",style:{...h,margin:"-6px 0 12px"}},n("models.smart.mixedApiHint").replace("{apis}",e.apis.join(", "))):null})(),l("div",{style:b},l("div",null,l("label",{style:f},n("models.smart.routeId")),l("input",{style:g,value:c,"aria-label":n("models.smart.routeId"),placeholder:"deepseek, openai...",onChange:G(u)})),l("div",null,l("label",{style:f},n("models.smart.field.displayName")),l("input",{style:g,value:y,"aria-label":n("models.smart.field.displayName"),placeholder:"DeepSeek, OpenAI...",onChange:G(w)}))),l("div",{style:b},l("div",null,l("label",{style:f},n("models.smart.field.api")),l("select",{style:g,"aria-label":n("models.smart.field.api"),value:x,onChange:G(k)},...["openai-completions","openai-responses","anthropic-messages"].map(e=>l("option",{key:e},e)))),l("div",null,l("label",{style:f},n("models.smart.field.baseURL")),l("input",{style:g,value:S,"aria-label":n("models.smart.field.baseURL"),placeholder:"https://api.openai.com/v1",onChange:G(E)}))),l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.apiKey")),l("input",{type:"password",autoComplete:"new-password",style:g,value:C,placeholder:n("models.smart.apiKeyPlaceholder"),"aria-label":n("models.smart.apiKey"),onChange:G(T)})),Q.length>0?l("div",{style:{...m,marginTop:"8px"}},l("p",{style:{...f,margin:"0 0 6px 0"}},n("models.smart.selectModelsHint")),Q.length>5?l("input",{type:"search","data-testid":"model-create-search",style:{...g,marginBottom:"8px"},"aria-label":n("models.smart.search"),value:O,placeholder:n("models.smart.search"),onChange:G(N)}):null,l("div",{style:{maxHeight:"160px",overflowY:"auto",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"6px",padding:"6px",background:"var(--dsw-alias-bg-layer-2)"}},Z.length?Z.map(e=>l("label",{key:e.id,style:{display:"block",padding:"3px 0",fontSize:"13px"}},l("input",{type:"checkbox",checked:B.includes(e.id),onChange:t=>P(t.target.checked?[...B,e.id]:B.filter(t=>t!==e.id))})," "+e.id+(e.name&&e.name!==e.id?" ("+e.name+")":""))):l("p",{"data-testid":"model-create-no-match",role:"status",style:{...h,margin:"2px 0"}},n("models.smart.noSearchMatch"))),l("div",{style:{...v,marginTop:"8px"}},l(L,{onClick:()=>P([...new Set([...B,...Z.map(e=>e.id)])])},n("models.smart.selectAll")),l(L,{onClick:()=>P([])},n("models.smart.clear")),l(L,{id:"model-create-discover",disabled:j,onClick:()=>{Y()}},n(j?"models.smart.loading":"models.smart.discover"))),B.length>0?l("div",{"data-testid":"model-create-selected",style:{...h,marginTop:"8px",lineHeight:"18px"}},l("span",null,n("models.smart.selectedCount").replace("{count}",String(B.length))),X.length>0?l("span",null," · ",n("models.smart.hiddenPicks").replace("{count}",String(X.length)),l(L,{id:"model-create-remove-hidden",compact:!0,style:{marginLeft:"6px"},onClick:()=>P(e=>e.filter(e=>!X.includes(e)))},n("models.smart.removeHiddenPicks"))):null):null):S.trim()?l("div",{style:{marginBottom:"8px"}},l(L,{id:"model-create-discover",disabled:j,onClick:()=>{Y()}},n(j?"models.smart.loading":"models.smart.discover"))):null,l("div",{style:{marginBottom:"12px"}},l("label",{style:f},n("models.smart.manualIds")),l("textarea",{style:{...g,minHeight:"60px"},value:q,"aria-label":n("models.smart.manualIds"),placeholder:"gpt-4o, claude-3-5-sonnet...",onChange:G(A)})),K?l("p",{role:"status",style:h},n("models.smart.unsaved")):null,l(L,{id:"model-create-save",disabled:!K||_,style:{...me(K?"primary":"neutral"),...K?{}:{opacity:.5,cursor:"not-allowed"}},onClick:async()=>{const e=[...new Set([...B,...q.split(/[\s,]+/).filter(Boolean)])];if(0!==e.length){V(!0),U("");try{const t=e.map(e=>({id:e})),s={route:c.trim(),profile:{displayName:y.trim()||c.trim(),api:x,baseURL:S.trim(),models:t},...C.trim()?{key:C.trim()}:{}},n=await a("models3-create-preview",s);if(!n.ok)return void U(n.error);const o=await a("models3-create-commit",{planId:n.value.planId});o.ok?r(c.trim()):U(o.error)}catch(e){U("operation-failed")}finally{V(!1)}}else U("noModelsSelected")}},n("models.smart.save")),l(W,{error:"noModelsSelected"===F?n("models.smart.noModelsSelected"):F}))}function Y(){const e=t(),[r,s]=i(null),[n,o]=i(""),[c,u]=i(null),[p,g]=i(!1),[f,b]=i(null),y=async()=>{const e=await a("models3-snapshot",{});e.ok?(s(e.value),o("")):o(e.error)};if(d(()=>{let e=!0;return a("models3-snapshot",{}).then(t=>{e&&(t.ok?(s(t.value),o("")):o(t.error))}),()=>{e=!1}},[]),p)return l(G,{onBack:()=>g(!1),onCreated:e=>{g(!1),u({route:e,displayName:e}),y()},templates:r?.templates??[]});const w=r?.routes??[],x=c?w.find(e=>e.route===c.route)??c:null;return l("section",{style:{minWidth:0},"data-testid":"model-providers"},l("style",null,"\n .dsh-model-workspace { display:flex; flex-direction:column; gap:16px; min-width:0; }\n .dsh-model-provider-card { min-width:0; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; background:var(--dsw-alias-bg-layer-3); margin-bottom:8px; }\n .dsh-model-content { min-width:0; padding:20px; border-top:1px solid var(--dsw-alias-border-l2); }\n .dsh-model-provider:hover { background:var(--dsw-alias-interactive-bg-hover)!important; }\n .dsh-model-provider:focus-visible { outline:2px solid var(--dsw-focus-ring-color); outline-offset:2px; }\n .dsh-model-row-name { font-size:13px; overflow-wrap:anywhere; }\n .dsh-model-row-capabilities { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }\n @media(max-width:640px) {\n .dsh-model-content { padding:16px 12px; }\n .dsh-model-row-copy { container-type:inline-size; }\n .dsh-model-row-name { width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; font-size:clamp(10px, calc(160cqw / var(--model-name-length)), 13px); }\n .dsh-model-row-capabilities { flex-basis:100%; }\n }\n "),l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"14px",flexWrap:"wrap"}},l("div",{style:{minWidth:0}},l("h3",{style:{margin:0,fontSize:"24px",fontWeight:700}},e("models.smart.homeTitle"))),l("div",{style:v},l(L,{id:"model-routes-refresh","aria-label":e("models.smart.refreshProviders"),title:e("models.smart.refreshProviders"),onClick:()=>{H()&&y()}},"↻"),l(L,{id:"model-route-create",style:me("primary"),onClick:()=>{H()&&g(!0)}},"+ "+e("models.smart.createRoute")))),l(W,{error:n}),null!==r||n?null:l("p",{style:h},e("models.smart.loading")),0!==w.length||null===r||n?null:l("p",{style:{...h,padding:"16px 0",textAlign:"center"},"data-testid":"models-empty-notice"},e("models.smart.noProviders")),w.length?l("div",{className:"dsh-model-workspace","data-testid":"model-workspace"},l("div",{"aria-label":e("models.smart.providers"),"data-testid":"model-provider-list"},...["builtin","custom"].map(t=>{const a=w.filter(e=>("builtin"===e.source?"builtin":"custom")===t);return a.length?l("section",{key:t,style:{marginBottom:"18px"}},l("h4",{style:{...h,margin:"4px 10px 12px",fontWeight:600}},e("builtin"===t?"models.smart.builtin":"models.smart.customProviders")),...a.map(t=>l("div",{key:t.route,className:"dsh-model-provider-card"},l("button",{type:"button",className:"dsh-model-provider","data-testid":"model-route-open-"+t.route,"aria-expanded":x?.route===t.route,onClick:()=>(e=>{H()&&u(e.route===x?.route?null:e)})(t),style:{display:"flex",width:"100%",minWidth:0,alignItems:"center",gap:"10px",padding:"14px 16px",borderRadius:"11px",cursor:"pointer",font:"inherit",textAlign:"left",color:"var(--dsw-alias-label-primary)",border:0,background:"transparent"}},l(U,{row:t}),l("span",{style:{flex:1,minWidth:0,overflowWrap:"anywhere",fontSize:"14px",fontWeight:600}},t.displayName),l("span",{title:e(t.configured?"models.smart.configSaved":"models.smart.configInherited"),"aria-label":e(t.configured?"models.smart.configSaved":"models.smart.configInherited"),style:{width:"7px",height:"7px",borderRadius:"50%",flexShrink:0,background:!1!==t.enabled&&t.configured?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-state-idle-primary)"}}),l("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0,style:{flexShrink:0,transition:"transform 150ms",transform:x?.route===t.route?"rotate(180deg)":"none"}},l("path",{d:"m6 9 6 6 6-6"}))),x?.route===t.route?l("div",{className:"dsh-model-content","data-testid":"model-provider-content"},l(K,{key:t.route,row:x,reload:()=>{y()},onModelsChanged:e=>{u(e),y()},onBack:()=>{u(null),y()}})):null))):null}))):null,(r?.removedRoutes??[]).length?l("section",{"data-testid":"model-removed-routes",style:{marginTop:"16px",borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:"12px"}},l("h4",{style:{margin:"0 0 8px 0",fontSize:"13px"}},e("models.smart.deleted")),...r.removedRoutes.map(e=>l(L,{key:e.route,id:"model-removed-"+e.route,disabled:e.taken,style:{marginRight:"6px"},onClick:async()=>{const t=await a("models3-restore-preview",{route:e.route});t.ok?b(t.value):o(t.error)}},e.displayName))):null,f?l("section",{style:{...m,marginTop:"12px"}},l("h4",{style:{margin:"0 0 6px 0",fontSize:"13px"}},e("models.smart.consequences")),l("p",{style:{...h,overflowWrap:"anywhere"}},f.restore?.route||""),l("p",{style:h},e("models.smart.credentialRetained")),l("div",{style:v},l(L,{id:"model-restore-confirm",style:me("primary"),onClick:async()=>{const e=await a("models3-restore-commit",{planId:f.planId});e.ok?(b(null),y()):o(e.error)}},e("models.smart.confirm")),l(L,{onClick:()=>b(null)},e("models.smart.cancel")))):null)}return{ModelsSection:function({SubagentSection:e}){const a=t(),{value:r}=n(),[d,c]=o?o.useEnabled():[!1,()=>{}],[u,p]=i("providers"),m=[...!1!==r.modelCatalog?[{id:"providers",label:a("tabs.providers")}]:[],...!1!==r.subagentRoute?[{id:"subagent",label:a("tabs.subagentRoute")}]:[]],g=m.some(e=>e.id===u)?u:m[0]?.id,h=o?l("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginBottom:"4px"}},l("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},a("models.navToggleHint")),l("button",{type:"button",role:"switch","data-testid":"models-nav-switch","aria-checked":String(d),"aria-label":a("models.navToggle"),title:a("models.navToggle"),onClick:()=>c(!d),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(d?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:d?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:"pointer",lineHeight:0}},l("span",{style:{position:"absolute",top:"1px",left:d?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:d?"#fff":"var(--dsw-alias-label-tertiary)"}}))):null;return l("div",{"data-testid":"models-page","data-dshsvc-root":""},h,m.length>1?l(s,{items:m,activeId:g,onChange:e=>{H()&&p(e)},testIdPrefix:"models-tab",variant:"sub",ariaLabel:a("tabs.models")}):null,"providers"===g?l(Y,null):"subagent"===g?l(e,null):null)},canLeave:H,ModelDetail:F,RouteDetail:K,parseDraft:R,capacity:S,formatCapacity:E}}({useTranslation:J,rpcCall:d,SvcTabs:Ie,useFeatures:v,modelsNavToggle:Pe});function Da(){const e=J(),{value:s}=v(),[n,i]=a(null),[c,u]=a(null),[g,h]=a(null),[f,y]=a(!1),[w,x]=a(0),[k,S]=a(null),[E,C]=a(null),[T,q]=a(null),[A,z]=a(null),[M,I]=a(!1),[O,H]=a(!1),[D,L]=a(null),[N,W]=a(!1),[B,P]=a(!1),[j,$]=a(null),[V,F]=a(!1),[U,K]=a({items:[],totalBytes:0}),[G,Y]=a(!1),[Q,Z]=a(null),X=l(0),[ae,re]=a(null),[se,ne]=a(null),[oe,le]=a(null),[ie,de]=a(null),[ce,ue]=a(null),[he,ve]=a(null),[ye,we]=a({}),[xe,ke]=a(!1),[Se,Ee]=a(!1),[Ce,Re]=a(!1),[He,De]=a(!1),[Le,Ne]=a(null),[We,Be]=a(null),[Pe,je]=a(null),[$e,_e]=a(null),[Ve,at]=a(null),[rt,st]=a(!1),[lt,it]=a(null),[dt,ct]=a(!1),[ut,pt]=a(null),[mt,gt]=a(!1),[ht,ft]=a(null),[bt,vt]=a(!1),[yt,wt]=a(!1),[xt,kt]=a(null),[St,Et]=a(null),[Ct,Tt]=a("day"),[qt,At]=a("all"),zt=l(null),Mt=l(null),It=l(!1),[Rt,Ot]=a(!1),[Ht,Dt]=a(!1),[Lt,Nt]=a(!1),[Wt,Bt]=a("today"),[Pt,jt]=a("overview"),$t=l({}),_t=l(!1),Vt=l(!1),[Ft,Ut]=a({kind:null,variant:null,phase:"idle",value:null,error:null}),Kt=l(0),Gt=l(null),Yt=Je(),Zt=Ze(),Xt=Qe(),ea={timezoneOffsetMinutes:(new Date).getTimezoneOffset()};o(()=>{R()},[]),o(()=>{Ke().then(e=>{e&&e.ok&&(Ne(e.value.current),Be(e.value.pluginVersion||null))})},[]);const ta=t=>{t&&!1!==t.ok?(je(t.value),_e(null)):_e(e("update.unavailable"))};o(()=>{let t=!0;return d("check-update",{}).then(e=>{t&&ta(e)}).catch(()=>{t&&_e(e("update.unavailable"))}),()=>{t=!1}},[]);const ra=(e,t)=>`${e}@${t}`,sa=async(e,t)=>{const a=Kt.current+=1,r=()=>Kt.current!==a;Ut({kind:e,variant:t,phase:"loading",value:null,error:null});let s=null;try{s=await d("latest"===t?"release-notes-latest":"release-notes",{kind:e})}catch(e){s=null}if(s&&!1!==s.ok&&s.value){if($t.current[ra(e,t)]=s.value,r())return;return void Ut({kind:e,variant:t,phase:"ready",value:s.value,error:null})}if(r())return;if("unknown-endpoint"===s?.error)return"latest"===t?Vt.current=!0:_t.current=!0,void Ut({kind:null,variant:null,phase:"idle",value:null,error:null});const n=(o=s?.error,"release-not-found"===o?"release-not-found":"release-unavailable");var o;Ut({kind:e,variant:t,phase:"release-not-found"===n?"pending":"error",value:null,error:n})},na=()=>{Kt.current+=1,Ut({kind:null,variant:null,phase:"idle",value:null,error:null})},oa=async(e,t)=>{if(!0===_t.current)return;const a=Ft.kind===e&&Ft.variant===t?Ft:null;if(null!==a&&("ready"===a.phase||"loading"===a.phase))return void na();const r=$t.current[ra(e,t)];if(void 0!==r)return Kt.current+=1,void Ut({kind:e,variant:t,phase:"ready",value:r,error:null});await sa(e,t)},la=null!==Ft.kind&&"idle"!==Ft.phase;o(()=>{if(!la||"undefined"==typeof document)return;const e=e=>{const t=e?.target;if(null!=t&&"function"==typeof t.closest)try{if(null!==t.closest('[data-testid="version-card"]'))return}catch(e){}const a=Gt.current;if(null!=a&&"function"==typeof a.contains)try{if(a.contains(t))return}catch(e){}na()},t=e=>{"Escape"===e?.key&&na()};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[la]),o(()=>{if(!b("healthDiagnostics"))return()=>{};let t=!0;return d("permissions-plan",{}).then(a=>{t&&(a&&!1!==a.ok?z(a.value):L(e("permissions.error")))}).catch(()=>{t&&L(e("permissions.error"))}),()=>{t=!1}},[s.healthDiagnostics]),o(()=>{try{pt(localStorage.getItem(Ra))}catch(e){pt(null)}},[]),o(()=>{if(!b("modelUsage"))return()=>{};let t=!0;const a=async a=>{if(!It.current){It.current=!0,st(!0);try{const r=await d("usage",ea);if(!t)return;if(!r||!1===r.ok)return void(a&&it(e("usage.error")));it(null),ct(!1),at(r.value);const s=await d("usage-refresh",ea).catch(()=>null);if(!t)return;s&&s.ok&&(it(null),ct(!1),at(s.value))}catch(r){t&&a&&it(e("usage.error"))}finally{It.current=!1,t&&st(!1)}}};return Mt.current=a,a(!0),()=>{t=!1,Mt.current=null}},[s.modelUsage]),o(()=>{if(!b("modelUsage"))return()=>{};if("usage"!==Pt)return()=>{};let e=!0,a=null;const r=()=>{if(!e)return;const t=Mt.current;if(null!=t)try{t(!1)}catch(e){}},s=()=>{if(!e)return;const n=new Date(Date.now()),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1,0,0,1,0),l=Math.max(1e3,o.getTime()-n.getTime());a=t.timer.timeout(()=>{e&&(r(),s())},l)};s();const n=()=>{if(!e)return;let t=!1;try{t="undefined"!=typeof document&&"hidden"===document.visibilityState}catch(e){}t||r()};return"undefined"!=typeof document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",n),r(),()=>{e=!1,null!=a&&a(),"undefined"!=typeof document&&"function"==typeof document.removeEventListener&&document.removeEventListener("visibilitychange",n)}},[s.modelUsage,Pt]),o(()=>{if(!b("backupMaintenance"))return()=>{};let t=!0;return d("backup-list",{}).then(a=>{t&&(a&&!1!==a.ok?K(a.value):re(e("backup.error")))}).catch(()=>{t&&re(e("backup.error"))}),()=>{t=!1}},[s.backupMaintenance]),o(()=>{let a=!0,r=()=>{};const s=async()=>{try{const e=await d("health",{});if(!a)return;if(!e||!1===e.ok)throw new Error(e&&e.error?e.error:"health failed");i(e.value),u(null)}catch(t){if(!a)return;u(e("health.error"))}a&&(r=t.timer.timeout(s,5e3))};return s(),()=>{a=!1,r()}},[]);const ia=async(t=!1)=>{if(b("healthDiagnostics")&&!(!t&&w>0&&Date.now()-w<=3e4)){y(!0);try{const e=await d("diagnostics",{});if(!e||!1===e.ok)throw new Error("diagnostics failed");h(e.value),x(Date.now())}catch(t){u(e("health.error"))}finally{y(!1)}}},da=async()=>{if(!It.current){It.current=!0,st(!0),it(null);try{const e=await d("usage-refresh",ea);if(!e||!1===e.ok)throw new Error("usage refresh failed");at(e.value)}catch(t){it(e("usage.error"))}finally{It.current=!1,st(!1)}}},ca=t=>{const a="backup.error."+String(t||""),r=e(a);return r===a?e("backup.restoreError"):r},ua=async(e,t)=>{Y(!0),re(null),ke(!1),void 0===t&&(de(null),ue(null),le(e),ve(null),we({}));try{const a=await d("backup-inspect",{id:e});if(!a||!1===a.ok)throw Object.assign(new Error("backup inspect failed"),{code:a?.error});if(void 0===t&&de(a.value),!0!==a.value.validForRestore)return;const r=await d("backup-restore-prepare",void 0===t?{id:e}:{id:e,profiles:t});if(!r||!1===r.ok)throw Object.assign(new Error("backup prepare failed"),{code:r?.error});if(ue(r.value),void 0===t){const e=r.value?.targets?.profiles?.mapping??[],t={};for(const a of e)t[a.source]={target:a.target,manifest:!0===a.manifest};if(we(t),e.length>0){const e=await d("backup-target-profiles",{});e&&!1!==e.ok&&ve(e.value)}}}catch(e){re(ca(e?.code))}finally{Y(!1)}},pa=async()=>{if(ce&&!G){Y(!0),re(null);try{const e=await d("backup-restore-commit",{planId:ce.planId});if(!e||!1===e.ok)throw Object.assign(new Error("backup restore failed"),{code:e?.error});if(le(null),de(null),ue(null),!0===e.value?.restart?.requiresManualRestart)ke(!0);else{const t=e.value?.restart?.previousInstanceId||e.value?.previousInstanceId;"string"==typeof t&&t.length>0&&Ye(t).catch(()=>{})}}catch(e){ue(null),re(ca(e?.code))}finally{Y(!1)}}},ma=()=>{G||(le(null),de(null),ue(null),ve(null),we({}))},ga={"active-work":"update.guardActiveWork","link-install":"update.guardLinkInstall","file-install":"update.guardFileInstall","no-newer-version":"update.guardNoNewer","no-profile-found":"update.guardNoProfile","ambiguous-profile":"update.guardAmbiguous","upgrade-stale":"update.guardStale","installed-version-unreadable":"update.guardUnreadable","pnpm-missing":"update.failPnpmMissing","transient-network":"update.failNetwork","fetch-timeout":"update.failFetchTimeout","release-age-violation":"update.failReleaseAge","hoist-pattern-diff":"update.failHoist","adding-to-root":"update.failAddingToRoot","not-a-workspace":"update.failNotWorkspace","ignored-builds":"update.failIgnoredBuilds","desktop-managed-upgrade":"update.desktopManagedUpgrade"},ha=async()=>{if(!Xe()){et(!0);try{let t=Zt;if(null===t&&(await Ke(),t=tt()),!bt&&null!==t&&!0===t.manualStartLikely)return ft(null),void vt(!0);vt(!1),gt(!0),ft(null);const a=await Ke(),r=a&&a.ok?a.value.instanceId:void 0,s=await d("upgrade",{});if(!s||!1===s.ok){const t=s&&"string"==typeof s.error?s.error.trim():"",a="string"==typeof t&&t.length>0?ga[t]:void 0;return void ft(void 0!==a?e(a):e("update.upgradeErrorDetail",{detail:t||"upgrade failed"}))}s.value&&!0===s.value.requiresManualRestart?wt(!0):"string"==typeof r&&r.length>0&&Ye(r).catch(()=>{}),Ge().catch(()=>{}),(async()=>{const e=await d("check-update",{}).catch(()=>null);e&&ta(e)})().catch(()=>{})}catch(t){const a=t instanceof Error&&"string"==typeof t.message&&"upgrade failed"!==t.message?t.message.trim():"";console.error("dsh-service: upgrade failed",a||t),ft(a?e("update.upgradeErrorDetail",{detail:a}):e("update.upgradeError"))}finally{et(!1),gt(!1)}}},ba=me(),va=(me("primary"),me("brandGhost")),wa=me("neutral"),xa=me("danger"),ka=me("dangerGhost"),Sa=me("ghost"),Ea=Object.assign({},ba,{background:"transparent",color:"var(--dsw-alias-label-primary)",border:0,borderTop:"1px solid var(--dsw-alias-border-l1)",borderRadius:0,padding:"10px 2px",width:"100%",textAlign:"left",fontWeight:600}),Ca={display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",flexWrap:"wrap"},Ta={color:"var(--dsw-alias-label-secondary)",fontSize:"12px",marginTop:"8px",lineHeight:1.5},qa=be(),Da=fe(),La={background:"transparent",color:"var(--dsw-alias-label-secondary)",border:0,borderBottom:"2px solid transparent",padding:"8px 10px",cursor:"pointer",fontSize:"13px",fontWeight:550,transition:"color 120ms, border-color 120ms"},Na={color:"var(--dsw-alias-brand-primary)",borderBottom:"2px solid var(--dsw-alias-brand-primary)",fontWeight:700},Wa=Object.assign({},La,{padding:"3px 6px",fontSize:"11px"}),Ba={fontSize:"14px",fontWeight:700,margin:"0 0 8px",color:"var(--dsw-alias-label-primary)"},Pa=e=>{const t=Number(e);return t<1024?t+" B":t<1048576?Math.round(t/102.4)/10+" KB":t<1073741824?Math.round(t/1048576*10)/10+" MB":Math.round(t/1073741824*10)/10+" GB"},ja=(t,a)=>r.createElement("div",{key:t,style:{padding:"8px 10px",borderRadius:"6px",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginBottom:"2px"}},e(t)),r.createElement("div",{style:{fontSize:"14px",fontWeight:600}},a)),$a=e=>{const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},_a=[];for(let e=6;e>=0;e-=1){const t=new Date;t.setHours(0,0,0,0),t.setDate(t.getDate()-e),_a.push({key:$a(t),label:`${t.getMonth()+1}/${t.getDate()}`})}const Va=[["inputTokens","usage.input","#79aaf7"],["outputTokens","usage.output","#f1b35b"],["cacheTokens","usage.cache","#48c7b0"]],Fa=e=>{const t=Ve&&Ve.days?Ve.days[e]:null;if(!t)return{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,cacheHitRate:0};if("all"===qt)return t.totals;const a=t.projects.find(e=>e.id===qt);return a?a.totals:{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,cacheHitRate:0}},Ua=e=>{const t=Number(e.inputTokens||0)+Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0);return 0===t?0:Number(e.cacheReadTokens||0)/t},Ka=e=>Number(e.inputTokens||0)+Number(e.outputTokens||0)+Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0),Ga=(e,t)=>"cacheTokens"===t?e.cacheReadTokens+e.cacheWriteTokens:e[t]||0,Ya=e=>m(e,{invalid:"0"}),Qa=(t,a)=>"cacheHitRate"===a?(100*Number(t)).toFixed(1)+"%":"steps"===a?e("usage.stepsValue",{count:Number(t).toLocaleString()}):Ya(t),Ja=_a.map(e=>Fa(e.key)),Za=Ja.map(e=>Va.reduce((t,[a])=>t+Ga(e,a),0)),Xa=Math.max(1,...Za),er=[Xa,.75*Xa,.5*Xa,.25*Xa,0],tr=Fa(_a[6].key),ar=_a.reduce((e,t)=>{const a=Fa(t.key);return e.steps+=a.steps||0,e.inputTokens+=a.inputTokens||0,e.outputTokens+=a.outputTokens||0,e.cacheReadTokens+=a.cacheReadTokens||0,e.cacheWriteTokens+=a.cacheWriteTokens||0,e},{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0}),rr=ar.inputTokens+ar.cacheReadTokens+ar.cacheWriteTokens;ar.cacheHitRate=0===rr?0:ar.cacheReadTokens/rr;const sr="zh"===p()?"zh-CN":"en-US",nr=e=>{const[t,a,r]=e.split("-").map(Number);return new Date(t,a-1,r)},or=e=>e.toLocaleDateString(sr,{month:"short",day:"numeric"}),lr=e=>e.toLocaleDateString(sr,{month:"short"}),ir=`${Ve?.updatedAt||0}:${qt}:${sr}:${$a(new Date)}`;if(!zt.current||zt.current.key!==ir){const e=Object.keys(Ve?.days||{}).filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(nr(e).getTime())),t=new Map;for(const a of e){const e=Fa(a);t.set(a,{total:Va.reduce((t,[a])=>t+Ga(e,a),0),steps:Number(e.steps||0)})}const a=[],r=new Date;if(r.setHours(0,0,0,0),e.length>0){const t=e.map(nr).reduce((e,t)=>t<e?t:e),s=new Date(r);s.setDate(s.getDate()-(s.getDay()+6)%7);const n=new Date(s);n.setDate(n.getDate()-133);const o=new Date(t);o.setDate(o.getDate()-(o.getDay()+6)%7);for(const e=new Date(o<n?n:o);e<=r;e.setDate(e.getDate()+1))a.push(new Date(e))}const s=a.reduce((e,a)=>Math.max(e,t.get($a(a))?.total||0),0),n=[];for(let e=0;e<a.length;e+=7){const t=a.slice(e,e+7),r=t[0],s=0===e?null:a[e-7];n.push({key:$a(r),monthLabel:null!==s&&s.getMonth()===r.getMonth()?"":lr(r),days:t})}const o=new Date(2024,0,1),l=[0,1,2,3,4,5,6].map(e=>{const t=new Date(o);return t.setDate(t.getDate()+e),t.toLocaleDateString(sr,{weekday:"short"})}),i="all"===qt?(Ve?.projects||[]).map(e=>e.id):[qt],d=e=>("all"===qt?e.totals:(e.projects||[]).find(e=>e.id===qt)?.totals)||{steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0},c=Array.isArray(Ve?.hours)?Ve.hours:[],u=new Map;for(const e of c){const t=Number(e?.weekday),a=Number(e?.hour);if(!Number.isInteger(t)||!Number.isInteger(a)||t<0||t>6||a<0||a>23)continue;const r=d(e);u.set(`${t}-${a}`,{total:Va.reduce((e,[t])=>e+Ga(r,t),0),steps:Number(r.steps||0)})}const p=[...u.values()].reduce((e,t)=>Math.max(e,t.total),0),m=e=>e<=0||s<=0?0:e<=.25*s?1:e<=.5*s?2:e<=.75*s?3:4,g=e=>e<=0||p<=0?0:e<=.25*p?1:e<=.5*p?2:e<=.75*p?3:4,h=e=>({id:e,steps:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0}),f=(e,t)=>{const a=e.get(t.id)||h(t.id);a.steps+=t.totals.steps||0,a.inputTokens+=t.totals.inputTokens||0,a.outputTokens+=t.totals.outputTokens||0,a.cacheReadTokens+=t.totals.cacheReadTokens||0,a.cacheWriteTokens+=t.totals.cacheWriteTokens||0,e.set(t.id,a)},b=new Map,v=new Map,y=new Map,w=new Set(_a.map(e=>e.key)),x=_a[_a.length-1].key;for(const[e,t]of Object.entries(Ve?.days||{})){const a=[y];w.has(e)&&a.push(v),e===x&&a.push(b);for(const e of t.projects)if(i.includes(e.id))for(const t of e.models)for(const e of a)f(e,t)}zt.current={key:ir,heatTotalsByDay:t,heatDays:a,heatMax:s,heatColumns:n,heatWeekdays:l,heatLevel:m,punchBuckets:c,punchBySlot:u,punchMax:p,punchLevel:g,modelTodayTotals:b,modelWeekTotals:v,modelAllTotals:y}}const dr=e=>e<=0?1:[1,.25,.45,.7,1][e],{heatTotalsByDay:cr,heatDays:ur,heatMax:pr,heatColumns:mr,heatWeekdays:gr,heatLevel:hr,punchBuckets:fr,punchBySlot:br,punchMax:vr,punchLevel:yr,modelTodayTotals:wr,modelWeekTotals:xr,modelAllTotals:kr}=zt.current,Sr=t=>{const a=String(t.detail??"");if("usage-index"===t.id){if("never"===a)return e("health.detail.usage-index.never");if("unavailable"===a)return e("health.detail.usage-index.unavailable");const[r="0",s="0",n="0"]=a.split(":"),o=Number(n),l={failed:r,indexed:s,updated:o>0?`${ot(o)} ${nt(o)}`:"—"};return e(Number(r)>0?"warning"===t.status?"health.detail.usage-index.warning":"health.detail.usage-index.info":"health.detail.usage-index.ok",l)}if("session-storage"===t.id&&"ok"===t.status)return e("health.detail.session-storage.ok",{count:a});if("workspace-registry"===t.id&&"ok"===t.status)return e("health.detail.workspace-registry.ok",{count:a});if("dsh-home"===t.id&&"ok"===t.status)return e("health.detail.dsh-home.ok",{mode:a});if("backup-storage"===t.id){const[t="0",r="0"]=a.split(":");return 0===Number(t)?e("health.detail.backup-storage.empty"):e("health.detail.backup-storage.ok",{count:t,size:Pa(r)})}if("tar"===t.id&&"ok"===t.status)return e("health.detail.tar.ok");if("permissions"===t.id)return e("ok"===t.status?"health.detail.permissions.ok":"health.detail.permissions.warning",{count:a||"0"});if("runtime-env"===t.id)return"desktop"===a?e("health.detail.runtime-env.desktop"):"manual"===a?e("health.detail.runtime-env.manual"):"declared"===a?e("health.detail.runtime-env.declared"):"unknown"===a?e("health.detail.runtime-env.unknown"):e("health.detail.runtime-env.managed",{kind:e(`env.kind.${a}`)});if("node-version"===t.id){const[r="",s=""]=a.split(":");return e("ok"===t.status?"health.detail.node-version.ok":"health.detail.node-version.warning",{version:r,required:s})}if("plugins"===t.id){if("unavailable"===a)return e("health.detail.plugins.unavailable");const[r,s,n,o]=a.split(":");if("ok"===t.status)return e("health.detail.plugins.ok",{total:r});const l=[];return(Number(s)||0)>0&&l.push(e("plugin.issue.failed",{failed:s})),(Number(n)||0)>0&&l.push(e("plugin.issue.pending",{pending:n})),(Number(o)||0)>0&&l.push(e("plugin.issue.info",{count:o})),l.join(",")}return e("health.detail.generic",{status:e(`health.status.${t.status}`)})},Er=(t,a,s)=>r.createElement("div",{style:{padding:"10px",borderRadius:"7px",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700,marginBottom:"5px"}},e(a)),(e=>[["usage.total",Ya(Ga(e,"inputTokens")+Ga(e,"outputTokens")+Ga(e,"cacheTokens"))],...Va.map(([t,a])=>[a,Ya(Ga(e,t))]),["usage.steps",Qa(e.steps,"steps")],["usage.hitRate",Qa(e.cacheHitRate,"cacheHitRate")]])(s).map(([a,s],n)=>r.createElement("div",{key:a,"data-testid":`usage-summary-${t}-${n}`,style:{display:"flex",justifyContent:"space-between",gap:"12px",padding:"4px 0",fontSize:"12px",borderTop:0===n?0:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("span",{style:{color:"var(--dsw-alias-label-secondary)"}},e(a)),r.createElement("span",{style:{fontWeight:650}},s)))),Cr=[...("today"===Wt?wr:"all"===Wt?kr:xr).values()].sort((e,t)=>Ka(t)-Ka(e)||t.steps-e.steps||e.id.localeCompare(t.id)),Tr=Lt?Cr:Cr.slice(0,3),qr=Math.max(0,Cr.length-3),Ar=Math.max(1,...Tr.map(e=>Ka(e))),zr=e=>(e||[]).filter(e=>"all"===qt||e.projectId===qt).sort((e,t)=>t.count-e.count||e.key.localeCompare(t.key)),Mr=zr(Ve?.errors?.models),Ir=zr(Ve?.errors?.tools),Rr=Array.isArray(Ve?.failedSessions)?Ve.failedSessions:[],Or=Number.isFinite(Number(Ve?.successfulSessions))?Number(Ve.successfulSessions):Math.max(0,Number(Ve?.indexedSessions||0)-Rr.filter(e=>e&&!0===e.stale).length),Hr=Rr.map(e=>`${e&&"string"==typeof e.id?e.id:""}\0${e&&"string"==typeof e.code?e.code:""}`).sort().join(""),Dr=0===Rr.length||ut===Hr?null:r.createElement("div",{"data-testid":"usage-failure-warning",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsh-svc-warning)",background:"var(--dsh-svc-raised-bg)",color:"var(--dsh-svc-text)"}},r.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px"}},r.createElement("div",{style:{flex:"1 1 auto",minWidth:0}},r.createElement("div",{style:{fontSize:"12px",lineHeight:1.5,fontWeight:650}},e("usage.failures.global",{successful:Or.toLocaleString(),failed:Rr.length.toLocaleString()})),Rr.some(e=>e&&!0===e.stale)?r.createElement("div",{style:{marginTop:"4px",fontSize:"11px",lineHeight:1.5,color:"var(--dsh-svc-text-muted)"}},e("usage.failures.staleHint")):null),r.createElement("button",{type:"button","data-testid":"usage-failure-dismiss","aria-label":e("usage.failures.dismiss"),title:e("usage.failures.dismiss"),style:{flex:"none",background:"transparent",border:0,padding:"0 2px",cursor:"pointer",color:"var(--dsh-svc-text-muted)",fontSize:"16px",lineHeight:1},onClick:()=>{pt(Hr);try{localStorage.setItem(Ra,Hr)}catch(e){}}},"×")),r.createElement("button",{type:"button","data-testid":"usage-failure-details-toggle","aria-expanded":String(dt),style:Object.assign({},Ea,{marginTop:"5px",padding:0}),onClick:()=>ct(e=>!e)},`${dt?"▾":"▸"} ${e(dt?"usage.failures.hide":"usage.failures.show")}`),dt?r.createElement("div",{"data-testid":"usage-failure-details",style:{display:"grid",gap:"6px",marginTop:"8px"}},Rr.map((t,a)=>{const s=t&&"object"==typeof t?t:{};return r.createElement("div",{key:`${String(s.id||"unknown")}:${a}`,style:{padding:"7px 9px",borderRadius:"6px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-card-bg)",fontSize:"11px",lineHeight:1.5}},r.createElement("div",{style:{overflowWrap:"anywhere"}},`${e("usage.failures.id")}: ${"string"==typeof s.id&&""!==s.id?s.id:"—"}`),r.createElement("div",{style:{overflowWrap:"anywhere"}},`${e("usage.failures.code")}: ${"string"==typeof s.code&&""!==s.code?s.code:"—"}`),r.createElement("div",{style:{overflowWrap:"anywhere",color:"var(--dsh-svc-text-muted)"}},`${e("usage.failures.message")}: ${["format-migration-failed","session-read-failed","session-fold-failed"].includes(s.code)?e(`usage.failures.reason.${s.code}`):"string"==typeof s.message&&""!==s.message?s.message:"—"}`),r.createElement("div",{style:{marginTop:"2px",color:"var(--dsh-svc-warning)"}},e(!0===s.stale?"usage.failures.stale":"usage.failures.notStale")))})):null),Lr=(t,a)=>r.createElement("div",{key:t,style:{display:"grid",gap:"6px",marginTop:"8px"}},0===a.length?r.createElement("p",{style:Ta},e("model"===t?"usage.errors.empty":"usage.toolErrors.empty")):a.map(a=>r.createElement("div",{key:`${t}:${a.projectId}:${a.key}`,style:{padding:"8px 10px",borderRadius:"6px",background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-state-error-primary)",color:"var(--dsw-alias-label-primary)",fontSize:"12px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",fontWeight:600}},r.createElement("span",null,"model"===t?`${a.provider}/${a.model} · ${a.code}${null===a.status?"":` · ${a.status}`}`:`${a.tool} · ${a.code}`),r.createElement("span",null,e("usage.errors.count",{count:a.count}))),r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",marginTop:"3px",overflowWrap:"anywhere"}},a.message)))),Nr=r.createElement("div",{"data-testid":"usage-heatmap-scope-tabs",style:{display:"flex",gap:"2px"}},["day","hour"].map(t=>r.createElement("button",{key:t,type:"button","data-testid":`usage-heatmap-scope-${t}`,style:Object.assign({},Wa,Ct===t?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>Tt(t)},e(`usage.heatmap.scope.${t}`)))),Wr=r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",overflowX:"auto",paddingBottom:"2px"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none",paddingTop:"19px"}},gr.map((e,t)=>r.createElement("div",{key:t,style:{height:"16px",fontSize:"11px",lineHeight:"16px",color:"var(--dsw-alias-label-secondary)"}},e))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0,flex:"none"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",gap:"4px",height:"15px"}},Array.from({length:24},(e,t)=>r.createElement("div",{key:`hour-${t}`,style:{width:"16px",flex:"none",fontSize:"10px",lineHeight:"15px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},(e=>e%3==0?String(e).padStart(2,"0"):"")(t)))),r.createElement("div",{"data-testid":"usage-punch-grid",role:"img","aria-label":e("usage.heatmap.hourGridLabel"),style:{display:"flex",flexDirection:"column",gap:"4px"}},[0,1,2,3,4,5,6].map(t=>r.createElement("div",{key:t,style:{display:"flex",gap:"4px"}},Array.from({length:24},(a,s)=>r.createElement("div",((t,a)=>{const r=br.get(`${t}-${a}`)||{total:0,steps:0},s=yr(r.total),n=e("usage.heatmap.hourCell",{weekday:gr[t],hour:String(a).padStart(2,"0"),total:Ya(r.total),steps:Number(r.steps||0).toLocaleString()});return{key:`${t}-${a}`,"data-testid":`usage-punch-cell-${t}-${a}`,"data-value":r.total,"data-level":s,"aria-label":n,onMouseEnter:e=>Et({id:`punch-${t}-${a}`,label:n,x:e.clientX,y:e.clientY}),onMouseMove:e=>Et(r=>r&&r.id===`punch-${t}-${a}`?r.x===e.clientX&&r.y===e.clientY?r:Object.assign({},r,{x:e.clientX,y:e.clientY}):r),onMouseLeave:()=>Et(null),style:{width:"16px",height:"16px",borderRadius:"3px",flex:"none",cursor:r.total>0?"pointer":"default",background:r.total>0?"var(--dsh-svc-success)":"var(--dsw-alias-border-l1)",opacity:dr(s)}}})(t,s)))))))),Br=0===ur.length&&0===fr.length?null:r.createElement("div",{key:"usage-heatmap","data-testid":"usage-heatmap",style:{marginTop:"10px",padding:"8px 10px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"10px",flexWrap:"wrap",marginBottom:"8px"}},r.createElement("div",{"data-testid":"usage-heatmap-title",style:{fontSize:"12px",fontWeight:650}},e("hour"===Ct?"usage.heatmap.hourTitle":"usage.heatmap.title")),Nr),"hour"===Ct?Wr:r.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",overflowX:"auto",paddingBottom:"2px"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none",paddingTop:"19px"}},gr.map((e,t)=>r.createElement("div",{key:t,style:{height:"20px",fontSize:"11px",lineHeight:"20px",color:"var(--dsw-alias-label-secondary)"}},t%2==0?e:""))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0,flex:"none"}},r.createElement("div",{"aria-hidden":"true",style:{display:"flex",gap:"4px",height:"15px"}},mr.map(e=>r.createElement("div",{key:`month-${e.key}`,style:{width:"20px",flex:"none",fontSize:"11px",lineHeight:"15px",color:"var(--dsw-alias-label-secondary)",whiteSpace:"nowrap"}},e.monthLabel))),r.createElement("div",{"data-testid":"usage-heatmap-grid",role:"img","aria-label":e("usage.heatmap.gridLabel"),style:{display:"flex",gap:"4px"}},mr.map(t=>r.createElement("div",{key:t.key,style:{display:"flex",flexDirection:"column",gap:"4px",flex:"none"}},t.days.map(t=>r.createElement("div",(t=>{const a=cr.get($a(t))||{total:0,steps:0},r=hr(a.total),s=e("usage.heatmap.cell",{date:or(t),total:Ya(a.total),steps:Number(a.steps||0).toLocaleString()});return{key:$a(t),"data-testid":`usage-heatmap-cell-${$a(t)}`,"data-value":a.total,"data-level":r,"aria-label":s,onMouseEnter:e=>Et({id:$a(t),label:s,x:e.clientX,y:e.clientY}),onMouseMove:e=>Et(a=>a&&a.id===$a(t)?a.x===e.clientX&&a.y===e.clientY?a:Object.assign({},a,{x:e.clientX,y:e.clientY}):a),onMouseLeave:()=>Et(null),style:{width:"20px",height:"20px",borderRadius:"4px",flex:"none",cursor:a.total>0?"pointer":"default",background:a.total>0?"var(--dsh-svc-success)":"var(--dsw-alias-border-l1)",opacity:dr(r)}}})(t)))))))),r.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"5px",marginTop:"8px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},r.createElement("span",null,e("usage.heatmap.less")),[0,1,2,3,4].map(e=>r.createElement("span",{key:e,"data-testid":`usage-heatmap-legend-${e}`,style:{width:"12px",height:"12px",borderRadius:"3px",background:0===e?"var(--dsw-alias-border-l1)":"var(--dsh-svc-success)",opacity:dr(e)}})),r.createElement("span",null,e("usage.heatmap.more"))),St?r.createElement("div",{"data-testid":"usage-heatmap-tooltip",style:{position:"fixed",left:`${St.x+12}px`,top:`${St.y+12}px`,zIndex:1e3,pointerEvents:"none",padding:"7px 9px",borderRadius:"6px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",fontSize:"12px",fontWeight:600,whiteSpace:"pre-line",textAlign:"left"}},St.label):null),Pr=r.createElement("div",{key:"usage-section","data-testid":"usage-card",style:qa},Ve&&Array.isArray(Ve.projects)&&Ve.projects.length>0?r.createElement("div",{"data-testid":"usage-project-tabs",style:{display:"flex",flexWrap:"wrap",gap:"14px",marginBottom:"12px",borderBottom:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("button",{style:Object.assign({},La,"all"===qt?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>At("all")},e("usage.allProjects")),Ve.projects.filter(e=>!0!==e.missing).map(e=>r.createElement("button",{key:e.id,style:Object.assign({},La,qt===e.id?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>At(e.id)},e.title))):null,Dr,Ve&&Ve.indexedSessions>0?r.createElement("div",{"data-testid":"usage-statistics-region",style:Object.assign({},Da,{padding:"12px",borderRadius:"9px"})},r.createElement("div",{"data-testid":"usage-region-header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",flexWrap:"wrap",marginBottom:"8px"}},r.createElement("div",{style:{display:"flex",gap:"14px",flexWrap:"wrap",fontSize:"11px"}},Va.map(([,t,a])=>r.createElement("span",{key:t,style:{display:"inline-flex",alignItems:"center",gap:"5px"}},r.createElement("span",{style:{width:"9px",height:"9px",borderRadius:"2px",background:a}}),e(t)))),r.createElement("button",{type:"button","data-testid":"usage-refresh","data-variant":"neutral",style:wa,onClick:da,disabled:rt},e(rt?"usage.refreshing":"usage.refresh"))),r.createElement("div",{"data-testid":"usage-chart",style:{position:"relative",display:"grid",gridTemplateColumns:"42px minmax(0, 1fr)",height:"180px",padding:"12px 10px 4px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l1)",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},r.createElement("div",{"data-testid":"usage-y-axis","aria-label":e("usage.axis"),style:{position:"relative",height:"144px",fontSize:"10px",color:"var(--dsw-alias-label-secondary)"}},er.map((e,t)=>r.createElement("span",{key:t,style:{position:"absolute",right:"7px",top:25*t+"%",transform:4===t?"translateY(-100%)":"translateY(-50%)"}},Ya(e)))),r.createElement("div",{"data-testid":"usage-plot",style:{position:"relative",height:"164px"}},r.createElement("div",{style:{position:"absolute",inset:"0 0 20px",display:"flex",alignItems:"end",gap:"8px",borderBottom:"1px solid var(--dsw-alias-border-l2)"}},er.map((e,t)=>r.createElement("div",{key:t,"data-testid":`usage-grid-${t}`,style:{position:"absolute",left:0,right:0,top:25*t+"%",borderTop:"1px solid var(--dsw-alias-border-l1)",pointerEvents:"none"}})),_a.map((t,a)=>r.createElement("div",{key:t.key,"aria-label":e("usage.barDay",{day:t.label,total:Ya(Za[a])}),style:{position:"relative",zIndex:1,flex:1,minWidth:0,alignSelf:"end"}},r.createElement("div",{"data-testid":`usage-bar-${t.key}`,style:{height:`${Math.max(2,Za[a]/Xa*144)}px`,display:"flex",flexDirection:"column-reverse",justifyContent:"flex-start",borderRadius:"4px 4px 0 0",overflow:"hidden"}},Va.map(([e,s,n])=>{const o=Ga(Ja[a],e),l=0===Za[a]?0:o/Za[a]*100,i=`${t.key}-${e}`,d=xt&&xt.id===i;return r.createElement("div",{key:e,"data-testid":`usage-segment-${i}`,"data-value":o,onMouseEnter:e=>kt({id:i,date:t.key,totals:Ja[a],x:e.clientX,y:e.clientY}),onMouseMove:e=>kt(t=>t&&t.id===i?t.x===e.clientX&&t.y===e.clientY?t:Object.assign({},t,{x:e.clientX,y:e.clientY}):t),onMouseLeave:()=>kt(null),style:{height:`${l}%`,minHeight:o>0?"2px":0,background:n,opacity:xt&&!d?.42:1,cursor:o>0?"pointer":"default",transition:"opacity 120ms ease"}})}))))),r.createElement("div",{"data-testid":"usage-x-axis",style:{position:"absolute",left:0,right:0,bottom:"0",height:"20px",display:"flex",gap:"8px",alignItems:"end"}},_a.map(e=>r.createElement("div",{key:e.key,style:{flex:1,minWidth:0,textAlign:"center",fontSize:"10px",color:"var(--dsw-alias-label-secondary)"}},e.label))))),r.createElement("div",{"data-testid":"usage-chart-summary",style:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}},e("usage.chartSummary",{total:Ya(Za.reduce((e,t)=>e+t,0))})),xt?r.createElement("div",{"data-testid":"usage-tooltip",style:{position:"fixed",left:`${xt.x+12}px`,top:`${xt.y+12}px`,zIndex:1e3,pointerEvents:"none",padding:"7px 9px",borderRadius:"6px",background:"var(--dsw-alias-bg-overlay)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l2)",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",fontSize:"12px",fontWeight:600,whiteSpace:"pre-line",textAlign:"left"}},(()=>{const t=xt.totals||{},a=Ga(t,"inputTokens")+Ga(t,"outputTokens")+Ga(t,"cacheTokens"),r=Number(t.inputTokens||0)+Number(t.cacheReadTokens||0)+Number(t.cacheWriteTokens||0),s=Number.isFinite(Number(t.cacheHitRate))?Number(t.cacheHitRate):0===r?0:Number(t.cacheReadTokens||0)/r;return`${e("usage.tooltip.date",{date:xt.date})}\n${e("usage.tooltip.input",{value:Number(t.inputTokens||0).toLocaleString()})}\n${e("usage.tooltip.output",{value:Number(t.outputTokens||0).toLocaleString()})}\n${e("usage.tooltip.cache",{value:Number((t.cacheReadTokens||0)+(t.cacheWriteTokens||0)).toLocaleString()})}\n${e("usage.tooltip.total",{value:Ya(a)})}\n${e("usage.tooltip.steps",{value:Number(t.steps||0).toLocaleString()})}\n${e("usage.tooltip.hitRate",{value:(100*s).toFixed(1)+"%"})}`})()):null,r.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"8px",marginTop:"10px"}},Er("today","usage.today",tr),Er("seven","usage.sevenDays",ar)),r.createElement("div",{"data-testid":"usage-model-list",style:{marginTop:"10px",padding:"8px 10px",borderRadius:"8px",background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",flexWrap:"wrap",marginBottom:"4px"}},r.createElement("div",{"data-testid":"usage-model-sort-hint",style:{fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},e(`usage.modelSortHint.${Wt}`)),r.createElement("div",{"data-testid":"usage-model-scope-tabs",style:{display:"flex",gap:"2px"}},["today","week","all"].map(t=>r.createElement("button",{key:t,"data-testid":`usage-model-scope-${t}`,style:Object.assign({},Wa,Wt===t?Na:{color:"var(--dsw-alias-label-secondary)",borderBottom:"2px solid transparent"}),onClick:()=>Bt(t)},e(`usage.modelScope.${t}`))))),Tr.map((t,a)=>{const s=Ka(t),n=Math.round(s/Ar*1e4)/100+"%";return r.createElement("div",{key:t.id,"data-testid":`usage-model-row-${t.id}`,style:{padding:"8px 2px",borderTop:0===a?0:"1px solid var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"baseline",fontSize:"12px"}},r.createElement("span",{style:{overflowWrap:"anywhere"}},t.id),r.createElement("span",{style:{fontWeight:650,whiteSpace:"nowrap"}},Ya(s))),r.createElement("div",{"data-testid":`usage-model-bar-${t.id}`,"data-value":s,"aria-label":e(`usage.modelBar.${Wt}`,{model:t.id,total:Ya(s)}),style:{height:"8px",borderRadius:"4px",marginTop:"6px",overflow:"hidden",background:"var(--dsw-alias-border-l1)"}},r.createElement("div",{style:{display:"flex",height:"100%",width:n}},Va.map(([e,,a])=>{const n=((e,t)=>"cacheTokens"===t?Number(e.cacheReadTokens||0)+Number(e.cacheWriteTokens||0):Number(e[t]||0))(t,e);return n>0?r.createElement("div",{key:e,"data-testid":`usage-model-segment-${t.id}-${e}`,style:{width:n/s*100+"%",background:a}}):null}))),r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"4px",textAlign:"right"}},e("usage.modelLine",{steps:Number(t.steps||0).toLocaleString(),hitRate:Qa(Ua(t),"cacheHitRate"),input:Ya(t.inputTokens),output:Ya(t.outputTokens)})))}),qr>0?r.createElement("button",{style:Object.assign({},Ea,{borderTop:"1px solid var(--dsw-alias-border-l1)",marginTop:"2px"}),onClick:()=>Nt(e=>!e)},`${Lt?"▾":"▸"} ${e(Lt?"usage.models.less":"usage.models.more",{count:qr})}`):null),Br):r.createElement("p",{style:Ta},lt||e("usage.empty")),...Ve&&Ve.indexedSessions>0?[]:[r.createElement("div",{key:"usage-refresh-fallback",style:Ca},r.createElement("button",{style:wa,"data-variant":"neutral",onClick:da,disabled:rt},e(rt?"usage.refreshing":"usage.refresh")))]),jr=n&&"string"==typeof n.platform&&n.platform?`${{win32:"Windows",darwin:"macOS",linux:"Linux",freebsd:"FreeBSD",openbsd:"OpenBSD"}[n.platform]||n.platform}${"string"==typeof n.arch&&n.arch?` · ${n.arch}`:""}`:"—",$r=r.createElement("div",{key:"container-info",style:qa},r.createElement("div",{style:Ba},e("overview.container")),n?r.createElement("div",{"data-testid":"health-display",style:Object.assign({},Da,{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"8px"})},ja("health.platform",jr),ja("health.nodeVersion","string"==typeof n.nodeVersion&&n.nodeVersion?n.nodeVersion:"—"),ja("health.uptime",(t=>{const a=Math.floor(Number(t)/60);return e("health.uptimeValue",{hours:Math.floor(a/60),minutes:a%60})})(n.uptimeSeconds)),ja("health.rss",(e=>{const t=Number(e)/1048576;return(Math.round(10*t)/10).toLocaleString(void 0,{maximumFractionDigits:1})+" MB"})(n.rssBytes)),ja("health.liveSessions",String(n.liveSessions)),ja("health.persistedSessions",String(n.persistedSessions)),ja("health.activeAgents",String(n.activeAgents)),ja("health.activeJobs",String(n.activeJobs))):r.createElement("p",{style:Ta},c||e("version.loading"))),_r=r.createElement("div",{key:"overview-errors",style:qa},r.createElement("div",{"data-testid":"overview-errors-title",style:Ba},e("overview.errors")),r.createElement("div",{"data-testid":"overview-errors-region",style:Da},r.createElement("div",{style:Object.assign({},Ta,{margin:"-3px 0 7px"})},e("usage.errors.recent")),r.createElement("div",{style:{display:"grid",gap:"7px"}},r.createElement("div",null,r.createElement("button",{style:Ea,onClick:()=>Ot(e=>!e)},`${Rt?"▾":"▸"} ${e("usage.errors.toggle",{count:Mr.length})}`),Rt?r.createElement("div",{style:{padding:"0 2px 8px"}},Lr("model",Mr)):null),r.createElement("div",null,r.createElement("button",{style:Ea,onClick:()=>Dt(e=>!e)},`${Ht?"▾":"▸"} ${e("usage.toolErrors.toggle",{count:Ir.length})}`),Ht?r.createElement("div",{style:{padding:"0 2px 8px"}},Lr("tool",Ir)):null)))),Vr=(t,a,s)=>{const n="error"===t.status||"warning"===t.status&&!0!==t.advisory,o="ok"===t.status?"var(--dsh-svc-success)":"warning"===t.status?"var(--dsh-svc-warning)":"info"===t.status?"var(--dsh-svc-info)":"var(--dsh-svc-danger)";return r.createElement("div",{key:t.id,"data-testid":`health-check-${t.id}`,style:{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 10px",borderRadius:"6px",borderTop:0===a?0:"1px solid var(--dsh-svc-border)",background:n?"error"===t.status?"rgba(211,51,51,0.08)":"rgba(198,128,0,0.10)":"transparent"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),marginTop:"5px",background:o}}),r.createElement("div",{style:{minWidth:0,flex:1}},r.createElement("div",{style:{fontSize:"12px",fontWeight:n?650:550,color:"var(--dsh-svc-text)"}},e("health.check."+t.id)),r.createElement("div",{style:{fontSize:"11px",lineHeight:1.5,marginTop:"2px",color:"ok"===t.status?"var(--dsh-svc-text-muted)":n?"error"===t.status?"var(--dsh-svc-danger)":"var(--dsh-svc-warning)":"var(--dsh-svc-text-muted)"}},s)))},Fr=!1===s.taskNotifications?null:"undefined"==typeof Notification?{status:"info",detail:e("health.detail.notification-permission.unsupported")}:"granted"===Notification.permission?{status:"ok",detail:e("health.detail.notification-permission.granted")}:{status:"warning",detail:e("denied"===Notification.permission?"health.detail.notification-permission.denied":"health.detail.notification-permission.default")},Ur=r.createElement("div",{"data-testid":"health-diagnostics-region",style:Da},g&&"ok"!==g.status?r.createElement("div",{style:{marginTop:"10px",padding:"9px 11px",borderRadius:"7px",background:"error"===g.status?"rgba(211,51,51,0.1)":"rgba(198,128,0,0.12)",border:"1px solid "+("error"===g.status?"rgba(211,51,51,0.3)":"rgba(198,128,0,0.3)")}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700}},e("health.alert.title")),r.createElement("div",{style:Ta},e("health.alert.diagnostics",{status:e("health.overall."+g.status)}))):null,g?r.createElement("div",{"data-testid":"health-check-list",style:Object.assign({},Da,{marginTop:"10px",padding:"8px 10px"})},...g.checks.map((e,t)=>Vr(e,t,Sr(e))),...null===Fr?[]:[Vr({id:"notification-permission",status:Fr.status},g.checks.length,Fr.detail)]):null),Kr=Array.isArray(g?.pluginIssues)?g.pluginIssues:[],Gr=0===Kr.length?null:r.createElement("div",{"data-testid":"plugin-issue-list",style:{marginTop:"6px",padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-raised-bg)"}},Kr.map((t,a)=>{const s="failed"===t.phase,n="disposed"===t.phase||"unknown"===t.phase,o=s?"var(--dsh-svc-danger)":n?"var(--dsh-svc-info)":"var(--dsh-svc-warning)",l=k===t.entryId,i=E===t.entryId;return r.createElement("div",{key:t.entryId,"data-testid":`plugin-issue-${t.entryId}`,style:{display:"flex",alignItems:"flex-start",gap:"9px",padding:"8px 2px",borderTop:0===a?0:"1px solid var(--dsh-svc-border)"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),marginTop:"6px",background:o}}),r.createElement("div",{style:{minWidth:0,flex:1}},r.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"}},r.createElement("span",{style:{fontFamily:"var(--ds-font-family-code, monospace)",fontSize:"12px",fontWeight:600,overflowWrap:"anywhere",color:"var(--dsw-alias-label-primary)"}},t.moduleName),r.createElement("span",{style:{fontSize:"11px",fontWeight:650,color:o}},e("plugin.state."+t.phase))),void 0!==t.error&&null!==t.error?r.createElement("div",{style:{fontSize:"11px",marginTop:"3px",color:"var(--dsh-svc-danger)",lineHeight:1.5,overflowWrap:"anywhere"}},e("plugin.error",{error:t.error})):null,void 0!==t.missingDeps&&t.missingDeps.length>0?r.createElement("div",{style:{fontSize:"11px",marginTop:"3px",color:"var(--dsh-svc-warning)",lineHeight:1.5,overflowWrap:"anywhere"}},e("plugin.missingDeps",{deps:t.missingDeps.join(", ")})):null,s?r.createElement("div",{style:{marginTop:"6px"}},l?r.createElement("div",{style:{padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--dsw-alias-state-error-primary)",background:"rgba(211,51,51,0.08)"}},r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 6px",color:"var(--dsw-alias-state-error-primary)"})},e("plugin.restartHint",{name:t.moduleName})),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{type:"button","data-testid":`plugin-restart-confirm-${t.entryId}`,style:xa,disabled:i,onClick:()=>(async t=>{if(null!==t&&"object"==typeof t&&null===E){C(t.entryId),q(null);try{const e=await d("plugin-restart",{entryId:t.entryId});if(!e||!0!==e.ok)throw Object.assign(new Error("plugin restart failed"),{code:e?.error});S(null),await ia(!0)}catch(t){S(null),q((t=>{const a="string"==typeof t&&t.length>0?t:"internal-error";if(a.startsWith("restart-failed:")){const t=a.slice(15).trim(),r=e("plugin.error.restart-failed");return e("plugin.restartFailed",{detail:""===t?r:`${r}(${t})`})}const r={"unknown-plugin":"plugin.error.unknown-plugin","loader-unavailable":"plugin.error.loader-unavailable","plugin-disabled":"plugin.error.plugin-disabled","not-failed":"plugin.error.not-failed"}[a];return e("plugin.restartFailed",{detail:void 0===r?a:e(r)})})(t?.code??String(t?.message||t)))}finally{C(null)}}})(t)},e(i?"plugin.restarting":"plugin.restartConfirm")),r.createElement("button",{type:"button",style:Sa,disabled:i,onClick:()=>{S(null),q(null)}},e("plugin.restartCancel")))):r.createElement("button",{type:"button","data-testid":`plugin-restart-${t.entryId}`,style:ka,disabled:i,onClick:()=>{S(t.entryId),q(null)}},e(i?"plugin.restarting":"plugin.restart"))):null,T?r.createElement("p",{"data-testid":"plugin-restart-error",style:Object.assign({},Ta,{margin:"4px 0 0",color:"var(--dsw-alias-state-error-primary)"})},T):null))})),Yr=A&&!0===A.supported?A.items.filter(e=>!1===e.writable).length:0,Qr=Yr>0||j&&(j.ownerIssues>0||j.directoryModeIssues>0||j.fileModeIssues>0||j.unreadable>0),Jr=A&&!0===A.supported?r.createElement("div",{key:"permissions-section",style:{marginTop:"18px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",flexWrap:"wrap"}},r.createElement("div",{style:Ba},e("permissions.title")),r.createElement("button",{type:"button","data-testid":"permissions-toggle","aria-expanded":String(B),onClick:()=>P(e=>!e),style:{fontSize:"12px",lineHeight:"20px",padding:"2px 12px",..._(999),border:"1px solid var(--dsh-svc-border-strong)",background:"transparent",color:Yr>0?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-primary)",cursor:"pointer"}},`${B?"▾":"▸"} ${e(B?"permissions.hide":"permissions.show")}${Yr>0?` · ${Yr}`:""}`)),B?r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("permissions.description")),Yr>0?r.createElement("div",{style:{marginTop:"8px",padding:"9px 11px",borderRadius:"7px",background:"rgba(198,128,0,0.12)",border:"1px solid rgba(198,128,0,0.3)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:700}},e("health.alert.title")),r.createElement("div",{style:Ta},e("permissions.summary.warning",{count:Yr}))):null,r.createElement("p",{style:Object.assign({},Ta,{fontWeight:600,color:Yr>0?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-primary)"})},e(Yr>0?"permissions.summary.warning":"permissions.summary.ok",{count:Yr>0?Yr:A.items.length})),r.createElement("p",{style:Object.assign({},Ta,{fontWeight:600})},e("permissions.target",{owner:A.targetOwner})),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},r.createElement("button",{style:wa,onClick:()=>W(e=>!e)},e(N?"permissions.hideDetails":"permissions.showDetails")),r.createElement("button",{style:wa,"data-variant":"neutral",onClick:async()=>{if(A&&!0===A.supported){F(!0),L(null);try{const e=await d("permissions-deep",{planId:A.planId});if(!e||!1===e.ok)throw new Error("deep permission check failed");$(e.value)}catch(t){L(e("permissions.error"))}finally{F(!1)}}},disabled:V},e(V?"permissions.deepChecking":"permissions.deep"))),j?r.createElement("p",{style:Ta},e("permissions.deepSummary",{scanned:j.scanned,duration:j.durationMs,owner:j.ownerIssues,directories:j.directoryModeIssues,files:j.fileModeIssues,unreadable:j.unreadable})):null,N?r.createElement("div",{style:{display:"grid",gap:"8px",marginTop:"8px"}},A.items.map(e=>r.createElement("div",{key:e.path,style:{padding:"9px 10px",borderRadius:"6px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{fontSize:"12px",fontWeight:600}},e.label),r.createElement("div",{style:{fontFamily:"monospace",fontSize:"11px",color:"var(--dsw-alias-label-secondary)",overflowWrap:"anywhere"}},e.path),r.createElement("div",{style:{fontFamily:"monospace",fontSize:"12px",marginTop:"3px"}},`${e.owner} · ${e.mode}`)))):null,M?r.createElement("div",{style:{marginTop:"10px"}},r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},e("permissions.confirmHint")),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:O,onClick:async()=>{if(A&&!0===A.supported){H(!0),L(null);try{const e=await d("permissions-repair",{planId:A.planId});if(!e||!1===e.ok)throw new Error("permission repair failed");z(e.value),I(!1)}catch(t){L(e("permissions.error"))}finally{H(!1)}}}},e(O?"permissions.repairing":"permissions.confirm")),r.createElement("button",{style:Sa,disabled:O,onClick:()=>I(!1)},e("permissions.cancel")))):Qr?r.createElement("button",{style:Object.assign({},ka,{marginTop:"10px"}),"data-variant":"dangerGhost",disabled:O,onClick:()=>I(!0)},e("permissions.repair")):null,D?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},D):null):null):null,Zr=r.createElement("div",{key:"health-section","data-testid":"health-card",style:qa},Ur,Gr,Jr),Xr=G&&!0===Q?.active,es=Xr&&Q.phase||"copy",ts={copy:1,archive:2,validate:3,publish:4}[es]||1,as=(()=>{if(!Xr)return 0;const e=Number(Q.totalBytes)||0;let t;if("copy"===es)t=e>0?Math.min(30,Math.floor(Q.copiedBytes/e*30)):0;else if("archive"===es){const a=e>0?Math.min(1,Number(Q.archiveBytes)/e):0;t=Math.min(70,30+Math.floor(40*a))}else t="validate"===es?70:100;const a=Math.max(X.current,t);return X.current=a,a})(),rs=Xr?"copy"===es?`${Pa(Q.copiedBytes)} / ${Pa(Q.totalBytes)}`:Q.archiveBytes>0?Pa(Q.archiveBytes):"":"",ss=r.createElement("div",{key:"backup-section"},r.createElement("div",{style:Ba},e("backup.title")),r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("backup.description")),r.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"12px",flexWrap:"wrap"}},r.createElement("button",{style:Object.assign({},va,{flex:1,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center"}),"data-variant":"brandGhost",onClick:async()=>{Y(!0),re(null),Z(null),X.current=0;let e=!1,a=()=>{};const r=async()=>{if(!e){try{const t=await d("backup-progress",{});!e&&t&&t.ok&&Z(!0===t.value?.active?t.value:null)}catch(e){}e||(a=t.timer.timeout(r,400))}};r();try{const e=await d("backup-create",{});if(!e||!1===e.ok)throw Object.assign(new Error("backup failed"),{code:e?.error});K({items:e.value.items,totalBytes:e.value.totalBytes})}catch(e){re(ca(e?.code))}finally{e=!0,a(),Z(null),Y(!1)}},disabled:G},e(G?"backup.creating":"backup.create")),r.createElement("label",{style:Object.assign({},wa,{flex:1,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:Ce?"default":"pointer"})},e(Ce?"backup.importing":"backup.import"),r.createElement("input",{type:"file",accept:".tar.gz,application/gzip",disabled:Ce,onChange:t=>{const a=t.target.files&&t.target.files[0];if(t.target.value="",!a)return;Re(!0),re(null);const r=new FileReader;r.onload=async()=>{try{const e=new Uint8Array(r.result);let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));const s=await d("backup-import",{name:a.name,data:btoa(t)});if(!s||!1===s.ok)throw Object.assign(new Error("backup import failed"),{code:s?.error});K(s.value)}catch(t){re(t?.code?ca(t.code):e("backup.error"))}finally{Re(!1)}},r.onerror=()=>{Re(!1),re(e("backup.error"))},r.readAsArrayBuffer(a)},style:{display:"none"}}))),G&&!0===Q?.active?r.createElement("div",{"data-testid":"backup-progress",style:{marginTop:"10px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",fontSize:"11px",color:"var(--dsw-alias-label-secondary)"}},r.createElement("span",null,e("backup.progress."+es,{current:ts,total:4})),r.createElement("span",null,rs)),r.createElement("div",{style:{marginTop:"5px",height:"6px",..._("999px"),background:"var(--dsh-svc-raised-bg)",border:"1px solid var(--dsw-alias-border-l1)",overflow:"hidden"}},r.createElement("div",{style:{height:"100%",width:as+"%",background:"var(--dsw-alias-brand-primary)",transition:"width 240ms ease"}}))):null,r.createElement("p",{style:Ta},e("backup.total",{size:Pa(U.totalBytes)})),xe?r.createElement("div",{"data-testid":"backup-manual-restart",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"rgba(198,128,0,0.10)"}},r.createElement("div",{style:{fontWeight:650,color:"var(--dsw-alias-state-warn-primary)"}},e(null!==Zt&&!0===Zt.electronShell?"backup.manualRestartTitleDesktop":"backup.manualRestartTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:"4px 0 0"})},e(null!==Zt&&!0===Zt.electronShell?"backup.manualRestartBodyDesktop":"backup.manualRestartBody"))):null,ae?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)"})},ae):null,0===U.items.length?r.createElement("p",{style:Ta},e("backup.empty")):U.items.length>10?r.createElement("button",{style:Object.assign({},Sa,{marginTop:"8px"}),onClick:()=>De(e=>!e)},e(He?"backup.hideRecords":"backup.showRecords")):null,U.items.length>0&&(U.items.length<=10||He)?r.createElement("div",{style:{marginTop:"10px",display:"grid",gap:"8px"}},U.items.map(t=>r.createElement("div",{key:t.id,style:{padding:"9px 2px",borderBottom:"1px solid var(--dsh-svc-border)",color:"var(--dsw-alias-label-primary)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"flex-start"}},r.createElement("div",null,r.createElement("div",{style:{fontFamily:"monospace",fontSize:"12px",overflowWrap:"anywhere"}},t.name),t.dshVersion?r.createElement("div",{"data-testid":`backup-row-version-${t.id}`,style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"3px"}},e("backup.row.version",{version:t.dshVersion})):null,r.createElement("div",{style:{color:"var(--dsw-alias-label-secondary)",fontSize:"11px",marginTop:"3px"}},`${Pa(t.sizeBytes)} · ${new Date(t.createdAt).toLocaleString()}`)),r.createElement("div",{style:{display:"flex",gap:"6px",flexShrink:0}},se===t.id||oe===t.id?null:r.createElement("button",{style:ge(),disabled:Se||G,onClick:()=>(async t=>{Ee(!0),re(null);try{const e=await d("backup-export",{id:t});if(!e||!1===e.ok)throw new Error("export failed");const a=document.createElement("a");a.href=e.value.url,a.download=e.value.name,document.body.appendChild(a),a.click(),document.body.removeChild(a)}catch(t){re(e("backup.exportError"))}finally{Ee(!1)}})(t.id)},e(Se?"backup.exporting":"backup.export")),se===t.id||oe===t.id?null:r.createElement("button",{style:ge(),disabled:G,onClick:()=>ua(t.id)},e(G&&oe===t.id?"backup.inspecting":"backup.restore")),se===t.id||oe===t.id?null:r.createElement("button",{style:Object.assign({},ka,{minHeight:"28px",padding:"4px 9px"}),"data-variant":"dangerGhost",disabled:G,onClick:()=>ne(t.id)},e("backup.delete")))),se===t.id?r.createElement("div",{style:{marginTop:"8px"}},r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)",margin:"0 0 6px"})},e("backup.confirmHint")),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:G,onClick:()=>(async t=>{Y(!0),re(null);try{const e=await d("backup-delete",{id:t});if(!e||!1===e.ok)throw new Error("backup failed");K(e.value),ne(null)}catch(t){re(e("backup.error"))}finally{Y(!1)}})(t.id)},e("backup.confirm")),r.createElement("button",{style:Sa,disabled:G,onClick:()=>ne(null)},e("backup.cancel")))):oe===t.id?r.createElement("div",{"data-testid":"backup-restore-preflight",style:{marginTop:"8px",padding:"10px",borderRadius:"8px",border:"1px solid var(--dsh-svc-border)",background:"var(--dsh-svc-raised-bg)"}},G&&null===ie?r.createElement("p",{style:Ta},e("backup.inspecting")):null!==ie?r.createElement("div",null,r.createElement("div",{style:{fontWeight:650,color:ie.validForRestore?"var(--dsh-svc-success)":"var(--dsh-svc-danger)"}},e(ie.validForRestore?"backup.integrity.ok":"backup.integrity.invalid")),r.createElement("p",{style:Object.assign({},Ta,{margin:"4px 0 0"})},e("backup.integrity.summary",{entries:ie.archive?.entryCount||0,size:Pa(ie.archive?.logicalBytes||0),sessions:ie.sections?.sessions?.files||0,config:ie.sections?.config?.files?.length||0,profiles:ie.sections?.profiles?.count||0})),r.createElement("p",{"data-testid":"backup-archive-format",style:Object.assign({},Ta,{margin:"2px 0 0"})},e("backup.integrity.format",{format:e("v2"===ie.archiveFormat?"backup.format.v2":"backup.format.v1")})),ie.dshVersion??ce?.reportSummary?.dshVersion?r.createElement("p",{"data-testid":"backup-source-version",style:Object.assign({},Ta,{margin:"2px 0 0"})},e("backup.integrity.sourceVersion",{version:ie.dshVersion??ce.reportSummary.dshVersion})):null,!0!==ie.validForRestore?r.createElement("ul",{style:Object.assign({},Ta,{margin:"6px 0 0",paddingLeft:"18px",color:"var(--dsh-svc-danger)"})},(ie.issues||[]).map((e,t)=>r.createElement("li",{key:t},ca(e.code)))):null):null,null!==ce?r.createElement("div",{style:{marginTop:"8px"}},ce.notices?.length||ie?.notices?.length?r.createElement("ul",{"data-testid":"backup-restore-notices",style:Object.assign({},Ta,{margin:"0 0 8px",paddingLeft:"18px",color:"var(--dsw-alias-state-warn-primary)"})},(ce.notices?.length?ce.notices:ie.notices).map((t,a)=>r.createElement("li",{key:`${t.code}-${a}`,"data-notice":t.code},e(`backup.notice.${t.code}`,{detail:t.detail||""})))):null,(ce.targets?.profiles?.mapping?.length||0)>0?r.createElement("div",{"data-testid":"backup-restore-mapping",style:{margin:"0 0 8px"}},r.createElement("div",{style:Object.assign({},Ta,{margin:"0 0 4px"})},e("backup.plan.mappingHint")),ce.targets.profiles.mapping.map(t=>{const a=ye[t.source]??{target:t.target,manifest:!0===t.manifest},s=[...new Set([t.source,...(he?.profiles??[]).map(e=>e.name)])].sort(),n=e=>((e,t)=>{we(t);const a=Object.keys(t).sort().map(e=>({source:e,target:t[e].target,manifest:!0===t[e].manifest}));return ua(e,a)})(oe,Object.assign({},ye,{[t.source]:e}));return r.createElement("div",{key:t.source,style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",margin:"2px 0"}},r.createElement("span",{style:{fontFamily:"monospace",fontSize:"11px"}},t.source),r.createElement("span",{style:Ta},"→"),r.createElement("select",{"data-testid":`backup-mapping-target-${t.source}`,"aria-label":e("backup.plan.mappingHint"),value:a.target,disabled:G,onChange:e=>n({target:e.target.value,manifest:!0===a.manifest}),style:{fontSize:"11px",padding:"2px 4px"}},s.map(e=>r.createElement("option",{key:e,value:e},e))),r.createElement("label",{style:Object.assign({},Ta,{display:"inline-flex",alignItems:"center",gap:"4px"})},r.createElement("input",{type:"checkbox","data-testid":`backup-mapping-manifest-${t.source}`,checked:!0===a.manifest,disabled:G,onChange:e=>n({target:a.target,manifest:e.target.checked})}),e("backup.plan.manifest")))})):null,r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-warn-primary)",margin:"0 0 6px"})},e("backup.restoreHint")),r.createElement("ul",{style:Object.assign({},Ta,{margin:"0 0 8px",paddingLeft:"18px"})},r.createElement("li",null,e("backup.plan.sessions")),r.createElement("li",null,e("backup.plan.config",{replace:ce.targets?.config?.replace?.length||0,remove:ce.targets?.config?.remove?.length||0})),r.createElement("li",null,e("backup.plan.profiles",{count:ce.targets?.profiles?.upsert?.length||0})),r.createElement("li",{"data-testid":"backup-plan-profile-patches"},(ce.targets?.profiles?.patches?.length||0)>0?e("backup.plan.profilePatches",{count:ce.targets.profiles.patches.length}):e("backup.plan.profilePatchesAbsent"))),r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 8px"})},e("backup.plan.expires",{time:new Date(ce.expiresAt).toLocaleTimeString()})),r.createElement("div",{style:{display:"flex",gap:"8px"}},r.createElement("button",{style:xa,disabled:G,onClick:pa},e("backup.restoreConfirm")),r.createElement("button",{style:Sa,disabled:G,onClick:ma},e("backup.cancel")))):r.createElement("button",{style:Sa,disabled:G,onClick:ma},e("backup.cancel"))):null))):null)),ns=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",transition:"transform 150ms ease",transform:e?"rotate(90deg)":"none"}},r.createElement("path",{d:"M9 6l6 6-6 6"})),os=(t,a,s,n,o,l,i)=>{const d=n?n.restartPending?e("update.installedPendingRestart",{version:n.current||s||""}):"unpublished"===n.status?e("update.unpublished"):"unavailable"===n.status?e("update.unavailable"):n.upToDate?e("update.current"):e("update.available",{version:n.latest}):$e||e("update.checking"),c=n?n.restartPending?"var(--dsw-alias-state-warn-primary)":n.upToDate?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-label-secondary)",u=void 0!==l&&Ft.kind===l&&"latest"===Ft.variant&&"idle"!==Ft.phase,p=void 0!==l&&!0!==Vt.current&&n&&"unpublished"!==n.status&&"unavailable"!==n.status&&!n.upToDate?r.createElement("button",{type:"button",title:e(u?"update.notes.hide":"update.notes.button"),style:{background:"transparent",border:0,padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"5px",fontSize:"12px",fontWeight:600,color:c},onClick:()=>{oa(l,"latest")}},ns(u),r.createElement("span",null,d)):r.createElement("div",{style:{color:c,fontWeight:600}},d);return r.createElement("div",{key:t,className:"dshsvc-version-row",style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",gap:"8px 16px",padding:"10px 2px",borderTop:i?"1px solid var(--dsw-alias-border-l1)":0}},r.createElement("div",{className:"dshsvc-version-identity",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",minWidth:0}},r.createElement("span",{style:{fontSize:"13px",fontWeight:650,whiteSpace:"nowrap"}},`${a} `),n?.url?r.createElement("a",{"data-testid":`version-${t}-link`,href:n.url,target:"_blank",rel:"noreferrer",style:{color:"var(--dsw-alias-label-primary)",textDecoration:"underline",fontSize:"12px",whiteSpace:"nowrap",marginLeft:"16px"}},n.current||s||e("version.loading")):r.createElement("code",{style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",marginLeft:"16px",whiteSpace:"nowrap"}},n?.current||s||e("version.loading")),(t=>{if(!0===_t.current)return null;const a=Ft.kind===t&&"current"===Ft.variant&&"idle"!==Ft.phase;return r.createElement("button",{type:"button","data-testid":`version-${t}-notes-toggle`,"aria-expanded":String(a),title:e(a?"update.notes.hide":"update.notes.button"),onClick:()=>{oa(t,"current")},style:Object.assign({},Sa,{minHeight:"22px",padding:"1px 8px",fontSize:"11px",display:"inline-flex",alignItems:"center",gap:"4px"})},a?null:ns(!1),r.createElement("span",null,e("update.notes.button")))})(t)),r.createElement("div",{className:"dshsvc-version-status",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:"8px",fontSize:"12px",minWidth:0,overflowWrap:"anywhere"}},p,o||null))},ls=Pe?.dsh,is=Pe?.plugin&&!Pe.plugin.upToDate&&"available"===Pe.plugin.status,ds=1===Ue(Xt,We||Pe?.plugin?.current||null),cs=yt||ds,us=cs&&null!==Xt?Object.assign({},Pe?.plugin,{current:Xt,restartPending:!0}):Pe?.plugin,ps=null!==Zt&&!0===Zt.electronShell,ms=!is||cs||bt?null:r.createElement("button",{style:Object.assign({},wa,{minHeight:"24px",padding:"2px 8px",fontSize:"11px"},ps?{opacity:.5,cursor:"default"}:{}),disabled:mt||ps,title:ps?e("update.desktopManagedUpgrade"):void 0,onClick:ha},e(mt?"update.upgrading":"update.upgrade")),gs=ps&&(is||cs)?r.createElement("p",{"data-testid":"upgrade-desktop-note",style:Object.assign({},Ta,{margin:"6px 0 0"})},e("update.desktopManagedUpgrade")):null,hs=yt||ds&&null!==Zt&&(!0===Zt.manualStartLikely||ps),fs=t=>{if(Ft.kind!==t||"idle"===Ft.phase)return null;const a="latest"===Ft.variant?"latest":"current",s=e=>`version-${t}-notes-${a}${e}`,n="ready"===Ft.phase?Ft.value:null,o="loading"===Ft.phase?r.createElement("p",{"data-testid":s("-loading"),style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("update.notes.loading")):"pending"===Ft.phase?r.createElement("div",{"data-testid":s("-pending"),style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px"}},r.createElement("span",{style:{fontSize:"12px",color:"var(--dsw-alias-label-secondary)"}},e("update.notes.error.release-not-found")),r.createElement("button",{type:"button","data-testid":s("-retry"),onClick:()=>{sa(t,a)},style:Object.assign({},Sa,{minHeight:"22px",padding:"1px 8px",fontSize:"11px"})},e("update.notes.retry"))):"error"===Ft.phase?r.createElement("p",{"data-testid":s("-error"),role:"alert",style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},e("update.notes.error."+("string"==typeof Ft.error&&""!==Ft.error?Ft.error:"release-unavailable"))):"string"==typeof n?.notes&&""!==n.notes.trim()?r.createElement("div",{"data-testid":s("-body"),style:{fontSize:"12px",color:"var(--dsw-alias-label-primary)",overflowWrap:"anywhere"}},null!==Aa?r.createElement(Aa,{text:n.notes,labels:za(e)}):r.createElement("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.6}},n.notes)):r.createElement("p",{"data-testid":s("-empty"),style:{margin:0,fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},e("update.notes.empty")),l=null===n?[]:["latest"===a&&"string"==typeof n.version&&""!==n.version?r.createElement("span",{key:"version",style:{color:"var(--dsw-alias-label-secondary)",fontWeight:600}},e("update.notes.version",{version:n.version})):null,n.publishedAt?r.createElement("span",{key:"published"},e("update.notes.publishedAt",{date:String(n.publishedAt).slice(0,10)})):null,!0===n.prerelease?r.createElement("span",{key:"prerelease",style:{color:"var(--dsw-alias-state-warn-primary)"}},e("update.notes.prerelease")):null,!0===n.truncated?r.createElement("span",{key:"truncated"},e("update.notes.truncated",{chars:Number(n.notesLimit)>0?n.notesLimit:2e4})):null].filter(e=>null!==e);return r.createElement("div",{"data-testid":`version-${t}-notes`,"data-dshsvc-notes-panel":"",ref:Gt,style:{marginTop:"6px",marginBottom:"4px",padding:"10px 12px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l1)",background:"var(--dsh-svc-raised-bg)",display:"flex",flexDirection:"column",gap:"8px"}},o,l.length>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},...l):null)},bs=r.createElement("div",{key:"version-card","data-testid":"version-card",style:qa},r.createElement("div",{key:"title",style:Ba},e("version.title")),r.createElement("div",{className:"dshsvc-version-surface",style:Da},os("plugin","dsh-service",We,us,ms,"plugin",!1),fs("plugin"),os("dsh","DSH",Le,ls,null,"dsh",!0),fs("dsh"),bt?r.createElement("div",{"data-testid":"upgrade-manual-confirm",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"6px",background:"rgba(211,51,51,0.08)",border:"1px solid rgba(211,51,51,0.3)"}},r.createElement("p",{style:{margin:"0 0 6px",color:"var(--dsw-alias-state-error-primary)",fontSize:"13px",fontWeight:600}},e("update.manualConfirmTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:"0 0 8px"})},e("update.manualConfirm")),r.createElement("div",{style:Ca},r.createElement("button",{style:ka,"data-variant":"dangerGhost",disabled:mt,onClick:ha},e(mt?"update.upgrading":"update.manualProceed")),r.createElement("button",{style:Sa,disabled:mt,onClick:()=>vt(!1)},e("restart.cancel")))):null,hs?r.createElement("div",{"data-testid":"upgrade-manual-pending",style:{marginTop:"10px",padding:"10px 12px",borderRadius:"6px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg)"}},r.createElement("p",{style:{margin:"0 0 4px",color:"var(--dsw-alias-state-warn-primary)",fontSize:"13px",fontWeight:650}},e(ps?"update.manualRestartTitleDesktop":"update.manualRestartTitle")),r.createElement("p",{style:Object.assign({},Ta,{margin:0})},e(ps?"update.manualRestartBodyDesktop":"update.manualRestartBody"))):null,gs,ht?r.createElement("p",{style:Object.assign({},Ta,{color:"var(--dsw-alias-state-error-primary)",margin:"4px 0 0"})},ht):null)),vs=r.createElement(Fe,{showNavToggle:!0}),{enabled:ys,done:ws,input:xs,bell:ks,setEnabled:Ss,setDone:Es,setInput:Cs,setBell:Ts}=Oe(),qs="undefined"!=typeof Notification,As=qs?Notification.permission:"denied",zs=(e,t,a,s,n,o)=>r.createElement("div",{"data-testid":e,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"5px 0"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"}},r.createElement("span",{style:{fontSize:"13px",color:"var(--dsw-alias-label-primary)"}},t),a?r.createElement("span",{style:Ta},a):null),((e,t,a)=>r.createElement("button",{type:"button",role:"switch","aria-checked":String(!0===e),"aria-disabled":a?"true":void 0,onClick:a?void 0:()=>t(!e),style:{width:"34px",height:"20px",..._("10px"),padding:0,flexShrink:0,position:"relative",border:"1px solid "+(e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-border-l2)"),background:e?"var(--dsw-alias-state-success-primary)":"var(--dsw-alias-bg-layer-2)",cursor:a?"default":"pointer",opacity:a?.5:1,lineHeight:0}},r.createElement("span",{style:{position:"absolute",top:"1px",left:e?"15px":"1px",width:"16px",height:"16px",..._("50%"),background:e?"#fff":"var(--dsw-alias-label-tertiary)"}})))(s,n,o)),Ms=qs?r.createElement("div",null,r.createElement("div",{style:Ba},e("notification.title")),r.createElement("div",{style:Object.assign({},Da,{marginTop:"4px"})},r.createElement("p",{style:Ta},e("notification.description")),"granted"!==As?r.createElement("div",{style:{marginTop:"8px",display:"flex",alignItems:"center",gap:"8px"}},r.createElement("button",{style:wa,onClick:()=>{Notification.requestPermission().then(e=>{"granted"===e&&Ss(!0)})}},e("notification.enable")),r.createElement("span",{style:Ta},"denied"===As?e("notification.denied"):"")):r.createElement("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column"}},zs("notify-row-master",e("notification.master"),null,ys,Ss,!1),zs("notify-row-done",e("notification.done"),null,ws,Es,!ys),zs("notify-row-input",e("notification.input"),null,xs,Cs,!ys),zs("notify-row-bell",e("notification.bellShow"),null,ks,Ts,!1)))):null,Is=null!=Pe&&(Pe.dsh&&!1===Pe.dsh.upToDate||Pe.plugin&&!1===Pe.plugin.upToDate),Rs=null!==U&&!G&&!ae,Os=(g?.checks||[]).filter(e=>"error"===e.status||"warning"===e.status&&!0!==e.advisory&&"permissions"!==e.id),Hs=[];c&&Hs.push({level:"error",text:c}),lt&&Hs.push({level:"error",text:lt}),ae&&Hs.push({level:"error",text:ae}),Yt.error&&Hs.push({level:"error",text:String(Yt.error)}),D&&Hs.push({level:"error",text:D});for(const t of Os)Hs.push({level:"error"===t.status?"error":"warning",text:e(`health.check.${t.id}`)+":"+Sr(t)});Yr>0&&Hs.push({level:"warning",text:e("permissions.summary.warning",{count:Yr})}),Is&&Hs.push({level:"info",text:e("overview.updateAvailable")}),Rs&&0===U.items.length&&Hs.push({level:"info",text:e("overview.backupEmpty")});const Ds=Hs.some(e=>"error"===e.level)?"error":Hs.some(e=>"warning"===e.level)?"warning":Hs.some(e=>"info"===e.level)?"info":"normal",Ls="normal"===Ds?e("overview.status.normal"):e(`overview.status.${Ds}`,{count:Hs.length}),Ns=r.createElement("div",{"data-testid":"overview-status",style:Object.assign({},Da,{display:"flex",alignItems:"center",gap:"10px"})},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"10px",height:"10px",..._("50%"),background:"normal"===Ds?"var(--dsh-svc-success)":"warning"===Ds?"var(--dsh-svc-warning)":"error"===Ds?"var(--dsh-svc-danger)":"var(--dsh-svc-info)"}}),r.createElement("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--dsh-svc-text)"}},Ls)),Ws=0===Hs.length?null:r.createElement("div",{"data-testid":"overview-actionables",style:Object.assign({},Da,{marginTop:"10px",padding:"4px 10px"})},Hs.map((e,t)=>r.createElement("div",{key:`${e.level}-${t}`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 2px",fontSize:"12px",borderTop:0===t?0:"1px solid var(--dsh-svc-border)"}},r.createElement("span",{"aria-hidden":"true",style:{flex:"none",width:"7px",height:"7px",..._("50%"),background:"error"===e.level?"var(--dsh-svc-danger)":"warning"===e.level?"var(--dsh-svc-warning)":"var(--dsh-svc-info)"}}),r.createElement("span",{style:{color:"var(--dsh-svc-text)"}},e.text)))),Bs=r.createElement("div",null,Ns,Ws,bs,$r,Mr.length>0||Ir.length>0?_r:null),Ps=r.createElement("div",{key:"maintenance-card","data-testid":"maintenance-card",style:qa},ss),js=!0===g?.checks?.some(e=>"error"===e.status||"warning"===e.status&&!0!==e.advisory),{batch:$s}=fa(),_s={overview:!1,usage:Boolean(lt),quota:!1,diagnostics:Boolean(c||D||js||Yr>0),maintenance:Boolean(ae||Yt.error),configuration:!1},[Vs,Fs]=a("subagent"),[Us,Ks]=a("features");o(()=>{let e=null;try{e=localStorage.getItem("dsh-service-maintenance-tab")}catch(e){}Fs(qe(e,s))},[]);const Gs=((e,t)=>ee.filter(t=>void 0===pe[t]||(Array.isArray(pe[t])?pe[t].some(t=>!1!==e[t]):!1!==e[pe[t]])).map(e=>({id:e,labelKey:te[e],warning:void 0!==t&&!0===t[e]})))(s,_s),Ys=Te(s),Qs=Gs.filter(e=>e.warning).map(t=>e(t.labelKey)),Js=Gs.some(e=>e.id===Pt)?Pt:"overview",Zs=qe(Vs,s),Xs="overview"===Js?Bs:"usage"===Js?Pr:"quota"===Js?r.createElement(Ia,null):"models"===Js?r.createElement(Oa,{SubagentSection:aa}):"diagnostics"===Js?Zr:"maintenance"===Js?null===Zs?r.createElement("div",{"data-testid":"maintenance-empty",style:Da},e("maintenance.empty")):"restart"===Zs?vs:"backup"===Zs?Ps:"skills"===Zs?r.createElement(ya,null):"subagent"===Zs?r.createElement(aa,null):r.createElement(Ma,null):"notifications"===Us?r.createElement("div",{"data-testid":"config-notifications-page",style:Object.assign({},qa,!1===s.taskNotifications?{opacity:.55}:{})},Ms,...!1===s.taskNotifications?[r.createElement("p",{key:"notify-off-hint",style:Object.assign({},Ta,{marginTop:"8px"})},e("config.notificationsDisabled"))]:[]):"navOrder"===Us?r.createElement(Jt,null):r.createElement("div",{style:qa},r.createElement(Qt,null));return r.createElement("div",{"data-testid":"service-panel-root","data-dshsvc-root":"","data-dshsvc-page":Js,className:"dshsvc-page"},Qs.length>0?r.createElement("div",{role:"alert",style:{marginBottom:"12px",padding:"11px 13px",borderRadius:"8px",background:"rgba(198,128,0,0.16)",border:"1px solid rgba(198,128,0,0.48)"}},r.createElement("div",{style:{fontSize:"13px",fontWeight:700}},e("tabs.alert.title")),r.createElement("div",{style:Object.assign({},Ta,{marginTop:"3px"})},e("tabs.alert.body",{tabs:Qs.join(e("tabs.alert.join"))}))):null,r.createElement(Ie,{items:Gs.map(t=>({id:t.id,label:e(t.labelKey),icon:"diagnostics"===t.id?"health":t.id,warning:t.warning,badge:"maintenance"===t.id&&null!==$s&&"running"===$s.phase?{testid:"skills-tab-badge",text:$s.done+"/"+$s.total}:null})),activeId:Js,onChange:e=>{Ha()&&(jt(e),"diagnostics"===e&&ia(!1))},testIdPrefix:"service-tab",dotLabel:e("tabs.alert.dot"),ariaLabel:e("nav.label")}),r.createElement(Me,{title:e(te[Js]),description:void 0!==ze[Js]?e(ze[Js]):null,action:"diagnostics"===Js?r.createElement("button",{type:"button","data-testid":"diagnostics-recheck","data-variant":"neutral",style:wa,onClick:()=>ia(!0),disabled:f},e(f?"health.checking":g?"health.recheck":"health.check")):null}),"maintenance"===Js&&Ys.length>0?r.createElement(Ie,{items:Ys.map(t=>({id:t.id,label:e(t.labelKey)})),activeId:Zs,onChange:e=>{Fs(e);try{localStorage.setItem("dsh-service-maintenance-tab",e)}catch(e){}},testIdPrefix:"maintenance-tab",variant:"sub",ariaLabel:e("tabs.maintenance")}):null,"configuration"===Js?r.createElement(Ie,{items:Ae.map(t=>({id:t.id,label:e(t.labelKey)})),activeId:Us,onChange:Ks,testIdPrefix:"config-tab",variant:"sub",ariaLabel:e("tabs.configuration")}):null,r.createElement("div",{"data-testid":"tab-panel",style:{padding:"14px 2px 2px",color:"var(--dsw-alias-label-primary)"}},Xs))}const La=["M10.268 21a2 2 0 0 0 3.464 0","m15 8 2 2 4-4","M16.8607 4.4824A6 6 0 0 0 6 8C6 12.499 4.589 13.956 3.262 15.326","M3.262 15.326A1 1 0 0 0 4 17H20A1 1 0 0 0 20.74 15.327C20.209 14.779 19.665 14.218 19.203 13.454"],Na=["M10.268 21a2 2 0 0 0 3.464 0","M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742","m2 2 20 20","M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05"];function Wa(){const{enabled:e,setEnabled:t}=Oe(),a=J();return r.createElement("button",{type:"button",title:a(e?"notification.bellOn":"notification.bellOff"),style:{background:"transparent",border:0,cursor:"pointer",padding:"2px 4px",color:"inherit",opacity:e?1:.45,lineHeight:0},onClick:()=>{"undefined"!=typeof Notification&&("granted"===Notification.permission?t(!e):Notification.requestPermission().then(e=>{"granted"===e&&t(!0)}))}},(s=e,r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"}},(s?La:Na).map(function(e,t){return r.createElement("path",{key:t,d:e})}))));var s}t.slots.inject("conversation.input.left",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("taskNotifications")&&Re.current.bellVisible&&(e=t.slots.register({name:"conversation.input.left",id:"dsh-service-notify",order:90,label:()=>u("notification.bellOn")},()=>r.createElement(Wa,null)))};a();const s=g.subscribe(a),n=Le(a);return()=>{s(),n(),null!==e&&e()}}),t.slots.inject("settings.plugin.item",()=>t.slots.register({name:"settings.plugin.item",id:"dsh-service",key:"dsh-service",order:40},()=>r.createElement(Gt,null))),t.slots.inject("plugins.bundle.config",()=>t.slots.register({name:"plugins.bundle.config",key:"@gehennawu/dsh-service"},e=>"page"===e?.view?r.createElement(Gt,null):null)),t.slots.inject("settings.section",()=>{const e=t.slots.register({name:"settings.section",id:"dsh-service",order:99,label:()=>u("nav.label")},()=>r.createElement(Da,null));We.sync(),Be.sync(),Pe.sync(),je.sync();const a=g.subscribe(Be.sync),s=g.subscribe(Pe.sync),n=g.subscribe(je.sync);return()=>{a(),s(),n(),e(),We.disposeEntry(),Be.disposeEntry(),Pe.disposeEntry(),je.disposeEntry()}}),t.slots.inject("shell.overlay",()=>t.slots.register({name:"shell.overlay",id:"dsh-service-restart",order:100,label:()=>u("overlay.label")},()=>r.createElement(Ve,null)));const Ba=function({ctx:e,useTranslation:t}){const a=()=>{try{return"undefined"!=typeof document&&null!==document.querySelector('[data-shortcut-modal="settings"]')}catch(e){return!1}},s=()=>{try{const t="function"==typeof e.slots?.entries?e.slots.entries("sidebar.settings"):[];for(const e of t){const t=e&&e.store;if(!t||"function"!=typeof t.create)continue;const a=t.create(),r=a&&a.actions&&a.actions.open;if("function"==typeof r)return r(),!0}}catch(e){}return!1},n=()=>{try{const t="function"==typeof e.get?e.get("shortcuts"):void 0,a=t&&t.registry;if(!a||"function"!=typeof a.invoke)return!1;const r=t.catalog,s=r&&"function"==typeof r.getSnapshot?r.getSnapshot():null;return!(!Array.isArray(s)||!s.some(e=>e&&"settings.open"===e.id)||(a.invoke("settings.open",{region:"page",modal:null,target:"undefined"==typeof document?null:document.body}),0))}catch(e){}return!1},o=()=>{try{if("undefined"==typeof document)return!1;const e=document.querySelector('[data-slot="sidebar.settings"] button[aria-haspopup="menu"]');if(!e)return!1;e.click();const t=document.querySelector('[role="menu"] [role="menuitem"], [role="menuitem"]');return t?(t.click(),!0):(e.click(),!1)}catch(e){}return!1},l=(e,t)=>{try{e&&e.dataset&&(e.dataset.dshsvcOpenVia=t)}catch(e){}},i=(e,t,r)=>{a()||(()=>{try{if("undefined"==typeof document)return!1;for(const e of document.querySelectorAll('[role="dialog"]'))if("settings"!==e.getAttribute("data-shortcut-modal"))return!0;return!1}catch(e){return!1}})()||r>=t.length||(t[r]()?0===r?Promise.resolve().then(()=>{"undefined"==typeof document||a()?l(e,"store"):i(e,t,r+1)}):l(e,1===r?"shortcut":"menu"):i(e,t,r+1))},d=e=>{const t=e&&e.currentTarget?e.currentTarget:null;i(t,[s,n,o],0)};return{SettingsEntry:function(e){const a=t(),s=null==e||!1!==e.wide,n=a("settingsEntry.label");return r.createElement("button",{type:"button","data-dshsvc-settings-entry":"","data-collapsed":s?"false":"true","data-testid":"dsh-service-settings-entry",title:n,"aria-label":n,onClick:d},r.createElement("span",{"data-dshsvc-settings-entry-icon":""},r.createElement("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,display:"block"}},r.createElement("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),r.createElement("circle",{cx:12,cy:12,r:3}))),s?r.createElement("span",{"data-dshsvc-settings-entry-label":""},n):null)},openSettings:d}}({ctx:t,useTranslation:J});t.slots.inject("sidebar.footer.action",()=>t.slots.register({name:"sidebar.footer.action",id:"dsh-service-settings-entry",order:50,label:()=>u("settingsEntry.label")},e=>r.createElement(Ba.SettingsEntry,e))),t.slots.inject("conversation.input.right",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("quotaLookup")&&(e=t.slots.register({name:"conversation.input.right",id:"dsh-service-quota-ring",order:95,label:()=>u("quota.ring.label"),inject:e=>{if(null==e)return{};try{const t=$e();if(void 0===t||"function"!=typeof t.directoryFor)return{sessionId:e};const a=t.directoryFor(e);return{sessionId:e,directoryStore:a.store,loadDirectory:()=>{try{const e=a.load();e&&"function"==typeof e.catch&&e.catch(()=>{})}catch(e){}}}}catch(t){return{sessionId:e}}}},e=>r.createElement(Kt,e)))};a();const s=g.subscribe(a);return()=>{s(),null!==e&&e()}}),t.slots.inject("conversation.composer.dock",()=>{let e=null;const a=()=>{null!==e&&(e(),e=null),b("subagentRoute")&&b("subagentModelsDock")&&(e=t.slots.register({name:"conversation.composer.dock",id:"dsh-service-subagent-models-dock",order:60,label:()=>u("subagent.dock.label"),inject:e=>({sessionId:e})},e=>r.createElement(Z,e)))};a();const s=g.subscribe(a);return()=>{s(),null!==e&&e()}});const Pa=L,ja=(e,t)=>{const a="editor.error."+("string"==typeof t&&""!==t?t:"internal"),r=e(a,{limit:"2 MiB"});return r===a?e("editor.error.internal"):r},$a=[],_a=e=>{const t=$a[e];try{t.button.remove()}catch(e){}$a.splice(e,1)},Va=()=>{for(;$a.length>0;)_a($a.length-1)},Fa=()=>{const e=P();if(null===e)return;const t=u("editor.viewer"),a=b("fileEditor"),r=a?j(e,B):[];for(let e=$a.length-1;e>=0;e-=1){const a=$a[e];r.includes(a.menu)&&$(a.menu)!==t||_a(e)}if(a){for(const e of $a)if(e.button.textContent!==t){e.button.textContent=t;try{e.button.setAttribute("aria-label",t),e.button.setAttribute("title",t)}catch(e){}}for(const a of r){if($(a)===t)continue;if($a.some(e=>e.menu===a))continue;const r=a.parentNode;if(null==r||"function"!=typeof e.createElement||"function"!=typeof r.insertBefore)continue;const s=e.createElement("button");s.type="button",s.setAttribute(N,""),s.setAttribute("aria-label",t),s.setAttribute("title",t),s.textContent=t,Object.assign(s.style,{minHeight:"22px",marginRight:"4px",padding:"1px 8px",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:"var(--dsh-svc-radius-control, 6px)",background:"transparent",color:"var(--dsw-alias-label-secondary)",font:"inherit",fontSize:"12px",lineHeight:"18px",cursor:"pointer",flex:"none"}),s.addEventListener("click",a=>{try{a?.preventDefault?.()}catch(e){}try{a?.stopPropagation?.()}catch(e){}G(e,e=>e===t,{menu:F(s),isAlive:()=>K.isAlive()})}),r.insertBefore(s,a),$a.push({menu:a,button:s})}}};function Ua(e){const t=J(),a="string"==typeof e?.tab?.contentId?e.tab.contentId:"";if(!a.startsWith("dsh-resource://file/")||!V(a))return null;const s=P();return(null===s?[]:j(s,B)).some(e=>$(e)===t("editor.viewer"))?null:r.createElement("button",{type:"button",role:"menuitem","data-testid":"file-editor-menu-item",[W]:"",onClick:()=>{try{e?.dismiss?.()}catch(e){}const a=P(),r=null===a?[]:j(a,B);1===r.length&&G(a,e=>e===t("editor.viewer"),{menu:r[0],isAlive:()=>K.isAlive()})},style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",border:0,background:"transparent",color:"var(--dsw-alias-label-primary)",font:"inherit",fontSize:"12px",lineHeight:"18px",cursor:"pointer",whiteSpace:"nowrap"}},t("editor.viewer"))}function Ka(e){const t=J(),a="string"==typeof e?.resourceAddress?e.resourceAddress:"",s=!1!==e?.wrap,n=e?.content,[o,l]=r.useState({phase:"loading",text:"",version:"",path:"",bytes:0,error:""}),[i,c]=r.useState(null),[u,p]=r.useState(!1),[m,g]=r.useState(""),[h,f]=r.useState(null),[b,v]=r.useState(null),[y,w]=r.useState(null),x=r.useRef(0),k=r.useRef(n),S=r.useRef(o),E=r.useRef(null),C=r.useRef(!1),T=r.useRef(null),q=r.useRef(null),A=r.useRef(null),z=e=>{S.current=e,l(e)},M=e=>{E.current=e,c(e)},I=e=>{C.current=e,p(e)},R=e=>{T.current=e,v(e)},O=()=>(x.current+=1,x.current),H=e=>x.current===e,D=()=>{if(!0===C.current)return;const e=O();z({phase:"loading",text:"",version:"",path:"",bytes:0,error:""}),M(null),f(null),R(null),g(""),I(!1),d("file-read",{address:a}).then(t=>{if(!H(e))return;if(!t||!0!==t.ok)return void z({phase:"error",text:"",version:"",path:"",bytes:0,error:"string"==typeof t?.error?t.error:"internal"});const a=t.value||{};z({phase:"ready",text:"string"==typeof a.text?a.text:"",version:"string"==typeof a.version?a.version:"",path:"string"==typeof a.path?a.path:"",bytes:Number.isFinite(a.bytes)?a.bytes:0,error:""})}).catch(()=>{H(e)&&z({phase:"error",text:"",version:"",path:"",bytes:0,error:"internal"})})},L=(e,t,r={})=>{const s="undo"===r?.kind?"undo":"save";if(!0===C.current)return;if("string"!=typeof e)return;const n=O();I(!0),g(""),d("file-write",{address:a,text:e,version:t,force:!0===r?.force}).then(a=>{if(!H(n))return;if(I(!1),!a||!0!==a.ok){const e="string"==typeof a?.error?a.error:"internal";return"file-stale"===e?void f({kind:s}):void g(e)}const o=a.value||{},l="string"==typeof o.version&&""!==o.version?o.version:"string"==typeof t?t:"",i=S.current;z({phase:"ready",text:e,version:l,path:"string"==typeof o.path&&""!==o.path?o.path:i.path,bytes:Number.isFinite(o.bytes)?o.bytes:i.bytes,error:""}),R("undo"===s?null:"string"==typeof o.before?{text:o.before,version:l}:null);const d=E.current;null===d||d===e?(M(null),f(null),g("saved"),"preview"===r?.leaveAfter&&V()):f(null)}).catch(()=>{H(n)&&(I(!1),g("internal"))})};r.useEffect(()=>(k.current=n,D(),()=>{x.current+=1}),[a]),r.useEffect(()=>{if(k.current===n)return;if(k.current=n,!0===C.current)return;const e=E.current;null!==e&&e!==S.current.text||D()},[n]);const N=null!==i&&i!==o.text,W="error"===o.phase?o.error:"",B=!0===u?t("editor.saving"):!0===N?t("editor.unsaved"):"saved"===m?t("editor.saved"):"",j=!0===u?"var(--dsw-alias-label-secondary)":!0===N?"var(--dsw-alias-state-warn-primary)":"var(--dsw-alias-state-success-primary)",$=e=>({minHeight:"26px",padding:"2px 9px",fontSize:"12px",borderRadius:"var(--dsh-svc-radius-control, 6px)",border:"1px solid "+("primary"===e?"var(--dsh-svc-brand)":"var(--dsw-alias-border-l2)"),background:"primary"===e?"var(--dsh-svc-brand)":"transparent",color:"primary"===e?"var(--dsh-svc-brand-text)":"var(--dsw-alias-label-primary)",cursor:"pointer"}),_=(e,a,s,n,o)=>r.createElement("button",{type:"button","data-testid":e,disabled:!0===o,onClick:s,style:Object.assign($(n),!0===o?{opacity:.5,cursor:"default"}:{})},t(a)),V=()=>{const e=F(q.current);return null!=e&&G(P(),e=>e!==t("editor.viewer"),{menu:e,isAlive:()=>K.isAlive()})},U=r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",padding:"6px 10px",borderBottom:"1px solid var(--dsw-alias-border-l1)",fontSize:"12px"}},r.createElement("span",{"data-testid":"file-editor-path",title:""!==o.path?o.path:a,style:{flex:"1 1 90px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--ds-font-family-code, monospace)",color:"var(--dsw-alias-label-secondary)"}},""!==o.path?o.path:a),""!==B?r.createElement("span",{"data-testid":"file-editor-status",role:"status","aria-live":"polite",style:{flex:"none",fontWeight:600,color:j}},B):null,r.createElement("span",{style:{display:"flex",gap:"6px",marginLeft:"auto",flex:"none"}},_("file-editor-preview","editor.preview",()=>{!0!==C.current&&(!0!==N?V():w("preview"))},"ghost",u),null!==b?_("file-editor-undo","editor.undo",()=>{!0!==C.current&&null!==b&&w("undo")},"ghost",u):null,_("file-editor-reload","editor.reload",()=>{!0!==C.current&&(!0!==N?D():w("reload"))},"ghost",u),_("file-editor-save","editor.save",()=>L(E.current??o.text,o.version,{kind:"save"}),"primary",u||!N))),Y=null!==h&&"save"===h.kind?r.createElement("div",{"data-testid":"file-editor-conflict",style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700,color:"var(--dsw-alias-state-warn-primary)"}},t("editor.conflict.title")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t("editor.conflict.body")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},_("file-editor-conflict-reload","editor.conflict.reload",()=>D(),"ghost",u),_("file-editor-conflict-overwrite","editor.conflict.overwrite",()=>L(E.current??o.text,o.version,{kind:"save",force:!0}),"primary",u))):null,Q=null!==h&&"undo"===h.kind?r.createElement("div",{"data-testid":"file-editor-undo-conflict",style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-state-warn-primary)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700,color:"var(--dsw-alias-state-warn-primary)"}},t("editor.undoConflict.title")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t("editor.undoConflict.body")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},_("file-editor-undo-conflict-reload","editor.conflict.reload",()=>D(),"ghost",u),_("file-editor-undo-conflict-dismiss","editor.undoConflict.dismiss",()=>f(null),"ghost",!1))):null,Z={preview:"editor.confirm.previewTitle",reload:"editor.confirm.reloadTitle",undo:"editor.confirm.undoTitle"},X=null===y?null:r.createElement("div",{"data-testid":"file-editor-confirm",role:"alertdialog","aria-label":t(Z[y]??"editor.confirm.previewTitle"),style:{margin:"8px 10px 0",padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsh-svc-raised-bg, transparent)",fontSize:"12px",lineHeight:1.6}},r.createElement("div",{style:{fontWeight:700}},t(Z[y]??"editor.confirm.previewTitle")),r.createElement("p",{style:{margin:"4px 0 8px",color:"var(--dsw-alias-label-secondary)"}},t({preview:"editor.confirm.previewBody",reload:"editor.confirm.reloadBody",undo:"editor.confirm.undoBody"}[y]??"editor.confirm.previewBody")),r.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},"preview"===y?_("file-editor-confirm-save","editor.confirm.saveBack",()=>{w(null),L(E.current??o.text,o.version,{kind:"save",leaveAfter:"preview"})},"primary",u):null,"undo"===y?_("file-editor-confirm-save","editor.undo",()=>(()=>{const e=T.current;w(null),null!=e&&(M(null),L(e.text,e.version,{kind:"undo"}))})(),"primary",u):null,"reload"===y?_("file-editor-confirm-discard","editor.confirm.reloadGo",()=>{w(null),D()},"primary",u):null,"preview"===y?_("file-editor-confirm-discard","editor.confirm.discardBack",()=>{w(null),V()},"ghost",!1):null,_("file-editor-confirm-cancel","editor.confirm.cancel",()=>(()=>{w(null);try{A.current?.focus?.()}catch(e){}})(),"ghost",!1))),ee=""===m||"saved"===m?null:r.createElement("p",{"data-testid":"file-editor-notice",style:{margin:"8px 10px 0",fontSize:"12px",color:"var(--dsw-alias-state-error-primary)"}},ja(t,m)),te="loading"===o.phase?r.createElement("p",{"data-testid":"file-editor-loading",style:{margin:"12px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary)"}},t("editor.loading")):"error"===o.phase?r.createElement("div",{"data-testid":"file-editor-error",style:{margin:"12px 10px",fontSize:"12px",lineHeight:1.6,color:"var(--dsw-alias-label-secondary)"}},r.createElement("p",{style:{margin:"0 0 8px"}},ja(t,W)),_("file-editor-retry","editor.retry",()=>D(),"ghost",!1)):r.createElement("textarea",{"data-testid":"file-editor-textarea",ref:A,"aria-label":t("editor.viewer"),value:null!==i?i:o.text,spellCheck:!1,onChange:e=>M("string"==typeof e?.target?.value?e.target.value:""),onKeyDown:e=>{!0!==e?.ctrlKey&&!0!==e?.metaKey||"s"!==e?.key&&"S"!==e?.key||(e.preventDefault(),!0!==C.current&&N&&L(E.current??o.text,o.version,{kind:"save"}))},style:{flex:"1 1 auto",minHeight:"160px",margin:0,padding:"8px 10px",border:0,outline:"none",resize:"none",background:"transparent",color:"var(--dsw-alias-label-primary)",fontFamily:"var(--ds-font-family-code, monospace)",fontSize:"12px",lineHeight:1.6,tabSize:2,whiteSpace:s?"pre-wrap":"pre",overflow:"auto",overflowWrap:s?"anywhere":"normal"}});return r.createElement("div",{"data-dshsvc-editor":"",ref:q,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,color:"var(--dsw-alias-label-primary)"}},U,X,Y,Q,ee,te,r.createElement("div",{style:{flex:"none",padding:"4px 10px 6px",fontSize:"11px",color:"var(--dsw-alias-label-tertiary)"}},t("editor.keyHint")))}const Ga=()=>{if(!b("fileEditor"))return;const e=[],a=e=>{if(null!=e&&void 0!==e.documentPreviews)return e.documentPreviews;try{return"function"==typeof t.get?t.get("documentPreviews"):void 0}catch(e){return}},n=a=>{if(null==a||"function"!=typeof a.register)return;let n=null;try{n=a.register({id:D,extensions:Pa,priority:"builtin",title:()=>u("editor.viewer"),loading:"text-pages",wrap:!0})}catch(e){return}e.push(n),e.push(t.slots.inject("sidebar.right.tab.document",()=>t.slots.register({name:"sidebar.right.tab.document",key:D,locale:s},Ka))),e.push(t.slots.inject("sidebar.right.tab.menu.item",()=>t.slots.register({name:"sidebar.right.tab.menu.item",id:"dsh-service-editor",order:40},e=>r.createElement(Ua,e)))),e.push((()=>{K=(()=>{const e={alive:!0};return U.add(e),{isAlive:()=>!0===e.alive,dispose:()=>{e.alive=!1,U.delete(e)}}})(),Fa();let e=()=>{};try{if("function"==typeof t.locale?.subscribe){const a=t.locale.subscribe(()=>{try{Fa()}catch(e){}});"function"==typeof a&&(e=a)}}catch(e){}const a=P();if(null===a||"function"!=typeof MutationObserver)return()=>{e(),Va()};let r=!1;const s=()=>{r||(r=!0,Promise.resolve().then(()=>{r=!1;try{Fa()}catch(e){}}))};let n=null;try{n=new MutationObserver(s),n.observe(a.documentElement??a.body??a,{childList:!0,subtree:!0,characterData:!0})}catch(e){n=null}return()=>{try{n?.disconnect()}catch(e){}e(),Va(),K.dispose(),(()=>{for(const e of U)e.alive=!1;U.clear()})()}})())};return"function"==typeof t.inject?e.push(t.inject(["documentPreviews"],e=>{n(a(e))})):n(a(void 0)),()=>{for(const t of e)try{t()}catch(e){}}};t.effect(()=>{let e=b("fileEditor"),t=!0===e?Ga():void 0;const a=g.subscribe(()=>{const a=b("fileEditor");a!==e&&(e=a,"function"==typeof t&&t(),t=!0===a?Ga():void 0)});return()=>{a(),"function"==typeof t&&t()}},"dsh-service file editor");const Ya=(()=>{const e={observer:null,btn:null,styleTag:null,retryTimer:null,retryLeft:0,scrollHandler:null,rafId:null,slotRO:null},a=we(),r=()=>{if(null!==e.retryTimer){try{e.retryTimer()}catch(e){}e.retryTimer=null}},s=()=>{if(null!==e.btn&&e.btn.isConnected)try{const t=a.toBottomSlot();if(null===t)return;const r=a.scrollportOf(t);if(null===r||"function"!=typeof r.querySelectorAll)return;let s=!1;for(const e of a.userRows(r))if(a.flowTopOf(r,e)<4){s=!0;break}const o=null!==a.loadOlderButton(r);e.btn.style.display=s||o?"flex":"none",n()}catch(e){}},n=()=>{if(null!==e.btn&&e.btn.isConnected)try{const t=a.toBottomSlot();if(null===t||"function"!=typeof t.querySelector)return;const r=a.toBottomButton(t);let s=0;if(null!==r){const e=t.getBoundingClientRect().right,a=r.getBoundingClientRect().right;s=Math.max(0,Math.round(e-a))}const n=`${s}px`;e.btn.style.right!==n&&(e.btn.style.right=n)}catch(e){}},o=()=>{if(null===e.btn||!e.btn.isConnected)try{const o=a.toBottomSlot();if(null===o||"function"!=typeof o.appendChild||"function"!=typeof o.querySelector)return;const l=a.toBottomButton(o),i=document.createElement("button");i.type="button",i.setAttribute("data-dshsvc-user-jump",""),i.setAttribute("aria-label",u("conversation.jump.previousReply"));let d=0;try{if(null!==l){const e=o.getBoundingClientRect().right,t=l.getBoundingClientRect().right;d=Math.max(0,Math.round(e-t))}}catch(e){}Object.assign(i.style,{position:"absolute",right:`${d}px`,bottom:"42px",zIndex:"1",width:"34px",height:"34px",padding:"0",cursor:"pointer",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-button-floating-fill)",color:"var(--dsw-alias-label-primary)",boxShadow:"var(--dsw-shadow-lv2)",..._("100px"),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto"}),i.innerHTML=(e=>{try{const t=a.toBottomButton(e),r=null!==t?t.querySelector("svg"):null;if(null!==r&&"string"==typeof r.outerHTML)return r.outerHTML.replace(/<svg/i,'<svg style="transform:rotate(180deg)"')}catch(e){}return'<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"><path d="M7 10.5V3.5M3.5 7 7 3.5 10.5 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'})(o),i.addEventListener("click",()=>{const s=a.scrollportOf(o);if(null===s||"function"!=typeof s.querySelectorAll)return;const n=Number(s.scrollTop)||0,l=()=>{e.retryTimer=null;const r=Number(s.scrollTop)||0;if(Math.abs(r-n)>40)try{s.scrollTop=n}catch(e){}const o=a.userRows(s);let i=null;for(let e=o.length-1;e>=0;e-=1)if(a.flowTopOf(s,o[e])<4){i=o[e];break}if(null!==i){const e=Math.max(0,n+a.flowTopOf(s,i)-12);try{s.scrollTop=e}catch(e){}return}if(e.retryLeft<=0)return;e.retryLeft-=1;const d=a.loadOlderButton(s);if(null!==d){if(!0!==d.disabled)try{d.click()}catch(e){}e.retryTimer=t.timer.timeout(l,220)}};r(),e.retryLeft=20,l()}),o.appendChild(i),e.btn=i,(()=>{if("function"==typeof ResizeObserver){if(null!==e.slotRO){try{e.slotRO.disconnect()}catch(e){}e.slotRO=null}try{const t=a.toBottomSlot();if(null===t)return;const r=new ResizeObserver(()=>{n()});r.observe(t),e.slotRO=r}catch(t){e.slotRO=null}}})(),s()}catch(e){}};return{start:()=>{try{if(null===e.styleTag){const t=document.createElement("style");t.dataset.plugin="@gehennawu/dsh-service",t.dataset.pluginCss="@gehennawu/dsh-service/user-jump.css",t.textContent="[data-dshsvc-user-jump]:hover,[data-dshsvc-user-jump]:active{background:var(--dsw-alias-button-floating-hover)!important}",document.head.appendChild(t),e.styleTag=t}}catch(e){}if(o(),null===e.observer){try{e.observer=new MutationObserver(()=>{o(),s()}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0})}catch(t){e.observer=null}if(null===e.scrollHandler)try{e.scrollHandler=()=>{if("function"==typeof requestAnimationFrame){if(null!==e.rafId)return;e.rafId=requestAnimationFrame(()=>{e.rafId=null,s()})}else s()},document.documentElement.addEventListener("scroll",e.scrollHandler,!0)}catch(t){e.scrollHandler=null}}},stop:()=>{if(r(),null!==e.slotRO){try{e.slotRO.disconnect()}catch(e){}e.slotRO=null}if(null!==e.scrollHandler){try{document.documentElement.removeEventListener("scroll",e.scrollHandler,!0)}catch(e){}e.scrollHandler=null}if(null!==e.rafId){try{cancelAnimationFrame(e.rafId)}catch(e){}e.rafId=null}if(null!==e.observer){try{e.observer.disconnect()}catch(e){}e.observer=null}if(null!==e.btn){try{e.btn.remove()}catch(e){}e.btn=null}if(null!==e.styleTag){try{e.styleTag.remove()}catch(e){}e.styleTag=null}}}})();t.effect(()=>(Ya.start(),()=>Ya.stop()),"dsh-service user reply jump");const Qa=xe({ctx:t,getModelDirectories:$e});t.effect(()=>{let e=!1;const t=()=>{const t=b("modelProviderIcons");t&&!e?(e=!0,Qa.revive(),Qa.start()):!t&&e&&(e=!1,Qa.stop())},a=g.subscribe(t);return t(),()=>{a(),e&&Qa.stop()}},"dsh-service model provider icons");const Ja=ye({ctx:t,t:u,featureEnabled:b,createConversationNav:we});t.effect(()=>{const e=g.subscribe(()=>Ja.evaluate());return Ja.evaluate(),()=>{e(),Ja.dispose()}},"dsh-service mobile adaptation")},a.subagentLine={aggregateSubagentRoutes:de,subagentRouteListText:ce},a.featureSettings={create:Se},a.fileEditor={id:D,extensions:L,selectViewerItem:G,editorExtensionMatches:V,attr:N,menuItemAttr:W},a.modelProviderIcons={resolve:T,dataUri:k,attr:d,seatAttr:c,triggerAttr:m,officialIconVar:b,slotKey:g,ariaTriggerSelector:h,triggerLegacySelector:f,groupTitleSelector:w,groupTitleLegacySelector:x,sizeVar:p,basePx:15,menuGroupAttr:v,menuGroupIconAttr:y,menuGroupPx:13,css:A,slugs:Object.keys(o),providerCount:Object.keys(l).length,quotaAdaptedKind:C,quotaKindSlugs:E,quotaStore:S},t}});
|