octiqflow-linux-x64 0.3.33 → 0.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/octiq-server +0 -0
- package/bin/v2/assets/{DiskPage-BHQ6vXWD.js → DiskPage-C724cmgZ.js} +1 -1
- package/bin/v2/assets/DiskPage-C724cmgZ.js.br +0 -0
- package/bin/v2/assets/DiskPage-C724cmgZ.js.gz +0 -0
- package/bin/v2/assets/{IslandPage-Qq4QwLeF.js → IslandPage-A4BNgIc2.js} +1 -1
- package/bin/v2/assets/IslandPage-A4BNgIc2.js.br +0 -0
- package/bin/v2/assets/IslandPage-A4BNgIc2.js.gz +0 -0
- package/bin/v2/assets/{index-DkCVJgWk.js → index-BNlnNuDG.js} +1 -1
- package/bin/v2/assets/index-BNlnNuDG.js.br +0 -0
- package/bin/v2/assets/index-BNlnNuDG.js.gz +0 -0
- package/bin/v2/assets/{index-Co3uxkEw.js → index-BSShmPXt.js} +1 -1
- package/bin/v2/assets/index-BSShmPXt.js.br +0 -0
- package/bin/v2/assets/index-BSShmPXt.js.gz +0 -0
- package/bin/v2/assets/{index-DgipX4Jo.js → index-BYmYfYRH.js} +1 -1
- package/bin/v2/assets/index-BYmYfYRH.js.br +0 -0
- package/bin/v2/assets/index-BYmYfYRH.js.gz +0 -0
- package/bin/v2/assets/{index-Dcyibowf.js → index-BgCzzAAi.js} +1 -1
- package/bin/v2/assets/index-BgCzzAAi.js.br +0 -0
- package/bin/v2/assets/index-BgCzzAAi.js.gz +0 -0
- package/bin/v2/assets/{index-Brzuk1-3.js → index-C-v7LutO.js} +1 -1
- package/bin/v2/assets/index-C-v7LutO.js.br +0 -0
- package/bin/v2/assets/index-C-v7LutO.js.gz +0 -0
- package/bin/v2/assets/{index-BtMUb1SW.js → index-C9hIYW7b.js} +1 -1
- package/bin/v2/assets/index-C9hIYW7b.js.br +0 -0
- package/bin/v2/assets/index-C9hIYW7b.js.gz +0 -0
- package/bin/v2/assets/index-CgiY3Jcy.css +1 -0
- package/bin/v2/assets/index-CgiY3Jcy.css.br +0 -0
- package/bin/v2/assets/index-CgiY3Jcy.css.gz +0 -0
- package/bin/v2/assets/{index-cShCsMR4.js → index-ChzikLML.js} +1 -1
- package/bin/v2/assets/index-ChzikLML.js.br +0 -0
- package/bin/v2/assets/index-ChzikLML.js.gz +0 -0
- package/bin/v2/assets/{index-BEWqNsHw.js → index-CyDXZsab.js} +1 -1
- package/bin/v2/assets/index-CyDXZsab.js.br +0 -0
- package/bin/v2/assets/index-CyDXZsab.js.gz +0 -0
- package/bin/v2/assets/{index-B3M2dqjT.js → index-D6_PH-_4.js} +1 -1
- package/bin/v2/assets/index-D6_PH-_4.js.br +0 -0
- package/bin/v2/assets/index-D6_PH-_4.js.gz +0 -0
- package/bin/v2/assets/{index-v7xV5kGw.js → index-KlpztsHG.js} +1 -1
- package/bin/v2/assets/index-KlpztsHG.js.br +0 -0
- package/bin/v2/assets/index-KlpztsHG.js.gz +0 -0
- package/bin/v2/assets/{index-s-iKxzP8.js → index-R8QroxO7.js} +1 -1
- package/bin/v2/assets/index-R8QroxO7.js.br +0 -0
- package/bin/v2/assets/index-R8QroxO7.js.gz +0 -0
- package/bin/v2/assets/{index-CzmdQnci.js → index-SFoAoPT0.js} +158 -158
- package/bin/v2/assets/index-SFoAoPT0.js.br +0 -0
- package/bin/v2/assets/index-SFoAoPT0.js.gz +0 -0
- package/bin/v2/assets/{portrait-DEXFdiVX.js → portrait-CXrd-LMr.js} +1 -1
- package/bin/v2/assets/portrait-CXrd-LMr.js.br +0 -0
- package/bin/v2/assets/portrait-CXrd-LMr.js.gz +0 -0
- package/bin/v2/index.html +2 -2
- package/package.json +1 -1
- package/bin/v2/assets/DiskPage-BHQ6vXWD.js.br +0 -0
- package/bin/v2/assets/DiskPage-BHQ6vXWD.js.gz +0 -0
- package/bin/v2/assets/IslandPage-Qq4QwLeF.js.br +0 -0
- package/bin/v2/assets/IslandPage-Qq4QwLeF.js.gz +0 -0
- package/bin/v2/assets/index-B3M2dqjT.js.br +0 -0
- package/bin/v2/assets/index-B3M2dqjT.js.gz +0 -0
- package/bin/v2/assets/index-BEWqNsHw.js.br +0 -0
- package/bin/v2/assets/index-BEWqNsHw.js.gz +0 -0
- package/bin/v2/assets/index-Brzuk1-3.js.br +0 -0
- package/bin/v2/assets/index-Brzuk1-3.js.gz +0 -0
- package/bin/v2/assets/index-BtMUb1SW.js.br +0 -0
- package/bin/v2/assets/index-BtMUb1SW.js.gz +0 -0
- package/bin/v2/assets/index-Co3uxkEw.js.br +0 -0
- package/bin/v2/assets/index-Co3uxkEw.js.gz +0 -0
- package/bin/v2/assets/index-CzmdQnci.js.br +0 -0
- package/bin/v2/assets/index-CzmdQnci.js.gz +0 -0
- package/bin/v2/assets/index-DWMHLBXe.css +0 -1
- package/bin/v2/assets/index-DWMHLBXe.css.br +0 -0
- package/bin/v2/assets/index-DWMHLBXe.css.gz +0 -0
- package/bin/v2/assets/index-Dcyibowf.js.br +0 -0
- package/bin/v2/assets/index-Dcyibowf.js.gz +0 -0
- package/bin/v2/assets/index-DgipX4Jo.js.br +0 -0
- package/bin/v2/assets/index-DgipX4Jo.js.gz +0 -0
- package/bin/v2/assets/index-DkCVJgWk.js.br +0 -0
- package/bin/v2/assets/index-DkCVJgWk.js.gz +0 -0
- package/bin/v2/assets/index-cShCsMR4.js.br +0 -0
- package/bin/v2/assets/index-cShCsMR4.js.gz +0 -0
- package/bin/v2/assets/index-s-iKxzP8.js.br +0 -0
- package/bin/v2/assets/index-s-iKxzP8.js.gz +0 -0
- package/bin/v2/assets/index-v7xV5kGw.js.br +0 -0
- package/bin/v2/assets/index-v7xV5kGw.js.gz +0 -0
- package/bin/v2/assets/portrait-DEXFdiVX.js.br +0 -0
- package/bin/v2/assets/portrait-DEXFdiVX.js.gz +0 -0
package/bin/octiq-server
CHANGED
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as k,b as A,l as s,W as re,m as ee,F as se,n as te}from"./index-CzmdQnci.js";const U=e=>e&&typeof e=="object"?e:{},N=(e,t="")=>typeof e=="string"?e:t,z=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:0,W=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:null;function oe(e){const t=U(e);if(!N(t.scanId))return null;const u=new Set,h=(Array.isArray(t.items)?t.items:[]).flatMap(r=>{const l=U(r),x=N(l.id);if(!x||u.has(x))return[];u.add(x);const m=l.worktree?U(l.worktree):null;return[{id:x,key:N(l.key,x),group:l.group==="clean"||l.group==="review"?l.group:"work",kind:N(l.kind),label:N(l.label,N(l.kind,"Folder")),path:N(l.path),bytes:z(l.bytes),effect:N(l.effect),note:N(l.note),notRecommended:l.notRecommended===!0,action:["tool","docker","worktree","rm","rmOlderThan"].includes(N(U(l.action).type))?l.action:null,previousBytes:W(l.previousBytes),grew:l.grew===!0,worktree:m?{repo:N(m.repo),branch:N(m.branch),clean:typeof m.clean=="boolean"?m.clean:void 0,merged:typeof m.merged=="boolean"?m.merged:void 0,mainline:typeof m.mainline=="boolean"?m.mainline:void 0,inUse:typeof m.inUse=="boolean"?m.inUse:void 0,eligible:typeof m.eligible=="boolean"?m.eligible:void 0,idleDays:W(m.idleDays)??void 0,ignoredBytes:z(m.ignoredBytes)}:void 0}]});return{scanId:N(t.scanId),scannedAt:z(t.scannedAt),platform:t.platform==="macos"||t.platform==="windows"||t.platform==="linux"?t.platform:"unknown",home:N(t.home),thresholdBytes:z(t.thresholdBytes),totalBytes:W(t.totalBytes)??h.reduce((r,l)=>r+l.bytes,0),items:h,skipped:(Array.isArray(t.skipped)?t.skipped:[]).map(r=>{const l=U(r);return{path:N(l.path),reason:N(l.reason,"Unknown reason")}}),previousScanAt:W(t.previousScanAt)}}function ne(e){const t=U(e);return N(t.scanId)?{scanId:N(t.scanId),startedAt:z(t.startedAt),phase:N(t.phase,"home"),entries:z(t.entries),bytes:z(t.bytes),path:N(t.path)}:null}function ce(e){const t=U(e);return{running:ne(t.running),report:oe(t.report)}}function de(e,t){return e.filter(u=>u.group===t).sort((u,h)=>h.bytes-u.bytes)}function L(e){return e.group!=="work"&&e.action!==null}function ue(e,t){const u=new Set(e),h=t.filter(L),r=h.every(l=>e.has(l.id));return h.forEach(l=>r?u.delete(l.id):u.add(l.id)),u}function he(e,t,u){const h=e.filter(r=>L(r)&&t.has(r.id));return{ids:h.map(r=>r.id),count:h.length,bytes:h.reduce((r,l)=>r+l.bytes,0),skippedCount:h.filter(r=>!u&&(!r.action||r.action.type==="rm"||r.action.type==="rmOlderThan")).length}}function B(e){const t=z(e);return t<1e6?`${(t/1e3).toLocaleString("en-US",{maximumFractionDigits:0})} KB`:t<1e9?`${(t/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} MB`:`${(t/1e9).toLocaleString("en-US",{maximumFractionDigits:2})} GB`}function P(e){if(!e)return"an unknown date";const t=new Date(e<1e12?e*1e3:e);return Number.isNaN(t.getTime())?"an unknown date":t.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}const F={clean:"Safe to clean",review:"Review first",work:"Your work"};function q(e,t,u){if(!(t>0&&u>0&&Number.isFinite(t*u)))return[];const h=e.filter(a=>a.bytes>0&&Number.isFinite(a.bytes)),r=h.reduce((a,b)=>Math.max(a,b.bytes),0),l=h.reduce((a,b)=>a+b.bytes/r,0),x=h.map(a=>({id:a.id,area:a.bytes/r/l*t*u})),m=[];let j=0,g=0,p=t,i=u,o=0;const f=(a,b)=>{const w=a.reduce((c,d)=>c+d.area,0),n=a.map(c=>c.area);return Math.max(b*b*Math.max(...n)/(w*w),w*w/(b*b*Math.min(...n)))};for(;o<x.length;){const a=[x[o++]],b=Math.min(p,i);for(;o<x.length&&f([...a,x[o]],b)<=f(a,b);)a.push(x[o++]);const w=a.reduce((y,v)=>y+v.area,0),n=p>=i,c=w/(n?i:p);let d=0;a.forEach((y,v)=>{const R=v===a.length-1?(n?i:p)-d:y.area/c;m.push({id:y.id,x:j+(n?0:d),y:g+(n?d:0),width:n?c:R,height:n?R:c}),d+=R}),n?(j+=c,p=Math.max(0,t-j)):(g+=c,i=Math.max(0,u-g))}return m}function pe(e,t,u=.015){const h=[];for(const r of["clean","review","work"]){const l=new Map;for(const i of e){if(i.group!==r||!(i.bytes>0&&Number.isFinite(i.bytes)))continue;const o=l.get(i.kind)??[];o.push(i),l.set(i.kind,o)}const x=(i,o,f)=>({id:i,group:r,label:o,items:[...f].sort((a,b)=>b.bytes-a.bytes),bytes:f.reduce((a,b)=>a+b.bytes,0),selectedCount:f.filter(a=>L(a)&&t.has(a.id)).length}),m=[...l].map(([i,o])=>{const f=o.length===1?o[0].label:i==="git-worktree"?"Linked Git worktrees":o.every(a=>a.label===o[0].label)?o[0].label:(i.replace(/[-_]/g," ")||"Folders").replace(/^./,a=>a.toUpperCase());return x(JSON.stringify([r,i]),f,o)}),j=m.reduce((i,o)=>i+o.bytes,0),g=m.filter(i=>i.bytes/j<u),p=m.filter(i=>i.bytes/j>=u);g.length&&p.push(x(JSON.stringify([r,null]),"Other",g.flatMap(i=>[...i.items]))),h.push(...p.sort((i,o)=>o.bytes-i.bytes||i.id.localeCompare(o.id)))}return h}const K=(e,t)=>t.bytes-e.bytes||e.id.localeCompare(t.id);function T(e,t,u){return{id:u,label:t,group:e[0].group,bytes:e.reduce((h,r)=>h+r.bytes,0),selectedCount:e.reduce((h,r)=>h+r.selectedCount,0),items:e.flatMap(h=>[...h.items]).sort((h,r)=>r.bytes-h.bytes)}}function me(e,t,u,h){const r=["clean","review","work"].flatMap(g=>{const p=e.filter(i=>i.group===g);return p.length?[T(p,F[g],JSON.stringify([g]))]:[]}),l=(g,p)=>{const i=h(p);return g.width>=i.width&&g.height>=i.height},x=[],m=new Map(r.map(g=>[g.id,e.filter(p=>p.group===g.group).sort(K)]));let j=r;for(;;){const g=q(j,t,u),p=[];let i=!1;for(const o of j){const f=g.find(d=>d.id===o.id);if(!f||!l(f,o)){x.push(o),m.delete(o.id),i=!0;continue}let a=m.get(o.id);const b=q(a,f.width,f.height),w=a.filter(d=>!l(b.find(y=>y.id===d.id),d));if(!w.length){p.push({box:f,tiles:b.map(d=>({...a.find(y=>y.id===d.id),...d}))});continue}if(i=!0,a.length===1){m.set(o.id,[o]);continue}const n=JSON.stringify([o.group,null]),c=a.find(d=>d.id===n);if(c&&w.every(d=>d===c))x.push(c),a=a.filter(d=>d!==c);else{const d=a.filter(v=>v!==c).at(-1);a=a.filter(v=>v!==d&&v!==c);const y=x.findIndex(v=>v.id===n);y>=0?x[y]=T([d,x[y]],"Other",n):(a.push(T(c?[d,c]:[d],"Other",n)),a.sort(K)),a.length===1&&(a=[T(a,o.label,o.id)])}m.set(o.id,a)}if(!i)return{regions:p,summaries:x};j=j.filter(o=>m.has(o.id)).map(o=>T(m.get(o.id),o.label,o.id))}}const V=e=>String(e?.message??e);function fe(e){const[t,u]=k.useState({running:null,report:null}),[h,r]=k.useState(null),[l,x]=k.useState(!1),[m,j]=k.useState(!0),g=k.useRef(0),p=k.useRef(!1),i=k.useRef(t),o=k.useRef(new Set),f=k.useCallback(w=>{i.current=w,u(w)},[]),a=k.useCallback(async()=>{const w=++g.current;try{const n=await A.invoke("disk_scan_state",{});if(!p.current||w!==g.current)return;const c=ce(n);c.running&&o.current.has(c.running.scanId)&&(c.running=null),f(c),r(null)}catch(n){p.current&&w===g.current&&r(V(n))}finally{p.current&&w===g.current&&j(!1)}},[f]);k.useEffect(()=>(p.current=!0,()=>{p.current=!1,++g.current}),[]),k.useEffect(()=>{if(!e){j(!1);return}const w=A.on("disk-scan-progress",c=>{const d=ne(c);!d||o.current.has(d.scanId)||i.current.running&&i.current.running.scanId!==d.scanId||(++g.current,f({...i.current,running:d}),j(!1))}),n=A.on("disk-scan-done",c=>{c?.scanId&&(o.current.add(c.scanId),i.current.running?.scanId===c.scanId&&f({...i.current,running:null}),a().then(()=>{p.current&&c.error&&r(String(c.error))}))});return a(),()=>{w(),n(),++g.current}},[e,a,f]);const b=k.useCallback(async()=>{if(!e||l)return;x(!0),r(null);const w=i.current.running;try{await A.invoke(w?"disk_scan_cancel":"disk_scan_start",w?{scanId:w.scanId}:{}),p.current&&await a()}catch(n){p.current&&r(V(n))}finally{p.current&&x(!1)}},[e,l,a]);return{...t,error:h,pending:l,loading:m,scan:b}}function Se({connected:e,onClose:t}){const u=fe(e);return s.jsx(ke,{...u,connected:e,onScan:()=>{u.scan()},onClose:t})}const ge=[],Q=new Set;function ke({report:e,running:t=null,error:u,pending:h=!1,loading:r=!1,connected:l=!0,onScan:x,onClose:m}){const[j,g]=k.useState({scanId:"",ids:Q}),[p,i]=k.useState(null),o=!!e&&p===e.scanId,[f,a]=k.useState(null),[b,w]=k.useState(null),[n,c]=k.useState(!1),d=k.useRef(e?.scanId);d.current=e?.scanId;const y=k.useRef(!0);k.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),k.useEffect(()=>{a(null),w(null)},[e?.scanId]);const v=k.useRef(new Map),R=e?.items??ge,M=j.scanId===e?.scanId?j.ids:Q,D=he(R,M,o),G=S=>{e&&g({scanId:e.scanId,ids:S})},[Y,J]=k.useState(null),O=Y?.scanId===e?.scanId?Y:null,ae=S=>{J({scanId:e.scanId,ids:new Set(S.items.map(E=>E.id)),label:S.label});const I=v.current.get(S.items[0].id);I?.scrollIntoView({block:"center",behavior:"instant"}),I?.focus({preventScroll:!0})},_=l?t?"Wait for the scan to finish before downloading a script.":D.count?null:"Select at least one item to download a script.":"Connect to the host to download a script.",le=async()=>{if(!e||_||n)return;const S=e.scanId;c(!0),w(null);try{const I=await A.invoke("disk_cleanup_script",{scanId:S,itemIds:D.ids,allowRm:o});if(!y.current||d.current!==S)return;if(typeof I?.script!="string"||typeof I?.fileName!="string"||!I.fileName)throw new Error("The host did not return a cleanup script.");const E=I.fileName.split(/[\\/]/).pop()||(e.platform==="windows"?"disk-cleanup.ps1":"disk-cleanup.sh"),$=URL.createObjectURL(new Blob([I.script],{type:"text/plain;charset=utf-8"})),C=document.createElement("a");C.href=$,C.download=E,document.body.append(C),C.click(),C.remove(),window.setTimeout(()=>URL.revokeObjectURL($),1e3),a({scanId:S,fileName:E})}catch(I){y.current&&d.current===S&&w(String(I?.message??I))}finally{y.current&&c(!1)}},H=f?.scanId===e?.scanId?f?.fileName:e?.platform==="windows"?"disk-cleanup.ps1":"disk-cleanup.sh";return s.jsxs("section",{className:"disk-page","aria-label":"Disk report",children:[s.jsx(re,{root:!0,title:s.jsx("h1",{children:"Disk"}),back:{label:"Chat",onClick:m},actions:s.jsx("button",{className:`disk-button${t?" is-scanning":""}`,type:"button",disabled:!l||h||r,onClick:x,children:h?t?"Cancelling…":"Starting…":t?"Cancel scan":"Scan"})}),s.jsxs("div",{className:"disk-body",children:[s.jsxs("div",{className:"disk-intro",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Development leftovers"}),s.jsx("p",{children:"Manual scans of your home folder and system temp. Metadata, Git and open-file checks only."})]}),e&&s.jsxs("div",{className:"disk-total",children:[s.jsx("strong",{children:B(e.totalBytes)}),s.jsxs("span",{children:[e.platform==="macos"?"macOS":e.platform==="windows"?"Windows":e.platform==="linux"?"Linux":"Unknown platform"," · Last scanned ",P(e.scannedAt)]})]})]}),s.jsx("p",{className:"disk-promise",children:"OctiqFlow never deletes anything. You choose items, download a cleanup script and run it yourself."}),!l&&s.jsx("p",{className:"disk-message",role:"status",children:"Connect to the host to scan."}),u&&s.jsx("p",{className:"disk-error",role:"alert",children:u}),t&&s.jsxs("div",{className:"disk-progress",role:"status",children:[s.jsx("span",{className:"disk-progress-mark","aria-hidden":"true"}),s.jsxs("span",{children:["Scanning ",be(t.phase)," · ",t.entries.toLocaleString("en-US")," entries · ",B(t.bytes)," counted"]})]}),r&&!e&&s.jsx("p",{className:"disk-message",children:"Reading the last report…"}),!e&&!r&&s.jsxs("div",{className:"disk-empty",children:[s.jsx("h2",{children:"No scan yet"}),s.jsx("p",{children:"Scan when you want to review large development leftovers. Nothing is selected automatically."})]}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"disk-threshold",children:["Items ≥ ",B(e.thresholdBytes)," · Size history: ",s.jsx("code",{children:"~/disk-report/sizes.csv"}),e.previousScanAt?` · Compared with ${P(e.previousScanAt)}`:" · First recorded scan"]}),s.jsxs("div",{className:"disk-layout",children:[s.jsxs("div",{className:"disk-map-column",children:[s.jsx(xe,{items:R,selected:M,onFocus:ae}),s.jsx("p",{className:"disk-map-help",children:"Area represents size. Choose a cleanup tile to highlight its rows. Your work is labelled only."})]}),s.jsxs("div",{className:"disk-list-column",children:[O&&s.jsxs("div",{className:"disk-found",role:"status",children:[O.label," · ",O.ids.size," ",O.ids.size===1?"row":"rows"," highlighted ",s.jsx("button",{type:"button",onClick:()=>J(null),children:"Clear highlight"})]}),["clean","review"].map(S=>{const I=de(R,S),E=I.filter(L);return s.jsxs("section",{className:`disk-section disk-${S}`,"aria-label":F[S],children:[s.jsxs("div",{className:"disk-section-heading",children:[s.jsxs("h2",{children:[F[S]," ",s.jsx("span",{children:I.length})]}),s.jsxs("label",{className:"disk-tick-all",children:[s.jsx("input",{type:"checkbox",checked:E.length>0&&E.every($=>M.has($.id)),disabled:!E.length,onChange:()=>G(ue(M,I))}),"Select all",s.jsxs("span",{className:"sr-only",children:[" ",F[S]]})]})]}),!I.length&&s.jsx("p",{className:"disk-message",children:"No items in this section."}),I.map($=>s.jsx(ye,{item:$,highlighted:O?.ids.has($.id),previousScanAt:e.previousScanAt,checked:M.has($.id),onTick:()=>{if(!L($))return;const C=new Set(M);C.has($.id)?C.delete($.id):C.add($.id),G(C)},rowRef:C=>{C?v.current.set($.id,C):v.current.delete($.id)}},`${e.scanId}:${$.id}`))]},S)}),s.jsx(ve,{report:e}),s.jsxs("section",{className:"disk-controls","aria-label":"Cleanup script",children:[s.jsxs("label",{className:"disk-rm-switch",children:[s.jsx("input",{type:"checkbox",role:"switch",checked:o,onChange:S=>i(S.target.checked?e.scanId:null)}),s.jsx("span",{children:"Use rm -rf for items with no tool command"})]}),s.jsx("p",{children:o?e.platform==="windows"?"The script can use PowerShell Remove-Item for these items.":"The script can use rm -rf for these items.":"Items with no tool command are printed as Skipped."}),s.jsxs("div",{className:"disk-download-row",children:[s.jsxs("strong",{children:[D.count," selected · ",B(D.bytes)]}),s.jsx("button",{className:"disk-button",type:"button",disabled:!!_||n,"aria-describedby":"disk-download-reason",onClick:()=>{le()},children:n?"Preparing script…":"Download cleanup script"})]}),D.skippedCount>0&&s.jsxs("p",{children:[D.skippedCount," selected ",D.skippedCount===1?"item will":"items will"," be printed as Skipped."]}),s.jsx("p",{id:"disk-download-reason",children:_??"Review the script before running it."}),b&&s.jsx("p",{className:"disk-error",role:"alert",children:b}),s.jsxs("p",{className:"disk-run-example",children:["Run it in your terminal, for example: ",s.jsx("code",{children:e.platform==="windows"?`powershell -File "$HOME\\Downloads\\${H}"`:`bash ~/Downloads/${H}`})]})]})]})]})]})]})]})}function be(e){return{home:"home folder",temp:"system temp",git:"Git worktrees",history:"size history"}[e]??e}function X(e,t,u){return{left:`${e.x/t*100}%`,top:`${e.y/u*100}%`,width:`${e.width/t*100}%`,height:`${e.height/u*100}%`}}function xe({items:e,selected:t,onFocus:u}){const h=k.useRef(null),[r,l]=k.useState(0),[x,m]=k.useState(null),[j,g]=we();k.useLayoutEffect(()=>{const n=h.current;if(!n)return;l(n.getBoundingClientRect().width);const c=new ResizeObserver(d=>{const y=d[0]?.contentRect.width;y>0&&l(y)});return c.observe(n),()=>c.disconnect()},[]);const p=Math.max(340,Math.min(520,r*1.1)),i=k.useMemo(()=>pe(e,t),[e,t]),o=k.useMemo(()=>["clean","review","work"].map(n=>({id:n,bytes:i.filter(c=>c.group===n).reduce((c,d)=>c+d.bytes,0)})),[i]),f=k.useMemo(()=>j?me(i,r,p,j):{regions:[],summaries:i},[i,r,p,j]),a=[...f.regions.flatMap(n=>n.tiles),...f.summaries],b=a.find(n=>n.id===x),w=(n,c)=>{const d=Z(n),y=!c,v=y?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"disk-tile-label",children:[n.label,n.label==="Other"?` in ${F[n.group]}`:""," · ",n.items.length," ",n.items.length===1?"item":"items"]}),s.jsx("span",{className:"disk-tile-size",children:ie(n)})]}):s.jsx(je,{entry:n}),R=`${d}
|
|
1
|
+
import{r as k,b as A,l as s,W as re,m as ee,F as se,n as te}from"./index-SFoAoPT0.js";const U=e=>e&&typeof e=="object"?e:{},N=(e,t="")=>typeof e=="string"?e:t,z=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:0,W=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:null;function oe(e){const t=U(e);if(!N(t.scanId))return null;const u=new Set,h=(Array.isArray(t.items)?t.items:[]).flatMap(r=>{const l=U(r),x=N(l.id);if(!x||u.has(x))return[];u.add(x);const m=l.worktree?U(l.worktree):null;return[{id:x,key:N(l.key,x),group:l.group==="clean"||l.group==="review"?l.group:"work",kind:N(l.kind),label:N(l.label,N(l.kind,"Folder")),path:N(l.path),bytes:z(l.bytes),effect:N(l.effect),note:N(l.note),notRecommended:l.notRecommended===!0,action:["tool","docker","worktree","rm","rmOlderThan"].includes(N(U(l.action).type))?l.action:null,previousBytes:W(l.previousBytes),grew:l.grew===!0,worktree:m?{repo:N(m.repo),branch:N(m.branch),clean:typeof m.clean=="boolean"?m.clean:void 0,merged:typeof m.merged=="boolean"?m.merged:void 0,mainline:typeof m.mainline=="boolean"?m.mainline:void 0,inUse:typeof m.inUse=="boolean"?m.inUse:void 0,eligible:typeof m.eligible=="boolean"?m.eligible:void 0,idleDays:W(m.idleDays)??void 0,ignoredBytes:z(m.ignoredBytes)}:void 0}]});return{scanId:N(t.scanId),scannedAt:z(t.scannedAt),platform:t.platform==="macos"||t.platform==="windows"||t.platform==="linux"?t.platform:"unknown",home:N(t.home),thresholdBytes:z(t.thresholdBytes),totalBytes:W(t.totalBytes)??h.reduce((r,l)=>r+l.bytes,0),items:h,skipped:(Array.isArray(t.skipped)?t.skipped:[]).map(r=>{const l=U(r);return{path:N(l.path),reason:N(l.reason,"Unknown reason")}}),previousScanAt:W(t.previousScanAt)}}function ne(e){const t=U(e);return N(t.scanId)?{scanId:N(t.scanId),startedAt:z(t.startedAt),phase:N(t.phase,"home"),entries:z(t.entries),bytes:z(t.bytes),path:N(t.path)}:null}function ce(e){const t=U(e);return{running:ne(t.running),report:oe(t.report)}}function de(e,t){return e.filter(u=>u.group===t).sort((u,h)=>h.bytes-u.bytes)}function L(e){return e.group!=="work"&&e.action!==null}function ue(e,t){const u=new Set(e),h=t.filter(L),r=h.every(l=>e.has(l.id));return h.forEach(l=>r?u.delete(l.id):u.add(l.id)),u}function he(e,t,u){const h=e.filter(r=>L(r)&&t.has(r.id));return{ids:h.map(r=>r.id),count:h.length,bytes:h.reduce((r,l)=>r+l.bytes,0),skippedCount:h.filter(r=>!u&&(!r.action||r.action.type==="rm"||r.action.type==="rmOlderThan")).length}}function B(e){const t=z(e);return t<1e6?`${(t/1e3).toLocaleString("en-US",{maximumFractionDigits:0})} KB`:t<1e9?`${(t/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} MB`:`${(t/1e9).toLocaleString("en-US",{maximumFractionDigits:2})} GB`}function P(e){if(!e)return"an unknown date";const t=new Date(e<1e12?e*1e3:e);return Number.isNaN(t.getTime())?"an unknown date":t.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}const F={clean:"Safe to clean",review:"Review first",work:"Your work"};function q(e,t,u){if(!(t>0&&u>0&&Number.isFinite(t*u)))return[];const h=e.filter(a=>a.bytes>0&&Number.isFinite(a.bytes)),r=h.reduce((a,b)=>Math.max(a,b.bytes),0),l=h.reduce((a,b)=>a+b.bytes/r,0),x=h.map(a=>({id:a.id,area:a.bytes/r/l*t*u})),m=[];let j=0,g=0,p=t,i=u,o=0;const f=(a,b)=>{const w=a.reduce((c,d)=>c+d.area,0),n=a.map(c=>c.area);return Math.max(b*b*Math.max(...n)/(w*w),w*w/(b*b*Math.min(...n)))};for(;o<x.length;){const a=[x[o++]],b=Math.min(p,i);for(;o<x.length&&f([...a,x[o]],b)<=f(a,b);)a.push(x[o++]);const w=a.reduce((y,v)=>y+v.area,0),n=p>=i,c=w/(n?i:p);let d=0;a.forEach((y,v)=>{const R=v===a.length-1?(n?i:p)-d:y.area/c;m.push({id:y.id,x:j+(n?0:d),y:g+(n?d:0),width:n?c:R,height:n?R:c}),d+=R}),n?(j+=c,p=Math.max(0,t-j)):(g+=c,i=Math.max(0,u-g))}return m}function pe(e,t,u=.015){const h=[];for(const r of["clean","review","work"]){const l=new Map;for(const i of e){if(i.group!==r||!(i.bytes>0&&Number.isFinite(i.bytes)))continue;const o=l.get(i.kind)??[];o.push(i),l.set(i.kind,o)}const x=(i,o,f)=>({id:i,group:r,label:o,items:[...f].sort((a,b)=>b.bytes-a.bytes),bytes:f.reduce((a,b)=>a+b.bytes,0),selectedCount:f.filter(a=>L(a)&&t.has(a.id)).length}),m=[...l].map(([i,o])=>{const f=o.length===1?o[0].label:i==="git-worktree"?"Linked Git worktrees":o.every(a=>a.label===o[0].label)?o[0].label:(i.replace(/[-_]/g," ")||"Folders").replace(/^./,a=>a.toUpperCase());return x(JSON.stringify([r,i]),f,o)}),j=m.reduce((i,o)=>i+o.bytes,0),g=m.filter(i=>i.bytes/j<u),p=m.filter(i=>i.bytes/j>=u);g.length&&p.push(x(JSON.stringify([r,null]),"Other",g.flatMap(i=>[...i.items]))),h.push(...p.sort((i,o)=>o.bytes-i.bytes||i.id.localeCompare(o.id)))}return h}const K=(e,t)=>t.bytes-e.bytes||e.id.localeCompare(t.id);function T(e,t,u){return{id:u,label:t,group:e[0].group,bytes:e.reduce((h,r)=>h+r.bytes,0),selectedCount:e.reduce((h,r)=>h+r.selectedCount,0),items:e.flatMap(h=>[...h.items]).sort((h,r)=>r.bytes-h.bytes)}}function me(e,t,u,h){const r=["clean","review","work"].flatMap(g=>{const p=e.filter(i=>i.group===g);return p.length?[T(p,F[g],JSON.stringify([g]))]:[]}),l=(g,p)=>{const i=h(p);return g.width>=i.width&&g.height>=i.height},x=[],m=new Map(r.map(g=>[g.id,e.filter(p=>p.group===g.group).sort(K)]));let j=r;for(;;){const g=q(j,t,u),p=[];let i=!1;for(const o of j){const f=g.find(d=>d.id===o.id);if(!f||!l(f,o)){x.push(o),m.delete(o.id),i=!0;continue}let a=m.get(o.id);const b=q(a,f.width,f.height),w=a.filter(d=>!l(b.find(y=>y.id===d.id),d));if(!w.length){p.push({box:f,tiles:b.map(d=>({...a.find(y=>y.id===d.id),...d}))});continue}if(i=!0,a.length===1){m.set(o.id,[o]);continue}const n=JSON.stringify([o.group,null]),c=a.find(d=>d.id===n);if(c&&w.every(d=>d===c))x.push(c),a=a.filter(d=>d!==c);else{const d=a.filter(v=>v!==c).at(-1);a=a.filter(v=>v!==d&&v!==c);const y=x.findIndex(v=>v.id===n);y>=0?x[y]=T([d,x[y]],"Other",n):(a.push(T(c?[d,c]:[d],"Other",n)),a.sort(K)),a.length===1&&(a=[T(a,o.label,o.id)])}m.set(o.id,a)}if(!i)return{regions:p,summaries:x};j=j.filter(o=>m.has(o.id)).map(o=>T(m.get(o.id),o.label,o.id))}}const V=e=>String(e?.message??e);function fe(e){const[t,u]=k.useState({running:null,report:null}),[h,r]=k.useState(null),[l,x]=k.useState(!1),[m,j]=k.useState(!0),g=k.useRef(0),p=k.useRef(!1),i=k.useRef(t),o=k.useRef(new Set),f=k.useCallback(w=>{i.current=w,u(w)},[]),a=k.useCallback(async()=>{const w=++g.current;try{const n=await A.invoke("disk_scan_state",{});if(!p.current||w!==g.current)return;const c=ce(n);c.running&&o.current.has(c.running.scanId)&&(c.running=null),f(c),r(null)}catch(n){p.current&&w===g.current&&r(V(n))}finally{p.current&&w===g.current&&j(!1)}},[f]);k.useEffect(()=>(p.current=!0,()=>{p.current=!1,++g.current}),[]),k.useEffect(()=>{if(!e){j(!1);return}const w=A.on("disk-scan-progress",c=>{const d=ne(c);!d||o.current.has(d.scanId)||i.current.running&&i.current.running.scanId!==d.scanId||(++g.current,f({...i.current,running:d}),j(!1))}),n=A.on("disk-scan-done",c=>{c?.scanId&&(o.current.add(c.scanId),i.current.running?.scanId===c.scanId&&f({...i.current,running:null}),a().then(()=>{p.current&&c.error&&r(String(c.error))}))});return a(),()=>{w(),n(),++g.current}},[e,a,f]);const b=k.useCallback(async()=>{if(!e||l)return;x(!0),r(null);const w=i.current.running;try{await A.invoke(w?"disk_scan_cancel":"disk_scan_start",w?{scanId:w.scanId}:{}),p.current&&await a()}catch(n){p.current&&r(V(n))}finally{p.current&&x(!1)}},[e,l,a]);return{...t,error:h,pending:l,loading:m,scan:b}}function Se({connected:e,onClose:t}){const u=fe(e);return s.jsx(ke,{...u,connected:e,onScan:()=>{u.scan()},onClose:t})}const ge=[],Q=new Set;function ke({report:e,running:t=null,error:u,pending:h=!1,loading:r=!1,connected:l=!0,onScan:x,onClose:m}){const[j,g]=k.useState({scanId:"",ids:Q}),[p,i]=k.useState(null),o=!!e&&p===e.scanId,[f,a]=k.useState(null),[b,w]=k.useState(null),[n,c]=k.useState(!1),d=k.useRef(e?.scanId);d.current=e?.scanId;const y=k.useRef(!0);k.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),k.useEffect(()=>{a(null),w(null)},[e?.scanId]);const v=k.useRef(new Map),R=e?.items??ge,M=j.scanId===e?.scanId?j.ids:Q,D=he(R,M,o),G=S=>{e&&g({scanId:e.scanId,ids:S})},[Y,J]=k.useState(null),O=Y?.scanId===e?.scanId?Y:null,ae=S=>{J({scanId:e.scanId,ids:new Set(S.items.map(E=>E.id)),label:S.label});const I=v.current.get(S.items[0].id);I?.scrollIntoView({block:"center",behavior:"instant"}),I?.focus({preventScroll:!0})},_=l?t?"Wait for the scan to finish before downloading a script.":D.count?null:"Select at least one item to download a script.":"Connect to the host to download a script.",le=async()=>{if(!e||_||n)return;const S=e.scanId;c(!0),w(null);try{const I=await A.invoke("disk_cleanup_script",{scanId:S,itemIds:D.ids,allowRm:o});if(!y.current||d.current!==S)return;if(typeof I?.script!="string"||typeof I?.fileName!="string"||!I.fileName)throw new Error("The host did not return a cleanup script.");const E=I.fileName.split(/[\\/]/).pop()||(e.platform==="windows"?"disk-cleanup.ps1":"disk-cleanup.sh"),$=URL.createObjectURL(new Blob([I.script],{type:"text/plain;charset=utf-8"})),C=document.createElement("a");C.href=$,C.download=E,document.body.append(C),C.click(),C.remove(),window.setTimeout(()=>URL.revokeObjectURL($),1e3),a({scanId:S,fileName:E})}catch(I){y.current&&d.current===S&&w(String(I?.message??I))}finally{y.current&&c(!1)}},H=f?.scanId===e?.scanId?f?.fileName:e?.platform==="windows"?"disk-cleanup.ps1":"disk-cleanup.sh";return s.jsxs("section",{className:"disk-page","aria-label":"Disk report",children:[s.jsx(re,{root:!0,title:s.jsx("h1",{children:"Disk"}),back:{label:"Chat",onClick:m},actions:s.jsx("button",{className:`disk-button${t?" is-scanning":""}`,type:"button",disabled:!l||h||r,onClick:x,children:h?t?"Cancelling…":"Starting…":t?"Cancel scan":"Scan"})}),s.jsxs("div",{className:"disk-body",children:[s.jsxs("div",{className:"disk-intro",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Development leftovers"}),s.jsx("p",{children:"Manual scans of your home folder and system temp. Metadata, Git and open-file checks only."})]}),e&&s.jsxs("div",{className:"disk-total",children:[s.jsx("strong",{children:B(e.totalBytes)}),s.jsxs("span",{children:[e.platform==="macos"?"macOS":e.platform==="windows"?"Windows":e.platform==="linux"?"Linux":"Unknown platform"," · Last scanned ",P(e.scannedAt)]})]})]}),s.jsx("p",{className:"disk-promise",children:"OctiqFlow never deletes anything. You choose items, download a cleanup script and run it yourself."}),!l&&s.jsx("p",{className:"disk-message",role:"status",children:"Connect to the host to scan."}),u&&s.jsx("p",{className:"disk-error",role:"alert",children:u}),t&&s.jsxs("div",{className:"disk-progress",role:"status",children:[s.jsx("span",{className:"disk-progress-mark","aria-hidden":"true"}),s.jsxs("span",{children:["Scanning ",be(t.phase)," · ",t.entries.toLocaleString("en-US")," entries · ",B(t.bytes)," counted"]})]}),r&&!e&&s.jsx("p",{className:"disk-message",children:"Reading the last report…"}),!e&&!r&&s.jsxs("div",{className:"disk-empty",children:[s.jsx("h2",{children:"No scan yet"}),s.jsx("p",{children:"Scan when you want to review large development leftovers. Nothing is selected automatically."})]}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"disk-threshold",children:["Items ≥ ",B(e.thresholdBytes)," · Size history: ",s.jsx("code",{children:"~/disk-report/sizes.csv"}),e.previousScanAt?` · Compared with ${P(e.previousScanAt)}`:" · First recorded scan"]}),s.jsxs("div",{className:"disk-layout",children:[s.jsxs("div",{className:"disk-map-column",children:[s.jsx(xe,{items:R,selected:M,onFocus:ae}),s.jsx("p",{className:"disk-map-help",children:"Area represents size. Choose a cleanup tile to highlight its rows. Your work is labelled only."})]}),s.jsxs("div",{className:"disk-list-column",children:[O&&s.jsxs("div",{className:"disk-found",role:"status",children:[O.label," · ",O.ids.size," ",O.ids.size===1?"row":"rows"," highlighted ",s.jsx("button",{type:"button",onClick:()=>J(null),children:"Clear highlight"})]}),["clean","review"].map(S=>{const I=de(R,S),E=I.filter(L);return s.jsxs("section",{className:`disk-section disk-${S}`,"aria-label":F[S],children:[s.jsxs("div",{className:"disk-section-heading",children:[s.jsxs("h2",{children:[F[S]," ",s.jsx("span",{children:I.length})]}),s.jsxs("label",{className:"disk-tick-all",children:[s.jsx("input",{type:"checkbox",checked:E.length>0&&E.every($=>M.has($.id)),disabled:!E.length,onChange:()=>G(ue(M,I))}),"Select all",s.jsxs("span",{className:"sr-only",children:[" ",F[S]]})]})]}),!I.length&&s.jsx("p",{className:"disk-message",children:"No items in this section."}),I.map($=>s.jsx(ye,{item:$,highlighted:O?.ids.has($.id),previousScanAt:e.previousScanAt,checked:M.has($.id),onTick:()=>{if(!L($))return;const C=new Set(M);C.has($.id)?C.delete($.id):C.add($.id),G(C)},rowRef:C=>{C?v.current.set($.id,C):v.current.delete($.id)}},`${e.scanId}:${$.id}`))]},S)}),s.jsx(ve,{report:e}),s.jsxs("section",{className:"disk-controls","aria-label":"Cleanup script",children:[s.jsxs("label",{className:"disk-rm-switch",children:[s.jsx("input",{type:"checkbox",role:"switch",checked:o,onChange:S=>i(S.target.checked?e.scanId:null)}),s.jsx("span",{children:"Use rm -rf for items with no tool command"})]}),s.jsx("p",{children:o?e.platform==="windows"?"The script can use PowerShell Remove-Item for these items.":"The script can use rm -rf for these items.":"Items with no tool command are printed as Skipped."}),s.jsxs("div",{className:"disk-download-row",children:[s.jsxs("strong",{children:[D.count," selected · ",B(D.bytes)]}),s.jsx("button",{className:"disk-button",type:"button",disabled:!!_||n,"aria-describedby":"disk-download-reason",onClick:()=>{le()},children:n?"Preparing script…":"Download cleanup script"})]}),D.skippedCount>0&&s.jsxs("p",{children:[D.skippedCount," selected ",D.skippedCount===1?"item will":"items will"," be printed as Skipped."]}),s.jsx("p",{id:"disk-download-reason",children:_??"Review the script before running it."}),b&&s.jsx("p",{className:"disk-error",role:"alert",children:b}),s.jsxs("p",{className:"disk-run-example",children:["Run it in your terminal, for example: ",s.jsx("code",{children:e.platform==="windows"?`powershell -File "$HOME\\Downloads\\${H}"`:`bash ~/Downloads/${H}`})]})]})]})]})]})]})]})}function be(e){return{home:"home folder",temp:"system temp",git:"Git worktrees",history:"size history"}[e]??e}function X(e,t,u){return{left:`${e.x/t*100}%`,top:`${e.y/u*100}%`,width:`${e.width/t*100}%`,height:`${e.height/u*100}%`}}function xe({items:e,selected:t,onFocus:u}){const h=k.useRef(null),[r,l]=k.useState(0),[x,m]=k.useState(null),[j,g]=we();k.useLayoutEffect(()=>{const n=h.current;if(!n)return;l(n.getBoundingClientRect().width);const c=new ResizeObserver(d=>{const y=d[0]?.contentRect.width;y>0&&l(y)});return c.observe(n),()=>c.disconnect()},[]);const p=Math.max(340,Math.min(520,r*1.1)),i=k.useMemo(()=>pe(e,t),[e,t]),o=k.useMemo(()=>["clean","review","work"].map(n=>({id:n,bytes:i.filter(c=>c.group===n).reduce((c,d)=>c+d.bytes,0)})),[i]),f=k.useMemo(()=>j?me(i,r,p,j):{regions:[],summaries:i},[i,r,p,j]),a=[...f.regions.flatMap(n=>n.tiles),...f.summaries],b=a.find(n=>n.id===x),w=(n,c)=>{const d=Z(n),y=!c,v=y?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"disk-tile-label",children:[n.label,n.label==="Other"?` in ${F[n.group]}`:""," · ",n.items.length," ",n.items.length===1?"item":"items"]}),s.jsx("span",{className:"disk-tile-size",children:ie(n)})]}):s.jsx(je,{entry:n}),R=`${d}
|
|
2
2
|
${n.items.length===1?n.items[0].path:`${n.items.length} items in ${F[n.group]}`}`,M={onMouseEnter:()=>{h.current?.parentElement?.contains(document.activeElement)||m(n.id)},onFocus:()=>m(n.id)},D=`${y?"disk-map-summary":"disk-tile"} disk-${n.group}${n.group==="work"?" is-work":""}${n.selectedCount?" is-selected":""}`;return n.group==="work"?s.jsx("div",{className:D,style:c,title:R,"aria-label":`${d}. Your work is labelled only.`,tabIndex:0,...M,children:v},n.id):s.jsx("button",{type:"button",className:D,style:c,title:R,"aria-label":`${d}. Find in ${F[n.group]}`,onClick:()=>u(n),...M,children:v},n.id)};return s.jsxs("section",{className:"disk-map-panel","aria-label":"Disk size treemap",children:[s.jsx("h2",{children:"Where the space goes"}),s.jsx("div",{className:"disk-map-legend",children:o.map(n=>s.jsxs("span",{className:`disk-${n.id}`,children:[s.jsx("i",{"aria-hidden":"true"}),F[n.id]," · ",B(n.bytes)]},n.id))}),g,s.jsx("div",{className:"disk-map",ref:h,style:{height:f.regions.length?p:0},children:f.regions.map(({box:n,tiles:c})=>s.jsx("div",{className:`disk-map-region disk-${c[0].group}`,style:X(n,r,p),"aria-label":F[c[0].group],children:c.map(d=>w(d,X(d,n.width,n.height)))},n.id))}),!i.length&&s.jsx("p",{className:"disk-message",children:"No large development leftovers found."}),!!f.summaries.length&&s.jsxs("div",{className:"disk-map-summaries","aria-label":"Groups summarized outside the map",children:[j&&s.jsx("p",{className:"disk-message",children:"Small items are summarized here. Map area represents only the items shown above."}),f.summaries.map(n=>w(n))]}),a.some(n=>n.selectedCount>0)&&s.jsx("p",{className:"disk-map-ticked","aria-live":"polite",children:a.filter(n=>n.selectedCount>0).map(n=>`${n.label} · ${n.selectedCount} ticked`).join("; ")}),s.jsx("div",{className:"disk-map-inspector","aria-live":"polite",children:b?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:Z(b)}),s.jsx("code",{children:b.items.length===1?b.items[0].path:`${b.items.length} items in ${F[b.group]}${b.group==="work"?" · Your work is labelled only.":" · Choose to highlight their rows."}`})]}):"Hover or focus a tile to see its full name, count and size."})]})}function Z(e){return`${e.label}, ${e.items.length} ${e.items.length===1?"item":"items"}, ${B(e.bytes)}${e.selectedCount?`, ${e.selectedCount} ticked`:""}`}function ie(e){return`${B(e.bytes)}${e.selectedCount?` · ${e.selectedCount} ticked`:""}`}function we(){const e=k.useRef(null),t=k.useRef(null),[u,h]=k.useState(null);return k.useLayoutEffect(()=>{const r=e.current,l=t.current;if(!r||!l)return;let x=!0,m="";const j=()=>{if(!x)return;const p=getComputedStyle(r),i=getComputedStyle(l),o=r.getBoundingClientRect(),f=l.getBoundingClientRect(),a=[p.font,i.font,p.letterSpacing,i.letterSpacing,o.width,o.height,f.width,f.height].join("|");if(a===m)return;m=a;const b=document.createElement("canvas").getContext("2d");if(!b)return;const w=(y,v)=>(b.font=v.font,b.measureText(y).width+(parseFloat(v.letterSpacing)||0)*y.length),n={font:p.font,letterSpacing:p.letterSpacing},c={font:i.font,letterSpacing:i.letterSpacing},d=Math.max(..."0123456789".split("").map(y=>w(y,c)));h(()=>y=>{const v=y.items.filter(L).length,R=w(B(y.bytes),c)+(v?w(" · ticked",c)+String(v).length*d:0),M=w(`${y.label.split(/\s+/)[0].slice(0,10)}…`,n);return{width:Math.ceil(Math.max(R,M))+26,height:Math.ceil(o.height+f.height)+6+26}})},g=new ResizeObserver(j);return g.observe(r),g.observe(l),j(),document.fonts.ready.then(j),()=>{x=!1,g.disconnect()}},[]),[u,s.jsxs("span",{className:"disk-map-probes","aria-hidden":"true",children:[s.jsx("span",{className:"disk-tile-label",ref:e,children:"Overview…"}),s.jsx("span",{className:"disk-tile-size",ref:t,children:"888.8 GB · 888 ticked"})]},"font-probes")]}function je({entry:e}){return s.jsxs("span",{className:"disk-tile-content","data-fit":"full","aria-hidden":"true",children:[s.jsxs("span",{className:"disk-tile-label disk-tile-visible-label",children:[e.label,e.items.length>1?` · ${e.items.length} items`:""]}),s.jsx("span",{className:"disk-tile-size disk-tile-visible-size",children:ie(e)})]})}function ye({item:e,checked:t,highlighted:u,onTick:h,previousScanAt:r,rowRef:l}){const x=ee(e.id),m=k.useId(),j=L(e),g=e.effect.length>200,p=(e.note?.length??0)>200,i=e.worktree,o=i?[{label:"Working tree clean",pass:i.clean},{label:"Merged to mainline",pass:i.merged},{label:"Not a mainline worktree",pass:i.mainline===void 0?void 0:!i.mainline},{label:"Not in use",pass:i.inUse===void 0?void 0:!i.inUse}]:[];return s.jsxs("article",{ref:l,tabIndex:-1,className:`disk-item${t?" is-selected":""}${u?" is-found":""}`,"aria-label":e.label,children:[s.jsxs("div",{className:"disk-item-heading",children:[s.jsxs("label",{children:[s.jsx("input",{type:"checkbox",checked:j&&t,"aria-disabled":!j||void 0,"aria-describedby":!j||e.notRecommended?m:void 0,onChange:()=>{j&&h()}}),s.jsx("strong",{children:e.label})]}),s.jsx("strong",{className:"disk-item-size",children:B(e.bytes)})]}),s.jsx("code",{className:"disk-path",title:e.path,children:e.path}),(!j||e.notRecommended)&&s.jsx("p",{id:m,className:"disk-not-recommended",children:e.notRecommended?"Not recommended to delete":"No safe cleanup command for this item"}),!g&&e.effect&&s.jsx("p",{children:e.effect}),!p&&e.note&&s.jsx("p",{className:"disk-note",children:e.note}),e.grew&&e.previousBytes!==null&&e.bytes>e.previousBytes&&s.jsxs("p",{className:"disk-growth",children:["+",((e.bytes-e.previousBytes)/1e6).toLocaleString("en-US",{maximumFractionDigits:1})," MB since ",P(r)]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"disk-worktree-facts",children:o.map(f=>s.jsxs("li",{className:f.pass===!0?"is-pass":"is-fail",children:[s.jsx("span",{children:f.pass===!0?"✓ Pass":f.pass===!1?"✕ Fail":"? Unknown"})," ",f.label]},f.label))}),!!i.ignoredBytes&&s.jsxs("p",{className:"disk-not-recommended",children:["Includes ",B(i.ignoredBytes)," of ignored files. Git does not protect these files."]})]}),s.jsx(se,{fold:x,labels:["Full path",g&&`Effect · ${e.effect.length} characters`,p&&`Note · ${e.note.length} characters`,i&&"Worktree details"],what:`details for ${e.label}`}),s.jsxs(te,{fold:x,bounded:!1,children:[s.jsx("code",{className:"disk-full-path",children:e.path}),g&&s.jsx("p",{children:e.effect}),p&&s.jsx("p",{children:e.note}),i&&s.jsxs("p",{children:["Repository: ",s.jsx("code",{children:i.repo||"Unknown"}),s.jsx("br",{}),"Branch: ",s.jsx("code",{children:i.branch||"Unknown"}),s.jsx("br",{}),"Idle: ",i.idleDays??"Unknown"," days · Eligible: ",i.eligible===void 0?"Unknown":i.eligible?"Yes":"No"]})]})]})}function ve({report:e}){const t=ee(`${e.scanId}:skipped`);return s.jsxs("div",{className:"disk-skipped",children:[s.jsx(se,{fold:t,labels:[`${e.skipped.length} folders skipped`],what:"skipped folders"}),s.jsxs(te,{fold:t,bounded:!1,children:[s.jsx("ul",{children:e.skipped.map((u,h)=>s.jsxs("li",{children:[s.jsx("code",{children:u.path}),s.jsx("p",{children:u.reason})]},h))}),!e.skipped.length&&s.jsx("p",{children:"No folders were skipped."})]})]})}export{xe as DiskMap,ke as DiskReportPage,Se as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,b as qe,a as Mt,T as Re,c as Ve,d as Is,p as Ce,e as ce,C as Pe,o as Lt,f as gs,P as wt,g as Os,S as Ht,h as Ws,u as $s,i as Us,j as Bs,k as Fs,w as Et,l as x,W as Gs,A as Ks}from"./index-CzmdQnci.js";import{G as he,B as ht,M as ze,a as O,c as ys,p as xs,C as Nt,b as ee,d as ct,A as It,S as lt,e as ws,R as zt,f as Ys,V as oe,g as Je,T as Ze,Q as qt,h as Zt,i as Me,j as Hs,P as qs,k as Zs,l as bs,m as H,N as Xs,n as Ot,o as Wt,q as Qs,r as Dt,s as Xe,t as Xt,I as Vs,u as Qt,D as Rt,v as ks,w as bt,x as Js,y as Ms,F as ei,z as ti,E as si,W as ii,H as ni,J as ai,K as oi,L as ri,O as ci,U as li,X as hi,Y as di,Z as ui,_ as Vt,$ as pi,a0 as fi,a1 as Jt,a2 as At,a3 as mi}from"./robot-CzDIvswk.js";const gi=o=>String(o?.message??o);function yi(o){const[e,t]=I.useState(null),[s,i]=I.useState(null),[n,a]=I.useState(null),r=I.useRef(null),l=I.useRef(0),h=I.useCallback(()=>{const p=++l.current;qe.invoke("island_get").then(c=>{if(p!==l.current||!c?.island)return;const d=c.island;r.current&&r.current.rev>d.rev||(r.current=d,t(d),i(null))}).catch(c=>{p===l.current&&i(gi(c))})},[]);I.useEffect(()=>{if(!o)return;h();const p=qe.on("island-changed",d=>{d&&(r.current&&d.rev<=r.current.rev||(a(d),h()))}),c=qe.on("chat-status",d=>{d?.key.startsWith("chat:island-wish-")&&h()});return()=>{p(),c()}},[o,h]);const m=I.useCallback(async(p,c={})=>{await qe.invoke(p,c),h()},[h]);return{island:e,error:s,change:n,reload:h,dismissWish:p=>m("island_wish_dismiss",{id:p}),grantWish:p=>m("island_wish_start",{id:p}),rollWish:()=>m("island_wish_roll"),inviteBot:()=>m("island_bot_invite"),farewell:p=>m("island_bot_farewell",{id:p}),setPace:p=>m("island_settings_set",{wishPace:p}),setBuildPace:p=>m("island_build_pace",{pace:p})}}function xi(o,e=Date.now()){const t=new Map;for(const s of o){const i=a=>s.activities.find(r=>r.state===a)?.title,n=s.state==="working"?{state:"working",label:i("working")}:s.state==="needs_you"?{state:"needs_you",label:i("needs_you")}:s.state==="failed"?{state:"failed",label:i("failed")}:{state:"free",...s.recent?{idleFor:Math.max(0,Math.round((e-s.recent.at)/6e4))}:{}};t.set(`agent:${s.id}`,n)}return t}function wi(o,e=Date.now()){const t=Math.max(0,Math.round((e-o)/6e4));if(t<1)return"just now";if(t<60)return`${t} min ago`;const s=Math.round(t/60);return s<24?`${s} h ago`:`${Math.round(s/24)} d ago`}function zs(o,e){const t=new Map;for(const c of[...e].sort((d,g)=>d.key.localeCompare(g.key))){const d=c.agent?.teamId?`team:${c.agent.teamId}`:"general";t.set(d,[...t.get(d)??[],c])}t.has("general")||t.set("general",[]);const s=[],i=o.assets.filter(c=>c.kind==="accessory"),n=[],a=[],r=new Map,l=o.plots.filter(c=>c.owner.kind==="home"&&c.owner.id.startsWith("public:")||o.placed.some(d=>d.plot===c.id&&o.assets.some(g=>g.id===d.asset&&g.kind==="building"&&g.name!=="Workshop"))),h=[];for(let c=1;h.length<t.size+l.length;c++)h.push(...Mt(c).filter(([d,g])=>(d!==-1||g!==0)&&(d!==0||g!==-1)));const m=(c,d,g)=>({shape:"box",size:c,at:d,color:g});for(const[c,[d,g]]of[...t].sort(([j],[b])=>j.localeCompare(b)).entries()){const[j,b]=h[c],k=Ve(j,b),f=`office:${d}`,E=d==="general"?"Agent Tower":`${g[0].agent?.teamName??"Team"} Office`,z={id:f,owner:{kind:"home",id:d},ring:Math.max(Math.abs(j),Math.abs(b),Math.abs(j+b)),slot:c,q:j,r:b,...k,facing:Math.atan2(-k.x,-k.z)*180/Math.PI,radius:Re,claimedAt:0,members:g.map(A=>A.owner.id),officeName:E};s.push(z);const _=Math.max(d==="general"?3:1,Math.ceil(g.length/6)),L=[];for(let A=0;A<_;A++){const S=A*2.3;L.push(m([8,.08,6],[0,S+.04,-.7],"#d6dce5")),L.push({...m([8,2,.14],[0,S+1,-3.6],"#b6c9dd"),finish:"glass"}),L.push({...m([.16,2.3,6],[-3.95,S+1.15,-.7],"#7a94b1"),finish:"glass"}),L.push({...m([.16,2.3,6],[3.95,S+1.15,-.7],"#7a94b1"),finish:"glass"});for(const N of[-2.7,0,2.7])L.push({...m([1.5,1,.025],[N,S+1.2,-3.51],"#b5e5fa"),finish:"glass"})}i.push({id:f,rev:_,name:E,kind:"building",parts:L,by:{name:"Island offices"},madeAt:0,updatedAt:0}),n.push({id:f,asset:f,plot:f,x:0,z:0,y:0,turn:0});for(const[A,S]of g.entries()){a.push({...S,plot:z});const N=`office-desk:${S.key}`,$=(A%3-1)*2.4,W=Math.floor(A%6/3)*2.5-2.4,X=Math.floor(A/6)*2.3;i.push({id:N,rev:Number.parseInt(S.look.trim.slice(1)+S.look.glow.slice(1),16),name:`${S.name}'s desk`,kind:"furniture",use:"desk",spot:{at:[0,0,.65],face:180},parts:[m([1.3,.08,.7],[0,.6,0],"#cfa783"),m([.12,.6,.12],[-.5,.3,0],S.look.trim),m([.12,.6,.12],[.5,.3,0],S.look.trim),m([.65,.42,.08],[0,.88,-.18],"#26354a"),{...m([.55,.32,.02],[0,.88,-.13],S.look.glow),finish:"glow"}],by:{name:S.name,agentId:S.owner.id},madeAt:0,updatedAt:0}),n.push({id:N,asset:N,plot:f,x:$,z:W,y:X,turn:0}),r.set(N,S.key);const Y=o.placed.filter(F=>F.plot===S.plot?.id).filter(F=>{const V=o.assets.find(ve=>ve.id===F.asset);return V&&V.kind!=="building"&&V.name!=="Workshop"&&V.name!=="Desk"&&V.use!=="bed"});for(const[F,V]of Y.entries()){const ve=o.assets.find(fe=>fe.id===V.asset);i.some(fe=>fe.id===ve.id)||i.push(ve);const ne=(A+F/Math.max(1,Y.length))/g.length*Math.PI*2;n.push({...V,plot:f,x:Math.sin(ne)*4.8,z:Math.cos(ne)*4.8,y:0})}}}for(const[c,d]of l.entries()){const[g,j]=h[t.size+c],b=Ve(g,j),k=o.placed.filter(z=>z.plot===d.id&&o.assets.some(_=>_.id===z.asset&&(d.owner.kind==="home"||_.kind==="building"&&_.name!=="Workshop"))),f=o.assets.find(z=>k.some(_=>_.asset===z.id)&&z.kind==="building"),E={...d,q:g,r:j,...b,ring:Math.max(Math.abs(g),Math.abs(j),Math.abs(g+j)),facing:Math.atan2(-b.x,-b.z)*180/Math.PI,officeName:f?.name??"Public project"};s.push(E),n.push(...k);for(const z of k){const _=o.assets.find(L=>L.id===z.asset);_&&!i.some(L=>L.id===_.id)&&i.push(_)}}const p=Math.max(30,o.radius,...s.map(c=>Math.hypot(c.x,c.z)+Re+4));return{island:{...o,plots:s,assets:i,placed:n,radius:p},residents:a,deskOwners:r}}function bi(){const o=new he;o.name="planted-seedlings";const e=new he;o.add(e);const t=new ht(1,1,1),s=new ze({color:"#88674b"}),i=new ze({color:"#64a856"}),n=new O(t,s);n.scale.set(.8,.035,.45),n.position.y=.02,o.add(n);for(const r of[-.26,0,.26]){const l=new O(t,i);l.scale.set(.025,.3,.025),l.position.set(r,.17,0),e.add(l);for(const h of[-1,1]){const m=new O(t,i);m.scale.set(.17,.045,.08),m.position.set(r+h*.07,.23,0),m.rotation.z=h*.4,e.add(m)}}let a=0;return{root:o,update(r,l){l&&(a=Math.min(1,a+r/12)),e.scale.setScalar(.12+a*.88),o.visible=a>0},dispose(){t.dispose(),s.dispose(),i.dispose()}}}const we=Ve(0,-1),ki={x:we.x,z:we.z-.8};function Mi(o){return{x:we.x+(o%4-1.5)*1.6,z:we.z+.6+Math.floor(o/4)*1}}function zi(){const o=new he;o.name="bot-society",o.position.set(we.x,.05,we.z);const e=new ht(1,1,1),t=new ze({color:"#ded8c9",roughness:.8}),s=new ze({color:"#caa45c",metalness:.5,roughness:.3}),i=new ze({color:"#b8e5f0",transparent:!0,opacity:.22,depthWrite:!1}),n=(c,d,g,j,b,k,f=t)=>{const E=new O(e,f);E.position.set(c,d,g),E.scale.set(j,b,k),o.add(E)};n(0,.05,0,8,.1,7),n(-3.9,1.2,0,.15,2.4,7,i),n(3.9,1.2,0,.15,2.4,7,i);for(const c of[-3.2,3.2])n(c,1.5,2.8,.45,3,.45),n(c,3.1,2.8,.75,.2,.75,s);n(0,3.15,2.8,6.8,.25,.35,s),n(0,.45,-1.6,3.2,.9,.65),n(0,.94,-1.6,3.5,.1,.9,s),n(0,.5,-3.7,2.4,1,1.8),n(0,1.07,-3.7,2.7,.15,2,s);const a=Is({id:"bot-society-statue",agent:"codex",model:"sol"}),r=ys({...a,shell:"#d7c592",trim:"#a98642",glow:"#fff2af",antenna:"crown"});xs(r,"raise",0,{calm:!0}),r.root.scale.setScalar(4.5),r.root.position.set(0,1.15,-3.7),o.add(r.root);const l=document.createElement("canvas");l.width=768,l.height=128;const h=l.getContext("2d");h.fillStyle="#f7e8bd",h.fillRect(0,0,768,128),h.fillStyle="#5d4828",h.font="bold 56px sans-serif",h.textAlign="center",h.fillText("BOT SOCIETY",384,80);const m=new Nt(l),p=new ee({map:m});return n(0,3.15,3.02,4.8,.8,.04,p),{root:o,solids:[{cx:we.x-3.9,cz:we.z,hx:.08,hz:3.5,yaw:0},{cx:we.x+3.9,cz:we.z,hx:.08,hz:3.5,yaw:0},{cx:we.x,cz:we.z-1.6,hx:1.7,hz:.45,yaw:0},{cx:we.x,cz:we.z-3.7,hx:1.4,hz:1.1,yaw:0}],dispose(){r.dispose(),e.dispose(),t.dispose(),s.dispose(),i.dispose(),m.dispose(),p.dispose()}}}function vi(o){if(o.kind==="accessory"||o.use==="none")return null;if(["read","paint","garden","perform","play","observe"].includes(o.use??""))return o.use;const e=o.name.toLowerCase();for(const[t,s]of[["garden",/garden|planter|greenhouse|seedling|herb|mint|花|种植|种子|盆栽|薄荷|温室|苗/],["paint",/easel|paint|画架|绘画|畫架/],["read",/library|bookshelf|bookcase|café|cafe|reading|书架|图书|書架|咖啡/],["perform",/music|concert|stage|piano|音乐|合奏|舞台|钢琴/],["play",/arcade|game|toy|游戏|玩具|游乐/],["observe",/lamp|light|灯|燈/]])if(s.test(e))return t;return/\b(chair|bench|stool|bed)\b|椅|凳|床/.test(e)&&!o.use?null:!o.use&&/\b(table|desk|workbench)\b|桌|工作台/.test(e)?/workbench|工作台/.test(e)?"play":"read":o.use==="desk"?/workbench|工作台/.test(e)?"play":"read":o.use==="seat"||o.use==="bed"?null:o.kind==="building"||o.kind==="furniture"||o.kind==="decor"?"observe":null}function _i(o,e,t){if(t.id.startsWith("office-desk:"))return null;const s=vi(o);if(!s||!o.parts.length)return null;const i=Math.max(...o.parts.map(c=>ct(c).max[2])),n=Math.max(0,...o.parts.map(c=>ct(c)).filter(c=>c.max[1]<=.35&&c.max[1]-c.min[1]<=.16).map(c=>c.max[1])),a=o.spot??(o.kind==="building"&&s!=="observe"?{at:[0,n,0],face:180}:{at:[0,0,i+.85],face:180}),r=t.turn*Math.PI/180,[l,h,m]=a.at,p=Ce(e,t.x+l*Math.cos(r)+m*Math.sin(r),t.z-l*Math.sin(r)+m*Math.cos(r));return{key:t.id,name:o.name,activity:s,...p,y:ce+t.y+h,face:(e.facing+t.turn+a.face)*Math.PI/180}}function es(o,e){const t={garden:"gardening",read:"reading",paint:"painting",perform:"music",play:"games"};return e==="observe"||!!o?.includes(t[e])}function Si(){const o=new he,e=new ht(1,1,1),t=["#f1e7cb","#6b86b6","#f5a14a","#76b9a5","#71c7ff"].map(m=>new ee({color:m})),s=(m,p,c)=>{const d=new he;d.name=m;const g=new O(e,t[c]);return g.scale.set(...p),d.add(g),o.add(d),d.visible=!1,d},i=s("read",[.32,.24,.05],1),n=s("paint",[.035,.32,.035],2),a=s("garden",[.22,.16,.17],3),r=s("register",[.24,.3,.02],0),l=s("play",[.25,.1,.1],1),h=new O(e,t[4]);return h.scale.set(.18,.035,.035),h.position.x=.16,a.add(h),{root:o,show(m){for(const p of[i,n,a,r,l])p.visible=p.name===m},dispose(){e.dispose(),t.forEach(m=>m.dispose())}}}function Pi(){const o=new he;o.name="concert-stage";const e=new ee({color:"#253044"}),t=new ee({color:"#9d8dff"}),s=new ee({color:"#c2a1ff",transparent:!0,opacity:.32,depthWrite:!1}),i=new ee({color:"#b997ff",transparent:!0,opacity:.13,depthWrite:!1,blending:It}),n=new lt(.75,20,12),a=new O(n,i);a.position.y=.65,o.add(a);const r=new ht(.5,.8,.4),l=new ws(.16,20),h=new zt(.7,1.25,40),m=new O(h,s);m.rotation.x=-Math.PI/2,m.position.y=.05,o.add(m);const p=[];for(const d of[-1,1]){const g=new he;g.position.set(d*1.2,.4,0),g.add(new O(r,e));for(const j of[-.19,.19]){const b=new O(l,t);b.position.set(0,j,.205),g.add(b)}o.add(g),p.push(g)}o.visible=!1;let c=0;return{root:o,update(d,g,j,b){c=Math.max(0,Math.min(1,c+(d?1:-1)*g*3)),o.visible=c>0;const k=b?1:1+Math.sin(j*8)*.09;o.scale.setScalar(Math.max(.001,c)),m.scale.setScalar(k),a.scale.setScalar(k),s.opacity=.24+(b?0:(Math.sin(j*8)+1)*.1),p.forEach(f=>f.scale.set(1,k,k))},dispose(){n.dispose(),i.dispose(),r.dispose(),l.dispose(),h.dispose(),e.dispose(),t.dispose(),s.dispose()}}}const ts={type:"change"},$t={type:"start"},vs={type:"end"},gt=new Hs,ss=new qs,ji=Math.cos(70*Zs.DEG2RAD),ae=new oe,xe=2*Math.PI,K={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Tt=1e-6;class Ei extends Ys{constructor(e,t=null){super(e,t),this.state=K.NONE,this.target=new oe,this.cursor=new oe,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Je.ROTATE,MIDDLE:Je.DOLLY,RIGHT:Je.PAN},this.touches={ONE:Ze.ROTATE,TWO:Ze.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new oe,this._lastQuaternion=new qt,this._lastTargetPosition=new oe,this._quat=new qt().setFromUnitVectors(e.up,new oe(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Zt,this._sphericalDelta=new Zt,this._scale=1,this._panOffset=new oe,this._rotateStart=new Me,this._rotateEnd=new Me,this._rotateDelta=new Me,this._panStart=new Me,this._panEnd=new Me,this._panDelta=new Me,this._dollyStart=new Me,this._dollyEnd=new Me,this._dollyDelta=new Me,this._dollyDirection=new oe,this._mouse=new Me,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Ti.bind(this),this._onPointerDown=Ai.bind(this),this._onPointerUp=Li.bind(this),this._onContextMenu=Wi.bind(this),this._onMouseWheel=Ci.bind(this),this._onKeyDown=Ni.bind(this),this._onTouchStart=Ii.bind(this),this._onTouchMove=Oi.bind(this),this._onMouseDown=Di.bind(this),this._onMouseMove=Ri.bind(this),this._interceptControlDown=$i.bind(this),this._interceptControlUp=Ui.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=""}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(ts),this.update(),this.state=K.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){const t=this.object.position;ae.copy(t).sub(this.target),ae.applyQuaternion(this._quat),this._spherical.setFromVector3(ae),this.autoRotate&&this.state===K.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(s)&&isFinite(i)&&(s<-Math.PI?s+=xe:s>Math.PI&&(s-=xe),i<-Math.PI?i+=xe:i>Math.PI&&(i-=xe),s<=i?this._spherical.theta=Math.max(s,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+i)/2?Math.max(s,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let n=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),n=a!=this._spherical.radius}if(ae.setFromSpherical(this._spherical),ae.applyQuaternion(this._quatInverse),t.copy(this.target).add(ae),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const r=ae.length();a=this._clampDistance(r*this._scale);const l=r-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),n=!!l}else if(this.object.isOrthographicCamera){const r=new oe(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),n=l!==this.object.zoom;const h=new oe(this._mouse.x,this._mouse.y,0);h.unproject(this.object),this.object.position.sub(h).add(r),this.object.updateMatrixWorld(),a=ae.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(gt.origin.copy(this.object.position),gt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(gt.direction))<ji?this.object.lookAt(this.target):(ss.setFromNormalAndCoplanarPoint(this.object.up,this.target),gt.intersectPlane(ss,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),n=!0)}return this._scale=1,this._performCursorZoom=!1,n||this._lastPosition.distanceToSquared(this.object.position)>Tt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Tt||this._lastTargetPosition.distanceToSquared(this.target)>Tt?(this.dispatchEvent(ts),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?xe/60*this.autoRotateSpeed*e:xe/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){ae.setFromMatrixColumn(t,0),ae.multiplyScalar(-e),this._panOffset.add(ae)}_panUp(e,t){this.screenSpacePanning===!0?ae.setFromMatrixColumn(t,1):(ae.setFromMatrixColumn(t,0),ae.crossVectors(this.object.up,ae)),ae.multiplyScalar(e),this._panOffset.add(ae)}_pan(e,t){const s=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;ae.copy(i).sub(this.target);let n=ae.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/s.clientHeight,this.object.matrix),this._panUp(2*t*n/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),i=e-s.left,n=t-s.top,a=s.width,r=s.height;this._mouse.x=i/a*2-1,this._mouse.y=-(n/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(xe*this._rotateDelta.x/t.clientHeight),this._rotateUp(xe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(s,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(s,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,i=e.pageY-t.y,n=Math.sqrt(s*s+i*i);this._dollyStart.set(0,n)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const s=this._getSecondPointerPosition(e),i=.5*(e.pageX+s.x),n=.5*(e.pageY+s.y);this._rotateEnd.set(i,n)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(xe*this._rotateDelta.x/t.clientHeight),this._rotateUp(xe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(s,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,i=e.pageY-t.y,n=Math.sqrt(s*s+i*i);this._dollyEnd.set(0,n),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,r=(e.pageY+t.y)*.5;this._updateZoomParameters(a,r)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Me,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,s={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function Ai(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function Ti(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function Li(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(vs),this.state=K.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Di(o){let e;switch(o.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case Je.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=K.DOLLY;break;case Je.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=K.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=K.ROTATE}break;case Je.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=K.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=K.PAN}break;default:this.state=K.NONE}this.state!==K.NONE&&this.dispatchEvent($t)}function Ri(o){switch(this.state){case K.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case K.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case K.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Ci(o){this.enabled===!1||this.enableZoom===!1||this.state!==K.NONE||(o.preventDefault(),this.dispatchEvent($t),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(vs))}function Ni(o){this.enabled!==!1&&this._handleKeyDown(o)}function Ii(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case Ze.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=K.TOUCH_ROTATE;break;case Ze.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=K.TOUCH_PAN;break;default:this.state=K.NONE}break;case 2:switch(this.touches.TWO){case Ze.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=K.TOUCH_DOLLY_PAN;break;case Ze.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=K.TOUCH_DOLLY_ROTATE;break;default:this.state=K.NONE}break;default:this.state=K.NONE}this.state!==K.NONE&&this.dispatchEvent($t)}function Oi(o){switch(this._trackPointer(o),this.state){case K.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case K.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case K.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case K.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=K.NONE}}function Wi(o){this.enabled!==!1&&o.preventDefault()}function $i(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ui(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Bi(o){if(o.kind!=="building"||!o.parts.length)return[];const e=o.parts.map(ct).filter(({min:t,max:s})=>(s[1]<=1.2+1e-6||s[1]-t[1]<.3)&&s[0]-t[0]>1&&s[2]-t[2]>1);if(!e.length){const t=Qs(o);e.push({min:[t.min[0],0,t.min[2]],max:[t.max[0],0,t.max[2]]})}return e.map(({min:t,max:s})=>({x:(t[0]+s[0])/2,y:s[1]+.012,z:(t[2]+s[2])/2,width:(s[0]-t[0])*.96,depth:(s[2]-t[2])*.96}))}class _s{group=new he;material=new bs({uniforms:{night:{value:0},warmth:{value:new H("#ffb24d")},strength:{value:.34}},vertexShader:`varying vec2 lightUv;
|
|
1
|
+
import{r as I,b as qe,a as Mt,T as Re,c as Ve,d as Is,p as Ce,e as ce,C as Pe,o as Lt,f as gs,P as wt,g as Os,S as Ht,h as Ws,u as $s,i as Us,j as Bs,k as Fs,w as Et,l as x,W as Gs,A as Ks}from"./index-SFoAoPT0.js";import{G as he,B as ht,M as ze,a as O,c as ys,p as xs,C as Nt,b as ee,d as ct,A as It,S as lt,e as ws,R as zt,f as Ys,V as oe,g as Je,T as Ze,Q as qt,h as Zt,i as Me,j as Hs,P as qs,k as Zs,l as bs,m as H,N as Xs,n as Ot,o as Wt,q as Qs,r as Dt,s as Xe,t as Xt,I as Vs,u as Qt,D as Rt,v as ks,w as bt,x as Js,y as Ms,F as ei,z as ti,E as si,W as ii,H as ni,J as ai,K as oi,L as ri,O as ci,U as li,X as hi,Y as di,Z as ui,_ as Vt,$ as pi,a0 as fi,a1 as Jt,a2 as At,a3 as mi}from"./robot-CzDIvswk.js";const gi=o=>String(o?.message??o);function yi(o){const[e,t]=I.useState(null),[s,i]=I.useState(null),[n,a]=I.useState(null),r=I.useRef(null),l=I.useRef(0),h=I.useCallback(()=>{const p=++l.current;qe.invoke("island_get").then(c=>{if(p!==l.current||!c?.island)return;const d=c.island;r.current&&r.current.rev>d.rev||(r.current=d,t(d),i(null))}).catch(c=>{p===l.current&&i(gi(c))})},[]);I.useEffect(()=>{if(!o)return;h();const p=qe.on("island-changed",d=>{d&&(r.current&&d.rev<=r.current.rev||(a(d),h()))}),c=qe.on("chat-status",d=>{d?.key.startsWith("chat:island-wish-")&&h()});return()=>{p(),c()}},[o,h]);const m=I.useCallback(async(p,c={})=>{await qe.invoke(p,c),h()},[h]);return{island:e,error:s,change:n,reload:h,dismissWish:p=>m("island_wish_dismiss",{id:p}),grantWish:p=>m("island_wish_start",{id:p}),rollWish:()=>m("island_wish_roll"),inviteBot:()=>m("island_bot_invite"),farewell:p=>m("island_bot_farewell",{id:p}),setPace:p=>m("island_settings_set",{wishPace:p}),setBuildPace:p=>m("island_build_pace",{pace:p})}}function xi(o,e=Date.now()){const t=new Map;for(const s of o){const i=a=>s.activities.find(r=>r.state===a)?.title,n=s.state==="working"?{state:"working",label:i("working")}:s.state==="needs_you"?{state:"needs_you",label:i("needs_you")}:s.state==="failed"?{state:"failed",label:i("failed")}:{state:"free",...s.recent?{idleFor:Math.max(0,Math.round((e-s.recent.at)/6e4))}:{}};t.set(`agent:${s.id}`,n)}return t}function wi(o,e=Date.now()){const t=Math.max(0,Math.round((e-o)/6e4));if(t<1)return"just now";if(t<60)return`${t} min ago`;const s=Math.round(t/60);return s<24?`${s} h ago`:`${Math.round(s/24)} d ago`}function zs(o,e){const t=new Map;for(const c of[...e].sort((d,g)=>d.key.localeCompare(g.key))){const d=c.agent?.teamId?`team:${c.agent.teamId}`:"general";t.set(d,[...t.get(d)??[],c])}t.has("general")||t.set("general",[]);const s=[],i=o.assets.filter(c=>c.kind==="accessory"),n=[],a=[],r=new Map,l=o.plots.filter(c=>c.owner.kind==="home"&&c.owner.id.startsWith("public:")||o.placed.some(d=>d.plot===c.id&&o.assets.some(g=>g.id===d.asset&&g.kind==="building"&&g.name!=="Workshop"))),h=[];for(let c=1;h.length<t.size+l.length;c++)h.push(...Mt(c).filter(([d,g])=>(d!==-1||g!==0)&&(d!==0||g!==-1)));const m=(c,d,g)=>({shape:"box",size:c,at:d,color:g});for(const[c,[d,g]]of[...t].sort(([j],[b])=>j.localeCompare(b)).entries()){const[j,b]=h[c],k=Ve(j,b),f=`office:${d}`,E=d==="general"?"Agent Tower":`${g[0].agent?.teamName??"Team"} Office`,z={id:f,owner:{kind:"home",id:d},ring:Math.max(Math.abs(j),Math.abs(b),Math.abs(j+b)),slot:c,q:j,r:b,...k,facing:Math.atan2(-k.x,-k.z)*180/Math.PI,radius:Re,claimedAt:0,members:g.map(A=>A.owner.id),officeName:E};s.push(z);const _=Math.max(d==="general"?3:1,Math.ceil(g.length/6)),L=[];for(let A=0;A<_;A++){const S=A*2.3;L.push(m([8,.08,6],[0,S+.04,-.7],"#d6dce5")),L.push({...m([8,2,.14],[0,S+1,-3.6],"#b6c9dd"),finish:"glass"}),L.push({...m([.16,2.3,6],[-3.95,S+1.15,-.7],"#7a94b1"),finish:"glass"}),L.push({...m([.16,2.3,6],[3.95,S+1.15,-.7],"#7a94b1"),finish:"glass"});for(const N of[-2.7,0,2.7])L.push({...m([1.5,1,.025],[N,S+1.2,-3.51],"#b5e5fa"),finish:"glass"})}i.push({id:f,rev:_,name:E,kind:"building",parts:L,by:{name:"Island offices"},madeAt:0,updatedAt:0}),n.push({id:f,asset:f,plot:f,x:0,z:0,y:0,turn:0});for(const[A,S]of g.entries()){a.push({...S,plot:z});const N=`office-desk:${S.key}`,$=(A%3-1)*2.4,W=Math.floor(A%6/3)*2.5-2.4,X=Math.floor(A/6)*2.3;i.push({id:N,rev:Number.parseInt(S.look.trim.slice(1)+S.look.glow.slice(1),16),name:`${S.name}'s desk`,kind:"furniture",use:"desk",spot:{at:[0,0,.65],face:180},parts:[m([1.3,.08,.7],[0,.6,0],"#cfa783"),m([.12,.6,.12],[-.5,.3,0],S.look.trim),m([.12,.6,.12],[.5,.3,0],S.look.trim),m([.65,.42,.08],[0,.88,-.18],"#26354a"),{...m([.55,.32,.02],[0,.88,-.13],S.look.glow),finish:"glow"}],by:{name:S.name,agentId:S.owner.id},madeAt:0,updatedAt:0}),n.push({id:N,asset:N,plot:f,x:$,z:W,y:X,turn:0}),r.set(N,S.key);const Y=o.placed.filter(F=>F.plot===S.plot?.id).filter(F=>{const V=o.assets.find(ve=>ve.id===F.asset);return V&&V.kind!=="building"&&V.name!=="Workshop"&&V.name!=="Desk"&&V.use!=="bed"});for(const[F,V]of Y.entries()){const ve=o.assets.find(fe=>fe.id===V.asset);i.some(fe=>fe.id===ve.id)||i.push(ve);const ne=(A+F/Math.max(1,Y.length))/g.length*Math.PI*2;n.push({...V,plot:f,x:Math.sin(ne)*4.8,z:Math.cos(ne)*4.8,y:0})}}}for(const[c,d]of l.entries()){const[g,j]=h[t.size+c],b=Ve(g,j),k=o.placed.filter(z=>z.plot===d.id&&o.assets.some(_=>_.id===z.asset&&(d.owner.kind==="home"||_.kind==="building"&&_.name!=="Workshop"))),f=o.assets.find(z=>k.some(_=>_.asset===z.id)&&z.kind==="building"),E={...d,q:g,r:j,...b,ring:Math.max(Math.abs(g),Math.abs(j),Math.abs(g+j)),facing:Math.atan2(-b.x,-b.z)*180/Math.PI,officeName:f?.name??"Public project"};s.push(E),n.push(...k);for(const z of k){const _=o.assets.find(L=>L.id===z.asset);_&&!i.some(L=>L.id===_.id)&&i.push(_)}}const p=Math.max(30,o.radius,...s.map(c=>Math.hypot(c.x,c.z)+Re+4));return{island:{...o,plots:s,assets:i,placed:n,radius:p},residents:a,deskOwners:r}}function bi(){const o=new he;o.name="planted-seedlings";const e=new he;o.add(e);const t=new ht(1,1,1),s=new ze({color:"#88674b"}),i=new ze({color:"#64a856"}),n=new O(t,s);n.scale.set(.8,.035,.45),n.position.y=.02,o.add(n);for(const r of[-.26,0,.26]){const l=new O(t,i);l.scale.set(.025,.3,.025),l.position.set(r,.17,0),e.add(l);for(const h of[-1,1]){const m=new O(t,i);m.scale.set(.17,.045,.08),m.position.set(r+h*.07,.23,0),m.rotation.z=h*.4,e.add(m)}}let a=0;return{root:o,update(r,l){l&&(a=Math.min(1,a+r/12)),e.scale.setScalar(.12+a*.88),o.visible=a>0},dispose(){t.dispose(),s.dispose(),i.dispose()}}}const we=Ve(0,-1),ki={x:we.x,z:we.z-.8};function Mi(o){return{x:we.x+(o%4-1.5)*1.6,z:we.z+.6+Math.floor(o/4)*1}}function zi(){const o=new he;o.name="bot-society",o.position.set(we.x,.05,we.z);const e=new ht(1,1,1),t=new ze({color:"#ded8c9",roughness:.8}),s=new ze({color:"#caa45c",metalness:.5,roughness:.3}),i=new ze({color:"#b8e5f0",transparent:!0,opacity:.22,depthWrite:!1}),n=(c,d,g,j,b,k,f=t)=>{const E=new O(e,f);E.position.set(c,d,g),E.scale.set(j,b,k),o.add(E)};n(0,.05,0,8,.1,7),n(-3.9,1.2,0,.15,2.4,7,i),n(3.9,1.2,0,.15,2.4,7,i);for(const c of[-3.2,3.2])n(c,1.5,2.8,.45,3,.45),n(c,3.1,2.8,.75,.2,.75,s);n(0,3.15,2.8,6.8,.25,.35,s),n(0,.45,-1.6,3.2,.9,.65),n(0,.94,-1.6,3.5,.1,.9,s),n(0,.5,-3.7,2.4,1,1.8),n(0,1.07,-3.7,2.7,.15,2,s);const a=Is({id:"bot-society-statue",agent:"codex",model:"sol"}),r=ys({...a,shell:"#d7c592",trim:"#a98642",glow:"#fff2af",antenna:"crown"});xs(r,"raise",0,{calm:!0}),r.root.scale.setScalar(4.5),r.root.position.set(0,1.15,-3.7),o.add(r.root);const l=document.createElement("canvas");l.width=768,l.height=128;const h=l.getContext("2d");h.fillStyle="#f7e8bd",h.fillRect(0,0,768,128),h.fillStyle="#5d4828",h.font="bold 56px sans-serif",h.textAlign="center",h.fillText("BOT SOCIETY",384,80);const m=new Nt(l),p=new ee({map:m});return n(0,3.15,3.02,4.8,.8,.04,p),{root:o,solids:[{cx:we.x-3.9,cz:we.z,hx:.08,hz:3.5,yaw:0},{cx:we.x+3.9,cz:we.z,hx:.08,hz:3.5,yaw:0},{cx:we.x,cz:we.z-1.6,hx:1.7,hz:.45,yaw:0},{cx:we.x,cz:we.z-3.7,hx:1.4,hz:1.1,yaw:0}],dispose(){r.dispose(),e.dispose(),t.dispose(),s.dispose(),i.dispose(),m.dispose(),p.dispose()}}}function vi(o){if(o.kind==="accessory"||o.use==="none")return null;if(["read","paint","garden","perform","play","observe"].includes(o.use??""))return o.use;const e=o.name.toLowerCase();for(const[t,s]of[["garden",/garden|planter|greenhouse|seedling|herb|mint|花|种植|种子|盆栽|薄荷|温室|苗/],["paint",/easel|paint|画架|绘画|畫架/],["read",/library|bookshelf|bookcase|café|cafe|reading|书架|图书|書架|咖啡/],["perform",/music|concert|stage|piano|音乐|合奏|舞台|钢琴/],["play",/arcade|game|toy|游戏|玩具|游乐/],["observe",/lamp|light|灯|燈/]])if(s.test(e))return t;return/\b(chair|bench|stool|bed)\b|椅|凳|床/.test(e)&&!o.use?null:!o.use&&/\b(table|desk|workbench)\b|桌|工作台/.test(e)?/workbench|工作台/.test(e)?"play":"read":o.use==="desk"?/workbench|工作台/.test(e)?"play":"read":o.use==="seat"||o.use==="bed"?null:o.kind==="building"||o.kind==="furniture"||o.kind==="decor"?"observe":null}function _i(o,e,t){if(t.id.startsWith("office-desk:"))return null;const s=vi(o);if(!s||!o.parts.length)return null;const i=Math.max(...o.parts.map(c=>ct(c).max[2])),n=Math.max(0,...o.parts.map(c=>ct(c)).filter(c=>c.max[1]<=.35&&c.max[1]-c.min[1]<=.16).map(c=>c.max[1])),a=o.spot??(o.kind==="building"&&s!=="observe"?{at:[0,n,0],face:180}:{at:[0,0,i+.85],face:180}),r=t.turn*Math.PI/180,[l,h,m]=a.at,p=Ce(e,t.x+l*Math.cos(r)+m*Math.sin(r),t.z-l*Math.sin(r)+m*Math.cos(r));return{key:t.id,name:o.name,activity:s,...p,y:ce+t.y+h,face:(e.facing+t.turn+a.face)*Math.PI/180}}function es(o,e){const t={garden:"gardening",read:"reading",paint:"painting",perform:"music",play:"games"};return e==="observe"||!!o?.includes(t[e])}function Si(){const o=new he,e=new ht(1,1,1),t=["#f1e7cb","#6b86b6","#f5a14a","#76b9a5","#71c7ff"].map(m=>new ee({color:m})),s=(m,p,c)=>{const d=new he;d.name=m;const g=new O(e,t[c]);return g.scale.set(...p),d.add(g),o.add(d),d.visible=!1,d},i=s("read",[.32,.24,.05],1),n=s("paint",[.035,.32,.035],2),a=s("garden",[.22,.16,.17],3),r=s("register",[.24,.3,.02],0),l=s("play",[.25,.1,.1],1),h=new O(e,t[4]);return h.scale.set(.18,.035,.035),h.position.x=.16,a.add(h),{root:o,show(m){for(const p of[i,n,a,r,l])p.visible=p.name===m},dispose(){e.dispose(),t.forEach(m=>m.dispose())}}}function Pi(){const o=new he;o.name="concert-stage";const e=new ee({color:"#253044"}),t=new ee({color:"#9d8dff"}),s=new ee({color:"#c2a1ff",transparent:!0,opacity:.32,depthWrite:!1}),i=new ee({color:"#b997ff",transparent:!0,opacity:.13,depthWrite:!1,blending:It}),n=new lt(.75,20,12),a=new O(n,i);a.position.y=.65,o.add(a);const r=new ht(.5,.8,.4),l=new ws(.16,20),h=new zt(.7,1.25,40),m=new O(h,s);m.rotation.x=-Math.PI/2,m.position.y=.05,o.add(m);const p=[];for(const d of[-1,1]){const g=new he;g.position.set(d*1.2,.4,0),g.add(new O(r,e));for(const j of[-.19,.19]){const b=new O(l,t);b.position.set(0,j,.205),g.add(b)}o.add(g),p.push(g)}o.visible=!1;let c=0;return{root:o,update(d,g,j,b){c=Math.max(0,Math.min(1,c+(d?1:-1)*g*3)),o.visible=c>0;const k=b?1:1+Math.sin(j*8)*.09;o.scale.setScalar(Math.max(.001,c)),m.scale.setScalar(k),a.scale.setScalar(k),s.opacity=.24+(b?0:(Math.sin(j*8)+1)*.1),p.forEach(f=>f.scale.set(1,k,k))},dispose(){n.dispose(),i.dispose(),r.dispose(),l.dispose(),h.dispose(),e.dispose(),t.dispose(),s.dispose()}}}const ts={type:"change"},$t={type:"start"},vs={type:"end"},gt=new Hs,ss=new qs,ji=Math.cos(70*Zs.DEG2RAD),ae=new oe,xe=2*Math.PI,K={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Tt=1e-6;class Ei extends Ys{constructor(e,t=null){super(e,t),this.state=K.NONE,this.target=new oe,this.cursor=new oe,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Je.ROTATE,MIDDLE:Je.DOLLY,RIGHT:Je.PAN},this.touches={ONE:Ze.ROTATE,TWO:Ze.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new oe,this._lastQuaternion=new qt,this._lastTargetPosition=new oe,this._quat=new qt().setFromUnitVectors(e.up,new oe(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Zt,this._sphericalDelta=new Zt,this._scale=1,this._panOffset=new oe,this._rotateStart=new Me,this._rotateEnd=new Me,this._rotateDelta=new Me,this._panStart=new Me,this._panEnd=new Me,this._panDelta=new Me,this._dollyStart=new Me,this._dollyEnd=new Me,this._dollyDelta=new Me,this._dollyDirection=new oe,this._mouse=new Me,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Ti.bind(this),this._onPointerDown=Ai.bind(this),this._onPointerUp=Li.bind(this),this._onContextMenu=Wi.bind(this),this._onMouseWheel=Ci.bind(this),this._onKeyDown=Ni.bind(this),this._onTouchStart=Ii.bind(this),this._onTouchMove=Oi.bind(this),this._onMouseDown=Di.bind(this),this._onMouseMove=Ri.bind(this),this._interceptControlDown=$i.bind(this),this._interceptControlUp=Ui.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=""}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(ts),this.update(),this.state=K.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){const t=this.object.position;ae.copy(t).sub(this.target),ae.applyQuaternion(this._quat),this._spherical.setFromVector3(ae),this.autoRotate&&this.state===K.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(s)&&isFinite(i)&&(s<-Math.PI?s+=xe:s>Math.PI&&(s-=xe),i<-Math.PI?i+=xe:i>Math.PI&&(i-=xe),s<=i?this._spherical.theta=Math.max(s,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+i)/2?Math.max(s,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let n=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),n=a!=this._spherical.radius}if(ae.setFromSpherical(this._spherical),ae.applyQuaternion(this._quatInverse),t.copy(this.target).add(ae),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const r=ae.length();a=this._clampDistance(r*this._scale);const l=r-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),n=!!l}else if(this.object.isOrthographicCamera){const r=new oe(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),n=l!==this.object.zoom;const h=new oe(this._mouse.x,this._mouse.y,0);h.unproject(this.object),this.object.position.sub(h).add(r),this.object.updateMatrixWorld(),a=ae.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(gt.origin.copy(this.object.position),gt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(gt.direction))<ji?this.object.lookAt(this.target):(ss.setFromNormalAndCoplanarPoint(this.object.up,this.target),gt.intersectPlane(ss,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),n=!0)}return this._scale=1,this._performCursorZoom=!1,n||this._lastPosition.distanceToSquared(this.object.position)>Tt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Tt||this._lastTargetPosition.distanceToSquared(this.target)>Tt?(this.dispatchEvent(ts),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?xe/60*this.autoRotateSpeed*e:xe/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){ae.setFromMatrixColumn(t,0),ae.multiplyScalar(-e),this._panOffset.add(ae)}_panUp(e,t){this.screenSpacePanning===!0?ae.setFromMatrixColumn(t,1):(ae.setFromMatrixColumn(t,0),ae.crossVectors(this.object.up,ae)),ae.multiplyScalar(e),this._panOffset.add(ae)}_pan(e,t){const s=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;ae.copy(i).sub(this.target);let n=ae.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/s.clientHeight,this.object.matrix),this._panUp(2*t*n/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),i=e-s.left,n=t-s.top,a=s.width,r=s.height;this._mouse.x=i/a*2-1,this._mouse.y=-(n/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(xe*this._rotateDelta.x/t.clientHeight),this._rotateUp(xe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-xe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(s,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(s,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,i=e.pageY-t.y,n=Math.sqrt(s*s+i*i);this._dollyStart.set(0,n)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const s=this._getSecondPointerPosition(e),i=.5*(e.pageX+s.x),n=.5*(e.pageY+s.y);this._rotateEnd.set(i,n)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(xe*this._rotateDelta.x/t.clientHeight),this._rotateUp(xe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(s,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,i=e.pageY-t.y,n=Math.sqrt(s*s+i*i);this._dollyEnd.set(0,n),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,r=(e.pageY+t.y)*.5;this._updateZoomParameters(a,r)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Me,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,s={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function Ai(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function Ti(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function Li(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(vs),this.state=K.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Di(o){let e;switch(o.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case Je.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=K.DOLLY;break;case Je.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=K.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=K.ROTATE}break;case Je.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=K.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=K.PAN}break;default:this.state=K.NONE}this.state!==K.NONE&&this.dispatchEvent($t)}function Ri(o){switch(this.state){case K.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case K.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case K.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Ci(o){this.enabled===!1||this.enableZoom===!1||this.state!==K.NONE||(o.preventDefault(),this.dispatchEvent($t),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(vs))}function Ni(o){this.enabled!==!1&&this._handleKeyDown(o)}function Ii(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case Ze.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=K.TOUCH_ROTATE;break;case Ze.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=K.TOUCH_PAN;break;default:this.state=K.NONE}break;case 2:switch(this.touches.TWO){case Ze.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=K.TOUCH_DOLLY_PAN;break;case Ze.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=K.TOUCH_DOLLY_ROTATE;break;default:this.state=K.NONE}break;default:this.state=K.NONE}this.state!==K.NONE&&this.dispatchEvent($t)}function Oi(o){switch(this._trackPointer(o),this.state){case K.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case K.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case K.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case K.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=K.NONE}}function Wi(o){this.enabled!==!1&&o.preventDefault()}function $i(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ui(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Bi(o){if(o.kind!=="building"||!o.parts.length)return[];const e=o.parts.map(ct).filter(({min:t,max:s})=>(s[1]<=1.2+1e-6||s[1]-t[1]<.3)&&s[0]-t[0]>1&&s[2]-t[2]>1);if(!e.length){const t=Qs(o);e.push({min:[t.min[0],0,t.min[2]],max:[t.max[0],0,t.max[2]]})}return e.map(({min:t,max:s})=>({x:(t[0]+s[0])/2,y:s[1]+.012,z:(t[2]+s[2])/2,width:(s[0]-t[0])*.96,depth:(s[2]-t[2])*.96}))}class _s{group=new he;material=new bs({uniforms:{night:{value:0},warmth:{value:new H("#ffb24d")},strength:{value:.34}},vertexShader:`varying vec2 lightUv;
|
|
2
2
|
void main() { lightUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,fragmentShader:`uniform float night; uniform vec3 warmth; uniform float strength; varying vec2 lightUv;
|
|
3
3
|
void main() {
|
|
4
4
|
vec2 p = lightUv * 2.0 - 1.0;
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as $,a7 as T,a8 as L,a9 as x,V as O,aa as A,K as k,ab as g,ac as D,R as w,O as P,Q as M,ad as v,ae as R,af as B,ag as V}from"./index-
|
|
1
|
+
import{J as $,a7 as T,a8 as L,a9 as x,V as O,aa as A,K as k,ab as g,ac as D,R as w,O as P,Q as M,ad as v,ae as R,af as B,ag as V}from"./index-SFoAoPT0.js";class te{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=$(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),l=i.search(W(t));return l<0?null:{from:n+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,n){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S(o){let t=Object.keys(o).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function j(o){let t=Object.create(null),e=Object.create(null);for(let{label:i}of o){t[i[0]]=!0;for(let l=1;l<i.length;l++)e[i[l]]=!0}let n=S(t)+S(e)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function ne(o){let t=o.map(i=>typeof i=="string"?{label:i}:i),[e,n]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:j(t);return i=>{let l=i.matchBefore(n);return l||i.explicit?{from:l?l.from:i.pos,options:t,validFor:e}:null}}function oe(o,t){return e=>{for(let n=$(e.state).resolveInner(e.pos,-1);n;n=n.parent){if(o.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return t(e)}}function W(o,t){var e;let{source:n}=o,i=n[n.length-1]!="$";return i?new RegExp(`(?:${n})${i?"$":""}`,(e=o.flags)!==null&&e!==void 0?e:o.ignoreCase?"i":""):o}const q=A.define(),z=w.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class H{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class b{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,v.TrackDel),n=t.mapPos(this.to,1,v.TrackDel);return e==null||n==null?null:new b(this.field,e,n)}}class I{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],l=t.doc.lineAt(e),p=/^\s*/.exec(l.text)[0];for(let r of this.lines){if(n.length){let f=p,a=/^\t*/.exec(r)[0].length;for(let s=0;s<a;s++)f+=t.facet(O);i.push(e+f.length-a),r=f+r.slice(a)}n.push(r),e+=r.length+1}let c=this.fieldPositions.map(r=>new b(r.field,i[r.line]+r.from,i[r.line]+r.to));return{text:n,ranges:c}}static parse(t){let e=[],n=[],i=[],l;for(let p of t.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(p);){let c=l[1]?+l[1]:null,r=l[2]||l[3]||"",f=-1;c===0&&(c=1e9);let a=r.replace(/\\[{}]/g,s=>s[1]);for(let s=0;s<e.length;s++)(c!=null?e[s].seq==c:a&&e[s].name==a)&&(f=s);if(f<0){let s=0;for(;s<e.length&&(c==null||e[s].seq!=null&&e[s].seq<c);)s++;e.splice(s,0,{seq:c,name:a}),f=s;for(let d of i)d.field>=f&&d.field++}for(let s of i)if(s.line==n.length&&s.from>l.index){let d=l[2]?3+(l[1]||"").length:2;s.from-=d,s.to-=d}i.push(new H(f,n.length,l.index,l.index+a.length)),p=p.slice(0,l.index)+r+p.slice(l.index+l[0].length)}p=p.replace(/\\([{}])/g,(c,r,f)=>{for(let a of i)a.line==n.length&&a.from>f&&(a.from--,a.to--);return r}),n.push(p)}return new I(n,i)}}let K=g.widget({widget:new class extends R{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),N=g.mark({class:"cm-snippetField"});class m{constructor(t,e){this.ranges=t,this.active=e,this.deco=g.set(t.map(n=>(n.from==n.to?K:N).range(n.from,n.to)),!0)}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new m(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(n=>n.field==this.active&&n.from<=e.from&&n.to>=e.to))}}const h=x.define({map(o,t){return o&&o.map(t)}}),X=x.define(),u=D.define({create(){return null},update(o,t){for(let e of t.effects){if(e.is(h))return e.value;if(e.is(X)&&o)return new m(o.ranges,e.value)}return o&&t.docChanged&&(o=o.map(t.changes)),o&&t.selection&&!o.selectionInsideField(t.selection)&&(o=null),o},provide:o=>w.decorations.from(o,t=>t?t.deco:g.none)});function y(o,t){return k.create(o.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function J(o){let t=I.parse(o);return(e,n,i,l)=>{let{text:p,ranges:c}=t.instantiate(e.state,i),{main:r}=e.state.selection,f={changes:{from:i,to:l==r.from?r.to:l,insert:L.of(p)},scrollIntoView:!0,annotations:n?[q.of(n),T.userEvent.of("input.complete")]:void 0};if(c.length&&(f.selection=y(c,0)),c.some(a=>a.field>0)){let a=new m(c,0),s=f.effects=[h.of(a)];e.state.field(u,!1)===void 0&&s.push(x.appendConfig.of([u,Z,_,z]))}e.dispatch(e.state.update(f))}}function E(o){return({state:t,dispatch:e})=>{let n=t.field(u,!1);if(!n||o<0&&n.active==0)return!1;let i=n.active+o,l=o>0&&!n.ranges.some(p=>p.field==i+o);return e(t.update({selection:y(n.ranges,i),effects:h.of(l?null:new m(n.ranges,i)),scrollIntoView:!0})),!0}}const Q=({state:o,dispatch:t})=>o.field(u,!1)?(t(o.update({effects:h.of(null)})),!0):!1,U=E(1),Y=E(-1),G=[{key:"Tab",run:U,shift:Y},{key:"Escape",run:Q}],F=B.define({combine(o){return o.length?o[0]:G}}),Z=P.highest(M.compute([F],o=>o.facet(F)));function ie(o,t){return{...t,apply:J(o)}}const _=w.domEventHandlers({mousedown(o,t){let e=t.state.field(u,!1),n;if(!e||(n=t.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let i=e.ranges.find(l=>l.from<=n&&l.to>=n);return!i||i.field==e.active?!1:(t.dispatch({selection:y(e.ranges,i.field),effects:h.of(e.ranges.some(l=>l.field>i.field)?new m(e.ranges,i.field):null),scrollIntoView:!0}),!0)}}),C=new class extends V{};C.startSide=1;C.endSide=-1;export{te as C,ne as c,oe as i,ie as s};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as Se,E as v,C as be}from"./index-v7xV5kGw.js";import{I as he,s as Te,t as S,R as Pe,J as H,K as xe,L as Ve,q as ye,v as we,y as ve,a1 as Xe}from"./index-CzmdQnci.js";import{cssLanguage as K,css as $e}from"./index-s-iKxzP8.js";import{typescriptLanguage as qe,jsxLanguage as _e,tsxLanguage as Ce,javascriptLanguage as A,javascript as ke}from"./index-B3M2dqjT.js";import"./index-DkCVJgWk.js";const Qe=55,Ae=1,Ye=56,Me=2,Re=57,Ee=3,B=4,Ze=5,Y=6,J=7,ee=8,te=9,ae=10,Be=11,ze=12,De=13,X=58,We=14,Ne=15,z=59,le=21,Ge=23,re=24,Ie=25,k=27,ne=28,je=29,Ue=32,Le=35,Fe=37,He=38,Ke=0,Je=1,et={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},tt={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},D={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function at(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let W=null,N=null,G=0;function Q(e,a){let r=e.pos+a;if(G==r&&N==e)return W;let l=e.peek(a),t="";for(;at(l);)t+=String.fromCharCode(l),l=e.peek(++a);return N=e,G=r,W=t?t.toLowerCase():l==lt||l==rt?void 0:null}const se=60,w=62,M=47,lt=63,rt=33,nt=45;function I(e,a){this.name=e,this.parent=a}const st=[Y,ae,J,ee,te],ot=new be({start:null,shift(e,a,r,l){return st.indexOf(a)>-1?new I(Q(l,1)||"",e):e},reduce(e,a){return a==le&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==Y||t==Fe?new I(Q(l,1)||"",e):e},strict:!1}),it=new v((e,a)=>{if(e.next!=se){e.next<0&&a.context&&e.acceptToken(X);return}e.advance();let r=e.next==M;r&&e.advance();let l=Q(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ne:We);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(Be);if(t&&tt[t])return e.acceptToken(X,-2);if(a.dialectEnabled(Ke))return e.acceptToken(ze);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(De)}else{if(l=="script")return e.acceptToken(J);if(l=="style")return e.acceptToken(ee);if(l=="textarea")return e.acceptToken(te);if(et.hasOwnProperty(l))return e.acceptToken(ae);t&&D[t]&&D[t][l]?e.acceptToken(X,-1):e.acceptToken(Y)}},{contextual:!0}),ut=new v(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(z);break}if(e.next==nt)a++;else if(e.next==w&&a>=2){r>=3&&e.acceptToken(z,-2);break}else a=0;e.advance()}});function Ot(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const dt=new v((e,a)=>{if(e.next==M&&e.peek(1)==w){let r=a.dialectEnabled(Je)||Ot(a.context);e.acceptToken(r?Ze:B,2)}else e.next==w&&e.acceptToken(B,1)});function R(e,a,r){let l=2+e.length;return new v(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==se||s==1&&t.next==M||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==w){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const ct=R("script",Qe,Ae),pt=R("style",Ye,Me),mt=R("textarea",Re,Ee),ft=Te({"Text RawText IncompleteTag IncompleteCloseTag":S.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":S.angleBracket,TagName:S.tagName,"MismatchedCloseTag/TagName":[S.tagName,S.invalid],AttributeName:S.attributeName,"AttributeValue UnquotedAttributeValue":S.attributeValue,Is:S.definitionOperator,"EntityReference CharacterReference":S.character,Comment:S.blockComment,ProcessingInst:S.processingInstruction,DoctypeDecl:S.documentMeta}),gt=Se.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pO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!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:ot,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,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!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[ct,pt,mt,dt,it,ut,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function oe(e,a){let r=Object.create(null);for(let l of e.getChildren(re)){let t=l.getChild(Ie),s=l.getChild(k)||l.getChild(ne);t&&(r[a.read(t.from,t.to)]=s?s.type.id==k?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function j(e,a){let r=e.getChild(Ge);return r?a.read(r.from,r.to):" "}function $(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=oe(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ie(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return he((i,O)=>{let f=i.type.id;if(f==je)return $(i,O,r);if(f==Ue)return $(i,O,l);if(f==Le)return $(i,O,t);if(f==le&&s.length){let m=i.node,u=m.firstChild,c=u&&j(u,O),p;if(c){for(let d of s)if(d.tag==c&&(!d.attrs||d.attrs(p||(p=oe(u,O))))){let h=m.lastChild,b=h.type.id==He?h.from:m.to;if(b>u.to)return{parser:d.parser,overlay:[{from:u.to,to:b}]}}}}if(o&&f==re){let m=i.node,u;if(u=m.firstChild){let c=o[O.read(u.from,u.to)];if(c)for(let p of c){if(p.tagName&&p.tagName!=j(m.parent,O))continue;let d=m.lastChild;if(d.type.id==k){let h=d.from+1,b=d.lastChild,Z=d.to-(b&&b.isError?0:1);if(Z>h)return{parser:p.parser,overlay:[{from:h,to:Z}],bracketed:!0}}else if(d.type.id==ne)return{parser:p.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const x=["_blank","_self","_top","_parent"],q=["ascii","utf-8","utf-16","latin1","latin1"],_=["get","post","put","delete"],C=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},St={a:{attrs:{href:null,ping:null,type:null,media:null,target:x,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:x}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:C,formmethod:_,formnovalidate:["novalidate"],formtarget:x,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":q,autocomplete:["on","off"],enctype:C,method:_,novalidate:["novalidate"],target:x}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:C,formmethod:_,formnovalidate:["novalidate"],formtarget:x,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:q,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:q}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},ue={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Oe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of Oe)ue[e]=null;class V{constructor(a,r){this.tags={...St,...a},this.globalAttrs={...ue,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}V.default=new V;function T(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function P(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function de(e,a,r){let l=r.tags[T(e,P(a))];return l?.children||r.allTags}function E(e,a){let r=[];for(let l=P(a);l&&!l.type.isTop;l=P(l.parent)){let t=T(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const ce=/^[:\-\.\w\u00b7-\uffff]*$/;function U(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=P(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:de(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(E(e.doc,r).map((i,O)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-O}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function L(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:E(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:ce}}function bt(e,a,r,l){let t=[],s=0;for(let o of de(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of E(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function ht(e,a,r,l,t){let s=P(r),o=s?a.tags[T(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],O=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:O.map(f=>({label:f,type:"property"})),validFor:ce}}function Tt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],O;if(o){let f=e.sliceDoc(o.from,o.to),m=a.globalAttrs[f];if(!m){let u=P(r),c=u?a.tags[T(e.doc,u)]:null;m=c?.attrs&&c.attrs[f]}if(m){let u=e.sliceDoc(l,t).toLowerCase(),c='"',p='"';/^['"]/.test(u)?(O=u[0]=='"'?/^[^"]*$/:/^[^']*$/,c="",p=e.sliceDoc(t,t+1)==u[0]?"":u[0],u=u.slice(1),l++):O=/^[^\s<>='"]*$/;for(let d of m)i.push({label:d,apply:c+d+p,type:"constant"})}}return{from:l,to:t,options:i,validFor:O}}function pe(e,a){let{state:r,pos:l}=a,t=H(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let O=i.lastChild;if(!O||!O.type.isError||O.from<O.to)break;s=t=i,o=O.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?L(r,t,t.from,l):U(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?U(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?L(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?ht(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Tt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?bt(r,e,t,l):null}function _t(e){return pe(V.default,e)}function Pt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new V(a,r):V.default;return t=>pe(l,t)}const xt=A.parser.configure({top:"SingleExpression"}),me=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Ce.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:xt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:A.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:K.parser}],fe=[{name:"style",parser:K.parser.configure({top:"Styles"})}].concat(Oe.map(e=>({name:e,parser:A.parser}))),ge=ye.define({name:"html",parser:gt.configure({props:[we.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),ve.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),Xe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),y=ge.configure({wrap:ie(me,fe)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ie((e.nestedLanguages||[]).concat(me),(e.nestedAttributes||[]).concat(fe)));let l=r?ge.configure({wrap:r,dialect:a}):a?y.configure({dialect:a}):y;return new Ve(l,[y.data.of({autocomplete:Pt(e)}),e.autoCloseTags!==!1?yt:[],ke().support,$e().support])}const F=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));function Vt(e,a,r){for(var l;;){if(((l=a.lastChild)===null||l===void 0?void 0:l.name)!="CloseTag")return!1;let t=a.parent;if(!t||T(e,t)!=r)return!0;a=t}}const yt=Pe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!y.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(O=>{var f;let m=o.doc.sliceString(O.from-1,O.to)==l,{head:u}=O,c=H(o).resolveInner(u,-1),p;if(m&&l==">"&&c.name=="EndTag"){let d=c.parent;if((p=T(o.doc,d.parent,u))&&!F.has(p)&&!Vt(o.doc,d.parent,p)){let h=u+(o.doc.sliceString(u,u+1)===">"?1:0),b=`</${p}>`;return{range:O,changes:{from:u,to:h,insert:b}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let d=c.parent;if(c.from==u-2&&((f=d.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=T(o.doc,d,u))&&!F.has(p)){let h=u+(o.doc.sliceString(u,u+1)===">"?1:0),b=`${p}>`;return{range:xe.cursor(u+b.length,-1),changes:{from:u,to:h,insert:b}}}}return{range:O}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,_t as htmlCompletionSource,Pt as htmlCompletionSourceWith,y as htmlLanguage};
|
|
1
|
+
import{L as Se,E as v,C as be}from"./index-KlpztsHG.js";import{I as he,s as Te,t as S,R as Pe,J as H,K as xe,L as Ve,q as ye,v as we,y as ve,a1 as Xe}from"./index-SFoAoPT0.js";import{cssLanguage as K,css as $e}from"./index-R8QroxO7.js";import{typescriptLanguage as qe,jsxLanguage as _e,tsxLanguage as Ce,javascriptLanguage as A,javascript as ke}from"./index-D6_PH-_4.js";import"./index-BNlnNuDG.js";const Qe=55,Ae=1,Ye=56,Me=2,Re=57,Ee=3,B=4,Ze=5,Y=6,J=7,ee=8,te=9,ae=10,Be=11,ze=12,De=13,X=58,We=14,Ne=15,z=59,le=21,Ge=23,re=24,Ie=25,k=27,ne=28,je=29,Ue=32,Le=35,Fe=37,He=38,Ke=0,Je=1,et={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},tt={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},D={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function at(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let W=null,N=null,G=0;function Q(e,a){let r=e.pos+a;if(G==r&&N==e)return W;let l=e.peek(a),t="";for(;at(l);)t+=String.fromCharCode(l),l=e.peek(++a);return N=e,G=r,W=t?t.toLowerCase():l==lt||l==rt?void 0:null}const se=60,w=62,M=47,lt=63,rt=33,nt=45;function I(e,a){this.name=e,this.parent=a}const st=[Y,ae,J,ee,te],ot=new be({start:null,shift(e,a,r,l){return st.indexOf(a)>-1?new I(Q(l,1)||"",e):e},reduce(e,a){return a==le&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==Y||t==Fe?new I(Q(l,1)||"",e):e},strict:!1}),it=new v((e,a)=>{if(e.next!=se){e.next<0&&a.context&&e.acceptToken(X);return}e.advance();let r=e.next==M;r&&e.advance();let l=Q(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ne:We);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(Be);if(t&&tt[t])return e.acceptToken(X,-2);if(a.dialectEnabled(Ke))return e.acceptToken(ze);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(De)}else{if(l=="script")return e.acceptToken(J);if(l=="style")return e.acceptToken(ee);if(l=="textarea")return e.acceptToken(te);if(et.hasOwnProperty(l))return e.acceptToken(ae);t&&D[t]&&D[t][l]?e.acceptToken(X,-1):e.acceptToken(Y)}},{contextual:!0}),ut=new v(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(z);break}if(e.next==nt)a++;else if(e.next==w&&a>=2){r>=3&&e.acceptToken(z,-2);break}else a=0;e.advance()}});function Ot(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const dt=new v((e,a)=>{if(e.next==M&&e.peek(1)==w){let r=a.dialectEnabled(Je)||Ot(a.context);e.acceptToken(r?Ze:B,2)}else e.next==w&&e.acceptToken(B,1)});function R(e,a,r){let l=2+e.length;return new v(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==se||s==1&&t.next==M||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==w){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const ct=R("script",Qe,Ae),pt=R("style",Ye,Me),mt=R("textarea",Re,Ee),ft=Te({"Text RawText IncompleteTag IncompleteCloseTag":S.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":S.angleBracket,TagName:S.tagName,"MismatchedCloseTag/TagName":[S.tagName,S.invalid],AttributeName:S.attributeName,"AttributeValue UnquotedAttributeValue":S.attributeValue,Is:S.definitionOperator,"EntityReference CharacterReference":S.character,Comment:S.blockComment,ProcessingInst:S.processingInstruction,DoctypeDecl:S.documentMeta}),gt=Se.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO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Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:ot,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[ft],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)es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=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[ct,pt,mt,dt,it,ut,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function oe(e,a){let r=Object.create(null);for(let l of e.getChildren(re)){let t=l.getChild(Ie),s=l.getChild(k)||l.getChild(ne);t&&(r[a.read(t.from,t.to)]=s?s.type.id==k?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function j(e,a){let r=e.getChild(Ge);return r?a.read(r.from,r.to):" "}function $(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=oe(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ie(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return he((i,O)=>{let f=i.type.id;if(f==je)return $(i,O,r);if(f==Ue)return $(i,O,l);if(f==Le)return $(i,O,t);if(f==le&&s.length){let m=i.node,u=m.firstChild,c=u&&j(u,O),p;if(c){for(let d of s)if(d.tag==c&&(!d.attrs||d.attrs(p||(p=oe(u,O))))){let h=m.lastChild,b=h.type.id==He?h.from:m.to;if(b>u.to)return{parser:d.parser,overlay:[{from:u.to,to:b}]}}}}if(o&&f==re){let m=i.node,u;if(u=m.firstChild){let c=o[O.read(u.from,u.to)];if(c)for(let p of c){if(p.tagName&&p.tagName!=j(m.parent,O))continue;let d=m.lastChild;if(d.type.id==k){let h=d.from+1,b=d.lastChild,Z=d.to-(b&&b.isError?0:1);if(Z>h)return{parser:p.parser,overlay:[{from:h,to:Z}],bracketed:!0}}else if(d.type.id==ne)return{parser:p.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const x=["_blank","_self","_top","_parent"],q=["ascii","utf-8","utf-16","latin1","latin1"],_=["get","post","put","delete"],C=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},St={a:{attrs:{href:null,ping:null,type:null,media:null,target:x,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:x}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:C,formmethod:_,formnovalidate:["novalidate"],formtarget:x,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":q,autocomplete:["on","off"],enctype:C,method:_,novalidate:["novalidate"],target:x}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:C,formmethod:_,formnovalidate:["novalidate"],formtarget:x,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:q,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:q}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},ue={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Oe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of Oe)ue[e]=null;class V{constructor(a,r){this.tags={...St,...a},this.globalAttrs={...ue,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}V.default=new V;function T(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function P(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function de(e,a,r){let l=r.tags[T(e,P(a))];return l?.children||r.allTags}function E(e,a){let r=[];for(let l=P(a);l&&!l.type.isTop;l=P(l.parent)){let t=T(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const ce=/^[:\-\.\w\u00b7-\uffff]*$/;function U(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=P(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:de(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(E(e.doc,r).map((i,O)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-O}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function L(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:E(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:ce}}function bt(e,a,r,l){let t=[],s=0;for(let o of de(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of E(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function ht(e,a,r,l,t){let s=P(r),o=s?a.tags[T(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],O=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:O.map(f=>({label:f,type:"property"})),validFor:ce}}function Tt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],O;if(o){let f=e.sliceDoc(o.from,o.to),m=a.globalAttrs[f];if(!m){let u=P(r),c=u?a.tags[T(e.doc,u)]:null;m=c?.attrs&&c.attrs[f]}if(m){let u=e.sliceDoc(l,t).toLowerCase(),c='"',p='"';/^['"]/.test(u)?(O=u[0]=='"'?/^[^"]*$/:/^[^']*$/,c="",p=e.sliceDoc(t,t+1)==u[0]?"":u[0],u=u.slice(1),l++):O=/^[^\s<>='"]*$/;for(let d of m)i.push({label:d,apply:c+d+p,type:"constant"})}}return{from:l,to:t,options:i,validFor:O}}function pe(e,a){let{state:r,pos:l}=a,t=H(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let O=i.lastChild;if(!O||!O.type.isError||O.from<O.to)break;s=t=i,o=O.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?L(r,t,t.from,l):U(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?U(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?L(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?ht(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Tt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?bt(r,e,t,l):null}function _t(e){return pe(V.default,e)}function Pt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new V(a,r):V.default;return t=>pe(l,t)}const xt=A.parser.configure({top:"SingleExpression"}),me=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Ce.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:xt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:A.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:K.parser}],fe=[{name:"style",parser:K.parser.configure({top:"Styles"})}].concat(Oe.map(e=>({name:e,parser:A.parser}))),ge=ye.define({name:"html",parser:gt.configure({props:[we.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),ve.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),Xe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),y=ge.configure({wrap:ie(me,fe)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ie((e.nestedLanguages||[]).concat(me),(e.nestedAttributes||[]).concat(fe)));let l=r?ge.configure({wrap:r,dialect:a}):a?y.configure({dialect:a}):y;return new Ve(l,[y.data.of({autocomplete:Pt(e)}),e.autoCloseTags!==!1?yt:[],ke().support,$e().support])}const F=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));function Vt(e,a,r){for(var l;;){if(((l=a.lastChild)===null||l===void 0?void 0:l.name)!="CloseTag")return!1;let t=a.parent;if(!t||T(e,t)!=r)return!0;a=t}}const yt=Pe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!y.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(O=>{var f;let m=o.doc.sliceString(O.from-1,O.to)==l,{head:u}=O,c=H(o).resolveInner(u,-1),p;if(m&&l==">"&&c.name=="EndTag"){let d=c.parent;if((p=T(o.doc,d.parent,u))&&!F.has(p)&&!Vt(o.doc,d.parent,p)){let h=u+(o.doc.sliceString(u,u+1)===">"?1:0),b=`</${p}>`;return{range:O,changes:{from:u,to:h,insert:b}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let d=c.parent;if(c.from==u-2&&((f=d.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=T(o.doc,d,u))&&!F.has(p)){let h=u+(o.doc.sliceString(u,u+1)===">"?1:0),b=`${p}>`;return{range:xe.cursor(u+b.length,-1),changes:{from:u,to:h,insert:b}}}}return{range:O}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,_t as htmlCompletionSource,Pt as htmlCompletionSourceWith,y as htmlLanguage};
|
|
Binary file
|
|
Binary file
|