1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11325,41285,63666],{3422:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},11325:(e,t,n)=>{n.r(t),n.d(t,{default:()=>H});var a=n(95818),r=n(16418),o=n(72888),l=n(82198),i=n(71082),d=n(34713),s=n(3422);let c=(0,n(41285).A)("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);var u=n(41102),m=n(8044),p=n(21448),h=n(32755),g=n(98338),b=n(20449),f=n(8480),y=n(59022),x=n(41447),k=n(85431);n(24782);var w=n(64097),v=n(61073),C=n(17823),N=n(28008);function j(e){return 48+20*Math.max(1,Math.ceil(Math.max(e.length,1)/20))}function D(e,t,n,a){let r={id:function(e,t){let n=e.trim();if(!n||"root"===n||t.has(n)){let e=1;for(;t.has("mm-".concat(e));)e+=1;n="mm-".concat(e)}return t.add(n),n}(e.id,a),label:e.label,depth:n,side:t,boxH:j(e.label),span:0,children:[]};return r.children=e.children.map(e=>D(e,t,n+1,a)),r}function S(e){return 0===e.length?0:e.reduce((e,t,n)=>e+t.span+18*(n>0),0)}function A(e){for(let t of e.children)A(t);e.span=Math.max(e.boxH,S(e.children))}function P(e,t,n,a,r){let o=t;for(let t=0;t<e.length;t+=1){t>0&&(o+=18);let l=e[t];!function e(t,n,a,r,o){if(a.push({id:t.id,type:"mind",position:{x:"left"===t.side?-(300*t.depth):300*t.depth,y:n+(t.span-t.boxH)/2},data:{label:t.label,depth:t.depth}}),o){let e={id:"e-".concat(o,"-").concat(t.id),source:o,target:t.id,type:"smoothstep"};"left"===t.side&&(e.sourceHandle="src-left",e.targetHandle="tgt-right"),r.push(e)}let l=S(t.children),i=n+(t.span-l)/2;for(let n of t.children)e(n,i,a,r,t.id),i+=n.span+18}(l,o,n,a,r),o+=l.span}}var E=n(97350),M=n(64893);let R=(0,r.createContext)(null),U=["border-primary bg-primary/15 text-primary","border-border bg-card text-foreground","border-border bg-background text-foreground","border-muted-foreground/40 bg-background text-muted-foreground"];function I(e){return"undefined"!=typeof crypto&&"randomUUID"in crypto?"".concat(e,"-").concat(crypto.randomUUID()):"".concat(e,"-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8))}let L=[{id:"root",type:"mind",position:{x:60,y:160},data:{label:"\xdd tưá»ng ch\xednh",depth:0}},{id:"c1",type:"mind",position:{x:320,y:40},data:{label:"Nh\xe1nh A",depth:1}},{id:"c2",type:"mind",position:{x:320,y:160},data:{label:"Nh\xe1nh B",depth:1}},{id:"c3",type:"mind",position:{x:320,y:280},data:{label:"Nh\xe1nh C",depth:1}}],T=[{id:"e-root-c1",source:"root",target:"c1",type:"smoothstep"},{id:"e-root-c2",source:"root",target:"c2",type:"smoothstep"},{id:"e-root-c3",source:"root",target:"c3",type:"smoothstep"}];function B(e){let{nodeId:t,canDelete:n,onClose:o,className:l}=e,i=(0,r.useContext)(R);if(!i||i.readOnly)return null;let d=e=>{e(),o()},p="flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition hover:bg-accent";return(0,a.jsxs)("div",{className:"z-50 min-w-[180px] rounded-xl border border-border bg-popover p-1.5 shadow-lg ".concat(null!=l?l:""),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("button",{type:"button",className:p,onClick:()=>d(()=>i.requestEdit(t)),children:[(0,a.jsx)(s.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Sá»a nh\xe3n"]}),(0,a.jsxs)("button",{type:"button",className:p,onClick:()=>d(()=>i.addChild(t)),children:[(0,a.jsx)(c,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Th\xeam nh\xe1nh con"]}),(0,a.jsxs)("button",{type:"button",className:p,onClick:()=>d(()=>i.duplicate(t)),children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Nh\xe2n bản"]}),(0,a.jsx)("div",{className:"my-1 border-t border-border"}),(0,a.jsxs)("button",{type:"button",disabled:!n,className:"".concat(p," text-destructive disabled:cursor-not-allowed disabled:opacity-40"),onClick:()=>{n&&d(()=>i.remove(t))},children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),"Xo\xe1 nh\xe1nh"]})]})}let W={mind:function(e){let{id:t,data:n,selected:l}=e,{setNodes:i}=(0,o.VH)(),d=(0,r.useContext)(R),h=(0,o.Pj)(e=>e.nodesDraggable),[g,b]=(0,r.useState)(!1),[f,y]=(0,r.useState)(n.label),[x,k]=(0,r.useState)(!1),w=(0,r.useRef)(null),v=U[Math.min(n.depth,U.length-1)],C="root"!==t;(0,r.useEffect)(()=>{g||y(n.label)},[n.label,g]),(0,r.useEffect)(()=>
1{if(!g)return;let e=window.requestAnimationFrame(()=>{var e,t;null===(e=w.current)||void 0===e||e.focus(),null===(t=w.current)||void 0===t||t.select()});return()=>window.cancelAnimationFrame(e)},[g]),(0,r.useEffect)(()=>{!h&&g&&b(!1)},[h,g]),(0,r.useEffect)(()=>{l||k(!1)},[l]),(0,r.useEffect)(()=>{let e=e=>{e.detail===t&&h&&(y(n.label),b(!0),k(!1))};return window.addEventListener("mindmap-edit-node",e),()=>window.removeEventListener("mindmap-edit-node",e)},[n.label,h,t]);let N=(0,r.useCallback)(e=>{let a=e.trim()||n.label;i(e=>e.map(e=>e.id===t?{...e,data:{...e.data,label:a}}:e)),b(!1)},[n.label,t,i]);return(0,a.jsxs)("div",{className:"relative w-max min-w-[150px] max-w-[240px] rounded-2xl border px-4 py-3 text-center shadow-sm ".concat(v," ").concat(l?"ring-2 ring-primary":""),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),h&&(y(n.label),b(!0),k(!1))},children:[(0,a.jsx)(o.h7,{type:"target",position:o.yX.Left,className:"!h-2.5 !w-2.5 !border-2 !border-background !bg-primary"}),(0,a.jsx)(o.h7,{type:"source",position:o.yX.Right,className:"!h-2.5 !w-2.5 !border-2 !border-background !bg-primary"}),(0,a.jsx)(o.h7,{id:"src-left",type:"source",position:o.yX.Left,isConnectable:!1,className:"!h-2 !w-2 !opacity-0"}),(0,a.jsx)(o.h7,{id:"tgt-right",type:"target",position:o.yX.Right,isConnectable:!1,className:"!h-2 !w-2 !opacity-0"}),h&&!g?(0,a.jsx)("button",{type:"button",title:"Menu h\xe0nh Äá»ng",className:"nodrag nopan nokey absolute right-1.5 top-1.5 rounded-md p-1 text-muted-foreground transition hover:bg-background/80 hover:text-foreground",onClick:e=>{e.preventDefault(),e.stopPropagation(),k(e=>!e)},children:(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"})}):null,x?(0,a.jsx)("div",{className:"nodrag nopan nokey absolute right-0 top-8 z-50",children:(0,a.jsx)(B,{nodeId:t,canDelete:C,onClose:()=>k(!1)})}):null,g?(0,a.jsx)("input",{ref:w,value:f,onChange:e=>y(e.target.value),onBlur:()=>N(f),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),N(f)),"Escape"===e.key&&(e.preventDefault(),y(n.label),b(!1))},className:"rounded-lg border border-border bg-background nodrag nopan nokey w-full rounded-md border border-primary bg-background px-2 py-1 text-center text-sm font-semibold text-foreground outline-none"}):(0,a.jsx)("p",{className:"break-words pr-5 text-sm font-semibold leading-snug",children:n.label}),(0,a.jsxs)("p",{className:"mt-0.5 text-[9px] leading-none opacity-55",children:["Cấp ",n.depth]}),(null==d?void 0:d.readOnly)||!l||g||x?null:(0,a.jsxs)("div",{className:"nodrag nopan nokey mt-2 flex items-center justify-center gap-1 border-t border-border/60 pt-2",children:[(0,a.jsx)("button",{type:"button",title:"Sá»a nh\xe3n",className:"rounded-md p-1.5 text-muted-foreground hover:bg-background/80 hover:text-foreground",onClick:e=>{e.stopPropagation(),null==d||d.requestEdit(t)},children:(0,a.jsx)(s.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{type:"button",title:"Th\xeam nh\xe1nh con",className:"rounded-md p-1.5 text-muted-foreground hover:bg-background/80 hover:text-foreground",onClick:e=>{e.stopPropagation(),null==d||d.addChild(t)},children:(0,a.jsx)(c,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{type:"button",title:"Nh\xe2n bản",className:"rounded-md p-1.5 text-muted-foreground hover:bg-background/80 hover:text-foreground",onClick:e=>{e.stopPropagation(),null==d||d.duplicate(t)},children:(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{type:"button",title:"Xo\xe1 nh\xe1nh",disabled:!C,className:"rounded-md p-1.5 text-destructive hover:bg-destructive/10 disabled:opacity-30",onClick:e=>{e.stopPropagation(),C&&(null==d||d.remove(t))},children:(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})})]})]})}},O={type:"smoothstep"},q={hideAttribution:!0};function K(e){let{value:t,children:n}=e;return(0,a.jsx)(R.Provider,{value:t,children:n})}function F(){var e;let[t,s]=(0,r.useState)(L),[u,p]=(0,r.useState)(T),[R,U]=(0,r.useState)("root"),[F,H]=(0,r.useState)(!1),[_,G]=(0,r.useState)(!1),[z,V]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(null),[Q,$]=(0,r.useState)(null),[ee,et]=(0,r.useState)("Mindmap cá»§a t\xf4i"),[en,ea]=(0,r.useState)(!1),er=(0,r.useRef)(null),eo=(0,r.useRef)(null),el=(0,r.useRef)(null),[ei,ed]=(0,r.useState)(0),{fitView:es}=(0,o.VH)(),ec=(0,r.useMemo)(()=>{var e;return null!==(e=t.find(e=>e.id===R))&&void 0!==e?e:null},[t,R]);(0,C.B)((0,r.useMemo)(()=>({nodes:t,edges:u}),[t,u]),e=>{var t;(null===(t=e.nodes)||void 0===t?void 0:t.length)&&s(e.nodes),e.edges&&p(e.edges)},X),(0,r.useEffect)(()=>{let e=new URLSearchParams(window.location.search);if(e.get("dapp")&&"mindmap"!==e.get("dapp"))return;let t=(0,M.hn)();if(t){(0,M.$I)(t).then(t=>{var n;if("mindmap"!==t.diagram.kind)return;let a=t.diagram.payload.nodes||[];$(t.diagram.id),et(t.diagram.title),s(a.length?a:L),p(t.diagram.payload.edges||[]),Y("view"===t.share.mode||"view"===e.get("dmode")),U((null===(n=a[0])||void 0===n?void 0:n.id)||"root")}).catch(e=>{E.W.error(e.message||"Link chia sẻ kh\xf4ng khả dụng.")});return}let n=(0,M.Qc)();if(n){(0,M.Bl)(n).then(e=>{var t;if("mindmap"!==e.kind)return;let n=e.payload.nodes||[];0!==n.length&&($(e.id),et(e.title),s(n),p(e.payload.edges||[]),U((null===(t=n[0])||void 0===t?void 0:t.id)||"root"))}).catch(e=>{e.needsAuth?(0,M.gI)():E.W.error(e.message||"Kh\xf4ng tải ÄÆ°á»£c diagram.")});return}let a=e.get("d");if(!a)return;let r=(0,w.xL)(a);r&&"mindmap"===r.kind&&r.flow&&(s(r.flow.nodes),p(r.flow.edges),("view"===r.mode||"view"===e.get("dmode"))&&Y(!0))},[]),(0,r.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void es({padding:.25}));return()=>window.cancelAnimationFrame(e)},[es]),(0,r.useEffect)(()=>
1{if(!ei)return;let e=window.requestAnimationFrame(()=>void es({padding:.18,duration:180}));return()=>window.cancelAnimationFrame(e)},[ei,es]),(0,r.useEffect)(()=>{if(!Z)return;let e=()=>J(null),t=t=>{"Escape"===t.key&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",t)}},[Z]);let eu=(0,r.useCallback)(e=>{s(t=>(0,o._0)(e,t))},[]),em=(0,r.useCallback)(e=>{p(t=>(0,o.zW)(e,t))},[]),ep=(0,r.useCallback)(e=>{p(t=>(0,o.rN)({...e,id:I("edge"),type:"smoothstep"},t))},[]),eh=(0,r.useCallback)(e=>{if(X)return;let n=t.find(t=>t.id===e);if(!n)return;let a=n.data.depth+1,r=I("mind"),o=u.filter(e=>e.source===n.id).length,l={x:n.position.x+240,y:n.position.y+(o-1)*90},i="\xdd ".concat(a,".").concat(o+1);s(e=>[...e.map(e=>({...e,selected:!1})),{id:r,type:"mind",position:l,data:{label:i,depth:a},selected:!0}]),p(e=>[...e,{id:I("edge"),source:n.id,target:r,type:"smoothstep"}]),U(r)},[u,t,X]),eg=(0,r.useCallback)(()=>{if(X)return;let e=t.filter(e=>0===e.data.depth).length,n=I("mind"),a={x:60+40*e,y:120+40*e};s(t=>[...t.map(e=>({...e,selected:!1})),{id:n,type:"mind",position:a,data:{label:"Chá»§ Äá» ".concat(e+1),depth:0},selected:!0}]),U(n),window.setTimeout(()=>{var e;return null===(e=er.current)||void 0===e?void 0:e.focus()},0)},[t,X]),eb=(0,r.useCallback)(e=>{if(X)return;let n=t.find(t=>t.id===e);if(!n)return;let a=u.find(t=>t.target===e),r=I("mind"),o={id:r,type:"mind",position:{x:n.position.x+24,y:n.position.y+72},data:{label:"".concat(n.data.label," (copy)"),depth:n.data.depth},selected:!0};s(e=>[...e.map(e=>({...e,selected:!1})),o]),a&&p(e=>[...e,{id:I("edge"),source:a.source,target:r,type:"smoothstep"}]),U(r)},[u,t,X]),ef=(0,r.useCallback)(e=>{if(X||"root"===e)return;let t=function(e,t){let n=new Set([e]),a=!0;for(;a;)for(let e of(a=!1,t))n.has(e.source)&&!n.has(e.target)&&(n.add(e.target),a=!0);return n}(e,u);s(e=>e.filter(e=>!t.has(e.id))),p(e=>e.filter(e=>!t.has(e.source)&&!t.has(e.target))),U("root"),J(null)},[u,X]),ey=(0,r.useCallback)(e=>{X||(U(e),window.dispatchEvent(new CustomEvent("mindmap-edit-node",{detail:e})))},[X]),ex=(0,r.useCallback)(e=>{R&&!X&&s(t=>t.map(t=>t.id===R?{...t,data:{...t.data,label:e}}:t))},[R,X]),ek=(0,r.useCallback)(async()=>{try{let{requireDiagramEditShare:e}=await n.e(71755).then(n.bind(n,71755));await e()}catch(e){E.W.error(e instanceof Error?e.message:"Cần g\xf3i Pro.");return}let e=(0,w.sZ)({app:"mindmap",payload:{v:1,kind:"mindmap",mode:"edit",flow:{nodes:t,edges:u}}});try{await navigator.clipboard.writeText(e)}catch(n){let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}H(!0),window.setTimeout(()=>H(!1),1800)},[t,u]),ew=(0,r.useCallback)(async()=>{if(!X&&!_){G(!0);try{await (0,v.SG)({diagramId:Q,title:ee,kind:"mindmap",payload:{nodes:t,edges:u},onSaved:e=>{$(e.id),et(e.title)}})}finally{G(!1)}}},[Q,ee,u,_,t,X]),ev=(0,r.useCallback)(async()=>{if(!X&&!z){V(!0);try{await (0,v.Jc)({diagramId:Q,title:ee,kind:"mindmap",payload:{nodes:t,edges:u},onSaved:e=>{$(e.id),et(e.title)}})}finally{V(!1)}}},[Q,ee,u,t,X,z]),eC=(0,r.useCallback)(async e=>{let t=eo.current;if(!t)return;let n=t.querySelector(".react-flow__viewport");if(!(n instanceof HTMLElement)){E.W.warning("Chưa sẵn s\xe0ng xuất ảnh.");return}try{let a=getComputedStyle(t).backgroundColor||"#ffffff",r="png"===e?await (0,k.toPng)(n,{backgroundColor:a,cacheBust:!0,pixelRatio:2}):await (0,k.YI)(n,{backgroundColor:a,cacheBust:!0});(0,N.Kh)("mindmap-".concat(Date.now(),".").concat(e),r)}catch(e){E.W.error(e instanceof Error?e.message:"Kh\xf4ng xuất ÄÆ°á»£c ảnh.")}},[]),eN=(0,r.useCallback)(async()=>{if(X||en)return;let e=ee;if(!Q){let t=await (0,M.ap)(ee);if(!t)return;e=t,et(t)}ea(!0);try{let n=await (0,M.Vm)({id:Q,title:e,kind:"mindmap",payload:{nodes:t,edges:u}});$(n.id),et(n.title),(0,M.lx)(n.id,"mindmap"),E.W.success(Q?"Ä\xe3 cáºp nháºt diagram.":"Ä\xe3 lưu diagram.")}catch(e){if(e.needsAuth){(0,M.gI)();return}E.W.error(e.message||"Kh\xf4ng lưu ÄÆ°á»£c diagram.")}finally{ea(!1)}},[Q,ee,u,t,X,en]),ej=(0,r.useCallback)(async e=>{if(X)return;let t=e.name.toLowerCase();if(!t.endsWith(".mm")&&!t.endsWith(".xml")){E.W.error("Chá» nháºn file .mm.");return}if(e.size>2097152){E.W.error("File .mm vượt 2MB.");return}try{let t=function(e){let t=function(e){let t=e.replace(/^\uFEFF/,"").replace(/<!--[\s\S]*?-->/g,"");if(!t.trim())throw Error("File .mm kh\xf4ng c\xf3 ná»i dung.");if(t.length>2e6)throw Error("File .mm vượt 2MB.");if(!/<map\b/i.test(t))throw Error("File .mm kh\xf4ng Ä\xfang Äá»nh dạng.");let n=[],a=[n];for(let e of t.matchAll(/<node\b([^>]*)>|<\/node\s*>/gi)){var r,o,l,i;if(e[0].startsWith("</")){a.length>1&&a.pop();continue}let t=(null!==(o=e[1])&&void 0!==o?o:"").trim(),n=t.endsWith("/");n&&(t=t.slice(0,-1).trim());let d=function(e){let t={};for(let r of e.matchAll(/([A-Za-z_][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g)){var n,a;t[r[1].toUpperCase()]=(null!==(a=null!==(n=r[2])&&void 0!==n?n:r[3])&&void 0!==a?a:"").replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>
1String.fromCodePoint(Number.parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,10))).replace(/ /g," ").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}return t}(t),s=null===(r=d.POSITION)||void 0===r?void 0:r.toLowerCase(),c={id:(null!==(l=d.ID)&&void 0!==l?l:"").trim(),label:(null!=(i=d.TEXT)?i:"").replace(/\s+/g," ").trim().slice(0,800)||"(trá»ng)",position:"left"===s||"right"===s?s:void 0,children:[]};a[a.length-1].push(c),n||a.push(c.children)}if(0===n.length)throw Error("File .mm kh\xf4ng c\xf3 node.");let d=1===n.length?n[0]:{id:"root",label:"Mindmap",children:n};if(function e(t){return 1+t.children.reduce((t,n)=>t+e(n),0)}(d)>2e3)throw Error("File .mm qu\xe1 lá»n (tá»i Äa ".concat(2e3," node)."));return d}(e),n=new Set(["root"]),a=t.children.filter(e=>"left"!==e.position).map(e=>D(e,"right",1,n)),r=t.children.filter(e=>"left"===e.position).map(e=>D(e,"left",1,n));for(let e of a)A(e);for(let e of r)A(e);let o=j(t.label),l=S(a),i=S(r),d=Math.max(o,l,i),s=[{id:"root",type:"mind",position:{x:0,y:(d-o)/2},data:{label:t.label,depth:0}}],c=[];return a.length>0&&P(a,(d-l)/2,s,c,"root"),r.length>0&&P(r,(d-i)/2,s,c,"root"),{title:t.label.slice(0,120),nodes:s,edges:c}}(await e.text());s(t.nodes.map(e=>({...e,selected:"root"===e.id}))),p(t.edges),U("root"),J(null),Q||et(t.title),ed(e=>e+1),E.W.success("Ä\xe3 nháºp ".concat(t.nodes.length," node."))}catch(e){E.W.error(e instanceof Error?e.message:"Kh\xf4ng Äá»c ÄÆ°á»£c file .mm.")}},[Q,X]),eD=(0,r.useMemo)(()=>({readOnly:X,requestEdit:ey,addChild:eh,duplicate:eb,remove:ef}),[X,ey,eh,eb,ef]),eS=(0,r.useCallback)((e,t)=>{var n;if(X)return;e.preventDefault(),U(t);let a=null===(n=eo.current)||void 0===n?void 0:n.getBoundingClientRect();J({x:a?e.clientX-a.left:e.clientX,y:a?e.clientY-a.top:e.clientY,nodeId:t})},[X]);return(0,a.jsx)(K,{value:eD,children:(0,a.jsxs)("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[720px] w-full flex-col overflow-hidden rounded-lg border border-border bg-card",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-background p-3",children:[(0,a.jsxs)("button",{type:"button",disabled:X,onClick:eg,className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-40",children:[(0,a.jsx)(h.A,{className:"h-4 w-4"}),"Th\xeam node gá»c"]}),(0,a.jsxs)("button",{type:"button",disabled:X||!ec,onClick:()=>ec&&eh(ec.id),className:"inline-flex items-center gap-2 rounded-lg border border-primary bg-accent px-3 py-2 text-sm font-medium text-primary hover:bg-primary/20 disabled:opacity-40",children:[(0,a.jsx)(c,{className:"h-4 w-4"}),"Th\xeam nh\xe1nh con"]}),(0,a.jsxs)("button",{type:"button",disabled:X||!R||"root"===R,onClick:()=>R&&ef(R),className:"inline-flex items-center gap-2 rounded-lg border border-border bg-destructive px-3 py-2 text-sm font-medium text-destructive-foreground disabled:opacity-40",children:[(0,a.jsx)(m.A,{className:"h-4 w-4"}),"Xo\xe1 nh\xe1nh"]}),(0,a.jsxs)("button",{type:"button",disabled:X||en,onClick:()=>void eN(),className:"inline-flex items-center gap-2 rounded-lg border border-primary bg-accent px-3 py-2 text-sm font-medium text-primary disabled:opacity-40",children:[(0,a.jsx)(g.A,{className:"h-4 w-4"}),en?"Äang lưuâ¦":Q?"Cáºp nháºt":"Lưu"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void ek(),className:"inline-flex items-center gap-2 rounded-lg border border-primary bg-accent px-3 py-2 text-sm font-medium text-primary",children:[F?(0,a.jsx)(b.A,{className:"h-4 w-4"}):(0,a.jsx)(f.A,{className:"h-4 w-4"}),F?"Ä\xe3 copy link":"Share link"]}),(0,a.jsxs)("button",{type:"button",disabled:X||z,onClick:()=>void ev(),className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-40",children:[(0,a.jsx)(f.A,{className:"h-4 w-4"}),z?"Äang tạoâ¦":"Link xem"]}),(0,a.jsxs)("button",{type:"button",disabled:X||_,onClick:()=>void ew(),className:"inline-flex items-center gap-2 rounded-lg border border-primary bg-primary/15 px-3 py-2 text-sm font-medium text-primary disabled:opacity-40",children:[(0,a.jsx)(f.A,{className:"h-4 w-4"}),_?"Äang tạoâ¦":"Link sá»a"]}),(0,a.jsxs)("button",{type:"button",disabled:X,title:"Nháºp file .mm (FreeMind)",onClick:()=>{var e;return null===(e=el.current)||void 0===e?void 0:e.click()},className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-40",children:[(0,a.jsx)(y.A,{className:"h-4 w-4"}),"Nháºp .mm"]}),(0,a.jsx)("input",{ref:el,type:"file",accept:".mm,.xml,text/xml,application/xml",className:"hidden",onChange:e=>{var t;let n=null===(t=e.target.files)||void 0===t?void 0:t[0];e.target.value="",n&&ej(n)}}),(0,a.jsxs)("button",{type:"button",onClick:()=>void eC("png"),className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground hover:bg-accent",children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"PNG"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void eC("svg"),className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground hover:bg-accent",children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"SVG"]}),Q?(0,a.jsx)("span",{className:"max-w-[140px] truncate text-xs text-muted-foreground",title:ee,children:ee}):null,X?(0,a.jsx)("button",{type:"button",onClick:()=>Y(!1),className:"rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground",children:"Sá»a tiếp"}):null,(0,a.jsxs)("div",{className:"ml-auto flex min-w-[220px] flex-1 items-center gap-2 rounded-lg border border-border bg-card px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Nh\xe3n"}),(0,a.jsx)("input",{ref:er,value:null!==(e=null==ec?void 0:ec.data.label)&&void 0!==e?e:"",onChange:e=>ex(e.target.value),onKeyDown:e=>e.stopPropagation(),placeholder:"Chá»n node hoặc double-click tr\xean node",disabled:!R||X,className:"nokey nodrag nopan w-full bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"})]})]}),(0,a.jsxs)("div",{ref:eo,className:"relative min-h-0 flex-1 bg-background",children:[(0,a.jsxs)(o.Gc,{nodes:t,edges:u,nodeTypes:W,onNodesChange:X?void 0:eu,onEdgesChange:X?void 0:em,onConnect:X?void 0:ep,nodesDraggable:!X,nodesConnectable:!X,elementsSelectable:!0,nodesFocusable:!X,zoomOnDoubleClick:!1,onNodeClick:(e,t)=>{U(t.id),J(null)},onNodeContextMenu:(e,t)=>eS(e,t.id),onPaneClick:()=>J(null),onSelectionChange:e=>{var t;let{nodes:n}=e;(null===(t=n[0])||void 0===t?void 0:t.id)&&U(n[0].id)},fitView:!0,minZoom:.02,maxZoom:2,className:"bg-background",defaultEdgeOptions:O,deleteKeyCode:X?null:["Delete"],proOptions:q,children:[(0,a.jsx)(l.V,{}),(0,a.jsx)(i.o,{className:"!border !border-border !bg-card"}),(0,a.jsx)(d.H,{className:"!border !border-border !bg-card"})]}),Z?(0,a.jsx)("div",{className:"absolute z-50",style:{left:Z.x,top:Z.y},children:(0,a.jsx)(B,{nodeId:Z.nodeId,canDelete:"root"!==Z.nodeId,onClose:()=>J(null)})}):null]}),(0,a.jsx)("p",{className:"border-t border-border bg-background px-3 py-2 text-xs text-muted-foreground",children:"Double-click sá»a nh\xe3n \xb7 click ⯠hoặc chuá»t phải má» menu \xb7 bấm Lưu Äá» lưu v\xe0o há» sÆ¡."})]})})}function H(){return(0,a.jsx)(o.Ln,{children:(0,a.jsx)(F,{})})}}
1,17823:(e,t,n)=>{n.d(t,{B:()=>o});var a=n(16418),r=n(76040);function o(e,t,n){let o=(0,a.useRef)(0),l=(0,a.useRef)(t);l.current=t;let{connected:i,broadcastState:d,onRemoteState:s}=(0,r.ik)();(0,a.useEffect)(()=>s((e,t)=>{!(t<=o.current)&&(o.current=t,e&&"object"==typeof e&&l.current(e))}),[s]),(0,a.useEffect)(()=>{i&&!n&&d(e)},[e,i,n,d])}},20449:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},21448:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},28008:(e,t,n)=>{n.d(t,{Kh:()=>o,Qo:()=>a,cl:()=>d,z5:()=>l});let a="#ffffff";function r(e,t){let n=e.trim();return n&&t?/data-hpk-export-bg=/i.test(n)?n.replace(/(<rect\b[^>]*\bdata-hpk-export-bg=["']1["'][^>]*\bfill=")[^"]*(")/i,"$1".concat(t,"$2")):n.replace(/<svg\b([^>]*)>/i,(e,n)=>{let a=t.replace(/"/g,"");return"<svg".concat(n,'><rect data-hpk-export-bg="1" width="100%" height="100%" fill="').concat(a,'"/>')}):n}function o(e,t){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function l(e,t,n){let a=new Blob([(null==n?void 0:n.backgroundColor)?r(t,n.backgroundColor):t],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(a),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)}async function i(e,t){var n,o;let l=null!==(n=null==t?void 0:t.backgroundColor)&&void 0!==n?n:a,i=r(e.trim(),l);if(!i)throw Error("SVG trá»ng.");/\sxmlns=/.test(i)||(i=i.replace(/<svg\b/i,'<svg xmlns="http://www.w3.org/2000/svg"'));let d=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),s=URL.createObjectURL(d);try{let e=await new Promise((e,t)=>{let n=new Image;n.onload=()=>e(n),n.onerror=()=>t(Error("Kh\xf4ng Äá»c ÄÆ°á»£c SVG Äá» xuất PNG.")),n.src=s}),n=Math.max(1,null!==(o=null==t?void 0:t.pixelRatio)&&void 0!==o?o:2),a=Math.max(1,Math.ceil((e.naturalWidth||e.width||1)*n)),r=Math.max(1,Math.ceil((e.naturalHeight||e.height||1)*n)),i=document.createElement("canvas");i.width=a,i.height=r;let d=i.getContext("2d");if(!d)throw Error("Kh\xf4ng tạo ÄÆ°á»£c canvas.");return d.fillStyle=l,d.fillRect(0,0,a,r),d.drawImage(e,0,0,a,r),i.toDataURL("image/png")}finally{URL.revokeObjectURL(s)}}async function d(e,t,n){o(e,await i(t,n))}},32755:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},41285:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(16418);let r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)((e,t)=>{let{color:n="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:d,className:s="",children:c,iconNode:u,...m}=e;return(0,a.createElement)("svg",{ref:t,...l,width:r,height:r,stroke:n,strokeWidth:d?24*Number(i)/Number(r):i,className:o("lucide",s),...m},[...u.map(e=>{let[t,n]=e;return(0,a.createElement)(t,n)}),...Array.isArray(c)?c:[c]])}),d=(e,t)=>{let n=(0,a.forwardRef)((n,l)=>{let{className:d,...s}=n;return(0,a.createElement)(i,{ref:l,iconNode:t,className:o("lucide-".concat(r(e)),d),...s})});return n.displayName="".concat(e),n}},41447:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},59022:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(41285).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},61073:(e,t,n)=>{n.d(t,{Jc:()=>c,SG:()=>s});
1var a=n(64644),r=n(97350),o=n(90165),l=n(64893);async function i(e){try{await navigator.clipboard.writeText(e)}catch(n){let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}async function d(e){let t=e.title.trim()||"Untitled";if(!e.id&&!1!==e.promptTitleIfNew){let e=await (0,a.a)(t);if(!e)return null;t=e}try{var n;let a=await (0,l.Vm)({id:e.id,title:t,kind:e.kind,payload:e.payload,visibility:"public"});return null===(n=e.onSaved)||void 0===n||n.call(e,{id:a.id,title:a.title}),(0,l.lx)(a.id,(0,o.WD)(e.kind)),a.id}catch(e){throw e}}async function s(e){try{let t=e.diagramId;if(e.setPublic?t=await e.setPublic():t&&"public"===e.visibility||(t=await d({id:t,title:e.title,kind:e.kind,payload:e.payload,promptTitleIfNew:!t,onSaved:e.onSaved})),!t)return!1;let n=await (0,l.D1)(t,"edit");return await i(n.url),r.W.success("Ä\xe3 copy link sá»a \xb7 ai c\xf3 link Äá»u sá»a \xb7 Live 6 giá»."),!0}catch(e){return r.W.error(e.message||"Kh\xf4ng tạo ÄÆ°á»£c link sá»a."),!1}}async function c(e){try{let t=e.diagramId;if(e.setPublic?t=await e.setPublic():t&&"public"===e.visibility||(t=await d({id:t,title:e.title,kind:e.kind,payload:e.payload,promptTitleIfNew:!t,onSaved:e.onSaved})),!t)return!1;let n=await (0,l.D1)(t,"view");return await i(n.url),r.W.success("Ä\xe3 copy link xem \xb7 guest kh\xf4ng cần ÄÄng nháºp \xb7 6 giá»."),!0}catch(e){return r.W.error(e.message||"Kh\xf4ng tạo ÄÆ°á»£c link xem."),!1}}},64097:(e,t,n)=>{n.d(t,{J9:()=>c,Sp:()=>p,ap:()=>m,kV:()=>d,sR:()=>s,sZ:()=>u,xL:()=>l});var a=n(88577),r=n(46538),o=n(33047).hp;function l(e){try{let t=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,a=t+"=".repeat(n),r="function"==typeof atob?atob(a):o.from(a,"base64").toString("binary"),l=new Uint8Array(r.length);for(let e=0;e<r.length;e++)l[e]=r.charCodeAt(e);return l}(e.trim()),n=new TextDecoder().decode((0,a.UD)(t)),r=JSON.parse(n);if(!r||1!==r.v||!r.kind)return null;return r}catch(e){return null}}function i(e){return(0,r.encode)(e)}function d(e){return"https://www.plantuml.com/plantuml/png/".concat(i(e))}function s(e){return"https://www.plantuml.com/plantuml/uml/".concat(i(e))}function c(e){return"https://www.plantuml.com/plantuml/svg/".concat(i(e))}function u(e){let t=e.origin||window.location.origin,n=function(e){let t=JSON.stringify({...e,v:1,mode:e.mode||"edit"});var n=(0,a.Kc)(new TextEncoder().encode(t),{level:9});let r="";for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return("function"==typeof btoa?btoa(r):o.from(n).toString("base64")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}(e.payload),r=new URLSearchParams;return r.set("section","diagram"),r.set("dapp",e.app||("flow"===e.payload.kind?"flow":"whiteboard"===e.payload.kind?"board":"mindmap"===e.payload.kind?"mindmap":"drawio"===e.payload.kind?"drawio":"erd"===e.payload.kind?"erd":"uml")),r.set("d",n),"view"===e.payload.mode&&r.set("dmode","view"),"".concat(t,"/?").concat(r.toString())}let m=[{key:"flowchart",label:"Flowchart",source:"flowchart TD\n A[Bắt Äầu] --\x3e B{Kiá»m tra?}\n B --\x3e|C\xf3| C[Xá» l\xfd]\n B --\x3e|Kh\xf4ng| D[Huá»·]\n C --\x3e E[Kết th\xfac]\n D --\x3e E"},{key:"sequence",label:"Sequence",source:"sequenceDiagram\n participant U as User\n participant S as System\n U->>S: Gá»i request\n S--\x3e>U: Response 200"},{key:"class",label:"Class",source:'classDiagram\n class User {\n +id\n +email\n +login()\n }\n class Order {\n +id\n +total\n }\n User "1" --\x3e "*" Order'},{key:"er",label:"ERD",source:"erDiagram\n USER ||--o{ ORDER : places\n ORDER ||--|{ ORDER_ITEM : contains\n PRODUCT ||--o{ ORDER_ITEM : includes"},{key:"state",label:"State",source:"stateDiagram-v2\n [*] --\x3e Draft\n Draft --\x3e Review\n Review --\x3e Published\n Review --\x3e Draft\n Published --\x3e [*]"},{key:"gantt",label:"Gantt",source:"gantt\n title Lá»ch triá»n khai\n dateFormat YYYY-MM-DD\n section Build\n Design :a1, 2026-01-01, 7d\n Develop :a2, after a1, 14d\n section Ship\n Test :a3, after a2, 5d\n Release :a4, after a3, 2d"},{key:"pie",label:"Pie",source:'pie showData\n title Tá»· lá» traffic\n "Organic" : 45\n "Paid" : 25\n "Referral" : 20\n "Direct" : 10'},{key:"mindmap",label:"Mindmap",source:"mindmap\n root((HPK Zone))\n Product\n Notes\n Tools\n Diagram\n Ops\n Deploy\n Mail\n Growth\n SEO\n Share link"},{key:"timeline",label:"Timeline",source:"timeline\n title Lá»ch sá» release\n 2024 : MVP README\n : Notes share link\n 2025 : Tools hub\n : Mail OTP\n 2026 : Diagram studio\n : Share edit/view"},{key:"gitGraph",label:"Git graph",source:'gitGraph\n commit id: "init"\n branch develop\n checkout develop\n commit id: "feature"\n checkout main\n merge develop\n commit id: "release"'},{key:"journey",label:"User journey",source:"journey\n title Mua h\xe0ng\n section Discover\n T\xecm sản phẩm: 5: User\n Xem chi tiết: 4: User\n section Checkout\n Th\xeam giá»: 5: User\n Thanh to\xe1n: 3: User, System\n section Done\n Nháºn email: 4: User"},{key:"quadrant",label:"Quadrant",source:"quadrantChart\n title Ưu ti\xean t\xednh nÄng\n x-axis Low Effort --\x3e High Effort\n y-axis Low Impact --\x3e High Impact\n quadrant-1 Quick wins\n quadrant-2 Big bets\n quadrant-3 Fill-ins\n quadrant-4 Money pit\n Share link: [0.3, 0.8]\n UML studio: [0.55, 0.85
1]\n Whiteboard: [0.4, 0.5]\n Rewrite all tools: [0.9, 0.4]"},{key:"xy",label:"XY chart",source:'xychart-beta\n title "Requests / ng\xe0y"\n x-axis [Mon, Tue, Wed, Thu, Fri]\n y-axis "Count" 0 --\x3e 1200\n bar [320, 480, 610, 540, 900]\n line [300, 450, 580, 520, 860]'},{key:"sankey",label:"Sankey",source:"sankey-beta\n Traffic,Landing,1000\n Landing,Signup,400\n Landing,Bounce,600\n Signup,Active,280\n Signup,Churn,120"},{key:"block",label:"Block",source:'block-beta\n columns 3\n A["API Gateway"]\n B["Auth"]\n C["DB"]\n A --\x3e B\n B --\x3e C'},{key:"requirement",label:"Requirement",source:"requirementDiagram\n requirement login_req {\n id: 1\n text: User must login with 2FA\n risk: high\n verifymethod: test\n }\n element auth_service {\n type: service\n }\n auth_service - satisfies -> login_req"},{key:"kanban",label:"Kanban",source:"---\nconfig:\n kanban:\n ticketBaseUrl: ''\n---\nkanban\n Todo\n task1[Thiết kế UML studio]\n task2[Th\xeam share link]\n Doing\n task3[Nhiá»u loại diagram]\n Done\n task4[Section Diagram]\n task5[Mermaid preview]"},{key:"architecture",label:"Architecture",source:"flowchart LR\n subgraph Cloud\n WEB[Web / Next.js]\n API[API Routes]\n end\n subgraph Data\n DB[(Postgres)]\n MAIL[Mail upstream]\n end\n WEB --\x3e API\n API --\x3e DB\n API --\x3e MAIL"},{key:"c4",label:"C4 context",source:"flowchart TB\n User((User))\n HPK[HPK Zone\\nHub tools / notes / diagram]\n Mail[[Mail server\\nOTP upstream]]\n User --\x3e|Browser| HPK\n HPK --\x3e|Fetch OTP| Mail"},{key:"packet",label:"Packet",source:'flowchart LR\n subgraph TCP["TCP Header"]\n SP[Source Port\\n0-15]\n DP[Dest Port\\n16-31]\n SEQ[Sequence\\n32-63]\n ACK[Ack\\n64-95]\n end\n SP --- DP --- SEQ --- ACK'}],p=[{key:"activity",label:"Activity",source:"@startuml\nstart\n:Ngưá»i d\xf9ng nháºp m\xe3 voucher;\n:Há» thá»ng kiá»m tra voucher;\nif (Voucher hợp lá»?) then (Kh\xf4ng)\n :Hiá»n thá» lá»i;\n stop\nelse (C\xf3)\n :\xc1p dụng giảm gi\xe1;\nendif\n:Cáºp nháºt tá»ng tiá»n;\nstop\n@enduml"},{key:"sequence",label:"Sequence",source:'@startuml\nactor User\nparticipant "API" as API\nparticipant DB\nUser -> API: POST /login\nAPI -> DB: find user\nDB --\x3e API: user\nAPI --\x3e User: JWT\n@enduml'},{key:"class",label:"Class",source:'@startuml\nclass User {\n +Long id\n +String email\n +login()\n}\nclass Order {\n +Long id\n +BigDecimal total\n}\nUser "1" -- "*" Order\n@enduml'},{key:"er",label:"ERD",source:"@startuml\nentity users {\n * user_id : bigint <<PK>>\n --\n * email : varchar\n role_id : bigint <<FK>>\n}\nentity orders {\n * order_id : bigint <<PK>>\n --\n * user_id : bigint <<FK>>\n total : decimal\n}\nusers ||--o{ orders\n@enduml"},{key:"usecase",label:"Use case",source:"@startuml\nleft to right direction\nactor User\nactor Admin\nrectangle System {\n User --\x3e (ÄÄng nháºp)\n User --\x3e (Tạo diagram)\n User --\x3e (Share link)\n Admin --\x3e (Quản trá»)\n (Share link) ..> (ÄÄng nháºp) : <<include>>\n}\n@enduml"},{key:"component",label:"Component",source:'@startuml\npackage "Frontend" {\n [Hub UI]\n [Diagram Studio]\n}\npackage "Backend" {\n [Next API]\n [Mail proxy]\n}\ndatabase "Postgres" {\n [addresses]\n}\n[Hub UI] --\x3e [Diagram Studio]\n[Diagram Studio] --\x3e [Next API]\n[Hub UI] --\x3e [Mail proxy]\n[Next API] --\x3e [addresses]\n@enduml'},{key:"deployment",label:"Deployment",source:'@startuml\nnode "Cloudflare" {\n [CDN / DNS]\n}\nnode "VPS" {\n artifact "Docker Compose" as compose\n component "Next.js" as next\n database "Postgres" as db\n compose --\x3e next\n next --\x3e db\n}\n[CDN / DNS] --\x3e next\n@enduml'},{key:"state",label:"State",source:"@startuml\n[*] --\x3e Draft\nDraft --\x3e Review : submit\nReview --\x3e Published : approve\nReview --\x3e Draft : reject\nPublished --\x3e [*]\n@enduml"},{key:"object",label:"Object",source:'@startuml\nobject user1 {\n id = 1\n email = "[email protected]"\n}\nobject order1 {\n id = 99\n total = 250000\n}\nuser1 --\x3e order1 : places\n@enduml'},{key:"timing",label:"Timing",source:'@startuml\nrobust "Web" as WEB\nconcise "API" as API\n@0\nWEB is Idle\nAPI is Idle\n@100\nWEB is Request\nAPI is Busy\n@300\nAPI is Idle\nWEB is Done\n@enduml'},{key:"network",label:"Network",source:'@startnwdiag\nnwdiag {\n network dmz {\n address = "10.0.0.0/24"\n web [address = "10.0.0.10"];\n }\n network internal {\n address = "10.0.1.0/24"\n db [address = "10.0.1.20"];\n web;\n }\n}\n@endnwdiag'},{key:"mindmap",label:"Mindmap",source:"@startmindmap\n* HPK Diagram\n** Mermaid\n*** Flow\n*** Sequence\n*** ERD\n** PlantUML\n*** Activity\n*** Component\n*** Deployment\n** Share\n*** Edit link\n*** View link\n@endmindmap"},{key:"wbs",label:"WBS",source:"@startwbs\n* Project Diagram\n** Research\n*** PlantUML\n*** Mermaid\n** Build\n*** Studio UI\n*** Share encode\n** Ship\n*** Docs\n*** Deploy\n@endwbs"},{key:"gantt",label:"Gantt",source:"@startgantt\nproject starts 2026-01-01\n[Design] lasts 7 days\n[Develop] lasts 14 days\n[Develop] starts at [De
1sign]'s end\n[Test] lasts 5 days\n[Test] starts at [Develop]'s end\n@endgantt"},{key:"salt",label:"Wireframe",source:'@startsalt\n{\n {+\n Login | "user@email"\n Password | "****"\n [Cancel] | [OK]\n }\n}\n@endsalt'},{key:"json",label:"JSON",source:'@startjson\n{\n "user": {\n "id": 1,\n "roles": ["admin", "editor"]\n },\n "diagram": {\n "kind": "plantuml",\n "share": true\n }\n}\n@endjson'},{key:"yaml",label:"YAML",source:"@startyaml\nservice: diagram\napps:\n - uml\n - flow\n - board\nshare:\n edit: true\n view: true\n@endyaml"}];Object.fromEntries(m.map(e=>[e.key,e.source])),Object.fromEntries(p.map(e=>[e.key,e.source]))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.