FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
current-time
/
build
Edit File: index.js
(()=>{"use strict";var e,t={436:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=window.wp.blockEditor,l=window.wp.components,a=window.wp.element,s=window.wp.primitives,n=window.ReactJSXRuntime,i=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M5 11.25h14v1.5H5z"})}),d=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})}),r=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})}),c=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})}),y=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),p=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),u=window.wp.compose,h=()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,n.jsx)("p",{children:(0,n.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M0 34.7721L6.88004 38.677V15.8055L20.4542 7.80977L23.9872 9.4833L30.4953 5.57841L20.4542 -7.62939e-06L0 11.9006V34.7721Z",fill:"#38DAC7"}),(0,n.jsx)("path",{d:"M32.9284 6.87939L34.2126 7.61318L12.3825 19.904L12.1991 40.45L20.6376 45.8616L41.0001 33.6625V35.4969L20.6376 47.6043L10.8232 41.2755V18.9868L32.9284 6.87939Z",fill:"#5566CA"}),(0,n.jsx)("path",{d:"M37.6063 9.53936L36.2305 8.71385L14.217 21.3716V38.9824L20.5459 43.5685L41.0001 31.3694V29.5349L20.5459 41.8258L15.5928 38.2486V22.1054L37.6063 9.53936Z",fill:"#5566CA"}),(0,n.jsx)("path",{d:"M41.0001 11.3738L39.5325 10.5483L17.3356 23.2061V37.2397L20.5459 39.6244L41.0001 27.4253V25.6826L20.5459 37.79L18.9866 36.5976V24.1233L41.0001 11.3738Z",fill:"#5566CA"})]})}),(0,n.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,t.__)("Access Without Limits!","cozy-addons")}),(0,n.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,t.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,n.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,n.jsx)("button",{className:"cozy-block-premium-button",style:{backgroundColor:"#5566ca",borderRadius:"20px",padding:"10px",border:"none",color:"#fff",fontFamily:"Inter",fontSize:"10px",fontWeight:"500",cursor:"pointer"},children:(0,n.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,n.jsx)("div",{children:(0,n.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M9.29768 0.0630875L0.24397 5.2847C-0.109583 5.48778 -0.0646564 5.97987 0.286944 6.12828L2.36334 6.99919L7.97527 2.05487C8.0827 1.95919 8.23506 2.10565 8.14325 2.21695L3.43767 7.94822V9.52017C3.43767 9.98102 3.99437 10.1626 4.26784 9.8287L5.50821 8.31924L7.94206 9.33857C8.21943 9.45573 8.53588 9.28194 8.58666 8.98317L9.99306 0.547365C10.0595 0.152913 9.6356 -0.132186 9.29768 0.0630875Z",fill:"white"})})}),(0,n.jsx)("div",{children:(0,t.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),m=(0,a.memo)((({clientId:e,attributes:t,blockId:o})=>{const[l,s]=(0,a.useState)(new Date),i=(0,u.useRefEffect)((e=>{const o=[{property:"--cozyDateTimePadding",value:`${t.layout.padding.top}px ${t.layout.padding.right}px ${t.layout.padding.bottom}px ${t.layout.padding.left}px`},{property:"--cozyDateTimeDisplay",value:t.layout.display},{property:"--cozyDateTimeFlexGap",value:`${t.layout.gap}px`},{property:"--cozyDateTimeTextAlign",value:t.layout.textAlign},{property:"--cozyDateTimeFontFamily",value:t.layout.styles.fontFamily},{property:"--cozyDateTimeFontSize",value:`${t.layout.styles.fontSize}px`},{property:"--cozyDateTimeFontWeight",value:t.layout.styles.fontWeight},{property:"--cozyDateTimeBorderRadius",value:`${t.layout.borderRadius.topL}px ${t.layout.borderRadius.topR}px ${t.layout.borderRadius.bottomR}px ${t.layout.borderRadius.bottomL}px`},{property:"--cozyDateTimeColor",value:t.layout.styles.color},{property:"--cozyDateTimeBgColor",value:t.layout.styles.bgColor}];t.date.enabled&&t.time.enabled&&o.push({property:"--cozyDateTimeMarginBottom",value:`${t.layout.marginBottom}px`});const l=[{property:"--cozyTimePadding",value:`${t.time.padding.top}px ${t.time.padding.right}px ${t.time.padding.bottom}px ${t.time.padding.left}px`},{property:"--cozyTimeFontSize",value:`${t.time.styles.fontSize}px`},{property:"--cozyTimeFontWeight",value:t.time.styles.fontWeight},{property:"--cozyTimeBorderRadius",value:`${t.time.borderRadius.topL}px ${t.time.borderRadius.topR}px ${t.time.borderRadius.bottomR}px ${t.time.borderRadius.bottomL}px`},{property:"--cozyTimeColor",value:t.time.styles.color},{property:"--cozyTimeBgColor",value:t.time.styles.bgColor}];null!==e&&o.forEach((t=>{e.style.setProperty(t.property,t.value)}));const a=e.querySelector(".cozy-time");null!==a&&l.forEach((e=>{a.style.setProperty(e.property,e.value)}));const n=setInterval((()=>{s(new Date)}),1e3);return()=>{clearInterval(n)}})),d=["January","February","March","April","May","June","July","August","September","October","November","December"][l.getMonth()],r=l.getDate(),c=l.getFullYear(),y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][l.getDay()],p=`\n\t\t#${o} {\n\t\t\ttext-transform: ${t.layout.styles?.letterCase};\n\t\t\ttext-decoration: ${t.layout.styles?.decoration};\n\t\t\tline-height: ${t.layout.styles?.lineHeight};\n\t\t\tletter-spacing: ${t.layout.styles?.letterSpacing};\n\n\t\t\t& .cozy-time {\n\t\t\t\tfont-family: ${t.time.styles?.fontFamily};\n\t\t\t\ttext-transform: ${t.time.styles?.letterCase};\n\t\t\t\ttext-decoration: ${t.time.styles?.decoration};\n\t\t\t\tline-height: ${t.time.styles?.lineHeight};\n\t\t\t\tletter-spacing: ${t.time.styles?.letterSpacing};\n\t\t\t}\n\t\t}\n\t`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:p}}),""!=t.layout.styles.fontFamily&&null!=t.layout.styles.fontFamily&&(0,n.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${t.layout.styles.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),""!=t.time.styles?.fontFamily&&null!=t.time.styles?.fontFamily&&(0,n.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${t.time.styles?.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),(0,n.jsxs)("div",{className:`cozy-block-date-time ${t.layout.display}`,id:o,ref:i,children:[t.date.enabled&&(0,n.jsxs)("div",{className:"cozy-date",children:["m-d-y"===t.date.format&&`${t.week.enabled?t.abbr?y.slice(0,3)+" ":y+" ":""}${t.abbr?d.slice(0,3):d} ${r}, ${c}`,"d-m-y"===t.date.format&&`${t.week.enabled?t.abbr?y.slice(0,3)+" ":y+" ":""}${r} ${t.abbr?d.slice(0,3):d}, ${c}`]}),t.time.enabled&&(0,n.jsx)("div",{className:"cozy-time",children:l.toLocaleTimeString("en-US",{hour12:t.time.timeFormat})})]})]})})),g=JSON.parse('{"UU":"cozy-block/date-time","DD":"Date & Time"}'),x=(0,n.jsxs)("svg",{width:"30",height:"25",viewBox:"0 0 30 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2H27V12H25V4H2V20H17V22H0V2Z",fill:"#0C50FF"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 6.5V0H7V6.5H5Z",fill:"#0C50FF"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 6.5V0H22V6.5H20Z",fill:"#0C50FF"}),(0,n.jsx)("rect",{x:"5",y:"10",width:"3",height:"3",rx:"1.5",fill:"#0C50FF"}),(0,n.jsx)("rect",{x:"5",y:"14",width:"3",height:"3",rx:"1.5",fill:"#0C50FF",fillOpacity:"0.25"}),(0,n.jsx)("rect",{x:"9",y:"10",width:"3",height:"3",rx:"1.5",fill:"#0C50FF",fillOpacity:"0.75"}),(0,n.jsx)("rect",{x:"9",y:"14",width:"3",height:"3",rx:"1.5",fill:"#0C50FF",fillOpacity:"0.5"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.5 21C23.2239 21 23 20.7761 23 20.5L23 17.5C23 17.2239 23.2239 17 23.5 17C23.7761 17 24 17.2239 24 17.5L24 20.5C24 20.7761 23.7761 21 23.5 21Z",fill:"#0C50FF"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26 20.5C26 20.7761 25.7761 21 25.5 21H23.5C23.2239 21 23 20.7761 23 20.5C23 20.2239 23.2239 20 23.5 20H25.5C25.7761 20 26 20.2239 26 20.5Z",fill:"#0C50FF"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 19C19.5 21.4853 21.5147 23.5 24 23.5C26.4853 23.5 28.5 21.4853 28.5 19C28.5 16.5147 26.4853 14.5 24 14.5C21.5147 14.5 19.5 16.5147 19.5 19ZM24 13C20.6863 13 18 15.6863 18 19C18 22.3137 20.6863 25 24 25C27.3137 25 30 22.3137 30 19C30 15.6863 27.3137 13 24 13Z",fill:"#0C50FF"})]});(0,e.registerBlockType)(g.UU,{title:(0,t.__)(g.DD,"cozy-addons"),description:(0,t.__)("Stay updated with our 'Date & Time' block, effortlessly displaying the current time and date to keep your audience informed and engaged.","cozy-addons"),icon:{src:x},edit:function(e){const{attributes:s,setAttributes:u,clientId:g}=e;if(s.cover)return(0,n.jsx)("img",{src:s.cover});s.blockClientId=g;const x=(0,o.useBlockProps)({className:"cozy-block-wrapper"}),b=`cozyBlock_${g.replace(/-/gi,"_")}`,[_,C]=(0,a.useState)(!0),[v,j]=(0,a.useState)(!0),[z,f]=(0,a.useState)(!0),[w,L]=(0,a.useState)(!0),T=(e,t)=>{let o={...s.layout.padding};o={...o,top:Math.abs(t),right:Math.abs(t),bottom:Math.abs(t),left:Math.abs(t)},u(_?{...s,layout:{...s.layout,padding:o}}:{...s,layout:{...s.layout,padding:{...s.layout.padding,[e]:Math.abs(t)}}})},k=(e,t)=>{let o={...s.time.padding};o={...o,top:Math.abs(t),right:Math.abs(t),bottom:Math.abs(t),left:Math.abs(t)},u(v?{...s,time:{...s.time,padding:o}}:{...s,time:{...s.time,padding:{...s.time.padding,[e]:Math.abs(t)}}})},R=(e,t)=>{let o={...s.layout.borderRadius};o={...o,topL:Math.abs(t),topR:Math.abs(t),bottomL:Math.abs(t),bottomR:Math.abs(t)},u(z?{...s,layout:{...s.layout,borderRadius:o}}:{...s,layout:{...s.layout,borderRadius:{...s.layout.borderRadius,[e]:Math.abs(t)}}})},F=(e,t)=>{let o={...s.time.borderRadius};o={...o,topL:Math.abs(t),topR:Math.abs(t),bottomL:Math.abs(t),bottomR:Math.abs(t)},u(w?{...s,time:{...s.time,borderRadius:o}}:{...s,time:{...s.time,borderRadius:{...s.time.borderRadius,[e]:Math.abs(t)}}})},M=function(){let e=[{label:"Default",value:""}];if("object"==typeof cozyBlockAssets.googleFonts)for(let t in cozyBlockAssets.googleFonts)e.push({label:cozyBlockAssets.googleFonts[t],value:t});return e}(),[B,S]=(0,a.useState)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{...x,children:["block"===s.layout.display&&(0,n.jsx)(o.BlockControls,{children:(0,n.jsx)(o.AlignmentToolbar,{value:s.layout.textAlign,onChange:e=>u({...s,layout:{...s.layout,textAlign:e}})})}),(0,n.jsx)(m,{clientId:g,attributes:s,blockId:b})]}),(0,n.jsxs)(o.InspectorControls,{group:"settings",children:[(0,n.jsxs)(l.PanelBody,{title:(0,t.__)("General","cozy-addons"),children:[s.date.enabled&&s.time.enabled&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Display Layout","cozy-addons"),options:[{label:(0,t.__)("Inline","cozy-addons"),value:"flex"},{label:(0,t.__)("Block","cozy-addons"),value:"block"}],value:s.layout.display,onChange:e=>u({...s,layout:{...s.layout,display:e}})}),"flex"===s.layout.display&&(0,n.jsx)(l.RangeControl,{label:(0,t.__)("Gap","cozy-addons"),min:0,max:50,step:1,value:s.layout.gap,onChange:e=>u({...s,layout:{...s.layout,gap:e}})}),"block"===s.layout.display&&(0,n.jsx)(l.RangeControl,{label:(0,t.__)("Gap","cozy-addons"),min:0,max:50,step:1,value:s.layout.marginBottom,onChange:e=>u({...s,layout:{...s.layout,marginBottom:e}})})]}),(0,n.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Date","cozy-addons"),checked:s.date.enabled,onChange:e=>u({...s,date:{...s.date,enabled:e}})}),s.date.enabled&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Week","cozy-addons"),checked:s.week.enabled,onChange:e=>u({...s,week:{...s.week,enabled:e}})}),(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Date Format","cozy-addons"),options:[{label:(0,t.__)("M-D-Y","cozy-addons"),value:"m-d-y"},{label:(0,t.__)("D-M-Y","cozy-addons"),value:"d-m-y"}],value:s.date.format,onChange:e=>u({...s,date:{...s.date,format:e}})}),(0,n.jsx)(l.ToggleControl,{label:(0,t.__)("Abbreviate","cozy-addons"),checked:s.abbr,onChange:e=>u({...s,abbr:e})})]}),(0,n.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Time","cozy-addons"),checked:s.time.enabled,onChange:e=>u({...s,time:{...s.time,enabled:e}})}),s.time.enabled&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(l.ToggleControl,{label:(0,t.__)("Time Format","cozy-addons"),checked:s.time.timeFormat,onChange:e=>u({...s,time:{...s.time,timeFormat:e}}),help:(0,t.__)("Note: Disabling switches to 24 hour format.")})})]}),!cozyBlockAssets.isPremium&&(0,n.jsx)(h,{})]},"setting"),(0,n.jsxs)(o.InspectorControls,{group:"styles",children:[(0,n.jsxs)(l.PanelBody,{title:(0,t.__)("Container Styles","cozy-addons"),opened:"container-styles"===B,onToggle:()=>S("container-styles"),children:[(0,n.jsxs)(l.BaseControl,{children:[(0,n.jsx)(l.BaseControl.VisualLabel,{children:(0,t.__)("Container Padding","cozy-addons")}),(0,n.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,n.jsx)("button",{className:"cozy-link-styles "+(_?"":"cozy-attr-link-disabled"),onClick:()=>C(!_),children:(0,n.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Top","cozy-addons"),value:s.layout.padding.top,onChange:e=>T("top",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Right","cozy-addons"),value:s.layout.padding.right,onChange:e=>T("right",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Bottom","cozy-addons"),value:s.layout.padding.bottom,onChange:e=>T("bottom",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Left","cozy-addons"),value:s.layout.padding.left,onChange:e=>T("left",e)})]})]}),(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Font Family","cozy-addons"),options:M,value:s.layout.styles.fontFamily,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,fontFamily:e}}})}),(0,n.jsx)(l.RangeControl,{label:(0,t.__)("Font Size","cozy-addons"),min:5,max:50,step:1,value:s.layout.styles.fontSize,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,fontSize:e}}})}),(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Font Weight","cozy-addons"),options:[{label:(0,t.__)("Thin","cozy-addons"),value:100},{label:(0,t.__)("Extra Light","cozy-addons"),value:200},{label:(0,t.__)("Light","cozy-addons"),value:300},{label:(0,t.__)("Normal","cozy-addons"),value:400},{label:(0,t.__)("Medium","cozy-addons"),value:500},{label:(0,t.__)("Semi Bold","cozy-addons"),value:600},{label:(0,t.__)("Bold","cozy-addons"),value:700},{label:(0,t.__)("Extra Bold","cozy-addons"),value:800}],value:s.layout.styles.fontWeight,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,fontWeight:e}}})}),(0,n.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsxs)(l.__experimentalToggleGroupControl,{label:(0,t.__)("Letter Case","cozy-addons"),value:s.layout.styles?.letterCase,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,letterCase:e}}}),children:[(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("None","cozy-addons"),value:"none",icon:i}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Uppercase","cozy-addons"),value:"uppercase",icon:d}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Lowercase","cozy-addons"),value:"lowercase",icon:r}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Capitalize","cozy-addons"),value:"capitalize",icon:c})]})}),(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsxs)(l.__experimentalToggleGroupControl,{label:(0,t.__)("Decoration","cozy-addons"),value:s.layout.styles?.decoration,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,decoration:e}}}),children:[(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("None","cozy-addons"),value:"none",icon:i}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Underline","cozy-addons"),value:"underline",icon:y}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Strikethrough","cozy-addons"),value:"line-through",icon:p})]})})]}),(0,n.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Line Height","cozy-addons"),value:s.layout.styles?.lineHeight,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,lineHeight:e}}})})}),(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Letter Spacing","cozy-addons"),value:s.layout.styles?.letterSpacing,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,letterSpacing:e}}})})})]}),(0,n.jsxs)(l.BaseControl,{children:[(0,n.jsx)(l.BaseControl.VisualLabel,{children:(0,t.__)("Border Radius","cozy-addons")}),(0,n.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,n.jsx)("button",{className:"cozy-link-styles "+(z?"":"cozy-attr-link-disabled"),onClick:()=>f(!z),children:(0,n.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("TopL","cozy-addons"),value:s.layout.borderRadius.topL,onChange:e=>R("topL",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("TopR","cozy-addons"),value:s.layout.borderRadius.topR,onChange:e=>R("topR",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("BottomL","cozy-addons"),value:s.layout.borderRadius.bottomL,onChange:e=>R("bottomL",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("BottomR","cozy-addons"),value:s.layout.borderRadius.bottomR,onChange:e=>R("bottomR",e)})]})]}),(0,n.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,t.__)("Color Settings","cozy-addons"),colorSettings:[{value:s.layout.styles.bgColor,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,bgColor:e}}}),label:(0,t.__)("Background Color","cozy-addons")},{value:s.layout.styles.color,onChange:e=>u({...s,layout:{...s.layout,styles:{...s.layout.styles,color:e}}}),label:(0,t.__)("Color","cozy-addons")}]})]}),s.time.enabled&&(0,n.jsxs)(l.PanelBody,{title:(0,t.__)("Time Styles","cozy-addons"),opened:"time-styles"===B,onToggle:()=>S("time-styles"),children:[(0,n.jsxs)(l.BaseControl,{children:[(0,n.jsx)(l.BaseControl.VisualLabel,{children:(0,t.__)("Time Padding","cozy-addons")}),(0,n.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,n.jsx)("button",{className:"cozy-link-styles "+(v?"":"cozy-attr-link-disabled"),onClick:()=>j(!v),children:(0,n.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,n.jsx)(l.TextControl,{type:"number",step:1,value:s.time.padding.top,label:(0,t.__)("Top","cozy-addons"),onChange:e=>k("top",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Right","cozy-addons"),value:s.time.padding.right,onChange:e=>k("right",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Bottom","cozy-addons"),value:s.time.padding.bottom,onChange:e=>k("bottom",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("Left","cozy-addons"),value:s.time.padding.left,onChange:e=>k("left",e)})]})]}),(0,n.jsx)(l.RangeControl,{label:(0,t.__)("Font Size","cozy-addons"),min:5,max:50,step:1,value:s.time.styles.fontSize,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,fontSize:e}}})}),(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Font Family","cozy-addons"),options:M,value:s.time.styles?.fontFamily,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,fontFamily:e}}})}),(0,n.jsx)(l.SelectControl,{label:(0,t.__)("Font Weight","cozy-addons"),options:[{label:(0,t.__)("Thin","cozy-addons"),value:100},{label:(0,t.__)("Extra Light","cozy-addons"),value:200},{label:(0,t.__)("Light","cozy-addons"),value:300},{label:(0,t.__)("Normal","cozy-addons"),value:400},{label:(0,t.__)("Medium","cozy-addons"),value:500},{label:(0,t.__)("Semi Bold","cozy-addons"),value:600},{label:(0,t.__)("Bold","cozy-addons"),value:700},{label:(0,t.__)("Extra Bold","cozy-addons"),value:800}],value:s.time.styles.fontWeight,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,fontWeight:e}}})}),(0,n.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsxs)(l.__experimentalToggleGroupControl,{label:(0,t.__)("Letter Case","cozy-addons"),value:s.time.styles?.letterCase,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,letterCase:e}}}),children:[(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("None","cozy-addons"),value:"none",icon:i}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Uppercase","cozy-addons"),value:"uppercase",icon:d}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Lowercase","cozy-addons"),value:"lowercase",icon:r}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Capitalize","cozy-addons"),value:"capitalize",icon:c})]})}),(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsxs)(l.__experimentalToggleGroupControl,{label:(0,t.__)("Decoration","cozy-addons"),value:s.time.styles?.decoration,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,decoration:e}}}),children:[(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("None","cozy-addons"),value:"none",icon:i}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Underline","cozy-addons"),value:"underline",icon:y}),(0,n.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,t.__)("Strikethrough","cozy-addons"),value:"line-through",icon:p})]})})]}),(0,n.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Line Height","cozy-addons"),value:s.time.styles?.lineHeight,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,lineHeight:e}}})})}),(0,n.jsx)("div",{style:{width:"100%"},children:(0,n.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Letter Spacing","cozy-addons"),value:s.time.styles?.letterSpacing,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,letterSpacing:e}}})})})]}),(0,n.jsxs)(l.BaseControl,{children:[(0,n.jsx)(l.BaseControl.VisualLabel,{children:(0,t.__)("Border Radius","cozy-addons")}),(0,n.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,n.jsx)("button",{className:"cozy-link-styles "+(w?"":"cozy-attr-link-disabled"),onClick:()=>L(!w),children:(0,n.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,n.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("TopL","cozy-addons"),value:s.time.borderRadius.topL,onChange:e=>F("topL",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("TopR","cozy-addons"),value:s.time.borderRadius.topR,onChange:e=>F("topR",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("BottomL","cozy-addons"),value:s.time.borderRadius.bottomL,onChange:e=>F("bottomL",e)}),(0,n.jsx)(l.TextControl,{type:"number",step:1,label:(0,t.__)("BottomR","cozy-addons"),value:s.time.borderRadius.bottomR,onChange:e=>F("bottomR",e)})]})]}),(0,n.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,t.__)("Color Settings","cozy-addons"),colorSettings:[{value:s.time.styles.bgColor,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,bgColor:e}}}),label:(0,t.__)("Background Color","cozy-addons")},{value:s.time.styles.color,onChange:e=>u({...s,time:{...s.time,styles:{...s.time.styles,color:e}}}),label:(0,t.__)("Color","cozy-addons")}]})]})]},"style")]})},save:function(e){const{attributes:t}=e,o=`cozyBlock_${(l=t.blockClientId,l.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var l;return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:`cozy-block-date-time ${t.layout.display}`,id:o,children:[t.date.enabled&&(0,n.jsx)("div",{className:"cozy-date"}),t.time.enabled&&(0,n.jsx)("div",{className:"cozy-time"})]})})}})}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,l),s.exports}l.m=t,e=[],l.O=(t,o,a,s)=>{if(!o){var n=1/0;for(c=0;c<e.length;c++){for(var[o,a,s]=e[c],i=!0,d=0;d<o.length;d++)(!1&s||n>=s)&&Object.keys(l.O).every((e=>l.O[e](o[d])))?o.splice(d--,1):(i=!1,s<n&&(n=s));if(i){e.splice(c--,1);var r=a();void 0!==r&&(t=r)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[o,a,s]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,s,[n,i,d]=o,r=0;if(n.some((t=>0!==e[t]))){for(a in i)l.o(i,a)&&(l.m[a]=i[a]);if(d)var c=d(l)}for(t&&t(o);r<n.length;r++)s=n[r],l.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return l.O(c)},o=globalThis.webpackChunkcurrent_time=globalThis.webpackChunkcurrent_time||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=l.O(void 0,[350],(()=>l(436)));a=l.O(a)})();
Save
Back