@cntrl-site/components 1.0.79-alpha.5 → 1.0.79-alpha.6

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/dist/index.js CHANGED
@@ -26505,7 +26505,7 @@ export function Burger({
26505
26505
  </div>
26506
26506
  );
26507
26507
  }
26508
- `;function Zo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function mi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function kl(e){return{[mi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[mi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[mi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[mi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[mi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[mi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[mi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[mi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const e$=kl(""),t$=kl("open"),n$=kl("compact"),i$=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["showIcon","iconSize"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],o$=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactShowIcon","compactIconSize"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],r$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Kn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},hs={fontWeight:400,fontStyle:"normal"},Vr={d:"Always",t:"Open Only",m:"Open Only"},a$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],s$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],l$={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{default:"Link Default",hover:"Link Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{open:"Link Default","open-hover":"Link Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{default:"Close Default",hover:"Close Hover",open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},textWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...a$]}},stateOverrides:{type:"object",scope:"common"},gap:Zo("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:Zo("Text padding left"),textPaddingRight:Zo("Text padding right"),textPaddingTop:Zo("Text padding top"),textPaddingBottom:Zo("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...e$,...t$,...n$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:Vr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactCloseButtonColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:hs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:hs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:hs,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666",closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",showIcon:"on",iconSize:30/375,textWidth:240/375,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Kn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",showIcon:"on",iconSize:16/768,textWidth:300/768,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Kn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",showIcon:"on",iconSize:20/1440,textWidth:300/1440,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Kn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:i$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:o$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:r$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...s$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},c$={element:Jw,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:l$,sourceCode:Qw,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},md=120,gd=3,d$=.12,El={x:0,y:0,width:100,height:100};function So(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ha(e){return e<0?0:e>1?1:e}function hd(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function u$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function p$(e){return e.map(([t,n])=>({x:t,y:n}))}function fs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function m$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ha(n[o]),l=ha(n[o+1]);l>r&&i.push({x0:r,x1:l})}return g$(i)}function g$(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function h$(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function f$(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function y$(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function v$(e,t,n,i){let o=null;for(let r=0;r<gd;r+=1){const l=ha(t+(n-t)*r/Math.max(1,gd-1)),d=m$(e,l),c=i==="avoid"?f$(d):d;if(o=o===null?c:h$(o,c),o.length===0)return[]}return o??[]}function fd(e,t="stretch",n=El){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=yr(l);if(d.length)return t==="viewbox"?So(d,n):fs(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",x),u.appendChild(y);let m=0;try{m=y.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let v=0;v<md;v+=1){const b=y.getPointAtLength(v/md*m);h.push({x:b.x,y:b.y})}p.push(h)}return p.length?t==="viewbox"?So(p,n):fs(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?So([r],n):fs([r])}const Ml={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Hs="0 0 100 100",fa=100,Os=16,x$=12,b$=16,ys=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,S$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,yd=Math.PI/4,w$=8,$$=Math.PI/18,C$=8,go=24,ho=[];function T$(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function vs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function L$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function I$(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function vd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=vs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?vs(c,i):L$(c))}if(!l.length){const c=o!=="custom"?Ml[o]:void 0;c?l=vs(Li(c),El):l=T$()}}return o==="circle"?I$(l,r):l}function xd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":No(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function Ds(e){const t=e==="rectangle"||e==="custom"?void 0:Ml[e];return t?So(yr(Li(t)),El):[p$([[0,0],[1,0],[1,1],[0,1]])]}function R$(e){const t=e.match(S$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function $n(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function zs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function P$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(P$)}))}function ln(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function bd(e,t,n,i=n){return ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function k$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),y=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*y+x*m,v=-x*y+p*m,b=h*h/(d*d)+v*v/(c*c);if(b>1){const Z=Math.sqrt(b);d*=Z,c*=Z}const C=o===r?-1:1,S=d*d*v*v+c*c*h*h,w=Math.max(0,d*d*c*c-S),D=S===0?0:C*Math.sqrt(w/S),_=D*d*v/c,z=-D*c*h/d,H=p*_-x*z+(e.x+l.x)/2,L=x*_+p*z+(e.y+l.y)/2,V=Math.atan2((v-z)/c,(h-_)/d);let k=Math.atan2((-v-z)/c,(-h-_)/d)-V;!r&&k>0&&(k-=Math.PI*2),r&&k<0&&(k+=Math.PI*2);const F=Math.max(1,Math.ceil(Math.abs(k)/(Math.PI/2))),W=k/F,g=4/3*Math.tan(W/4),E=(Z,T)=>({x:H+p*d*Z-x*c*T,y:L+x*d*Z+p*c*T}),R=[];let G=V;for(let Z=0;Z<F;Z+=1){const T=G+W,j=Math.cos(G),K=Math.sin(G),le=Math.cos(T),se=Math.sin(T);R.push({c1:E(j-g*K,K+g*j),c2:E(le+g*se,se-g*le),p:Z===F-1?cn(l):E(le,se)}),G=T}return R}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:Vn(h??null,m),out:null}),r=m},x=m=>{if(!i.length)return;const h=i[i.length-1];h.out=Vn(m,h.p)};ys.lastIndex=0;let y=ys.exec(t);for(;y!==null;){const m=y[1],h=m.toUpperCase(),v=m!==h,b=R$(y[2]),C=S=>v?{x:r.x+b[S],y:r.y+b[S+1]}:{x:b[S],y:b[S+1]};if(h==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(h==="M"){for(let S=0;S+1<b.length;S+=2){const w=C(S);S===0&&(u(),l=cn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let S=0;S+1<b.length;S+=2)p(C(S));d=null,c=null}else if(h==="H"){for(const S of b)p({x:v?r.x+S:S,y:r.y});d=null,c=null}else if(h==="V"){for(const S of b)p({x:r.x,y:v?r.y+S:S});d=null,c=null}else if(h==="C"){for(let S=0;S+5<b.length;S+=6){const w=C(S),D=C(S+2),_=C(S+4);x(w),p(_,D),d=D}c=null}else if(h==="S"){for(let S=0;S+3<b.length;S+=4){const w=d?zs(d,r):cn(r),D=C(S),_=C(S+2);x(w),p(_,D),d=D}c=null}else if(h==="Q")for(let S=0;S+3<b.length;S+=4){const w=C(S),D=C(S+2);x($n(r,w,2/3)),p(D,$n(D,w,2/3)),c=w,d=null}else if(h==="T")for(let S=0;S+1<b.length;S+=2){const w=c?zs(c,r):cn(r),D=C(S);x($n(r,w,2/3)),p(D,$n(D,w,2/3)),c=w,d=null}else if(h==="A")for(let S=0;S+6<b.length;S+=7){const w=v?{x:r.x+b[S+5],y:r.y+b[S+6]}:{x:b[S+5],y:b[S+6]};for(const D of k$(r,b[S],b[S+1],b[S+2],b[S+3]!==0,b[S+4]!==0,w))x(D.c1),p(D.p,D.c2);d=null,c=null}y=ys.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function pp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Bo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Sd(e,t){if(Bo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(t.p.y)}`}function No(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Sd(r,l)),r=l;if(n.closed){const l=Sd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function mp(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function Bs(e,t,n){if(Bo(e,t))return $n(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function yr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of mp(n)){if(Bo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Os;r+=1)i.push(Bs(o.from,o.to,r/Os))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of yr(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function E$(e){const t=Si(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function gp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function hp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=x$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/b$)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:cn(r),...gp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function fp(e,t,n=1){if(!e.length)return!1;const i=Si(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function M$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,x=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+x/c}})}function A$(e,t){if(!e.length)return e;const n=Si(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function yp(e){const t={x:0,y:0,width:fa,height:fa},n=e!=="custom"?Ml[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(hp(Ds("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=A$(i,t);return{shape:e,customPath:No(o),pathFit:"viewbox",pathViewBox:Hs}}function Gr(e,t){return t>0?Math.round(e/t)*t:e}function F$(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function wd(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function N$(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=vp(i,r,d)}),i}function _$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=zs(o,c.p)}return d}function W$(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=zn(e);return r[t].nodes[n][i]=null,r}function H$(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=zn(e),c=d[t].nodes,u=n+1;if(Bo(r,l))return c.splice(u,0,{p:$n(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,y=$n(r.p,p,i),m=$n(p,x,i),h=$n(x,l.p,i),v=$n(y,m,i),b=$n(m,h,i),C=$n(v,b,i),S=(n+1)%o.nodes.length;return c[n].out=y,c[S].in=h,c.splice(u,0,{p:C,in:v,out:b}),{contours:d,nodeIndex:u}}function vp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=zn(e);return o[t].nodes.splice(n,1),o}function $d(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=zn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,x=!!Vn(l[u].out,l[u].p),y=!!Vn(l[p].in,l[p].p);if(pp(d)||x||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=gp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function O$(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Cd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of mp(i)){const l=Bo(r.from,r.to)?1:Os;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=O$(t,Bs(r.from,r.to,c),Bs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function D$(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Td(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Ld(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function z$(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function B$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function js(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function j$(e,t){const n=js(e,t);return n?{kind:"align",a:{x:e.x-n.x*go,y:e.y-n.y*go},b:{x:t.x+n.x*go,y:t.y+n.y*go}}:{kind:"align",a:e,b:t}}function Vs(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Id(e,t,n,i,o){if(e.axis===null)return j$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return Vs(o(r)[t],t,i)}function V$(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Id(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Id(n,"y",l,i,o)),r}function G$(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return js(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return js(i(p),r)}function X$(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ho};const y=Math.atan2(p,u),m=Math.round(y/yd)*yd;let h=o?m:null,v=!1;if(!o){const z=[];n&&z.push({angle:Math.atan2(n.y,n.x),smooth:!0}),z.push({angle:m,smooth:!1});for(const H of z){const L=B$(H.angle-y);if(!(Math.abs(L)>$$)&&!(Math.abs(Math.sin(L))*x>w$)){h=H.angle,v=H.smooth;break}}}const b=i!==null&&i>0&&Math.abs(x-i)<=C$;if(h===null&&!b)return{point:e,guides:ho};const C=h??y,S=b?i:x,w={x:Math.cos(C),y:Math.sin(C)},D=S+(h===null?0:go),_=b?S:v?go:0;return{point:l({x:d.x+w.x*S,y:d.y+w.y*S}),guides:[{kind:"angle",a:{x:d.x-w.x*_,y:d.y-w.y*_},b:{x:d.x+w.x*D,y:d.y+w.y*D}}]}}const Gs=.1,Xs=8,q$=4,Rd=10,ya=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},xp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},qs=(e,t)=>{const n=ya(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Rd,y:n.y+o*Rd}},Us=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Gi=(e,t,n)=>{const i=Us(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,fo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<q$?.5:ha(r)},U$=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Us(e,n),p=Us(t,n),x=Math.min(Xs,Math.max(Gs,p>0?r*(u/p):r)),y=Gi(t,n,x);return{focalX:fo(t.width,y.width,d-t.x,{clamp:!1}),focalY:fo(t.height,y.height,c-t.y,{clamp:!1}),scale:x}},Pd=1.08,Xr=14,qr=8;function Y$({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:y}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,v=s.useRef(null),b=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const S=l==="image";s.useEffect(()=>{var W;S&&((W=m.current)==null||W.focus({preventScroll:!0}))},[S]);const w=s.useCallback((W,g)=>{var R;const E=(R=m.current)==null?void 0:R.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(W-E.left)/E.width*t.width,y:(g-E.top)/E.height*t.height}},[t.width,t.height]),D=W=>{var E,R;if(!i)return;W.stopPropagation(),W.preventDefault(),(E=m.current)==null||E.focus({preventScroll:!0});const g=Gi(n,i,p);v.current={pointerId:W.pointerId,origin:w(W.clientX,W.clientY),startX:Dn(n.width,g.width,c),startY:Dn(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(R=m.current)==null||R.setPointerCapture(W.pointerId)},_=(W,g)=>{var le,se;if(!i)return;W.stopPropagation(),W.preventDefault(),(le=m.current)==null||le.focus({preventScroll:!0});const E=Gi(n,i,p),R=Dn(n.width,E.width,c),G=Dn(n.height,E.height,u),Z={minX:R,minY:G,maxX:R+E.width,maxY:G+E.height},T=ya(Z,xp(g)),j=ya(Z,g),K=Math.hypot(j.x-T.x,j.y-T.y);!isFinite(K)||K<=0||(b.current={pointerId:W.pointerId,anchor:T,startDistance:K,startScale:p,startX:R,startY:G,moved:!1},(se=m.current)==null||se.setPointerCapture(W.pointerId))},z=W=>{if(!i)return;const g=b.current;if(g&&W.pointerId===g.pointerId){W.stopPropagation(),W.preventDefault();const R=w(W.clientX,W.clientY),G={x:R.x-n.x,y:R.y-n.y},Z=Math.hypot(G.x-g.anchor.x,G.y-g.anchor.y),T=Math.min(Xs,Math.max(Gs,g.startScale*(Z/g.startDistance)));if(!g.moved&&Math.abs(T-g.startScale)<1e-4)return;g.moved=!0;const j=T/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*j,le=g.anchor.y+(g.startY-g.anchor.y)*j,se=Gi(n,i,T);x({focalX:fo(n.width,se.width,K),focalY:fo(n.height,se.height,le),scale:T});return}const E=v.current;if(E&&W.pointerId===E.pointerId){W.stopPropagation(),W.preventDefault();const R=w(W.clientX,W.clientY),G=R.x-E.origin.x,Z=R.y-E.origin.y;if(!E.moved&&G===0&&Z===0)return;E.moved=!0,x({focalX:fo(n.width,E.width,E.startX+G),focalY:fo(n.height,E.height,E.startY+Z),scale:p})}},H=W=>{var R,G;const g=v.current;if(g&&W.pointerId===g.pointerId){v.current=null,W.stopPropagation(),(R=m.current)!=null&&R.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&y(C.current);return}const E=b.current;E&&W.pointerId===E.pointerId&&(b.current=null,W.stopPropagation(),(G=m.current)!=null&&G.hasPointerCapture(E.pointerId)&&m.current.releasePointerCapture(E.pointerId),E.moved&&y(C.current))},L=W=>{if(W.key==="Escape"){W.stopPropagation(),d("none");return}if(W.key==="="||W.key==="+"||W.key==="-"||W.key==="_"){W.preventDefault(),W.stopPropagation();const g=W.key==="="||W.key==="+",E=Math.min(Xs,Math.max(Gs,p*(g?Pd:1/Pd))),R={focalX:c,focalY:u,scale:E};x(R),y(R)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},k=s.useMemo(()=>{const W=i??{width:n.width,height:n.height},g=Gi(n,W,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Dn(n.width,g.width,c),y:n.y+Dn(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),F=k?{minX:k.x,minY:k.y,maxX:k.x+k.width,maxY:k.y+k.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${S?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:L,onPointerMove:z,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),S&&o&&k&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:k.x,y:k.y,width:k.width,height:k.height,children:[a.jsx("rect",{x:k.x,y:k.y,width:k.width,height:k.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:k.x,y:k.y,width:k.width,height:k.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:k.x,y:k.y,width:k.width,height:k.height})]}),S&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:D}),V.map(W=>{const g=qs(F,W),E=W==="ne"||W==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-qr/2,y:g.y-qr/2,width:qr,height:qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-Xr/2,y:g.y-Xr/2,width:Xr,height:Xr,onPointerDown:R=>_(R,W)})]},W)})]})]})}const Ys=10,K$=Ys*2,Hn=7,Z$=4,ao=9,J$=3.5,kd=1.08,Q$=.05,Ur=14,eC=1,Yr=14,Kr=8;function tC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:x}){const y=s.useRef(null),m=s.useRef(null),h=s.useRef(i);h.current=i;const v=s.useRef(null),b=s.useRef(null),C=s.useRef(null),S=s.useRef(null),[w,D]=s.useState([]),[_,z]=s.useState(ho),[H,L]=s.useState(null),V=s.useCallback(f=>{z(X=>z$(X,f)?X:f)},[]),$=d==="shape";s.useEffect(()=>{var f;$&&((f=y.current)==null||f.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||D(f=>f.length?[]:f)},[$]);const k=w.length>0;s.useEffect(()=>{u==null||u(k)},[k,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const F=n.width>0?t.width/n.width:1,W=n.height>0?t.height/n.height:1,g=Math.min(F,W),E=r&&l?g:F,R=r&&l?g:W,G=r&&l?(t.width-n.width*g)/2:0,Z=r&&l?(t.height-n.height*g)/2:0,T=s.useCallback(f=>r?{x:G+(f.x-n.x)*E,y:Z+(f.y-n.y)*R}:{x:f.x-n.x,y:f.y-n.y},[r,n,E,R,G,Z]),j=s.useCallback(f=>r?{x:n.x+(E>0?(f.x-G)/E:0),y:n.y+(R>0?(f.y-Z)/R:0)}:{x:n.x+f.x,y:n.y+f.y},[r,n,E,R,G,Z]),K=s.useMemo(()=>j({x:t.width/2,y:t.height/2}),[j,t.width,t.height]),le=s.useCallback((f,X)=>{var U;const N=(U=y.current)==null?void 0:U.getBoundingClientRect();if(!N||N.width<=0||N.height<=0)return{x:0,y:0};if(r){const me=(f-N.left)/N.width*t.width,Y=(X-N.top)/N.height*t.height;return{x:n.x+(E>0?(me-G)/E:0),y:n.y+(R>0?(Y-Z)/R:0)}}return{x:n.x+(f-N.left),y:n.y+(X-N.top)}},[r,n,t.width,t.height,E,R,G,Z]),se=s.useCallback((f,X)=>{var U;const N=(U=y.current)==null?void 0:U.getBoundingClientRect();return!N||N.width<=0||N.height<=0?{x:0,y:0}:{x:(f-N.left)/N.width*t.width,y:(X-N.top)/N.height*t.height}},[t.width,t.height]),M=s.useCallback((f,X)=>{const N=l&&!(X!=null&&X.preserveShape)?M$(f,n,t,G,Z,E,R):f;x(N,X)},[x,l,n,t,G,Z,E,R]),re=s.useCallback(()=>{L(null)},[]),q=s.useCallback((f,X,N)=>{if(!N||v.current||b.current||C.current||S.current){re();return}const U=se(f,X),me=ln(h.current,T);for(const te of me)for(const Ae of te.nodes)if(Math.hypot(Ae.p.x-U.x,Ae.p.y-U.y)<=ao){re();return}const Y=Cd(me,U);if(!Y||Y.distance>Ys){re();return}const I=me[Y.contour],ie=I==null?void 0:I.nodes[Y.segment],oe=I==null?void 0:I.nodes[(Y.segment+1)%((I==null?void 0:I.nodes.length)??1)],B=!!(ie&&oe&&!Bo(ie,oe));L(te=>te&&te.curved===B&&Math.hypot(te.point.x-Y.point.x,te.point.y-Y.point.y)<.25?te:{point:Y.point,curved:B})},[se,T,re]),ce=f=>{var Fe;const X=f.metaKey||f.ctrlKey,N=C.current;if(N&&f.pointerId===N.pointerId){if(f.stopPropagation(),f.preventDefault(),N.startDistance<=0)return;const et=le(f.clientX,f.clientY),Ue=Math.hypot(et.x-N.origin.x,et.y-N.origin.y),nt=Math.max(Q$,Ue/N.startDistance);if(!N.moved&&Math.abs(nt-1)<1e-4)return;N.moved=!0,p(bd(N.startContours,N.origin,nt));return}const U=b.current;if(U&&f.pointerId===U.pointerId){f.stopPropagation(),f.preventDefault();const et=le(f.clientX,f.clientY),{bbox:Ue}=U,nt=Ue.maxX-Ue.minX,tt=Ue.maxY-Ue.minY,Ve=et.x-U.origin.x,fe=et.y-U.origin.y;let He=Ve,Be=fe;if(isFinite(nt)&&isFinite(tt))if(r){let Ce=n.x,De=n.x+n.width,Xe=n.y,ge=n.y+n.height;l&&(E>0&&(Ce=n.x+(0-G)/E,De=n.x+(t.width-G)/E),R>0&&(Xe=n.y+(0-Z)/R,ge=n.y+(t.height-Z)/R));const Ee=Math.min(Ce,De-nt),ze=Math.max(Ce,De-nt),Re=Math.min(Xe,ge-tt),xe=Math.max(Xe,ge-tt),Ie=Math.min(ze,Math.max(Ee,Ue.minX+Ve)),Ye=Math.min(xe,Math.max(Re,Ue.minY+fe));He=Ie-Ue.minX,Be=Ye-Ue.minY}else{const Ce=Ue.minX-n.x,De=Ue.minY-n.y,Xe=Math.min(0,t.width-nt),ge=Math.max(0,t.width-nt),Ee=Math.min(0,t.height-tt),ze=Math.max(0,t.height-tt),Re=Math.min(ge,Math.max(Xe,Ce+Ve)),xe=Math.min(ze,Math.max(Ee,De+fe));He=Re-Ce,Be=xe-De}const Je=[];if(!X&&isFinite(nt)&&isFinite(tt)){const Ce=T({x:Ue.minX+nt/2+He,y:Ue.minY+tt/2+Be}),De={x:t.width/2,y:t.height/2};Math.abs(Ce.x-De.x)<=Ur&&(He=K.x-Ue.minX-nt/2,Je.push(Vs(De.x,"x",t))),Math.abs(Ce.y-De.y)<=Ur&&(Be=K.y-Ue.minY-tt/2,Je.push(Vs(De.y,"y",t)))}if(!U.moved&&He===0&&Be===0)return;U.moved=!0,V(Je.length?Je:ho),p(ln(U.startContours,Ce=>({x:Ce.x+He,y:Ce.y+Be})),{carryImage:!0});return}const me=S.current;if(me&&f.pointerId===me.pointerId){f.stopPropagation(),f.preventDefault();const et=le(f.clientX,f.clientY);let Ue=et.x-me.origin.x,nt=et.y-me.origin.y;if(f.shiftKey&&(Math.abs(Ue)>Math.abs(nt)?nt=0:Ue=0),!me.moved&&Ue===0&&nt===0)return;me.moved=!0,p(wd(me.startContours,me.selection,Ue,nt));return}const Y=v.current;if(!Y||f.pointerId!==Y.pointerId){q(f.clientX,f.clientY,w.length>0||$);return}re(),f.stopPropagation(),f.preventDefault();const I=le(f.clientX,f.clientY);if(Y.kind==="anchor"){const et={x:Y.anchor.x+(I.x-Y.origin.x),y:Y.anchor.y+(I.y-Y.origin.y)},Ue=X?[]:D$(h.current,{contour:Y.contour,node:Y.node}),nt=X||!Y.center?[]:[Y.center],tt=Ld(Td(Ue,nt.map(He=>He.x),"x"),et,"x",T,Ur),Ve=Ld(Td(Ue,nt.map(He=>He.y),"y"),et,"y",T,Ur),fe=X?et:{x:(tt==null?void 0:tt.value)??Gr(et.x,o),y:(Ve==null?void 0:Ve.value)??Gr(et.y,o)};if(f.shiftKey&&(Math.abs(fe.x-Y.anchor.x)>Math.abs(fe.y-Y.anchor.y)?fe.y=Y.anchor.y:fe.x=Y.anchor.x),!Y.moved&&fe.x===Y.anchor.x&&fe.y===Y.anchor.y)return;Y.moved=!0,V(V$(fe,tt,Ve,t,T)),p(F$(h.current,Y.contour,Y.node,fe));return}const ie=(Fe=h.current[Y.contour])==null?void 0:Fe.nodes[Y.node],oe=Y.mirror&&!f.altKey,B=oe||X?null:Y.kind==="in"?ie==null?void 0:ie.out:ie==null?void 0:ie.in,te=ie?T(ie.p):null,Ae=B?T(B):null,he=ie&&(!X||f.shiftKey)?X$(I,ie.p,oe||X?null:G$(h.current[Y.contour],Y.node,Y.kind,T),te&&Ae?Math.hypot(Ae.x-te.x,Ae.y-te.y):null,f.shiftKey,T,j):{point:I,guides:ho},Q=he.guides.length?he.point:X?I:{x:Gr(I.x,o),y:Gr(I.y,o)},Ze=Y.kind==="in"?ie==null?void 0:ie.in:ie==null?void 0:ie.out;!Y.moved&&Ze&&Q.x===Ze.x&&Q.y===Ze.y||(Y.moved=!0,V(he.guides),p(_$(h.current,Y.contour,Y.node,Y.kind,Q,oe)))},J=f=>{V(ho);const X=C.current;if(X&&f.pointerId===X.pointerId){C.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(X.pointerId)&&B.releasePointerCapture(X.pointerId),X.moved&&M(h.current,{preserveShape:!0});return}const N=b.current;if(N&&f.pointerId===N.pointerId){b.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),N.moved?M(h.current,{preserveShape:!0}):D([]);return}const U=S.current;if(U&&f.pointerId===U.pointerId){S.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(U.pointerId)&&B.releasePointerCapture(U.pointerId),U.moved&&M(h.current);return}const me=v.current;if(!me||f.pointerId!==me.pointerId)return;v.current=null,f.stopPropagation();const Y=y.current;Y!=null&&Y.hasPointerCapture(me.pointerId)&&Y.releasePointerCapture(me.pointerId);const I=Math.hypot(f.clientX-me.clientOrigin.x,f.clientY-me.clientOrigin.y);if(me.moved||I>Z$){me.moved&&M(h.current);return}if(!me.toggleOnRelease||f.type!=="pointerup")return;const oe=$d(h.current,me.contour,me.node);oe!==h.current&&(p(oe),M(oe))},be=f=>{f.stopPropagation()},We=f=>{var X,N;f.stopPropagation(),f.preventDefault(),re(),(X=y.current)==null||X.focus({preventScroll:!0}),b.current={pointerId:f.pointerId,origin:le(f.clientX,f.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(N=y.current)==null||N.setPointerCapture(f.pointerId)},ye=(f,X)=>{var I,ie;f.stopPropagation(),f.preventDefault(),re(),(I=y.current)==null||I.focus({preventScroll:!0}),D([]),c("shape");const N=Si(i),U=ya(N,xp(X)),me=qs(N,X),Y=Math.hypot(me.x-U.x,me.y-U.y);!isFinite(Y)||Y<=0||(C.current={pointerId:f.pointerId,corner:X,origin:U,startDistance:Y,startContours:zn(i),moved:!1},(ie=y.current)==null||ie.setPointerCapture(f.pointerId))},ue=(f,X,N,U)=>{var I,ie,oe,B;f.stopPropagation(),f.preventDefault(),re(),(I=y.current)==null||I.focus({preventScroll:!0});const me=(ie=i[N])==null?void 0:ie.nodes[U];if(!me)return;if(f.altKey){const te=X==="anchor"?vp(i,N,U):W$(i,N,U,X);if(te===i)return;D(X==="anchor"?[]:[{contour:N,node:U}]),p(te),M(te);return}const Y=f.metaKey||f.ctrlKey;if(X==="anchor"&&f.shiftKey&&!Y){D(te=>te.some(Ae=>Ae.contour===N&&Ae.node===U)?te.filter(Ae=>!(Ae.contour===N&&Ae.node===U)):[...te,{contour:N,node:U}]);return}if(X==="anchor"&&!Y&&w.length>1&&w.some(te=>te.contour===N&&te.node===U)){S.current={pointerId:f.pointerId,origin:le(f.clientX,f.clientY),startContours:zn(i),selection:w,moved:!1},(oe=y.current)==null||oe.setPointerCapture(f.pointerId);return}D([{contour:N,node:U}]),v.current={kind:X,contour:N,node:U,pointerId:f.pointerId,origin:le(f.clientX,f.clientY),clientOrigin:{x:f.clientX,y:f.clientY},anchor:me.p,center:E$(i),mirror:X!=="anchor"&&!!(me.in&&me.out),toggleOnRelease:Y,moved:!1},(B=y.current)==null||B.setPointerCapture(f.pointerId)},ee=f=>{f.stopPropagation(),f.preventDefault(),re();const X=ln(i,T),N=Cd(X,se(f.clientX,f.clientY));if(!N||N.distance>Ys)return;const{contours:U,nodeIndex:me}=H$(i,N.contour,N.segment,N.t);me<0||(D([{contour:N.contour,node:me}]),p(U),M(U))},de=f=>{if(f.key==="="||f.key==="+"||f.key==="-"||f.key==="_"){f.preventDefault(),f.stopPropagation();const Y=Si(i);if(!isFinite(Y.minX)||!isFinite(Y.maxX))return;const I={x:(Y.minX+Y.maxX)/2,y:(Y.minY+Y.maxY)/2},oe=f.key==="="||f.key==="+"?kd:1/kd,B=bd(i,I,oe);p(B),M(B,{preserveShape:!0});return}if(f.key==="Escape"){f.stopPropagation(),D([]),c("none");return}if(!w.length)return;if(f.key==="Backspace"||f.key==="Delete"){f.preventDefault(),f.stopPropagation();const Y=N$(i,w);if(Y===i)return;D([]),p(Y),M(Y);return}const X=o>0?o:eC,N=f.shiftKey?X*10:X,U={ArrowLeft:[-N,0],ArrowRight:[N,0],ArrowUp:[0,-N],ArrowDown:[0,N]}[f.key];if(!U)return;f.preventDefault(),f.stopPropagation();const me=wd(i,w,U[0],U[1]);p(me),M(me)},ne=s.useMemo(()=>No(ln(i,T)),[i,T]),Pe=s.useMemo(()=>Si(i),[i]),Te=T({x:Pe.minX,y:Pe.minY}),Oe={width:T({x:Pe.maxX,y:Pe.minY}).x-Te.x,height:T({x:Pe.minX,y:Pe.maxY}).y-Te.y},ve=$&&w.length===0&&isFinite(Pe.minX)&&isFinite(Pe.maxX)&&Pe.maxX>Pe.minX&&Pe.maxY>Pe.minY,Se=w.length>0||$,$e=Se;return a.jsxs("svg",{ref:y,className:`${e}-editor${Se?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:de,onPointerDown:()=>{var f;return(f=y.current)==null?void 0:f.focus({preventScroll:!0})},onPointerMove:ce,onPointerLeave:re,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:J,onContextMenu:f=>{f.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{D([]),c("none")},onClick:ee}),$e&&a.jsx("path",{className:`${e}-editor-outline`,d:ne}),$e&&_.map((f,X)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${f.kind}`,x1:f.a.x,y1:f.a.y,x2:f.b.x,y2:f.b.y},`${f.kind}-${X}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:ne,fillRule:"evenodd",onPointerDown:We,onClick:ee}),$e&&a.jsx("path",{className:`${e}-editor-hit`,d:ne,style:{strokeWidth:K$},onClick:ee}),$e&&H&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:H.point.x-Hn/2,y:H.point.y-Hn/2,width:Hn,height:Hn,rx:H.curved?Hn/2:0}),$e&&i.map((f,X)=>f.nodes.map((N,U)=>{const me=w.some(I=>I.contour===X&&I.node===U),Y=T(N.p);return a.jsxs("g",{children:[me&&w.length===1&&["in","out"].map(I=>{const ie=N[I];if(!ie)return null;const oe=T(ie);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:Y.x,y1:Y.y,x2:oe.x,y2:oe.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:oe.x,cy:oe.y,r:J$}),a.jsx("circle",{className:`${e}-editor-grab`,cx:oe.x,cy:oe.y,r:ao,onPointerDown:B=>ue(B,I,X,U),onClick:be})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${me?` ${e}-editor-anchor-selected`:""}`,x:Y.x-Hn/2,y:Y.y-Hn/2,width:Hn,height:Hn,rx:pp(N)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:Y.x-ao,y:Y.y-ao,width:ao*2,height:ao*2,onPointerDown:I=>ue(I,"anchor",X,U),onClick:be,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const ie=$d(i,X,U);p(ie),M(ie)}})]},`${X}-${U}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:Te.x,y:Te.y,width:Oe.width,height:Oe.height}),["nw","ne","se","sw"].map(f=>{const X=T(qs(Pe,f)),N=f==="ne"||f==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:X.x-Kr/2,y:X.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${N?` ${e}-editor-scale-grab-nesw`:""}`,x:X.x-Yr/2,y:X.y-Yr/2,width:Yr,height:Yr,onPointerDown:U=>ye(U,f),onClick:be})]},f)})]})]})}const nC=4e3,iC=/^(?:https?:|mailto:|tel:)/i;function bp(e){return!!e&&typeof e=="object"&&e.type==="link"}function oC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!iC.test(t)))return t}function rC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(bp(c)){o(c.children??[],oC(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ed(e){return{...e.fontFamily&&{fontFamily:Oo(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function aC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(bp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Md(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,y=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||y<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const v=Math.max(1,m*.5),b=y*d$;let C=0,S=0,w=0,D=t[0].para,_=0,z=0,H=null;for(;C<t.length&&w<nC;){const L=S+y>c;if(L&&!u)break;const V=t[C].para;if(V>D+1){S+=y*(V-D-1),D=V-1,w+=1;continue}let $=L?[{x0:0,x1:d}]:v$(i,(S+b)/c,(S+y-b)/c,o).map(F=>({x0:F.x0*d,x1:F.x1*d}));p>0&&x>0&&!L&&$.length&&(H===null&&(H=w,_=$[0].x0,z=S),w-H<x&&($=y$($,{x0:_,x1:_+p})));const k=$.reduce((F,W)=>Math.max(F,W.x1-W.x0),0);for(const F of $){const W=F.x1-F.x0;if(W<v)continue;if(C>=t.length||t[C].para!==V)break;const g=C;let E=0;for(;C<t.length&&t[C].para===V;){const R=n[C]*l,G=C===g?R:m+R;if(E+G>W&&!(C===g&&W>=k-.5&&R>d-.5))break;E+=G,C+=1}if(C>g){const R=C>=t.length||t[C].para!==V;h.push({top:S,left:F.x0,width:W,from:g,to:C,justify:r==="justify"&&!R})}if(C>=t.length||t[C].para!==V)break}D=V,S+=y,w+=1}return{segments:h,placed:C,height:h.length?S:0,capLeft:_,capTop:z}}const sC=.12,lC=2,cC=10,xs=.25,dC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},uC=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,pC=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=dC(e);(!r||!uC(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},bs=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},Zr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function mC(){return typeof document>"u"?null:document.body}function gC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:y,dropCapSize:m,showGuides:h,typography:v,imageUrl:b,imageFocalX:C,imageFocalY:S,imageScale:w,imageCustomPath:D,pathDragActive:_,pathCarryImage:z,onCarryImageConsumed:H,pathEditor:L,imageEditor:V}){var De,Xe;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[k,F]=s.useState(null),W=s.useRef(null),[g,E]=s.useState({width:0,height:0}),[R,G]=s.useState(null),[Z,T]=s.useState(0),[j,K]=s.useState("none");s.useEffect(()=>{!L&&!V&&K("none")},[L,V]);const[le,se]=s.useState(null);s.useEffect(()=>{if(!b||typeof Image>"u"){se(null);return}let ge=!1;const Ee=new Image;return Ee.onload=()=>{ge||se({width:Ee.naturalWidth,height:Ee.naturalHeight})},Ee.src=b,()=>{ge=!0}},[b]);const M=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),re=s.useMemo(()=>rC(M),[M]),q=s.useMemo(()=>aC(M),[M]),ce=y>0&&m>1?((Xe=(De=re[0])==null?void 0:De.text)==null?void 0:Xe.charAt(0))??"":"",J=(L==null?void 0:L.contours)??null,be=s.useMemo(()=>{let ge=[];if(J){const Ee=yr(J);Ee.length&&(ge=So(Ee,r))}if(!ge.length){const Ee=i.trim(),ze=Ee?fd(Ee,o,r):null;ze&&ze.length?ge=ze:ge=Ds(n==="custom"?"rectangle":n)}return n==="circle"?bs(ge,g):ge},[J,n,i,o,r,g.width,g.height]),We=L==null?void 0:L.onConvert,ye=(L==null?void 0:L.needsConversion)??!1,ue=s.useMemo(()=>{if(n==="circle")return!1;const ge=J??(i.trim()?Li(i):null);return!!(ge&&fp(ge,r))},[J,i,r,n]),[ee,de]=s.useState(null);Zr(()=>{if(!ue){ee&&de(null);return}!ee&&g.width>0&&g.height>0&&de({width:g.width,height:g.height})},[ue,g.width,g.height,ee]);const ne=s.useMemo(()=>{if(!ue||g.width<=0||g.height<=0)return be;const ge=ee??g,Ee=r.width/ge.width,ze=r.height/ge.height;return be.map(Re=>Re.map(xe=>({x:xe.x*Ee,y:xe.y*ze})))},[be,ue,ee,r.width,r.height,g.width,g.height]),Pe=s.useMemo(()=>{if(J){const Re=yr(J);if(Re.length){const xe=So(Re,r);return n==="circle"?bs(xe,g):xe}}const ge=D.trim(),Ee=ge?fd(ge,o,r):null,ze=Ee&&Ee.length?Ee:Ds(n==="custom"?"rectangle":n);return n==="circle"?bs(ze,g):ze},[J,n,D,o,r,g.width,g.height]),Te=s.useMemo(()=>{if(!ue||g.width<=0||g.height<=0)return Pe;const ge=ee??g,Ee=r.width/ge.width,ze=r.height/ge.height;return Pe.map(Re=>Re.map(xe=>({x:xe.x*Ee,y:xe.y*ze})))},[Pe,ue,ee,r.width,r.height,g.width,g.height]),Oe=s.useRef(null),ve=s.useRef(!1);s.useEffect(()=>{if(!(!We||g.width<=0||g.height<=0)){if(ue){if(Oe.current===i)return;const ge=J??(i.trim()?Li(i):null);if(!(ge!=null&&ge.length))return;const Ee=ln(ge,ze=>({x:r.x+(ze.x-r.x)/g.width*r.width,y:r.y+(ze.y-r.y)/g.height*r.height}));Oe.current=No(Ee),We(Ee);return}!ye||!be.length||ve.current||(ve.current=!0,We(ln(hp(be),ge=>({x:ge.x*fa,y:ge.y*fa}))))}},[ye,ue,We,be,J,i,r,g.width,g.height]),Zr(()=>{const ge=k;if(!ge||typeof ResizeObserver>"u")return;const Ee=()=>{const Re=ge.getBoundingClientRect();E(xe=>Math.abs(xe.width-Re.width)<.5&&Math.abs(xe.height-Re.height)<.5?xe:{width:Re.width,height:Re.height})};Ee();const ze=new ResizeObserver(Ee);return ze.observe(ge),()=>ze.disconnect()},[k]),s.useEffect(()=>{const ge=typeof document<"u"?document.fonts:void 0;ge!=null&&ge.ready&&ge.ready.then(()=>{T(Ee=>Ee+1)})},[]),Zr(()=>{const ge=W.current;if(!ge)return;if(!re.length){G(null);return}const Ee=[],ze=document.createDocumentFragment();for(const Qe of re){const dt=document.createElement("span");Object.assign(dt.style,Ed(Qe.leaf)),dt.textContent=Qe.text,ze.appendChild(dt),Ee.push(dt)}const Re=document.createElement("span");Re.textContent=" ",ze.appendChild(Re);const xe=ce||"H",Ie=document.createElement("span");Ie.textContent=xe,Ie.style.lineHeight="1",ze.appendChild(Ie),ge.replaceChildren(ze);const Ye=window.getComputedStyle(ge),Ne=parseFloat(Ye.fontSize)||16,it=parseFloat(Ye.lineHeight),ot=Number.isNaN(it)?Ne*1.2:it,rt=Math.max(ot,Ne),ht=document.createElement("span");ht.textContent=xe,ht.style.lineHeight=`${rt}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",ht.appendChild(Pt),ge.appendChild(ht);const kt=ht.getBoundingClientRect().top,ut=Pt.getBoundingClientRect().top,gt=Math.max(1,ut-kt);ht.remove();let $t=gt*.8;const ft=document.createElement("canvas").getContext("2d"),At=Qe=>`${Ye.fontStyle} ${Ye.fontWeight} ${Qe}px ${Ye.fontFamily}`;if(ft){ft.font=At(Ne);const Qe=ft.measureText(xe).actualBoundingBoxAscent;Qe>0&&($t=Qe)}const zt=m>1?(m-1)*rt+$t:$t;let jt=Ne*(zt/$t);if(ft){ft.font=At(jt);const Qe=ft.measureText(xe).actualBoundingBoxAscent;Qe>0&&(jt=jt*(zt/Qe))}Ie.style.fontSize=`${jt}px`,Ie.style.lineHeight=`${jt}px`;const Zt=document.createElement("span");Zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ie.appendChild(Zt);const Ct=Math.max(1,Zt.getBoundingClientRect().top-Ie.getBoundingClientRect().top);Zt.remove();const rn=(m-1)*rt+gt-Ct,lt=Ee.map(Qe=>Qe.getBoundingClientRect().width),ke=Re.getBoundingClientRect().width,je=ce?Ie.getBoundingClientRect().width:0;ge.replaceChildren(),G({widths:lt,spaceWidth:ke,lineHeight:rt,capWidth:je,dropCapFontSize:jt,dropCapTopAdjust:rn})},[re,v,ce,y,m,Z,g.width]);const Se=R&&ce?R.capWidth+R.lineHeight*sC:0,$e=Math.max(y,Math.ceil(m)),f=s.useMemo(()=>{if(!R||!re.length||g.width<=0||g.height<=0||!u)return 1;const ge=Re=>Md({tokens:re,widths:R.widths,spaceWidth:R.spaceWidth,lineHeight:R.lineHeight,width:g.width,height:g.height,rings:ne,mode:l,align:d,scale:Re,allowOverflow:!1,capInset:Se*Re,capLines:ce?$e:0});if(ge(1).placed>=re.length)return 1;if(ge(xs).placed<re.length)return xs;let Ee=xs,ze=1;for(let Re=0;Re<cC;Re+=1){const xe=(Ee+ze)/2;ge(xe).placed>=re.length?Ee=xe:ze=xe}return Ee},[R,re,g.width,g.height,ne,l,d,u,Se,ce,$e]);s.useEffect(()=>{x(f)},[f,x]);const X=u?Math.min(p,f):1,N=s.useMemo(()=>!R||!re.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Md({tokens:re,widths:R.widths,spaceWidth:R.spaceWidth,lineHeight:R.lineHeight,width:g.width,height:g.height,rings:ne,mode:l,align:d,scale:X,allowOverflow:c,capInset:Se*X,capLines:ce?$e:0}),[R,re,g.width,g.height,ne,l,d,X,c,Se,ce,$e]),U=R?R.dropCapFontSize*X:0,me=R?R.dropCapTopAdjust*X:0,Y=d==="justify"?"left":d,I=!!(L&&J&&g.width>0&&g.height>0),ie=!!V,oe=(I||ie)&&g.width>0&&g.height>0,B=pC(k,oe),te=oe&&B?mC():null,Ae=s.useRef(!1),he=s.useCallback(ge=>{Ae.current=ge},[]);s.useEffect(()=>{if(!I&&!ie)return;const ge=Ee=>{const ze=k;if(!ze)return;const Re=ze.getBoundingClientRect();Ee.clientX>=Re.left&&Ee.clientX<=Re.right&&Ee.clientY>=Re.top&&Ee.clientY<=Re.bottom&&(Ee.preventDefault(),Ee.stopPropagation(),K(Ie=>Ie==="shape"&&Ae.current?Ie:Ie==="shape"&&ie?"image":I?"shape":"image"))};return document.addEventListener("dblclick",ge,!0),()=>document.removeEventListener("dblclick",ge,!0)},[I,ie,k]);const Q=s.useMemo(()=>b&&g.width>0&&g.height>0?u$(Te,g):null,[b,Te,g.width,g.height]),Ze=s.useRef(null),Fe=(()=>{const ge=Ze.current;return z||!V||!le||!Q||!ge||D===ge.customPath||ge.shape!==n&&n!=="custom"?null:U$(ge.bounds,Q,le,ge.focalX,ge.focalY,ge.scale)})();Zr(()=>{if(_||!V||!le||!Q)return;const ge=Ze.current,Ee=!!(ge&&D!==ge.customPath);Ee&&Fe&&V.onCommit(Fe),Ee&&z&&(H==null||H()),Ze.current={rings:Te,bounds:Q,focalX:(Fe==null?void 0:Fe.focalX)??C,focalY:(Fe==null?void 0:Fe.focalY)??S,scale:(Fe==null?void 0:Fe.scale)??w,customPath:D,shape:n}},[_,z,D,n,Te,Q,V,le,C,S,w,Fe,H]);const et=Ze.current,Ue=!!(_&&!z&&et&&!Fe),nt=Ue&&et?et.focalX:(Fe==null?void 0:Fe.focalX)??C,tt=Ue&&et?et.focalY:(Fe==null?void 0:Fe.focalY)??S,Ve=Ue&&et?et.scale:(Fe==null?void 0:Fe.scale)??w,fe=Ue&&et?et.bounds:Q,He=s.useMemo(()=>{if(!(g.width>0)||!(g.height>0))return"";let ge=vd(i,J,o,r,n,g);if(ue){const Ee=ee??g,ze=r.width/Ee.width,Re=r.height/Ee.height;ge=ln(ge,xe=>({x:xe.x*ze,y:xe.y*Re}))}return xd(ge,g)||hd(ne,g)},[i,J,o,r,n,g.width,g.height,ue,ee,ne]),Be=s.useMemo(()=>{if(!b||!(g.width>0)||!(g.height>0))return"";let ge=vd(D,J,o,r,n,g);if(ue){const Ee=ee??g,ze=r.width/Ee.width,Re=r.height/Ee.height;ge=ln(ge,xe=>({x:xe.x*ze,y:xe.y*Re}))}return xd(ge,g)||hd(Te,g)},[b,D,J,o,r,n,g.width,g.height,ue,ee,Te]),Je=`${$}-clip`,Ce=s.useMemo(()=>{if(!fe)return null;const ge=le??{width:fe.width,height:fe.height},Ee=Gi(fe,ge,Ve);return{x:Dn(fe.width,Ee.width,nt),y:Dn(fe.height,Ee.height,tt),width:Ee.width,height:Ee.height}},[fe,le,nt,tt,Ve]);return a.jsxs("div",{className:`${e}-column`,ref:F,children:[He?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:He,fillRule:"evenodd"}),b&&Be&&fe&&Ce?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Je,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:b,x:fe.x+Ce.x,y:fe.y+Ce.y,width:Ce.width,height:Ce.height,preserveAspectRatio:"none",clipPath:`url(#${Je})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...v,["--"+e+"-fit"]:X},children:[a.jsx("div",{className:`${e}-measure`,ref:W,style:v,"aria-hidden":!0}),N.segments.map((ge,Ee)=>{const ze=re.slice(ge.from,ge.to),Re=Ee===0;return a.jsx("div",{className:`${e}-line${ge.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${ge.top}px`,left:`${ge.left}px`,width:`${ge.width}px`,textAlign:ge.justify?void 0:Y},children:ze.map((xe,Ie)=>{const Ne=ce&&Re&&ge.from===0&&Ie===0?xe.text.slice(1):xe.text,it=Ed(xe.leaf),ot=xe.href?a.jsx("a",{className:`${e}-link`,href:xe.href,target:xe.target,rel:xe.target?"noopener noreferrer":void 0,style:it,children:Ne}):a.jsx("span",{style:it,children:Ne});return a.jsxs("span",{children:[!ge.justify&&Ie>0?" ":null,ot]},Ie)})},`${ge.from}-${ge.to}-${Ee}`)}),h&&!J&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map((ge,Ee)=>a.jsx("polygon",{points:ge.map(ze=>`${ze.x},${ze.y}`).join(" ")},Ee))})]}),ce&&R&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...v,top:`${N.capTop+me}px`,left:`${N.capLeft}px`,fontSize:`${U}px`,lineHeight:`${U}px`},children:ce}),te&&B&&(J&&L||V)&&ri.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:B.top,left:B.left,width:B.width,height:B.height,zIndex:lC,pointerEvents:"none"},children:[J&&L&&a.jsx(tC,{P:e,box:{width:B.width,height:B.height},viewBox:r,contours:J,snap:L.snap,stretchToBox:!ue,uniformStretch:n==="circle",stage:j,onStageChange:K,onSelectionChange:he,onChange:L.onChange,onCommit:L.onCommit}),V&&fe&&a.jsx(Y$,{P:e,box:{width:B.width,height:B.height},bounds:fe,natural:le,imageUrl:b,maskPath:Be,stage:j,onStageChange:K,focalX:nt,focalY:tt,scale:Ve,onChange:V.onChange,onCommit:V.onCommit})]}),te),a.jsx("div",{className:`${e}-a11y`,children:q.map((ge,Ee)=>a.jsx("p",{children:ge},Ee))})]})}const Sp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],hC={x:0,y:0,width:100,height:100},fC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hC:{x:t[0],y:t[1],width:t[2],height:t[3]}},yC=e=>`
26508
+ `;function Zo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function mi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function kl(e){return{[mi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[mi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[mi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[mi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[mi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[mi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[mi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[mi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const e$=kl(""),t$=kl("open"),n$=kl("compact"),i$=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],o$=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],r$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Kn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},hs={fontWeight:400,fontStyle:"normal"},Vr={d:"Always",t:"Open Only",m:"Open Only"},a$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],s$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],l$={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{default:"Link Default",hover:"Link Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{open:"Link Default","open-hover":"Link Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{default:"Close Default",hover:"Close Hover",open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},textWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...a$]}},stateOverrides:{type:"object",scope:"common"},gap:Zo("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:Zo("Text padding left"),textPaddingRight:Zo("Text padding right"),textPaddingTop:Zo("Text padding top"),textPaddingBottom:Zo("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...e$,...t$,...n$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:Vr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:Vr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactCloseButtonColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:hs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:hs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:hs,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666",closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",showIcon:"on",iconSize:30/375,textWidth:240/375,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Kn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",showIcon:"on",iconSize:16/768,textWidth:300/768,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Kn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",showIcon:"on",iconSize:20/1440,textWidth:300/1440,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Kn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Kn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Kn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:i$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:o$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:r$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...s$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},c$={element:Jw,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:l$,sourceCode:Qw,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},md=120,gd=3,d$=.12,El={x:0,y:0,width:100,height:100};function So(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ha(e){return e<0?0:e>1?1:e}function hd(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function u$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function p$(e){return e.map(([t,n])=>({x:t,y:n}))}function fs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function m$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ha(n[o]),l=ha(n[o+1]);l>r&&i.push({x0:r,x1:l})}return g$(i)}function g$(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function h$(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function f$(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function y$(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function v$(e,t,n,i){let o=null;for(let r=0;r<gd;r+=1){const l=ha(t+(n-t)*r/Math.max(1,gd-1)),d=m$(e,l),c=i==="avoid"?f$(d):d;if(o=o===null?c:h$(o,c),o.length===0)return[]}return o??[]}function fd(e,t="stretch",n=El){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=yr(l);if(d.length)return t==="viewbox"?So(d,n):fs(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",x),u.appendChild(y);let m=0;try{m=y.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let v=0;v<md;v+=1){const b=y.getPointAtLength(v/md*m);h.push({x:b.x,y:b.y})}p.push(h)}return p.length?t==="viewbox"?So(p,n):fs(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?So([r],n):fs([r])}const Ml={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Hs="0 0 100 100",fa=100,Os=16,x$=12,b$=16,ys=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,S$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,yd=Math.PI/4,w$=8,$$=Math.PI/18,C$=8,go=24,ho=[];function T$(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function vs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function L$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function I$(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function vd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=vs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?vs(c,i):L$(c))}if(!l.length){const c=o!=="custom"?Ml[o]:void 0;c?l=vs(Li(c),El):l=T$()}}return o==="circle"?I$(l,r):l}function xd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":No(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function Ds(e){const t=e==="rectangle"||e==="custom"?void 0:Ml[e];return t?So(yr(Li(t)),El):[p$([[0,0],[1,0],[1,1],[0,1]])]}function R$(e){const t=e.match(S$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function $n(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function zs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function P$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(P$)}))}function ln(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function bd(e,t,n,i=n){return ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function k$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),y=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*y+x*m,v=-x*y+p*m,b=h*h/(d*d)+v*v/(c*c);if(b>1){const Z=Math.sqrt(b);d*=Z,c*=Z}const C=o===r?-1:1,S=d*d*v*v+c*c*h*h,w=Math.max(0,d*d*c*c-S),D=S===0?0:C*Math.sqrt(w/S),_=D*d*v/c,z=-D*c*h/d,H=p*_-x*z+(e.x+l.x)/2,L=x*_+p*z+(e.y+l.y)/2,V=Math.atan2((v-z)/c,(h-_)/d);let k=Math.atan2((-v-z)/c,(-h-_)/d)-V;!r&&k>0&&(k-=Math.PI*2),r&&k<0&&(k+=Math.PI*2);const F=Math.max(1,Math.ceil(Math.abs(k)/(Math.PI/2))),W=k/F,g=4/3*Math.tan(W/4),E=(Z,T)=>({x:H+p*d*Z-x*c*T,y:L+x*d*Z+p*c*T}),R=[];let G=V;for(let Z=0;Z<F;Z+=1){const T=G+W,j=Math.cos(G),K=Math.sin(G),le=Math.cos(T),se=Math.sin(T);R.push({c1:E(j-g*K,K+g*j),c2:E(le+g*se,se-g*le),p:Z===F-1?cn(l):E(le,se)}),G=T}return R}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:Vn(h??null,m),out:null}),r=m},x=m=>{if(!i.length)return;const h=i[i.length-1];h.out=Vn(m,h.p)};ys.lastIndex=0;let y=ys.exec(t);for(;y!==null;){const m=y[1],h=m.toUpperCase(),v=m!==h,b=R$(y[2]),C=S=>v?{x:r.x+b[S],y:r.y+b[S+1]}:{x:b[S],y:b[S+1]};if(h==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(h==="M"){for(let S=0;S+1<b.length;S+=2){const w=C(S);S===0&&(u(),l=cn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let S=0;S+1<b.length;S+=2)p(C(S));d=null,c=null}else if(h==="H"){for(const S of b)p({x:v?r.x+S:S,y:r.y});d=null,c=null}else if(h==="V"){for(const S of b)p({x:r.x,y:v?r.y+S:S});d=null,c=null}else if(h==="C"){for(let S=0;S+5<b.length;S+=6){const w=C(S),D=C(S+2),_=C(S+4);x(w),p(_,D),d=D}c=null}else if(h==="S"){for(let S=0;S+3<b.length;S+=4){const w=d?zs(d,r):cn(r),D=C(S),_=C(S+2);x(w),p(_,D),d=D}c=null}else if(h==="Q")for(let S=0;S+3<b.length;S+=4){const w=C(S),D=C(S+2);x($n(r,w,2/3)),p(D,$n(D,w,2/3)),c=w,d=null}else if(h==="T")for(let S=0;S+1<b.length;S+=2){const w=c?zs(c,r):cn(r),D=C(S);x($n(r,w,2/3)),p(D,$n(D,w,2/3)),c=w,d=null}else if(h==="A")for(let S=0;S+6<b.length;S+=7){const w=v?{x:r.x+b[S+5],y:r.y+b[S+6]}:{x:b[S+5],y:b[S+6]};for(const D of k$(r,b[S],b[S+1],b[S+2],b[S+3]!==0,b[S+4]!==0,w))x(D.c1),p(D.p,D.c2);d=null,c=null}y=ys.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function pp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Bo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Sd(e,t){if(Bo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(t.p.y)}`}function No(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Sd(r,l)),r=l;if(n.closed){const l=Sd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function mp(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function Bs(e,t,n){if(Bo(e,t))return $n(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function yr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of mp(n)){if(Bo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Os;r+=1)i.push(Bs(o.from,o.to,r/Os))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of yr(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function E$(e){const t=Si(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function gp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function hp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=x$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/b$)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:cn(r),...gp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function fp(e,t,n=1){if(!e.length)return!1;const i=Si(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function M$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,x=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+x/c}})}function A$(e,t){if(!e.length)return e;const n=Si(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function yp(e){const t={x:0,y:0,width:fa,height:fa},n=e!=="custom"?Ml[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(hp(Ds("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=A$(i,t);return{shape:e,customPath:No(o),pathFit:"viewbox",pathViewBox:Hs}}function Gr(e,t){return t>0?Math.round(e/t)*t:e}function F$(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function wd(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function N$(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=vp(i,r,d)}),i}function _$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=zs(o,c.p)}return d}function W$(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=zn(e);return r[t].nodes[n][i]=null,r}function H$(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=zn(e),c=d[t].nodes,u=n+1;if(Bo(r,l))return c.splice(u,0,{p:$n(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,y=$n(r.p,p,i),m=$n(p,x,i),h=$n(x,l.p,i),v=$n(y,m,i),b=$n(m,h,i),C=$n(v,b,i),S=(n+1)%o.nodes.length;return c[n].out=y,c[S].in=h,c.splice(u,0,{p:C,in:v,out:b}),{contours:d,nodeIndex:u}}function vp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=zn(e);return o[t].nodes.splice(n,1),o}function $d(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=zn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,x=!!Vn(l[u].out,l[u].p),y=!!Vn(l[p].in,l[p].p);if(pp(d)||x||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=gp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function O$(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Cd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of mp(i)){const l=Bo(r.from,r.to)?1:Os;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=O$(t,Bs(r.from,r.to,c),Bs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function D$(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Td(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Ld(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function z$(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function B$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function js(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function j$(e,t){const n=js(e,t);return n?{kind:"align",a:{x:e.x-n.x*go,y:e.y-n.y*go},b:{x:t.x+n.x*go,y:t.y+n.y*go}}:{kind:"align",a:e,b:t}}function Vs(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Id(e,t,n,i,o){if(e.axis===null)return j$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return Vs(o(r)[t],t,i)}function V$(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Id(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Id(n,"y",l,i,o)),r}function G$(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return js(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return js(i(p),r)}function X$(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ho};const y=Math.atan2(p,u),m=Math.round(y/yd)*yd;let h=o?m:null,v=!1;if(!o){const z=[];n&&z.push({angle:Math.atan2(n.y,n.x),smooth:!0}),z.push({angle:m,smooth:!1});for(const H of z){const L=B$(H.angle-y);if(!(Math.abs(L)>$$)&&!(Math.abs(Math.sin(L))*x>w$)){h=H.angle,v=H.smooth;break}}}const b=i!==null&&i>0&&Math.abs(x-i)<=C$;if(h===null&&!b)return{point:e,guides:ho};const C=h??y,S=b?i:x,w={x:Math.cos(C),y:Math.sin(C)},D=S+(h===null?0:go),_=b?S:v?go:0;return{point:l({x:d.x+w.x*S,y:d.y+w.y*S}),guides:[{kind:"angle",a:{x:d.x-w.x*_,y:d.y-w.y*_},b:{x:d.x+w.x*D,y:d.y+w.y*D}}]}}const Gs=.1,Xs=8,q$=4,Rd=10,ya=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},xp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},qs=(e,t)=>{const n=ya(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Rd,y:n.y+o*Rd}},Us=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Gi=(e,t,n)=>{const i=Us(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,fo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<q$?.5:ha(r)},U$=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Us(e,n),p=Us(t,n),x=Math.min(Xs,Math.max(Gs,p>0?r*(u/p):r)),y=Gi(t,n,x);return{focalX:fo(t.width,y.width,d-t.x,{clamp:!1}),focalY:fo(t.height,y.height,c-t.y,{clamp:!1}),scale:x}},Pd=1.08,Xr=14,qr=8;function Y$({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:y}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,v=s.useRef(null),b=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const S=l==="image";s.useEffect(()=>{var W;S&&((W=m.current)==null||W.focus({preventScroll:!0}))},[S]);const w=s.useCallback((W,g)=>{var R;const E=(R=m.current)==null?void 0:R.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(W-E.left)/E.width*t.width,y:(g-E.top)/E.height*t.height}},[t.width,t.height]),D=W=>{var E,R;if(!i)return;W.stopPropagation(),W.preventDefault(),(E=m.current)==null||E.focus({preventScroll:!0});const g=Gi(n,i,p);v.current={pointerId:W.pointerId,origin:w(W.clientX,W.clientY),startX:Dn(n.width,g.width,c),startY:Dn(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(R=m.current)==null||R.setPointerCapture(W.pointerId)},_=(W,g)=>{var le,se;if(!i)return;W.stopPropagation(),W.preventDefault(),(le=m.current)==null||le.focus({preventScroll:!0});const E=Gi(n,i,p),R=Dn(n.width,E.width,c),G=Dn(n.height,E.height,u),Z={minX:R,minY:G,maxX:R+E.width,maxY:G+E.height},T=ya(Z,xp(g)),j=ya(Z,g),K=Math.hypot(j.x-T.x,j.y-T.y);!isFinite(K)||K<=0||(b.current={pointerId:W.pointerId,anchor:T,startDistance:K,startScale:p,startX:R,startY:G,moved:!1},(se=m.current)==null||se.setPointerCapture(W.pointerId))},z=W=>{if(!i)return;const g=b.current;if(g&&W.pointerId===g.pointerId){W.stopPropagation(),W.preventDefault();const R=w(W.clientX,W.clientY),G={x:R.x-n.x,y:R.y-n.y},Z=Math.hypot(G.x-g.anchor.x,G.y-g.anchor.y),T=Math.min(Xs,Math.max(Gs,g.startScale*(Z/g.startDistance)));if(!g.moved&&Math.abs(T-g.startScale)<1e-4)return;g.moved=!0;const j=T/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*j,le=g.anchor.y+(g.startY-g.anchor.y)*j,se=Gi(n,i,T);x({focalX:fo(n.width,se.width,K),focalY:fo(n.height,se.height,le),scale:T});return}const E=v.current;if(E&&W.pointerId===E.pointerId){W.stopPropagation(),W.preventDefault();const R=w(W.clientX,W.clientY),G=R.x-E.origin.x,Z=R.y-E.origin.y;if(!E.moved&&G===0&&Z===0)return;E.moved=!0,x({focalX:fo(n.width,E.width,E.startX+G),focalY:fo(n.height,E.height,E.startY+Z),scale:p})}},H=W=>{var R,G;const g=v.current;if(g&&W.pointerId===g.pointerId){v.current=null,W.stopPropagation(),(R=m.current)!=null&&R.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&y(C.current);return}const E=b.current;E&&W.pointerId===E.pointerId&&(b.current=null,W.stopPropagation(),(G=m.current)!=null&&G.hasPointerCapture(E.pointerId)&&m.current.releasePointerCapture(E.pointerId),E.moved&&y(C.current))},L=W=>{if(W.key==="Escape"){W.stopPropagation(),d("none");return}if(W.key==="="||W.key==="+"||W.key==="-"||W.key==="_"){W.preventDefault(),W.stopPropagation();const g=W.key==="="||W.key==="+",E=Math.min(Xs,Math.max(Gs,p*(g?Pd:1/Pd))),R={focalX:c,focalY:u,scale:E};x(R),y(R)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},k=s.useMemo(()=>{const W=i??{width:n.width,height:n.height},g=Gi(n,W,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Dn(n.width,g.width,c),y:n.y+Dn(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),F=k?{minX:k.x,minY:k.y,maxX:k.x+k.width,maxY:k.y+k.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${S?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:L,onPointerMove:z,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),S&&o&&k&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:k.x,y:k.y,width:k.width,height:k.height,children:[a.jsx("rect",{x:k.x,y:k.y,width:k.width,height:k.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:k.x,y:k.y,width:k.width,height:k.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:k.x,y:k.y,width:k.width,height:k.height})]}),S&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:D}),V.map(W=>{const g=qs(F,W),E=W==="ne"||W==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-qr/2,y:g.y-qr/2,width:qr,height:qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-Xr/2,y:g.y-Xr/2,width:Xr,height:Xr,onPointerDown:R=>_(R,W)})]},W)})]})]})}const Ys=10,K$=Ys*2,Hn=7,Z$=4,ao=9,J$=3.5,kd=1.08,Q$=.05,Ur=14,eC=1,Yr=14,Kr=8;function tC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:x}){const y=s.useRef(null),m=s.useRef(null),h=s.useRef(i);h.current=i;const v=s.useRef(null),b=s.useRef(null),C=s.useRef(null),S=s.useRef(null),[w,D]=s.useState([]),[_,z]=s.useState(ho),[H,L]=s.useState(null),V=s.useCallback(f=>{z(X=>z$(X,f)?X:f)},[]),$=d==="shape";s.useEffect(()=>{var f;$&&((f=y.current)==null||f.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||D(f=>f.length?[]:f)},[$]);const k=w.length>0;s.useEffect(()=>{u==null||u(k)},[k,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const F=n.width>0?t.width/n.width:1,W=n.height>0?t.height/n.height:1,g=Math.min(F,W),E=r&&l?g:F,R=r&&l?g:W,G=r&&l?(t.width-n.width*g)/2:0,Z=r&&l?(t.height-n.height*g)/2:0,T=s.useCallback(f=>r?{x:G+(f.x-n.x)*E,y:Z+(f.y-n.y)*R}:{x:f.x-n.x,y:f.y-n.y},[r,n,E,R,G,Z]),j=s.useCallback(f=>r?{x:n.x+(E>0?(f.x-G)/E:0),y:n.y+(R>0?(f.y-Z)/R:0)}:{x:n.x+f.x,y:n.y+f.y},[r,n,E,R,G,Z]),K=s.useMemo(()=>j({x:t.width/2,y:t.height/2}),[j,t.width,t.height]),le=s.useCallback((f,X)=>{var U;const N=(U=y.current)==null?void 0:U.getBoundingClientRect();if(!N||N.width<=0||N.height<=0)return{x:0,y:0};if(r){const me=(f-N.left)/N.width*t.width,Y=(X-N.top)/N.height*t.height;return{x:n.x+(E>0?(me-G)/E:0),y:n.y+(R>0?(Y-Z)/R:0)}}return{x:n.x+(f-N.left),y:n.y+(X-N.top)}},[r,n,t.width,t.height,E,R,G,Z]),se=s.useCallback((f,X)=>{var U;const N=(U=y.current)==null?void 0:U.getBoundingClientRect();return!N||N.width<=0||N.height<=0?{x:0,y:0}:{x:(f-N.left)/N.width*t.width,y:(X-N.top)/N.height*t.height}},[t.width,t.height]),M=s.useCallback((f,X)=>{const N=l&&!(X!=null&&X.preserveShape)?M$(f,n,t,G,Z,E,R):f;x(N,X)},[x,l,n,t,G,Z,E,R]),re=s.useCallback(()=>{L(null)},[]),q=s.useCallback((f,X,N)=>{if(!N||v.current||b.current||C.current||S.current){re();return}const U=se(f,X),me=ln(h.current,T);for(const te of me)for(const Ae of te.nodes)if(Math.hypot(Ae.p.x-U.x,Ae.p.y-U.y)<=ao){re();return}const Y=Cd(me,U);if(!Y||Y.distance>Ys){re();return}const I=me[Y.contour],ie=I==null?void 0:I.nodes[Y.segment],oe=I==null?void 0:I.nodes[(Y.segment+1)%((I==null?void 0:I.nodes.length)??1)],B=!!(ie&&oe&&!Bo(ie,oe));L(te=>te&&te.curved===B&&Math.hypot(te.point.x-Y.point.x,te.point.y-Y.point.y)<.25?te:{point:Y.point,curved:B})},[se,T,re]),ce=f=>{var Fe;const X=f.metaKey||f.ctrlKey,N=C.current;if(N&&f.pointerId===N.pointerId){if(f.stopPropagation(),f.preventDefault(),N.startDistance<=0)return;const et=le(f.clientX,f.clientY),Ue=Math.hypot(et.x-N.origin.x,et.y-N.origin.y),nt=Math.max(Q$,Ue/N.startDistance);if(!N.moved&&Math.abs(nt-1)<1e-4)return;N.moved=!0,p(bd(N.startContours,N.origin,nt));return}const U=b.current;if(U&&f.pointerId===U.pointerId){f.stopPropagation(),f.preventDefault();const et=le(f.clientX,f.clientY),{bbox:Ue}=U,nt=Ue.maxX-Ue.minX,tt=Ue.maxY-Ue.minY,Ve=et.x-U.origin.x,fe=et.y-U.origin.y;let He=Ve,Be=fe;if(isFinite(nt)&&isFinite(tt))if(r){let Ce=n.x,De=n.x+n.width,Xe=n.y,ge=n.y+n.height;l&&(E>0&&(Ce=n.x+(0-G)/E,De=n.x+(t.width-G)/E),R>0&&(Xe=n.y+(0-Z)/R,ge=n.y+(t.height-Z)/R));const Ee=Math.min(Ce,De-nt),ze=Math.max(Ce,De-nt),Re=Math.min(Xe,ge-tt),xe=Math.max(Xe,ge-tt),Ie=Math.min(ze,Math.max(Ee,Ue.minX+Ve)),Ye=Math.min(xe,Math.max(Re,Ue.minY+fe));He=Ie-Ue.minX,Be=Ye-Ue.minY}else{const Ce=Ue.minX-n.x,De=Ue.minY-n.y,Xe=Math.min(0,t.width-nt),ge=Math.max(0,t.width-nt),Ee=Math.min(0,t.height-tt),ze=Math.max(0,t.height-tt),Re=Math.min(ge,Math.max(Xe,Ce+Ve)),xe=Math.min(ze,Math.max(Ee,De+fe));He=Re-Ce,Be=xe-De}const Je=[];if(!X&&isFinite(nt)&&isFinite(tt)){const Ce=T({x:Ue.minX+nt/2+He,y:Ue.minY+tt/2+Be}),De={x:t.width/2,y:t.height/2};Math.abs(Ce.x-De.x)<=Ur&&(He=K.x-Ue.minX-nt/2,Je.push(Vs(De.x,"x",t))),Math.abs(Ce.y-De.y)<=Ur&&(Be=K.y-Ue.minY-tt/2,Je.push(Vs(De.y,"y",t)))}if(!U.moved&&He===0&&Be===0)return;U.moved=!0,V(Je.length?Je:ho),p(ln(U.startContours,Ce=>({x:Ce.x+He,y:Ce.y+Be})),{carryImage:!0});return}const me=S.current;if(me&&f.pointerId===me.pointerId){f.stopPropagation(),f.preventDefault();const et=le(f.clientX,f.clientY);let Ue=et.x-me.origin.x,nt=et.y-me.origin.y;if(f.shiftKey&&(Math.abs(Ue)>Math.abs(nt)?nt=0:Ue=0),!me.moved&&Ue===0&&nt===0)return;me.moved=!0,p(wd(me.startContours,me.selection,Ue,nt));return}const Y=v.current;if(!Y||f.pointerId!==Y.pointerId){q(f.clientX,f.clientY,w.length>0||$);return}re(),f.stopPropagation(),f.preventDefault();const I=le(f.clientX,f.clientY);if(Y.kind==="anchor"){const et={x:Y.anchor.x+(I.x-Y.origin.x),y:Y.anchor.y+(I.y-Y.origin.y)},Ue=X?[]:D$(h.current,{contour:Y.contour,node:Y.node}),nt=X||!Y.center?[]:[Y.center],tt=Ld(Td(Ue,nt.map(He=>He.x),"x"),et,"x",T,Ur),Ve=Ld(Td(Ue,nt.map(He=>He.y),"y"),et,"y",T,Ur),fe=X?et:{x:(tt==null?void 0:tt.value)??Gr(et.x,o),y:(Ve==null?void 0:Ve.value)??Gr(et.y,o)};if(f.shiftKey&&(Math.abs(fe.x-Y.anchor.x)>Math.abs(fe.y-Y.anchor.y)?fe.y=Y.anchor.y:fe.x=Y.anchor.x),!Y.moved&&fe.x===Y.anchor.x&&fe.y===Y.anchor.y)return;Y.moved=!0,V(V$(fe,tt,Ve,t,T)),p(F$(h.current,Y.contour,Y.node,fe));return}const ie=(Fe=h.current[Y.contour])==null?void 0:Fe.nodes[Y.node],oe=Y.mirror&&!f.altKey,B=oe||X?null:Y.kind==="in"?ie==null?void 0:ie.out:ie==null?void 0:ie.in,te=ie?T(ie.p):null,Ae=B?T(B):null,he=ie&&(!X||f.shiftKey)?X$(I,ie.p,oe||X?null:G$(h.current[Y.contour],Y.node,Y.kind,T),te&&Ae?Math.hypot(Ae.x-te.x,Ae.y-te.y):null,f.shiftKey,T,j):{point:I,guides:ho},Q=he.guides.length?he.point:X?I:{x:Gr(I.x,o),y:Gr(I.y,o)},Ze=Y.kind==="in"?ie==null?void 0:ie.in:ie==null?void 0:ie.out;!Y.moved&&Ze&&Q.x===Ze.x&&Q.y===Ze.y||(Y.moved=!0,V(he.guides),p(_$(h.current,Y.contour,Y.node,Y.kind,Q,oe)))},J=f=>{V(ho);const X=C.current;if(X&&f.pointerId===X.pointerId){C.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(X.pointerId)&&B.releasePointerCapture(X.pointerId),X.moved&&M(h.current,{preserveShape:!0});return}const N=b.current;if(N&&f.pointerId===N.pointerId){b.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),N.moved?M(h.current,{preserveShape:!0}):D([]);return}const U=S.current;if(U&&f.pointerId===U.pointerId){S.current=null,f.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(U.pointerId)&&B.releasePointerCapture(U.pointerId),U.moved&&M(h.current);return}const me=v.current;if(!me||f.pointerId!==me.pointerId)return;v.current=null,f.stopPropagation();const Y=y.current;Y!=null&&Y.hasPointerCapture(me.pointerId)&&Y.releasePointerCapture(me.pointerId);const I=Math.hypot(f.clientX-me.clientOrigin.x,f.clientY-me.clientOrigin.y);if(me.moved||I>Z$){me.moved&&M(h.current);return}if(!me.toggleOnRelease||f.type!=="pointerup")return;const oe=$d(h.current,me.contour,me.node);oe!==h.current&&(p(oe),M(oe))},be=f=>{f.stopPropagation()},We=f=>{var X,N;f.stopPropagation(),f.preventDefault(),re(),(X=y.current)==null||X.focus({preventScroll:!0}),b.current={pointerId:f.pointerId,origin:le(f.clientX,f.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(N=y.current)==null||N.setPointerCapture(f.pointerId)},ye=(f,X)=>{var I,ie;f.stopPropagation(),f.preventDefault(),re(),(I=y.current)==null||I.focus({preventScroll:!0}),D([]),c("shape");const N=Si(i),U=ya(N,xp(X)),me=qs(N,X),Y=Math.hypot(me.x-U.x,me.y-U.y);!isFinite(Y)||Y<=0||(C.current={pointerId:f.pointerId,corner:X,origin:U,startDistance:Y,startContours:zn(i),moved:!1},(ie=y.current)==null||ie.setPointerCapture(f.pointerId))},ue=(f,X,N,U)=>{var I,ie,oe,B;f.stopPropagation(),f.preventDefault(),re(),(I=y.current)==null||I.focus({preventScroll:!0});const me=(ie=i[N])==null?void 0:ie.nodes[U];if(!me)return;if(f.altKey){const te=X==="anchor"?vp(i,N,U):W$(i,N,U,X);if(te===i)return;D(X==="anchor"?[]:[{contour:N,node:U}]),p(te),M(te);return}const Y=f.metaKey||f.ctrlKey;if(X==="anchor"&&f.shiftKey&&!Y){D(te=>te.some(Ae=>Ae.contour===N&&Ae.node===U)?te.filter(Ae=>!(Ae.contour===N&&Ae.node===U)):[...te,{contour:N,node:U}]);return}if(X==="anchor"&&!Y&&w.length>1&&w.some(te=>te.contour===N&&te.node===U)){S.current={pointerId:f.pointerId,origin:le(f.clientX,f.clientY),startContours:zn(i),selection:w,moved:!1},(oe=y.current)==null||oe.setPointerCapture(f.pointerId);return}D([{contour:N,node:U}]),v.current={kind:X,contour:N,node:U,pointerId:f.pointerId,origin:le(f.clientX,f.clientY),clientOrigin:{x:f.clientX,y:f.clientY},anchor:me.p,center:E$(i),mirror:X!=="anchor"&&!!(me.in&&me.out),toggleOnRelease:Y,moved:!1},(B=y.current)==null||B.setPointerCapture(f.pointerId)},ee=f=>{f.stopPropagation(),f.preventDefault(),re();const X=ln(i,T),N=Cd(X,se(f.clientX,f.clientY));if(!N||N.distance>Ys)return;const{contours:U,nodeIndex:me}=H$(i,N.contour,N.segment,N.t);me<0||(D([{contour:N.contour,node:me}]),p(U),M(U))},de=f=>{if(f.key==="="||f.key==="+"||f.key==="-"||f.key==="_"){f.preventDefault(),f.stopPropagation();const Y=Si(i);if(!isFinite(Y.minX)||!isFinite(Y.maxX))return;const I={x:(Y.minX+Y.maxX)/2,y:(Y.minY+Y.maxY)/2},oe=f.key==="="||f.key==="+"?kd:1/kd,B=bd(i,I,oe);p(B),M(B,{preserveShape:!0});return}if(f.key==="Escape"){f.stopPropagation(),D([]),c("none");return}if(!w.length)return;if(f.key==="Backspace"||f.key==="Delete"){f.preventDefault(),f.stopPropagation();const Y=N$(i,w);if(Y===i)return;D([]),p(Y),M(Y);return}const X=o>0?o:eC,N=f.shiftKey?X*10:X,U={ArrowLeft:[-N,0],ArrowRight:[N,0],ArrowUp:[0,-N],ArrowDown:[0,N]}[f.key];if(!U)return;f.preventDefault(),f.stopPropagation();const me=wd(i,w,U[0],U[1]);p(me),M(me)},ne=s.useMemo(()=>No(ln(i,T)),[i,T]),Pe=s.useMemo(()=>Si(i),[i]),Te=T({x:Pe.minX,y:Pe.minY}),Oe={width:T({x:Pe.maxX,y:Pe.minY}).x-Te.x,height:T({x:Pe.minX,y:Pe.maxY}).y-Te.y},ve=$&&w.length===0&&isFinite(Pe.minX)&&isFinite(Pe.maxX)&&Pe.maxX>Pe.minX&&Pe.maxY>Pe.minY,Se=w.length>0||$,$e=Se;return a.jsxs("svg",{ref:y,className:`${e}-editor${Se?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:de,onPointerDown:()=>{var f;return(f=y.current)==null?void 0:f.focus({preventScroll:!0})},onPointerMove:ce,onPointerLeave:re,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:J,onContextMenu:f=>{f.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{D([]),c("none")},onClick:ee}),$e&&a.jsx("path",{className:`${e}-editor-outline`,d:ne}),$e&&_.map((f,X)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${f.kind}`,x1:f.a.x,y1:f.a.y,x2:f.b.x,y2:f.b.y},`${f.kind}-${X}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:ne,fillRule:"evenodd",onPointerDown:We,onClick:ee}),$e&&a.jsx("path",{className:`${e}-editor-hit`,d:ne,style:{strokeWidth:K$},onClick:ee}),$e&&H&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:H.point.x-Hn/2,y:H.point.y-Hn/2,width:Hn,height:Hn,rx:H.curved?Hn/2:0}),$e&&i.map((f,X)=>f.nodes.map((N,U)=>{const me=w.some(I=>I.contour===X&&I.node===U),Y=T(N.p);return a.jsxs("g",{children:[me&&w.length===1&&["in","out"].map(I=>{const ie=N[I];if(!ie)return null;const oe=T(ie);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:Y.x,y1:Y.y,x2:oe.x,y2:oe.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:oe.x,cy:oe.y,r:J$}),a.jsx("circle",{className:`${e}-editor-grab`,cx:oe.x,cy:oe.y,r:ao,onPointerDown:B=>ue(B,I,X,U),onClick:be})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${me?` ${e}-editor-anchor-selected`:""}`,x:Y.x-Hn/2,y:Y.y-Hn/2,width:Hn,height:Hn,rx:pp(N)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:Y.x-ao,y:Y.y-ao,width:ao*2,height:ao*2,onPointerDown:I=>ue(I,"anchor",X,U),onClick:be,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const ie=$d(i,X,U);p(ie),M(ie)}})]},`${X}-${U}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:Te.x,y:Te.y,width:Oe.width,height:Oe.height}),["nw","ne","se","sw"].map(f=>{const X=T(qs(Pe,f)),N=f==="ne"||f==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:X.x-Kr/2,y:X.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${N?` ${e}-editor-scale-grab-nesw`:""}`,x:X.x-Yr/2,y:X.y-Yr/2,width:Yr,height:Yr,onPointerDown:U=>ye(U,f),onClick:be})]},f)})]})]})}const nC=4e3,iC=/^(?:https?:|mailto:|tel:)/i;function bp(e){return!!e&&typeof e=="object"&&e.type==="link"}function oC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!iC.test(t)))return t}function rC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(bp(c)){o(c.children??[],oC(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ed(e){return{...e.fontFamily&&{fontFamily:Oo(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function aC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(bp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Md(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,y=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||y<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const v=Math.max(1,m*.5),b=y*d$;let C=0,S=0,w=0,D=t[0].para,_=0,z=0,H=null;for(;C<t.length&&w<nC;){const L=S+y>c;if(L&&!u)break;const V=t[C].para;if(V>D+1){S+=y*(V-D-1),D=V-1,w+=1;continue}let $=L?[{x0:0,x1:d}]:v$(i,(S+b)/c,(S+y-b)/c,o).map(F=>({x0:F.x0*d,x1:F.x1*d}));p>0&&x>0&&!L&&$.length&&(H===null&&(H=w,_=$[0].x0,z=S),w-H<x&&($=y$($,{x0:_,x1:_+p})));const k=$.reduce((F,W)=>Math.max(F,W.x1-W.x0),0);for(const F of $){const W=F.x1-F.x0;if(W<v)continue;if(C>=t.length||t[C].para!==V)break;const g=C;let E=0;for(;C<t.length&&t[C].para===V;){const R=n[C]*l,G=C===g?R:m+R;if(E+G>W&&!(C===g&&W>=k-.5&&R>d-.5))break;E+=G,C+=1}if(C>g){const R=C>=t.length||t[C].para!==V;h.push({top:S,left:F.x0,width:W,from:g,to:C,justify:r==="justify"&&!R})}if(C>=t.length||t[C].para!==V)break}D=V,S+=y,w+=1}return{segments:h,placed:C,height:h.length?S:0,capLeft:_,capTop:z}}const sC=.12,lC=2,cC=10,xs=.25,dC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},uC=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,pC=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=dC(e);(!r||!uC(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},bs=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},Zr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function mC(){return typeof document>"u"?null:document.body}function gC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:y,dropCapSize:m,showGuides:h,typography:v,imageUrl:b,imageFocalX:C,imageFocalY:S,imageScale:w,imageCustomPath:D,pathDragActive:_,pathCarryImage:z,onCarryImageConsumed:H,pathEditor:L,imageEditor:V}){var De,Xe;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[k,F]=s.useState(null),W=s.useRef(null),[g,E]=s.useState({width:0,height:0}),[R,G]=s.useState(null),[Z,T]=s.useState(0),[j,K]=s.useState("none");s.useEffect(()=>{!L&&!V&&K("none")},[L,V]);const[le,se]=s.useState(null);s.useEffect(()=>{if(!b||typeof Image>"u"){se(null);return}let ge=!1;const Ee=new Image;return Ee.onload=()=>{ge||se({width:Ee.naturalWidth,height:Ee.naturalHeight})},Ee.src=b,()=>{ge=!0}},[b]);const M=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),re=s.useMemo(()=>rC(M),[M]),q=s.useMemo(()=>aC(M),[M]),ce=y>0&&m>1?((Xe=(De=re[0])==null?void 0:De.text)==null?void 0:Xe.charAt(0))??"":"",J=(L==null?void 0:L.contours)??null,be=s.useMemo(()=>{let ge=[];if(J){const Ee=yr(J);Ee.length&&(ge=So(Ee,r))}if(!ge.length){const Ee=i.trim(),ze=Ee?fd(Ee,o,r):null;ze&&ze.length?ge=ze:ge=Ds(n==="custom"?"rectangle":n)}return n==="circle"?bs(ge,g):ge},[J,n,i,o,r,g.width,g.height]),We=L==null?void 0:L.onConvert,ye=(L==null?void 0:L.needsConversion)??!1,ue=s.useMemo(()=>{if(n==="circle")return!1;const ge=J??(i.trim()?Li(i):null);return!!(ge&&fp(ge,r))},[J,i,r,n]),[ee,de]=s.useState(null);Zr(()=>{if(!ue){ee&&de(null);return}!ee&&g.width>0&&g.height>0&&de({width:g.width,height:g.height})},[ue,g.width,g.height,ee]);const ne=s.useMemo(()=>{if(!ue||g.width<=0||g.height<=0)return be;const ge=ee??g,Ee=r.width/ge.width,ze=r.height/ge.height;return be.map(Re=>Re.map(xe=>({x:xe.x*Ee,y:xe.y*ze})))},[be,ue,ee,r.width,r.height,g.width,g.height]),Pe=s.useMemo(()=>{if(J){const Re=yr(J);if(Re.length){const xe=So(Re,r);return n==="circle"?bs(xe,g):xe}}const ge=D.trim(),Ee=ge?fd(ge,o,r):null,ze=Ee&&Ee.length?Ee:Ds(n==="custom"?"rectangle":n);return n==="circle"?bs(ze,g):ze},[J,n,D,o,r,g.width,g.height]),Te=s.useMemo(()=>{if(!ue||g.width<=0||g.height<=0)return Pe;const ge=ee??g,Ee=r.width/ge.width,ze=r.height/ge.height;return Pe.map(Re=>Re.map(xe=>({x:xe.x*Ee,y:xe.y*ze})))},[Pe,ue,ee,r.width,r.height,g.width,g.height]),Oe=s.useRef(null),ve=s.useRef(!1);s.useEffect(()=>{if(!(!We||g.width<=0||g.height<=0)){if(ue){if(Oe.current===i)return;const ge=J??(i.trim()?Li(i):null);if(!(ge!=null&&ge.length))return;const Ee=ln(ge,ze=>({x:r.x+(ze.x-r.x)/g.width*r.width,y:r.y+(ze.y-r.y)/g.height*r.height}));Oe.current=No(Ee),We(Ee);return}!ye||!be.length||ve.current||(ve.current=!0,We(ln(hp(be),ge=>({x:ge.x*fa,y:ge.y*fa}))))}},[ye,ue,We,be,J,i,r,g.width,g.height]),Zr(()=>{const ge=k;if(!ge||typeof ResizeObserver>"u")return;const Ee=()=>{const Re=ge.getBoundingClientRect();E(xe=>Math.abs(xe.width-Re.width)<.5&&Math.abs(xe.height-Re.height)<.5?xe:{width:Re.width,height:Re.height})};Ee();const ze=new ResizeObserver(Ee);return ze.observe(ge),()=>ze.disconnect()},[k]),s.useEffect(()=>{const ge=typeof document<"u"?document.fonts:void 0;ge!=null&&ge.ready&&ge.ready.then(()=>{T(Ee=>Ee+1)})},[]),Zr(()=>{const ge=W.current;if(!ge)return;if(!re.length){G(null);return}const Ee=[],ze=document.createDocumentFragment();for(const Qe of re){const dt=document.createElement("span");Object.assign(dt.style,Ed(Qe.leaf)),dt.textContent=Qe.text,ze.appendChild(dt),Ee.push(dt)}const Re=document.createElement("span");Re.textContent=" ",ze.appendChild(Re);const xe=ce||"H",Ie=document.createElement("span");Ie.textContent=xe,Ie.style.lineHeight="1",ze.appendChild(Ie),ge.replaceChildren(ze);const Ye=window.getComputedStyle(ge),Ne=parseFloat(Ye.fontSize)||16,it=parseFloat(Ye.lineHeight),ot=Number.isNaN(it)?Ne*1.2:it,rt=Math.max(ot,Ne),ht=document.createElement("span");ht.textContent=xe,ht.style.lineHeight=`${rt}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",ht.appendChild(Pt),ge.appendChild(ht);const kt=ht.getBoundingClientRect().top,ut=Pt.getBoundingClientRect().top,gt=Math.max(1,ut-kt);ht.remove();let $t=gt*.8;const ft=document.createElement("canvas").getContext("2d"),At=Qe=>`${Ye.fontStyle} ${Ye.fontWeight} ${Qe}px ${Ye.fontFamily}`;if(ft){ft.font=At(Ne);const Qe=ft.measureText(xe).actualBoundingBoxAscent;Qe>0&&($t=Qe)}const zt=m>1?(m-1)*rt+$t:$t;let jt=Ne*(zt/$t);if(ft){ft.font=At(jt);const Qe=ft.measureText(xe).actualBoundingBoxAscent;Qe>0&&(jt=jt*(zt/Qe))}Ie.style.fontSize=`${jt}px`,Ie.style.lineHeight=`${jt}px`;const Zt=document.createElement("span");Zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ie.appendChild(Zt);const Ct=Math.max(1,Zt.getBoundingClientRect().top-Ie.getBoundingClientRect().top);Zt.remove();const rn=(m-1)*rt+gt-Ct,lt=Ee.map(Qe=>Qe.getBoundingClientRect().width),ke=Re.getBoundingClientRect().width,je=ce?Ie.getBoundingClientRect().width:0;ge.replaceChildren(),G({widths:lt,spaceWidth:ke,lineHeight:rt,capWidth:je,dropCapFontSize:jt,dropCapTopAdjust:rn})},[re,v,ce,y,m,Z,g.width]);const Se=R&&ce?R.capWidth+R.lineHeight*sC:0,$e=Math.max(y,Math.ceil(m)),f=s.useMemo(()=>{if(!R||!re.length||g.width<=0||g.height<=0||!u)return 1;const ge=Re=>Md({tokens:re,widths:R.widths,spaceWidth:R.spaceWidth,lineHeight:R.lineHeight,width:g.width,height:g.height,rings:ne,mode:l,align:d,scale:Re,allowOverflow:!1,capInset:Se*Re,capLines:ce?$e:0});if(ge(1).placed>=re.length)return 1;if(ge(xs).placed<re.length)return xs;let Ee=xs,ze=1;for(let Re=0;Re<cC;Re+=1){const xe=(Ee+ze)/2;ge(xe).placed>=re.length?Ee=xe:ze=xe}return Ee},[R,re,g.width,g.height,ne,l,d,u,Se,ce,$e]);s.useEffect(()=>{x(f)},[f,x]);const X=u?Math.min(p,f):1,N=s.useMemo(()=>!R||!re.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Md({tokens:re,widths:R.widths,spaceWidth:R.spaceWidth,lineHeight:R.lineHeight,width:g.width,height:g.height,rings:ne,mode:l,align:d,scale:X,allowOverflow:c,capInset:Se*X,capLines:ce?$e:0}),[R,re,g.width,g.height,ne,l,d,X,c,Se,ce,$e]),U=R?R.dropCapFontSize*X:0,me=R?R.dropCapTopAdjust*X:0,Y=d==="justify"?"left":d,I=!!(L&&J&&g.width>0&&g.height>0),ie=!!V,oe=(I||ie)&&g.width>0&&g.height>0,B=pC(k,oe),te=oe&&B?mC():null,Ae=s.useRef(!1),he=s.useCallback(ge=>{Ae.current=ge},[]);s.useEffect(()=>{if(!I&&!ie)return;const ge=Ee=>{const ze=k;if(!ze)return;const Re=ze.getBoundingClientRect();Ee.clientX>=Re.left&&Ee.clientX<=Re.right&&Ee.clientY>=Re.top&&Ee.clientY<=Re.bottom&&(Ee.preventDefault(),Ee.stopPropagation(),K(Ie=>Ie==="shape"&&Ae.current?Ie:Ie==="shape"&&ie?"image":I?"shape":"image"))};return document.addEventListener("dblclick",ge,!0),()=>document.removeEventListener("dblclick",ge,!0)},[I,ie,k]);const Q=s.useMemo(()=>b&&g.width>0&&g.height>0?u$(Te,g):null,[b,Te,g.width,g.height]),Ze=s.useRef(null),Fe=(()=>{const ge=Ze.current;return z||!V||!le||!Q||!ge||D===ge.customPath||ge.shape!==n&&n!=="custom"?null:U$(ge.bounds,Q,le,ge.focalX,ge.focalY,ge.scale)})();Zr(()=>{if(_||!V||!le||!Q)return;const ge=Ze.current,Ee=!!(ge&&D!==ge.customPath);Ee&&Fe&&V.onCommit(Fe),Ee&&z&&(H==null||H()),Ze.current={rings:Te,bounds:Q,focalX:(Fe==null?void 0:Fe.focalX)??C,focalY:(Fe==null?void 0:Fe.focalY)??S,scale:(Fe==null?void 0:Fe.scale)??w,customPath:D,shape:n}},[_,z,D,n,Te,Q,V,le,C,S,w,Fe,H]);const et=Ze.current,Ue=!!(_&&!z&&et&&!Fe),nt=Ue&&et?et.focalX:(Fe==null?void 0:Fe.focalX)??C,tt=Ue&&et?et.focalY:(Fe==null?void 0:Fe.focalY)??S,Ve=Ue&&et?et.scale:(Fe==null?void 0:Fe.scale)??w,fe=Ue&&et?et.bounds:Q,He=s.useMemo(()=>{if(!(g.width>0)||!(g.height>0))return"";let ge=vd(i,J,o,r,n,g);if(ue){const Ee=ee??g,ze=r.width/Ee.width,Re=r.height/Ee.height;ge=ln(ge,xe=>({x:xe.x*ze,y:xe.y*Re}))}return xd(ge,g)||hd(ne,g)},[i,J,o,r,n,g.width,g.height,ue,ee,ne]),Be=s.useMemo(()=>{if(!b||!(g.width>0)||!(g.height>0))return"";let ge=vd(D,J,o,r,n,g);if(ue){const Ee=ee??g,ze=r.width/Ee.width,Re=r.height/Ee.height;ge=ln(ge,xe=>({x:xe.x*ze,y:xe.y*Re}))}return xd(ge,g)||hd(Te,g)},[b,D,J,o,r,n,g.width,g.height,ue,ee,Te]),Je=`${$}-clip`,Ce=s.useMemo(()=>{if(!fe)return null;const ge=le??{width:fe.width,height:fe.height},Ee=Gi(fe,ge,Ve);return{x:Dn(fe.width,Ee.width,nt),y:Dn(fe.height,Ee.height,tt),width:Ee.width,height:Ee.height}},[fe,le,nt,tt,Ve]);return a.jsxs("div",{className:`${e}-column`,ref:F,children:[He?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:He,fillRule:"evenodd"}),b&&Be&&fe&&Ce?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Je,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:b,x:fe.x+Ce.x,y:fe.y+Ce.y,width:Ce.width,height:Ce.height,preserveAspectRatio:"none",clipPath:`url(#${Je})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...v,["--"+e+"-fit"]:X},children:[a.jsx("div",{className:`${e}-measure`,ref:W,style:v,"aria-hidden":!0}),N.segments.map((ge,Ee)=>{const ze=re.slice(ge.from,ge.to),Re=Ee===0;return a.jsx("div",{className:`${e}-line${ge.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${ge.top}px`,left:`${ge.left}px`,width:`${ge.width}px`,textAlign:ge.justify?void 0:Y},children:ze.map((xe,Ie)=>{const Ne=ce&&Re&&ge.from===0&&Ie===0?xe.text.slice(1):xe.text,it=Ed(xe.leaf),ot=xe.href?a.jsx("a",{className:`${e}-link`,href:xe.href,target:xe.target,rel:xe.target?"noopener noreferrer":void 0,style:it,children:Ne}):a.jsx("span",{style:it,children:Ne});return a.jsxs("span",{children:[!ge.justify&&Ie>0?" ":null,ot]},Ie)})},`${ge.from}-${ge.to}-${Ee}`)}),h&&!J&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map((ge,Ee)=>a.jsx("polygon",{points:ge.map(ze=>`${ze.x},${ze.y}`).join(" ")},Ee))})]}),ce&&R&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...v,top:`${N.capTop+me}px`,left:`${N.capLeft}px`,fontSize:`${U}px`,lineHeight:`${U}px`},children:ce}),te&&B&&(J&&L||V)&&ri.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:B.top,left:B.left,width:B.width,height:B.height,zIndex:lC,pointerEvents:"none"},children:[J&&L&&a.jsx(tC,{P:e,box:{width:B.width,height:B.height},viewBox:r,contours:J,snap:L.snap,stretchToBox:!ue,uniformStretch:n==="circle",stage:j,onStageChange:K,onSelectionChange:he,onChange:L.onChange,onCommit:L.onCommit}),V&&fe&&a.jsx(Y$,{P:e,box:{width:B.width,height:B.height},bounds:fe,natural:le,imageUrl:b,maskPath:Be,stage:j,onStageChange:K,focalX:nt,focalY:tt,scale:Ve,onChange:V.onChange,onCommit:V.onCommit})]}),te),a.jsx("div",{className:`${e}-a11y`,children:q.map((ge,Ee)=>a.jsx("p",{children:ge},Ee))})]})}const Sp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],hC={x:0,y:0,width:100,height:100},fC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hC:{x:t[0],y:t[1],width:t[2],height:t[3]}},yC=e=>`
26509
26509
  .${e}-wrapper {
26510
26510
  box-sizing: border-box;
26511
26511
  display: flex;
package/dist/index.mjs CHANGED
@@ -55294,7 +55294,7 @@ const h$ = Bs(""), f$ = Bs("open"), y$ = Bs("compact"), v$ = [
55294
55294
  "__componentName__",
55295
55295
  { type: "row", items: ["panelHeight", "navTextWidth"] },
55296
55296
  { type: "row", title: "Logo", items: ["logoMaxHeight", "logoPosition"] },
55297
- { type: "row", title: "Hamburger", items: ["showIcon", "iconSize"] },
55297
+ { type: "row", title: "Hamburger", items: ["iconSize", "showIcon"] },
55298
55298
  "fontFamily",
55299
55299
  "fontSettings",
55300
55300
  { type: "row", items: ["fontSize", "lineHeight", "letterSpacing", "wordSpacing"] },
@@ -55307,7 +55307,7 @@ const h$ = Bs(""), f$ = Bs("open"), y$ = Bs("compact"), v$ = [
55307
55307
  "__componentName__",
55308
55308
  { type: "row", items: ["compactPanelHeight", "compactNavTextWidth"] },
55309
55309
  { type: "row", title: "Logo", items: ["compactLogoMaxHeight", "compactLogoPosition"] },
55310
- { type: "row", title: "Hamburger", items: ["compactShowIcon", "compactIconSize"] },
55310
+ { type: "row", title: "Hamburger", items: ["compactIconSize", "compactShowIcon"] },
55311
55311
  "compactFontFamily",
55312
55312
  "compactFontSettings",
55313
55313
  { type: "row", items: ["compactFontSize", "compactLineHeight", "compactLetterSpacing", "compactWordSpacing"] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.79-alpha.5",
3
+ "version": "1.0.79-alpha.6",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",