/// CLI flag enabling release profile compilation for multi-locale WASM bundles.
pub const DOCS_FLAG_RELEASE: &str = "--release";
/// CLI flag enabling debug profile compilation for multi-locale WASM bundles.
pub const DOCS_FLAG_DEBUG: &str = "--debug";
/// CLI flag selecting a single locale to build (`--locale <dir|prefix|label>`).
pub const DOCS_FLAG_LOCALE: &str = "--locale";
/// CLI flag forcing legacy single-locale static HTML output even when `locales:` is declared.
pub const DOCS_FLAG_STATIC_HTML: &str = "--static-html";
pub(crate) const BUNDLE_PKG_DIR: &str = "pkg";
pub(crate) const BUNDLE_INDEX_HTML: &str = "index.html";
pub(crate) const BUNDLE_NOT_FOUND_HTML: &str = "404.html";
pub(crate) const BUNDLE_PUBLIC_DIR: &str = "public";
pub(crate) const BUNDLE_BUILDER_DIR: &str = "euv-docs-wasm-builder";
pub(crate) const BUNDLE_TARGET_DIR: &str = "euv-docs-wasm-target";
pub(crate) const BUNDLE_CRATE_NAME: &str = "euv_docs_site";
pub(crate) const BUNDLE_SHELL_JSON_FILE: &str = "site_shell.json";
pub(crate) const BUNDLE_BODIES_BIN_FILE: &str = "site_bodies.euvz";
pub(crate) const BUNDLE_CARGO_TOML: &str = "Cargo.toml";
pub(crate) const BUNDLE_SRC_DIR: &str = "src";
pub(crate) const BUNDLE_LIB_RS: &str = "lib.rs";
pub(crate) const BUNDLE_WASM_PACK_BIN: &str = "wasm-pack";
pub(crate) const BUNDLE_ARG_BUILD: &str = "build";
pub(crate) const BUNDLE_ARG_TARGET: &str = "--target";
pub(crate) const BUNDLE_ARG_WEB: &str = "web";
pub(crate) const BUNDLE_ARG_NO_TS: &str = "--no-typescript";
pub(crate) const BUNDLE_ARG_OUT_DIR: &str = "--out-dir";
pub(crate) const BUNDLE_ARG_OUT_NAME: &str = "--out-name";
pub(crate) const BUNDLE_ARG_DEV: &str = "--dev";
pub(crate) const BUNDLE_ENV_TARGET_DIR: &str = "CARGO_TARGET_DIR";
pub(crate) const BUNDLE_ENV_RUSTC_WRAPPER: &str = "RUSTC_WRAPPER";
pub(crate) const BUNDLE_NAME_PREFIX: &str = "euv_docs_";
pub(crate) const BUNDLE_BG_WASM_SUFFIX: &str = "_bg.wasm";
pub(crate) const BUNDLE_JS_EXT: &str = ".js";
pub(crate) const BUNDLE_MJS_EXT: &str = ".mjs";
pub(crate) const BUNDLE_CSS_EXT: &str = ".css";
pub(crate) const BUNDLE_FORBIDDEN_DIRS: [&str; 2] = ["js", "webfonts"];
pub(crate) const BUNDLE_SKIP_FILES: [&str; 1] = [".DS_Store"];
pub(crate) const BUNDLE_EXPORT_PREFIX: &str = "export ";
pub(crate) const BUNDLE_EXPORT_BRACE: &str = "export {";
pub(crate) const BUNDLE_EXPORT_DEFAULT: &str = "export default ";
pub(crate) const BUNDLE_WASM_BINDGEN_VER: &str = "0.2";
pub(crate) const BUNDLE_DIR_CORE: &str = "core";
pub(crate) const BUNDLE_DIR_MACROS: &str = "macros";
pub(crate) const BUNDLE_DIR_UI: &str = "ui";
pub(crate) const BUNDLE_DEFAULT_LOCALE_SUFFIX: &str = "default";
pub(crate) const BUNDLE_ESC_AMP: &str = "&";
pub(crate) const BUNDLE_ESC_LT: &str = "<";
pub(crate) const BUNDLE_ESC_GT: &str = ">";
pub(crate) const BUNDLE_ESC_QUOT: &str = """;
pub(crate) const BUNDLE_HTML_DOCTYPE_OPEN: &str = "<!DOCTYPE html>\n<html lang=\"";
pub(crate) const BUNDLE_ERR_NO_LOCALES: &str =
"No locales declared in root README.md frontmatter for multi-locale WASM build";
pub(crate) const BUNDLE_ERR_NO_MATCHING_LOCALE: &str =
"No locale matched the requested --locale filter";
pub(crate) const BUNDLE_ERR_WASM_PACK: &str = "wasm-pack build failed";
pub(crate) const BUNDLE_WRAPPER_LIB_RS: &str = r#"use wasm_bindgen::prelude::wasm_bindgen;
const SITE_SHELL_JSON: &str = include_str!("site_shell.json");
const SITE_BODIES_BIN: &[u8] = include_bytes!("site_bodies.euvz");
#[wasm_bindgen]
pub fn euv_docs_web_start() -> u64 {
euv_docs::boot_wasm_docs_compressed_bundle(SITE_SHELL_JSON, SITE_BODIES_BIN)
}
#[wasm_bindgen]
pub fn euv_docs_render_route(route: &str) -> u64 {
euv_docs::wasm_docs_render_route(route)
}
#[wasm_bindgen]
pub fn euv_docs_pointer_move(x: f32, y: f32) -> u64 {
euv_docs::wasm_docs_pointer_move(x, y)
}
#[wasm_bindgen]
pub fn euv_docs_pointer_down(x: f32, y: f32) -> u64 {
euv_docs::wasm_docs_pointer_down(x, y)
}
#[wasm_bindgen]
pub fn euv_docs_pointer_up(x: f32, y: f32) -> u64 {
euv_docs::wasm_docs_pointer_up(x, y)
}
#[wasm_bindgen]
pub fn euv_docs_pointer_event(
kind: u8,
pointer_id: u32,
is_touch: bool,
x: f32,
y: f32,
pressure: f32,
) -> u64 {
euv_docs::wasm_docs_pointer_event(kind, pointer_id, is_touch, x, y, pressure)
}
#[wasm_bindgen]
pub fn euv_docs_scroll(dx: f32, dy: f32) -> u64 {
euv_docs::wasm_docs_scroll(dx, dy)
}
#[wasm_bindgen]
pub fn euv_docs_scroll_at(x: f32, y: f32, dx: f32, dy: f32) -> u64 {
euv_docs::wasm_docs_scroll_at(x, y, dx, dy)
}
#[wasm_bindgen]
pub fn euv_docs_key_down(key: &str) -> u64 {
euv_docs::wasm_docs_key_down(key)
}
#[wasm_bindgen]
pub fn euv_docs_resize(width: u32, height: u32, dpr: f32) -> u64 {
euv_docs::wasm_docs_resize(width, height, dpr)
}
#[wasm_bindgen]
pub fn euv_docs_sync_safe_area() -> u64 {
euv_docs::wasm_docs_sync_safe_area()
}
#[wasm_bindgen]
pub fn euv_docs_tick(dt_secs: f32) -> u64 {
euv_docs::wasm_docs_tick(dt_secs)
}
"#;
pub(crate) const BUNDLE_HTML_HEAD_MID: &str = "\">\n<head>\n<meta charset=\"utf-8\"/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,viewport-fit=cover\"/>\n<meta name=\"description\" content=\"";
pub(crate) const BUNDLE_HTML_DESC_END: &str = "\"/>\n<link rel=\"icon\" type=\"image/png\" href=\"https://devhub.vip/pages/docs/img/euv.png\"/>\n<title>";
pub(crate) const BUNDLE_HTML_STYLE_AND_BODY: &str = "</title>\n<style>:root{--euv-safe-top:env(safe-area-inset-top,0px);--euv-safe-right:env(safe-area-inset-right,0px);--euv-safe-bottom:env(safe-area-inset-bottom,0px);--euv-safe-left:env(safe-area-inset-left,0px);}html,body{margin:0;padding:0;width:100vw;height:100vh;height:100dvh;overflow:hidden;background:#09090b;touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;outline:none;}canvas{display:block;width:100%;height:100%;touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;outline:none;}canvas:focus,canvas:focus-visible{outline:none;}</style>\n</head>\n<body>\n<script type=\"module\">\n";
pub(crate) const BUNDLE_HTML_BOOT_PREFIX: &str = "\nawait __wbg_init({ module_or_path: './pkg/";
pub(crate) const BUNDLE_HTML_BOOT_SUFFIX: &str = r#"' });
euv_docs_web_start();
function syncSize(){const vv=window.visualViewport;const w=Math.max(320,Math.round((vv&&vv.width)||window.innerWidth||1200));const h=Math.max(320,Math.round((vv&&vv.height)||window.innerHeight||800));euv_docs_resize(w,h,window.devicePixelRatio||1);euv_docs_sync_safe_area();requestAnimationFrame(()=>{euv_docs_tick(0);});}
syncSize();
window.addEventListener('resize',syncSize);
window.addEventListener('orientationchange',()=>{syncSize();setTimeout(syncSize,120);});
document.addEventListener('fullscreenchange',()=>{syncSize();setTimeout(syncSize,60);});
if(window.visualViewport){window.visualViewport.addEventListener('resize',syncSize);}
if(typeof ResizeObserver==='function'){new ResizeObserver(syncSize).observe(document.documentElement);}
window.addEventListener('hashchange',()=>{const h=(window.location.hash||'').replace(/^#/,'');if(h.startsWith('/'))euv_docs_render_route(h);});
const cvs=document.querySelector('canvas');
if(cvs){
const pt=(ev)=>{const r=cvs.getBoundingClientRect();return [ev.clientX-r.left,ev.clientY-r.top];};
const isTouch=(ev)=>ev.pointerType==='touch';
const press=(ev)=>(typeof ev.pressure==='number'&&ev.pressure>0)?ev.pressure:(ev.buttons>0?1.0:0.0);
cvs.addEventListener('pointerdown',(ev)=>{const [x,y]=pt(ev);if(isTouch(ev)){try{cvs.setPointerCapture(ev.pointerId);}catch(_){}}euv_docs_pointer_event(1,ev.pointerId>>>0,isTouch(ev),x,y,press(ev)||1.0);});
cvs.addEventListener('pointermove',(ev)=>{const [x,y]=pt(ev);euv_docs_pointer_event(0,ev.pointerId>>>0,isTouch(ev),x,y,press(ev));});
cvs.addEventListener('pointerup',(ev)=>{const [x,y]=pt(ev);try{cvs.releasePointerCapture(ev.pointerId);}catch(_){}euv_docs_pointer_event(2,ev.pointerId>>>0,isTouch(ev),x,y,0.0);});
cvs.addEventListener('pointercancel',(ev)=>{const [x,y]=pt(ev);try{cvs.releasePointerCapture(ev.pointerId);}catch(_){}euv_docs_pointer_event(3,ev.pointerId>>>0,isTouch(ev),x,y,0.0);});
cvs.addEventListener('wheel',(ev)=>{ev.preventDefault();const [x,y]=pt(ev);const mult=ev.deltaMode===1?24:(ev.deltaMode===2?(window.innerHeight||800):1);euv_docs_scroll_at(x,y,ev.deltaX*mult,ev.deltaY*mult);},{passive:false});
}
window.addEventListener('keydown',(ev)=>{if(ev.key==='PageDown'||ev.key==='PageUp'||ev.key==='Home'||ev.key==='End'||ev.key==='ArrowDown'||ev.key==='ArrowUp'){ev.preventDefault();}euv_docs_key_down(ev.key);});
let prevTs=performance.now();
function frame(ts){const dt=Math.min(0.1,Math.max(0,(ts-prevTs)/1000));prevTs=ts;euv_docs_tick(dt);requestAnimationFrame(frame);}
requestAnimationFrame(frame);
</script>
</body>
</html>
"#;