@blocklet/pages-kit-inner-components 0.5.30 → 0.5.32

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.
Files changed (37) hide show
  1. package/lib/cjs/add-component.js +47 -23
  2. package/lib/cjs/chunks/array-DxhrK2d5.js +475 -0
  3. package/lib/cjs/chunks/{config-string-C4Q0hgG0.js → config-string-DqWgB7yO.js} +1 -1
  4. package/lib/cjs/chunks/{draft-data-Cu9gua-P.js → draft-data-DzN2u_NT.js} +1 -1
  5. package/lib/cjs/chunks/home-0fezWT4S.js +38 -0
  6. package/lib/cjs/chunks/{publish-button-DvwoFH1F.js → publish-button-D2jaaXXn.js} +1 -1
  7. package/lib/cjs/chunks/site-state-D5jk8eJT.js +57 -0
  8. package/lib/cjs/chunks/state-DoGBMTzI.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/locales.js +3 -1
  12. package/lib/cjs/project-html.js +2 -2
  13. package/lib/cjs/resources.js +1 -1
  14. package/lib/cjs/setting.js +1 -1
  15. package/lib/cjs/site-state.js +1 -1
  16. package/lib/es/add-component.js +795 -749
  17. package/lib/es/chunks/array-D6qyZucY.js +2224 -0
  18. package/lib/es/chunks/{config-string-CNLg1EYu.js → config-string-Btybe5Rd.js} +1 -1
  19. package/lib/es/chunks/{draft-data-hSHLdxKp.js → draft-data-DQ7_JyJX.js} +1 -1
  20. package/lib/es/chunks/{home-CNk6U8FU.js → home-Dox9JwvF.js} +112 -96
  21. package/lib/es/chunks/{publish-button-BftBlabj.js → publish-button-T2YJBoty.js} +3 -3
  22. package/lib/es/chunks/{site-state-DJ3JcBMm.js → site-state-DEduMTrY.js} +505 -473
  23. package/lib/es/chunks/state-NhsHvaKm.js +605 -0
  24. package/lib/es/components.js +1 -1
  25. package/lib/es/home.js +3 -3
  26. package/lib/es/locales.js +46 -6
  27. package/lib/es/project-html.js +43 -42
  28. package/lib/es/resources.js +1 -1
  29. package/lib/es/setting.js +2 -2
  30. package/lib/es/site-state.js +1 -1
  31. package/package.json +10 -10
  32. package/lib/cjs/chunks/array-CJC7ex3i.js +0 -467
  33. package/lib/cjs/chunks/home-CimGvyT9.js +0 -38
  34. package/lib/cjs/chunks/site-state-DvIWP0pO.js +0 -57
  35. package/lib/cjs/chunks/state-jCG5gSUJ.js +0 -1
  36. package/lib/es/chunks/array-9j8tOSbO.js +0 -1993
  37. package/lib/es/chunks/state-D5BnGunt.js +0 -483
