@billgangcom/theme-lib 1.71.1 → 1.71.3

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.
@@ -96,20 +96,20 @@
96
96
  `,s+=` --border-sm: var(--scale-1);
97
97
  `,s+=` --border-md: var(--scale-2);
98
98
  `,s+=` --border-lg: var(--scale-4);
99
- `,s+="}",s},wi=e=>{const n=document.getElementById("dynamic-styles");if(n)n.innerHTML=e;else{const s=document.createElement("style");s.id="dynamic-styles",s.innerHTML=e,document.head.appendChild(s)}},In=new Set,ki=e=>{const n=new Map;return Object.entries(e).forEach(([s,r])=>{typeof r=="object"&&Object.entries(r).forEach(([i,o])=>{var a,l;if(o&&o.font){const u=o.font.replace(/\s+/g,"+");n.has(u)||n.set(u,new Set),(a=n.get(u))==null||a.add(o.weight),(l=n.get(u))==null||l.add(o.boldWeight)}})}),n},Ri=e=>{const n=new Map;return Object.entries(e).forEach(([s,r])=>{typeof r=="object"&&Object.keys(r).forEach(i=>{var o;if(i==="font"&&r[i]){const a=r[i].replace(/\s+/g,"+");n.has(a)||n.set(a,new Set),(o=n.get(a))==null||o.add("400")}})}),n},Ni=e=>{In.forEach(n=>{if(!e.has(n)){const s=document.querySelector(`link[data-font="${n}"]`);s&&s.remove(),In.delete(n)}})},Ii=e=>{const n=new Set;e.forEach((s,r)=>{const i=Array.from(s).join(";"),o=`${r}:wght@${i}`;if(n.add(o),!In.has(o)){const a=document.createElement("link");a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?family=${o}&display=swap`,a.setAttribute("data-font",o),document.head.appendChild(a),In.add(o)}}),Ni(n)},Ti=e=>{if(e.fonts){const n=ki(e.fonts.desktop),s=Ri(e.buttons),r=new Map(n);s.forEach((i,o)=>{if(r.has(o)){const a=r.get(o);i.forEach(l=>a==null?void 0:a.add(l))}else r.set(o,new Set(i))}),Ii(r)}};function Pi(){try{const{editBlock:e,currentBlock:n,blocks:s,setHeader:r,setFooter:i,setAnnouncement:o}=t.useLayersStore.getState(),{currentPage:a,pages:l}=t.usePagesStore.getState(),{currentInstance:u,settingsInstance:p}=t.useBlocksStore.getState(),{setSettings:c}=t.useSettingsStore.getState();if(n||c(p),u&&n){if(n==="header")r(u);else if(n==="footer")i(u);else if(n==="announcement")o(u);else if(n==="header"||n==="footer"||n==="announcement")throw new Error(`Missing ${n} data.`)}if(u&&l&&n&&!["header","footer","announcement"].includes(n)){const m={blockSettings:{}};if(!u.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(u.blockSettings).filter(x=>!["displayName","isAddable"].includes(x)).forEach(x=>{m.blockSettings[x]=u.blockSettings[x]}),!l[a])throw new Error(`Page "${a}" does not exist.`);if(!s[l[a].path].data||!s[l[a].path].data[n])throw new Error(`Layer or block for page "${l[a].path}" and block "${n}" does not exist.`);e(l[a].path,n,{name:s[l[a].path].data[n].name,value:m})}}catch(e){console.error("Error in hotReload function:",e)}}async function Li(e,n,s,r){const i=t.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.SL_API_URL}/v1/public/${i}/tickets`,{notifications:a,setNotifications:l}=t.useNotificationStore.getState();try{const u=await t.request({method:"post",url:o,body:{title:e,firstMessage:n,email:r,recaptcha:s},withToken:!1});return l([...a,{id:t.v4(),message:"Ticket created successfully. We will contact you by mail",status:"success"}]),u}catch(u){l([...a,{id:t.v4(),message:`Error: ${u}. Please try again later.`,status:"error"}])}}const Bi=()=>{const{pages:e}=t.usePagesStore(),[n,s]=_.useState(e);return _.useEffect(()=>{s(e)},[e]),n},Ai="_tooltip_4hruj_1",Mi={tooltip:Ai},Bt=e=>{const{text:n}=e,{setShowTooltip:s}=t.useTooltipStore();return _.useEffect(()=>(s(!0),()=>{s(!1)}),[]),t.jsxRuntimeExports.jsx("div",{className:Mi.tooltip,children:n})},$i=()=>{const{undo:e,redo:n,past:s,future:r}=t.useHistoryStore(),[i,o]=_.useState(!1),[a,l]=_.useState(!1),[u,p]=_.useState(!1),[c,m]=_.useState(!1),[x,d]=_.useState(null),{notifications:g,setNotifications:h}=t.useNotificationStore();return _.useEffect(()=>{o(s.length===0)},[s]),_.useEffect(()=>{l(r.length===0)},[r]),t.jsxRuntimeExports.jsxs("div",{className:Ot.buttons,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ot.button,{[Ot.disabled]:i}),onMouseEnter:()=>{const S=setTimeout(()=>{m(!0),p(!1)},200);d(S)},onMouseLeave:()=>{x&&clearTimeout(x),m(!1),p(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{i||(e(),h([...g,{id:t.v4(),message:"Changes undone",status:"success"}]))},fill:i?"#757575":"#252525"}),c&&t.jsxRuntimeExports.jsx(Bt,{text:i?"Nothing to undo":"Click to undo changes"})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ot.button,{[Ot.disabled]:a}),onMouseEnter:()=>{const S=setTimeout(()=>{p(!0),m(!1)},200);d(S)},onMouseLeave:()=>{x&&clearTimeout(x),p(!1),m(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(n(),h([...g,{id:t.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),u&&t.jsxRuntimeExports.jsx(Bt,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},Di="_devices_ls6k9_1",Fi="_device_ls6k9_1",Oi="_active_ls6k9_27",ps={devices:Di,device:Fi,active:Oi},Hi=()=>t.jsxRuntimeExports.jsx("div",{className:ps.devices,children:Ao.map(e=>t.jsxRuntimeExports.jsx(zi,{device:e}))}),zi=e=>{const{device:n}=e,{currentDevice:s,setCurrentDevice:r}=t.useDeviceStore(),[i,o]=_.useState(!1),[a,l]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ps.device,{[ps.active]:s.value===n.value}),onClick:()=>r(n),onMouseEnter:()=>{const u=setTimeout(()=>{o(!0)},200);l(u)},onMouseLeave:()=>{a&&clearTimeout(a),o(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:n.icon,fill:s.value===n.value?"#252525":"#757575",width:20,height:20}),i&&t.jsxRuntimeExports.jsx(Bt,{text:`Switch to ${n.value} view`})]},n.value)},Ui="_preview_1x3m8_2",Vi="_active_1x3m8_19",Hn={preview:Ui,active:Vi},Wi=()=>{const{onPreview:e}=t.usePreviewStore(),[n,s]=_.useState(!1),[r,i]=_.useState(null);return t.jsxRuntimeExports.jsxs("a",{href:"/",className:t.clx(Hn.preview,{[Hn.active]:e}),target:"_blank",onMouseEnter:()=>{const o=setTimeout(()=>{s(!0)},200);i(o)},onMouseLeave:()=>{r&&clearTimeout(r),s(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUpRight",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:Hn.text,children:"Preview"}),n&&t.jsxRuntimeExports.jsx(Bt,{text:"Open draft theme in new tab"})]})},qi="_settings_u4cv4_1",Gi={settings:qi},Zi="_pages_167qp_1",Xi="_text_167qp_21",Yi="_modal_167qp_27",Ki="_open_167qp_46",Ji="_page_167qp_1",Qi="_hoverable_167qp_61",ea="_separator_167qp_65",ta="_button_167qp_70",na="_items_167qp_85",$e={pages:Zi,default:"_default_167qp_5",text:Xi,modal:Yi,open:Ki,page:Ji,hoverable:Qi,separator:ea,button:ta,items:na},Be=e=>e?e.replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" and "):"",Or=(e,n,s,r,i,o,a)=>{const l=e.currentTarget.getBoundingClientRect(),u=window.innerHeight-l.bottom,p=l.top,c=window.innerWidth-l.right,m=l.left;let x,d;return x=l.bottom+r+window.scrollY,d=l.left,(u<n||u<i)&&(p>=n+a?x=l.top-n-r+window.scrollY:x=window.scrollY+a),x-window.scrollY<a&&(x=window.scrollY+a),(c<s||c<o)&&(m>=s?d=l.right-s:d=(window.innerWidth-s)/2),d<l.right+o&&(d=l.right+o),d<l.right&&d+s>l.left&&x<l.bottom&&x+n>l.top&&(c>=s+o?d=l.right+r+o:u>=n?x=l.bottom+r+window.scrollY:(x=window.scrollY+a,d=(window.innerWidth-s)/2)),{top:x,left:d}},Hr=async e=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),r=`${t.API_URL}/v2/builder/shops/${n}/drafts/${s}/pages/${encodeURIComponent(e)}`;return await t.request({url:r,withToken:!0,method:"delete"})},sa=()=>{const{currentPage:e,setCurrentPage:n,setIsOpenModal:s,pages:r,setIsEdit:i,setEditedPage:o,deletePage:a,setIsOpenSelectModal:l}=t.usePagesStore(),{deletePage:u,setCurrentBlock:p}=t.useLayersStore(),[c,m]=_.useState(null),{setTitle:x,setDescription:d,setOnConfirm:g}=t.useConfirmationModalStore(),[h,S]=_.useState(!1),j=_.useRef(null);return t.useOnClickOutside(j,()=>{h&&S(!1)}),_.useEffect(()=>{h?l(!0):setTimeout(()=>{l(!1)},300)},[h]),t.jsxRuntimeExports.jsxs("div",{className:$e.pages,ref:j,children:[t.jsxRuntimeExports.jsxs("div",{className:$e.default,onClick:E=>{E.stopPropagation(),S(C=>!C)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:r&&r[e]&&r[e].icon||"File",fill:"#252525",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:$e.text,children:r&&r[e]&&t.defaultPagePaths.includes(r[e].path)?`${Be(r[e].name)} page`:r&&r[e]&&r[e].name}),t.jsxRuntimeExports.jsx("div",{style:{transform:h?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:20,height:20})})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx($e.modal,{[$e.open]:h}),onClick:E=>E.stopPropagation(),children:[r&&t.jsxRuntimeExports.jsx("div",{className:$e.items,children:Object.keys(r).map(E=>{const C=r[E];return t.jsxRuntimeExports.jsxs("div",{className:t.clx($e.page,{[$e.hoverable]:c===E}),onMouseEnter:()=>m(E),onMouseLeave:()=>m(null),onClick:()=>{m(null),i(!1),p(null),n(E),S(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:C.icon,fill:"#252525"}),t.jsxRuntimeExports.jsx("span",{className:$e.text,children:t.defaultPagePaths.includes(C.path)?`${Be(C.name)} page`:C.name}),c===E&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Gear",fill:"#757575",onClick:N=>{N.stopPropagation(),i(!0),o(E),s(!0)}}),!t.defaultPagePaths.includes(C.path)&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"#C12A2A",onClick:N=>{N.stopPropagation(),x("Delete Page"),d(`Are you sure you want to delete ${C.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),g(()=>{N.stopPropagation(),r[e].path===C.path&&n(Object.keys(r)[0]),a(E),u(C.name),Hr(C.path)})}})]}),r[e]&&r[e].name===C.name&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"#FF3F19"})]},E)})}),t.jsxRuntimeExports.jsx("div",{className:$e.separator}),t.jsxRuntimeExports.jsxs(t.Button,{className:$e.button,onClick:E=>{E.stopPropagation(),s(!0)},size:"l",children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#ff3f19"}),t.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},ra="_zoom_fu0hj_1",Ds={zoom:ra},oa=()=>{const{zoomLevel:e,setZoomLevel:n}=t.usePreviewStore();return t.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:Ds.zoom,children:[t.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),t.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:s=>{const r=Number(s.target.value);n(r/100)},className:Ds.input}),t.jsxRuntimeExports.jsx("span",{children:"%"})]})},ia=()=>t.jsxRuntimeExports.jsxs("div",{className:Gi.settings,children:[t.jsxRuntimeExports.jsx(sa,{}),t.jsxRuntimeExports.jsx(oa,{})]}),aa="_theme_1e5wq_1",la="_text_1e5wq_13",Fs={theme:aa,text:la},ca=()=>t.jsxRuntimeExports.jsx("div",{className:Fs.theme,children:t.jsxRuntimeExports.jsx("div",{className:Fs.text,children:"Live Theme"})}),ua=async(e,n,s)=>{const r=localStorage.getItem("shopId")||void 0,i=localStorage.getItem("draftId"),o=`${t.API_URL}/v2/builder/shops/${r}/drafts/${i}/${n}`;return await t.request({url:o,withToken:!0,method:e,body:s})};function Ht(e,n){try{return n.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(o=>o&&o.type===e).map(o=>{if(o.value===void 0)throw new Error("item.value is undefined.");return o.value}).flat()}).flat().filter(r=>r).map(r=>e==="ListingIds"?r.listingId:r)}catch(s){return console.error("Error in getValues function:",s),[]}}function pa(e,n,s){return da(e,n)?(s.reviews||[]).length*3:0}function da(e,n){return n.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(o=>o&&o.type===e).map(o=>{if(o.value===void 0)throw new Error("item.value is undefined.");return o.value}).flat()}).flat().filter(r=>r).length>0}function ma(e,n){if(n){const s=Object.keys(n).find(r=>n[r].path===e);if(s)return n[s]}return null}const xa=({setIsLoading:e,isLoading:n})=>{const{themeSettings:s}=t.useThemeSettingsStore(),{settings:r}=t.useSettingsStore(),[i,o]=_.useState(null),[a,l]=_.useState(!1),{setNotifications:u,notifications:p}=t.useNotificationStore(),{header:c,footer:m,announcement:x,blocks:d}=t.useLayersStore(),{pageContext:g}=t.usePagesStore(),{pages:h}=t.usePagesStore(),S=async()=>{if(a)i&&clearTimeout(i);else{e(!0);const E=Object.keys(d).map(w=>{const b=ma(w,h);return d[w]&&d[w].data&&(b!=null&&b.path)?{id:b?b.id:w,name:b?b.name:w,path:b.path,layout:{...d[w]},neededProductIds:[...Ht("ProductId",Object.values(d[w].data))],neededCategoryIds:[...Ht("CategoryId",Object.values(d[w].data))],neededAnnouncementIds:[...Ht("AnnouncementId",Object.values(d[w].data))],neededListingIds:[...Ht("ListingIds",Object.values(d[w].data))],neededFaqIds:[...Ht("FaqsIds",Object.values(d[w].data))],neededReviewCount:pa("ReviewCount",Object.values(d[w].data),g),seo:{pageTitle:b&&b.seo&&b.seo.pageTitle?b.seo.pageTitle:"",pageDescription:b&&b.seo&&b.seo.pageDescription?b.seo.pageDescription:""},isPrivate:!!(b&&b.visibility==="private")}:null}).filter(w=>w),C={settings:{maxStoreWidth:r==null?void 0:r.blockSettings.maxStoreWidth},header:c,footer:m,announcement:x},{status:N}=await ua("post","save",{themeSettings:s,settings:C,updatedPages:E});u([...p,{id:t.v4(),message:N===200?"Settings saved":"Error",status:N===200?"success":"error"}]),e(!1)}l(!0);const j=setTimeout(()=>{l(!1)},2e3);o(j)};return t.jsxRuntimeExports.jsx(t.Button,{onClick:S,disabled:n,children:t.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},ha=()=>{const{isOpenSelectModal:e}=t.usePagesStore(),[n,s]=_.useState(!1),{showTooltip:r}=t.useTooltipStore();return t.jsxRuntimeExports.jsxs("div",{className:pn.header,style:{zIndex:e?5e4:r?501:50},children:[t.jsxRuntimeExports.jsxs("div",{className:pn.left,children:[t.jsxRuntimeExports.jsx(Hi,{}),t.jsxRuntimeExports.jsx(Wi,{})]}),t.jsxRuntimeExports.jsx("div",{className:pn.center,children:t.jsxRuntimeExports.jsx(ia,{})}),t.jsxRuntimeExports.jsxs("div",{className:pn.right,children:[t.jsxRuntimeExports.jsx(ca,{}),t.jsxRuntimeExports.jsx($i,{}),t.jsxRuntimeExports.jsx(xa,{setIsLoading:s,isLoading:n}),n&&t.jsxRuntimeExports.jsx(mt,{})]})]})},ga="_exit_ovvox_1",fa="_text_ovvox_11",ja="_exitLink_ovvox_16",zn={exit:ga,text:fa,exitLink:ja},ya=()=>t.jsxRuntimeExports.jsx("div",{className:zn.exit,children:t.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:zn.exitLink,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"SignOut",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:zn.text,children:"Exit"})]})}),_a="_navbar_1podc_1",Sa="_main_1podc_6",ba="_block_1podc_13",Ca="_active_1podc_29",dn={navbar:_a,main:Sa,block:ba,active:Ca},Ea=()=>{const{activeBlock:e}=t.useNavbarStore(),{setActiveBlock:n}=t.useBlocksStore(),{setCurrentBlock:s}=t.useLayersStore(),{setActiveBlock:r}=t.useThemeSettingsStore(),{setActiveBlock:i}=t.usePreviewStore(),o=t.useNavigate();function a(l){switch(n(null),s(null),r(null),i({id:null,neededScroll:!1}),l.name){case"Layers":o("/admin/builder");break;case"Add":o("/admin/builder/add");break;case"Theme":o("/admin/builder/theme");break;case"Settings":o("/admin/builder/settings");break}}return t.jsxRuntimeExports.jsxs("div",{className:dn.navbar,children:[t.jsxRuntimeExports.jsx(ya,{}),t.jsxRuntimeExports.jsx("div",{className:dn.main,children:t.navbarBlocks.map(l=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(dn.block,{[dn.active]:e.icon===l.icon}),onClick:()=>a(l),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:l.icon,fill:e.icon===l.icon?"#252525":"#757575"}),t.jsxRuntimeExports.jsx("span",{children:l.name})]},l.icon))})]})},va="_preview_gb2ye_1",wa="_main_gb2ye_15",ka="_content_gb2ye_25",Ra="_loading_gb2ye_34",Na="_previewLoading_gb2ye_65",zt={preview:va,main:wa,content:ka,loading:Ra,previewLoading:Na},Ia="_header_11zku_2",Ta="_circles_11zku_16",Pa="_circle_11zku_16",La="_red_11zku_32",Ba="_green_11zku_36",Aa="_yellow_11zku_40",Ma="_input_11zku_44",$a="_main_11zku_55",Da="_text_11zku_63",Fa="_copy_11zku_75",qe={header:Ia,circles:Ta,circle:Pa,red:La,green:Ba,yellow:Aa,input:Ma,main:$a,text:Da,copy:Fa},Oa=["red","yellow","green"],Ha=()=>{const{currentDevice:e}=t.useDeviceStore(),n=(i,o)=>i.length>o?i.slice(0,o)+"...":i,{notifications:s,setNotifications:r}=t.useNotificationStore();return t.jsxRuntimeExports.jsxs("div",{className:qe.header,children:[t.jsxRuntimeExports.jsx("div",{className:qe.circles,children:Oa.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(qe.circle,{[qe.red]:i==="red",[qe.yellow]:i==="yellow",[qe.green]:i==="green"})},i))}),t.jsxRuntimeExports.jsx("div",{className:qe.input,children:t.jsxRuntimeExports.jsxs("div",{className:qe.main,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),t.jsxRuntimeExports.jsx("span",{className:qe.text,children:e.value==="mobile"?n(window.location.origin,35):e.value==="desktop"?n(window.location.origin,200):n(window.location.origin,100)})]})}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),r([...s,{id:t.v4(),status:"success",message:"Domain copied to clipboard"}])},className:qe.copy,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},za="_results_1pahy_1",Os={results:za};function Ua(e,n){return n?new n[e]().blockSettings.isAddable:!1}function Hs(e,n){return e?Object.keys(e||{}).reduce((s,r)=>(Ua(r,n)&&s.push({name:r,displayName:t.getDisplayName(r,n)}),s),[]):[]}const Va="_product_yggw5_1",Wa="_name_yggw5_15",zs={product:Va,name:Wa},qa=e=>{const{blockId:n,setSearchValue:s}=e,{sourceBlocks:r,setActiveBlock:i}=t.useBlocksStore(),{hideModal:o,hoverBlockId:a,isModalVisible:l,showPreview:u,hidePreview:p,clearHideTimeout:c,startHideTimeout:m,setHoverBlockTopPosition:x}=t.useSubmodalStore();function d(S){s(""),i(S),o("keyBlock")}function g(S,j){const E=window.innerHeight,C=400,N=10;let w=j.clientY-120;w+C>E&&(w=E-C-N),w<N&&(w=N),a||o("keyBlock"),u(S,"keyBlock"),c(),x(w)}function h(){l?m("keyBlock"):p("keyBlock"),x(null)}return t.jsxRuntimeExports.jsxs("div",{className:zs.product,onClick:()=>d(n),onMouseEnter:S=>g(n,S),onMouseLeave:h,children:[en[n]?t.jsxRuntimeExports.jsx("img",{src:en[n]}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards"}),t.jsxRuntimeExports.jsx("span",{className:zs.name,children:t.getDisplayName(n,r)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight",width:20,height:20})]},n)},zr=()=>{const{blocks:e,sourceBlocks:n}=t.useBlocksStore(),[s,r]=_.useState(""),[i,o]=_.useState([]),a=_.useMemo(()=>Hs(e,n),[e,n]),l=_.useMemo(()=>new t.Fuse(a,{keys:["displayName"],threshold:.4}),[a]);return _.useEffect(()=>{if(s.trim()==="")o(Hs(e,n));else{const u=l.search(s);o(u.map(p=>p.item))}},[s,l]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:r,value:s,style:{marginBottom:10}}),t.jsxRuntimeExports.jsx("div",{className:Os.results,children:i.length>0?i.map(u=>t.jsxRuntimeExports.jsx(qa,{blockId:u.name,setSearchValue:r})):t.jsxRuntimeExports.jsx("div",{className:Os.noResults,children:"No sections found"})})]})},Ga="_wrapper_1k1cr_1",Za="_submodal_1k1cr_14",ds={wrapper:Ga,submodal:Za},Xa=({children:e,positionTop:n,positionLeft:s})=>{const{keyBlock:r,startHideTimeout:i,clearHideTimeout:o,setMouseOverModal:a}=t.useSubmodalStore();return r?t.jsxRuntimeExports.jsx("div",{className:ds.wrapper,style:n?{top:n,left:s||void 0}:{},onMouseEnter:()=>{o(),a(!0)},onMouseLeave:()=>{a(!1),i()},children:e}):null},Ya=({children:e})=>{const{hoverBlockId:n,startHideTimeout:s,clearHideTimeout:r,setMouseOverModal:i}=t.useSubmodalStore();return n?t.jsxRuntimeExports.jsx("div",{className:t.clx(ds.wrapper,ds.submodal),onMouseEnter:()=>{r(),i(!0)},onMouseLeave:()=>{i(!1),s()},children:e}):null},Ka="_applyButton_1a9kh_2",Ja="_content_1a9kh_7",Qa="_title_1a9kh_14",el="_label_1a9kh_21",tl="_colorValue_1a9kh_40",nl="_colorMap_1a9kh_48",sl="_indicator_1a9kh_57",rl="_hueSlider_1a9kh_66",ol="_slider_1a9kh_97",il="_buttons_1a9kh_102",al="_name_1a9kh_109",ll="_secondary_1a9kh_114",cl="_input_1a9kh_122",ul="_modal_1a9kh_160",pl="_alphaSlider_1a9kh_249",dl="_alphaBackground_1a9kh_257",ml="_alphaGradient_1a9kh_268",xl="_chargeTypes_1a9kh_297",hl="_charge_1a9kh_297",gl="_chargeActive_1a9kh_326",fl="_gradient_1a9kh_334",jl="_color_1a9kh_40",yl="_colorActive_1a9kh_355",_l="_gradientWrapper_1a9kh_362",Sl="_subtitle_1a9kh_368",bl="_colorTypes_1a9kh_375",Cl="_colorType_1a9kh_375",El="_colorTypeActive_1a9kh_399",vl="_colorsWrapper_1a9kh_404",wl="_colors_1a9kh_404",J={applyButton:Ka,content:Ja,title:Qa,label:el,colorValue:tl,colorMap:nl,indicator:sl,hueSlider:rl,slider:ol,buttons:il,name:al,secondary:ll,input:cl,modal:ul,alphaSlider:pl,alphaBackground:dl,alphaGradient:ml,chargeTypes:xl,charge:hl,chargeActive:gl,gradient:fl,color:jl,colorActive:yl,gradientWrapper:_l,subtitle:Sl,colorTypes:bl,colorType:Cl,colorTypeActive:El,colorsWrapper:vl,colors:wl},kl=()=>{const{modalPosition:e,color:n,initialColor:s,setShowModal:r,hue:i,saturation:o,brightness:a,alpha:l,dragging:u,setDragging:p,setHue:c,setSaturation:m,setBrightness:x,setAlpha:d,colorChange:g,setColor:h,update:S,isGradient:j,setIsGradient:E,gradientDirection:C,setGradientDirection:N,hue2:w,saturation2:b,brightness2:A,alpha2:$,setHue2:z,setSaturation2:V,setBrightness2:B,setAlpha2:R,activeColorIndex:I,setActiveColorIndex:M,isGradientActive:P}=t.useColorPickerStore(),O=(Y,W,ie)=>{W/=100,ie/=100;const Z=pe=>(pe+Y/60)%6,ee=pe=>ie*(1-W*Math.max(0,Math.min(Z(pe),4-Z(pe),1))),K=Math.round(255*ee(5)),oe=Math.round(255*ee(3)),ne=Math.round(255*ee(1));return{r:K,g:oe,b:ne}},D=Y=>Y.toString(16).padStart(2,"0"),L=(Y,W,ie,Z)=>{const{r:ee,g:K,b:oe}=O(Y,W,ie),ne=Math.round(Z/100*255);return`#${D(ee)}${D(K)}${D(oe)}${D(ne)}`},H=(Y,W,ie,Z)=>{if(j)if(I===1){c(Y),m(W),x(ie),d(Z);const ee=L(Y,W,ie,Z),K=L(w,b,A,$),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${ee} 0%, ${K} 100%)`;g(ne),h(ne)}else{z(Y),V(W),B(ie),R(Z);const ee=L(Y,W,ie,Z),K=L(i,o,a,l),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${K} 0%, ${ee} 100%)`;g(ne),h(ne)}else{const ee=L(Y,W,ie,Z);g(ee),h(ee)}},f=(Y,W,ie)=>{const{width:Z,height:ee}=ie.getBoundingClientRect(),K=Math.max(0,Math.min(Y/Z*100,100)),oe=Math.max(0,Math.min(100-W/ee*100,100));j?I===1?(m(K),x(oe),H(i,K,oe,l)):(V(K),B(oe),H(w,K,oe,$)):(m(K),x(oe),H(i,K,oe,l))},se=Y=>{const{offsetX:W,offsetY:ie}=Y.nativeEvent;p(!0),f(W,ie,Y.currentTarget)},he=Y=>{if(u){const W=document.querySelector(`.${J.colorMap}`),{left:ie,top:Z}=W.getBoundingClientRect(),ee=Y.clientX-ie,K=Y.clientY-Z;f(ee,K,W)}},y=()=>{p(!1)};_.useEffect(()=>{function Y(Z){const ee=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,K=Z.match(ee);if(K){const oe=K[1],ne=K[2],pe=K[3];return{angle:oe,col1:ne,col2:pe}}return null}function W(Z){const ee=parseInt(Z.slice(1,3),16),K=parseInt(Z.slice(3,5),16),oe=parseInt(Z.slice(5,7),16),ne=parseInt(Z.slice(7,9),16)/255*100,{h:pe,s:it,b:v}=ie(ee,K,oe);return{h:pe,s:it,b:v,a:ne}}function ie(Z,ee,K){Z/=255,ee/=255,K/=255;const oe=Math.max(Z,ee,K),ne=Math.min(Z,ee,K);let pe=0;const it=oe-ne,v=(oe===0?0:it/oe)*100,T=oe*100;if(oe===ne)pe=0;else switch(oe){case Z:pe=((ee-K)/it+(ee<K?6:0))*60;break;case ee:pe=((K-Z)/it+2)*60;break;case K:pe=((Z-ee)/it+4)*60;break}return{h:pe,s:v,b:T}}if(s&&s.startsWith("linear-gradient")){const Z=Y(s);if(Z){const{angle:ee,col1:K,col2:oe}=Z,ne=W(K),pe=W(oe);E(!0),N(ee==="0deg"?"vertical":"horizontal"),c(ne.h),m(ne.s),x(ne.b),d(ne.a),z(pe.h),V(pe.s),B(pe.b),R(pe.a),M(1)}}else if(s){const ee=function(oe){let ne=oe;return ne.length===7?ne+"ff":ne.length===9?ne:ne.length===4?ne[0]+ne[1].repeat(2)+ne[2].repeat(2)+ne[3].repeat(2)+"ff":"#000000ff"}(s),K=W(ee);E(!1),c(K.h),m(K.s),x(K.b),d(K.a)}},[s,E,N,c,m,x,d,z,V,B,R,M]),_.useEffect(()=>{let Y,W,ie,Z;j?I===1?(Y=i,W=o,ie=a,Z=l):(Y=w,W=b,ie=A,Z=$):(Y=i,W=o,ie=a,Z=l),H(Y,W,ie,Z)},[j,C,I,i,o,a,l,w,b,A,$]),_.useEffect(()=>{const Y=ie=>he(ie),W=()=>y();return u?(document.addEventListener("mousemove",Y),document.addEventListener("mouseup",W)):(document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",W)),()=>{document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",W)}},[u,j,C]);function Q(){if(!j)S(n);else{const Y=L(i,o,a,l),W=L(w,b,A,$),Z=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${Y} 0%, ${W} 100%)`;S(Z)}r(!1)}function ge(){r(!1),g(s)}const G=j?I===1?i:w:i,je=j?I===1?o:b:o,Ae=j?I===1?a:A:a,ot=j?I===1?l:$:l,{r:Je,g:ht,b:cn}=O(G,je,Ae),Mn=`linear-gradient(to right, rgba(${Je}, ${ht}, ${cn}, 0), rgba(${Je}, ${ht}, ${cn}, 1))`,un=L(i,o,a,l),$t=L(w,b,A,$);return t.jsxRuntimeExports.jsxs("div",{className:J.modal,onClick:Y=>Y.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsx("h2",{className:J.title,children:"Color"}),P&&t.jsxRuntimeExports.jsxs("div",{className:J.colorTypes,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.colorType,{[J.colorTypeActive]:!j}),onClick:()=>E(!1),children:[t.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.colorType,{[J.colorTypeActive]:j}),onClick:()=>E(!0),children:[t.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),j&&P&&t.jsxRuntimeExports.jsxs("div",{className:J.colorsWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:J.colors,style:{background:`linear-gradient(90deg, ${un} 0%, ${$t} 100%)`}}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.color,{[J.colorActive]:I===1}),onClick:()=>M(1),style:{background:un}}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.color,{[J.colorActive]:I===2}),onClick:()=>M(2),style:{background:$t}})]}),t.jsxRuntimeExports.jsx("div",{className:J.colorMap,onMouseDown:se,style:{background:`
99
+ `,s+="}",s},wi=e=>{const n=document.getElementById("dynamic-styles");if(n)n.innerHTML=e;else{const s=document.createElement("style");s.id="dynamic-styles",s.innerHTML=e,document.head.appendChild(s)}},In=new Set,ki=e=>{const n=new Map;return Object.entries(e).forEach(([s,r])=>{typeof r=="object"&&Object.entries(r).forEach(([i,o])=>{var a,l;if(o&&o.font){const u=o.font.replace(/\s+/g,"+");n.has(u)||n.set(u,new Set),(a=n.get(u))==null||a.add(o.weight),(l=n.get(u))==null||l.add(o.boldWeight)}})}),n},Ri=e=>{const n=new Map;return Object.entries(e).forEach(([s,r])=>{typeof r=="object"&&Object.keys(r).forEach(i=>{var o;if(i==="font"&&r[i]){const a=r[i].replace(/\s+/g,"+");n.has(a)||n.set(a,new Set),(o=n.get(a))==null||o.add("400")}})}),n},Ni=e=>{In.forEach(n=>{if(!e.has(n)){const s=document.querySelector(`link[data-font="${n}"]`);s&&s.remove(),In.delete(n)}})},Ii=e=>{const n=new Set;e.forEach((s,r)=>{const i=Array.from(s).join(";"),o=`${r}:wght@${i}`;if(n.add(o),!In.has(o)){const a=document.createElement("link");a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?family=${o}&display=swap`,a.setAttribute("data-font",o),document.head.appendChild(a),In.add(o)}}),Ni(n)},Ti=e=>{if(e.fonts){const n=ki(e.fonts.desktop),s=Ri(e.buttons),r=new Map(n);s.forEach((i,o)=>{if(r.has(o)){const a=r.get(o);i.forEach(l=>a==null?void 0:a.add(l))}else r.set(o,new Set(i))}),Ii(r)}};function Pi(){try{const{editBlock:e,currentBlock:n,blocks:s,setHeader:r,setFooter:i,setAnnouncement:o}=t.useLayersStore.getState(),{currentPage:a,pages:l}=t.usePagesStore.getState(),{currentInstance:u,settingsInstance:p}=t.useBlocksStore.getState(),{setSettings:c}=t.useSettingsStore.getState();if(n||c(p),u&&n){if(n==="header")r(u);else if(n==="footer")i(u);else if(n==="announcement")o(u);else if(n==="header"||n==="footer"||n==="announcement")throw new Error(`Missing ${n} data.`)}if(u&&l&&n&&!["header","footer","announcement"].includes(n)){const m={blockSettings:{}};if(!u.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(u.blockSettings).filter(x=>!["displayName","isAddable"].includes(x)).forEach(x=>{m.blockSettings[x]=u.blockSettings[x]}),!l[a])throw new Error(`Page "${a}" does not exist.`);if(!s[l[a].path].data||!s[l[a].path].data[n])throw new Error(`Layer or block for page "${l[a].path}" and block "${n}" does not exist.`);e(l[a].path,n,{name:s[l[a].path].data[n].name,value:m})}}catch(e){console.error("Error in hotReload function:",e)}}async function Li(e,n,s,r){const i=t.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.SL_API_URL}/v1/public/${i}/tickets`,{notifications:a,setNotifications:l}=t.useNotificationStore.getState();try{const u=await t.request({method:"post",url:o,body:{title:e,firstMessage:n,email:r,recaptcha:s},withToken:!1});return l([...a,{id:t.v4(),message:"Ticket created successfully. We will contact you by mail",status:"success"}]),u}catch(u){l([...a,{id:t.v4(),message:`Error: ${u}. Please try again later.`,status:"error"}])}}const Bi=()=>{const{pages:e}=t.usePagesStore(),[n,s]=_.useState(e);return _.useEffect(()=>{s(e)},[e]),n},Ai="_tooltip_4hruj_1",Mi={tooltip:Ai},Bt=e=>{const{text:n}=e,{setShowTooltip:s}=t.useTooltipStore();return _.useEffect(()=>(s(!0),()=>{s(!1)}),[]),t.jsxRuntimeExports.jsx("div",{className:Mi.tooltip,children:n})},$i=()=>{const{undo:e,redo:n,past:s,future:r}=t.useHistoryStore(),[i,o]=_.useState(!1),[a,l]=_.useState(!1),[u,p]=_.useState(!1),[c,m]=_.useState(!1),[x,d]=_.useState(null),{notifications:g,setNotifications:h}=t.useNotificationStore();return _.useEffect(()=>{o(s.length===0)},[s]),_.useEffect(()=>{l(r.length===0)},[r]),t.jsxRuntimeExports.jsxs("div",{className:Ot.buttons,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ot.button,{[Ot.disabled]:i}),onMouseEnter:()=>{const b=setTimeout(()=>{m(!0),p(!1)},200);d(b)},onMouseLeave:()=>{x&&clearTimeout(x),m(!1),p(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{i||(e(),h([...g,{id:t.v4(),message:"Changes undone",status:"success"}]))},fill:i?"#757575":"#252525"}),c&&t.jsxRuntimeExports.jsx(Bt,{text:i?"Nothing to undo":"Click to undo changes"})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ot.button,{[Ot.disabled]:a}),onMouseEnter:()=>{const b=setTimeout(()=>{p(!0),m(!1)},200);d(b)},onMouseLeave:()=>{x&&clearTimeout(x),p(!1),m(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(n(),h([...g,{id:t.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),u&&t.jsxRuntimeExports.jsx(Bt,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},Di="_devices_ls6k9_1",Fi="_device_ls6k9_1",Oi="_active_ls6k9_27",ps={devices:Di,device:Fi,active:Oi},Hi=()=>t.jsxRuntimeExports.jsx("div",{className:ps.devices,children:Ao.map(e=>t.jsxRuntimeExports.jsx(zi,{device:e}))}),zi=e=>{const{device:n}=e,{currentDevice:s,setCurrentDevice:r}=t.useDeviceStore(),[i,o]=_.useState(!1),[a,l]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ps.device,{[ps.active]:s.value===n.value}),onClick:()=>r(n),onMouseEnter:()=>{const u=setTimeout(()=>{o(!0)},200);l(u)},onMouseLeave:()=>{a&&clearTimeout(a),o(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:n.icon,fill:s.value===n.value?"#252525":"#757575",width:20,height:20}),i&&t.jsxRuntimeExports.jsx(Bt,{text:`Switch to ${n.value} view`})]},n.value)},Ui="_preview_1x3m8_2",Vi="_active_1x3m8_19",Hn={preview:Ui,active:Vi},Wi=()=>{const{onPreview:e}=t.usePreviewStore(),[n,s]=_.useState(!1),[r,i]=_.useState(null);return t.jsxRuntimeExports.jsxs("a",{href:"/",className:t.clx(Hn.preview,{[Hn.active]:e}),target:"_blank",onMouseEnter:()=>{const o=setTimeout(()=>{s(!0)},200);i(o)},onMouseLeave:()=>{r&&clearTimeout(r),s(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUpRight",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:Hn.text,children:"Preview"}),n&&t.jsxRuntimeExports.jsx(Bt,{text:"Open draft theme in new tab"})]})},qi="_settings_u4cv4_1",Gi={settings:qi},Zi="_pages_167qp_1",Xi="_text_167qp_21",Yi="_modal_167qp_27",Ki="_open_167qp_46",Ji="_page_167qp_1",Qi="_hoverable_167qp_61",ea="_separator_167qp_65",ta="_button_167qp_70",na="_items_167qp_85",$e={pages:Zi,default:"_default_167qp_5",text:Xi,modal:Yi,open:Ki,page:Ji,hoverable:Qi,separator:ea,button:ta,items:na},Be=e=>e?e.replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" and "):"",Or=(e,n,s,r,i,o,a)=>{const l=e.currentTarget.getBoundingClientRect(),u=window.innerHeight-l.bottom,p=l.top,c=window.innerWidth-l.right,m=l.left;let x,d;return x=l.bottom+r+window.scrollY,d=l.left,(u<n||u<i)&&(p>=n+a?x=l.top-n-r+window.scrollY:x=window.scrollY+a),x-window.scrollY<a&&(x=window.scrollY+a),(c<s||c<o)&&(m>=s?d=l.right-s:d=(window.innerWidth-s)/2),d<l.right+o&&(d=l.right+o),d<l.right&&d+s>l.left&&x<l.bottom&&x+n>l.top&&(c>=s+o?d=l.right+r+o:u>=n?x=l.bottom+r+window.scrollY:(x=window.scrollY+a,d=(window.innerWidth-s)/2)),{top:x,left:d}},Hr=async e=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),r=`${t.API_URL}/v2/builder/shops/${n}/drafts/${s}/pages/${encodeURIComponent(e)}`;return await t.request({url:r,withToken:!0,method:"delete"})},sa=()=>{const{currentPage:e,setCurrentPage:n,setIsOpenModal:s,pages:r,setIsEdit:i,setEditedPage:o,deletePage:a,setIsOpenSelectModal:l}=t.usePagesStore(),{deletePage:u,setCurrentBlock:p}=t.useLayersStore(),[c,m]=_.useState(null),{setTitle:x,setDescription:d,setOnConfirm:g}=t.useConfirmationModalStore(),[h,b]=_.useState(!1),f=_.useRef(null);return t.useOnClickOutside(f,()=>{h&&b(!1)}),_.useEffect(()=>{h?l(!0):setTimeout(()=>{l(!1)},300)},[h]),t.jsxRuntimeExports.jsxs("div",{className:$e.pages,ref:f,children:[t.jsxRuntimeExports.jsxs("div",{className:$e.default,onClick:E=>{E.stopPropagation(),b(C=>!C)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:r&&r[e]&&r[e].icon||"File",fill:"#252525",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:$e.text,children:r&&r[e]&&t.defaultPagePaths.includes(r[e].path)?`${Be(r[e].name)} page`:r&&r[e]&&r[e].name}),t.jsxRuntimeExports.jsx("div",{style:{transform:h?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:20,height:20})})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx($e.modal,{[$e.open]:h}),onClick:E=>E.stopPropagation(),children:[r&&t.jsxRuntimeExports.jsx("div",{className:$e.items,children:Object.keys(r).map(E=>{const C=r[E];return t.jsxRuntimeExports.jsxs("div",{className:t.clx($e.page,{[$e.hoverable]:c===E}),onMouseEnter:()=>m(E),onMouseLeave:()=>m(null),onClick:()=>{m(null),i(!1),p(null),n(E),b(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:C.icon,fill:"#252525"}),t.jsxRuntimeExports.jsx("span",{className:$e.text,children:t.defaultPagePaths.includes(C.path)?`${Be(C.name)} page`:C.name}),c===E&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Gear",fill:"#757575",onClick:N=>{N.stopPropagation(),i(!0),o(E),s(!0)}}),!t.defaultPagePaths.includes(C.path)&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"#C12A2A",onClick:N=>{N.stopPropagation(),x("Delete Page"),d(`Are you sure you want to delete ${C.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),g(()=>{N.stopPropagation(),r[e].path===C.path&&n(Object.keys(r)[0]),a(E),u(C.name),Hr(C.path)})}})]}),r[e]&&r[e].name===C.name&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"#FF3F19"})]},E)})}),t.jsxRuntimeExports.jsx("div",{className:$e.separator}),t.jsxRuntimeExports.jsxs(t.Button,{className:$e.button,onClick:E=>{E.stopPropagation(),s(!0)},size:"l",children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#ff3f19"}),t.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},ra="_zoom_fu0hj_1",Ds={zoom:ra},oa=()=>{const{zoomLevel:e,setZoomLevel:n}=t.usePreviewStore();return t.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:Ds.zoom,children:[t.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),t.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:s=>{const r=Number(s.target.value);n(r/100)},className:Ds.input}),t.jsxRuntimeExports.jsx("span",{children:"%"})]})},ia=()=>t.jsxRuntimeExports.jsxs("div",{className:Gi.settings,children:[t.jsxRuntimeExports.jsx(sa,{}),t.jsxRuntimeExports.jsx(oa,{})]}),aa="_theme_1e5wq_1",la="_text_1e5wq_13",Fs={theme:aa,text:la},ca=()=>t.jsxRuntimeExports.jsx("div",{className:Fs.theme,children:t.jsxRuntimeExports.jsx("div",{className:Fs.text,children:"Live Theme"})}),ua=async(e,n,s)=>{const r=localStorage.getItem("shopId")||void 0,i=localStorage.getItem("draftId"),o=`${t.API_URL}/v2/builder/shops/${r}/drafts/${i}/${n}`;return await t.request({url:o,withToken:!0,method:e,body:s})};function Ht(e,n){try{return n.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(o=>o&&o.type===e).map(o=>{if(o.value===void 0)throw new Error("item.value is undefined.");return o.value}).flat()}).flat().filter(r=>r).map(r=>e==="ListingIds"?r.listingId:r)}catch(s){return console.error("Error in getValues function:",s),[]}}function pa(e,n,s){return da(e,n)?(s.reviews||[]).length*3:0}function da(e,n){return n.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(o=>o&&o.type===e).map(o=>{if(o.value===void 0)throw new Error("item.value is undefined.");return o.value}).flat()}).flat().filter(r=>r).length>0}function ma(e,n){if(n){const s=Object.keys(n).find(r=>n[r].path===e);if(s)return n[s]}return null}const xa=({setIsLoading:e,isLoading:n})=>{const{themeSettings:s}=t.useThemeSettingsStore(),{settings:r}=t.useSettingsStore(),[i,o]=_.useState(null),[a,l]=_.useState(!1),{setNotifications:u,notifications:p}=t.useNotificationStore(),{header:c,footer:m,announcement:x,blocks:d}=t.useLayersStore(),{pageContext:g}=t.usePagesStore(),{pages:h}=t.usePagesStore(),b=async()=>{if(a)i&&clearTimeout(i);else{e(!0);const E=Object.keys(d).map(w=>{const S=ma(w,h);return d[w]&&d[w].data&&(S!=null&&S.path)?{id:S?S.id:w,name:S?S.name:w,path:S.path,layout:{...d[w]},neededProductIds:[...Ht("ProductId",Object.values(d[w].data))],neededCategoryIds:[...Ht("CategoryId",Object.values(d[w].data))],neededAnnouncementIds:[...Ht("AnnouncementId",Object.values(d[w].data))],neededListingIds:[...Ht("ListingIds",Object.values(d[w].data))],neededFaqIds:[...Ht("FaqsIds",Object.values(d[w].data))],neededReviewCount:pa("ReviewCount",Object.values(d[w].data),g),seo:{pageTitle:S&&S.seo&&S.seo.pageTitle?S.seo.pageTitle:"",pageDescription:S&&S.seo&&S.seo.pageDescription?S.seo.pageDescription:""},isPrivate:!!(S&&S.visibility==="private")}:null}).filter(w=>w),C={settings:{maxStoreWidth:r==null?void 0:r.blockSettings.maxStoreWidth},header:c,footer:m,announcement:x},{status:N}=await ua("post","save",{themeSettings:s,settings:C,updatedPages:E});u([...p,{id:t.v4(),message:N===200?"Settings saved":"Error",status:N===200?"success":"error"}]),e(!1)}l(!0);const f=setTimeout(()=>{l(!1)},2e3);o(f)};return t.jsxRuntimeExports.jsx(t.Button,{onClick:b,disabled:n,children:t.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},ha=()=>{const{isOpenSelectModal:e}=t.usePagesStore(),[n,s]=_.useState(!1),{showTooltip:r}=t.useTooltipStore();return t.jsxRuntimeExports.jsxs("div",{className:pn.header,style:{zIndex:e?5e4:r?501:50},children:[t.jsxRuntimeExports.jsxs("div",{className:pn.left,children:[t.jsxRuntimeExports.jsx(Hi,{}),t.jsxRuntimeExports.jsx(Wi,{})]}),t.jsxRuntimeExports.jsx("div",{className:pn.center,children:t.jsxRuntimeExports.jsx(ia,{})}),t.jsxRuntimeExports.jsxs("div",{className:pn.right,children:[t.jsxRuntimeExports.jsx(ca,{}),t.jsxRuntimeExports.jsx($i,{}),t.jsxRuntimeExports.jsx(xa,{setIsLoading:s,isLoading:n}),n&&t.jsxRuntimeExports.jsx(mt,{})]})]})},ga="_exit_ovvox_1",fa="_text_ovvox_11",ja="_exitLink_ovvox_16",zn={exit:ga,text:fa,exitLink:ja},ya=()=>t.jsxRuntimeExports.jsx("div",{className:zn.exit,children:t.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:zn.exitLink,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"SignOut",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:zn.text,children:"Exit"})]})}),_a="_navbar_1podc_1",Sa="_main_1podc_6",ba="_block_1podc_13",Ca="_active_1podc_29",dn={navbar:_a,main:Sa,block:ba,active:Ca},Ea=()=>{const{activeBlock:e}=t.useNavbarStore(),{setActiveBlock:n}=t.useBlocksStore(),{setCurrentBlock:s}=t.useLayersStore(),{setActiveBlock:r}=t.useThemeSettingsStore(),{setActiveBlock:i}=t.usePreviewStore(),o=t.useNavigate();function a(l){switch(n(null),s(null),r(null),i({id:null,neededScroll:!1}),l.name){case"Layers":o("/admin/builder");break;case"Add":o("/admin/builder/add");break;case"Theme":o("/admin/builder/theme");break;case"Settings":o("/admin/builder/settings");break}}return t.jsxRuntimeExports.jsxs("div",{className:dn.navbar,children:[t.jsxRuntimeExports.jsx(ya,{}),t.jsxRuntimeExports.jsx("div",{className:dn.main,children:t.navbarBlocks.map(l=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(dn.block,{[dn.active]:e.icon===l.icon}),onClick:()=>a(l),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:l.icon,fill:e.icon===l.icon?"#252525":"#757575"}),t.jsxRuntimeExports.jsx("span",{children:l.name})]},l.icon))})]})},va="_preview_gb2ye_1",wa="_main_gb2ye_15",ka="_content_gb2ye_25",Ra="_loading_gb2ye_34",Na="_previewLoading_gb2ye_65",zt={preview:va,main:wa,content:ka,loading:Ra,previewLoading:Na},Ia="_header_11zku_2",Ta="_circles_11zku_16",Pa="_circle_11zku_16",La="_red_11zku_32",Ba="_green_11zku_36",Aa="_yellow_11zku_40",Ma="_input_11zku_44",$a="_main_11zku_55",Da="_text_11zku_63",Fa="_copy_11zku_75",qe={header:Ia,circles:Ta,circle:Pa,red:La,green:Ba,yellow:Aa,input:Ma,main:$a,text:Da,copy:Fa},Oa=["red","yellow","green"],Ha=()=>{const{currentDevice:e}=t.useDeviceStore(),n=(i,o)=>i.length>o?i.slice(0,o)+"...":i,{notifications:s,setNotifications:r}=t.useNotificationStore();return t.jsxRuntimeExports.jsxs("div",{className:qe.header,children:[t.jsxRuntimeExports.jsx("div",{className:qe.circles,children:Oa.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(qe.circle,{[qe.red]:i==="red",[qe.yellow]:i==="yellow",[qe.green]:i==="green"})},i))}),t.jsxRuntimeExports.jsx("div",{className:qe.input,children:t.jsxRuntimeExports.jsxs("div",{className:qe.main,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),t.jsxRuntimeExports.jsx("span",{className:qe.text,children:e.value==="mobile"?n(window.location.origin,35):e.value==="desktop"?n(window.location.origin,200):n(window.location.origin,100)})]})}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),r([...s,{id:t.v4(),status:"success",message:"Domain copied to clipboard"}])},className:qe.copy,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},za="_results_1pahy_1",Os={results:za};function Ua(e,n){return n?new n[e]().blockSettings.isAddable:!1}function Hs(e,n){return e?Object.keys(e||{}).reduce((s,r)=>(Ua(r,n)&&s.push({name:r,displayName:t.getDisplayName(r,n)}),s),[]):[]}const Va="_product_yggw5_1",Wa="_name_yggw5_15",zs={product:Va,name:Wa},qa=e=>{const{blockId:n,setSearchValue:s}=e,{sourceBlocks:r,setActiveBlock:i}=t.useBlocksStore(),{hideModal:o,hoverBlockId:a,isModalVisible:l,showPreview:u,hidePreview:p,clearHideTimeout:c,startHideTimeout:m,setHoverBlockTopPosition:x}=t.useSubmodalStore();function d(b){s(""),i(b),o("keyBlock")}function g(b,f){const E=window.innerHeight,C=400,N=10;let w=f.clientY-120;w+C>E&&(w=E-C-N),w<N&&(w=N),a||o("keyBlock"),u(b,"keyBlock"),c(),x(w)}function h(){l?m("keyBlock"):p("keyBlock"),x(null)}return t.jsxRuntimeExports.jsxs("div",{className:zs.product,onClick:()=>d(n),onMouseEnter:b=>g(n,b),onMouseLeave:h,children:[en[n]?t.jsxRuntimeExports.jsx("img",{src:en[n]}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards"}),t.jsxRuntimeExports.jsx("span",{className:zs.name,children:t.getDisplayName(n,r)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight",width:20,height:20})]},n)},zr=()=>{const{blocks:e,sourceBlocks:n}=t.useBlocksStore(),[s,r]=_.useState(""),[i,o]=_.useState([]),a=_.useMemo(()=>Hs(e,n),[e,n]),l=_.useMemo(()=>new t.Fuse(a,{keys:["displayName"],threshold:.4}),[a]);return _.useEffect(()=>{if(s.trim()==="")o(Hs(e,n));else{const u=l.search(s);o(u.map(p=>p.item))}},[s,l]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:r,value:s,style:{marginBottom:10}}),t.jsxRuntimeExports.jsx("div",{className:Os.results,children:i.length>0?i.map(u=>t.jsxRuntimeExports.jsx(qa,{blockId:u.name,setSearchValue:r})):t.jsxRuntimeExports.jsx("div",{className:Os.noResults,children:"No sections found"})})]})},Ga="_wrapper_1k1cr_1",Za="_submodal_1k1cr_14",ds={wrapper:Ga,submodal:Za},Xa=({children:e,positionTop:n,positionLeft:s})=>{const{keyBlock:r,startHideTimeout:i,clearHideTimeout:o,setMouseOverModal:a}=t.useSubmodalStore();return r?t.jsxRuntimeExports.jsx("div",{className:ds.wrapper,style:n?{top:n,left:s||void 0}:{},onMouseEnter:()=>{o(),a(!0)},onMouseLeave:()=>{a(!1),i()},children:e}):null},Ya=({children:e})=>{const{hoverBlockId:n,startHideTimeout:s,clearHideTimeout:r,setMouseOverModal:i}=t.useSubmodalStore();return n?t.jsxRuntimeExports.jsx("div",{className:t.clx(ds.wrapper,ds.submodal),onMouseEnter:()=>{r(),i(!0)},onMouseLeave:()=>{i(!1),s()},children:e}):null},Ka="_applyButton_1a9kh_2",Ja="_content_1a9kh_7",Qa="_title_1a9kh_14",el="_label_1a9kh_21",tl="_colorValue_1a9kh_40",nl="_colorMap_1a9kh_48",sl="_indicator_1a9kh_57",rl="_hueSlider_1a9kh_66",ol="_slider_1a9kh_97",il="_buttons_1a9kh_102",al="_name_1a9kh_109",ll="_secondary_1a9kh_114",cl="_input_1a9kh_122",ul="_modal_1a9kh_160",pl="_alphaSlider_1a9kh_249",dl="_alphaBackground_1a9kh_257",ml="_alphaGradient_1a9kh_268",xl="_chargeTypes_1a9kh_297",hl="_charge_1a9kh_297",gl="_chargeActive_1a9kh_326",fl="_gradient_1a9kh_334",jl="_color_1a9kh_40",yl="_colorActive_1a9kh_355",_l="_gradientWrapper_1a9kh_362",Sl="_subtitle_1a9kh_368",bl="_colorTypes_1a9kh_375",Cl="_colorType_1a9kh_375",El="_colorTypeActive_1a9kh_399",vl="_colorsWrapper_1a9kh_404",wl="_colors_1a9kh_404",J={applyButton:Ka,content:Ja,title:Qa,label:el,colorValue:tl,colorMap:nl,indicator:sl,hueSlider:rl,slider:ol,buttons:il,name:al,secondary:ll,input:cl,modal:ul,alphaSlider:pl,alphaBackground:dl,alphaGradient:ml,chargeTypes:xl,charge:hl,chargeActive:gl,gradient:fl,color:jl,colorActive:yl,gradientWrapper:_l,subtitle:Sl,colorTypes:bl,colorType:Cl,colorTypeActive:El,colorsWrapper:vl,colors:wl},kl=()=>{const{modalPosition:e,color:n,initialColor:s,setShowModal:r,hue:i,saturation:o,brightness:a,alpha:l,dragging:u,setDragging:p,setHue:c,setSaturation:m,setBrightness:x,setAlpha:d,colorChange:g,setColor:h,update:b,isGradient:f,setIsGradient:E,gradientDirection:C,setGradientDirection:N,hue2:w,saturation2:S,brightness2:A,alpha2:$,setHue2:z,setSaturation2:V,setBrightness2:B,setAlpha2:R,activeColorIndex:I,setActiveColorIndex:M,isGradientActive:P}=t.useColorPickerStore(),O=(Y,W,ie)=>{W/=100,ie/=100;const Z=pe=>(pe+Y/60)%6,ee=pe=>ie*(1-W*Math.max(0,Math.min(Z(pe),4-Z(pe),1))),K=Math.round(255*ee(5)),oe=Math.round(255*ee(3)),ne=Math.round(255*ee(1));return{r:K,g:oe,b:ne}},D=Y=>Y.toString(16).padStart(2,"0"),L=(Y,W,ie,Z)=>{const{r:ee,g:K,b:oe}=O(Y,W,ie),ne=Math.round(Z/100*255);return`#${D(ee)}${D(K)}${D(oe)}${D(ne)}`},H=(Y,W,ie,Z)=>{if(f)if(I===1){c(Y),m(W),x(ie),d(Z);const ee=L(Y,W,ie,Z),K=L(w,S,A,$),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${ee} 0%, ${K} 100%)`;g(ne),h(ne)}else{z(Y),V(W),B(ie),R(Z);const ee=L(Y,W,ie,Z),K=L(i,o,a,l),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${K} 0%, ${ee} 100%)`;g(ne),h(ne)}else{const ee=L(Y,W,ie,Z);g(ee),h(ee)}},j=(Y,W,ie)=>{const{width:Z,height:ee}=ie.getBoundingClientRect(),K=Math.max(0,Math.min(Y/Z*100,100)),oe=Math.max(0,Math.min(100-W/ee*100,100));f?I===1?(m(K),x(oe),H(i,K,oe,l)):(V(K),B(oe),H(w,K,oe,$)):(m(K),x(oe),H(i,K,oe,l))},se=Y=>{const{offsetX:W,offsetY:ie}=Y.nativeEvent;p(!0),j(W,ie,Y.currentTarget)},he=Y=>{if(u){const W=document.querySelector(`.${J.colorMap}`),{left:ie,top:Z}=W.getBoundingClientRect(),ee=Y.clientX-ie,K=Y.clientY-Z;j(ee,K,W)}},y=()=>{p(!1)};_.useEffect(()=>{function Y(Z){const ee=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,K=Z.match(ee);if(K){const oe=K[1],ne=K[2],pe=K[3];return{angle:oe,col1:ne,col2:pe}}return null}function W(Z){const ee=parseInt(Z.slice(1,3),16),K=parseInt(Z.slice(3,5),16),oe=parseInt(Z.slice(5,7),16),ne=parseInt(Z.slice(7,9),16)/255*100,{h:pe,s:it,b:v}=ie(ee,K,oe);return{h:pe,s:it,b:v,a:ne}}function ie(Z,ee,K){Z/=255,ee/=255,K/=255;const oe=Math.max(Z,ee,K),ne=Math.min(Z,ee,K);let pe=0;const it=oe-ne,v=(oe===0?0:it/oe)*100,T=oe*100;if(oe===ne)pe=0;else switch(oe){case Z:pe=((ee-K)/it+(ee<K?6:0))*60;break;case ee:pe=((K-Z)/it+2)*60;break;case K:pe=((Z-ee)/it+4)*60;break}return{h:pe,s:v,b:T}}if(s&&s.startsWith("linear-gradient")){const Z=Y(s);if(Z){const{angle:ee,col1:K,col2:oe}=Z,ne=W(K),pe=W(oe);E(!0),N(ee==="0deg"?"vertical":"horizontal"),c(ne.h),m(ne.s),x(ne.b),d(ne.a),z(pe.h),V(pe.s),B(pe.b),R(pe.a),M(1)}}else if(s){const ee=function(oe){let ne=oe;return ne.length===7?ne+"ff":ne.length===9?ne:ne.length===4?ne[0]+ne[1].repeat(2)+ne[2].repeat(2)+ne[3].repeat(2)+"ff":"#000000ff"}(s),K=W(ee);E(!1),c(K.h),m(K.s),x(K.b),d(K.a)}},[s,E,N,c,m,x,d,z,V,B,R,M]),_.useEffect(()=>{let Y,W,ie,Z;f?I===1?(Y=i,W=o,ie=a,Z=l):(Y=w,W=S,ie=A,Z=$):(Y=i,W=o,ie=a,Z=l),H(Y,W,ie,Z)},[f,C,I,i,o,a,l,w,S,A,$]),_.useEffect(()=>{const Y=ie=>he(ie),W=()=>y();return u?(document.addEventListener("mousemove",Y),document.addEventListener("mouseup",W)):(document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",W)),()=>{document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",W)}},[u,f,C]);function Q(){if(!f)b(n);else{const Y=L(i,o,a,l),W=L(w,S,A,$),Z=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${Y} 0%, ${W} 100%)`;b(Z)}r(!1)}function ge(){r(!1),g(s)}const G=f?I===1?i:w:i,je=f?I===1?o:S:o,Ae=f?I===1?a:A:a,ot=f?I===1?l:$:l,{r:Je,g:ht,b:cn}=O(G,je,Ae),Mn=`linear-gradient(to right, rgba(${Je}, ${ht}, ${cn}, 0), rgba(${Je}, ${ht}, ${cn}, 1))`,un=L(i,o,a,l),$t=L(w,S,A,$);return t.jsxRuntimeExports.jsxs("div",{className:J.modal,onClick:Y=>Y.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsx("h2",{className:J.title,children:"Color"}),P&&t.jsxRuntimeExports.jsxs("div",{className:J.colorTypes,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.colorType,{[J.colorTypeActive]:!f}),onClick:()=>E(!1),children:[t.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.colorType,{[J.colorTypeActive]:f}),onClick:()=>E(!0),children:[t.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),f&&P&&t.jsxRuntimeExports.jsxs("div",{className:J.colorsWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:J.colors,style:{background:`linear-gradient(90deg, ${un} 0%, ${$t} 100%)`}}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.color,{[J.colorActive]:I===1}),onClick:()=>M(1),style:{background:un}}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.color,{[J.colorActive]:I===2}),onClick:()=>M(2),style:{background:$t}})]}),t.jsxRuntimeExports.jsx("div",{className:J.colorMap,onMouseDown:se,style:{background:`
100
100
  linear-gradient(to top, black, transparent),
101
101
  linear-gradient(to right, hsl(${G}, 100%, 100%), hsl(${G}, 100%, 50%))
102
- `},children:t.jsxRuntimeExports.jsx("div",{className:J.indicator,style:{position:"absolute",left:`${je}%`,top:`${100-Ae}%`,transform:"translate(-50%, -50%)"}})}),t.jsxRuntimeExports.jsx("div",{className:J.hueSlider,style:{bottom:j?"175px":"100px"},children:t.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:G,onChange:Y=>{const W=Number(Y.target.value);j?I===1?H(W,o,a,l):H(W,b,A,$):(c(W),H(W,o,a,l))},className:J.slider})}),t.jsxRuntimeExports.jsxs("div",{className:J.alphaSlider,style:{bottom:j?"150px":"75px"},children:[t.jsxRuntimeExports.jsx("div",{className:J.alphaBackground}),t.jsxRuntimeExports.jsx("div",{className:J.alphaGradient,style:{background:Mn}}),t.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:ot,onChange:Y=>{const W=Number(Y.target.value);j?I===1?H(i,o,a,W):H(w,b,A,W):(d(W),H(i,o,a,W))},className:J.slider})]}),j&&P&&t.jsxRuntimeExports.jsxs("div",{className:J.gradientWrapper,children:[t.jsxRuntimeExports.jsx("h3",{className:J.subtitle,children:"Rotation"}),t.jsxRuntimeExports.jsx("div",{className:J.gradient,children:t.jsxRuntimeExports.jsxs("div",{className:J.chargeTypes,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.charge,{[J.chargeActive]:C==="horizontal"}),onClick:()=>N("horizontal"),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.charge,{[J.chargeActive]:C==="vertical"}),onClick:()=>N("vertical"),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),t.jsxRuntimeExports.jsxs("div",{className:J.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:ge,className:t.clx(J.applyButton,J.cancelButton),type:"Secondary",children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:Q,className:J.applyButton,children:"Apply"})]})]})},Rl=()=>{const{onPreview:e,zoomLevel:n}=t.usePreviewStore(),{keyBlock:s,hoverBlockId:r,isModalVisible:i,hoverBlockTopPosition:o}=t.useSubmodalStore(),{settings:a}=t.useSettingsStore(),{sourceBlocks:l}=t.useBlocksStore(),{pageContext:u}=t.usePagesStore(),{showModal:p}=t.useColorPickerStore(),{currentDevice:c}=t.useDeviceStore(),{isLoadingThemeSettings:m}=t.useThemeSettingsStore(),{isLoadingLayers:x}=t.useLayersStore(),d=C=>C?!l||!l[C]?t.jsxRuntimeExports.jsx(t.ErrorableBlock,{error:`Block "${C}" does not exist in blocks.`}):new l[C]().renderPreview(a,u):t.jsxRuntimeExports.jsx(t.ErrorableBlock,{error:"Block or block.name is undefined."});function g(){if(c.value==="desktop")return n>=1?"100%":`${(n*100).toFixed(2)}%`;{const C=c.value==="tablet"?768:425;return n>=1?`${C}px`:`${(C*n).toFixed(2)}px`}}function h(){switch(c.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:S}=t.usePagesStore(),j=_.useRef(null),E=C=>{j.current&&(j.current.scrollTop+=C.deltaY)};return t.jsxRuntimeExports.jsxs("div",{className:zt.preview,style:{zIndex:p&&!S?5e3:500},onWheel:C=>{C.stopPropagation(),E(C)},children:[i&&t.jsxRuntimeExports.jsx(Ya,{children:t.jsxRuntimeExports.jsx(zr,{})}),t.jsxRuntimeExports.jsxs(Xa,{positionTop:o,positionLeft:!r&&s?void 0:250,children:[!m&&!x&&t.jsxRuntimeExports.jsx(t.RenderBlock,{render:d,block:s},s),(m||!s||x)&&t.jsxRuntimeExports.jsx("div",{className:zt.previewLoading,children:t.jsxRuntimeExports.jsx(mt,{})})]}),p&&t.jsxRuntimeExports.jsx(kl,{}),e&&t.jsxRuntimeExports.jsxs("div",{className:zt.main,style:{width:h()},children:[t.jsxRuntimeExports.jsx(Ha,{}),t.jsxRuntimeExports.jsx("div",{style:{borderLeft:g()==="100%"?"none":"var(--default-border)",borderRight:g()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:C=>{C.stopPropagation()},onWheel:C=>{C.stopPropagation()},children:!m&&!x?t.jsxRuntimeExports.jsx("div",{className:zt.content,style:{width:g()},children:t.jsxRuntimeExports.jsx(t.PreviewContent,{scrollableRef:j})}):t.jsxRuntimeExports.jsx("div",{className:zt.loading,children:t.jsxRuntimeExports.jsx(mt,{})})})]})]})},Nl="_sidebar_1xtkj_1",Il="_title_1xtkj_11",Us={sidebar:Nl,title:Il},Tl="_layers_1jhzw_1",Pl="_wrapper_1jhzw_9",Ll="_draggingWrapper_1jhzw_17",Bl="_block_1jhzw_21",Al="_dragging_1jhzw_17",Ml="_active_1jhzw_56",$l="_add_1jhzw_63",Dl="_addTop_1jhzw_79",Fl="_visible_1jhzw_95",Ol="_button_1jhzw_99",Hl="_nameBlock_1jhzw_158",zl="_loader_1jhzw_162",Ul="_actions_1jhzw_171",Vl="_deleteButton_1jhzw_179",ye={layers:Tl,wrapper:Pl,draggingWrapper:Ll,block:Bl,dragging:Al,active:Ml,add:$l,addTop:Dl,visible:Fl,button:Ol,nameBlock:Hl,loader:zl,actions:Ul,deleteButton:Vl},Wl="_block_sj4cc_1",ql="_title_sj4cc_17",Gl="_actions_sj4cc_21",ft={block:Wl,title:ql,actions:Gl},Un={header:"Header",footer:"Footer",announcement:"Announcement"},Vn=({id:e})=>{const{setCurrentBlock:n}=t.useLayersStore(),{activeBlock:s}=t.usePreviewStore(),[r,i]=_.useState(!1);function o(a){n(a)}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ft.block,{[ft.active]:s.id===e,[ft.header]:e==="header",[ft.footer]:e==="footer",[ft.announcement]:e==="announcement"}),onClick:()=>o(e),onMouseOver:()=>i(!0),onMouseLeave:()=>i(!1),children:[en[Un[e]]?t.jsxRuntimeExports.jsx("img",{src:en[Un[e]],width:20,height:20}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:ft.title,children:Un[e]}),t.jsxRuntimeExports.jsx("div",{className:ft.actions,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},Zl=({id:e,name:n,onClick:s,isDragging:r,icon:i})=>{const{activeBlock:o,setActiveBlock:a}=t.usePreviewStore(),{showPreview:l,hidePreview:u,showModal:p,hideModal:c,clearHideTimeout:m,startHideTimeout:x,hoverBlockId:d,isModalVisible:g}=t.useSubmodalStore(),{setPositionBlock:h}=t.useLayersStore(),[S,j]=_.useState(!1),[E,C]=_.useState(!1),[N,w]=_.useState(!1),[b,A]=_.useState(!1),[$,z]=_.useState(null),V=_.useRef(null),{attributes:B,listeners:R,setNodeRef:I,transform:M,transition:P}=t.useSortable({id:e}),O={transform:t.CSS.Transform.toString(M),transition:P},{setTitle:D,setDescription:L,setOnConfirm:H}=t.useConfirmationModalStore(),{pages:f,currentPage:se}=t.usePagesStore(),{removeBlock:he}=t.useLayersStore(),y=G=>{G.stopPropagation(),V.current&&clearTimeout(V.current),a({id:e,neededScroll:!0}),g&&c(),l(e),m()},Q=(G,je=!0)=>{G.stopPropagation(),u(),p(e),m(),h(e,je)},ge=G=>{G.stopPropagation(),a({id:null,neededScroll:!1}),g?x():u()};return _.useEffect(()=>{w(!1),j(!1),C(!1),A(!1)},[r]),_.useEffect(()=>{g||(C(!1),j(!1))},[g]),t.jsxRuntimeExports.jsxs("div",{ref:I,style:O,className:t.clx(ye.wrapper,{[ye.draggingWrapper]:r&&o.id===e}),onClick:G=>{G.stopPropagation(),s(e)},onMouseEnter:y,onMouseLeave:ge,...B,...R,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(ye.block,{[ye.dragging]:r&&o.id===e,[ye.active]:!r&&o.id===e}),children:[i?t.jsxRuntimeExports.jsx("img",{src:i,width:20,height:20}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:ye.nameBlock,children:n}),d===e&&!r&&t.jsxRuntimeExports.jsx("div",{className:t.clx(ye.addTop,{[ye.visible]:E}),onMouseEnter:()=>{C(!0)},onMouseLeave:()=>{C(!1)},children:t.jsxRuntimeExports.jsxs("button",{className:ye.button,onClick:G=>Q(G,!1),onMouseEnter:()=>{const G=setTimeout(()=>{r||A(!0)},200);z(G)},onMouseLeave:()=>{$&&clearTimeout($),A(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#fff"}),b&&t.jsxRuntimeExports.jsx(Bt,{text:"Click to add a section"})]})}),d===e&&!r&&t.jsxRuntimeExports.jsx("div",{className:t.clx(ye.add,{[ye.visible]:S}),onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},children:t.jsxRuntimeExports.jsxs("button",{className:ye.button,onClick:G=>Q(G),onMouseEnter:()=>{const G=setTimeout(()=>{r||w(!0)},200);z(G)},onMouseLeave:()=>{$&&clearTimeout($),w(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#fff"}),N&&t.jsxRuntimeExports.jsx(Bt,{text:"Click to add a section"})]})})]}),d===e&&!r&&t.jsxRuntimeExports.jsxs("div",{className:ye.actions,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),t.jsxRuntimeExports.jsx("div",{className:ye.deleteButton,onClick:G=>{G.stopPropagation(),D("Remove Block"),L(`Are you sure you want to delete ${n||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),H(()=>{f&&he(f[se].path,e)})},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},Xl=()=>{const{blocks:e,setCurrentBlock:n,currentBlock:s,moveBlock:r,isLoadingLayers:i,announcement:o}=t.useLayersStore(),{currentPage:a,pages:l}=t.usePagesStore(),{setMouseOverModal:u,setHoverBlockId:p}=t.useSubmodalStore(),{sourceBlocks:c}=t.useBlocksStore();function m(j){n(j),u(!1),p(null)}const x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),[d,g]=_.useState(!1),h=()=>{g(!0)},S=j=>{g(!1);const{active:E,over:C}=j;if(C&&E.id!==C.id&&l&&l[a]){const N=l[a].path,w=e[N].order,b=w.indexOf(E.id),A=w.indexOf(C.id);b!==-1&&A!==-1&&r(N,b,A)}};return t.jsxRuntimeExports.jsx("div",{className:ye.layers,children:i?t.jsxRuntimeExports.jsx("div",{className:ye.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx(Vn,{id:"announcement"}),t.jsxRuntimeExports.jsx(Vn,{id:"header"}),!s&&t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:S,onDragStart:h,children:l&&l[a]&&e[l[a].path]&&t.jsxRuntimeExports.jsx(t.SortableContext,{items:e[l[a].path].order,strategy:t.verticalListSortingStrategy,children:e[l[a].path].order.map((j,E)=>t.jsxRuntimeExports.jsx(Zl,{id:j,name:t.getDisplayName(e[l[a].path].data[j].name,c),index:E,onClick:m,isDragging:d,icon:en[e[l[a].path].data[j].name]},j))})}),t.jsxRuntimeExports.jsx(Vn,{id:"footer"})]})})},Yl="_loader_eyvkk_1",Kl={loader:Yl},Jl=()=>{const{isLoadingSettings:e}=t.useSettingsStore();return e?t.jsxRuntimeExports.jsx("div",{className:Kl.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsx(Ql,{})},Ql=()=>{const{settings:e}=t.useSettingsStore(),{settings:n,setSettingsInstance:s}=t.useBlocksStore();if(!e)return null;const{setError:r}=t.useErrorStore(),i=new n(e.blockSettings);_.useEffect(()=>{s(i)},[e]);try{return i.renderSettings()}catch(o){throw console.error("Error rendering settings:",o),r({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),o}},ec="_theme_a1one_1",tc="_block_a1one_8",nc="_name_a1one_23",sc="_loader_a1one_27",mn={theme:ec,block:tc,name:nc,loader:sc},rc=()=>{const e=t.useNavigate(),{isLoadingThemeSettings:n,setActiveBlock:s}=t.useThemeSettingsStore();function r(i){switch(i==null?void 0:i.name){case"Colors":e("/admin/builder/theme/colors"),s(Ue[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(Ue[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(Ue[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(Ue[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(Ue[4]);break}}return t.jsxRuntimeExports.jsx("div",{className:mn.theme,children:n?t.jsxRuntimeExports.jsx("div",{className:mn.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):Ue.map(i=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>r(i),className:t.clx(mn.block),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:i.icon}),t.jsxRuntimeExports.jsx("span",{className:mn.name,children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight"})]},i.icon))})},oc="_render_7e826_9",ic="_open_7e826_24",ac="_close_7e826_51",lc="_clicked_7e826_55",cc="_loading_7e826_72",uc="_settings_7e826_76",kt={render:oc,open:ic,close:ac,clicked:lc,loading:cc,settings:uc},pc=({block:e})=>{const{pageContext:n}=t.usePagesStore(),{setError:s}=t.useErrorStore();try{return e.renderSettings(n)}catch(r){throw console.error("Error rendering settings:",r),s({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},dc="_wrapper_15ju8_1",mc="_header_15ju8_8",xc="_title_15ju8_15",hc="_colorWrapper_15ju8_21",gc="_name_15ju8_35",fc="_color_15ju8_21",jc="_value_15ju8_47",yc="_length_15ju8_51",Pe={wrapper:dc,header:mc,title:xc,colorWrapper:hc,name:gc,color:fc,value:jc,length:yc},_c=e=>{const{colors:n}=e,{themeSettings:s}=t.useThemeSettingsStore(),[r,i]=_.useState(!0);_.useEffect(()=>{n.length<=3&&i(!0)},[]);function o(a){const l=a.replace("--",""),[u,p]=l.split("-"),c=`${p.charAt(0).toUpperCase()+p.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[m,x]=l.split("-");return{name:c,field:m,variable:x}}return t.jsxRuntimeExports.jsxs("div",{className:Pe.wrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:Pe.header,children:[t.jsxRuntimeExports.jsx("div",{className:Pe.title,children:"Section Colors"}),!r&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(Pe.value,Pe.length),onClick:()=>i(!0),children:["+",n.length]})]}),r&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:Pe.colors,children:n.map(a=>{const l=o(a),{variable:u,name:p,field:c}=l;return t.jsxRuntimeExports.jsx(Sc,{color:s.colors[c][u],name:p})})}),n.length>3&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(Pe.value,Pe.length),onClick:()=>i(!1),children:["Hide ",n.length," colors"]})]})]})},Sc=e=>{const{name:n,color:s}=e,{setActiveLabel:r,setModalPosition:i,setInitialColor:o,setShowModal:a,setUpdate:l,setColor:u,setColorChange:p,colorChange:c,setIsGradientActive:m}=t.useColorPickerStore(),{updateColor:x}=t.useThemeSettingsStore(),d=(S,j)=>E=>{x(S,j,E)};_.useEffect(()=>{const S=()=>{a(!1),r(null),o(s),l(()=>{}),u(s),p(()=>{})};return document.body.addEventListener("click",S),()=>{document.body.removeEventListener("click",S)}},[]);const g=S=>{const j=n.split("/")[0],E=j.split(" ")[0].toLowerCase(),C=j.split(" ")[1].toLowerCase();S.stopPropagation(),a(!0),p(c),l(b=>d(C,E)(b)),o(s),u(s),m(C==="surface");const{top:N,left:w}=Or(S,550,288,10,20,230,80);i({top:C==="surface"?N:N+125,left:w-200})};function h(S){return S.length>15?S.slice(0,15)+"...":S}return t.jsxRuntimeExports.jsxs("div",{className:Pe.colorWrapper,onClick:g,children:[t.jsxRuntimeExports.jsx("div",{className:Pe.color,style:{background:s}}),t.jsxRuntimeExports.jsx("div",{className:Pe.name,children:n}),t.jsxRuntimeExports.jsx("div",{className:Pe.value,children:h(s)})]})},bc="_back_1sznl_1",Cc="_title_1sznl_9",Ec="_deleteButton_1sznl_17",vc="_backIcon_1sznl_30",xn={back:bc,title:Cc,deleteButton:Ec,backIcon:vc},wc=({onClick:e,setIsClicked:n,getDisplayName:s})=>{var x,d;const{activeBlock:r}=t.useBlocksStore(),{setTitle:i,setDescription:o,setOnConfirm:a}=t.useConfirmationModalStore(),{blocks:l,currentBlock:u,removeBlock:p}=t.useLayersStore(),{currentPage:c,pages:m}=t.usePagesStore();return t.jsxRuntimeExports.jsxs("div",{className:xn.back,children:[t.jsxRuntimeExports.jsx("div",{className:xn.backIcon,onClick:()=>e(),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx("h3",{className:xn.title,children:r&&s(r)||m&&m[c]&&l[m[c].path]&&u&&s((x=l[m[c].path].data[u])==null?void 0:x.name)||u&&Be(u)||"Loading"}),u&&m&&!["header","footer","announcement"].includes(u)&&l[m[c].path].data[u]&&s((d=l[m[c].path].data[u])==null?void 0:d.name)!=="unknown name"&&t.jsxRuntimeExports.jsx("button",{onClick:g=>{var h;g.stopPropagation(),i("Remove Block"),o(`Are you sure you want to delete ${s((h=l[m[c].path].data[u])==null?void 0:h.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{n(!0),p(m[c].path,u),e(!0)})},className:xn.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},kc=()=>{const e=t.useNavigate(),[n,s]=_.useState(!1),{header:r,footer:i,announcement:o,sourceBlocks:a,activeBlock:l,setActiveBlock:u,currentInstance:p,setCurrentInstance:c}=t.useBlocksStore(),{setActiveBlock:m}=t.usePreviewStore(),{blocks:x,addBlock:d,editBlock:g,currentBlock:h,setCurrentBlock:S,header:j,footer:E,announcement:C,isLoadingLayers:N}=t.useLayersStore(),{currentPage:w,pages:b}=t.usePagesStore(),{past:A,future:$}=t.useHistoryStore();function z(R=!1){if(b&&p&&h&&!["header","footer","announcement"].includes(h)&&!R){const I={blockSettings:{}};Object.keys(p.blockSettings).filter(M=>!["displayName","isAddable"].includes(M)).map(M=>{I.blockSettings[M]=p.blockSettings[M]}),g(b[w].path,h,{name:x[b[w].path].data[h].name,value:I})}u(null),S(null),m({id:null,neededScroll:!1}),setTimeout(()=>{s(!1)},150),c(null)}function V(R){var O;if(!b||!w||!R)return null;if(R==="header"){const D=new r;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=j==null?void 0:j.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=j==null?void 0:j.blockColors[L]}),D}if(R==="footer"){const D=new i;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=E==null?void 0:E.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=E==null?void 0:E.blockColors[L]}),D}if(R==="announcement"){const D=new o;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=C==null?void 0:C.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=C==null?void 0:C.blockColors[L]}),D}const I=x[b[w].path];if(!I||!I.data[R])return null;const M=I.data[R];return!M||!a[M.name]?null:new a[M.name]((O=M.value)==null?void 0:O.blockSettings)}_.useEffect(()=>{if(h){const R=V(h);c(R)}else c(null)},[h,A,$,l]),_.useEffect(()=>{if(l&&b&&!h){const R={blockSettings:{},blockColors:{}},I=new a[l];c(I),Object.keys(I.blockSettings).filter(P=>!["displayName","isAddable"].includes(P)).map(P=>{R.blockSettings[P]=I.blockSettings[P]}),Object.keys(I.blockColors).filter(P=>!["displayName","isAddable"].includes(P)).map(P=>{R.blockColors[P]=I.blockColors[P]});const M=d(b[w].path,{name:l,value:R});m({id:M,neededScroll:!0}),S(M),e("/admin/builder")}},[l,A,$]);function B(R){if(!a)return"unknown name";if(!a[R])return h==="header"?j==null?void 0:j.blockSettings.displayName:h==="footer"?E==null?void 0:E.blockSettings.displayName:h==="announcement"?C==null?void 0:C.blockSettings.displayName:"unknown name";const I=new a[R];return!I.blockSettings||!I.blockSettings.displayName?"unknown name":I.blockSettings.displayName}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(kt.render,{[kt.open]:h,[kt.close]:!h,[kt.clicked]:n}),onClick:R=>R.stopPropagation(),style:{opacity:N?0:1},children:[t.jsxRuntimeExports.jsx(wc,{onClick:z,setIsClicked:s,getDisplayName:B}),t.jsxRuntimeExports.jsxs("div",{className:kt.settings,children:[p&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(pc,{block:p}),t.jsxRuntimeExports.jsx(_c,{colors:p.blockColors})]}),!l&&!h&&t.jsxRuntimeExports.jsx("div",{className:kt.loading,children:"Loading"})]})]})},Rc="_header_9rrfr_1",Nc="_title_9rrfr_9",Ic="_backIcon_9rrfr_15",Wn={header:Rc,title:Nc,backIcon:Ic},nn=({onClick:e,title:n})=>t.jsxRuntimeExports.jsxs("div",{className:Wn.header,children:[t.jsxRuntimeExports.jsx("div",{className:Wn.backIcon,onClick:e,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx("span",{className:Wn.title,children:n})]}),Tc="_options_ymds7_1",Pc={options:Tc},Lc="_wrapper_kzokw_1",Bc="_open_kzokw_16",Ac="_close_kzokw_20",qn={wrapper:Lc,open:Bc,close:Ac},sn=e=>{const{isOpen:n,isClose:s,children:r}=e;return t.jsxRuntimeExports.jsx("div",{className:t.clx(qn.wrapper,{[qn.open]:n,[qn.close]:s}),children:r})},Mc=()=>{var p,c;const{activeBlock:e,themeSettings:n,updateBorder:s,setActiveBlock:r}=t.useThemeSettingsStore();function i(m,x){s(x,m)}const o=t.useNavigate();function a(){r(null),o("/admin/builder/theme")}const l=_.useMemo(()=>n.borders,[n]),u=(e==null?void 0:e.name)==="Borders";return t.jsxRuntimeExports.jsxs(sn,{isOpen:u,isClose:!u,children:[t.jsxRuntimeExports.jsx(nn,{onClick:a,title:"Borders Style"}),t.jsxRuntimeExports.jsxs("div",{className:Pc.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Border Radius (px)",options:Object.keys($n),value:((p=Object.entries($n).find(([m,x])=>x===l.radius))==null?void 0:p[0])||"None",onChange:m=>i($n[m],"radius")}),t.jsxRuntimeExports.jsx(t.Select,{label:"Border Thickness (px)",options:Object.keys(Dn),value:((c=Object.entries(Dn).find(([m,x])=>x===l.thickness))==null?void 0:c[0])||"None",onChange:m=>i(Dn[m],"thickness")})]})]})},$c="_options_jo38w_1",Dc="_alignments_jo38w_9",Fc="_blocks_jo38w_15",Oc="_alignment_jo38w_9",Hc="_active_jo38w_34",zc="_chargeTypes_jo38w_41",Uc="_charge_jo38w_41",Vc="_chargeActive_jo38w_69",Wc="_sliderContainer_jo38w_83",qc="_shadowInputs_jo38w_91",Gc="_label_jo38w_102",Zc="_shadowInputsRow_jo38w_111",Xc="_shadowInputsOpen_jo38w_119",Ce={options:$c,alignments:Dc,blocks:Fc,alignment:Oc,active:Hc,chargeTypes:zc,charge:Uc,chargeActive:Vc,sliderContainer:Wc,shadowInputs:qc,label:Gc,shadowInputsRow:Zc,shadowInputsOpen:Xc};function Gn(e){return(e.includes("linear-gradient")||e.includes("radial-gradient"))&&/^linear-gradient\(\d+deg,\s*#[A-Fa-f0-9]{8}\s+\d+%,\s*#[A-Fa-f0-9]{8}\s+\d+%\)$/.test(e)?!0:/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const Ve=e=>{const{initialColor:n,onChange:s,title:r,labelStyle:i="primary",isGradientActive:o=!0}=e,[a,l]=_.useState(n);_.useEffect(()=>{l(n)},[n]);const{setActiveLabel:u,setModalPosition:p,setInitialColor:c,setShowModal:m,setUpdate:x,setColor:d,setColorChange:g,setIsGradientActive:h,colorChange:S}=t.useColorPickerStore();_.useEffect(()=>{const N=()=>{m(!1),u(null),c(n),x(()=>{}),d(n),g(()=>{})};return document.body.addEventListener("click",N),()=>{document.body.removeEventListener("click",N)}},[n]);const j=N=>{N.stopPropagation(),m(!0),g(l),x(s),c(n),d(a),h(o);const{top:w,left:b}=Or(N,600,288,10,20,230,80);p({top:w,left:b})},E=N=>{const w=N.target.value;l(w),Gn(w)&&(s(w),d(w),g(S))},C=()=>{Gn(a)||l(n)};return t.jsxRuntimeExports.jsxs("div",{className:J.content,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(J.name,{[J.secondary]:i==="secondary"}),children:r}),t.jsxRuntimeExports.jsxs("label",{className:J.label,onClick:N=>N.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:J.colorValue,style:{background:Gn(a)?a:n},onClick:j}),t.jsxRuntimeExports.jsx("input",{type:"text",value:a.includes("linear-gradient")?a:a.toUpperCase(),onChange:E,onBlur:C,className:J.input,style:{textTransform:a.includes("linear-gradient")?"none":"uppercase"}})]})]})},Yc=["left","center","right"],Kc=()=>{const{activeBlock:e,themeSettings:n,updateButton:s,setActiveBlock:r}=t.useThemeSettingsStore(),{fonts:i}=t.useFontsStore(),[o,a]=_.useState("primary");function l(h,S){s(o,S,h)}const[u,p]=_.useState(!1),c=n.buttons[o],m=t.useNavigate();function x(){r(null),m("/admin/builder/theme")}const d=(e==null?void 0:e.name)==="Buttons";function g(h,S){l({...c.boxShadow,[h]:S},"boxShadow")}return t.jsxRuntimeExports.jsxs(sn,{isOpen:d,isClose:!d,children:[t.jsxRuntimeExports.jsx(nn,{onClick:x,title:"Buttons Style"}),t.jsxRuntimeExports.jsx("div",{className:Ce.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Ce.charge,{[Ce.chargeActive]:o===h}),onClick:()=>a(h),children:h.charAt(0).toUpperCase()+h.slice(1)},h))}),c&&t.jsxRuntimeExports.jsxs("div",{className:Ce.options,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Height (px)",value:String(c.height),onChange:h=>l(Number(h),"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",value:String(c.size),onChange:h=>l(Number(h),"size"),options:Nn}),t.jsxRuntimeExports.jsx(t.Input,{label:"Border Radius (px)",value:String(c.radius),onChange:h=>l(Number(h),"radius"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font",value:c.font,onChange:h=>l(h,"font"),options:[...i.filter(h=>h.name!==c.font).map(h=>h.name)]}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.color,onChange:h=>l(h,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.background,onChange:h=>l(h,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),t.jsxRuntimeExports.jsxs("div",{className:Ce.sliderContainer,children:[t.jsxRuntimeExports.jsx("h4",{className:Ce.label,children:"Shadow"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>p(!u),style:{padding:5,display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ce.shadowInputs,{[Ce.shadowInputsOpen]:u}),children:[t.jsxRuntimeExports.jsxs("div",{className:Ce.shadowInputsRow,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Left (px)",value:String(c.boxShadow.left),onChange:h=>g("left",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Top (px)",value:String(c.boxShadow.top),onChange:h=>g("top",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Blur (px)",value:String(c.boxShadow.blur),onChange:h=>g("blur",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:t.jsxRuntimeExports.jsx(t.Input,{label:"Spread (px)",value:String(c.boxShadow.spread),onChange:h=>g("spread",Number(h)),type:"number"})})]}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.boxShadow.color,onChange:h=>g("color",h),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsxs("div",{className:Ce.alignments,children:[t.jsxRuntimeExports.jsx("h4",{className:Ce.label,children:"Alignment Type"}),t.jsxRuntimeExports.jsx("div",{className:Ce.blocks,children:Yc.map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Ce.alignment,{[Ce.active]:c.alignment===h}),onClick:()=>{l(h,"alignment")},children:t.jsxRuntimeExports.jsx(t.Icon,{name:h==="center"?"AlignCenterHorizontal":h==="left"?"AlignLeft":"AlignRight",fill:c.alignment===h?"#252525":"#757575"})},h))})]}),t.jsxRuntimeExports.jsx(t.Switch,{label:"Enable Hover",onChange:h=>l(h,"hover"),current:c.hover}),c.hover&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Ve,{initialColor:c.colorHover,onChange:h=>l(h,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.backgroundHover,onChange:h=>l(h,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Jc="_category_hxy9u_1",Qc="_categoryTitle_hxy9u_19",Zn={category:Jc,categoryTitle:Qc},eu=()=>{const{themeSettings:e,setActiveColorCategory:n}=t.useThemeSettingsStore();function s(r){n(r)}return t.jsxRuntimeExports.jsx("div",{className:Zn.wrapper,children:Object.keys(e.colors).map(r=>r==="icon"?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{}):t.jsxRuntimeExports.jsxs("div",{className:Zn.category,onClick:()=>s(r),children:[t.jsxRuntimeExports.jsxs("h2",{className:Zn.categoryTitle,children:[r==="text"?"Text & Icon":Be(r)," Colors"]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight",width:24,height:24})]},r))})},tu="_options_ikvjo_38",nu={options:tu},su=()=>{const{activeBlock:e,setActiveFont:n,activeFont:s,themeSettings:r,updateFont:i}=t.useThemeSettingsStore(),{fonts:o}=t.useFontsStore(),[a,l]=_.useState(null);function u(){n(null)}function p(h,S){a&&s&&i("desktop",a,s,S,h)}const[c,m]=_.useState([]),x=_.useMemo(()=>s?r.fonts.desktop.heading[s]?(l("heading"),r.fonts.desktop.heading[s]):r.fonts.desktop.body[s]?(l("body"),r.fonts.desktop.body[s]):(l(null),null):null,[s,r]);_.useEffect(()=>{if(x){const h=o.find(S=>S.name===x.font);h&&(m(h.weights),h.weights.includes(x.boldWeight)||p("400","boldWeight"),h.weights.includes(x.weight)||p("400","weight"))}},[x,s]);const d=!!((e==null?void 0:e.name)==="Fonts"&&s),g=(e==null?void 0:e.name)!=="Fonts"||!s;return t.jsxRuntimeExports.jsxs(sn,{isOpen:d,isClose:g,children:[t.jsxRuntimeExports.jsx(nn,{onClick:u,title:"Font Style"}),s&&x&&t.jsxRuntimeExports.jsxs("div",{className:nu.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Font",value:x.font,onChange:h=>p(h,"font"),options:[...o.filter(h=>h.name!==x.font).map(h=>h.name)]}),t.jsxRuntimeExports.jsx(t.Select,{label:"Size",value:String(x.size),onChange:h=>p(h,"size"),options:Nn}),t.jsxRuntimeExports.jsx(t.Select,{label:"Default Weight",value:String(x.weight),onChange:h=>p(h,"weight"),options:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Bold Weight",value:String(x.boldWeight),onChange:h=>p(h,"boldWeight"),options:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Case",value:String(x.case).charAt(0).toUpperCase()+String(x.case).slice(1),onChange:h=>p(h.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(h=>h.toLowerCase()!==String(x.case))})]})]})},ru="_wrapper_mkmxa_1",ou="_category_mkmxa_5",iu="_categoryTitle_mkmxa_11",au="_font_mkmxa_17",lu="_content_mkmxa_32",cu="_icon_mkmxa_39",uu="_paragraph_mkmxa_50",st={wrapper:ru,category:ou,categoryTitle:iu,font:au,content:lu,icon:cu,paragraph:uu},pu={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},du=e=>{const{font:n,size:s,id:r,category:i}=e,{setActiveFont:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsxs("div",{className:st.font,onClick:()=>o(r),children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(st.icon,{[st.paragraph]:i==="paragraph"}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:i==="paragraph"?"TextB":"TextH"})}),t.jsxRuntimeExports.jsxs("div",{className:st.content,children:[t.jsxRuntimeExports.jsx("h2",{className:st.categoryTitle,children:Be(pu[r])}),t.jsxRuntimeExports.jsx("span",{className:st.value,children:`${n}, ${s}px`})]})]})},mu=()=>{const{themeSettings:e,setActiveFont:n,activeBlock:s}=t.useThemeSettingsStore();_.useEffect(()=>(r(),()=>{r()}),[]);function r(){n(null)}if(s!=null&&s.name)return t.jsxRuntimeExports.jsx("div",{className:st.wrapper,children:Object.entries(e.fonts.desktop).sort(([i],[o])=>i==="heading"?-1:o==="heading"?1:0).map(([i,o])=>t.jsxRuntimeExports.jsxs("div",{className:st.category,children:[t.jsxRuntimeExports.jsx("h2",{className:st.categoryTitle,children:Be(i)}),Object.entries(o).map(([a,l])=>t.jsxRuntimeExports.jsx(du,{id:a,category:i,...l},a))]},i))})},xu="_wrapper_16ym0_2",hu="_categoryTitle_16ym0_12",gu="_title_16ym0_74",fu="_field_16ym0_82",ju="_alignments_16ym0_92",yu="_lineField_16ym0_98",_u="_style_16ym0_106",Su="_header_16ym0_113",ze={wrapper:xu,categoryTitle:hu,title:gu,field:fu,alignments:ju,lineField:yu,style:_u,header:Su},bu="_blocks_emecf_1",Cu="_block_emecf_1",Eu="_active_emecf_21",Xn={blocks:bu,block:Cu,active:Eu},Vs=e=>{const{items:n,selectedItem:s,onSelect:r,getIconName:i}=e;return t.jsxRuntimeExports.jsx("div",{className:Xn.blocks,children:n.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Xn.block,{[Xn.active]:s===o}),onClick:()=>r(o),children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(o),fill:s===o?"#252525":"#757575"})},String(o)))})},vu=["left","center","right"],wu=["solid","dashed"],Ut=e=>{const{title:n,children:s,rightAddon:r}=e;return t.jsxRuntimeExports.jsxs("div",{className:ze.field,children:[t.jsxRuntimeExports.jsxs("div",{className:ze.header,children:[t.jsxRuntimeExports.jsx("h4",{className:ze.categoryTitle,children:n}),r]}),s]})},ku=()=>{const{themeSettings:e,updateInput:n}=t.useThemeSettingsStore(),s=_.useMemo(()=>e.inputs,[e]),r=(o,a,l)=>{n(o,a,l)},i=o=>a=>{n(o,a,"color")};return t.jsxRuntimeExports.jsxs("div",{className:ze.wrapper,children:[t.jsxRuntimeExports.jsxs(Ut,{title:"General",children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Height (px)",value:String(s.general.height),onChange:o=>r("general",o,"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",onChange:o=>r("general",o,"size"),value:String(s.general.size),options:Nn}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.general.color),onChange:i("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsx(Ut,{title:"Field Fill",rightAddon:t.jsxRuntimeExports.jsx("div",{className:ze.switch,children:t.jsxRuntimeExports.jsx(t.Switch,{onChange:o=>r("field",o,"active"),current:s.field.active})}),children:t.jsxRuntimeExports.jsx(Ve,{initialColor:s.field.color,onChange:i("field"),title:"Color",labelStyle:"secondary"})}),t.jsxRuntimeExports.jsx(Ut,{title:"Placeholder",children:t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.placeholder.color),onChange:i("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),t.jsxRuntimeExports.jsxs(Ut,{title:"Border",rightAddon:t.jsxRuntimeExports.jsx("div",{className:ze.switch,children:t.jsxRuntimeExports.jsx(t.Switch,{onChange:o=>r("border",o,"active"),current:s.border.active})}),children:[t.jsxRuntimeExports.jsxs("div",{className:ze.lineField,children:[t.jsxRuntimeExports.jsxs("div",{className:ze.style,children:[t.jsxRuntimeExports.jsx("span",{className:ze.title,children:"Style"}),t.jsxRuntimeExports.jsx(Vs,{items:wu,selectedItem:s.border.style,onSelect:o=>r("border",o,"style"),getIconName:o=>o==="solid"?"Minus":"Selection"})]}),t.jsxRuntimeExports.jsx(t.Input,{label:"Radius (px)",value:String(s.border.radius),onChange:o=>r("border",o,"radius"),type:"number",min:0})]}),t.jsxRuntimeExports.jsx(t.Input,{label:"Thickness (px)",value:String(s.border.thickness),onChange:o=>r("border",o,"thickness"),type:"number",min:0}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.border.color),onChange:i("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsxs(Ut,{title:"Label",children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Line Height (px)",value:String(s.label.height),onChange:o=>r("label",o,"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",onChange:o=>r("label",o,"size"),value:String(s.label.size),options:Nn}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.label.color),onChange:i("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsxs("div",{className:ze.alignments,children:[t.jsxRuntimeExports.jsx("h4",{className:ze.title,children:"Alignment Type"}),t.jsxRuntimeExports.jsx(Vs,{items:vu,selectedItem:s.label.alignment,onSelect:o=>r("label",o,"alignment"),getIconName:o=>o==="center"?"AlignCenterHorizontal":o==="left"?"AlignLeft":"AlignRight"})]})]})]})},Ru="_wrapper_1yw63_2",Nu="_color_1yw63_24",Iu="_content_1yw63_33",Tu="_preview_1yw63_42",Pu="_container_1yw63_52",Lu="_buttonWrapper_1yw63_62",Bu="_button_1yw63_62",Au="_buttonBorder_1yw63_80",Mu="_buttonBackground_1yw63_83",$u="_text_1yw63_87",Du="_textText_1yw63_93",Fu="_icon_1yw63_97",Ou="_iconIcon_1yw63_100",Hu="_annotation_1yw63_104",zu="_annotationText_1yw63_111",Uu="_label_1yw63_116",Vu="_circle_1yw63_127",Wu="_line_1yw63_140",qu="_circle1_1yw63_154",Gu="_circle2_1yw63_159",Zu="_annotationIcon_1yw63_164",Xu="_annotationBorder_1yw63_192",Yu="_line1_1yw63_203",Ku="_line2_1yw63_210",Ju="_circle3_1yw63_227",Qu="_circle4_1yw63_232",ep="_annotationSurface_1yw63_237",F={wrapper:Ru,color:Nu,content:Iu,preview:Tu,container:Pu,buttonWrapper:Lu,button:Bu,buttonBorder:Au,buttonBackground:Mu,text:$u,textText:Du,icon:Fu,iconIcon:Ou,annotation:Hu,annotationText:zu,label:Uu,circle:Vu,line:Wu,circle1:qu,circle2:Gu,annotationIcon:Zu,annotationBorder:Xu,line1:Yu,line2:Ku,circle3:Ju,circle4:Qu,annotationSurface:ep},tp=()=>{const{activeColorCategory:e}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("div",{className:F.container,children:t.jsxRuntimeExports.jsxs("div",{className:F.buttonWrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.button,{[F.buttonBorder]:e==="border",[F.buttonBackground]:e==="surface"}),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Smiley",className:t.clx(F.icon,{[F.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),t.jsxRuntimeExports.jsx("span",{className:t.clx(F.text,{[F.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationText),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Text Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]}),e==="text"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationIcon),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Icon Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]}),e==="border"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationBorder),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Border Color"}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.line,F.line1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.line,F.line2)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle3)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle4)})]}),e==="surface"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationSurface),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Surface Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]})]})})},np={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},sp=()=>{const{activeBlock:e,setActiveColorCategory:n,activeColorCategory:s,themeSettings:r,updateColor:i}=t.useThemeSettingsStore();function o(){n(null)}function a(c,m,x){i(c,m,x)}const l=!!((e==null?void 0:e.name)==="Colors"&&s),u=(e==null?void 0:e.name)!=="Colors"||!s,p=s?np[s]:[];return t.jsxRuntimeExports.jsxs(sn,{isOpen:l,isClose:u,children:[t.jsxRuntimeExports.jsx(nn,{onClick:o,title:s==="text"?"Text & Icon Colors":`${Be(s)} Colors`}),s&&t.jsxRuntimeExports.jsxs("div",{className:F.wrapper,children:[t.jsxRuntimeExports.jsx(tp,{}),p.map(c=>{const m=r.colors[s][c];return typeof m!="string"?null:t.jsxRuntimeExports.jsx("div",{className:F.color,children:t.jsxRuntimeExports.jsxs("div",{className:F.content,children:[t.jsxRuntimeExports.jsx("div",{className:F.preview,style:{background:m}}),t.jsxRuntimeExports.jsx(Ve,{title:Be(c),initialColor:m,onChange:x=>a(s,c,x),isGradientActive:s==="surface"})]})},c)})]})]})},rp="_loader_1p5lr_1",op={loader:rp},ip=()=>{const{activeBlock:e,themeSettings:n,isLoadingThemeSettings:s}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s?t.jsxRuntimeExports.jsx("div",{className:op.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&n.fonts&&t.jsxRuntimeExports.jsx(mu,{}),(e==null?void 0:e.name)==="Fonts"&&n.fonts&&t.jsxRuntimeExports.jsx(su,{}),(e==null?void 0:e.name)==="Colors"&&n.colors&&t.jsxRuntimeExports.jsx(eu,{}),(e==null?void 0:e.name)==="Colors"&&n.colors&&t.jsxRuntimeExports.jsx(sp,{}),(e==null?void 0:e.name)==="Inputs"&&n.inputs&&t.jsxRuntimeExports.jsx(ku,{}),(e==null?void 0:e.name)==="Borders"&&n.borders&&t.jsxRuntimeExports.jsx(Mc,{}),(e==null?void 0:e.name)==="Buttons"&&n.buttons&&t.jsxRuntimeExports.jsx(Kc,{})]})})},ap=()=>{const{activeBlock:e,setActiveBlock:n}=t.useThemeSettingsStore(),{activeBlock:s}=t.useNavbarStore(),r=t.useNavigate();function i(){n(null),r("/admin/builder/theme")}const o=!!e,a=!e||s.name!=="Theme";return t.jsxRuntimeExports.jsxs(sn,{isOpen:o,isClose:a,children:[t.jsxRuntimeExports.jsx(nn,{onClick:i,title:(e==null?void 0:e.name)||""}),t.jsxRuntimeExports.jsx(ip,{})]})},lp=()=>{const{activeBlock:e}=t.useNavbarStore(),{showTooltip:n}=t.useTooltipStore();function s(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return t.jsxRuntimeExports.jsxs("div",{className:Us.sidebar,style:{zIndex:n?50:"auto"},children:[t.jsxRuntimeExports.jsx("h3",{className:Us.title,children:s()}),e.name==="Layers"&&t.jsxRuntimeExports.jsx(Xl,{}),e.name==="Add"&&t.jsxRuntimeExports.jsx(zr,{}),t.jsxRuntimeExports.jsx(kc,{}),t.jsxRuntimeExports.jsx(ap,{}),e.name==="Theme"&&t.jsxRuntimeExports.jsx(rc,{}),e.name==="Settings"&&t.jsxRuntimeExports.jsx(Jl,{})]})},cp="_wrapper_no6if_1",up="_header_no6if_12",pp="_content_no6if_23",dp="_buttons_no6if_44",mp="_label_no6if_51",xp="_description_no6if_52",hp="_preview_no6if_60",gp="_block_no6if_66",fp="_slug_no6if_75",jp="_title_no6if_81",yp="_closeIcon_no6if_87",De={wrapper:cp,header:up,content:pp,buttons:dp,label:mp,description:xp,preview:hp,block:gp,slug:fp,title:jp,closeIcon:yp},_p="_wrapper_ba9vp_2",Sp="_label_ba9vp_10",bp="_options_ba9vp_18",Cp="_radioLabel_ba9vp_24",Ep="_radio_ba9vp_24",vp="_custom_ba9vp_39",wp="_option_ba9vp_18",jt={wrapper:_p,label:Sp,options:bp,radioLabel:Cp,radio:Ep,custom:vp,option:wp},kp=e=>{const{defaultValue:n,options:s,onChange:r,label:i}=e,[o,a]=_.useState(n),l=u=>{const p=u.target.value;a(p),r(p)};return t.jsxRuntimeExports.jsxs("div",{className:jt.wrapper,children:[t.jsxRuntimeExports.jsx("span",{className:jt.label,children:i}),t.jsxRuntimeExports.jsx("div",{className:jt.options,children:s.map(u=>t.jsxRuntimeExports.jsxs("label",{className:jt.radioLabel,children:[t.jsxRuntimeExports.jsx("input",{type:"radio",value:u.value,checked:o===u.value,onChange:l,className:jt.radio}),t.jsxRuntimeExports.jsx("span",{className:jt.custom}),t.jsxRuntimeExports.jsx("span",{className:jt.option,children:u.label})]},u.value))})]})},Rp=()=>{var z,V,B,R,I,M,P;const{setIsOpenModal:e,pages:n,createPage:s,updatePage:r,isEdit:i,setIsEdit:o,editedPage:a,setEditedPage:l,pageContext:u}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),{createPage:c,updatePage:m}=t.useLayersStore(),[x,d]=_.useState(a?n&&((z=n[a])==null?void 0:z.path):""),[g,h]=_.useState(a?n&&((V=n[a])==null?void 0:V.name):""),[S,j]=_.useState(a?n&&((B=n[a])==null?void 0:B.seo)&&((I=(R=n[a])==null?void 0:R.seo)==null?void 0:I.pageDescription)||"":`${u.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[E,C]=_.useState(a&&n&&(M=n[a])!=null&&M.isPrivate?"private":"public");function N(){d(""),h(""),j(""),C("public"),o(!1),l(null)}function w(){p(!1),setTimeout(()=>{N(),e(!1),p(!0)},300)}_.useEffect(()=>()=>{w()},[]);function b(O){return O[0]==="/"?O:"/"+O}function A(){s({path:b(x),name:g||x||"",icon:"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:E||"public"}),c(b(x)),w()}function $(){n&&(t.defaultPagePaths.includes(n[a].path)||Hr(n[a].path),m(n[a].path||"",x||""),r(a,{path:b(x),name:g||x,icon:n[a].icon||"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:E||"public"})),w()}return t.jsxRuntimeExports.jsxs("div",{className:De.wrapper,onClick:O=>O.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:De.header,children:[t.jsxRuntimeExports.jsx("h2",{children:i?"Edit Page":"Create New Page"}),t.jsxRuntimeExports.jsx("div",{className:De.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:w})})]}),t.jsxRuntimeExports.jsxs("div",{className:De.content,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Page Slug",onChange:O=>d(O),value:x,placeholder:"path-to-page",disabled:!!(a&&n&&((P=n[a])!=null&&P.name)&&t.defaultPagePaths.includes(n[a].path)),required:!0,regex:"^.+$"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Page Title",onChange:O=>{h(O)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),t.jsxRuntimeExports.jsx(t.Textarea,{label:"Description",onChange:O=>j(O),value:S,placeholder:`${u.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`,maxLength:150}),t.jsxRuntimeExports.jsx(kp,{label:"Visibility",defaultValue:E,options:[{value:"public",label:"Public"},{value:"private",label:"Private"}],onChange:O=>C(O)}),t.jsxRuntimeExports.jsxs("div",{className:De.preview,children:[t.jsxRuntimeExports.jsx("span",{className:De.label,children:"Preview"}),t.jsxRuntimeExports.jsxs("div",{className:De.block,children:[t.jsxRuntimeExports.jsx("span",{className:De.slug,children:x||"yoursite.url"}),t.jsxRuntimeExports.jsx("span",{className:De.title,children:g||"My Blank Page"}),t.jsxRuntimeExports.jsx("span",{className:De.description,children:S||"It is My Description"})]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:De.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:w,type:"Secondary",children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:i?$:A,disabled:x.length===0,children:i?"Update":"Create"})]})]})},Np="_layout_1pjho_1",Ip="_main_1pjho_10",Tp="_content_1pjho_18",Pp="_notifications_1pjho_26",hn={layout:Np,main:Ip,content:Tp,notifications:Pp},Lp="_notification_2jmah_1",Bp="_text_2jmah_22",Ap="_timer_2jmah_27",Mp="_warning_2jmah_32",$p="_error_2jmah_37",Dp="_success_2jmah_42",Rt={notification:Lp,text:Bp,timer:Ap,warning:Mp,error:$p,success:Dp},Ws={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Ur=e=>{const{type:n,message:s,style:r,padding:i,timer:o,id:a}=e,[l,u]=_.useState(o),{setNotifications:p}=t.useNotificationStore();function c(){const x=t.useNotificationStore.getState().notifications.filter(d=>d.id!==a);p([...x])}return _.useEffect(()=>{const m=setTimeout(()=>{c()},o*1e3);return()=>clearTimeout(m)},[o]),_.useEffect(()=>{const m=setInterval(()=>u(x=>x-1),1e3);return()=>clearInterval(m)},[l]),t.jsxRuntimeExports.jsx("div",{style:{padding:i,position:"relative"},children:t.jsxRuntimeExports.jsxs("div",{className:t.clx(Rt.notification,{[Rt.warning]:n==="warning",[Rt.error]:n==="error",[Rt.success]:n==="success"}),style:r,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",fill:Ws[n],width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:Rt.text,children:s}),o&&t.jsxRuntimeExports.jsx("div",{className:Rt.timer,children:l}),t.jsxRuntimeExports.jsx("div",{style:{display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:Ws[n],width:20,height:20,hoverable:!0,onClick:()=>c()})})]})})},Fp="_modal_1h74q_1",Op="_title_1h74q_14",Hp="_buttons_1h74q_20",gn={modal:Fp,title:Op,buttons:Hp},Vr=()=>{const{title:e,description:n,onConfirm:s,setTitle:r,setDescription:i,setOnConfirm:o}=t.useConfirmationModalStore(),{setIsOpen:a}=t.useModalStore();function l(){a(!1),setTimeout(()=>{r(null),i(null),o(null),a(!0)},300)}return e&&n&&s&&t.jsxRuntimeExports.jsxs("div",{className:gn.modal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:gn.title,children:e}),t.jsxRuntimeExports.jsx("div",{className:gn.description,children:n}),t.jsxRuntimeExports.jsxs("div",{className:gn.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:l,children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:()=>{s(),l()},type:"Secondary",children:"Confirm"})]})]})},zp="_modal_270ti_1",Up="_padding_270ti_17",Vp="_content_270ti_21",Wp="_close_270ti_42",fn={modal:zp,padding:Up,content:Vp,close:Wp},wn=e=>{const{close:n,children:s,withAnimation:r=!0,hasPadding:i=!0}=e,{isOpen:o,setIsOpen:a}=t.useModalStore();return _.useEffect(()=>{const l=()=>{a(!1),r?setTimeout(()=>{n(!1),a(!0)},300):(n(!1),a(!0))};return document.body.addEventListener("click",l),()=>{document.body.removeEventListener("click",l)}},[]),t.jsxRuntimeExports.jsx("div",{className:t.clx(fn.modal,{[fn.padding]:i}),children:r?t.jsxRuntimeExports.jsx("div",{className:t.clx(fn.content,{[fn.close]:!o}),children:s}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s})})},qp=()=>{const{isOpenModal:e,setIsOpenModal:n}=t.usePagesStore(),{openModal:s,setOpenModal:r}=t.useChooseImageStore(),{notifications:i}=t.useNotificationStore(),{title:o,description:a,setTitle:l,setDescription:u,setOnConfirm:p}=t.useConfirmationModalStore();return t.jsxRuntimeExports.jsxs("div",{id:"builder",children:[t.jsxRuntimeExports.jsxs("div",{className:hn.layout,children:[t.jsxRuntimeExports.jsx(Ea,{}),t.jsxRuntimeExports.jsxs("main",{className:hn.main,children:[t.jsxRuntimeExports.jsx(ha,{}),t.jsxRuntimeExports.jsxs("div",{className:hn.content,children:[t.jsxRuntimeExports.jsx(lp,{}),t.jsxRuntimeExports.jsx(Rl,{})]})]})]}),o&&a&&t.jsxRuntimeExports.jsx(wn,{close:()=>{l(null),u(null),p(null)},children:t.jsxRuntimeExports.jsx(Vr,{})}),e&&t.jsxRuntimeExports.jsx(wn,{close:n,children:t.jsxRuntimeExports.jsx(Rp,{})}),s&&t.jsxRuntimeExports.jsx(wn,{close:r,children:t.jsxRuntimeExports.jsx(t.ChooseImageModal,{})}),i.length>0&&t.jsxRuntimeExports.jsx("div",{className:hn.notifications,children:i.map(c=>t.jsxRuntimeExports.jsx(Ur,{type:c.status,message:c.message,timer:10,id:c.id},c.id))})]})};async function Nt(e,n){const s=localStorage.getItem("shopId")||void 0,r=`${t.API_URL}/${e}/builder/shops/${s}/${n}`;return(await t.request({url:r,withToken:!0,method:"get"})).data}async function Gp(){try{const[e,n,s,r,i,o,a,l]=await Promise.allSettled([Nt("v1","general"),Nt("v1","faqs"),Nt("v1","listings"),Nt("v1","products"),Nt("v1","reviews"),Nt("v1","categories"),{data:null},{data:null}]);return{general:e,faqs:n,listings:s,products:r,reviews:i,categories:o,fullPosts:a,posts:l}}catch(e){throw console.error("Error fetching page data:",e),e}}async function Zp(){try{const{data:e}=await t.axios.get(`${t.GOOGLE_FONTS_API}?key=AIzaSyAEsTbjAPUz_TeuFCq4z4LPK9w_vst0Pfw`);return e.items}catch(e){throw console.error("Error fetching page data:",e),e}}async function Xp(){var r;const e=localStorage.getItem("shopId"),n=localStorage.getItem("draftId"),s=`${t.API_URL}/v2/builder/shops/${e}/drafts/${n}/pages`;try{return(await t.request({url:s,withToken:!0,method:"get"})).data}catch(i){return{data:[],status:(r=i.response)==null?void 0:r.status}}}async function Yp(){const e=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId")||void 0,s=`${t.API_URL}/v2/builder/shops/${e}/drafts/${n}/all`;return(await t.request({url:s,withToken:!0,method:"get"})).data}const Kp=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,{setBlocks:a,setSourceBlocks:l,setHeader:u,setFooter:p,setAnnouncement:c,setSettings:m}=t.useBlocksStore(),{fonts:x,setFonts:d}=t.useFontsStore(),{setSettings:g}=t.useSettingsStore(),{setPageContext:h}=t.usePagesStore(),{setThemeSettings:S,setIsLoadingThemeSettings:j}=t.useThemeSettingsStore(),{setIsLoadingSettings:E}=t.useSettingsStore(),{notifications:C,setNotifications:N}=t.useNotificationStore(),{setBlocks:w,blocks:b,createPage:A,setIsLoadingLayers:$,setHeader:z,setAnnouncement:V,setFooter:B}=t.useLayersStore(),{setPages:R,setCurrentPage:I}=t.usePagesStore();return _.useEffect(()=>{j(!0),$(!0),E(!0);const M={};Object.keys(n).forEach(O=>{M[O]=n[O]}),l(M),a(M),u(r),p(i),c(o),m(s),(async()=>{const O={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},D=await Gp();Object.keys(D).map(Q=>{const ge=Q;O[ge]=D[ge].value.data}),h(O);const{data:L}=await Yp(),{themeSettings:H,layers:f,settings:se}=L||{};if(se){if(se.settings){const Q=new s;Q.blockSettings={displayName:"Settings",isAddable:!1,...se.settings},g(Q)}se.header&&z(se.header),se.footer&&B(se.footer),se.announcement&&V(se.announcement)}else{const Q=new s;g(Q)}H&&S(H);const he=await Xp(),y={};if(he.status>=400&&N([...C,{id:t.v4(),message:"Error fetching pages",status:"error"}]),he.data.length>0?(he.data.forEach(Q=>{b[Q.path]||A(Q.path),y[Q.id||Q.path]={...Q,icon:t.pages[Q.path]?t.pages[Q.path].icon:"File",name:Q.name?Q.name:t.pages[Q.path].name}}),R(y),I(Object.keys(y)[0])):(R(t.pages),I(Object.keys(t.pages)[0])),x.length===0){const Q=await Zp();d([...Q.map(ge=>{const G=ge.variants.map(je=>{if(!je.includes("italic"))return je==="regular"?"400":je}).filter(je=>je!==void 0);return{name:ge.family,weights:G}})])}w(f),j(!1),$(!1),E(!1)})()},[]),t.jsxRuntimeExports.jsx(qp,{})};function Jp(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}function Qp(){const e=new URLSearchParams(document.location.search),n=e.get("shopId")||localStorage.getItem("shopId"),s=e.get("sellerAccessToken")||localStorage.getItem("sellerAccessToken"),r=e.get("draftId")||localStorage.getItem("draftId");return Jp(),s&&localStorage.setItem("sellerAccessToken",s),n&&localStorage.setItem("shopId",n),r&&localStorage.setItem("draftId",r),!!(s&&n&&r)}const ed=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,[a,l]=_.useState(!0),u=t.useNavigate();return _.useEffect(()=>{l(!0),Qp()?l(!1):u("/")},[]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a?t.jsxRuntimeExports.jsx(mt,{}):t.jsxRuntimeExports.jsx(Kp,{blocks:n,settings:s,header:r,footer:i,announcement:o})})},td="_wrapper_1yd2j_1",nd="_error_1yd2j_11",sd="_title_1yd2j_21",rd="_buttons_1yd2j_29",Vt={wrapper:td,error:nd,title:sd,buttons:rd},qs=async e=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),r=`${t.API_URL}/v2/builder/shops/${n}/drafts/${s}/reset`;return await t.request({url:r,withToken:!0,method:"post",body:e})},od=()=>{const{error:e,setError:n}=t.useErrorStore(),{pages:s}=t.usePagesStore(),{setIsOpen:r}=t.useModalStore(),{title:i,description:o,setOnConfirm:a,setTitle:l,setDescription:u}=t.useConfirmationModalStore(),{setBlocks:p}=t.useLayersStore();async function c(){await qs({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),n(null),p({}),window.location.reload()}async function m(){const x=[];s&&Object.keys(s).map(d=>s[d].id).filter(d=>d!==void 0).map(d=>x.push(d)),await qs({resetSettings:!0,resetThemeSettings:!0,resetPageIds:x}),n(null)}return t.jsxRuntimeExports.jsxs("div",{className:Vt.wrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:Vt.error,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("div",{className:Vt.title,children:"Oops! Something went wrong"}),t.jsxRuntimeExports.jsx("span",{className:Vt.message,children:(e==null?void 0:e.message)||""})]}),t.jsxRuntimeExports.jsxs("div",{className:Vt.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:c,children:"Reset Settings"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:x=>{x.stopPropagation(),l("Reset All Settings"),u("Are you sure you want to reset all settings? This is irreversible."),a(async()=>{await m()})},children:"Reset All Settings"})]})]}),i&&o&&t.jsxRuntimeExports.jsx(wn,{close:()=>{r(!1),setTimeout(()=>{l(null),u(null),a(null),r(!0)},300)},children:t.jsxRuntimeExports.jsx(Vr,{})})]})},id=e=>{const{children:n}=e,{pathname:s}=t.useLocation(),{setActiveBlock:r}=t.useNavbarStore(),{setActiveBlock:i}=t.useThemeSettingsStore(),{setActiveBlock:o}=t.usePreviewStore();return _.useEffect(()=>{switch(o({id:null,neededScroll:!1}),s){case"/admin/builder":r(t.navbarBlocks[0]);break;case"/admin/builder/add":r(t.navbarBlocks[1]);break;case"/admin/builder/theme":r(t.navbarBlocks[2]);break;case"/admin/builder/settings":r(t.navbarBlocks[3]);break;case"/admin/builder/theme/colors":r(t.navbarBlocks[2]),i(Ue[0]);break;case"/admin/builder/theme/fonts":r(t.navbarBlocks[2]),i(Ue[1]);break;case"/admin/builder/theme/borders":r(t.navbarBlocks[2]),i(Ue[2]);break;case"/admin/builder/theme/buttons":r(t.navbarBlocks[2]),i(Ue[3]);break;case"/admin/builder/theme/inputs":r(t.navbarBlocks[2]),i(Ue[4]);break}},[s]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:n})},ad="_lock_1mxa7_1",ld="_wrapper_1mxa7_12",cd="_content_1mxa7_22",ud="_info_1mxa7_31",pd="_buttons_1mxa7_38",dd="_button_1mxa7_38",md="_input_1mxa7_50",xd="_error_1mxa7_57",Fe={lock:ad,wrapper:ld,content:cd,info:ud,buttons:pd,button:dd,input:md,error:xd},hd=()=>{const[e,n]=_.useState(!1),[s,r]=_.useState(!1),[i,o]=_.useState(""),{general:a,setGeneral:l}=t.useGeneralStore(),{setShopPassword:u}=t.useStorefrontStore(),p=t.useLocation(),c=t.useNavigate();_.useEffect(()=>{if(a&&(!a.info.passwordProtected||a.isPasswordValid)){const x=p.state.from==="/validation"?"/":p.state.from;c(x)}},[a]),_.useEffect(()=>{a||(async()=>{var h;n(!0);const d=localStorage.getItem("shopPassword")||"",g=await us(d);if(g.isPasswordValid){const S=((h=p.state)==null?void 0:h.from)||"/";c(S)}l(g),n(!1)})()},[a]);async function m(){var d;n(!0);const x=await us(i);if(!x.isPasswordValid)r(!0);else{localStorage.setItem("shopPassword",i),u(i);const g=((d=p.state)==null?void 0:d.from)||"/";c(g),l(x)}n(!1)}return t.jsxRuntimeExports.jsxs("div",{className:Fe.wrapper,children:[!e&&t.jsxRuntimeExports.jsxs("div",{className:Fe.content,children:[t.jsxRuntimeExports.jsx("div",{className:Fe.lock,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),t.jsxRuntimeExports.jsxs("div",{className:Fe.info,children:[t.jsxRuntimeExports.jsx("h2",{id:"h2",className:Fe.title,children:"The store is password protected"}),t.jsxRuntimeExports.jsx("p",{id:"p",className:Fe.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),t.jsxRuntimeExports.jsxs("div",{className:Fe.input,children:[t.jsxRuntimeExports.jsx(t.Input$1,{type:"password",onChange:x=>{r(!1),o(x)},value:i,placeholder:"Password",required:!0}),t.jsxRuntimeExports.jsx("span",{className:Fe.error,children:s&&"Incorrect password"})]}),t.jsxRuntimeExports.jsxs("div",{className:Fe.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:Fe.button,onClick:()=>c("/contact"),children:"Contact Support"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",className:Fe.button,disabled:s,onClick:m,children:"Submit"})]})]}),e&&t.jsxRuntimeExports.jsx(t.Loader,{})]})},gd="_notifications_2ywhg_1",fd={notifications:gd},jd=({children:e})=>{const n=t.useLocation(),{token:s,setToken:r}=t.useStorefrontStore(),{dashInfo:i,setDashInfo:o}=t.useCustomerDashboardStore(),{shopPassword:a}=t.useStorefrontStore(),l=t.useNavigate(),[u,p]=t.useSearchParams(),{notifications:c}=t.useNotificationStore(),[m,x]=_.useState(!0),{setCustomerEmail:d}=t.useCartStore(),{setThemeSettings:g,themeSettings:h}=t.useThemeSettingsStore(),{settings:S,setSettings:j}=t.useSettingsStore(),{setHeader:E,setFooter:C,setAnnouncement:N,header:w,footer:b,announcement:A}=t.useLayersStore(),{general:$,setGeneral:z}=t.useGeneralStore(),{pageContext:V,setPageContext:B}=t.usePagesStore(),R=async()=>{const I=await t.getDynamicPage(encodeURIComponent("/products"));if(I){const{data:M}=I;B({...V,listings:M.listings})}};return _.useEffect(()=>{const I=localStorage.getItem("token");if(I&&(!s||!i))try{const M=t.jwtDecode(I);o(M),r(I),d(M.email)}catch(M){console.error("Failed to decode token:",M),localStorage.removeItem("token"),r(""),o(null)}},[s,i]),_.useEffect(()=>{const I=u.get("r");I&&(localStorage.setItem("referralCode",I),u.delete("r"),p(u),l({pathname:n.pathname,search:u.toString()},{replace:!0}))},[u,n]),_.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&$&&($.info.passwordProtected&&a||$.isPasswordValid)&&R()},[$,a]),_.useEffect(()=>{x(!0);const I=async()=>{if(!$){const P=await us(a);P.isPasswordValid||n.pathname.includes("/admin/builder")||l("/validation",{state:{from:n.pathname}}),z(P)}},M=async()=>{const{settings:P,theme:O}=(await xi()).data;if(P&&S){const D=S;if(P.settings?(Object.keys(P.settings).map(L=>{D.blockSettings[L]=P.settings[L]}),j(D)):j(S),P.header&&w){const L=w;Object.keys(P.header).map(H=>{L[H]=P.header[H]}),E(L)}if(P.footer&&b){const L=b;Object.keys(P.footer).map(H=>{L[H]=P.footer[H]}),C(L)}if(P.announcement&&A){const L=A;Object.keys(P.announcement).map(H=>{L[H]=P.announcement[H]}),N(L)}}else j(S);g(h),g(O||h),x(!1)};n.pathname.startsWith("/validation")||I(),M()},[]),n.pathname.startsWith("/admin/builder")?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:m?t.jsxRuntimeExports.jsx("div",{style:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e,c.length>0&&t.jsxRuntimeExports.jsx("div",{className:fd.notifications,children:c.map(I=>t.jsxRuntimeExports.jsx(Ur,{type:I.status,message:I.message,timer:10,id:I.id},I.id))})]})})},yd=()=>(_.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),t.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxRuntimeExports.jsx(t.Loader,{})})),_d="_wrapper_rccv2_1",Sd="_content_rccv2_11",bd="_title_rccv2_21",Yn={wrapper:_d,content:Sd,title:bd},tt=()=>{const e=t.useNavigate();return t.jsxRuntimeExports.jsx("div",{className:Yn.wrapper,children:t.jsxRuntimeExports.jsxs("div",{className:Yn.content,children:[t.jsxRuntimeExports.jsx("h1",{className:Yn.title,children:"Something went wrong"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>{e("/")},children:"Go to Home"})]})})},Cd=({children:e,shopDomain:n,shopId:s,shopPassword:r})=>{const{setShopDomain:i,setShopId:o,setShopPassword:a,setShopTerms:l,setShopPrivacyPolicy:u,setShopRefundPolicy:p}=t.useStorefrontStore();return _.useLayoutEffect(()=>{const c=async()=>{const{data:d}=await gi();l(d)},m=async()=>{const{data:d}=await ji();u(d)},x=async()=>{const{data:d}=await fi();p(d)};i(n),o(s),r&&a(r),c(),m(),x()},[n,s,r]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e})},Ed="_checkoutItemsContainer_1kn61_2",vd="_innerContainer_1kn61_16",wd="_headerSection_1kn61_22",kd="_header_1kn61_22",Rd="_productsContainer_1kn61_47",Nd="_couponContainer_1kn61_54",Id="_checkoutFooter_1kn61_58",yt={checkoutItemsContainer:Ed,innerContainer:vd,headerSection:wd,header:kd,productsContainer:Rd,couponContainer:Nd,checkoutFooter:Id},Td="_checkoutFooter_1dzvc_1",Pd="_footerBranding_1dzvc_9",Ld="_poweredText_1dzvc_14",Bd="_footerNav_1dzvc_19",jn={checkoutFooter:Td,footerBranding:Pd,poweredText:Ld,footerNav:Bd},Ad="data:image/svg+xml,%3csvg%20width='100'%20height='26'%20viewBox='0%200%20100%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20.3996%203.39999V12.8228L16.2964%2014.1313V8.89738L7.69363%2011.587V6.87107L20.3996%203.39999Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M16.2964%2014.1313L16.2962%2018.6292L3.59961%2022.6V12.7592L7.69363%2011.587L7.69344%2016.9118L16.2964%2014.1313Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M95.6308%2022C93.4931%2022%2091.8804%2020.882%2091.4678%2019.1776L93.118%2019.0676C93.4181%2019.984%2094.0931%2020.5338%2095.6308%2020.5338C97.4311%2020.5338%2098.4249%2019.8373%2098.4249%2018.4078V16.8316C97.9374%2017.858%2096.8122%2018.5178%2095.5183%2018.5178C92.9868%2018.5178%2091.1865%2016.575%2091.1865%2013.8076C91.1865%2011.0401%2092.9492%209.09737%2095.4433%209.09737C96.831%209.09737%2098.0499%209.77549%2098.5%2010.8568V9.3173H100V18.3711C100%2020.6438%2098.3687%2022%2095.6308%2022ZM95.5933%2017.0515C97.2998%2017.0515%2098.4062%2015.8053%2098.4249%2013.8076C98.4624%2011.8099%2097.3186%2010.5636%2095.5933%2010.5636C93.8494%2010.5636%2092.8367%2011.8099%2092.8367%2013.8076C92.8367%2015.8053%2093.8869%2017.0515%2095.5933%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M81.1836%2019.0309V9.3173H82.6275L82.665%2011.0584C83.1901%209.72051%2084.3527%209.09737%2085.7217%209.09737C87.9907%209.09737%2089.0783%2010.7285%2089.0783%2012.7812V19.0309H87.5031V13.2211C87.5031%2011.425%2086.8843%2010.4536%2085.3841%2010.4536C83.8464%2010.4536%2082.7588%2011.425%2082.7588%2013.2211V19.0309H81.1836Z'%20fill='%23252525'/%3e%3cpath%20d='M73.3176%2019.2509C71.2549%2019.2509%2069.9609%2018.2795%2069.9609%2016.6117C69.9609%2014.9622%2070.9173%2014.0458%2073.0926%2013.6426L76.618%2013.0011C76.618%2011.37%2075.8304%2010.5636%2074.2552%2010.5636C72.8676%2010.5636%2072.0987%2011.1867%2071.7987%2012.3047L70.1297%2012.1764C70.5048%2010.3436%2072.0049%209.09737%2074.2552%209.09737C76.8056%209.09737%2078.1932%2010.6002%2078.1932%2013.0561V17.0699C78.1932%2017.5097%2078.3433%2017.6747%2078.7183%2017.6747H79.1121V19.0309C78.9996%2019.0493%2078.7558%2019.0676%2078.512%2019.0676C77.3119%2019.0676%2076.7681%2018.6094%2076.6368%2017.5281C76.1492%2018.5361%2074.7803%2019.2509%2073.3176%2019.2509ZM73.4676%2017.8946C75.4554%2017.8946%2076.618%2016.6483%2076.618%2015.0355V14.3391L73.3926%2014.9255C72.0425%2015.1638%2071.6111%2015.6586%2071.6111%2016.4651C71.6111%2017.3814%2072.305%2017.8946%2073.4676%2017.8946Z'%20fill='%23252525'/%3e%3cpath%20d='M63.2168%2022C61.079%2022%2059.4663%2020.882%2059.0537%2019.1776L60.704%2019.0676C61.004%2019.984%2061.6791%2020.5338%2063.2168%2020.5338C65.017%2020.5338%2066.0109%2019.8373%2066.0109%2018.4078V16.8316C65.5233%2017.858%2064.3982%2018.5178%2063.1043%2018.5178C60.5727%2018.5178%2058.7725%2016.575%2058.7725%2013.8076C58.7725%2011.0401%2060.5352%209.09737%2063.0293%209.09737C64.4169%209.09737%2065.6358%209.77549%2066.0859%2010.8568V9.3173H67.5861V18.3711C67.5861%2020.6438%2065.9546%2022%2063.2168%2022ZM63.1793%2017.0515C64.8857%2017.0515%2065.9921%2015.8053%2066.0109%2013.8076C66.0484%2011.8099%2064.9045%2010.5636%2063.1793%2010.5636C61.4353%2010.5636%2060.4227%2011.8099%2060.4227%2013.8076C60.4227%2015.8053%2061.4728%2017.0515%2063.1793%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M56.2141%2019.0309C55.0515%2019.0309%2054.2451%2018.4811%2054.2451%2017.1982L54.2639%206.01834H55.8391V17.0699C55.8391%2017.4731%2056.0453%2017.6747%2056.4579%2017.6747H57.3205V19.0309H56.2141Z'%20fill='%23252525'/%3e%3cpath%20d='M51.0686%2019.0309C49.906%2019.0309%2049.0996%2018.4811%2049.0996%2017.1982L49.1184%206.01834H50.6936V17.0699C50.6936%2017.4731%2050.8998%2017.6747%2051.3124%2017.6747H52.175V19.0309H51.0686Z'%20fill='%23252525'/%3e%3cpath%20d='M44.5209%2019.0309V9.3173H46.0961V19.0309H44.5209ZM44.4834%207.79611V6H46.1336V7.79611H44.4834Z'%20fill='%23252525'/%3e%3cpath%20d='M32%2019.0309V6.01834H36.5756C39.726%206.01834%2041.3012%207.09967%2041.3012%209.51891C41.3012%2010.9851%2040.4198%2012.0481%2038.9384%2012.3047C40.7574%2012.5613%2041.8638%2013.7709%2041.8638%2015.4571C41.8638%2017.8213%2040.2323%2019.0309%2037.3257%2019.0309H32ZM37.3257%2017.4914C39.1447%2017.4914%2040.176%2016.74%2040.176%2015.3654C40.176%2013.9908%2039.1447%2013.1844%2037.3257%2013.1844H33.6127V17.4914H37.3257ZM36.5756%2011.6449C38.5258%2011.6449%2039.6135%2010.8935%2039.6135%209.59222C39.6135%208.21765%2038.6008%207.55786%2036.5756%207.55786H33.6127V11.6449H36.5756Z'%20fill='%23252525'/%3e%3c/svg%3e",rt=({className:e})=>{const{shopTerms:n,shopPrivacyPolicy:s,shopRefundPolicy:r}=t.useStorefrontStore();return t.jsxRuntimeExports.jsxs("footer",{className:`${jn.checkoutFooter} ${e}`,children:[t.jsxRuntimeExports.jsxs("div",{className:jn.footerBranding,children:[t.jsxRuntimeExports.jsx("p",{className:jn.poweredText,children:"Powered by"}),t.jsxRuntimeExports.jsx("img",{src:Ad,alt:"Billgang"})]}),t.jsxRuntimeExports.jsx("nav",{children:t.jsxRuntimeExports.jsxs("ul",{className:jn.footerNav,children:[(n==null?void 0:n.showTermsOfServiceOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:n.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(s==null?void 0:s.showPrivacyPolicyOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:s.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},Md="_checkoutHeader_d2mbf_1",$d="_leftContainer_d2mbf_20",Dd="_backArrow_d2mbf_26",Fd="_logoContainer_d2mbf_38",Od="_logo_d2mbf_38",Wt={checkoutHeader:Md,leftContainer:$d,backArrow:Dd,logoContainer:Fd,logo:Od},Hd="_activeBadge_1yb5i_1",zd="_activeBadgeText_1yb5i_12",Gs={activeBadge:Hd,activeBadgeText:zd},Ud=({className:e})=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(Gs.activeBadge,e),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",width:20,height:20}),t.jsxRuntimeExports.jsx("p",{className:Gs.activeBadgeText,children:"Active"})]}),Vd="_timerContainer_105jf_2",Wd="_timerText_105jf_12",Zs={timerContainer:Vd,timerText:Wd},qd=({expiresAt:e})=>{const[n,s]=_.useState(r());function r(){const i=new Date,o=new Date(e).getTime()-i.getTime();if(o<=0)return{hours:"00",minutes:"00",seconds:"00"};const a=Math.floor(o/(1e3*60*60)),l=Math.floor(o%(1e3*60*60)/(1e3*60)),u=Math.floor(o%(1e3*60)/1e3);return{hours:String(a).padStart(2,"0"),minutes:String(l).padStart(2,"0"),seconds:String(u).padStart(2,"0")}}return _.useEffect(()=>{const i=setInterval(()=>{s(r())},1e3);return()=>clearInterval(i)},[e]),n.hours==="00"&&n.minutes==="00"&&n.seconds==="00"?null:t.jsxRuntimeExports.jsxs("div",{className:Zs.timerContainer,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Clock"}),t.jsxRuntimeExports.jsxs("p",{className:Zs.timerText,children:[n.hours,":",n.minutes,":",n.seconds]})]})},Gd="_progressBar_mcabf_4",Zd="_progressBarLabel_mcabf_12",Xd="_progressBarTrack_mcabf_17",Yd="_progressBarFill_mcabf_28",yn={progressBar:Gd,progressBarLabel:Zd,progressBarTrack:Xd,progressBarFill:Yd},Wr=({color:e,percent:n,disablePercentLabel:s})=>t.jsxRuntimeExports.jsxs("div",{className:yn.progressBar,children:[!s&&t.jsxRuntimeExports.jsxs("p",{className:yn.progressBarLabel,children:[n,"%"]}),t.jsxRuntimeExports.jsx("div",{className:yn.progressBarTrack,children:t.jsxRuntimeExports.jsx("div",{style:{width:`${n}%`,background:e||void 0},className:yn.progressBarFill})})]}),Kd="_rating_1bpps_4",Jd="_disabled_1bpps_9",Qd="_ratingStar_1bpps_14",em="_inactive_1bpps_22",_n={rating:Kd,disabled:Jd,ratingStar:Qd,inactive:em},tm=({setRating:e,rating:n,disabled:s})=>{const[r,i]=_.useState(0),o=l=>{s||i(+l.currentTarget.id)},a=l=>{s||e(l)};return t.jsxRuntimeExports.jsx("div",{className:t.clx(_n.rating,{[_n.disabled]:s}),onMouseLeave:()=>i(0),children:[1,2,3,4,5].map(l=>t.jsxRuntimeExports.jsx("div",{id:l.toString(),className:t.clx(_n.ratingStar,{[_n.inactive]:!(n>=l||r>=l)}),onMouseEnter:o,onClick:()=>a(l),children:n>=l||r>=l?t.jsxRuntimeExports.jsx(t.FilledStar,{}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Star",fill:"var(--text-secondary)",width:22,height:21})},l))})},nm="_inputRange_iv6ow_4",sm="_inputRangeLabel_iv6ow_14",rm="_progressBar_iv6ow_22",om="_progressBarFill_iv6ow_29",im="_stepsContainer_iv6ow_40",am="_step_iv6ow_40",lm="_stepDot_iv6ow_57",cm="_current_iv6ow_61",um="_active_iv6ow_69",pm="_inactive_iv6ow_72",dm="_tooltip_iv6ow_77",Ie={inputRange:nm,inputRangeLabel:sm,progressBar:rm,progressBarFill:om,stepsContainer:im,step:am,stepDot:lm,current:cm,default:"_default_iv6ow_65",active:um,inactive:pm,tooltip:dm},mm=({totalSteps:e,step:n,onStepChange:s,label:r})=>{const[i,o]=_.useState(n),a=i===1?0:(i-1)/(e-1)*100,l=u=>{o(u),s(u)};return t.jsxRuntimeExports.jsxs("div",{className:Ie.inputRange,children:[r&&t.jsxRuntimeExports.jsx("div",{className:Ie.inputRangeLabel,children:r}),t.jsxRuntimeExports.jsxs("div",{className:Ie.progressBar,children:[t.jsxRuntimeExports.jsx("div",{className:Ie.progressBarFill,style:{width:`${Math.ceil(a)}%`}}),t.jsxRuntimeExports.jsx("div",{className:Ie.stepsContainer,children:[...Array(e)].map((u,p)=>{const c=p+1,m=c<=i,x=c===i;return t.jsxRuntimeExports.jsxs("div",{className:Ie.step,onClick:()=>l(c),children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(Ie.stepDot,x?Ie.current:Ie.default,m?Ie.active:Ie.inactive)}),x&&t.jsxRuntimeExports.jsxs("div",{className:Ie.tooltip,style:{transform:`translateX(calc(50% - ${a<99?"40px":"70px"}))`},children:[t.jsxRuntimeExports.jsx("span",{children:i}),t.jsxRuntimeExports.jsx("span",{children:i===1?"month":"months"})]})]},c)})})]})]})},rn=({className:e,expiresAt:n})=>{const{shopGeneral:s}=t.useStorefrontStore(),r=t.useNavigate();return t.jsxRuntimeExports.jsxs("header",{className:`${Wt.checkoutHeader} ${e}`,children:[t.jsxRuntimeExports.jsxs("div",{className:Wt.leftContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Wt.backArrow,onClick:()=>{window.history.length>2?r(-1):r("/")},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUp"})}),(s==null?void 0:s.info.logo)&&t.jsxRuntimeExports.jsx("div",{className:Wt.logoContainer,children:t.jsxRuntimeExports.jsx("img",{className:Wt.logo,src:t.convertCfImageIdToUrl(s.info.logo.cfId)})})]}),n&&t.jsxRuntimeExports.jsx(qd,{expiresAt:n})]})},xm="_checkoutPrices_vp75r_1",hm="_priceRow_vp75r_12",gm="_label_vp75r_22",fm="_totalRow_vp75r_26",jm="_totalLabel_vp75r_37",ym="_totalValue_vp75r_42",Oe={checkoutPrices:xm,priceRow:hm,label:gm,totalRow:fm,totalLabel:jm,totalValue:ym},on=({formatter:e,coupon:n,discount:s,totalWithDiscount:r,total:i,className:o,isShowSubtotal:a=!0,feeOrDiscount:l})=>{const u=Math.max(0,s),{priceAdjusment:p}=t.useCartStore();return t.jsxRuntimeExports.jsxs("div",{className:`${Oe.checkoutPrices} ${o||""}`,children:[a&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsx("p",{className:Oe.label,children:"Subtotal"}),t.jsxRuntimeExports.jsx("p",{children:e.format(i)})]}),(n||u>0)&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsxs("p",{className:Oe.label,children:["Discount ",n&&!(n!=null&&n.isFixed)&&`(${n==null?void 0:n.discount}%)`]}),t.jsxRuntimeExports.jsxs("p",{children:["-",e.format(u)]})]}),l&&p&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsxs("p",{className:Oe.label,children:[p.isDiscount?"Discount:":"Fee:"," (",p.percentage,"% +"," ",e.format(p.fixedAmount),")"]}),t.jsxRuntimeExports.jsx("p",{children:e.format(l)})]}),t.jsxRuntimeExports.jsxs("div",{className:Oe.totalRow,children:[t.jsxRuntimeExports.jsx("p",{className:Oe.totalLabel,children:"Total Due"}),p&&l?t.jsxRuntimeExports.jsx("p",{className:Oe.totalValue,children:r?e.format(Math.max(p.isDiscount?r-l:r+l,0)):e.format(Math.max(p.isDiscount?i-l:i+l,0))}):t.jsxRuntimeExports.jsx("p",{className:Oe.totalValue,children:r?e.format(Math.max(r,0)):e.format(Math.max(i,0))})]})]})},_m="_checkoutProduct_n1naa_1",Sm="_isOrder_n1naa_1",bm="_productDetails_n1naa_10",Cm="_productImage_n1naa_16",Em="_isOrderImage_n1naa_26",vm="_image_n1naa_30",wm="_productInfo_n1naa_35",km="_productHeader_n1naa_40",Rm="_quantityBadge_n1naa_46",Nm="_productPrice_n1naa_62",Im="_deliveryCategories_n1naa_71",Tm="_customerNote_n1naa_79",Pm="_noteHeader_n1naa_86",Lm="_logoContainer_n1naa_92",Bm="_shopName_n1naa_104",Am="_noteContent_n1naa_108",Mm="_productName_n1naa_114",xe={checkoutProduct:_m,isOrder:Sm,productDetails:bm,productImage:Cm,isOrderImage:Em,image:vm,productInfo:wm,productHeader:km,quantityBadge:Rm,productPrice:Nm,deliveryCategories:Im,customerNote:Tm,noteHeader:Pm,logoContainer:Lm,shopName:Bm,noteContent:Am,productName:Mm},Cs=({isOrder:e,product:n})=>{var o;const{shopGeneral:s}=t.useStorefrontStore(),r=n.subscriptionSettings,{cart:i}=t.useCart();return console.log("product",n),t.jsxRuntimeExports.jsxs("div",{className:`${xe.checkoutProduct} ${e?xe.isOrder:""}`,children:[t.jsxRuntimeExports.jsxs("div",{className:xe.productDetails,children:[t.jsxRuntimeExports.jsx("div",{className:`${xe.productImage} ${e?xe.isOrderImage:""}`,children:n!=null&&n.image?t.jsxRuntimeExports.jsx("img",{className:xe.image,src:t.convertCfImageIdToUrl(n.image.cfId)}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("div",{className:xe.productInfo,children:t.jsxRuntimeExports.jsxs("div",{className:xe.productHeader,children:[t.jsxRuntimeExports.jsx("h2",{className:xe.productName,children:n.name}),t.jsxRuntimeExports.jsxs("span",{className:xe.quantityBadge,children:[n.price.quantity,"x"]})]})}),n.chargeType==="RECURRING"&&t.jsxRuntimeExports.jsx("p",{className:xe.productPrice,children:r&&`${t.formatPrice(r.price)} / ${t.normalizeInterval(r.recurringIntervalDays||0)}${r.entryFee?" + "+t.formatPrice(r.entryFee):""}`}),n.chargeType==="ONE_TIME"&&t.jsxRuntimeExports.jsx("p",{className:xe.productPrice,children:n.variantsGateways&&i.gateway&&n.variantsGateways.some(a=>a.name===i.gateway&&a.overrodePrice)?t.formatPrice(((o=n.variantsGateways.find(a=>a.name===i.gateway))==null?void 0:o.overrodePrice)||n.price):t.formatPrice(n.price)})]}),n.deliveryCategories&&t.jsxRuntimeExports.jsx("div",{className:xe.deliveryCategories,children:n.deliveryCategories.map(a=>t.jsxRuntimeExports.jsx(t.DeliveryItem,{deliveryConfiguration:a},a.id))}),n.customerNote&&t.jsxRuntimeExports.jsxs("div",{className:xe.customerNote,children:[t.jsxRuntimeExports.jsxs("div",{className:xe.noteHeader,children:[(s==null?void 0:s.info.logo)&&t.jsxRuntimeExports.jsx("div",{className:xe.logoContainer,children:t.jsxRuntimeExports.jsx("img",{src:t.convertCfImageIdToUrl(s==null?void 0:s.info.logo.cfId)})}),t.jsxRuntimeExports.jsx("p",{className:xe.shopName,children:s==null?void 0:s.info.name})]}),t.jsxRuntimeExports.jsx("p",{className:xe.noteContent,children:n.customerNote})]})]})},$m="_coupon_dkjzv_1",Dm="_couponApplied_dkjzv_7",Fm="_discount_dkjzv_17",Om="_removeButton_dkjzv_23",Hm="_removeButtonText_dkjzv_27",zm="_couponInput_dkjzv_31",Um="_couponInputContainer_dkjzv_37",at={coupon:$m,couponApplied:Dm,discount:Fm,removeButton:Om,removeButtonText:Hm,couponInput:zm,couponInputContainer:Um},Vm=({applyCoupon:e,couponData:n,discount:s,removeCoupon:r,gateway:i})=>{const[o,a]=_.useState(null),[l,u]=_.useState(!1);return t.jsxRuntimeExports.jsxs("div",{className:at.coupon,children:[l&&t.jsxRuntimeExports.jsx(t.ContentLoader,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:at.skeleton,children:t.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!l&&(n?t.jsxRuntimeExports.jsxs("div",{className:at.couponApplied,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"var(--text-success)"}),t.jsxRuntimeExports.jsxs("p",{children:[o," is applied"," ",t.jsxRuntimeExports.jsxs("span",{className:at.discount,children:["-",s," ",!n.isFixed&&`(${n.discount}%)`]})]}),t.jsxRuntimeExports.jsx("button",{className:at.removeButton,onClick:r,children:t.jsxRuntimeExports.jsx("span",{className:at.removeButtonText,children:"Remove"})})]}):t.jsxRuntimeExports.jsxs("div",{className:at.couponInput,children:[t.jsxRuntimeExports.jsxs("div",{className:at.couponInputContainer,children:[t.jsxRuntimeExports.jsx(t.Input$1,{placeholder:"Enter a discount code",value:o||"",onChange:p=>{a(p===""?null:p)}}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:async()=>{u(!0),o&&await e(o),u(!1)},disabled:!i||!o,type:"Primary",children:"Apply"})]}),!i&&t.jsxRuntimeExports.jsx(t.Tip,{type:"warning",message:"The discount is related to the method of payment. Select to enter."})]}))]})},Wm=({cart:e,products:n,applyCoupon:s,applyCouponPending:r,coupon:i,totalAndDiscount:o,removeCoupon:a})=>{var d;const{priceAdjusment:l}=t.useCartStore(),u=_.useMemo(()=>e.parts.map(g=>{const h=n.find(j=>j.id===g.productId),S=h==null?void 0:h.variants.find(j=>j.id===g.productVariantId);return{id:(h==null?void 0:h.id)||0,image:h==null?void 0:h.images[0],name:(S==null?void 0:S.name)||"",description:(S==null?void 0:S.description)||"",price:{quantity:g.quantity,amount:(S==null?void 0:S.price.amount)||0,currency:S==null?void 0:S.price.currency},subscriptionSettings:S==null?void 0:S.subscriptionSettings,chargeType:g.chargeType,variantsGateways:S==null?void 0:S.gateways}}),[e,n]),p=((d=u[0])==null?void 0:d.price.currency)||"USD",c=new Intl.NumberFormat("en-US",{style:"currency",currency:p}),m=_.useMemo(()=>o.totalWithDiscount?o.total-o.totalWithDiscount:0,[o]),x=l?(l==null?void 0:l.fixedAmount)+Math.round((o.totalWithDiscount||o.total)*((l==null?void 0:l.percentage)/100)):null;return t.jsxRuntimeExports.jsx("div",{className:yt.checkoutItemsContainer,children:t.jsxRuntimeExports.jsxs("div",{className:yt.innerContainer,children:[t.jsxRuntimeExports.jsx(rn,{}),t.jsxRuntimeExports.jsxs("div",{className:yt.headerSection,children:[t.jsxRuntimeExports.jsx("header",{className:yt.header,children:t.jsxRuntimeExports.jsx("h1",{children:"Checkout"})}),t.jsxRuntimeExports.jsx("div",{className:yt.productsContainer,children:u.map(g=>t.jsxRuntimeExports.jsx(Cs,{product:g},g.id))}),t.jsxRuntimeExports.jsx("div",{className:yt.couponContainer,children:t.jsxRuntimeExports.jsx(Vm,{applyCoupon:s,applyCouponPending:r,couponData:i,discount:c.format(m),removeCoupon:a,gateway:e.gateway})}),t.jsxRuntimeExports.jsx(on,{formatter:c,coupon:i,total:o.total,discount:m,totalWithDiscount:o.totalWithDiscount,feeOrDiscount:x})]}),t.jsxRuntimeExports.jsx("div",{className:yt.checkoutFooter,children:t.jsxRuntimeExports.jsx(rt,{})})]})})},qm="_checkoutOperational_6gxie_1",Gm="_innerContainer_6gxie_17",Zm="_paymentMethodsSection_6gxie_22",Xm="_socialConnectSection_6gxie_28",Ym="_socialConnectLabel_6gxie_31",Km="_socialConnectContent_6gxie_35",Jm="_continueButton_6gxie_39",Qm="_button_6gxie_43",ex="_checkoutFooter_6gxie_47",nt={checkoutOperational:qm,innerContainer:Gm,paymentMethodsSection:Zm,socialConnectSection:Xm,socialConnectLabel:Ym,socialConnectContent:Km,continueButton:Jm,button:Qm,checkoutFooter:ex},tx="_customFields_1emyf_2",nx="_checkboxWrapper_1emyf_9",sx="_textareaWrapper_1emyf_16",rx="_inputWrapper_1emyf_17",Yt={customFields:tx,checkboxWrapper:nx,textareaWrapper:sx,inputWrapper:rx},ox=({customFields:e,setCustomFields:n})=>{if(e.length===0)return null;const s=e.map(r=>t.jsxRuntimeExports.jsx(ix,{customField:r,setCustomFields:n},r.name));return t.jsxRuntimeExports.jsx("div",{className:Yt.customFields,children:s})},ix=({customField:e,setCustomFields:n})=>{const[s,r]=_.useState(e.value);return t.jsxRuntimeExports.jsx(ax,{value:s,placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:i=>{r(i),n(o=>o.map(a=>a.name===e.name?{...a,value:i}:a))},label:e.name,regex:e.regex})},ax=({label:e,type:n,defaultValue:s,value:r,placeholder:i,regex:o,required:a,onValueChange:l})=>{if(n===t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox)return t.jsxRuntimeExports.jsxs("label",{className:Yt.checkboxWrapper,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:!!s,onChange:p=>l(p)}),t.jsxRuntimeExports.jsx("p",{className:Yt.checkboxLabel,children:e})]});if(n==t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Hidden)return t.jsxRuntimeExports.jsx("input",{type:"hidden",value:typeof s!="boolean"?s:void 0,required:a});const u=p=>{let c=/^\d*$/;n!=t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number&&(c=o?new RegExp(o):new RegExp("")),c.test(p)&&l(p)};return n==t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Textarea?t.jsxRuntimeExports.jsx("div",{className:Yt.textareaWrapper,children:t.jsxRuntimeExports.jsx(t.Textarea$1,{label:e,value:r,placeholder:i,onChange:p=>u(p)})}):t.jsxRuntimeExports.jsx("div",{className:Yt.inputWrapper,children:t.jsxRuntimeExports.jsx(t.Input$1,{label:e,value:r,placeholder:i,required:a,onChange:p=>u(p)})})},lx="_connectedContainer_e6cyx_1",cx="_userInfo_e6cyx_10",ux="_avatar_e6cyx_16",px="_avatarImage_e6cyx_26",Sn={connectedContainer:lx,userInfo:cx,avatar:ux,avatarImage:px},dx=({customerEmail:e})=>{const{discordInfo:n,setDiscordInfo:s}=t.useDiscordStore(),[r,i]=_.useState(!1),o=()=>{e.trim()!==""&&(i(!0),Si({customerEmail:e}).then(({data:a})=>{const l=window.open(a.redirectUrl);(!l||l.closed||typeof l.closed>"u")&&setTimeout(()=>{const c=document.createElement("a");c.href=a.redirectUrl,c.target="_blank",c.click()});let u;const p=()=>{bi({id:a.id,customerEmail:e}).then(({data:c})=>{s({authorized:!0,id:c.discordId,avatar:c.avatar,username:c.username}),l&&l.close(),i(!1),clearTimeout(u)}).catch(c=>{console.log("Ожидание авторизации...",c,{newWindow:l}),clearTimeout(u),u=setTimeout(p,1500)})};p()}).catch(a=>{console.log("Could not initiate Discord authorization",a)}))};return n!=null&&n.authorized?t.jsxRuntimeExports.jsxs("div",{className:Sn.connectedContainer,children:[t.jsxRuntimeExports.jsxs("div",{className:Sn.userInfo,children:[t.jsxRuntimeExports.jsx("div",{className:Sn.avatar,children:n.avatar?t.jsxRuntimeExports.jsx("img",{className:Sn.avatarImage,src:`https://cdn.discordapp.com/avatars/${n.id}/${n.avatar}.png?size=256`}):t.jsxRuntimeExports.jsx(t.Icon,{name:"UserCircle"})}),t.jsxRuntimeExports.jsx("p",{children:n.username}),t.jsxRuntimeExports.jsx(Ud,{})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Reconnect"})]}):t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:r?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"DiscordLogo"}),"Connect Your Discord"]})})},mx="_paymentMethodsContainer_a3he6_2",xx={paymentMethodsContainer:mx},hx="_bottomSheet_og330_1",gx="_content_og330_8",fx="_description_og330_11",jx="_buttonGroup_og330_15",yx="_buttonWrapper_og330_25",_x="_fullWidthButton_og330_28",Sx="_modal_og330_32",bx="_header_og330_39",lt={bottomSheet:hx,content:gx,description:fx,buttonGroup:jx,buttonWrapper:yx,fullWidthButton:_x,modal:Sx,header:bx},Cx=({setIsOpen:e,balance:n})=>{const s=t.useNavigate(),{setIsOpen:r}=t.useModalStore(),i=()=>{s("/top-up?redirectRoute=checkout")};function o(){r(!1),setTimeout(()=>{e(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:lt.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:lt.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Insufficient Customer Balance"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:lt.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:lt.content,children:t.jsxRuntimeExports.jsxs("p",{className:lt.description,children:["You currently have ",n&&t.formatPrice(n)," in your balance. After topping up the required amount, you can continue to checkout."]})}),t.jsxRuntimeExports.jsxs("div",{className:lt.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:lt.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:i,children:"Add Balance"})})]})]})]})},qr=({align:e,gateway:n,gatewayDisplayName:s,selected:r,onSelect:i,total:o,onSignInClick:a,reversed:l})=>{const{token:u}=t.useStorefrontStore(),{balance:p}=t.useCustomerDashboardStore(),[c,m]=_.useState(!1),{setIsOpen:x}=t.useModalStore(),d=g=>{g.stopPropagation(),i&&i(n),p&&p.amount<o&&(m(!0),x(!0))};return _.useEffect(()=>{},[p,o]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(t.styles$3.paymentMethod,{[t.styles$3.selected]:r,[t.styles$3.alignColumn]:e==="column",[t.styles$3.reversed]:l}),onClick:d,children:[t.jsxRuntimeExports.jsxs("p",{className:t.styles$3.paymentText,children:[s," ",t.jsxRuntimeExports.jsxs("span",{className:t.styles$3.balanceText,children:["(",u?p&&t.formatPrice(p):t.jsxRuntimeExports.jsx("a",{className:t.styles$3.signInLink,onClick:a,children:"Sign in"}),")"]})]}),t.jsxRuntimeExports.jsx("div",{className:t.styles$3.iconContainer,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}),c&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>m(!1),children:t.jsxRuntimeExports.jsx(Cx,{setIsOpen:m,balance:p})})]})},Gr=({possibleGateways:e,setGateway:n,totalAndDiscount:s,onSignInClick:r,setPaymentMethod:i})=>{const[o,a]=_.useState(),[l,u]=_.useState(),{setPriceAdjustment:p}=t.useCartStore(),[c,m]=_.useState(null),x=(d,g)=>{var h;l!==g&&(n(g),p(((h=c==null?void 0:c.find(S=>S.name===g))==null?void 0:h.priceAdjustment)||null)),i(d),a(d),u(g)};return _.useEffect(()=>{const d=async()=>{const{data:g}=await t.fetchGatewaysDetail([...e.availableGateways,...e.requiresSignInGateways]);m(g)};e.availableGateways.length&&d()},[]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[c&&t.jsxRuntimeExports.jsx("div",{className:xx.paymentMethodsContainer,children:c==null?void 0:c.map(d=>d.name==="Balance"?t.jsxRuntimeExports.jsx(qr,{gateway:d.name,gatewayDisplayName:d.displayName,onSelect:g=>{u(g),l!==g&&n(g)},selected:d.name===l,total:s.total,onSignInClick:r,reversed:!0},d.name):d.paymentMethods.map(g=>t.jsxRuntimeExports.jsx(t.CheckoutPaymentMethod,{paymentMethod:g,gateway:d.name,gatewayDisplayName:d.displayName,gatewayLogoCfId:d.logoCfImageId,poweredByLogoCfId:d.poweredByImageCfImageId,onSelect:h=>x(h,d.name),selected:o===g&&l===d.name},`${d.name}-${g}`)))}),!c&&t.jsxRuntimeExports.jsx(t.ContentLoader,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",children:t.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})})]})},Ex="_modal_14r0b_1",vx={modal:Ex},wx=({setIsOpen:e})=>{const{token:n}=t.useStorefrontStore(),{setIsOpen:s}=t.useModalStore();_.useEffect(()=>{n&&r()},[n]);const r=()=>{s(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsx("div",{className:vx.modal,onClick:i=>i.stopPropagation(),children:t.jsxRuntimeExports.jsx(t.Auth,{inModal:!0})})},kx=({getPossibleGateways:e,setGateway:n,getDiscordSettings:s,cart:r,products:i,submitCart:o,reset:a,setCustomFieldsToCart:l,totalAndDiscount:u,setDiscordSocialConnectId:p,setPaymentMethod:c})=>{const m=_.useMemo(()=>s(),[]),[x,d]=_.useState([]),[g,h]=_.useState({}),{balance:S,setBalance:j}=t.useCustomerDashboardStore(),{token:E}=t.useStorefrontStore(),{executeRecaptcha:C}=t.useReCaptcha(),{discordInfo:N}=t.useDiscordStore(),{customerEmail:w,setCustomerEmail:b}=t.useCartStore(),A=N!=null&&N.authorized?N.id:void 0,$=t.useNavigate(),z=_.useMemo(()=>e(),[r.parts]),[V,B]=_.useState(!1),{setIsOpen:R}=t.useModalStore(),{notifications:I,setNotifications:M}=t.useNotificationStore();_.useEffect(()=>{const H=t.getCommonCustomFields(r.parts,i).map(f=>f.type===t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...f,value:String(f.defaultValue)}:f);d([...H])},[r.parts,i]);const P=()=>{const L={...g};x.forEach(H=>{H.required&&!H.value?(h({...g,[H.name]:`Field ${H.name} is required but has an empty value.`}),M([...I,{message:`Field ${H.name} is required but has an empty value.`,status:"error",id:t.v4()}])):(delete L[H.name],h(L))})};_.useEffect(()=>{const L=[];Object.entries(g).forEach(([H,f])=>{L.push({message:f,status:"error",id:t.v4()})}),L.length&&M([...I,...L])},[g]);const O=async L=>{if(L.stopPropagation(),r.gateway==="Balance"&&!E){R(!0),B(!0);return}const H={};P(),x.forEach(se=>H[se.name]=se.value),l(H),A&&m.isEnabled&&p(A);const f=await C();if(f&&!Object.keys(g).length){const se=await o(f);$(`/orders/${"order"in se?se.order.id:se.id}`),setTimeout(()=>{a()},0)}};_.useEffect(()=>{d(t.getCommonCustomFields(r.parts,i))},[r.parts,i]),_.useEffect(()=>{E&&(async()=>{const H=await t.getBalance();j(H)})()},[E]);function D(L){return L&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(L)}return t.jsxRuntimeExports.jsxs("div",{className:nt.checkoutOperational,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.innerContainer,children:[r.parts.length>0&&t.jsxRuntimeExports.jsx(Gr,{possibleGateways:z,setGateway:n,setPaymentMethod:c,balance:S,totalAndDiscount:u,onSignInClick:()=>{B(!0),R(!0)}}),t.jsxRuntimeExports.jsx("div",{className:nt.paymentMethodsSection,children:t.jsxRuntimeExports.jsx(t.Input$1,{placeholder:"mail@mail.com",value:w||"",onChange:L=>b(L),disabled:!!E,label:"Email Address"})}),t.jsxRuntimeExports.jsx(ox,{customFields:x,setCustomFields:d}),m.isEnabled&&t.jsxRuntimeExports.jsxs("div",{className:nt.socialConnectSection,children:[t.jsxRuntimeExports.jsx("p",{className:nt.socialConnectLabel,children:"Social Connect"}),t.jsxRuntimeExports.jsx("div",{className:nt.socialConnectContent,children:t.jsxRuntimeExports.jsx(dx,{customerEmail:w||""})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.continueButton,children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:O,disabled:!r.gateway||!D(w||"")||m.isRequired&&!(N!=null&&N.authorized),className:nt.button,children:"Continue to Checkout"}),t.jsxRuntimeExports.jsx(t.TermsOfService,{}),t.jsxRuntimeExports.jsx(t.SecuredBySsl,{})]}),t.jsxRuntimeExports.jsx(rt,{className:nt.checkoutFooter})]}),V&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>B(!1),children:t.jsxRuntimeExports.jsx(wx,{setIsOpen:B})})]})},Rx="_mt1_1t7v2_1",Nx="_notifyBlock_1t7v2_13",Ix="_notifyHeader_1t7v2_19",Tx="_notifyContent_1t7v2_25",Px="_buttonBlock_1t7v2_30",Lx="_imageBlock_1t7v2_34",Bx="_imageContainer_1t7v2_42",Ax="_sectionBlock_1t7v2_54",Mx="_sectionTitle_1t7v2_61",$x="_sectionSubtitle_1t7v2_64",Dx="_inputContainer_1t7v2_69",We={mt1:Rx,notifyBlock:Nx,notifyHeader:Ix,notifyContent:Tx,buttonBlock:Px,imageBlock:Lx,imageContainer:Bx,sectionBlock:Ax,sectionTitle:Mx,sectionSubtitle:$x,inputContainer:Dx},Fx=({props:e})=>{const n=t.useCopy();return t.jsxRuntimeExports.jsx("div",{className:We.mt1,children:t.jsxRuntimeExports.jsxs("div",{className:We.inputContainer,children:[t.jsxRuntimeExports.jsx(t.Input$1,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>n(e.text),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})})},Ox=({props:e})=>t.jsxRuntimeExports.jsx(t.Button$1,{className:We.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),Hx=({props:e})=>t.jsxRuntimeExports.jsx("div",{className:We.imageBlock,children:t.jsxRuntimeExports.jsx("div",{className:We.imageContainer,children:t.jsxRuntimeExports.jsx("img",{src:e.src,alt:""})})}),zx=({props:e})=>t.jsxRuntimeExports.jsxs("div",{className:We.notifyBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:We.notifyHeader,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),t.jsxRuntimeExports.jsx("p",{children:e.heading})]}),t.jsxRuntimeExports.jsx("p",{className:We.notifyContent,children:e.content})]}),Ux=({props:e})=>{var n;return t.jsxRuntimeExports.jsxs("div",{className:We.sectionBlock,children:[t.jsxRuntimeExports.jsx("p",{className:We.sectionTitle,children:e.title}),t.jsxRuntimeExports.jsx("span",{className:We.sectionSubtitle,children:e.subTitle}),(n=e.children)==null?void 0:n.map((s,r)=>t.jsxRuntimeExports.jsx(Zr,{block:s},r))]})},Zr=({block:e})=>{switch(e.type){case"Section":return t.jsxRuntimeExports.jsx(Ux,{...e});case"ReadOnlyTextInput":return t.jsxRuntimeExports.jsx(Fx,{...e});case"Notify":return t.jsxRuntimeExports.jsx(zx,{...e});case"Button":return t.jsxRuntimeExports.jsx(Ox,{...e});case"Image":return t.jsxRuntimeExports.jsx(Hx,{...e});default:return null}},Vx="_bottomSheet_1x4sq_1",Wx="_content_1x4sq_8",qx="_agreementList_1x4sq_11",Gx="_agreementItem_1x4sq_16",Zx="_warning_1x4sq_23",Xx="_buttonGroup_1x4sq_31",Yx="_buttonWrapper_1x4sq_41",Kx="_fullWidthButton_1x4sq_44",Jx="_modal_1x4sq_48",Qx="_header_1x4sq_55",Te={bottomSheet:Vx,content:Wx,agreementList:qx,agreementItem:Gx,warning:Zx,buttonGroup:Xx,buttonWrapper:Yx,fullWidthButton:Kx,modal:Jx,header:Qx},eh=({setIsOpen:e,price:n})=>{const[s,r]=_.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:i}=t.useModalStore(),o=()=>{i(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:Te.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Te.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Note"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:Te.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:Te.content,children:[t.jsxRuntimeExports.jsxs("div",{className:Te.agreementList,children:[t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToSendAsFF,onChange:a=>r({...s,agreeToSendAsFF:a})}),t.jsxRuntimeExports.jsx("p",{children:"I agree to send the payment as friends & family"})]}),t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToSend,onChange:a=>r({...s,agreeToSend:a})}),t.jsxRuntimeExports.jsxs("p",{children:["I agree to send the payment of ",t.formatPrice(n)," ",n.currency]})]}),t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToNotAddNote,onChange:a=>r({...s,agreeToNotAddNote:a})}),t.jsxRuntimeExports.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),t.jsxRuntimeExports.jsx("div",{className:Te.warning,children:t.jsxRuntimeExports.jsxs("p",{children:["Please note that you are required to send the exact payment of ",t.formatPrice(n)," ",n.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),t.jsxRuntimeExports.jsxs("div",{className:Te.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:Te.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:t.jsxRuntimeExports.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),t.jsxRuntimeExports.jsx("div",{className:Te.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!(s.agreeToSendAsFF&&s.agreeToNotAddNote&&s.agreeToSend),onClick:o,children:"Continue to Payment"})})]})]})]})},th="_chargeItemsContainer_qmv3w_4",nh="_chargeItemsInner_qmv3w_20",sh="_productsContainer_qmv3w_27",rh="_chargeHeader_qmv3w_41",oh="_chargeTitle_qmv3w_49",ih="_chargeDescription_qmv3w_55",ah="_copyButton_qmv3w_61",lh="_productsList_qmv3w_73",ch="_trackingContainer_qmv3w_81",uh="_footerContainer_qmv3w_91",Ge={chargeItemsContainer:th,chargeItemsInner:nh,productsContainer:sh,chargeHeader:rh,chargeTitle:oh,chargeDescription:ih,copyButton:ah,productsList:lh,trackingContainer:ch,footerContainer:uh},ph=({charge:e})=>{var o;const n=t.useCopy(),s=(e==null?void 0:e.price.currency)||"USD",r=new Intl.NumberFormat("en-US",{style:"currency",currency:s}),i=_.useMemo(()=>{var a;return((a=e==null?void 0:e.order)==null?void 0:a.partOrders.map(l=>{var u,p,c,m,x,d;return{id:(l==null?void 0:l.id)||0,image:l.productWithVariant.image,name:((u=l.productWithVariant)==null?void 0:u.variantName)||"",description:((p=l.productWithVariant)==null?void 0:p.description)||"",price:{quantity:l.quantity,amount:((c=l.productWithVariant)==null?void 0:c.price.amount)||0,currency:(m=l.productWithVariant)==null?void 0:m.price.currency},subscriptionSettings:(x=e.order)!=null&&x.subscriptionOrderId?(d=l.productWithVariant)==null?void 0:d.subscriptionSettings:null}}))||[]},[e]);return t.jsxRuntimeExports.jsx("div",{className:Ge.chargeItemsContainer,children:t.jsxRuntimeExports.jsxs("div",{className:Ge.chargeItemsInner,children:[t.jsxRuntimeExports.jsx(rn,{expiresAt:e==null?void 0:e.expiresAt}),t.jsxRuntimeExports.jsxs("div",{className:Ge.productsContainer,children:[(e==null?void 0:e.name)&&t.jsxRuntimeExports.jsxs("header",{className:Ge.chargeHeader,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("h1",{className:Ge.chargeTitle,children:e.name}),e.description&&t.jsxRuntimeExports.jsx("p",{className:Ge.chargeDescription,children:e.description})]}),((o=e.order)==null?void 0:o.id)&&t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",className:Ge.copyButton,onClick:()=>{var a;return n(((a=e.order)==null?void 0:a.id)||"")},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"}),"Copy Order ID"]})]}),t.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[!!i.length&&t.jsxRuntimeExports.jsx("div",{className:Ge.productsList,children:i.map(a=>t.jsxRuntimeExports.jsx(Cs,{product:a},a.id))}),t.jsxRuntimeExports.jsx(on,{formatter:r,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1})]}),t.jsxRuntimeExports.jsxs("div",{children:[e&&t.jsxRuntimeExports.jsx("div",{className:Ge.trackingContainer,children:t.jsxRuntimeExports.jsx(t.TrackPayment,{timeline:e.timeline})}),t.jsxRuntimeExports.jsx(rt,{className:Ge.footerContainer})]})]})]})})},dh="_checkoutOrderMainData_1rnwg_4",mh="_orderDetailRow_1rnwg_10",xh="_chargeIdRow_1rnwg_21",hh="_detailLabel_1rnwg_31",gh="_detailValue_1rnwg_36",fh="_chargeIdContainer_1rnwg_41",jh="_chargeId_1rnwg_21",yh="_copyIcon_1rnwg_60",Se={checkoutOrderMainData:dh,orderDetailRow:mh,chargeIdRow:xh,detailLabel:hh,detailValue:gh,chargeIdContainer:fh,chargeId:jh,copyIcon:yh},Xr=({lastUpdate:e,invoiceId:n,email:s,paymentType:r})=>{const i=t.useCopy(),[o,a]=_.useState(null),l=o==null?void 0:o.find(p=>p.name===r);_.useEffect(()=>{o||(async()=>{const c=[r],m=await t.getGatewaysDetail(c);a(m)})()},[r,o]);const u=p=>{const c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=p.getDate().toString().padStart(2,"0"),x=c[p.getMonth()],d=p.getFullYear(),g=p.getHours(),h=p.getMinutes().toString().padStart(2,"0"),S=p.getSeconds().toString().padStart(2,"0"),j=g>=12?"PM":"AM",E=(g%12||12).toString().padStart(2,"0");return`${x} ${m}, ${d} at ${E}:${h}:${S} ${j}`};return t.jsxRuntimeExports.jsxs("div",{className:Se.checkoutOrderMainData,children:[t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Last Updated"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:u(new Date(e))})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Payment Type"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:l==null?void 0:l.displayName})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Email"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:s})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.chargeIdRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Charge ID"}),t.jsxRuntimeExports.jsxs("div",{className:Se.chargeIdContainer,children:[t.jsxRuntimeExports.jsx("p",{className:Se.chargeId,children:n}),t.jsxRuntimeExports.jsx("div",{className:Se.copyIcon,onClick:()=>i(n),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})]})},_h="_bottomSheet_1yai1_1",Sh="_formContainer_1yai1_8",bh="_error_1yai1_14",Ch="_buttonGroup_1yai1_18",Eh="_buttonWrapper_1yai1_28",vh="_fullWidthButton_1yai1_31",wh="_modal_1yai1_41",kh="_header_1yai1_48",ct={bottomSheet:_h,formContainer:Sh,error:bh,buttonGroup:Ch,buttonWrapper:Eh,fullWidthButton:vh,modal:wh,header:kh},Rh=({chargeId:e,setIsOpen:n})=>{const[s,r]=_.useState(""),[i,o]=_.useState(""),{setIsOpen:a}=t.useModalStore(),l=c=>{try{return new URL(c),!0}catch{return!1}},u=async c=>{if(c.preventDefault(),!s){o("The link field cannot be empty.");return}if(!l(s)){o("Please enter a valid URL");return}await hi({url:s},e)&&(alert("CashApp successfully verified"),n(!1))},p=()=>{a(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:ct.modal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:ct.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"CashApp Verify"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsx("form",{onSubmit:u,children:t.jsxRuntimeExports.jsxs("div",{className:ct.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:ct.formContainer,children:t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx(t.Input$1,{value:s,onChange:c=>{r(c),o("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),i&&t.jsxRuntimeExports.jsx("p",{className:ct.error,children:i})]})}),t.jsxRuntimeExports.jsxs("div",{className:ct.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:ct.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:p,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:ct.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",children:"Verify"})})]})]})})]})},Nh="_container_1opbn_1",Ih="_productDetails_1opbn_8",Th="_imageContainer_1opbn_14",Ph="_image_1opbn_14",Lh="_textContainer_1opbn_32",Bh="_header_1opbn_40",Ah="_title_1opbn_46",Mh="_price_1opbn_53",$h="_badgeContainer_1opbn_57",Dh="_description_1opbn_61",Ze={container:Nh,productDetails:Ih,imageContainer:Th,image:Ph,textContainer:Lh,header:Bh,title:Ah,price:Mh,badgeContainer:$h,description:Dh};function Fh(e,n){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const Oh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zh={};function Xs(e,n){return(zh.jsx?Hh:Oh).test(e)}const Uh=/[ \t\n\f\r]/g;function Vh(e){return typeof e=="object"?e.type==="text"?Ys(e.value):!1:Ys(e)}function Ys(e){return e.replace(Uh,"")===""}class an{constructor(n,s,r){this.normal=s,this.property=n,r&&(this.space=r)}}an.prototype.normal={};an.prototype.property={};an.prototype.space=void 0;function Yr(e,n){const s={},r={};for(const i of e)Object.assign(s,i.property),Object.assign(r,i.normal);return new an(s,r,n)}function ms(e){return e.toLowerCase()}class we{constructor(n,s){this.attribute=s,this.property=n}}we.prototype.attribute="";we.prototype.booleanish=!1;we.prototype.boolean=!1;we.prototype.commaOrSpaceSeparated=!1;we.prototype.commaSeparated=!1;we.prototype.defined=!1;we.prototype.mustUseProperty=!1;we.prototype.number=!1;we.prototype.overloadedBoolean=!1;we.prototype.property="";we.prototype.spaceSeparated=!1;we.prototype.space=void 0;let Wh=0;const X=vt(),de=vt(),Kr=vt(),k=vt(),le=vt(),Pt=vt(),Re=vt();function vt(){return 2**++Wh}const xs=Object.freeze(Object.defineProperty({__proto__:null,boolean:X,booleanish:de,commaOrSpaceSeparated:Re,commaSeparated:Pt,number:k,overloadedBoolean:Kr,spaceSeparated:le},Symbol.toStringTag,{value:"Module"})),Kn=Object.keys(xs);class Es extends we{constructor(n,s,r,i){let o=-1;if(super(n,s),Ks(this,"space",i),typeof r=="number")for(;++o<Kn.length;){const a=Kn[o];Ks(this,Kn[o],(r&xs[a])===xs[a])}}}Es.prototype.defined=!0;function Ks(e,n,s){s&&(e[n]=s)}function At(e){const n={},s={};for(const[r,i]of Object.entries(e.properties)){const o=new Es(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,s[ms(r)]=r,s[ms(o.attribute)]=r}return new an(n,s,e.space)}const Jr=At({properties:{ariaActiveDescendant:null,ariaAtomic:de,ariaAutoComplete:null,ariaBusy:de,ariaChecked:de,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:le,ariaCurrent:null,ariaDescribedBy:le,ariaDetails:null,ariaDisabled:de,ariaDropEffect:le,ariaErrorMessage:null,ariaExpanded:de,ariaFlowTo:le,ariaGrabbed:de,ariaHasPopup:null,ariaHidden:de,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:le,ariaLevel:k,ariaLive:null,ariaModal:de,ariaMultiLine:de,ariaMultiSelectable:de,ariaOrientation:null,ariaOwns:le,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:de,ariaReadOnly:de,ariaRelevant:null,ariaRequired:de,ariaRoleDescription:le,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:de,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Qr(e,n){return n in e?e[n]:n}function eo(e,n){return Qr(e,n.toLowerCase())}const qh=At({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pt,acceptCharset:le,accessKey:le,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:le,autoFocus:X,autoPlay:X,blocking:le,capture:null,charSet:null,checked:X,cite:null,className:le,cols:k,colSpan:null,content:null,contentEditable:de,controls:X,controlsList:le,coords:k|Pt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:Kr,draggable:de,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:le,height:k,hidden:X,high:k,href:null,hrefLang:null,htmlFor:le,httpEquiv:le,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:le,itemRef:le,itemScope:X,itemType:le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:k,pattern:null,ping:le,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:le,required:X,reversed:X,rows:k,rowSpan:k,sandbox:le,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:de,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:de,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:le,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:de,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:eo}),Gh=At({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Re,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pt,g2:Pt,glyphName:Pt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:Re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Re,rev:Re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Re,requiredFeatures:Re,requiredFonts:Re,requiredFormats:Re,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:Re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Re,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Qr}),to=At({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),no=At({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eo}),so=At({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Zh={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xh=/[A-Z]/g,Js=/-[a-z]/g,Yh=/^data[-\w.:]+$/i;function Kh(e,n){const s=ms(n);let r=n,i=we;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&Yh.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Js,Qh);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Js.test(o)){let a=o.replace(Xh,Jh);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=Es}return new i(r,n)}function Jh(e){return"-"+e.toLowerCase()}function Qh(e){return e.charAt(1).toUpperCase()}const eg=Yr([Jr,qh,to,no,so],"html"),vs=Yr([Jr,Gh,to,no,so],"svg");function tg(e){return e.join(" ").trim()}var ro={},Qs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ng=/\n/g,sg=/^\s*/,rg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,og=/^:\s*/,ig=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ag=/^[;\s]*/,lg=/^\s+|\s+$/g,cg=`
103
- `,er="/",tr="*",Et="",ug="comment",pg="declaration",dg=function(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var s=1,r=1;function i(g){var h=g.match(ng);h&&(s+=h.length);var S=g.lastIndexOf(cg);r=~S?g.length-S:r+g.length}function o(){var g={line:s,column:r};return function(h){return h.position=new a(g),p(),h}}function a(g){this.start=g,this.end={line:s,column:r},this.source=n.source}a.prototype.content=e;function l(g){var h=new Error(n.source+":"+s+":"+r+": "+g);if(h.reason=g,h.filename=n.source,h.line=s,h.column=r,h.source=e,!n.silent)throw h}function u(g){var h=g.exec(e);if(h){var S=h[0];return i(S),e=e.slice(S.length),h}}function p(){u(sg)}function c(g){var h;for(g=g||[];h=m();)h!==!1&&g.push(h);return g}function m(){var g=o();if(!(er!=e.charAt(0)||tr!=e.charAt(1))){for(var h=2;Et!=e.charAt(h)&&(tr!=e.charAt(h)||er!=e.charAt(h+1));)++h;if(h+=2,Et===e.charAt(h-1))return l("End of comment missing");var S=e.slice(2,h-2);return r+=2,i(S),e=e.slice(h),r+=2,g({type:ug,comment:S})}}function x(){var g=o(),h=u(rg);if(h){if(m(),!u(og))return l("property missing ':'");var S=u(ig),j=g({type:pg,property:nr(h[0].replace(Qs,Et)),value:S?nr(S[0].replace(Qs,Et)):Et});return u(ag),j}}function d(){var g=[];c(g);for(var h;h=x();)h!==!1&&(g.push(h),c(g));return g}return p(),d()};function nr(e){return e?e.replace(lg,Et):Et}var mg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ro,"__esModule",{value:!0});var sr=ro.default=hg,xg=mg(dg);function hg(e,n){var s=null;if(!e||typeof e!="string")return s;var r=(0,xg.default)(e),i=typeof n=="function";return r.forEach(function(o){if(o.type==="declaration"){var a=o.property,l=o.value;i?n(a,l,o):l&&(s=s||{},s[a]=l)}}),s}const gg=sr.default||sr,oo=io("end"),ws=io("start");function io(e){return n;function n(s){const r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fg(e){const n=ws(e),s=oo(e);if(n&&s)return{start:n,end:s}}function Kt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rr(e.position):"start"in e||"end"in e?rr(e):"line"in e||"column"in e?hs(e):""}function hs(e){return or(e&&e.line)+":"+or(e&&e.column)}function rr(e){return hs(e&&e.start)+"-"+hs(e&&e.end)}function or(e){return e&&typeof e=="number"?e:1}class _e extends Error{constructor(n,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let i="",o={},a=!1;if(s&&("line"in s&&"column"in s?o={place:s}:"start"in s&&"end"in s?o={place:s}:"type"in s?o={ancestors:[s],place:s.position}:o={...s}),typeof n=="string"?i=n:!o.cause&&n&&(a=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=Kt(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}_e.prototype.file="";_e.prototype.name="";_e.prototype.reason="";_e.prototype.message="";_e.prototype.stack="";_e.prototype.column=void 0;_e.prototype.line=void 0;_e.prototype.ancestors=void 0;_e.prototype.cause=void 0;_e.prototype.fatal=void 0;_e.prototype.place=void 0;_e.prototype.ruleId=void 0;_e.prototype.source=void 0;const ks={}.hasOwnProperty,jg=new Map,yg=/[A-Z]/g,_g=/-([a-z])/g,Sg=new Set(["table","tbody","thead","tfoot","tr"]),bg=new Set(["td","th"]),ao="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cg(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Tg(s,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ig(s,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?vs:eg,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=lo(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function lo(e,n,s){if(n.type==="element")return Eg(e,n,s);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return vg(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return kg(e,n,s);if(n.type==="mdxjsEsm")return wg(e,n);if(n.type==="root")return Rg(e,n,s);if(n.type==="text")return Ng(e,n)}function Eg(e,n,s){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vs,e.schema=i),e.ancestors.push(n);const o=uo(e,n.tagName,!1),a=Pg(e,n);let l=Ns(e,n);return Sg.has(n.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vh(u):!0})),co(e,a,o,n),Rs(a,l),e.ancestors.pop(),e.schema=r,e.create(n,o,a,s)}function vg(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tn(e,n.position)}function wg(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);tn(e,n.position)}function kg(e,n,s){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=vs,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:uo(e,n.name,!0),a=Lg(e,n),l=Ns(e,n);return co(e,a,o,n),Rs(a,l),e.ancestors.pop(),e.schema=r,e.create(n,o,a,s)}function Rg(e,n,s){const r={};return Rs(r,Ns(e,n)),e.create(n,e.Fragment,r,s)}function Ng(e,n){return n.value}function co(e,n,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(n.node=r)}function Rs(e,n){if(n.length>0){const s=n.length>1?n:n[0];s&&(e.children=s)}}function Ig(e,n,s){return r;function r(i,o,a,l){const p=Array.isArray(a.children)?s:n;return l?p(o,a,l):p(o,a)}}function Tg(e,n){return s;function s(r,i,o,a){const l=Array.isArray(o.children),u=ws(r);return n(i,o,a,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Pg(e,n){const s={};let r,i;for(i in n.properties)if(i!=="children"&&ks.call(n.properties,i)){const o=Bg(e,i,n.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&bg.has(n.tagName)?r=l:s[a]=l}}if(r){const o=s.style||(s.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function Lg(e,n){const s={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const l=a.properties[0];l.type,Object.assign(s,e.evaluater.evaluateExpression(l.argument))}else tn(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else tn(e,n.position);else o=r.value===null?!0:r.value;s[i]=o}return s}function Ns(e,n){const s=[];let r=-1;const i=e.passKeys?new Map:jg;for(;++r<n.children.length;){const o=n.children[r];let a;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const p=i.get(u)||0;a=u+"-"+p,i.set(u,p+1)}}const l=lo(e,o,a);l!==void 0&&s.push(l)}return s}function Bg(e,n,s){const r=Kh(e.schema,n);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?Fh(s):tg(s)),r.property==="style"){let i=typeof s=="object"?s:Ag(e,String(s));return e.stylePropertyNameCase==="css"&&(i=Mg(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Zh[r.property]||r.property:r.attribute,s]}}function Ag(e,n){const s={};try{gg(n,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,a=new _e("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=ao+"#cannot-parse-style-attribute",a}}return s;function r(i,o){let a=i;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(_g,Dg)),s[a]=o}}function uo(e,n,s){let r;if(!s)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,a;for(;++o<i.length;){const l=Xs(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=a}else r=Xs(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return ks.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tn(e)}function tn(e,n){const s=new _e("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=ao+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Mg(e){const n={};let s;for(s in e)ks.call(e,s)&&(n[$g(s)]=e[s]);return n}function $g(e){let n=e.replace(yg,Fg);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Dg(e,n){return n.toUpperCase()}function Fg(e){return"-"+e.toLowerCase()}const Jn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Og={};function Hg(e,n){const s=Og,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,i=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return po(e,r,i)}function po(e,n,s){if(zg(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ir(e.children,n,s)}return Array.isArray(e)?ir(e,n,s):""}function ir(e,n,s){const r=[];let i=-1;for(;++i<e.length;)r[i]=po(e[i],n,s);return r.join("")}function zg(e){return!!(e&&typeof e=="object")}const ar=document.createElement("i");function Is(e){const n="&"+e+";";ar.innerHTML=n;const s=ar.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===n?!1:s}function Ke(e,n,s,r){const i=e.length;let o=0,a;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,s=s>0?s:0,r.length<1e4)a=Array.from(r),a.unshift(n,s),e.splice(...a);else for(s&&e.splice(n,s);o<r.length;)a=r.slice(o,o+1e4),a.unshift(n,0),e.splice(...a),o+=1e4,n+=1e4}function Le(e,n){return e.length>0?(Ke(e,e.length,0,n),e):n}const lr={}.hasOwnProperty;function Ug(e){const n={};let s=-1;for(;++s<e.length;)Vg(n,e[s]);return n}function Vg(e,n){let s;for(s in n){const i=(lr.call(e,s)?e[s]:void 0)||(e[s]={}),o=n[s];let a;if(o)for(a in o){lr.call(i,a)||(i[a]=[]);const l=o[a];Wg(i[a],Array.isArray(l)?l:l?[l]:[])}}}function Wg(e,n){let s=-1;const r=[];for(;++s<n.length;)(n[s].add==="after"?e:r).push(n[s]);Ke(e,0,0,r)}function mo(e,n){const s=Number.parseInt(e,n);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Lt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ye=xt(/[A-Za-z]/),Ne=xt(/[\dA-Za-z]/),qg=xt(/[#-'*+\--9=?A-Z^-~]/);function gs(e){return e!==null&&(e<32||e===127)}const fs=xt(/\d/),Gg=xt(/[\dA-Fa-f]/),Zg=xt(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function ve(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const Xg=xt(new RegExp("\\p{P}|\\p{S}","u")),Yg=xt(/\s/);function xt(e){return n;function n(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function Mt(e){const n=[];let s=-1,r=0,i=0;for(;++s<e.length;){const o=e.charCodeAt(s);let a="";if(o===37&&Ne(e.charCodeAt(s+1))&&Ne(e.charCodeAt(s+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(s+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),i=1):a="�"}else a=String.fromCharCode(o);a&&(n.push(e.slice(r,s),encodeURIComponent(a)),r=s+i+1,a=""),i&&(s+=i,i=0)}return n.join("")+e.slice(r)}function ce(e,n,s,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(u){return re(u)?(e.enter(s),l(u)):n(u)}function l(u){return re(u)&&o++<i?(e.consume(u),l):(e.exit(s),n(u))}}const Kg={tokenize:Jg};function Jg(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let s;return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ce(e,n,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=u),s=u,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return U(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),a)}}const Qg={tokenize:ef},cr={tokenize:tf};function ef(e){const n=this,s=[];let r=0,i,o,a;return l;function l(C){if(r<s.length){const N=s[r];return n.containerState=N[1],e.attempt(N[0].continuation,u,p)(C)}return p(C)}function u(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const N=n.events.length;let w=N,b;for(;w--;)if(n.events[w][0]==="exit"&&n.events[w][1].type==="chunkFlow"){b=n.events[w][1].end;break}j(r);let A=N;for(;A<n.events.length;)n.events[A][1].end={...b},A++;return Ke(n.events,w+1,0,n.events.slice(N)),n.events.length=A,p(C)}return l(C)}function p(C){if(r===s.length){if(!i)return x(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(cr,c,m)(C)}function c(C){return i&&E(),j(r),x(C)}function m(C){return n.parser.lazy[n.now().line]=r!==s.length,a=n.now().offset,g(C)}function x(C){return n.containerState={},e.attempt(cr,d,g)(C)}function d(C){return r++,s.push([n.currentConstruct,n.containerState]),x(C)}function g(C){if(C===null){i&&E(),j(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(C)}function h(C){if(C===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(C);return}return U(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,n.interrupt=void 0,l):(e.consume(C),h)}function S(C,N){const w=n.sliceStream(C);if(N&&w.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(w),n.parser.lazy[C.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<a&&(!i.events[b][1].end||i.events[b][1].end.offset>a))return;const A=n.events.length;let $=A,z,V;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(z){V=n.events[$][1].end;break}z=!0}for(j(r),b=A;b<n.events.length;)n.events[b][1].end={...V},b++;Ke(n.events,$+1,0,n.events.slice(A)),n.events.length=b}}function j(C){let N=s.length;for(;N-- >C;){const w=s[N];n.containerState=w[1],w[0].exit.call(n,e)}s.length=C}function E(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function tf(e,n,s){return ce(e,e.attempt(this.parser.constructs.document,n,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ur(e){if(e===null||ve(e)||Yg(e))return 1;if(Xg(e))return 2}function Ts(e,n,s){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,s),r.push(o))}return n}const js={name:"attention",resolveAll:nf,tokenize:sf};function nf(e,n){let s=-1,r,i,o,a,l,u,p,c;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const m={...e[r][1].end},x={...e[s][1].start};pr(m,-u),pr(x,u),a={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:x},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[r][1].end={...a.start},e[s][1].start={...l.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Le(p,[["enter",e[r][1],n],["exit",e[r][1],n]])),p=Le(p,[["enter",i,n],["enter",a,n],["exit",a,n],["enter",o,n]]),p=Le(p,Ts(n.parser.constructs.insideSpan.null,e.slice(r+1,s),n)),p=Le(p,[["exit",o,n],["enter",l,n],["exit",l,n],["exit",i,n]]),e[s][1].end.offset-e[s][1].start.offset?(c=2,p=Le(p,[["enter",e[s][1],n],["exit",e[s][1],n]])):c=0,Ke(e,r-1,s-r+3,p),s=r+p.length-c-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function sf(e,n){const s=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ur(r);let o;return a;function a(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const p=e.exit("attentionSequence"),c=ur(u),m=!c||c===2&&i||s.includes(u),x=!i||i===2&&c||s.includes(r);return p._open=!!(o===42?m:m&&(i||!x)),p._close=!!(o===42?x:x&&(c||!m)),n(u)}}function pr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const rf={name:"autolink",tokenize:of};function of(e,n,s){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return Ye(d)?(e.consume(d),a):d===64?s(d):p(d)}function a(d){return d===43||d===45||d===46||Ne(d)?(r=1,l(d)):p(d)}function l(d){return d===58?(e.consume(d),r=0,u):(d===43||d===45||d===46||Ne(d))&&r++<32?(e.consume(d),l):(r=0,p(d))}function u(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),n):d===null||d===32||d===60||gs(d)?s(d):(e.consume(d),u)}function p(d){return d===64?(e.consume(d),c):qg(d)?(e.consume(d),p):s(d)}function c(d){return Ne(d)?m(d):s(d)}function m(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),n):x(d)}function x(d){if((d===45||Ne(d))&&r++<63){const g=d===45?x:m;return e.consume(d),g}return s(d)}}const Ln={partial:!0,tokenize:af};function af(e,n,s){return r;function r(o){return re(o)?ce(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||U(o)?n(o):s(o)}}const xo={continuation:{tokenize:cf},exit:uf,name:"blockQuote",tokenize:lf};function lf(e,n,s){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return s(a)}function o(a){return re(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(a))}}function cf(e,n,s){const r=this;return i;function i(a){return re(a)?ce(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(xo,n,s)(a)}}function uf(e){e.exit("blockQuote")}const ho={name:"characterEscape",tokenize:pf};function pf(e,n,s){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Zg(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):s(o)}}const go={name:"characterReference",tokenize:df};function df(e,n,s){const r=this;let i=0,o,a;return l;function l(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),u}function u(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,a=Ne,c(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Gg,c):(e.enter("characterReferenceValue"),o=7,a=fs,c(m))}function c(m){if(m===59&&i){const x=e.exit("characterReferenceValue");return a===Ne&&!Is(r.sliceSerialize(x))?s(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return a(m)&&i++<o?(e.consume(m),c):s(m)}}const dr={partial:!0,tokenize:xf},mr={concrete:!0,name:"codeFenced",tokenize:mf};function mf(e,n,s){const r=this,i={partial:!0,tokenize:w};let o=0,a=0,l;return u;function u(b){return p(b)}function p(b){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(b)}function c(b){return b===l?(a++,e.consume(b),c):a<3?s(b):(e.exit("codeFencedFenceSequence"),re(b)?ce(e,m,"whitespace")(b):m(b))}function m(b){return b===null||U(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(dr,h,N)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||U(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(b)):re(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ce(e,d,"whitespace")(b)):b===96&&b===l?s(b):(e.consume(b),x)}function d(b){return b===null||U(b)?m(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||U(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(b)):b===96&&b===l?s(b):(e.consume(b),g)}function h(b){return e.attempt(i,N,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),j}function j(b){return o>0&&re(b)?ce(e,E,"linePrefix",o+1)(b):E(b)}function E(b){return b===null||U(b)?e.check(dr,h,N)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||U(b)?(e.exit("codeFlowValue"),E(b)):(e.consume(b),C)}function N(b){return e.exit("codeFenced"),n(b)}function w(b,A,$){let z=0;return V;function V(P){return b.enter("lineEnding"),b.consume(P),b.exit("lineEnding"),B}function B(P){return b.enter("codeFencedFence"),re(P)?ce(b,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):R(P)}function R(P){return P===l?(b.enter("codeFencedFenceSequence"),I(P)):$(P)}function I(P){return P===l?(z++,b.consume(P),I):z>=a?(b.exit("codeFencedFenceSequence"),re(P)?ce(b,M,"whitespace")(P):M(P)):$(P)}function M(P){return P===null||U(P)?(b.exit("codeFencedFence"),A(P)):$(P)}}}function xf(e,n,s){const r=this;return i;function i(a){return a===null?s(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?s(a):n(a)}}const Qn={name:"codeIndented",tokenize:gf},hf={partial:!0,tokenize:ff};function gf(e,n,s){const r=this;return i;function i(p){return e.enter("codeIndented"),ce(e,o,"linePrefix",5)(p)}function o(p){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(p):s(p)}function a(p){return p===null?u(p):U(p)?e.attempt(hf,a,u)(p):(e.enter("codeFlowValue"),l(p))}function l(p){return p===null||U(p)?(e.exit("codeFlowValue"),a(p)):(e.consume(p),l)}function u(p){return e.exit("codeIndented"),n(p)}}function ff(e,n,s){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?s(a):U(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ce(e,o,"linePrefix",5)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(a):U(a)?i(a):s(a)}}const jf={name:"codeText",previous:_f,resolve:yf,tokenize:Sf};function yf(e){let n=e.length-4,s=3,r,i;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=s;++r<n;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(r=s-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function _f(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sf(e,n,s){let r=0,i,o;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),r++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?s(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(o=e.enter("codeTextSequence"),i=0,c(m)):U(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),p(m))}function p(m){return m===null||m===32||m===96||U(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),p)}function c(m){return m===96?(e.consume(m),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",p(m))}}class bf{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,s){const r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,s,r){const i=s||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),qt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),qt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const s=this.left.splice(n,Number.POSITIVE_INFINITY);qt(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);qt(this.left,s.reverse())}}}function qt(e,n){let s=0;if(n.length<1e4)e.push(...n);else for(;s<n.length;)e.push(...n.slice(s,s+1e4)),s+=1e4}function fo(e){const n={};let s=-1,r,i,o,a,l,u,p;const c=new bf(e);for(;++s<c.length;){for(;s in n;)s=n[s];if(r=c.get(s),s&&r[1].type==="chunkFlow"&&c.get(s-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Cf(c,s)),s=n[s],p=!0);else if(r[1]._container){for(o=s,i=void 0;o--;)if(a=c.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},l=c.slice(i,s),l.unshift(r),c.splice(i,s-i+1,l))}}return Ke(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!p}function Cf(e,n){const s=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let a=s._tokenizer;a||(a=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,u=[],p={};let c,m,x=-1,d=s,g=0,h=0;const S=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),m&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=d,d=d.next}for(d=s;++x<l.length;)l[x][0]==="exit"&&l[x-1][0]==="enter"&&l[x][1].type===l[x-1][1].type&&l[x][1].start.line!==l[x][1].end.line&&(h=x+1,S.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):S.pop(),x=S.length;x--;){const j=l.slice(S[x],S[x+1]),E=o.pop();u.push([E,E+j.length-1]),e.splice(E,2,j)}for(u.reverse(),x=-1;++x<u.length;)p[g+u[x][0]]=g+u[x][1],g+=u[x][1]-u[x][0]-1;return p}const Ef={resolve:wf,tokenize:kf},vf={partial:!0,tokenize:Rf};function wf(e){return fo(e),e}function kf(e,n){let s;return r;function r(l){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):U(l)?e.check(vf,a,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),n(l)}function a(l){return e.consume(l),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,i}}function Rf(e,n,s){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ce(e,o,"linePrefix")}function o(a){if(a===null||U(a))return s(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(a):e.interrupt(r.parser.constructs.flow,s,n)(a)}}function jo(e,n,s,r,i,o,a,l,u){const p=u||Number.POSITIVE_INFINITY;let c=0;return m;function m(j){return j===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(j),e.exit(o),x):j===null||j===32||j===41||gs(j)?s(j):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(j))}function x(j){return j===62?(e.enter(o),e.consume(j),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(l),e.enter("chunkString",{contentType:"string"}),d(j))}function d(j){return j===62?(e.exit("chunkString"),e.exit(l),x(j)):j===null||j===60||U(j)?s(j):(e.consume(j),j===92?g:d)}function g(j){return j===60||j===62||j===92?(e.consume(j),d):d(j)}function h(j){return!c&&(j===null||j===41||ve(j))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),n(j)):c<p&&j===40?(e.consume(j),c++,h):j===41?(e.consume(j),c--,h):j===null||j===32||j===40||gs(j)?s(j):(e.consume(j),j===92?S:h)}function S(j){return j===40||j===41||j===92?(e.consume(j),h):h(j)}}function yo(e,n,s,r,i,o){const a=this;let l=0,u;return p;function p(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),c}function c(d){return l>999||d===null||d===91||d===93&&!u||d===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?s(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):U(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),m(d))}function m(d){return d===null||d===91||d===93||U(d)||l++>999?(e.exit("chunkString"),c(d)):(e.consume(d),u||(u=!re(d)),d===92?x:m)}function x(d){return d===91||d===92||d===93?(e.consume(d),l++,m):m(d)}}function _o(e,n,s,r,i,o){let a;return l;function l(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),a=x===40?41:x,u):s(x)}function u(x){return x===a?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),n):(e.enter(o),p(x))}function p(x){return x===a?(e.exit(o),u(a)):x===null?s(x):U(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ce(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===a||x===null||U(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?m:c)}function m(x){return x===a||x===92?(e.consume(x),c):c(x)}}function Jt(e,n){let s;return r;function r(i){return U(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s=!0,r):re(i)?ce(e,r,s?"linePrefix":"lineSuffix")(i):n(i)}}const Nf={name:"definition",tokenize:Tf},If={partial:!0,tokenize:Pf};function Tf(e,n,s){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return yo.call(r,e,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function l(d){return i=Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),u):s(d)}function u(d){return ve(d)?Jt(e,p)(d):p(d)}function p(d){return jo(e,c,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(If,m,m)(d)}function m(d){return re(d)?ce(e,x,"whitespace")(d):x(d)}function x(d){return d===null||U(d)?(e.exit("definition"),r.parser.defined.push(i),n(d)):s(d)}}function Pf(e,n,s){return r;function r(l){return ve(l)?Jt(e,i)(l):s(l)}function i(l){return _o(e,o,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return re(l)?ce(e,a,"whitespace")(l):a(l)}function a(l){return l===null||U(l)?n(l):s(l)}}const Lf={name:"hardBreakEscape",tokenize:Bf};function Bf(e,n,s){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return U(o)?(e.exit("hardBreakEscape"),n(o)):s(o)}}const Af={name:"headingAtx",resolve:Mf,tokenize:$f};function Mf(e,n){let s=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},o={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},Ke(e,r,s-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function $f(e,n,s){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||ve(c)?(e.exit("atxHeadingSequence"),l(c)):s(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||U(c)?(e.exit("atxHeading"),n(c)):re(c)?ce(e,l,"whitespace")(c):(e.enter("atxHeadingText"),p(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),l(c))}function p(c){return c===null||c===35||ve(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),p)}}const Df=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xr=["pre","script","style","textarea"],Ff={concrete:!0,name:"htmlFlow",resolveTo:zf,tokenize:Uf},Of={partial:!0,tokenize:Wf},Hf={partial:!0,tokenize:Vf};function zf(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Uf(e,n,s){const r=this;let i,o,a,l,u;return p;function p(y){return c(y)}function c(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),m}function m(y){return y===33?(e.consume(y),x):y===47?(e.consume(y),o=!0,h):y===63?(e.consume(y),i=3,r.interrupt?n:f):Ye(y)?(e.consume(y),a=String.fromCharCode(y),S):s(y)}function x(y){return y===45?(e.consume(y),i=2,d):y===91?(e.consume(y),i=5,l=0,g):Ye(y)?(e.consume(y),i=4,r.interrupt?n:f):s(y)}function d(y){return y===45?(e.consume(y),r.interrupt?n:f):s(y)}function g(y){const Q="CDATA[";return y===Q.charCodeAt(l++)?(e.consume(y),l===Q.length?r.interrupt?n:R:g):s(y)}function h(y){return Ye(y)?(e.consume(y),a=String.fromCharCode(y),S):s(y)}function S(y){if(y===null||y===47||y===62||ve(y)){const Q=y===47,ge=a.toLowerCase();return!Q&&!o&&xr.includes(ge)?(i=1,r.interrupt?n(y):R(y)):Df.includes(a.toLowerCase())?(i=6,Q?(e.consume(y),j):r.interrupt?n(y):R(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(y):o?E(y):C(y))}return y===45||Ne(y)?(e.consume(y),a+=String.fromCharCode(y),S):s(y)}function j(y){return y===62?(e.consume(y),r.interrupt?n:R):s(y)}function E(y){return re(y)?(e.consume(y),E):V(y)}function C(y){return y===47?(e.consume(y),V):y===58||y===95||Ye(y)?(e.consume(y),N):re(y)?(e.consume(y),C):V(y)}function N(y){return y===45||y===46||y===58||y===95||Ne(y)?(e.consume(y),N):w(y)}function w(y){return y===61?(e.consume(y),b):re(y)?(e.consume(y),w):C(y)}function b(y){return y===null||y===60||y===61||y===62||y===96?s(y):y===34||y===39?(e.consume(y),u=y,A):re(y)?(e.consume(y),b):$(y)}function A(y){return y===u?(e.consume(y),u=null,z):y===null||U(y)?s(y):(e.consume(y),A)}function $(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||ve(y)?w(y):(e.consume(y),$)}function z(y){return y===47||y===62||re(y)?C(y):s(y)}function V(y){return y===62?(e.consume(y),B):s(y)}function B(y){return y===null||U(y)?R(y):re(y)?(e.consume(y),B):s(y)}function R(y){return y===45&&i===2?(e.consume(y),O):y===60&&i===1?(e.consume(y),D):y===62&&i===4?(e.consume(y),se):y===63&&i===3?(e.consume(y),f):y===93&&i===5?(e.consume(y),H):U(y)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Of,he,I)(y)):y===null||U(y)?(e.exit("htmlFlowData"),I(y)):(e.consume(y),R)}function I(y){return e.check(Hf,M,he)(y)}function M(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),P}function P(y){return y===null||U(y)?I(y):(e.enter("htmlFlowData"),R(y))}function O(y){return y===45?(e.consume(y),f):R(y)}function D(y){return y===47?(e.consume(y),a="",L):R(y)}function L(y){if(y===62){const Q=a.toLowerCase();return xr.includes(Q)?(e.consume(y),se):R(y)}return Ye(y)&&a.length<8?(e.consume(y),a+=String.fromCharCode(y),L):R(y)}function H(y){return y===93?(e.consume(y),f):R(y)}function f(y){return y===62?(e.consume(y),se):y===45&&i===2?(e.consume(y),f):R(y)}function se(y){return y===null||U(y)?(e.exit("htmlFlowData"),he(y)):(e.consume(y),se)}function he(y){return e.exit("htmlFlow"),n(y)}}function Vf(e,n,s){const r=this;return i;function i(a){return U(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):s(a)}function o(a){return r.parser.lazy[r.now().line]?s(a):n(a)}}function Wf(e,n,s){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ln,n,s)}}const qf={name:"htmlText",tokenize:Gf};function Gf(e,n,s){const r=this;let i,o,a;return l;function l(f){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(f),u}function u(f){return f===33?(e.consume(f),p):f===47?(e.consume(f),w):f===63?(e.consume(f),C):Ye(f)?(e.consume(f),$):s(f)}function p(f){return f===45?(e.consume(f),c):f===91?(e.consume(f),o=0,g):Ye(f)?(e.consume(f),E):s(f)}function c(f){return f===45?(e.consume(f),d):s(f)}function m(f){return f===null?s(f):f===45?(e.consume(f),x):U(f)?(a=m,D(f)):(e.consume(f),m)}function x(f){return f===45?(e.consume(f),d):m(f)}function d(f){return f===62?O(f):f===45?x(f):m(f)}function g(f){const se="CDATA[";return f===se.charCodeAt(o++)?(e.consume(f),o===se.length?h:g):s(f)}function h(f){return f===null?s(f):f===93?(e.consume(f),S):U(f)?(a=h,D(f)):(e.consume(f),h)}function S(f){return f===93?(e.consume(f),j):h(f)}function j(f){return f===62?O(f):f===93?(e.consume(f),j):h(f)}function E(f){return f===null||f===62?O(f):U(f)?(a=E,D(f)):(e.consume(f),E)}function C(f){return f===null?s(f):f===63?(e.consume(f),N):U(f)?(a=C,D(f)):(e.consume(f),C)}function N(f){return f===62?O(f):C(f)}function w(f){return Ye(f)?(e.consume(f),b):s(f)}function b(f){return f===45||Ne(f)?(e.consume(f),b):A(f)}function A(f){return U(f)?(a=A,D(f)):re(f)?(e.consume(f),A):O(f)}function $(f){return f===45||Ne(f)?(e.consume(f),$):f===47||f===62||ve(f)?z(f):s(f)}function z(f){return f===47?(e.consume(f),O):f===58||f===95||Ye(f)?(e.consume(f),V):U(f)?(a=z,D(f)):re(f)?(e.consume(f),z):O(f)}function V(f){return f===45||f===46||f===58||f===95||Ne(f)?(e.consume(f),V):B(f)}function B(f){return f===61?(e.consume(f),R):U(f)?(a=B,D(f)):re(f)?(e.consume(f),B):z(f)}function R(f){return f===null||f===60||f===61||f===62||f===96?s(f):f===34||f===39?(e.consume(f),i=f,I):U(f)?(a=R,D(f)):re(f)?(e.consume(f),R):(e.consume(f),M)}function I(f){return f===i?(e.consume(f),i=void 0,P):f===null?s(f):U(f)?(a=I,D(f)):(e.consume(f),I)}function M(f){return f===null||f===34||f===39||f===60||f===61||f===96?s(f):f===47||f===62||ve(f)?z(f):(e.consume(f),M)}function P(f){return f===47||f===62||ve(f)?z(f):s(f)}function O(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),n):s(f)}function D(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),L}function L(f){return re(f)?ce(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):H(f)}function H(f){return e.enter("htmlTextData"),a(f)}}const Ps={name:"labelEnd",resolveAll:Kf,resolveTo:Jf,tokenize:Qf},Zf={tokenize:e2},Xf={tokenize:t2},Yf={tokenize:n2};function Kf(e){let n=-1;const s=[];for(;++n<e.length;){const r=e[n][1];if(s.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==s.length&&Ke(e,0,e.length,s),e}function Jf(e,n){let s=e.length,r=0,i,o,a,l;for(;s--;)if(i=e[s][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[s][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[s][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=s,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=s);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",u,n],["enter",p,n]],l=Le(l,e.slice(o+1,o+r+3)),l=Le(l,[["enter",c,n]]),l=Le(l,Ts(n.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),n)),l=Le(l,[["exit",c,n],e[a-2],e[a-1],["exit",p,n]]),l=Le(l,e.slice(a+1)),l=Le(l,[["exit",u,n]]),Ke(e,o,e.length,l),e}function Qf(e,n,s){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(x){return o?o._inactive?m(x):(a=r.parser.defined.includes(Lt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),u):s(x)}function u(x){return x===40?e.attempt(Zf,c,a?c:m)(x):x===91?e.attempt(Xf,c,a?p:m)(x):a?c(x):m(x)}function p(x){return e.attempt(Yf,c,m)(x)}function c(x){return n(x)}function m(x){return o._balanced=!0,s(x)}}function e2(e,n,s){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return ve(m)?Jt(e,o)(m):o(m)}function o(m){return m===41?c(m):jo(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return ve(m)?Jt(e,u)(m):c(m)}function l(m){return s(m)}function u(m){return m===34||m===39||m===40?_o(e,p,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):c(m)}function p(m){return ve(m)?Jt(e,c)(m):c(m)}function c(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):s(m)}}function t2(e,n,s){const r=this;return i;function i(l){return yo.call(r,e,o,a,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(l):s(l)}function a(l){return s(l)}}function n2(e,n,s){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):s(o)}}const s2={name:"labelStartImage",resolveAll:Ps.resolveAll,tokenize:r2};function r2(e,n,s){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):s(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(l):n(l)}}const o2={name:"labelStartLink",resolveAll:Ps.resolveAll,tokenize:i2};function i2(e,n,s){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(a):n(a)}}const es={name:"lineEnding",tokenize:a2};function a2(e,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ce(e,n,"linePrefix")}}const kn={name:"thematicBreak",tokenize:l2};function l2(e,n,s){let r=0,i;return o;function o(p){return e.enter("thematicBreak"),a(p)}function a(p){return i=p,l(p)}function l(p){return p===i?(e.enter("thematicBreakSequence"),u(p)):r>=3&&(p===null||U(p))?(e.exit("thematicBreak"),n(p)):s(p)}function u(p){return p===i?(e.consume(p),r++,u):(e.exit("thematicBreakSequence"),re(p)?ce(e,l,"whitespace")(p):l(p))}}const Ee={continuation:{tokenize:d2},exit:x2,name:"list",tokenize:p2},c2={partial:!0,tokenize:h2},u2={partial:!0,tokenize:m2};function p2(e,n,s){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:fs(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(kn,s,p)(d):p(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(d)}return s(d)}function u(d){return fs(d)&&++a<10?(e.consume(d),u):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),p(d)):s(d)}function p(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Ln,r.interrupt?s:c,e.attempt(c2,x,m))}function c(d){return r.containerState.initialBlankLine=!0,o++,x(d)}function m(d){return re(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),x):s(d)}function x(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(d)}}function d2(e,n,s){const r=this;return r.containerState._closeFlow=void 0,e.check(Ln,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,n,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!re(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(u2,n,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(Ee,n,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function m2(e,n,s){const r=this;return ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(o):s(o)}}function x2(e){e.exit(this.containerState.type)}function h2(e,n,s){const r=this;return ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?n(o):s(o)}}const hr={name:"setextUnderline",resolveTo:g2,tokenize:f2};function g2(e,n){let s=e.length,r,i,o;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&e.splice(s,1),!o&&e[s][1].type==="definition"&&(o=s);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f2(e,n,s){const r=this;let i;return o;function o(p){let c=r.events.length,m;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){m=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=p,a(p)):s(p)}function a(p){return e.enter("setextHeadingLineSequence"),l(p)}function l(p){return p===i?(e.consume(p),l):(e.exit("setextHeadingLineSequence"),re(p)?ce(e,u,"lineSuffix")(p):u(p))}function u(p){return p===null||U(p)?(e.exit("setextHeadingLine"),n(p)):s(p)}}const j2={tokenize:y2};function y2(e){const n=this,s=e.attempt(Ln,r,e.attempt(this.parser.constructs.flowInitial,i,ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ef,i)),"linePrefix")));return s;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,s}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,s}}const _2={resolveAll:bo()},S2=So("string"),b2=So("text");function So(e){return{resolveAll:bo(e==="text"?C2:void 0),tokenize:n};function n(s){const r=this,i=this.parser.constructs[e],o=s.attempt(i,a,l);return a;function a(c){return p(c)?o(c):l(c)}function l(c){if(c===null){s.consume(c);return}return s.enter("data"),s.consume(c),u}function u(c){return p(c)?(s.exit("data"),o(c)):(s.consume(c),u)}function p(c){if(c===null)return!0;const m=i[c];let x=-1;if(m)for(;++x<m.length;){const d=m[x];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function bo(e){return n;function n(s,r){let i=-1,o;for(;++i<=s.length;)o===void 0?s[i]&&s[i][1].type==="data"&&(o=i,i++):(!s[i]||s[i][1].type!=="data")&&(i!==o+2&&(s[o][1].end=s[i-1][1].end,s.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(s,r):s}}function C2(e,n){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=n.sliceStream(r);let o=i.length,a=-1,l=0,u;for(;o--;){const p=i[o];if(typeof p=="string"){for(a=p.length;p.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(p===-2)u=!0,l++;else if(p!==-1){o++;break}}if(n._contentTypeTextTrailing&&s===e.length&&(l=0),l){const p={type:s===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(s,0,["enter",p,n],["exit",p,n]),s+=2)}s++}return e}const E2={42:Ee,43:Ee,45:Ee,48:Ee,49:Ee,50:Ee,51:Ee,52:Ee,53:Ee,54:Ee,55:Ee,56:Ee,57:Ee,62:xo},v2={91:Nf},w2={[-2]:Qn,[-1]:Qn,32:Qn},k2={35:Af,42:kn,45:[hr,kn],60:Ff,61:hr,95:kn,96:mr,126:mr},R2={38:go,92:ho},N2={[-5]:es,[-4]:es,[-3]:es,33:s2,38:go,42:js,60:[rf,qf],91:o2,92:[Lf,ho],93:Ps,95:js,96:jf},I2={null:[js,_2]},T2={null:[42,95]},P2={null:[]},L2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:T2,contentInitial:v2,disable:P2,document:E2,flow:k2,flowInitial:w2,insideSpan:I2,string:R2,text:N2},Symbol.toStringTag,{value:"Module"}));function B2(e,n,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const i={},o=[];let a=[],l=[];const u={attempt:A(w),check:A(b),consume:E,enter:C,exit:N,interrupt:A(b,{interrupt:!0})},p={code:null,containerState:{},defineSkip:h,events:[],now:g,parser:e,previous:null,sliceSerialize:x,sliceStream:d,write:m};let c=n.tokenize.call(p,u);return n.resolveAll&&o.push(n),p;function m(B){return a=Le(a,B),S(),a[a.length-1]!==null?[]:($(n,0),p.events=Ts(o,p.events,p),p.events)}function x(B,R){return M2(d(B),R)}function d(B){return A2(a,B)}function g(){const{_bufferIndex:B,_index:R,line:I,column:M,offset:P}=r;return{_bufferIndex:B,_index:R,line:I,column:M,offset:P}}function h(B){i[B.line]=B.column,V()}function S(){let B;for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<R.length;)j(R.charCodeAt(r._bufferIndex));else j(R)}}function j(B){c=c(B)}function E(B){U(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,V()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=B}function C(B,R){const I=R||{};return I.type=B,I.start=g(),p.events.push(["enter",I,p]),l.push(I),I}function N(B){const R=l.pop();return R.end=g(),p.events.push(["exit",R,p]),R}function w(B,R){$(B,R.from)}function b(B,R){R.restore()}function A(B,R){return I;function I(M,P,O){let D,L,H,f;return Array.isArray(M)?he(M):"tokenize"in M?he([M]):se(M);function se(G){return je;function je(Ae){const ot=Ae!==null&&G[Ae],Je=Ae!==null&&G.null,ht=[...Array.isArray(ot)?ot:ot?[ot]:[],...Array.isArray(Je)?Je:Je?[Je]:[]];return he(ht)(Ae)}}function he(G){return D=G,L=0,G.length===0?O:y(G[L])}function y(G){return je;function je(Ae){return f=z(),H=G,G.partial||(p.currentConstruct=G),G.name&&p.parser.constructs.disable.null.includes(G.name)?ge():G.tokenize.call(R?Object.assign(Object.create(p),R):p,u,Q,ge)(Ae)}}function Q(G){return B(H,f),P}function ge(G){return f.restore(),++L<D.length?y(D[L]):O}}}function $(B,R){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Ke(p.events,R,p.events.length-R,B.resolve(p.events.slice(R),p)),B.resolveTo&&(p.events=B.resolveTo(p.events,p))}function z(){const B=g(),R=p.previous,I=p.currentConstruct,M=p.events.length,P=Array.from(l);return{from:M,restore:O};function O(){r=B,p.previous=R,p.currentConstruct=I,p.events.length=M,l=P,V()}}function V(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function A2(e,n){const s=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let a;if(s===i)a=[e[s].slice(r,o)];else{if(a=e.slice(s,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function M2(e,n){let s=-1;const r=[];let i;for(;++s<e.length;){const o=e[s];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
102
+ `},children:t.jsxRuntimeExports.jsx("div",{className:J.indicator,style:{position:"absolute",left:`${je}%`,top:`${100-Ae}%`,transform:"translate(-50%, -50%)"}})}),t.jsxRuntimeExports.jsx("div",{className:J.hueSlider,style:{bottom:f?"175px":"100px"},children:t.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:G,onChange:Y=>{const W=Number(Y.target.value);f?I===1?H(W,o,a,l):H(W,S,A,$):(c(W),H(W,o,a,l))},className:J.slider})}),t.jsxRuntimeExports.jsxs("div",{className:J.alphaSlider,style:{bottom:f?"150px":"75px"},children:[t.jsxRuntimeExports.jsx("div",{className:J.alphaBackground}),t.jsxRuntimeExports.jsx("div",{className:J.alphaGradient,style:{background:Mn}}),t.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:ot,onChange:Y=>{const W=Number(Y.target.value);f?I===1?H(i,o,a,W):H(w,S,A,W):(d(W),H(i,o,a,W))},className:J.slider})]}),f&&P&&t.jsxRuntimeExports.jsxs("div",{className:J.gradientWrapper,children:[t.jsxRuntimeExports.jsx("h3",{className:J.subtitle,children:"Rotation"}),t.jsxRuntimeExports.jsx("div",{className:J.gradient,children:t.jsxRuntimeExports.jsxs("div",{className:J.chargeTypes,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.charge,{[J.chargeActive]:C==="horizontal"}),onClick:()=>N("horizontal"),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(J.charge,{[J.chargeActive]:C==="vertical"}),onClick:()=>N("vertical"),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),t.jsxRuntimeExports.jsxs("div",{className:J.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:ge,className:t.clx(J.applyButton,J.cancelButton),type:"Secondary",children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:Q,className:J.applyButton,children:"Apply"})]})]})},Rl=()=>{const{onPreview:e,zoomLevel:n}=t.usePreviewStore(),{keyBlock:s,hoverBlockId:r,isModalVisible:i,hoverBlockTopPosition:o}=t.useSubmodalStore(),{settings:a}=t.useSettingsStore(),{sourceBlocks:l}=t.useBlocksStore(),{pageContext:u}=t.usePagesStore(),{showModal:p}=t.useColorPickerStore(),{currentDevice:c}=t.useDeviceStore(),{isLoadingThemeSettings:m}=t.useThemeSettingsStore(),{isLoadingLayers:x}=t.useLayersStore(),d=C=>C?!l||!l[C]?t.jsxRuntimeExports.jsx(t.ErrorableBlock,{error:`Block "${C}" does not exist in blocks.`}):new l[C]().renderPreview(a,u):t.jsxRuntimeExports.jsx(t.ErrorableBlock,{error:"Block or block.name is undefined."});function g(){if(c.value==="desktop")return n>=1?"100%":`${(n*100).toFixed(2)}%`;{const C=c.value==="tablet"?768:425;return n>=1?`${C}px`:`${(C*n).toFixed(2)}px`}}function h(){switch(c.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:b}=t.usePagesStore(),f=_.useRef(null),E=C=>{f.current&&(f.current.scrollTop+=C.deltaY)};return t.jsxRuntimeExports.jsxs("div",{className:zt.preview,style:{zIndex:p&&!b?5e3:500},onWheel:C=>{C.stopPropagation(),E(C)},children:[i&&t.jsxRuntimeExports.jsx(Ya,{children:t.jsxRuntimeExports.jsx(zr,{})}),t.jsxRuntimeExports.jsxs(Xa,{positionTop:o,positionLeft:!r&&s?void 0:250,children:[!m&&!x&&t.jsxRuntimeExports.jsx(t.RenderBlock,{render:d,block:s},s),(m||!s||x)&&t.jsxRuntimeExports.jsx("div",{className:zt.previewLoading,children:t.jsxRuntimeExports.jsx(mt,{})})]}),p&&t.jsxRuntimeExports.jsx(kl,{}),e&&t.jsxRuntimeExports.jsxs("div",{className:zt.main,style:{width:h()},children:[t.jsxRuntimeExports.jsx(Ha,{}),t.jsxRuntimeExports.jsx("div",{style:{borderLeft:g()==="100%"?"none":"var(--default-border)",borderRight:g()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:C=>{C.stopPropagation()},onWheel:C=>{C.stopPropagation()},children:!m&&!x?t.jsxRuntimeExports.jsx("div",{className:zt.content,style:{width:g()},children:t.jsxRuntimeExports.jsx(t.PreviewContent,{scrollableRef:f})}):t.jsxRuntimeExports.jsx("div",{className:zt.loading,children:t.jsxRuntimeExports.jsx(mt,{})})})]})]})},Nl="_sidebar_1xtkj_1",Il="_title_1xtkj_11",Us={sidebar:Nl,title:Il},Tl="_layers_1jhzw_1",Pl="_wrapper_1jhzw_9",Ll="_draggingWrapper_1jhzw_17",Bl="_block_1jhzw_21",Al="_dragging_1jhzw_17",Ml="_active_1jhzw_56",$l="_add_1jhzw_63",Dl="_addTop_1jhzw_79",Fl="_visible_1jhzw_95",Ol="_button_1jhzw_99",Hl="_nameBlock_1jhzw_158",zl="_loader_1jhzw_162",Ul="_actions_1jhzw_171",Vl="_deleteButton_1jhzw_179",ye={layers:Tl,wrapper:Pl,draggingWrapper:Ll,block:Bl,dragging:Al,active:Ml,add:$l,addTop:Dl,visible:Fl,button:Ol,nameBlock:Hl,loader:zl,actions:Ul,deleteButton:Vl},Wl="_block_sj4cc_1",ql="_title_sj4cc_17",Gl="_actions_sj4cc_21",ft={block:Wl,title:ql,actions:Gl},Un={header:"Header",footer:"Footer",announcement:"Announcement"},Vn=({id:e})=>{const{setCurrentBlock:n}=t.useLayersStore(),{activeBlock:s}=t.usePreviewStore(),[r,i]=_.useState(!1);function o(a){n(a)}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ft.block,{[ft.active]:s.id===e,[ft.header]:e==="header",[ft.footer]:e==="footer",[ft.announcement]:e==="announcement"}),onClick:()=>o(e),onMouseOver:()=>i(!0),onMouseLeave:()=>i(!1),children:[en[Un[e]]?t.jsxRuntimeExports.jsx("img",{src:en[Un[e]],width:20,height:20}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:ft.title,children:Un[e]}),t.jsxRuntimeExports.jsx("div",{className:ft.actions,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},Zl=({id:e,name:n,onClick:s,isDragging:r,icon:i})=>{const{activeBlock:o,setActiveBlock:a}=t.usePreviewStore(),{showPreview:l,hidePreview:u,showModal:p,hideModal:c,clearHideTimeout:m,startHideTimeout:x,hoverBlockId:d,isModalVisible:g}=t.useSubmodalStore(),{setPositionBlock:h}=t.useLayersStore(),[b,f]=_.useState(!1),[E,C]=_.useState(!1),[N,w]=_.useState(!1),[S,A]=_.useState(!1),[$,z]=_.useState(null),V=_.useRef(null),{attributes:B,listeners:R,setNodeRef:I,transform:M,transition:P}=t.useSortable({id:e}),O={transform:t.CSS.Transform.toString(M),transition:P},{setTitle:D,setDescription:L,setOnConfirm:H}=t.useConfirmationModalStore(),{pages:j,currentPage:se}=t.usePagesStore(),{removeBlock:he}=t.useLayersStore(),y=G=>{G.stopPropagation(),V.current&&clearTimeout(V.current),a({id:e,neededScroll:!0}),g&&c(),l(e),m()},Q=(G,je=!0)=>{G.stopPropagation(),u(),p(e),m(),h(e,je)},ge=G=>{G.stopPropagation(),a({id:null,neededScroll:!1}),g?x():u()};return _.useEffect(()=>{w(!1),f(!1),C(!1),A(!1)},[r]),_.useEffect(()=>{g||(C(!1),f(!1))},[g]),t.jsxRuntimeExports.jsxs("div",{ref:I,style:O,className:t.clx(ye.wrapper,{[ye.draggingWrapper]:r&&o.id===e}),onClick:G=>{G.stopPropagation(),s(e)},onMouseEnter:y,onMouseLeave:ge,...B,...R,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(ye.block,{[ye.dragging]:r&&o.id===e,[ye.active]:!r&&o.id===e}),children:[i?t.jsxRuntimeExports.jsx("img",{src:i,width:20,height:20}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Cards",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{className:ye.nameBlock,children:n}),d===e&&!r&&t.jsxRuntimeExports.jsx("div",{className:t.clx(ye.addTop,{[ye.visible]:E}),onMouseEnter:()=>{C(!0)},onMouseLeave:()=>{C(!1)},children:t.jsxRuntimeExports.jsxs("button",{className:ye.button,onClick:G=>Q(G,!1),onMouseEnter:()=>{const G=setTimeout(()=>{r||A(!0)},200);z(G)},onMouseLeave:()=>{$&&clearTimeout($),A(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#fff"}),S&&t.jsxRuntimeExports.jsx(Bt,{text:"Click to add a section"})]})}),d===e&&!r&&t.jsxRuntimeExports.jsx("div",{className:t.clx(ye.add,{[ye.visible]:b}),onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},children:t.jsxRuntimeExports.jsxs("button",{className:ye.button,onClick:G=>Q(G),onMouseEnter:()=>{const G=setTimeout(()=>{r||w(!0)},200);z(G)},onMouseLeave:()=>{$&&clearTimeout($),w(!1)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#fff"}),N&&t.jsxRuntimeExports.jsx(Bt,{text:"Click to add a section"})]})})]}),d===e&&!r&&t.jsxRuntimeExports.jsxs("div",{className:ye.actions,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),t.jsxRuntimeExports.jsx("div",{className:ye.deleteButton,onClick:G=>{G.stopPropagation(),D("Remove Block"),L(`Are you sure you want to delete ${n||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),H(()=>{j&&he(j[se].path,e)})},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},Xl=()=>{const{blocks:e,setCurrentBlock:n,currentBlock:s,moveBlock:r,isLoadingLayers:i,announcement:o}=t.useLayersStore(),{currentPage:a,pages:l}=t.usePagesStore(),{setMouseOverModal:u,setHoverBlockId:p}=t.useSubmodalStore(),{sourceBlocks:c}=t.useBlocksStore();function m(f){n(f),u(!1),p(null)}const x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),[d,g]=_.useState(!1),h=()=>{g(!0)},b=f=>{g(!1);const{active:E,over:C}=f;if(C&&E.id!==C.id&&l&&l[a]){const N=l[a].path,w=e[N].order,S=w.indexOf(E.id),A=w.indexOf(C.id);S!==-1&&A!==-1&&r(N,S,A)}};return t.jsxRuntimeExports.jsx("div",{className:ye.layers,children:i?t.jsxRuntimeExports.jsx("div",{className:ye.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx(Vn,{id:"announcement"}),t.jsxRuntimeExports.jsx(Vn,{id:"header"}),!s&&t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:b,onDragStart:h,children:l&&l[a]&&e[l[a].path]&&t.jsxRuntimeExports.jsx(t.SortableContext,{items:e[l[a].path].order,strategy:t.verticalListSortingStrategy,children:e[l[a].path].order.map((f,E)=>t.jsxRuntimeExports.jsx(Zl,{id:f,name:t.getDisplayName(e[l[a].path].data[f].name,c),index:E,onClick:m,isDragging:d,icon:en[e[l[a].path].data[f].name]},f))})}),t.jsxRuntimeExports.jsx(Vn,{id:"footer"})]})})},Yl="_loader_eyvkk_1",Kl={loader:Yl},Jl=()=>{const{isLoadingSettings:e}=t.useSettingsStore();return e?t.jsxRuntimeExports.jsx("div",{className:Kl.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsx(Ql,{})},Ql=()=>{const{settings:e}=t.useSettingsStore(),{settings:n,setSettingsInstance:s}=t.useBlocksStore();if(!e)return null;const{setError:r}=t.useErrorStore(),i=new n(e.blockSettings);_.useEffect(()=>{s(i)},[e]);try{return i.renderSettings()}catch(o){throw console.error("Error rendering settings:",o),r({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),o}},ec="_theme_a1one_1",tc="_block_a1one_8",nc="_name_a1one_23",sc="_loader_a1one_27",mn={theme:ec,block:tc,name:nc,loader:sc},rc=()=>{const e=t.useNavigate(),{isLoadingThemeSettings:n,setActiveBlock:s}=t.useThemeSettingsStore();function r(i){switch(i==null?void 0:i.name){case"Colors":e("/admin/builder/theme/colors"),s(Ue[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(Ue[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(Ue[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(Ue[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(Ue[4]);break}}return t.jsxRuntimeExports.jsx("div",{className:mn.theme,children:n?t.jsxRuntimeExports.jsx("div",{className:mn.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):Ue.map(i=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>r(i),className:t.clx(mn.block),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:i.icon}),t.jsxRuntimeExports.jsx("span",{className:mn.name,children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight"})]},i.icon))})},oc="_render_7e826_9",ic="_open_7e826_24",ac="_close_7e826_51",lc="_clicked_7e826_55",cc="_loading_7e826_72",uc="_settings_7e826_76",kt={render:oc,open:ic,close:ac,clicked:lc,loading:cc,settings:uc},pc=({block:e})=>{const{pageContext:n}=t.usePagesStore(),{setError:s}=t.useErrorStore();try{return e.renderSettings(n)}catch(r){throw console.error("Error rendering settings:",r),s({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},dc="_wrapper_15ju8_1",mc="_header_15ju8_8",xc="_title_15ju8_15",hc="_colorWrapper_15ju8_21",gc="_name_15ju8_35",fc="_color_15ju8_21",jc="_value_15ju8_47",yc="_length_15ju8_51",Pe={wrapper:dc,header:mc,title:xc,colorWrapper:hc,name:gc,color:fc,value:jc,length:yc},_c=e=>{const{colors:n}=e,{themeSettings:s}=t.useThemeSettingsStore(),[r,i]=_.useState(!0);_.useEffect(()=>{n.length<=3&&i(!0)},[]);function o(a){const l=a.replace("--",""),[u,p]=l.split("-"),c=`${p.charAt(0).toUpperCase()+p.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[m,x]=l.split("-");return{name:c,field:m,variable:x}}return t.jsxRuntimeExports.jsxs("div",{className:Pe.wrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:Pe.header,children:[t.jsxRuntimeExports.jsx("div",{className:Pe.title,children:"Section Colors"}),!r&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(Pe.value,Pe.length),onClick:()=>i(!0),children:["+",n.length]})]}),r&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:Pe.colors,children:n.map(a=>{const l=o(a),{variable:u,name:p,field:c}=l;return t.jsxRuntimeExports.jsx(Sc,{color:s.colors[c][u],name:p})})}),n.length>3&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(Pe.value,Pe.length),onClick:()=>i(!1),children:["Hide ",n.length," colors"]})]})]})},Sc=e=>{const{name:n,color:s}=e,{setActiveLabel:r,setModalPosition:i,setInitialColor:o,setShowModal:a,setUpdate:l,setColor:u,setColorChange:p,colorChange:c,setIsGradientActive:m}=t.useColorPickerStore(),{updateColor:x}=t.useThemeSettingsStore(),d=(b,f)=>E=>{x(b,f,E)};_.useEffect(()=>{const b=()=>{a(!1),r(null),o(s),l(()=>{}),u(s),p(()=>{})};return document.body.addEventListener("click",b),()=>{document.body.removeEventListener("click",b)}},[]);const g=b=>{const f=n.split("/")[0],E=f.split(" ")[0].toLowerCase(),C=f.split(" ")[1].toLowerCase();b.stopPropagation(),a(!0),p(c),l(S=>d(C,E)(S)),o(s),u(s),m(C==="surface");const{top:N,left:w}=Or(b,550,288,10,20,230,80);i({top:C==="surface"?N:N+125,left:w-200})};function h(b){return b.length>15?b.slice(0,15)+"...":b}return t.jsxRuntimeExports.jsxs("div",{className:Pe.colorWrapper,onClick:g,children:[t.jsxRuntimeExports.jsx("div",{className:Pe.color,style:{background:s}}),t.jsxRuntimeExports.jsx("div",{className:Pe.name,children:n}),t.jsxRuntimeExports.jsx("div",{className:Pe.value,children:h(s)})]})},bc="_back_1sznl_1",Cc="_title_1sznl_9",Ec="_deleteButton_1sznl_17",vc="_backIcon_1sznl_30",xn={back:bc,title:Cc,deleteButton:Ec,backIcon:vc},wc=({onClick:e,setIsClicked:n,getDisplayName:s})=>{var x,d;const{activeBlock:r}=t.useBlocksStore(),{setTitle:i,setDescription:o,setOnConfirm:a}=t.useConfirmationModalStore(),{blocks:l,currentBlock:u,removeBlock:p}=t.useLayersStore(),{currentPage:c,pages:m}=t.usePagesStore();return t.jsxRuntimeExports.jsxs("div",{className:xn.back,children:[t.jsxRuntimeExports.jsx("div",{className:xn.backIcon,onClick:()=>e(),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx("h3",{className:xn.title,children:r&&s(r)||m&&m[c]&&l[m[c].path]&&u&&s((x=l[m[c].path].data[u])==null?void 0:x.name)||u&&Be(u)||"Loading"}),u&&m&&!["header","footer","announcement"].includes(u)&&l[m[c].path].data[u]&&s((d=l[m[c].path].data[u])==null?void 0:d.name)!=="unknown name"&&t.jsxRuntimeExports.jsx("button",{onClick:g=>{var h;g.stopPropagation(),i("Remove Block"),o(`Are you sure you want to delete ${s((h=l[m[c].path].data[u])==null?void 0:h.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{n(!0),p(m[c].path,u),e(!0)})},className:xn.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},kc=()=>{const e=t.useNavigate(),[n,s]=_.useState(!1),{header:r,footer:i,announcement:o,sourceBlocks:a,activeBlock:l,setActiveBlock:u,currentInstance:p,setCurrentInstance:c}=t.useBlocksStore(),{setActiveBlock:m}=t.usePreviewStore(),{blocks:x,addBlock:d,editBlock:g,currentBlock:h,setCurrentBlock:b,header:f,footer:E,announcement:C,isLoadingLayers:N}=t.useLayersStore(),{currentPage:w,pages:S}=t.usePagesStore(),{past:A,future:$}=t.useHistoryStore();function z(R=!1){if(S&&p&&h&&!["header","footer","announcement"].includes(h)&&!R){const I={blockSettings:{}};Object.keys(p.blockSettings).filter(M=>!["displayName","isAddable"].includes(M)).map(M=>{I.blockSettings[M]=p.blockSettings[M]}),g(S[w].path,h,{name:x[S[w].path].data[h].name,value:I})}u(null),b(null),m({id:null,neededScroll:!1}),setTimeout(()=>{s(!1)},150),c(null)}function V(R){var O;if(!S||!w||!R)return null;if(R==="header"){const D=new r;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=f==null?void 0:f.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=f==null?void 0:f.blockColors[L]}),D}if(R==="footer"){const D=new i;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=E==null?void 0:E.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=E==null?void 0:E.blockColors[L]}),D}if(R==="announcement"){const D=new o;return Object.keys(D.blockSettings).forEach(L=>{D.blockSettings[L]=C==null?void 0:C.blockSettings[L]}),Object.keys(D.blockColors).forEach(L=>{D.blockColors[L]=C==null?void 0:C.blockColors[L]}),D}const I=x[S[w].path];if(!I||!I.data[R])return null;const M=I.data[R];return!M||!a[M.name]?null:new a[M.name]((O=M.value)==null?void 0:O.blockSettings)}_.useEffect(()=>{if(h){const R=V(h);c(R)}else c(null)},[h,A,$,l]),_.useEffect(()=>{if(l&&S&&!h){const R={blockSettings:{},blockColors:{}},I=new a[l];c(I),Object.keys(I.blockSettings).filter(P=>!["displayName","isAddable"].includes(P)).map(P=>{R.blockSettings[P]=I.blockSettings[P]}),Object.keys(I.blockColors).filter(P=>!["displayName","isAddable"].includes(P)).map(P=>{R.blockColors[P]=I.blockColors[P]});const M=d(S[w].path,{name:l,value:R});m({id:M,neededScroll:!0}),b(M),e("/admin/builder")}},[l,A,$]);function B(R){if(!a)return"unknown name";if(!a[R])return h==="header"?f==null?void 0:f.blockSettings.displayName:h==="footer"?E==null?void 0:E.blockSettings.displayName:h==="announcement"?C==null?void 0:C.blockSettings.displayName:"unknown name";const I=new a[R];return!I.blockSettings||!I.blockSettings.displayName?"unknown name":I.blockSettings.displayName}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(kt.render,{[kt.open]:h,[kt.close]:!h,[kt.clicked]:n}),onClick:R=>R.stopPropagation(),style:{opacity:N?0:1},children:[t.jsxRuntimeExports.jsx(wc,{onClick:z,setIsClicked:s,getDisplayName:B}),t.jsxRuntimeExports.jsxs("div",{className:kt.settings,children:[p&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(pc,{block:p}),t.jsxRuntimeExports.jsx(_c,{colors:p.blockColors})]}),!l&&!h&&t.jsxRuntimeExports.jsx("div",{className:kt.loading,children:"Loading"})]})]})},Rc="_header_9rrfr_1",Nc="_title_9rrfr_9",Ic="_backIcon_9rrfr_15",Wn={header:Rc,title:Nc,backIcon:Ic},nn=({onClick:e,title:n})=>t.jsxRuntimeExports.jsxs("div",{className:Wn.header,children:[t.jsxRuntimeExports.jsx("div",{className:Wn.backIcon,onClick:e,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx("span",{className:Wn.title,children:n})]}),Tc="_options_ymds7_1",Pc={options:Tc},Lc="_wrapper_kzokw_1",Bc="_open_kzokw_16",Ac="_close_kzokw_20",qn={wrapper:Lc,open:Bc,close:Ac},sn=e=>{const{isOpen:n,isClose:s,children:r}=e;return t.jsxRuntimeExports.jsx("div",{className:t.clx(qn.wrapper,{[qn.open]:n,[qn.close]:s}),children:r})},Mc=()=>{var p,c;const{activeBlock:e,themeSettings:n,updateBorder:s,setActiveBlock:r}=t.useThemeSettingsStore();function i(m,x){s(x,m)}const o=t.useNavigate();function a(){r(null),o("/admin/builder/theme")}const l=_.useMemo(()=>n.borders,[n]),u=(e==null?void 0:e.name)==="Borders";return t.jsxRuntimeExports.jsxs(sn,{isOpen:u,isClose:!u,children:[t.jsxRuntimeExports.jsx(nn,{onClick:a,title:"Borders Style"}),t.jsxRuntimeExports.jsxs("div",{className:Pc.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Border Radius (px)",options:Object.keys($n),value:((p=Object.entries($n).find(([m,x])=>x===l.radius))==null?void 0:p[0])||"None",onChange:m=>i($n[m],"radius")}),t.jsxRuntimeExports.jsx(t.Select,{label:"Border Thickness (px)",options:Object.keys(Dn),value:((c=Object.entries(Dn).find(([m,x])=>x===l.thickness))==null?void 0:c[0])||"None",onChange:m=>i(Dn[m],"thickness")})]})]})},$c="_options_jo38w_1",Dc="_alignments_jo38w_9",Fc="_blocks_jo38w_15",Oc="_alignment_jo38w_9",Hc="_active_jo38w_34",zc="_chargeTypes_jo38w_41",Uc="_charge_jo38w_41",Vc="_chargeActive_jo38w_69",Wc="_sliderContainer_jo38w_83",qc="_shadowInputs_jo38w_91",Gc="_label_jo38w_102",Zc="_shadowInputsRow_jo38w_111",Xc="_shadowInputsOpen_jo38w_119",Ce={options:$c,alignments:Dc,blocks:Fc,alignment:Oc,active:Hc,chargeTypes:zc,charge:Uc,chargeActive:Vc,sliderContainer:Wc,shadowInputs:qc,label:Gc,shadowInputsRow:Zc,shadowInputsOpen:Xc};function Gn(e){return(e.includes("linear-gradient")||e.includes("radial-gradient"))&&/^linear-gradient\(\d+deg,\s*#[A-Fa-f0-9]{8}\s+\d+%,\s*#[A-Fa-f0-9]{8}\s+\d+%\)$/.test(e)?!0:/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const Ve=e=>{const{initialColor:n,onChange:s,title:r,labelStyle:i="primary",isGradientActive:o=!0}=e,[a,l]=_.useState(n);_.useEffect(()=>{l(n)},[n]);const{setActiveLabel:u,setModalPosition:p,setInitialColor:c,setShowModal:m,setUpdate:x,setColor:d,setColorChange:g,setIsGradientActive:h,colorChange:b}=t.useColorPickerStore();_.useEffect(()=>{const N=()=>{m(!1),u(null),c(n),x(()=>{}),d(n),g(()=>{})};return document.body.addEventListener("click",N),()=>{document.body.removeEventListener("click",N)}},[n]);const f=N=>{N.stopPropagation(),m(!0),g(l),x(s),c(n),d(a),h(o);const{top:w,left:S}=Or(N,600,288,10,20,230,80);p({top:w,left:S})},E=N=>{const w=N.target.value;l(w),Gn(w)&&(s(w),d(w),g(b))},C=()=>{Gn(a)||l(n)};return t.jsxRuntimeExports.jsxs("div",{className:J.content,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(J.name,{[J.secondary]:i==="secondary"}),children:r}),t.jsxRuntimeExports.jsxs("label",{className:J.label,onClick:N=>N.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:J.colorValue,style:{background:Gn(a)?a:n},onClick:f}),t.jsxRuntimeExports.jsx("input",{type:"text",value:a.includes("linear-gradient")?a:a.toUpperCase(),onChange:E,onBlur:C,className:J.input,style:{textTransform:a.includes("linear-gradient")?"none":"uppercase"}})]})]})},Yc=["left","center","right"],Kc=()=>{const{activeBlock:e,themeSettings:n,updateButton:s,setActiveBlock:r}=t.useThemeSettingsStore(),{fonts:i}=t.useFontsStore(),[o,a]=_.useState("primary");function l(h,b){s(o,b,h)}const[u,p]=_.useState(!1),c=n.buttons[o],m=t.useNavigate();function x(){r(null),m("/admin/builder/theme")}const d=(e==null?void 0:e.name)==="Buttons";function g(h,b){l({...c.boxShadow,[h]:b},"boxShadow")}return t.jsxRuntimeExports.jsxs(sn,{isOpen:d,isClose:!d,children:[t.jsxRuntimeExports.jsx(nn,{onClick:x,title:"Buttons Style"}),t.jsxRuntimeExports.jsx("div",{className:Ce.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Ce.charge,{[Ce.chargeActive]:o===h}),onClick:()=>a(h),children:h.charAt(0).toUpperCase()+h.slice(1)},h))}),c&&t.jsxRuntimeExports.jsxs("div",{className:Ce.options,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Height (px)",value:String(c.height),onChange:h=>l(Number(h),"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",value:String(c.size),onChange:h=>l(Number(h),"size"),options:Nn}),t.jsxRuntimeExports.jsx(t.Input,{label:"Border Radius (px)",value:String(c.radius),onChange:h=>l(Number(h),"radius"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font",value:c.font,onChange:h=>l(h,"font"),options:[...i.filter(h=>h.name!==c.font).map(h=>h.name)]}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.color,onChange:h=>l(h,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.background,onChange:h=>l(h,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),t.jsxRuntimeExports.jsxs("div",{className:Ce.sliderContainer,children:[t.jsxRuntimeExports.jsx("h4",{className:Ce.label,children:"Shadow"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>p(!u),style:{padding:5,display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Ce.shadowInputs,{[Ce.shadowInputsOpen]:u}),children:[t.jsxRuntimeExports.jsxs("div",{className:Ce.shadowInputsRow,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Left (px)",value:String(c.boxShadow.left),onChange:h=>g("left",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Top (px)",value:String(c.boxShadow.top),onChange:h=>g("top",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Blur (px)",value:String(c.boxShadow.blur),onChange:h=>g("blur",Number(h)),type:"number"}),t.jsxRuntimeExports.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:t.jsxRuntimeExports.jsx(t.Input,{label:"Spread (px)",value:String(c.boxShadow.spread),onChange:h=>g("spread",Number(h)),type:"number"})})]}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.boxShadow.color,onChange:h=>g("color",h),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsxs("div",{className:Ce.alignments,children:[t.jsxRuntimeExports.jsx("h4",{className:Ce.label,children:"Alignment Type"}),t.jsxRuntimeExports.jsx("div",{className:Ce.blocks,children:Yc.map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Ce.alignment,{[Ce.active]:c.alignment===h}),onClick:()=>{l(h,"alignment")},children:t.jsxRuntimeExports.jsx(t.Icon,{name:h==="center"?"AlignCenterHorizontal":h==="left"?"AlignLeft":"AlignRight",fill:c.alignment===h?"#252525":"#757575"})},h))})]}),t.jsxRuntimeExports.jsx(t.Switch,{label:"Enable Hover",onChange:h=>l(h,"hover"),current:c.hover}),c.hover&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Ve,{initialColor:c.colorHover,onChange:h=>l(h,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsx(Ve,{initialColor:c.backgroundHover,onChange:h=>l(h,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Jc="_category_hxy9u_1",Qc="_categoryTitle_hxy9u_19",Zn={category:Jc,categoryTitle:Qc},eu=()=>{const{themeSettings:e,setActiveColorCategory:n}=t.useThemeSettingsStore();function s(r){n(r)}return t.jsxRuntimeExports.jsx("div",{className:Zn.wrapper,children:Object.keys(e.colors).map(r=>r==="icon"?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{}):t.jsxRuntimeExports.jsxs("div",{className:Zn.category,onClick:()=>s(r),children:[t.jsxRuntimeExports.jsxs("h2",{className:Zn.categoryTitle,children:[r==="text"?"Text & Icon":Be(r)," Colors"]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretRight",width:24,height:24})]},r))})},tu="_options_ikvjo_38",nu={options:tu},su=()=>{const{activeBlock:e,setActiveFont:n,activeFont:s,themeSettings:r,updateFont:i}=t.useThemeSettingsStore(),{fonts:o}=t.useFontsStore(),[a,l]=_.useState(null);function u(){n(null)}function p(h,b){a&&s&&i("desktop",a,s,b,h)}const[c,m]=_.useState([]),x=_.useMemo(()=>s?r.fonts.desktop.heading[s]?(l("heading"),r.fonts.desktop.heading[s]):r.fonts.desktop.body[s]?(l("body"),r.fonts.desktop.body[s]):(l(null),null):null,[s,r]);_.useEffect(()=>{if(x){const h=o.find(b=>b.name===x.font);h&&(m(h.weights),h.weights.includes(x.boldWeight)||p("400","boldWeight"),h.weights.includes(x.weight)||p("400","weight"))}},[x,s]);const d=!!((e==null?void 0:e.name)==="Fonts"&&s),g=(e==null?void 0:e.name)!=="Fonts"||!s;return t.jsxRuntimeExports.jsxs(sn,{isOpen:d,isClose:g,children:[t.jsxRuntimeExports.jsx(nn,{onClick:u,title:"Font Style"}),s&&x&&t.jsxRuntimeExports.jsxs("div",{className:nu.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Font",value:x.font,onChange:h=>p(h,"font"),options:[...o.filter(h=>h.name!==x.font).map(h=>h.name)]}),t.jsxRuntimeExports.jsx(t.Select,{label:"Size",value:String(x.size),onChange:h=>p(h,"size"),options:Nn}),t.jsxRuntimeExports.jsx(t.Select,{label:"Default Weight",value:String(x.weight),onChange:h=>p(h,"weight"),options:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Bold Weight",value:String(x.boldWeight),onChange:h=>p(h,"boldWeight"),options:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Case",value:String(x.case).charAt(0).toUpperCase()+String(x.case).slice(1),onChange:h=>p(h.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(h=>h.toLowerCase()!==String(x.case))})]})]})},ru="_wrapper_mkmxa_1",ou="_category_mkmxa_5",iu="_categoryTitle_mkmxa_11",au="_font_mkmxa_17",lu="_content_mkmxa_32",cu="_icon_mkmxa_39",uu="_paragraph_mkmxa_50",st={wrapper:ru,category:ou,categoryTitle:iu,font:au,content:lu,icon:cu,paragraph:uu},pu={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},du=e=>{const{font:n,size:s,id:r,category:i}=e,{setActiveFont:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsxs("div",{className:st.font,onClick:()=>o(r),children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(st.icon,{[st.paragraph]:i==="paragraph"}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:i==="paragraph"?"TextB":"TextH"})}),t.jsxRuntimeExports.jsxs("div",{className:st.content,children:[t.jsxRuntimeExports.jsx("h2",{className:st.categoryTitle,children:Be(pu[r])}),t.jsxRuntimeExports.jsx("span",{className:st.value,children:`${n}, ${s}px`})]})]})},mu=()=>{const{themeSettings:e,setActiveFont:n,activeBlock:s}=t.useThemeSettingsStore();_.useEffect(()=>(r(),()=>{r()}),[]);function r(){n(null)}if(s!=null&&s.name)return t.jsxRuntimeExports.jsx("div",{className:st.wrapper,children:Object.entries(e.fonts.desktop).sort(([i],[o])=>i==="heading"?-1:o==="heading"?1:0).map(([i,o])=>t.jsxRuntimeExports.jsxs("div",{className:st.category,children:[t.jsxRuntimeExports.jsx("h2",{className:st.categoryTitle,children:Be(i)}),Object.entries(o).map(([a,l])=>t.jsxRuntimeExports.jsx(du,{id:a,category:i,...l},a))]},i))})},xu="_wrapper_16ym0_2",hu="_categoryTitle_16ym0_12",gu="_title_16ym0_74",fu="_field_16ym0_82",ju="_alignments_16ym0_92",yu="_lineField_16ym0_98",_u="_style_16ym0_106",Su="_header_16ym0_113",ze={wrapper:xu,categoryTitle:hu,title:gu,field:fu,alignments:ju,lineField:yu,style:_u,header:Su},bu="_blocks_emecf_1",Cu="_block_emecf_1",Eu="_active_emecf_21",Xn={blocks:bu,block:Cu,active:Eu},Vs=e=>{const{items:n,selectedItem:s,onSelect:r,getIconName:i}=e;return t.jsxRuntimeExports.jsx("div",{className:Xn.blocks,children:n.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Xn.block,{[Xn.active]:s===o}),onClick:()=>r(o),children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(o),fill:s===o?"#252525":"#757575"})},String(o)))})},vu=["left","center","right"],wu=["solid","dashed"],Ut=e=>{const{title:n,children:s,rightAddon:r}=e;return t.jsxRuntimeExports.jsxs("div",{className:ze.field,children:[t.jsxRuntimeExports.jsxs("div",{className:ze.header,children:[t.jsxRuntimeExports.jsx("h4",{className:ze.categoryTitle,children:n}),r]}),s]})},ku=()=>{const{themeSettings:e,updateInput:n}=t.useThemeSettingsStore(),s=_.useMemo(()=>e.inputs,[e]),r=(o,a,l)=>{n(o,a,l)},i=o=>a=>{n(o,a,"color")};return t.jsxRuntimeExports.jsxs("div",{className:ze.wrapper,children:[t.jsxRuntimeExports.jsxs(Ut,{title:"General",children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Height (px)",value:String(s.general.height),onChange:o=>r("general",o,"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",onChange:o=>r("general",o,"size"),value:String(s.general.size),options:Nn}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.general.color),onChange:i("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsx(Ut,{title:"Field Fill",rightAddon:t.jsxRuntimeExports.jsx("div",{className:ze.switch,children:t.jsxRuntimeExports.jsx(t.Switch,{onChange:o=>r("field",o,"active"),current:s.field.active})}),children:t.jsxRuntimeExports.jsx(Ve,{initialColor:s.field.color,onChange:i("field"),title:"Color",labelStyle:"secondary"})}),t.jsxRuntimeExports.jsx(Ut,{title:"Placeholder",children:t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.placeholder.color),onChange:i("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),t.jsxRuntimeExports.jsxs(Ut,{title:"Border",rightAddon:t.jsxRuntimeExports.jsx("div",{className:ze.switch,children:t.jsxRuntimeExports.jsx(t.Switch,{onChange:o=>r("border",o,"active"),current:s.border.active})}),children:[t.jsxRuntimeExports.jsxs("div",{className:ze.lineField,children:[t.jsxRuntimeExports.jsxs("div",{className:ze.style,children:[t.jsxRuntimeExports.jsx("span",{className:ze.title,children:"Style"}),t.jsxRuntimeExports.jsx(Vs,{items:wu,selectedItem:s.border.style,onSelect:o=>r("border",o,"style"),getIconName:o=>o==="solid"?"Minus":"Selection"})]}),t.jsxRuntimeExports.jsx(t.Input,{label:"Radius (px)",value:String(s.border.radius),onChange:o=>r("border",o,"radius"),type:"number",min:0})]}),t.jsxRuntimeExports.jsx(t.Input,{label:"Thickness (px)",value:String(s.border.thickness),onChange:o=>r("border",o,"thickness"),type:"number",min:0}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.border.color),onChange:i("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),t.jsxRuntimeExports.jsxs(Ut,{title:"Label",children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Line Height (px)",value:String(s.label.height),onChange:o=>r("label",o,"height"),type:"number",min:0}),t.jsxRuntimeExports.jsx(t.Select,{label:"Font Size (px)",onChange:o=>r("label",o,"size"),value:String(s.label.size),options:Nn}),t.jsxRuntimeExports.jsx(Ve,{initialColor:Be(s.label.color),onChange:i("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),t.jsxRuntimeExports.jsxs("div",{className:ze.alignments,children:[t.jsxRuntimeExports.jsx("h4",{className:ze.title,children:"Alignment Type"}),t.jsxRuntimeExports.jsx(Vs,{items:vu,selectedItem:s.label.alignment,onSelect:o=>r("label",o,"alignment"),getIconName:o=>o==="center"?"AlignCenterHorizontal":o==="left"?"AlignLeft":"AlignRight"})]})]})]})},Ru="_wrapper_1yw63_2",Nu="_color_1yw63_24",Iu="_content_1yw63_33",Tu="_preview_1yw63_42",Pu="_container_1yw63_52",Lu="_buttonWrapper_1yw63_62",Bu="_button_1yw63_62",Au="_buttonBorder_1yw63_80",Mu="_buttonBackground_1yw63_83",$u="_text_1yw63_87",Du="_textText_1yw63_93",Fu="_icon_1yw63_97",Ou="_iconIcon_1yw63_100",Hu="_annotation_1yw63_104",zu="_annotationText_1yw63_111",Uu="_label_1yw63_116",Vu="_circle_1yw63_127",Wu="_line_1yw63_140",qu="_circle1_1yw63_154",Gu="_circle2_1yw63_159",Zu="_annotationIcon_1yw63_164",Xu="_annotationBorder_1yw63_192",Yu="_line1_1yw63_203",Ku="_line2_1yw63_210",Ju="_circle3_1yw63_227",Qu="_circle4_1yw63_232",ep="_annotationSurface_1yw63_237",F={wrapper:Ru,color:Nu,content:Iu,preview:Tu,container:Pu,buttonWrapper:Lu,button:Bu,buttonBorder:Au,buttonBackground:Mu,text:$u,textText:Du,icon:Fu,iconIcon:Ou,annotation:Hu,annotationText:zu,label:Uu,circle:Vu,line:Wu,circle1:qu,circle2:Gu,annotationIcon:Zu,annotationBorder:Xu,line1:Yu,line2:Ku,circle3:Ju,circle4:Qu,annotationSurface:ep},tp=()=>{const{activeColorCategory:e}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("div",{className:F.container,children:t.jsxRuntimeExports.jsxs("div",{className:F.buttonWrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.button,{[F.buttonBorder]:e==="border",[F.buttonBackground]:e==="surface"}),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Smiley",className:t.clx(F.icon,{[F.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),t.jsxRuntimeExports.jsx("span",{className:t.clx(F.text,{[F.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationText),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Text Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]}),e==="text"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationIcon),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Icon Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]}),e==="border"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationBorder),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Border Color"}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.line,F.line1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.line,F.line2)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle3)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle4)})]}),e==="surface"&&t.jsxRuntimeExports.jsxs("div",{className:t.clx(F.annotation,F.annotationSurface),children:[t.jsxRuntimeExports.jsx("div",{className:F.label,children:"Surface Color"}),t.jsxRuntimeExports.jsx("div",{className:F.line}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle1)}),t.jsxRuntimeExports.jsx("div",{className:t.clx(F.circle,F.circle2)})]})]})})},np={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},sp=()=>{const{activeBlock:e,setActiveColorCategory:n,activeColorCategory:s,themeSettings:r,updateColor:i}=t.useThemeSettingsStore();function o(){n(null)}function a(c,m,x){i(c,m,x)}const l=!!((e==null?void 0:e.name)==="Colors"&&s),u=(e==null?void 0:e.name)!=="Colors"||!s,p=s?np[s]:[];return t.jsxRuntimeExports.jsxs(sn,{isOpen:l,isClose:u,children:[t.jsxRuntimeExports.jsx(nn,{onClick:o,title:s==="text"?"Text & Icon Colors":`${Be(s)} Colors`}),s&&t.jsxRuntimeExports.jsxs("div",{className:F.wrapper,children:[t.jsxRuntimeExports.jsx(tp,{}),p.map(c=>{const m=r.colors[s][c];return typeof m!="string"?null:t.jsxRuntimeExports.jsx("div",{className:F.color,children:t.jsxRuntimeExports.jsxs("div",{className:F.content,children:[t.jsxRuntimeExports.jsx("div",{className:F.preview,style:{background:m}}),t.jsxRuntimeExports.jsx(Ve,{title:Be(c),initialColor:m,onChange:x=>a(s,c,x),isGradientActive:s==="surface"})]})},c)})]})]})},rp="_loader_1p5lr_1",op={loader:rp},ip=()=>{const{activeBlock:e,themeSettings:n,isLoadingThemeSettings:s}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s?t.jsxRuntimeExports.jsx("div",{className:op.loader,children:t.jsxRuntimeExports.jsx(mt,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&n.fonts&&t.jsxRuntimeExports.jsx(mu,{}),(e==null?void 0:e.name)==="Fonts"&&n.fonts&&t.jsxRuntimeExports.jsx(su,{}),(e==null?void 0:e.name)==="Colors"&&n.colors&&t.jsxRuntimeExports.jsx(eu,{}),(e==null?void 0:e.name)==="Colors"&&n.colors&&t.jsxRuntimeExports.jsx(sp,{}),(e==null?void 0:e.name)==="Inputs"&&n.inputs&&t.jsxRuntimeExports.jsx(ku,{}),(e==null?void 0:e.name)==="Borders"&&n.borders&&t.jsxRuntimeExports.jsx(Mc,{}),(e==null?void 0:e.name)==="Buttons"&&n.buttons&&t.jsxRuntimeExports.jsx(Kc,{})]})})},ap=()=>{const{activeBlock:e,setActiveBlock:n}=t.useThemeSettingsStore(),{activeBlock:s}=t.useNavbarStore(),r=t.useNavigate();function i(){n(null),r("/admin/builder/theme")}const o=!!e,a=!e||s.name!=="Theme";return t.jsxRuntimeExports.jsxs(sn,{isOpen:o,isClose:a,children:[t.jsxRuntimeExports.jsx(nn,{onClick:i,title:(e==null?void 0:e.name)||""}),t.jsxRuntimeExports.jsx(ip,{})]})},lp=()=>{const{activeBlock:e}=t.useNavbarStore(),{showTooltip:n}=t.useTooltipStore();function s(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return t.jsxRuntimeExports.jsxs("div",{className:Us.sidebar,style:{zIndex:n?50:"auto"},children:[t.jsxRuntimeExports.jsx("h3",{className:Us.title,children:s()}),e.name==="Layers"&&t.jsxRuntimeExports.jsx(Xl,{}),e.name==="Add"&&t.jsxRuntimeExports.jsx(zr,{}),t.jsxRuntimeExports.jsx(kc,{}),t.jsxRuntimeExports.jsx(ap,{}),e.name==="Theme"&&t.jsxRuntimeExports.jsx(rc,{}),e.name==="Settings"&&t.jsxRuntimeExports.jsx(Jl,{})]})},cp="_wrapper_no6if_1",up="_header_no6if_12",pp="_content_no6if_23",dp="_buttons_no6if_44",mp="_label_no6if_51",xp="_description_no6if_52",hp="_preview_no6if_60",gp="_block_no6if_66",fp="_slug_no6if_75",jp="_title_no6if_81",yp="_closeIcon_no6if_87",De={wrapper:cp,header:up,content:pp,buttons:dp,label:mp,description:xp,preview:hp,block:gp,slug:fp,title:jp,closeIcon:yp},_p="_wrapper_ba9vp_2",Sp="_label_ba9vp_10",bp="_options_ba9vp_18",Cp="_radioLabel_ba9vp_24",Ep="_radio_ba9vp_24",vp="_custom_ba9vp_39",wp="_option_ba9vp_18",jt={wrapper:_p,label:Sp,options:bp,radioLabel:Cp,radio:Ep,custom:vp,option:wp},kp=e=>{const{defaultValue:n,options:s,onChange:r,label:i}=e,[o,a]=_.useState(n),l=u=>{const p=u.target.value;a(p),r(p)};return t.jsxRuntimeExports.jsxs("div",{className:jt.wrapper,children:[t.jsxRuntimeExports.jsx("span",{className:jt.label,children:i}),t.jsxRuntimeExports.jsx("div",{className:jt.options,children:s.map(u=>t.jsxRuntimeExports.jsxs("label",{className:jt.radioLabel,children:[t.jsxRuntimeExports.jsx("input",{type:"radio",value:u.value,checked:o===u.value,onChange:l,className:jt.radio}),t.jsxRuntimeExports.jsx("span",{className:jt.custom}),t.jsxRuntimeExports.jsx("span",{className:jt.option,children:u.label})]},u.value))})]})},Rp=()=>{var z,V,B,R,I,M,P;const{setIsOpenModal:e,pages:n,createPage:s,updatePage:r,isEdit:i,setIsEdit:o,editedPage:a,setEditedPage:l,pageContext:u}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),{createPage:c,updatePage:m}=t.useLayersStore(),[x,d]=_.useState(a?n&&((z=n[a])==null?void 0:z.path):""),[g,h]=_.useState(a?n&&((V=n[a])==null?void 0:V.name):""),[b,f]=_.useState(a?n&&((B=n[a])==null?void 0:B.seo)&&((I=(R=n[a])==null?void 0:R.seo)==null?void 0:I.pageDescription)||"":`${u.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[E,C]=_.useState(a&&n&&(M=n[a])!=null&&M.isPrivate?"private":"public");function N(){d(""),h(""),f(""),C("public"),o(!1),l(null)}function w(){p(!1),setTimeout(()=>{N(),e(!1),p(!0)},300)}_.useEffect(()=>()=>{w()},[]);function S(O){return O[0]==="/"?O:"/"+O}function A(){s({path:S(x),name:g||x||"",icon:"File",seo:{pageTitle:g||"",pageDescription:b||""},visibility:E||"public"}),c(S(x)),w()}function $(){n&&(t.defaultPagePaths.includes(n[a].path)||Hr(n[a].path),m(n[a].path||"",x||""),r(a,{path:S(x),name:g||x,icon:n[a].icon||"File",seo:{pageTitle:g||"",pageDescription:b||""},visibility:E||"public"})),w()}return t.jsxRuntimeExports.jsxs("div",{className:De.wrapper,onClick:O=>O.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:De.header,children:[t.jsxRuntimeExports.jsx("h2",{children:i?"Edit Page":"Create New Page"}),t.jsxRuntimeExports.jsx("div",{className:De.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:w})})]}),t.jsxRuntimeExports.jsxs("div",{className:De.content,children:[t.jsxRuntimeExports.jsx(t.Input,{label:"Page Slug",onChange:O=>d(O),value:x,placeholder:"path-to-page",disabled:!!(a&&n&&((P=n[a])!=null&&P.name)&&t.defaultPagePaths.includes(n[a].path)),required:!0,regex:"^.+$"}),t.jsxRuntimeExports.jsx(t.Input,{label:"Page Title",onChange:O=>{h(O)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),t.jsxRuntimeExports.jsx(t.Textarea,{label:"Description",onChange:O=>f(O),value:b,placeholder:`${u.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`,maxLength:150}),t.jsxRuntimeExports.jsx(kp,{label:"Visibility",defaultValue:E,options:[{value:"public",label:"Public"},{value:"private",label:"Private"}],onChange:O=>C(O)}),t.jsxRuntimeExports.jsxs("div",{className:De.preview,children:[t.jsxRuntimeExports.jsx("span",{className:De.label,children:"Preview"}),t.jsxRuntimeExports.jsxs("div",{className:De.block,children:[t.jsxRuntimeExports.jsx("span",{className:De.slug,children:x||"yoursite.url"}),t.jsxRuntimeExports.jsx("span",{className:De.title,children:g||"My Blank Page"}),t.jsxRuntimeExports.jsx("span",{className:De.description,children:b||"It is My Description"})]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:De.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:w,type:"Secondary",children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:i?$:A,disabled:x.length===0,children:i?"Update":"Create"})]})]})},Np="_layout_1pjho_1",Ip="_main_1pjho_10",Tp="_content_1pjho_18",Pp="_notifications_1pjho_26",hn={layout:Np,main:Ip,content:Tp,notifications:Pp},Lp="_notification_2jmah_1",Bp="_text_2jmah_22",Ap="_timer_2jmah_27",Mp="_warning_2jmah_32",$p="_error_2jmah_37",Dp="_success_2jmah_42",Rt={notification:Lp,text:Bp,timer:Ap,warning:Mp,error:$p,success:Dp},Ws={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Ur=e=>{const{type:n,message:s,style:r,padding:i,timer:o,id:a}=e,[l,u]=_.useState(o),{setNotifications:p}=t.useNotificationStore();function c(){const x=t.useNotificationStore.getState().notifications.filter(d=>d.id!==a);p([...x])}return _.useEffect(()=>{const m=setTimeout(()=>{c()},o*1e3);return()=>clearTimeout(m)},[o]),_.useEffect(()=>{const m=setInterval(()=>u(x=>x-1),1e3);return()=>clearInterval(m)},[l]),t.jsxRuntimeExports.jsx("div",{style:{padding:i,position:"relative"},children:t.jsxRuntimeExports.jsxs("div",{className:t.clx(Rt.notification,{[Rt.warning]:n==="warning",[Rt.error]:n==="error",[Rt.success]:n==="success"}),style:r,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",fill:Ws[n],width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:Rt.text,children:s}),o&&t.jsxRuntimeExports.jsx("div",{className:Rt.timer,children:l}),t.jsxRuntimeExports.jsx("div",{style:{display:"flex"},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:Ws[n],width:20,height:20,hoverable:!0,onClick:()=>c()})})]})})},Fp="_modal_1h74q_1",Op="_title_1h74q_14",Hp="_buttons_1h74q_20",gn={modal:Fp,title:Op,buttons:Hp},Vr=()=>{const{title:e,description:n,onConfirm:s,setTitle:r,setDescription:i,setOnConfirm:o}=t.useConfirmationModalStore(),{setIsOpen:a}=t.useModalStore();function l(){a(!1),setTimeout(()=>{r(null),i(null),o(null),a(!0)},300)}return e&&n&&s&&t.jsxRuntimeExports.jsxs("div",{className:gn.modal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:gn.title,children:e}),t.jsxRuntimeExports.jsx("div",{className:gn.description,children:n}),t.jsxRuntimeExports.jsxs("div",{className:gn.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{onClick:l,children:"Cancel"}),t.jsxRuntimeExports.jsx(t.Button,{onClick:()=>{s(),l()},type:"Secondary",children:"Confirm"})]})]})},zp="_modal_270ti_1",Up="_padding_270ti_17",Vp="_content_270ti_21",Wp="_close_270ti_42",fn={modal:zp,padding:Up,content:Vp,close:Wp},wn=e=>{const{close:n,children:s,withAnimation:r=!0,hasPadding:i=!0}=e,{isOpen:o,setIsOpen:a}=t.useModalStore();return _.useEffect(()=>{const l=()=>{a(!1),r?setTimeout(()=>{n(!1),a(!0)},300):(n(!1),a(!0))};return document.body.addEventListener("click",l),()=>{document.body.removeEventListener("click",l)}},[]),t.jsxRuntimeExports.jsx("div",{className:t.clx(fn.modal,{[fn.padding]:i}),children:r?t.jsxRuntimeExports.jsx("div",{className:t.clx(fn.content,{[fn.close]:!o}),children:s}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s})})},qp=()=>{const{isOpenModal:e,setIsOpenModal:n}=t.usePagesStore(),{openModal:s,setOpenModal:r}=t.useChooseImageStore(),{notifications:i}=t.useNotificationStore(),{title:o,description:a,setTitle:l,setDescription:u,setOnConfirm:p}=t.useConfirmationModalStore();return t.jsxRuntimeExports.jsxs("div",{id:"builder",children:[t.jsxRuntimeExports.jsxs("div",{className:hn.layout,children:[t.jsxRuntimeExports.jsx(Ea,{}),t.jsxRuntimeExports.jsxs("main",{className:hn.main,children:[t.jsxRuntimeExports.jsx(ha,{}),t.jsxRuntimeExports.jsxs("div",{className:hn.content,children:[t.jsxRuntimeExports.jsx(lp,{}),t.jsxRuntimeExports.jsx(Rl,{})]})]})]}),o&&a&&t.jsxRuntimeExports.jsx(wn,{close:()=>{l(null),u(null),p(null)},children:t.jsxRuntimeExports.jsx(Vr,{})}),e&&t.jsxRuntimeExports.jsx(wn,{close:n,children:t.jsxRuntimeExports.jsx(Rp,{})}),s&&t.jsxRuntimeExports.jsx(wn,{close:r,children:t.jsxRuntimeExports.jsx(t.ChooseImageModal,{})}),i.length>0&&t.jsxRuntimeExports.jsx("div",{className:hn.notifications,children:i.map(c=>t.jsxRuntimeExports.jsx(Ur,{type:c.status,message:c.message,timer:10,id:c.id},c.id))})]})};async function Nt(e,n){const s=localStorage.getItem("shopId")||void 0,r=`${t.API_URL}/${e}/builder/shops/${s}/${n}`;return(await t.request({url:r,withToken:!0,method:"get"})).data}async function Gp(){try{const[e,n,s,r,i,o,a,l]=await Promise.allSettled([Nt("v1","general"),Nt("v1","faqs"),Nt("v1","listings"),Nt("v1","products"),Nt("v1","reviews"),Nt("v1","categories"),{data:null},{data:null}]);return{general:e,faqs:n,listings:s,products:r,reviews:i,categories:o,fullPosts:a,posts:l}}catch(e){throw console.error("Error fetching page data:",e),e}}async function Zp(){try{const{data:e}=await t.axios.get(`${t.GOOGLE_FONTS_API}?key=AIzaSyAEsTbjAPUz_TeuFCq4z4LPK9w_vst0Pfw`);return e.items}catch(e){throw console.error("Error fetching page data:",e),e}}async function Xp(){var r;const e=localStorage.getItem("shopId"),n=localStorage.getItem("draftId"),s=`${t.API_URL}/v2/builder/shops/${e}/drafts/${n}/pages`;try{return(await t.request({url:s,withToken:!0,method:"get"})).data}catch(i){return{data:[],status:(r=i.response)==null?void 0:r.status}}}async function Yp(){const e=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId")||void 0,s=`${t.API_URL}/v2/builder/shops/${e}/drafts/${n}/all`;return(await t.request({url:s,withToken:!0,method:"get"})).data}const Kp=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,{setBlocks:a,setSourceBlocks:l,setHeader:u,setFooter:p,setAnnouncement:c,setSettings:m}=t.useBlocksStore(),{fonts:x,setFonts:d}=t.useFontsStore(),{setSettings:g}=t.useSettingsStore(),{setPageContext:h}=t.usePagesStore(),{setThemeSettings:b,setIsLoadingThemeSettings:f}=t.useThemeSettingsStore(),{setIsLoadingSettings:E}=t.useSettingsStore(),{notifications:C,setNotifications:N}=t.useNotificationStore(),{setBlocks:w,blocks:S,createPage:A,setIsLoadingLayers:$,setHeader:z,setAnnouncement:V,setFooter:B}=t.useLayersStore(),{setPages:R,setCurrentPage:I}=t.usePagesStore();return _.useEffect(()=>{f(!0),$(!0),E(!0);const M={};Object.keys(n).forEach(O=>{M[O]=n[O]}),l(M),a(M),u(r),p(i),c(o),m(s),(async()=>{const O={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},D=await Gp();Object.keys(D).map(Q=>{const ge=Q;O[ge]=D[ge].value.data}),h(O);const{data:L}=await Yp(),{themeSettings:H,layers:j,settings:se}=L||{};if(se){if(se.settings){const Q=new s;Q.blockSettings={displayName:"Settings",isAddable:!1,...se.settings},g(Q)}se.header&&z(se.header),se.footer&&B(se.footer),se.announcement&&V(se.announcement)}else{const Q=new s;g(Q)}H&&b(H);const he=await Xp(),y={};if(he.status>=400&&N([...C,{id:t.v4(),message:"Error fetching pages",status:"error"}]),he.data.length>0?(he.data.forEach(Q=>{S[Q.path]||A(Q.path),y[Q.id||Q.path]={...Q,icon:t.pages[Q.path]?t.pages[Q.path].icon:"File",name:Q.name?Q.name:t.pages[Q.path].name}}),R(y),I(Object.keys(y)[0])):(R(t.pages),I(Object.keys(t.pages)[0])),x.length===0){const Q=await Zp();d([...Q.map(ge=>{const G=ge.variants.map(je=>{if(!je.includes("italic"))return je==="regular"?"400":je}).filter(je=>je!==void 0);return{name:ge.family,weights:G}})])}w(j),f(!1),$(!1),E(!1)})()},[]),t.jsxRuntimeExports.jsx(qp,{})};function Jp(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}function Qp(){const e=new URLSearchParams(document.location.search),n=e.get("shopId")||localStorage.getItem("shopId"),s=e.get("sellerAccessToken")||localStorage.getItem("sellerAccessToken"),r=e.get("draftId")||localStorage.getItem("draftId");return Jp(),s&&localStorage.setItem("sellerAccessToken",s),n&&localStorage.setItem("shopId",n),r&&localStorage.setItem("draftId",r),!!(s&&n&&r)}const ed=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,[a,l]=_.useState(!0),u=t.useNavigate();return _.useEffect(()=>{l(!0),Qp()?l(!1):u("/")},[]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a?t.jsxRuntimeExports.jsx(mt,{}):t.jsxRuntimeExports.jsx(Kp,{blocks:n,settings:s,header:r,footer:i,announcement:o})})},td="_wrapper_1yd2j_1",nd="_error_1yd2j_11",sd="_title_1yd2j_21",rd="_buttons_1yd2j_29",Vt={wrapper:td,error:nd,title:sd,buttons:rd},qs=async e=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),r=`${t.API_URL}/v2/builder/shops/${n}/drafts/${s}/reset`;return await t.request({url:r,withToken:!0,method:"post",body:e})},od=()=>{const{error:e,setError:n}=t.useErrorStore(),{pages:s}=t.usePagesStore(),{setIsOpen:r}=t.useModalStore(),{title:i,description:o,setOnConfirm:a,setTitle:l,setDescription:u}=t.useConfirmationModalStore(),{setBlocks:p}=t.useLayersStore();async function c(){await qs({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),n(null),p({}),window.location.reload()}async function m(){const x=[];s&&Object.keys(s).map(d=>s[d].id).filter(d=>d!==void 0).map(d=>x.push(d)),await qs({resetSettings:!0,resetThemeSettings:!0,resetPageIds:x}),n(null)}return t.jsxRuntimeExports.jsxs("div",{className:Vt.wrapper,children:[t.jsxRuntimeExports.jsxs("div",{className:Vt.error,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("div",{className:Vt.title,children:"Oops! Something went wrong"}),t.jsxRuntimeExports.jsx("span",{className:Vt.message,children:(e==null?void 0:e.message)||""})]}),t.jsxRuntimeExports.jsxs("div",{className:Vt.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:c,children:"Reset Settings"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:x=>{x.stopPropagation(),l("Reset All Settings"),u("Are you sure you want to reset all settings? This is irreversible."),a(async()=>{await m()})},children:"Reset All Settings"})]})]}),i&&o&&t.jsxRuntimeExports.jsx(wn,{close:()=>{r(!1),setTimeout(()=>{l(null),u(null),a(null),r(!0)},300)},children:t.jsxRuntimeExports.jsx(Vr,{})})]})},id=e=>{const{children:n}=e,{pathname:s}=t.useLocation(),{setActiveBlock:r}=t.useNavbarStore(),{setActiveBlock:i}=t.useThemeSettingsStore(),{setActiveBlock:o}=t.usePreviewStore();return _.useEffect(()=>{switch(o({id:null,neededScroll:!1}),s){case"/admin/builder":r(t.navbarBlocks[0]);break;case"/admin/builder/add":r(t.navbarBlocks[1]);break;case"/admin/builder/theme":r(t.navbarBlocks[2]);break;case"/admin/builder/settings":r(t.navbarBlocks[3]);break;case"/admin/builder/theme/colors":r(t.navbarBlocks[2]),i(Ue[0]);break;case"/admin/builder/theme/fonts":r(t.navbarBlocks[2]),i(Ue[1]);break;case"/admin/builder/theme/borders":r(t.navbarBlocks[2]),i(Ue[2]);break;case"/admin/builder/theme/buttons":r(t.navbarBlocks[2]),i(Ue[3]);break;case"/admin/builder/theme/inputs":r(t.navbarBlocks[2]),i(Ue[4]);break}},[s]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:n})},ad="_lock_1mxa7_1",ld="_wrapper_1mxa7_12",cd="_content_1mxa7_22",ud="_info_1mxa7_31",pd="_buttons_1mxa7_38",dd="_button_1mxa7_38",md="_input_1mxa7_50",xd="_error_1mxa7_57",Fe={lock:ad,wrapper:ld,content:cd,info:ud,buttons:pd,button:dd,input:md,error:xd},hd=()=>{const[e,n]=_.useState(!1),[s,r]=_.useState(!1),[i,o]=_.useState(""),{general:a,setGeneral:l}=t.useGeneralStore(),{setShopPassword:u}=t.useStorefrontStore(),p=t.useLocation(),c=t.useNavigate();_.useEffect(()=>{if(a&&(!a.info.passwordProtected||a.isPasswordValid)){const x=p.state.from==="/validation"?"/":p.state.from;c(x)}},[a]),_.useEffect(()=>{a||(async()=>{var h;n(!0);const d=localStorage.getItem("shopPassword")||"",g=await us(d);if(g.isPasswordValid){const b=((h=p.state)==null?void 0:h.from)||"/";c(b)}l(g),n(!1)})()},[a]);async function m(){var d;n(!0);const x=await us(i);if(!x.isPasswordValid)r(!0);else{localStorage.setItem("shopPassword",i),u(i);const g=((d=p.state)==null?void 0:d.from)||"/";c(g),l(x)}n(!1)}return t.jsxRuntimeExports.jsxs("div",{className:Fe.wrapper,children:[!e&&t.jsxRuntimeExports.jsxs("div",{className:Fe.content,children:[t.jsxRuntimeExports.jsx("div",{className:Fe.lock,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),t.jsxRuntimeExports.jsxs("div",{className:Fe.info,children:[t.jsxRuntimeExports.jsx("h2",{id:"h2",className:Fe.title,children:"The store is password protected"}),t.jsxRuntimeExports.jsx("p",{id:"p",className:Fe.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),t.jsxRuntimeExports.jsxs("div",{className:Fe.input,children:[t.jsxRuntimeExports.jsx(t.Input$1,{type:"password",onChange:x=>{r(!1),o(x)},value:i,placeholder:"Password",required:!0}),t.jsxRuntimeExports.jsx("span",{className:Fe.error,children:s&&"Incorrect password"})]}),t.jsxRuntimeExports.jsxs("div",{className:Fe.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:Fe.button,onClick:()=>c("/contact"),children:"Contact Support"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",className:Fe.button,disabled:s,onClick:m,children:"Submit"})]})]}),e&&t.jsxRuntimeExports.jsx(t.Loader,{})]})},gd="_notifications_2ywhg_1",fd={notifications:gd},jd=({children:e})=>{const n=t.useLocation(),{token:s,setToken:r}=t.useStorefrontStore(),{dashInfo:i,setDashInfo:o}=t.useCustomerDashboardStore(),{shopPassword:a}=t.useStorefrontStore(),l=t.useNavigate(),[u,p]=t.useSearchParams(),{notifications:c}=t.useNotificationStore(),[m,x]=_.useState(!0),{setCustomerEmail:d}=t.useCartStore(),{setThemeSettings:g,themeSettings:h}=t.useThemeSettingsStore(),{settings:b,setSettings:f}=t.useSettingsStore(),{setHeader:E,setFooter:C,setAnnouncement:N,header:w,footer:S,announcement:A}=t.useLayersStore(),{general:$,setGeneral:z}=t.useGeneralStore(),{pageContext:V,setPageContext:B}=t.usePagesStore(),R=async()=>{const I=await t.getDynamicPage(encodeURIComponent("/products"));if(I){const{data:M}=I;B({...V,listings:M.listings})}};return _.useEffect(()=>{const I=localStorage.getItem("token");if(I&&(!s||!i))try{const M=t.jwtDecode(I);o(M),r(I),d(M.email)}catch(M){console.error("Failed to decode token:",M),localStorage.removeItem("token"),r(""),o(null)}},[s,i]),_.useEffect(()=>{const I=u.get("r");I&&(localStorage.setItem("referralCode",I),u.delete("r"),p(u),l({pathname:n.pathname,search:u.toString()},{replace:!0}))},[u,n]),_.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&$&&($.info.passwordProtected&&a||$.isPasswordValid)&&R()},[$,a]),_.useEffect(()=>{x(!0);const I=async()=>{if(!$){const P=await us(a);P.isPasswordValid||n.pathname.includes("/admin/builder")||l("/validation",{state:{from:n.pathname}}),z(P)}},M=async()=>{const{settings:P,theme:O}=(await xi()).data;if(P&&b){const D=b;if(P.settings?(Object.keys(P.settings).map(L=>{D.blockSettings[L]=P.settings[L]}),f(D)):f(b),P.header&&w){const L=w;Object.keys(P.header).map(H=>{L[H]=P.header[H]}),E(L)}if(P.footer&&S){const L=S;Object.keys(P.footer).map(H=>{L[H]=P.footer[H]}),C(L)}if(P.announcement&&A){const L=A;Object.keys(P.announcement).map(H=>{L[H]=P.announcement[H]}),N(L)}}else f(b);g(h),g(O||h),x(!1)};n.pathname.startsWith("/validation")||I(),M()},[]),n.pathname.startsWith("/admin/builder")?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:m?t.jsxRuntimeExports.jsx("div",{style:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e,c.length>0&&t.jsxRuntimeExports.jsx("div",{className:fd.notifications,children:c.map(I=>t.jsxRuntimeExports.jsx(Ur,{type:I.status,message:I.message,timer:10,id:I.id},I.id))})]})})},yd=()=>(_.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),t.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxRuntimeExports.jsx(t.Loader,{})})),_d="_wrapper_rccv2_1",Sd="_content_rccv2_11",bd="_title_rccv2_21",Yn={wrapper:_d,content:Sd,title:bd},tt=()=>{const e=t.useNavigate();return t.jsxRuntimeExports.jsx("div",{className:Yn.wrapper,children:t.jsxRuntimeExports.jsxs("div",{className:Yn.content,children:[t.jsxRuntimeExports.jsx("h1",{className:Yn.title,children:"Something went wrong"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>{e("/")},children:"Go to Home"})]})})},Cd=({children:e,shopDomain:n,shopId:s,shopPassword:r})=>{const{setShopDomain:i,setShopId:o,setShopPassword:a,setShopTerms:l,setShopPrivacyPolicy:u,setShopRefundPolicy:p}=t.useStorefrontStore();return _.useLayoutEffect(()=>{const c=async()=>{const{data:d}=await gi();l(d)},m=async()=>{const{data:d}=await ji();u(d)},x=async()=>{const{data:d}=await fi();p(d)};i(n),o(s),r&&a(r),c(),m(),x()},[n,s,r]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e})},Ed="_checkoutItemsContainer_1kn61_2",vd="_innerContainer_1kn61_16",wd="_headerSection_1kn61_22",kd="_header_1kn61_22",Rd="_productsContainer_1kn61_47",Nd="_couponContainer_1kn61_54",Id="_checkoutFooter_1kn61_58",yt={checkoutItemsContainer:Ed,innerContainer:vd,headerSection:wd,header:kd,productsContainer:Rd,couponContainer:Nd,checkoutFooter:Id},Td="_checkoutFooter_1dzvc_1",Pd="_footerBranding_1dzvc_9",Ld="_poweredText_1dzvc_14",Bd="_footerNav_1dzvc_19",jn={checkoutFooter:Td,footerBranding:Pd,poweredText:Ld,footerNav:Bd},Ad="data:image/svg+xml,%3csvg%20width='100'%20height='26'%20viewBox='0%200%20100%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20.3996%203.39999V12.8228L16.2964%2014.1313V8.89738L7.69363%2011.587V6.87107L20.3996%203.39999Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M16.2964%2014.1313L16.2962%2018.6292L3.59961%2022.6V12.7592L7.69363%2011.587L7.69344%2016.9118L16.2964%2014.1313Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M95.6308%2022C93.4931%2022%2091.8804%2020.882%2091.4678%2019.1776L93.118%2019.0676C93.4181%2019.984%2094.0931%2020.5338%2095.6308%2020.5338C97.4311%2020.5338%2098.4249%2019.8373%2098.4249%2018.4078V16.8316C97.9374%2017.858%2096.8122%2018.5178%2095.5183%2018.5178C92.9868%2018.5178%2091.1865%2016.575%2091.1865%2013.8076C91.1865%2011.0401%2092.9492%209.09737%2095.4433%209.09737C96.831%209.09737%2098.0499%209.77549%2098.5%2010.8568V9.3173H100V18.3711C100%2020.6438%2098.3687%2022%2095.6308%2022ZM95.5933%2017.0515C97.2998%2017.0515%2098.4062%2015.8053%2098.4249%2013.8076C98.4624%2011.8099%2097.3186%2010.5636%2095.5933%2010.5636C93.8494%2010.5636%2092.8367%2011.8099%2092.8367%2013.8076C92.8367%2015.8053%2093.8869%2017.0515%2095.5933%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M81.1836%2019.0309V9.3173H82.6275L82.665%2011.0584C83.1901%209.72051%2084.3527%209.09737%2085.7217%209.09737C87.9907%209.09737%2089.0783%2010.7285%2089.0783%2012.7812V19.0309H87.5031V13.2211C87.5031%2011.425%2086.8843%2010.4536%2085.3841%2010.4536C83.8464%2010.4536%2082.7588%2011.425%2082.7588%2013.2211V19.0309H81.1836Z'%20fill='%23252525'/%3e%3cpath%20d='M73.3176%2019.2509C71.2549%2019.2509%2069.9609%2018.2795%2069.9609%2016.6117C69.9609%2014.9622%2070.9173%2014.0458%2073.0926%2013.6426L76.618%2013.0011C76.618%2011.37%2075.8304%2010.5636%2074.2552%2010.5636C72.8676%2010.5636%2072.0987%2011.1867%2071.7987%2012.3047L70.1297%2012.1764C70.5048%2010.3436%2072.0049%209.09737%2074.2552%209.09737C76.8056%209.09737%2078.1932%2010.6002%2078.1932%2013.0561V17.0699C78.1932%2017.5097%2078.3433%2017.6747%2078.7183%2017.6747H79.1121V19.0309C78.9996%2019.0493%2078.7558%2019.0676%2078.512%2019.0676C77.3119%2019.0676%2076.7681%2018.6094%2076.6368%2017.5281C76.1492%2018.5361%2074.7803%2019.2509%2073.3176%2019.2509ZM73.4676%2017.8946C75.4554%2017.8946%2076.618%2016.6483%2076.618%2015.0355V14.3391L73.3926%2014.9255C72.0425%2015.1638%2071.6111%2015.6586%2071.6111%2016.4651C71.6111%2017.3814%2072.305%2017.8946%2073.4676%2017.8946Z'%20fill='%23252525'/%3e%3cpath%20d='M63.2168%2022C61.079%2022%2059.4663%2020.882%2059.0537%2019.1776L60.704%2019.0676C61.004%2019.984%2061.6791%2020.5338%2063.2168%2020.5338C65.017%2020.5338%2066.0109%2019.8373%2066.0109%2018.4078V16.8316C65.5233%2017.858%2064.3982%2018.5178%2063.1043%2018.5178C60.5727%2018.5178%2058.7725%2016.575%2058.7725%2013.8076C58.7725%2011.0401%2060.5352%209.09737%2063.0293%209.09737C64.4169%209.09737%2065.6358%209.77549%2066.0859%2010.8568V9.3173H67.5861V18.3711C67.5861%2020.6438%2065.9546%2022%2063.2168%2022ZM63.1793%2017.0515C64.8857%2017.0515%2065.9921%2015.8053%2066.0109%2013.8076C66.0484%2011.8099%2064.9045%2010.5636%2063.1793%2010.5636C61.4353%2010.5636%2060.4227%2011.8099%2060.4227%2013.8076C60.4227%2015.8053%2061.4728%2017.0515%2063.1793%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M56.2141%2019.0309C55.0515%2019.0309%2054.2451%2018.4811%2054.2451%2017.1982L54.2639%206.01834H55.8391V17.0699C55.8391%2017.4731%2056.0453%2017.6747%2056.4579%2017.6747H57.3205V19.0309H56.2141Z'%20fill='%23252525'/%3e%3cpath%20d='M51.0686%2019.0309C49.906%2019.0309%2049.0996%2018.4811%2049.0996%2017.1982L49.1184%206.01834H50.6936V17.0699C50.6936%2017.4731%2050.8998%2017.6747%2051.3124%2017.6747H52.175V19.0309H51.0686Z'%20fill='%23252525'/%3e%3cpath%20d='M44.5209%2019.0309V9.3173H46.0961V19.0309H44.5209ZM44.4834%207.79611V6H46.1336V7.79611H44.4834Z'%20fill='%23252525'/%3e%3cpath%20d='M32%2019.0309V6.01834H36.5756C39.726%206.01834%2041.3012%207.09967%2041.3012%209.51891C41.3012%2010.9851%2040.4198%2012.0481%2038.9384%2012.3047C40.7574%2012.5613%2041.8638%2013.7709%2041.8638%2015.4571C41.8638%2017.8213%2040.2323%2019.0309%2037.3257%2019.0309H32ZM37.3257%2017.4914C39.1447%2017.4914%2040.176%2016.74%2040.176%2015.3654C40.176%2013.9908%2039.1447%2013.1844%2037.3257%2013.1844H33.6127V17.4914H37.3257ZM36.5756%2011.6449C38.5258%2011.6449%2039.6135%2010.8935%2039.6135%209.59222C39.6135%208.21765%2038.6008%207.55786%2036.5756%207.55786H33.6127V11.6449H36.5756Z'%20fill='%23252525'/%3e%3c/svg%3e",rt=({className:e})=>{const{shopTerms:n,shopPrivacyPolicy:s,shopRefundPolicy:r}=t.useStorefrontStore();return t.jsxRuntimeExports.jsxs("footer",{className:`${jn.checkoutFooter} ${e}`,children:[t.jsxRuntimeExports.jsxs("div",{className:jn.footerBranding,children:[t.jsxRuntimeExports.jsx("p",{className:jn.poweredText,children:"Powered by"}),t.jsxRuntimeExports.jsx("img",{src:Ad,alt:"Billgang"})]}),t.jsxRuntimeExports.jsx("nav",{children:t.jsxRuntimeExports.jsxs("ul",{className:jn.footerNav,children:[(n==null?void 0:n.showTermsOfServiceOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:n.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(s==null?void 0:s.showPrivacyPolicyOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:s.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},Md="_checkoutHeader_d2mbf_1",$d="_leftContainer_d2mbf_20",Dd="_backArrow_d2mbf_26",Fd="_logoContainer_d2mbf_38",Od="_logo_d2mbf_38",Wt={checkoutHeader:Md,leftContainer:$d,backArrow:Dd,logoContainer:Fd,logo:Od},Hd="_activeBadge_1yb5i_1",zd="_activeBadgeText_1yb5i_12",Gs={activeBadge:Hd,activeBadgeText:zd},Ud=({className:e})=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(Gs.activeBadge,e),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",width:20,height:20}),t.jsxRuntimeExports.jsx("p",{className:Gs.activeBadgeText,children:"Active"})]}),Vd="_timerContainer_105jf_2",Wd="_timerText_105jf_12",Zs={timerContainer:Vd,timerText:Wd},qd=({expiresAt:e})=>{const[n,s]=_.useState(r());function r(){const i=new Date,o=new Date(e).getTime()-i.getTime();if(o<=0)return{hours:"00",minutes:"00",seconds:"00"};const a=Math.floor(o/(1e3*60*60)),l=Math.floor(o%(1e3*60*60)/(1e3*60)),u=Math.floor(o%(1e3*60)/1e3);return{hours:String(a).padStart(2,"0"),minutes:String(l).padStart(2,"0"),seconds:String(u).padStart(2,"0")}}return _.useEffect(()=>{const i=setInterval(()=>{s(r())},1e3);return()=>clearInterval(i)},[e]),n.hours==="00"&&n.minutes==="00"&&n.seconds==="00"?null:t.jsxRuntimeExports.jsxs("div",{className:Zs.timerContainer,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Clock"}),t.jsxRuntimeExports.jsxs("p",{className:Zs.timerText,children:[n.hours,":",n.minutes,":",n.seconds]})]})},Gd="_progressBar_mcabf_4",Zd="_progressBarLabel_mcabf_12",Xd="_progressBarTrack_mcabf_17",Yd="_progressBarFill_mcabf_28",yn={progressBar:Gd,progressBarLabel:Zd,progressBarTrack:Xd,progressBarFill:Yd},Wr=({color:e,percent:n,disablePercentLabel:s})=>t.jsxRuntimeExports.jsxs("div",{className:yn.progressBar,children:[!s&&t.jsxRuntimeExports.jsxs("p",{className:yn.progressBarLabel,children:[n,"%"]}),t.jsxRuntimeExports.jsx("div",{className:yn.progressBarTrack,children:t.jsxRuntimeExports.jsx("div",{style:{width:`${n}%`,background:e||void 0},className:yn.progressBarFill})})]}),Kd="_rating_1bpps_4",Jd="_disabled_1bpps_9",Qd="_ratingStar_1bpps_14",em="_inactive_1bpps_22",_n={rating:Kd,disabled:Jd,ratingStar:Qd,inactive:em},tm=({setRating:e,rating:n,disabled:s})=>{const[r,i]=_.useState(0),o=l=>{s||i(+l.currentTarget.id)},a=l=>{s||e(l)};return t.jsxRuntimeExports.jsx("div",{className:t.clx(_n.rating,{[_n.disabled]:s}),onMouseLeave:()=>i(0),children:[1,2,3,4,5].map(l=>t.jsxRuntimeExports.jsx("div",{id:l.toString(),className:t.clx(_n.ratingStar,{[_n.inactive]:!(n>=l||r>=l)}),onMouseEnter:o,onClick:()=>a(l),children:n>=l||r>=l?t.jsxRuntimeExports.jsx(t.FilledStar,{}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Star",fill:"var(--text-secondary)",width:22,height:21})},l))})},nm="_inputRange_iv6ow_4",sm="_inputRangeLabel_iv6ow_14",rm="_progressBar_iv6ow_22",om="_progressBarFill_iv6ow_29",im="_stepsContainer_iv6ow_40",am="_step_iv6ow_40",lm="_stepDot_iv6ow_57",cm="_current_iv6ow_61",um="_active_iv6ow_69",pm="_inactive_iv6ow_72",dm="_tooltip_iv6ow_77",Ie={inputRange:nm,inputRangeLabel:sm,progressBar:rm,progressBarFill:om,stepsContainer:im,step:am,stepDot:lm,current:cm,default:"_default_iv6ow_65",active:um,inactive:pm,tooltip:dm},mm=({totalSteps:e,step:n,onStepChange:s,label:r})=>{const[i,o]=_.useState(n),a=i===1?0:(i-1)/(e-1)*100,l=u=>{o(u),s(u)};return t.jsxRuntimeExports.jsxs("div",{className:Ie.inputRange,children:[r&&t.jsxRuntimeExports.jsx("div",{className:Ie.inputRangeLabel,children:r}),t.jsxRuntimeExports.jsxs("div",{className:Ie.progressBar,children:[t.jsxRuntimeExports.jsx("div",{className:Ie.progressBarFill,style:{width:`${Math.ceil(a)}%`}}),t.jsxRuntimeExports.jsx("div",{className:Ie.stepsContainer,children:[...Array(e)].map((u,p)=>{const c=p+1,m=c<=i,x=c===i;return t.jsxRuntimeExports.jsxs("div",{className:Ie.step,onClick:()=>l(c),children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(Ie.stepDot,x?Ie.current:Ie.default,m?Ie.active:Ie.inactive)}),x&&t.jsxRuntimeExports.jsxs("div",{className:Ie.tooltip,style:{transform:`translateX(calc(50% - ${a<99?"40px":"70px"}))`},children:[t.jsxRuntimeExports.jsx("span",{children:i}),t.jsxRuntimeExports.jsx("span",{children:i===1?"month":"months"})]})]},c)})})]})]})},rn=({className:e,expiresAt:n})=>{const{shopGeneral:s}=t.useStorefrontStore(),r=t.useNavigate();return t.jsxRuntimeExports.jsxs("header",{className:`${Wt.checkoutHeader} ${e}`,children:[t.jsxRuntimeExports.jsxs("div",{className:Wt.leftContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Wt.backArrow,onClick:()=>{window.history.length>2?r(-1):r("/")},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowUp"})}),(s==null?void 0:s.info.logo)&&t.jsxRuntimeExports.jsx("div",{className:Wt.logoContainer,children:t.jsxRuntimeExports.jsx("img",{className:Wt.logo,src:t.convertCfImageIdToUrl(s.info.logo.cfId)})})]}),n&&t.jsxRuntimeExports.jsx(qd,{expiresAt:n})]})},xm="_checkoutPrices_vp75r_1",hm="_priceRow_vp75r_12",gm="_label_vp75r_22",fm="_totalRow_vp75r_26",jm="_totalLabel_vp75r_37",ym="_totalValue_vp75r_42",Oe={checkoutPrices:xm,priceRow:hm,label:gm,totalRow:fm,totalLabel:jm,totalValue:ym},on=({formatter:e,coupon:n,discount:s,totalWithDiscount:r,total:i,className:o,isShowSubtotal:a=!0,feeOrDiscount:l})=>{const u=Math.max(0,s),{priceAdjusment:p}=t.useCartStore();return t.jsxRuntimeExports.jsxs("div",{className:`${Oe.checkoutPrices} ${o||""}`,children:[a&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsx("p",{className:Oe.label,children:"Subtotal"}),t.jsxRuntimeExports.jsx("p",{children:e.format(i)})]}),(n||u>0)&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsxs("p",{className:Oe.label,children:["Discount ",n&&!(n!=null&&n.isFixed)&&`(${n==null?void 0:n.discount}%)`]}),t.jsxRuntimeExports.jsxs("p",{children:["-",e.format(u)]})]}),l!=null&&l!==0&&p&&(p.fixedAmount!==0||p.percentage!==0)&&t.jsxRuntimeExports.jsxs("div",{className:Oe.priceRow,children:[t.jsxRuntimeExports.jsxs("p",{className:Oe.label,children:[p.isDiscount?"Discount: ":"Fee: ",p.percentage!==0&&p.fixedAmount===0&&`(${p.percentage}%)`,p.fixedAmount!==0&&p.percentage===0&&`(${e.format(p.fixedAmount)})`,p.percentage!==0&&p.fixedAmount!==0&&`(${p.percentage}% + ${e.format(p.fixedAmount)})`]}),t.jsxRuntimeExports.jsx("p",{children:e.format(l)})]}),t.jsxRuntimeExports.jsxs("div",{className:Oe.totalRow,children:[t.jsxRuntimeExports.jsx("p",{className:Oe.totalLabel,children:"Total Due"}),p&&l?t.jsxRuntimeExports.jsx("p",{className:Oe.totalValue,children:r?e.format(Math.max(p.isDiscount?r-l:r+l,0)):e.format(Math.max(p.isDiscount?i-l:i+l,0))}):t.jsxRuntimeExports.jsx("p",{className:Oe.totalValue,children:r?e.format(Math.max(r,0)):e.format(Math.max(i,0))})]})]})},_m="_checkoutProduct_n1naa_1",Sm="_isOrder_n1naa_1",bm="_productDetails_n1naa_10",Cm="_productImage_n1naa_16",Em="_isOrderImage_n1naa_26",vm="_image_n1naa_30",wm="_productInfo_n1naa_35",km="_productHeader_n1naa_40",Rm="_quantityBadge_n1naa_46",Nm="_productPrice_n1naa_62",Im="_deliveryCategories_n1naa_71",Tm="_customerNote_n1naa_79",Pm="_noteHeader_n1naa_86",Lm="_logoContainer_n1naa_92",Bm="_shopName_n1naa_104",Am="_noteContent_n1naa_108",Mm="_productName_n1naa_114",xe={checkoutProduct:_m,isOrder:Sm,productDetails:bm,productImage:Cm,isOrderImage:Em,image:vm,productInfo:wm,productHeader:km,quantityBadge:Rm,productPrice:Nm,deliveryCategories:Im,customerNote:Tm,noteHeader:Pm,logoContainer:Lm,shopName:Bm,noteContent:Am,productName:Mm},Cs=({isOrder:e,product:n})=>{var o;const{shopGeneral:s}=t.useStorefrontStore(),r=n.subscriptionSettings,{cart:i}=t.useCart();return console.log("product",n),t.jsxRuntimeExports.jsxs("div",{className:`${xe.checkoutProduct} ${e?xe.isOrder:""}`,children:[t.jsxRuntimeExports.jsxs("div",{className:xe.productDetails,children:[t.jsxRuntimeExports.jsx("div",{className:`${xe.productImage} ${e?xe.isOrderImage:""}`,children:n!=null&&n.image?t.jsxRuntimeExports.jsx("img",{className:xe.image,src:t.convertCfImageIdToUrl(n.image.cfId)}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("div",{className:xe.productInfo,children:t.jsxRuntimeExports.jsxs("div",{className:xe.productHeader,children:[t.jsxRuntimeExports.jsx("h2",{className:xe.productName,children:n.name}),t.jsxRuntimeExports.jsxs("span",{className:xe.quantityBadge,children:[n.price.quantity,"x"]})]})}),n.chargeType==="RECURRING"&&t.jsxRuntimeExports.jsx("p",{className:xe.productPrice,children:r&&`${t.formatPrice(r.price)} / ${t.normalizeInterval(r.recurringIntervalDays||0)}${r.entryFee?" + "+t.formatPrice(r.entryFee):""}`}),n.chargeType==="ONE_TIME"&&t.jsxRuntimeExports.jsx("p",{className:xe.productPrice,children:n.variantsGateways&&i.gateway&&n.variantsGateways.some(a=>a.name===i.gateway&&a.overrodePrice)?t.formatPrice(((o=n.variantsGateways.find(a=>a.name===i.gateway))==null?void 0:o.overrodePrice)||n.price):t.formatPrice(n.price)})]}),n.deliveryCategories&&t.jsxRuntimeExports.jsx("div",{className:xe.deliveryCategories,children:n.deliveryCategories.map(a=>t.jsxRuntimeExports.jsx(t.DeliveryItem,{deliveryConfiguration:a},a.id))}),n.customerNote&&t.jsxRuntimeExports.jsxs("div",{className:xe.customerNote,children:[t.jsxRuntimeExports.jsxs("div",{className:xe.noteHeader,children:[(s==null?void 0:s.info.logo)&&t.jsxRuntimeExports.jsx("div",{className:xe.logoContainer,children:t.jsxRuntimeExports.jsx("img",{src:t.convertCfImageIdToUrl(s==null?void 0:s.info.logo.cfId)})}),t.jsxRuntimeExports.jsx("p",{className:xe.shopName,children:s==null?void 0:s.info.name})]}),t.jsxRuntimeExports.jsx("p",{className:xe.noteContent,children:n.customerNote})]})]})},$m="_coupon_dkjzv_1",Dm="_couponApplied_dkjzv_7",Fm="_discount_dkjzv_17",Om="_removeButton_dkjzv_23",Hm="_removeButtonText_dkjzv_27",zm="_couponInput_dkjzv_31",Um="_couponInputContainer_dkjzv_37",at={coupon:$m,couponApplied:Dm,discount:Fm,removeButton:Om,removeButtonText:Hm,couponInput:zm,couponInputContainer:Um},Vm=({applyCoupon:e,couponData:n,discount:s,removeCoupon:r,gateway:i})=>{const[o,a]=_.useState(null),[l,u]=_.useState(!1);return t.jsxRuntimeExports.jsxs("div",{className:at.coupon,children:[l&&t.jsxRuntimeExports.jsx(t.ContentLoader,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:at.skeleton,children:t.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!l&&(n?t.jsxRuntimeExports.jsxs("div",{className:at.couponApplied,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"var(--text-success)"}),t.jsxRuntimeExports.jsxs("p",{children:[o," is applied"," ",t.jsxRuntimeExports.jsxs("span",{className:at.discount,children:["-",s," ",!n.isFixed&&`(${n.discount}%)`]})]}),t.jsxRuntimeExports.jsx("button",{className:at.removeButton,onClick:r,children:t.jsxRuntimeExports.jsx("span",{className:at.removeButtonText,children:"Remove"})})]}):t.jsxRuntimeExports.jsxs("div",{className:at.couponInput,children:[t.jsxRuntimeExports.jsxs("div",{className:at.couponInputContainer,children:[t.jsxRuntimeExports.jsx(t.Input$1,{placeholder:"Enter a discount code",value:o||"",onChange:p=>{a(p===""?null:p)}}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:async()=>{u(!0),o&&await e(o),u(!1)},disabled:!i||!o,type:"Primary",children:"Apply"})]}),!i&&t.jsxRuntimeExports.jsx(t.Tip,{type:"warning",message:"The discount is related to the method of payment. Select to enter."})]}))]})},Wm=({cart:e,products:n,applyCoupon:s,applyCouponPending:r,coupon:i,totalAndDiscount:o,removeCoupon:a})=>{var h;const{priceAdjusment:l}=t.useCartStore(),[u,p]=_.useState(!1),c=_.useMemo(()=>e.parts.map(b=>{const f=n.find(C=>C.id===b.productId),E=f==null?void 0:f.variants.find(C=>C.id===b.productVariantId);return b.chargeType==="RECURRING"&&p(!0),{id:(f==null?void 0:f.id)||0,image:f==null?void 0:f.images[0],name:(E==null?void 0:E.name)||"",description:(E==null?void 0:E.description)||"",price:{quantity:b.quantity,amount:(E==null?void 0:E.price.amount)||0,currency:E==null?void 0:E.price.currency},subscriptionSettings:E==null?void 0:E.subscriptionSettings,chargeType:b.chargeType,variantsGateways:E==null?void 0:E.gateways}}),[e,n]),m=((h=c[0])==null?void 0:h.price.currency)||"USD",x=new Intl.NumberFormat("en-US",{style:"currency",currency:m}),d=_.useMemo(()=>o.totalWithDiscount?o.total-o.totalWithDiscount:0,[o]),g=l?(l==null?void 0:l.fixedAmount)+Math.round((o.totalWithDiscount||o.total)*((l==null?void 0:l.percentage)/100)):null;return t.jsxRuntimeExports.jsx("div",{className:yt.checkoutItemsContainer,children:t.jsxRuntimeExports.jsxs("div",{className:yt.innerContainer,children:[t.jsxRuntimeExports.jsx(rn,{}),t.jsxRuntimeExports.jsxs("div",{className:yt.headerSection,children:[t.jsxRuntimeExports.jsx("header",{className:yt.header,children:t.jsxRuntimeExports.jsx("h1",{children:"Checkout"})}),t.jsxRuntimeExports.jsx("div",{className:yt.productsContainer,children:c.map(b=>t.jsxRuntimeExports.jsx(Cs,{product:b},b.id))}),t.jsxRuntimeExports.jsx("div",{className:yt.couponContainer,children:t.jsxRuntimeExports.jsx(Vm,{applyCoupon:s,applyCouponPending:r,couponData:i,discount:x.format(d),removeCoupon:a,gateway:e.gateway})}),t.jsxRuntimeExports.jsx(on,{formatter:x,coupon:i,total:o.total,discount:d,totalWithDiscount:o.totalWithDiscount,feeOrDiscount:u?null:g})]}),t.jsxRuntimeExports.jsx("div",{className:yt.checkoutFooter,children:t.jsxRuntimeExports.jsx(rt,{})})]})})},qm="_checkoutOperational_6gxie_1",Gm="_innerContainer_6gxie_17",Zm="_paymentMethodsSection_6gxie_22",Xm="_socialConnectSection_6gxie_28",Ym="_socialConnectLabel_6gxie_31",Km="_socialConnectContent_6gxie_35",Jm="_continueButton_6gxie_39",Qm="_button_6gxie_43",ex="_checkoutFooter_6gxie_47",nt={checkoutOperational:qm,innerContainer:Gm,paymentMethodsSection:Zm,socialConnectSection:Xm,socialConnectLabel:Ym,socialConnectContent:Km,continueButton:Jm,button:Qm,checkoutFooter:ex},tx="_customFields_1emyf_2",nx="_checkboxWrapper_1emyf_9",sx="_textareaWrapper_1emyf_16",rx="_inputWrapper_1emyf_17",Yt={customFields:tx,checkboxWrapper:nx,textareaWrapper:sx,inputWrapper:rx},ox=({customFields:e,setCustomFields:n})=>{if(e.length===0)return null;const s=e.map(r=>t.jsxRuntimeExports.jsx(ix,{customField:r,setCustomFields:n},r.name));return t.jsxRuntimeExports.jsx("div",{className:Yt.customFields,children:s})},ix=({customField:e,setCustomFields:n})=>{const[s,r]=_.useState(e.value);return t.jsxRuntimeExports.jsx(ax,{value:s,placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:i=>{r(i),n(o=>o.map(a=>a.name===e.name?{...a,value:i}:a))},label:e.name,regex:e.regex})},ax=({label:e,type:n,defaultValue:s,value:r,placeholder:i,regex:o,required:a,onValueChange:l})=>{if(n===t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox)return t.jsxRuntimeExports.jsxs("label",{className:Yt.checkboxWrapper,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:!!s,onChange:p=>l(p)}),t.jsxRuntimeExports.jsx("p",{className:Yt.checkboxLabel,children:e})]});if(n==t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Hidden)return t.jsxRuntimeExports.jsx("input",{type:"hidden",value:typeof s!="boolean"?s:void 0,required:a});const u=p=>{let c=/^\d*$/;n!=t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number&&(c=o?new RegExp(o):new RegExp("")),c.test(p)&&l(p)};return n==t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Textarea?t.jsxRuntimeExports.jsx("div",{className:Yt.textareaWrapper,children:t.jsxRuntimeExports.jsx(t.Textarea$1,{label:e,value:r,placeholder:i,onChange:p=>u(p)})}):t.jsxRuntimeExports.jsx("div",{className:Yt.inputWrapper,children:t.jsxRuntimeExports.jsx(t.Input$1,{label:e,value:r,placeholder:i,required:a,onChange:p=>u(p)})})},lx="_connectedContainer_e6cyx_1",cx="_userInfo_e6cyx_10",ux="_avatar_e6cyx_16",px="_avatarImage_e6cyx_26",Sn={connectedContainer:lx,userInfo:cx,avatar:ux,avatarImage:px},dx=({customerEmail:e})=>{const{discordInfo:n,setDiscordInfo:s}=t.useDiscordStore(),[r,i]=_.useState(!1),o=()=>{e.trim()!==""&&(i(!0),Si({customerEmail:e}).then(({data:a})=>{const l=window.open(a.redirectUrl);(!l||l.closed||typeof l.closed>"u")&&setTimeout(()=>{const c=document.createElement("a");c.href=a.redirectUrl,c.target="_blank",c.click()});let u;const p=()=>{bi({id:a.id,customerEmail:e}).then(({data:c})=>{s({authorized:!0,id:c.discordId,avatar:c.avatar,username:c.username}),l&&l.close(),i(!1),clearTimeout(u)}).catch(c=>{console.log("Ожидание авторизации...",c,{newWindow:l}),clearTimeout(u),u=setTimeout(p,1500)})};p()}).catch(a=>{console.log("Could not initiate Discord authorization",a)}))};return n!=null&&n.authorized?t.jsxRuntimeExports.jsxs("div",{className:Sn.connectedContainer,children:[t.jsxRuntimeExports.jsxs("div",{className:Sn.userInfo,children:[t.jsxRuntimeExports.jsx("div",{className:Sn.avatar,children:n.avatar?t.jsxRuntimeExports.jsx("img",{className:Sn.avatarImage,src:`https://cdn.discordapp.com/avatars/${n.id}/${n.avatar}.png?size=256`}):t.jsxRuntimeExports.jsx(t.Icon,{name:"UserCircle"})}),t.jsxRuntimeExports.jsx("p",{children:n.username}),t.jsxRuntimeExports.jsx(Ud,{})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Reconnect"})]}):t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:r?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"DiscordLogo"}),"Connect Your Discord"]})})},mx="_paymentMethodsContainer_a3he6_2",xx={paymentMethodsContainer:mx},hx="_bottomSheet_og330_1",gx="_content_og330_8",fx="_description_og330_11",jx="_buttonGroup_og330_15",yx="_buttonWrapper_og330_25",_x="_fullWidthButton_og330_28",Sx="_modal_og330_32",bx="_header_og330_39",lt={bottomSheet:hx,content:gx,description:fx,buttonGroup:jx,buttonWrapper:yx,fullWidthButton:_x,modal:Sx,header:bx},Cx=({setIsOpen:e,balance:n})=>{const s=t.useNavigate(),{setIsOpen:r}=t.useModalStore(),i=()=>{s("/top-up?redirectRoute=checkout")};function o(){r(!1),setTimeout(()=>{e(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:lt.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:lt.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Insufficient Customer Balance"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:lt.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:lt.content,children:t.jsxRuntimeExports.jsxs("p",{className:lt.description,children:["You currently have ",n&&t.formatPrice(n)," in your balance. After topping up the required amount, you can continue to checkout."]})}),t.jsxRuntimeExports.jsxs("div",{className:lt.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:lt.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:i,children:"Add Balance"})})]})]})]})},qr=({align:e,gateway:n,gatewayDisplayName:s,selected:r,onSelect:i,total:o,onSignInClick:a,reversed:l})=>{const{token:u}=t.useStorefrontStore(),{balance:p}=t.useCustomerDashboardStore(),[c,m]=_.useState(!1),{setIsOpen:x}=t.useModalStore(),d=g=>{g.stopPropagation(),i&&i(n),p&&p.amount<o&&(m(!0),x(!0))};return _.useEffect(()=>{},[p,o]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:t.clx(t.styles$3.paymentMethod,{[t.styles$3.selected]:r,[t.styles$3.alignColumn]:e==="column",[t.styles$3.reversed]:l}),onClick:d,children:[t.jsxRuntimeExports.jsxs("p",{className:t.styles$3.paymentText,children:[s," ",t.jsxRuntimeExports.jsxs("span",{className:t.styles$3.balanceText,children:["(",u?p&&t.formatPrice(p):t.jsxRuntimeExports.jsx("a",{className:t.styles$3.signInLink,onClick:a,children:"Sign in"}),")"]})]}),t.jsxRuntimeExports.jsx("div",{className:t.styles$3.iconContainer,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}),c&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>m(!1),children:t.jsxRuntimeExports.jsx(Cx,{setIsOpen:m,balance:p})})]})},Gr=({possibleGateways:e,setGateway:n,totalAndDiscount:s,onSignInClick:r,setPaymentMethod:i})=>{const[o,a]=_.useState(),[l,u]=_.useState(),{setPriceAdjustment:p}=t.useCartStore(),[c,m]=_.useState(null),x=(d,g)=>{var h;l!==g&&(n(g),p(((h=c==null?void 0:c.find(b=>b.name===g))==null?void 0:h.priceAdjustment)||null)),i(d),a(d),u(g)};return _.useEffect(()=>{const d=async()=>{const{data:g}=await t.fetchGatewaysDetail([...e.availableGateways,...e.requiresSignInGateways]);m(g)};e.availableGateways.length&&d()},[]),_.useLayoutEffect(()=>{p(null)},[]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[c&&t.jsxRuntimeExports.jsx("div",{className:xx.paymentMethodsContainer,children:c==null?void 0:c.map(d=>d.name==="Balance"?t.jsxRuntimeExports.jsx(qr,{gateway:d.name,gatewayDisplayName:d.displayName,onSelect:g=>{u(g),l!==g&&n(g)},selected:d.name===l,total:s.total,onSignInClick:r,reversed:!0},d.name):d.paymentMethods.map(g=>t.jsxRuntimeExports.jsx(t.CheckoutPaymentMethod,{paymentMethod:g,gateway:d.name,gatewayDisplayName:d.displayName,gatewayLogoCfId:d.logoCfImageId,poweredByLogoCfId:d.poweredByImageCfImageId,onSelect:h=>x(h,d.name),selected:o===g&&l===d.name},`${d.name}-${g}`)))}),!c&&t.jsxRuntimeExports.jsx(t.ContentLoader,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",children:t.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})})]})},Ex="_modal_14r0b_1",vx={modal:Ex},wx=({setIsOpen:e})=>{const{token:n}=t.useStorefrontStore(),{setIsOpen:s}=t.useModalStore();_.useEffect(()=>{n&&r()},[n]);const r=()=>{s(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsx("div",{className:vx.modal,onClick:i=>i.stopPropagation(),children:t.jsxRuntimeExports.jsx(t.Auth,{inModal:!0})})},kx=({getPossibleGateways:e,setGateway:n,getDiscordSettings:s,cart:r,products:i,submitCart:o,reset:a,setCustomFieldsToCart:l,totalAndDiscount:u,setDiscordSocialConnectId:p,setPaymentMethod:c})=>{const m=_.useMemo(()=>s(),[]),[x,d]=_.useState([]),[g,h]=_.useState({}),{balance:b,setBalance:f}=t.useCustomerDashboardStore(),{token:E}=t.useStorefrontStore(),{executeRecaptcha:C}=t.useReCaptcha(),{discordInfo:N}=t.useDiscordStore(),{customerEmail:w,setCustomerEmail:S}=t.useCartStore(),A=N!=null&&N.authorized?N.id:void 0,$=t.useNavigate(),z=_.useMemo(()=>e(),[r.parts]),[V,B]=_.useState(!1),{setIsOpen:R}=t.useModalStore(),{notifications:I,setNotifications:M}=t.useNotificationStore();_.useEffect(()=>{const H=t.getCommonCustomFields(r.parts,i).map(j=>j.type===t.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...j,value:String(j.defaultValue)}:j);d([...H])},[r.parts,i]);const P=()=>{const L={...g};x.forEach(H=>{H.required&&!H.value?(h({...g,[H.name]:`Field ${H.name} is required but has an empty value.`}),M([...I,{message:`Field ${H.name} is required but has an empty value.`,status:"error",id:t.v4()}])):(delete L[H.name],h(L))})};_.useEffect(()=>{const L=[];Object.entries(g).forEach(([H,j])=>{L.push({message:j,status:"error",id:t.v4()})}),L.length&&M([...I,...L])},[g]);const O=async L=>{if(L.stopPropagation(),r.gateway==="Balance"&&!E){R(!0),B(!0);return}const H={};P(),x.forEach(se=>H[se.name]=se.value),l(H),A&&m.isEnabled&&p(A);const j=await C();if(j&&!Object.keys(g).length){const se=await o(j);$(`/orders/${"order"in se?se.order.id:se.id}`),setTimeout(()=>{a()},0)}};_.useEffect(()=>{d(t.getCommonCustomFields(r.parts,i))},[r.parts,i]),_.useEffect(()=>{E&&(async()=>{const H=await t.getBalance();f(H)})()},[E]);function D(L){return L&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(L)}return t.jsxRuntimeExports.jsxs("div",{className:nt.checkoutOperational,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.innerContainer,children:[r.parts.length>0&&t.jsxRuntimeExports.jsx(Gr,{possibleGateways:z,setGateway:n,setPaymentMethod:c,balance:b,totalAndDiscount:u,onSignInClick:()=>{B(!0),R(!0)}}),t.jsxRuntimeExports.jsx("div",{className:nt.paymentMethodsSection,children:t.jsxRuntimeExports.jsx(t.Input$1,{placeholder:"mail@mail.com",value:w||"",onChange:L=>S(L),disabled:!!E,label:"Email Address"})}),t.jsxRuntimeExports.jsx(ox,{customFields:x,setCustomFields:d}),m.isEnabled&&t.jsxRuntimeExports.jsxs("div",{className:nt.socialConnectSection,children:[t.jsxRuntimeExports.jsx("p",{className:nt.socialConnectLabel,children:"Social Connect"}),t.jsxRuntimeExports.jsx("div",{className:nt.socialConnectContent,children:t.jsxRuntimeExports.jsx(dx,{customerEmail:w||""})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.continueButton,children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:O,disabled:!r.gateway||!D(w||"")||m.isRequired&&!(N!=null&&N.authorized),className:nt.button,children:"Continue to Checkout"}),t.jsxRuntimeExports.jsx(t.TermsOfService,{}),t.jsxRuntimeExports.jsx(t.SecuredBySsl,{})]}),t.jsxRuntimeExports.jsx(rt,{className:nt.checkoutFooter})]}),V&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>B(!1),children:t.jsxRuntimeExports.jsx(wx,{setIsOpen:B})})]})},Rx="_mt1_1t7v2_1",Nx="_notifyBlock_1t7v2_13",Ix="_notifyHeader_1t7v2_19",Tx="_notifyContent_1t7v2_25",Px="_buttonBlock_1t7v2_30",Lx="_imageBlock_1t7v2_34",Bx="_imageContainer_1t7v2_42",Ax="_sectionBlock_1t7v2_54",Mx="_sectionTitle_1t7v2_61",$x="_sectionSubtitle_1t7v2_64",Dx="_inputContainer_1t7v2_69",We={mt1:Rx,notifyBlock:Nx,notifyHeader:Ix,notifyContent:Tx,buttonBlock:Px,imageBlock:Lx,imageContainer:Bx,sectionBlock:Ax,sectionTitle:Mx,sectionSubtitle:$x,inputContainer:Dx},Fx=({props:e})=>{const n=t.useCopy();return t.jsxRuntimeExports.jsx("div",{className:We.mt1,children:t.jsxRuntimeExports.jsxs("div",{className:We.inputContainer,children:[t.jsxRuntimeExports.jsx(t.Input$1,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>n(e.text),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})})},Ox=({props:e})=>t.jsxRuntimeExports.jsx(t.Button$1,{className:We.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),Hx=({props:e})=>t.jsxRuntimeExports.jsx("div",{className:We.imageBlock,children:t.jsxRuntimeExports.jsx("div",{className:We.imageContainer,children:t.jsxRuntimeExports.jsx("img",{src:e.src,alt:""})})}),zx=({props:e})=>t.jsxRuntimeExports.jsxs("div",{className:We.notifyBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:We.notifyHeader,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),t.jsxRuntimeExports.jsx("p",{children:e.heading})]}),t.jsxRuntimeExports.jsx("p",{className:We.notifyContent,children:e.content})]}),Ux=({props:e})=>{var n;return t.jsxRuntimeExports.jsxs("div",{className:We.sectionBlock,children:[t.jsxRuntimeExports.jsx("p",{className:We.sectionTitle,children:e.title}),t.jsxRuntimeExports.jsx("span",{className:We.sectionSubtitle,children:e.subTitle}),(n=e.children)==null?void 0:n.map((s,r)=>t.jsxRuntimeExports.jsx(Zr,{block:s},r))]})},Zr=({block:e})=>{switch(e.type){case"Section":return t.jsxRuntimeExports.jsx(Ux,{...e});case"ReadOnlyTextInput":return t.jsxRuntimeExports.jsx(Fx,{...e});case"Notify":return t.jsxRuntimeExports.jsx(zx,{...e});case"Button":return t.jsxRuntimeExports.jsx(Ox,{...e});case"Image":return t.jsxRuntimeExports.jsx(Hx,{...e});default:return null}},Vx="_bottomSheet_1x4sq_1",Wx="_content_1x4sq_8",qx="_agreementList_1x4sq_11",Gx="_agreementItem_1x4sq_16",Zx="_warning_1x4sq_23",Xx="_buttonGroup_1x4sq_31",Yx="_buttonWrapper_1x4sq_41",Kx="_fullWidthButton_1x4sq_44",Jx="_modal_1x4sq_48",Qx="_header_1x4sq_55",Te={bottomSheet:Vx,content:Wx,agreementList:qx,agreementItem:Gx,warning:Zx,buttonGroup:Xx,buttonWrapper:Yx,fullWidthButton:Kx,modal:Jx,header:Qx},eh=({setIsOpen:e,price:n})=>{const[s,r]=_.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:i}=t.useModalStore(),o=()=>{i(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:Te.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Te.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Note"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:Te.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:Te.content,children:[t.jsxRuntimeExports.jsxs("div",{className:Te.agreementList,children:[t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToSendAsFF,onChange:a=>r({...s,agreeToSendAsFF:a})}),t.jsxRuntimeExports.jsx("p",{children:"I agree to send the payment as friends & family"})]}),t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToSend,onChange:a=>r({...s,agreeToSend:a})}),t.jsxRuntimeExports.jsxs("p",{children:["I agree to send the payment of ",t.formatPrice(n)," ",n.currency]})]}),t.jsxRuntimeExports.jsxs("label",{className:Te.agreementItem,children:[t.jsxRuntimeExports.jsx(t.Checkbox,{value:s.agreeToNotAddNote,onChange:a=>r({...s,agreeToNotAddNote:a})}),t.jsxRuntimeExports.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),t.jsxRuntimeExports.jsx("div",{className:Te.warning,children:t.jsxRuntimeExports.jsxs("p",{children:["Please note that you are required to send the exact payment of ",t.formatPrice(n)," ",n.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),t.jsxRuntimeExports.jsxs("div",{className:Te.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:Te.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:t.jsxRuntimeExports.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),t.jsxRuntimeExports.jsx("div",{className:Te.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!(s.agreeToSendAsFF&&s.agreeToNotAddNote&&s.agreeToSend),onClick:o,children:"Continue to Payment"})})]})]})]})},th="_chargeItemsContainer_qmv3w_4",nh="_chargeItemsInner_qmv3w_20",sh="_productsContainer_qmv3w_27",rh="_chargeHeader_qmv3w_41",oh="_chargeTitle_qmv3w_49",ih="_chargeDescription_qmv3w_55",ah="_copyButton_qmv3w_61",lh="_productsList_qmv3w_73",ch="_trackingContainer_qmv3w_81",uh="_footerContainer_qmv3w_91",Ge={chargeItemsContainer:th,chargeItemsInner:nh,productsContainer:sh,chargeHeader:rh,chargeTitle:oh,chargeDescription:ih,copyButton:ah,productsList:lh,trackingContainer:ch,footerContainer:uh},ph=({charge:e})=>{var o;const n=t.useCopy(),s=(e==null?void 0:e.price.currency)||"USD",r=new Intl.NumberFormat("en-US",{style:"currency",currency:s}),i=_.useMemo(()=>{var a;return((a=e==null?void 0:e.order)==null?void 0:a.partOrders.map(l=>{var u,p,c,m,x,d;return{id:(l==null?void 0:l.id)||0,image:l.productWithVariant.image,name:((u=l.productWithVariant)==null?void 0:u.variantName)||"",description:((p=l.productWithVariant)==null?void 0:p.description)||"",price:{quantity:l.quantity,amount:((c=l.productWithVariant)==null?void 0:c.price.amount)||0,currency:(m=l.productWithVariant)==null?void 0:m.price.currency},subscriptionSettings:(x=e.order)!=null&&x.subscriptionOrderId?(d=l.productWithVariant)==null?void 0:d.subscriptionSettings:null}}))||[]},[e]);return t.jsxRuntimeExports.jsx("div",{className:Ge.chargeItemsContainer,children:t.jsxRuntimeExports.jsxs("div",{className:Ge.chargeItemsInner,children:[t.jsxRuntimeExports.jsx(rn,{expiresAt:e==null?void 0:e.expiresAt}),t.jsxRuntimeExports.jsxs("div",{className:Ge.productsContainer,children:[(e==null?void 0:e.name)&&t.jsxRuntimeExports.jsxs("header",{className:Ge.chargeHeader,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("h1",{className:Ge.chargeTitle,children:e.name}),e.description&&t.jsxRuntimeExports.jsx("p",{className:Ge.chargeDescription,children:e.description})]}),((o=e.order)==null?void 0:o.id)&&t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",className:Ge.copyButton,onClick:()=>{var a;return n(((a=e.order)==null?void 0:a.id)||"")},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"}),"Copy Order ID"]})]}),t.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[!!i.length&&t.jsxRuntimeExports.jsx("div",{className:Ge.productsList,children:i.map(a=>t.jsxRuntimeExports.jsx(Cs,{product:a},a.id))}),t.jsxRuntimeExports.jsx(on,{formatter:r,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1})]}),t.jsxRuntimeExports.jsxs("div",{children:[e&&t.jsxRuntimeExports.jsx("div",{className:Ge.trackingContainer,children:t.jsxRuntimeExports.jsx(t.TrackPayment,{timeline:e.timeline})}),t.jsxRuntimeExports.jsx(rt,{className:Ge.footerContainer})]})]})]})})},dh="_checkoutOrderMainData_1rnwg_4",mh="_orderDetailRow_1rnwg_10",xh="_chargeIdRow_1rnwg_21",hh="_detailLabel_1rnwg_31",gh="_detailValue_1rnwg_36",fh="_chargeIdContainer_1rnwg_41",jh="_chargeId_1rnwg_21",yh="_copyIcon_1rnwg_60",Se={checkoutOrderMainData:dh,orderDetailRow:mh,chargeIdRow:xh,detailLabel:hh,detailValue:gh,chargeIdContainer:fh,chargeId:jh,copyIcon:yh},Xr=({lastUpdate:e,invoiceId:n,email:s,paymentType:r})=>{const i=t.useCopy(),[o,a]=_.useState(null),l=o==null?void 0:o.find(p=>p.name===r);_.useEffect(()=>{o||(async()=>{const c=[r],m=await t.getGatewaysDetail(c);a(m)})()},[r,o]);const u=p=>{const c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=p.getDate().toString().padStart(2,"0"),x=c[p.getMonth()],d=p.getFullYear(),g=p.getHours(),h=p.getMinutes().toString().padStart(2,"0"),b=p.getSeconds().toString().padStart(2,"0"),f=g>=12?"PM":"AM",E=(g%12||12).toString().padStart(2,"0");return`${x} ${m}, ${d} at ${E}:${h}:${b} ${f}`};return t.jsxRuntimeExports.jsxs("div",{className:Se.checkoutOrderMainData,children:[t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Last Updated"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:u(new Date(e))})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Payment Type"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:l==null?void 0:l.displayName})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.orderDetailRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Email"}),t.jsxRuntimeExports.jsx("p",{className:Se.detailValue,children:s})]}),t.jsxRuntimeExports.jsxs("div",{className:Se.chargeIdRow,children:[t.jsxRuntimeExports.jsx("p",{className:Se.detailLabel,children:"Charge ID"}),t.jsxRuntimeExports.jsxs("div",{className:Se.chargeIdContainer,children:[t.jsxRuntimeExports.jsx("p",{className:Se.chargeId,children:n}),t.jsxRuntimeExports.jsx("div",{className:Se.copyIcon,onClick:()=>i(n),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})]})},_h="_bottomSheet_1yai1_1",Sh="_formContainer_1yai1_8",bh="_error_1yai1_14",Ch="_buttonGroup_1yai1_18",Eh="_buttonWrapper_1yai1_28",vh="_fullWidthButton_1yai1_31",wh="_modal_1yai1_41",kh="_header_1yai1_48",ct={bottomSheet:_h,formContainer:Sh,error:bh,buttonGroup:Ch,buttonWrapper:Eh,fullWidthButton:vh,modal:wh,header:kh},Rh=({chargeId:e,setIsOpen:n})=>{const[s,r]=_.useState(""),[i,o]=_.useState(""),{setIsOpen:a}=t.useModalStore(),l=c=>{try{return new URL(c),!0}catch{return!1}},u=async c=>{if(c.preventDefault(),!s){o("The link field cannot be empty.");return}if(!l(s)){o("Please enter a valid URL");return}await hi({url:s},e)&&(alert("CashApp successfully verified"),n(!1))},p=()=>{a(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:ct.modal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:ct.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"CashApp Verify"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsx("form",{onSubmit:u,children:t.jsxRuntimeExports.jsxs("div",{className:ct.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:ct.formContainer,children:t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx(t.Input$1,{value:s,onChange:c=>{r(c),o("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),i&&t.jsxRuntimeExports.jsx("p",{className:ct.error,children:i})]})}),t.jsxRuntimeExports.jsxs("div",{className:ct.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:ct.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:p,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:ct.fullWidthButton,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",children:"Verify"})})]})]})})]})},Nh="_container_1opbn_1",Ih="_productDetails_1opbn_8",Th="_imageContainer_1opbn_14",Ph="_image_1opbn_14",Lh="_textContainer_1opbn_32",Bh="_header_1opbn_40",Ah="_title_1opbn_46",Mh="_price_1opbn_53",$h="_badgeContainer_1opbn_57",Dh="_description_1opbn_61",Ze={container:Nh,productDetails:Ih,imageContainer:Th,image:Ph,textContainer:Lh,header:Bh,title:Ah,price:Mh,badgeContainer:$h,description:Dh};function Fh(e,n){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const Oh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zh={};function Xs(e,n){return(zh.jsx?Hh:Oh).test(e)}const Uh=/[ \t\n\f\r]/g;function Vh(e){return typeof e=="object"?e.type==="text"?Ys(e.value):!1:Ys(e)}function Ys(e){return e.replace(Uh,"")===""}class an{constructor(n,s,r){this.normal=s,this.property=n,r&&(this.space=r)}}an.prototype.normal={};an.prototype.property={};an.prototype.space=void 0;function Yr(e,n){const s={},r={};for(const i of e)Object.assign(s,i.property),Object.assign(r,i.normal);return new an(s,r,n)}function ms(e){return e.toLowerCase()}class we{constructor(n,s){this.attribute=s,this.property=n}}we.prototype.attribute="";we.prototype.booleanish=!1;we.prototype.boolean=!1;we.prototype.commaOrSpaceSeparated=!1;we.prototype.commaSeparated=!1;we.prototype.defined=!1;we.prototype.mustUseProperty=!1;we.prototype.number=!1;we.prototype.overloadedBoolean=!1;we.prototype.property="";we.prototype.spaceSeparated=!1;we.prototype.space=void 0;let Wh=0;const X=vt(),de=vt(),Kr=vt(),k=vt(),le=vt(),Pt=vt(),Re=vt();function vt(){return 2**++Wh}const xs=Object.freeze(Object.defineProperty({__proto__:null,boolean:X,booleanish:de,commaOrSpaceSeparated:Re,commaSeparated:Pt,number:k,overloadedBoolean:Kr,spaceSeparated:le},Symbol.toStringTag,{value:"Module"})),Kn=Object.keys(xs);class Es extends we{constructor(n,s,r,i){let o=-1;if(super(n,s),Ks(this,"space",i),typeof r=="number")for(;++o<Kn.length;){const a=Kn[o];Ks(this,Kn[o],(r&xs[a])===xs[a])}}}Es.prototype.defined=!0;function Ks(e,n,s){s&&(e[n]=s)}function At(e){const n={},s={};for(const[r,i]of Object.entries(e.properties)){const o=new Es(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,s[ms(r)]=r,s[ms(o.attribute)]=r}return new an(n,s,e.space)}const Jr=At({properties:{ariaActiveDescendant:null,ariaAtomic:de,ariaAutoComplete:null,ariaBusy:de,ariaChecked:de,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:le,ariaCurrent:null,ariaDescribedBy:le,ariaDetails:null,ariaDisabled:de,ariaDropEffect:le,ariaErrorMessage:null,ariaExpanded:de,ariaFlowTo:le,ariaGrabbed:de,ariaHasPopup:null,ariaHidden:de,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:le,ariaLevel:k,ariaLive:null,ariaModal:de,ariaMultiLine:de,ariaMultiSelectable:de,ariaOrientation:null,ariaOwns:le,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:de,ariaReadOnly:de,ariaRelevant:null,ariaRequired:de,ariaRoleDescription:le,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:de,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Qr(e,n){return n in e?e[n]:n}function eo(e,n){return Qr(e,n.toLowerCase())}const qh=At({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pt,acceptCharset:le,accessKey:le,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:le,autoFocus:X,autoPlay:X,blocking:le,capture:null,charSet:null,checked:X,cite:null,className:le,cols:k,colSpan:null,content:null,contentEditable:de,controls:X,controlsList:le,coords:k|Pt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:Kr,draggable:de,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:le,height:k,hidden:X,high:k,href:null,hrefLang:null,htmlFor:le,httpEquiv:le,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:le,itemRef:le,itemScope:X,itemType:le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:k,pattern:null,ping:le,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:le,required:X,reversed:X,rows:k,rowSpan:k,sandbox:le,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:de,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:de,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:le,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:de,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:eo}),Gh=At({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Re,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pt,g2:Pt,glyphName:Pt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:Re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Re,rev:Re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Re,requiredFeatures:Re,requiredFonts:Re,requiredFormats:Re,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:Re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Re,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Qr}),to=At({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),no=At({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eo}),so=At({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Zh={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xh=/[A-Z]/g,Js=/-[a-z]/g,Yh=/^data[-\w.:]+$/i;function Kh(e,n){const s=ms(n);let r=n,i=we;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&Yh.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Js,Qh);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Js.test(o)){let a=o.replace(Xh,Jh);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=Es}return new i(r,n)}function Jh(e){return"-"+e.toLowerCase()}function Qh(e){return e.charAt(1).toUpperCase()}const eg=Yr([Jr,qh,to,no,so],"html"),vs=Yr([Jr,Gh,to,no,so],"svg");function tg(e){return e.join(" ").trim()}var ro={},Qs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ng=/\n/g,sg=/^\s*/,rg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,og=/^:\s*/,ig=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ag=/^[;\s]*/,lg=/^\s+|\s+$/g,cg=`
103
+ `,er="/",tr="*",Et="",ug="comment",pg="declaration",dg=function(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var s=1,r=1;function i(g){var h=g.match(ng);h&&(s+=h.length);var b=g.lastIndexOf(cg);r=~b?g.length-b:r+g.length}function o(){var g={line:s,column:r};return function(h){return h.position=new a(g),p(),h}}function a(g){this.start=g,this.end={line:s,column:r},this.source=n.source}a.prototype.content=e;function l(g){var h=new Error(n.source+":"+s+":"+r+": "+g);if(h.reason=g,h.filename=n.source,h.line=s,h.column=r,h.source=e,!n.silent)throw h}function u(g){var h=g.exec(e);if(h){var b=h[0];return i(b),e=e.slice(b.length),h}}function p(){u(sg)}function c(g){var h;for(g=g||[];h=m();)h!==!1&&g.push(h);return g}function m(){var g=o();if(!(er!=e.charAt(0)||tr!=e.charAt(1))){for(var h=2;Et!=e.charAt(h)&&(tr!=e.charAt(h)||er!=e.charAt(h+1));)++h;if(h+=2,Et===e.charAt(h-1))return l("End of comment missing");var b=e.slice(2,h-2);return r+=2,i(b),e=e.slice(h),r+=2,g({type:ug,comment:b})}}function x(){var g=o(),h=u(rg);if(h){if(m(),!u(og))return l("property missing ':'");var b=u(ig),f=g({type:pg,property:nr(h[0].replace(Qs,Et)),value:b?nr(b[0].replace(Qs,Et)):Et});return u(ag),f}}function d(){var g=[];c(g);for(var h;h=x();)h!==!1&&(g.push(h),c(g));return g}return p(),d()};function nr(e){return e?e.replace(lg,Et):Et}var mg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ro,"__esModule",{value:!0});var sr=ro.default=hg,xg=mg(dg);function hg(e,n){var s=null;if(!e||typeof e!="string")return s;var r=(0,xg.default)(e),i=typeof n=="function";return r.forEach(function(o){if(o.type==="declaration"){var a=o.property,l=o.value;i?n(a,l,o):l&&(s=s||{},s[a]=l)}}),s}const gg=sr.default||sr,oo=io("end"),ws=io("start");function io(e){return n;function n(s){const r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fg(e){const n=ws(e),s=oo(e);if(n&&s)return{start:n,end:s}}function Kt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rr(e.position):"start"in e||"end"in e?rr(e):"line"in e||"column"in e?hs(e):""}function hs(e){return or(e&&e.line)+":"+or(e&&e.column)}function rr(e){return hs(e&&e.start)+"-"+hs(e&&e.end)}function or(e){return e&&typeof e=="number"?e:1}class _e extends Error{constructor(n,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let i="",o={},a=!1;if(s&&("line"in s&&"column"in s?o={place:s}:"start"in s&&"end"in s?o={place:s}:"type"in s?o={ancestors:[s],place:s.position}:o={...s}),typeof n=="string"?i=n:!o.cause&&n&&(a=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=Kt(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}_e.prototype.file="";_e.prototype.name="";_e.prototype.reason="";_e.prototype.message="";_e.prototype.stack="";_e.prototype.column=void 0;_e.prototype.line=void 0;_e.prototype.ancestors=void 0;_e.prototype.cause=void 0;_e.prototype.fatal=void 0;_e.prototype.place=void 0;_e.prototype.ruleId=void 0;_e.prototype.source=void 0;const ks={}.hasOwnProperty,jg=new Map,yg=/[A-Z]/g,_g=/-([a-z])/g,Sg=new Set(["table","tbody","thead","tfoot","tr"]),bg=new Set(["td","th"]),ao="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cg(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Tg(s,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ig(s,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?vs:eg,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=lo(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function lo(e,n,s){if(n.type==="element")return Eg(e,n,s);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return vg(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return kg(e,n,s);if(n.type==="mdxjsEsm")return wg(e,n);if(n.type==="root")return Rg(e,n,s);if(n.type==="text")return Ng(e,n)}function Eg(e,n,s){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vs,e.schema=i),e.ancestors.push(n);const o=uo(e,n.tagName,!1),a=Pg(e,n);let l=Ns(e,n);return Sg.has(n.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vh(u):!0})),co(e,a,o,n),Rs(a,l),e.ancestors.pop(),e.schema=r,e.create(n,o,a,s)}function vg(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tn(e,n.position)}function wg(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);tn(e,n.position)}function kg(e,n,s){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=vs,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:uo(e,n.name,!0),a=Lg(e,n),l=Ns(e,n);return co(e,a,o,n),Rs(a,l),e.ancestors.pop(),e.schema=r,e.create(n,o,a,s)}function Rg(e,n,s){const r={};return Rs(r,Ns(e,n)),e.create(n,e.Fragment,r,s)}function Ng(e,n){return n.value}function co(e,n,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(n.node=r)}function Rs(e,n){if(n.length>0){const s=n.length>1?n:n[0];s&&(e.children=s)}}function Ig(e,n,s){return r;function r(i,o,a,l){const p=Array.isArray(a.children)?s:n;return l?p(o,a,l):p(o,a)}}function Tg(e,n){return s;function s(r,i,o,a){const l=Array.isArray(o.children),u=ws(r);return n(i,o,a,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Pg(e,n){const s={};let r,i;for(i in n.properties)if(i!=="children"&&ks.call(n.properties,i)){const o=Bg(e,i,n.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&bg.has(n.tagName)?r=l:s[a]=l}}if(r){const o=s.style||(s.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function Lg(e,n){const s={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const l=a.properties[0];l.type,Object.assign(s,e.evaluater.evaluateExpression(l.argument))}else tn(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else tn(e,n.position);else o=r.value===null?!0:r.value;s[i]=o}return s}function Ns(e,n){const s=[];let r=-1;const i=e.passKeys?new Map:jg;for(;++r<n.children.length;){const o=n.children[r];let a;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const p=i.get(u)||0;a=u+"-"+p,i.set(u,p+1)}}const l=lo(e,o,a);l!==void 0&&s.push(l)}return s}function Bg(e,n,s){const r=Kh(e.schema,n);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?Fh(s):tg(s)),r.property==="style"){let i=typeof s=="object"?s:Ag(e,String(s));return e.stylePropertyNameCase==="css"&&(i=Mg(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Zh[r.property]||r.property:r.attribute,s]}}function Ag(e,n){const s={};try{gg(n,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,a=new _e("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=ao+"#cannot-parse-style-attribute",a}}return s;function r(i,o){let a=i;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(_g,Dg)),s[a]=o}}function uo(e,n,s){let r;if(!s)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,a;for(;++o<i.length;){const l=Xs(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=a}else r=Xs(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return ks.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tn(e)}function tn(e,n){const s=new _e("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=ao+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Mg(e){const n={};let s;for(s in e)ks.call(e,s)&&(n[$g(s)]=e[s]);return n}function $g(e){let n=e.replace(yg,Fg);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Dg(e,n){return n.toUpperCase()}function Fg(e){return"-"+e.toLowerCase()}const Jn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Og={};function Hg(e,n){const s=Og,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,i=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return po(e,r,i)}function po(e,n,s){if(zg(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ir(e.children,n,s)}return Array.isArray(e)?ir(e,n,s):""}function ir(e,n,s){const r=[];let i=-1;for(;++i<e.length;)r[i]=po(e[i],n,s);return r.join("")}function zg(e){return!!(e&&typeof e=="object")}const ar=document.createElement("i");function Is(e){const n="&"+e+";";ar.innerHTML=n;const s=ar.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===n?!1:s}function Ke(e,n,s,r){const i=e.length;let o=0,a;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,s=s>0?s:0,r.length<1e4)a=Array.from(r),a.unshift(n,s),e.splice(...a);else for(s&&e.splice(n,s);o<r.length;)a=r.slice(o,o+1e4),a.unshift(n,0),e.splice(...a),o+=1e4,n+=1e4}function Le(e,n){return e.length>0?(Ke(e,e.length,0,n),e):n}const lr={}.hasOwnProperty;function Ug(e){const n={};let s=-1;for(;++s<e.length;)Vg(n,e[s]);return n}function Vg(e,n){let s;for(s in n){const i=(lr.call(e,s)?e[s]:void 0)||(e[s]={}),o=n[s];let a;if(o)for(a in o){lr.call(i,a)||(i[a]=[]);const l=o[a];Wg(i[a],Array.isArray(l)?l:l?[l]:[])}}}function Wg(e,n){let s=-1;const r=[];for(;++s<n.length;)(n[s].add==="after"?e:r).push(n[s]);Ke(e,0,0,r)}function mo(e,n){const s=Number.parseInt(e,n);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Lt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ye=xt(/[A-Za-z]/),Ne=xt(/[\dA-Za-z]/),qg=xt(/[#-'*+\--9=?A-Z^-~]/);function gs(e){return e!==null&&(e<32||e===127)}const fs=xt(/\d/),Gg=xt(/[\dA-Fa-f]/),Zg=xt(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function ve(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const Xg=xt(new RegExp("\\p{P}|\\p{S}","u")),Yg=xt(/\s/);function xt(e){return n;function n(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function Mt(e){const n=[];let s=-1,r=0,i=0;for(;++s<e.length;){const o=e.charCodeAt(s);let a="";if(o===37&&Ne(e.charCodeAt(s+1))&&Ne(e.charCodeAt(s+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(s+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),i=1):a="�"}else a=String.fromCharCode(o);a&&(n.push(e.slice(r,s),encodeURIComponent(a)),r=s+i+1,a=""),i&&(s+=i,i=0)}return n.join("")+e.slice(r)}function ce(e,n,s,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(u){return re(u)?(e.enter(s),l(u)):n(u)}function l(u){return re(u)&&o++<i?(e.consume(u),l):(e.exit(s),n(u))}}const Kg={tokenize:Jg};function Jg(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let s;return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ce(e,n,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=u),s=u,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return U(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),a)}}const Qg={tokenize:ef},cr={tokenize:tf};function ef(e){const n=this,s=[];let r=0,i,o,a;return l;function l(C){if(r<s.length){const N=s[r];return n.containerState=N[1],e.attempt(N[0].continuation,u,p)(C)}return p(C)}function u(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const N=n.events.length;let w=N,S;for(;w--;)if(n.events[w][0]==="exit"&&n.events[w][1].type==="chunkFlow"){S=n.events[w][1].end;break}f(r);let A=N;for(;A<n.events.length;)n.events[A][1].end={...S},A++;return Ke(n.events,w+1,0,n.events.slice(N)),n.events.length=A,p(C)}return l(C)}function p(C){if(r===s.length){if(!i)return x(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(cr,c,m)(C)}function c(C){return i&&E(),f(r),x(C)}function m(C){return n.parser.lazy[n.now().line]=r!==s.length,a=n.now().offset,g(C)}function x(C){return n.containerState={},e.attempt(cr,d,g)(C)}function d(C){return r++,s.push([n.currentConstruct,n.containerState]),x(C)}function g(C){if(C===null){i&&E(),f(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(C)}function h(C){if(C===null){b(e.exit("chunkFlow"),!0),f(0),e.consume(C);return}return U(C)?(e.consume(C),b(e.exit("chunkFlow")),r=0,n.interrupt=void 0,l):(e.consume(C),h)}function b(C,N){const w=n.sliceStream(C);if(N&&w.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(w),n.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const A=n.events.length;let $=A,z,V;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(z){V=n.events[$][1].end;break}z=!0}for(f(r),S=A;S<n.events.length;)n.events[S][1].end={...V},S++;Ke(n.events,$+1,0,n.events.slice(A)),n.events.length=S}}function f(C){let N=s.length;for(;N-- >C;){const w=s[N];n.containerState=w[1],w[0].exit.call(n,e)}s.length=C}function E(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function tf(e,n,s){return ce(e,e.attempt(this.parser.constructs.document,n,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ur(e){if(e===null||ve(e)||Yg(e))return 1;if(Xg(e))return 2}function Ts(e,n,s){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,s),r.push(o))}return n}const js={name:"attention",resolveAll:nf,tokenize:sf};function nf(e,n){let s=-1,r,i,o,a,l,u,p,c;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const m={...e[r][1].end},x={...e[s][1].start};pr(m,-u),pr(x,u),a={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:x},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[r][1].end={...a.start},e[s][1].start={...l.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Le(p,[["enter",e[r][1],n],["exit",e[r][1],n]])),p=Le(p,[["enter",i,n],["enter",a,n],["exit",a,n],["enter",o,n]]),p=Le(p,Ts(n.parser.constructs.insideSpan.null,e.slice(r+1,s),n)),p=Le(p,[["exit",o,n],["enter",l,n],["exit",l,n],["exit",i,n]]),e[s][1].end.offset-e[s][1].start.offset?(c=2,p=Le(p,[["enter",e[s][1],n],["exit",e[s][1],n]])):c=0,Ke(e,r-1,s-r+3,p),s=r+p.length-c-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function sf(e,n){const s=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ur(r);let o;return a;function a(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const p=e.exit("attentionSequence"),c=ur(u),m=!c||c===2&&i||s.includes(u),x=!i||i===2&&c||s.includes(r);return p._open=!!(o===42?m:m&&(i||!x)),p._close=!!(o===42?x:x&&(c||!m)),n(u)}}function pr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const rf={name:"autolink",tokenize:of};function of(e,n,s){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return Ye(d)?(e.consume(d),a):d===64?s(d):p(d)}function a(d){return d===43||d===45||d===46||Ne(d)?(r=1,l(d)):p(d)}function l(d){return d===58?(e.consume(d),r=0,u):(d===43||d===45||d===46||Ne(d))&&r++<32?(e.consume(d),l):(r=0,p(d))}function u(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),n):d===null||d===32||d===60||gs(d)?s(d):(e.consume(d),u)}function p(d){return d===64?(e.consume(d),c):qg(d)?(e.consume(d),p):s(d)}function c(d){return Ne(d)?m(d):s(d)}function m(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),n):x(d)}function x(d){if((d===45||Ne(d))&&r++<63){const g=d===45?x:m;return e.consume(d),g}return s(d)}}const Ln={partial:!0,tokenize:af};function af(e,n,s){return r;function r(o){return re(o)?ce(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||U(o)?n(o):s(o)}}const xo={continuation:{tokenize:cf},exit:uf,name:"blockQuote",tokenize:lf};function lf(e,n,s){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return s(a)}function o(a){return re(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(a))}}function cf(e,n,s){const r=this;return i;function i(a){return re(a)?ce(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(xo,n,s)(a)}}function uf(e){e.exit("blockQuote")}const ho={name:"characterEscape",tokenize:pf};function pf(e,n,s){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Zg(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):s(o)}}const go={name:"characterReference",tokenize:df};function df(e,n,s){const r=this;let i=0,o,a;return l;function l(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),u}function u(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,a=Ne,c(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Gg,c):(e.enter("characterReferenceValue"),o=7,a=fs,c(m))}function c(m){if(m===59&&i){const x=e.exit("characterReferenceValue");return a===Ne&&!Is(r.sliceSerialize(x))?s(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return a(m)&&i++<o?(e.consume(m),c):s(m)}}const dr={partial:!0,tokenize:xf},mr={concrete:!0,name:"codeFenced",tokenize:mf};function mf(e,n,s){const r=this,i={partial:!0,tokenize:w};let o=0,a=0,l;return u;function u(S){return p(S)}function p(S){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===l?(a++,e.consume(S),c):a<3?s(S):(e.exit("codeFencedFenceSequence"),re(S)?ce(e,m,"whitespace")(S):m(S))}function m(S){return S===null||U(S)?(e.exit("codeFencedFence"),r.interrupt?n(S):e.check(dr,h,N)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||U(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(S)):re(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ce(e,d,"whitespace")(S)):S===96&&S===l?s(S):(e.consume(S),x)}function d(S){return S===null||U(S)?m(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||U(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(S)):S===96&&S===l?s(S):(e.consume(S),g)}function h(S){return e.attempt(i,N,b)(S)}function b(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),f}function f(S){return o>0&&re(S)?ce(e,E,"linePrefix",o+1)(S):E(S)}function E(S){return S===null||U(S)?e.check(dr,h,N)(S):(e.enter("codeFlowValue"),C(S))}function C(S){return S===null||U(S)?(e.exit("codeFlowValue"),E(S)):(e.consume(S),C)}function N(S){return e.exit("codeFenced"),n(S)}function w(S,A,$){let z=0;return V;function V(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),B}function B(P){return S.enter("codeFencedFence"),re(P)?ce(S,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):R(P)}function R(P){return P===l?(S.enter("codeFencedFenceSequence"),I(P)):$(P)}function I(P){return P===l?(z++,S.consume(P),I):z>=a?(S.exit("codeFencedFenceSequence"),re(P)?ce(S,M,"whitespace")(P):M(P)):$(P)}function M(P){return P===null||U(P)?(S.exit("codeFencedFence"),A(P)):$(P)}}}function xf(e,n,s){const r=this;return i;function i(a){return a===null?s(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?s(a):n(a)}}const Qn={name:"codeIndented",tokenize:gf},hf={partial:!0,tokenize:ff};function gf(e,n,s){const r=this;return i;function i(p){return e.enter("codeIndented"),ce(e,o,"linePrefix",5)(p)}function o(p){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(p):s(p)}function a(p){return p===null?u(p):U(p)?e.attempt(hf,a,u)(p):(e.enter("codeFlowValue"),l(p))}function l(p){return p===null||U(p)?(e.exit("codeFlowValue"),a(p)):(e.consume(p),l)}function u(p){return e.exit("codeIndented"),n(p)}}function ff(e,n,s){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?s(a):U(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ce(e,o,"linePrefix",5)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(a):U(a)?i(a):s(a)}}const jf={name:"codeText",previous:_f,resolve:yf,tokenize:Sf};function yf(e){let n=e.length-4,s=3,r,i;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=s;++r<n;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(r=s-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function _f(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sf(e,n,s){let r=0,i,o;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),r++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?s(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(o=e.enter("codeTextSequence"),i=0,c(m)):U(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),p(m))}function p(m){return m===null||m===32||m===96||U(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),p)}function c(m){return m===96?(e.consume(m),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",p(m))}}class bf{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,s){const r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,s,r){const i=s||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),qt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),qt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const s=this.left.splice(n,Number.POSITIVE_INFINITY);qt(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);qt(this.left,s.reverse())}}}function qt(e,n){let s=0;if(n.length<1e4)e.push(...n);else for(;s<n.length;)e.push(...n.slice(s,s+1e4)),s+=1e4}function fo(e){const n={};let s=-1,r,i,o,a,l,u,p;const c=new bf(e);for(;++s<c.length;){for(;s in n;)s=n[s];if(r=c.get(s),s&&r[1].type==="chunkFlow"&&c.get(s-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Cf(c,s)),s=n[s],p=!0);else if(r[1]._container){for(o=s,i=void 0;o--;)if(a=c.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},l=c.slice(i,s),l.unshift(r),c.splice(i,s-i+1,l))}}return Ke(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!p}function Cf(e,n){const s=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let a=s._tokenizer;a||(a=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,u=[],p={};let c,m,x=-1,d=s,g=0,h=0;const b=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),m&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=d,d=d.next}for(d=s;++x<l.length;)l[x][0]==="exit"&&l[x-1][0]==="enter"&&l[x][1].type===l[x-1][1].type&&l[x][1].start.line!==l[x][1].end.line&&(h=x+1,b.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):b.pop(),x=b.length;x--;){const f=l.slice(b[x],b[x+1]),E=o.pop();u.push([E,E+f.length-1]),e.splice(E,2,f)}for(u.reverse(),x=-1;++x<u.length;)p[g+u[x][0]]=g+u[x][1],g+=u[x][1]-u[x][0]-1;return p}const Ef={resolve:wf,tokenize:kf},vf={partial:!0,tokenize:Rf};function wf(e){return fo(e),e}function kf(e,n){let s;return r;function r(l){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):U(l)?e.check(vf,a,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),n(l)}function a(l){return e.consume(l),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,i}}function Rf(e,n,s){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ce(e,o,"linePrefix")}function o(a){if(a===null||U(a))return s(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(a):e.interrupt(r.parser.constructs.flow,s,n)(a)}}function jo(e,n,s,r,i,o,a,l,u){const p=u||Number.POSITIVE_INFINITY;let c=0;return m;function m(f){return f===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(f),e.exit(o),x):f===null||f===32||f===41||gs(f)?s(f):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(f))}function x(f){return f===62?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(l),e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===62?(e.exit("chunkString"),e.exit(l),x(f)):f===null||f===60||U(f)?s(f):(e.consume(f),f===92?g:d)}function g(f){return f===60||f===62||f===92?(e.consume(f),d):d(f)}function h(f){return!c&&(f===null||f===41||ve(f))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),n(f)):c<p&&f===40?(e.consume(f),c++,h):f===41?(e.consume(f),c--,h):f===null||f===32||f===40||gs(f)?s(f):(e.consume(f),f===92?b:h)}function b(f){return f===40||f===41||f===92?(e.consume(f),h):h(f)}}function yo(e,n,s,r,i,o){const a=this;let l=0,u;return p;function p(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),c}function c(d){return l>999||d===null||d===91||d===93&&!u||d===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?s(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):U(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),m(d))}function m(d){return d===null||d===91||d===93||U(d)||l++>999?(e.exit("chunkString"),c(d)):(e.consume(d),u||(u=!re(d)),d===92?x:m)}function x(d){return d===91||d===92||d===93?(e.consume(d),l++,m):m(d)}}function _o(e,n,s,r,i,o){let a;return l;function l(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),a=x===40?41:x,u):s(x)}function u(x){return x===a?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),n):(e.enter(o),p(x))}function p(x){return x===a?(e.exit(o),u(a)):x===null?s(x):U(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ce(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===a||x===null||U(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?m:c)}function m(x){return x===a||x===92?(e.consume(x),c):c(x)}}function Jt(e,n){let s;return r;function r(i){return U(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s=!0,r):re(i)?ce(e,r,s?"linePrefix":"lineSuffix")(i):n(i)}}const Nf={name:"definition",tokenize:Tf},If={partial:!0,tokenize:Pf};function Tf(e,n,s){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return yo.call(r,e,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function l(d){return i=Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),u):s(d)}function u(d){return ve(d)?Jt(e,p)(d):p(d)}function p(d){return jo(e,c,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(If,m,m)(d)}function m(d){return re(d)?ce(e,x,"whitespace")(d):x(d)}function x(d){return d===null||U(d)?(e.exit("definition"),r.parser.defined.push(i),n(d)):s(d)}}function Pf(e,n,s){return r;function r(l){return ve(l)?Jt(e,i)(l):s(l)}function i(l){return _o(e,o,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return re(l)?ce(e,a,"whitespace")(l):a(l)}function a(l){return l===null||U(l)?n(l):s(l)}}const Lf={name:"hardBreakEscape",tokenize:Bf};function Bf(e,n,s){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return U(o)?(e.exit("hardBreakEscape"),n(o)):s(o)}}const Af={name:"headingAtx",resolve:Mf,tokenize:$f};function Mf(e,n){let s=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},o={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},Ke(e,r,s-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function $f(e,n,s){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||ve(c)?(e.exit("atxHeadingSequence"),l(c)):s(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||U(c)?(e.exit("atxHeading"),n(c)):re(c)?ce(e,l,"whitespace")(c):(e.enter("atxHeadingText"),p(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),l(c))}function p(c){return c===null||c===35||ve(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),p)}}const Df=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xr=["pre","script","style","textarea"],Ff={concrete:!0,name:"htmlFlow",resolveTo:zf,tokenize:Uf},Of={partial:!0,tokenize:Wf},Hf={partial:!0,tokenize:Vf};function zf(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Uf(e,n,s){const r=this;let i,o,a,l,u;return p;function p(y){return c(y)}function c(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),m}function m(y){return y===33?(e.consume(y),x):y===47?(e.consume(y),o=!0,h):y===63?(e.consume(y),i=3,r.interrupt?n:j):Ye(y)?(e.consume(y),a=String.fromCharCode(y),b):s(y)}function x(y){return y===45?(e.consume(y),i=2,d):y===91?(e.consume(y),i=5,l=0,g):Ye(y)?(e.consume(y),i=4,r.interrupt?n:j):s(y)}function d(y){return y===45?(e.consume(y),r.interrupt?n:j):s(y)}function g(y){const Q="CDATA[";return y===Q.charCodeAt(l++)?(e.consume(y),l===Q.length?r.interrupt?n:R:g):s(y)}function h(y){return Ye(y)?(e.consume(y),a=String.fromCharCode(y),b):s(y)}function b(y){if(y===null||y===47||y===62||ve(y)){const Q=y===47,ge=a.toLowerCase();return!Q&&!o&&xr.includes(ge)?(i=1,r.interrupt?n(y):R(y)):Df.includes(a.toLowerCase())?(i=6,Q?(e.consume(y),f):r.interrupt?n(y):R(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(y):o?E(y):C(y))}return y===45||Ne(y)?(e.consume(y),a+=String.fromCharCode(y),b):s(y)}function f(y){return y===62?(e.consume(y),r.interrupt?n:R):s(y)}function E(y){return re(y)?(e.consume(y),E):V(y)}function C(y){return y===47?(e.consume(y),V):y===58||y===95||Ye(y)?(e.consume(y),N):re(y)?(e.consume(y),C):V(y)}function N(y){return y===45||y===46||y===58||y===95||Ne(y)?(e.consume(y),N):w(y)}function w(y){return y===61?(e.consume(y),S):re(y)?(e.consume(y),w):C(y)}function S(y){return y===null||y===60||y===61||y===62||y===96?s(y):y===34||y===39?(e.consume(y),u=y,A):re(y)?(e.consume(y),S):$(y)}function A(y){return y===u?(e.consume(y),u=null,z):y===null||U(y)?s(y):(e.consume(y),A)}function $(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||ve(y)?w(y):(e.consume(y),$)}function z(y){return y===47||y===62||re(y)?C(y):s(y)}function V(y){return y===62?(e.consume(y),B):s(y)}function B(y){return y===null||U(y)?R(y):re(y)?(e.consume(y),B):s(y)}function R(y){return y===45&&i===2?(e.consume(y),O):y===60&&i===1?(e.consume(y),D):y===62&&i===4?(e.consume(y),se):y===63&&i===3?(e.consume(y),j):y===93&&i===5?(e.consume(y),H):U(y)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Of,he,I)(y)):y===null||U(y)?(e.exit("htmlFlowData"),I(y)):(e.consume(y),R)}function I(y){return e.check(Hf,M,he)(y)}function M(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),P}function P(y){return y===null||U(y)?I(y):(e.enter("htmlFlowData"),R(y))}function O(y){return y===45?(e.consume(y),j):R(y)}function D(y){return y===47?(e.consume(y),a="",L):R(y)}function L(y){if(y===62){const Q=a.toLowerCase();return xr.includes(Q)?(e.consume(y),se):R(y)}return Ye(y)&&a.length<8?(e.consume(y),a+=String.fromCharCode(y),L):R(y)}function H(y){return y===93?(e.consume(y),j):R(y)}function j(y){return y===62?(e.consume(y),se):y===45&&i===2?(e.consume(y),j):R(y)}function se(y){return y===null||U(y)?(e.exit("htmlFlowData"),he(y)):(e.consume(y),se)}function he(y){return e.exit("htmlFlow"),n(y)}}function Vf(e,n,s){const r=this;return i;function i(a){return U(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):s(a)}function o(a){return r.parser.lazy[r.now().line]?s(a):n(a)}}function Wf(e,n,s){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ln,n,s)}}const qf={name:"htmlText",tokenize:Gf};function Gf(e,n,s){const r=this;let i,o,a;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),u}function u(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),w):j===63?(e.consume(j),C):Ye(j)?(e.consume(j),$):s(j)}function p(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),o=0,g):Ye(j)?(e.consume(j),E):s(j)}function c(j){return j===45?(e.consume(j),d):s(j)}function m(j){return j===null?s(j):j===45?(e.consume(j),x):U(j)?(a=m,D(j)):(e.consume(j),m)}function x(j){return j===45?(e.consume(j),d):m(j)}function d(j){return j===62?O(j):j===45?x(j):m(j)}function g(j){const se="CDATA[";return j===se.charCodeAt(o++)?(e.consume(j),o===se.length?h:g):s(j)}function h(j){return j===null?s(j):j===93?(e.consume(j),b):U(j)?(a=h,D(j)):(e.consume(j),h)}function b(j){return j===93?(e.consume(j),f):h(j)}function f(j){return j===62?O(j):j===93?(e.consume(j),f):h(j)}function E(j){return j===null||j===62?O(j):U(j)?(a=E,D(j)):(e.consume(j),E)}function C(j){return j===null?s(j):j===63?(e.consume(j),N):U(j)?(a=C,D(j)):(e.consume(j),C)}function N(j){return j===62?O(j):C(j)}function w(j){return Ye(j)?(e.consume(j),S):s(j)}function S(j){return j===45||Ne(j)?(e.consume(j),S):A(j)}function A(j){return U(j)?(a=A,D(j)):re(j)?(e.consume(j),A):O(j)}function $(j){return j===45||Ne(j)?(e.consume(j),$):j===47||j===62||ve(j)?z(j):s(j)}function z(j){return j===47?(e.consume(j),O):j===58||j===95||Ye(j)?(e.consume(j),V):U(j)?(a=z,D(j)):re(j)?(e.consume(j),z):O(j)}function V(j){return j===45||j===46||j===58||j===95||Ne(j)?(e.consume(j),V):B(j)}function B(j){return j===61?(e.consume(j),R):U(j)?(a=B,D(j)):re(j)?(e.consume(j),B):z(j)}function R(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(e.consume(j),i=j,I):U(j)?(a=R,D(j)):re(j)?(e.consume(j),R):(e.consume(j),M)}function I(j){return j===i?(e.consume(j),i=void 0,P):j===null?s(j):U(j)?(a=I,D(j)):(e.consume(j),I)}function M(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ve(j)?z(j):(e.consume(j),M)}function P(j){return j===47||j===62||ve(j)?z(j):s(j)}function O(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),n):s(j)}function D(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),L}function L(j){return re(j)?ce(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),a(j)}}const Ps={name:"labelEnd",resolveAll:Kf,resolveTo:Jf,tokenize:Qf},Zf={tokenize:e2},Xf={tokenize:t2},Yf={tokenize:n2};function Kf(e){let n=-1;const s=[];for(;++n<e.length;){const r=e[n][1];if(s.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==s.length&&Ke(e,0,e.length,s),e}function Jf(e,n){let s=e.length,r=0,i,o,a,l;for(;s--;)if(i=e[s][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[s][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[s][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=s,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=s);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",u,n],["enter",p,n]],l=Le(l,e.slice(o+1,o+r+3)),l=Le(l,[["enter",c,n]]),l=Le(l,Ts(n.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),n)),l=Le(l,[["exit",c,n],e[a-2],e[a-1],["exit",p,n]]),l=Le(l,e.slice(a+1)),l=Le(l,[["exit",u,n]]),Ke(e,o,e.length,l),e}function Qf(e,n,s){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(x){return o?o._inactive?m(x):(a=r.parser.defined.includes(Lt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),u):s(x)}function u(x){return x===40?e.attempt(Zf,c,a?c:m)(x):x===91?e.attempt(Xf,c,a?p:m)(x):a?c(x):m(x)}function p(x){return e.attempt(Yf,c,m)(x)}function c(x){return n(x)}function m(x){return o._balanced=!0,s(x)}}function e2(e,n,s){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return ve(m)?Jt(e,o)(m):o(m)}function o(m){return m===41?c(m):jo(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return ve(m)?Jt(e,u)(m):c(m)}function l(m){return s(m)}function u(m){return m===34||m===39||m===40?_o(e,p,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):c(m)}function p(m){return ve(m)?Jt(e,c)(m):c(m)}function c(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):s(m)}}function t2(e,n,s){const r=this;return i;function i(l){return yo.call(r,e,o,a,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(l):s(l)}function a(l){return s(l)}}function n2(e,n,s){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):s(o)}}const s2={name:"labelStartImage",resolveAll:Ps.resolveAll,tokenize:r2};function r2(e,n,s){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):s(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(l):n(l)}}const o2={name:"labelStartLink",resolveAll:Ps.resolveAll,tokenize:i2};function i2(e,n,s){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(a):n(a)}}const es={name:"lineEnding",tokenize:a2};function a2(e,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ce(e,n,"linePrefix")}}const kn={name:"thematicBreak",tokenize:l2};function l2(e,n,s){let r=0,i;return o;function o(p){return e.enter("thematicBreak"),a(p)}function a(p){return i=p,l(p)}function l(p){return p===i?(e.enter("thematicBreakSequence"),u(p)):r>=3&&(p===null||U(p))?(e.exit("thematicBreak"),n(p)):s(p)}function u(p){return p===i?(e.consume(p),r++,u):(e.exit("thematicBreakSequence"),re(p)?ce(e,l,"whitespace")(p):l(p))}}const Ee={continuation:{tokenize:d2},exit:x2,name:"list",tokenize:p2},c2={partial:!0,tokenize:h2},u2={partial:!0,tokenize:m2};function p2(e,n,s){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:fs(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(kn,s,p)(d):p(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(d)}return s(d)}function u(d){return fs(d)&&++a<10?(e.consume(d),u):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),p(d)):s(d)}function p(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Ln,r.interrupt?s:c,e.attempt(c2,x,m))}function c(d){return r.containerState.initialBlankLine=!0,o++,x(d)}function m(d){return re(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),x):s(d)}function x(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(d)}}function d2(e,n,s){const r=this;return r.containerState._closeFlow=void 0,e.check(Ln,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,n,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!re(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(u2,n,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(Ee,n,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function m2(e,n,s){const r=this;return ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(o):s(o)}}function x2(e){e.exit(this.containerState.type)}function h2(e,n,s){const r=this;return ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?n(o):s(o)}}const hr={name:"setextUnderline",resolveTo:g2,tokenize:f2};function g2(e,n){let s=e.length,r,i,o;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&e.splice(s,1),!o&&e[s][1].type==="definition"&&(o=s);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f2(e,n,s){const r=this;let i;return o;function o(p){let c=r.events.length,m;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){m=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=p,a(p)):s(p)}function a(p){return e.enter("setextHeadingLineSequence"),l(p)}function l(p){return p===i?(e.consume(p),l):(e.exit("setextHeadingLineSequence"),re(p)?ce(e,u,"lineSuffix")(p):u(p))}function u(p){return p===null||U(p)?(e.exit("setextHeadingLine"),n(p)):s(p)}}const j2={tokenize:y2};function y2(e){const n=this,s=e.attempt(Ln,r,e.attempt(this.parser.constructs.flowInitial,i,ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ef,i)),"linePrefix")));return s;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,s}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,s}}const _2={resolveAll:bo()},S2=So("string"),b2=So("text");function So(e){return{resolveAll:bo(e==="text"?C2:void 0),tokenize:n};function n(s){const r=this,i=this.parser.constructs[e],o=s.attempt(i,a,l);return a;function a(c){return p(c)?o(c):l(c)}function l(c){if(c===null){s.consume(c);return}return s.enter("data"),s.consume(c),u}function u(c){return p(c)?(s.exit("data"),o(c)):(s.consume(c),u)}function p(c){if(c===null)return!0;const m=i[c];let x=-1;if(m)for(;++x<m.length;){const d=m[x];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function bo(e){return n;function n(s,r){let i=-1,o;for(;++i<=s.length;)o===void 0?s[i]&&s[i][1].type==="data"&&(o=i,i++):(!s[i]||s[i][1].type!=="data")&&(i!==o+2&&(s[o][1].end=s[i-1][1].end,s.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(s,r):s}}function C2(e,n){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=n.sliceStream(r);let o=i.length,a=-1,l=0,u;for(;o--;){const p=i[o];if(typeof p=="string"){for(a=p.length;p.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(p===-2)u=!0,l++;else if(p!==-1){o++;break}}if(n._contentTypeTextTrailing&&s===e.length&&(l=0),l){const p={type:s===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(s,0,["enter",p,n],["exit",p,n]),s+=2)}s++}return e}const E2={42:Ee,43:Ee,45:Ee,48:Ee,49:Ee,50:Ee,51:Ee,52:Ee,53:Ee,54:Ee,55:Ee,56:Ee,57:Ee,62:xo},v2={91:Nf},w2={[-2]:Qn,[-1]:Qn,32:Qn},k2={35:Af,42:kn,45:[hr,kn],60:Ff,61:hr,95:kn,96:mr,126:mr},R2={38:go,92:ho},N2={[-5]:es,[-4]:es,[-3]:es,33:s2,38:go,42:js,60:[rf,qf],91:o2,92:[Lf,ho],93:Ps,95:js,96:jf},I2={null:[js,_2]},T2={null:[42,95]},P2={null:[]},L2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:T2,contentInitial:v2,disable:P2,document:E2,flow:k2,flowInitial:w2,insideSpan:I2,string:R2,text:N2},Symbol.toStringTag,{value:"Module"}));function B2(e,n,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const i={},o=[];let a=[],l=[];const u={attempt:A(w),check:A(S),consume:E,enter:C,exit:N,interrupt:A(S,{interrupt:!0})},p={code:null,containerState:{},defineSkip:h,events:[],now:g,parser:e,previous:null,sliceSerialize:x,sliceStream:d,write:m};let c=n.tokenize.call(p,u);return n.resolveAll&&o.push(n),p;function m(B){return a=Le(a,B),b(),a[a.length-1]!==null?[]:($(n,0),p.events=Ts(o,p.events,p),p.events)}function x(B,R){return M2(d(B),R)}function d(B){return A2(a,B)}function g(){const{_bufferIndex:B,_index:R,line:I,column:M,offset:P}=r;return{_bufferIndex:B,_index:R,line:I,column:M,offset:P}}function h(B){i[B.line]=B.column,V()}function b(){let B;for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<R.length;)f(R.charCodeAt(r._bufferIndex));else f(R)}}function f(B){c=c(B)}function E(B){U(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,V()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=B}function C(B,R){const I=R||{};return I.type=B,I.start=g(),p.events.push(["enter",I,p]),l.push(I),I}function N(B){const R=l.pop();return R.end=g(),p.events.push(["exit",R,p]),R}function w(B,R){$(B,R.from)}function S(B,R){R.restore()}function A(B,R){return I;function I(M,P,O){let D,L,H,j;return Array.isArray(M)?he(M):"tokenize"in M?he([M]):se(M);function se(G){return je;function je(Ae){const ot=Ae!==null&&G[Ae],Je=Ae!==null&&G.null,ht=[...Array.isArray(ot)?ot:ot?[ot]:[],...Array.isArray(Je)?Je:Je?[Je]:[]];return he(ht)(Ae)}}function he(G){return D=G,L=0,G.length===0?O:y(G[L])}function y(G){return je;function je(Ae){return j=z(),H=G,G.partial||(p.currentConstruct=G),G.name&&p.parser.constructs.disable.null.includes(G.name)?ge():G.tokenize.call(R?Object.assign(Object.create(p),R):p,u,Q,ge)(Ae)}}function Q(G){return B(H,j),P}function ge(G){return j.restore(),++L<D.length?y(D[L]):O}}}function $(B,R){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Ke(p.events,R,p.events.length-R,B.resolve(p.events.slice(R),p)),B.resolveTo&&(p.events=B.resolveTo(p.events,p))}function z(){const B=g(),R=p.previous,I=p.currentConstruct,M=p.events.length,P=Array.from(l);return{from:M,restore:O};function O(){r=B,p.previous=R,p.currentConstruct=I,p.events.length=M,l=P,V()}}function V(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function A2(e,n){const s=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let a;if(s===i)a=[e[s].slice(r,o)];else{if(a=e.slice(s,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function M2(e,n){let s=-1;const r=[];let i;for(;++s<e.length;){const o=e[s];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
104
104
  `;break}case-3:{a=`\r
105
- `;break}case-2:{a=n?" ":" ";break}case-1:{if(!n&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function $2(e){const r={constructs:Ug([L2,...(e||{}).extensions||[]]),content:i(Kg),defined:[],document:i(Qg),flow:i(j2),lazy:{},string:i(S2),text:i(b2)};return r;function i(o){return a;function a(l){return B2(r,o,l)}}}function D2(e){for(;!fo(e););return e}const gr=/[\0\t\n\r]/g;function F2(){let e=1,n="",s=!0,r;return i;function i(o,a,l){const u=[];let p,c,m,x,d;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),m=0,n="",s&&(o.charCodeAt(0)===65279&&m++,s=void 0);m<o.length;){if(gr.lastIndex=m,p=gr.exec(o),x=p&&p.index!==void 0?p.index:o.length,d=o.charCodeAt(x),!p){n=o.slice(m);break}if(d===10&&m===x&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<x&&(u.push(o.slice(m,x)),e+=x-m),d){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return l&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const O2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H2(e){return e.replace(O2,z2)}function z2(e,n,s){if(n)return n;if(s.charCodeAt(0)===35){const i=s.charCodeAt(1),o=i===120||i===88;return mo(s.slice(o?2:1),o?16:10)}return Is(s)||e}const Co={}.hasOwnProperty;function U2(e,n,s){return typeof n!="string"&&(s=n,n=void 0),V2(s)(D2($2(s).document().write(F2()(e,n,!0))))}function V2(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Z),autolinkProtocol:z,autolinkEmail:z,atxHeading:o($t),blockQuote:o(Je),characterEscape:z,characterReference:z,codeFenced:o(ht),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ht,a),codeText:o(cn,a),codeTextData:z,data:z,codeFlowValue:z,definition:o(Mn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(un),hardBreakEscape:o(Y),hardBreakTrailing:o(Y),htmlFlow:o(W,a),htmlFlowData:z,htmlText:o(W,a),htmlTextData:z,image:o(ie),label:a,link:o(Z),listItem:o(K),listItemValue:x,listOrdered:o(ee,m),listUnordered:o(ee),paragraph:o(oe),reference:y,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o($t),strong:o(ne),thematicBreak:o(it)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:ot,autolinkProtocol:Ae,blockQuote:u(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:G,characterReference:je,codeFenced:u(S),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:V,codeIndented:u(j),codeText:u(P),codeTextData:V,data:V,definition:u(),definitionDestinationString:N,definitionLabelString:E,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(R),hardBreakTrailing:u(R),htmlFlow:u(I),htmlFlowData:V,htmlText:u(M),htmlTextData:V,image:u(D),label:H,labelText:L,lineEnding:B,link:u(O),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:f,resourceTitleString:se,resource:he,setextHeading:u($),setextHeadingLineSequence:A,setextHeadingText:b,strong:u(),thematicBreak:u()}};Eo(n,(e||{}).mdastExtensions||[]);const s={};return r;function r(v){let T={type:"root",children:[]};const q={stack:[T],tokenStack:[],config:n,enter:l,exit:p,buffer:a,resume:c,data:s},te=[];let ae=-1;for(;++ae<v.length;)if(v[ae][1].type==="listOrdered"||v[ae][1].type==="listUnordered")if(v[ae][0]==="enter")te.push(ae);else{const Me=te.pop();ae=i(v,Me,ae)}for(ae=-1;++ae<v.length;){const Me=n[v[ae][0]];Co.call(Me,v[ae][1].type)&&Me[v[ae][1].type].call(Object.assign({sliceSerialize:v[ae][2].sliceSerialize},q),v[ae][1])}if(q.tokenStack.length>0){const Me=q.tokenStack[q.tokenStack.length-1];(Me[1]||fr).call(q,void 0,Me[0])}for(T.position={start:ut(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:ut(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},ae=-1;++ae<n.transforms.length;)T=n.transforms[ae](T)||T;return T}function i(v,T,q){let te=T-1,ae=-1,Me=!1,gt,Qe,Dt,Ft;for(;++te<=q;){const ke=v[te];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?ae++:ae--,Ft=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(gt&&!Ft&&!ae&&!Dt&&(Dt=te),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=void 0}if(!ae&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||ae===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(gt){let wt=te;for(Qe=void 0;wt--;){const et=v[wt];if(et[1].type==="lineEnding"||et[1].type==="lineEndingBlank"){if(et[0]==="exit")continue;Qe&&(v[Qe][1].type="lineEndingBlank",Me=!0),et[1].type="lineEnding",Qe=wt}else if(!(et[1].type==="linePrefix"||et[1].type==="blockQuotePrefix"||et[1].type==="blockQuotePrefixWhitespace"||et[1].type==="blockQuoteMarker"||et[1].type==="listItemIndent"))break}Dt&&(!Qe||Dt<Qe)&&(gt._spread=!0),gt.end=Object.assign({},Qe?v[Qe][1].start:ke[1].end),v.splice(Qe||te,0,["exit",gt,ke[2]]),te++,q++}if(ke[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};gt=wt,v.splice(te,0,["enter",wt,ke[2]]),te++,q++,Dt=void 0,Ft=!0}}}return v[T][1]._spread=Me,q}function o(v,T){return q;function q(te){l.call(this,v(te),te),T&&T.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(v,T,q){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([T,q||void 0]),v.position={start:ut(T.start),end:void 0}}function u(v){return T;function T(q){v&&v.call(this,q),p.call(this,q)}}function p(v,T){const q=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==v.type&&(T?T.call(this,v,te[0]):(te[1]||fr).call(this,v,te[0]));else throw new Error("Cannot close `"+v.type+"` ("+Kt({start:v.start,end:v.end})+"): it’s not open");q.position.end=ut(v.end)}function c(){return Hg(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(v){if(this.data.expectingFirstListItemValue){const T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function d(){const v=this.resume(),T=this.stack[this.stack.length-1];T.lang=v}function g(){const v=this.resume(),T=this.stack[this.stack.length-1];T.meta=v}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v.replace(/(\r?\n|\r)$/g,"")}function E(v){const T=this.resume(),q=this.stack[this.stack.length-1];q.label=T,q.identifier=Lt(this.sliceSerialize(v)).toLowerCase()}function C(){const v=this.resume(),T=this.stack[this.stack.length-1];T.title=v}function N(){const v=this.resume(),T=this.stack[this.stack.length-1];T.url=v}function w(v){const T=this.stack[this.stack.length-1];if(!T.depth){const q=this.sliceSerialize(v).length;T.depth=q}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function A(v){const T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function z(v){const q=this.stack[this.stack.length-1].children;let te=q[q.length-1];(!te||te.type!=="text")&&(te=pe(),te.position={start:ut(v.start),end:void 0},q.push(te)),this.stack.push(te)}function V(v){const T=this.stack.pop();T.value+=this.sliceSerialize(v),T.position.end=ut(v.end)}function B(v){const T=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=T.children[T.children.length-1];q.position.end=ut(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(T.type)&&(z.call(this,v),V.call(this,v))}function R(){this.data.atHardBreak=!0}function I(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function M(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function P(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function O(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=T,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function D(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=T,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function L(v){const T=this.sliceSerialize(v),q=this.stack[this.stack.length-2];q.label=H2(T),q.identifier=Lt(T).toLowerCase()}function H(){const v=this.stack[this.stack.length-1],T=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const te=v.children;q.children=te}else q.alt=T}function f(){const v=this.resume(),T=this.stack[this.stack.length-1];T.url=v}function se(){const v=this.resume(),T=this.stack[this.stack.length-1];T.title=v}function he(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function Q(v){const T=this.resume(),q=this.stack[this.stack.length-1];q.label=T,q.identifier=Lt(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function ge(v){this.data.characterReferenceType=v.type}function G(v){const T=this.sliceSerialize(v),q=this.data.characterReferenceType;let te;q?(te=mo(T,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Is(T);const ae=this.stack[this.stack.length-1];ae.value+=te}function je(v){const T=this.stack.pop();T.position.end=ut(v.end)}function Ae(v){V.call(this,v);const T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(v)}function ot(v){V.call(this,v);const T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(v)}function Je(){return{type:"blockquote",children:[]}}function ht(){return{type:"code",lang:null,meta:null,value:""}}function cn(){return{type:"inlineCode",value:""}}function Mn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function un(){return{type:"emphasis",children:[]}}function $t(){return{type:"heading",depth:0,children:[]}}function Y(){return{type:"break"}}function W(){return{type:"html",value:""}}function ie(){return{type:"image",title:null,url:"",alt:null}}function Z(){return{type:"link",title:null,url:"",children:[]}}function ee(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function K(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ne(){return{type:"strong",children:[]}}function pe(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function ut(e){return{line:e.line,column:e.column,offset:e.offset}}function Eo(e,n){let s=-1;for(;++s<n.length;){const r=n[s];Array.isArray(r)?Eo(e,r):W2(e,r)}}function W2(e,n){let s;for(s in n)if(Co.call(n,s))switch(s){case"canContainEols":{const r=n[s];r&&e[s].push(...r);break}case"transforms":{const r=n[s];r&&e[s].push(...r);break}case"enter":case"exit":{const r=n[s];r&&Object.assign(e[s],r);break}}}function fr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Kt({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Kt({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Kt({start:n.start,end:n.end})+") is still open")}function q2(e){const n=this;n.parser=s;function s(r){return U2(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function G2(e,n){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,s),e.applyData(n,s)}function Z2(e,n){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,s),[e.applyData(n,s),{type:"text",value:`
105
+ `;break}case-2:{a=n?" ":" ";break}case-1:{if(!n&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function $2(e){const r={constructs:Ug([L2,...(e||{}).extensions||[]]),content:i(Kg),defined:[],document:i(Qg),flow:i(j2),lazy:{},string:i(S2),text:i(b2)};return r;function i(o){return a;function a(l){return B2(r,o,l)}}}function D2(e){for(;!fo(e););return e}const gr=/[\0\t\n\r]/g;function F2(){let e=1,n="",s=!0,r;return i;function i(o,a,l){const u=[];let p,c,m,x,d;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),m=0,n="",s&&(o.charCodeAt(0)===65279&&m++,s=void 0);m<o.length;){if(gr.lastIndex=m,p=gr.exec(o),x=p&&p.index!==void 0?p.index:o.length,d=o.charCodeAt(x),!p){n=o.slice(m);break}if(d===10&&m===x&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<x&&(u.push(o.slice(m,x)),e+=x-m),d){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return l&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const O2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H2(e){return e.replace(O2,z2)}function z2(e,n,s){if(n)return n;if(s.charCodeAt(0)===35){const i=s.charCodeAt(1),o=i===120||i===88;return mo(s.slice(o?2:1),o?16:10)}return Is(s)||e}const Co={}.hasOwnProperty;function U2(e,n,s){return typeof n!="string"&&(s=n,n=void 0),V2(s)(D2($2(s).document().write(F2()(e,n,!0))))}function V2(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Z),autolinkProtocol:z,autolinkEmail:z,atxHeading:o($t),blockQuote:o(Je),characterEscape:z,characterReference:z,codeFenced:o(ht),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ht,a),codeText:o(cn,a),codeTextData:z,data:z,codeFlowValue:z,definition:o(Mn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(un),hardBreakEscape:o(Y),hardBreakTrailing:o(Y),htmlFlow:o(W,a),htmlFlowData:z,htmlText:o(W,a),htmlTextData:z,image:o(ie),label:a,link:o(Z),listItem:o(K),listItemValue:x,listOrdered:o(ee,m),listUnordered:o(ee),paragraph:o(oe),reference:y,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o($t),strong:o(ne),thematicBreak:o(it)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:ot,autolinkProtocol:Ae,blockQuote:u(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:G,characterReference:je,codeFenced:u(b),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:V,codeIndented:u(f),codeText:u(P),codeTextData:V,data:V,definition:u(),definitionDestinationString:N,definitionLabelString:E,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(R),hardBreakTrailing:u(R),htmlFlow:u(I),htmlFlowData:V,htmlText:u(M),htmlTextData:V,image:u(D),label:H,labelText:L,lineEnding:B,link:u(O),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:j,resourceTitleString:se,resource:he,setextHeading:u($),setextHeadingLineSequence:A,setextHeadingText:S,strong:u(),thematicBreak:u()}};Eo(n,(e||{}).mdastExtensions||[]);const s={};return r;function r(v){let T={type:"root",children:[]};const q={stack:[T],tokenStack:[],config:n,enter:l,exit:p,buffer:a,resume:c,data:s},te=[];let ae=-1;for(;++ae<v.length;)if(v[ae][1].type==="listOrdered"||v[ae][1].type==="listUnordered")if(v[ae][0]==="enter")te.push(ae);else{const Me=te.pop();ae=i(v,Me,ae)}for(ae=-1;++ae<v.length;){const Me=n[v[ae][0]];Co.call(Me,v[ae][1].type)&&Me[v[ae][1].type].call(Object.assign({sliceSerialize:v[ae][2].sliceSerialize},q),v[ae][1])}if(q.tokenStack.length>0){const Me=q.tokenStack[q.tokenStack.length-1];(Me[1]||fr).call(q,void 0,Me[0])}for(T.position={start:ut(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:ut(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},ae=-1;++ae<n.transforms.length;)T=n.transforms[ae](T)||T;return T}function i(v,T,q){let te=T-1,ae=-1,Me=!1,gt,Qe,Dt,Ft;for(;++te<=q;){const ke=v[te];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?ae++:ae--,Ft=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(gt&&!Ft&&!ae&&!Dt&&(Dt=te),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=void 0}if(!ae&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||ae===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(gt){let wt=te;for(Qe=void 0;wt--;){const et=v[wt];if(et[1].type==="lineEnding"||et[1].type==="lineEndingBlank"){if(et[0]==="exit")continue;Qe&&(v[Qe][1].type="lineEndingBlank",Me=!0),et[1].type="lineEnding",Qe=wt}else if(!(et[1].type==="linePrefix"||et[1].type==="blockQuotePrefix"||et[1].type==="blockQuotePrefixWhitespace"||et[1].type==="blockQuoteMarker"||et[1].type==="listItemIndent"))break}Dt&&(!Qe||Dt<Qe)&&(gt._spread=!0),gt.end=Object.assign({},Qe?v[Qe][1].start:ke[1].end),v.splice(Qe||te,0,["exit",gt,ke[2]]),te++,q++}if(ke[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};gt=wt,v.splice(te,0,["enter",wt,ke[2]]),te++,q++,Dt=void 0,Ft=!0}}}return v[T][1]._spread=Me,q}function o(v,T){return q;function q(te){l.call(this,v(te),te),T&&T.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(v,T,q){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([T,q||void 0]),v.position={start:ut(T.start),end:void 0}}function u(v){return T;function T(q){v&&v.call(this,q),p.call(this,q)}}function p(v,T){const q=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==v.type&&(T?T.call(this,v,te[0]):(te[1]||fr).call(this,v,te[0]));else throw new Error("Cannot close `"+v.type+"` ("+Kt({start:v.start,end:v.end})+"): it’s not open");q.position.end=ut(v.end)}function c(){return Hg(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(v){if(this.data.expectingFirstListItemValue){const T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function d(){const v=this.resume(),T=this.stack[this.stack.length-1];T.lang=v}function g(){const v=this.resume(),T=this.stack[this.stack.length-1];T.meta=v}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v.replace(/(\r?\n|\r)$/g,"")}function E(v){const T=this.resume(),q=this.stack[this.stack.length-1];q.label=T,q.identifier=Lt(this.sliceSerialize(v)).toLowerCase()}function C(){const v=this.resume(),T=this.stack[this.stack.length-1];T.title=v}function N(){const v=this.resume(),T=this.stack[this.stack.length-1];T.url=v}function w(v){const T=this.stack[this.stack.length-1];if(!T.depth){const q=this.sliceSerialize(v).length;T.depth=q}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(v){const T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function z(v){const q=this.stack[this.stack.length-1].children;let te=q[q.length-1];(!te||te.type!=="text")&&(te=pe(),te.position={start:ut(v.start),end:void 0},q.push(te)),this.stack.push(te)}function V(v){const T=this.stack.pop();T.value+=this.sliceSerialize(v),T.position.end=ut(v.end)}function B(v){const T=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=T.children[T.children.length-1];q.position.end=ut(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(T.type)&&(z.call(this,v),V.call(this,v))}function R(){this.data.atHardBreak=!0}function I(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function M(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function P(){const v=this.resume(),T=this.stack[this.stack.length-1];T.value=v}function O(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=T,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function D(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=T,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function L(v){const T=this.sliceSerialize(v),q=this.stack[this.stack.length-2];q.label=H2(T),q.identifier=Lt(T).toLowerCase()}function H(){const v=this.stack[this.stack.length-1],T=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const te=v.children;q.children=te}else q.alt=T}function j(){const v=this.resume(),T=this.stack[this.stack.length-1];T.url=v}function se(){const v=this.resume(),T=this.stack[this.stack.length-1];T.title=v}function he(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function Q(v){const T=this.resume(),q=this.stack[this.stack.length-1];q.label=T,q.identifier=Lt(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function ge(v){this.data.characterReferenceType=v.type}function G(v){const T=this.sliceSerialize(v),q=this.data.characterReferenceType;let te;q?(te=mo(T,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Is(T);const ae=this.stack[this.stack.length-1];ae.value+=te}function je(v){const T=this.stack.pop();T.position.end=ut(v.end)}function Ae(v){V.call(this,v);const T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(v)}function ot(v){V.call(this,v);const T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(v)}function Je(){return{type:"blockquote",children:[]}}function ht(){return{type:"code",lang:null,meta:null,value:""}}function cn(){return{type:"inlineCode",value:""}}function Mn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function un(){return{type:"emphasis",children:[]}}function $t(){return{type:"heading",depth:0,children:[]}}function Y(){return{type:"break"}}function W(){return{type:"html",value:""}}function ie(){return{type:"image",title:null,url:"",alt:null}}function Z(){return{type:"link",title:null,url:"",children:[]}}function ee(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function K(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ne(){return{type:"strong",children:[]}}function pe(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function ut(e){return{line:e.line,column:e.column,offset:e.offset}}function Eo(e,n){let s=-1;for(;++s<n.length;){const r=n[s];Array.isArray(r)?Eo(e,r):W2(e,r)}}function W2(e,n){let s;for(s in n)if(Co.call(n,s))switch(s){case"canContainEols":{const r=n[s];r&&e[s].push(...r);break}case"transforms":{const r=n[s];r&&e[s].push(...r);break}case"enter":case"exit":{const r=n[s];r&&Object.assign(e[s],r);break}}}function fr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Kt({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Kt({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Kt({start:n.start,end:n.end})+") is still open")}function q2(e){const n=this;n.parser=s;function s(r){return U2(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function G2(e,n){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,s),e.applyData(n,s)}function Z2(e,n){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,s),[e.applyData(n,s),{type:"text",value:`
106
106
  `}]}function X2(e,n){const s=n.value?n.value+`
107
107
  `:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:s}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Y2(e,n){const s={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function K2(e,n){const s={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function J2(e,n){const s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Mt(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+i,id:s+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,u);const p={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,p),e.applyData(n,p)}function Q2(e,n){const s={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function e0(e,n){if(e.options.allowDangerousHtml){const s={type:"raw",value:n.value};return e.patch(n,s),e.applyData(n,s)}}function vo(e,n){const s=n.referenceType;let r="]";if(s==="collapsed"?r+="[]":s==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function t0(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return vo(e,n);const i={src:Mt(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function n0(e,n){const s={src:Mt(n.url)};n.alt!==null&&n.alt!==void 0&&(s.alt=n.alt),n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,r),e.applyData(n,r)}function s0(e,n){const s={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,s);const r={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(n,r),e.applyData(n,r)}function r0(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return vo(e,n);const i={href:Mt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function o0(e,n){const s={href:Mt(n.url)};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function i0(e,n,s){const r=e.all(n),i=s?a0(s):wo(n),o={},a=[];if(typeof n.checked=="boolean"){const c=r[0];let m;c&&c.type==="element"&&c.tagName==="p"?m=c:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const c=r[l];(i||l!==0||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
108
108
  `}),c.type==="element"&&c.tagName==="p"&&!i?a.push(...c.children):a.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
109
- `});const p={type:"element",tagName:"li",properties:o,children:a};return e.patch(n,p),e.applyData(n,p)}function a0(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const s=e.children;let r=-1;for(;!n&&++r<s.length;)n=wo(s[r])}return n}function wo(e){const n=e.spread;return n??e.children.length>1}function l0(e,n){const s={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(s.start=n.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function c0(e,n){const s={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function u0(e,n){const s={type:"root",children:e.wrap(e.all(n))};return e.patch(n,s),e.applyData(n,s)}function p0(e,n){const s={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function d0(e,n){const s=e.all(n),r=s.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),i.push(a)}if(s.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},l=ws(n.children[1]),u=oo(n.children[n.children.length-1]);l&&u&&(a.position={start:l,end:u}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function m0(e,n,s){const r=s?s.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",a=s&&s.type==="table"?s.align:void 0,l=a?a.length:n.children.length;let u=-1;const p=[];for(;++u<l;){const m=n.children[u],x={},d=a?a[u]:void 0;d&&(x.align=d);let g={type:"element",tagName:o,properties:x,children:[]};m&&(g.children=e.all(m),e.patch(m,g),g=e.applyData(m,g)),p.push(g)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,c),e.applyData(n,c)}function x0(e,n){const s={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}const jr=9,yr=32;function h0(e){const n=String(e),s=/\r?\n|\r/g;let r=s.exec(n),i=0;const o=[];for(;r;)o.push(_r(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=s.exec(n);return o.push(_r(n.slice(i),i>0,!1)),o.join("")}function _r(e,n,s){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===jr||o===yr;)r++,o=e.codePointAt(r)}if(s){let o=e.codePointAt(i-1);for(;o===jr||o===yr;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function g0(e,n){const s={type:"text",value:h0(String(n.value))};return e.patch(n,s),e.applyData(n,s)}function f0(e,n){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,s),e.applyData(n,s)}const j0={blockquote:G2,break:Z2,code:X2,delete:Y2,emphasis:K2,footnoteReference:J2,heading:Q2,html:e0,imageReference:t0,image:n0,inlineCode:s0,linkReference:r0,link:o0,listItem:i0,list:l0,paragraph:c0,root:u0,strong:p0,table:d0,tableCell:x0,tableRow:m0,text:g0,thematicBreak:f0,toml:bn,yaml:bn,definition:bn,footnoteDefinition:bn};function bn(){}const ko=-1,Bn=0,Qt=1,Tn=2,Ls=3,Bs=4,As=5,Ms=6,Ro=7,No=8,Sr=typeof self=="object"?self:globalThis,y0=(e,n)=>{const s=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=n[i];switch(o){case Bn:case ko:return s(a,i);case Qt:{const l=s([],i);for(const u of a)l.push(r(u));return l}case Tn:{const l=s({},i);for(const[u,p]of a)l[r(u)]=r(p);return l}case Ls:return s(new Date(a),i);case Bs:{const{source:l,flags:u}=a;return s(new RegExp(l,u),i)}case As:{const l=s(new Map,i);for(const[u,p]of a)l.set(r(u),r(p));return l}case Ms:{const l=s(new Set,i);for(const u of a)l.add(r(u));return l}case Ro:{const{name:l,message:u}=a;return s(new Sr[l](u),i)}case No:return s(BigInt(a),i);case"BigInt":return s(Object(BigInt(a)),i);case"ArrayBuffer":return s(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return s(new DataView(l),a)}}return s(new Sr[o](a),i)};return r},br=e=>y0(new Map,e)(0),It="",{toString:_0}={},{keys:S0}=Object,Gt=e=>{const n=typeof e;if(n!=="object"||!e)return[Bn,n];const s=_0.call(e).slice(8,-1);switch(s){case"Array":return[Qt,It];case"Object":return[Tn,It];case"Date":return[Ls,It];case"RegExp":return[Bs,It];case"Map":return[As,It];case"Set":return[Ms,It];case"DataView":return[Qt,s]}return s.includes("Array")?[Qt,s]:s.includes("Error")?[Ro,s]:[Tn,s]},Cn=([e,n])=>e===Bn&&(n==="function"||n==="symbol"),b0=(e,n,s,r)=>{const i=(a,l)=>{const u=r.push(a)-1;return s.set(l,u),u},o=a=>{if(s.has(a))return s.get(a);let[l,u]=Gt(a);switch(l){case Bn:{let c=a;switch(u){case"bigint":l=No,c=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([ko],a)}return i([l,c],a)}case Qt:{if(u){let x=a;return u==="DataView"?x=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(x=new Uint8Array(a)),i([u,[...x]],a)}const c=[],m=i([l,c],a);for(const x of a)c.push(o(x));return m}case Tn:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(n&&"toJSON"in a)return o(a.toJSON());const c=[],m=i([l,c],a);for(const x of S0(a))(e||!Cn(Gt(a[x])))&&c.push([o(x),o(a[x])]);return m}case Ls:return i([l,a.toISOString()],a);case Bs:{const{source:c,flags:m}=a;return i([l,{source:c,flags:m}],a)}case As:{const c=[],m=i([l,c],a);for(const[x,d]of a)(e||!(Cn(Gt(x))||Cn(Gt(d))))&&c.push([o(x),o(d)]);return m}case Ms:{const c=[],m=i([l,c],a);for(const x of a)(e||!Cn(Gt(x)))&&c.push(o(x));return m}}const{message:p}=a;return i([l,{name:u,message:p}],a)};return o},Cr=(e,{json:n,lossy:s}={})=>{const r=[];return b0(!(n||s),!!n,new Map,r)(e),r},Pn=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?br(Cr(e,n)):structuredClone(e):(e,n)=>br(Cr(e,n));function C0(e,n){const s=[{type:"text",value:"↩"}];return n>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),s}function E0(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function v0(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||C0,r=e.options.footnoteBackLabel||E0,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[u]);if(!p)continue;const c=e.all(p),m=String(p.identifier).toUpperCase(),x=Mt(m.toLowerCase());let d=0;const g=[],h=e.footnoteCounts.get(m);for(;h!==void 0&&++d<=h;){g.length>0&&g.push({type:"text",value:" "});let E=typeof s=="string"?s:s(u,d);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,d),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const E=S.children[S.children.length-1];E&&E.type==="text"?E.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...g)}else c.push(...g);const j={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(c,!0)};e.patch(p,j),l.push(j)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
109
+ `});const p={type:"element",tagName:"li",properties:o,children:a};return e.patch(n,p),e.applyData(n,p)}function a0(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const s=e.children;let r=-1;for(;!n&&++r<s.length;)n=wo(s[r])}return n}function wo(e){const n=e.spread;return n??e.children.length>1}function l0(e,n){const s={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(s.start=n.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function c0(e,n){const s={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function u0(e,n){const s={type:"root",children:e.wrap(e.all(n))};return e.patch(n,s),e.applyData(n,s)}function p0(e,n){const s={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function d0(e,n){const s=e.all(n),r=s.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),i.push(a)}if(s.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},l=ws(n.children[1]),u=oo(n.children[n.children.length-1]);l&&u&&(a.position={start:l,end:u}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function m0(e,n,s){const r=s?s.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",a=s&&s.type==="table"?s.align:void 0,l=a?a.length:n.children.length;let u=-1;const p=[];for(;++u<l;){const m=n.children[u],x={},d=a?a[u]:void 0;d&&(x.align=d);let g={type:"element",tagName:o,properties:x,children:[]};m&&(g.children=e.all(m),e.patch(m,g),g=e.applyData(m,g)),p.push(g)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,c),e.applyData(n,c)}function x0(e,n){const s={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}const jr=9,yr=32;function h0(e){const n=String(e),s=/\r?\n|\r/g;let r=s.exec(n),i=0;const o=[];for(;r;)o.push(_r(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=s.exec(n);return o.push(_r(n.slice(i),i>0,!1)),o.join("")}function _r(e,n,s){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===jr||o===yr;)r++,o=e.codePointAt(r)}if(s){let o=e.codePointAt(i-1);for(;o===jr||o===yr;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function g0(e,n){const s={type:"text",value:h0(String(n.value))};return e.patch(n,s),e.applyData(n,s)}function f0(e,n){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,s),e.applyData(n,s)}const j0={blockquote:G2,break:Z2,code:X2,delete:Y2,emphasis:K2,footnoteReference:J2,heading:Q2,html:e0,imageReference:t0,image:n0,inlineCode:s0,linkReference:r0,link:o0,listItem:i0,list:l0,paragraph:c0,root:u0,strong:p0,table:d0,tableCell:x0,tableRow:m0,text:g0,thematicBreak:f0,toml:bn,yaml:bn,definition:bn,footnoteDefinition:bn};function bn(){}const ko=-1,Bn=0,Qt=1,Tn=2,Ls=3,Bs=4,As=5,Ms=6,Ro=7,No=8,Sr=typeof self=="object"?self:globalThis,y0=(e,n)=>{const s=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=n[i];switch(o){case Bn:case ko:return s(a,i);case Qt:{const l=s([],i);for(const u of a)l.push(r(u));return l}case Tn:{const l=s({},i);for(const[u,p]of a)l[r(u)]=r(p);return l}case Ls:return s(new Date(a),i);case Bs:{const{source:l,flags:u}=a;return s(new RegExp(l,u),i)}case As:{const l=s(new Map,i);for(const[u,p]of a)l.set(r(u),r(p));return l}case Ms:{const l=s(new Set,i);for(const u of a)l.add(r(u));return l}case Ro:{const{name:l,message:u}=a;return s(new Sr[l](u),i)}case No:return s(BigInt(a),i);case"BigInt":return s(Object(BigInt(a)),i);case"ArrayBuffer":return s(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return s(new DataView(l),a)}}return s(new Sr[o](a),i)};return r},br=e=>y0(new Map,e)(0),It="",{toString:_0}={},{keys:S0}=Object,Gt=e=>{const n=typeof e;if(n!=="object"||!e)return[Bn,n];const s=_0.call(e).slice(8,-1);switch(s){case"Array":return[Qt,It];case"Object":return[Tn,It];case"Date":return[Ls,It];case"RegExp":return[Bs,It];case"Map":return[As,It];case"Set":return[Ms,It];case"DataView":return[Qt,s]}return s.includes("Array")?[Qt,s]:s.includes("Error")?[Ro,s]:[Tn,s]},Cn=([e,n])=>e===Bn&&(n==="function"||n==="symbol"),b0=(e,n,s,r)=>{const i=(a,l)=>{const u=r.push(a)-1;return s.set(l,u),u},o=a=>{if(s.has(a))return s.get(a);let[l,u]=Gt(a);switch(l){case Bn:{let c=a;switch(u){case"bigint":l=No,c=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([ko],a)}return i([l,c],a)}case Qt:{if(u){let x=a;return u==="DataView"?x=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(x=new Uint8Array(a)),i([u,[...x]],a)}const c=[],m=i([l,c],a);for(const x of a)c.push(o(x));return m}case Tn:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(n&&"toJSON"in a)return o(a.toJSON());const c=[],m=i([l,c],a);for(const x of S0(a))(e||!Cn(Gt(a[x])))&&c.push([o(x),o(a[x])]);return m}case Ls:return i([l,a.toISOString()],a);case Bs:{const{source:c,flags:m}=a;return i([l,{source:c,flags:m}],a)}case As:{const c=[],m=i([l,c],a);for(const[x,d]of a)(e||!(Cn(Gt(x))||Cn(Gt(d))))&&c.push([o(x),o(d)]);return m}case Ms:{const c=[],m=i([l,c],a);for(const x of a)(e||!Cn(Gt(x)))&&c.push(o(x));return m}}const{message:p}=a;return i([l,{name:u,message:p}],a)};return o},Cr=(e,{json:n,lossy:s}={})=>{const r=[];return b0(!(n||s),!!n,new Map,r)(e),r},Pn=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?br(Cr(e,n)):structuredClone(e):(e,n)=>br(Cr(e,n));function C0(e,n){const s=[{type:"text",value:"↩"}];return n>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),s}function E0(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function v0(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||C0,r=e.options.footnoteBackLabel||E0,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[u]);if(!p)continue;const c=e.all(p),m=String(p.identifier).toUpperCase(),x=Mt(m.toLowerCase());let d=0;const g=[],h=e.footnoteCounts.get(m);for(;h!==void 0&&++d<=h;){g.length>0&&g.push({type:"text",value:" "});let E=typeof s=="string"?s:s(u,d);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,d),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const b=c[c.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const E=b.children[b.children.length-1];E&&E.type==="text"?E.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else c.push(...g);const f={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(c,!0)};e.patch(p,f),l.push(f)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
110
110
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
111
- `}]}}const Io=function(e){if(e==null)return N0;if(typeof e=="function")return An(e);if(typeof e=="object")return Array.isArray(e)?w0(e):k0(e);if(typeof e=="string")return R0(e);throw new Error("Expected function, string, or object as test")};function w0(e){const n=[];let s=-1;for(;++s<e.length;)n[s]=Io(e[s]);return An(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function k0(e){const n=e;return An(s);function s(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function R0(e){return An(n);function n(s){return s&&s.type===e}}function An(e){return n;function n(s,r,i){return!!(I0(s)&&e.call(this,s,typeof r=="number"?r:void 0,i||void 0))}}function N0(){return!0}function I0(e){return e!==null&&typeof e=="object"&&"type"in e}const To=[],T0=!0,Er=!1,P0="skip";function L0(e,n,s,r){let i;typeof n=="function"&&typeof s!="function"?(r=s,s=n):i=n;const o=Io(i),a=r?-1:1;l(e,void 0,[])();function l(u,p,c){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const d=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(u.type+(d?"<"+d+">":""))+")"})}return x;function x(){let d=To,g,h,S;if((!n||o(u,p,c[c.length-1]||void 0))&&(d=B0(s(u,c)),d[0]===Er))return d;if("children"in u&&u.children){const j=u;if(j.children&&d[0]!==P0)for(h=(r?j.children.length:-1)+a,S=c.concat(j);h>-1&&h<j.children.length;){const E=j.children[h];if(g=l(E,h,S)(),g[0]===Er)return g;h=typeof g[1]=="number"?g[1]:h+a}}return d}}}function B0(e){return Array.isArray(e)?e:typeof e=="number"?[T0,e]:e==null?To:[e]}function Po(e,n,s,r){let i,o,a;typeof n=="function"?(o=void 0,a=n,i=s):(o=n,a=s,i=r),L0(e,o,l,i);function l(u,p){const c=p[p.length-1],m=c?c.children.indexOf(u):void 0;return a(u,m,c)}}const ys={}.hasOwnProperty,A0={};function M0(e,n){const s=n||A0,r=new Map,i=new Map,o=new Map,a={...j0,...s.handlers},l={all:p,applyData:D0,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:u,options:s,patch:$0,wrap:O0};return Po(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const m=c.type==="definition"?r:i,x=String(c.identifier).toUpperCase();m.has(x)||m.set(x,c)}}),l;function u(c,m){const x=c.type,d=l.handlers[x];if(ys.call(l.handlers,x)&&d)return d(l,c,m);if(l.options.passThrough&&l.options.passThrough.includes(x)){if("children"in c){const{children:h,...S}=c,j=Pn(S);return j.children=l.all(c),j}return Pn(c)}return(l.options.unknownHandler||F0)(l,c,m)}function p(c){const m=[];if("children"in c){const x=c.children;let d=-1;for(;++d<x.length;){const g=l.one(x[d],c);if(g){if(d&&x[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=vr(g.value)),!Array.isArray(g)&&g.type==="element")){const h=g.children[0];h&&h.type==="text"&&(h.value=vr(h.value))}Array.isArray(g)?m.push(...g):m.push(g)}}}return m}}function $0(e,n){e.position&&(n.position=fg(e))}function D0(e,n){let s=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{const a="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:a}}s.type==="element"&&o&&Object.assign(s.properties,Pn(o)),"children"in s&&s.children&&i!==null&&i!==void 0&&(s.children=i)}return s}function F0(e,n){const s=n.data||{},r="value"in n&&!(ys.call(s,"hProperties")||ys.call(s,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function O0(e,n){const s=[];let r=-1;for(n&&s.push({type:"text",value:`
111
+ `}]}}const Io=function(e){if(e==null)return N0;if(typeof e=="function")return An(e);if(typeof e=="object")return Array.isArray(e)?w0(e):k0(e);if(typeof e=="string")return R0(e);throw new Error("Expected function, string, or object as test")};function w0(e){const n=[];let s=-1;for(;++s<e.length;)n[s]=Io(e[s]);return An(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function k0(e){const n=e;return An(s);function s(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function R0(e){return An(n);function n(s){return s&&s.type===e}}function An(e){return n;function n(s,r,i){return!!(I0(s)&&e.call(this,s,typeof r=="number"?r:void 0,i||void 0))}}function N0(){return!0}function I0(e){return e!==null&&typeof e=="object"&&"type"in e}const To=[],T0=!0,Er=!1,P0="skip";function L0(e,n,s,r){let i;typeof n=="function"&&typeof s!="function"?(r=s,s=n):i=n;const o=Io(i),a=r?-1:1;l(e,void 0,[])();function l(u,p,c){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const d=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(u.type+(d?"<"+d+">":""))+")"})}return x;function x(){let d=To,g,h,b;if((!n||o(u,p,c[c.length-1]||void 0))&&(d=B0(s(u,c)),d[0]===Er))return d;if("children"in u&&u.children){const f=u;if(f.children&&d[0]!==P0)for(h=(r?f.children.length:-1)+a,b=c.concat(f);h>-1&&h<f.children.length;){const E=f.children[h];if(g=l(E,h,b)(),g[0]===Er)return g;h=typeof g[1]=="number"?g[1]:h+a}}return d}}}function B0(e){return Array.isArray(e)?e:typeof e=="number"?[T0,e]:e==null?To:[e]}function Po(e,n,s,r){let i,o,a;typeof n=="function"?(o=void 0,a=n,i=s):(o=n,a=s,i=r),L0(e,o,l,i);function l(u,p){const c=p[p.length-1],m=c?c.children.indexOf(u):void 0;return a(u,m,c)}}const ys={}.hasOwnProperty,A0={};function M0(e,n){const s=n||A0,r=new Map,i=new Map,o=new Map,a={...j0,...s.handlers},l={all:p,applyData:D0,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:u,options:s,patch:$0,wrap:O0};return Po(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const m=c.type==="definition"?r:i,x=String(c.identifier).toUpperCase();m.has(x)||m.set(x,c)}}),l;function u(c,m){const x=c.type,d=l.handlers[x];if(ys.call(l.handlers,x)&&d)return d(l,c,m);if(l.options.passThrough&&l.options.passThrough.includes(x)){if("children"in c){const{children:h,...b}=c,f=Pn(b);return f.children=l.all(c),f}return Pn(c)}return(l.options.unknownHandler||F0)(l,c,m)}function p(c){const m=[];if("children"in c){const x=c.children;let d=-1;for(;++d<x.length;){const g=l.one(x[d],c);if(g){if(d&&x[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=vr(g.value)),!Array.isArray(g)&&g.type==="element")){const h=g.children[0];h&&h.type==="text"&&(h.value=vr(h.value))}Array.isArray(g)?m.push(...g):m.push(g)}}}return m}}function $0(e,n){e.position&&(n.position=fg(e))}function D0(e,n){let s=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{const a="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:a}}s.type==="element"&&o&&Object.assign(s.properties,Pn(o)),"children"in s&&s.children&&i!==null&&i!==void 0&&(s.children=i)}return s}function F0(e,n){const s=n.data||{},r="value"in n&&!(ys.call(s,"hProperties")||ys.call(s,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function O0(e,n){const s=[];let r=-1;for(n&&s.push({type:"text",value:`
112
112
  `});++r<e.length;)r&&s.push({type:"text",value:`
113
113
  `}),s.push(e[r]);return n&&e.length>0&&s.push({type:"text",value:`
114
114
  `}),s}function vr(e){let n=0,s=e.charCodeAt(n);for(;s===9||s===32;)n++,s=e.charCodeAt(n);return e.slice(n)}function wr(e,n){const s=M0(e,n),r=s.one(e,void 0),i=v0(s),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
115
- `},i),o}function H0(e,n){return e&&"run"in e?async function(s,r){const i=wr(s,{file:r,...n});await e.run(i,r)}:function(s,r){return wr(s,{file:r,...e||n})}}function kr(e){if(e)throw e}var Rn=Object.prototype.hasOwnProperty,Lo=Object.prototype.toString,Rr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,Ir=function(n){return typeof Array.isArray=="function"?Array.isArray(n):Lo.call(n)==="[object Array]"},Tr=function(n){if(!n||Lo.call(n)!=="[object Object]")return!1;var s=Rn.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&Rn.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!s&&!r)return!1;var i;for(i in n);return typeof i>"u"||Rn.call(n,i)},Pr=function(n,s){Rr&&s.name==="__proto__"?Rr(n,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):n[s.name]=s.newValue},Lr=function(n,s){if(s==="__proto__")if(Rn.call(n,s)){if(Nr)return Nr(n,s).value}else return;return n[s]},z0=function e(){var n,s,r,i,o,a,l=arguments[0],u=1,p=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<p;++u)if(n=arguments[u],n!=null)for(s in n)r=Lr(l,s),i=Lr(n,s),l!==i&&(c&&i&&(Tr(i)||(o=Ir(i)))?(o?(o=!1,a=r&&Ir(r)?r:[]):a=r&&Tr(r)?r:{},Pr(l,{name:s,newValue:e(c,a,i)})):typeof i<"u"&&Pr(l,{name:s,newValue:i}));return l};const ts=t.getDefaultExportFromCjs(z0);function _s(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U0(){const e=[],n={run:s,use:r};return n;function s(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(u,...p){const c=e[++o];let m=-1;if(u){a(u);return}for(;++m<i.length;)(p[m]===null||p[m]===void 0)&&(p[m]=i[m]);i=p,c?V0(c,l)(...p):a(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function V0(e,n){let s;return r;function r(...a){const l=e.length>a.length;let u;l&&a.push(i);try{u=e.apply(this,a)}catch(p){const c=p;if(l&&s)throw c;return i(c)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...l){s||(s=!0,n(a,...l))}function o(a){i(null,a)}}const Xe={basename:W0,dirname:q0,extname:G0,join:Z0,sep:"/"};function W0(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');ln(e);let s=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(s,r)}if(n===e)return"";let a=-1,l=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===n.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return s===r?r=a:r<0&&(r=e.length),e.slice(s,r)}function q0(e){if(ln(e),e.length===0)return".";let n=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){n=s;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function G0(e){ln(e);let n=e.length,s=-1,r=0,i=-1,o=0,a;for(;n--;){const l=e.codePointAt(n);if(l===47){if(a){r=n+1;break}continue}s<0&&(a=!0,s=n+1),l===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||s<0||o===0||o===1&&i===s-1&&i===r+1?"":e.slice(i,s)}function Z0(...e){let n=-1,s;for(;++n<e.length;)ln(e[n]),e[n]&&(s=s===void 0?e[n]:s+"/"+e[n]);return s===void 0?".":X0(s)}function X0(e){ln(e);const n=e.codePointAt(0)===47;let s=Y0(e,!n);return s.length===0&&!n&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),n?"/"+s:s}function Y0(e,n){let s="",r=0,i=-1,o=0,a=-1,l,u;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(u=s.lastIndexOf("/"),u!==s.length-1){u<0?(s="",r=0):(s=s.slice(0,u),r=s.length-1-s.lastIndexOf("/")),i=a,o=0;continue}}else if(s.length>0){s="",r=0,i=a,o=0;continue}}n&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(i+1,a):s=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return s}function ln(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K0={cwd:J0};function J0(){return"/"}function Ss(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q0(e){if(typeof e=="string")e=new URL(e);else if(!Ss(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return e1(e)}function e1(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let s=-1;for(;++s<n.length;)if(n.codePointAt(s)===37&&n.codePointAt(s+1)===50){const r=n.codePointAt(s+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const ns=["history","path","basename","stem","extname","dirname"];class Bo{constructor(n){let s;n?Ss(n)?s={path:n}:typeof n=="string"||t1(n)?s={value:n}:s=n:s={},this.cwd="cwd"in s?"":K0.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ns.length;){const o=ns[r];o in s&&s[o]!==void 0&&s[o]!==null&&(this[o]=o==="history"?[...s[o]]:s[o])}let i;for(i in s)ns.includes(i)||(this[i]=s[i])}get basename(){return typeof this.path=="string"?Xe.basename(this.path):void 0}set basename(n){rs(n,"basename"),ss(n,"basename"),this.path=Xe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Xe.dirname(this.path):void 0}set dirname(n){Br(this.basename,"dirname"),this.path=Xe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Xe.extname(this.path):void 0}set extname(n){if(ss(n,"extname"),Br(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Ss(n)&&(n=Q0(n)),rs(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Xe.basename(this.path,this.extname):void 0}set stem(n){rs(n,"stem"),ss(n,"stem"),this.path=Xe.join(this.dirname||"",n+(this.extname||""))}fail(n,s,r){const i=this.message(n,s,r);throw i.fatal=!0,i}info(n,s,r){const i=this.message(n,s,r);return i.fatal=void 0,i}message(n,s,r){const i=new _e(n,s,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ss(e,n){if(e&&e.includes(Xe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Xe.sep+"`")}function rs(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Br(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function t1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const n1=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},s1={}.hasOwnProperty;class $s extends n1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U0()}copy(){const n=new $s;let s=-1;for(;++s<this.attachers.length;){const r=this.attachers[s];n.use(...r)}return n.data(ts(!0,{},this.namespace)),n}data(n,s){return typeof n=="string"?arguments.length===2?(as("data",this.frozen),this.namespace[n]=s,this):s1.call(this.namespace,n)&&this.namespace[n]||void 0:n?(as("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=s.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const s=En(n),r=this.parser||this.Parser;return os("parse",r),r(String(s),s)}process(n,s){const r=this;return this.freeze(),os("process",this.parser||this.Parser),is("process",this.compiler||this.Compiler),s?i(void 0,s):new Promise(i);function i(o,a){const l=En(n),u=r.parse(l);r.run(u,l,function(c,m,x){if(c||!m||!x)return p(c);const d=m,g=r.stringify(d,x);i1(g)?x.value=g:x.result=g,p(c,x)});function p(c,m){c||!m?a(c):o?o(m):s(void 0,m)}}}processSync(n){let s=!1,r;return this.freeze(),os("processSync",this.parser||this.Parser),is("processSync",this.compiler||this.Compiler),this.process(n,i),Mr("processSync","process",s),r;function i(o,a){s=!0,kr(o),r=a}}run(n,s,r){Ar(n),this.freeze();const i=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?o(void 0,r):new Promise(o);function o(a,l){const u=En(s);i.run(n,u,p);function p(c,m,x){const d=m||n;c?l(c):a?a(d):r(void 0,d,x)}}}runSync(n,s){let r=!1,i;return this.run(n,s,o),Mr("runSync","run",r),i;function o(a,l){kr(a),i=l,r=!0}}stringify(n,s){this.freeze();const r=En(s),i=this.compiler||this.Compiler;return is("stringify",i),Ar(n),i(n,r)}use(n,...s){const r=this.attachers,i=this.namespace;if(as("use",this.frozen),n!=null)if(typeof n=="function")u(n,s);else if(typeof n=="object")Array.isArray(n)?l(n):a(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")u(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[c,...m]=p;u(c,m)}else a(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function a(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(p.plugins),p.settings&&(i.settings=ts(!0,i.settings,p.settings))}function l(p){let c=-1;if(p!=null)if(Array.isArray(p))for(;++c<p.length;){const m=p[c];o(m)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function u(p,c){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===p){x=m;break}if(x===-1)r.push([p,...c]);else if(c.length>0){let[d,...g]=c;const h=r[x][1];_s(h)&&_s(d)&&(d=ts(!0,h,d)),r[x]=[p,d,...g]}}}}const r1=new $s().freeze();function os(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function is(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function as(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ar(e){if(!_s(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Mr(e,n,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function En(e){return o1(e)?e:new Bo(e)}function o1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function i1(e){return typeof e=="string"||a1(e)}function a1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$r=[],Dr={allowDangerousHtml:!0},c1=/^(https?|ircs?|mailto|xmpp)$/i,u1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function p1(e){const n=d1(e),s=m1(e);return x1(n.runSync(n.parse(s),s),e)}function d1(e){const n=e.rehypePlugins||$r,s=e.remarkPlugins||$r,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dr}:Dr;return r1().use(q2).use(s).use(H0,r).use(n)}function m1(e){const n=e.children||"",s=new Bo;return typeof n=="string"&&(s.value=n),s}function x1(e,n){const s=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,a=n.skipHtml,l=n.unwrapDisallowed,u=n.urlTransform||h1;for(const c of u1)Object.hasOwn(n,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+l1+c.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),Po(e,p),Cg(e,{Fragment:t.jsxRuntimeExports.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsxRuntimeExports.jsx,jsxs:t.jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function p(c,m,x){if(c.type==="raw"&&x&&typeof m=="number")return a?x.children.splice(m,1):x.children[m]={type:"text",value:c.value},m;if(c.type==="element"){let d;for(d in Jn)if(Object.hasOwn(Jn,d)&&Object.hasOwn(c.properties,d)){const g=c.properties[d],h=Jn[d];(h===null||h.includes(c.tagName))&&(c.properties[d]=u(String(g||""),d,c))}}if(c.type==="element"){let d=s?!s.includes(c.tagName):o?o.includes(c.tagName):!1;if(!d&&r&&typeof m=="number"&&(d=!r(c,m,x)),d&&x&&typeof m=="number")return l&&c.children?x.children.splice(m,1,...c.children):x.children.splice(m,1),m}}}function h1(e){const n=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||s!==-1&&n>s||r!==-1&&n>r||c1.test(e.slice(0,n))?e:""}const g1=({subscription:e})=>t.jsxRuntimeExports.jsxs("div",{className:Ze.container,children:[t.jsxRuntimeExports.jsxs("div",{className:Ze.productDetails,children:[t.jsxRuntimeExports.jsx("div",{className:Ze.imageContainer,children:e!=null&&e.image?t.jsxRuntimeExports.jsx("img",{className:Ze.image,src:t.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})}),t.jsxRuntimeExports.jsxs("div",{className:Ze.textContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Ze.header,children:t.jsxRuntimeExports.jsx("h2",{className:Ze.title,children:e.name})}),t.jsxRuntimeExports.jsxs("p",{className:Ze.price,children:[t.formatPrice(e.price)," / ",e.recurringInterval]})]}),t.jsxRuntimeExports.jsx("div",{className:Ze.badgeContainer,children:t.jsxRuntimeExports.jsx(t.SubscriptionStatusBadge,{status:e.status})})]}),e.description&&t.jsxRuntimeExports.jsx(p1,{className:Ze.description,children:e.description})]}),f1="_card_69liy_1",j1="_price_69liy_10",y1="_interval_69liy_17",_1="_name_69liy_22",S1="_description_69liy_28",b1="_currentPlan_69liy_32",C1="_selectButton_69liy_45",E1="_progressSection_69liy_50",v1="_progressLabel_69liy_54",w1="_bottomSheet_69liy_60",k1="_title_69liy_69",R1="_typeSelector_69liy_80",N1="_typeOption_69liy_90",I1="_active_69liy_100",T1="_saveTag_69liy_108",P1="_planSelector_69liy_117",L1="_modal_69liy_127",B1="_inactive_69liy_148",A1="_notMounted_69liy_151",M1="_closeButton_69liy_157",ue={card:f1,price:j1,interval:y1,name:_1,description:S1,currentPlan:b1,selectButton:C1,progressSection:E1,progressLabel:v1,bottomSheet:w1,title:k1,typeSelector:R1,typeOption:N1,active:I1,saveTag:T1,planSelector:P1,modal:L1,inactive:B1,notMounted:A1,closeButton:M1},$1=({variant:e,onSelect:n,isCurrent:s})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",i=e.subscriptionSettings.price.amount.toFixed(2),o=e.subscriptionSettings.recurringIntervalDays,a=10;return t.jsxRuntimeExports.jsxs("div",{className:ue.card,onClick:n,children:[t.jsxRuntimeExports.jsxs("h2",{className:ue.price,children:["$",i," ",t.jsxRuntimeExports.jsxs("span",{className:ue.interval,children:["/ ",r]})]}),t.jsxRuntimeExports.jsx("h3",{className:ue.name,children:e.name}),e.description&&t.jsxRuntimeExports.jsx("p",{className:ue.description,children:e.description}),s?t.jsxRuntimeExports.jsxs("div",{className:ue.currentPlan,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}),"Your current Plan"]}):t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:ue.selectButton,children:"Select"}),s&&t.jsxRuntimeExports.jsxs("div",{className:ue.progressSection,children:[t.jsxRuntimeExports.jsx(Wr,{percent:a/o*100,disablePercentLabel:!0}),t.jsxRuntimeExports.jsxs("p",{className:ue.progressLabel,children:["Used: ",a," of ",o," days"]})]})]})},D1=({isOpen:e,setIsOpen:n,subscription:s})=>{const[r,i]=_.useState(null),[o,a]=_.useState(null),[l,u]=_.useState(null),{id:p,accessToken:c}=t.useParams(),[m,x]=_.useState(!1),[d,g]=_.useState(!1),{setIsOpen:h}=t.useModalStore();_.useEffect(()=>{e&&x(!0)},[e]);const S=()=>{n(!1)},[j,E]=_.useState(null);_.useEffect(()=>{p&&c&&(async()=>{if(p&&c){const{data:b}=await t.getSubscriptionUpgradePlans({id:p,accessToken:c});E(b)}})()},[p,c]),_.useEffect(()=>{var w;if(j!=null&&j.data.types[0]){const b=(w=j.data.types.flatMap(A=>A.productVariants).find(A=>A.data.id===(s==null?void 0:s.variantId)))==null?void 0:w.data;b&&(u(b),a(b))}},[j,s]),_.useEffect(()=>{j!=null&&j.data.types[0]&&i(j==null?void 0:j.data.types[0])},[j==null?void 0:j.data.types]);const C=w=>{i(w),a(null)},N=w=>{a(w),h(!0),g(!0)};return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ue.modal,{[ue.active]:e,[ue.inactive]:!e&&m,[ue.notMounted]:!m}),onClick:w=>w.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:S,hoverable:!0,className:ue.closeButton,fill:"var(--text-primary)"}),t.jsxRuntimeExports.jsxs("div",{className:ue.bottomSheet,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:ue.title,children:"Change Plan"}),t.jsxRuntimeExports.jsx("p",{className:ue.description,children:j==null?void 0:j.data.description}),t.jsxRuntimeExports.jsx("div",{className:ue.typeSelector,children:j==null?void 0:j.data.types.map(w=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(ue.typeOption,{[ue.active]:(r==null?void 0:r.id)===w.id}),onClick:()=>C(w),children:[w.name,w.name==="Yearly"&&t.jsxRuntimeExports.jsx("span",{className:ue.saveTag,children:"Save %"})]},w.id))}),r&&t.jsxRuntimeExports.jsx("div",{className:ue.planSelector,children:r.productVariants.map(w=>t.jsxRuntimeExports.jsx($1,{variant:w.data,isSelected:(o==null?void 0:o.id)===w.data.id,isCurrent:(l==null?void 0:l.id)===w.data.id,onSelect:()=>N(w.data)},w.data.id))})]}),d&&o&&s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{g(!1)},children:t.jsxRuntimeExports.jsx(Rj,{setIsOpen:g,selectedVariant:o,subscription:s})})]})},F1="_container_nb625_1",O1="_title_nb625_11",H1="_subtitle_nb625_16",z1="_info_nb625_20",vn={container:F1,title:O1,subtitle:H1,info:z1},U1=()=>{const{subscription:e}=t.useSubscriptionStore(),[n,s]=t.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,i]=_.useState(!1),{setIsOpen:o}=t.useModalStore();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:vn.container,children:[t.jsxRuntimeExports.jsxs("div",{className:vn.info,children:[t.jsxRuntimeExports.jsx("p",{className:vn.title,children:"Expiration Date"}),t.jsxRuntimeExports.jsxs("p",{className:vn.subtitle,children:[n," at ",s]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:a=>{a.stopPropagation(),o(!0),i(!0)},children:"Extend"})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(Wj,{setIsOpen:i})})]})},V1="_couponContainer_1sspa_1",W1="_iconWrapper_1sspa_10",q1="_details_1sspa_21",G1="_title_1sspa_25",Z1="_progress_1sspa_29",X1="_foreverText_1sspa_34",Tt={couponContainer:V1,iconWrapper:W1,details:q1,title:G1,progress:Z1,foreverText:X1},Y1=({coupon:e,currency:n})=>{const s=e.isFixed?t.formatPrice({amount:e.discount,currency:n}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?t.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return t.jsxRuntimeExports.jsxs("div",{className:Tt.couponContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Tt.iconWrapper,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CheckCircle"})}),t.jsxRuntimeExports.jsxs("div",{className:Tt.details,children:[t.jsxRuntimeExports.jsxs("p",{className:Tt.title,children:[e.name,", ",s," discount"]}),t.jsxRuntimeExports.jsx("div",{className:Tt.progress,children:t.jsxRuntimeExports.jsx(Wr,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),t.jsxRuntimeExports.jsx("p",{className:Tt.foreverText,children:"Forever discount code"})]})]})},K1="_paymentMethodContainer_1g0da_4",J1="_paymentMethodTitle_1g0da_15",Q1="_activeMethod_1g0da_20",ej="_noMethod_1g0da_28",tj="_activeMethodPaymentMethod_1g0da_37",nj="_paymentMethodLogo_1g0da_47",sj="_paymentMethodNumber_1g0da_57",rj="_method_1g0da_61",dt={paymentMethodContainer:K1,paymentMethodTitle:J1,activeMethod:Q1,noMethod:ej,activeMethodPaymentMethod:tj,paymentMethodLogo:nj,paymentMethodNumber:sj,method:rj},oj="_paymentMethods_1gev0_1",ij="_modal_1gev0_14",aj="_header_1gev0_28",lj="_content_1gev0_37",_t={paymentMethods:oj,modal:ij,header:aj,content:lj},cj=e=>{const{setIsLoading:n,setIsOpen:s}=e,{subscription:r,setSubscription:i}=t.useSubscriptionStore();if(!r)return null;const{id:o}=t.useParams(),a=t.useNavigate(),{notifications:l,setNotifications:u}=t.useNotificationStore(),{setPaymentMethod:p,setGateway:c,cart:m}=t.useCart(),{setIsOpen:x}=t.useModalStore();async function d(){if(g(),n(!0),o&&r){const{data:h}=await t.changeSubscriptionGateway(o,m.gateway);h.isReconnectPaymentNeeded?a(`/charges/${h.chargeId}`):(u([...l,{status:"success",id:t.v4(),message:"Your action has been successfully completed"}]),i({...r,gatewayName:m.gateway}))}else u([...l,{status:"error",id:t.v4(),message:"Your action has been failed. Try again!"}]);n(!1)}function g(){x(!1),setTimeout(()=>{s(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:_t.modal,onClick:h=>{h.stopPropagation()},children:[t.jsxRuntimeExports.jsxs("div",{className:_t.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:_t.title,children:"Choose Payment Method"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:_t.content,children:[(r==null?void 0:r.availableGateways)&&t.jsxRuntimeExports.jsx(Gr,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:c,setPaymentMethod:p,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>a("/customer-dash")}),t.jsxRuntimeExports.jsxs("div",{className:_t.paymentMethods,children:[t.jsxRuntimeExports.jsx("div",{className:_t.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:_t.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!m.gateway,onClick:()=>d(),children:"Continue"})})]})]})]})},uj="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",pj=()=>{var g,h,S;const{subscription:e}=t.useSubscriptionStore(),{cart:n,setPaymentMethod:s}=t.useCart(),r=t.useNavigate(),[i,o]=_.useState(null),[a,l]=_.useState(!1),[u,p]=_.useState(!1),{setIsOpen:c}=t.useModalStore();if(!e)return null;const[m,x]=_.useState(e.gatewayName||n.gateway),d=n.paymentMethod;return _.useEffect(()=>{(async()=>{const E=await t.getGatewaysDetail(e.availableGateways);o(E)})()},[]),_.useEffect(()=>{n.gateway!==m&&x(n.gateway)},[n.gateway]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:dt.paymentMethodContainer,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("p",{className:dt.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&t.jsxRuntimeExports.jsx(dj,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&m==="Balance"&&t.jsxRuntimeExports.jsx(qr,{gateway:m,gatewayDisplayName:m,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!m&&t.jsxRuntimeExports.jsx("span",{className:dt.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&m&&t.jsxRuntimeExports.jsx("div",{className:dt.activeMethod,children:i&&t.jsxRuntimeExports.jsx(t.CheckoutPaymentMethod,{align:"row",gatewayLogoCfId:(g=i.find(j=>j.name===m))==null?void 0:g.logoCfImageId,gatewayDisplayName:(h=i.find(j=>j.name===m))==null?void 0:h.displayName,gateway:m,poweredByLogoCfId:(S=i.find(j=>j.name===m))==null?void 0:S.poweredByImageCfImageId,className:dt.activeMethodPaymentMethod,selected:d===m,onSelect:j=>{s(j)}},m)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:j=>{j.stopPropagation(),c(!0),p(!0)},children:n.gateway?"Change":"Manage"})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>p(!1),children:t.jsxRuntimeExports.jsx(cj,{setIsLoading:l,setIsOpen:p})})]})},dj=({gatewayInfo:e})=>{var n,s,r,i,o;return t.jsxRuntimeExports.jsxs("div",{className:dt.method,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.paymentMethodLogo,children:[((n=e.card)==null?void 0:n.brand.toLowerCase())==="visa"&&t.jsxRuntimeExports.jsx(t.Visa,{}),((s=e.card)==null?void 0:s.brand.toLowerCase())==="mastercard"&&t.jsxRuntimeExports.jsx("img",{src:uj,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((i=e.card)==null?void 0:i.brand.toLowerCase())!=="mastercard"&&t.jsxRuntimeExports.jsx(t.Icon,{name:"CreditCard",width:22})]}),t.jsxRuntimeExports.jsxs("p",{className:dt.paymentMethodNumber,children:["•••• •••• •••• ",(o=e.card)==null?void 0:o.last4]})]})},mj="_subscriptionProductContainer_83ibx_4",xj="_subscriptionProductImage_83ibx_15",hj="_subscriptionProductInfo_83ibx_32",gj="_name_83ibx_37",fj="_price_83ibx_40",Zt={subscriptionProductContainer:mj,subscriptionProductImage:xj,subscriptionProductInfo:hj,name:gj,price:fj},jj=({subscription:e,id:n,accessToken:s})=>{const[r,i]=_.useState(!1),{setIsOpen:o}=t.useModalStore();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Zt.subscriptionProductContainer,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:Zt.subscriptionProductImage,children:e!=null&&e.image?t.jsxRuntimeExports.jsx("img",{src:t.convertCfImageIdToUrl(e.image.cfId)}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})}),t.jsxRuntimeExports.jsxs("div",{className:Zt.subscriptionProductInfo,children:[t.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:t.jsxRuntimeExports.jsx("h2",{className:Zt.name,children:e.name})}),t.jsxRuntimeExports.jsxs("p",{className:Zt.price,children:[t.formatPrice(e.price)," / ",e.recurringInterval]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:a=>{a.preventDefault(),i(!0),o(!0)},children:"Cancel"})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(ry,{accessToken:s,id:n,isOpen:r,setIsOpen:i})})]})},yj="_content_5ctxw_1",_j="_selectedPlan_5ctxw_37",Sj="_planName_5ctxw_44",bj="_description_5ctxw_48",Cj="_price_5ctxw_51",Ej="_buttonGroup_5ctxw_79",vj="_buttonWrapper_5ctxw_84",wj="_modal_5ctxw_88",kj="_header_5ctxw_95",He={content:yj,selectedPlan:_j,planName:Sj,description:bj,price:Cj,buttonGroup:Ej,buttonWrapper:vj,modal:wj,header:kj},Rj=({setIsOpen:e,selectedVariant:n,subscription:s})=>{if(!n)return null;const{setIsOpen:r}=t.useModalStore(),i=()=>{o()},o=()=>{r(!1),setTimeout(()=>{e(!1)},300)},a=(n.subscriptionSettings.compareAtPrice||n.subscriptionSettings.price).amount,l=n.subscriptionSettings.compareAtPrice?n.subscriptionSettings.compareAtPrice.amount-n.subscriptionSettings.price.amount:n.subscriptionSettings.price.amount,u=a-l,p=new Intl.NumberFormat("en-US",{style:"currency",currency:s.price.currency});return t.jsxRuntimeExports.jsxs("div",{className:He.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:He.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Choose upgrade method"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:()=>o(),fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:He.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:He.content,children:[t.jsxRuntimeExports.jsxs("div",{className:He.selectedPlan,children:[t.jsxRuntimeExports.jsx("h2",{className:He.planName,children:n.name}),t.jsxRuntimeExports.jsx("p",{className:He.description,children:n.description}),t.jsxRuntimeExports.jsxs("p",{className:He.price,children:["$",n.subscriptionSettings.price.amount.toFixed(2)," /"," ",n.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),t.jsxRuntimeExports.jsx(on,{formatter:p,coupon:null,total:u,discount:l})]}),t.jsxRuntimeExports.jsxs("div",{className:He.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:He.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>o(),children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:He.buttonWrapper,children:t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Primary",onClick:i,children:["Upgrade for $",u.toFixed(2)]})})]})]})]})},Nj="_reviewMessage_1lmwy_1",Ij="_leaveReviewContainer_1lmwy_10",Tj="_leaveReviewTitle_1lmwy_19",ls={reviewMessage:Nj,leaveReviewContainer:Ij,leaveReviewTitle:Tj},Pj=({review:e,orderId:n,className:s})=>{const[r,i]=_.useState((e==null?void 0:e.rating)||0),[o,a]=_.useState(!1),{setIsOpen:l}=t.useModalStore(),{notifications:u,setNotifications:p}=t.useNotificationStore(),c=async m=>{e&&"accessToken"in e&&(await yi({comment:m,rating:r},n,e.accessToken),p([...u,{status:"success",id:t.v4(),message:"Review left successfully"}]),a(!1))};return _.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(l(!0),a(!0))},[r]),e?e.rating&&"accessToken"in e?t.jsxRuntimeExports.jsxs("div",{className:ls.reviewMessage,children:["You left a ",e.rating," star rating"]}):t.jsxRuntimeExports.jsxs("div",{className:t.clx(ls.leaveReviewContainer,s),children:[t.jsxRuntimeExports.jsx("p",{className:ls.leaveReviewTitle,children:"Leave a review"}),t.jsxRuntimeExports.jsx(tm,{rating:r,setRating:i,disabled:!!e.rating||!("accessToken"in e)}),o&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>a(!1),children:t.jsxRuntimeExports.jsx(Fj,{setIsOpen:a,onSubmit:c})})]}):null},Lj="_bottomSheet_jxxl3_1",Bj="_content_jxxl3_7",Aj="_buttonGroup_jxxl3_18",Mj="_buttonWrapper_jxxl3_29",$j="_modal_jxxl3_33",Dj="_header_jxxl3_40",St={bottomSheet:Lj,content:Bj,buttonGroup:Aj,buttonWrapper:Mj,modal:$j,header:Dj},Fj=({setIsOpen:e,onSubmit:n})=>{const[s,r]=_.useState(""),{setIsOpen:i}=t.useModalStore(),o=()=>{i(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:St.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:St.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Review Description"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:St.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:St.content,children:t.jsxRuntimeExports.jsx(t.Textarea$1,{maxLength:150,placeholder:"Great product and fast checkout...",value:s,onChange:a=>r(a),label:"Describe your review in detail below"})}),t.jsxRuntimeExports.jsxs("div",{className:St.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:St.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:St.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!s,onClick:()=>{o(),n(s)},children:"Submit"})})]})]})]})},Oj="_container_1idhv_1",Hj="_buttonGroup_1idhv_8",zj="_buttonWrapper_1idhv_15",Uj="_header_1idhv_19",Vj="_content_1idhv_28",bt={container:Oj,buttonGroup:Hj,buttonWrapper:zj,header:Uj,content:Vj},Wj=({setIsOpen:e})=>{const{subscription:n}=t.useSubscriptionStore(),{getTotalAndDiscount:s,cart:r,coupon:i}=t.useCart(),[o,a]=_.useState(1),l=t.useNavigate(),{setIsOpen:u}=t.useModalStore(),{setNotifications:p,notifications:c}=t.useNotificationStore(),[m,x]=_.useState(!1),d=_.useMemo(()=>s(),[i,r]),g=_.useMemo(()=>d.totalWithDiscount?d.total-d.totalWithDiscount:0,[d]);if(m)return t.jsxRuntimeExports.jsx(t.ProcessingPaymentModal,{});const h=(n==null?void 0:n.price.currency)||"USD",S=new Intl.NumberFormat("en-US",{style:"currency",currency:h});async function j(){var C;x(!0);try{const{data:N}=await t.extendSubscription((n==null?void 0:n.id)||"",{});p([{id:t.v4(),message:"Order created successfully",status:"success"}]),l(`/orders/${(C=N.data)==null?void 0:C.id}/${N.data.fullAccessToken}`)}catch(N){const w=N;p([...c,{id:t.v4(),message:`Order creation failed: ${w.message}`,status:"error"}]),E()}finally{x(!1)}}function E(){u(!1),setTimeout(()=>{e(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:bt.container,onClick:C=>C.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:bt.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:bt.title,children:"Extend Subscription"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:E,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:bt.content,children:[t.jsxRuntimeExports.jsx(mm,{step:o,totalSteps:12,onStepChange:a,label:"How long would you like to extend your subscription for?"}),t.jsxRuntimeExports.jsx(on,{formatter:S,coupon:i,total:d.total,discount:g,totalWithDiscount:d.totalWithDiscount}),t.jsxRuntimeExports.jsxs("div",{className:bt.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:bt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:E,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:bt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:j,children:"Extend"})})]})]})]})},qj="_bottomSheet_uw5jb_1",Gj="_content_uw5jb_7",Zj="_radioGroup_uw5jb_11",Xj="_confirmation_uw5jb_26",Yj="_iconWrapper_uw5jb_33",Kj="_title_uw5jb_42",Jj="_message_uw5jb_48",Qj="_buttonGroup_uw5jb_54",ey="_buttonWrapper_uw5jb_64",ty="_modal_uw5jb_68",ny="_header_uw5jb_77",me={bottomSheet:qj,content:Gj,radioGroup:Zj,confirmation:Xj,iconWrapper:Yj,title:Kj,message:Jj,buttonGroup:Qj,buttonWrapper:ey,modal:ty,header:ny},sy={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},ry=({isOpen:e,setIsOpen:n,id:s,accessToken:r})=>{const[i,o]=_.useState(0),[a,l]=_.useState(!1),[u,p]=_.useState(""),[c,m]=_.useState(""),{setIsOpen:x}=t.useModalStore(),d=async()=>{if(!u)return;l(!0);const h=await t.cancelSubscription(s,r,{reason:u==="Other reason"?c:u});l(!1),h&&o(2)};_.useEffect(()=>{e||(o(0),p(""),m(""))},[e]);const g=()=>{x(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:me.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:me.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:sy[i]||""}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:me.content,children:[i===0&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),t.jsxRuntimeExports.jsxs("div",{className:me.radioGroup,children:[t.jsxRuntimeExports.jsx(t.Radio,{defaultValue:u,onChange:h=>p(h),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),u==="Other reason"&&t.jsxRuntimeExports.jsx(t.Textarea$1,{value:c,onChange:h=>m(h),placeholder:"Describe the reason...",maxLength:150})]}),t.jsxRuntimeExports.jsxs("div",{className:me.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>u&&o(1),disabled:!u,children:"Continue"})})]})]}),i===1&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),t.jsxRuntimeExports.jsxs("div",{className:me.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:d,disabled:a,children:"Cancel it anyway"})})]})]}),i===2&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:`${me.confirmation}`,children:[t.jsxRuntimeExports.jsx("div",{className:me.iconWrapper,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"var(--text-success)"})}),t.jsxRuntimeExports.jsx("p",{className:me.title,children:"Subscription Cancelled"}),t.jsxRuntimeExports.jsx("p",{className:me.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),t.jsxRuntimeExports.jsx("div",{className:me.buttonGroup,children:t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},oy="_checkoutContainer_wkomn_1",iy="_loaderContainer_wkomn_20",cs={checkoutContainer:oy,loaderContainer:iy},ay=()=>{const{cart:e,products:n,pending:s,getTotalAndDiscount:r,getPossibleGateways:i,submitCart:o,setGateway:a,applyCoupon:l,setDiscordSocialConnectId:u,setCustomFields:p,applyCouponPending:c,coupon:m,removeCoupon:x,getDiscordSettings:d,setPaymentMethod:g,reset:h}=t.useCart(),S=_.useMemo(()=>r(),[m,e]),j=t.useNavigate();return _.useEffect(()=>{if(e.parts.length===0)try{j(-1)}catch{j("/")}},[e.parts]),s?t.jsxRuntimeExports.jsx("div",{className:cs.checkoutContainer,children:t.jsxRuntimeExports.jsx("div",{className:cs.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})})}):t.jsxRuntimeExports.jsxs("div",{className:cs.checkoutContainer,children:[t.jsxRuntimeExports.jsx(Wm,{cart:e,products:n,applyCoupon:l,applyCouponPending:c,coupon:m,removeCoupon:x,totalAndDiscount:S}),t.jsxRuntimeExports.jsx(kx,{cart:e,getPossibleGateways:i,setGateway:a,getDiscordSettings:d,products:n,submitCart:o,totalAndDiscount:S,setCustomFieldsToCart:p,setDiscordSocialConnectId:u,setPaymentMethod:g,reset:h})]})},ly="_chargePageContainer_1cfy0_1",cy="_chargeItems_1cfy0_14",uy="_mainContent_1cfy0_25",py="_contentWrapper_1cfy0_36",dy="_statusBlock_1cfy0_41",my="_notPaidSection_1cfy0_45",xy="_footer_1cfy0_54",hy="_loaderContainer_1cfy0_64",pt={chargePageContainer:ly,chargeItems:cy,mainContent:uy,contentWrapper:py,statusBlock:dy,notPaidSection:my,footer:xy,loaderContainer:hy},gy=()=>{const{id:e}=t.useParams(),[n,s]=t.useSearchParams(),[r,i]=_.useState(!1),[o,a]=_.useState(),[l,u]=_.useState(!0),p=t.useNavigate(),c=_.useRef(),{setIsOpen:m}=t.useModalStore();return _.useEffect(()=>{const x=async(g,h=!1)=>{h||i(!0);const{data:S}=await _i(g);i(!1),a(S)},d=setInterval(()=>{e&&x(e,!0)},5e3);return e&&x(e),()=>{clearInterval(d)}},[]),_.useEffect(()=>{const x=n.get("redirectRoute");(o==null?void 0:o.status)===t.ChargeStatus.Paid&&o.redirectUrl&&!c.current&&window.open(o.redirectUrl,"_self"),(o==null?void 0:o.status)===t.ChargeStatus.Paid&&c.current&&p(c.current,{replace:!0}),x&&c&&(c.current=x,n.delete("redirectRoute"),s(n))},[o]),_.useEffect(()=>{((o==null?void 0:o.gateway)==="PayPalFF"||(o==null?void 0:o.gateway)==="Сashapp")&&m(!0)},[o]),r?t.jsxRuntimeExports.jsx("div",{className:pt.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs("div",{className:pt.chargePageContainer,children:[t.jsxRuntimeExports.jsx("div",{className:pt.chargeItems,children:t.jsxRuntimeExports.jsx(ph,{charge:o})}),t.jsxRuntimeExports.jsx("div",{className:pt.mainContent,children:t.jsxRuntimeExports.jsxs("div",{className:pt.contentWrapper,children:[o&&(o==null?void 0:o.status)!==t.ChargeStatus.NotPaid&&t.jsxRuntimeExports.jsx(t.ChargeStatusBlock,{charge:o}),o&&t.jsxRuntimeExports.jsx("div",{className:`${pt.statusBlock}`,children:t.jsxRuntimeExports.jsx(Xr,{lastUpdate:o.expiresAt,email:o.customerForCharge.email,invoiceId:o.id,paymentType:o.gateway})}),(o==null?void 0:o.status)===t.ChargeStatus.NotPaid&&t.jsxRuntimeExports.jsx("div",{className:pt.notPaidSection,children:o==null?void 0:o.displayPaymentInfo.map((x,d)=>t.jsxRuntimeExports.jsx(Zr,{block:x},d))}),t.jsxRuntimeExports.jsx(rt,{className:pt.footer})]})}),(o==null?void 0:o.gateway)==="PayPalFF"&&l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>u(!1),children:t.jsxRuntimeExports.jsx(eh,{price:o.price,setIsOpen:u})}),(o==null?void 0:o.gateway)==="Сashapp"&&l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(Rh,{setIsOpen:u,chargeId:o.id})})]})},fy="_wrapper_1fax2_1",jy="_title_1fax2_20",yy="_container_1fax2_26",_y="_content_1fax2_36",Sy="_messages_1fax2_46",by="_input_1fax2_58",Cy="_textarea_1fax2_64",Ey="_message_1fax2_46",vy="_messageDate_1fax2_88",wy="_myMessage_1fax2_94",ky="_otherMessage_1fax2_101",Ry="_button_1fax2_108",Ny="_loadingMessage_1fax2_117",be={wrapper:fy,title:jy,container:yy,content:_y,messages:Sy,input:by,textarea:Cy,message:Ey,messageDate:vy,myMessage:wy,otherMessage:ky,button:Ry,loadingMessage:Ny},Iy=()=>{const e=window.location.pathname.split("/"),n=e[e.length-1],s=e[e.length-2],[r,i]=_.useState(!0),[o,a]=_.useState(null),[l,u]=_.useState(""),[p,c]=_.useState(null),{executeRecaptcha:m}=t.useReCaptcha(),x=async()=>{if(s&&n){const{data:h}=await t.fetchTicket(s,n);a(h),i(!1)}};_.useEffect(()=>{x();const h=setInterval(()=>{x()},5e3);return()=>clearInterval(h)},[]);const d=async()=>{const h=await m();if(!s||!n||!h||!l.trim())return;const S={content:l,createdAt:new Date().toISOString(),id:Date.now(),isSellerReply:!1};a(j=>j?{...j,messages:[...j.messages,S]}:null),c(S.id),u("");try{await t.sendTicketMessage(s,n,l,h),await x()}finally{setTimeout(()=>{c(null)},1e4)}},g=h=>{const S=new Date,j=new Date(h),E=Math.floor((S.getTime()-j.getTime())/1e3);if(E<60)return"right now";if(E<3600){const C=Math.floor(E/60);return`${C} minute${C>1?"s":""} ago`}else if(E<10800){const C=Math.floor(E/3600);return`${C} hour${C>1?"s":""} ago`}else return j.getFullYear()===S.getFullYear()?j.toLocaleDateString("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):j.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return t.jsxRuntimeExports.jsx("div",{className:be.wrapper,children:r&&!o?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs("div",{className:be.container,children:[t.jsxRuntimeExports.jsx("div",{className:be.title,children:`#${s} (${o==null?void 0:o.title})`}),t.jsxRuntimeExports.jsxs("div",{className:be.content,children:[t.jsxRuntimeExports.jsx("div",{className:be.messages,children:o==null?void 0:o.messages.sort((h,S)=>new Date(h.createdAt).getTime()-new Date(S.createdAt).getTime()).map(h=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(be.message,{[be.myMessage]:!h.isSellerReply,[be.otherMessage]:h.isSellerReply,[be.loadingMessage]:p===h.id}),children:[t.jsxRuntimeExports.jsx("div",{className:be.messageContent,children:t.splitTextIntoSpans(h.content)}),p!==h.id&&t.jsxRuntimeExports.jsx("div",{className:be.messageDate,children:g(h.createdAt)}),p===h.id&&t.jsxRuntimeExports.jsx("div",{className:be.messageDate,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]},h.id))}),t.jsxRuntimeExports.jsxs("div",{className:be.input,children:[t.jsxRuntimeExports.jsx("textarea",{className:be.textarea,value:l,placeholder:"What worries you?",onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),d())},style:{resize:"none",maxHeight:"150px",overflowY:"auto"}}),t.jsxRuntimeExports.jsx("div",{className:be.button,onClick:d,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"PaperPlaneRight"})})]})]})]})})},Ty="_subscriptionContainer_1j6ol_1",Py="_leftSection_1j6ol_15",Ly="_content_1j6ol_26",By="_mainContent_1j6ol_33",Ay="_detailsSection_1j6ol_37",My="_buttonGroup_1j6ol_50",$y="_detailsContent_1j6ol_57",Ct={subscriptionContainer:Ty,leftSection:Py,content:Ly,mainContent:By,detailsSection:Ay,buttonGroup:My,detailsContent:$y},Dy=()=>{const{id:e,accessToken:n}=t.useParams(),{subscription:s,setSubscription:r}=t.useSubscriptionStore(),{setIsOpen:i}=t.useModalStore(),[o,a]=_.useState(!1),[l,u]=_.useState(!1);_.useLayoutEffect(()=>{r(null)},[e,n]);const{balanceSettings:p,setBalanceSettings:c}=t.useCustomerDashboardStore();return _.useEffect(()=>{e&&n&&(async()=>{if(!e||!n)return;u(!0);const{data:x}=await t.fetchSubscription(e,n);r({...x}),u(!1)})()},[e,n]),_.useEffect(()=>{p||(async()=>{const x=await t.getBalanceSettings();c(x)})()},[p]),l?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Ct.subscriptionContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Ct.leftSection,children:t.jsxRuntimeExports.jsxs("div",{className:Ct.content,children:[t.jsxRuntimeExports.jsx(rn,{}),t.jsxRuntimeExports.jsxs("div",{className:Ct.mainContent,children:[s&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Your Subscription"}),t.jsxRuntimeExports.jsx(g1,{subscription:{price:s.price,name:s.productName,description:s.productDescription,status:s.status,image:s.productImage,recurringInterval:s.recurringInterval}}),t.jsxRuntimeExports.jsx("div",{className:Ct.buttonGroup,children:s.pricingPlanExists&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:m=>{m.stopPropagation(),i(!0),a(!0)},style:{maxWidth:"500px",width:"100%"},children:"Change Plan"})})]}),t.jsxRuntimeExports.jsx(rt,{})]})]})}),t.jsxRuntimeExports.jsx("div",{className:Ct.detailsSection,children:t.jsxRuntimeExports.jsxs("div",{className:Ct.detailsContent,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Details"}),(s==null?void 0:s.coupon)&&t.jsxRuntimeExports.jsx(Y1,{coupon:s.coupon,currency:s.price.currency||"USD"}),s&&t.jsxRuntimeExports.jsx(jj,{id:e||"",accessToken:n||"",subscription:{price:s.price,name:s.productName,description:s.productDescription,status:s.status,image:s.productImage,recurringInterval:s.recurringInterval}}),s&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(pj,{}),s.activeTo&&t.jsxRuntimeExports.jsx(U1,{})]}),t.jsxRuntimeExports.jsx(rt,{className:"flex md:hidden"})]})})]}),t.jsxRuntimeExports.jsx(D1,{isOpen:o,setIsOpen:a,subscription:s})]})},Fy="_topUpContainer_1pag6_1",Oy="_formWrapper_1pag6_15",Hy="_header_1pag6_29",zy="_footer_1pag6_82",Uy="_wrapper_1pag6_105",Xt={topUpContainer:Fy,formWrapper:Oy,header:Hy,footer:zy,wrapper:Uy},Vy=()=>{const{gatewaysDetail:e,setGatewaysDetail:n,balanceSettings:s,setBalanceSettings:r}=t.useCustomerDashboardStore();return _.useEffect(()=>{!e&&s&&(async()=>{const o=await t.getGatewaysDetail(s!=null&&s.isEnabled?(s==null?void 0:s.topUpSettings.gateways)||[]:[]);n(o)})()},[e,s]),_.useEffect(()=>{s||(async()=>{const o=await t.getBalanceSettings();r(o)})()},[s]),t.jsxRuntimeExports.jsxs("div",{className:Xt.wrapper,children:[t.jsxRuntimeExports.jsx(rn,{className:Xt.header}),t.jsxRuntimeExports.jsx("div",{className:Xt.topUpContainer,children:s?t.jsxRuntimeExports.jsx("div",{className:Xt.formWrapper,children:t.jsxRuntimeExports.jsx(t.BalanceModal,{setIsOpen:()=>{},isModal:!1})}):t.jsxRuntimeExports.jsx(t.Loader,{})}),t.jsxRuntimeExports.jsx("div",{className:Xt.footer,children:t.jsxRuntimeExports.jsx(rt,{})})]})},Wy="_orderPage_1nvve_1",qy="_leftSection_1nvve_15",Gy="_content_1nvve_35",Zy="_main_1nvve_42",Xy="_statusBlock_1nvve_54",Yy="_timelineBlock_1nvve_58",Ky="_footer_1nvve_62",Jy="_rightSection_1nvve_71",Qy="_header_1nvve_84",e_="_productList_1nvve_92",t_="_mobileFooter_1nvve_99",n_="_loaderContainer_1nvve_108",s_="_orderMainData_1nvve_116",r_="_prices_1nvve_123",o_="_headerTitle_1nvve_127",i_="_headerDescription_1nvve_131",fe={orderPage:Wy,leftSection:qy,content:Gy,main:Zy,statusBlock:Xy,timelineBlock:Yy,footer:Ky,rightSection:Jy,header:Qy,productList:e_,mobileFooter:t_,loaderContainer:n_,orderMainData:s_,prices:r_,headerTitle:o_,headerDescription:i_},a_=()=>{var m,x,d;const{id:e,accessToken:n}=t.useParams(),s=t.useNavigate(),[r,i]=_.useState(),[o,a]=_.useState(!1),l=t.useCopy(),u=((m=r==null?void 0:r.rawPrice)==null?void 0:m.currency)||"USD",p=new Intl.NumberFormat("en-US",{style:"currency",currency:u}),c=_.useMemo(()=>(r==null?void 0:r.partOrders.map(g=>{var h,S,j,E;return{id:(g==null?void 0:g.id)||0,image:g.productWithVariant.image,name:((h=g.productWithVariant)==null?void 0:h.name)||"",description:((S=g.productWithVariant)==null?void 0:S.description)||"",price:{quantity:g.quantity,amount:((j=g.productWithVariant)==null?void 0:j.price.amount)||0,currency:(E=g.productWithVariant)==null?void 0:E.price.currency},deliveryCategories:"deliveryCategories"in g?g.deliveryCategories:void 0,customerNote:g.customerNote,chargeType:g.chargeType||"ONE_TIME"}}))||[],[r]);return _.useEffect(()=>{const g=async(S,j=!1)=>{j||a(!0);const{data:E}=await(n?t.fetchAuthorizedOrder(`${S}/${n}`):t.fetchOrder(S));a(!1),E.charge.status===t.ChargeStatus.NotPaid&&s(`/charges/${E.charge.id}`,{replace:!0}),i(E)};e&&g(e);const h=setInterval(()=>{e&&g(e,!0)},5e3);return()=>{clearInterval(h)}},[]),o?t.jsxRuntimeExports.jsx("div",{className:fe.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs("div",{className:fe.orderPage,children:[t.jsxRuntimeExports.jsx("div",{className:fe.leftSection,children:t.jsxRuntimeExports.jsxs("div",{className:fe.content,children:[t.jsxRuntimeExports.jsx(rn,{}),r&&t.jsxRuntimeExports.jsxs("div",{className:fe.main,children:[t.jsxRuntimeExports.jsx(t.OrderStatusBlock,{className:fe.statusBlock,orderStatus:r.status}),t.jsxRuntimeExports.jsxs("div",{className:fe.orderMainData,children:[t.jsxRuntimeExports.jsx(Xr,{lastUpdate:r.createdAt,paymentType:r.charge.gateway,email:r.charge.customerForCharge.email,invoiceId:r.charge.id}),"accessToken"in r.review&&t.jsxRuntimeExports.jsx(Pj,{orderId:r.id,review:r.review})]}),r.charge&&t.jsxRuntimeExports.jsx(t.TrackPayment,{className:fe.timelineBlock,timeline:r.charge.timeline}),t.jsxRuntimeExports.jsx(rt,{className:fe.footer})]})]})}),t.jsxRuntimeExports.jsx("div",{className:fe.rightSection,children:t.jsxRuntimeExports.jsxs("div",{className:fe.content,children:[(r==null?void 0:r.charge.name)&&t.jsxRuntimeExports.jsxs("header",{className:fe.header,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("h1",{className:fe.headerTitle,children:r.charge.name}),r.charge.description&&t.jsxRuntimeExports.jsx("p",{className:fe.headerDescription,children:r.charge.description})]}),t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:()=>l((r==null?void 0:r.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"}),t.jsxRuntimeExports.jsx("span",{children:"Copy ID"})]})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("div",{className:fe.productList,children:c.map(g=>t.jsxRuntimeExports.jsx(Cs,{product:g,isOrder:!0},g.id))}),t.jsxRuntimeExports.jsx(on,{formatter:p,coupon:null,total:((x=r==null?void 0:r.charge)==null?void 0:x.price.amount)||0,discount:0,totalWithDiscount:((d=r==null?void 0:r.charge)==null?void 0:d.price.amount)||0,className:fe.prices,isShowSubtotal:!1}),t.jsxRuntimeExports.jsx(rt,{className:fe.mobileFooter})]})]})})]})},l_=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,[a,l]=_.useState(null),{general:u}=t.useGeneralStore(),{setBlocks:p,setSourceBlocks:c,setHeader:m,setFooter:x,setAnnouncement:d,setSettings:g}=t.useBlocksStore(),{setHeader:h,setFooter:S,setAnnouncement:j}=t.useLayersStore(),{themeSettings:E}=t.useThemeSettingsStore(),{settings:C,setSettings:N}=t.useSettingsStore(),w=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,b=localStorage.getItem("shopPassword"),A=localStorage.getItem("shopId")||"";return _.useEffect(()=>{if(E&&C){const $=vi(E,C);Ti(E),wi($)}},[E,C,window.location.hostname]),_.useEffect(()=>{const $={};Object.keys(n).map(L=>{$[L]=n[L]}),c($),p($),m(r),x(i),d(o),g(s);const z=new r,V=JSON.parse(JSON.stringify(z));h(V,!1);const B=new i,R=JSON.parse(JSON.stringify(B));S(R,!1);const I=new o,M=JSON.parse(JSON.stringify(I));j(M,!1);const P=new s,O=JSON.parse(JSON.stringify(P));N(O);const D=t.createBrowserRouter([{element:t.jsxRuntimeExports.jsx(Cd,{shopDomain:w,shopId:A,shopPassword:b||void 0,children:t.jsxRuntimeExports.jsx(t.ReCaptchaProvider,{children:t.jsxRuntimeExports.jsx(jd,{children:t.jsxRuntimeExports.jsx(t.Outlet,{})})})}),errorElement:t.jsxRuntimeExports.jsx(yd,{}),children:[{path:"/admin/builder/*",element:t.jsxRuntimeExports.jsx(id,{children:t.jsxRuntimeExports.jsx(ed,{blocks:n,settings:s,header:r,footer:i,announcement:o})}),errorElement:t.jsxRuntimeExports.jsx(od,{}),loader:()=>(document.title="Builder",!0)},{path:"/checkout",element:t.jsxRuntimeExports.jsx(ay,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsxRuntimeExports.jsx(Vy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsxRuntimeExports.jsx(gy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsxRuntimeExports.jsx(a_,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsxRuntimeExports.jsx(Dy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Subscriptions",!0)},{path:"/customer-dash",element:t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[t.jsxRuntimeExports.jsx(t.RenderHeader,{}),t.jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto",background:"var(--surface-primary)"},children:t.jsxRuntimeExports.jsx(t.CustomerDashboard,{})}),t.jsxRuntimeExports.jsx(t.RenderFooter,{})]}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Customer Dashboard",!0)},{path:"/validation",element:t.jsxRuntimeExports.jsx(hd,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[t.jsxRuntimeExports.jsx(t.RenderHeader,{}),t.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsxRuntimeExports.jsx(t.ReCaptchaProvider,{children:t.jsxRuntimeExports.jsx(Iy,{})})}),t.jsxRuntimeExports.jsx(t.RenderFooter,{})]}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Ticket",!0)},{path:"*",element:t.jsxRuntimeExports.jsx(Ei,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{})}]}]);l(D)},[u]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a&&t.jsxRuntimeExports.jsx(t.RouterProvider,{router:a})})};exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useReCaptcha=t.useReCaptcha;exports.App=l_;exports.ColorVariables=Fr;exports.createTicket=Li;exports.hotReload=Pi;exports.iconNames=Mo;exports.useBuilderPages=Bi;
115
+ `},i),o}function H0(e,n){return e&&"run"in e?async function(s,r){const i=wr(s,{file:r,...n});await e.run(i,r)}:function(s,r){return wr(s,{file:r,...e||n})}}function kr(e){if(e)throw e}var Rn=Object.prototype.hasOwnProperty,Lo=Object.prototype.toString,Rr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,Ir=function(n){return typeof Array.isArray=="function"?Array.isArray(n):Lo.call(n)==="[object Array]"},Tr=function(n){if(!n||Lo.call(n)!=="[object Object]")return!1;var s=Rn.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&Rn.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!s&&!r)return!1;var i;for(i in n);return typeof i>"u"||Rn.call(n,i)},Pr=function(n,s){Rr&&s.name==="__proto__"?Rr(n,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):n[s.name]=s.newValue},Lr=function(n,s){if(s==="__proto__")if(Rn.call(n,s)){if(Nr)return Nr(n,s).value}else return;return n[s]},z0=function e(){var n,s,r,i,o,a,l=arguments[0],u=1,p=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<p;++u)if(n=arguments[u],n!=null)for(s in n)r=Lr(l,s),i=Lr(n,s),l!==i&&(c&&i&&(Tr(i)||(o=Ir(i)))?(o?(o=!1,a=r&&Ir(r)?r:[]):a=r&&Tr(r)?r:{},Pr(l,{name:s,newValue:e(c,a,i)})):typeof i<"u"&&Pr(l,{name:s,newValue:i}));return l};const ts=t.getDefaultExportFromCjs(z0);function _s(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U0(){const e=[],n={run:s,use:r};return n;function s(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(u,...p){const c=e[++o];let m=-1;if(u){a(u);return}for(;++m<i.length;)(p[m]===null||p[m]===void 0)&&(p[m]=i[m]);i=p,c?V0(c,l)(...p):a(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function V0(e,n){let s;return r;function r(...a){const l=e.length>a.length;let u;l&&a.push(i);try{u=e.apply(this,a)}catch(p){const c=p;if(l&&s)throw c;return i(c)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...l){s||(s=!0,n(a,...l))}function o(a){i(null,a)}}const Xe={basename:W0,dirname:q0,extname:G0,join:Z0,sep:"/"};function W0(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');ln(e);let s=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(s,r)}if(n===e)return"";let a=-1,l=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===n.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return s===r?r=a:r<0&&(r=e.length),e.slice(s,r)}function q0(e){if(ln(e),e.length===0)return".";let n=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){n=s;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function G0(e){ln(e);let n=e.length,s=-1,r=0,i=-1,o=0,a;for(;n--;){const l=e.codePointAt(n);if(l===47){if(a){r=n+1;break}continue}s<0&&(a=!0,s=n+1),l===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||s<0||o===0||o===1&&i===s-1&&i===r+1?"":e.slice(i,s)}function Z0(...e){let n=-1,s;for(;++n<e.length;)ln(e[n]),e[n]&&(s=s===void 0?e[n]:s+"/"+e[n]);return s===void 0?".":X0(s)}function X0(e){ln(e);const n=e.codePointAt(0)===47;let s=Y0(e,!n);return s.length===0&&!n&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),n?"/"+s:s}function Y0(e,n){let s="",r=0,i=-1,o=0,a=-1,l,u;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(u=s.lastIndexOf("/"),u!==s.length-1){u<0?(s="",r=0):(s=s.slice(0,u),r=s.length-1-s.lastIndexOf("/")),i=a,o=0;continue}}else if(s.length>0){s="",r=0,i=a,o=0;continue}}n&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(i+1,a):s=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return s}function ln(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K0={cwd:J0};function J0(){return"/"}function Ss(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q0(e){if(typeof e=="string")e=new URL(e);else if(!Ss(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return e1(e)}function e1(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let s=-1;for(;++s<n.length;)if(n.codePointAt(s)===37&&n.codePointAt(s+1)===50){const r=n.codePointAt(s+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const ns=["history","path","basename","stem","extname","dirname"];class Bo{constructor(n){let s;n?Ss(n)?s={path:n}:typeof n=="string"||t1(n)?s={value:n}:s=n:s={},this.cwd="cwd"in s?"":K0.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ns.length;){const o=ns[r];o in s&&s[o]!==void 0&&s[o]!==null&&(this[o]=o==="history"?[...s[o]]:s[o])}let i;for(i in s)ns.includes(i)||(this[i]=s[i])}get basename(){return typeof this.path=="string"?Xe.basename(this.path):void 0}set basename(n){rs(n,"basename"),ss(n,"basename"),this.path=Xe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Xe.dirname(this.path):void 0}set dirname(n){Br(this.basename,"dirname"),this.path=Xe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Xe.extname(this.path):void 0}set extname(n){if(ss(n,"extname"),Br(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Ss(n)&&(n=Q0(n)),rs(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Xe.basename(this.path,this.extname):void 0}set stem(n){rs(n,"stem"),ss(n,"stem"),this.path=Xe.join(this.dirname||"",n+(this.extname||""))}fail(n,s,r){const i=this.message(n,s,r);throw i.fatal=!0,i}info(n,s,r){const i=this.message(n,s,r);return i.fatal=void 0,i}message(n,s,r){const i=new _e(n,s,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ss(e,n){if(e&&e.includes(Xe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Xe.sep+"`")}function rs(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Br(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function t1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const n1=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},s1={}.hasOwnProperty;class $s extends n1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U0()}copy(){const n=new $s;let s=-1;for(;++s<this.attachers.length;){const r=this.attachers[s];n.use(...r)}return n.data(ts(!0,{},this.namespace)),n}data(n,s){return typeof n=="string"?arguments.length===2?(as("data",this.frozen),this.namespace[n]=s,this):s1.call(this.namespace,n)&&this.namespace[n]||void 0:n?(as("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=s.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const s=En(n),r=this.parser||this.Parser;return os("parse",r),r(String(s),s)}process(n,s){const r=this;return this.freeze(),os("process",this.parser||this.Parser),is("process",this.compiler||this.Compiler),s?i(void 0,s):new Promise(i);function i(o,a){const l=En(n),u=r.parse(l);r.run(u,l,function(c,m,x){if(c||!m||!x)return p(c);const d=m,g=r.stringify(d,x);i1(g)?x.value=g:x.result=g,p(c,x)});function p(c,m){c||!m?a(c):o?o(m):s(void 0,m)}}}processSync(n){let s=!1,r;return this.freeze(),os("processSync",this.parser||this.Parser),is("processSync",this.compiler||this.Compiler),this.process(n,i),Mr("processSync","process",s),r;function i(o,a){s=!0,kr(o),r=a}}run(n,s,r){Ar(n),this.freeze();const i=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?o(void 0,r):new Promise(o);function o(a,l){const u=En(s);i.run(n,u,p);function p(c,m,x){const d=m||n;c?l(c):a?a(d):r(void 0,d,x)}}}runSync(n,s){let r=!1,i;return this.run(n,s,o),Mr("runSync","run",r),i;function o(a,l){kr(a),i=l,r=!0}}stringify(n,s){this.freeze();const r=En(s),i=this.compiler||this.Compiler;return is("stringify",i),Ar(n),i(n,r)}use(n,...s){const r=this.attachers,i=this.namespace;if(as("use",this.frozen),n!=null)if(typeof n=="function")u(n,s);else if(typeof n=="object")Array.isArray(n)?l(n):a(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")u(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[c,...m]=p;u(c,m)}else a(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function a(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(p.plugins),p.settings&&(i.settings=ts(!0,i.settings,p.settings))}function l(p){let c=-1;if(p!=null)if(Array.isArray(p))for(;++c<p.length;){const m=p[c];o(m)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function u(p,c){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===p){x=m;break}if(x===-1)r.push([p,...c]);else if(c.length>0){let[d,...g]=c;const h=r[x][1];_s(h)&&_s(d)&&(d=ts(!0,h,d)),r[x]=[p,d,...g]}}}}const r1=new $s().freeze();function os(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function is(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function as(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ar(e){if(!_s(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Mr(e,n,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function En(e){return o1(e)?e:new Bo(e)}function o1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function i1(e){return typeof e=="string"||a1(e)}function a1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$r=[],Dr={allowDangerousHtml:!0},c1=/^(https?|ircs?|mailto|xmpp)$/i,u1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function p1(e){const n=d1(e),s=m1(e);return x1(n.runSync(n.parse(s),s),e)}function d1(e){const n=e.rehypePlugins||$r,s=e.remarkPlugins||$r,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dr}:Dr;return r1().use(q2).use(s).use(H0,r).use(n)}function m1(e){const n=e.children||"",s=new Bo;return typeof n=="string"&&(s.value=n),s}function x1(e,n){const s=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,a=n.skipHtml,l=n.unwrapDisallowed,u=n.urlTransform||h1;for(const c of u1)Object.hasOwn(n,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+l1+c.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),Po(e,p),Cg(e,{Fragment:t.jsxRuntimeExports.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsxRuntimeExports.jsx,jsxs:t.jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function p(c,m,x){if(c.type==="raw"&&x&&typeof m=="number")return a?x.children.splice(m,1):x.children[m]={type:"text",value:c.value},m;if(c.type==="element"){let d;for(d in Jn)if(Object.hasOwn(Jn,d)&&Object.hasOwn(c.properties,d)){const g=c.properties[d],h=Jn[d];(h===null||h.includes(c.tagName))&&(c.properties[d]=u(String(g||""),d,c))}}if(c.type==="element"){let d=s?!s.includes(c.tagName):o?o.includes(c.tagName):!1;if(!d&&r&&typeof m=="number"&&(d=!r(c,m,x)),d&&x&&typeof m=="number")return l&&c.children?x.children.splice(m,1,...c.children):x.children.splice(m,1),m}}}function h1(e){const n=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||s!==-1&&n>s||r!==-1&&n>r||c1.test(e.slice(0,n))?e:""}const g1=({subscription:e})=>t.jsxRuntimeExports.jsxs("div",{className:Ze.container,children:[t.jsxRuntimeExports.jsxs("div",{className:Ze.productDetails,children:[t.jsxRuntimeExports.jsx("div",{className:Ze.imageContainer,children:e!=null&&e.image?t.jsxRuntimeExports.jsx("img",{className:Ze.image,src:t.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})}),t.jsxRuntimeExports.jsxs("div",{className:Ze.textContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Ze.header,children:t.jsxRuntimeExports.jsx("h2",{className:Ze.title,children:e.name})}),t.jsxRuntimeExports.jsxs("p",{className:Ze.price,children:[t.formatPrice(e.price)," / ",e.recurringInterval]})]}),t.jsxRuntimeExports.jsx("div",{className:Ze.badgeContainer,children:t.jsxRuntimeExports.jsx(t.SubscriptionStatusBadge,{status:e.status})})]}),e.description&&t.jsxRuntimeExports.jsx(p1,{className:Ze.description,children:e.description})]}),f1="_card_69liy_1",j1="_price_69liy_10",y1="_interval_69liy_17",_1="_name_69liy_22",S1="_description_69liy_28",b1="_currentPlan_69liy_32",C1="_selectButton_69liy_45",E1="_progressSection_69liy_50",v1="_progressLabel_69liy_54",w1="_bottomSheet_69liy_60",k1="_title_69liy_69",R1="_typeSelector_69liy_80",N1="_typeOption_69liy_90",I1="_active_69liy_100",T1="_saveTag_69liy_108",P1="_planSelector_69liy_117",L1="_modal_69liy_127",B1="_inactive_69liy_148",A1="_notMounted_69liy_151",M1="_closeButton_69liy_157",ue={card:f1,price:j1,interval:y1,name:_1,description:S1,currentPlan:b1,selectButton:C1,progressSection:E1,progressLabel:v1,bottomSheet:w1,title:k1,typeSelector:R1,typeOption:N1,active:I1,saveTag:T1,planSelector:P1,modal:L1,inactive:B1,notMounted:A1,closeButton:M1},$1=({variant:e,onSelect:n,isCurrent:s})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",i=e.subscriptionSettings.price.amount.toFixed(2),o=e.subscriptionSettings.recurringIntervalDays,a=10;return t.jsxRuntimeExports.jsxs("div",{className:ue.card,onClick:n,children:[t.jsxRuntimeExports.jsxs("h2",{className:ue.price,children:["$",i," ",t.jsxRuntimeExports.jsxs("span",{className:ue.interval,children:["/ ",r]})]}),t.jsxRuntimeExports.jsx("h3",{className:ue.name,children:e.name}),e.description&&t.jsxRuntimeExports.jsx("p",{className:ue.description,children:e.description}),s?t.jsxRuntimeExports.jsxs("div",{className:ue.currentPlan,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}),"Your current Plan"]}):t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:ue.selectButton,children:"Select"}),s&&t.jsxRuntimeExports.jsxs("div",{className:ue.progressSection,children:[t.jsxRuntimeExports.jsx(Wr,{percent:a/o*100,disablePercentLabel:!0}),t.jsxRuntimeExports.jsxs("p",{className:ue.progressLabel,children:["Used: ",a," of ",o," days"]})]})]})},D1=({isOpen:e,setIsOpen:n,subscription:s})=>{const[r,i]=_.useState(null),[o,a]=_.useState(null),[l,u]=_.useState(null),{id:p,accessToken:c}=t.useParams(),[m,x]=_.useState(!1),[d,g]=_.useState(!1),{setIsOpen:h}=t.useModalStore();_.useEffect(()=>{e&&x(!0)},[e]);const b=()=>{n(!1)},[f,E]=_.useState(null);_.useEffect(()=>{p&&c&&(async()=>{if(p&&c){const{data:S}=await t.getSubscriptionUpgradePlans({id:p,accessToken:c});E(S)}})()},[p,c]),_.useEffect(()=>{var w;if(f!=null&&f.data.types[0]){const S=(w=f.data.types.flatMap(A=>A.productVariants).find(A=>A.data.id===(s==null?void 0:s.variantId)))==null?void 0:w.data;S&&(u(S),a(S))}},[f,s]),_.useEffect(()=>{f!=null&&f.data.types[0]&&i(f==null?void 0:f.data.types[0])},[f==null?void 0:f.data.types]);const C=w=>{i(w),a(null)},N=w=>{a(w),h(!0),g(!0)};return t.jsxRuntimeExports.jsxs("div",{className:t.clx(ue.modal,{[ue.active]:e,[ue.inactive]:!e&&m,[ue.notMounted]:!m}),onClick:w=>w.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:b,hoverable:!0,className:ue.closeButton,fill:"var(--text-primary)"}),t.jsxRuntimeExports.jsxs("div",{className:ue.bottomSheet,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:ue.title,children:"Change Plan"}),t.jsxRuntimeExports.jsx("p",{className:ue.description,children:f==null?void 0:f.data.description}),t.jsxRuntimeExports.jsx("div",{className:ue.typeSelector,children:f==null?void 0:f.data.types.map(w=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(ue.typeOption,{[ue.active]:(r==null?void 0:r.id)===w.id}),onClick:()=>C(w),children:[w.name,w.name==="Yearly"&&t.jsxRuntimeExports.jsx("span",{className:ue.saveTag,children:"Save %"})]},w.id))}),r&&t.jsxRuntimeExports.jsx("div",{className:ue.planSelector,children:r.productVariants.map(w=>t.jsxRuntimeExports.jsx($1,{variant:w.data,isSelected:(o==null?void 0:o.id)===w.data.id,isCurrent:(l==null?void 0:l.id)===w.data.id,onSelect:()=>N(w.data)},w.data.id))})]}),d&&o&&s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{g(!1)},children:t.jsxRuntimeExports.jsx(Rj,{setIsOpen:g,selectedVariant:o,subscription:s})})]})},F1="_container_nb625_1",O1="_title_nb625_11",H1="_subtitle_nb625_16",z1="_info_nb625_20",vn={container:F1,title:O1,subtitle:H1,info:z1},U1=()=>{const{subscription:e}=t.useSubscriptionStore(),[n,s]=t.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,i]=_.useState(!1),{setIsOpen:o}=t.useModalStore();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:vn.container,children:[t.jsxRuntimeExports.jsxs("div",{className:vn.info,children:[t.jsxRuntimeExports.jsx("p",{className:vn.title,children:"Expiration Date"}),t.jsxRuntimeExports.jsxs("p",{className:vn.subtitle,children:[n," at ",s]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:a=>{a.stopPropagation(),o(!0),i(!0)},children:"Extend"})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(Wj,{setIsOpen:i})})]})},V1="_couponContainer_1sspa_1",W1="_iconWrapper_1sspa_10",q1="_details_1sspa_21",G1="_title_1sspa_25",Z1="_progress_1sspa_29",X1="_foreverText_1sspa_34",Tt={couponContainer:V1,iconWrapper:W1,details:q1,title:G1,progress:Z1,foreverText:X1},Y1=({coupon:e,currency:n})=>{const s=e.isFixed?t.formatPrice({amount:e.discount,currency:n}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?t.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return t.jsxRuntimeExports.jsxs("div",{className:Tt.couponContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Tt.iconWrapper,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CheckCircle"})}),t.jsxRuntimeExports.jsxs("div",{className:Tt.details,children:[t.jsxRuntimeExports.jsxs("p",{className:Tt.title,children:[e.name,", ",s," discount"]}),t.jsxRuntimeExports.jsx("div",{className:Tt.progress,children:t.jsxRuntimeExports.jsx(Wr,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),t.jsxRuntimeExports.jsx("p",{className:Tt.foreverText,children:"Forever discount code"})]})]})},K1="_paymentMethodContainer_1g0da_4",J1="_paymentMethodTitle_1g0da_15",Q1="_activeMethod_1g0da_20",ej="_noMethod_1g0da_28",tj="_activeMethodPaymentMethod_1g0da_37",nj="_paymentMethodLogo_1g0da_47",sj="_paymentMethodNumber_1g0da_57",rj="_method_1g0da_61",dt={paymentMethodContainer:K1,paymentMethodTitle:J1,activeMethod:Q1,noMethod:ej,activeMethodPaymentMethod:tj,paymentMethodLogo:nj,paymentMethodNumber:sj,method:rj},oj="_paymentMethods_1gev0_1",ij="_modal_1gev0_14",aj="_header_1gev0_28",lj="_content_1gev0_37",_t={paymentMethods:oj,modal:ij,header:aj,content:lj},cj=e=>{const{setIsLoading:n,setIsOpen:s}=e,{subscription:r,setSubscription:i}=t.useSubscriptionStore();if(!r)return null;const{id:o}=t.useParams(),a=t.useNavigate(),{notifications:l,setNotifications:u}=t.useNotificationStore(),{setPaymentMethod:p,setGateway:c,cart:m}=t.useCart(),{setIsOpen:x}=t.useModalStore();async function d(){if(g(),n(!0),o&&r){const{data:h}=await t.changeSubscriptionGateway(o,m.gateway);h.isReconnectPaymentNeeded?a(`/charges/${h.chargeId}`):(u([...l,{status:"success",id:t.v4(),message:"Your action has been successfully completed"}]),i({...r,gatewayName:m.gateway}))}else u([...l,{status:"error",id:t.v4(),message:"Your action has been failed. Try again!"}]);n(!1)}function g(){x(!1),setTimeout(()=>{s(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:_t.modal,onClick:h=>{h.stopPropagation()},children:[t.jsxRuntimeExports.jsxs("div",{className:_t.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:_t.title,children:"Choose Payment Method"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:_t.content,children:[(r==null?void 0:r.availableGateways)&&t.jsxRuntimeExports.jsx(Gr,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:c,setPaymentMethod:p,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>a("/customer-dash")}),t.jsxRuntimeExports.jsxs("div",{className:_t.paymentMethods,children:[t.jsxRuntimeExports.jsx("div",{className:_t.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:_t.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!m.gateway,onClick:()=>d(),children:"Continue"})})]})]})]})},uj="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",pj=()=>{var g,h,b;const{subscription:e}=t.useSubscriptionStore(),{cart:n,setPaymentMethod:s}=t.useCart(),r=t.useNavigate(),[i,o]=_.useState(null),[a,l]=_.useState(!1),[u,p]=_.useState(!1),{setIsOpen:c}=t.useModalStore();if(!e)return null;const[m,x]=_.useState(e.gatewayName||n.gateway),d=n.paymentMethod;return _.useEffect(()=>{(async()=>{const E=await t.getGatewaysDetail(e.availableGateways);o(E)})()},[]),_.useEffect(()=>{n.gateway!==m&&x(n.gateway)},[n.gateway]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:dt.paymentMethodContainer,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("p",{className:dt.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&t.jsxRuntimeExports.jsx(dj,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&m==="Balance"&&t.jsxRuntimeExports.jsx(qr,{gateway:m,gatewayDisplayName:m,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!m&&t.jsxRuntimeExports.jsx("span",{className:dt.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&m&&t.jsxRuntimeExports.jsx("div",{className:dt.activeMethod,children:i&&t.jsxRuntimeExports.jsx(t.CheckoutPaymentMethod,{align:"row",gatewayLogoCfId:(g=i.find(f=>f.name===m))==null?void 0:g.logoCfImageId,gatewayDisplayName:(h=i.find(f=>f.name===m))==null?void 0:h.displayName,gateway:m,poweredByLogoCfId:(b=i.find(f=>f.name===m))==null?void 0:b.poweredByImageCfImageId,className:dt.activeMethodPaymentMethod,selected:d===m,onSelect:f=>{s(f)}},m)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:f=>{f.stopPropagation(),c(!0),p(!0)},children:n.gateway?"Change":"Manage"})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>p(!1),children:t.jsxRuntimeExports.jsx(cj,{setIsLoading:l,setIsOpen:p})})]})},dj=({gatewayInfo:e})=>{var n,s,r,i,o;return t.jsxRuntimeExports.jsxs("div",{className:dt.method,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.paymentMethodLogo,children:[((n=e.card)==null?void 0:n.brand.toLowerCase())==="visa"&&t.jsxRuntimeExports.jsx(t.Visa,{}),((s=e.card)==null?void 0:s.brand.toLowerCase())==="mastercard"&&t.jsxRuntimeExports.jsx("img",{src:uj,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((i=e.card)==null?void 0:i.brand.toLowerCase())!=="mastercard"&&t.jsxRuntimeExports.jsx(t.Icon,{name:"CreditCard",width:22})]}),t.jsxRuntimeExports.jsxs("p",{className:dt.paymentMethodNumber,children:["•••• •••• •••• ",(o=e.card)==null?void 0:o.last4]})]})},mj="_subscriptionProductContainer_83ibx_4",xj="_subscriptionProductImage_83ibx_15",hj="_subscriptionProductInfo_83ibx_32",gj="_name_83ibx_37",fj="_price_83ibx_40",Zt={subscriptionProductContainer:mj,subscriptionProductImage:xj,subscriptionProductInfo:hj,name:gj,price:fj},jj=({subscription:e,id:n,accessToken:s})=>{const[r,i]=_.useState(!1),{setIsOpen:o}=t.useModalStore();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Zt.subscriptionProductContainer,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:Zt.subscriptionProductImage,children:e!=null&&e.image?t.jsxRuntimeExports.jsx("img",{src:t.convertCfImageIdToUrl(e.image.cfId)}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})}),t.jsxRuntimeExports.jsxs("div",{className:Zt.subscriptionProductInfo,children:[t.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:t.jsxRuntimeExports.jsx("h2",{className:Zt.name,children:e.name})}),t.jsxRuntimeExports.jsxs("p",{className:Zt.price,children:[t.formatPrice(e.price)," / ",e.recurringInterval]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Special",onClick:a=>{a.preventDefault(),i(!0),o(!0)},children:"Cancel"})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(ry,{accessToken:s,id:n,isOpen:r,setIsOpen:i})})]})},yj="_content_5ctxw_1",_j="_selectedPlan_5ctxw_37",Sj="_planName_5ctxw_44",bj="_description_5ctxw_48",Cj="_price_5ctxw_51",Ej="_buttonGroup_5ctxw_79",vj="_buttonWrapper_5ctxw_84",wj="_modal_5ctxw_88",kj="_header_5ctxw_95",He={content:yj,selectedPlan:_j,planName:Sj,description:bj,price:Cj,buttonGroup:Ej,buttonWrapper:vj,modal:wj,header:kj},Rj=({setIsOpen:e,selectedVariant:n,subscription:s})=>{if(!n)return null;const{setIsOpen:r}=t.useModalStore(),i=()=>{o()},o=()=>{r(!1),setTimeout(()=>{e(!1)},300)},a=(n.subscriptionSettings.compareAtPrice||n.subscriptionSettings.price).amount,l=n.subscriptionSettings.compareAtPrice?n.subscriptionSettings.compareAtPrice.amount-n.subscriptionSettings.price.amount:n.subscriptionSettings.price.amount,u=a-l,p=new Intl.NumberFormat("en-US",{style:"currency",currency:s.price.currency});return t.jsxRuntimeExports.jsxs("div",{className:He.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:He.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Choose upgrade method"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:()=>o(),fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:He.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:He.content,children:[t.jsxRuntimeExports.jsxs("div",{className:He.selectedPlan,children:[t.jsxRuntimeExports.jsx("h2",{className:He.planName,children:n.name}),t.jsxRuntimeExports.jsx("p",{className:He.description,children:n.description}),t.jsxRuntimeExports.jsxs("p",{className:He.price,children:["$",n.subscriptionSettings.price.amount.toFixed(2)," /"," ",n.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),t.jsxRuntimeExports.jsx(on,{formatter:p,coupon:null,total:u,discount:l})]}),t.jsxRuntimeExports.jsxs("div",{className:He.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:He.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>o(),children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:He.buttonWrapper,children:t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Primary",onClick:i,children:["Upgrade for $",u.toFixed(2)]})})]})]})]})},Nj="_reviewMessage_1lmwy_1",Ij="_leaveReviewContainer_1lmwy_10",Tj="_leaveReviewTitle_1lmwy_19",ls={reviewMessage:Nj,leaveReviewContainer:Ij,leaveReviewTitle:Tj},Pj=({review:e,orderId:n,className:s})=>{const[r,i]=_.useState((e==null?void 0:e.rating)||0),[o,a]=_.useState(!1),{setIsOpen:l}=t.useModalStore(),{notifications:u,setNotifications:p}=t.useNotificationStore(),c=async m=>{e&&"accessToken"in e&&(await yi({comment:m,rating:r},n,e.accessToken),p([...u,{status:"success",id:t.v4(),message:"Review left successfully"}]),a(!1))};return _.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(l(!0),a(!0))},[r]),e?e.rating&&"accessToken"in e?t.jsxRuntimeExports.jsxs("div",{className:ls.reviewMessage,children:["You left a ",e.rating," star rating"]}):t.jsxRuntimeExports.jsxs("div",{className:t.clx(ls.leaveReviewContainer,s),children:[t.jsxRuntimeExports.jsx("p",{className:ls.leaveReviewTitle,children:"Leave a review"}),t.jsxRuntimeExports.jsx(tm,{rating:r,setRating:i,disabled:!!e.rating||!("accessToken"in e)}),o&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>a(!1),children:t.jsxRuntimeExports.jsx(Fj,{setIsOpen:a,onSubmit:c})})]}):null},Lj="_bottomSheet_jxxl3_1",Bj="_content_jxxl3_7",Aj="_buttonGroup_jxxl3_18",Mj="_buttonWrapper_jxxl3_29",$j="_modal_jxxl3_33",Dj="_header_jxxl3_40",St={bottomSheet:Lj,content:Bj,buttonGroup:Aj,buttonWrapper:Mj,modal:$j,header:Dj},Fj=({setIsOpen:e,onSubmit:n})=>{const[s,r]=_.useState(""),{setIsOpen:i}=t.useModalStore(),o=()=>{i(!1),setTimeout(()=>{e(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:St.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:St.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Review Description"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:St.bottomSheet,children:[t.jsxRuntimeExports.jsx("div",{className:St.content,children:t.jsxRuntimeExports.jsx(t.Textarea$1,{maxLength:150,placeholder:"Great product and fast checkout...",value:s,onChange:a=>r(a),label:"Describe your review in detail below"})}),t.jsxRuntimeExports.jsxs("div",{className:St.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:St.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:o,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:St.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",disabled:!s,onClick:()=>{o(),n(s)},children:"Submit"})})]})]})]})},Oj="_container_1idhv_1",Hj="_buttonGroup_1idhv_8",zj="_buttonWrapper_1idhv_15",Uj="_header_1idhv_19",Vj="_content_1idhv_28",bt={container:Oj,buttonGroup:Hj,buttonWrapper:zj,header:Uj,content:Vj},Wj=({setIsOpen:e})=>{const{subscription:n}=t.useSubscriptionStore(),{getTotalAndDiscount:s,cart:r,coupon:i}=t.useCart(),[o,a]=_.useState(1),l=t.useNavigate(),{setIsOpen:u}=t.useModalStore(),{setNotifications:p,notifications:c}=t.useNotificationStore(),[m,x]=_.useState(!1),d=_.useMemo(()=>s(),[i,r]),g=_.useMemo(()=>d.totalWithDiscount?d.total-d.totalWithDiscount:0,[d]);if(m)return t.jsxRuntimeExports.jsx(t.ProcessingPaymentModal,{});const h=(n==null?void 0:n.price.currency)||"USD",b=new Intl.NumberFormat("en-US",{style:"currency",currency:h});async function f(){var C;x(!0);try{const{data:N}=await t.extendSubscription((n==null?void 0:n.id)||"",{});p([{id:t.v4(),message:"Order created successfully",status:"success"}]),l(`/orders/${(C=N.data)==null?void 0:C.id}/${N.data.fullAccessToken}`)}catch(N){const w=N;p([...c,{id:t.v4(),message:`Order creation failed: ${w.message}`,status:"error"}]),E()}finally{x(!1)}}function E(){u(!1),setTimeout(()=>{e(!1)},300)}return t.jsxRuntimeExports.jsxs("div",{className:bt.container,onClick:C=>C.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:bt.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",className:bt.title,children:"Extend Subscription"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:E,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:bt.content,children:[t.jsxRuntimeExports.jsx(mm,{step:o,totalSteps:12,onStepChange:a,label:"How long would you like to extend your subscription for?"}),t.jsxRuntimeExports.jsx(on,{formatter:b,coupon:i,total:d.total,discount:g,totalWithDiscount:d.totalWithDiscount}),t.jsxRuntimeExports.jsxs("div",{className:bt.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:bt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:E,children:"Cancel"})}),t.jsxRuntimeExports.jsx("div",{className:bt.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:f,children:"Extend"})})]})]})]})},qj="_bottomSheet_uw5jb_1",Gj="_content_uw5jb_7",Zj="_radioGroup_uw5jb_11",Xj="_confirmation_uw5jb_26",Yj="_iconWrapper_uw5jb_33",Kj="_title_uw5jb_42",Jj="_message_uw5jb_48",Qj="_buttonGroup_uw5jb_54",ey="_buttonWrapper_uw5jb_64",ty="_modal_uw5jb_68",ny="_header_uw5jb_77",me={bottomSheet:qj,content:Gj,radioGroup:Zj,confirmation:Xj,iconWrapper:Yj,title:Kj,message:Jj,buttonGroup:Qj,buttonWrapper:ey,modal:ty,header:ny},sy={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},ry=({isOpen:e,setIsOpen:n,id:s,accessToken:r})=>{const[i,o]=_.useState(0),[a,l]=_.useState(!1),[u,p]=_.useState(""),[c,m]=_.useState(""),{setIsOpen:x}=t.useModalStore(),d=async()=>{if(!u)return;l(!0);const h=await t.cancelSubscription(s,r,{reason:u==="Other reason"?c:u});l(!1),h&&o(2)};_.useEffect(()=>{e||(o(0),p(""),m(""))},[e]);const g=()=>{x(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsxs("div",{className:me.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:me.header,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:sy[i]||""}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),t.jsxRuntimeExports.jsxs("div",{className:me.content,children:[i===0&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),t.jsxRuntimeExports.jsxs("div",{className:me.radioGroup,children:[t.jsxRuntimeExports.jsx(t.Radio,{defaultValue:u,onChange:h=>p(h),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),u==="Other reason"&&t.jsxRuntimeExports.jsx(t.Textarea$1,{value:c,onChange:h=>m(h),placeholder:"Describe the reason...",maxLength:150})]}),t.jsxRuntimeExports.jsxs("div",{className:me.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>u&&o(1),disabled:!u,children:"Continue"})})]})]}),i===1&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),t.jsxRuntimeExports.jsxs("div",{className:me.buttonGroup,children:[t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Stay with us"})}),t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:d,disabled:a,children:"Cancel it anyway"})})]})]}),i===2&&t.jsxRuntimeExports.jsxs("div",{className:me.bottomSheet,children:[t.jsxRuntimeExports.jsxs("div",{className:`${me.confirmation}`,children:[t.jsxRuntimeExports.jsx("div",{className:me.iconWrapper,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Check",fill:"var(--text-success)"})}),t.jsxRuntimeExports.jsx("p",{className:me.title,children:"Subscription Cancelled"}),t.jsxRuntimeExports.jsx("p",{className:me.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),t.jsxRuntimeExports.jsx("div",{className:me.buttonGroup,children:t.jsxRuntimeExports.jsx("div",{className:me.buttonWrapper,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},oy="_checkoutContainer_wkomn_1",iy="_loaderContainer_wkomn_20",cs={checkoutContainer:oy,loaderContainer:iy},ay=()=>{const{cart:e,products:n,pending:s,getTotalAndDiscount:r,getPossibleGateways:i,submitCart:o,setGateway:a,applyCoupon:l,setDiscordSocialConnectId:u,setCustomFields:p,applyCouponPending:c,coupon:m,removeCoupon:x,getDiscordSettings:d,setPaymentMethod:g,reset:h}=t.useCart(),b=_.useMemo(()=>r(),[m,e]),f=t.useNavigate();return _.useEffect(()=>{if(e.parts.length===0)try{f(-1)}catch{f("/")}},[e.parts]),s?t.jsxRuntimeExports.jsx("div",{className:cs.checkoutContainer,children:t.jsxRuntimeExports.jsx("div",{className:cs.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})})}):t.jsxRuntimeExports.jsxs("div",{className:cs.checkoutContainer,children:[t.jsxRuntimeExports.jsx(Wm,{cart:e,products:n,applyCoupon:l,applyCouponPending:c,coupon:m,removeCoupon:x,totalAndDiscount:b}),t.jsxRuntimeExports.jsx(kx,{cart:e,getPossibleGateways:i,setGateway:a,getDiscordSettings:d,products:n,submitCart:o,totalAndDiscount:b,setCustomFieldsToCart:p,setDiscordSocialConnectId:u,setPaymentMethod:g,reset:h})]})},ly="_chargePageContainer_1cfy0_1",cy="_chargeItems_1cfy0_14",uy="_mainContent_1cfy0_25",py="_contentWrapper_1cfy0_36",dy="_statusBlock_1cfy0_41",my="_notPaidSection_1cfy0_45",xy="_footer_1cfy0_54",hy="_loaderContainer_1cfy0_64",pt={chargePageContainer:ly,chargeItems:cy,mainContent:uy,contentWrapper:py,statusBlock:dy,notPaidSection:my,footer:xy,loaderContainer:hy},gy=()=>{const{id:e}=t.useParams(),[n,s]=t.useSearchParams(),[r,i]=_.useState(!1),[o,a]=_.useState(),[l,u]=_.useState(!0),p=t.useNavigate(),c=_.useRef(),{setIsOpen:m}=t.useModalStore();return _.useEffect(()=>{const x=async(g,h=!1)=>{h||i(!0);const{data:b}=await _i(g);i(!1),a(b)},d=setInterval(()=>{e&&x(e,!0)},5e3);return e&&x(e),()=>{clearInterval(d)}},[]),_.useEffect(()=>{const x=n.get("redirectRoute");(o==null?void 0:o.status)===t.ChargeStatus.Paid&&o.redirectUrl&&!c.current&&window.open(o.redirectUrl,"_self"),(o==null?void 0:o.status)===t.ChargeStatus.Paid&&c.current&&p(c.current,{replace:!0}),x&&c&&(c.current=x,n.delete("redirectRoute"),s(n))},[o]),_.useEffect(()=>{((o==null?void 0:o.gateway)==="PayPalFF"||(o==null?void 0:o.gateway)==="Сashapp")&&m(!0)},[o]),r?t.jsxRuntimeExports.jsx("div",{className:pt.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs("div",{className:pt.chargePageContainer,children:[t.jsxRuntimeExports.jsx("div",{className:pt.chargeItems,children:t.jsxRuntimeExports.jsx(ph,{charge:o})}),t.jsxRuntimeExports.jsx("div",{className:pt.mainContent,children:t.jsxRuntimeExports.jsxs("div",{className:pt.contentWrapper,children:[o&&(o==null?void 0:o.status)!==t.ChargeStatus.NotPaid&&t.jsxRuntimeExports.jsx(t.ChargeStatusBlock,{charge:o}),o&&t.jsxRuntimeExports.jsx("div",{className:`${pt.statusBlock}`,children:t.jsxRuntimeExports.jsx(Xr,{lastUpdate:o.expiresAt,email:o.customerForCharge.email,invoiceId:o.id,paymentType:o.gateway})}),(o==null?void 0:o.status)===t.ChargeStatus.NotPaid&&t.jsxRuntimeExports.jsx("div",{className:pt.notPaidSection,children:o==null?void 0:o.displayPaymentInfo.map((x,d)=>t.jsxRuntimeExports.jsx(Zr,{block:x},d))}),t.jsxRuntimeExports.jsx(rt,{className:pt.footer})]})}),(o==null?void 0:o.gateway)==="PayPalFF"&&l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>u(!1),children:t.jsxRuntimeExports.jsx(eh,{price:o.price,setIsOpen:u})}),(o==null?void 0:o.gateway)==="Сashapp"&&l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(Rh,{setIsOpen:u,chargeId:o.id})})]})},fy="_wrapper_1fax2_1",jy="_title_1fax2_20",yy="_container_1fax2_26",_y="_content_1fax2_36",Sy="_messages_1fax2_46",by="_input_1fax2_58",Cy="_textarea_1fax2_64",Ey="_message_1fax2_46",vy="_messageDate_1fax2_88",wy="_myMessage_1fax2_94",ky="_otherMessage_1fax2_101",Ry="_button_1fax2_108",Ny="_loadingMessage_1fax2_117",be={wrapper:fy,title:jy,container:yy,content:_y,messages:Sy,input:by,textarea:Cy,message:Ey,messageDate:vy,myMessage:wy,otherMessage:ky,button:Ry,loadingMessage:Ny},Iy=()=>{const e=window.location.pathname.split("/"),n=e[e.length-1],s=e[e.length-2],[r,i]=_.useState(!0),[o,a]=_.useState(null),[l,u]=_.useState(""),[p,c]=_.useState(null),{executeRecaptcha:m}=t.useReCaptcha(),x=async()=>{if(s&&n){const{data:h}=await t.fetchTicket(s,n);a(h),i(!1)}};_.useEffect(()=>{x();const h=setInterval(()=>{x()},5e3);return()=>clearInterval(h)},[]);const d=async()=>{const h=await m();if(!s||!n||!h||!l.trim())return;const b={content:l,createdAt:new Date().toISOString(),id:Date.now(),isSellerReply:!1};a(f=>f?{...f,messages:[...f.messages,b]}:null),c(b.id),u("");try{await t.sendTicketMessage(s,n,l,h),await x()}finally{setTimeout(()=>{c(null)},1e4)}},g=h=>{const b=new Date,f=new Date(h),E=Math.floor((b.getTime()-f.getTime())/1e3);if(E<60)return"right now";if(E<3600){const C=Math.floor(E/60);return`${C} minute${C>1?"s":""} ago`}else if(E<10800){const C=Math.floor(E/3600);return`${C} hour${C>1?"s":""} ago`}else return f.getFullYear()===b.getFullYear()?f.toLocaleDateString("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):f.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return t.jsxRuntimeExports.jsx("div",{className:be.wrapper,children:r&&!o?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs("div",{className:be.container,children:[t.jsxRuntimeExports.jsx("div",{className:be.title,children:`#${s} (${o==null?void 0:o.title})`}),t.jsxRuntimeExports.jsxs("div",{className:be.content,children:[t.jsxRuntimeExports.jsx("div",{className:be.messages,children:o==null?void 0:o.messages.sort((h,b)=>new Date(h.createdAt).getTime()-new Date(b.createdAt).getTime()).map(h=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(be.message,{[be.myMessage]:!h.isSellerReply,[be.otherMessage]:h.isSellerReply,[be.loadingMessage]:p===h.id}),children:[t.jsxRuntimeExports.jsx("div",{className:be.messageContent,children:t.splitTextIntoSpans(h.content)}),p!==h.id&&t.jsxRuntimeExports.jsx("div",{className:be.messageDate,children:g(h.createdAt)}),p===h.id&&t.jsxRuntimeExports.jsx("div",{className:be.messageDate,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]},h.id))}),t.jsxRuntimeExports.jsxs("div",{className:be.input,children:[t.jsxRuntimeExports.jsx("textarea",{className:be.textarea,value:l,placeholder:"What worries you?",onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),d())},style:{resize:"none",maxHeight:"150px",overflowY:"auto"}}),t.jsxRuntimeExports.jsx("div",{className:be.button,onClick:d,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"PaperPlaneRight"})})]})]})]})})},Ty="_subscriptionContainer_1j6ol_1",Py="_leftSection_1j6ol_15",Ly="_content_1j6ol_26",By="_mainContent_1j6ol_33",Ay="_detailsSection_1j6ol_37",My="_buttonGroup_1j6ol_50",$y="_detailsContent_1j6ol_57",Ct={subscriptionContainer:Ty,leftSection:Py,content:Ly,mainContent:By,detailsSection:Ay,buttonGroup:My,detailsContent:$y},Dy=()=>{const{id:e,accessToken:n}=t.useParams(),{subscription:s,setSubscription:r}=t.useSubscriptionStore(),{setIsOpen:i}=t.useModalStore(),[o,a]=_.useState(!1),[l,u]=_.useState(!1);_.useLayoutEffect(()=>{r(null)},[e,n]);const{balanceSettings:p,setBalanceSettings:c}=t.useCustomerDashboardStore();return _.useEffect(()=>{e&&n&&(async()=>{if(!e||!n)return;u(!0);const{data:x}=await t.fetchSubscription(e,n);r({...x}),u(!1)})()},[e,n]),_.useEffect(()=>{p||(async()=>{const x=await t.getBalanceSettings();c(x)})()},[p]),l?t.jsxRuntimeExports.jsx(t.Loader,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Ct.subscriptionContainer,children:[t.jsxRuntimeExports.jsx("div",{className:Ct.leftSection,children:t.jsxRuntimeExports.jsxs("div",{className:Ct.content,children:[t.jsxRuntimeExports.jsx(rn,{}),t.jsxRuntimeExports.jsxs("div",{className:Ct.mainContent,children:[s&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Your Subscription"}),t.jsxRuntimeExports.jsx(g1,{subscription:{price:s.price,name:s.productName,description:s.productDescription,status:s.status,image:s.productImage,recurringInterval:s.recurringInterval}}),t.jsxRuntimeExports.jsx("div",{className:Ct.buttonGroup,children:s.pricingPlanExists&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:m=>{m.stopPropagation(),i(!0),a(!0)},style:{maxWidth:"500px",width:"100%"},children:"Change Plan"})})]}),t.jsxRuntimeExports.jsx(rt,{})]})]})}),t.jsxRuntimeExports.jsx("div",{className:Ct.detailsSection,children:t.jsxRuntimeExports.jsxs("div",{className:Ct.detailsContent,children:[t.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Details"}),(s==null?void 0:s.coupon)&&t.jsxRuntimeExports.jsx(Y1,{coupon:s.coupon,currency:s.price.currency||"USD"}),s&&t.jsxRuntimeExports.jsx(jj,{id:e||"",accessToken:n||"",subscription:{price:s.price,name:s.productName,description:s.productDescription,status:s.status,image:s.productImage,recurringInterval:s.recurringInterval}}),s&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(pj,{}),s.activeTo&&t.jsxRuntimeExports.jsx(U1,{})]}),t.jsxRuntimeExports.jsx(rt,{className:"flex md:hidden"})]})})]}),t.jsxRuntimeExports.jsx(D1,{isOpen:o,setIsOpen:a,subscription:s})]})},Fy="_topUpContainer_1pag6_1",Oy="_formWrapper_1pag6_15",Hy="_header_1pag6_29",zy="_footer_1pag6_82",Uy="_wrapper_1pag6_105",Xt={topUpContainer:Fy,formWrapper:Oy,header:Hy,footer:zy,wrapper:Uy},Vy=()=>{const{gatewaysDetail:e,setGatewaysDetail:n,balanceSettings:s,setBalanceSettings:r}=t.useCustomerDashboardStore();return _.useEffect(()=>{!e&&s&&(async()=>{const o=await t.getGatewaysDetail(s!=null&&s.isEnabled?(s==null?void 0:s.topUpSettings.gateways)||[]:[]);n(o)})()},[e,s]),_.useEffect(()=>{s||(async()=>{const o=await t.getBalanceSettings();r(o)})()},[s]),t.jsxRuntimeExports.jsxs("div",{className:Xt.wrapper,children:[t.jsxRuntimeExports.jsx(rn,{className:Xt.header}),t.jsxRuntimeExports.jsx("div",{className:Xt.topUpContainer,children:s?t.jsxRuntimeExports.jsx("div",{className:Xt.formWrapper,children:t.jsxRuntimeExports.jsx(t.BalanceModal,{setIsOpen:()=>{},isModal:!1})}):t.jsxRuntimeExports.jsx(t.Loader,{})}),t.jsxRuntimeExports.jsx("div",{className:Xt.footer,children:t.jsxRuntimeExports.jsx(rt,{})})]})},Wy="_orderPage_1nvve_1",qy="_leftSection_1nvve_15",Gy="_content_1nvve_35",Zy="_main_1nvve_42",Xy="_statusBlock_1nvve_54",Yy="_timelineBlock_1nvve_58",Ky="_footer_1nvve_62",Jy="_rightSection_1nvve_71",Qy="_header_1nvve_84",e_="_productList_1nvve_92",t_="_mobileFooter_1nvve_99",n_="_loaderContainer_1nvve_108",s_="_orderMainData_1nvve_116",r_="_prices_1nvve_123",o_="_headerTitle_1nvve_127",i_="_headerDescription_1nvve_131",fe={orderPage:Wy,leftSection:qy,content:Gy,main:Zy,statusBlock:Xy,timelineBlock:Yy,footer:Ky,rightSection:Jy,header:Qy,productList:e_,mobileFooter:t_,loaderContainer:n_,orderMainData:s_,prices:r_,headerTitle:o_,headerDescription:i_},a_=()=>{var m,x,d;const{id:e,accessToken:n}=t.useParams(),s=t.useNavigate(),[r,i]=_.useState(),[o,a]=_.useState(!1),l=t.useCopy(),u=((m=r==null?void 0:r.rawPrice)==null?void 0:m.currency)||"USD",p=new Intl.NumberFormat("en-US",{style:"currency",currency:u}),c=_.useMemo(()=>(r==null?void 0:r.partOrders.map(g=>{var h,b,f,E;return{id:(g==null?void 0:g.id)||0,image:g.productWithVariant.image,name:((h=g.productWithVariant)==null?void 0:h.name)||"",description:((b=g.productWithVariant)==null?void 0:b.description)||"",price:{quantity:g.quantity,amount:((f=g.productWithVariant)==null?void 0:f.price.amount)||0,currency:(E=g.productWithVariant)==null?void 0:E.price.currency},deliveryCategories:"deliveryCategories"in g?g.deliveryCategories:void 0,customerNote:g.customerNote,chargeType:g.chargeType||"ONE_TIME"}}))||[],[r]);return _.useEffect(()=>{const g=async(b,f=!1)=>{f||a(!0);const{data:E}=await(n?t.fetchAuthorizedOrder(`${b}/${n}`):t.fetchOrder(b));a(!1),E.charge.status===t.ChargeStatus.NotPaid&&s(`/charges/${E.charge.id}`,{replace:!0}),i(E)};e&&g(e);const h=setInterval(()=>{e&&g(e,!0)},5e3);return()=>{clearInterval(h)}},[]),o?t.jsxRuntimeExports.jsx("div",{className:fe.loaderContainer,children:t.jsxRuntimeExports.jsx(t.Loader,{})}):t.jsxRuntimeExports.jsxs("div",{className:fe.orderPage,children:[t.jsxRuntimeExports.jsx("div",{className:fe.leftSection,children:t.jsxRuntimeExports.jsxs("div",{className:fe.content,children:[t.jsxRuntimeExports.jsx(rn,{}),r&&t.jsxRuntimeExports.jsxs("div",{className:fe.main,children:[t.jsxRuntimeExports.jsx(t.OrderStatusBlock,{className:fe.statusBlock,orderStatus:r.status}),t.jsxRuntimeExports.jsxs("div",{className:fe.orderMainData,children:[t.jsxRuntimeExports.jsx(Xr,{lastUpdate:r.createdAt,paymentType:r.charge.gateway,email:r.charge.customerForCharge.email,invoiceId:r.charge.id}),"accessToken"in r.review&&t.jsxRuntimeExports.jsx(Pj,{orderId:r.id,review:r.review})]}),r.charge&&t.jsxRuntimeExports.jsx(t.TrackPayment,{className:fe.timelineBlock,timeline:r.charge.timeline}),t.jsxRuntimeExports.jsx(rt,{className:fe.footer})]})]})}),t.jsxRuntimeExports.jsx("div",{className:fe.rightSection,children:t.jsxRuntimeExports.jsxs("div",{className:fe.content,children:[(r==null?void 0:r.charge.name)&&t.jsxRuntimeExports.jsxs("header",{className:fe.header,children:[t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("h1",{className:fe.headerTitle,children:r.charge.name}),r.charge.description&&t.jsxRuntimeExports.jsx("p",{className:fe.headerDescription,children:r.charge.description})]}),t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:()=>l((r==null?void 0:r.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"}),t.jsxRuntimeExports.jsx("span",{children:"Copy ID"})]})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("div",{className:fe.productList,children:c.map(g=>t.jsxRuntimeExports.jsx(Cs,{product:g,isOrder:!0},g.id))}),t.jsxRuntimeExports.jsx(on,{formatter:p,coupon:null,total:((x=r==null?void 0:r.charge)==null?void 0:x.price.amount)||0,discount:0,totalWithDiscount:((d=r==null?void 0:r.charge)==null?void 0:d.price.amount)||0,className:fe.prices,isShowSubtotal:!1}),t.jsxRuntimeExports.jsx(rt,{className:fe.mobileFooter})]})]})})]})},l_=e=>{const{blocks:n,settings:s,header:r,footer:i,announcement:o}=e,[a,l]=_.useState(null),{general:u}=t.useGeneralStore(),{setBlocks:p,setSourceBlocks:c,setHeader:m,setFooter:x,setAnnouncement:d,setSettings:g}=t.useBlocksStore(),{setHeader:h,setFooter:b,setAnnouncement:f}=t.useLayersStore(),{themeSettings:E}=t.useThemeSettingsStore(),{settings:C,setSettings:N}=t.useSettingsStore(),w=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,S=localStorage.getItem("shopPassword"),A=localStorage.getItem("shopId")||"";return _.useEffect(()=>{if(E&&C){const $=vi(E,C);Ti(E),wi($)}},[E,C,window.location.hostname]),_.useEffect(()=>{const $={};Object.keys(n).map(L=>{$[L]=n[L]}),c($),p($),m(r),x(i),d(o),g(s);const z=new r,V=JSON.parse(JSON.stringify(z));h(V,!1);const B=new i,R=JSON.parse(JSON.stringify(B));b(R,!1);const I=new o,M=JSON.parse(JSON.stringify(I));f(M,!1);const P=new s,O=JSON.parse(JSON.stringify(P));N(O);const D=t.createBrowserRouter([{element:t.jsxRuntimeExports.jsx(Cd,{shopDomain:w,shopId:A,shopPassword:S||void 0,children:t.jsxRuntimeExports.jsx(t.ReCaptchaProvider,{children:t.jsxRuntimeExports.jsx(jd,{children:t.jsxRuntimeExports.jsx(t.Outlet,{})})})}),errorElement:t.jsxRuntimeExports.jsx(yd,{}),children:[{path:"/admin/builder/*",element:t.jsxRuntimeExports.jsx(id,{children:t.jsxRuntimeExports.jsx(ed,{blocks:n,settings:s,header:r,footer:i,announcement:o})}),errorElement:t.jsxRuntimeExports.jsx(od,{}),loader:()=>(document.title="Builder",!0)},{path:"/checkout",element:t.jsxRuntimeExports.jsx(ay,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsxRuntimeExports.jsx(Vy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsxRuntimeExports.jsx(gy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsxRuntimeExports.jsx(a_,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsxRuntimeExports.jsx(Dy,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Subscriptions",!0)},{path:"/customer-dash",element:t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[t.jsxRuntimeExports.jsx(t.RenderHeader,{}),t.jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto",background:"var(--surface-primary)"},children:t.jsxRuntimeExports.jsx(t.CustomerDashboard,{})}),t.jsxRuntimeExports.jsx(t.RenderFooter,{})]}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Customer Dashboard",!0)},{path:"/validation",element:t.jsxRuntimeExports.jsx(hd,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[t.jsxRuntimeExports.jsx(t.RenderHeader,{}),t.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsxRuntimeExports.jsx(t.ReCaptchaProvider,{children:t.jsxRuntimeExports.jsx(Iy,{})})}),t.jsxRuntimeExports.jsx(t.RenderFooter,{})]}),errorElement:t.jsxRuntimeExports.jsx(tt,{}),loader:()=>(document.title="Ticket",!0)},{path:"*",element:t.jsxRuntimeExports.jsx(Ei,{}),errorElement:t.jsxRuntimeExports.jsx(tt,{})}]}]);l(D)},[u]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a&&t.jsxRuntimeExports.jsx(t.RouterProvider,{router:a})})};exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useReCaptcha=t.useReCaptcha;exports.App=l_;exports.ColorVariables=Fr;exports.createTicket=Li;exports.hotReload=Pi;exports.iconNames=Mo;exports.useBuilderPages=Bi;