@blocklet/pages-kit-inner-components 0.5.55 → 0.6.0

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 (45) hide show
  1. package/lib/cjs/add-component.js +21 -23
  2. package/lib/cjs/chunks/{draft-data-CuZfaQ4s.js → draft-data-D44_IEV2.js} +1 -1
  3. package/lib/cjs/chunks/home-BYk01EUy.js +39 -0
  4. package/lib/cjs/chunks/index-BRgYwvuv.js +475 -0
  5. package/lib/cjs/chunks/publish-button-C8XPA4g_.js +1 -0
  6. package/lib/cjs/chunks/session-BRtsDvA-.js +1 -0
  7. package/lib/cjs/chunks/site-state-gSkcvhcV.js +57 -0
  8. package/lib/cjs/chunks/state-B6BF5wJ-.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/project-html.js +7 -7
  12. package/lib/cjs/resources.js +1 -1
  13. package/lib/cjs/setting.js +3 -3
  14. package/lib/cjs/site-state.js +1 -1
  15. package/lib/cjs/theme.js +1 -1
  16. package/lib/es/add-component.js +385 -2356
  17. package/lib/es/chunks/{draft-data-CWM--ooz.js → draft-data-CafrGKeh.js} +1 -1
  18. package/lib/es/chunks/home-DW8SdyfO.js +594 -0
  19. package/lib/es/chunks/index-D5gXPe_7.js +2326 -0
  20. package/lib/es/chunks/publish-button-XSZrDaTQ.js +498 -0
  21. package/lib/es/chunks/session-C72Dq8zg.js +19 -0
  22. package/lib/es/chunks/site-state-W2H7XCSQ.js +2077 -0
  23. package/lib/es/chunks/state-0gvZF3k2.js +573 -0
  24. package/lib/es/components.js +1 -1
  25. package/lib/es/home.js +5 -5
  26. package/lib/es/project-html.js +131 -141
  27. package/lib/es/resources.js +106 -107
  28. package/lib/es/setting.js +1772 -1489
  29. package/lib/es/site-state.js +1 -1
  30. package/lib/es/theme.js +50 -51
  31. package/package.json +46 -47
  32. package/lib/cjs/chunks/array-BqHuYyfx.js +0 -475
  33. package/lib/cjs/chunks/config-string-4bVR9Vc8.js +0 -1
  34. package/lib/cjs/chunks/home-BMjMYgq3.js +0 -38
  35. package/lib/cjs/chunks/publish-button-CGfGqrov.js +0 -1
  36. package/lib/cjs/chunks/session-BA7Qrcia.js +0 -1
  37. package/lib/cjs/chunks/site-state-BtZ8o3J2.js +0 -57
  38. package/lib/cjs/chunks/state-BVdbNJCA.js +0 -1
  39. package/lib/es/chunks/array-c6HYTLze.js +0 -2224
  40. package/lib/es/chunks/config-string-WMpFf-7V.js +0 -88
  41. package/lib/es/chunks/home-PDsc59QG.js +0 -566
  42. package/lib/es/chunks/publish-button-Ds7OBvxV.js +0 -462
  43. package/lib/es/chunks/session-CVblGhSp.js +0 -21
  44. package/lib/es/chunks/site-state-D-moj9fA.js +0 -2125
  45. package/lib/es/chunks/state-l--dTdHq.js +0 -603
