@mlightcad/cad-simple-viewer-cli 1.6.3 → 1.7.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.
@@ -0,0 +1,1526 @@
1
+ import{N as ar,W as rr,k as At,h as L,x as st,b as T,o as nr,a as Y,c as ir,z as xe,A as or,d as Rt,X as lr,j as sr,G as ve,e as cr,O as ye,f as dr,L as ur,g as mr,M as pr,i as hr,p as fr,l as $t,D as gr,m as br,n as wr,q as xr,r as la,S as vr,s as yr,w as Lr,t as kr,u as Ar,v as Mr,y as Cr,B as Ir,C as zr,E as ee,F as Sr,H as Pr,I as Or,J as $r,K as Er,P as Nr,Q as Ur,R as Fr,T as _r,U as Br,V as Rr,Y as Tr,Z as Dr,_ as Hr,$ as jr,a0 as Vr,a1 as Zr,a2 as Yr,a3 as Gr,a4 as Xr,a5 as W,a6 as Wr,a7 as dt,a8 as sa,a9 as Kr,aa as ae,ab as Qr,ac as Jr,ad as qr,ae as tn}from"./index-D6ZWapu2.js";import{af as ps,ag as hs}from"./index-D6ZWapu2.js";function re(...t){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${t.map(a=>`<path fill="currentColor" d="${a}"/>`).join("")}</svg>`}const en='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.4379 15.2979h.002l4.86-4.86-9.722-4.86 4.86 9.72Zm7.562-5.298-3.434 3.434 3.2 3.2-1.132 1.132-3.2-3.2-3.434 3.434-7.6-15.6 15.6 7.6Z"/></svg>',an='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.08 12.8537l.002-.002V5.5897c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.6381-.414-.6381 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.4437c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.2317c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388-.26-.446-.518-.892-.776-1.338-.338-.482-1.1-.15-.794.38.326.566.652 1.132.978 1.698.006.012.014.026.02.04.552.946 1.106 1.89 1.658 2.834.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.7921-.124 2.5601-.612.3-.19.572-.416.816-.68.326-.368.57-.776.734-1.204.176-.482.258-.97.258-1.494Zm-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894-.216.564-.53 1.114-.964 1.576-.318.34-.666.632-1.046.884-.978.612-2.1461.862-3.2601.774-1.128-.102-2.228-.564-3.098-1.352-.326-.292-.612-.646-.87-1.034-.558-.96-1.114-1.92-1.672-2.88l-.012-.028c-.326-.568-.652-1.138-.978-1.706-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096.04.074.082.146.122.218V4.2337c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.9721-.51 2.2221.102 2.2221 1.284v.06c.022-.014.046-.026.068-.04Z"/></svg>',rn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M9.3333 14.125 5.875 10.6667V14.125H9.3333Zm4.7917-3.4583-3.4583 3.4583H14.125V10.6667ZM10.6667 5.875 14.125 9.3333V5.875H10.6667ZM5.875 9.3333 9.3333 5.875H5.875V9.3333Zm9.2083 5.475c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917S.9417 7.275 4.1083 4.1083C7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Z"/></svg>',nn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.0833 14.8083c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917C.8417 12.3667.9417 7.275 4.1083 4.1083 7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Zm-3.55-2.6083V7.2083H7.2083v5.5833h5.5833ZM5.875 5.875h8.25v8.25H5.875V5.875Z"/></svg>',on='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65l-149.36-68.1c-16.19-7.4-42.69-7.4-58.88 0L77.3 137.65c-17.6 8-17.6 21.09 0 29.09l148 67.5c16.89 7.7 44.69 7.7 61.58 0l148-67.5c17.52-8 17.52-21.1-.08-29.09M160 308.52l-82.7 37.11c-17.6 8-17.6 21.1 0 29.1l148 67.5c16.89 7.69 44.69 7.69 61.58 0l148-67.5c17.6-8 17.6-21.1 0-29.1l-79.94-38.47"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m160 204.48l-82.8 37.16c-17.6 8-17.6 21.1 0 29.1l148 67.49c16.89 7.7 44.69 7.7 61.58 0l148-67.49c17.7-8 17.7-21.1.1-29.1L352 204.48"/></svg>',ln='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="2" y="2" width="8.2" height="5" rx="1.2" fill="currentColor"/><rect x="2" y="8.5" width="8.2" height="9.5" rx="1.2" fill="currentColor"/><rect x="11.7" y="2" width="6.3" height="10" rx="1.2" fill="currentColor"/><rect x="11.7" y="13.5" width="6.3" height="4.5" rx="1.2" fill="currentColor"/></svg>',sn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M1.5 7h17v6h-17ZM4.25 7h1v2.5h-1ZM7.5 7h.75v1.5H7.5ZM10.25 7h1v2.5h-1ZM13.5 7h.75v1.5H13.5ZM16.25 7h1v2.5h-1Z"/></svg>',cn='<path fill="currentColor" fill-rule="evenodd" d="M2.25 15h15.5v3.4H2.25Zm1.5 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Z"/>',k="var(--el-color-primary, var(--ml-ui-accent, #409eff))";function ut(t){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${t}${cn}</svg>`}const dn=ut(`<rect fill="${k}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${k}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${k}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${k}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${k}" x="6.7" y="6.25" width="6.6" height="1.3"/>`),un=ut(`<rect fill="${k}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${k}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${k}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${k}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${k}" x="6.7" y="6.25" width="6.6" height="1.3"/><circle fill="currentColor" cx="10" cy="3.45" r="2.2"/><text x="10" y="4.42" text-anchor="middle" font-size="3.15" font-weight="700" font-family="Arial,Helvetica,sans-serif" fill="${k}">n</text>`),mn=ut(`<g fill="none" stroke="${k}" stroke-linejoin="miter"><path stroke-width="1.55" stroke-linecap="butt" d="M16.9 12.25H4.9L11.6 3.03"/><path stroke-width="1.7" stroke-linecap="butt" d="M11.05 12.25A6.15 6.15 0 0 0 8.51 7.27"/></g><path fill="${k}" d="M11.05 12.25 9.85 10.55h2.4Z"/><path fill="${k}" d="M8.51 7.27 10.46 7.39 9.23 9.09Z"/>`),pn=ut(`<path fill="${k}" d="M5 12V4.2A7.8 7.8 0 0 1 12.8 12Z"/>`),hn=ut(`<g fill="none" stroke-linejoin="miter"><path stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" d="M4.9 11.6A8.3 8.3 0 0 1 13.2 3.3"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="square" d="M10.4 11.6H13.2V8.8"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" d="M13.2 11.6v1.7"/><rect stroke="${k}" stroke-width="1.15" x="3.65" y="10.35" width="2.5" height="2.5"/><rect stroke="${k}" stroke-width="1.15" x="11.95" y="2.05" width="2.5" height="2.5"/></g>`),fn=ut(`<g fill="none" stroke="${k}" stroke-linecap="round" stroke-linejoin="round"><path stroke-width="1.4" d="M4 4.8v7.4h7.6"/><path stroke-width="1.2" stroke-dasharray="1.7 1.2" d="M4 6.9h7M11 12.2V6.9"/></g><path fill="${k}" d="M4 2.5 2.45 4.8h3.1ZM13.8 12.2 11.5 10.7v3Z"/><circle fill="${k}" cx="11" cy="6.9" r="1.3"/>`),ca='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true"><path d="M 459.5 0 L 475.5 0 L 476.5 1 L 479.5 1 L 485.5 3 Q 487.8 6.2 492.5 7 L 501 14.5 L 505 19.5 L 511 32.5 Q 510.2 35.8 512 36.5 L 512 52.5 L 511 53.5 L 511 56.5 L 509 62.5 L 506 68.5 L 493 89.5 L 483 108.5 L 478 115.5 L 472 127.5 L 467 134.5 L 457 153.5 L 452 160.5 L 442 179.5 L 437 186.5 L 431 198.5 L 440 213.5 L 440 215.5 L 443 220.5 L 447 232.5 L 448 240.5 L 449 241.5 L 449 245.5 L 450 246.5 L 450 254.5 L 451 255.5 L 451 274.5 L 450 275.5 L 450 283.5 L 449 284.5 L 449 289.5 L 448 290.5 L 448 294.5 L 447 295.5 L 446 302.5 L 442 314.5 L 438 322.5 L 438 324.5 L 428 345.5 L 428 347.5 L 425 352.5 L 422 361.5 L 418 368.5 L 418 370.5 L 415 375.5 L 412 384.5 L 408 391.5 L 408 393.5 L 405 398.5 L 402 407.5 L 398 414.5 L 395 423.5 L 391 430.5 L 391 432.5 L 381 453.5 L 381 455.5 L 378 460.5 L 375 469.5 L 371 476.5 L 368 485.5 L 361.5 497 L 353.5 501 L 348.5 501 L 347.5 500 L 344.5 500 L 329.5 495 L 326.5 493 L 321.5 492 L 318.5 490 L 303.5 485 L 289.5 478 L 287.5 478 L 282 473.5 L 279 467.5 L 279 459.5 L 280 458.5 L 280 455.5 L 281 454.5 L 281 451.5 L 282 450.5 L 283 442.5 L 284 441.5 L 286 431.5 L 285.5 431 L 281.5 435 L 259.5 455 L 255.5 457 L 246.5 457 L 223.5 444 L 189.5 421 L 155.5 394 L 133 373.5 L 130 367.5 L 130 359.5 L 134 352.5 L 223 233.5 L 242 206.5 L 254.5 192 L 271.5 177 L 285.5 168 L 299.5 161 L 314.5 156 L 317.5 156 L 318.5 155 L 330.5 154 L 331.5 153 L 352.5 153 L 354 151.5 L 356 146.5 L 372 120.5 L 374 115.5 L 387 94.5 L 397 75.5 L 402 68.5 L 408 56.5 L 413 49.5 L 423 30.5 L 431 17.5 L 439.5 9 L 449.5 3 L 455.5 1 L 458.5 1 L 459.5 0 Z M 466 30 L 459 33 L 454 39 L 448 51 L 443 58 L 433 77 L 428 84 L 414 110 L 409 117 L 407 122 L 405 124 L 403 129 L 401 131 L 399 136 L 384 161 L 386 162 L 388 162 L 396 166 L 409 175 L 422 153 L 424 148 L 429 141 L 431 136 L 433 134 L 435 129 L 437 127 L 439 122 L 444 115 L 454 96 L 459 89 L 469 70 L 474 63 L 482 47 L 482 43 L 480 38 L 475 32 L 469 30 L 466 30 Z M 333 183 L 332 184 L 328 184 L 327 185 L 324 185 L 323 186 L 320 186 L 314 188 L 300 195 L 286 205 L 271 220 L 267 225 L 266 228 L 410 310 L 412 307 L 412 305 L 416 296 L 418 285 L 419 284 L 419 279 L 420 278 L 420 252 L 419 251 L 419 246 L 417 241 L 417 238 L 411 224 L 402 211 L 389 198 L 371 188 L 362 185 L 352 184 L 351 183 L 333 183 Z M 248 252 L 195 322 L 193 326 L 172 353 L 167 361 L 194 384 L 228 409 L 249 422 L 256 417 L 303 372 L 310 368 L 318 368 L 322 370 L 328 378 Q 327 381 329 382 L 329 386 L 326 395 L 326 399 L 323 408 L 323 411 L 322 412 L 322 416 L 319 425 L 319 428 L 318 429 L 318 432 L 317 433 L 317 437 L 314 446 L 314 449 L 313 450 L 313 453 L 312 454 L 316 456 L 318 456 L 331 462 L 343 466 L 351 448 L 351 446 L 354 441 L 354 439 L 357 434 L 357 432 L 364 418 L 364 416 L 367 411 L 367 409 L 370 404 L 370 402 L 377 388 L 377 386 L 380 381 L 380 379 L 383 374 L 383 372 L 387 365 L 390 356 L 393 351 L 393 349 L 396 344 L 397 339 L 375 326 L 373 324 L 368 322 L 366 320 L 361 318 L 354 313 L 349 311 L 347 309 L 342 307 L 340 305 L 335 303 L 321 294 L 316 292 L 314 290 L 309 288 L 307 286 L 302 284 L 295 279 L 276 269 L 248 252 Z "/><path d="M 170.5 100 L 179.5 100 Q 185 102 188 106.5 L 190 110.5 L 190 134.5 L 184.5 142 L 177.5 145 L 171.5 145 L 166.5 143 L 162 138.5 L 159 129.5 L 159 115.5 L 160 114.5 Q 159.2 109.7 161 107.5 L 166.5 102 L 170.5 100 Z "/><path d="M 131.5 140 L 151.5 140 L 156.5 142 L 162 147.5 L 164 151.5 L 164 159.5 L 163 162.5 L 158.5 168 L 152.5 171 L 130.5 171 L 124.5 168 L 122 165.5 L 119 159.5 L 119 151.5 Q 121.3 145.3 126.5 142 L 131.5 140 Z "/><path d="M 197.5 140 L 218.5 140 L 223.5 142 L 228 146.5 L 231 152.5 L 231 158.5 L 229 163.5 L 223.5 169 L 218.5 171 L 197.5 171 L 192.5 169 L 188 164.5 L 186 160.5 L 185 153.5 L 188 146.5 L 191.5 143 L 197.5 140 Z "/><path d="M 171.5 166 L 177.5 166 L 180.5 167 L 187 171.5 L 190 176.5 L 190 200.5 Q 188 206 183.5 209 L 179.5 211 L 173.5 212 L 167.5 210 L 161 203.5 Q 159.2 201.3 160 196.5 L 159 195.5 L 159 181.5 L 162 172.5 L 165.5 169 L 171.5 166 Z "/><path d="M 50.5 223 L 60.5 223 L 68 228.5 L 71 234.5 L 71 256.5 Q 69.1 262.6 64.5 266 L 59.5 268 L 51.5 268 Q 45.3 265.7 42 260.5 L 40 255.5 L 40 235.5 L 42 230.5 L 48.5 224 L 50.5 223 Z "/><path d="M 13.5 263 L 30.5 263 Q 31.5 265 35.5 264 L 43 270.5 L 45 274.5 L 45 282.5 Q 43.1 288.6 38.5 292 L 33.5 294 L 10.5 294 Q 5 292 2 287.5 L 0 283.5 L 0 274.5 Q 2.3 268.3 7.5 265 L 13.5 263 Z "/><path d="M 80.5 263 L 97.5 263 L 103.5 265 L 108 268.5 L 111 273.5 L 112 279.5 L 109 287.5 L 104.5 292 L 100.5 294 L 77.5 294 Q 71.3 291.7 68 286.5 L 66 281.5 L 66 276.5 L 69 269.5 L 72.5 266 L 80.5 263 Z "/><path d="M 54.5 289 L 61.5 290 L 69 296.5 L 71 301.5 L 71 322.5 L 69 327.5 L 63.5 333 L 58.5 335 L 53.5 335 L 46.5 332 L 43 328.5 L 40 321.5 L 40 302.5 Q 41.8 301.8 41 298.5 L 46.5 292 L 54.5 289 Z "/><path d="M 98.5 400 L 107.5 402 L 113 407.5 L 115 411.5 L 115 434.5 Q 112.7 440.7 107.5 444 L 101.5 446 L 96.5 446 L 90.5 443 L 87 439.5 L 84 430.5 L 84 415.5 L 85 414.5 Q 84.3 410.3 86 408.5 L 92.5 402 L 98.5 400 Z "/><path d="M 55.5 441 L 77.5 441 L 80.5 442 L 86 446.5 L 89 451.5 L 89 460.5 Q 86.7 466.7 81.5 470 L 76.5 472 L 56.5 472 L 51.5 470 L 46 464.5 L 44 460.5 L 44 452.5 L 45 449.5 L 49.5 444 L 55.5 441 Z "/><path d="M 121.5 441 L 144.5 441 Q 150.7 443.3 154 448.5 L 156 453.5 L 156 458.5 L 154 464.5 L 148.5 470 L 146.5 470 L 143.5 472 L 122.5 472 L 116.5 469 L 113 465.5 L 111 461.5 L 110 455.5 Q 112 454.5 111 450.5 L 117.5 443 L 121.5 441 Z "/><path d="M 96.5 467 L 103.5 467 L 106.5 468 L 113 473.5 L 115 478.5 L 115 501.5 Q 113 507 108.5 510 L 104.5 512 L 95.5 512 Q 89.3 509.7 86 504.5 Q 84.3 502.7 85 498.5 L 84 497.5 L 84 482.5 L 87 473.5 L 91.5 469 L 96.5 467 Z "/></svg>',gn=ca,bn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" fill="currentColor"/><rect x="14" y="14" width="7" height="7" fill="none" stroke="currentColor" stroke-width="1"/><path d="M12 4a8 8 0 0 1 7.25 7.25" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M20.75 10 L17.25 10 L19 12.5 Z" fill="currentColor"/><path d="M12 20a8 8 0 0 1-8-8" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M6 14 L2.5 14 L4 11 Z" fill="currentColor"/></svg>',wn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" style="fill:none"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12.4 3.25H5.5A2.25 2.25 0 0 0 3.25 5.5v9A2.25 2.25 0 0 0 5.5 16.75h9A2.25 2.25 0 0 0 16.75 14.5V8.6"/><g transform="rotate(45 13.2 6.7)"><rect x="11.7" y="1.55" width="3" height="7.45" rx="1.45"/><path d="M11.7 3.2h3"/><path d="M11.7 9 13.2 12.15 14.7 9"/><rect x="12.8" y="7.05" width="0.8" height="1.2" rx="0.4"/></g></g></svg>',xn='<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" stroke-linejoin="miter" d="M2.6 6.8v8.5h5.2l2.2 2.4 2.2-2.4h5.2"/>',da='<g fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" transform="rotate(46 14.8 9)"><rect x="13.65" y="4.7" width="2.3" height="5.6" rx="1.05"/><path d="M13.65 10.3 14.8 12.9 15.95 10.3"/></g>';function mt(t){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${xn}${t}</svg>`}const vn=mt('<path fill="currentColor" d="M6.4 12.2c-1.85 0-3.3-1.25-3.3-2.85 0-1.35.95-2.5 2.3-2.8.45-1.7 1.95-2.85 3.7-2.85 1.25 0 2.35.55 3.05 1.45.55-.7 1.45-1.15 2.5-1.15 1.85 0 3.25 1.3 3.25 2.95 0 .3-.05.55-.1.8 1.2.4 2.05 1.4 2.05 2.65 0 1.55-1.5 2.8-3.4 2.8H6.4Z"/>'),yn=mt(`<rect fill="none" stroke="currentColor" stroke-width="1.35" x="5" y="2.8" width="8.2" height="7.2"/><rect fill="${k}" x="4.2" y="2" width="2" height="2"/><rect fill="${k}" x="12.2" y="9" width="2" height="2"/>${da}`),Ln=mt(`<ellipse fill="none" stroke="currentColor" stroke-width="1.35" cx="9" cy="6.6" rx="4" ry="3.6"/><rect fill="${k}" x="8" y="2.1" width="2" height="2"/><rect fill="${k}" x="4" y="5.6" width="2" height="2"/>${da}`),kn=mt('<path fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" d="M4.4 12.6 10.2 7"/><rect fill="currentColor" x="10.2" y="1.2" width="7.8" height="5.8" rx=".35"/>'),An=mt('<path fill="currentColor" fill-rule="evenodd" d="M10 2.2 15.3 13.1h-2.2l-1.05-2.95H7.95L6.9 13.1H4.7L10 2.2Zm0 3.4-1.15 3.2h2.3L10 5.6Z"/>'),Mn=mt('<g transform="rotate(-40 10 7.6)" fill="currentColor"><path d="M3.5 6.75h9V5.15L16.7 7.6 12.5 10.05V8.45h-9Z"/></g>'),Cn=re("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"),ua=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="3.5" y="3" width="13" height="14" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M3.5 6.5h13"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M6.5 9.5h7M6.5 12h7M6.5 14.5h3.2"/><g fill="none" stroke="${k}" stroke-width="1.7" stroke-linecap="round"><circle cx="14.5" cy="14.7" r="4.2"/><path d="M17.5 17.7 19.5 19.7"/></g></svg>`,In=ua,zn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M4.5 2h6.4L15.5 6.6V16.5A1.5 1.5 0 0 1 14 18H4.5A1.5 1.5 0 0 1 3 16.5V3.5A1.5 1.5 0 0 1 4.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M10.9 2v4.6h4.6"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 5.8v6M7.2 9.6 10 12.5l2.8-2.9"/></svg>',Sn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M15.5 2H9.1L4.5 6.6V16.5A1.5 1.5 0 0 0 6 18h9.5A1.5 1.5 0 0 0 17 16.5V3.5A1.5 1.5 0 0 0 15.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M9.1 2v4.6H4.5"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 14.2V8M7.2 10.4 10 7.5l2.8 2.9"/></svg>',Pn=ca,On=re("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160");re("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48");const $n='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="m18.5 10 4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725 16.676 16.676 0 0 1 3.524 17.273l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877 16.165 16.165 0 0 0 11.91 6.001L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg>',En='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 3a7 7 0 1 0 0 14 9 9 0 0 1 0-14Z"/></svg>',Nn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 6.5 5.5 11h9L10 6.5Z"/></svg>',Un='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',Fn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 2.6 18 9.8h-2.1V17h-4.4v-4.4H8.5V17H4.1V9.8H2L10 2.6Zm0 1.8L5.3 9.8V15.8h2V11.4h5.4v4.4h2V9.8L10 4.4Z"/></svg>',_n='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M8.08 2.1h3.84l.32 1.52a6.4 6.4 0 0 1 1.36.78l1.48-.64 1.92 1.92-.64 1.48c.3.42.54.88.78 1.36l1.52.32v3.84l-1.52.32a6.4 6.4 0 0 1-.78 1.36l.64 1.48-1.92 1.92-1.48-.64a6.4 6.4 0 0 1-1.36.78l-.32 1.52H8.08l-.32-1.52a6.4 6.4 0 0 1-1.36-.78l-1.48.64-1.92-1.92.64-1.48a6.4 6.4 0 0 1-.78-1.36L1.34 11.92V8.08l1.52-.32c.24-.48.48-.94.78-1.36l-.64-1.48 1.92-1.92 1.48.64c.42-.3.88-.54 1.36-.78L8.08 2.1ZM10 7.2A2.8 2.8 0 1 0 10 12.8 2.8 2.8 0 0 0 10 7.2Z"/></svg>',Bn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2.5v6M7 5.5h6"/><circle cx="10" cy="14.5" r="3.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="10" cy="14.5" r="1.1" fill="currentColor"/></svg>',Rn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 3.53 16.09 6.97 10.09 10.29 4.18 7 10.09 3.56M10.09 2.4 2.17 7 3.31 7.65 10.09 11.45 17 7.62 18.17 7 10.08 2.37 10.09 2.4Z"/><path fill="currentColor" d="M10.25 14.83 18.17 10.22 17 9.57 10.22 13.57 3.32 9.59 2.17 10.22 10.25 14.83Z"/><path fill="currentColor" d="M10.25 17.63 18.17 13 17 12.37 10.22 16.37 3.32 12.38 2.17 13 10.25 17.63Z"/></svg>',Tn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 5.15 16.09 8.59 10.09 11.91 4.18 8.59 10.09 5.15ZM10.09 4 2.17 8.61 3.31 9.25 10.09 13.06 17 9.24 18.16 8.61 10.08 4 10.09 4Z"/><path fill="currentColor" d="M10.25 16.46 18.17 11.85 17 11.2 10.22 15.2 3.32 11.21 2.17 11.85 10.25 16.46Z"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',Dn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M2.25 2.25h4.878v4.878H2.25V2.25Zm.978.978v2.924h2.924V3.228H3.228Z"/><path fill="currentColor" d="M5.175 20.773V7.128H4.204V21.75H21.75V4.204H7.128v.971H20.773v15.598H5.175Z"/></svg>',Hn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',jn='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M16.98 11L18.5 11L18.5 10L16.98 10C16.86 8.13 16.05 6.44 14.8 5.2L16.88 2.83L16.12 2.17L14.05 4.54C12.79 3.57 11.21 3 9.5 3C5.36 3 2 6.36 2 10.5C2 14.64 5.36 18 9.5 18C13.47 18 16.73 14.91 16.98 11ZM15.98 10C15.86 8.43 15.18 7.01 14.14 5.95L10.6 10L15.98 10ZM13.39 5.29L8.4 11L15.98 11C15.73 14.36 12.92 17 9.5 17C5.91 17 3 14.09 3 10.5C3 6.91 5.91 4 9.5 4C10.96 4 12.31 4.48 13.39 5.29Z"/></svg>',Vn=fn,Zn=vn,Yn=yn,Gn=Ln,Xn=On,tt=4;var D=Uint8Array,Z=Uint16Array,ne=Int32Array,ie=new D([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oe=new D([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Le=new D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ma=function(t,e){for(var a=new Z(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];for(var n=new ne(a[30]),r=1;r<30;++r)for(var i=a[r];i<a[r+1];++i)n[i]=i-a[r]<<5|r;return{b:a,r:n}},pa=ma(ie,2),Wn=pa.b,Yt=pa.r;Wn[28]=258,Yt[258]=28;var Kn=ma(oe,0),ke=Kn.r,Gt=new Z(32768);for(var A=0;A<32768;++A){var q=(A&43690)>>1|(A&21845)<<1;q=(q&52428)>>2|(q&13107)<<2,q=(q&61680)>>4|(q&3855)<<4,Gt[A]=((q&65280)>>8|(q&255)<<8)>>1}var wt=(function(t,e,a){for(var r=t.length,n=0,i=new Z(e);n<r;++n)t[n]&&++i[t[n]-1];var o=new Z(e);for(n=1;n<e;++n)o[n]=o[n-1]+i[n-1]<<1;var l;if(a){l=new Z(1<<e);var s=15-e;for(n=0;n<r;++n)if(t[n])for(var c=n<<4|t[n],d=e-t[n],u=o[t[n]-1]++<<d,m=u|(1<<d)-1;u<=m;++u)l[Gt[u]>>s]=c}else for(l=new Z(r),n=0;n<r;++n)t[n]&&(l[n]=Gt[o[t[n]-1]++]>>15-t[n]);return l}),rt=new D(288);for(var A=0;A<144;++A)rt[A]=8;for(var A=144;A<256;++A)rt[A]=9;for(var A=256;A<280;++A)rt[A]=7;for(var A=280;A<288;++A)rt[A]=8;var Ct=new D(32);for(var A=0;A<32;++A)Ct[A]=5;var Qn=wt(rt,9,0),Jn=wt(Ct,5,0),ha=function(t){return(t+7)/8|0},fa=function(t,e,a){return(a==null||a>t.length)&&(a=t.length),new D(t.subarray(e,a))},qn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Et=function(t,e,a){var r=new Error(e||qn[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Et),!a)throw r;return r},Q=function(t,e,a){a<<=e&7;var r=e/8|0;t[r]|=a,t[r+1]|=a>>8},ht=function(t,e,a){a<<=e&7;var r=e/8|0;t[r]|=a,t[r+1]|=a>>8,t[r+2]|=a>>16},Tt=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,i=a.slice();if(!n)return{t:ba,l:0};if(n==1){var o=new D(a[0].s+1);return o[a[0].s]=1,{t:o,l:1}}a.sort(function(U,F){return U.f-F.f}),a.push({s:-1,f:25001});var l=a[0],s=a[1],c=0,d=1,u=2;for(a[0]={s:-1,f:l.f+s.f,l,r:s};d!=n-1;)l=a[a[c].f<a[u].f?c++:u++],s=a[c!=d&&a[c].f<a[u].f?c++:u++],a[d++]={s:-1,f:l.f+s.f,l,r:s};for(var m=i[0].s,r=1;r<n;++r)i[r].s>m&&(m=i[r].s);var p=new Z(m+1),v=Xt(a[d-1],p,0);if(v>e){var r=0,b=0,y=v-e,O=1<<y;for(i.sort(function(F,f){return p[f.s]-p[F.s]||F.f-f.f});r<n;++r){var z=i[r].s;if(p[z]>e)b+=O-(1<<v-p[z]),p[z]=e;else break}for(b>>=y;b>0;){var N=i[r].s;p[N]<e?b-=1<<e-p[N]++-1:++r}for(;r>=0&&b;--r){var C=i[r].s;p[C]==e&&(--p[C],++b)}v=e}return{t:new D(p),l:v}},Xt=function(t,e,a){return t.s==-1?Math.max(Xt(t.l,e,a+1),Xt(t.r,e,a+1)):e[t.s]=a},Ae=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Z(++e),r=0,n=t[0],i=1,o=function(s){a[r++]=s},l=1;l<=e;++l)if(t[l]==n&&l!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=t[l]}return{c:a.subarray(0,r),n:e}},ft=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},ga=function(t,e,a){var r=a.length,n=ha(e+2);t[n]=r&255,t[n+1]=r>>8,t[n+2]=t[n]^255,t[n+3]=t[n+1]^255;for(var i=0;i<r;++i)t[n+i+4]=a[i];return(n+4+r)*8},Me=function(t,e,a,r,n,i,o,l,s,c,d){Q(e,d++,a),++n[256];for(var u=Tt(n,15),m=u.t,p=u.l,v=Tt(i,15),b=v.t,y=v.l,O=Ae(m),z=O.c,N=O.n,C=Ae(b),U=C.c,F=C.n,f=new Z(19),x=0;x<z.length;++x)++f[z[x]&31];for(var x=0;x<U.length;++x)++f[U[x]&31];for(var w=Tt(f,7),H=w.t,K=w.l,_=19;_>4&&!H[Le[_-1]];--_);var G=c+5<<3,P=ft(n,rt)+ft(i,Ct)+o,B=ft(n,m)+ft(i,b)+o+14+3*_+ft(f,H)+2*f[16]+3*f[17]+7*f[18];if(s>=0&&G<=P&&G<=B)return ga(e,d,t.subarray(s,s+c));var $,M,E,j;if(Q(e,d,1+(B<P)),d+=2,B<P){$=wt(m,p,0),M=m,E=wt(b,y,0),j=b;var J=wt(H,K,0);Q(e,d,N-257),Q(e,d+5,F-1),Q(e,d+10,_-4),d+=14;for(var x=0;x<_;++x)Q(e,d+3*x,H[Le[x]]);d+=3*_;for(var V=[z,U],pt=0;pt<2;++pt)for(var it=V[pt],x=0;x<it.length;++x){var X=it[x]&31;Q(e,d,J[X]),d+=H[X],X>15&&(Q(e,d,it[x]>>5&127),d+=it[x]>>12)}}else $=Qn,M=rt,E=Jn,j=Ct;for(var x=0;x<l;++x){var R=r[x];if(R>255){var X=R>>18&31;ht(e,d,$[X+257]),d+=M[X+257],X>7&&(Q(e,d,R>>23&31),d+=ie[X]);var ot=R&31;ht(e,d,E[ot]),d+=j[ot],ot>3&&(ht(e,d,R>>5&8191),d+=oe[ot])}else ht(e,d,$[R]),d+=M[R]}return ht(e,d,$[256]),d+M[256]},ti=new ne([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ba=new D(0),ei=function(t,e,a,r,n,i){var o=i.z||t.length,l=new D(r+o+5*(1+Math.ceil(o/7e3))+n),s=l.subarray(r,l.length-n),c=i.l,d=(i.r||0)&7;if(e){d&&(s[0]=i.r>>3);for(var u=ti[e-1],m=u>>13,p=u&8191,v=(1<<a)-1,b=i.p||new Z(32768),y=i.h||new Z(v+1),O=Math.ceil(a/3),z=2*O,N=function(Bt){return(t[Bt]^t[Bt+1]<<O^t[Bt+2]<<z)&v},C=new ne(25e3),U=new Z(288),F=new Z(32),f=0,x=0,w=i.i||0,H=0,K=i.w||0,_=0;w+2<o;++w){var G=N(w),P=w&32767,B=y[G];if(b[P]=B,y[G]=P,K<=w){var $=o-w;if((f>7e3||H>24576)&&($>423||!c)){d=Me(t,s,0,C,U,F,x,H,_,w-_,d),H=f=x=0,_=w;for(var M=0;M<286;++M)U[M]=0;for(var M=0;M<30;++M)F[M]=0}var E=2,j=0,J=p,V=P-B&32767;if($>2&&G==N(w-V))for(var pt=Math.min(m,$)-1,it=Math.min(32767,w),X=Math.min(258,$);V<=it&&--J&&P!=B;){if(t[w+E]==t[w+E-V]){for(var R=0;R<X&&t[w+R]==t[w+R-V];++R);if(R>E){if(E=R,j=V,R>pt)break;for(var ot=Math.min(V,R-2),fe=0,M=0;M<ot;++M){var Ft=w-V+M&32767,er=b[Ft],ge=Ft-er&32767;ge>fe&&(fe=ge,B=Ft)}}}P=B,B=b[P],V+=P-B&32767}if(j){C[H++]=268435456|Yt[E]<<18|ke[j];var be=Yt[E]&31,we=ke[j]&31;x+=ie[be]+oe[we],++U[257+be],++F[we],K=w+E,++f}else C[H++]=t[w],++U[t[w]]}}for(w=Math.max(w,K);w<o;++w)C[H++]=t[w],++U[t[w]];d=Me(t,s,c,C,U,F,x,H,_,w-_,d),c||(i.r=d&7|s[d/8|0]<<3,d-=7,i.h=y,i.p=b,i.i=w,i.w=K)}else{for(var w=i.w||0;w<o+c;w+=65535){var _t=w+65535;_t>=o&&(s[d/8|0]=c,_t=o),d=ga(s,d+1,t.subarray(w,_t))}i.i=o}return fa(l,0,r+ha(d)+n)},ai=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(a&1&&-306674912)^a>>>1;t[e]=a}return t})(),wa=function(){var t=-1;return{p:function(e){for(var a=t,r=0;r<e.length;++r)a=ai[a&255^e[r]]^a>>>8;t=a},d:function(){return~t}}},xa=function(t,e,a,r,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new D(i.length+t.length);o.set(i),o.set(t,i.length),t=o,n.w=i.length}return ei(t,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,a,r,n)},va=function(t,e){var a={};for(var r in t)a[r]=t[r];for(var r in e)a[r]=e[r];return a},I=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8},ri=function(t,e){var a=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&I(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),a){t[3]=8;for(var r=0;r<=a.length;++r)t[r+10]=a.charCodeAt(r)}},ni=function(t){return 10+(t.filename?t.filename.length+1:0)};function ii(t,e){return xa(t,e||{},0,0)}function oi(t,e){e||(e={});var a=wa(),r=t.length;a.p(t);var n=xa(t,e,ni(e),8),i=n.length;return ri(n,e),I(n,i-8,a.d()),I(n,i-4,r),n}var ya=function(t,e,a,r){for(var n in t){var i=t[n],o=e+n,l=r;Array.isArray(i)&&(l=va(r,i[1]),i=i[0]),i instanceof D?a[o]=[i,l]:(a[o+="/"]=[new D(0),l],ya(i,o,a,r))}},Ce=typeof TextEncoder<"u"&&new TextEncoder,li=typeof TextDecoder<"u"&&new TextDecoder,si=0;try{li.decode(ba,{stream:!0}),si=1}catch{}function vt(t,e){var a;if(Ce)return Ce.encode(t);for(var r=t.length,n=new D(t.length+(t.length>>1)),i=0,o=function(d){n[i++]=d},a=0;a<r;++a){if(i+5>n.length){var l=new D(i+8+(r-a<<1));l.set(n),n=l}var s=t.charCodeAt(a);s<128||e?o(s):s<2048?(o(192|s>>6),o(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|t.charCodeAt(++a)&1023,o(240|s>>18),o(128|s>>12&63),o(128|s>>6&63),o(128|s&63)):(o(224|s>>12),o(128|s>>6&63),o(128|s&63))}return fa(n,0,i)}var Wt=function(t){var e=0;if(t)for(var a in t){var r=t[a].length;r>65535&&Et(9),e+=r+4}return e},Ie=function(t,e,a,r,n,i,o,l){var s=r.length,c=a.extra,d=l&&l.length,u=Wt(c);I(t,e,o!=null?33639248:67324752),e+=4,o!=null&&(t[e++]=20,t[e++]=a.os),t[e]=20,e+=2,t[e++]=a.flag<<1|(i<0&&8),t[e++]=n&&8,t[e++]=a.compression&255,t[e++]=a.compression>>8;var m=new Date(a.mtime==null?Date.now():a.mtime),p=m.getFullYear()-1980;if((p<0||p>119)&&Et(10),I(t,e,p<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),e+=4,i!=-1&&(I(t,e,a.crc),I(t,e+4,i<0?-i-2:i),I(t,e+8,a.size)),I(t,e+12,s),I(t,e+14,u),e+=16,o!=null&&(I(t,e,d),I(t,e+6,a.attrs),I(t,e+10,o),e+=14),t.set(r,e),e+=s,u)for(var v in c){var b=c[v],y=b.length;I(t,e,+v),I(t,e+2,y),t.set(b,e+4),e+=4+y}return d&&(t.set(l,e),e+=d),e},ci=function(t,e,a,r,n){I(t,e,101010256),I(t,e+8,a),I(t,e+10,a),I(t,e+12,r),I(t,e+16,n)};function di(t,e){e||(e={});var a={},r=[];ya(t,"",a,e);var n=0,i=0;for(var o in a){var l=a[o],s=l[0],c=l[1],d=c.level==0?0:8,u=vt(o),m=u.length,p=c.comment,v=p&&vt(p),b=v&&v.length,y=Wt(c.extra);m>65535&&Et(11);var O=d?ii(s,c):s,z=O.length,N=wa();N.p(s),r.push(va(c,{size:s.length,crc:N.d(),c:O,f:u,m:v,u:m!=o.length||v&&p.length!=b,o:n,compression:d})),n+=30+m+y+z,i+=76+2*(m+y)+(b||0)+z}for(var C=new D(i+22),U=n,F=i-n,f=0;f<r.length;++f){var u=r[f];Ie(C,u.o,u,u.f,u.u,u.c.length);var x=30+u.f.length+Wt(u.extra);C.set(u.c,u.o+x),Ie(C,n,u,u.f,u.u,u.c.length,u.o,u.m),n+=16+x+(u.m?u.m.length:0)}return ci(C,n,r.length,F,U),C}const ui="gzip";function le(t){return{bytes:oi(t),compression:ui}}const ze=1,Se=2,Pe=4,Oe=8,$e=16,mi=32,Ee=1,Ne=2,Ue=4,Fe=8,_e=16,pi=32,Be=64,Re=128;function La(t){let e=256+t.positions.byteLength;return t.indices&&(e+=t.indices.byteLength),t.lineDistances&&(e+=t.lineDistances.byteLength),t.linePattern&&(e+=64+t.linePattern.pattern.length*8),e}function ka(t){let e=256+t.positions.byteLength;return t.indices&&(e+=t.indices.byteLength),t.gradientPositions&&(e+=t.gradientPositions.byteLength),t.uvs&&(e+=t.uvs.byteLength),t.texture&&(e+=t.texture.bytes.byteLength+64),t.hatchPattern&&(e+=128),t.gradientFill&&(e+=64),e}function Aa(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let a=0;e.indices&&e.indices.length>0&&(a|=ze),e.linePattern&&(a|=Se),e.lineDistances&&e.lineDistances.length>0&&(a|=Pe),e.lineWidth!=null&&e.lineWidth>0&&(a|=Oe),e.renderOrder!=null&&e.renderOrder!==0&&(a|=$e),e.excludeFromOsnap&&(a|=mi),t.writeU8(a),a&ze&&t.writeUint32Array(e.indices),a&Se&&t.writeJson(e.linePattern),a&Pe&&t.writeFloat32Array(e.lineDistances),a&Oe&&t.writeF32(e.lineWidth),a&$e&&t.writeI32(e.renderOrder)}function Ma(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let a=0;e.indices&&e.indices.length>0&&(a|=Ee),e.hatchPattern&&(a|=Ne),e.gradientFill&&(a|=Ue),e.gradientPositions&&e.gradientPositions.length>0&&(a|=Fe),e.side!=null&&(a|=_e),e.points&&(a|=pi),e.renderOrder!=null&&e.renderOrder!==0&&(a|=Be),e.texture&&e.texture.bytes.length>0&&e.uvs&&e.uvs.length>=2&&(a|=Re),t.writeU8(a),a&Ee&&t.writeUint32Array(e.indices),a&Ne&&t.writeJson(e.hatchPattern),a&Ue&&t.writeJson(e.gradientFill),a&Fe&&t.writeFloat32Array(e.gradientPositions),a&_e&&t.writeU8(e.side),a&Be&&t.writeI32(e.renderOrder),a&Re&&(t.writeFloat32Array(e.uvs),t.writeString(e.texture.mimeType||"image/png"),t.writeU32(e.texture.bytes.byteLength),t.writeBytes(e.texture.bytes))}class se{constructor(){this.chunks=[],this.length=0}writeU8(e){const a=new Uint8Array(1);a[0]=e&255,this.chunks.push(a),this.length+=1}writeU32(e){const a=new Uint8Array(4);new DataView(a.buffer).setUint32(0,e>>>0,!0),this.chunks.push(a),this.length+=4}writeI32(e){const a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,e|0,!0),this.chunks.push(a),this.length+=4}writeF32(e){const a=new Uint8Array(4);new DataView(a.buffer).setFloat32(0,e,!0),this.chunks.push(a),this.length+=4}writeF64(e){const a=new Uint8Array(8);new DataView(a.buffer).setFloat64(0,e,!0),this.chunks.push(a),this.length+=8}writeBytes(e){this.chunks.push(e),this.length+=e.length}writeString(e){const a=vt(e);this.writeU32(a.length),this.writeBytes(a)}writeJson(e){this.writeString(JSON.stringify(e))}writeFloat32Array(e){this.alignTo(4);const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(a.length),this.writeBytes(a)}writeUint32Array(e){this.alignTo(4);const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(a.length),this.writeBytes(a)}alignTo(e){const a=this.length%e;if(a===0)return;const r=e-a;for(let n=0;n<r;n++)this.writeU8(0)}toUint8Array(){const e=new Uint8Array(this.length);let a=0;for(const r of this.chunks)e.set(r,a),a+=r.length;return e}}const hi=1480934209;function fi(t){if(t.version!==tt)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=new se;e.writeU32(hi),e.writeU8(tt),e.writeU8(0),e.writeU8(0),e.writeU8(0),e.writeJson(t.meta),e.writeJson(t.layers),e.writeString(t.activeLayoutBtrId),e.writeU32(t.layouts.length);for(const a of t.layouts)gi(e,a);return e.toUint8Array()}function gi(t,e){t.writeString(e.btrId),t.writeString(e.name),t.writeU8(e.isModelSpace?1:0),t.writeJson(e.osnap??null),t.writeJson(e.viewports??null),t.writeU32(e.lineBatches.length);for(const a of e.lineBatches)Aa(t,a);t.writeU32(e.meshBatches.length);for(const a of e.meshBatches)Ma(t,a)}const bi="application/vnd.mlightcad.acex-snapshot+binary";function Kt(t){if(t.version!==tt)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=fi(t),a=le(e);return{payload:xi(a.bytes),compression:a.compression}}function wi(){return bi}function xi(t){let e="";for(let a=0;a<t.length;a++)e+=String.fromCharCode(t[a]);return btoa(e)}function nt(t,e,a){if(a<=0)return new Float32Array(0);const r=new Float32Array(a);for(let n=0;n<a;n++)r[n]=t[e+n];return r}function vi(t,e,a){if(a<=0)return new Uint32Array(0);const r=new Uint32Array(a);for(let n=0;n<a;n++)r[n]=t[e+n];return r}function Ca(t,e){if(e.length===0)return{positions:t,indices:e};let a=0;for(let n=0;n<e.length;n++){const i=e[n];i>a&&(a=i)}const r=(a+1)*3;return r>=t.length?{positions:t,indices:e}:{positions:nt(t,0,r),indices:e}}function Te(t,e){return t+e}const lt={x:0,y:0,z:0};function yi(t){t.updateMatrixWorld(!0);const e=t.matrixWorld.elements;return lt.x=e[12],lt.y=e[13],lt.z=e[14],[lt.x,lt.y,lt.z]}function Li(t,e){const a=e.elements,r=t.positions;if(r.length===0)return{positions:new Float32Array(0),indices:t.indices};const n=new Float32Array(r.length);for(let i=0;i<r.length;i+=3){const o=r[i],l=r[i+1],s=r[i+2];n[i]=a[0]*o+a[4]*l+a[8]*s+a[12],n[i+1]=a[1]*o+a[5]*l+a[9]*s+a[13],n[i+2]=a[2]*o+a[6]*l+a[10]*s+a[14]}return{positions:n,indices:t.indices?new Uint32Array(t.indices):void 0}}function ki(t){const e=t.positions;if(e.length<3)return{slice:t,offset:[0,0,0]};let a=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,l=-1/0;for(let d=0;d<e.length;d+=3){const u=e[d],m=e[d+1],p=e[d+2];a=Math.min(a,u),r=Math.min(r,m),n=Math.min(n,p),i=Math.max(i,u),o=Math.max(o,m),l=Math.max(l,p)}const s=[(a+i)/2,(r+o)/2,(n+l)/2],c=new Float32Array(e.length);for(let d=0;d<e.length;d+=3)c[d]=e[d]-s[0],c[d+1]=e[d+1]-s[1],c[d+2]=e[d+2]-s[2];return{slice:{positions:c,indices:t.indices?new Uint32Array(t.indices):void 0},offset:s}}function Ai(t,e,a={}){t.updateMatrixWorld(!0);const r=Li(e,t.matrixWorld);return a.preserveWorldSpaceForPatternFill?{slice:r,offset:[0,0,0]}:ki(r)}function Mi(t){const e=t.image;if(!e||typeof document>"u")return;const a=document.createElement("canvas"),r=a.getContext("2d");if(!r)return;try{if(e instanceof ImageData)a.width=e.width,a.height=e.height,r.putImageData(e,0,0);else if(Ii(e)){a.width=e.width,a.height=e.height;const s=Si(e.data,e.width*e.height),c=new ImageData(new Uint8ClampedArray(s),e.width,e.height);r.putImageData(c,0,0)}else if(Ci(e)){const s=zi(e);if(!s)return;a.width=s.width,a.height=s.height,r.drawImage(e,0,0)}else return}catch{return}const n=a.toDataURL("image/png"),i=n.indexOf(",");if(i<0)return;const o=atob(n.slice(i+1)),l=new Uint8Array(o.length);for(let s=0;s<o.length;s++)l[s]=o.charCodeAt(s);return{mimeType:"image/png",bytes:l}}function Ci(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement}function Ii(t){if(!t||typeof t!="object")return!1;const e=t;return e.data!=null&&typeof e.width=="number"&&typeof e.height=="number"&&e.width>=1&&e.height>=1}function zi(t){let e=Number(t.width),a=Number(t.height);if(t instanceof HTMLImageElement?(e=t.naturalWidth||t.width,a=t.naturalHeight||t.height):typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement&&(e=t.videoWidth||t.width,a=t.videoHeight||t.height),!(!Number.isFinite(e)||!Number.isFinite(a)||e<1||a<1))return{width:e,height:a}}function Si(t,e){const a=e*4;if(t instanceof Uint8ClampedArray&&t.length>=a)return t.length===a?t:t.subarray(0,a);const r=new Uint8ClampedArray(a),n=Math.min(a,t.length);for(let i=0;i<n;i++)r[i]=t[i];if(t.length>=e*3&&t.length<a)for(let i=e-1;i>=0;i--){const o=i*3,l=i*4;r[l]=t[o],r[l+1]=t[o+1],r[l+2]=t[o+2],r[l+3]=255}return r}function Pi(t,e){const a=t.getAttribute("uv");if(!a||a.count===0||a.itemSize<2)return;const r=Math.floor(e.length/3)*2;if(r<=0)return;const n=a.array;if(!(a.count*a.itemSize<r))return nt(n,0,r)}function Oi(t){const e=t;return e.map?!1:e.transparent===!0&&typeof e.opacity=="number"&&e.opacity<.01}function ce(t){const e=t;if(e.isShaderMaterial===!0||t.type==="ShaderMaterial")return e}function $i(t){var e;const a=ce(t);if(!a)return;const r=a.uniforms.pattern,n=a.uniforms.patternLength;if(!r||!n)return;const i=r.value;if(!(!Array.isArray(i)||i.length===0))return{pattern:[...i],patternLength:Number(n.value),viewportScale:Number(((e=a.uniforms.u_viewportScale)==null?void 0:e.value)??1)}}function Ei(t){var e;const a=ce(t);if(!a)return;const r=a.uniforms.u_patternLines;if(!r)return;const n=r.value;if(!(!Array.isArray(n)||n.length===0))return{patternAngle:Number(((e=a.uniforms.u_patternAngle)==null?void 0:e.value)??0),patternLines:n.map(Ui)}}function Ni(t){var e,a,r,n,i;const o=ce(t);if(!o||o.uniforms.u_patternLines)return;const l=(e=o.uniforms.u_startColor)==null?void 0:e.value,s=(a=o.uniforms.u_endColor)==null?void 0:a.value,c=o.uniforms.u_gradientType;if(!(!(l!=null&&l.getHex)||c==null))return{startColor:l.getHex(),endColor:((r=s==null?void 0:s.getHex)==null?void 0:r.call(s))??l.getHex(),angle:Number(((n=o.uniforms.u_angle)==null?void 0:n.value)??0),shift:Number(((i=o.uniforms.u_shift)==null?void 0:i.value)??0),gradientType:Number(c.value)}}function Ui(t){return{angle:t.angle,base:[t.base.x,t.base.y],offset:[t.offset.x,t.offset.y],dashLengths:[...t.dashLengths],patternLength:t.patternLength}}function Ia(t){const e=t.length/3;if(e<2)return new Float32Array(0);const a=new Float32Array(e);for(let r=0;r<e;r+=2){r===0?a[r]=0:a[r]=a[r-1];const n=t[r*3],i=t[r*3+1],o=t[r*3+2]??0,l=t[(r+1)*3],s=t[(r+1)*3+1],c=t[(r+1)*3+2]??0,d=l-n,u=s-i,m=c-o;a[r+1]=a[r]+Math.sqrt(d*d+u*u+m*m)}return a}function Fi(t,e){const a=t.getAttribute(e);if(!a||a.count===0)return;const r=a.itemSize;if(t.getIndex()){const d=a.array;return nt(d,0,a.count*r)}const n=t.drawRange,i=a.count,o=Math.max(0,Math.min(Math.floor(n.start),i)),l=Math.max(0,i-o),s=!Number.isFinite(n.count)||n.count<=0?l:Math.min(Math.floor(n.count),l);if(s<=0)return;const c=a.array;return nt(c,o*r,s*r)}function _i(t,e){const a=Math.atan2(e[1],e[0]),r=(i,o)=>[e[0]*i+e[4]*o+e[12],e[1]*i+e[5]*o+e[13]],n=(i,o)=>[e[0]*i+e[4]*o,e[1]*i+e[5]*o];return{patternAngle:t.patternAngle+a,patternLines:t.patternLines.map(i=>({angle:i.angle+a,base:r(i.base[0],i.base[1]),offset:n(i.offset[0],i.offset[1]),dashLengths:[...i.dashLengths],patternLength:i.patternLength}))}}function Qt(t,e){return!Number.isFinite(t)||t<0?0:Math.min(Math.floor(t),e)}function Jt(t,e,a){const r=Math.max(0,e-a);return!Number.isFinite(t)||t<=0?r:Math.min(Math.floor(t),r)}function De(t){const e=t.getAttribute("position");if(!e)return{positions:new Float32Array(0)};const a=t.drawRange,r=e.array,n=e.itemSize,i=t.getIndex();if(i){const s=nt(r,0,e.count*n),c=i.array,d=Qt(a.start,i.count),u=Jt(a.count,i.count,d),m=vi(c,d,u);return Ca(s,m)}const o=Qt(a.start,e.count),l=Jt(a.count,e.count,o);return{positions:nt(r,o*n,l*n)}}function It(t){return Gr(t.flags)&&Xr(t.flags)}function za(t){const{count:e}=t.mappingStats;for(let a=0;a<e;a++){let r;try{r=t.getGeometryRangeAt(a)}catch{continue}if(It(r)&&r.bboxIntersectionCheck)return!0}return!1}function He(t){return Lr(t).bboxIntersectionCheck===!0}function de(t,e){const a=e.getAttribute("position");if(!a)return{positions:new Float32Array(0)};const r=a.itemSize,n=a.array,i=e.getIndex(),{count:o}=t.mappingStats;if(i){const s=nt(n,0,a.count*r),c=i.array,d=[];for(let u=0;u<o;u++){let m;try{m=t.getGeometryRangeAt(u)}catch{continue}const p=m.indexStart??0,v=m.indexCount??0;if(!(!It(m)||v<=0))for(let b=0;b<v;b++)d.push(c[p+b])}return d.length===0?{positions:new Float32Array(0)}:Ca(s,new Uint32Array(d))}const l=[];for(let s=0;s<o;s++){let c;try{c=t.getGeometryRangeAt(s)}catch{continue}if(!It(c)||c.vertexCount<=0)continue;const d=c.vertexStart*r,u=c.vertexCount*r;for(let m=0;m<u;m++)l.push(n[d+m])}return{positions:new Float32Array(l)}}function zt(t,e,a){t.push(e.getX(a),e.getY(a),e.getZ(a))}function Bi(t,e){const a=e.getAttribute("instanceStart"),r=e.getAttribute("instanceEnd");if(!a||!r)return{positions:new Float32Array(0)};const{count:n}=t.mappingStats,i=[];for(let o=0;o<n;o++){let l;try{l=t.getGeometryRangeAt(o)}catch{continue}if(!It(l)||l.vertexCount<=0)continue;const s=l.vertexStart,c=s+l.vertexCount;for(let d=s;d<c;d++)zt(i,a,d),zt(i,r,d)}return{positions:new Float32Array(i)}}function Ri(t,e){const a=t.instanceCount;if(Number.isFinite(a)&&a>=0)return Math.min(Math.floor(a),e);const r=t.drawRange,n=Qt(r.start,e);return Jt(r.count,e,n)}function Ti(t){const e=t.getAttribute("instanceStart"),a=t.getAttribute("instanceEnd");if(!e||!a||e.count===0)return{positions:new Float32Array(0)};const r=Ri(t,e.count);if(r<=0)return{positions:new Float32Array(0)};const n=[];for(let i=0;i<r;i++)zt(n,e,i),zt(n,a,i);return{positions:new Float32Array(n)}}function Dt(t){return xr(t)}function Sa(t){if(t instanceof yr)return t.linewidth}function Ht(t){if("material"in t){const e=t.userData.originalMaterial??t.material;return Array.isArray(e)?e[0]:e}return t.material}function ct(t){var e;const a=la(t),r=a.layer??"0",n=t;let i=n.color!=null?n.color.getHex():a.color??16777215;const o=$i(t),l=Ei(t),s=Ni(t);if(t instanceof vr||t.type==="ShaderMaterial"){const c=(e=t.uniforms.u_color)==null?void 0:e.value;c!=null&&c.getHex?i=c.getHex():s&&(i=s.startColor)}return{color:i,layer:r,linePattern:o,hatchPattern:l,gradientFill:s,side:l||s?t.side:void 0}}function Di(t,e){const a=la(e).drawOrder??t.renderOrder;return a===0?void 0:a}function yt(t,e,a){const r=Di(e,a);r!=null&&(t.renderOrder=r)}function Hi(t,e){if(!e)return;const a=t.userData.bakedWorldMatrix;return!a||a.length<16?e:_i(e,a)}function Nt(t){return yi(t)}function jt(t,e,a={}){const r=Ai(t,e,a);return{...r.slice,offset:r.offset}}function ue(t,e,a,r,n){const i=ct(e),o=Hi(a,i.hatchPattern),l=i.gradientFill?Fi(t,"gradientPosition"):void 0,s={layer:i.layer,color:i.color,offset:n,hatchPattern:o,gradientFill:i.gradientFill,gradientPositions:l,side:i.side,...r},c=e;if(c.map){const d=Mi(c.map),u=Pi(t,r.positions);if(!d||!u)return;s.texture=d,s.uvs=u,s.color=16777215,s.side=kr}return yt(s,a,e),s}function ji(t){const e=Bi(t,t.geometry);if(e.positions.length===0)return;const{color:a,layer:r}=ct(t.material),n=Sa(t.material),i={layer:r,color:a,offset:Nt(t),lineWidth:n,...e};return za(t)&&(i.excludeFromOsnap=!0),yt(i,t,t.material),i}function Vi(t){const e=de(t,t.geometry);if(e.positions.length===0)return;const{color:a,layer:r,linePattern:n}=ct(t.material),i=n?Ia(e.positions):void 0,o={layer:r,color:a,offset:Nt(t),linePattern:n,lineDistances:i,...e};return za(t)&&(o.excludeFromOsnap=!0),yt(o,t,t.material),o}function Zi(t){const e=de(t,t.geometry);if(e.positions.length!==0)return ue(t.geometry,t.material,t,e,Nt(t))}function Yi(t){const e=de(t,t.geometry);if(e.positions.length===0)return;const a=ue(t.geometry,t.material,t,e,Nt(t));if(a)return{points:!0,...a}}function Gi(t){const e=[],a=[];return t.traverse(r=>{if(!(lr(r)||sr(r))){if(r instanceof ve){const n=Vi(r);n&&e.push(n);return}if(r instanceof cr){const n=ji(r);n&&e.push(n);return}if(r instanceof ye){const n=Zi(r);n&&a.push(n);return}if(r instanceof dr){const n=Yi(r);n&&a.push(n);return}if(r instanceof ur){if(!Dt(r))return;const n=Ti(r.geometry);if(n.positions.length===0)return;const i=Ht(r),{color:o,layer:l}=ct(i),{offset:s,...c}=jt(r,n),d={layer:l,color:o,offset:s,lineWidth:Sa(i),...c};He(r)&&(d.excludeFromOsnap=!0),yt(d,r,i),e.push(d)}else if(r instanceof mr&&!(r instanceof ve)){if(!Dt(r))return;const n=De(r.geometry);if(n.positions.length===0)return;const i=Ht(r),{color:o,layer:l,linePattern:s}=ct(i),{offset:c,...d}=jt(r,n),u=s?Ia(d.positions):void 0,m={layer:l,color:o,offset:c,linePattern:s,lineDistances:u,...d};He(r)&&(m.excludeFromOsnap=!0),yt(m,r,i),e.push(m)}else if(r instanceof pr&&!(r instanceof ye)){if(!Dt(r))return;const n=Ht(r);if(Oi(n))return;const i=De(r.geometry);if(i.positions.length===0)return;const o=ct(n),{offset:l,...s}=jt(r,i,{preserveWorldSpaceForPatternFill:!!o.hatchPattern}),c=ue(r.geometry,n,r,s,l);c&&a.push(c)}}}),{lineBatches:e,meshBatches:a}}const je={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function Ve(t){const e=new br(wr.ByACI,t);return e.cssColor??`rgb(${e.red}, ${e.green}, ${e.blue})`}function Xi(t){try{const e=or.instance(),a=e.getVar(Rt.GRIPSIZE,t),r=e.getVar(Rt.GRIPCOLOR,t),n=e.getVar(Rt.GRIPHOT,t);return!(a>0)||!Number.isFinite(a)?je:{size:a,colorCss:Ve(r),hotColorCss:Ve(n)}}catch{return je}}function Ze(t,e){const a=t.extmin,r=t.extmax,n=Xi(t);return{title:e==null?void 0:e.title,extents:{minX:a.x,minY:a.y,maxX:r.x,maxY:r.y},units:{insunits:t.insunits,lunits:t.lunits,luprec:t.luprec,aunits:t.aunits,auprec:t.auprec,measurement:t.measurement,ltscale:t.ltscale,angbase:t.angbase,angdir:t.angdir},grip:n,background:(e==null?void 0:e.background)??0}}function Ye(t,e,a,r,n){return Math.atan2(r-e,n*(a-t))}function me(t){return t.z>=0?1:-1}function Pa(t,e,a){if(!(a.radius>0)||!Number.isFinite(a.radius))return;const r=a.clockwise?-1:1,n=a.center.x,i=a.center.y;t.push({kind:"arc",layer:e,cx:n,cy:i,r:a.radius,startAngle:Ye(n,i,a.startPoint.x,a.startPoint.y,r),endAngle:Ye(n,i,a.endPoint.x,a.endPoint.y,r),normalSign:r})}function S(t,e){const a=new W(e.x,e.y,e.z??0).applyMatrix4(t);return{x:a.x,y:a.y}}function Wi(t){const e=t.elements;return new $t(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])}function St(t,e){return new $t().multiplyMatrices(t,Wi(e))}function Oa(t,e){const a=new W(e.x,e.y,e.z??0).transformDirection(t).normalize();return{x:a.x,y:a.y}}function qt(t){const e=new W(t.elements[0],t.elements[1],t.elements[2]).length(),a=new W(t.elements[4],t.elements[5],t.elements[6]).length();return dt.equal(e,a,sa*Math.max(e,a,1))}function Ki(t,e){const a=t.tables.blockTable.getIdAt(e);if(a)return a;for(const n of t.tables.blockTable.newIterator())if(n.objectId===e)return n;const r=t.tables.blockTable.modelSpace;if(r.objectId===e)return r}function Qi(t){if(t instanceof Wr)return!0;const e=t;return(e.type==="LINE"||e.type==="Line")&&e.startPoint!=null&&e.endPoint!=null}function Ji(t,e,a,r){r.startPoint,r.endPoint}function $a(t,e){return t.blockTableRecord??(t.blockName?e.tables.blockTable.getAt(t.blockName):void 0)}function qi(t,e){const a=t.dimBlockId;return a?e.tables.blockTable.getAt(a):void 0}function to(t,e){const a=$a(t,e);if(a)return a;const r=t.owningBlockRecordId;return r?e.tables.blockTable.getAt(r):void 0}function Ea(t){return t.getFullInsertionTransform()}function eo(t){for(const e of t.newIterator())return!0;return!1}function ao(t){return typeof t.getFullInsertionTransform=="function"&&"blockTableRecord"in t}function et(t,e,a,r,n){if(r.length<2)return;const i=qt(a),o=a.elements[0]*a.elements[5]-a.elements[4]*a.elements[1]<0?-1:1,l=[];for(const s of r){const c=S(a,s);let d=s.bulge??0;dt.isPositive(Math.abs(d))&&(d=i?d*o:0),l.push(c.x,c.y,d)}t.push({kind:"path",layer:e,closed:n,vertices:l})}function Na(t,e){return dt.equal(t.x,e.x)&&dt.equal(t.y,e.y)}function ro(t){return(t.clockwise?-1:1)*Math.tan(t.deltaAngle/4)}function Ge(t,e,a,r){if(t.length===0){t.push({x:e.x,y:e.y,z:e.z??0,bulge:r}),t.push({x:a.x,y:a.y,z:a.z??0,bulge:0});return}const n=t[t.length-1];Na(n,e)?n.bulge=r:(n.bulge=0,t.push({x:e.x,y:e.y,z:e.z??0,bulge:r})),t.push({x:a.x,y:a.y,z:a.z??0,bulge:0})}function Xe(t){return t.length>=2&&Na(t[0],t[t.length-1])&&t.pop(),t}function xt(t,e,a,r,n){if(r.length<2)return;const i=n?r.length:r.length-1;for(let o=0;o<i;o++)r[o],r[(o+1)%r.length]}function no(t,e,a,r){const n=[r.startPosition];for(const i of r.segments)n.push(i.position);xt(t,e,a,n,r.closed)}function io(t,e,a){if(a.vertices.length>=2)return a.vertices;if(a.vertices.length===0)return[];const r=a.vertices[0],n=e.lastLeaderLinePoint??e.landingPoint??t.landingPoint??t.contentBasePosition;if(!n)return a.vertices;const i=r.x-n.x,o=r.y-n.y,l=(r.z??0)-(n.z??0);return Math.hypot(i,o,l)<=sa?a.vertices:[r,n]}function oo(t,e,a,r){var n,i;for(const l of r.leaders)for(const s of l.leaderLines){const c=io(r,l,s);xt(t,e,a,c,!1)}const o=l=>{if(!l)return;const s=S(a,l);t.push({kind:"point",layer:e,x:s.x,y:s.y})};o(r.contentBasePosition),o((n=r.mtextContent)==null?void 0:n.anchorPoint),o((i=r.blockContent)==null?void 0:i.position)}function lo(t,e,a,r){const n=r.numberOfVertices;if(n<2)return;const i=r.elevation,o=r.closed?n:n-1;for(let l=0;l<o;l++){const s=r.getPointAt(l),c=r.getPointAt((l+1)%n),d=r.getBulgeAt(l),u={x:s.x,y:s.y,z:i},m={x:c.x,y:c.y,z:i};if(dt.isPositive(Math.abs(d))){const p=S(a,u),v=S(a,m);Pa(t,e,new ae(p,v,d))}}}function so(t,e,a,r,n,i){const o=S(a,r),l=new W(a.elements[0],a.elements[1],a.elements[2]).length(),s={kind:"circle",layer:e,cx:o.x,cy:o.y,r:n*l,normalSign:me(i)};t.push(s)}function co(t,e,a,r){const n=S(a,r.center),i=new W(a.elements[0],a.elements[1],a.elements[2]).length(),o={kind:"arc",layer:e,cx:n.x,cy:n.y,r:r.radius*i,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:me(r.normal)};t.push(o)}function Vt(t,e,a,r){const n=S(a,r.center),i=r._geo,o=(i==null?void 0:i.majorAxis)??{x:1,y:0,z:0},l=Oa(a,o),s=Math.hypot(l.x,l.y)||1,c=new W(a.elements[0],a.elements[1],a.elements[2]).length(),d=new W(a.elements[4],a.elements[5],a.elements[6]).length(),u={kind:"ellipse",layer:e,cx:n.x,cy:n.y,majorX:l.x/s,majorY:l.y/s,majorR:r.majorAxisRadius*c,minorR:r.minorAxisRadius*d,startAngle:r.startAngle,endAngle:r.endAngle,closed:r.closed,normalSign:me(r.normal)};t.push(u)}function uo(t,e,a,r){var n,i;const o=r._geo;if(!((n=o==null?void 0:o.controlPoints)!=null&&n.length))return;const l=[];for(const c of o.controlPoints){const d=S(a,c);l.push(d.x,d.y)}const s={kind:"spline",layer:e,controlPoints:l,degree:o.degree??3,knots:[...o.knots??[]],weights:[...o.weights??[]],closed:o.closed??!1};if((i=o.fitPoints)!=null&&i.length){s.fitPoints=[];for(const c of o.fitPoints){const d=S(a,c);s.fitPoints.push(d.x,d.y)}}t.push(s)}const We=1e-6;function mo(t){var e;const a=t.elevation,r=(e=t._geo)==null?void 0:e.vertices;return r&&r.length>1?r.map(n=>({x:n.x,y:n.y,z:a,bulge:n.bulge,startWidth:n.startWidth,endWidth:n.endWidth})):Array.from({length:t.numberOfVertices},(n,i)=>{const o=t.getPoint2dAt(i);return{x:o.x,y:o.y,z:a,bulge:0}})}function po(t){return t.some(e=>{const a=Math.max(0,e.startWidth??0),r=Math.max(0,e.endWidth??0);return a>We||r>We})}function ho(t,e,a,r){const n=mo(r),i=n.length;if(i<2)return;if(po(n)){et(t,e,a,n,r.closed);return}const o=r.closed?i:i-1;for(let l=0;l<o;l++){const s=n[l],c=n[(l+1)%i],d=s.bulge??0;if(dt.isPositive(Math.abs(d))){const u=S(a,s),m=S(a,c);Pa(t,e,new ae(u,m,d))}}}function fo(t,e,a,r,n){const i=S(a,{x:r.center.x,y:r.center.y,z:n}),o=Oa(a,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),l=Math.hypot(o.x,o.y)||1,s=new W(a.elements[0],a.elements[1],a.elements[2]).length(),c=new W(a.elements[4],a.elements[5],a.elements[6]).length();t.push({kind:"ellipse",layer:e,cx:i.x,cy:i.y,majorX:o.x/l,majorY:o.y/l,majorR:r.majorAxisRadius*s,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function go(t,e,a,r,n){var i;const o=r.numberOfVertices;if(o<2)return;const l=[];for(let s=0;s<o;s++){const c=r.getPointAt(s);l.push({x:c.x,y:c.y,z:n,bulge:((i=r.vertices[s])==null?void 0:i.bulge)??0})}et(t,e,a,l,r.closed)}function bo(t,e,a,r,n){if(r instanceof Qr){go(t,e,a,r,n);return}if(!(r instanceof Jr))return;const i=[];let o=!1;const l=()=>{const c=Xe(i);c.length>=2&&et(t,e,a,c,!1),i.length=0};for(const c of r.curves)c instanceof qr?Ge(i,{x:c.startPoint.x,y:c.startPoint.y,z:n},{x:c.endPoint.x,y:c.endPoint.y,z:n},0):c instanceof ae?Ge(i,{x:c.startPoint.x,y:c.startPoint.y,z:n},{x:c.endPoint.x,y:c.endPoint.y,z:n},ro(c)):c instanceof tn&&(o=!0,l(),fo(t,e,a,c,n));const s=Xe(i);s.length>=2&&et(t,e,a,s,!o)}function wo(t,e,a,r){var n;const i=(n=r._geo)==null?void 0:n.loops;if(!(i!=null&&i.length))return;const o=r.elevation;for(const l of i)bo(t,e,a,l,o)}function xo(t,e,a,r){St(a,Ea(r));const n=[0];for(let o=0;o<r.numColumns;o++)n.push(n[o]+r.columnWidth(o));const i=[0];for(let o=0;o<r.numRows;o++)i.push(i[o]-r.rowHeight(o));n[n.length-1],i[i.length-1];for(const o of i);for(const o of n);}function vo(t,e,a,r,n,i,o,l=!0){const s=te(t.layer,a);if(o&&!o(s))return;const c=to(t,i);if(c&&!n.has(c.objectId)&&eo(c)){n.add(c.objectId);const u=St(e,Ea(t));Pt(c,u,s,r,n,i,o,l),n.delete(c.objectId);return}xo(r,s,e,t);const d=S(e,t.position);r.push({kind:"point",layer:s,x:d.x,y:d.y})}function yo(t,e,a,r){let n=r.boundaryPath();if(n.length>1){const o=n[0],l=n[n.length-1];o.x===l.x&&o.y===l.y&&(o.z??0)===(l.z??0)&&(n=n.slice(0,-1))}n.length>=2&&et(t,e,a,n,!0);const i=S(a,r.position);t.push({kind:"point",layer:e,x:i.x,y:i.y})}function Lo(t,e,a,r){const n=r.position();et(t,e,a,[n.upperLeft,n.upperRight,n.lowerRight,n.lowerLeft],!0);const i=S(a,r.getLocation());t.push({kind:"point",layer:e,x:i.x,y:i.y})}function ko(t){var e;const a=(e=t.attributeIterator)==null?void 0:e.call(t);return a?typeof a.toArray=="function"?a.toArray():[...a]:[]}function te(t,e){return t==="0"?e:t}function Ua(t,e,a,r,n,i,o,l=!0){if(!t.visibility)return;const s=te(t.layer,a);if(!(o&&!o(s))){if(t instanceof Ar){vo(t,e,a,r,n,i,o,l);return}if(ao(t)){const c=$a(t,i);if(!c||n.has(c.objectId))return;n.add(c.objectId);const d=t.getFullInsertionTransform(),u=Math.max(1,t.columnCount??1),m=Math.max(1,t.rowCount??1),p=t.columnSpacing??0,v=t.rowSpacing??0,b=te(t.layer,a);for(let y=0;y<m;y++)for(let O=0;O<u;O++){const z=St(e,d);(O!==0||y!==0)&&z.multiply(new $t().makeTranslation(O*p,y*v,0));const N=S(z,{x:0,y:0,z:0});r.push({kind:"point",layer:b,x:N.x,y:N.y}),Pt(c,z,b,r,n,i,o,l)}for(const y of ko(t))y instanceof Mr,y.isInvisible||Ua(y,e,b,r,n,i,o,l);n.delete(c.objectId);return}if(t instanceof Cr){const c=t,d=qi(c,i);if(!d||n.has(d.objectId))return;n.add(d.objectId);const u=St(e,c.getFullDimBlockTransform());Pt(d,u,s,r,n,i,o,!0),n.delete(d.objectId);return}if(Qi(t)){Ji(r,s,e,t);return}if(t instanceof Ir){qt(e)?so(r,s,e,t.center,t.radius,t.normal):Vt(r,s,e,Ao(t));return}if(t instanceof zr){qt(e)?co(r,s,e,t):Vt(r,s,e,Mo(t));return}if(t instanceof ee){Vt(r,s,e,t);return}if(t instanceof Sr){uo(r,s,e,t);return}if(t instanceof Pr){ho(r,s,e,t);return}if(t instanceof Or){lo(r,s,e,t);return}if(t instanceof $r){const c=[];for(let d=0;d<t.numberOfVertices;d++)c.push(t.getPointAt(d));xt(r,s,e,c,t.closed);return}if(t instanceof Er){l&&wo(r,s,e,t);return}if(t instanceof Nr){t.basePoint,t.unitDir;return}if(t instanceof Ur){t.basePoint,t.unitDir;return}if(t instanceof Fr){et(r,s,e,[t.getPointAt(0),t.getPointAt(1),t.getPointAt(3),t.getPointAt(2)],!0);return}if(t instanceof _r){l&&et(r,s,e,[t.getPointAt(0),t.getPointAt(1),t.getPointAt(3),t.getPointAt(2)],!0);return}if(t instanceof Br){const c=t.subGetGripPoints();c.length>=2&&xt(r,s,e,c,c.length>=3);return}if(t instanceof Rr){const c=t.vertices;c.length>=2&&xt(r,s,e,c,!1);return}if(t instanceof Tr){no(r,s,e,t);return}if(t instanceof Dr){oo(r,s,e,t);return}if(t instanceof Hr){const c=S(e,t.position);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(t instanceof jr){const c=S(e,t.location);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(t instanceof Vr){l&&Lo(r,s,e,t);return}if(t instanceof Zr){l&&yo(r,s,e,t);return}if(t instanceof Yr){const c=S(e,t.position);r.push({kind:"point",layer:s,x:c.x,y:c.y})}}}function Pt(t,e,a,r,n,i,o,l=!0){for(const s of t.newIterator())Ua(s,e,a,r,n,i,o,l)}function Ao(t){return new ee(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,0,Kr)}function Mo(t){return new ee(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,t.startAngle,t.endAngle)}function Co(t,e,a={}){const r=Ki(t,e);if(!r)return{primitives:[]};const n=[],i=new $t;return Pt(r,i,"0",n,new Set,t,a.includeLayer),{primitives:n.filter(o=>o.kind!=="line"&&Io(o))}}function Io(t){switch(t.kind){case"line":return Number.isFinite(t.x0)&&Number.isFinite(t.y0)&&Number.isFinite(t.x1)&&Number.isFinite(t.y1);case"circle":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.r);case"arc":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.r)&&Number.isFinite(t.startAngle)&&Number.isFinite(t.endAngle);case"ellipse":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.majorX)&&Number.isFinite(t.majorY)&&Number.isFinite(t.majorR)&&Number.isFinite(t.minorR)&&Number.isFinite(t.startAngle)&&Number.isFinite(t.endAngle);case"spline":return t.controlPoints.every(e=>Number.isFinite(e))&&t.knots.every(e=>Number.isFinite(e))&&t.weights.every(e=>Number.isFinite(e));case"point":return Number.isFinite(t.x)&&Number.isFinite(t.y);case"path":return t.vertices.length>=6&&t.vertices.length%3===0&&t.vertices.every(e=>Number.isFinite(e));default:return t}}const Fa=["en","zh","cs","tr","ar"],zo={en:"EN",zh:"中",cs:"CS",tr:"TR",ar:"AR"};function _a(t){if(t==null||t==="")return null;const e=t.toLowerCase().replace("_","-");for(const a of Fa)if(e===a||e.startsWith(`${a}-`))return a;return null}const So=1128612673;function Po(t){const e=new se;e.writeU32(So),e.writeU8(tt),e.writeU8(0),e.writeU8(0),e.writeU8(0),e.writeString(t.layoutBtrId),e.writeU32(t.lineBatches.length);for(const a of t.lineBatches)Aa(e,a);e.writeU32(t.meshBatches.length);for(const a of t.meshBatches)Ma(e,a);return e.toUint8Array()}function Oo(t){const e=Po(t),a=le(e).bytes;return{uncompressed:e,compressed:a}}const $o=1329939265,Eo=1,No=1,Uo=2,Fo=3,_o=4,Bo=5,Ro=6,To=7;function Do(t){var e;switch(t.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+t.vertices.length*8;case"spline":return 10+(t.controlPoints.length+t.knots.length+t.weights.length+(((e=t.fitPoints)==null?void 0:e.length)??0))*8+16;default:return t}}function Ho(t,e){if(t.length===0)return[];const a=[];let r=[],n=64;const i=()=>{r.length!==0&&(a.push(r),r=[],n=64)};for(const o of t){const l=Do(o);r.length>0&&n+l>e&&i(),r.push(o),n+=l}return i(),a}function jo(t){const e=new se;e.writeU32($o),e.writeU8(Eo),e.writeU8(0),e.writeU8(0),e.writeU8(0);const a=[],r=new Map,n=i=>{const o=r.get(i);if(o!=null)return o;const l=a.length;return a.push(i),r.set(i,l),l};for(const i of t.primitives)n(i.layer);e.writeU32(a.length);for(const i of a)e.writeString(i);e.writeU32(t.primitives.length);for(const i of t.primitives)Zo(e,i,n(i.layer));return e.toUint8Array()}function Vo(t){const e=jo(t),a=le(e).bytes;return{uncompressed:e,compressed:a}}function Zt(t,e){t.writeU8(e<0?0:1)}function gt(t,e){t.writeU32(e.length);for(const a of e)t.writeF64(a)}function Zo(t,e,a){switch(e.kind){case"line":t.writeU8(No),t.writeU32(a),t.writeF64(e.x0),t.writeF64(e.y0),t.writeF64(e.x1),t.writeF64(e.y1);return;case"circle":t.writeU8(Uo),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.r),Zt(t,e.normalSign);return;case"arc":t.writeU8(Fo),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.r),t.writeF64(e.startAngle),t.writeF64(e.endAngle),Zt(t,e.normalSign);return;case"ellipse":t.writeU8(_o),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.majorX),t.writeF64(e.majorY),t.writeF64(e.majorR),t.writeF64(e.minorR),t.writeF64(e.startAngle),t.writeF64(e.endAngle),t.writeU8(e.closed?1:0),Zt(t,e.normalSign??1);return;case"spline":t.writeU8(Bo),t.writeU32(a),gt(t,e.controlPoints),t.writeU32(e.degree),gt(t,e.knots),gt(t,e.weights),t.writeU8(e.closed?1:0),gt(t,e.fitPoints??[]);return;case"point":t.writeU8(Ro),t.writeU32(a),t.writeF64(e.x),t.writeF64(e.y);return;case"path":t.writeU8(To),t.writeU32(a),t.writeU8(e.closed?1:0),gt(t,e.vertices);return;default:{const r=e;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}const Yo=1,Go=2*1024*1024,Ut=2*1024*1024,Xo=512*1024,Ba="drawing.acex.json",Wo=`./${Ba}`,h={select:en,pan:an,zoomExtent:rn,measureDistance:dn,measureContinuous:un,measureAngle:mn,measureArc:hn,measureArea:pn,measureCoordinate:Vn,clearMeasurements:gn,layer:on,layout:ln,zoomWindow:nn,zoomOriginal:Fn,layerOn:Rn,layerOff:Tn,language:$n,osnap:Dn,orthoMode:Hn,polarTracking:jn,chevronUp:Nn,chevronDown:Un,measure:sn,annotation:wn,markupCloud:Zn,markupCallout:kn,markupText:An,markupRect:Yn,markupCircle:Gn,markupArrow:Mn,markupStamp:Cn,markupPanel:ua,measurementPanel:In,markupImport:zn,markupExport:Sn,markupShow:Xn,clearMarkups:Pn,settings:_n,simulatedMouse:Bn,switchBg:bn,themeDark:En};function g(t,e,a){const r=Object.entries(a).map(([o,l])=>`${o}="${bt(l)}"`).join(" "),n=a["data-i18n-key"],i=n?`<span class="mlcad-tool-btn-label" data-i18n-key="${bt(n)}" data-i18n-text>${bt(e)}</span>`:"";return`<button type="button" class="mlcad-tool-btn" title="${bt(e)}" aria-label="${bt(e)}" ${r}><span class="mlcad-tool-btn-icon" aria-hidden="true">${t}</span>${i}</button>`}function bt(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}const Ko=[90,45,30,23,18,10,5],Qo={en:"toolbar.localeEn",zh:"toolbar.localeZh",cs:"toolbar.localeCs",tr:"toolbar.localeTr",ar:"toolbar.localeAr"},Jo={en:"English",zh:"中文",cs:"Čeština",tr:"Türkçe",ar:"العربية"};function qo(){return`<div id="mlcad-locale-strip-wrap" hidden>
2
+ <div id="mlcad-locale-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.language" aria-label="Language">
3
+ ${Fa.map(t=>{const e=Jo[t],a=Qo[t],r=zo[t];return`<button type="button" class="mlcad-tool-btn mlcad-locale-option" data-locale="${t}" data-i18n-key="${a}" data-i18n-attr="title aria-label" title="${e}" aria-label="${e}"><span class="mlcad-tool-btn-icon" aria-hidden="true"><span class="mlcad-locale-option-badge">${r}</span></span><span class="mlcad-tool-btn-label" data-i18n-key="${a}" data-i18n-text>${e}</span></button>`}).join("")}
4
+ </div>
5
+ </div>`}function tl(){const t=Ko.map(e=>`<button type="button" class="mlcad-tool-btn mlcad-settings-option-btn mlcad-polar-angle-btn" data-polar-ang="${e}" title="${e}°" aria-label="${e}°"><span class="mlcad-settings-option-indicator" aria-hidden="true"></span><span class="mlcad-settings-option-text">${e}°</span></button>`).join("");return`
6
+ <div id="mlcad-snap-strip-wrap" hidden>
7
+ <div id="mlcad-snap-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.snap" aria-label="Object snap">
8
+ ${g(h.orthoMode,"Orthogonal mode",{id:"mlcad-ortho-btn","data-toggle":"ortho","data-i18n-key":"settings.ortho","data-i18n-attr":"title aria-label"})}
9
+ ${g(h.polarTracking,"Polar tracking",{id:"mlcad-polar-btn","data-toggle":"polar","data-i18n-key":"settings.polar","data-i18n-attr":"title aria-label"})}
10
+ </div>
11
+ <div id="mlcad-polar-angles" role="group" data-i18n-attr="aria-label" data-i18n-key="settings.polarAngles" aria-label="Polar tracking angles" hidden>
12
+ ${t}
13
+ </div>
14
+ </div>`}const el=600,al=960,Ra=`
15
+ :root {
16
+ --mlcad-ui-bg: rgba(24, 26, 30, 0.94);
17
+ --mlcad-ui-bg-elevated: rgba(32, 35, 40, 0.98);
18
+ --mlcad-ui-border: rgba(255, 255, 255, 0.1);
19
+ --mlcad-ui-text: #e8eaed;
20
+ --mlcad-ui-muted: #9aa0a6;
21
+ --mlcad-accent: #08e8de;
22
+ --mlcad-accent-active: #1a8cff;
23
+ /* Shared measure-tool SVGs read --el-color-primary (Element Plus in cad-viewer). */
24
+ --el-color-primary: var(--mlcad-accent);
25
+ --ml-ui-accent: var(--mlcad-accent);
26
+ --ml-ui-bg: var(--mlcad-ui-bg);
27
+ --ml-ui-bg-elevated: var(--mlcad-ui-bg-elevated);
28
+ --ml-ui-border: var(--mlcad-ui-border);
29
+ --ml-ui-text: var(--mlcad-ui-text);
30
+ --ml-ui-muted: var(--mlcad-ui-muted);
31
+ --mlcad-tool-btn-active-border: rgba(26, 140, 255, 0.55);
32
+ --mlcad-tool-btn-active-bg: rgba(26, 140, 255, 0.22);
33
+ --mlcad-measure-accent: #08e8de;
34
+ --mlcad-measure-accent-border: rgba(8, 232, 222, 0.45);
35
+ --mlcad-measure-accent-fill: rgba(8, 232, 222, 0.2);
36
+ --mlcad-markup-accent: #e53935;
37
+ --mlcad-markup-accent-border: rgba(229, 57, 53, 0.45);
38
+ --mlcad-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
39
+ --mlcad-toolbar-width: 44px;
40
+ --mlcad-drawer-width: 220px;
41
+ --mlcad-drawer-gap: 8px;
42
+ --mlcad-ui-inset: 12px;
43
+ --mlcad-review-max-height: calc(100vh - 2 * var(--mlcad-ui-inset) - 48px);
44
+ --mlcad-z-chrome: 7;
45
+ /* Drawing overlays stay under chrome, session panel, and modal dialogs. */
46
+ --mlcad-z-measure: 1;
47
+ --mlcad-z-markup: 2;
48
+ --ml-ui-grip-size: 8px;
49
+ --ml-ui-grip-normal: #0080ff;
50
+ --ml-ui-grip-hot: #ff0000;
51
+ }
52
+ html, body {
53
+ margin: 0; height: 100%; overflow: hidden;
54
+ background: #121418;
55
+ font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
56
+ color: var(--mlcad-ui-text);
57
+ }
58
+ #mlcad-root { position: relative; width: 100%; height: 100%; }
59
+ #mlcad-canvas-host {
60
+ position: absolute;
61
+ inset: 0;
62
+ min-width: 0;
63
+ min-height: 0;
64
+ }
65
+ #mlcad-canvas-host canvas,
66
+ #mlcad-root > canvas {
67
+ display: block;
68
+ width: 100%;
69
+ height: 100%;
70
+ touch-action: none;
71
+ }
72
+
73
+ .mlcad-snap-loupe {
74
+ position: absolute;
75
+ left: 8px;
76
+ top: 56px;
77
+ width: 128px;
78
+ height: 128px;
79
+ box-sizing: border-box;
80
+ border: 2px solid var(--mlcad-measure-accent, #08e8de);
81
+ border-radius: 2px;
82
+ pointer-events: none;
83
+ z-index: 8;
84
+ overflow: hidden;
85
+ box-shadow: var(--mlcad-shadow);
86
+ }
87
+
88
+ html[data-mlcad-theme="light"] {
89
+ --mlcad-ui-bg: rgba(255, 255, 255, 0.94);
90
+ --mlcad-ui-bg-elevated: rgba(248, 249, 250, 0.98);
91
+ --mlcad-ui-border: rgba(0, 0, 0, 0.12);
92
+ --mlcad-ui-text: #202124;
93
+ --mlcad-ui-muted: #5f6368;
94
+ --mlcad-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
95
+ }
96
+ html[data-mlcad-theme="light"],
97
+ html[data-mlcad-theme="light"] body {
98
+ background: #e8eaed;
99
+ color: var(--mlcad-ui-text);
100
+ }
101
+
102
+ #mlcad-sidebar {
103
+ position: absolute;
104
+ left: var(--mlcad-ui-inset);
105
+ top: 50%;
106
+ z-index: var(--mlcad-z-chrome);
107
+ transform: translateY(-50%);
108
+ display: flex;
109
+ align-items: flex-start;
110
+ gap: var(--mlcad-drawer-gap);
111
+ max-width: calc(100% - 2 * var(--mlcad-ui-inset));
112
+ box-sizing: border-box;
113
+ pointer-events: none;
114
+ }
115
+ #mlcad-sidebar > * { pointer-events: auto; }
116
+
117
+ #mlcad-toolbar {
118
+ flex-shrink: 0;
119
+ display: flex; flex-direction: column; gap: 4px;
120
+ padding: 6px;
121
+ background: var(--mlcad-ui-bg);
122
+ border: 1px solid var(--mlcad-ui-border);
123
+ border-radius: 8px;
124
+ box-shadow: var(--mlcad-shadow);
125
+ backdrop-filter: blur(12px);
126
+ }
127
+ .mlcad-tool-btn {
128
+ position: relative;
129
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
130
+ gap: 2px;
131
+ width: var(--mlcad-toolbar-width); height: var(--mlcad-toolbar-width);
132
+ margin: 0; padding: 0;
133
+ border: 1px solid transparent;
134
+ border-radius: 6px;
135
+ background: transparent;
136
+ color: var(--mlcad-ui-text);
137
+ cursor: pointer;
138
+ transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
139
+ }
140
+ .mlcad-tool-btn:hover {
141
+ background: rgba(255, 255, 255, 0.08);
142
+ border-color: var(--mlcad-ui-border);
143
+ }
144
+ .mlcad-tool-btn.active,
145
+ .mlcad-tool-btn.is-menu-open {
146
+ background: var(--mlcad-tool-btn-active-bg);
147
+ border-color: var(--mlcad-tool-btn-active-border);
148
+ color: #fff;
149
+ }
150
+ .mlcad-tool-btn-icon {
151
+ display: inline-flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ width: 20px;
155
+ height: 20px;
156
+ flex-shrink: 0;
157
+ }
158
+ .mlcad-tool-btn-icon svg,
159
+ .mlcad-tool-btn svg {
160
+ width: 20px; height: 20px; display: block; flex-shrink: 0;
161
+ }
162
+ .mlcad-tool-btn-label {
163
+ display: none;
164
+ max-width: 100%;
165
+ overflow: hidden;
166
+ text-overflow: ellipsis;
167
+ white-space: nowrap;
168
+ font-size: 10px;
169
+ line-height: 1.2;
170
+ text-align: center;
171
+ pointer-events: none;
172
+ }
173
+ /* Settings is always on the bar (desktop/pad/phone); language lives under it. */
174
+ /* Flyout mark: opaque corner triangle (cad-simple-ui-plugin is-left style). */
175
+ .mlcad-tool-btn.has-children::after {
176
+ content: '';
177
+ position: absolute;
178
+ right: 1px;
179
+ bottom: 1px;
180
+ width: 6px;
181
+ height: 6px;
182
+ background: currentColor;
183
+ clip-path: polygon(100% 100%, 0 100%, 100% 0);
184
+ pointer-events: none;
185
+ }
186
+ .mlcad-dropdown {
187
+ position: fixed;
188
+ z-index: 40;
189
+ min-width: 180px;
190
+ max-width: min(280px, calc(100vw - 24px));
191
+ max-height: min(360px, calc(100vh - 24px));
192
+ overflow-y: auto;
193
+ padding: 4px;
194
+ background: var(--mlcad-ui-bg-elevated);
195
+ border: 1px solid var(--mlcad-ui-border);
196
+ border-radius: 8px;
197
+ box-shadow: var(--mlcad-shadow);
198
+ backdrop-filter: blur(12px);
199
+ }
200
+ .mlcad-dropdown-item {
201
+ display: flex;
202
+ align-items: center;
203
+ gap: 8px;
204
+ width: 100%;
205
+ box-sizing: border-box;
206
+ margin: 0;
207
+ padding: 6px 8px;
208
+ border: none;
209
+ border-radius: 5px;
210
+ background: transparent;
211
+ color: var(--mlcad-ui-text);
212
+ font-size: 12px;
213
+ font-weight: 500;
214
+ text-align: left;
215
+ cursor: pointer;
216
+ }
217
+ .mlcad-dropdown-item:hover {
218
+ background: rgba(255, 255, 255, 0.08);
219
+ }
220
+ .mlcad-dropdown-item.active,
221
+ .mlcad-dropdown-item.is-toggled {
222
+ background: rgba(26, 140, 255, 0.22);
223
+ color: #fff;
224
+ }
225
+ .mlcad-dropdown-icon {
226
+ display: inline-flex;
227
+ width: 18px;
228
+ height: 18px;
229
+ flex-shrink: 0;
230
+ align-items: center;
231
+ justify-content: center;
232
+ }
233
+ .mlcad-dropdown-icon svg {
234
+ width: 18px;
235
+ height: 18px;
236
+ display: block;
237
+ }
238
+ .mlcad-dropdown-label {
239
+ overflow: hidden;
240
+ text-overflow: ellipsis;
241
+ white-space: nowrap;
242
+ }
243
+ .mlcad-dropdown-separator {
244
+ height: 1px;
245
+ margin: 4px 6px;
246
+ background: var(--mlcad-ui-border);
247
+ }
248
+ #mlcad-toolbar-toggle {
249
+ height: calc(var(--mlcad-toolbar-width) / 2);
250
+ margin-top: -4px;
251
+ margin-bottom: -4px;
252
+ border-radius: 4px;
253
+ }
254
+ #mlcad-toolbar-toggle svg {
255
+ width: calc(var(--mlcad-toolbar-width) / 2);
256
+ height: calc(var(--mlcad-toolbar-width) / 2);
257
+ }
258
+ .mlcad-tool-separator {
259
+ height: 1px;
260
+ margin: 4px 8px;
261
+ background: var(--mlcad-ui-border);
262
+ }
263
+ .mlcad-locale-option-badge {
264
+ display: inline-flex;
265
+ align-items: center;
266
+ justify-content: center;
267
+ width: 100%;
268
+ height: 100%;
269
+ font-size: 12px;
270
+ font-weight: 700;
271
+ line-height: 1;
272
+ letter-spacing: -0.04em;
273
+ user-select: none;
274
+ }
275
+ #mlcad-zoom-window-rect,
276
+ #mlcad-selection-rect {
277
+ position: fixed;
278
+ z-index: 25;
279
+ box-sizing: border-box;
280
+ pointer-events: none;
281
+ border: 1px dashed var(--mlcad-accent, #08e8de);
282
+ background: rgba(8, 232, 222, 0.12);
283
+ }
284
+ #mlcad-zoom-window-rect[hidden],
285
+ #mlcad-selection-rect[hidden] { display: none; }
286
+ #mlcad-selection-rect[data-mode='window'] {
287
+ border-style: solid;
288
+ border-color: #00ff5a;
289
+ background: rgba(64, 158, 255, 0.12);
290
+ }
291
+ #mlcad-selection-rect[data-mode='crossing'] {
292
+ border-style: dashed;
293
+ border-color: #00d1ff;
294
+ background: rgba(64, 158, 255, 0.12);
295
+ }
296
+
297
+ #mlcad-layer-drawer,
298
+ #mlcad-review-drawer,
299
+ #mlcad-measure-drawer {
300
+ flex-shrink: 1;
301
+ min-width: 0;
302
+ width: var(--mlcad-drawer-width);
303
+ max-height: min(420px, var(--mlcad-review-max-height));
304
+ display: flex; flex-direction: column;
305
+ background: var(--mlcad-ui-bg-elevated);
306
+ border: 1px solid var(--mlcad-ui-border);
307
+ border-radius: 8px;
308
+ box-shadow: var(--mlcad-shadow);
309
+ backdrop-filter: blur(12px);
310
+ overflow: hidden;
311
+ box-sizing: border-box;
312
+ }
313
+ #mlcad-markup-strip-wrap {
314
+ position: relative;
315
+ }
316
+ #mlcad-review-drawer {
317
+ position: absolute;
318
+ left: 100%;
319
+ top: 0;
320
+ margin-left: var(--mlcad-drawer-gap);
321
+ width: min(320px, calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap)));
322
+ height: 100%;
323
+ max-height: var(--mlcad-review-max-height);
324
+ }
325
+ #mlcad-layer-drawer[hidden],
326
+ #mlcad-review-drawer[hidden],
327
+ #mlcad-measure-drawer[hidden] { display: none; }
328
+
329
+ .mlcad-drawer-header {
330
+ display: flex; align-items: center; justify-content: space-between;
331
+ gap: 6px; padding: 8px 10px;
332
+ border-bottom: 1px solid var(--mlcad-ui-border);
333
+ font-size: 13px; font-weight: 600;
334
+ }
335
+ .mlcad-drawer-close {
336
+ width: 28px; height: 28px; padding: 0;
337
+ border: none; border-radius: 4px;
338
+ background: transparent; color: var(--mlcad-ui-muted);
339
+ cursor: pointer; font-size: 18px; line-height: 1;
340
+ }
341
+ .mlcad-drawer-close:hover {
342
+ background: rgba(255, 255, 255, 0.08); color: var(--mlcad-ui-text);
343
+ }
344
+
345
+ .mlcad-drawer-sheet-chrome {
346
+ display: none;
347
+ position: relative;
348
+ }
349
+ .mlcad-drawer-grabber {
350
+ flex: 1 1 auto;
351
+ display: flex;
352
+ align-items: center;
353
+ justify-content: center;
354
+ min-height: 20px;
355
+ cursor: ns-resize;
356
+ touch-action: none;
357
+ }
358
+ .mlcad-drawer-grabber::before {
359
+ content: '';
360
+ position: absolute;
361
+ left: 50%;
362
+ top: 50%;
363
+ transform: translate(-50%, -50%);
364
+ width: 36px;
365
+ height: 4px;
366
+ border-radius: 2px;
367
+ background: var(--mlcad-ui-muted);
368
+ opacity: 0.75;
369
+ }
370
+ .mlcad-drawer-sheet-close {
371
+ width: 36px; height: 28px; padding: 0;
372
+ border: none; background: transparent;
373
+ color: var(--mlcad-ui-muted); cursor: pointer;
374
+ display: inline-flex; align-items: center; justify-content: center;
375
+ flex: 0 0 auto;
376
+ position: relative;
377
+ z-index: 1;
378
+ }
379
+ .mlcad-drawer-sheet-close:hover { color: var(--mlcad-ui-text); }
380
+ .mlcad-drawer-sheet-close svg { width: 18px; height: 18px; }
381
+
382
+ .mlcad-layer-actions {
383
+ display: flex; gap: 4px; padding: 6px 8px;
384
+ border-bottom: 1px solid var(--mlcad-ui-border);
385
+ }
386
+ .mlcad-layer-action-btn {
387
+ flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
388
+ min-height: 30px; padding: 4px 8px;
389
+ border: 1px solid var(--mlcad-ui-border);
390
+ border-radius: 5px;
391
+ background: rgba(255, 255, 255, 0.04);
392
+ color: var(--mlcad-ui-text);
393
+ font-size: 12px; cursor: pointer;
394
+ }
395
+ .mlcad-layer-action-btn:hover { background: rgba(255, 255, 255, 0.1); }
396
+ .mlcad-layer-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
397
+
398
+ #mlcad-layer-list {
399
+ flex: 1; overflow: auto; padding: 4px 0;
400
+ }
401
+ .mlcad-layer-item {
402
+ display: grid;
403
+ grid-template-columns: auto auto 1fr auto;
404
+ align-items: center; gap: 6px;
405
+ padding: 5px 8px;
406
+ font-size: 12px; cursor: pointer;
407
+ }
408
+ .mlcad-layer-item:hover { background: rgba(255, 255, 255, 0.05); }
409
+ .mlcad-layer-item input { margin: 0; cursor: pointer; }
410
+ .mlcad-layer-swatch {
411
+ width: 12px; height: 12px; border-radius: 2px;
412
+ border: 1px solid rgba(255, 255, 255, 0.28);
413
+ }
414
+ .mlcad-layer-name {
415
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
416
+ }
417
+ .mlcad-layer-zoom {
418
+ display: flex; align-items: center; justify-content: center;
419
+ width: 22px; height: 22px; padding: 0;
420
+ border: 1px solid transparent; border-radius: 4px;
421
+ background: transparent; color: var(--mlcad-ui-muted);
422
+ cursor: pointer;
423
+ }
424
+ .mlcad-layer-zoom svg {
425
+ width: 14px; height: 14px; display: block;
426
+ }
427
+ .mlcad-layer-zoom:hover:not(:disabled) {
428
+ color: var(--mlcad-accent);
429
+ border-color: var(--mlcad-ui-border);
430
+ background: rgba(255, 255, 255, 0.06);
431
+ }
432
+ .mlcad-layer-zoom:disabled { opacity: 0.35; cursor: not-allowed; }
433
+
434
+ .mlcad-review-toolbar {
435
+ display: flex; gap: 6px; align-items: center;
436
+ padding: 6px 8px;
437
+ border-bottom: 1px solid var(--mlcad-ui-border);
438
+ }
439
+ .mlcad-review-search {
440
+ flex: 1; min-width: 0;
441
+ box-sizing: border-box;
442
+ padding: 4px 8px;
443
+ border: 1px solid var(--mlcad-ui-border);
444
+ border-radius: 4px;
445
+ background: rgba(255, 255, 255, 0.04);
446
+ color: var(--mlcad-ui-text);
447
+ font-size: 12px;
448
+ }
449
+ .mlcad-review-clear,
450
+ .mlcad-review-zoom,
451
+ .mlcad-review-delete {
452
+ flex: 0 0 auto;
453
+ padding: 4px 8px;
454
+ border: 1px solid var(--mlcad-ui-border);
455
+ border-radius: 4px;
456
+ background: rgba(255, 255, 255, 0.04);
457
+ color: var(--mlcad-ui-text);
458
+ font-size: 12px; cursor: pointer;
459
+ }
460
+ .mlcad-review-clear:disabled { opacity: 0.5; cursor: default; }
461
+ .mlcad-review-delete { color: #f56c6c; border-color: rgba(245, 108, 108, 0.55); }
462
+ .mlcad-review-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
463
+ .mlcad-review-table {
464
+ width: 100%; border-collapse: collapse; font-size: 12px;
465
+ }
466
+ .mlcad-review-table th,
467
+ .mlcad-review-table td {
468
+ padding: 4px 8px; text-align: left;
469
+ border-bottom: 1px solid var(--mlcad-ui-border);
470
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
471
+ max-width: 90px;
472
+ }
473
+ .mlcad-review-table tr.is-selected td {
474
+ background: rgba(26, 140, 255, 0.22);
475
+ }
476
+ .mlcad-review-table tr { cursor: pointer; }
477
+ .mlcad-review-empty td { text-align: center; color: var(--mlcad-ui-muted); cursor: default; }
478
+ .mlcad-review-detail {
479
+ flex: 0 1 auto;
480
+ max-height: 52%;
481
+ overflow: auto;
482
+ border-top: 1px solid var(--mlcad-ui-border);
483
+ padding: 8px 10px 14px;
484
+ display: flex; flex-direction: column; gap: 6px;
485
+ box-sizing: border-box;
486
+ }
487
+ .mlcad-review-detail[hidden] { display: none; }
488
+ .mlcad-review-detail-header {
489
+ display: flex; align-items: center; justify-content: space-between; gap: 4px;
490
+ }
491
+ .mlcad-review-detail-title { font-weight: 600; font-size: 12px; }
492
+ .mlcad-review-detail-close {
493
+ flex-shrink: 0;
494
+ width: 24px; height: 24px; padding: 0;
495
+ border: none; border-radius: 4px;
496
+ background: transparent; color: var(--mlcad-ui-muted);
497
+ cursor: pointer; font-size: 16px; line-height: 1;
498
+ }
499
+ .mlcad-review-detail-close:hover {
500
+ background: rgba(255, 255, 255, 0.08); color: var(--mlcad-ui-text);
501
+ }
502
+ .mlcad-review-field { display: flex; flex-direction: column; gap: 2px; }
503
+ .mlcad-review-field-label { font-size: 11px; color: var(--mlcad-ui-muted); }
504
+ .mlcad-review-status,
505
+ .mlcad-review-author,
506
+ .mlcad-review-text,
507
+ .mlcad-review-comment {
508
+ box-sizing: border-box; width: 100%;
509
+ padding: 4px 6px;
510
+ border: 1px solid var(--mlcad-ui-border);
511
+ border-radius: 4px;
512
+ background: rgba(255, 255, 255, 0.04);
513
+ color: var(--mlcad-ui-text);
514
+ font-size: 12px;
515
+ }
516
+ .mlcad-review-author:disabled { opacity: 0.7; }
517
+ .mlcad-review-comment { min-height: 44px; resize: vertical; }
518
+ .mlcad-review-detail-actions { display: flex; gap: 6px; margin-top: 2px; }
519
+
520
+ .mlcad-measure-toolbar {
521
+ display: flex; gap: 8px; align-items: center;
522
+ padding: 8px 10px; border-bottom: 1px solid var(--mlcad-ui-border);
523
+ }
524
+ .mlcad-measure-filter {
525
+ flex: 1 1 auto; min-width: 0;
526
+ display: flex; overflow: hidden;
527
+ border: 1px solid var(--mlcad-ui-border); border-radius: 4px;
528
+ }
529
+ .mlcad-measure-filter-btn {
530
+ flex: 1 1 0; min-width: 0; padding: 4px 2px;
531
+ border: none; border-right: 1px solid var(--mlcad-ui-border);
532
+ background: transparent; color: var(--mlcad-ui-text);
533
+ font: inherit; font-size: 11px; cursor: pointer;
534
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
535
+ }
536
+ .mlcad-measure-filter-btn:last-child { border-right: none; }
537
+ .mlcad-measure-filter-btn:hover:not(.is-active) {
538
+ background: rgba(255, 255, 255, 0.06);
539
+ }
540
+ .mlcad-measure-filter-btn.is-active {
541
+ background: rgba(8, 232, 222, 0.18);
542
+ }
543
+ .mlcad-measure-clear,
544
+ .mlcad-measure-row-delete {
545
+ border: 1px solid var(--mlcad-ui-border); border-radius: 4px;
546
+ background: rgba(255, 255, 255, 0.04); color: var(--mlcad-ui-text);
547
+ padding: 4px 8px; font-size: 12px; cursor: pointer;
548
+ }
549
+ .mlcad-measure-clear:disabled { opacity: 0.5; cursor: default; }
550
+ .mlcad-measure-row-delete { color: #f56c6c; border-color: rgba(245, 108, 108, 0.55); padding: 2px 6px; font-size: 11px; }
551
+ .mlcad-measure-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
552
+ .mlcad-measure-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
553
+ .mlcad-measure-table th,
554
+ .mlcad-measure-table td {
555
+ padding: 6px 8px; text-align: left; font-size: 12px;
556
+ border-bottom: 1px solid var(--mlcad-ui-border);
557
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
558
+ }
559
+ .mlcad-measure-table tr.is-selected td {
560
+ background: rgba(8, 232, 222, 0.12);
561
+ }
562
+ .mlcad-measure-table tr { cursor: pointer; }
563
+ .mlcad-measure-empty td { text-align: center; color: var(--mlcad-ui-muted); cursor: default; }
564
+ #mlcad-measure-strip-wrap { position: relative; }
565
+ #mlcad-measure-drawer {
566
+ position: absolute;
567
+ left: 100%;
568
+ top: 0;
569
+ margin-left: var(--mlcad-drawer-gap);
570
+ width: min(320px, calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap)));
571
+ height: 100%;
572
+ max-height: var(--mlcad-review-max-height);
573
+ }
574
+
575
+ #mlcad-status-bar {
576
+ position: absolute; left: 12px; right: 12px; top: 10px; z-index: var(--mlcad-z-chrome);
577
+ display: flex; align-items: center; min-height: 28px; padding: 0 12px;
578
+ border: 1px solid rgba(0, 0, 0, 0.12);
579
+ border-radius: 6px;
580
+ background: var(--mlcad-accent);
581
+ color: #0b1f1e;
582
+ font-size: 12px;
583
+ font-weight: 600;
584
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
585
+ backdrop-filter: blur(10px);
586
+ pointer-events: none;
587
+ opacity: 1;
588
+ transform: translateY(0);
589
+ transition: opacity 0.18s ease, transform 0.18s ease;
590
+ }
591
+ #mlcad-status-bar:empty,
592
+ #mlcad-status-bar[hidden] {
593
+ display: none;
594
+ opacity: 0;
595
+ transform: translateY(-6px);
596
+ }
597
+
598
+ /* Session panel DOM/CSS comes from shared AcUiMobileSessionPanel. */
599
+ #mlcad-root {
600
+ --ml-mobile-cmd-collapsed-height: var(--mlcad-toolbar-phone-height, 56px);
601
+ }
602
+ .ml-mobile-cmd-panel {
603
+ z-index: calc(var(--mlcad-z-chrome) + 3);
604
+ }
605
+
606
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-snap-strip-wrap,
607
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-measure-strip-wrap,
608
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-markup-strip-wrap,
609
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-zoom-strip-wrap,
610
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-settings-strip-wrap,
611
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-locale-strip-wrap,
612
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-layer-drawer,
613
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-review-drawer,
614
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-measure-drawer {
615
+ display: none !important;
616
+ }
617
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-btn:not(#mlcad-toolbar-toggle) {
618
+ display: none;
619
+ }
620
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-separator {
621
+ display: none;
622
+ }
623
+
624
+ #mlcad-snap-strip-wrap,
625
+ #mlcad-measure-strip-wrap,
626
+ #mlcad-markup-strip-wrap,
627
+ #mlcad-zoom-strip-wrap,
628
+ #mlcad-settings-strip-wrap,
629
+ #mlcad-locale-strip-wrap {
630
+ flex-shrink: 0;
631
+ min-width: 0;
632
+ display: flex;
633
+ flex-direction: row;
634
+ align-items: flex-start;
635
+ gap: var(--mlcad-drawer-gap);
636
+ }
637
+ #mlcad-snap-strip-wrap[hidden],
638
+ #mlcad-measure-strip-wrap[hidden],
639
+ #mlcad-markup-strip-wrap[hidden],
640
+ #mlcad-zoom-strip-wrap[hidden],
641
+ #mlcad-settings-strip-wrap[hidden],
642
+ #mlcad-locale-strip-wrap[hidden] { display: none; }
643
+
644
+ #mlcad-snap-strip,
645
+ #mlcad-measure-strip,
646
+ #mlcad-markup-strip,
647
+ #mlcad-zoom-strip,
648
+ #mlcad-settings-strip,
649
+ #mlcad-locale-strip {
650
+ flex-shrink: 0;
651
+ display: flex;
652
+ flex-direction: column;
653
+ align-items: stretch;
654
+ gap: 4px;
655
+ padding: 6px;
656
+ background: var(--mlcad-ui-bg);
657
+ border: 1px solid var(--mlcad-ui-border);
658
+ border-radius: 8px;
659
+ box-shadow: var(--mlcad-shadow);
660
+ backdrop-filter: blur(12px);
661
+ }
662
+ /* Pad/desktop: same button size as the parent bar so a vertical strip
663
+ matches its width and a horizontal strip matches its height. */
664
+ #mlcad-snap-strip .mlcad-tool-btn,
665
+ #mlcad-measure-strip .mlcad-tool-btn,
666
+ #mlcad-markup-strip .mlcad-tool-btn,
667
+ #mlcad-zoom-strip .mlcad-tool-btn,
668
+ #mlcad-settings-strip .mlcad-tool-btn,
669
+ #mlcad-locale-strip .mlcad-tool-btn {
670
+ width: var(--mlcad-toolbar-width);
671
+ height: var(--mlcad-toolbar-width);
672
+ }
673
+ #mlcad-measure-strip .mlcad-tool-separator,
674
+ #mlcad-markup-strip .mlcad-tool-separator {
675
+ margin: 2px 4px;
676
+ }
677
+
678
+ #mlcad-polar-angles {
679
+ flex-shrink: 0;
680
+ display: inline-flex;
681
+ flex-direction: column;
682
+ align-items: stretch;
683
+ gap: 4px;
684
+ padding: 6px;
685
+ max-width: min(280px, calc(100vw - 2 * var(--mlcad-ui-inset) - 3 * var(--mlcad-toolbar-width) - 3 * var(--mlcad-drawer-gap)));
686
+ background: var(--mlcad-ui-bg);
687
+ border: 1px solid var(--mlcad-ui-border);
688
+ border-radius: 8px;
689
+ box-shadow: var(--mlcad-shadow);
690
+ backdrop-filter: blur(12px);
691
+ }
692
+ #mlcad-polar-angles[hidden] { display: none; }
693
+
694
+ .mlcad-color-input {
695
+ position: absolute;
696
+ width: 0;
697
+ height: 0;
698
+ opacity: 0;
699
+ pointer-events: none;
700
+ }
701
+ .mlcad-settings-option-btn {
702
+ width: 100%;
703
+ box-sizing: border-box;
704
+ height: var(--mlcad-toolbar-width);
705
+ justify-content: flex-start;
706
+ gap: 8px;
707
+ padding: 0 10px;
708
+ font-size: 11px;
709
+ font-weight: 500;
710
+ }
711
+ .mlcad-settings-option-indicator {
712
+ flex-shrink: 0;
713
+ width: 10px;
714
+ height: 10px;
715
+ border: 1px solid var(--mlcad-ui-muted);
716
+ border-radius: 2px;
717
+ box-sizing: border-box;
718
+ transition: background 0.15s ease, border-color 0.15s ease;
719
+ }
720
+ .mlcad-settings-option-btn.active .mlcad-settings-option-indicator {
721
+ background: var(--mlcad-accent);
722
+ border-color: var(--mlcad-accent);
723
+ }
724
+ .mlcad-settings-option-text {
725
+ overflow: hidden;
726
+ text-overflow: ellipsis;
727
+ white-space: nowrap;
728
+ pointer-events: none;
729
+ line-height: 1.2;
730
+ }
731
+
732
+ #mlcad-measure-overlays {
733
+ position: absolute;
734
+ inset: 0;
735
+ pointer-events: none;
736
+ z-index: var(--mlcad-z-measure);
737
+ overflow: hidden;
738
+ }
739
+ .mlcad-measure-canvas {
740
+ position: absolute;
741
+ left: 0;
742
+ top: 0;
743
+ z-index: 1;
744
+ pointer-events: none;
745
+ }
746
+ .mlcad-measure-dot {
747
+ position: absolute;
748
+ z-index: 3;
749
+ width: 10px;
750
+ height: 10px;
751
+ border-radius: 50%;
752
+ background: var(--mlcad-measure-accent);
753
+ border: 2px solid rgba(255, 255, 255, 0.9);
754
+ box-sizing: border-box;
755
+ transform: translate(-50%, -50%);
756
+ visibility: hidden;
757
+ pointer-events: none;
758
+ cursor: grab;
759
+ }
760
+ .mlcad-measure-dot.mlcad-measure-selected {
761
+ visibility: visible;
762
+ pointer-events: auto;
763
+ box-shadow:
764
+ 0 0 0 2px rgba(255, 213, 79, 0.75),
765
+ 0 0 10px rgba(255, 213, 79, 0.95),
766
+ 0 0 18px rgba(255, 213, 79, 0.55);
767
+ }
768
+ #mlcad-measure-overlays.mlcad-grip-dragging .mlcad-measure-dot {
769
+ visibility: hidden !important;
770
+ pointer-events: none !important;
771
+ }
772
+ .mlcad-measure-badge {
773
+ position: absolute;
774
+ z-index: 2;
775
+ padding: 3px 10px;
776
+ border-radius: 14px;
777
+ background: var(--mlcad-ui-bg-elevated);
778
+ border: 1px solid var(--mlcad-measure-accent-border);
779
+ color: var(--mlcad-measure-accent);
780
+ font-size: 12px;
781
+ font-weight: 600;
782
+ white-space: nowrap;
783
+ transform: translate(-50%, -50%);
784
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
785
+ pointer-events: none;
786
+ }
787
+ .mlcad-measure-badge--coordinate {
788
+ transform: translate(-50%, calc(-50% - 16px));
789
+ }
790
+ .mlcad-measure-badge.mlcad-measure-selected {
791
+ outline: 2px solid rgba(255, 213, 79, 0.85);
792
+ outline-offset: 1px;
793
+ box-shadow:
794
+ 0 0 0 2px rgba(255, 213, 79, 0.4),
795
+ 0 0 12px rgba(255, 213, 79, 0.75),
796
+ 0 2px 8px rgba(0, 0, 0, 0.35);
797
+ }
798
+ .mlcad-measure-canvas.mlcad-measure-selected {
799
+ filter:
800
+ drop-shadow(0 0 1.5px #ffd54f)
801
+ drop-shadow(0 0 4px rgba(255, 213, 79, 0.95))
802
+ drop-shadow(0 0 8px rgba(255, 213, 79, 0.55));
803
+ }
804
+
805
+ #mlcad-markup-overlays {
806
+ position: absolute;
807
+ inset: 0;
808
+ pointer-events: none;
809
+ z-index: var(--mlcad-z-markup);
810
+ overflow: hidden;
811
+ }
812
+ .mlcad-markup-canvas {
813
+ position: absolute;
814
+ left: 0;
815
+ top: 0;
816
+ z-index: 1;
817
+ pointer-events: none;
818
+ }
819
+ .mlcad-markup-badge,
820
+ .mlcad-markup-stamp {
821
+ position: absolute;
822
+ z-index: 2;
823
+ padding: 3px 10px;
824
+ border-radius: 14px;
825
+ background: var(--mlcad-ui-bg-elevated);
826
+ border: 1px solid var(--mlcad-markup-accent-border);
827
+ color: var(--mlcad-markup-accent);
828
+ font-size: 12px;
829
+ font-weight: 600;
830
+ white-space: pre-wrap;
831
+ max-width: 240px;
832
+ min-width: 80px;
833
+ min-height: 1.75em;
834
+ box-sizing: border-box;
835
+ transform: translate(-50%, -50%);
836
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
837
+ pointer-events: auto;
838
+ cursor: grab;
839
+ touch-action: none;
840
+ user-select: none;
841
+ }
842
+ .mlcad-markup-stamp {
843
+ border-radius: 4px;
844
+ border-width: 2px;
845
+ text-transform: uppercase;
846
+ letter-spacing: 0.04em;
847
+ font-size: 11px;
848
+ white-space: nowrap;
849
+ min-width: 0;
850
+ }
851
+ .mlcad-markup-preview-dot {
852
+ position: absolute;
853
+ width: 10px;
854
+ height: 10px;
855
+ border-radius: 50%;
856
+ background: var(--mlcad-markup-accent);
857
+ border: 2px solid rgba(255, 255, 255, 0.9);
858
+ box-sizing: border-box;
859
+ transform: translate(-50%, -50%);
860
+ pointer-events: none;
861
+ }
862
+ .mlcad-markup-dot {
863
+ position: absolute;
864
+ z-index: 3;
865
+ width: 10px;
866
+ height: 10px;
867
+ border-radius: 50%;
868
+ background: var(--mlcad-markup-accent);
869
+ border: 2px solid rgba(255, 255, 255, 0.9);
870
+ box-sizing: border-box;
871
+ transform: translate(-50%, -50%);
872
+ visibility: hidden;
873
+ pointer-events: none;
874
+ cursor: grab;
875
+ }
876
+ .mlcad-markup-dot.mlcad-markup-selected {
877
+ visibility: visible;
878
+ pointer-events: auto;
879
+ box-shadow:
880
+ 0 0 0 2px rgba(255, 213, 79, 0.75),
881
+ 0 0 10px rgba(255, 213, 79, 0.95),
882
+ 0 0 18px rgba(255, 213, 79, 0.55);
883
+ }
884
+ #mlcad-markup-overlays.mlcad-grip-dragging .mlcad-markup-dot {
885
+ visibility: hidden !important;
886
+ pointer-events: none !important;
887
+ }
888
+ .mlcad-markup-badge.mlcad-markup-selected,
889
+ .mlcad-markup-stamp.mlcad-markup-selected {
890
+ outline: 2px solid rgba(255, 213, 79, 0.85);
891
+ outline-offset: 1px;
892
+ box-shadow:
893
+ 0 0 0 2px rgba(255, 213, 79, 0.4),
894
+ 0 0 12px rgba(255, 213, 79, 0.75),
895
+ 0 2px 8px rgba(0, 0, 0, 0.35);
896
+ }
897
+ .mlcad-markup-canvas.mlcad-markup-selected {
898
+ filter:
899
+ drop-shadow(0 0 1.5px #ffd54f)
900
+ drop-shadow(0 0 4px rgba(255, 213, 79, 0.95))
901
+ drop-shadow(0 0 8px rgba(255, 213, 79, 0.55));
902
+ }
903
+
904
+ #mlcad-loading {
905
+ position: fixed; inset: 0; z-index: 100;
906
+ display: flex; align-items: center; justify-content: center;
907
+ background: #121418;
908
+ transition: opacity 0.35s ease, visibility 0.35s ease;
909
+ }
910
+ #mlcad-loading.mlcad-loading--done {
911
+ opacity: 0; visibility: hidden; pointer-events: none;
912
+ }
913
+ #mlcad-loading.mlcad-loading--gate .mlcad-loading-spinner {
914
+ display: none;
915
+ }
916
+ .mlcad-loading-spinner {
917
+ width: 48px; height: 48px; box-sizing: border-box;
918
+ border: 3px solid rgba(255, 255, 255, 0.12);
919
+ border-top-color: var(--mlcad-accent);
920
+ border-radius: 50%;
921
+ animation: mlcad-spin 0.85s linear infinite;
922
+ }
923
+ @keyframes mlcad-spin { to { transform: rotate(360deg); } }
924
+
925
+ #mlcad-access-gate {
926
+ display: flex;
927
+ align-items: center;
928
+ justify-content: center;
929
+ width: 100%;
930
+ max-width: 360px;
931
+ padding: 0 20px;
932
+ box-sizing: border-box;
933
+ }
934
+ #mlcad-access-gate[hidden] {
935
+ display: none !important;
936
+ }
937
+ .mlcad-access-card {
938
+ width: 100%;
939
+ padding: 24px 20px;
940
+ border-radius: 10px;
941
+ border: 1px solid var(--mlcad-ui-border);
942
+ background: var(--mlcad-ui-bg-elevated);
943
+ box-shadow: var(--mlcad-shadow);
944
+ box-sizing: border-box;
945
+ }
946
+ .mlcad-access-title {
947
+ margin: 0 0 8px;
948
+ font-size: 16px;
949
+ font-weight: 600;
950
+ color: var(--mlcad-ui-text);
951
+ text-align: center;
952
+ }
953
+ .mlcad-access-hint {
954
+ margin: 0 0 16px;
955
+ font-size: 13px;
956
+ line-height: 1.45;
957
+ color: var(--mlcad-ui-muted);
958
+ text-align: center;
959
+ }
960
+ .mlcad-access-expiry {
961
+ margin: -8px 0 16px;
962
+ font-size: 12px;
963
+ line-height: 1.4;
964
+ color: var(--mlcad-ui-muted);
965
+ text-align: center;
966
+ }
967
+ .mlcad-access-expiry[hidden] {
968
+ display: none;
969
+ }
970
+ .mlcad-access-expiry.mlcad-expiry-countdown {
971
+ width: fit-content;
972
+ max-width: 100%;
973
+ margin-left: auto;
974
+ margin-right: auto;
975
+ margin-bottom: 16px;
976
+ padding: 6px 10px;
977
+ border-radius: 6px;
978
+ box-sizing: border-box;
979
+ }
980
+ .mlcad-access-field {
981
+ display: flex;
982
+ gap: 8px;
983
+ margin-bottom: 12px;
984
+ }
985
+ .mlcad-access-field input {
986
+ flex: 1 1 auto;
987
+ min-width: 0;
988
+ height: 36px;
989
+ padding: 0 12px;
990
+ border-radius: 6px;
991
+ border: 1px solid var(--mlcad-ui-border);
992
+ background: rgba(0, 0, 0, 0.25);
993
+ color: var(--mlcad-ui-text);
994
+ font: inherit;
995
+ box-sizing: border-box;
996
+ }
997
+ .mlcad-access-field input:focus {
998
+ outline: none;
999
+ border-color: rgba(26, 140, 255, 0.65);
1000
+ box-shadow: 0 0 0 2px rgba(26, 140, 255, 0.2);
1001
+ }
1002
+ .mlcad-access-submit {
1003
+ width: 100%;
1004
+ height: 36px;
1005
+ border: 1px solid rgba(26, 140, 255, 0.55);
1006
+ border-radius: 6px;
1007
+ background: rgba(26, 140, 255, 0.22);
1008
+ color: #fff;
1009
+ font: inherit;
1010
+ font-weight: 600;
1011
+ cursor: pointer;
1012
+ }
1013
+ .mlcad-access-submit:hover {
1014
+ background: rgba(26, 140, 255, 0.32);
1015
+ }
1016
+ .mlcad-access-error {
1017
+ margin: 0;
1018
+ font-size: 12px;
1019
+ line-height: 1.4;
1020
+ color: #ff8a80;
1021
+ text-align: center;
1022
+ }
1023
+ .mlcad-access-error[hidden] {
1024
+ display: none;
1025
+ }
1026
+ .mlcad-access-gate--locked .mlcad-access-submit:disabled,
1027
+ .mlcad-access-gate--locked .mlcad-access-field input:disabled {
1028
+ opacity: 0.55;
1029
+ cursor: not-allowed;
1030
+ }
1031
+ .mlcad-access-field[hidden],
1032
+ .mlcad-access-submit[hidden],
1033
+ .mlcad-access-gate--expired .mlcad-access-field,
1034
+ .mlcad-access-gate--expired .mlcad-access-submit,
1035
+ .mlcad-access-gate--expired #mlcad-access-expiry,
1036
+ .mlcad-access-gate--expired #mlcad-access-error {
1037
+ display: none !important;
1038
+ }
1039
+ .mlcad-expiry-badge {
1040
+ position: fixed;
1041
+ top: var(--mlcad-ui-inset);
1042
+ right: var(--mlcad-ui-inset);
1043
+ z-index: 40;
1044
+ max-width: min(360px, calc(100vw - 2 * var(--mlcad-ui-inset)));
1045
+ padding: 8px 12px;
1046
+ border-radius: 6px;
1047
+ border: 1px solid var(--mlcad-ui-border);
1048
+ background: var(--mlcad-ui-bg-elevated);
1049
+ box-shadow: var(--mlcad-shadow);
1050
+ color: var(--mlcad-ui-text);
1051
+ font-size: 12px;
1052
+ line-height: 1.4;
1053
+ pointer-events: none;
1054
+ }
1055
+ .mlcad-expiry-badge[hidden] {
1056
+ display: none !important;
1057
+ }
1058
+ .mlcad-expiry-countdown {
1059
+ border-color: rgba(255, 152, 0, 0.55);
1060
+ background: rgba(255, 152, 0, 0.16);
1061
+ color: #ffcc80;
1062
+ font-variant-numeric: tabular-nums;
1063
+ }
1064
+
1065
+ @media (max-width: ${el}px) {
1066
+ :root {
1067
+ --mlcad-drawer-width: min(280px, calc(100vw - 16px));
1068
+ --mlcad-ui-inset: 0px;
1069
+ --mlcad-toolbar-phone-height: 56px;
1070
+ /* Portrait min width (narrower than simple-ui's height - 4). */
1071
+ --mlcad-toolbar-phone-btn-size: max(
1072
+ 24px,
1073
+ calc(var(--mlcad-toolbar-phone-height) - 16px)
1074
+ );
1075
+ }
1076
+ #mlcad-root {
1077
+ display: flex;
1078
+ flex-direction: column;
1079
+ }
1080
+ #mlcad-canvas-host {
1081
+ position: relative;
1082
+ flex: 1 1 auto;
1083
+ inset: auto;
1084
+ width: 100%;
1085
+ min-height: 0;
1086
+ }
1087
+ #mlcad-sidebar {
1088
+ position: relative;
1089
+ left: auto;
1090
+ top: auto;
1091
+ right: auto;
1092
+ transform: none;
1093
+ width: 100%;
1094
+ max-width: none;
1095
+ flex: 0 0 auto;
1096
+ flex-direction: column-reverse;
1097
+ align-items: stretch;
1098
+ gap: 0;
1099
+ overflow: visible;
1100
+ }
1101
+ #mlcad-toolbar {
1102
+ flex-direction: row;
1103
+ width: 100%;
1104
+ box-sizing: border-box;
1105
+ gap: 0;
1106
+ padding: 4px 0;
1107
+ border-radius: 0;
1108
+ border-left: none;
1109
+ border-right: none;
1110
+ border-bottom: none;
1111
+ }
1112
+ #mlcad-toolbar .mlcad-tool-btn {
1113
+ flex: 1 1 0;
1114
+ width: auto;
1115
+ min-width: 0;
1116
+ height: auto;
1117
+ min-height: var(--mlcad-toolbar-phone-height);
1118
+ border-radius: 0;
1119
+ padding: 4px 2px;
1120
+ }
1121
+ #mlcad-toolbar .mlcad-tool-btn-label,
1122
+ #mlcad-zoom-strip .mlcad-tool-btn-label,
1123
+ #mlcad-measure-strip .mlcad-tool-btn-label,
1124
+ #mlcad-markup-strip .mlcad-tool-btn-label,
1125
+ #mlcad-settings-strip .mlcad-tool-btn-label,
1126
+ #mlcad-locale-strip .mlcad-tool-btn-label,
1127
+ #mlcad-snap-strip .mlcad-tool-btn-label {
1128
+ display: block;
1129
+ max-width: 100%;
1130
+ overflow: hidden;
1131
+ text-overflow: ellipsis;
1132
+ white-space: nowrap;
1133
+ }
1134
+ /* Drop sticky :focus / touch :hover chrome after closing a strip. */
1135
+ #mlcad-toolbar .mlcad-tool-btn:focus,
1136
+ #mlcad-toolbar .mlcad-tool-btn:focus-visible {
1137
+ outline: none;
1138
+ }
1139
+ #mlcad-toolbar .mlcad-tool-btn:focus:not(.active):not(.is-menu-open),
1140
+ #mlcad-toolbar .mlcad-tool-btn:focus-visible:not(.active):not(.is-menu-open) {
1141
+ background: transparent;
1142
+ border-color: transparent;
1143
+ }
1144
+ @media (hover: none) {
1145
+ #mlcad-toolbar .mlcad-tool-btn:hover:not(.active):not(.is-menu-open) {
1146
+ background: transparent;
1147
+ border-color: transparent;
1148
+ }
1149
+ }
1150
+ .mlcad-tool-btn.has-children::after {
1151
+ display: none;
1152
+ }
1153
+ #mlcad-toolbar-toggle,
1154
+ #mlcad-toolbar .mlcad-tool-separator {
1155
+ display: none !important;
1156
+ }
1157
+ /* Float above the bottom bar so the wrap does not occupy an in-flow
1158
+ rectangle of page background around the rounded strip. */
1159
+ #mlcad-sidebar > #mlcad-snap-strip-wrap,
1160
+ #mlcad-sidebar > #mlcad-measure-strip-wrap,
1161
+ #mlcad-sidebar > #mlcad-markup-strip-wrap,
1162
+ #mlcad-sidebar > #mlcad-zoom-strip-wrap,
1163
+ #mlcad-sidebar > #mlcad-settings-strip-wrap,
1164
+ #mlcad-sidebar > #mlcad-locale-strip-wrap {
1165
+ position: absolute;
1166
+ left: 0;
1167
+ right: 0;
1168
+ bottom: 100%;
1169
+ width: auto;
1170
+ flex-direction: column;
1171
+ align-items: stretch;
1172
+ background: none;
1173
+ box-shadow: none;
1174
+ backdrop-filter: none;
1175
+ overflow: visible;
1176
+ pointer-events: none;
1177
+ z-index: calc(var(--mlcad-z-chrome) + 1);
1178
+ }
1179
+ #mlcad-settings-strip-wrap:not([hidden]) {
1180
+ display: flex !important;
1181
+ }
1182
+ #mlcad-snap-strip,
1183
+ #mlcad-measure-strip,
1184
+ #mlcad-markup-strip,
1185
+ #mlcad-zoom-strip,
1186
+ #mlcad-settings-strip,
1187
+ #mlcad-locale-strip {
1188
+ display: grid;
1189
+ /* Fallback before wrap-pack JS: auto-fit stretches a short strip evenly.
1190
+ JS then sets an explicit column count so wrapped last rows stay narrow. */
1191
+ grid-template-columns: repeat(
1192
+ auto-fit,
1193
+ minmax(var(--mlcad-toolbar-phone-btn-size), 1fr)
1194
+ );
1195
+ justify-content: start;
1196
+ align-content: flex-start;
1197
+ width: auto;
1198
+ box-sizing: border-box;
1199
+ gap: 0;
1200
+ margin: 4px 8px 8px;
1201
+ padding: 4px 0;
1202
+ border-radius: 8px;
1203
+ /* Match active toolbar button outline. */
1204
+ border: 1px solid var(--mlcad-tool-btn-active-border);
1205
+ box-shadow: none;
1206
+ backdrop-filter: none;
1207
+ overflow: hidden;
1208
+ isolation: isolate;
1209
+ clip-path: inset(0 round 8px);
1210
+ pointer-events: auto;
1211
+ }
1212
+ #mlcad-snap-strip .mlcad-tool-btn,
1213
+ #mlcad-measure-strip .mlcad-tool-btn,
1214
+ #mlcad-markup-strip .mlcad-tool-btn,
1215
+ #mlcad-zoom-strip .mlcad-tool-btn,
1216
+ #mlcad-settings-strip .mlcad-tool-btn,
1217
+ #mlcad-locale-strip .mlcad-tool-btn {
1218
+ width: 100%;
1219
+ min-width: 0;
1220
+ height: auto;
1221
+ min-height: var(--mlcad-toolbar-phone-height);
1222
+ border-radius: 0;
1223
+ padding: 4px 2px;
1224
+ box-sizing: border-box;
1225
+ }
1226
+ #mlcad-measure-strip .mlcad-tool-separator,
1227
+ #mlcad-markup-strip .mlcad-tool-separator {
1228
+ display: none;
1229
+ }
1230
+ #mlcad-polar-angles {
1231
+ flex-direction: row;
1232
+ flex-wrap: wrap;
1233
+ max-width: none;
1234
+ width: 100%;
1235
+ box-sizing: border-box;
1236
+ border-radius: 0;
1237
+ pointer-events: auto;
1238
+ }
1239
+ #mlcad-layer-drawer,
1240
+ #mlcad-review-drawer,
1241
+ #mlcad-measure-drawer {
1242
+ position: fixed;
1243
+ left: 0;
1244
+ right: 0;
1245
+ bottom: var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height));
1246
+ top: auto;
1247
+ margin: 0;
1248
+ width: 100%;
1249
+ max-width: none;
1250
+ height: min(42vh, calc(100vh - var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height)) - 12px));
1251
+ max-height: calc(100vh - var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height)) - 12px);
1252
+ z-index: calc(var(--mlcad-z-chrome) + 1);
1253
+ border-radius: 12px 12px 0 0;
1254
+ pointer-events: auto;
1255
+ }
1256
+ #mlcad-layer-drawer .mlcad-drawer-sheet-chrome,
1257
+ #mlcad-review-drawer .mlcad-drawer-sheet-chrome,
1258
+ #mlcad-measure-drawer .mlcad-drawer-sheet-chrome {
1259
+ display: flex;
1260
+ align-items: center;
1261
+ flex: 0 0 auto;
1262
+ min-height: 28px;
1263
+ }
1264
+ #mlcad-layer-drawer .mlcad-drawer-header,
1265
+ #mlcad-review-drawer .mlcad-drawer-header,
1266
+ #mlcad-measure-drawer .mlcad-drawer-header {
1267
+ display: none;
1268
+ }
1269
+ .mlcad-layer-action-btn {
1270
+ min-height: 28px;
1271
+ padding: 3px 6px;
1272
+ font-size: 11px;
1273
+ gap: 4px;
1274
+ }
1275
+ .mlcad-layer-action-btn svg { width: 12px; height: 12px; }
1276
+ .mlcad-layer-zoom {
1277
+ width: 20px;
1278
+ height: 20px;
1279
+ }
1280
+ .mlcad-layer-zoom svg {
1281
+ width: 12px;
1282
+ height: 12px;
1283
+ }
1284
+ #mlcad-status-bar {
1285
+ left: 8px;
1286
+ right: 8px;
1287
+ top: 8px;
1288
+ }
1289
+
1290
+ }
1291
+
1292
+ /* Pad / coarse pointer: same toolbar as desktop, minus select and pan. */
1293
+ @media (max-width: ${al}px), (pointer: coarse) {
1294
+ #mlcad-toolbar [data-action="select"],
1295
+ #mlcad-toolbar [data-action="pan"] {
1296
+ display: none !important;
1297
+ }
1298
+ }
1299
+
1300
+ /*
1301
+ * Hide toolbar chrome during measure / markup without changing canvas size.
1302
+ * On phone the sidebar is in the flex column; display:none would expand
1303
+ * #mlcad-canvas-host and shift the drawing. Session panel floats on top.
1304
+ */
1305
+ #mlcad-root.mlcad-session-active #mlcad-sidebar {
1306
+ visibility: hidden !important;
1307
+ pointer-events: none !important;
1308
+ }
1309
+ `;function Ta(t,e="measure",a=!0){const r=e==="measure"?cl():"",n=e==="measure"?dl():"",i=ll(),o="",l=`${ol()}${e==="measure"?`${ul()}${pl()}${tl()}`:""}${sl(e)}${qo()}`;return`
1310
+ <div id="mlcad-loading" aria-hidden="true" style="background:${t}">
1311
+ <div class="mlcad-loading-spinner"></div>
1312
+ <div id="mlcad-access-gate" hidden>
1313
+ <form id="mlcad-access-form" class="mlcad-access-card">
1314
+ <h2 class="mlcad-access-title" data-i18n-key="access.title" data-i18n-text>Protected drawing</h2>
1315
+ <p class="mlcad-access-hint" data-i18n-key="access.passwordPrompt" data-i18n-text>Enter the password to open this file.</p>
1316
+ <p id="mlcad-access-expiry" class="mlcad-access-expiry" hidden></p>
1317
+ <div class="mlcad-access-field">
1318
+ <input
1319
+ id="mlcad-access-password"
1320
+ type="password"
1321
+ autocomplete="off"
1322
+ data-i18n-key="access.passwordPlaceholder"
1323
+ data-i18n-attr="placeholder aria-label"
1324
+ placeholder="Password"
1325
+ aria-label="Password"
1326
+ />
1327
+ </div>
1328
+ <button type="submit" class="mlcad-access-submit" data-i18n-key="access.unlock" data-i18n-text>Unlock</button>
1329
+ <p id="mlcad-access-error" class="mlcad-access-error" hidden></p>
1330
+ </form>
1331
+ </div>
1332
+ </div>
1333
+ <div id="mlcad-root">
1334
+ <div id="mlcad-canvas-host">
1335
+ <footer id="mlcad-status-bar" aria-live="polite" hidden></footer>
1336
+ </div>
1337
+ <aside id="mlcad-sidebar">
1338
+ <nav id="mlcad-toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.viewerTools" aria-label="Viewer tools">
1339
+ ${g(h.select,"Select",{"data-action":"select","aria-pressed":"false","data-i18n-key":"toolbar.select","data-i18n-attr":"title aria-label"})}
1340
+ ${g(h.pan,"Pan",{"data-action":"pan","aria-pressed":"true","data-i18n-key":"toolbar.pan","data-i18n-attr":"title aria-label"})}
1341
+ ${il()}
1342
+ ${e==="measure"?Ot():""}
1343
+ ${r}
1344
+ ${n}
1345
+ ${e==="measure"?Ot():""}
1346
+ ${g(h.layer,"Layers",{id:"mlcad-layers-btn","aria-haspopup":"dialog","aria-expanded":"false","data-i18n-key":"toolbar.layers","data-i18n-attr":"title aria-label"})}
1347
+ ${a?nl():""}
1348
+ ${i}
1349
+ ${g(h.chevronUp,"Collapse toolbar",{id:"mlcad-toolbar-toggle","aria-expanded":"true","data-i18n-key":"toolbar.collapse","data-i18n-attr":"title aria-label"})}
1350
+ </nav>
1351
+ ${l}
1352
+ <div id="mlcad-layer-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="layers.title" aria-label="Layers" hidden>
1353
+ ${pe("mlcad-layer-sheet-close","layers.close","Close layers")}
1354
+ <div class="mlcad-drawer-header">
1355
+ <span data-i18n-key="layers.title" data-i18n-text>Layers</span>
1356
+ <button type="button" class="mlcad-drawer-close" id="mlcad-layer-close" data-i18n-key="layers.close" data-i18n-attr="aria-label" aria-label="Close layers">×</button>
1357
+ </div>
1358
+ <div class="mlcad-layer-actions">
1359
+ <button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-show-all">
1360
+ ${h.layerOn}<span data-i18n-key="layers.showAll" data-i18n-text>Show all</span>
1361
+ </button>
1362
+ <button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-hide-all">
1363
+ ${h.layerOff}<span data-i18n-key="layers.hideAll" data-i18n-text>Hide all</span>
1364
+ </button>
1365
+ </div>
1366
+ <div id="mlcad-layer-list"></div>
1367
+ </div>
1368
+ </aside>
1369
+ </div>
1370
+ ${o}`}function Ot(){return'<div class="mlcad-tool-separator" aria-hidden="true"></div>'}function pe(t,e,a){return`<div class="mlcad-drawer-sheet-chrome">
1371
+ <div class="mlcad-drawer-grabber" role="separator" aria-orientation="horizontal"></div>
1372
+ <button type="button" class="mlcad-drawer-sheet-close" id="${t}" data-i18n-key="${e}" data-i18n-attr="aria-label" aria-label="${a}">${h.chevronDown}</button>
1373
+ </div>`}function rl(){return`<div id="mlcad-review-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="review.title" aria-label="Review" hidden>
1374
+ ${pe("mlcad-review-sheet-close","review.close","Close review")}
1375
+ <div class="mlcad-drawer-header">
1376
+ <span data-i18n-key="review.title" data-i18n-text>Review</span>
1377
+ <button type="button" class="mlcad-drawer-close" id="mlcad-review-close" data-i18n-key="review.close" data-i18n-attr="aria-label" aria-label="Close review">×</button>
1378
+ </div>
1379
+ <div class="mlcad-review-toolbar">
1380
+ <input type="search" class="mlcad-review-search" data-i18n-key="review.searchPlaceholder" data-i18n-attr="placeholder" placeholder="Search markups" />
1381
+ <button type="button" class="mlcad-review-clear" data-i18n-key="review.clear" data-i18n-text>Clear all</button>
1382
+ </div>
1383
+ <div class="mlcad-review-table-wrap">
1384
+ <table class="mlcad-review-table">
1385
+ <thead>
1386
+ <tr>
1387
+ <th data-review-col="type" data-i18n-key="review.type" data-i18n-text>Type</th>
1388
+ <th data-review-col="status" data-i18n-key="review.status" data-i18n-text>Status</th>
1389
+ <th data-review-col="author" data-i18n-key="review.author" data-i18n-text>Author</th>
1390
+ <th data-review-col="summary" data-i18n-key="review.summary" data-i18n-text>Summary</th>
1391
+ </tr>
1392
+ </thead>
1393
+ <tbody></tbody>
1394
+ </table>
1395
+ </div>
1396
+ <div class="mlcad-review-detail" hidden>
1397
+ <div class="mlcad-review-detail-header">
1398
+ <div class="mlcad-review-detail-title" data-i18n-key="review.details" data-i18n-text>Details</div>
1399
+ <button type="button" class="mlcad-review-detail-close" data-i18n-key="review.closeDetails" data-i18n-attr="title aria-label" title="Close details" aria-label="Close details">×</button>
1400
+ </div>
1401
+ <div class="mlcad-review-field">
1402
+ <label class="mlcad-review-field-label" data-review-field="status" data-i18n-key="review.status" data-i18n-text>Status</label>
1403
+ <select class="mlcad-review-status"></select>
1404
+ </div>
1405
+ <div class="mlcad-review-field">
1406
+ <label class="mlcad-review-field-label" data-review-field="author" data-i18n-key="review.author" data-i18n-text>Author</label>
1407
+ <input type="text" class="mlcad-review-author" disabled />
1408
+ </div>
1409
+ <div class="mlcad-review-field">
1410
+ <label class="mlcad-review-field-label" data-review-field="label" data-i18n-key="review.label" data-i18n-text>Label</label>
1411
+ <input type="text" class="mlcad-review-text" />
1412
+ </div>
1413
+ <div class="mlcad-review-field">
1414
+ <label class="mlcad-review-field-label" data-review-field="comment" data-i18n-key="review.comment" data-i18n-text>Comment</label>
1415
+ <textarea class="mlcad-review-comment" rows="2"></textarea>
1416
+ </div>
1417
+ <div class="mlcad-review-detail-actions">
1418
+ <button type="button" class="mlcad-review-zoom" data-i18n-key="review.zoomTo" data-i18n-text>Zoom to</button>
1419
+ <button type="button" class="mlcad-review-delete" data-i18n-key="review.delete" data-i18n-text>Delete</button>
1420
+ </div>
1421
+ </div>
1422
+ </div>`}function nl(){return g(h.layout,"Layout",{id:"mlcad-layout-menu-btn","aria-haspopup":"menu","aria-expanded":"false","data-action":"layout-menu","data-i18n-key":"toolbar.layout","data-i18n-attr":"title aria-label","data-children-ui":"menu"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}function il(){return g(h.zoomExtent,"Zoom",{id:"mlcad-zoom-menu-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"zoom-menu","data-i18n-key":"toolbar.zoom","data-i18n-attr":"title aria-label","data-children-ui":"toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}function ol(){return`<div id="mlcad-zoom-strip-wrap" hidden>
1423
+ <div id="mlcad-zoom-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.zoom" aria-label="Zoom">
1424
+ ${g(h.zoomOriginal,"Original",{"data-action":"zoom-original","data-i18n-key":"toolbar.zoomOriginal","data-i18n-attr":"title aria-label"})}
1425
+ ${g(h.zoomExtent,"Extents",{"data-action":"fit","data-i18n-key":"toolbar.zoomExtents","data-i18n-attr":"title aria-label"})}
1426
+ ${g(h.zoomWindow,"Window",{"data-action":"zoom-window","aria-pressed":"false","data-i18n-key":"toolbar.zoomWindow","data-i18n-attr":"title aria-label"})}
1427
+ </div>
1428
+ </div>`}function ll(){return g(h.settings,"Settings",{id:"mlcad-settings-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"settings-menu","data-i18n-key":"toolbar.settings","data-i18n-attr":"title aria-label","data-children-ui":"toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}function sl(t){const e=t==="measure"?g(h.osnap,"Object snap",{id:"mlcad-settings-snap-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"snap-menu","data-i18n-key":"toolbar.snap","data-i18n-attr":"title aria-label","data-children-ui":"sticky-toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"'):"";return`<div id="mlcad-settings-strip-wrap" hidden>
1429
+ <div id="mlcad-settings-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.settings" aria-label="Settings">
1430
+ ${g(h.simulatedMouse,"Mouse",{id:"mlcad-simulated-mouse-btn","data-action":"toggle-simulated-mouse","data-i18n-key":"toolbar.simulatedMouseOn","data-i18n-attr":"title aria-label"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn active"')}
1431
+ ${e}
1432
+ ${g(h.themeDark,"Light",{id:"mlcad-theme-btn","data-action":"toggle-theme","data-i18n-key":"toolbar.themeDark","data-i18n-attr":"title aria-label"})}
1433
+ ${g(h.switchBg,"Background",{"data-action":"switch-bg","data-i18n-key":"toolbar.switchBg","data-i18n-attr":"title aria-label"})}
1434
+ ${g(h.language,"Language",{id:"mlcad-settings-locale-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"locale-menu","data-i18n-key":"toolbar.language","data-i18n-attr":"title aria-label","data-children-ui":"toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}
1435
+ </div>
1436
+ </div>`}function cl(){return g(h.measure,"Measure",{id:"mlcad-measure-menu-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"measure-menu","data-i18n-key":"toolbar.measure","data-i18n-attr":"title aria-label","data-children-ui":"toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}function dl(){return g(h.annotation,"Review",{id:"mlcad-markup-menu-btn","aria-haspopup":"true","aria-expanded":"false","data-action":"markup-menu","data-i18n-key":"toolbar.annotation","data-i18n-attr":"title aria-label","data-children-ui":"toolbar"}).replace('class="mlcad-tool-btn"','class="mlcad-tool-btn has-children"')}function ul(){return`<div id="mlcad-measure-strip-wrap" hidden>
1437
+ <div id="mlcad-measure-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.measure" aria-label="Measure">
1438
+ ${g(h.measureDistance,"Distance",{"data-action":"measure","data-measure-mode":"distance","data-i18n-key":"toolbar.measureDistance","data-i18n-attr":"title aria-label"})}
1439
+ ${g(h.measureContinuous,"Continuous",{"data-action":"measure","data-measure-mode":"continuous","data-i18n-key":"toolbar.measureContinuous","data-i18n-attr":"title aria-label"})}
1440
+ ${g(h.measureAngle,"Angle",{"data-action":"measure","data-measure-mode":"angle","data-i18n-key":"toolbar.measureAngle","data-i18n-attr":"title aria-label"})}
1441
+ ${g(h.measureArc,"Arc",{"data-action":"measure","data-measure-mode":"arc","data-i18n-key":"toolbar.measureArc","data-i18n-attr":"title aria-label"})}
1442
+ ${g(h.measureArea,"Area",{"data-action":"measure","data-measure-mode":"area","data-i18n-key":"toolbar.measureArea","data-i18n-attr":"title aria-label"})}
1443
+ ${g(h.measureCoordinate,"XY",{"data-action":"measure","data-measure-mode":"coordinate","data-i18n-key":"toolbar.measureCoordinate","data-i18n-attr":"title aria-label"})}
1444
+ ${g(h.measurementPanel,"Results",{"data-action":"measure-panel","aria-pressed":"false","data-i18n-key":"toolbar.measurementPanel","data-i18n-attr":"title aria-label"})}
1445
+ ${g(h.markupShow,"Hide",{"data-action":"measure-visibility","data-i18n-key":"toolbar.measureHide","data-i18n-attr":"title aria-label"})}
1446
+ ${g(h.clearMeasurements,"Clear",{"data-action":"clear-measurements","data-i18n-key":"toolbar.clearMeasurements","data-i18n-attr":"title aria-label"})}
1447
+ ${Ot()}
1448
+ ${g(h.markupImport,"Import",{"data-action":"measure-import","data-i18n-key":"toolbar.measureImport","data-i18n-attr":"title aria-label"})}
1449
+ ${g(h.markupExport,"Export",{"data-action":"measure-export","data-i18n-key":"toolbar.measureExport","data-i18n-attr":"title aria-label"})}
1450
+ </div>
1451
+ ${ml()}
1452
+ </div>`}function ml(){return`<div id="mlcad-measure-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="measurePanel.title" aria-label="Measurements" hidden>
1453
+ ${pe("mlcad-measure-sheet-close","measurePanel.close","Close measurements")}
1454
+ <div class="mlcad-drawer-header">
1455
+ <span data-i18n-key="measurePanel.title" data-i18n-text>Measurements</span>
1456
+ <button type="button" class="mlcad-drawer-close" id="mlcad-measure-close" data-i18n-key="measurePanel.close" data-i18n-attr="aria-label" aria-label="Close measurements">×</button>
1457
+ </div>
1458
+ <div class="mlcad-measure-toolbar">
1459
+ <div class="mlcad-measure-filter" role="group" data-i18n-key="measurePanel.filterGroup" data-i18n-attr="aria-label" aria-label="Filter by type">
1460
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="distance" aria-pressed="false" data-i18n-key="measurePanel.filterDistance" data-i18n-text data-i18n-attr="title aria-label" title="Distance">Distance</button>
1461
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="arc" aria-pressed="false" data-i18n-key="measurePanel.filterArc" data-i18n-text data-i18n-attr="title aria-label" title="Arc">Arc</button>
1462
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="angle" aria-pressed="false" data-i18n-key="measurePanel.filterAngle" data-i18n-text data-i18n-attr="title aria-label" title="Angle">Angle</button>
1463
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="area" aria-pressed="false" data-i18n-key="measurePanel.filterArea" data-i18n-text data-i18n-attr="title aria-label" title="Area">Area</button>
1464
+ </div>
1465
+ <button type="button" class="mlcad-measure-clear" data-i18n-key="measurePanel.clear" data-i18n-text>Clear all</button>
1466
+ </div>
1467
+ <div class="mlcad-measure-table-wrap">
1468
+ <table class="mlcad-measure-table">
1469
+ <thead>
1470
+ <tr>
1471
+ <th data-measure-col="type" data-i18n-key="measurePanel.type" data-i18n-text>Type</th>
1472
+ <th data-measure-col="value" data-i18n-key="measurePanel.value" data-i18n-text>Value</th>
1473
+ <th></th>
1474
+ </tr>
1475
+ </thead>
1476
+ <tbody></tbody>
1477
+ </table>
1478
+ </div>
1479
+ </div>`}function pl(){return`<div id="mlcad-markup-strip-wrap" hidden>
1480
+ <div id="mlcad-markup-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.annotation" aria-label="Review">
1481
+ ${g(h.markupCloud,"Cloud",{"data-action":"markup","data-markup-mode":"cloud","data-i18n-key":"toolbar.markupCloud","data-i18n-attr":"title aria-label"})}
1482
+ ${g(h.markupRect,"Rect",{"data-action":"markup","data-markup-mode":"rect","data-i18n-key":"toolbar.markupRect","data-i18n-attr":"title aria-label"})}
1483
+ ${g(h.markupCircle,"Circle",{"data-action":"markup","data-markup-mode":"circle","data-i18n-key":"toolbar.markupCircle","data-i18n-attr":"title aria-label"})}
1484
+ ${g(h.markupCallout,"Callout",{"data-action":"markup","data-markup-mode":"callout","data-i18n-key":"toolbar.markupCallout","data-i18n-attr":"title aria-label"})}
1485
+ ${g(h.markupArrow,"Arrow",{"data-action":"markup","data-markup-mode":"arrow","data-i18n-key":"toolbar.markupArrow","data-i18n-attr":"title aria-label"})}
1486
+ ${g(h.markupText,"Text",{"data-action":"markup","data-markup-mode":"text","data-i18n-key":"toolbar.markupText","data-i18n-attr":"title aria-label"})}
1487
+ ${g(h.markupStamp,"Stamp",{"data-action":"markup","data-markup-mode":"stamp","data-i18n-key":"toolbar.markupStamp","data-i18n-attr":"title aria-label"})}
1488
+ ${g(h.markupPanel,"Results",{"data-action":"markup-panel","aria-pressed":"false","data-i18n-key":"toolbar.markupPanel","data-i18n-attr":"title aria-label"})}
1489
+ ${g(h.markupShow,"Hide",{"data-action":"markup-visibility","data-i18n-key":"toolbar.markupHide","data-i18n-attr":"title aria-label"})}
1490
+ ${g(h.clearMarkups,"Clear",{"data-action":"clear-markups","data-i18n-key":"toolbar.clearMarkups","data-i18n-attr":"title aria-label"})}
1491
+ ${Ot()}
1492
+ ${g(h.markupImport,"Import",{"data-action":"markup-import","data-i18n-key":"toolbar.markupImport","data-i18n-attr":"title aria-label"})}
1493
+ ${g(h.markupExport,"Export",{"data-action":"markup-export","data-i18n-key":"toolbar.markupExport","data-i18n-attr":"title aria-label"})}
1494
+ </div>
1495
+ ${rl()}
1496
+ </div>`}function Ke(t,e){var a;const r=e.title??t.meta.title??"CAD Drawing",n=e.encoded??Kt(t),i=e.viewerRuntime,o=wi(),l=n.compression,s=((a=e.accessManifest)==null?void 0:a.encrypted)===!0,c=`#${t.meta.background.toString(16).padStart(6,"0")}`,d=_a(t.meta.locale)??"en",u=t.meta.viewerMode??"measure",m=t.meta.exportLayouts!==!1,p=e.accessManifest?` <script id="mlcad-access" type="application/json">${ja(JSON.stringify(e.accessManifest))}<\/script>
1497
+ `:"",v=s?`${o}+aes-gcm;base64`:`${o}+${l};base64`;return`<!DOCTYPE html>
1498
+ <html lang="${d}">
1499
+ <head>
1500
+ <meta charset="utf-8" />
1501
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
1502
+ <meta name="generator" content="mlightcad-cad-html-plugin" />
1503
+ <title>${Da(r)}</title>
1504
+ <style>${Ra}</style>
1505
+ </head>
1506
+ <body>
1507
+ ${Ta(c,u,m)}
1508
+ ${p} <script id="mlcad-snapshot" type="${v}">${n.payload}<\/script>
1509
+ <script>${Ha(i)}<\/script>
1510
+ </body>
1511
+ </html>`}function hl(t,e){var a;const r=e.title??t.meta.title??"CAD Drawing",n=e.viewerRuntime,i=`#${t.meta.background.toString(16).padStart(6,"0")}`,o=_a(t.meta.locale)??"en",l=t.meta.viewerMode??"measure",s=t.meta.exportLayouts!==!1,c=(a=e.manifestUrl)==null?void 0:a.trim(),d=JSON.stringify(c&&c!==Wo?{manifestUrl:c}:{});return`<!DOCTYPE html>
1512
+ <html lang="${o}">
1513
+ <head>
1514
+ <meta charset="utf-8" />
1515
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
1516
+ <meta name="generator" content="mlightcad-cad-html-plugin" />
1517
+ <title>${Da(r)}</title>
1518
+ <style>${Ra}</style>
1519
+ </head>
1520
+ <body>
1521
+ ${Ta(i,l,s)}
1522
+ <script id="mlcad-package" type="application/json">${ja(d)}<\/script>
1523
+ <script>${Ha(n)}<\/script>
1524
+ </body>
1525
+ </html>`}function Da(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ha(t){return t.replace(/<\/script/gi,"<\\/script")}function ja(t){return t.replace(/</g,"\\u003c")}const fl=1,gl=1e5,bl=16,wl=12;function xl(t,e=Date.now(),a){return t==="never"?null:t==="custom"?a??null:e+t*24*60*60*1e3}function Va(t){var e;const a=!!((e=t.password)!=null&&e.trim());return t.expiresAt!=null||a}function Qe(t){var e;if(!Va(t))return;const a=!!((e=t.password)!=null&&e.trim());return{v:fl,expiresAt:t.expiresAt,encrypted:a,...a&&t.salt?{salt:t.salt}:{}}}async function vl(t,e){const a=crypto.getRandomValues(new Uint8Array(bl)),r=crypto.getRandomValues(new Uint8Array(wl)),n=await yl(t,a),i=new Uint8Array(Ll(e)),o=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(r)},n,i)),l=new Uint8Array(r.length+o.length);return l.set(r,0),l.set(o,r.length),{encryptedPayload:qe(l),salt:qe(a)}}async function Je(t,e){var a;if(!Va(e))return{encoded:t};const r=(a=e.password)==null?void 0:a.trim();if(r){const{encryptedPayload:n,salt:i}=await vl(r,t.payload);return{encoded:{payload:n,compression:t.compression},manifest:Qe({expiresAt:e.expiresAt,password:r,salt:i})}}return{encoded:t,manifest:Qe({expiresAt:e.expiresAt})}}async function yl(t,e){const a=new TextEncoder,r=await crypto.subtle.importKey("raw",a.encode(t),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(e),iterations:gl,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function qe(t){let e="";for(let a=0;a<t.length;a++)e+=String.fromCharCode(t[a]);return btoa(e)}function Ll(t){const e=atob(t.trim()),a=new Uint8Array(e.length);for(let r=0;r<e.length;r++)a[r]=e.charCodeAt(r);return a}const kl=256;function Al(t,e=Ut){return!(e>0)||La(t)<=e?[t]:t.indices&&t.indices.length>=2?Il(t,e):Cl(t,e)}function Ml(t,e=Ut){return t.texture?[t]:!(e>0)||ka(t)<=e?[t]:t.points?Sl(t,e):!t.indices||t.indices.length<3?Ya(t,e):Ol(t,e)}function Za(t){return t.linePattern?64+t.linePattern.pattern.length*8:0}function he(t){return(t.hatchPattern?128:0)+(t.gradientFill?64:0)}function kt(t,e,a){const r=t-kl-e;return r<a?1:Math.max(1,Math.floor(r/a))}function Cl(t,e){var a;const r=(((a=t.lineDistances)==null?void 0:a.length)??0)>=2,n=24+(r?8:0),i=kt(e,Za(t),n),o=t.positions.length/6|0;if(o<=1)return[t];const l=[];for(let s=0;s<o;s+=i){const c=Math.min(i,o-s),d=s*6,u={layer:t.layer,color:t.color,offset:t.offset,positions:t.positions.slice(d,d+c*6)};if(Wa(t,u),r&&t.lineDistances){const m=s*2;u.lineDistances=t.lineDistances.slice(m,m+c*2)}l.push(u)}return l.length>0?l:[t]}function Il(t,e){var a;const r=t.indices,n=32+((((a=t.lineDistances)==null?void 0:a.length)??0)>0?8:0),i=kt(e,Za(t),n),o=[];for(let l=0;l+1<r.length;){const s=Math.min(i*2,r.length-l),c=s-s%2;if(c<2)break;o.push(zl(t,l,c)),l+=c}return o.length>0?o:[t]}function zl(t,e,a){const r=Xa(t.positions,t.indices.subarray(e,e+a),t.lineDistances?[t.lineDistances]:[],[1]),n={layer:t.layer,color:t.color,offset:t.offset,positions:r.positions,indices:r.indices};return Wa(t,n),r.attributes[0]&&r.attributes[0].length>0&&(n.lineDistances=r.attributes[0]),n}function Sl(t,e){return t.indices&&t.indices.length>0?Pl(t,e):Ya(t,e)}function Pl(t,e){const a=t.indices,r=16+(t.uvs?8:0)+(t.gradientPositions?8:0),n=kt(e,he(t),r),i=[];for(let o=0;o<a.length;){const l=Math.min(n,a.length-o);if(l<1)break;i.push(Ga(t,o,l)),o+=l}return i.length>0?i:[t]}function Ya(t,e){const a=t.positions.length/3|0;if(a<=1)return[t];const r=12+(t.uvs?8:0)+(t.gradientPositions?8:0),n=kt(e,he(t),r),i=t.points?1:3,o=Math.max(i,n-n%i),l=[];for(let s=0;s<a;s+=o){const c=Math.min(o,a-s),d=c-c%i;if(d<i)break;l.push($l(t,s,d))}return l.length>0?l:[t]}function Ol(t,e){const a=t.indices,r=48+(t.uvs?24:0)+(t.gradientPositions?24:0),n=kt(e,he(t),r),i=[];for(let o=0;o+2<a.length;){const l=Math.min(n*3,a.length-o),s=l-l%3;if(s<3)break;i.push(Ga(t,o,s)),o+=s}return i.length>0?i:[t]}function $l(t,e,a){const r=e*3,n={layer:t.layer,color:t.color,offset:t.offset,positions:t.positions.slice(r,r+a*3)};return Ka(t,n),t.uvs&&(n.uvs=t.uvs.slice(e*2,(e+a)*2)),t.gradientPositions&&(n.gradientPositions=t.gradientPositions.slice(e*2,(e+a)*2)),n}function Ga(t,e,a){const r=[],n=[];t.uvs&&(r.push(t.uvs),n.push(2)),t.gradientPositions&&(r.push(t.gradientPositions),n.push(2));const i=Xa(t.positions,t.indices.subarray(e,e+a),r,n),o={layer:t.layer,color:t.color,offset:t.offset,positions:i.positions,indices:i.indices};Ka(t,o);let l=0;return t.uvs&&(o.uvs=i.attributes[l++]),t.gradientPositions&&(o.gradientPositions=i.attributes[l]),o}function Xa(t,e,a,r){const n=new Map,i=[],o=new Uint32Array(e.length),l=a.map(()=>[]);for(let s=0;s<e.length;s++){const c=e[s];let d=n.get(c);if(d==null){d=n.size,n.set(c,d);const u=c*3;i.push(t[u]??0,t[u+1]??0,t[u+2]??0);for(let m=0;m<a.length;m++){const p=r[m],v=a[m],b=c*p;for(let y=0;y<p;y++)l[m].push(v[b+y]??0)}}o[s]=d}return{positions:Float32Array.from(i),indices:o,attributes:l.map(s=>Float32Array.from(s))}}function Wa(t,e){t.linePattern&&(e.linePattern=t.linePattern),t.lineWidth!=null&&(e.lineWidth=t.lineWidth),t.renderOrder!=null&&(e.renderOrder=t.renderOrder),t.excludeFromOsnap&&(e.excludeFromOsnap=!0)}function Ka(t,e){t.hatchPattern&&(e.hatchPattern=t.hatchPattern),t.gradientFill&&(e.gradientFill=t.gradientFill),t.side!=null&&(e.side=t.side),t.renderOrder!=null&&(e.renderOrder=t.renderOrder),t.points&&(e.points=!0)}function El(t,e,a=Ut){const r=[];let n={lineBatches:[],meshBatches:[],estimatedBytes:64};const i=()=>{n.lineBatches.length===0&&n.meshBatches.length===0&&r.length>0||(r.push(n),n={lineBatches:[],meshBatches:[],estimatedBytes:64})},o=c=>{const d=La(c);n.estimatedBytes+d>e&&(n.lineBatches.length>0||n.meshBatches.length>0)&&i(),n.lineBatches.push(c),n.estimatedBytes+=d},l=c=>{const d=ka(c);n.estimatedBytes+d>e&&(n.lineBatches.length>0||n.meshBatches.length>0)&&i(),n.meshBatches.push(c),n.estimatedBytes+=d},s=Math.min(e,a);for(const c of t.lineBatches)for(const d of Al(c,s))o(d);for(const c of t.meshBatches)for(const d of Ml(c,s))l(d);return(r.length===0||n.lineBatches.length>0||n.meshBatches.length>0)&&i(),r.length===0&&r.push({lineBatches:[],meshBatches:[],estimatedBytes:64}),r}function Nl(t,e){var a,r;if(t.version!==tt)throw new Error(`Unsupported snapshot version: ${t.version}`);const n=e.maxChunkBytes??Go,i=e.maxBatchBytes??Ut,o=e.maxOsnapChunkBytes??Xo,l=Ba,s=e.manifestUrl,c=Ul(t.layouts,t.activeLayoutBtrId),d=[],u=[],m=[],p=[],v=new Map;c.forEach((f,x)=>{var w;v.set(f.btrId,x);const H=El(f,n,i),K=[];H.forEach((P,B)=>{const $=`L${x}-${String(B).padStart(3,"0")}`,M=`chunks/${$}.acex.gz`,E={layoutBtrId:f.btrId,lineBatches:P.lineBatches,meshBatches:P.meshBatches},{uncompressed:j,compressed:J}=Oo(E);K.push($),d.push({id:$,href:M,layoutBtrId:f.btrId,byteLength:j.byteLength,compressedByteLength:J.byteLength,lineBatchCount:P.lineBatches.length,meshBatchCount:P.meshBatches.length}),p.push({path:M,bytes:J})});const _={btrId:f.btrId,name:f.name,isModelSpace:f.isModelSpace,viewports:f.viewports,chunkIds:K},G=(w=f.osnap)==null?void 0:w.primitives;if(G&&G.length>0){const P=Ho(G,o),B=[];P.forEach(($,M)=>{const E=`L${x}-osnap-${String(M).padStart(3,"0")}`,j=`chunks/${E}.osnap.gz`,{uncompressed:J,compressed:V}=Vo({primitives:$});B.push(E),u.push({id:E,href:j,layoutBtrId:f.btrId,byteLength:J.byteLength,compressedByteLength:V.byteLength,primitiveCount:$.length}),p.push({path:j,bytes:V})}),_.osnapChunkIds=B}m.push(_)});const b=t.layouts.map(f=>{const x=v.get(f.btrId);return m[x]}),y=new Set(((a=b.find(f=>f.btrId===t.activeLayoutBtrId))==null?void 0:a.chunkIds)??[]),O=[...d.filter(f=>y.has(f.id)),...d.filter(f=>!y.has(f.id))],z=new Set(((r=b.find(f=>f.btrId===t.activeLayoutBtrId))==null?void 0:r.osnapChunkIds)??[]),N=[...u.filter(f=>z.has(f.id)),...u.filter(f=>!z.has(f.id))],C={format:"acex-package",packageVersion:Yo,snapshotVersion:tt,meta:t.meta,layers:t.layers,activeLayoutBtrId:t.activeLayoutBtrId,layouts:b,chunks:O,...N.length>0?{osnapChunks:N}:{}},U=`${JSON.stringify(C)}
1526
+ `;p.unshift({path:l,bytes:vt(U)});const F=hl(t,{title:t.meta.title,viewerRuntime:e.viewerRuntime,...s?{manifestUrl:s}:{}});return p.unshift({path:"viewer.html",bytes:vt(F)}),{html:F,manifest:C,manifestFileName:l,files:p}}function Ul(t,e){const a=t.find(n=>n.btrId===e),r=t.filter(n=>n.btrId!==e);return a?[a,...r]:[...t]}function Fl(t){return!t||t.startsWith("/")||t.includes("\\")||t.includes("\0")?!1:t.split("/").every(e=>e.length>0&&e!=="."&&e!==".."&&/^[A-Za-z0-9._-]+$/.test(e))}function _l(t){const e={};for(const a of t.files){if(!Fl(a.path))throw new Error(`Unsafe package path: ${a.path}`);e[a.path]=a.bytes}return di(e,{level:6})}const Bl=400;function at(t={}){var e;const a=t.exportFormat==="multi"?"multi":"single";return{exportFormat:a,exportInvisibleLayers:t.exportInvisibleLayers!==!1,exportLayouts:t.exportLayouts!==!1,initialView:t.initialView??"fit",viewerMode:t.viewerMode??"measure",expiryDays:a==="multi"?"never":t.expiryDays??"never",expiresAt:a==="multi"?null:t.expiresAt??null,password:a==="multi"?"":((e=t.password)==null?void 0:e.trim())??""}}function Rl(t){const e=t.activeLayoutView,a=e.center,r=e.trCamera.zoom,n=Math.max(e.height,1),i=r*(2*Bl)/n;return{centerX:a.x,centerY:a.y,zoom:i}}const Tl="./viewer-runtime.iife.js";let Lt={};function Dl(t){Lt={...Lt,...t}}function Hl(){return{...Lt}}function jl(t){return t!=null?String(t):Lt.viewerRuntimeUrl!=null?String(Lt.viewerRuntimeUrl):Tl}const Qa="https://mlightcad.com/cad-viewer/docs/";let Ja=qa(Qa);function Vl(){return Ja}function Zl(t){Ja=qa(t)}function qa(t){const e=t.trim();return e?e.replace(/\/+$/,""):Qa.replace(/\/+$/,"")}function Yl(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function Gl(t,e,a){if(e.length<3)return;const r=a[0],n=a[1];for(let i=0;i+2<e.length;i+=3){const o=Te(e[i],r),l=Te(e[i+1],n);t.valid?(o<t.minX&&(t.minX=o),o>t.maxX&&(t.maxX=o),l<t.minY&&(t.minY=l),l>t.maxY&&(t.maxY=l)):(t.minX=t.maxX=o,t.minY=t.maxY=l,t.valid=!0)}}function ta(t,e){Gl(t,e.positions,e.offset)}function Xl(t){return t.valid?{minX:t.minX,minY:t.minY,maxX:t.maxX,maxY:t.maxY}:null}function Wl(t,e){const a=Yl();for(const r of t)ta(a,r);for(const r of e)ta(a,r);return Xl(a)}function tr(t,e){return t?e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t:e??null}function Kl(t){if(!t||t.length===0)return null;let e=null;for(const a of t)e=tr(e,a.paper);return e}function Ql(t){return tr(Wl(t.lineBatches,t.meshBatches),Kl(t.viewports))}function Jl(t,e,a){if(a)return;const r=ql(t,e);if(!(r!=null&&r.newIterator))return;const n=[];for(const i of r.newIterator()){if(!(i instanceof hr)||fr.isDefaultPaperSpaceViewport(i)||typeof i.toGiViewport!="function")continue;const o=i.toGiViewport(),l=o.box,s=o.viewBox,c=ea(l),d=ea(s);if(!c||!d)continue;const u=Number.isFinite(o.viewTwistAngle)?o.viewTwistAngle:i.viewTwistAngle;n.push(Number.isFinite(u)&&Math.abs(u)>1e-12?{paper:c,model:d,twist:u}:{paper:c,model:d})}return n.length>0?n:void 0}function ea(t){if(typeof t.isEmpty=="function"&&t.isEmpty())return;const e=t.min.x,a=t.min.y,r=t.max.x,n=t.max.y;if(!(!Number.isFinite(e)||!Number.isFinite(a)||!Number.isFinite(r)||!Number.isFinite(n)||r-e<=0||n-a<=0))return{minX:e,minY:a,maxX:r,maxY:n}}function ql(t,e){var a;const r=(a=t.tables)==null?void 0:a.blockTable;if(!r)return;const n=typeof r.getIdAt=="function"?r.getIdAt(e):void 0;if(n)return n;if(typeof r.newIterator=="function"){for(const o of r.newIterator())if(o.objectId===e)return o}const i=r.modelSpace;if((i==null?void 0:i.objectId)===e)return i}class ts{build(e,a,r={}){return this.buildSync(e,a,r)}async buildAsync(e,a,r={}){await Y();const n=r.exportInvisibleLayers!==!1,i=r.exportLayouts!==!1,o=n?void 0:p=>Mt(e,p,n),l=Ze(a,{title:r.title,background:r.background}),s=[];e.layers.forEach(p=>{Mt(e,p.name,n)&&s.push({name:p.name,color:p.color.RGB??16777215,visible:!p.isOff&&!p.isFrozen})});const c=ra(a),d=new Map(c.map(p=>[p.blockTableRecordId,p.name])),u=ia(e,i),m=[];for(const p of na(e,c,i))m.push(oa(e,a,p,d,r,o)),await Y();return{version:tt,meta:aa(l,r,m,u),layers:s,layouts:m,activeLayoutBtrId:u}}buildSync(e,a,r){const n=r.exportInvisibleLayers!==!1,i=r.exportLayouts!==!1,o=n?void 0:p=>Mt(e,p,n),l=Ze(a,{title:r.title,background:r.background}),s=[];e.layers.forEach(p=>{Mt(e,p.name,n)&&s.push({name:p.name,color:p.color.RGB??16777215,visible:!p.isOff&&!p.isFrozen})});const c=ra(a),d=new Map(c.map(p=>[p.blockTableRecordId,p.name])),u=ia(e,i),m=[];for(const p of na(e,c,i))m.push(oa(e,a,p,d,r,o));return{version:tt,meta:aa(l,r,m,u),layers:s,layouts:m,activeLayoutBtrId:u}}}function aa(t,e,a,r){const n=a.find(l=>l.btrId===r)??a[0],i=n?Ql(n):null,o=e.initialView??"fit";return{title:t.title,createdAt:new Date().toISOString(),extents:t.extents,viewExtents:i??void 0,units:t.units,grip:t.grip,background:t.background,locale:e.locale??L.currentLocale,initialView:o,viewState:o==="current"?e.viewState:void 0,viewerMode:e.viewerMode??"measure",exportLayouts:e.exportLayouts!==!1,docsBaseUrl:es()}}function es(){try{Zl(gr())}catch{}return Vl()}function as(t){return(t.viewerMode??"measure")==="measure"}function Mt(t,e,a){if(a)return!0;const r=t.layers.get(e);return r?!r.isOff&&!r.isFrozen:!0}function ra(t){var e;const a=(e=t.objects)==null?void 0:e.layout;if(!(a!=null&&a.newIterator))return[];const r=[];for(const n of a.newIterator()){const i=n.blockTableRecordId;i&&r.push({name:n.layoutName||i,tabOrder:n.tabOrder??0,blockTableRecordId:i})}return r.sort((n,i)=>n.tabOrder-i.tabOrder),r}function na(t,e,a){if(!a)return t.modelSpaceBtrId?[t.modelSpaceBtrId]:[];const r=new Set,n=[];for(const i of e)r.has(i.blockTableRecordId)||(r.add(i.blockTableRecordId),n.push(i.blockTableRecordId));for(const i of t.layouts.keys())r.has(i)||(r.add(i),n.push(i));return n}function ia(t,e){return e&&t.activeLayoutBtrId||t.modelSpaceBtrId}function oa(t,e,a,r,n,i){const o=[],l=[],s=t.layouts.get(a);if(s)for(const[,d]of s.layers){if(i&&!i(d.name))continue;const u=Gi(d.internalObject);o.push(...u.lineBatches),l.push(...u.meshBatches)}const c=a===t.modelSpaceBtrId;return{btrId:a,name:r.get(a)??rs(e,a),isModelSpace:c,lineBatches:o,meshBatches:l,osnap:as(n)?Co(e,a,{includeLayer:i}):void 0,viewports:Jl(e,a,c)}}function rs(t,e){var a;const r=(a=t.tables)==null?void 0:a.blockTable;if(r!=null&&r.newIterator){for(const n of r.newIterator())if(n.objectId===e)return n.name}return e}class ns{constructor(e={}){this.options=e,this._snapshotBuilder=new ts}async prepareAcTrView2dForHtmlExport(e,a={}){if(!e||!("cadScene"in e)||!e.cadScene)throw new Error("CAD scene is not available. Open a drawing before exporting to HTML.");if(!(e instanceof nr))throw new Error("HTML export requires a 2D CAD view. Open a drawing before exporting.");const r=at(a),n={includeInvisibleLayers:r.exportInvisibleLayers,includeLayouts:r.exportLayouts};return await e.ensureEntitiesConvertedForExport(n),await Y(),e}async convert(e,a={},r){const n=st.instance,i=at(a);await n.withBusyIndicator(async()=>{await Y();const o=n.curDocument,l=await this.prepareAcTrView2dForHtmlExport(r??n.curView,i),s=e||o.fileName||o.docTitle,c=ir(s),d=await this._snapshotBuilder.buildAsync(l.cadScene,o.database,{title:c,background:l.backgroundColor,exportInvisibleLayers:i.exportInvisibleLayers,exportLayouts:i.exportLayouts,initialView:i.initialView,viewerMode:i.viewerMode,viewState:i.initialView==="current"&&(i.exportLayouts||l.activeLayoutBtrId===l.modelSpaceBtrId)?Rl(l):void 0});await Y();const u=await this.loadViewerRuntime();if(await Y(),i.exportFormat==="multi"){const b=Nl(d,{viewerRuntime:u}),y=_l(b);await Y(),this.downloadBytes(y,xe(s,"zip"),"application/zip");return}const m=xl(i.expiryDays,Date.now(),i.expiresAt),p=await Je(Kt(d),{expiresAt:m,password:i.password||void 0}),v=Ke(d,{title:d.meta.title,viewerRuntime:u,encoded:p.encoded,accessManifest:p.manifest});await Y(),this.downloadHtml(v,xe(s,"html"))})}async packSnapshot(e,a){await st.instance.withBusyIndicator(async()=>{await Y();const r=await this.loadViewerRuntime();await Y();const n=await Je(Kt(e),{expiresAt:null}),i=Ke(e,{title:e.meta.title,viewerRuntime:r,encoded:n.encoded,accessManifest:n.manifest});await Y(),this.downloadHtml(i,a)})}async loadViewerRuntime(){const e=jl(this.options.viewerRuntimeUrl),a=await fetch(e);if(!a.ok)throw new Error(`Failed to load HTML viewer runtime from "${e}" (${a.status}). Install @mlightcad/cad-html-plugin, copy viewer-runtime.iife.js to your app assets, and set viewerRuntimeUrl on registerLazyHtmlPlugin / createHtmlPlugin / AcApHtmlConvertor.`);return a.text()}downloadHtml(e,a){this.downloadBytes(new TextEncoder().encode(e),a,"text/html;charset=utf-8")}downloadBytes(e,a,r){const n=new Uint8Array(e.byteLength);n.set(e);const i=new Blob([n],{type:r}),o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=a,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.setTimeout(()=>URL.revokeObjectURL(o),6e4)}}class is extends rr{constructor(e={}){super(),this.pluginOptions=e}async execute(e){const a=await this.promptOptions();a&&await new ns(this.pluginOptions).convert(e.doc.fileName||e.doc.docTitle,a,e.view)}async promptOptions(){const e=at(),a=await this.promptExportFormat();if(a===void 0)return;const r=await this.promptYesNo("jig.chtml.exportInvisibleLayers",e.exportInvisibleLayers);if(r===void 0)return;const n=await this.promptYesNo("jig.chtml.exportLayouts",e.exportLayouts);if(n===void 0)return;const i=await this.promptInitialView();if(i===void 0)return;const o=await this.promptViewerMode();if(o!==void 0)return at({exportFormat:a,exportInvisibleLayers:r,exportLayouts:n,initialView:i,viewerMode:o})}async promptExportFormat(){const e=at(),a=new At(L.t("jig.chtml.exportFormat"));a.allowNone=!0;const r=a.keywords.add(L.t("jig.chtml.keywords.single.display"),L.t("jig.chtml.keywords.single.global"),L.t("jig.chtml.keywords.single.local")),n=a.keywords.add(L.t("jig.chtml.keywords.multi.display"),L.t("jig.chtml.keywords.multi.global"),L.t("jig.chtml.keywords.multi.local"));a.keywords.default=e.exportFormat==="multi"?n:r;const i=await st.instance.editor.getKeywords(a);if(i.status!==T.Cancel){if(i.status===T.None)return e.exportFormat;if(i.status===T.OK||i.status===T.Keyword)return i.stringResult?i.stringResult==="Multi"?"multi":"single":e.exportFormat}}async promptYesNo(e,a){const r=new At(L.t(e));r.allowNone=!0;const n=r.keywords.add(L.t("jig.chtml.keywords.yes.display"),L.t("jig.chtml.keywords.yes.global"),L.t("jig.chtml.keywords.yes.local")),i=r.keywords.add(L.t("jig.chtml.keywords.no.display"),L.t("jig.chtml.keywords.no.global"),L.t("jig.chtml.keywords.no.local"));r.keywords.default=a?n:i;const o=await st.instance.editor.getKeywords(r);if(o.status!==T.Cancel){if(o.status===T.None)return a;if(o.status===T.OK||o.status===T.Keyword)return o.stringResult?o.stringResult==="Yes":a}}async promptInitialView(){const e=at(),a=new At(L.t("jig.chtml.initialView"));a.allowNone=!0;const r=a.keywords.add(L.t("jig.chtml.keywords.extents.display"),L.t("jig.chtml.keywords.extents.global"),L.t("jig.chtml.keywords.extents.local")),n=a.keywords.add(L.t("jig.chtml.keywords.current.display"),L.t("jig.chtml.keywords.current.global"),L.t("jig.chtml.keywords.current.local"));a.keywords.default=e.initialView==="current"?n:r;const i=await st.instance.editor.getKeywords(a);if(i.status!==T.Cancel){if(i.status===T.None)return e.initialView;if(i.status===T.OK||i.status===T.Keyword)return i.stringResult?i.stringResult==="Current"?"current":"fit":e.initialView}}async promptViewerMode(){const e=at(),a=new At(L.t("jig.chtml.viewerMode"));a.allowNone=!0;const r=a.keywords.add(L.t("jig.chtml.keywords.view.display"),L.t("jig.chtml.keywords.view.global"),L.t("jig.chtml.keywords.view.local")),n=a.keywords.add(L.t("jig.chtml.keywords.measure.display"),L.t("jig.chtml.keywords.measure.global"),L.t("jig.chtml.keywords.measure.local"));a.keywords.default=e.viewerMode==="view"?r:n;const i=await st.instance.editor.getKeywords(a);if(i.status!==T.Cancel){if(i.status===T.None)return e.viewerMode;if(i.status===T.OK||i.status===T.Keyword)return i.stringResult?i.stringResult==="View"?"view":"measure":e.viewerMode}}}const os="1.7.0",ls={version:os};class ss{constructor(e={}){this.options=e,this.name="HtmlPlugin",this.version=ls.version,this.description="HTML export (-chtml) command",this.registeredCommands=[]}onLoad(e,a){const r=ar.SYSTEMT_COMMAND_GROUP_NAME,n=new is(this.options);a.addCommand(r,"-chtml","-chtml",n),this.registeredCommands.push({group:r,name:"-chtml"}),a.lookupGlobalCmd("chtml")||(a.addCommand(r,"chtml","chtml",n),this.registeredCommands.push({group:r,name:"chtml"}))}onUnload(e,a){for(const r of this.registeredCommands)a.removeCmd(r.group,r.name);this.registeredCommands=[]}}async function ds(t={}){return t.viewerRuntimeUrl!=null&&Dl(t),new ss(Hl())}export{So as ACEC_CHUNK_MAGIC,$o as ACEO_OSNAP_MAGIC,Eo as ACEO_OSNAP_VERSION,Go as ACEX_DEFAULT_CHUNK_MAX_BYTES,Ba as ACEX_DEFAULT_MANIFEST_FILE,Wo as ACEX_DEFAULT_MANIFEST_HREF,Xo as ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES,Ut as ACEX_MAX_GEOMETRY_BATCH_BYTES,Yo as ACEX_PACKAGE_VERSION,ui as ACEX_SNAPSHOT_COMPRESSION,tt as ACEX_SNAPSHOT_VERSION,is as AcApExportHtmlCmd,ns as AcApHtmlConvertor,ts as AcApHtmlSnapshotBuilder,Tl as DEFAULT_HTML_VIEWER_RUNTIME_URL,ps as HTML_PLUGIN_NAME,hs as HTML_PLUGIN_TRIGGERS,Qe as buildAcExHtmlAccessManifest,Nl as buildAcExPackage,Co as buildOsnapCatalog,Ze as buildViewerMetadata,Rl as captureAcApHtmlViewState,Gi as collectBatchesFromObject3D,le as compressSnapshotBinary,Dl as configureHtmlPlugin,ds as createHtmlPlugin,Po as encodeChunkBinary,Oo as encodeChunkGzip,jo as encodeOsnapCatalogBinary,Vo as encodeOsnapCatalogGzip,Kt as encodeSnapshot,fi as encodeSnapshotBinary,vl as encryptAcExHtmlSnapshotPayload,Do as estimateOsnapPrimitiveBytes,Bi as exportActiveBatchedLine2Slice,de as exportActiveBatchedSlice,De as exportBufferGeometrySlice,Hl as getHtmlPluginOptions,ra as listDatabaseLayouts,Va as needsAcExHtmlAccessControl,Ke as packHtml,hl as packHtmlPackage,Je as protectAcExHtmlEncodedSnapshot,xl as resolveAcApHtmlExpiresAt,at as resolveAcApHtmlExportOptions,_a as resolveAcExHtmlLocale,jl as resolveViewerRuntimeUrl,wi as snapshotMimeType,El as splitLayoutIntoSlices,Ho as splitOsnapPrimitives,_l as zipAcExPackageFiles};