-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
5 lines (5 loc) · 3.26 KB
/
index.js
1
2
3
4
5
(function(){"use strict";const p=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="m8.522 16.949 1.844.522c1.924.555 3.615.992 5.074 1.31L15.34 24 1.566 20.319zM16.418.001c.242-.035 1.704 1.633 3.234 3.681l2.782 3.716-6.955 3.439-2.784-3.681C11.164 5.176 9.913 3.37 9.913 3.23c0-.349 5.739-3.161 6.505-3.229"/>
<path d="m22.434 7.4-.068 6.702-.106 6.738-3.442 1.562L15.34 24c.088-4.503.135-7.521.138-9.048v-4.115l6.956-3.439zM8.383 3.785c.065 0 .129 2.546.138 5.829v7.334l-6.955 3.371V6.878L4.905 5.35c1.843-.869 3.408-1.563 3.478-1.563z" opacity=".75"/>
</svg>
`,U="";function i(t,e,r,s,l,c,u,w){var n=typeof t=="function"?t.options:t;e&&(n.render=e,n.staticRenderFns=r,n._compiled=!0),s&&(n.functional=!0),c&&(n._scopeId="data-v-"+c);var a;if(u?(a=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__<"u"&&(o=__VUE_SSR_CONTEXT__),l&&l.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(u)},n._ssrRegister=a):l&&(a=w?function(){l.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:l),a)if(n.functional){n._injectStyles=a;var I=n.render;n.render=function(T,_){return a.call(_),I(T,_)}}else{var m=n.beforeCreate;n.beforeCreate=m?[].concat(m,a):[a]}return{exports:t,options:n}}const f={computed:{mainUrl(){return this.idToImageUrl(this.content.mainproductid)}},methods:{idToImageUrl(t){if(!t)return null;switch(t.split(":").length){case 1:return"https://uploads.roomle.com/plans/"+t+"/thumbnail.png";case 2:return"https://www.roomle.com/api/v2/items/"+t+"/perspectiveImageHD";case 3:return"https://uploads.roomle.com/configurations/"+t+"/perspectiveImage.png";default:return null}},variantToImageUrl(t){return t.image[0]?t.image[0].url:t.productid?this.idToImageUrl(t.productid):null}}};var v=function(){var e=this,r=e._self._c;return r("div",{staticClass:"k-block-type-roomle-configurator-wrapper",on:{dblclick:function(s){return e.$emit("open")}}},[r("k-aspect-ratio",{staticClass:"k-block-type-roomle-configurator-main",attrs:{ratio:"1/1"}},[r("lbro-lazy-image",{attrs:{src:e.mainUrl}},[r("k-empty",{attrs:{icon:"roomle",layout:"cardlets",text:e.$t("roomle.empty")}})],1)],1),r("ul",{staticClass:"k-block-type-roomle-configurator-variants"},e._l(e.content.variants,function(s,l){return r("li",{key:l,staticClass:"k-block-type-roomle-configurator-variant"},[r("lbro-lazy-image",{attrs:{src:e.variantToImageUrl(s)}},[r("k-empty",{attrs:{icon:"image",layout:"cardlets",text:e.$t("roomle.noRendering")}})],1),r("span",{staticClass:"k-block-type-roomle-configurator-labels"},[r("strong",[e._v(e._s(s.title))]),r("span",[e._v(e._s(s.subtitle))])])],1)}),0)],1)},d=[],g=i(f,v,d,!1,null,null,null,null);const h=g.exports,b={props:{alt:{type:String,default:""},src:String},data(){return{visible:!0}}};var y=function(){var e=this,r=e._self._c;return r("span",[e.src?r("img",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],attrs:{alt:e.alt,src:e.src},on:{error:function(s){e.visible=!1},load:function(s){e.visible=!0}}}):e._e(),!e.src||!e.visible?e._t("default"):e._e()],2)},k=[],C=i(b,y,k,!1,null,null,null,null);const $=C.exports;panel.plugin("lukasbestle/roomle",{blocks:{"roomle-configurator":h},components:{"lbro-lazy-image":$},icons:{roomle:p}})})();