@@ -1,475 +0,0 @@
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-BVdbNJCA.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 +0,0 @@
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-BVdbNJCA.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,38 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),S=require("./state-BVdbNJCA.js"),Z=require("@arcblock/ux/lib/Locale/context"),ue=require("@arcblock/ux/lib/Result"),de=require("@blocklet/pages-kit/builtin/page/header"),pe=require("@blocklet/pages-kit/contexts/color"),ee=require("@blocklet/pages-kit/utils/data-source"),ge=require("@blocklet/pages-kit/utils/route"),me=require("@blocklet/ui-react/lib/Header"),fe=require("@emotion/css"),z=require("@emotion/react"),he=require("@emotion/styled"),v=require("@mui/material"),W=require("ahooks"),xe=require("isomorphic-dompurify"),je=require("lodash/cloneDeep"),be=require("lodash/isEmpty"),ye=require("lodash/isEqual"),g=require("react"),ve=require("react-helmet"),w=require("react-router-dom"),te=require("react-use"),_=require("ufo"),M=require("./array-BqHuYyfx.js"),K=require("@arcblock/ux/lib/Theme"),Pe=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const X=require("./session-BA7Qrcia.js"),q=t=>t&&t.__esModule?t:{default:t},ne=q(ue),we=q(me),oe=q(he),ke=q(xe),V=q(je),Re=q(be),re=q(ye),Se=q(Pe),qe=K.styled(Se.default,{shouldForwardProp:t=>!!t})`
2
- & > div > .MuiContainer-root {
3
- max-width: unset;
4
- }
5
- `;function Ce({meta:t,...o}){const s=K.useTheme();return e.jsx(qe,{...o,meta:t,theme:s||{}})}function se(t){return e.jsx(v.Box,{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center",...t,children:e.jsx(v.CircularProgress,{size:30})})}function _e(t){return e.jsx(Me,{...t})}const Me=K.styled(v.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
- `,Ie=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
17
- sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function Ee({titleFontFamily:t,descriptionFontFamily:o}){var n;const s=v.useTheme(),a=(n=s==null?void 0:s.typography)==null?void 0:n.fontFamily;g.useEffect(()=>{},[t,o]);const i=`${a}, ${Ie}`;return e.jsx(z.Global,{styles:z.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 Te(){const[t]=w.useSearchParams(),{session:o}=X.useSessionContext(),s=X.useIsRoleOrMultiTenant("owner","admin","pagesEditor","member"),a=g.useMemo(()=>{const n=t.get("mode");return M.STATE_MODES.includes(n)?n:"production"},[t]),i=a==="production"?a:o.user?s?a:"production":null;return i?e.jsx(ae,{mode:i}):null}function ae({mode:t}){if(t!=="draft"){const o=window.__PAGE_STATE__;return o?e.jsx(N,{mode:t,state:o}):e.jsx(Oe,{mode:t,children:({state:s})=>e.jsx(N,{mode:t,state:s})})}return e.jsx(Be,{children:({state:o})=>e.jsx(N,{mode:t,state:o})})}const Be=g.lazy(()=>Promise.resolve().then(()=>require("./draft-data-CuZfaQ4s.js")));function Oe({mode:t,children:o}){const s=document.querySelector('meta[property="pages:version"]'),a=s==null?void 0:s.content,i=S.useProjectId(),n=g.useMemo(()=>{if(a==="{{pagesPublishedAt}}"){const u=localStorage.getItem(S.getProjectPageVersionKey(i??""));return Number(u)?Number(u):new Date().getTime()}return Number(a)},[a]),{loading:m,value:c}=te.useAsync(()=>M.getPages({mode:t,version:n}),[t,n]);return m?e.jsx(se,{}):c?o({state:c}):null}function N({mode:t,state:o}){const{t:s,locale:a}=Z.useLocaleContext(),[i]=w.useSearchParams(),n=S.useProjectId(),m=S.useProjectSlug(),c=i.get("hiddenBadge")==="true",u=i.get("showPublish")==="true",{pageIds:f,pages:p,routeIds:l,routes:h,supportedLocales:j,config:{defaultLocale:b},resources:I}=o,x=S.getAllComponents(o),k=g.useMemo(()=>j!=null&&j.some(d=>d.locale===a)?a:void 0,[a,j]),O=Object.values(h||{}).find(d=>(d==null?void 0:d.path)==="/")||Object.values(p).find(d=>(d==null?void 0:d.slug)==="/")?void 0:Object.values(p)[0],H=g.useMemo(()=>t==="production"?f.map(d=>{const r=p[d];return r&&{id:r.id,path:_.joinURL("/",m||n||"",r.slug)}}).filter(M.nonNullable):l.map(d=>{const r=h[d];return r?{id:r.id,path:_.joinURL("/",m||n||"",r.path,`?mode=${t}&showPublish=true`)}:null}).filter(M.nonNullable),[f,p,t,h,l,n,m]),C=([...d])=>(t!=="production"&&u&&d.unshift(e.jsx(g.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(De,{mode:"production",state:o})})),d);return e.jsxs(M.Provider,{value:{pages:H},children:[e.jsxs(w.Routes,{children:[O&&e.jsx(w.Route,{index:!0,element:e.jsx(w.Navigate,{to:_.joinURL("/",k||"",O.slug)})}),l==null?void 0:l.map(d=>{var y,P,R,A;const r=h==null?void 0:h[d];if(!r||!r.displayTemplateId)return null;const E=p[r.displayTemplateId];if(!E)return null;let T=[];if(r.params&&r.params.length>0){const B=ge.generateParamCombinations({basePath:r.path,params:r.params,routeId:r.id,paramsOptions:r.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});T=B==null?void 0:B.map(L=>{var F,Y,J,Q;const D=L.paramOptionIds.join("-");return e.jsx(w.Route,{path:_.joinURL(":projectIdOrSlug?",L.path),element:e.jsx(G,{mode:t,components:x,page:E,locale:k,defaultLocale:b,headerAddons:C,state:o,pageData:(Q=(J=(Y=(F=r.dataSource)==null?void 0:F.pathDataMappings)==null?void 0:Y[D])==null?void 0:J.dataCache)==null?void 0:Q[k||b||"en"]})},D)})}return T.push(e.jsx(w.Route,{path:_.joinURL(":projectIdOrSlug?",r.path),element:e.jsx(G,{mode:t,components:x,page:E,locale:k,defaultLocale:b,headerAddons:C,state:o,pageData:(A=(R=(P=(y=r.dataSource)==null?void 0:y.pathDataMappings)==null?void 0:P[r.id])==null?void 0:R.dataCache)==null?void 0:A[k||b||"en"]})},r.id)),T}),f.map(d=>{const r=p[d];return r?e.jsx(w.Route,{path:_.joinURL(":projectIdOrSlug?",r.slug),element:e.jsx(U,{mode:t,components:x,page:r,locale:k,defaultLocale:b,headerAddons:C})},r.id):null}),I.pages&&Object.values(I.pages).map(({blockletId:d,page:r})=>e.jsx(w.Route,{path:_.joinURL("/",`@${d}`,r.slug),element:e.jsx(U,{mode:t,components:x,page:r,locale:k,defaultLocale:b,headerAddons:C})},r.id)),e.jsx(w.Route,{path:"*",element:e.jsx(v.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(ne.default,{status:404,extra:e.jsx(le,{href:"/",children:s("common.back")}),sx:{bgcolor:"transparent",width:"100%",height:"100%"}})})})]}),t!=="production"&&!c&&e.jsx(_e,{sx:{bgcolor:"info.light"},children:t}),e.jsx(Ee,{})]})}function G({mode:t,pageData:o,components:s,page:a,locale:i,defaultLocale:n,headerAddons:m,state:c}){const u=W.useReactive({page:null});g.useEffect(()=>{const p=a||null;p?u.page=V.default(p):u.page=null},[a,JSON.stringify(a),u]);const f=g.useRef();return g.useEffect(()=>{re.default(o,f.current)||o&&u.page&&(ee.setPageDataSource(u.page,c,i,o),f.current=V.default(o))},[u.page,o,i,c]),u.page?e.jsx(U,{mode:t,components:s,page:u.page,locale:i,defaultLocale:n,headerAddons:m}):null}function Le({mode:t,state:o,path:s,pageData:a}){const{t:i,locale:n}=Z.useLocaleContext(),{pages:m,supportedLocales:c,config:{defaultLocale:u},resources:f}=o,p=Object.values(m).find(x=>(x==null?void 0:x.slug)===s),l=Object.values(f.pages||{}).find(x=>x.page.slug===s),h=g.useMemo(()=>c!=null&&c.some(x=>x.locale===n)?n:void 0,[n,c]),j=W.useReactive({page:null});g.useEffect(()=>{const x=p||(l==null?void 0:l.page)||null;x?j.page=V.default(x):j.page=null},[p,l]);const b=g.useRef();if(g.useEffect(()=>{re.default(a,b.current)||a&&j.page&&(ee.setPageDataSource(j.page,o,h,a),b.current=V.default(a))},[{}]),!p&&!(l!=null&&l.page))return e.jsx(v.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(ne.default,{style:{background:"inherit"},status:404,extra:e.jsx(le,{href:"/",children:i("common.back")})})});const I=S.getAllComponents(o);return j.page?e.jsx(U,{mode:t,components:I,page:j.page,locale:h,defaultLocale:u}):null}function U({mode:t,components:o,page:s,locale:a,defaultLocale:i,headerAddons:n}){var k,$,O,H,C,d,r,E,T;const m=pe.useColorConvert(),c=((k=s.locales)==null?void 0:k[a])??(($=s.locales)==null?void 0:$[i])??{},u=c.title||((O=window.blocklet)==null?void 0:O.appName),f=c.description||((H=window.blocklet)==null?void 0:H.appDescription),p=S.autoResizeImage(S.getImageAbsoluteUrl(c.image),540),{logo:l,brand:h,description:j,...b}=de.useHeaderState(),I=g.useMemo(()=>y=>{var R;let P=(n==null?void 0:n(y))??y;return P=((R=b.addons)==null?void 0:R.call(b,P))??P,P},[b.addons,n]),x=g.useMemo(()=>{var y;return(y=c.header)!=null&&y.translucent?ce:ie},[(C=c.header)==null?void 0:C.translucent]);return e.jsxs(M.PageProvider,{page:s,defaultLocale:i,currentLocale:a,children:[e.jsx(z.Global,{styles:z.css`
30
- body {
31
- background-color: ${m(!c.backgroundColor||c.backgroundColor==="transparent"?"background.default":c.backgroundColor)} !important;
32
- }
33
- `}),e.jsx(x,{hideNavMenu:!!((d=c.header)!=null&&d.hideNavMenus),translucentTextColor:(r=c.header)==null?void 0:r.translucentTextColor,...l?{logo:l}:{},...h?{brand:h}:{},...j?{description:j}:{},className:fe.cx(((E=c.header)==null?void 0:E.sticky)&&"sticky","page-header"),maxWidth:!1,addons:I}),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:f}),e.jsx("meta",{name:"og:image",content:p}),e.jsx("meta",{name:"twitter:image:src",content:p}),e.jsx("meta",{name:"twitter:image",content:p}),e.jsx("meta",{property:"twitter:description",content:f}),e.jsx("meta",{property:"twitter:title",content:u}),e.jsx("meta",{name:"description",content:f})]}),e.jsx(v.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:s.sectionIds.map(y=>{var B,L,D,F;const P=s.sections[y];if(!P||P.visibility==="hidden")return null;const R=(L=(B=s.dataSource)==null?void 0:B[y])==null?void 0:L[a],A=((F=(D=s.dataSource)==null?void 0:D[y])==null?void 0:F[i])??{};return e.jsx(M.BlockRenderer,{id:y,type:P.component,mode:t,section:P,config:{...Re.default(R)?A:R,locale:a,dev:t==="draft"?{mode:t,components:o,defaultLocale:i}:{mode:t,defaultLocale:i}},page:s},y)})}),!((T=c.footer)!=null&&T.hidden)&&e.jsx(Ce,{})]})}const De=g.lazy(()=>Promise.resolve().then(()=>require("./publish-button-CGfGqrov.js"))),ie=oe.default(we.default)`
34
- &.sticky {
35
- position: sticky;
36
- top: 0;
37
- }
38
- `;function Fe({logo:t}){const[o,s]=g.useState(),a=v.useMediaQuery(n=>n.breakpoints.down("sm")),{value:i}=te.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 m=n.toString();return new Promise(f=>{fetch(m).then(p=>{const l=p.headers.get("content-type");l!=null&&l.includes("svg")&&p.text().then(h=>{s(h),f(null)}),f(p.url)})})},[a]);if(t)return t;if(o)return e.jsx(v.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:ke.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 m=n.toString();return e.jsx("img",{src:m,alt:"logo"})}return null}function ce({logo:t,translucentTextColor:o,...s}){const i=W.useScroll(document.getElementById("app"),l=>l.top<1200),n=v.useTheme(),m=Math.min((i==null?void 0:i.top)??0,800),c=g.useMemo(()=>{let l=Math.min(m/800,1),h="";return l>.1?(l=Math.max(l,.6),h=v.alpha(n.palette.text.primary,l)):h=o||"#EEEEEE",{backgroundOpacity:l,textColor:h,isReversed:l<.7}},[m,800,n.palette.text.primary,o]),{backgroundOpacity:u,textColor:f,isReversed:p}=c;return e.jsx(ie,{logo:e.jsx(Fe,{logo:t}),...s,sx:{position:"fixed !important",top:0,left:0,right:0,zIndex:n.zIndex.appBar,backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1,backgroundColor:v.alpha(n.palette.background.default,u),backdropFilter:u>=.6?"blur(10px)":"blur(0px)",transition:"backgroundColor 0.3s ease-in-out"},transition:"color 0.3s ease-in-out",".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${f} !important`},".header-logo":{color:`${f} !important`},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:`invert(${p?1:0})`,transition:"filter 0.3s ease-in-out"}}})}const le=oe.default(v.Button)``;exports.Home=Te;exports.HomeView=ae;exports.Loading=se;exports.PageRoutes=N;exports.PageView=U;exports.PageViewByPath=Le;exports.PageViewWithDataSource=G;exports.TranslucentHeader=ce;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),F=require("./state-BVdbNJCA.js"),W=require("@arcblock/ux/lib/Locale/context"),ee=require("@arcblock/ux/lib/Toast"),te=require("@blocklet/pages-kit/utils/route"),O=require("@mui/icons-material"),J=require("@mui/lab"),s=require("@mui/material"),se=require("immer"),ne=require("lodash/difference"),l=require("react"),ie=require("react-use"),re=require("./home-BMjMYgq3.js"),U=require("./array-BqHuYyfx.js"),G=r=>r&&r.__esModule?r:{default:r},$=G(ee),H=G(ne);function oe(r){const[j,k]=l.useState(!1);return e.jsx(J.LoadingButton,{...r,loading:r.loading||j,onClick:u=>{var b;const p=(b=r.onClick)==null?void 0:b.call(r,u);p instanceof Promise&&(k(!0),p.finally(()=>{k(!1)}))}})}const ae=s.createSvgIcon(e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M7.75732 16.2426L16.2426 7.75736",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16.2426 16.2426L7.75732 7.75735",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Close");function le(){const[r,j]=l.useState(),k=l.useMemo(()=>r?e.jsx(s.Dialog,{...r}):null,[r]),u=l.useCallback(()=>{j(void 0)},[]),p=l.useCallback(({title:b,content:d,cancelText:S="Cancel",okText:g="Ok",onOk:f,onClose:c,okIcon:P,okColor:w="primary",cancelColor:y="primary",DialogContentProps:A,form:E,...z})=>{j({...z,open:!0,children:e.jsxs("form",{onSubmit:v=>v.preventDefault(),children:[b&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:v=>`1px solid ${v.palette.divider}`},children:[e.jsx(s.Box,{children:b}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{u(),c==null||c()},children:e.jsx(ae,{})})]}),d&&e.jsx(s.DialogContent,{...A,sx:{mt:-3,...A==null?void 0:A.sx,bgcolor:"background.paper"},children:e.jsx(s.Box,{pt:3,children:d})}),e.jsxs(s.DialogActions,{sx:{bgcolor:"background.paper"},children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:c??u,children:S}),e.jsx(oe,{variant:"contained",color:w||"primary",startIcon:P,loadingPosition:P?"start":"center",onClick:async()=>{await(f==null?void 0:f()),u()},type:"submit",children:g})]})]}),onClose:c??u})},[u]);return{dialog:k,showDialog:p,closeDialog:u}}const ce=l.forwardRef(({mode:r,state:j},k)=>{const{t:u}=W.useLocaleContext(),[p,b]=l.useState(!1),{dialog:d,showDialog:S}=le(),g=F.useProjectId(),f=l.useCallback(P=>{let w=[];S({title:u("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(O.Warning,{}),children:u("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(de,{state:j,toMode:r,onChange:y=>w=y,defaultRouteIds:P})})]}),okText:u("maker.publish"),cancelText:u("common.cancel"),onOk:async()=>{if((w==null?void 0:w.length)===0){const y=u("maker.publishSelectPagesMessage");throw $.default.error(y),new Error(y)}localStorage.setItem(F.getProjectPageVersionKey(g??""),String(new Date().getTime())),b(!0);try{await U.publishPages({mode:r,routes:w}),$.default.success(u("maker.publishSuccessMessage"))}catch(y){throw $.default.error(y.message),y}finally{b(!1)}}})},[r,j,u,g,S]);l.useImperativeHandle(k,()=>({openPublishDialog:f}));const c=l.useCallback(()=>{f()},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(J.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:c,loading:p,disabled:p,children:u("maker.publish")}),d]})});function ue({routePathInfo:r,checked:j,onClick:k,route:u}){var d,S,g,f,c;const{t:p}=W.useLocaleContext(),b=!((d=r.routeMetaData)!=null&&d.publishedAt)||((S=r.routeMetaData)==null?void 0:S.updatedAt)&&new Date((g=r.routeMetaData)==null?void 0:g.updatedAt)>new Date((f=r.routeMetaData)==null?void 0:f.publishedAt);return e.jsx(s.ListItem,{sx:{pl:4,pr:3},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{display:"flex",alignItems:"center",sx:{minWidth:"auto"},children:[b&&e.jsx(s.Box,{mr:.35,className:"visible",color:"warning.main",sx:{display:"flex",alignItems:"center"},title:p("maker.pages.needPublish"),children:e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(O.Sync,{fontSize:"small",sx:{fontSize:"16px"}})})}),(!((c=r.routeMetaData)!=null&&c.isPublic)||!u.isPublic)&&e.jsx(s.Box,{className:"visible",color:"warning.main",children:e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(O.VisibilityOff,{fontSize:"small",sx:{fontSize:"16px"}})})})]}),children:e.jsxs(s.ListItemButton,{onClick:k,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:j,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:r.path,primaryTypographyProps:{fontSize:"0.8rem",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pr:1}})]})})}function de({state:r,toMode:j,onChange:k,defaultRouteIds:u}){const{t:p,locale:b}=W.useLocaleContext(),[d,S]=l.useState(!1),[g,f]=l.useState(()=>u?Object.fromEntries(u.filter(t=>!t.includes("-")).map(t=>[t,!0])):{}),[c,P]=l.useState({}),[w,y]=l.useState(()=>u?Object.fromEntries(u.filter(t=>t.includes("-")).map(t=>[t,!0])):{}),[A,E]=l.useState({}),{loading:z,error:v,value:x}=ie.useAsync(()=>U.getPages({mode:j}),[j]);if(v)throw v;const D=l.useMemo(()=>r.routeIds||[],[r]),I=l.useMemo(()=>(x==null?void 0:x.pageIds)||[],[x]),T=l.useMemo(()=>!D||!r.routes?[]:JSON.parse(JSON.stringify(D)).sort((o,i)=>{var h,m;const n=(h=r.routes)==null?void 0:h[o],a=(m=r.routes)==null?void 0:m[i];return n!=null&&n.publishedAt&&new Date(n.publishedAt).getTime()<new Date(n.updatedAt).getTime()?-1:a!=null&&a.publishedAt&&new Date(a.publishedAt).getTime()<new Date(a.updatedAt).getTime()?1:new Date((n==null?void 0:n.updatedAt)??"").getTime()-new Date((a==null?void 0:a.updatedAt)??"").getTime()}),[r,D]),q=l.useMemo(()=>{if(!T)return[];if(!c)return T;const t=[...T].filter(o=>!c[o]);return Object.values(c).forEach(o=>{o.forEach(i=>{t.push(`${i.originalRouteId}-${i.paramOptionIds.join("-")}`)})}),t},[T,c]),B=l.useMemo(()=>!x||!I||!q?[]:H.default(I,q),[q,x,I]),C=l.useMemo(()=>D?[...D].concat(B):B,[D,B]),_=l.useCallback(()=>{const t={};T==null||T.forEach(o=>{var n;const i=(n=r.routes)==null?void 0:n[o];if(i&&i.params&&i.params.length>0&&i.paramsOptions&&i.paramsOptions.length>0){const a=te.generateParamCombinations({basePath:i.path,params:i.params,routeId:i.id,paramsOptions:i.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});a.length>0&&(t[i.id]=a)}}),P(t)},[T,r.routes]);l.useEffect(()=>{_()},[_]),l.useEffect(()=>{E(t=>{const o={...t};return Object.keys(c).forEach(i=>{var n;c[i]&&((n=c[i])==null?void 0:n.length)>0&&o[i]===void 0&&(o[i]=!0)}),o})},[c]);const K=l.useRef(!0);l.useEffect(()=>{y(t=>{const o={...t};return Object.keys(c).length===0||(Object.keys(c).forEach(i=>{const n=c[i]||[],a=d||!!g[i];n.forEach(h=>{const m=`${i}-${h.paramOptionIds.join("-")}`;K.current?o[m]=a||t[m]||!1:o[m]=a})}),K.current=!1),o})},[g,c,d]);const Q=(t,o)=>{o.stopPropagation(),E(i=>{const n={...i};return n[t]=!n[t],n})},N=l.useCallback(t=>{f(o=>{const i=se.produce(o,n=>{d?(Object.assign(n,Object.fromEntries(C.map(a=>[a,!0]))),delete n[t]):n[t]?(delete n[t],B.includes(t)&&(D||[]).filter(a=>{var h,m;return((h=r.pages[a])==null?void 0:h.slug)===((m=x==null?void 0:x.pages[t])==null?void 0:m.slug)}).forEach(a=>{delete n[a]})):(n[t]=!0,D&&D.includes(t)&&B.filter(a=>{var h,m;return((h=x==null?void 0:x.pages[a])==null?void 0:h.slug)===((m=r.pages[t])==null?void 0:m.slug)}).forEach(a=>{n[a]=!0}))});return S(H.default(C,Object.keys(i)).length===0),i})},[d,C,B,r,x,D]),X=l.useCallback((t,o)=>{const i=`${t}-${o.paramOptionIds.join("-")}`;y(n=>{var m;const a={...n};a[i]=!a[i];const h=((m=c[t])==null?void 0:m.every(L=>a[`${t}-${L.paramOptionIds.join("-")}`]))??!1;return f(L=>{if(h&&!L[t])return{...L,[t]:!0};if(!h&&L[t]){const R={...L};return delete R[t],R}return L}),a})},[c]),Y=l.useCallback(()=>{S(t=>(t&&f({}),!t))},[]);return l.useEffect(()=>{const t=d?C:Object.keys(g),o=Object.entries(w).filter(([,n])=>n).map(([n])=>n).filter(n=>n!==void 0),i=Array.from(new Set([...t,...o]));k(d?null:i)},[d,g,w,C,k]),z?e.jsx(re.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:700},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:Y,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:p("common.all")})]})}),T.map(t=>{var L,R;const o=(L=r.routes)==null?void 0:L[t];if(!o)return null;const i=!1,n=c&&c[t]&&((R=c[t])==null?void 0:R.length)>0,a=A[t]!==!1,h=c[t]||[],m=!o.publishedAt||o.updatedAt&&new Date(o.updatedAt).getTime()>new Date(o.publishedAt).getTime();return e.jsxs(s.Box,{children:[e.jsx(s.ListItem,{sx:{pr:4},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{sx:{display:"flex",alignItems:"center"},children:[m&&e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(O.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!o.isPublic&&e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(O.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),i,n&&e.jsx(s.Box,{onClick:M=>Q(t,M),sx:{display:"inline-flex",alignItems:"center",mr:.35,cursor:"pointer",color:"info.main"},children:a?e.jsx(O.KeyboardArrowDown,{fontSize:"small",sx:{fontSize:"18px"}}):e.jsx(O.KeyboardArrowRight,{fontSize:"small",sx:{fontSize:"18px"}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(t),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d||!!g[t],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:o.path,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})}),n&&e.jsx(s.Collapse,{in:a,children:e.jsx(s.Box,{children:h.map(M=>{const V=`${t}-${M.paramOptionIds.join("-")}`,Z=w[V]||!1;return e.jsx(ue,{routePathInfo:M,checked:d||Z,onClick:()=>X(t,M),route:o},V)})})})]},t)}),B.map(t=>{var i,n;const o=x==null?void 0:x.pages[t];return o?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(t),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d||!!g[t],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:o.slug,secondary:(n=(i=o.locales)==null?void 0:i[b])==null?void 0:n.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},t):null})]})}exports.default=ce;
@@ -1 +0,0 @@
1
- "use strict";const i=require("@arcblock/did-connect/lib/Session"),r=require("react"),{SessionProvider:u,SessionContext:c,SessionConsumer:a,withSession:C}=i.createAuthServiceSessionContext();function t(){return r.useContext(c)}function l(...s){var e;const{session:n}=t();return s.includes((e=n.user)==null?void 0:e.role)}function S(...s){var o;const{session:n}=t(),e=l(...s);return((o=window.blocklet)==null?void 0:o.tenantMode)==="multiple"?!!n.user:e}exports.SessionProvider=u;exports.useIsRoleOrMultiTenant=S;exports.useSessionContext=t;