const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/vendor-common.js","assets/chunks/vendor-react.js","assets/chunks/_commonjsHelpers.js","assets/chunks/preload-helper.js","assets/chunks/_commonjs-dynamic-modules.js"])))=>i.map(i=>d[i]); import{_ as Yt}from"./preload-helper.js?v=1775123024591";import{h as me,n as xe,g as pe}from"./fills-generator.js?v=1775123024591";function ye(t){return typeof t=="string"?t.trim().toLowerCase():""}function $t(t){return String((t==null?void 0:t.tagName)??"").trim().toUpperCase()}function be(t){const e=t==null?void 0:t.parentElement;return e?e.id==="root"?!0:typeof e.hasAttribute=="function"&&e.hasAttribute("data-page-id"):!1}function Ut(t,e){const n=ye(t);if(n==="body"||n==="html"||n==="document.body"||n==="document.documentelement")return!0;const o=$t(e);return o==="BODY"||o==="HTML"}function we(t,e,n){var r;if(Ut(t,e))return!1;const o=String(n??"").trim().toLowerCase();if(o==="bg"||o==="background")return!0;const s=$t(e).toLowerCase();return!!(o===s&&be(e)&&Number(((r=e==null?void 0:e.children)==null?void 0:r.length)??0)>0)}const Wt="export-overlay-root",ke=new Set(["script","style","noscript","meta","link","title"]),At=new Set(["img","canvas","video"]),Te=new Set(["path","line","polyline","polygon","rect","circle","ellipse"]),Xt=0,et=1,ct=3,jt=0,Qt=1,Ce=2,kt=new Set(["hidden","clip","auto","scroll"]),u=t=>Math.round(t*1e3)/1e3,y=(t,e=0)=>{const n=Number.parseFloat(String(t||""));return Number.isFinite(n)?n:e},Me=()=>{const t=document.documentElement,e=document.body,n=Math.max((t==null?void 0:t.scrollWidth)||0,(t==null?void 0:t.clientWidth)||0,(e==null?void 0:e.scrollWidth)||0,(e==null?void 0:e.clientWidth)||0),o=Math.max((t==null?void 0:t.scrollHeight)||0,(t==null?void 0:t.clientHeight)||0,(e==null?void 0:e.scrollHeight)||0,(e==null?void 0:e.clientHeight)||0);return{width:Math.max(1,u(n)),height:Math.max(1,u(o))}},qt=t=>{if(!t)return!0;const e=t.trim().toLowerCase();return e==="transparent"||e==="rgba(0, 0, 0, 0)"||e==="rgba(0,0,0,0)"},St=t=>{if(!t)return null;const e=t.trim(),n=pe(e);return n?{r:Math.min(1,Math.max(0,Number(n.r)||0)),g:Math.min(1,Math.max(0,Number(n.g)||0)),b:Math.min(1,Math.max(0,Number(n.b)||0)),a:Math.min(1,Math.max(0,Number(n.a)||0))}:null},Ae=t=>{const e=[];let n=0,o=0;for(let r=0;r{var n,o,s;if(!t)return null;const e=((n=t.match(/rgba?\([^)]*\)/i))==null?void 0:n[0])||((o=t.match(/hsla?\([^)]*\)/i))==null?void 0:o[0])||((s=t.match(/#[0-9a-f]{3,8}/i))==null?void 0:s[0])||(/transparent/i.test(t)?"transparent":null);return e?St(e):null},Tt=t=>!t||t==="none"?[]:Ae(t).map(n=>{const o=/\binset\b/i.test(n),s=Se(n)||{r:0,g:0,b:0,a:1},r=n.match(/-?\d*\.?\d+px/gi)||[],i=y(r[0],0),a=y(r[1],0),c=Math.max(0,y(r[2],0)),p=Math.max(0,y(r[3],0));return{color:s,enabled:!0,blur:u(c),offset:{x:u(i),y:u(a)},type:1,shadowType:o?1:0,spread:u(p)}}).filter(n=>n.color),Z=(t,e=!0)=>{const n=St(t);return n?{type:et,enabled:e,color:n}:null},Zt=(t,e=0)=>t?{alignment:e,fill:t}:null,Lt=()=>({hasFixedLeft:!0,hasFixedRight:!1,hasFixedTop:!0,hasFixedBottom:!1,hasFixedWidth:!0,hasFixedHeight:!0}),Le=()=>({hasFixedLeft:!1,hasFixedRight:!1,hasFixedTop:!1,hasFixedBottom:!1,hasFixedWidth:!1,hasFixedHeight:!1}),Ne=t=>{switch((t||"").toLowerCase()){case"center":return 1;case"right":return 2;case"justify":return 3;case"left":default:return 0}},Dt=(t,e=!1)=>{switch(String(t||"").toLowerCase().trim()){case"center":return"center";case"end":case"flex-end":case"right":case"self-end":return"end";case"space-around":case"space-evenly":return"center";case"space-between":return e?"start":"center";case"baseline":case"stretch":case"normal":case"start":case"left":case"flex-start":default:return"start"}},Fe=(t,e=0)=>t==="center"?1:t==="end"?2:t==="start"?0:e,ve=t=>t==="center"?"middle":t==="end"?"bottom":"top",Ie=t=>{if(!String(t.display||"").toLowerCase().trim().includes("flex"))return null;const o=(t.flexDirection||"row").toLowerCase().startsWith("column"),s=Dt(t.justifyContent,!0),r=Dt(t.alignItems,!1),i=o?r:s,a=o?s:r;return{horizontalTextAlign:Fe(i,0),verticalAlign:ve(a)}},He=t=>{const e=Math.max(0,y(t.borderTopWidth,0)),n=Math.max(0,y(t.borderRightWidth,0)),o=Math.max(0,y(t.borderBottomWidth,0)),s=Math.max(0,y(t.borderLeftWidth,0)),r=Math.max(0,y(t.paddingTop,0)),i=Math.max(0,y(t.paddingRight,0)),a=Math.max(0,y(t.paddingBottom,0)),c=Math.max(0,y(t.paddingLeft,0));return{borderTop:e,borderRight:n,borderBottom:o,borderLeft:s,paddingTop:r,paddingRight:i,paddingBottom:a,paddingLeft:c}},Pe=t=>{const e=(t.verticalAlign||"").toLowerCase();return e==="middle"?"middle":e==="bottom"||e==="text-bottom"?"bottom":"top"},Re=(()=>{let t=null;return(e,n,o,s)=>{if(!e)return Math.max(1,u(s));try{if(t||(t=document.createElement("canvas").getContext("2d")),!t)return Math.max(1,u(s));const r=n.fontStyle||"normal",i=n.fontWeight||"400",a=Nt(n.fontFamily);t.font=`${r} ${i} ${o}px ${a}`;const c=t.measureText(e),p=c.actualBoundingBoxAscent,b=c.actualBoundingBoxDescent,d=p+b;if(Number.isFinite(d)&&d>0)return Math.max(1,u(d))}catch{return Math.max(1,u(s))}return Math.max(1,u(s))}})(),Be=(()=>{let t=null;return(e,n,o,s=0)=>{if(!e)return 0;try{if(t||(t=document.createElement("canvas").getContext("2d")),!t)return 0;const r=n.fontStyle||"normal",i=n.fontWeight||"400",a=Nt(n.fontFamily);t.font=`${r} ${i} ${o}px ${a}`;const c=t.measureText(e),p=Number.isFinite(c.width)?c.width:0,b=Math.max(0,e.length-1)*Math.max(0,s),d=p+b;return Math.max(0,u(d))}catch{return 0}}})(),We=t=>{const e=t.textDecorationLine||t.getPropertyValue("text-decoration-line")||t.textDecoration||"",n=String(e).toLowerCase(),o=n.includes("underline"),s=n.includes("line-through");return{underline:o,strikethrough:s}},De=t=>t>=700?"Bold":t>=600?"Semibold":t>=500?"Medium":t<=300?"Light":"Regular",Nt=t=>{var n;return t?(((n=t.split(",")[0])==null?void 0:n.trim())||"Roboto").replace(/^["']|["']$/g,""):"Roboto"},ze=t=>{if(!t||typeof t!="string")return"Roboto";const e=t.split(",").map(s=>s.trim().replace(/^["']|["']$/g,"").trim()).filter(Boolean);if(e.length===0)return"Roboto";const n=[],o=new Set;for(const s of e){const r=s.toLowerCase();o.has(r)||(o.add(r),n.push(s))}return n.join(", ")},Kt=t=>Array.from(t.childNodes).filter(n=>n.nodeType===Node.TEXT_NODE).map(n=>n.textContent||"").join(" ").replace(/\s+/g," ").trim(),Ee=(t,e,n)=>{const o=Array.from(t.childNodes).filter(d=>d.nodeType===Node.TEXT_NODE&&(d.textContent||"").trim().length>0);if(o.length===0)return null;let s=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,c=!1,p=0,b=0;for(const d of o){const l=document.createRange();l.selectNodeContents(d);const F=l.getClientRects();for(const T of F){if(T.width<=0||T.height<=0)continue;const B=T.left+window.scrollX,C=T.top+window.scrollY,x=T.right+window.scrollX,k=T.bottom+window.scrollY;p+=1,b=Math.max(b,T.width),s=Math.min(s,B),r=Math.min(r,C),i=Math.max(i,x),a=Math.max(a,k),c=!0}}return c?{x:u(s-e),y:u(r-n),width:u(Math.max(0,i-s)),height:u(Math.max(0,a-r)),lineCount:p,maxLineWidth:u(Math.max(0,b))}:null},Ft=t=>t instanceof Element?!!(t.id===Wt||typeof t.closest=="function"&&t.closest(`#${Wt}`)):!1,Ve=t=>{if(!(t instanceof HTMLElement||t instanceof SVGElement))return!1;const e=t.tagName.toLowerCase();if(ke.has(e)||Ft(t))return!1;const n=window.getComputedStyle(t);if(n.display==="none"||n.visibility==="hidden"||y(n.opacity,1)<=0)return!1;const o=t.getBoundingClientRect();return!(o.width<=0||o.height<=0)},ut=(t,e,n)=>{const o=t.getBoundingClientRect(),s=o.left+window.scrollX,r=o.top+window.scrollY;return{x:u(s-e),y:u(r-n),width:u(o.width),height:u(o.height)}},zt=t=>{const e=t.getAttribute("data-label");if(e)return e.slice(0,40);if(t.id)return t.id.slice(0,40);const n=t.getAttribute("aria-label");if(n)return n.slice(0,40);const o=Kt(t);return o?o.slice(0,40):t.tagName.toLowerCase()},Jt=t=>{const e=t.backgroundImage;if(!e||e==="none")return null;const n=e.match(/url\((['"]?)(.*?)\1\)/i);return!n||!n[2]?null:n[2]},_e=t=>{const e=[t.borderTopStyle,t.borderRightStyle,t.borderBottomStyle,t.borderLeftStyle].map(n=>(n||"").toLowerCase()).filter(Boolean);return e.length===0?!1:e.some(n=>n!=="none"&&n!=="solid")},Ge=t=>{const e=t.backgroundImage;if(!e||e==="none")return!1;const n=e.toLowerCase();return n.includes("linear-gradient")||n.includes("radial-gradient")||n.includes("conic-gradient")||n.includes("repeating-linear-gradient")||n.includes("repeating-radial-gradient")?!0:!n.includes("url(")},te=t=>!!(xe(t)||Ge(t)||_e(t)||(t.borderImageSource||"none")!=="none"||(t.filter||"none")!=="none"||(t.backdropFilter||t.webkitBackdropFilter||"none")!=="none"),Oe=async(t,e)=>{try{const n=t.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;const o=4096;if(n.width>o||n.height>o)return null;const{snapdom:s}=await Yt(async()=>{const{snapdom:a}=await import("./vendor-common.js?v=1775123024591").then(c=>c.dj);return{snapdom:a}},__vite__mapDeps([0,1,2,3,4])),r=t.cloneNode(!0);if(!(r instanceof HTMLElement||r instanceof SVGElement))return null;if(r instanceof HTMLElement){r.removeAttribute("id");for(let a=0;a{(a instanceof HTMLElement||a instanceof SVGElement)&&(a.style.visibility="hidden")}),document.body.appendChild(r);const i=await s.toPng(r,{fast:!1,embedFonts:!0,scale:1,dpr:1,width:n.width,height:n.height});return r.remove(),i!=null&&i.src?i.src:null}catch(n){return console.warn("[htmlToAxure] captureElementFillImage failed, fallback to style mapping",n),null}},Ye=async t=>{try{const e=t.getBoundingClientRect();if(e.width<=0||e.height<=0)return null;const n=4096;if(e.width>n||e.height>n)return null;const{snapdom:o}=await Yt(async()=>{const{snapdom:r}=await import("./vendor-common.js?v=1775123024591").then(i=>i.dj);return{snapdom:r}},__vite__mapDeps([0,1,2,3,4])),s=await o.toPng(t,{fast:!1,embedFonts:!0,scale:1,dpr:1,width:e.width,height:e.height});return s!=null&&s.src?s.src:null}catch(e){return console.warn("[htmlToAxure] captureSvgAsPngDataUrl failed",e),null}},$e=(t,e)=>{const n=t.tagName.toLowerCase();if(n==="img")return t.currentSrc||t.src||null;if(n==="video")return t.poster||null;if(n==="canvas")try{return t.toDataURL("image/png")}catch{return null}return Jt(e)},Ue=t=>{if(!t)return t;const e=t.trim(),n=e.indexOf(";base64,");return e.startsWith("data:")&&n>0?e.slice(n+8):e},Et=t=>{let e=0;for(let o=0;o>>0).toString(16).padStart(8,"0");return`${n}${n}${n}${n}${n}`.slice(0,40)},Xe=async t=>{var e;if((e=globalThis.crypto)!=null&&e.subtle)try{const n=new TextEncoder().encode(t),o=await globalThis.crypto.subtle.digest("SHA-1",n);return Array.from(new Uint8Array(o)).map(s=>s.toString(16).padStart(2,"0")).join("")}catch{return Et(t)}return Et(t)},U=({id:t,name:e,rect:n,opacity:o})=>({itemType:Qt,flippedHorizontal:!1,flippedVertical:!1,id:t,name:e,visible:!0,isLocked:!1,isNameDynamic:!1,rotation:0,rect:{location:{x:n.x,y:n.y},size:{width:n.width,height:n.height}},resizingConstraints:Lt(),opacity:o,textAlignment:Xt,textPadding:[],effects:[],textShadows:[],booleanOperation:0,textRotation:0,isMask:!1}),ee=t=>{const e=(b,d)=>{const l=u(Math.max(0,y(b,0))),F=(d||"").toLowerCase();return F==="none"||F==="hidden"?0:l},n=e(t.borderTopWidth,t.borderTopStyle),o=e(t.borderRightWidth,t.borderRightStyle),s=e(t.borderBottomWidth,t.borderBottomStyle),r=e(t.borderLeftWidth,t.borderLeftStyle),i=[n,o,s,r],a=Math.max(...i),c=a>0,p=n>0&&t.borderTopColor||o>0&&t.borderRightColor||s>0&&t.borderBottomColor||r>0&&t.borderLeftColor||t.borderColor;return{hasBorder:c,maxWidth:a,strokeColor:p,border:i}},vt=t=>[u(y(t.borderTopLeftRadius,0)),u(y(t.borderTopRightRadius,0)),u(y(t.borderBottomRightRadius,0)),u(y(t.borderBottomLeftRadius,0))],It=t=>t.some(e=>e>.01),ne=t=>{const e=(t.overflow||"").toLowerCase(),n=(t.overflowX||"").toLowerCase(),o=(t.overflowY||"").toLowerCase();return kt.has(e)||kt.has(n)||kt.has(o)},je=(t,e,n=6)=>Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.width-e.width)<=n&&Math.abs(t.height-e.height)<=n,lt=(t,e,n,o={})=>{const{includeSelf:s=!1,maxDepth:r=6}=o;let i=0,a=s?t:t.parentElement;for(;a&&i{let s=0,r=t.parentElement;for(;r&&s<4;){const i=lt(r,n,o,{includeSelf:!0,maxDepth:1});if(i&&It(i.corners)&&je(i.rect,e))return{rect:i.rect,corners:i.corners};r=r.parentElement,s+=1}return null},Qe=(t,e,n,o,s)=>{const r=vt(e);if(It(r))return r;const i=re(t,n,o,s);return i!=null&&i.corners?i.corners:r},at=({id:t,name:e,rect:n,corners:o,maskedItems:s})=>({...U({id:t,name:e,rect:n,opacity:1}),type:0,corners:o,border:[0,0,0,0],backgroundFills:[{type:et,enabled:!1,color:{r:1,g:1,b:1,a:1}}],strokes:[],strokePattern:[],strokeThickness:0,effects:[],isMask:!0,maskedScene:{items:s}}),qe=({id:t,name:e,rect:n})=>({...U({id:t,name:e,rect:n,opacity:1}),type:0,corners:[0,0,0,0],border:[0,0,0,0],backgroundFills:[{type:et,enabled:!1,color:{r:1,g:1,b:1,a:1}}],strokes:[],strokePattern:[],strokeThickness:0,effects:[],textShadows:[],isMask:!0,maskedScene:{items:[]}}),Ze=({id:t,name:e,rect:n})=>({id:t,name:e,itemType:jt,visible:!0,isLocked:!1,isNameDynamic:!1,rotation:0,rect:{location:{x:n.x,y:n.y},size:{width:n.width,height:n.height}},resizingConstraints:Lt(),effects:[],isMask:!1,flippedHorizontal:!1,flippedVertical:!1,opacity:1,scene:{items:[]}}),Ct=t=>!t||typeof t!="object"?null:Number(t.itemType)===jt?((!t.scene||!Array.isArray(t.scene.items))&&(t.scene={items:[]}),t.scene.items):t.maskedScene&&Array.isArray(t.maskedScene.items)?t.maskedScene.items:null,Ke=(t,e)=>{const n=t.tagName.toLowerCase();return n==="svg"?!1:!!(At.has(n)||!qt(e.backgroundColor)||e.backgroundImage&&e.backgroundImage!=="none"||Jt(e)||te(e)||ee(e).hasBorder)},Je=(t,e,n,o)=>({itemType:Qt,flippedHorizontal:!1,flippedVertical:!1,id:t,name:"Background",visible:!0,isLocked:!0,isNameDynamic:!1,rotation:0,rect:{location:{x:0,y:0},size:{width:e,height:n}},resizingConstraints:{hasFixedLeft:!0,hasFixedRight:!0,hasFixedTop:!0,hasFixedBottom:!0,hasFixedWidth:!1,hasFixedHeight:!1},strokes:[],strokeThickness:0,strokePattern:[],type:0,backgroundFills:[o],opacity:1,booleanOperation:0,corners:[0,0,0,0],border:[1,1,1,1],textAlignment:Xt,textPadding:[],effects:[],textShadows:[],textRotation:0,isMask:!1}),tn=t=>{const e=window.getComputedStyle(t);return!(e.display==="none"||e.visibility==="hidden"||y(e.opacity,1)<=0)},q=(t,e,n)=>!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(n)||n<=0?0:u((t-e)/n),en=t=>{const e=t.ownerSVGElement;if(!e||typeof e.createSVGPoint!="function")return[];const n=t.getTotalLength,o=t.getPointAtLength;if(typeof n!="function"||typeof o!="function")return[];const s=t.getScreenCTM();if(!s)return[];let r=0;try{r=n.call(t)}catch{return[]}if(!Number.isFinite(r)||r<0)return[];const i=Math.max(2,Math.min(240,Math.ceil(r/6)+1)),a=[];for(let p=0;p.001||Math.abs(b.y-p.y)>.001)&&c.push(p)}return c},nn=t=>{const e=[];if(!t)return e;const n=/([AaCcHhLlMmQqSsTtVvZz])|([+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]?\d+)?)/g;let o=n.exec(t);for(;o;){if(o[1])e.push(o[1]);else if(o[2]){const s=Number.parseFloat(o[2]);Number.isFinite(s)&&e.push(s)}o=n.exec(t)}return e},Vt=(t,e)=>({x:2*e.x-t.x,y:2*e.y-t.y}),_t=(t,e,n)=>({c1:{x:t.x+(e.x-t.x)*2/3,y:t.y+(e.y-t.y)*2/3},c2:{x:n.x+(e.x-n.x)*2/3,y:n.y+(e.y-n.y)*2/3}}),rn=t=>{const e=nn(t),n=[];if(e.length===0)return n;let o=0,s=null,r={x:0,y:0},i={x:0,y:0},a=null,c=null,p=null,b=!1;const d=()=>typeof e[o]=="number",l=()=>{const C=e[o];return typeof C!="number"?null:(o+=1,C)},F=()=>(p||(p={closed:!1,data:[],endDecoration:1,startDecoration:1},n.push(p)),p),T=(C,x=2,k,h)=>{const f=F(),w={type:x,to:{x:C.x,y:C.y}};return k&&(w.lowerHandle={x:k.x,y:k.y}),f.data.push(w),w},B=C=>{const x=F(),k=x.data[x.data.length-1];k&&(k.type=3,k.higherHandle={x:C.x,y:C.y})};for(;ont===null))break;const H={x:x?r.x+h:h,y:x?r.y+f:f},z={x:x?r.x+w:w,y:x?r.y+A:A},X={x:x?r.x+S:S,y:x?r.y+g:g};B(H),T(X,3,z),r=X,a=z,c=null}continue}if(k==="S"){for(;d();){const h=l(),f=l(),w=l(),A=l();if([h,f,w,A].some(z=>z===null))break;const S=a?Vt(a,r):r,g={x:x?r.x+h:h,y:x?r.y+f:f},H={x:x?r.x+w:w,y:x?r.y+A:A};B(S),T(H,3,g),r=H,a=g,c=null}continue}if(k==="Q"){for(;d();){const h=l(),f=l(),w=l(),A=l();if([h,f,w,A].some(z=>z===null))break;const S={x:x?r.x+h:h,y:x?r.y+f:f},g={x:x?r.x+w:w,y:x?r.y+A:A},H=_t(r,S,g);B(H.c1),T(g,3,H.c2),r=g,c=S,a=null}continue}if(k==="T"){for(;d();){const h=l(),f=l();if([h,f].some(g=>g===null))break;const w=c?Vt(c,r):r,A={x:x?r.x+h:h,y:x?r.y+f:f},S=_t(r,w,A);B(S.c1),T(A,3,S.c2),r=A,c=w,a=null}continue}if(k==="A"){for(b=!0;d();){const h=l(),f=l(),w=l(),A=l(),S=l(),g=l(),H=l();if([h,f,w,A,S,g,H].some(X=>X===null))break;const z={x:x?r.x+g:g,y:x?r.y+H:H};T(z,2),r=z}a=null,c=null;continue}s=null}return b?[]:n.filter(C=>Array.isArray(C.data)&&C.data.length>=2)},on=t=>{if(!t)return[];const e=[],n=/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]?\d+)?/g;let o=n.exec(t);for(;o;){const r=Number.parseFloat(o[0]);Number.isFinite(r)&&e.push(r),o=n.exec(t)}const s=[];for(let r=0;r+1{if(n<=0||o<=0)return[];const s=.5522847498307936,r={x:t+n,y:e},i={x:t,y:e+o},a={x:t-n,y:e},c={x:t,y:e-o},p={x:t+n,y:e+o*s},b={x:t+n*s,y:e+o},d={x:t-n*s,y:e+o},l={x:t-n,y:e+o*s},F={x:t-n,y:e-o*s},T={x:t-n*s,y:e-o},B={x:t+n*s,y:e-o},C={x:t+n,y:e-o*s};return[{closed:!0,endDecoration:1,startDecoration:1,data:[{type:3,to:r,higherHandle:p},{type:3,to:i,lowerHandle:b,higherHandle:d},{type:3,to:a,lowerHandle:l,higherHandle:F},{type:3,to:c,lowerHandle:T,higherHandle:B},{type:3,to:r,lowerHandle:C}]}]},sn=t=>{const e=t.tagName.toLowerCase();if(e==="path"){const n=t.getAttribute("d")||"";return rn(n)}if(e==="line"){const n=y(t.getAttribute("x1"),0),o=y(t.getAttribute("y1"),0),s=y(t.getAttribute("x2"),0),r=y(t.getAttribute("y2"),0);return[{closed:!1,endDecoration:1,startDecoration:1,data:[{type:2,to:{x:n,y:o}},{type:2,to:{x:s,y:r}}]}]}if(e==="polyline"||e==="polygon"){const n=on(t.getAttribute("points")||"");return n.length<2?[]:[{closed:e==="polygon",endDecoration:1,startDecoration:1,data:n.map(o=>({type:2,to:o}))}]}if(e==="rect"){const n=y(t.getAttribute("x"),0),o=y(t.getAttribute("y"),0),s=y(t.getAttribute("width"),0),r=y(t.getAttribute("height"),0);return s<=0||r<=0?[]:[{closed:!0,endDecoration:1,startDecoration:1,data:[{type:2,to:{x:n,y:o}},{type:2,to:{x:n+s,y:o}},{type:2,to:{x:n+s,y:o+r}},{type:2,to:{x:n,y:o+r}}]}]}if(e==="circle"){const n=y(t.getAttribute("cx"),0),o=y(t.getAttribute("cy"),0),s=y(t.getAttribute("r"),0);return Gt(n,o,s,s)}if(e==="ellipse"){const n=y(t.getAttribute("cx"),0),o=y(t.getAttribute("cy"),0),s=y(t.getAttribute("rx"),0),r=y(t.getAttribute("ry"),0);return Gt(n,o,s,r)}return[]},Mt=(t,e,n)=>{const o=t.createSVGPoint();o.x=n.x,o.y=n.y;const s=o.matrixTransform(e);return{x:s.x,y:s.y}},Ot=(t,e)=>t.map(n=>{const o={type:n.type,to:{x:q(n.to.x,e.left,e.width),y:q(n.to.y,e.top,e.height)}};return n.lowerHandle&&(o.lowerHandle={x:q(n.lowerHandle.x,e.left,e.width),y:q(n.lowerHandle.y,e.top,e.height)}),n.higherHandle&&(o.higherHandle={x:q(n.higherHandle.x,e.left,e.width),y:q(n.higherHandle.y,e.top,e.height)}),o}),an=(t,e,n,o)=>{const s=t.ownerSVGElement;if(!s)return null;const r=t.getScreenCTM();if(!r)return null;const i=t.getBoundingClientRect();if(!Number.isFinite(i.left)||!Number.isFinite(i.top)||i.width<=0&&i.height<=0)return null;const a=window.getComputedStyle(t),c=sn(t);let p=[];if(c.length>0&&(p=c.map(C=>{const x=(C.data||[]).map(k=>{const h=Mt(s,r,k.to),f={type:k.type,to:h};return k.lowerHandle&&(f.lowerHandle=Mt(s,r,k.lowerHandle)),k.higherHandle&&(f.higherHandle=Mt(s,r,k.higherHandle)),f});return x.length<2?null:{closed:!!C.closed,endDecoration:1,startDecoration:1,data:Ot(x,i)}}).filter(Boolean)),p.length===0){const C=en(t);if(C.length<2)return null;p=[{closed:!1,endDecoration:1,startDecoration:1,data:Ot(C.map(x=>({type:2,to:x})),i)}]}const b=Math.max(0,u(y(a.strokeWidth,0))),d=Z(a.stroke,!0),l=a.fill,F=l&&l!=="none"?Z(l,!0):null,T=Math.min(1,Math.max(0,y(a.opacity,1))),B={x:u(i.left+window.scrollX-e),y:u(i.top+window.scrollY-n),width:u(i.width),height:u(i.height)};return{...U({id:o(),name:t.getAttribute("id")||t.getAttribute("data-label")||"Vector",rect:B,opacity:T}),resizingConstraints:Le(),type:2,backgroundFills:F?[F]:[],strokes:d&&b>0?[Zt(d,1)]:[],strokeThickness:d&&b>0?b:0,strokePattern:[],textAlignment:1,paths:p,svgPaths:[]}},cn=(t,e,n,o)=>{const s=ut(t,e,n);if(s.width<=0||s.height<=0)return null;const r=Array.from(Te).join(","),i=t.querySelectorAll(r),a=typeof SVGGeometryElement<"u",c=[];for(const d of i){if(!(d instanceof SVGElement)||d.ownerSVGElement!==t||a&&!(d instanceof SVGGeometryElement)||Ft(d)||!tn(d))continue;const l=an(d,e,n,o);l&&c.push(l)}if(c.length===0)return null;const p=window.getComputedStyle(t),b=Math.min(1,Math.max(0,y(p.opacity,1)));return{...U({id:o(),name:"SVG",rect:s,opacity:b}),type:0,corners:[0,0,0,0],border:[1,1,1,1],backgroundFills:[{type:et,enabled:!1,color:{r:1,g:1,b:1,a:1}}],strokes:[],strokePattern:[],strokeThickness:0,textAlignment:1,isMask:!0,maskedScene:{items:c}}},ln=async(t,e,n,o,s,r)=>{const i=ut(t,n,o);if(i.width<=0||i.height<=0)return null;const a=await Ye(t);if(!a)return null;const c=await r(a);if(!c)return null;const p=Math.min(1,Math.max(0,y(e.opacity,1)));return{...U({id:s(),name:"SVG",rect:i,opacity:p}),type:0,corners:[0,0,0,0],border:[1,1,1,1],backgroundFills:[{type:ct,enabled:!0,image:c,isHash:!0,patternFillType:4,alignment:{horizontal:1,vertical:1}}],strokes:[],strokePattern:[],strokeThickness:0,textAlignment:1}};async function gn(t="body",e={}){const{rootName:n=document.title||"Page",useCustomSize:o=!1,targetWidth:s,targetHeight:r,preserveHierarchy:i=!1,preserveSvgIcons:a=!0}=e||{},c=t instanceof HTMLElement||t instanceof SVGElement?t:document.querySelector(t||"body");if(!c)throw new Error("htmlToAxure: target element not found");try{await me(c)}catch(m){console.warn("[htmlToAxure] convertImagesInPage failed, continue:",m)}const p=c.getBoundingClientRect(),b=p.left+window.scrollX,d=p.top+window.scrollY,l=Ut(t,c),F=Me(),T=o&&Number.isFinite(s)&&s>0?u(s):F.width,B=o&&Number.isFinite(r)&&r>0?u(r):F.height,C={},x=[];let k=10;const h=()=>`1-${k++}`,f=i?new WeakMap:null,w=async m=>{if(!m)return null;let v=m;if(!v.startsWith("data:"))try{v=new URL(v,document.baseURI).href}catch{v=m}const Y=Ue(v),E=await Xe(Y);return C[E]||(C[E]=Y),E},A=(m,v,Y,E)=>{if(!i||!(m instanceof HTMLElement||m instanceof SVGElement)||m===c)return x;const j=f==null?void 0:f.get(m);if(j)return Ct(j)||x;let W=E;if(!W)try{W=window.getComputedStyle(m)}catch{W=null}const _=((W?ne(W):!1)?qe:Ze)({id:h(),name:`${Y||zt(m)}-hierarchy`,rect:v});let P=x;const M=m.parentElement;if(M&&M!==c){const L=f==null?void 0:f.get(M),D=Ct(L);D&&(P=D)}return P.push(_),f==null||f.set(m,_),Ct(_)||P},S=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT);let g=c;for(;g;){if(g instanceof SVGElement&&g.ownerSVGElement){g=S.nextNode();continue}if(Ve(g)){const m=window.getComputedStyle(g),v=ut(g,b,d);if(v.width>0&&v.height>0){const Y=Math.min(1,Math.max(0,y(m.opacity,1))),E=zt(g),j=g.tagName.toLowerCase(),W=A(g,v,E,m),rt=g===c&&we(t,c,E);if(j==="svg"){if(rt){g=S.nextNode();continue}let P=null;if(a&&(P=cn(g,b,d,h)),P||(P=await ln(g,m,b,d,h,w)),P){const M=i?lt(g,b,d,{includeSelf:!1}):null;if(M){const L=at({id:h(),name:`${E}-svg-clip-mask`,rect:M.rect,corners:M.corners,maskedItems:[P]});W.push(L)}else W.push(P)}g=S.nextNode();continue}if(!rt&&Ke(g,m)){const P=h(),M=ee(m),L=[];let D=!1;if(te(m)){const N=await Oe(g,m);if(N){const R=await w(N);R&&(L.push({type:ct,enabled:!0,image:R,isHash:!0,patternFillType:4,alignment:{horizontal:1,vertical:1}}),D=!0)}}if(!D){const N=$e(g,m);if(N){const st=await w(N);st&&L.push({type:ct,enabled:!0,image:st,isHash:!0,patternFillType:4,alignment:{horizontal:1,vertical:1}})}const R=Z(m.backgroundColor,!0);R&&L.push(R)}const G=vt(m),O=At.has(j)&&!It(G)?re(g,v,b,d):null,ot=At.has(j)?Qe(g,m,v,b,d):G,$={...U({id:P,name:E,rect:v,opacity:Y}),type:0,corners:ot,border:M.border,backgroundFills:L,strokes:[],strokePattern:[],strokeThickness:D?0:M.hasBorder?M.maxWidth:0,effects:Tt(m.boxShadow)};if(!D&&M.hasBorder){const N=Z(M.strokeColor,!0),R=Zt(N,0);R&&($.strokes=[R])}const K=i?lt(g,b,d,{includeSelf:!1}):null;if(K){const N={...$,corners:G},R=at({id:h(),name:`${E}-clip-mask`,rect:K.rect,corners:K.corners,maskedItems:[N]});W.push(R)}else if(O&&L.some(N=>Number(N==null?void 0:N.type)===ct&&(N==null?void 0:N.enabled)!==!1)){const N={...$,corners:G},R=at({id:h(),name:`${E}-mask`,rect:O.rect,corners:O.corners,maskedItems:[N]});W.push(R)}else W.push($)}const _=rt?"":Kt(g);if(_){const P=h(),M=Ee(g,b,d),L=Math.max(1,y(m.fontSize,14)),D=m.lineHeight,G=!!(D&&D!=="normal"),O=G?Math.max(0,y(D,L)):0,ot=G?Math.max(L,O):u(L*1.4),$=Math.max(100,Math.min(900,y(m.fontWeight,400))),K=ze(m.fontFamily),N=Nt(m.fontFamily),R=St(m.color)||{r:0,g:0,b:0,a:1},st=Ne(m.textAlign),J=Ie(m),Q=J?J.horizontalTextAlign:st,{underline:se,strikethrough:ie}=We(m),V=He(m),ae=v.x+V.borderLeft+V.paddingLeft,dt=v.y+V.borderTop+V.paddingTop,ce=Math.max(1,u(v.width-V.borderLeft-V.borderRight-V.paddingLeft-V.paddingRight)),it=Math.max(1,u(v.height-V.borderTop-V.borderBottom-V.paddingTop-V.paddingBottom)),ht=G&&O>L+.5&&Math.abs(O-it)<=2,le=D&&D!=="normal"?Math.max(L,Math.min(ot,L*1.25)):Math.max(L,L*1.2),ue=Re(_,m,L,le),ft=Math.min(it,Math.max(1,ue,ht?O:1)),Ht=J?J.verticalAlign:Pe(m),de=Ht==="middle"||ht;let tt=dt;de?tt=dt+Math.max(0,(it-ft)/2):Ht==="bottom"&&(tt=dt+Math.max(0,it-ft)),tt=u(tt);let I={x:u(ae),y:tt,width:ce,height:ft};M&&M.width>0&&M.height>0&&!ht&&!J&&(I={x:M.x,y:M.y,width:M.width,height:M.height});const gt=y(m.letterSpacing,0),Pt=Be(_,m,L,gt),mt=String(m.whiteSpace||"").toLowerCase(),he=String(m.textWrapMode||m.getPropertyValue("text-wrap-mode")||"").toLowerCase(),fe=mt==="nowrap"||mt==="pre"||mt==="pre-nowrap"||he==="nowrap",ge=((M==null?void 0:M.lineCount)||0)<=1||I.height<=Math.max(L,ot)*1.35;if(Pt>I.width+.5&&(fe||ge)){const bt=Math.max(2,Math.min(12,Math.abs(gt)*2)),Bt=u(Pt+bt),wt=Bt-I.width;wt>0&&(Q===1?I.x=u(I.x-wt/2):Q===2&&(I.x=u(I.x-wt)),I.width=Bt)}const xt=Math.max(1,Math.ceil(I.width)),pt=xt-I.width;pt>0&&(Q===1?I.x=u(I.x-pt/2):Q===2&&(I.x=u(I.x-pt))),I.width=xt;const Rt={...U({id:P,name:_.slice(0,40),rect:I,opacity:Y}),isNameDynamic:!0,type:0,backgroundFills:[],strokes:[],strokePattern:[],strokeThickness:0,textAlignment:Q,effects:Tt(m.textShadow),textShadows:Tt(m.textShadow),text:{paragraphs:[{horizontalAlignment:Q,lineSpacing:G?u(O):0,inlines:[{type:0,text:_,family:K,typeface:`${N} - ${De($)}`,weight:$,size:u(L),textColor:R,style:0,underline:se,strikethrough:ie,characterSpacing:u(gt)}]}]}},yt=i?lt(g,b,d,{includeSelf:!0}):null;if(yt){const bt=at({id:h(),name:`${_.slice(0,24)}-text-clip-mask`,rect:yt.rect,corners:yt.corners,maskedItems:[Rt]});W.push(bt)}else W.push(Rt)}}}g=S.nextNode()}const H=window.getComputedStyle(c).backgroundColor||"rgba(255,255,255,1)",z=Z(H,!qt(H))||Z("rgba(255,255,255,1)",!1),X=h(),nt=l?Je(h(),T,B,z):null,oe={id:X,name:n||"Artboard",itemType:Ce,resizingConstraints:Lt(),isNameDynamic:!1,rect:{location:{x:u(b),y:u(d)},size:{width:T,height:B}},backgroundFill:{type:et,enabled:!1,color:z.color},scene:{items:x},...nt?{backgroundShape:nt}:{}};return{masters:{},imageMap:C,scene:{items:[oe]}}}export{gn as default,gn as htmlToAxure};