@@ -0,0 +1,475 @@
1
+ "use strict";var It=Object.create;var lt=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty;var Pt=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Tt(e))!zt.call(t,r)&&r!==i&&lt(t,r,{get:()=>e[r],enumerable:!(n=Rt(e,r))||n.enumerable});return t};var Et=(t,e,i)=>(i=t!=null?It(Wt(t)):{},Pt(e||!t||!t.__esModule?lt(i,"default",{value:t,enumerable:!0}):i,t));const o=require("react/jsx-runtime"),qt=require("@mui/icons-material"),m=require("@mui/material"),Lt=require("lodash/isEmpty"),At=require("lodash/pick"),b=require("react"),Ot=require("lodash/keyBy"),k=require("./state-DoGBMTzI.js"),J=require("@blocklet/ai-runtime/components"),Ut=require("@mui/utils"),Mt=require("react-error-boundary"),Ft=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),yt=require("@blocklet/pages-kit/contexts/color"),_=require("@emotion/css"),Ht=require("react-syntax-highlighter/dist/esm/styles/prism"),$=require("@arcblock/ux/lib/Theme"),Vt=require("@arcblock/react-hooks/lib/useBrowser"),Dt=require("@arcblock/ux/lib/Colors"),et=require("@blocklet/pages-kit/components"),ct=require("@blocklet/pages-kit/utils/style"),Yt=require("@mui/material/useMediaQuery"),Jt=require("lodash/omit"),bt=require("@iconify-icon/react"),Gt=require("@arcblock/ux/lib/Screenshot"),ot=require("react-router-dom"),Kt=require("@arcblock/ux/lib/Button"),Xt=require("is-uri"),G=require("pathe"),q=require("ufo"),Qt=require("@blocklet/embed/message"),Zt=require("ahooks"),te=require("lodash/isEqual"),ee=require("@blocklet/embed/react"),oe=require("@arcblock/ux/lib/Locale/context"),ne=require("react-twitter-embed"),dt=require("react-use"),C=t=>t&&t.__esModule?t:{default:t},re=C(Lt),X=C(At),ie=C(b),Q=C(Ot),se=C(Ft),ae=C(Vt),ut=C(Dt),wt=C(Yt),R=C(Jt),le=C(Gt),ce=C(Kt),Z=C(Xt),de=C(te),jt="{{CUSTOM_VALUE}}",ue=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],me=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],xe=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:2.5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:2.5,md:10,lg:12.5,xl:15}}}],K=(t,e,i)=>{const n=t.breakpoints.values[i];return`${e}${n?` (${n}px)`:""}`},pe=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:t=>K(t,"Small","sm"),value:"sm",sx:{maxWidth:t=>t.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:t=>K(t,"Normal","md"),value:"md",sx:{maxWidth:t=>t.breakpoints.values.md,width:"100%",mx:"auto"}},{title:t=>K(t,"Large","lg"),value:"lg",sx:{maxWidth:t=>t.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:t=>K(t,"Extra Large","xl"),value:"xl",sx:{maxWidth:t=>t.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:jt,width:"100%",mx:"auto"}}],he=Q.default(ue,"value"),fe=Q.default(me,"value"),ge=Q.default(xe,"value"),ye=Q.default(pe,"value"),be=new Map([["baseSectionPaddingY",he],["maxWidth",ye],["paddingY",fe],["paddingX",ge]]);function _t(t){var l;const{type:e,value:i,format:n="sx",defaultValue:r=null}=t,a=be.get(e);if(!a)return r;const d=i.startsWith("custom:"),s=d?"custom":i;if(a!=null&&a[s]&&((l=a==null?void 0:a[s])!=null&&l[n])){const c=a[s][n];if(d){const x=i.replace("custom:","");try{return JSON.parse(JSON.stringify(c||{}).replaceAll(jt,x))}catch{}}return c}return r}const vt=b.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function we(){return b.useContext(vt)}function je({page:t,children:e,defaultLocale:i="en",currentLocale:n}){const r=b.useMemo(()=>t?JSON.parse(JSON.stringify(t)):null,[JSON.stringify(t)]),a=b.useCallback(()=>{var c;if(!r)return{};const l=n||i;return((c=r.locales)==null?void 0:c[l])??{}},[r,i,n]),d=b.useCallback((l="sx")=>{const c=a();return!c||!c.style?{}:Object.entries(c.style||{}).reduce((u,[h,p])=>{if(!p)return u;const y=`${h}Custom`;c.style[y];const f=_t({type:h,value:p,format:l});return f?{...u,...f}:u},{})},[a]),s=b.useMemo(()=>({page:r,getPageMeta:a,getPageMetaStyle:d}),[r,a,d]);return o.jsx(vt.Provider,{value:s,children:e})}function E({actions:t,center:e,className:i,align:n}){return t&&(t!=null&&t.length)?o.jsx(m.Box,{className:_.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(e||n==="center")&&"justify-center",!e&&n==="right"&&"justify-end",!e&&n==="left"&&"justify-start",i),sx:{alignItems:"center"},children:t}):null}const _e="section",ve=m.styled(m.Box)`
2
+ overflow: hidden;
3
+
4
+ .section__title {
5
+ margin-top: 0;
6
+ font-weight: 700;
7
+ }
8
+ .section__title_non_big {
9
+ font-size: 32px;
10
+ @media (max-width: 600px) {
11
+ font-size: 24px;
12
+ }
13
+ }
14
+ &.base-info .section__tag {
15
+ margin-top: 0;
16
+ margin-bottom: 2vw;
17
+ background-color: ${({theme:t})=>t.palette.primary.main};
18
+ white-space: nowrap;
19
+ max-width: 100%;
20
+ display: inline-block;
21
+ padding: 0 10px;
22
+ justify-content: flex-start;
23
+ overflow: hidden;
24
+ text-overflow: ellipsis;
25
+ font-size: 12px;
26
+ color: #fff;
27
+ border-radius: 4px;
28
+ line-height: 20px;
29
+ }
30
+ .section__title {
31
+ color: ${({theme:t})=>t.palette.text.primary};
32
+ a {
33
+ color: ${({theme:t})=>t.palette.primary.main};
34
+ }
35
+ p {
36
+ margin-top: 0;
37
+ margin-bottom: 0;
38
+ }
39
+ }
40
+ .section__description {
41
+ color: ${({theme:t})=>t.palette.text.primary};
42
+ margin-bottom: 4vw;
43
+ margin-top: 0;
44
+ a {
45
+ color: ${({theme:t})=>t.palette.primary.main};
46
+ }
47
+ p {
48
+ margin-top: 0;
49
+ margin-bottom: 0.5rem;
50
+ }
51
+ }
52
+ @media (min-width: ${({theme:t})=>t.breakpoints.values[_e]}px) {
53
+ .section__tag {
54
+ margin-bottom: 32px;
55
+ }
56
+ .section__title {
57
+ margin-bottom: 32px;
58
+ }
59
+ .section__description {
60
+ margin-bottom: 40px;
61
+ }
62
+ }
63
+ `;function O({title:t,description:e,descriptionMarkdown:i,actions:n,className:r="",classes:a={},prepend:d,append:s,level:l=2,tag:c,badge:x,center:u,logo:h,titleAppearance:p,descriptionAppearance:y,...f}){const w=yt.useColorConvert();if(!t&&!e&&!n&&!x&&!c&&!d&&!s&&!h)return null;const g=Math.max(Math.min(5,l+1),1),j={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},B=l===0?"big":`h${g}`,v=l===0;return o.jsxs(ve,{className:_.cx("base-info","lg:text-left",u&&"!text-center",r),...f,children:[d&&o.jsx("div",{children:d}),(c||x)&&o.jsx("div",{className:_.cx("section__tag",(a==null?void 0:a.tag)||(a==null?void 0:a.badge)),children:c||x}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(p==null?void 0:p.color)&&{color:`${w(p.color)} !important`}},className:_.cx("section__title","text-gray-800","dark:text-gray-50",a.title,"page-kit-section__title",v?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:B,children:t}),e&&(i?o.jsx(m.Box,{sx:{...(y==null?void 0:y.color)&&{color:`${w(y.color)} !important`}},className:_.cx("section__description","text-gray-800","dark:text-gray-100",j[g],a.description,"page-kit-section__description"),children:o.jsx(se.default,{codeOptions:{showActionButton:!1,theme:Ht.materialDark},children:e})}):o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",...(y==null?void 0:y.color)&&{color:`${w(y.color)} !important`}},className:_.cx("section__description","text-gray-800","dark:text-gray-100",j[g],a.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(E,{actions:n,center:u,className:"mt-8"}),s&&o.jsx("div",{children:s})]})}const U=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function kt(t){if(t.type===b.Fragment){const i=(t.props.children||[]).filter(n=>b.isValidElement(n));return i.length===1?kt(i[0]):i.length>1}return Array.isArray(t)}const W="&>*";function nt({children:t,col:e,gap:i,className:n,align:r,sx:a,type:d,...s}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=$.useTheme(),c=Number(Math.floor(100/e*100)/100),x={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},u=x[r]||x.center;let p=i??({2:6,3:4,4:4,5:3,6:3}[e]||0);kt(t)||(p=0);const f=(e-1)*p/e;let w={...a,gap:`${p}rem`};const g={[W]:{width:"100%"}},j={},B={},v={};switch(g.gap="1rem",j.gap=`${p/2}rem`,e){case 3:case 4:j[W]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:g[W]={width:`calc(50% - ${p/2/2}rem)`},j[W]={width:`calc(50% - ${p/2/2}rem)`},B[W]={width:`calc(33.33% - ${p*2/3}rem)`};break}return w[W]={width:`calc(${c}% - ${f}rem)`},w[`@media (max-width: ${l.breakpoints.values.xl}px)`]=v,w[`@media (max-width: ${l.breakpoints.values.lg}px)`]=B,w[`@media (max-width: ${l.breakpoints.values.md}px)`]=j,w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g,d==="wall"&&(w={...a,gap:`${p}rem`},w[W]={width:`calc(${c}% - ${f}rem)`},g[W]={width:`calc(45% - ${p/2/2}rem)`},w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g),o.jsx(m.Box,{className:_.cx("flex flex-wrap flex-row h-full",u,n),sx:w,...s,children:t})}function ke(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function $e(t=""){if(t.startsWith("data:image/svg+xml,"))return!0;const e=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,i=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return e.test(t)||i.test(t)}function L(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function Be(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function Ce(t){let e={};return typeof t=="string"?ct.isGradient(t)?e.image=t:(e.image=k.getImageAbsoluteUrl(t),ct.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function Se(){const[t,e]=b.useState(Date.now());return b.useEffect(()=>{const i=()=>{e(Date.now())};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i)}},[]),t}function mt(t,e,i,n,r){let a=null;const{color:d="",image:s}=Ce(e);if(s&&$e(s)){delete i.backgroundColor;const l=!(t.mobile.apple.device||ke())&&L(s),c=L(s)&&n?k.autoResizeImage(k.getImageAbsoluteUrl(n),1200,"quality"):"";l?a=o.jsx(m.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:c,src:L(s)?s:k.autoResizeImage(s,1200,"quality"),sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},s):a=o.jsx(et.ResponsiveImage,{src:L(s)&&n?c:s,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},r||s)}else s?i.backgroundImage=`${s} !important`:d&&(i.backgroundColor=`${d} !important`);return a}function Ne({autoWidth:t,children:e,...i}){return t?o.jsx(m.Box,{display:"flex",...i,children:e}):o.jsx(m.Container,{...i,children:e})}function M({dark:t=!1,children:e,className:i,sx:n={},boxed:r={show:!1},padding:a="normal",boxProps:d,type:s,...l}){const c={...n},x=wt.default(p=>p.breakpoints.down("md"));t&&(c.color=ut.default.common.white,c.backgroundColor=`${ut.default.grey[900]} !important`),r.show&&(c.display="flex");const u=b.useMemo(()=>!Number(l.boxMaxWidth)||x?{width:"100%"}:s==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,x,s]),h=_t({type:"baseSectionPaddingY",value:a||"normal",defaultValue:""});return o.jsx(Ie,{component:"section",styles:{...c,...h},className:_.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",i,{dark:t}),...R.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Ne,{autoWidth:l==null?void 0:l.autoWidth,className:_.cx("section-content h-full"),sx:u,children:r.show?o.jsx($t,{...d,boxed:r,children:e}):e})})}function $t({background:t="",backgroundVideoPoster:e,children:i,sx:n={},boxed:r={show:!1},className:a="",styles:d={},...s}){const l={...d,...n},c=yt.useColorConvert();let x=null;const u=wt.default(y=>y.breakpoints.up("sm")),h=ae.default(),p=Se();return t&&(x=mt(h,typeof t=="string"?c(t):t,l,e,p)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=u?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(x=mt(h,typeof(r==null?void 0:r.background)=="string"?c(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,p))),o.jsxs(m.Box,{...s,sx:{...l,...x?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:_.cx(a,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[x,i]})}const Ie=$.styled($t)`
64
+ &:nth-of-type(even) {
65
+ background: #f8f8f8;
66
+ }
67
+
68
+ @media (max-width: 600px) {
69
+ .section__title {
70
+ font-size: 24px;
71
+ }
72
+
73
+ .base-info {
74
+ > *:last-child {
75
+ margin-bottom: 0;
76
+ }
77
+ }
78
+ }
79
+ `;function rt({icon:t,...e}){return o.jsx(bt.Icon,{icon:t,...e,ref:null})}function S(t,e){const i=X.default(t,e),n=R.default(t,e);return[i,n]}const Bt=["title","description","actions","badge","tag","prepend","append","logo"];function Re({image:t,imageBorder:e,imageShadow:i,className:n,reverse:r=!1,fullSizeImage:a,...d}){const[s,l]=S(d,U),c=Object.keys(s).length>0&&Object.values(X.default(s,Bt)).filter(Boolean).length>0&&o.jsx(O,{...s}),x=b.isValidElement(t)?t:o.jsx(m.Box,{component:"img",src:t,alt:"",className:"block"}),u=["phone","macbook"].includes(e),h=t&&o.jsx(m.Box,{className:_.cx("section__image","m-auto, leading-[1] text-center",i&&"shadow-xl",s!=null&&s.center?"flex justify-center items-center":""),sx:{border:e===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":u?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:u?o.jsx(le.default,{type:e,sx:{width:"100%"},children:x}):x});return o.jsx(M,{className:_.cx("section--block",n,a&&!r&&_.css`
80
+ .section-bg {
81
+ height: 80%;
82
+ }
83
+ `),...l,boxProps:a?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(nt,{col:t?2:1,className:a?_.css`
84
+ display: flex;
85
+ flex-direction: column;
86
+
87
+ > .base-info,
88
+ > .section__image {
89
+ width: 100%;
90
+
91
+ > img,
92
+ > video {
93
+ width: 100%;
94
+ }
95
+ }
96
+ `:void 0,children:r?o.jsxs(o.Fragment,{children:[h,c]}):o.jsxs(o.Fragment,{children:[c,h]})})})}const F=["editing","height","locale","dev","sx"];function Te(t){const{className:e,...i}=t;return o.jsx(We,{...i,className:_.cx("BlockBase-root",e)})}const We=$.styled(m.Box)`
97
+ position: relative;
98
+ color: ${({theme:t})=>t.palette.text.primary};
99
+ `;function ze({widget:t,reverse:e,projectId:i,assistantId:n,working:r,submitTitle:a,submitIcon:d,submitColor:s,placeholder:l,loadingIndicator:c,section:x,...u}){const[{editing:h},p]=S(u,F),[y,f]=S(p,U),w=i&&n?{projectId:i,gitRef:"main",assistantId:n,working:!0}:void 0,g={children:a,endIcon:d?o.jsx(rt,{icon:d}):void 0,sx:{background:s||void 0,":hover":{background:s||void 0,opacity:.8}}},j=[],B=l&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:l}),v=c&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:c});Object.keys(y).length>0&&Object.values(X.default(y,Bt)).filter(Boolean).length>0&&j.push(o.jsx(O,{...y},"base-info")),w&&(t==="form"?j.push(o.jsx(J.AIForm,{identifier:w,SubmitProps:g},"form")):t==="result"?j.push(o.jsx(J.AIFormResult,{identifier:w,placeholder:B,loadingIndicator:v},"result")):j.push(o.jsxs(m.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(J.AIForm,{identifier:w,BoxProps:{flex:1},SubmitProps:g}),o.jsx(J.AIFormResult,{identifier:w,BoxProps:{flex:1},placeholder:B,loadingIndicator:v})]},"form-result"))),e&&j.reverse();const N=m.useTheme(),I=b.useMemo(()=>m.createTheme(Ut.deepmerge(N,{palette:{primary:s?{main:s}:void 0}})),[s,N]);return o.jsx(Mt.ErrorBoundary,{fallbackRender:k.ErrorView,children:o.jsx(m.ThemeProvider,{theme:I,children:o.jsx(M,{...f,sx:h?{pointerEvents:"none"}:{},children:o.jsx(nt,{col:j.length,children:j})})})})}const Ct=b.createContext({pages:[],project:void 0}),{Provider:Pe,Consumer:qo}=Ct;function St(){return b.useContext(Ct)}function Ee({icon:t,className:e="",size:i="1rem",...n}){return o.jsx(qe,{component:rt,className:_.cx("css-icon",e),size:i,...n,icon:t})}const qe=$.styled(m.Box)`
100
+ &.css-icon {
101
+ display: inline-block;
102
+ width: ${({size:t})=>t};
103
+ height: ${({size:t})=>t};
104
+ }
105
+ `;function Le({icon:t,className:e="",size:i="1rem",imageMeta:n,...r}){const a=k.autoResizeImage(k.getImageAbsoluteUrl(t),540),[d,s]=b.useState(!1),l=$.useTheme();return d?o.jsx(Ee,{icon:"i-mdi:image",color:l.palette.grey[500],size:i,className:e,...r}):o.jsx(Ae,{className:_.cx("image-icon",e),size:i,...r,children:o.jsx("img",{className:"image-icon__image",src:a,onError:()=>s(!0),width:n==null?void 0:n.naturalWidth,height:n==null?void 0:n.naturalHeight,alt:(n==null?void 0:n.filename)||"card-icon",loading:"lazy"})})}const Ae=$.styled(m.Box)`
106
+ display: inline-block;
107
+ width: ${({size:t})=>t};
108
+ height: ${({size:t})=>t};
109
+ .image-icon__image {
110
+ object-fit: contain;
111
+ height: 100%;
112
+ width: 100%;
113
+ }
114
+ `,it=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function tt({icon:t,size:e="1rem",imageMeta:i,...n}){const r=window.isNaN(e)?e:`${e}px`;return it(t)?o.jsx(bt.Icon,{icon:t}):o.jsx(Oe,{component:Le,imageMeta:i,className:"base-icon",icon:t,size:r,...n})}const Oe=$.styled(m.Box)`
115
+ flex-shrink: 0;
116
+ `;function A({text:t,children:e,icon:i="",endIcon:n,color:r="primary",link:a="",href:d="",...s}){const l=i?o.jsx(tt,{icon:i}):null,c=n?o.jsx(tt,{icon:n}):null,x=a||d,u={...s};return x&&(u.href=x,Z.default(x)&&(u.target=u.target||"_blank")),o.jsx(ce.default,{startIcon:l,endIcon:c,color:r,...u,children:t||e})}function st({editing:t,text:e,...i}){const{pages:n=[]}=St(),r=n.find(a=>a.id===(i.link||i.linkId));if(t)return o.jsx(A,{...R.default(i,["link","linkId"]),children:e});if(r){const a=r.path||"/";return o.jsx(ot.Link,{to:a,children:o.jsx(A,{...R.default(i,["link","linkId"]),children:e})})}return o.jsx(A,{...R.default(i,"linkId"),children:e})}function z({type:t="",icon:e="",size:i="3rem",className:n="",...r}){return o.jsx(tt,{icon:e||t,size:i,className:_.cx("content-icon",n),...r})}z.propTypes={};z.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Ue({to:t,base:e,children:i,className:n,activeClassName:r="active",target:a="auto",autoExternalMark:d=!1,useRouterLink:s,...l}){const{pages:c=[],locale:x=""}={},u=e?G.join("/",e):e||"";let h=a==="auto"?"_self":a,p=G.join(u,t);const y=d?Z.default(p):!1;if(e)return p=G.join(u,x,t),o.jsx("a",{className:`no-underline ${n}`,href:q.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:i});if(Z.default(t))a==="auto"&&(h="_blank"),p=t;else{q.isRelative(p)&&(p=G.join(window.location.pathname,p));const f=q.parseURL(`${window.location.origin}${p}`),w=c.some(g=>g.pathname===f.pathname);if(s||w)return o.jsx(ot.NavLink,{end:!0,to:q.withoutTrailingSlash(p),className:({isActive:g})=>_.cx(n,g?r:""),...l,children:i})}return o.jsxs("a",{className:`no-underline ${n}`,href:q.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[i,y&&o.jsx(z,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function H({prepend:t,append:e,children:i,className:n="",dark:r=!1,border:a=!0,...d}){let s={};const{pages:l=[]}=St(),c=l.find(h=>h.id===d.link),x=!i||ie.default.Children.toArray(i).every(h=>h===null);d.link&&(s={component:Ue,to:(c==null?void 0:c.path)||d.link,useRouterLink:!0});const u=m.useTheme();return o.jsxs(Me,{className:_.cx("base-card card",{dark:r,"border-transparent":!a},n),sx:{borderColor:u.palette.divider},...s,...R.default(d,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!x&&o.jsx("div",{className:"card__body",children:i}),e]})}const Me=$.styled(m.Box)`
117
+ &.base-card {
118
+ text-align: left;
119
+ border-width: 1px;
120
+ border-style: solid;
121
+ border-radius: 12px;
122
+ overflow: hidden;
123
+ &,
124
+ &:hover {
125
+ text-decoration: none;
126
+ }
127
+ }
128
+ .card__body {
129
+ padding: 15px 15px;
130
+ }
131
+ `;function V({align:t="left",title:e,titleProps:i={},description:n,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(m.Typography,{className:_.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...i,children:e}),n&&o.jsx(m.Typography,{className:_.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:n})]})}function Fe({image:t,title:e,description:i,imageProps:n={},imageMeta:r,imageSize:a,titleProps:d={},descriptionProps:s={},actions:l,align:c,...x}){const u=it(t),h=k.autoResizeImage(k.getImageAbsoluteUrl(t),540);return o.jsxs(He,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(z,{icon:t,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...n,alt:n.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:a||"cover",objectPosition:"center"},loading:"lazy"})}),children:[e||i?o.jsx(V,{align:c,title:e,titleProps:d,description:i,descriptionProps:s}):null,l!=null&&l.length?o.jsx(E,{align:c,actions:l,className:"mt-4"}):null]})}const He=$.styled(H)`
132
+ ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
133
+ &:hover {
134
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
135
+ }`:""}
136
+
137
+ .card__title {
138
+ color: ${({theme:t})=>t.palette.text.primary};
139
+ a {
140
+ color: ${({theme:t})=>t.palette.primary.main};
141
+ }
142
+ }
143
+ .card__description {
144
+ color: ${({theme:t})=>t.palette.text.primary};
145
+ a {
146
+ color: ${({theme:t})=>t.palette.primary.main};
147
+ }
148
+ }
149
+
150
+ .card__image__wrap {
151
+ padding-top: 61.8%;
152
+ width: 100%;
153
+ position: relative;
154
+ }
155
+ .card__image {
156
+ position: absolute;
157
+ top: 0;
158
+ left: 0;
159
+ bottom: 0;
160
+ right: 0;
161
+ width: 100%;
162
+ height: 100%;
163
+ object-position: top center;
164
+ }
165
+ `,xt="section";function pt({title:t,image:e,imageMeta:i,description:n,actions:r,align:a,listType:d="",className:s="",...l}){return o.jsxs(Ve,{className:_.cx("card",`list-type-${d}`,s),align:a,...l,children:[e&&o.jsx(z,{icon:e,color:"primary.main",size:d==="icon-title"?"1.2rem":"3rem",imageMeta:i}),t||n?o.jsx(V,{align:a,title:t,description:n}):null,r!=null&&r.length?o.jsx(E,{align:a,actions:r,className:"mt-4"}):null]})}const Ve=$.styled(H)`
166
+ padding: 5vw 4vw;
167
+ box-sizing: border-box;
168
+ /* min-height: 320px; */
169
+ color: inherit !important;
170
+ border-radius: 0.5rem;
171
+ /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
172
+ @media (max-width: ${({theme:t})=>t.breakpoints.values[xt]}px) {
173
+ padding: 1.5rem 2rem;
174
+ }
175
+ @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
176
+ height: auto;
177
+ min-height: unset;
178
+ }
179
+
180
+ ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
181
+ &:hover {
182
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
183
+ }`:""}
184
+
185
+ .card__title {
186
+ font-weight: 700;
187
+ margin-top: 24px;
188
+ margin-bottom: 12px;
189
+ color: ${({theme:t})=>t.palette.text.primary};
190
+ a {
191
+ color: ${({theme:t})=>t.palette.primary.main};
192
+ }
193
+ }
194
+ .card__description {
195
+ color: ${({theme:t})=>t.palette.text.primary};
196
+ a {
197
+ color: ${({theme:t})=>t.palette.primary.main};
198
+ }
199
+ }
200
+ .card__body {
201
+ color: ${({theme:t})=>t.palette.text.primary};
202
+ padding: 0;
203
+ ${({align:t})=>`text-align:${t||"left"};`}
204
+ }
205
+
206
+ &.list-type-icon-title {
207
+ padding: 1.2rem;
208
+ .title-line {
209
+ display: flex;
210
+ }
211
+ .card__title {
212
+ margin: 0;
213
+ font-size: 1em;
214
+ }
215
+ .css-icon {
216
+ margin-right: 0.5rem;
217
+ }
218
+ }
219
+
220
+ @media (min-width: ${({theme:t})=>t.breakpoints.values[xt]}px) {
221
+ padding: 2rem 2rem;
222
+ text-align: left;
223
+ box-sizing: border-box;
224
+ }
225
+ `;function De({image:t,title:e,description:i,imageProps:n={},imageMeta:r,imageSize:a,titleProps:d={},descriptionProps:s={},actions:l,align:c,...x}){const u=it(t),h=k.autoResizeImage(k.getImageAbsoluteUrl(t),540);return o.jsxs(Ye,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(z,{icon:t,color:"primary.main"})}):h&&o.jsx(m.Box,{component:"img",className:"card__image",src:h,...n,alt:n.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:a||"contain",objectPosition:"center"},loading:"lazy"})}),children:[e||i?o.jsx(V,{align:c,title:e,titleProps:d,description:i,descriptionProps:s}):null,l!=null&&l.length?o.jsx(E,{align:c,actions:l,className:"mt-4"}):null]})}const Ye=$.styled(H)`
226
+ ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
227
+ &:hover {
228
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
229
+ }`:""}
230
+
231
+ border-radius: 0 !important;
232
+
233
+ .card__body {
234
+ ${({align:t})=>`text-align:${t||"left"};`}
235
+ }
236
+
237
+ .card__image__wrap {
238
+ width: 100%;
239
+ height: 100%;
240
+ position: relative;
241
+ display: flex;
242
+ justify-content: center;
243
+ align-items: center;
244
+ }
245
+
246
+ .card__image {
247
+ max-height: 60px;
248
+ }
249
+ `,ht="section";function Je({title:t,image:e,imageMeta:i,iconSize:n=100,description:r,actions:a,align:d,className:s="",...l}){return o.jsx(Ge,{className:_.cx("card",s),...l,children:o.jsxs(m.Box,{className:"flex items-center",children:[e&&o.jsx(z,{icon:e,color:"primary.main",size:n,imageMeta:i}),o.jsxs(m.Box,{className:"flex-1 ml-4",children:[o.jsx(V,{align:d,title:t,description:r}),o.jsx(E,{align:d,actions:a,className:"mt-4"})]})]})})}const Ge=$.styled(H)`
250
+ padding: 5vw 4vw;
251
+ text-align: left;
252
+ box-sizing: border-box;
253
+ /* min-height: 320px; */
254
+ color: inherit !important;
255
+ border-radius: 0.5rem;
256
+ /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
257
+ @media (max-width: ${({theme:t})=>t.breakpoints.values[ht]}px) {
258
+ padding: 1.5rem 2rem;
259
+ }
260
+ @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
261
+ height: auto;
262
+ min-height: unset;
263
+ }
264
+
265
+ ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
266
+ &:hover {
267
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
268
+ }`:""}
269
+
270
+ .card__title {
271
+ font-weight: 700;
272
+ margin-bottom: 12px;
273
+ color: ${({theme:t})=>t.palette.text.primary};
274
+ a {
275
+ color: ${({theme:t})=>t.palette.primary.main};
276
+ }
277
+ }
278
+ .card__description {
279
+ color: ${({theme:t})=>t.palette.text.primary};
280
+ a {
281
+ color: ${({theme:t})=>t.palette.primary.main};
282
+ }
283
+ }
284
+ .card__body {
285
+ padding: 0;
286
+ }
287
+
288
+ &.list-type-icon-title {
289
+ padding: 1.2rem;
290
+ .title-line {
291
+ display: flex;
292
+ }
293
+ .card__title {
294
+ margin: 0;
295
+ font-size: 1em;
296
+ }
297
+ .css-icon {
298
+ margin-right: 0.5rem;
299
+ }
300
+ }
301
+
302
+ @media (min-width: ${({theme:t})=>t.breakpoints.values[ht]}px) {
303
+ padding: 2rem 2rem;
304
+ text-align: left;
305
+ box-sizing: border-box;
306
+ }
307
+ `;function Ke({title:t,titleProps:e={},description:i,descriptionProps:n={},image:r,imageMeta:a,className:d="",align:s,hoverStyle:l,...c}){return o.jsxs(Xe,{className:_.cx("card-simple",d,`hover-style__${l}`),align:s,...c,children:[r&&o.jsx(z,{icon:r,color:"primary.main",imageMeta:a}),t||i?o.jsx(V,{align:s,title:t,titleProps:e,description:i,descriptionProps:n}):null]})}const Xe=$.styled(H)`
308
+ .card__title {
309
+ color: ${({theme:t})=>t.palette.text.primary};
310
+ a {
311
+ color: ${({theme:t})=>t.palette.primary.main};
312
+ }
313
+ }
314
+ .card__description {
315
+ color: ${({theme:t})=>t.palette.text.primary};
316
+ a {
317
+ color: ${({theme:t})=>t.palette.primary.main};
318
+ }
319
+ }
320
+
321
+ &.hover-style__default {
322
+ &.card-simple {
323
+ &:hover {
324
+ border-top-right-radius: 36px;
325
+ }
326
+ }
327
+ .card__body {
328
+ &:hover {
329
+ &::before {
330
+ width: 42px;
331
+ height: 42px;
332
+ transform: translate(50%, -50%) rotate(45deg);
333
+ }
334
+ &::after {
335
+ transform: none;
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ &.card-simple {
342
+ border-radius: 8px;
343
+ border-top-right-radius: 26px;
344
+
345
+ .card__body {
346
+ ${({align:t})=>`text-align:${t||"left"};`}
347
+ }
348
+
349
+ ${t=>t.link?`
350
+ cursor: pointer;
351
+ `:""}
352
+ /* cursor: pointer; */
353
+ /* &:hover {
354
+ border-top-right-radius: 36px;
355
+ } */
356
+ transition: all 180ms ease 0s;
357
+ overflow: visible;
358
+ .card__title {
359
+ margin: 12px 0;
360
+ }
361
+ .card__body {
362
+ position: relative;
363
+ padding: 20px 16px 18px;
364
+ overflow: hidden;
365
+ transition: all 180ms ease 0s;
366
+ /* &:hover {
367
+ &::before {
368
+ width: 42px;
369
+ height: 42px;
370
+ transform: translate(50%, -50%) rotate(45deg);
371
+ }
372
+ &::after {
373
+ transform: none;
374
+ }
375
+ } */
376
+ &::before,
377
+ &::after {
378
+ content: ${({border:t})=>t?'""':""};
379
+ transition: inherit;
380
+ position: absolute;
381
+ top: 0px;
382
+ right: 0px;
383
+ }
384
+ &::before {
385
+ z-index: 3;
386
+ background: #fff;
387
+ width: 30px;
388
+ height: 30px;
389
+ transform: translate(50%, -50%) rotate(45deg);
390
+ box-shadow: 0 1px 0 0 #e9eaec;
391
+ }
392
+ &::after {
393
+ z-index: 2;
394
+ width: 28px;
395
+ height: 28px;
396
+ border-bottom-left-radius: 6px;
397
+ background: #fcfcfd;
398
+ box-shadow: -1px 1px 0 0 #e9eaec;
399
+ transform: translate(8px, -8px);
400
+ }
401
+ }
402
+ }
403
+ `;function Qe({type:t="default",...e}){const n={article:Fe,simple:Ke,news:Je,default:pt,wall:De}[t]||pt;return o.jsx(n,{...t==="news"?e:R.default(e,"iconSize")})}function Ze({list:t=[],align:e="top",cards:i,listBorder:n=!0,listType:r="",col:a=3,gap:d,iconColor:s,className:l="",type:c="default",dark:x=!1,textAlign:u="left",hoverStyle:h,...p}){return o.jsx(nt,{type:c,className:_.cx("card-list py-1",l,"items-stretch"),col:a,gap:d,align:e,...p,children:i||t.map(y=>o.jsx(Qe,{borderColor:n,iconColor:s,type:c,listType:r,dark:x,...y,align:u,style:d===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},y.id))})}const to=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],eo=$.styled(M)`
404
+ a .card {
405
+ color: #404040;
406
+ cursor: pointer;
407
+ }
408
+ a:not(.MuiButton-root) {
409
+ color: ${({theme:t})=>t.palette.primary.main};
410
+ &:hover,
411
+ &:active {
412
+ color: ${({theme:t})=>t.palette.primary.main};
413
+ }
414
+ }
415
+ a:hover .card {
416
+ color: #404040;
417
+ }
418
+ `;function oo({className:t,...e}){const[i,n]=S(e,U),[r,a]=S(n,to);return o.jsxs(eo,{className:_.cx("section--card-list",t),type:e.type,...a,children:[Object.keys(i).length>0&&o.jsx(O,{center:!0,...i,className:"mb-[2.5vw]"}),o.jsx(Ze,{...r,dark:!!e.dark})]})}const no=$.styled(oo)`
419
+ .card__description {
420
+ white-space: pre-wrap;
421
+ }
422
+ .section__description {
423
+ }
424
+ .card {
425
+ /* background: inherit !important; */
426
+ }
427
+ &.dark .card-simple .card__body::before {
428
+ background: #212121 !important;
429
+ }
430
+ .card-simple .card__body::after {
431
+ background: inherit !important;
432
+ }
433
+ `;function ro({section:t,...e}){const[{editing:i},n]=S(e,F),r=b.useMemo(()=>{var a;return{...R.default(n,["listBorder","list","iconSize","imageSize"]),list:(a=n.list)==null?void 0:a.map(d=>{var s,l;return{...R.default(d,"icon","iconColor"),image:["news","simple","default"].includes(n.type)&&d.icon?d.icon:d.image,actions:(l=(s=d.actions)==null?void 0:s.map)==null?void 0:l.call(s,c=>o.jsx(st,{...c,editing:i},c.id)),border:n.listBorder,iconSize:n.iconSize,imageSize:n.imageSize,hoverStyle:n.hoverStyle}})}},[n]);return o.jsx(no,{style:i?{pointerEvents:"none"}:{},...r})}function io({properties:t,section:e,locale:i,dev:n}){var r;return(r=e==null?void 0:e.config)!=null&&r.componentId?o.jsx(et.CustomComponentRenderer,{instanceId:e.id,componentId:e.config.componentId,blockletId:e.config.blockletId,blockletTitle:e.config.blockletTitle,componentName:e.config.componentName,locale:i,properties:t,dev:n}):o.jsx(m.Box,{textAlign:"center",py:2,children:o.jsx(m.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function so({src:t,dataId:e,isEdit:i=!1,height:n="100%",onLoad:r=()=>{}}){return o.jsx(ee.EmbedIframe,{isEdit:i,embedId:e,src:t,height:n,onLoad:()=>{r()}})}function ao({dataId:t,src:e,actions:i,center:n,onLoad:r,...a}){const[d,s]=S(a,U);return o.jsxs(M,{...s,children:[Object.keys(d).length>0&&o.jsx(O,{center:n,...d}),o.jsx(so,{dataId:t,src:e,onLoad:r,height:a.iframeHeight?`${a.iframeHeight}px`:"100%"}),o.jsx(E,{actions:i,center:n})]})}const lo={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function co({section:t,id:e,src:i,...n}){const r=`${e}-${n.locale}`,[{editing:a},d]=S(n,F),s=b.useRef({}),l=JSON.parse(JSON.stringify(d)),{message:c}=Qt.useMessage(r,"server"),x=Zt.useLatest(JSON.parse(JSON.stringify(d.config)||"{}"));return b.useEffect(()=>{c&&c.onInit(()=>x.current)},[c]),b.useEffect(()=>{const u=JSON.parse(JSON.stringify(d.config)||"{}");de.default(s.current,u)||(s.current=u,c==null||c.send("config-set",u))},[c,d.config]),i?o.jsx(ao,{...l,dataId:r,src:i,style:a?{pointerEvents:"none"}:{}}):o.jsx(uo,{children:'Please set the "src" attribute for this block'})}const uo=$.styled("div")`
434
+ user-select: none;
435
+ color: #999;
436
+ padding: 8px;
437
+ height: 200px;
438
+ `,mo=12,xo=({gridSettings:t,section:e,index:i,columns:n,simulateMode:r="desktop",isBackground:a})=>{const d=(t==null?void 0:t[r])??{},s=d[e.id],l=po(d);return{i:e.id,static:(e==null?void 0:e.locked)||a,...a?{x:0,y:0,w:n,h:1,isResizable:!1}:{x:(s==null?void 0:s.x)??0,y:(s==null?void 0:s.y)??i,w:(s==null?void 0:s.w)??n,h:(s==null?void 0:s.h)??1,isResizable:!0},minH:1,maxH:1,maxY:l}},po=t=>Object.values(t).reduce((e,i)=>Math.max(e,i.y||0),0)||0,ho=t=>{const{dev:e,id:i,section:n,onBlockRender:r}=t,a=e==null?void 0:e.mode,d=m.useMediaQuery(g=>g.breakpoints.down("sm")),{t:s}=oe.useLocaleContext(),{sections:l,sectionIds:c,config:x}=n,{columns:u=mo,gridSettings:h}=x||{},p=b.useCallback((g,j=!1,B=0)=>{var at;if(!r||!g||!g.component||g.visibility==="hidden")return null;const v=xo({gridSettings:h,section:g,index:B,columns:u,simulateMode:d?"mobile":"desktop",isBackground:j}),N=(v==null?void 0:v.x)??0,I=(v==null?void 0:v.y)??0,T=(v==null?void 0:v.w)??u,P=(v==null?void 0:v.h)??1,D=(v==null?void 0:v.maxY)??0,Y=!!((at=n==null?void 0:n.config)!=null&&at.backgroundSectionId);return o.jsx(m.Box,{className:j?"layout-block-background":"layout-block-section",sx:{...j?{gridColumn:"1 / -1",gridRow:`1 / ${D+1}`,zIndex:0,width:"100%",height:"100%","& .BlockBase-root":{width:"100%",height:"100%"}}:{position:"relative",gridColumn:`${N+1} / span ${T}`,gridRow:`${I+(Y?0:1)} / span ${P}`,zIndex:1}},children:r({id:g.id,type:g.component,config:{},section:{...g},mode:a})},g.id)},[i,a,r,h,u,d]),{backgroundElements:y,contentElements:f}=b.useMemo(()=>{if(!c||!c.length||!l||!Object.keys(l).length)return{backgroundElements:[],contentElements:[]};const g=[],j=[];return c==null||c.forEach((B,v)=>{var P;const N=l[B];if(!N)return;const I=((P=n==null?void 0:n.config)==null?void 0:P.backgroundSectionId)===B,T=p(N,I,v);T&&(I?g.push(T):j.push(T))}),{backgroundElements:g,contentElements:j}},[p,l,c]);return a==="draft"&&!(y!=null&&y.length)&&!(f!=null&&f.length)?o.jsxs(m.Box,{sx:{gridColumn:"1 / -1",gridRow:"1",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,border:g=>`2px dashed ${g.palette.divider}`,borderRadius:2,padding:4,color:"text.secondary",textAlign:"center",minHeight:"160px"},children:[o.jsx(m.Box,{sx:{fontSize:"48px",opacity:.5},children:"📐"}),o.jsx(m.Box,{sx:{fontSize:"16px",fontWeight:500,marginBottom:1},children:"Section Layout"}),o.jsx(m.Box,{sx:{opacity:.7,whiteSpace:"pre-line"},children:s("maker.layoutBlock.draftPlaceholder")}),o.jsx(m.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:.1,background:g=>`
439
+ repeating-linear-gradient(
440
+ 90deg,
441
+ transparent,
442
+ transparent calc(100% / ${u} - 1px),
443
+ ${g.palette.grey[400]} calc(100% / ${u} - 1px),
444
+ ${g.palette.grey[400]} calc(100% / ${u})
445
+ )
446
+ `}})]}):o.jsxs(m.Box,{sx:{position:"relative",display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,alignItems:"center",width:"100%",height:"100%"},children:[y,f]})},fo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function go(t){var e;if(/youtu\.?be/.test(t))for(const i of fo){const n=(e=i.exec(t))==null?void 0:e[1];if(n)return n}}function yo(t){const e=go(t);if(e)return`https://youtube.com/embed/${e}`}function bo({src:t}){return b.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function wo(t){return o.jsx(m.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(ne.TwitterTimelineEmbed,{...t})})}function jo({url:t}){const e=b.useRef(null),i=495,[n,r]=b.useState(e.current?e.current.offsetWidth*.5625:i),a=b.useCallback(()=>{const d=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,s=e.current?e.current.offsetWidth*.5625:i;return r(Math.floor(s*d))},[]);return b.useEffect(()=>{window.addEventListener("resize",a);const d=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,s=e.current?e.current.offsetWidth*.5625:i;return r(Math.floor(s*d)),function(){window.removeEventListener("resize",a)}},[n,a]),o.jsx(m.Box,{component:"iframe",ref:e,title:"youtube",width:"100%",height:`${n}px`,src:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{display:"block"}})}const _o={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},vo=$.styled(Re)`
447
+ .section__description {
448
+ }
449
+ `;function ko({hasImage:t,fullSizeImage:e,boxed:i,videoPoster:n,imageMeta:r,imageOptimization:a,imageSize:d,section:s,...l}){var p,y;const[{editing:c},x]=S({...l,boxed:e?void 0:i},F);let u=$o(x.image,n,e,r,a,d);t||(u=null);let h=null;return x.actions&&(h=(y=(p=x.actions)==null?void 0:p.map)==null?void 0:y.call(p,(f,w)=>o.jsx(st,{...f,editing:c},w))),o.jsx(vo,{...x,style:c?{pointerEvents:"none"}:{},image:u,fullSizeImage:t&&e,actions:h})}function $o(t,e,i,n,r,a){if(t){if(t.endsWith(".json"))return o.jsx(bo,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(wo,{sourceType:"url",url:t});const d=yo(t);if(d)return o.jsx(jo,{url:d});const{naturalWidth:s,naturalHeight:l,filename:c}=n||{};if(L(t))return o.jsx("video",{width:s&&`${s}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:a||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:k.autoResizeImage(k.getImageAbsoluteUrl(e),i?1200:540,r),children:o.jsx("source",{src:k.getImageAbsoluteUrl(t),type:Be(t)})},t);const x=r==="quality"?1:.6;return o.jsx(et.ResponsiveImage,{src:k.getImageAbsoluteUrl(t),sizesAttr:{sm:600*x,md:450*x,lg:540*x,...i&&{md:900*x,lg:1200*x}},width:s&&`${s}px`,height:l&&`${l}px`,alt:c??t,style:{objectFit:a||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const Bo=["production","draft"];function Co({mode:t,version:e}={}){const i=e&&typeof e=="number"?{mode:t,version:e}:{mode:t};return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages`,{params:i}).then(n=>n.data)}function So({mode:t,routes:e}){return k.api.post(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,routes:e}).then(i=>i.data)}function No({locale:t,sort:e,page:i,limit:n,mode:r}={}){return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:t,sort:e,page:i,limit:n,mode:r}}).then(a=>a.data)}const Io={style:"list",sort:"-updatedAt"},ft=20;function Ro({style:t,sort:e,section:i,...n}){const[{editing:r,locale:a},d]=S(n,F),[s,l]=S(d,U),[c,x]=b.useState(),u=b.useRef(!1),h=dt.useUpdate(),p=ot.useNavigate(),y=b.useCallback(async()=>{if(!u.current){u.current=!0,h();try{const f=c?Math.floor(c.list.length/ft)+1:1,{list:w,total:g}=await No({locale:a,sort:e,page:f,limit:ft});x(j=>({list:((j==null?void 0:j.list)??[]).concat(w),total:g}))}finally{u.current=!1,h()}}},[c,a,e,h]);return dt.useMount(()=>{y()}),o.jsxs(M,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(s).length>0&&o.jsx(O,{...s}),c?o.jsxs(o.Fragment,{children:[o.jsx(m.Grid,{container:!0,spacing:2,justifyContent:"center",children:c==null?void 0:c.list.map(f=>o.jsx(m.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs(To,{elevation:0,className:_.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>p(f.slug),children:[!!f.image&&o.jsx(m.CardMedia,{component:"img",alt:"",image:k.autoResizeImage(k.getImageAbsoluteUrl(f.image),540),loading:"lazy"}),o.jsxs(m.CardContent,{children:[o.jsx(m.Typography,{variant:"h6",component:"div",className:gt,children:f.title||f.id}),o.jsx(m.Typography,{variant:"body2",className:gt,children:f.description})]})]})},f.id))}),o.jsx(m.Box,{textAlign:"center",mt:2,children:c.total>c.list.length?o.jsx(A,{variant:"outlined",color:"secondary",onClick:y,loading:u.current,children:"More"}):o.jsx(A,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(m.Box,{p:2,textAlign:"center",children:o.jsx(m.CircularProgress,{size:24})})]})}const gt=_.css`
450
+ display: -webkit-box;
451
+ -webkit-box-orient: vertical;
452
+ -webkit-line-clamp: 2;
453
+ overflow: hidden;
454
+ text-overflow: ellipsis;
455
+ `,To=$.styled(m.Card)`
456
+ border: 1px solid #e0e0e0;
457
+ background-color: transparent;
458
+ cursor: pointer;
459
+ display: flex;
460
+ color: inherit;
461
+
462
+ > .MuiCardMedia-root {
463
+ width: 30vw;
464
+ max-height: 50vw;
465
+ }
466
+
467
+ &.style-card {
468
+ display: block;
469
+
470
+ > .MuiCardMedia-root {
471
+ width: 100%;
472
+ max-height: 50vw;
473
+ }
474
+ }
475
+ `,Wo={iframe:co,section:ko,"section-card-list":ro,toc:Ro,"ai-runtime":ze,"custom-component":io,"layout-block":ho};function Nt({id:t,type:e,mode:i,config:n,section:r,ignorePageMetaStyle:a,page:d,...s}){const l=Wo[e],{getPageMetaStyle:c}=we(),x=b.useMemo(()=>{const{height:p,...y}=n;return e==="layout-block"&&(y.onBlockRender=f=>{var N,I,T,P,D,Y;const w={...n==null?void 0:n.dev,...(N=f==null?void 0:f.config)==null?void 0:N.dev},{defaultLocale:g}=w,j={...X.default(n,["locale","editing"]),...f==null?void 0:f.config,dev:w},{locale:B}=j;let v=(T=(I=d==null?void 0:d.dataSource)==null?void 0:I[f==null?void 0:f.id])==null?void 0:T[B];return re.default(v)&&(v=(D=(P=d==null?void 0:d.dataSource)==null?void 0:P[f==null?void 0:f.id])==null?void 0:D[g??"en"]),o.jsx(Nt,{...f,config:{...(Y=f==null?void 0:f.section)==null?void 0:Y.properties,...v,...j},page:d,ignorePageMetaStyle:!0})}),y},[n,e]),u=b.useMemo(()=>{const p={};return e!=="custom-component"&&(p.height=n.height),p.sx=a?void 0:c("sx"),p.id=`BlockBase-${t}`,p},[n.height,a,e,c]),h=l&&o.jsx(l,{mode:i,...x,id:t,section:r});return h?o.jsx(Te,{...s,...u,children:h}):o.jsx(zo,{type:e})}function zo({type:t}){return o.jsx(m.Box,{p:2,children:o.jsxs(m.Alert,{icon:o.jsx(qt.ErrorOutline,{}),color:"error",children:["Unsupported Block `",t,"`"]})})}function Po(t){return t!=null}exports.Action=st;exports.BlockRenderer=Nt;exports.IFrameBlockDefaultProps=lo;exports.Icon=rt;exports.PageProvider=je;exports.Provider=Pe;exports.STATE_MODES=Bo;exports.SectionBlockDefaultProps=_o;exports.TocDefaultProps=Io;exports.getPages=Co;exports.nonNullable=Po;exports.publishPages=So;
@@ -1 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),s=require("@blocklet/pages-kit/builtin/uploader"),h=require("@iconify-icon/react"),n=require("@mui/material"),l=require("react"),q=require("react-use"),I=require("./state-jCG5gSUJ.js"),v=l.forwardRef(function({showMarkdown:S,markdown:j,onMarkdownChange:o,showUploader:p,value:c,meta:A,onChange:a,...u},z){const[t,m]=l.useState("");l.useEffect(()=>{m(c||"")},[c,m]);const f=async()=>{if(t!==c){const e=I.getImageAbsoluteUrl(t);if(!e){a(t,void 0);return}const r=await s.getImageSize(e).catch(()=>s.getVideoSize(e)).catch(()=>{});a(t,{...r,filename:t})}};q.useDebounce(()=>{t!==c&&a(t)},300,[t]),l.useImperativeHandle(z,()=>({submit:f}));const g={};return p&&(g.InputProps={sx:{pr:0},endAdornment:i.jsx(n.InputAdornment,{position:"end",sx:{mx:.5},children:i.jsx(s.UploaderButton,{onChange:async({response:e})=>{var b;const r=(b=e==null?void 0:e.data)==null?void 0:b.filename,d=I.getImageAbsoluteUrl(r)||"";let x={};d&&(x=await s.getImageSize(d).catch(()=>s.getVideoSize(d)).catch(()=>{})),a(r,{...x,filename:r})}})})}),i.jsx(n.TextField,{size:"small",fullWidth:!0,...u,label:i.jsxs(n.Stack,{direction:"row",spacing:1,alignItems:"center",children:[u.label,S&&i.jsxs(i.Fragment,{children:[" (",i.jsx(n.FormControlLabel,{checked:j,label:i.jsx(n.Box,{component:h.Icon,icon:"tabler:markdown",sx:{verticalAlign:"middle"}}),labelPlacement:"start",control:i.jsx(n.Switch,{size:"small"}),sx:{ml:.25,pr:1},onChange:(e,r)=>o==null?void 0:o(r)}),")"]})]}),InputLabelProps:{shrink:!0,...u.InputLabelProps},value:t,onChange:e=>m(e.target.value),...g,onKeyDown:e=>{e.keyCode!==229&&e.key==="Enter"&&f()}})});exports.ConfigString=v;
1
+ "use strict";const i=require("react/jsx-runtime"),s=require("@blocklet/pages-kit/builtin/uploader"),h=require("@iconify-icon/react"),n=require("@mui/material"),l=require("react"),q=require("react-use"),I=require("./state-DoGBMTzI.js"),v=l.forwardRef(function({showMarkdown:S,markdown:j,onMarkdownChange:o,showUploader:p,value:c,meta:A,onChange:a,...u},z){const[t,m]=l.useState("");l.useEffect(()=>{m(c||"")},[c,m]);const f=async()=>{if(t!==c){const e=I.getImageAbsoluteUrl(t);if(!e){a(t,void 0);return}const r=await s.getImageSize(e).catch(()=>s.getVideoSize(e)).catch(()=>{});a(t,{...r,filename:t})}};q.useDebounce(()=>{t!==c&&a(t)},300,[t]),l.useImperativeHandle(z,()=>({submit:f}));const g={};return p&&(g.InputProps={sx:{pr:0},endAdornment:i.jsx(n.InputAdornment,{position:"end",sx:{mx:.5},children:i.jsx(s.UploaderButton,{onChange:async({response:e})=>{var b;const r=(b=e==null?void 0:e.data)==null?void 0:b.filename,d=I.getImageAbsoluteUrl(r)||"";let x={};d&&(x=await s.getImageSize(d).catch(()=>s.getVideoSize(d)).catch(()=>{})),a(r,{...x,filename:r})}})})}),i.jsx(n.TextField,{size:"small",fullWidth:!0,...u,label:i.jsxs(n.Stack,{direction:"row",spacing:1,alignItems:"center",children:[u.label,S&&i.jsxs(i.Fragment,{children:[" (",i.jsx(n.FormControlLabel,{checked:j,label:i.jsx(n.Box,{component:h.Icon,icon:"tabler:markdown",sx:{verticalAlign:"middle"}}),labelPlacement:"start",control:i.jsx(n.Switch,{size:"small"}),sx:{ml:.25,pr:1},onChange:(e,r)=>o==null?void 0:o(r)}),")"]})]}),InputLabelProps:{shrink:!0,...u.InputLabelProps},value:t,onChange:e=>m(e.target.value),...g,onKeyDown:e=>{e.keyCode!==229&&e.key==="Enter"&&f()}})});exports.ConfigString=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./state-jCG5gSUJ.js");function n({children:e}){const r=t.useProjectId();return s.jsx(t.StoreProvider,{url:t.getWssURL(r??""),name:"root",waitingSynced:!0,children:s.jsx(o,{children:e})})}function o({children:e}){const{state:r}=t.useStore();return e({state:r})}exports.default=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./state-DoGBMTzI.js");function n({children:e}){const r=t.useProjectId();return s.jsx(t.StoreProvider,{url:t.getWssURL(r??""),name:"root",waitingSynced:!0,children:s.jsx(o,{children:e})})}function o({children:e}){const{state:r}=t.useStore();return e({state:r})}exports.default=n;
@@ -0,0 +1,38 @@
1
+ "use strict";const e=require("react/jsx-runtime"),k=require("./state-DoGBMTzI.js"),Z=require("@arcblock/ux/lib/Locale/context"),de=require("@arcblock/ux/lib/Result"),pe=require("@blocklet/pages-kit/builtin/page/header"),ge=require("@blocklet/pages-kit/contexts/color"),ee=require("@blocklet/pages-kit/utils/data-source"),me=require("@blocklet/pages-kit/utils/route"),fe=require("@blocklet/ui-react/lib/Header"),te=require("@emotion/css"),V=require("@emotion/react"),he=require("@emotion/styled"),y=require("@mui/material"),$=require("ahooks"),xe=require("isomorphic-dompurify"),je=require("lodash/cloneDeep"),be=require("lodash/isEmpty"),ye=require("lodash/isEqual"),f=require("react"),ve=require("react-helmet"),w=require("react-router-dom"),ne=require("react-use"),C=require("ufo"),E=require("./array-DxhrK2d5.js"),K=require("@arcblock/ux/lib/Theme"),Pe=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const J=require("./session-BA7Qrcia.js"),q=t=>t&&t.__esModule?t:{default:t},oe=q(de),we=q(fe),re=q(he),Re=q(xe),z=q(je),Se=q(be),se=q(ye),ke=q(Pe),qe=K.styled(ke.default,{shouldForwardProp:t=>!!t})`
2
+ & > div > .MuiContainer-root {
3
+ max-width: unset;
4
+ }
5
+ `;function _e({meta:t,...o}){const s=K.useTheme();return e.jsx(qe,{...o,meta:t,theme:s||{}})}function ae(t){return e.jsx(y.Box,{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center",...t,children:e.jsx(y.CircularProgress,{size:30})})}function Ce(t){return e.jsx(Ee,{...t})}const Ee=K.styled(y.Box)`
6
+ position: fixed;
7
+ left: 0;
8
+ top: 0;
9
+ z-index: 999999999999;
10
+ width: 80px;
11
+ font-size: 12px;
12
+ text-align: center;
13
+ opacity: 0.7;
14
+ transform: translateX(-23%) translateY(70%) rotate(-45deg);
15
+ pointer-events: none;
16
+ `,Me=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
17
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function Ie({titleFontFamily:t,descriptionFontFamily:o}){var n;const s=y.useTheme(),a=(n=s==null?void 0:s.typography)==null?void 0:n.fontFamily;f.useEffect(()=>{},[t,o]);const i=`${a}, ${Me}`;return e.jsx(V.Global,{styles:V.css`
18
+ #app {
19
+ font-family: ${i};
20
+
21
+ .page-kit-section__title {
22
+ font-family: ${i};
23
+ }
24
+
25
+ .page-kit-section__description {
26
+ font-family: ${i};
27
+ }
28
+ }
29
+ `})}function Be(){const[t]=w.useSearchParams(),{session:o}=J.useSessionContext(),s=J.useIsRoleOrMultiTenant("owner","admin","pagesEditor","member"),a=f.useMemo(()=>{const n=t.get("mode");return E.STATE_MODES.includes(n)?n:"production"},[t]),i=a==="production"?a:o.user?s?a:"production":null;return i?e.jsx(ie,{mode:i}):null}function ie({mode:t}){if(t!=="draft"){const o=window.__PAGE_STATE__;return o?e.jsx(N,{mode:t,state:o}):e.jsx(Le,{mode:t,children:({state:s})=>e.jsx(N,{mode:t,state:s})})}return e.jsx(Te,{children:({state:o})=>e.jsx(N,{mode:t,state:o})})}const Te=f.lazy(()=>Promise.resolve().then(()=>require("./draft-data-DzN2u_NT.js")));function Le({mode:t,children:o}){const s=document.querySelector('meta[property="pages:version"]'),a=s==null?void 0:s.content,i=k.useProjectId(),n=f.useMemo(()=>{if(a==="{{pagesPublishedAt}}"){const u=localStorage.getItem(k.getProjectPageVersionKey(i??""));return Number(u)?Number(u):new Date().getTime()}return Number(a)},[a]),{loading:p,value:c}=ne.useAsync(()=>E.getPages({mode:t,version:n}),[t,n]);return p?e.jsx(ae,{}):c?o({state:c}):null}function N({mode:t,state:o}){const{t:s,locale:a}=Z.useLocaleContext(),[i]=w.useSearchParams(),n=k.useProjectId(),p=k.useProjectSlug(),c=i.get("hiddenBadge")==="true",u=i.get("showPublish")==="true",{pageIds:h,pages:d,routeIds:g,routes:x,supportedLocales:j,config:{defaultLocale:b},resources:M}=o,m=k.getAllComponents(o),R=f.useMemo(()=>j!=null&&j.some(l=>l.locale===a)?a:void 0,[a,j]),L=Object.values(x||{}).find(l=>(l==null?void 0:l.path)==="/")||Object.values(d).find(l=>(l==null?void 0:l.slug)==="/")?void 0:Object.values(d)[0],H=f.useMemo(()=>t==="production"?h.map(l=>{const r=d[l];return r&&{id:r.id,path:C.joinURL("/",p||n||"",r.slug)}}).filter(E.nonNullable):g.map(l=>{const r=x[l];return r?{id:r.id,path:C.joinURL("/",p||n||"",r.path,`?mode=${t}&showPublish=true`)}:null}).filter(E.nonNullable),[h,d,t,x,g,n,p]),_=([...l])=>(t!=="production"&&u&&l.unshift(e.jsx(f.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(Oe,{mode:"production",state:o})})),l);return e.jsxs(E.Provider,{value:{pages:H},children:[e.jsxs(w.Routes,{children:[L&&e.jsx(w.Route,{index:!0,element:e.jsx(w.Navigate,{to:C.joinURL("/",R||"",L.slug)})}),g==null?void 0:g.map(l=>{var P,v,S,A;const r=x==null?void 0:x[l];if(!r||!r.displayTemplateId)return null;const I=d[r.displayTemplateId];if(!I)return null;let B=[];if(r.params&&r.params.length>0){const T=me.generateParamCombinations({basePath:r.path,params:r.params,routeId:r.id,paramsOptions:r.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});B=T==null?void 0:T.map(D=>{var F,Q,X,Y;const O=D.paramOptionIds.join("-");return e.jsx(w.Route,{path:C.joinURL(":projectIdOrSlug?",D.path),element:e.jsx(W,{mode:t,components:m,page:I,locale:R,defaultLocale:b,headerAddons:_,state:o,pageData:(Y=(X=(Q=(F=r.dataSource)==null?void 0:F.pathDataMappings)==null?void 0:Q[O])==null?void 0:X.dataCache)==null?void 0:Y[R||b||"en"]})},O)})}return B.push(e.jsx(w.Route,{path:C.joinURL(":projectIdOrSlug?",r.path),element:e.jsx(W,{mode:t,components:m,page:I,locale:R,defaultLocale:b,headerAddons:_,state:o,pageData:(A=(S=(v=(P=r.dataSource)==null?void 0:P.pathDataMappings)==null?void 0:v[r.id])==null?void 0:S.dataCache)==null?void 0:A[R||b||"en"]})},r.id)),B}),h.map(l=>{const r=d[l];return r?e.jsx(w.Route,{path:C.joinURL(":projectIdOrSlug?",r.slug),element:e.jsx(U,{mode:t,components:m,page:r,locale:R,defaultLocale:b,headerAddons:_})},r.id):null}),M.pages&&Object.values(M.pages).map(({blockletId:l,page:r})=>e.jsx(w.Route,{path:C.joinURL("/",`@${l}`,r.slug),element:e.jsx(U,{mode:t,components:m,page:r,locale:R,defaultLocale:b,headerAddons:_})},r.id)),e.jsx(w.Route,{path:"*",element:e.jsx(y.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(oe.default,{status:404,extra:e.jsx(ue,{href:"/",children:s("common.back")}),sx:{bgcolor:"transparent",width:"100%",height:"100%"}})})})]}),t!=="production"&&!c&&e.jsx(Ce,{sx:{bgcolor:"info.light"},children:t}),e.jsx(Ie,{})]})}function W({mode:t,pageData:o,components:s,page:a,locale:i,defaultLocale:n,headerAddons:p,state:c}){const u=$.useReactive({page:null});f.useEffect(()=>{const d=a||null;d?u.page=z.default(d):u.page=null},[a,u]);const h=f.useRef();return f.useEffect(()=>{se.default(o,h.current)||o&&u.page&&(ee.setPageDataSource(u.page,c,i,o),h.current=z.default(o))},[u.page,o,i,c]),u.page?e.jsx(U,{mode:t,components:s,page:u.page,locale:i,defaultLocale:n,headerAddons:p}):null}function De({mode:t,state:o,path:s,pageData:a}){const{t:i,locale:n}=Z.useLocaleContext(),{pages:p,supportedLocales:c,config:{defaultLocale:u},resources:h}=o,d=Object.values(p).find(m=>(m==null?void 0:m.slug)===s),g=Object.values(h.pages||{}).find(m=>m.page.slug===s),x=f.useMemo(()=>c!=null&&c.some(m=>m.locale===n)?n:void 0,[n,c]),j=$.useReactive({page:null});f.useEffect(()=>{const m=d||(g==null?void 0:g.page)||null;m?j.page=z.default(m):j.page=null},[d,g]);const b=f.useRef();if(f.useEffect(()=>{se.default(a,b.current)||a&&j.page&&(ee.setPageDataSource(j.page,o,x,a),b.current=z.default(a))},[{}]),!d&&!(g!=null&&g.page))return e.jsx(y.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(oe.default,{style:{background:"inherit"},status:404,extra:e.jsx(ue,{href:"/",children:i("common.back")})})});const M=k.getAllComponents(o);return j.page?e.jsx(U,{mode:t,components:M,page:j.page,locale:x,defaultLocale:u}):null}function U({mode:t,components:o,page:s,locale:a,defaultLocale:i,headerAddons:n}){var R,G,L,H,_,l,r,I,B;const p=ge.useColorConvert(),c=((R=s.locales)==null?void 0:R[a])??((G=s.locales)==null?void 0:G[i])??{},u=c.title||((L=window.blocklet)==null?void 0:L.appName),h=c.description||((H=window.blocklet)==null?void 0:H.appDescription),d=k.autoResizeImage(k.getImageAbsoluteUrl(c.image),540),{logo:g,brand:x,description:j,...b}=pe.useHeaderState(),M=f.useMemo(()=>P=>{var S;let v=(n==null?void 0:n(P))??P;return v=((S=b.addons)==null?void 0:S.call(b,v))??v,v},[b.addons,n]),m=(_=c.header)!=null&&_.translucent?le:ce;return e.jsxs(E.PageProvider,{page:s,defaultLocale:i,currentLocale:a,children:[e.jsx(V.Global,{styles:V.css`
30
+ body {
31
+ background-color: ${p(!c.backgroundColor||c.backgroundColor==="transparent"?"background.default":c.backgroundColor)} !important;
32
+ }
33
+ `}),e.jsx(m,{hideNavMenu:!!((l=c.header)!=null&&l.hideNavMenus),translucentTextColor:(r=c.header)==null?void 0:r.translucentTextColor,...g?{logo:g}:{},...x?{brand:x}:{},...j?{description:j}:{},className:te.cx(((I=c.header)==null?void 0:I.sticky)&&"sticky","page-header"),maxWidth:!1,addons:M}),e.jsx(w.ScrollRestoration,{}),e.jsxs(ve.Helmet,{children:[e.jsx("title",{children:u}),e.jsx("meta",{name:"og:title",content:u}),e.jsx("meta",{name:"og:description",content:h}),e.jsx("meta",{name:"og:image",content:d}),e.jsx("meta",{name:"twitter:image:src",content:d}),e.jsx("meta",{name:"twitter:image",content:d}),e.jsx("meta",{property:"twitter:description",content:h}),e.jsx("meta",{property:"twitter:title",content:u}),e.jsx("meta",{name:"description",content:h})]}),e.jsx(y.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:s.sectionIds.map(P=>{var T,D,O,F;const v=s.sections[P];if(!v||v.visibility==="hidden")return null;const S=(D=(T=s.dataSource)==null?void 0:T[P])==null?void 0:D[a],A=((F=(O=s.dataSource)==null?void 0:O[P])==null?void 0:F[i])??{};return e.jsx(E.BlockRenderer,{id:P,type:v.component,mode:t,section:v,config:{...Se.default(S)?A:S,locale:a,dev:t==="draft"?{mode:t,components:o,defaultLocale:i}:{mode:t,defaultLocale:i}},page:s},P)})}),!((B=c.footer)!=null&&B.hidden)&&e.jsx(_e,{})]})}const Oe=f.lazy(()=>Promise.resolve().then(()=>require("./publish-button-D2jaaXXn.js"))),ce=re.default(we.default)`
34
+ &.sticky {
35
+ position: sticky;
36
+ top: 0;
37
+ }
38
+ `;function Fe({logo:t}){const[o,s]=f.useState(),a=y.useMediaQuery(n=>n.breakpoints.down("sm")),{value:i}=ne.useAsync(()=>{var c,u;const n=new URL(a?((c=window==null?void 0:window.blocklet)==null?void 0:c.appLogo)||"/.well-known/service/blocklet/logo":((u=window==null?void 0:window.blocklet)==null?void 0:u.appLogoRect)||"/.well-known/service/blocklet/logo-rect",window.location.origin);n.searchParams.delete("imageFilter"),n.searchParams.delete("f");const p=n.toString();return new Promise(h=>{fetch(p).then(d=>{const g=d.headers.get("content-type");g!=null&&g.includes("svg")&&d.text().then(x=>{s(x),h(null)}),h(d.url)})})},[a]);if(t)return t;if(o)return e.jsx(y.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:Re.default.sanitize(o)}});if(i){const n=new URL(i);n.searchParams.set("imageFilter","convert"),n.searchParams.set("f","png"),n.searchParams.set("h","80");const p=n.toString();return e.jsx("img",{src:p,alt:"logo"})}return null}function le({logo:t,translucentTextColor:o,...s}){const{top:a=0}=$.useScroll(()=>document.getElementById("app"))||{},i=y.useTheme();let n=Math.min(a/800,1),p="";return n>.1?(n=Math.max(n,.6),p=y.alpha(i.palette.text.primary,n)):p=o||"#EEEEEE",e.jsx(ce,{logo:e.jsx(Fe,{logo:t}),...s,className:te.cx(n<=.7&&"reverse-color"),style:{backgroundColor:y.alpha(i.palette.background.default,n),"--logo-invert":n<=.7?1-n/6:1-n},sx:{backdropFilter:n>=.6?"blur(10px)":"blur(0px)",transition:"all 0.3s ease",position:"fixed !important",left:0,top:0,right:0,bgcolor:"transparent","&.reverse-color":{".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${p} !important`}},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:"invert(var(--logo-invert))"},".header-logo":{color:p}}})}const ue=re.default(y.Button)``;exports.Home=Be;exports.HomeView=ie;exports.Loading=ae;exports.PageRoutes=N;exports.PageView=U;exports.PageViewByPath=De;exports.PageViewWithDataSource=W;exports.TranslucentHeader=le;