!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.i18n,n=window.wp.blocks,o=window.wp.element,i=window.wp.primitives,s=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),r=window.React,c=window.wp.blockEditor,l=window.wp.data,a=window.nisje.components,d=window.nisje.format,w=window.nisje.icons,m=window.nisje.fullSiteEditing;const p="dekode-wiki";(0,n.registerBlockType)("nisje/card-wiki",{title:(0,t.__)("Wiki post","nisje"),icon:s,edit:function({attributes:e,setAttributes:n}){const{postId:i}=e,{GridSizeToolbar:s,sizeClassNames:u}=(0,m.useGridSize)(),[g,S]=(0,m.useDarkClassname)(),[k,z]=(0,r.useState)(!1),E=(0,c.useBlockProps)({style:S,className:(0,d.classnames)("editor-wiki-post",u,g)}),{BackgroundColor:C,InspectorControlsColorPanel:b}=(0,c.__experimentalUseColors)([{name:"backgroundColor"}]),h=(0,l.useSelect)((e=>{if(0===i)return(0,t.__)("Currently showing latest post","nisje");const n=e("core").getEntityRecord("postType",p,i);return(null==n?void 0:n.title.rendered)||"..."}),[i]),j=0!==i;return(0,o.createElement)(o.Fragment,null,s,(0,o.createElement)(m.PostSelectorPanel,{hasSelected:j,onOpen:()=>z(!0),onRemove:()=>n({postId:0})}),b,(0,o.createElement)(C,null,(0,o.createElement)(a.BaseCard,E,(0,o.createElement)("div",null,(0,o.createElement)(w.Icon,{icon:w.globe,size:40}),(0,o.createElement)(a.TextDeprecated,{as:"h2",variant:"title-medium"},(0,t.__)("Wiki post","nisje")),(0,o.createElement)(a.TextDeprecated,{as:"p"},h)))),k&&(0,o.createElement)(m.PostSelector,{onRequestClose:()=>z(!1),onSelect:e=>n({postId:e}),postType:p}))}}),(window.nisje=window.nisje||{}).pluginWikiAdmin=e}();