(()=>{"use strict";var e={223(e,o,t){t.d(o,{A:()=>l});var r=t(573),p=t(790);const l=(0,p.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(r.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})})},641(e,o,t){t.d(o,{A:()=>l});var r=t(573),p=t(790);const l=(0,p.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(r.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})})},839(e,o,t){t.d(o,{A:()=>l});var r=t(573),p=t(790);const l=(0,p.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(r.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})})},350(e,o,t){t.d(o,{ii:()=>c,pA:()=>i,uO:()=>s});var r=t(723),p=t(223),l=t(641),n=t(839);const i="(###) ###-####",s=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"],c=[{title:(0,r.__)("Paragraph","peeps-people-directory"),value:"p",icon:l.A},{title:(0,r.__)("Div","peeps-people-directory"),value:"div",icon:p.A},{title:(0,r.__)("Span","peeps-people-directory"),value:"span",icon:n.A}]},501(e,o,t){t.d(o,{n4:()=>r});const r=(e,o)=>{if(!e)return"";const t=e.replace(/\D/g,""),r=(o.match(/#/g)||[]).length;let p=o;for(let e=0;e<t.length&&e<r;e++)p=p.replace("#",t[e]);return t.length>r&&(p+=t.slice(r)),p.replace(/#/g,"")}},790(e){e.exports=window.ReactJSXRuntime},715(e){e.exports=window.wp.blockEditor},997(e){e.exports=window.wp.blocks},427(e){e.exports=window.wp.components},582(e){e.exports=window.wp.coreData},143(e){e.exports=window.wp.data},723(e){e.exports=window.wp.i18n},573(e){e.exports=window.wp.primitives}},o={};function t(r){var p=o[r];if(void 0!==p)return p.exports;var l=o[r]={exports:{}};return e[r](l,l.exports,t),l.exports}t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},t.d=(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o);var r=t(997),p=t(723),l=t(715),n=t(427),i=t(582),s=t(143),c=t(350),a=t(501),d=t(790);const h=JSON.parse('{"UU":"ph-peeps/phone"}');(0,r.registerBlockType)(h.UU,{edit:function({attributes:e,setAttributes:o,isSelected:t,context:r}){const{tagName:h,makeLink:x,prefix:v}=e,{postType:w,postId:_}=r,u=(0,l.useBlockProps)(),g=(0,s.useSelect)((e=>_?e(i.store).getEntityRecord("postType",w||"ph_peeps_people",_):null),[_,w]),m=(0,s.useSelect)((e=>e(i.store).getEntityRecord("root","site")?.ph_peeps_phone_format||c.pA),[]),b=g?.meta?.ph_peeps_phone,f=g?.meta?.ph_peeps_phone_ext,j=b?(0,a.n4)(b,m):m,y=f?` x${f}`:"",k=h,P=b?`tel:${b.replace(/[^0-9+]/g,"")}${f?`;ext=${f}`:""}`:"",A=b?(0,d.jsx)("a",{href:P,children:j+y}):j,S=(0,d.jsxs)(d.Fragment,{children:[(t||v)&&(0,d.jsx)(l.RichText,{identifier:"prefix",allowedFormats:c.uO,className:"wp-block-ph-peeps-phone__prefix","aria-label":(0,p.__)("Prefix","peeps-people-directory"),placeholder:(0,p.__)("Prefix","peeps-people-directory")+" ",value:v,onChange:e=>o({prefix:e}),tagName:"span"}),x?A:j+y]}),B=c.ii.find((e=>e.value===h));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.BlockControls,{children:(0,d.jsx)(n.ToolbarGroup,{children:(0,d.jsx)(n.ToolbarDropdownMenu,{icon:B?.icon,label:(0,p.__)("Change text element","peeps-people-directory"),controls:c.ii.map((e=>({title:e.title,icon:e.icon,isActive:e.value===h,onClick:()=>o({tagName:e.value})})))})})}),(0,d.jsx)(l.InspectorControls,{children:(0,d.jsx)(n.PanelBody,{title:(0,p.__)("Phone Settings","peeps-people-directory"),children:(0,d.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Make Phone Link","peeps-people-directory"),checked:x,onChange:()=>o({makeLink:!x}),help:x?(0,p.__)("Phone number will be clickable","peeps-people-directory"):(0,p.__)("Phone number will be plain text","peeps-people-directory")})})}),(0,d.jsx)(k,{...u,children:S})]})}})})();