!function(e){function t(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var l=n(2),i=(n.n(l),n(3)),r=(n.n(i),wp.components),a=r.IconButton,o=r.PanelBody,c=r.TextControl,m=r.Toolbar,s=(r.withNotices,wp.element.Fragment),u=wp.i18n.__,p=wp.blocks.registerBlockType,d=wp.editor,g=d.BlockControls,w=d.InspectorControls,h=d.BlockAlignmentToolbar,b=d.MediaPlaceholder,f=d.MediaUpload,y=d.AlignmentToolbar,_=(d.RichText,{title:{type:"array",source:"children",selector:"p"},url:{type:"string"},align:{type:"string"},width:{type:"number"},height:{type:"number"},contentAlign:{type:"string",default:"center"},id:{type:"number"}});p("cgb/block-algori-360-image",{title:u("360\xb0 Image"),description:u("If an image is worth 1,000 words, imagine how many more words an interactive 360\xb0 image is worth! Insert a single 360\xb0 image."),icon:"format-image",category:"common",keywords:[u("panorama image - three sixty degree photo"),u("spherical photo - full-sphere 3D image"),u("equirectangular image - VR (Virtual Reality) photography")],attributes:_,getEditWrapperProps:function(e){var t=e.align,n=e.width;if("left"===t||"center"===t||"right"===t||"wide"===t||"full"===t)return{"data-align":t,"data-resized":!!n}},edit:function(e){var t=e.attributes,n=e.setAttributes,l=(e.isSelected,e.className),i=(e.noticeOperations,e.noticeUI),r=t.url,p=(t.title,t.align),d=t.width,_=t.height,v=t.contentAlign,E=t.id,k=function(e){return n({width:parseInt(e,10)})},I=function(e){return n({height:parseInt(e,10)})},N=function(e){return n({align:e})},x=function(e){if(!e||!e.url)return void n({url:void 0,id:void 0});n({url:e.url,id:e.id})},C=wp.element.createElement(s,null,wp.element.createElement(g,null,wp.element.createElement(h,{value:p,onChange:N}),wp.element.createElement(y,{value:v,onChange:function(e){n({contentAlign:e})}}),wp.element.createElement(m,null,wp.element.createElement(f,{onSelect:x,type:"image",value:E,render:function(e){var t=e.open;return wp.element.createElement(a,{className:"components-toolbar__control",label:u("Edit image"),icon:"edit",onClick:t})}}))),!!r&&wp.element.createElement(w,null,wp.element.createElement(o,{title:u("360\xb0 Image Settings")},wp.element.createElement("div",{className:"core-blocks-image__dimensions"},wp.element.createElement("p",{className:"core-blocks-image__dimensions__row"},u("Image Dimensions")),wp.element.createElement("div",{className:"core-blocks-image__dimensions__row"},wp.element.createElement(c,{type:"number",className:"core-blocks-image__dimensions__width",label:u("Width"),value:void 0!==d?d:"",placeholder:600,min:1,onChange:k}),wp.element.createElement(c,{type:"number",className:"core-blocks-image__dimensions__height",label:u("Height"),value:void 0!==_?_:"",placeholder:300,min:1,onChange:I}))))));return r?wp.element.createElement(s,null,C,wp.element.createElement("div",null,wp.element.createElement("a-scene",{class:"wp-block-cgb-block-algori-360-image-embedded-scene",style:{width:d,height:_},embedded:!0},wp.element.createElement("a-sky",{src:r})))):wp.element.createElement(s,null,C,wp.element.createElement(b,{icon:"format-image",className:l,labels:{title:u("360 Image"),name:u("a 360\xb0 image")},onSelect:x,accept:"image/*",type:"image",notices:i}))},save:function(e){var t=e.attributes,n=(e.className,t.url),l=(t.title,t.align,t.width),i=t.height;t.contentAlign,t.id;return wp.element.createElement("div",null,wp.element.createElement("a-scene",{className:"wp-block-cgb-block-algori-360-image-embedded-scene",style:{width:l,height:i},embedded:""},wp.element.createElement("a-sky",{src:n})))}})},function(e,t){},function(e,t){}]);