@tiddh/brave-vue 1.91.81 → 1.91.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brave-vue.esm.js +38 -82
- package/dist/brave-vue.ssr.js +38 -82
- package/package.json +2 -1
package/dist/brave-vue.esm.js
CHANGED
|
@@ -55,12 +55,9 @@ a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeUR
|
|
|
55
55
|
this.selectedSubcategory?e=this.selectedSubcategory.assets.colors.find((function(e){return e.id===t.customization.optionId})):this.subcategoriesAssets.forEach((function(a){e=a.assets.colors.find((function(e){return e.id===t.customization.optionId}))}))),e},visibleSubcategories:function(){var t=this;if(!this.category.depends_category)return this.subcategoriesAssets;var e=this.category.assets.categories.find((function(e){return e.parent_id===t.relatedCustomization.optionId}));return e?e.assets.subcategories:null},visibleColors:function(){return this.selectedSubcategory&&this.selectedSubcategory.assets.colors.length>1?(screen.width<=1023&&(document.getElementById("customization-panel-body").style.height="16rem"),this.selectedSubcategory.assets.colors):(screen.width<=1023&&(document.getElementById("customization-panel-body").style.height="12rem"),null)},showPlaceholder:function(){return""===this.imagePath}},mounted:function(){this.isSelected=this.selectedSubcategory},methods:{handleSubcategoryClick:function(t){var e=this;if(this.glasses=t.assets.icon,t.assets.colors&&t.assets.colors.length>0)
|
|
56
56
|
// Caso a cor já houver sido selecionada, buscamos a cor mais parecida
|
|
57
57
|
// na nova subcategoria e atualizamos a customização
|
|
58
|
-
if(this.removableCategory&&this.selectedSubcategory&&t.assets.name===this.selectedSubcategory.assets.name)this.handleCustomizationUpdate(t.parent_id,null,null,null,null,!0),this.clickedSubcategory=null;else{if(this.selectedColor){var a=t.assets.colors.find((function(t){return t.hexa===e.selectedColor.hexa}))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// handleGroupCustomizationUpdate
|
|
62
|
-
this.handleCustomizationUpdate(i.id,i.hexa,i.assets.asset,t.z_index,t.disable,null,!!this.removableCategory,this.removableCategory?i.parent_id:null)}
|
|
63
|
-
// #DICA DO EGON
|
|
58
|
+
if(this.removableCategory&&this.selectedSubcategory&&t.assets.name===this.selectedSubcategory.assets.name)this.handleCustomizationUpdate(t.parent_id,null,null,null,null,!0),this.clickedSubcategory=null;else{if(this.selectedColor){var a=t.assets.colors.find((function(t){return t.hexa===e.selectedColor.hexa}));// Caso não encontremos atualizamos a customizaçao com a primeira cor disponível
|
|
59
|
+
a||(a=t.assets.colors[0]),this.handleCustomizationUpdate(a.id,a.hexa,a.assets.asset,t.z_index,t.disable)}else{var i=t.assets.colors[0];// handleGroupCustomizationUpdate
|
|
60
|
+
this.handleCustomizationUpdate(i.id,i.hexa,i.assets.asset,t.z_index,t.disable,null,!!this.removableCategory,this.removableCategory?i.parent_id:null)}// #DICA DO EGON
|
|
64
61
|
// Sempre que quiser consumir o valor de uma computed property e na mesma função
|
|
65
62
|
// quiser alterar o valor de data deixe a alteração da data por ultimo
|
|
66
63
|
// pois ao fazer a alterção é possível que suas computed properties estejam sendo
|
|
@@ -80,13 +77,11 @@ color:{type:String,default:"#68596E"},
|
|
|
80
77
|
* Type of font<br>
|
|
81
78
|
* Example: `Regular | Bold`
|
|
82
79
|
**/
|
|
83
|
-
type:{type:String,default:"regular"}},data:function(){return{}}},"data-v-494fbeae",!1,void 0,!1,x,void 0,void 0),C=require("axios"),P=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-panel"},[a("div",{staticClass:"overlay-opacity"}),t._v(" "),a("div",{staticClass:"customization-panel-head"},[a("div",{staticClass:"customization-panel-heading"},[t._v("\n\t\t\t\tEditar o personagem "+t._s(t.characterIsMale?"do":"da")+"\n\t\t\t\t"),a("b",[t._v(t._s(t.characterName))])]),t._v(" "),a("div",{staticClass:"customization-categories"},[t._l(t.categoriesAssets.categories,(function(e){return a("a",{directives:[{name:"show",rawName:"v-show",value:"mooner"!==e.code&&"pet"!==e.code,expression:"category.code !== 'mooner' && category.code !== 'pet'"}],key:e.key,ref:e.code,refInFor:!0,staticClass:"customization-categories-item",class:[{"is-selected":e===t.selectedCategory,"is-disabled":t.isCategoryDisabled(e)},"category-"+e.code],attrs:{id:e.code},on:{click:function(a){return t.handleSelectCategory(e)}}},[e.assets.icon?a("img",{staticClass:"customization-categories-item-icon",attrs:{src:e.assets.icon}}):a("span",{staticClass:"customization-categories-item-icon customization-categories-item-icon-placeholder"}),t._v(" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],1)})),t._v(" "),t._l(t.categoriesAssets.groups,(function(e){return a("a",{key:e.key,ref:e.code,refInFor:!0,staticClass:"customization-categories-item",class:[{"is-selected":e===t.selectedGroup},"category-"+e.code],on:{click:function(a){return t.handleSelectGroup(e)}}},[e.assets.icon?a("img",{staticClass:"customization-categories-item-icon",attrs:{src:e.assets.icon}}):a("span",{staticClass:"customization-categories-item-icon customization-categories-item-icon-placeholder"}),t._v(" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],1)}))],2)]),t._v(" "),a("div",{staticClass:"customization-panel-body",attrs:{id:"customization-panel-body"}},[t._l(t.visibleCategoriesCustomizations,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedCategory,expression:"selectedCategory"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.id),relatedCustomization:t.getCustomizationByCategoryId(e.depends_category),disabledCategories:t.disabledCategories,removableCategory:!e.required},on:{"update:customization":t.handleUpdateCustomization}})})),t._v(" "),t._l(t.categoriesAssets.groups,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedGroup,expression:"selectedGroup"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.assets.subcategories[0].parent_id),removableCategory:!e.required,customizations:t.customizations},on:{"update:customization":t.handleUpdateCustomization}})}))],2),t._v(" "),a("div",{staticClass:"helper"},[a("div",{ref:"error",staticClass:"error",domProps:{innerHTML:t._s(t.error)}}),t._v(" "),a("div",{staticClass:"btn-avatar",on:{click:t.generateAvatar}},[a("div",{staticClass:"btn-avatar-preload"},[t._v("\n\t\t\t\t\tCONTINUAR\n\t\t\t\t\t"),a("div",{staticClass:"icon icon-check"},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36"}},[a("path",{attrs:{fill:"#000","fill-rule":"evenodd",d:"M22.65 17.828a1.996 1.996 0 0 1-.579 1.586l-5.657 5.657a2 2 0 0 1-2.828-2.828L18 17.828l-4.414-4.414a2 2 0 0 1 2.828-2.828l5.657 5.657c.434.434.627 1.018.579 1.585z"}})])])]),t._v(" "),a("div",{staticClass:"btn-avatar-loading"},[a("span",{staticClass:"btn-avatar-loading-content",domProps:{innerHTML:t._s(t.loadingContent)}}),t._v(" "),a("span",{staticClass:"btn-avatar-loading-icon"},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36"}},[a("path",{attrs:{fill:"#000","fill-rule":"evenodd",d:"M26.383 12.728c-.433-.47-.986-.727-1.48-.728-.293 0-.569.092-.776.29l-2.306 2.179v-.002l-3.136 2.963c-.055.052-.093.109-.13.16l-3.008 2.841-3.545-3.855c-.217-.235-.526-.347-.858-.347-.47 0-.992.217-1.424.625-.465.44-.719 1-.72 1.5 0 .298.092.576.287.788l3.25 3.533 1.823 1.981c.214.235.52.344.85.344.147 0 .295-.021.448-.061l.085.002c.292.001.566-.087.776-.284l5.44-5.14c.054-.052.094-.11.13-.162l4.567-4.315c.234-.22.344-.532.344-.87 0-.474-.215-1.002-.617-1.442z"}})])])])])])])},staticRenderFns:[]},(function(t){t&&t("data-v-9bed85a8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.postingCharacter{height:100vh}.customization-panel-heading b{font-weight:400;color:#923fda;text-transform:capitalize}.customization-panel{z-index:100;position:fixed;width:520px;height:100%;top:0;right:0;background:#f8f7fc;border-left:1px solid #dfdae4;transition:all .3s;overflow:hidden}@media (max-width:992px){.customization-panel{width:100%;bottom:0;top:unset;min-height:180px;height:auto}}.customization-panel-head{background:#fff;border-bottom:1px solid #f0ebf5;box-shadow:0 10px 26px 0 #d7d1ef;position:relative;z-index:150}@media (max-width:992px){.customization-panel-head{box-shadow:0 0 26px 0 #d7d1ef}}.customization-panel-heading{height:80px;max-width:100%;line-height:80px;text-align:center;font-family:Roboto,sans-serif;color:#afa2ba;background:#fff;border-bottom:1px solid #dfdae4;font-size:16px}@media (max-width:992px){.customization-panel-heading{display:none}}.customization-panel-body{height:70%;scroll-behavior:smooth;padding-bottom:70px;z-index:20;overflow-y:auto;position:relative}.customization-panel-body::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.customization-panel-body::-webkit-scrollbar{width:7px;background-color:transparent}.customization-panel-body::-webkit-scrollbar-thumb{border-radius:20px;background-color:#e4e4e4}@media (max-width:992px){.customization-panel-body{padding-bottom:0;z-index:0}}.customization-panel .helper{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #dfdae4;box-shadow:0 0 26px 0 #d7d1ef;padding:.7619047619rem 1.1428571429rem;display:flex;align-items:center;justify-content:center;z-index:999}@media (max-width:992px){.customization-panel .helper{display:none;z-index:0}}.customization-panel .helper .error{background:red;width:100%;color:#fff;font-family:Roboto,sans-serif;font-size:14px;padding:15px 0;text-align:center;text-transform:uppercase;position:absolute;transition:all .3s;top:-45px;opacity:0}.btn-avatar{width:100%;height:65px;font-family:Nunito;font-weight:900;padding:0!important;background:#12d3db;background-size:200%;background-position-x:99%;box-shadow:0 .2381rem .95238rem 0 #89e6e8;border-radius:1.90476rem;color:#fff;transition:all .2s cubic-bezier(.4,0,.2,1);border:0;font-size:14px;letter-spacing:.0381rem;line-height:1.2rem;position:relative;display:flex;align-items:center;justify-content:center}.btn-avatar:hover{box-shadow:0 .2381rem .95238rem 0 #89e6e8;-webkit-transform:translateY(-.09524rem);transform:translateY(-.09524rem);cursor:pointer;background-position-x:0;-webkit-transform:translateY(-.14286rem);transform:translateY(-.14286rem);color:#fff}.btn-avatar:active,.btn-avatar:focus{outline:0;box-shadow:0 0 0 #89e6e8;background-position-x:0;-webkit-transform:translateY(.14286rem) scale(.97);transform:translateY(.14286rem) scale(.97)}.btn-avatar .icon{position:absolute;display:flex;justify-content:center;align-items:center;right:0;top:0;margin:15px!important}.btn-avatar .icon path,.btn-avatar .icon svg{fill:#fff;stroke:#fff}@media (max-width:992px){.btn-avatar{display:none!important}}.btn-avatar-mobile{display:none!important}@media (max-width:992px){.btn-avatar-mobile{display:flex!important;width:150px;height:40px;box-shadow:none;font-size:12px;float:right;line-height:1;position:fixed;right:0;top:10px;z-index:200;border-radius:100px;margin-right:.7619047619rem}.btn-avatar-mobile .icon{display:none}}.customization-categories{display:flex;align-items:center;align-content:center;padding:.7619047619rem .7619047619rem}@media (max-width:992px){.customization-categories{padding:0}}.customization-categories .category-vestuario{display:none!important}.customization-categories-item{position:relative;font-size:inherit;flex-basis:0;flex-grow:1;max-width:100%;height:100%;text-align:center}.customization-categories-item:hover{cursor:pointer}.customization-categories-item:hover .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item{height:50px;display:flex;justify-content:center;align-items:center;border:0}}.customization-categories-item-icon{height:52px;width:52px;display:block;border-radius:30px;margin:auto}.customization-categories-item-icon-placeholder{background-color:#dfdae4;border-radius:2px}@media (max-width:992px){.customization-categories-item-icon{display:none}}.customization-categories-item-label{font-weight:400;display:block;font-size:12px;color:#000;text-transform:capitalize!important;font-family:Roboto;padding-top:.380952381rem}@media (max-width:992px){.customization-categories-item-label{margin:0}}.customization-categories-item:first-child{border-left:none}.customization-categories-item.is-selected .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item.is-selected:after{content:"";position:absolute;left:0;bottom:-2px;width:100%;height:3px;background:#12d3db}}@media (max-width:992px) and (max-width:992px){.customization-categories-item.is-selected:after{bottom:0}}.customization-categories-item.is-disabled{opacity:.6}.btn-avatar-reduced{background:#2dd4d9!important;width:65px!important;cursor:wait}@media (max-width:479px){.btn-avatar-reduced{width:40px!important;height:40px!important}}.btn-avatar-loading-completed{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-position:0 0;background-repeat:no-repeat;-webkit-animation:1s loadingCompleted;-moz-animation:1s loadingCompleted;animation:1s loadingCompleted;cursor:wait}@-webkit-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@-moz-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}.btn-avatar-loading-started{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-repeat:no-repeat;background-position:41% 0;-webkit-animation:4s loadingPosition;-moz-animation:4s loadingPosition;animation:4s loadingPosition;transition:.3s;cursor:wait}@-webkit-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@-moz-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}.btn-avatar-loading{font-size:1.4285714286rem;display:none;opacity:0;transition:all .3s;font-size:14px;cursor:wait}.btn-avatar-loading .btn-avatar-loading-icon{display:none;opacity:0;align-items:center;justify-content:center}.btn-avatar-loading .btn-avatar-loading-icon svg{width:2.1904761905rem;height:2.1904761905rem}@media (max-width:479px){.btn-avatar-loading .btn-avatar-loading-icon svg{width:3.5514018692rem;height:3.5514018692rem}}.btn-avatar-loading .btn-avatar-loading-icon path,.btn-avatar-loading .btn-avatar-loading-icon svg{fill:#fff;stroke:#fff}@media (max-width:479px){.btn-avatar-loading{font-size:12px}.btn-avatar-loading .btn-avatar-loading-content{font-size:12px}}',map:void 0,media:void 0})}),{name:"CustomizationPanel",components:{CategoryCustomizations:k,Caption:_},props:{builderApi:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},selectedCharacter:{type:Object,default:{}},characterSlug:{type:String,required:!0},characterId:{type:[Number,String],required:!0},characterTypeId:{type:[Number,String],required:!0},characterName:{type:String,required:!0},characterIsMale:{type:Boolean,required:!0},categoriesAssets:{type:Object,required:!0},disabledCategories:{type:Array,required:!1,default:function(){return[]}},customizations:{type:Array,required:!0},builderProductId:{type:[String,Number],required:!1,default:null},subscriptionId:{type:[Number,String],required:!0},stackId:{type:[Number,String],required:!0},userDataProperties:{type:Object,required:!0},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{selectedCategory:null,selectedGroup:null,selectedCollection:null,error:null,isMobile:null,loadingContent:screen.width<1023?"ENVIANDO":"ENVIANDO PERSONAGEM"}},mounted:function(){if(!document.body.getElementsByClassName("btn-avatar-mobile")[0]){var t=document.getElementsByClassName("btn-avatar")[0].cloneNode(!0);t.classList.add("btn-avatar-mobile"),document.body.appendChild(t),document.body.getElementsByClassName("btn-avatar-mobile")[0].addEventListener("click",this.generateAvatar)}var e=document.getElementsByClassName("top-bar")[0];if(screen.width<=1023&&e&&!e.getElementsByClassName("overlay-opacity")[0]){var a=document.getElementsByClassName("overlay-opacity")[0].cloneNode(!0);e.appendChild(a)}if(!document.body.getElementsByClassName("error-mobile")[0]){var i=document.getElementsByClassName("error")[0].cloneNode(!0);i.classList.add("error-mobile"),document.body.appendChild(i)}window.addEventListener("resize",this.screenResize),screen.width>1023?this.isMobile=!1:this.isMobile=!0},beforeDestroy:function(){document.body.getElementsByClassName("btn-avatar-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("btn-avatar-mobile")[0]),document.body.getElementsByClassName("error-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("error-mobile")[0])},computed:{showColorsCustomizations:function(){return!1},showSubcategoriesCustomizations:function(){return!1},visibleCategoriesCustomizations:function(){var t=this,e=[];return this.selectedCategory?e.push(this.selectedCategory):this.selectedCollection&&this.selectedCollection.categories.forEach((function(a){var i=t.categoriesAssets.categories.find((function(t){return t.id===a}));i&&e.push(i)})),e}},methods:{monthsHelper:function(t){switch(t){case 1:return"Janeiro";case 2:return"Fevereiro";case 3:return"Março";case 4:return"Abril";case 5:return"Maio";case 6:return"Junho";case 7:return"Julho";case 8:return"Agosto";case 9:return"Setembro";case 10:return"Outubro";case 11:return"Novembro";case 12:return"Dezembro"}},generateAvatar:function(){var t=this;return v(h().mark((function e(){var a,i,o,r,d,n,s,l,c,p,m,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t,o=!1,t.categoriesAssets.categories.forEach((function(e){e.required?((i=t.customizations.find((function(t){return e.id===t.categoryId})))||(i=t.disabledCategories.find((function(t){return e.id===t.categoryId}))),i||(o=!0,r=e)):(e.code.includes("mooner")||e.code.includes("pet"))&&(i=t.disabledCategories.find((function(t){return e.id===t.categoryId})))})),o){e.next=18;break}return t.$emit("startedMethod"),d=null,n=[],t.customizations.forEach((function(t){var e={parent_id:t.categoryId,id:t.optionId?t.optionId:t.relatedCategoryId};e.parent_id&&e.id&&n.push(e)})),s={properties:a.userDataProperties,type:t.characterTypeId},l={custom_character:{character_id:t.characterId,product_id:t.builderProductId,type_id:t.characterTypeId,categories:n,user_data:s}},t.builderLayoutId&&(l.custom_character.layout_id=t.builderLayoutId),t.language&&(l.custom_character.language=t.language),e.next=14,C({method:"POST",url:"".concat(t.builderApi,"/customs_characters/"),headers:{"Content-Type":"application/json"},data:l}).then((function(t){return t})).catch((function(t){return t}));case 14:(c=e.sent)&&(200===c.status?t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:c.data.custom.uuid,categories:n,success:!0}):(console.log("tentou pegar o segundo request"),c&&c.response&&c.response.reques&&(p=JSON.parse(c.response.request.responseText),d=p?p.error:"Não foi possível gerar o avatar. Tente novamente."),d&&(t.error=d,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)),t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:c.data.custom.uuid,categories:n,success:!1}))),e.next=22;break;case 18:m=r.code,u="pele"===m?"Necessário selecionar um tom de pele":"Necessário selecionar um tipo de ".concat(m),screen.width>1023&&("roupa"===m||"tenis"===m)?(t.error=u,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)):(document.getElementsByClassName("error")[0].style.opacity="1",document.getElementsByClassName("error")[0].textContent=u,setTimeout((function(){document.getElementsByClassName("error")[0].style.opacity="0",document.getElementsByClassName("error")[0].textContent=""}),5e3)),t.$refs[m][0].click();case 22:case"end":return e.stop()}}),e)})))()},getCustomizationTitle:function(t){var e=t?t.toLowerCase():"";switch(e){case"pele":return"Tons de pele";default:return"Tipos de ".concat(e)}},getCustomizationByCategoryId:function(t){return this.customizations.find((function(e){return e.categoryId===t}))},handleSelectCategory:function(t){if(!this.isCategoryDisabled(t)&&this.selectedCategory!==t){this.selectedCharacter.slug;var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];"cabelo"===t.code||"olhos"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):"roupa"===t.code||"tenis"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-out"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0})),this.selectedGroup=null,this.selectedCollection=null,this.selectedCategory=t}},handleSelectGroup:function(t){if(this.selectedGroup!==t){if(screen.width<=1023){var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];this.selectedCharacter.slug;"acessorio"===t.code||"acessorios"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0}))}this.selectedCategory=null,this.selectedCollection=null,this.selectedGroup=t}},handleSelectCollection:function(t){this.selectedCollection!==t&&(this.selectedCategory=null,this.selectedGroup=null,this.selectedCollection=t)},handleUpdateCustomization:function(t){this.$emit("update:customization",t)},isCategoryDisabled:function(t){return void 0!==this.disabledCategories.find((function(e){return e.categoryId===t.id}))},screenResize:function(){if(screen.width>1023){document.getElementsByClassName("customization-preview-asset");
|
|
84
|
-
// const transform = "scale(1) translateY(0)"
|
|
80
|
+
type:{type:String,default:"regular"}},data:function(){return{}}},"data-v-494fbeae",!1,void 0,!1,x,void 0,void 0),C=require("axios"),P=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-panel"},[a("div",{staticClass:"overlay-opacity"}),t._v(" "),a("div",{staticClass:"customization-panel-head"},[a("div",{staticClass:"customization-panel-heading"},[t._v("\n\t\t\t\tEditar o personagem "+t._s(t.characterIsMale?"do":"da")+"\n\t\t\t\t"),a("b",[t._v(t._s(t.characterName))])]),t._v(" "),a("div",{staticClass:"customization-categories"},[t._l(t.categoriesAssets.categories,(function(e){return a("a",{directives:[{name:"show",rawName:"v-show",value:"mooner"!==e.code&&"pet"!==e.code,expression:"category.code !== 'mooner' && category.code !== 'pet'"}],key:e.key,ref:e.code,refInFor:!0,staticClass:"customization-categories-item",class:[{"is-selected":e===t.selectedCategory,"is-disabled":t.isCategoryDisabled(e)},"category-"+e.code],attrs:{id:e.code},on:{click:function(a){return t.handleSelectCategory(e)}}},[e.assets.icon?a("img",{staticClass:"customization-categories-item-icon",attrs:{src:e.assets.icon}}):a("span",{staticClass:"customization-categories-item-icon customization-categories-item-icon-placeholder"}),t._v(" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],1)})),t._v(" "),t._l(t.categoriesAssets.groups,(function(e){return a("a",{key:e.key,ref:e.code,refInFor:!0,staticClass:"customization-categories-item",class:[{"is-selected":e===t.selectedGroup},"category-"+e.code],on:{click:function(a){return t.handleSelectGroup(e)}}},[e.assets.icon?a("img",{staticClass:"customization-categories-item-icon",attrs:{src:e.assets.icon}}):a("span",{staticClass:"customization-categories-item-icon customization-categories-item-icon-placeholder"}),t._v(" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],1)}))],2)]),t._v(" "),a("div",{staticClass:"customization-panel-body",attrs:{id:"customization-panel-body"}},[t._l(t.visibleCategoriesCustomizations,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedCategory,expression:"selectedCategory"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.id),relatedCustomization:t.getCustomizationByCategoryId(e.depends_category),disabledCategories:t.disabledCategories,removableCategory:!e.required},on:{"update:customization":t.handleUpdateCustomization}})})),t._v(" "),t._l(t.categoriesAssets.groups,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedGroup,expression:"selectedGroup"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.assets.subcategories[0].parent_id),removableCategory:!e.required,customizations:t.customizations},on:{"update:customization":t.handleUpdateCustomization}})}))],2),t._v(" "),a("div",{staticClass:"helper"},[a("div",{ref:"error",staticClass:"error",domProps:{innerHTML:t._s(t.error)}}),t._v(" "),a("div",{staticClass:"btn-avatar",on:{click:t.generateAvatar}},[a("div",{staticClass:"btn-avatar-preload"},[t._v("\n\t\t\t\t\tCONTINUAR\n\t\t\t\t\t"),a("div",{staticClass:"icon icon-check"},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36"}},[a("path",{attrs:{fill:"#000","fill-rule":"evenodd",d:"M22.65 17.828a1.996 1.996 0 0 1-.579 1.586l-5.657 5.657a2 2 0 0 1-2.828-2.828L18 17.828l-4.414-4.414a2 2 0 0 1 2.828-2.828l5.657 5.657c.434.434.627 1.018.579 1.585z"}})])])]),t._v(" "),a("div",{staticClass:"btn-avatar-loading"},[a("span",{staticClass:"btn-avatar-loading-content",domProps:{innerHTML:t._s(t.loadingContent)}}),t._v(" "),a("span",{staticClass:"btn-avatar-loading-icon"},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36"}},[a("path",{attrs:{fill:"#000","fill-rule":"evenodd",d:"M26.383 12.728c-.433-.47-.986-.727-1.48-.728-.293 0-.569.092-.776.29l-2.306 2.179v-.002l-3.136 2.963c-.055.052-.093.109-.13.16l-3.008 2.841-3.545-3.855c-.217-.235-.526-.347-.858-.347-.47 0-.992.217-1.424.625-.465.44-.719 1-.72 1.5 0 .298.092.576.287.788l3.25 3.533 1.823 1.981c.214.235.52.344.85.344.147 0 .295-.021.448-.061l.085.002c.292.001.566-.087.776-.284l5.44-5.14c.054-.052.094-.11.13-.162l4.567-4.315c.234-.22.344-.532.344-.87 0-.474-.215-1.002-.617-1.442z"}})])])])])])])},staticRenderFns:[]},(function(t){t&&t("data-v-9bed85a8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.postingCharacter{height:100vh}.customization-panel-heading b{font-weight:400;color:#923fda;text-transform:capitalize}.customization-panel{z-index:100;position:fixed;width:520px;height:100%;top:0;right:0;background:#f8f7fc;border-left:1px solid #dfdae4;transition:all .3s;overflow:hidden}@media (max-width:992px){.customization-panel{width:100%;bottom:0;top:unset;min-height:180px;height:auto}}.customization-panel-head{background:#fff;border-bottom:1px solid #f0ebf5;box-shadow:0 10px 26px 0 #d7d1ef;position:relative;z-index:150}@media (max-width:992px){.customization-panel-head{box-shadow:0 0 26px 0 #d7d1ef}}.customization-panel-heading{height:80px;max-width:100%;line-height:80px;text-align:center;font-family:Roboto,sans-serif;color:#afa2ba;background:#fff;border-bottom:1px solid #dfdae4;font-size:16px}@media (max-width:992px){.customization-panel-heading{display:none}}.customization-panel-body{height:70%;scroll-behavior:smooth;padding-bottom:70px;z-index:20;overflow-y:auto;position:relative}.customization-panel-body::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.customization-panel-body::-webkit-scrollbar{width:7px;background-color:transparent}.customization-panel-body::-webkit-scrollbar-thumb{border-radius:20px;background-color:#e4e4e4}@media (max-width:992px){.customization-panel-body{padding-bottom:0;z-index:0}}.customization-panel .helper{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #dfdae4;box-shadow:0 0 26px 0 #d7d1ef;padding:.7619047619rem 1.1428571429rem;display:flex;align-items:center;justify-content:center;z-index:999}@media (max-width:992px){.customization-panel .helper{display:none;z-index:0}}.customization-panel .helper .error{background:red;width:100%;color:#fff;font-family:Roboto,sans-serif;font-size:14px;padding:15px 0;text-align:center;text-transform:uppercase;position:absolute;transition:all .3s;top:-45px;opacity:0}.btn-avatar{width:100%;height:65px;font-family:Nunito;font-weight:900;padding:0!important;background:#12d3db;background-size:200%;background-position-x:99%;box-shadow:0 .2381rem .95238rem 0 #89e6e8;border-radius:1.90476rem;color:#fff;transition:all .2s cubic-bezier(.4,0,.2,1);border:0;font-size:14px;letter-spacing:.0381rem;line-height:1.2rem;position:relative;display:flex;align-items:center;justify-content:center}.btn-avatar:hover{box-shadow:0 .2381rem .95238rem 0 #89e6e8;-webkit-transform:translateY(-.09524rem);transform:translateY(-.09524rem);cursor:pointer;background-position-x:0;-webkit-transform:translateY(-.14286rem);transform:translateY(-.14286rem);color:#fff}.btn-avatar:active,.btn-avatar:focus{outline:0;box-shadow:0 0 0 #89e6e8;background-position-x:0;-webkit-transform:translateY(.14286rem) scale(.97);transform:translateY(.14286rem) scale(.97)}.btn-avatar .icon{position:absolute;display:flex;justify-content:center;align-items:center;right:0;top:0;margin:15px!important}.btn-avatar .icon path,.btn-avatar .icon svg{fill:#fff;stroke:#fff}@media (max-width:992px){.btn-avatar{display:none!important}}.btn-avatar-mobile{display:none!important}@media (max-width:992px){.btn-avatar-mobile{display:flex!important;width:150px;height:40px;box-shadow:none;font-size:12px;float:right;line-height:1;position:fixed;right:0;top:10px;z-index:200;border-radius:100px;margin-right:.7619047619rem}.btn-avatar-mobile .icon{display:none}}.customization-categories{display:flex;align-items:center;align-content:center;padding:.7619047619rem .7619047619rem}@media (max-width:992px){.customization-categories{padding:0}}.customization-categories .category-vestuario{display:none!important}.customization-categories-item{position:relative;font-size:inherit;flex-basis:0;flex-grow:1;max-width:100%;height:100%;text-align:center}.customization-categories-item:hover{cursor:pointer}.customization-categories-item:hover .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item{height:50px;display:flex;justify-content:center;align-items:center;border:0}}.customization-categories-item-icon{height:52px;width:52px;display:block;border-radius:30px;margin:auto}.customization-categories-item-icon-placeholder{background-color:#dfdae4;border-radius:2px}@media (max-width:992px){.customization-categories-item-icon{display:none}}.customization-categories-item-label{font-weight:400;display:block;font-size:12px;color:#000;text-transform:capitalize!important;font-family:Roboto;padding-top:.380952381rem}@media (max-width:992px){.customization-categories-item-label{margin:0}}.customization-categories-item:first-child{border-left:none}.customization-categories-item.is-selected .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item.is-selected:after{content:"";position:absolute;left:0;bottom:-2px;width:100%;height:3px;background:#12d3db}}@media (max-width:992px) and (max-width:992px){.customization-categories-item.is-selected:after{bottom:0}}.customization-categories-item.is-disabled{opacity:.6}.btn-avatar-reduced{background:#2dd4d9!important;width:65px!important;cursor:wait}@media (max-width:479px){.btn-avatar-reduced{width:40px!important;height:40px!important}}.btn-avatar-loading-completed{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-position:0 0;background-repeat:no-repeat;-webkit-animation:1s loadingCompleted;-moz-animation:1s loadingCompleted;animation:1s loadingCompleted;cursor:wait}@-webkit-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@-moz-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}.btn-avatar-loading-started{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-repeat:no-repeat;background-position:41% 0;-webkit-animation:4s loadingPosition;-moz-animation:4s loadingPosition;animation:4s loadingPosition;transition:.3s;cursor:wait}@-webkit-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@-moz-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}.btn-avatar-loading{font-size:1.4285714286rem;display:none;opacity:0;transition:all .3s;font-size:14px;cursor:wait}.btn-avatar-loading .btn-avatar-loading-icon{display:none;opacity:0;align-items:center;justify-content:center}.btn-avatar-loading .btn-avatar-loading-icon svg{width:2.1904761905rem;height:2.1904761905rem}@media (max-width:479px){.btn-avatar-loading .btn-avatar-loading-icon svg{width:3.5514018692rem;height:3.5514018692rem}}.btn-avatar-loading .btn-avatar-loading-icon path,.btn-avatar-loading .btn-avatar-loading-icon svg{fill:#fff;stroke:#fff}@media (max-width:479px){.btn-avatar-loading{font-size:12px}.btn-avatar-loading .btn-avatar-loading-content{font-size:12px}}',map:void 0,media:void 0})}),{name:"CustomizationPanel",components:{CategoryCustomizations:k,Caption:_},props:{builderApi:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},selectedCharacter:{type:Object,default:{}},characterSlug:{type:String,required:!0},characterId:{type:[Number,String],required:!0},characterTypeId:{type:[Number,String],required:!0},characterName:{type:String,required:!0},characterIsMale:{type:Boolean,required:!0},categoriesAssets:{type:Object,required:!0},disabledCategories:{type:Array,required:!1,default:function(){return[]}},customizations:{type:Array,required:!0},builderProductId:{type:[String,Number],required:!1,default:null},subscriptionId:{type:[Number,String],required:!0},stackId:{type:[Number,String],required:!0},userDataProperties:{type:Object,required:!0},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{selectedCategory:null,selectedGroup:null,selectedCollection:null,error:null,isMobile:null,loadingContent:screen.width<1023?"ENVIANDO":"ENVIANDO PERSONAGEM"}},mounted:function(){if(!document.body.getElementsByClassName("btn-avatar-mobile")[0]){var t=document.getElementsByClassName("btn-avatar")[0].cloneNode(!0);t.classList.add("btn-avatar-mobile"),document.body.appendChild(t),document.body.getElementsByClassName("btn-avatar-mobile")[0].addEventListener("click",this.generateAvatar)}var e=document.getElementsByClassName("top-bar")[0];if(screen.width<=1023&&e&&!e.getElementsByClassName("overlay-opacity")[0]){var a=document.getElementsByClassName("overlay-opacity")[0].cloneNode(!0);e.appendChild(a)}if(!document.body.getElementsByClassName("error-mobile")[0]){var i=document.getElementsByClassName("error")[0].cloneNode(!0);i.classList.add("error-mobile"),document.body.appendChild(i)}window.addEventListener("resize",this.screenResize),screen.width>1023?this.isMobile=!1:this.isMobile=!0},beforeDestroy:function(){document.body.getElementsByClassName("btn-avatar-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("btn-avatar-mobile")[0]),document.body.getElementsByClassName("error-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("error-mobile")[0])},computed:{showColorsCustomizations:function(){return!1},showSubcategoriesCustomizations:function(){return!1},visibleCategoriesCustomizations:function(){var t=this,e=[];return this.selectedCategory?e.push(this.selectedCategory):this.selectedCollection&&this.selectedCollection.categories.forEach((function(a){var i=t.categoriesAssets.categories.find((function(t){return t.id===a}));i&&e.push(i)})),e}},methods:{monthsHelper:function(t){switch(t){case 1:return"Janeiro";case 2:return"Fevereiro";case 3:return"Março";case 4:return"Abril";case 5:return"Maio";case 6:return"Junho";case 7:return"Julho";case 8:return"Agosto";case 9:return"Setembro";case 10:return"Outubro";case 11:return"Novembro";case 12:return"Dezembro"}},generateAvatar:function(){var t=this;return v(h().mark((function e(){var a,i,o,r,d,n,s,l,c,p,m,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t,o=!1,t.categoriesAssets.categories.forEach((function(e){e.required?((i=t.customizations.find((function(t){return e.id===t.categoryId})))||(i=t.disabledCategories.find((function(t){return e.id===t.categoryId}))),i||(o=!0,r=e)):(e.code.includes("mooner")||e.code.includes("pet"))&&(i=t.disabledCategories.find((function(t){return e.id===t.categoryId})))})),o){e.next=18;break}return t.$emit("startedMethod"),d=null,n=[],t.customizations.forEach((function(t){var e={parent_id:t.categoryId,id:t.optionId?t.optionId:t.relatedCategoryId};e.parent_id&&e.id&&n.push(e)})),s={properties:a.userDataProperties,type:t.characterTypeId},l={custom_character:{character_id:t.characterId,product_id:t.builderProductId,type_id:t.characterTypeId,categories:n,user_data:s}},t.builderLayoutId&&(l.custom_character.layout_id=t.builderLayoutId),t.language&&(l.custom_character.language=t.language),e.next=14,C({method:"POST",url:"".concat(t.builderApi,"/customs_characters/"),headers:{"Content-Type":"application/json"},data:l}).then((function(t){return t})).catch((function(t){return t}));case 14:(c=e.sent)&&(200===c.status?t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:c.data.custom.uuid,categories:n,success:!0}):(console.log("tentou pegar o segundo request"),c&&c.response&&c.response.reques&&(p=JSON.parse(c.response.request.responseText),d=p?p.error:"Não foi possível gerar o avatar. Tente novamente."),d&&(t.error=d,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)),t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:c.data.custom.uuid,categories:n,success:!1}))),e.next=22;break;case 18:m=r.code,u="pele"===m?"Necessário selecionar um tom de pele":"Necessário selecionar um tipo de ".concat(m),screen.width>1023&&("roupa"===m||"tenis"===m)?(t.error=u,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)):(document.getElementsByClassName("error")[0].style.opacity="1",document.getElementsByClassName("error")[0].textContent=u,setTimeout((function(){document.getElementsByClassName("error")[0].style.opacity="0",document.getElementsByClassName("error")[0].textContent=""}),5e3)),t.$refs[m][0].click();case 22:case"end":return e.stop()}}),e)})))()},getCustomizationTitle:function(t){var e=t?t.toLowerCase():"";switch(e){case"pele":return"Tons de pele";default:return"Tipos de ".concat(e)}},getCustomizationByCategoryId:function(t){return this.customizations.find((function(e){return e.categoryId===t}))},handleSelectCategory:function(t){if(!this.isCategoryDisabled(t)&&this.selectedCategory!==t){this.selectedCharacter.slug;var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];"cabelo"===t.code||"olhos"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):"roupa"===t.code||"tenis"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-out"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0})),this.selectedGroup=null,this.selectedCollection=null,this.selectedCategory=t}},handleSelectGroup:function(t){if(this.selectedGroup!==t){if(screen.width<=1023){var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];this.selectedCharacter.slug;"acessorio"===t.code||"acessorios"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0}))}this.selectedCategory=null,this.selectedCollection=null,this.selectedGroup=t}},handleSelectCollection:function(t){this.selectedCollection!==t&&(this.selectedCategory=null,this.selectedGroup=null,this.selectedCollection=t)},handleUpdateCustomization:function(t){this.$emit("update:customization",t)},isCategoryDisabled:function(t){return void 0!==this.disabledCategories.find((function(e){return e.categoryId===t.id}))},screenResize:function(){if(screen.width>1023){document.getElementsByClassName("customization-preview-asset");// const transform = "scale(1) translateY(0)"
|
|
85
81
|
// Array.from(avatar).forEach(piece => {
|
|
86
82
|
// piece.style.transform = transform
|
|
87
83
|
// })
|
|
88
|
-
this.isMobile&&(this.isMobile=!1)}else this.isMobile||(this.isMobile=!0);this.categoriesAssets&&this.categoriesAssets.categories&&(this.selectedCategory=this.categoriesAssets.categories[0]),this.selectedGroup=null,this.selectedCollection=null}},updated:function(){!this.categoriesAssets||!this.categoriesAssets.categories||this.selectedCategory||this.selectedGroup||this.selectedCollection||(this.selectedCategory=this.categoriesAssets.categories[0])}},void 0,!1,void 0,!1,x,void 0,void 0),M=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-preview",class:"avatar-"+t.characterSlug,style:t.gradientColors&&t.gradientColors.bgInner?"background-image: radial-gradient(circle, "+t.gradientColors.bgInner+" 0%, "+t.gradientColors.bgCentral+" 10%, "+t.gradientColors.bgOuter+" 100%);":null},[a("div",{staticClass:"overlay-opacity"}),t._v(" "),a("div",{staticClass:"customization-preview-stage"},t._l(t.customizations,(function(e){return a("img",{key:e.categoryId,staticClass:"customization-preview-asset",class:t.characterHeight?"alt":"com",style:[{transform:"scale("+t.selectedCharacter.fixers.size*t.scaleFixerMobile+") translate("+(t.selectedCharacter.fixers.x*t.scaleFixerMobile-32)+"px, "+(t.selectedCharacter.fixers.y*t.scaleFixerMobile-28)+"px)",zIndex:null!=e.priorityZIndex?e.priorityZIndex:e.zIndex?e.zIndex:e.categoryZIndex}],attrs:{src:e.optionAsset}})})),0)])},staticRenderFns:[]},(function(t){t&&t("data-v-f9a501c8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.customization-preview{position:relative;width:calc(100vw - 520px);height:100vh;transition:all .5s}@media (max-width:479px){.customization-preview{height:calc(var(--vh,1vh) * 100 - var(--cp));width:100%;top:0;min-width:100vw}}.customization-preview-asset{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s}.customization-preview.zoom-in{transform:scale(1.8) translate(-2%,10%)!important}@media (max-width:479px){.customization-preview.zoom-in{transform:scale(1.7) translate(0,12%)!important}}',map:void 0,media:void 0})}),{name:"CustomizationPreview",props:{customizations:{type:Array,required:!0},selectedCharacter:{type:Object,required:!0},characterHeight:{type:Number,default:0},gradientColors:{type:Object,required:!1},characterSlug:{type:String,required:!1,default:"noone"}},data:function(){return{screenWidth:null,isMobile:!1,scaleFixer:1.2,scaleFixerMobile:1.1}},mounted:function(){var t=this;console.log(t.isMobile);var e=document.querySelector(".customization-panel").clientHeight;console.log(document.documentElement.style),document.documentElement.style.setProperty("--cp","".concat(e,"px")),this.screenWidth=screen.width,t.detectSize(),window.addEventListener("resize",(function(e){t.detectSize();
|
|
89
|
-
//alert(self.isMobile);
|
|
84
|
+
this.isMobile&&(this.isMobile=!1)}else this.isMobile||(this.isMobile=!0);this.categoriesAssets&&this.categoriesAssets.categories&&(this.selectedCategory=this.categoriesAssets.categories[0]),this.selectedGroup=null,this.selectedCollection=null}},updated:function(){!this.categoriesAssets||!this.categoriesAssets.categories||this.selectedCategory||this.selectedGroup||this.selectedCollection||(this.selectedCategory=this.categoriesAssets.categories[0])}},void 0,!1,void 0,!1,x,void 0,void 0),M=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-preview",class:"avatar-"+t.characterSlug,style:t.gradientColors&&t.gradientColors.bgInner?"background-image: radial-gradient(circle, "+t.gradientColors.bgInner+" 0%, "+t.gradientColors.bgCentral+" 10%, "+t.gradientColors.bgOuter+" 100%);":null},[a("div",{staticClass:"overlay-opacity"}),t._v(" "),a("div",{staticClass:"customization-preview-stage"},t._l(t.customizations,(function(e){return a("img",{key:e.categoryId,staticClass:"customization-preview-asset",class:t.characterHeight?"alt":"com",style:[{transform:"scale("+t.selectedCharacter.fixers.size*t.scaleFixerMobile+") translate("+(t.selectedCharacter.fixers.x*t.scaleFixerMobile-32)+"px, "+(t.selectedCharacter.fixers.y*t.scaleFixerMobile-28)+"px)",zIndex:null!=e.priorityZIndex?e.priorityZIndex:e.zIndex?e.zIndex:e.categoryZIndex}],attrs:{src:e.optionAsset}})})),0)])},staticRenderFns:[]},(function(t){t&&t("data-v-f9a501c8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.customization-preview{position:relative;width:calc(100vw - 520px);height:100vh;transition:all .5s}@media (max-width:479px){.customization-preview{height:calc(var(--vh,1vh) * 100 - var(--cp));width:100%;top:0;min-width:100vw}}.customization-preview-asset{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s}.customization-preview.zoom-in{transform:scale(1.8) translate(-2%,10%)!important}@media (max-width:479px){.customization-preview.zoom-in{transform:scale(1.7) translate(0,12%)!important}}',map:void 0,media:void 0})}),{name:"CustomizationPreview",props:{customizations:{type:Array,required:!0},selectedCharacter:{type:Object,required:!0},characterHeight:{type:Number,default:0},gradientColors:{type:Object,required:!1},characterSlug:{type:String,required:!1,default:"noone"}},data:function(){return{screenWidth:null,isMobile:!1,scaleFixer:1.2,scaleFixerMobile:1.1}},mounted:function(){var t=this;console.log(t.isMobile);var e=document.querySelector(".customization-panel").clientHeight;console.log(document.documentElement.style),document.documentElement.style.setProperty("--cp","".concat(e,"px")),this.screenWidth=screen.width,t.detectSize(),window.addEventListener("resize",(function(e){t.detectSize();//alert(self.isMobile);
|
|
90
85
|
}))},methods:{detectSize:function(){this.isMobile=!1,this.screenWidth<990&&(this.isMobile=!0)}}},void 0,!1,void 0,!1,x,void 0,void 0),S=require("axios"),N=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("link",{attrs:{rel:"stylesheet",href:"https://use.fontawesome.com/releases/v5.8.1/css/all.css",integrity:"sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf",crossorigin:"anonymous"}}),t._v(" "),a("div",{staticClass:"mobile-tooltip",on:{click:t.removeTooltip}},[t._m(0)]),t._v(" "),a("CustomizationPreview",{attrs:{customizations:t.customizations,"selected-character":t.selectedCharacter,"character-height":t.characterHeight?t.characterHeight:null,"gradient-colors":t.gradient_colors,"character-slug":t.custom_properties.slug,characterHeight:1}}),t._v(" "),a("CustomizationPanel",{attrs:{"builder-api":t.builder_api,"selected-character":t.selectedCharacter,"character-name":t.custom_properties.user_data.properties.nome.value,"subscription-id":"1","stack-id":"1","character-slug":t.custom_properties.slug,"character-id":t.characterId,"character-type-id":t.characterTypeId,"character-is-male":t.custom_properties.is_male,"categories-assets":t.categoriesAssets,"disabled-categories":t.disabledCategories,customizations:t.customizations,"builder-product-id":t.builderProductId?t.builderProductId:this.custom_properties.product_id,userDataProperties:t.custom_properties.user_data.properties,builderLayoutId:t.builderLayoutId,language:t.language},on:{"update:customization":t.handleCustomization,startedMethod:t.startedMethod,completedMethod:t.completedMethod}})],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"tooltip"},[this._v("\n\t\t\tLorem ipsum dolor sit amet, eum ne sale vidit epicuri, usu populo\n\t\t\tincorrupte ex. His falli intellegebat no.\n\t\t\t"),e("i",{staticClass:"fas fa-times"})])}]},(function(t){t&&t("data-v-264948b7_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.mobile-tooltip{display:none}@media (max-width:992px){.mobile-tooltip{display:none;position:absolute;z-index:90000000;height:calc(100vh - 59px);width:100%;transition:all .3s;bottom:0}.mobile-tooltip .tooltip{border-radius:5px;color:#fff;font-size:14px;padding:10px 36px 10px 16px;width:350px;margin-left:15px;box-shadow:0 1px 2px 0 rgba(0,0,0,.31);line-height:1.5;position:relative;margin-top:auto;bottom:calc(var(--cp) + 25px)}.mobile-tooltip .tooltip:after{top:100%;left:5%;border:solid transparent;content:" ";position:absolute;border-width:10px}.mobile-tooltip .tooltip i{position:absolute;right:10px;top:10px}}',map:void 0,media:void 0})}),{name:"CustomizationView",components:{CustomizationPanel:P,CustomizationPreview:M},props:{custom_properties:{type:Object,required:!0},builder_api:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},is_subscription:{type:Boolean,default:!1},gradient_colors:{type:Object,required:!1},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{categoriesAssets:{},customizations:[],
|
|
91
86
|
// Velho e bom customizations
|
|
92
87
|
requiredCategories:[],
|
|
@@ -116,8 +111,7 @@ initDisabledCategories:function(){var t=this;this.customizations.forEach((functi
|
|
|
116
111
|
i=t.categoriesAssets.groups.find((function(t){t.groupedCategories.includes(e.categoryId)}))),i){
|
|
117
112
|
// Caso a categoria dependa de outra descemos o nível da arvore
|
|
118
113
|
// de assets para pegar apenas as subcategorias e cores dependêntes
|
|
119
|
-
if(i.depends_category){var o=t.getCustomization(i.depends_category);i=i.assets.categories.find((function(t){return a=o.optionId,t.parent_id===a}))}
|
|
120
|
-
// Buscando a subbategoria com as informações a respeito das
|
|
114
|
+
if(i.depends_category){var o=t.getCustomization(i.depends_category);i=i.assets.categories.find((function(t){return a=o.optionId,t.parent_id===a}))}// Buscando a subbategoria com as informações a respeito das
|
|
121
115
|
// categorias para desabilitar
|
|
122
116
|
a=e.optionId;var r=i.assets.subcategories.find((function(t){if(t.assets.colors&&t.assets.colors.length){var e=!1;return t.assets.colors.forEach((function(t){t.id===a&&(e=!0)})),e}return t.id===a}));r&&t.updateDisabledCategories(e,r.disable)}}))},
|
|
123
117
|
/*
|
|
@@ -129,8 +123,7 @@ initDefaultCustomizationCharacter:function(){var t,e=this,a=[];
|
|
|
129
123
|
* Definindo as customizações default das categorias sem
|
|
130
124
|
* dependencia
|
|
131
125
|
*/
|
|
132
|
-
this.categoriesAssets.categories.forEach((function(i){i.depends_category?a.push(i):(t=e.getCategoryDefaultCustomization(i),i.code.includes("mooner")&&(console.log(i)
|
|
133
|
-
// c.assets.subcategories[0].parent_id;
|
|
126
|
+
this.categoriesAssets.categories.forEach((function(i){i.depends_category?a.push(i):(t=e.getCategoryDefaultCustomization(i),i.code.includes("mooner")&&(console.log(i),// c.assets.subcategories[0].parent_id;
|
|
134
127
|
// null
|
|
135
128
|
// c.assets.subcategories[0].id;
|
|
136
129
|
// c.assets.subcategories[0].name;
|
|
@@ -148,8 +141,7 @@ loadCustomizationCharacter:function(){var t=this;return v(h().mark((function e()
|
|
|
148
141
|
// Verifica se há outra customização que deve ser atualizada
|
|
149
142
|
// em função dessa atualização e atualiza essa customização
|
|
150
143
|
// antes
|
|
151
|
-
this.handleUpdateRelatedCategories(e);var l=this.updateCustomizations(e.categoryId,e.relatedCategoryId,e.optionId,e.optionName,e.optionAsset,e.optionZIndex,e.categoryZIndex,o,d,s)
|
|
152
|
-
// Desabilitando categorias associadas a customização
|
|
144
|
+
this.handleUpdateRelatedCategories(e);var l=this.updateCustomizations(e.categoryId,e.relatedCategoryId,e.optionId,e.optionName,e.optionAsset,e.optionZIndex,e.categoryZIndex,o,d,s);// Desabilitando categorias associadas a customização
|
|
153
145
|
this.updateDisabledCategories(l,a)},
|
|
154
146
|
/**
|
|
155
147
|
* Essa funçaão recebe a customização da categoria pai
|
|
@@ -162,8 +154,7 @@ handleUpdateRelatedCategories:function(t){var e=this;this.categoriesAssets.categ
|
|
|
162
154
|
// Pegando a customização da categoria relacionada
|
|
163
155
|
// e recuperando a subcategoryId para atualizar depois
|
|
164
156
|
// as informações de customização da categoria relacionada
|
|
165
|
-
var i=e.getCustomization(a.id),o=null,r=null;if(!i)return;a.assets.categories.forEach((function(t){t.assets.subcategories.forEach((function(t){t.assets.colors.forEach((function(e){e.id===i.optionId&&(o=t)}))}))})),(
|
|
166
|
-
// Procurando a nova subcategoria
|
|
157
|
+
var i=e.getCustomization(a.id),o=null,r=null;if(!i)return;a.assets.categories.forEach((function(t){t.assets.subcategories.forEach((function(t){t.assets.colors.forEach((function(e){e.id===i.optionId&&(o=t)}))}))})),(// Procurando a nova subcategoria
|
|
167
158
|
// já com a referência correta da categoria
|
|
168
159
|
r=a.assets.categories.find((function(e){return e.parent_id===t.optionId})))&&r.assets.subcategories.forEach((function(t){t.id===o.id&&t.assets.colors.forEach((function(e){e.hexa===i.optionName&&(i.optionId=e.id,i.optionName=e.hexa,i.optionAsset=e.assets.asset,i.optionZIndex=t.z_index)}))}))}}))},fakeData:function(){var t=this.categoriesAssets.categories[0]?this.categoriesAssets.categories[0].id:0,e=this.categoriesAssets.categories[1]?this.categoriesAssets.categories[1].id:0;this.categoriesAssets.collections=[],this.categoriesAssets.collections.push({id:1e4,name:"Vestuario",icon:"https://dka04237waacy.cloudfront.net/uploads/turma-da-monica/tp-corpo-branco-3.png",categories:[t,e]})},parseCollection:function(){var t=this;this.categoriesAssets.collections&&this.categoriesAssets.collections[0]&&this.categoriesAssets.collections[0].categories.forEach((function(e,a){t.categoriesAssets.collections[0].categories[a]=parseInt(e)}))},removeTooltip:function(){var t=document.getElementsByClassName("mobile-tooltip")[0];t.parentNode.removeChild(t)}}},void 0,!1,void 0,!1,x,void 0,void 0),E=require("axios"),L=b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"avatar-page"},[a("CustomizationView",{attrs:{custom_properties:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,is_male:t.is_male,slug:t.character_slug,uuid:t.uuid,user_data:{properties:t.custom_properties,type_id:t.type_id}},gradient_colors:t.gradient_colors,is_subscription:t.is_subscription,builder_api:"https://builder.dentrodahistoria.com.br/api",builderLayoutId:t.builderLayoutId,language:t.language},on:{startedMethod:t.started,completedMethod:t.completed}})],1)},staticRenderFns:[]},(function(t){t&&t("data-v-1969f868_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);[data-v-1969f868]:root{--column-width:6.6666666667vw}@media (min-width:0px){[data-v-1969f868]:root{--column-width:6.6666666667vw}}@media (min-width:480px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:0px){html[data-v-1969f868]{font-size:2.9166666667vw}}@media (min-width:480px){html[data-v-1969f868]{font-size:14px}}@media (min-width:1024px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1920px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:2620px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html[data-v-1969f868]{font-size:1.5648854962vw}}@media (min-width:2620px){html[data-v-1969f868]{font-size:1.56vw}}html[data-v-1969f868]{box-sizing:border-box}*[data-v-1969f868],[data-v-1969f868]::after,[data-v-1969f868]::before{box-sizing:border-box}hr[data-v-1969f868]{margin:10px -1.5rem}h1[data-v-1969f868]{font-family:Nunito;font-size:24px;font-weight:900;font-style:normal;font-stretch:normal;line-height:normal;letter-spacing:normal;color:#000;margin-top:0;margin-bottom:15px}h1[data-v-1969f868]:first-child{display:none}.ddh-sidebar[data-v-1969f868],.ddh-sidebar.hide-sidebar[data-v-1969f868]{display:none!important}html[data-v-1969f868]{--scale:1;--translate:0%}.loading-view[data-v-1969f868]{position:absolute;top:0;width:100%;height:100%;background:#fff;position:absolute;width:100%;top:0;z-index:200;display:flex;align-items:center;justify-content:center;flex-direction:column}.avatar-page-1[data-v-1969f868]{position:absolute;z-index:3}.avatar-page[data-v-1969f868]{min-height:100vh;position:absolute;width:100%;height:100vh;top:0;left:0;background:#fff}@media (max-width:992px){.avatar-page[data-v-1969f868]{min-height:0;height:100vh;height:calc(var(--vh,1vh) * 100);overflow:hidden}}.return[data-v-1969f868]{position:fixed;z-index:99}.return .icon[data-v-1969f868]{width:38px;height:38px;position:absolute;z-index:30;padding:.95238rem 2.77778vw}.return .icon svg[data-v-1969f868]{width:38px;height:38px}.return .icon svg path[data-v-1969f868]{fill:#afa2ba!important;stroke:#afa2ba!important;transition:all .1s cubic-bezier(.4,0,.2,1)}.return .icon[data-v-1969f868]:hover{cursor:pointer}.return .icon:hover path[data-v-1969f868],.return .icon:hover svg[data-v-1969f868]{fill:#1ad3d9!important;stroke:#1ad3d9!important}.return .icon:active svg[data-v-1969f868]{transform:scale(.9)}',map:void 0,media:void 0})}),{name:"Avatar",components:{CustomizationView:N},props:{
|
|
169
160
|
/**
|
|
@@ -327,8 +318,7 @@ loadingProgress:{type:Number,required:!1},
|
|
|
327
318
|
*/
|
|
328
319
|
isLoadingCompleted:{type:Boolean,required:!1}},watch:{isLoadingCompleted:{
|
|
329
320
|
// the callback will be called immediately after the start of the observation
|
|
330
|
-
immediate:!0,handler:function(t,e){var a=this;!0===t?setTimeout((function(){a.isLoadingCompleteCheck=!0}),3e3):a.isLoadingCompleteCheck=!1
|
|
331
|
-
// if(this.initialValue === ''){
|
|
321
|
+
immediate:!0,handler:function(t,e){var a=this;!0===t?setTimeout((function(){a.isLoadingCompleteCheck=!0}),3e3):a.isLoadingCompleteCheck=!1;// if(this.initialValue === ''){
|
|
332
322
|
// this.initialValue = val
|
|
333
323
|
// }
|
|
334
324
|
// this.finalValue = val
|
|
@@ -540,8 +530,7 @@ link:{type:String,required:!1},
|
|
|
540
530
|
* Existe campo de validação<br>
|
|
541
531
|
* Values: `lg` `sm`
|
|
542
532
|
*/
|
|
543
|
-
linkLabel:{type:String,required:!1}},data:function(){return{isCallingOne:!1,isCallingAll:!1,condCpfCnpn:this.onChangeCpf,cpf:{numero:"",cpfLengthUnmasked:11,cpfLengthMasked:14},card:{mask:"#### #### #### ####",length:17,flag:"",error:""}}},methods:{onChangeCardNumber:function(t){t.e;var e=t.target;if(e.value.length>=3){a.number(e.value).card?("american-express"===a.number(e.value).card.type||"diners-club"===a.number(e.value).card.type?(this.card.mask="#### ###### #####",this.card.length=17):(this.card.mask="#### #### #### ####",this.card.length=19),this.card.flag=a.number(e.value).card.type):this.card.flag="",e.value.length>=this.card.length&&(a.number(e.value).isValid?this.card.error="":this.card.error="Número incorreto");var i={target:e.name,value:e.value,flag:this.card.flag,error:this.card.error};this.$emit("update",i)}else{this.card.flag="",this.card.error="";var o={target:e.name,value:e.value,flag:""};this.$emit("update",o)}},onChangeCardExpiration:function(t){t.e;var e,i=t.target;if(5===i.value.length){e=a.expirationDate(i.value).isValid?"":"Data de validade inválida";var o={target:i.name,value:i.value,error:e};this.$emit("update",o)}else{e="";var r={target:i.name,value:i.value};this.$emit("update",r)}},condCpfCnpj:function(t){t.target.value.length<=14?this.onChangeCpf(t,t.target):this.onChangeCnpj(t,t.target)},onChangeCnpj:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^\d]+/g,"");if(i.length>=13)if(""==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else if("00000000000000"==i
|
|
544
|
-
// Elimina CNPJs invalidos conhecidos
|
|
533
|
+
linkLabel:{type:String,required:!1}},data:function(){return{isCallingOne:!1,isCallingAll:!1,condCpfCnpn:this.onChangeCpf,cpf:{numero:"",cpfLengthUnmasked:11,cpfLengthMasked:14},card:{mask:"#### #### #### ####",length:17,flag:"",error:""}}},methods:{onChangeCardNumber:function(t){t.e;var e=t.target;if(e.value.length>=3){a.number(e.value).card?("american-express"===a.number(e.value).card.type||"diners-club"===a.number(e.value).card.type?(this.card.mask="#### ###### #####",this.card.length=17):(this.card.mask="#### #### #### ####",this.card.length=19),this.card.flag=a.number(e.value).card.type):this.card.flag="",e.value.length>=this.card.length&&(a.number(e.value).isValid?this.card.error="":this.card.error="Número incorreto");var i={target:e.name,value:e.value,flag:this.card.flag,error:this.card.error};this.$emit("update",i)}else{this.card.flag="",this.card.error="";var o={target:e.name,value:e.value,flag:""};this.$emit("update",o)}},onChangeCardExpiration:function(t){t.e;var e,i=t.target;if(5===i.value.length){e=a.expirationDate(i.value).isValid?"":"Data de validade inválida";var o={target:i.name,value:i.value,error:e};this.$emit("update",o)}else{e="";var r={target:i.name,value:i.value};this.$emit("update",r)}},condCpfCnpj:function(t){t.target.value.length<=14?this.onChangeCpf(t,t.target):this.onChangeCnpj(t,t.target)},onChangeCnpj:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^\d]+/g,"");if(i.length>=13)if(""==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else if("00000000000000"==i||// Elimina CNPJs invalidos conhecidos
|
|
545
534
|
"11111111111111"==i||"22222222222222"==i||"33333333333333"==i||"44444444444444"==i||"55555555555555"==i||"66666666666666"==i||"77777777777777"==i||"88888888888888"==i||"99999999999999"==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else{for(
|
|
546
535
|
// Valida DVs
|
|
547
536
|
var o=i.length-2,r=i.substring(0,o),d=i.substring(o),n=0,s=o-7,l=o;l>=1;l--)n+=r.charAt(o-l)*s--,s<2&&(s=9);var c=n%11<2?0:11-n%11;if(c!=d.charAt(0))e={target:a.name,value:a.value,error:"CNPJ inválido"};else{o+=1,r=i.substring(0,o),n=0,s=o-7;for(var p=o;p>=1;p--)n+=r.charAt(o-p)*s--,s<2&&(s=9);e=(c=n%11<2?0:11-n%11)!=d.charAt(1)?{target:a.name,value:a.value,error:"CNPJ inválido"}:{target:a.name,value:a.value,error:""}}}else e={target:a.name,value:a.value,error:""};this.$emit("update",e)},onChangeCpf:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^0-9]/g,"");if(i.length===this.cpf.cpfLengthUnmasked){var o,r,d;d="",o=0,"00000000000"!==i&&"11111111111"!==i&&"22222222222"!==i&&"33333333333"!==i&&"44444444444"!==i&&"55555555555"!==i&&"66666666666"!==i&&"77777777777"!==i&&"88888888888"!==i&&"99999999999"!==i||(d="CPF Inválido");for(var n=1;n<=9;n++)o+=parseInt(i.substring(n-1,n))*(11-n);10!==(r=10*o%11)&&11!==r||(r=0),r!==parseInt(i.substring(9,10))&&(d="CPF Inválido"),o=0;for(var s=1;s<=10;s++)o+=parseInt(i.substring(s-1,s))*(12-s);10!==(r=10*o%11)&&11!==r||(r=0),r!==parseInt(i.substring(10,11))&&(d="CPF Inválido"),e={target:a.name,value:a.value,error:d}}else e={target:a.name,value:a.value,error:""};
|
|
@@ -1311,30 +1300,23 @@ o="",r=1;case 5:if(!(r<6)){e.next=13;break}return e.next=8,a.getImagePuzzle(r);c
|
|
|
1311
1300
|
// "&v=0&update=" +
|
|
1312
1301
|
// n +
|
|
1313
1302
|
// "' alt=''></div>";
|
|
1314
|
-
return _t("#flipbook").html(o),e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)})))()},initBook:function(){var t=this,e=t.resize();this.flipbookWidth=e.width,this.flipbookHeight=e.height
|
|
1315
|
-
// this.flipbookWidth = self.formato === "square" ? "100vh" : "100vh";
|
|
1303
|
+
return _t("#flipbook").html(o),e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)})))()},initBook:function(){var t=this,e=t.resize();this.flipbookWidth=e.width,this.flipbookHeight=e.height,// this.flipbookWidth = self.formato === "square" ? "100vh" : "100vh";
|
|
1316
1304
|
// this.flipbookHeight =
|
|
1317
1305
|
// self.formato === "square"
|
|
1318
1306
|
// ? "calc(100vh - 91px)"
|
|
1319
1307
|
// : "calc(100vh - 91px)";
|
|
1320
|
-
_t("#flipbook").turn({width:t.flipbookWidth,height:t.flipbookHeight,autoCenter:!1,gradients:!0,acceleration:!0,duration:800,elevation:150}),_t("#flipbook").bind("start",(function(t,e,a){console.log(t),console.log(e),console.log(a),"r"==a||"l"==a?_t(".page-wrapper").css("cursor","pointer"):_t(".page-wrapper").css("cursor","unset"),"tl"!=a&&"tr"!=a&&"bl"!=a&&"br"!=a||t.preventDefault()})),_t("#flipbook").bind("end",(function(t,e,a){
|
|
1321
|
-
|
|
1322
|
-
})),
|
|
1323
|
-
// Habilitar passagem via o dedo
|
|
1324
|
-
_t(document).keydown((function(t){switch(t.keyCode){case 37:s("#flipbook").turn("previous");break;case 39:s("#flipbook").turn("next")}})),t.isCover="-"+_t(".page-wrapper[page="+t.currentPage+"]").width(),_t("#flipbook").bind("turning",(function(e,a,i){t.currentPage=a,t.currentPage>=t.loadedPages-2&&t.morePages(),1===t.currentPage?(t.numberPositions=0,t.isCover="-"+_t(".page-wrapper[page="+t.currentPage+"]").width()):t.currentPage===t.pages?(t.isCover=_t(".page-wrapper[page="+t.currentPage+"]").width(),t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1)):(t.isCover=0,t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1))}));for(var a=this.loadedPages;a<this.pages-2;a++){var i=_t("#flipbook").turn("pages")+1,o=_t('<div><img class="img-book" width="100%" src="'+this.apiUrl+"/api/builder/getplaceholder/"+this.product_id+"?page="+a+"&w="+this.bookDimensions.widthPlaceholder+'&pw=0&noCache=true" alt=""><div class="loading-bg"><div class="loading book-loading"></div></div> </div>');_t("#flipbook").turn("addPage",o),_t("#flipbook").turn("pages",i)}this.started()},toTheLeft:function(){_t("#flipbook").turn("previous")},toTheRight:function(){_t("#flipbook").turn("next")},zoomTo:function(t){setTimeout((function(){_t(".flipbook-container").data().regionClicked?_t(".flipbook-container").data().regionClicked=!1:1==_t(".flipbook-container").zoom("value")?_t(".flipbook-container").zoom("zoomIn",t):_t(".flipbook-container").zoom("zoomOut")}),1)},activateZoom:function(){var t=this;_t(".flipbook-container").zoom({flipbook:_t("#flipbook"),max:function(){return 1452/_t("#flipbook").width()},when:{swipeLeft:function(){_t(this).zoom("flipbook").turn("next")},swipeRight:function(){_t(this).zoom("flipbook").turn("previous")},resize:function(t,e,a,i){
|
|
1325
|
-
// if (scale==1)
|
|
1308
|
+
_t("#flipbook").turn({width:t.flipbookWidth,height:t.flipbookHeight,autoCenter:!1,gradients:!0,acceleration:!0,duration:800,elevation:150}),_t("#flipbook").bind("start",(function(t,e,a){console.log(t),console.log(e),console.log(a),"r"==a||"l"==a?_t(".page-wrapper").css("cursor","pointer"):_t(".page-wrapper").css("cursor","unset"),"tl"!=a&&"tr"!=a&&"bl"!=a&&"br"!=a||t.preventDefault()})),_t("#flipbook").bind("end",(function(t,e,a){//$(".page-wrapper").css("cursor", "unset");
|
|
1309
|
+
})),// Habilitar passagem via o dedo
|
|
1310
|
+
_t(document).keydown((function(t){switch(t.keyCode){case 37:s("#flipbook").turn("previous");break;case 39:s("#flipbook").turn("next")}})),t.isCover="-"+_t(".page-wrapper[page="+t.currentPage+"]").width(),_t("#flipbook").bind("turning",(function(e,a,i){t.currentPage=a,t.currentPage>=t.loadedPages-2&&t.morePages(),1===t.currentPage?(t.numberPositions=0,t.isCover="-"+_t(".page-wrapper[page="+t.currentPage+"]").width()):t.currentPage===t.pages?(t.isCover=_t(".page-wrapper[page="+t.currentPage+"]").width(),t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1)):(t.isCover=0,t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1))}));for(var a=this.loadedPages;a<this.pages-2;a++){var i=_t("#flipbook").turn("pages")+1,o=_t('<div><img class="img-book" width="100%" src="'+this.apiUrl+"/api/builder/getplaceholder/"+this.product_id+"?page="+a+"&w="+this.bookDimensions.widthPlaceholder+'&pw=0&noCache=true" alt=""><div class="loading-bg"><div class="loading book-loading"></div></div> </div>');_t("#flipbook").turn("addPage",o),_t("#flipbook").turn("pages",i)}this.started()},toTheLeft:function(){_t("#flipbook").turn("previous")},toTheRight:function(){_t("#flipbook").turn("next")},zoomTo:function(t){setTimeout((function(){_t(".flipbook-container").data().regionClicked?_t(".flipbook-container").data().regionClicked=!1:1==_t(".flipbook-container").zoom("value")?_t(".flipbook-container").zoom("zoomIn",t):_t(".flipbook-container").zoom("zoomOut")}),1)},activateZoom:function(){var t=this;_t(".flipbook-container").zoom({flipbook:_t("#flipbook"),max:function(){return 1452/_t("#flipbook").width()},when:{swipeLeft:function(){_t(this).zoom("flipbook").turn("next")},swipeRight:function(){_t(this).zoom("flipbook").turn("previous")},resize:function(t,e,a,i){// if (scale==1)
|
|
1326
1311
|
// loadSmallPage(page, pageElement);
|
|
1327
1312
|
// else
|
|
1328
1313
|
// loadLargePage(page, pageElement);
|
|
1329
|
-
},zoomIn:function(){_t(".flipbook-container").removeClass("zoom-in"),_t(".flipbook-container").removeClass("zoom-out"),_t(".flipbook-container").addClass("zoom-in")},zoomOut:function(){_t(".flipbook-container").removeClass("zoom-in"),_t(".flipbook-container").removeClass("zoom-out"),_t(".flipbook-container").addClass("zoom-out")
|
|
1330
|
-
// $('.exit-message').hide();
|
|
1314
|
+
},zoomIn:function(){_t(".flipbook-container").removeClass("zoom-in"),_t(".flipbook-container").removeClass("zoom-out"),_t(".flipbook-container").addClass("zoom-in")},zoomOut:function(){_t(".flipbook-container").removeClass("zoom-in"),_t(".flipbook-container").removeClass("zoom-out"),_t(".flipbook-container").addClass("zoom-out"),// $('.exit-message').hide();
|
|
1331
1315
|
// $('.thumbnails').fadeIn();
|
|
1332
1316
|
// $('.made').fadeIn();
|
|
1333
1317
|
// $('.zoom-icon').removeClass('zoom-icon-out').addClass('zoom-icon-in');
|
|
1334
|
-
setTimeout((function(){_t("#flipbook").addClass("animated").removeClass("zoom-in"),t.resizeViewport()}),0)}}})
|
|
1335
|
-
//
|
|
1336
|
-
_t.isTouch?_t(".flipbook-container").bind("zoom.doubleTap",t.zoomTo):_t(".flipbook-container").bind("zoom.tap",t.zoomTo)},resizeViewport:function(){var t=self.resize(),e=t.width,a=t.height,i=_t("#flipbook").turn("options");if(_t("#flipbook").removeClass("animated"),_t(".flipbook-container").css({width:e,height:a}).zoom("resize"),1==_t("#flipbook").turn("zoom")){var o=calculateBound({width:i.width,height:i.height,boundWidth:Math.min(i.width,e),boundHeight:Math.min(i.height,a)});o.width%2!=0&&(o.width-=1),o.width==_t("#flipbook").width()&&o.height==_t("#flipbook").height()||(_t("#flipbook").turn("size",o.width,o.height),1==_t("#flipbook").turn("page")&&_t("#flipbook").turn("peel","br")),_t("#flipbook").css({top:-o.height/2,left:-o.width/2})}
|
|
1337
|
-
// var magazineOffset = $('#flipbook').offset(),
|
|
1318
|
+
setTimeout((function(){_t("#flipbook").addClass("animated").removeClass("zoom-in"),t.resizeViewport()}),0)}}}),// Zoom event
|
|
1319
|
+
_t.isTouch?_t(".flipbook-container").bind("zoom.doubleTap",t.zoomTo):_t(".flipbook-container").bind("zoom.tap",t.zoomTo)},resizeViewport:function(){var t=self.resize(),e=t.width,a=t.height,i=_t("#flipbook").turn("options");if(_t("#flipbook").removeClass("animated"),_t(".flipbook-container").css({width:e,height:a}).zoom("resize"),1==_t("#flipbook").turn("zoom")){var o=calculateBound({width:i.width,height:i.height,boundWidth:Math.min(i.width,e),boundHeight:Math.min(i.height,a)});o.width%2!=0&&(o.width-=1),o.width==_t("#flipbook").width()&&o.height==_t("#flipbook").height()||(_t("#flipbook").turn("size",o.width,o.height),1==_t("#flipbook").turn("page")&&_t("#flipbook").turn("peel","br")),_t("#flipbook").css({top:-o.height/2,left:-o.width/2})}// var magazineOffset = $('#flipbook').offset(),
|
|
1338
1320
|
// boundH = height - magazineOffset.top - $('#flipbook').height(),
|
|
1339
1321
|
// marginTop = (boundH - $('.thumbnails > div').height()) / 2;
|
|
1340
1322
|
// if (marginTop<0) {
|
|
@@ -1397,8 +1379,7 @@ currentLanguage:null,
|
|
|
1397
1379
|
// Layouts
|
|
1398
1380
|
currentLayout:null,
|
|
1399
1381
|
// Preview default props
|
|
1400
|
-
pages:[],pageNum:36,isMobile:!1,isPagesNumLoaded:!1,isLoading:!0,custom_character:null,custom:null,callingLayout:!1,currentShirtNumber:7,modalMoonerFirstOpen:!1,firstBookSelected:!1,type_id:0}}},U(zt,"computed",{cssProps:function(){return{"--preview_color":this.preview_color}}}),U(zt,"mounted",(function(){var t=this;window.addEventListener("resize",(function(e){t.isMobile=t.detectSize()})),t.isMobile=t.detectSize(),this.initMounted()})),U(zt,"methods",{detectSize:function(){var t=!1;return window.innerWidth<990&&(t=!0),t},setCurrentMoonerName:function(t){this.currentMoonerName=t,this.haveCustomMoonerName=!0},toggleSidebar:function(){this.sidebarOpen=!this.sidebarOpen},modalIsOpen:function(){return!!(this.modalLayout||this.modalName||this.modalDedication||this.modalShirtNumber||this.modalPet||this.modalMooner||this.modalBirthdate)},updateName:function(t){console.log(this.current_character_name),this.current_character_name=t.value,console.log(t)},updateDedicationText:function(t){this.current_dedcation_text=t.value},updateShirtNumber:function(t){this.currentShirtNumber=t.value},onChangeDay:function(t){this.selectedBirthDay=t.target.value
|
|
1401
|
-
// this.validateDays({
|
|
1382
|
+
pages:[],pageNum:36,isMobile:!1,isPagesNumLoaded:!1,isLoading:!0,custom_character:null,custom:null,callingLayout:!1,currentShirtNumber:7,modalMoonerFirstOpen:!1,firstBookSelected:!1,type_id:0}}},U(zt,"computed",{cssProps:function(){return{"--preview_color":this.preview_color}}}),U(zt,"mounted",(function(){var t=this;window.addEventListener("resize",(function(e){t.isMobile=t.detectSize()})),t.isMobile=t.detectSize(),this.initMounted()})),U(zt,"methods",{detectSize:function(){var t=!1;return window.innerWidth<990&&(t=!0),t},setCurrentMoonerName:function(t){this.currentMoonerName=t,this.haveCustomMoonerName=!0},toggleSidebar:function(){this.sidebarOpen=!this.sidebarOpen},modalIsOpen:function(){return!!(this.modalLayout||this.modalName||this.modalDedication||this.modalShirtNumber||this.modalPet||this.modalMooner||this.modalBirthdate)},updateName:function(t){console.log(this.current_character_name),this.current_character_name=t.value,console.log(t)},updateDedicationText:function(t){this.current_dedcation_text=t.value},updateShirtNumber:function(t){this.currentShirtNumber=t.value},onChangeDay:function(t){this.selectedBirthDay=t.target.value;// this.validateDays({
|
|
1402
1383
|
// year: payload.value,
|
|
1403
1384
|
// });
|
|
1404
1385
|
},onChangeMonth:function(t){
|
|
@@ -1407,59 +1388,38 @@ var e=this;e.months.forEach((function(a){
|
|
|
1407
1388
|
// if (property[1].code === propertyName) {
|
|
1408
1389
|
// returnProperty = property[1];
|
|
1409
1390
|
// }
|
|
1410
|
-
a.value==t.target.value&&(e.selectedBirthMonth=a.key)}))},updateHaveDedication:function(t){this.haveDedication=t},setMooner:function(t){var e=this,a=this;a.moonerAnimation=!1,a.haveCustomMoonerName||(a.currentMoonerName=t.name.toUpperCase()),setTimeout((function(){a.moonerAnimation=!0,e.currentMooner=t,setTimeout((function(){a.moonerInitAnimation=!0}),"500")}),"500")},setPet:function(t){var e=this;e.petAnimation=!1,setTimeout((function(){e.petAnimation=!0,e.currentPet=t,e.currentPetColor=e.currentPet.assets.colors[0],setTimeout((function(){e.petInitAnimation=!0}),"500")}),"500")},setFantasy:function(t){var e=this;e.fantasyAnimation=!1,setTimeout((function(){e.fantasyAnimation=!0,e.currentFantasy=t
|
|
1411
|
-
//self.currentPetColor = self.currentPet.assets.colors[0];
|
|
1391
|
+
a.value==t.target.value&&(e.selectedBirthMonth=a.key)}))},updateHaveDedication:function(t){this.haveDedication=t},setMooner:function(t){var e=this,a=this;a.moonerAnimation=!1,a.haveCustomMoonerName||(a.currentMoonerName=t.name.toUpperCase()),setTimeout((function(){a.moonerAnimation=!0,e.currentMooner=t,setTimeout((function(){a.moonerInitAnimation=!0}),"500")}),"500")},setPet:function(t){var e=this;e.petAnimation=!1,setTimeout((function(){e.petAnimation=!0,e.currentPet=t,e.currentPetColor=e.currentPet.assets.colors[0],setTimeout((function(){e.petInitAnimation=!0}),"500")}),"500")},setFantasy:function(t){var e=this;e.fantasyAnimation=!1,setTimeout((function(){e.fantasyAnimation=!0,e.currentFantasy=t,//self.currentPetColor = self.currentPet.assets.colors[0];
|
|
1412
1392
|
setTimeout((function(){e.fantasyAnimation=!0}),"500")}),"500")},setColor:function(t){
|
|
1413
1393
|
//this.currentPetColor = selectedColor;
|
|
1414
1394
|
//this.searchExtraProperty("pet").value.newPetColor = selectedColor;
|
|
1415
1395
|
this.currentPetColor=t},showModal:function(t){
|
|
1416
|
-
// alert(key);
|
|
1417
1396
|
//var modalName = Object.keys(key)[0];
|
|
1418
1397
|
// console.log(modalName);
|
|
1419
|
-
"nome"===t&&(this.modalName=!0),t.includes("dedicatoria")&&(this.modalDedication=!0),t.includes("nome-do-mooner")&&(this.modalMooner=!0),t.includes("nome-pet")&&(this.modalPet=!0),t.includes("script")&&(this.modalLayout=!0),t.includes("camisa")&&(this.modalShirtNumber=!0),t.includes("birthday")&&(this.modalBirthdate=!0),t.includes("fantasy")&&(this.modalFantasy=!0),t.includes("languages")&&(this.modalLanguage=!0),t.includes("layouts")&&(this.modalLayout=!0)},showModalName:function(){this.modalName=!0},showmodalLayout:function(){this.modalLayout=!0},showModalDedication:function(){this.modalDedication=!0},showModalShirtNumber:function(){this.modalShirtNumber=!0},showModalBirthdate:function(){this.modalBirthdate=!0},showModalPet:function(){
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
// Get mooner from extra character customization
|
|
1425
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"mooner"===t.code&&(a.typeRead||(a.modalMooner=!0,a.listMooner=t,a.setMooner(a.listMooner.assets.subcategories[0])))})),
|
|
1426
|
-
//Get pet from extra character customization
|
|
1427
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"pet"===t.code&&(a.typeRead||(a.modalPet=!0,a.listPet=t,a.setPet(a.listPet.assets.subcategories[0])))}));var e=[];
|
|
1428
|
-
//Get pet from extra character customization
|
|
1429
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"fantasia"===t.code&&(a.typeRead||(a.modalFantasy=!0,
|
|
1430
|
-
// Criar categorias com ou sem cadeirante
|
|
1431
|
-
t.assets.subcategories.forEach((function(t){(1==a.haveWheelChair&&1==t.name.includes("cadeirante")||0==a.haveWheelChair&&0==t.name.includes("cadeirante"))&&e.push(t)})))),a.listFantasy=e,a.setFantasy(a.listFantasy[0])}))})).catch((function(t){console.log(t)})));case 4:case"end":return e.stop()}}),e)})))()},closeModal:function(){this.modalLayout=!1,this.modalName=!1,this.modalDedication=!1,this.modalShirtNumber=!1,this.modalPet=!1,this.modalMooner=!1,this.modalBirthdate=!1,this.modalFantasy=!1,this.modalLanguage=!1},setCurrentLayout:function(t){this.currentLayout=t,this.firstBookSelected=!0},initMounted:function(){var t=this;return v(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.getProductInfo();case 3:a.getCustomCharacter();
|
|
1432
|
-
// self.getProductInfo();
|
|
1398
|
+
"nome"===t&&(this.modalName=!0),t.includes("dedicatoria")&&(this.modalDedication=!0),t.includes("nome-do-mooner")&&(this.modalMooner=!0),t.includes("nome-pet")&&(this.modalPet=!0),t.includes("script")&&(this.modalLayout=!0),t.includes("camisa")&&(this.modalShirtNumber=!0),t.includes("birthday")&&(this.modalBirthdate=!0),t.includes("fantasy")&&(this.modalFantasy=!0),t.includes("languages")&&(this.modalLanguage=!0),t.includes("layouts")&&(this.modalLayout=!0)},showModalName:function(){this.modalName=!0},showmodalLayout:function(){this.modalLayout=!0},showModalDedication:function(){this.modalDedication=!0},showModalShirtNumber:function(){this.modalShirtNumber=!0},showModalBirthdate:function(){this.modalBirthdate=!0},showModalPet:function(){},searchExtraProperty:function(t){var e=null;return Object.entries(this.properties).forEach((function(a){a[1].code===t&&(e=a[1])})),e},searchCustomUserDataProperty:function(t){var e=null;return Object.entries(t).forEach((function(t){"nome-do-mooner"==t[0]&&(e=t[1])})),e},searchCategoryProperty:function(t,e){var a=null;return Object.keys(t).forEach((function(i){t[i].code.includes(e)&&(a=t[i]),console.log(i+" - "+t[i])})),a},getTreeList:function(){var t=this;return v(h().mark((function e(){var a,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:// Todo Guto
|
|
1399
|
+
return i="https://hb.dentrodahistoria.com.br/api/v2/characters/"+(a=t).character_id+"/categories/assets/treelist?character_type_id="+a.type_id+"&subscription="+a.is_subscription+"&product_id="+parseInt(a.product_id),a.character_position_id&&(i=i+"&character_position_id="+parseInt(a.character_position_id)),e.abrupt("return",Nt.get(i).then((function(t){t.data.character_categories_assets[0].characters_extra.forEach((function(t){"mooner"===t.code&&(a.typeRead||(a.modalMooner=!0,a.listMooner=t,a.setMooner(a.listMooner.assets.subcategories[0])))})),//Get pet from extra character customization
|
|
1400
|
+
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"pet"===t.code&&(a.typeRead||(a.modalPet=!0,a.listPet=t,a.setPet(a.listPet.assets.subcategories[0])))}));var e=[];//Get pet from extra character customization
|
|
1401
|
+
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"fantasia"===t.code&&(a.typeRead||(a.modalFantasy=!0,// Criar categorias com ou sem cadeirante
|
|
1402
|
+
t.assets.subcategories.forEach((function(t){(1==a.haveWheelChair&&1==t.name.includes("cadeirante")||0==a.haveWheelChair&&0==t.name.includes("cadeirante"))&&e.push(t)})))),a.listFantasy=e,a.setFantasy(a.listFantasy[0])}))})).catch((function(t){console.log(t)})));case 4:case"end":return e.stop()}}),e)})))()},closeModal:function(){this.modalLayout=!1,this.modalName=!1,this.modalDedication=!1,this.modalShirtNumber=!1,this.modalPet=!1,this.modalMooner=!1,this.modalBirthdate=!1,this.modalFantasy=!1,this.modalLanguage=!1},setCurrentLayout:function(t){this.currentLayout=t,this.firstBookSelected=!0},initMounted:function(){var t=this;return v(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.getProductInfo();case 3:a.getCustomCharacter();// self.getProductInfo();
|
|
1433
1403
|
// self.getTreeList();
|
|
1434
|
-
case 4:case"end":return e.stop()}}),e)})))()},getCustomCharacter:function(){var t=this;Nt.get(this.lang.urlBuilder+"/api/customs_characters/"+t.uuid).then((function(e){
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
t.properties
|
|
1439
|
-
// Dedicatória
|
|
1440
|
-
t.properties.dedicatoria&&(t.current_dedcation_text=t.properties.dedicatoria.value),
|
|
1441
|
-
// Pet
|
|
1442
|
-
t.properties["nome-pet"]&&(t.mooner_name=t.properties["nome-pet"].value),t.properties.numero&&t.properties.mes){t.selectedBirthDay=t.properties.numero.value,t.months.forEach((function(e,a){e.value==t.properties.mes.value&&(t.selectedBirthMonth=e.key)}));var a={code:"birthday",value:t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value};delete t.properties.numero,delete t.properties.mes,t.properties.birthday=a}
|
|
1443
|
-
// Fantasia
|
|
1404
|
+
case 4:case"end":return e.stop()}}),e)})))()},getCustomCharacter:function(){var t=this;Nt.get(this.lang.urlBuilder+"/api/customs_characters/"+t.uuid).then((function(e){// Aniversário
|
|
1405
|
+
if(t.properties=e.data.custom.user_data.properties,// Nome
|
|
1406
|
+
t.properties.nome&&(t.current_character_name=t.properties.nome.value),// Dedicatória
|
|
1407
|
+
t.properties.dedicatoria&&(t.current_dedcation_text=t.properties.dedicatoria.value),// Pet
|
|
1408
|
+
t.properties["nome-pet"]&&(t.mooner_name=t.properties["nome-pet"].value),t.properties.numero&&t.properties.mes){t.selectedBirthDay=t.properties.numero.value,t.months.forEach((function(e,a){e.value==t.properties.mes.value&&(t.selectedBirthMonth=e.key)}));var a={code:"birthday",value:t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value};delete t.properties.numero,delete t.properties.mes,t.properties.birthday=a}// Fantasia
|
|
1444
1409
|
// Linguagens
|
|
1445
|
-
if(e.data.assets.forEach((function(e,a){e.assets.name.includes("roupa-cadeirante")&&(t.haveWheelChair=!0)})),e.data.assets.forEach((function(a,i){if(a.assets.name.includes("fantasia")){var o={code:"fantasy",value:a.assets.name};t.properties.fantasy=o,t.avatarFantasy=e.data.assets}})),t.languages&&t.language){t.languages.forEach((function(e){e.Slug==t.language&&(t.currentLanguage=e)}));var i={code:"languages",value:t.currentLanguage.Label};t.properties.languages=i}
|
|
1446
|
-
|
|
1447
|
-
if(t.layouts&&t.layout){t.layouts.forEach((function(e){e.builderProductId==t.layout&&(t.currentLayout=e)}));var o={code:"layouts",value:t.currentLayout.name};t.properties.layouts=o}t.getTreeList()})).catch((function(t){console.log(t)}))},getProductInfo:function(){var t=this;return v(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.abrupt("return",Nt.get(t.lang.urlBuilder+"/api/products/info/"+a.product_id).then((function(t){a.pageNum=t.data.product.pages,a.isPagesNumLoaded=!0,a.availableLayouts=t.data.product.layout,
|
|
1448
|
-
// Gender
|
|
1410
|
+
if(e.data.assets.forEach((function(e,a){e.assets.name.includes("roupa-cadeirante")&&(t.haveWheelChair=!0)})),e.data.assets.forEach((function(a,i){if(a.assets.name.includes("fantasia")){var o={code:"fantasy",value:a.assets.name};t.properties.fantasy=o,t.avatarFantasy=e.data.assets}})),t.languages&&t.language){t.languages.forEach((function(e){e.Slug==t.language&&(t.currentLanguage=e)}));var i={code:"languages",value:t.currentLanguage.Label};t.properties.languages=i}// Layouts
|
|
1411
|
+
if(t.layouts&&t.layout){t.layouts.forEach((function(e){e.builderProductId==t.layout&&(t.currentLayout=e)}));var o={code:"layouts",value:t.currentLayout.name};t.properties.layouts=o}t.getTreeList()})).catch((function(t){console.log(t)}))},getProductInfo:function(){var t=this;return v(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.abrupt("return",Nt.get(t.lang.urlBuilder+"/api/products/info/"+a.product_id).then((function(t){a.pageNum=t.data.product.pages,a.isPagesNumLoaded=!0,a.availableLayouts=t.data.product.layout,// Gender
|
|
1449
1412
|
a.gender&&t.data.product.type.forEach((function(t){t.name==a.gender&&(a.type_id=t.id)}))})).catch((function(t){console.log(t)})));case 2:case"end":return e.stop()}}),e)})))()},changeMoonerLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};t.currentMooner&&
|
|
1450
1413
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1451
|
-
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}}))
|
|
1452
|
-
//var data_custom;
|
|
1414
|
+
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}})),//var data_custom;
|
|
1453
1415
|
// Envio da custom porperties dynamic
|
|
1454
1416
|
Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data);var a=!1,i=null;t.custom.categories.forEach((function(e){if(e.parent_id===t.currentMooner.parent_id){a=!0;var i=t.custom.categories.indexOf(e);t.custom.categories[i]={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id}}})),!1===a&&(i={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id},t.custom.categories.push(i)),t.modalMoonerFirstOpen=!0,t.sidebarOpen=!1,t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},changeFantasyLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};t.currentFantasy&&
|
|
1455
1417
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1456
|
-
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}}))
|
|
1457
|
-
//var data_custom;
|
|
1418
|
+
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}})),//var data_custom;
|
|
1458
1419
|
// Envio da custom porperties dynamic
|
|
1459
1420
|
Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data);var a=!1,i=null;t.custom.categories.forEach((function(e){if(e.parent_id===t.currentMooner.parent_id){a=!0;var i=t.custom.categories.indexOf(e);t.custom.categories[i]={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id}}})),!1===a&&(i={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id},t.custom.categories.push(i)),t.modalMoonerFirstOpen=!0,t.sidebarOpen=!1,t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},updateNameAndDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.currentMooner&&
|
|
1460
1421
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1461
|
-
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}})),t.searchExtraProperty("birthday")){t.searchExtraProperty("birthday");e.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},e.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}
|
|
1462
|
-
// if (self.have_birth_date) {
|
|
1422
|
+
t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={property_id:a.id,value:t.currentMoonerName,code:a.code};a.value=t.currentMoonerName,e.custom_character.user_data.properties[a.code]=i}})),t.searchExtraProperty("birthday")){t.searchExtraProperty("birthday");e.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},e.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}// if (self.have_birth_date) {
|
|
1463
1423
|
// self.extras.forEach((itemProperty) => {
|
|
1464
1424
|
// if (itemProperty.code.includes("birthday")) {
|
|
1465
1425
|
// request.custom_character.user_data.properties["mes"] =
|
|
@@ -1476,15 +1436,12 @@ t.extras.forEach((function(a){if(a.code.includes("nome-do-mooner")){var i={prope
|
|
|
1476
1436
|
// }
|
|
1477
1437
|
// });
|
|
1478
1438
|
// }
|
|
1479
|
-
Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.extras.forEach((function(e){"nome"===e.code&&(e.value=t.current_character_name),"dedicatoria"===e.code&&(e.value=t.dedicationText)})),t.changeUuid(e.data.custom.uuid),t.changeName(t.current_character_name),t.have_birth_date){var a={custom_numero:t.selectedBirthDay,custom_mes:t.months[t.selectedBirthMonth-1].value};t.changeBirthday(a)}})).catch((function(t){console.log(t)}))},updateDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data)
|
|
1480
|
-
// self.extras.forEach((itemProperty) => {
|
|
1439
|
+
Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.extras.forEach((function(e){"nome"===e.code&&(e.value=t.current_character_name),"dedicatoria"===e.code&&(e.value=t.dedicationText)})),t.changeUuid(e.data.custom.uuid),t.changeName(t.current_character_name),t.have_birth_date){var a={custom_numero:t.selectedBirthDay,custom_mes:t.months[t.selectedBirthMonth-1].value};t.changeBirthday(a)}})).catch((function(t){console.log(t)}))},updateDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",e).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data),// self.extras.forEach((itemProperty) => {
|
|
1481
1440
|
// if (itemProperty.code === "dedicatoria") {
|
|
1482
1441
|
// itemProperty.value = self.dedicationText;
|
|
1483
1442
|
// }
|
|
1484
1443
|
// });
|
|
1485
|
-
t.searchExtraProperty("dedicatoria").value=t.dedicationText,t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e,a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.properties["nome-do-mooner"]){var i={property_id:(o=t.properties["nome-do-mooner"]).id,value:o.value,code:o.code};a.custom_character.user_data.properties[o.code]=i}if(t.properties.birthday){var o=t.properties.birthday;a.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},a.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}
|
|
1486
|
-
// Envio da custom porperties dynamic
|
|
1487
|
-
Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(a){if(t.custom=JSON.parse(a.data.custom.customCharacter.data),t.currentPet&&t.currentPet.parent_id&&(e={parent_id:t.currentPet.parent_id,id:t.currentPetColor.id},t.custom.categories.push(e)),t.custom_mes&&t.custom_numero){var i={mes:t.selectedBirthMonth,dia:t.selectedBirthDay};t.changeBirthday(i),t.properties.birthday.value=t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value}t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},sendCustomCharacter:function(){var t=this;Nt.post(this.lang.urlBuilder+"/api/customs_characters",{custom_character:t.custom}).then((function(e){
|
|
1444
|
+
t.searchExtraProperty("dedicatoria").value=t.dedicationText,t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var e,a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.properties["nome-do-mooner"]){var i={property_id:(o=t.properties["nome-do-mooner"]).id,value:o.value,code:o.code};a.custom_character.user_data.properties[o.code]=i}if(t.properties.birthday){var o=t.properties.birthday;a.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},a.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}Nt.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(a){if(t.custom=JSON.parse(a.data.custom.customCharacter.data),t.currentPet&&t.currentPet.parent_id&&(e={parent_id:t.currentPet.parent_id,id:t.currentPetColor.id},t.custom.categories.push(e)),t.custom_mes&&t.custom_numero){var i={mes:t.selectedBirthMonth,dia:t.selectedBirthDay};t.changeBirthday(i),t.properties.birthday.value=t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value}t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},sendCustomCharacter:function(){var t=this;Nt.post(this.lang.urlBuilder+"/api/customs_characters",{custom_character:t.custom}).then((function(e){
|
|
1488
1445
|
//self.custom = JSON.parse(response.data.custom.customCharacter.data);
|
|
1489
1446
|
//alert("salvou catiolo");
|
|
1490
1447
|
t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeUuid:function(t){this.$emit("changeUuid",t)},changeName:function(t){this.$emit("changeName",t)},changeBirthday:function(t){this.$emit("changeBirthday",t)},isLoadingMethod:function(t){this.$emit("isLoadingMethod",t)},validateDays:function(t){var e,a=t.month?t.month:this.selectedBirthMonth,i=t.year?t.year:this.selectedBirthYear;a||(a=13);var o=[];e=1===a||3===a||5===a||7===a||8===a||10===a||12===a||13===a?31:4===a||6===a||9===a||11===a?30:i%4==0&&i%100>0||i%400==0?29:28,a||i||(e=31);for(var r=1;r<=e;r++)o.push({key:r,value:r});this.days=o}}),zt),"data-v-4521078a",!1,void 0,!1,x,void 0,void 0),Lt=(require("axios"),b({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"preview-full"},[t.isLoaded&&!t.isMobile?a("Preview",{attrs:{uuid:t.uuid,pages:t.pages,age:t.age,product_id:t.product_id,typeLanguage:t.typeLanguage,apiUrl:t.apiUrl}}):t._e(),t._v(" "),t.isLoaded&&t.isMobile?a("PreviewMobile",{attrs:{uuid:t.uuid,pages:t.pages,age:t.age,product_id:t.product_id,typeLanguage:t.typeLanguage,apiUrl:t.apiUrl}}):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-7c5f1153_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.storybook-6{width:16.6666666667vw}.storybook-12{width:33.3333333333vw}.storybook-25{width:69.4444444444vw}.custom-properties{position:absolute;top:30px}',map:void 0,media:void 0})}),{name:"PreviewFull",components:{Preview:Pt,PreviewMobile:St},props:{
|
|
@@ -1567,8 +1524,7 @@ color:{type:String,default:"#DFDAE4"}},data:function(){return{colorDefault:"#DFD
|
|
|
1567
1524
|
**/
|
|
1568
1525
|
visible:{type:Boolean,default:!0,required:!0},title:{type:String,default:"default",required:!0},description:{type:String,default:"default",required:!0},type:{type:String,default:"success",required:!0}},watch:{visible:{
|
|
1569
1526
|
// the callback will be called immediately after the start of the observation
|
|
1570
|
-
immediate:!0,handler:function(t,e){var a=this;!0===t&&setTimeout((function(){a.displayVisible=!0}),300)}}},data:function(){return{displayVisible:!1}},methods:{closeFeedBack:function(){this.$emit("closeFeedBack")}}},"data-v-ae47cb8c",!1,void 0,!1,x,void 0,void 0),Dt=Object.freeze({__proto__:null,Avatar:L,Button:T,Card:F,CardLink:R,CardOption:q,Checkbox:j,Icon:I,Input:D,InputEdit:$,InputName:O,InputEmail:V,InputAddressNumber:W,InputAddress:J,InputAddressBilling:G,InputCardNumber:X,Options:Y,Radius:K,Select:Z,Birthday:rt,BirthdayMobile:mt,TextArea:ut,GenderSelect:ht,Tabs:gt,Tooltip:vt,Caption:_,Heading:ft,Paragraph:bt,Modal:wt,Preview:Pt,PreviewMobile:St,PreviewTools:Et,PreviewFull:Lt,PreviewWithTools:Ft,HR:Rt,Spinner:qt,FeedBack:jt}),$t=function(t){$t.installed||($t.installed=!0,Object.entries(Dt).forEach((function(e){var a=m(e,2),i=a[0],o=a[1];t.component(i,o)})))},Ot={install:$t},Vt=null;"undefined"!=typeof window?Vt=window.Vue:"undefined"!=typeof global&&(Vt=global.Vue),Vt&&Vt.use(Ot)
|
|
1571
|
-
// // Import vue component
|
|
1527
|
+
immediate:!0,handler:function(t,e){var a=this;!0===t&&setTimeout((function(){a.displayVisible=!0}),300)}}},data:function(){return{displayVisible:!1}},methods:{closeFeedBack:function(){this.$emit("closeFeedBack")}}},"data-v-ae47cb8c",!1,void 0,!1,x,void 0,void 0),Dt=Object.freeze({__proto__:null,Avatar:L,Button:T,Card:F,CardLink:R,CardOption:q,Checkbox:j,Icon:I,Input:D,InputEdit:$,InputName:O,InputEmail:V,InputAddressNumber:W,InputAddress:J,InputAddressBilling:G,InputCardNumber:X,Options:Y,Radius:K,Select:Z,Birthday:rt,BirthdayMobile:mt,TextArea:ut,GenderSelect:ht,Tabs:gt,Tooltip:vt,Caption:_,Heading:ft,Paragraph:bt,Modal:wt,Preview:Pt,PreviewMobile:St,PreviewTools:Et,PreviewFull:Lt,PreviewWithTools:Ft,HR:Rt,Spinner:qt,FeedBack:jt}),$t=function(t){$t.installed||($t.installed=!0,Object.entries(Dt).forEach((function(e){var a=m(e,2),i=a[0],o=a[1];t.component(i,o)})))},Ot={install:$t},Vt=null;"undefined"!=typeof window?Vt=window.Vue:"undefined"!=typeof global&&(Vt=global.Vue),Vt&&Vt.use(Ot);// Default export is library as a whole, registered via Vue.use()
|
|
1572
1528
|
// import MyButton from './components/MyButton/MyButton.vue';
|
|
1573
1529
|
// import Heading from './components/Heading/Heading.vue';
|
|
1574
1530
|
// // Declare install function executed by Vue.use()
|
package/dist/brave-vue.ssr.js
CHANGED
|
@@ -48,12 +48,9 @@ const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,p):[p]}return a}function b(t
|
|
|
48
48
|
this.selectedSubcategory?e=this.selectedSubcategory.assets.colors.find((function(e){return e.id===t.customization.optionId})):this.subcategoriesAssets.forEach((function(a){e=a.assets.colors.find((function(e){return e.id===t.customization.optionId}))}))),e},visibleSubcategories:function(){var t=this;if(!this.category.depends_category)return this.subcategoriesAssets;var e=this.category.assets.categories.find((function(e){return e.parent_id===t.relatedCustomization.optionId}));return e?e.assets.subcategories:null},visibleColors:function(){return this.selectedSubcategory&&this.selectedSubcategory.assets.colors.length>1?(screen.width<=1023&&(document.getElementById("customization-panel-body").style.height="16rem"),this.selectedSubcategory.assets.colors):(screen.width<=1023&&(document.getElementById("customization-panel-body").style.height="12rem"),null)},showPlaceholder:function(){return""===this.imagePath}},mounted:function(){this.isSelected=this.selectedSubcategory},methods:{handleSubcategoryClick:function(t){var e=this;if(this.glasses=t.assets.icon,t.assets.colors&&t.assets.colors.length>0)
|
|
49
49
|
// Caso a cor já houver sido selecionada, buscamos a cor mais parecida
|
|
50
50
|
// na nova subcategoria e atualizamos a customização
|
|
51
|
-
if(this.removableCategory&&this.selectedSubcategory&&t.assets.name===this.selectedSubcategory.assets.name)this.handleCustomizationUpdate(t.parent_id,null,null,null,null,!0),this.clickedSubcategory=null;else{if(this.selectedColor){var a=t.assets.colors.find((function(t){return t.hexa===e.selectedColor.hexa}))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// handleGroupCustomizationUpdate
|
|
55
|
-
this.handleCustomizationUpdate(i.id,i.hexa,i.assets.asset,t.z_index,t.disable,null,!!this.removableCategory,this.removableCategory?i.parent_id:null)}
|
|
56
|
-
// #DICA DO EGON
|
|
51
|
+
if(this.removableCategory&&this.selectedSubcategory&&t.assets.name===this.selectedSubcategory.assets.name)this.handleCustomizationUpdate(t.parent_id,null,null,null,null,!0),this.clickedSubcategory=null;else{if(this.selectedColor){var a=t.assets.colors.find((function(t){return t.hexa===e.selectedColor.hexa}));// Caso não encontremos atualizamos a customizaçao com a primeira cor disponível
|
|
52
|
+
a||(a=t.assets.colors[0]),this.handleCustomizationUpdate(a.id,a.hexa,a.assets.asset,t.z_index,t.disable)}else{var i=t.assets.colors[0];// handleGroupCustomizationUpdate
|
|
53
|
+
this.handleCustomizationUpdate(i.id,i.hexa,i.assets.asset,t.z_index,t.disable,null,!!this.removableCategory,this.removableCategory?i.parent_id:null)}// #DICA DO EGON
|
|
57
54
|
// Sempre que quiser consumir o valor de uma computed property e na mesma função
|
|
58
55
|
// quiser alterar o valor de data deixe a alteração da data por ultimo
|
|
59
56
|
// pois ao fazer a alterção é possível que suas computed properties estejam sendo
|
|
@@ -73,13 +70,11 @@ color:{type:String,default:"#68596E"},
|
|
|
73
70
|
* Type of font<br>
|
|
74
71
|
* Example: `Regular | Bold`
|
|
75
72
|
**/
|
|
76
|
-
type:{type:String,default:"regular"}},data:function(){return{}}},"data-v-494fbeae",!1,"data-v-494fbeae",!1,void 0,b,void 0),z=f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"avatar-page"},[a("CustomizationView",{attrs:{custom_properties:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,is_male:t.is_male,slug:t.character_slug,uuid:t.uuid,user_data:{properties:t.custom_properties,type_id:t.type_id}},gradient_colors:t.gradient_colors,is_subscription:t.is_subscription,builder_api:"https://builder.dentrodahistoria.com.br/api",builderLayoutId:t.builderLayoutId,language:t.language},on:{startedMethod:t.started,completedMethod:t.completed}})],1)},staticRenderFns:[]},(function(t){t&&t("data-v-1969f868_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);[data-v-1969f868]:root{--column-width:6.6666666667vw}@media (min-width:0px){[data-v-1969f868]:root{--column-width:6.6666666667vw}}@media (min-width:480px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:0px){html[data-v-1969f868]{font-size:2.9166666667vw}}@media (min-width:480px){html[data-v-1969f868]{font-size:14px}}@media (min-width:1024px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1920px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:2620px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html[data-v-1969f868]{font-size:1.5648854962vw}}@media (min-width:2620px){html[data-v-1969f868]{font-size:1.56vw}}html[data-v-1969f868]{box-sizing:border-box}*[data-v-1969f868],[data-v-1969f868]::after,[data-v-1969f868]::before{box-sizing:border-box}hr[data-v-1969f868]{margin:10px -1.5rem}h1[data-v-1969f868]{font-family:Nunito;font-size:24px;font-weight:900;font-style:normal;font-stretch:normal;line-height:normal;letter-spacing:normal;color:#000;margin-top:0;margin-bottom:15px}h1[data-v-1969f868]:first-child{display:none}.ddh-sidebar[data-v-1969f868],.ddh-sidebar.hide-sidebar[data-v-1969f868]{display:none!important}html[data-v-1969f868]{--scale:1;--translate:0%}.loading-view[data-v-1969f868]{position:absolute;top:0;width:100%;height:100%;background:#fff;position:absolute;width:100%;top:0;z-index:200;display:flex;align-items:center;justify-content:center;flex-direction:column}.avatar-page-1[data-v-1969f868]{position:absolute;z-index:3}.avatar-page[data-v-1969f868]{min-height:100vh;position:absolute;width:100%;height:100vh;top:0;left:0;background:#fff}@media (max-width:992px){.avatar-page[data-v-1969f868]{min-height:0;height:100vh;height:calc(var(--vh,1vh) * 100);overflow:hidden}}.return[data-v-1969f868]{position:fixed;z-index:99}.return .icon[data-v-1969f868]{width:38px;height:38px;position:absolute;z-index:30;padding:.95238rem 2.77778vw}.return .icon svg[data-v-1969f868]{width:38px;height:38px}.return .icon svg path[data-v-1969f868]{fill:#afa2ba!important;stroke:#afa2ba!important;transition:all .1s cubic-bezier(.4,0,.2,1)}.return .icon[data-v-1969f868]:hover{cursor:pointer}.return .icon:hover path[data-v-1969f868],.return .icon:hover svg[data-v-1969f868]{fill:#1ad3d9!important;stroke:#1ad3d9!important}.return .icon:active svg[data-v-1969f868]{transform:scale(.9)}',map:void 0,media:void 0})}),{name:"Avatar",components:{CustomizationView:f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._ssrNode('<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous"> <div class="mobile-tooltip"><div class="tooltip">\n\t\t\tLorem ipsum dolor sit amet, eum ne sale vidit epicuri, usu populo\n\t\t\tincorrupte ex. His falli intellegebat no.\n\t\t\t<i class="fas fa-times"></i></div></div> '),a("CustomizationPreview",{attrs:{customizations:t.customizations,"selected-character":t.selectedCharacter,"character-height":t.characterHeight?t.characterHeight:null,"gradient-colors":t.gradient_colors,"character-slug":t.custom_properties.slug,characterHeight:1}}),t._ssrNode(" "),a("CustomizationPanel",{attrs:{"builder-api":t.builder_api,"selected-character":t.selectedCharacter,"character-name":t.custom_properties.user_data.properties.nome.value,"subscription-id":"1","stack-id":"1","character-slug":t.custom_properties.slug,"character-id":t.characterId,"character-type-id":t.characterTypeId,"character-is-male":t.custom_properties.is_male,"categories-assets":t.categoriesAssets,"disabled-categories":t.disabledCategories,customizations:t.customizations,"builder-product-id":t.builderProductId?t.builderProductId:this.custom_properties.product_id,userDataProperties:t.custom_properties.user_data.properties,builderLayoutId:t.builderLayoutId,language:t.language},on:{"update:customization":t.handleCustomization,startedMethod:t.startedMethod,completedMethod:t.completedMethod}})],2)},staticRenderFns:[]},(function(t){t&&t("data-v-264948b7_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.mobile-tooltip{display:none}@media (max-width:992px){.mobile-tooltip{display:none;position:absolute;z-index:90000000;height:calc(100vh - 59px);width:100%;transition:all .3s;bottom:0}.mobile-tooltip .tooltip{border-radius:5px;color:#fff;font-size:14px;padding:10px 36px 10px 16px;width:350px;margin-left:15px;box-shadow:0 1px 2px 0 rgba(0,0,0,.31);line-height:1.5;position:relative;margin-top:auto;bottom:calc(var(--cp) + 25px)}.mobile-tooltip .tooltip:after{top:100%;left:5%;border:solid transparent;content:" ";position:absolute;border-width:10px}.mobile-tooltip .tooltip i{position:absolute;right:10px;top:10px}}',map:void 0,media:void 0})}),{name:"CustomizationView",components:{CustomizationPanel:f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-panel"},[t._ssrNode('<div class="overlay-opacity"></div> '),t._ssrNode('<div class="customization-panel-head">',"</div>",[t._ssrNode('<div class="customization-panel-heading">'+t._ssrEscape("\n\t\t\t\tEditar o personagem "+t._s(t.characterIsMale?"do":"da")+"\n\t\t\t\t")+"<b>"+t._ssrEscape(t._s(t.characterName))+"</b></div> "),t._ssrNode('<div class="customization-categories">',"</div>",[t._l(t.categoriesAssets.categories,(function(e){return t._ssrNode("<a"+t._ssrAttr("id",e.code)+t._ssrClass("customization-categories-item",[{"is-selected":e===t.selectedCategory,"is-disabled":t.isCategoryDisabled(e)},"category-"+e.code])+t._ssrStyle(null,null,{display:"mooner"!==e.code&&"pet"!==e.code?"":"none"})+">","</a>",[t._ssrNode((e.assets.icon?"<img"+t._ssrAttr("src",e.assets.icon)+' class="customization-categories-item-icon">':'<span class="customization-categories-item-icon customization-categories-item-icon-placeholder"></span>')+" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],2)})),t._ssrNode(" "),t._l(t.categoriesAssets.groups,(function(e){return t._ssrNode("<a"+t._ssrClass("customization-categories-item",[{"is-selected":e===t.selectedGroup},"category-"+e.code])+">","</a>",[t._ssrNode((e.assets.icon?"<img"+t._ssrAttr("src",e.assets.icon)+' class="customization-categories-item-icon">':'<span class="customization-categories-item-icon customization-categories-item-icon-placeholder"></span>')+" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],2)}))],2)],2),t._ssrNode(" "),t._ssrNode('<div id="customization-panel-body" class="customization-panel-body">',"</div>",[t._l(t.visibleCategoriesCustomizations,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedCategory,expression:"selectedCategory"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.id),relatedCustomization:t.getCustomizationByCategoryId(e.depends_category),disabledCategories:t.disabledCategories,removableCategory:!e.required},on:{"update:customization":t.handleUpdateCustomization}})})),t._ssrNode(" "),t._l(t.categoriesAssets.groups,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedGroup,expression:"selectedGroup"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.assets.subcategories[0].parent_id),removableCategory:!e.required,customizations:t.customizations},on:{"update:customization":t.handleUpdateCustomization}})}))],2),t._ssrNode(' <div class="helper"><div class="error">'+t._s(t.error)+'</div> <div class="btn-avatar"><div class="btn-avatar-preload">\n\t\t\t\t\tCONTINUAR\n\t\t\t\t\t<div class="icon icon-check"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path fill="#000" fill-rule="evenodd" d="M22.65 17.828a1.996 1.996 0 0 1-.579 1.586l-5.657 5.657a2 2 0 0 1-2.828-2.828L18 17.828l-4.414-4.414a2 2 0 0 1 2.828-2.828l5.657 5.657c.434.434.627 1.018.579 1.585z"></path></svg></div></div> <div class="btn-avatar-loading"><span class="btn-avatar-loading-content">'+t._s(t.loadingContent)+'</span> <span class="btn-avatar-loading-icon"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path fill="#000" fill-rule="evenodd" d="M26.383 12.728c-.433-.47-.986-.727-1.48-.728-.293 0-.569.092-.776.29l-2.306 2.179v-.002l-3.136 2.963c-.055.052-.093.109-.13.16l-3.008 2.841-3.545-3.855c-.217-.235-.526-.347-.858-.347-.47 0-.992.217-1.424.625-.465.44-.719 1-.72 1.5 0 .298.092.576.287.788l3.25 3.533 1.823 1.981c.214.235.52.344.85.344.147 0 .295-.021.448-.061l.085.002c.292.001.566-.087.776-.284l5.44-5.14c.054-.052.094-.11.13-.162l4.567-4.315c.234-.22.344-.532.344-.87 0-.474-.215-1.002-.617-1.442z"></path></svg></span></div></div></div>')],2)},staticRenderFns:[]},(function(t){t&&t("data-v-9bed85a8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.postingCharacter{height:100vh}.customization-panel-heading b{font-weight:400;color:#923fda;text-transform:capitalize}.customization-panel{z-index:100;position:fixed;width:520px;height:100%;top:0;right:0;background:#f8f7fc;border-left:1px solid #dfdae4;transition:all .3s;overflow:hidden}@media (max-width:992px){.customization-panel{width:100%;bottom:0;top:unset;min-height:180px;height:auto}}.customization-panel-head{background:#fff;border-bottom:1px solid #f0ebf5;box-shadow:0 10px 26px 0 #d7d1ef;position:relative;z-index:150}@media (max-width:992px){.customization-panel-head{box-shadow:0 0 26px 0 #d7d1ef}}.customization-panel-heading{height:80px;max-width:100%;line-height:80px;text-align:center;font-family:Roboto,sans-serif;color:#afa2ba;background:#fff;border-bottom:1px solid #dfdae4;font-size:16px}@media (max-width:992px){.customization-panel-heading{display:none}}.customization-panel-body{height:70%;scroll-behavior:smooth;padding-bottom:70px;z-index:20;overflow-y:auto;position:relative}.customization-panel-body::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.customization-panel-body::-webkit-scrollbar{width:7px;background-color:transparent}.customization-panel-body::-webkit-scrollbar-thumb{border-radius:20px;background-color:#e4e4e4}@media (max-width:992px){.customization-panel-body{padding-bottom:0;z-index:0}}.customization-panel .helper{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #dfdae4;box-shadow:0 0 26px 0 #d7d1ef;padding:.7619047619rem 1.1428571429rem;display:flex;align-items:center;justify-content:center;z-index:999}@media (max-width:992px){.customization-panel .helper{display:none;z-index:0}}.customization-panel .helper .error{background:red;width:100%;color:#fff;font-family:Roboto,sans-serif;font-size:14px;padding:15px 0;text-align:center;text-transform:uppercase;position:absolute;transition:all .3s;top:-45px;opacity:0}.btn-avatar{width:100%;height:65px;font-family:Nunito;font-weight:900;padding:0!important;background:#12d3db;background-size:200%;background-position-x:99%;box-shadow:0 .2381rem .95238rem 0 #89e6e8;border-radius:1.90476rem;color:#fff;transition:all .2s cubic-bezier(.4,0,.2,1);border:0;font-size:14px;letter-spacing:.0381rem;line-height:1.2rem;position:relative;display:flex;align-items:center;justify-content:center}.btn-avatar:hover{box-shadow:0 .2381rem .95238rem 0 #89e6e8;-webkit-transform:translateY(-.09524rem);transform:translateY(-.09524rem);cursor:pointer;background-position-x:0;-webkit-transform:translateY(-.14286rem);transform:translateY(-.14286rem);color:#fff}.btn-avatar:active,.btn-avatar:focus{outline:0;box-shadow:0 0 0 #89e6e8;background-position-x:0;-webkit-transform:translateY(.14286rem) scale(.97);transform:translateY(.14286rem) scale(.97)}.btn-avatar .icon{position:absolute;display:flex;justify-content:center;align-items:center;right:0;top:0;margin:15px!important}.btn-avatar .icon path,.btn-avatar .icon svg{fill:#fff;stroke:#fff}@media (max-width:992px){.btn-avatar{display:none!important}}.btn-avatar-mobile{display:none!important}@media (max-width:992px){.btn-avatar-mobile{display:flex!important;width:150px;height:40px;box-shadow:none;font-size:12px;float:right;line-height:1;position:fixed;right:0;top:10px;z-index:200;border-radius:100px;margin-right:.7619047619rem}.btn-avatar-mobile .icon{display:none}}.customization-categories{display:flex;align-items:center;align-content:center;padding:.7619047619rem .7619047619rem}@media (max-width:992px){.customization-categories{padding:0}}.customization-categories .category-vestuario{display:none!important}.customization-categories-item{position:relative;font-size:inherit;flex-basis:0;flex-grow:1;max-width:100%;height:100%;text-align:center}.customization-categories-item:hover{cursor:pointer}.customization-categories-item:hover .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item{height:50px;display:flex;justify-content:center;align-items:center;border:0}}.customization-categories-item-icon{height:52px;width:52px;display:block;border-radius:30px;margin:auto}.customization-categories-item-icon-placeholder{background-color:#dfdae4;border-radius:2px}@media (max-width:992px){.customization-categories-item-icon{display:none}}.customization-categories-item-label{font-weight:400;display:block;font-size:12px;color:#000;text-transform:capitalize!important;font-family:Roboto;padding-top:.380952381rem}@media (max-width:992px){.customization-categories-item-label{margin:0}}.customization-categories-item:first-child{border-left:none}.customization-categories-item.is-selected .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item.is-selected:after{content:"";position:absolute;left:0;bottom:-2px;width:100%;height:3px;background:#12d3db}}@media (max-width:992px) and (max-width:992px){.customization-categories-item.is-selected:after{bottom:0}}.customization-categories-item.is-disabled{opacity:.6}.btn-avatar-reduced{background:#2dd4d9!important;width:65px!important;cursor:wait}@media (max-width:479px){.btn-avatar-reduced{width:40px!important;height:40px!important}}.btn-avatar-loading-completed{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-position:0 0;background-repeat:no-repeat;-webkit-animation:1s loadingCompleted;-moz-animation:1s loadingCompleted;animation:1s loadingCompleted;cursor:wait}@-webkit-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@-moz-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}.btn-avatar-loading-started{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-repeat:no-repeat;background-position:41% 0;-webkit-animation:4s loadingPosition;-moz-animation:4s loadingPosition;animation:4s loadingPosition;transition:.3s;cursor:wait}@-webkit-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@-moz-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}.btn-avatar-loading{font-size:1.4285714286rem;display:none;opacity:0;transition:all .3s;font-size:14px;cursor:wait}.btn-avatar-loading .btn-avatar-loading-icon{display:none;opacity:0;align-items:center;justify-content:center}.btn-avatar-loading .btn-avatar-loading-icon svg{width:2.1904761905rem;height:2.1904761905rem}@media (max-width:479px){.btn-avatar-loading .btn-avatar-loading-icon svg{width:3.5514018692rem;height:3.5514018692rem}}.btn-avatar-loading .btn-avatar-loading-icon path,.btn-avatar-loading .btn-avatar-loading-icon svg{fill:#fff;stroke:#fff}@media (max-width:479px){.btn-avatar-loading{font-size:12px}.btn-avatar-loading .btn-avatar-loading-content{font-size:12px}}',map:void 0,media:void 0})}),{name:"CustomizationPanel",components:{CategoryCustomizations:x,Caption:y},props:{builderApi:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},selectedCharacter:{type:Object,default:{}},characterSlug:{type:String,required:!0},characterId:{type:[Number,String],required:!0},characterTypeId:{type:[Number,String],required:!0},characterName:{type:String,required:!0},characterIsMale:{type:Boolean,required:!0},categoriesAssets:{type:Object,required:!0},disabledCategories:{type:Array,required:!1,default:function(){return[]}},customizations:{type:Array,required:!0},builderProductId:{type:[String,Number],required:!1,default:null},subscriptionId:{type:[Number,String],required:!0},stackId:{type:[Number,String],required:!0},userDataProperties:{type:Object,required:!0},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{selectedCategory:null,selectedGroup:null,selectedCollection:null,error:null,isMobile:null,loadingContent:screen.width<1023?"ENVIANDO":"ENVIANDO PERSONAGEM"}},mounted:function(){if(!document.body.getElementsByClassName("btn-avatar-mobile")[0]){var t=document.getElementsByClassName("btn-avatar")[0].cloneNode(!0);t.classList.add("btn-avatar-mobile"),document.body.appendChild(t),document.body.getElementsByClassName("btn-avatar-mobile")[0].addEventListener("click",this.generateAvatar)}var e=document.getElementsByClassName("top-bar")[0];if(screen.width<=1023&&e&&!e.getElementsByClassName("overlay-opacity")[0]){var a=document.getElementsByClassName("overlay-opacity")[0].cloneNode(!0);e.appendChild(a)}if(!document.body.getElementsByClassName("error-mobile")[0]){var i=document.getElementsByClassName("error")[0].cloneNode(!0);i.classList.add("error-mobile"),document.body.appendChild(i)}window.addEventListener("resize",this.screenResize),screen.width>1023?this.isMobile=!1:this.isMobile=!0},beforeDestroy:function(){document.body.getElementsByClassName("btn-avatar-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("btn-avatar-mobile")[0]),document.body.getElementsByClassName("error-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("error-mobile")[0])},computed:{showColorsCustomizations:function(){return!1},showSubcategoriesCustomizations:function(){return!1},visibleCategoriesCustomizations:function(){var t=this,e=[];return this.selectedCategory?e.push(this.selectedCategory):this.selectedCollection&&this.selectedCollection.categories.forEach((function(a){var i=t.categoriesAssets.categories.find((function(t){return t.id===a}));i&&e.push(i)})),e}},methods:{monthsHelper:function(t){switch(t){case 1:return"Janeiro";case 2:return"Fevereiro";case 3:return"Março";case 4:return"Abril";case 5:return"Maio";case 6:return"Junho";case 7:return"Julho";case 8:return"Agosto";case 9:return"Setembro";case 10:return"Outubro";case 11:return"Novembro";case 12:return"Dezembro"}},generateAvatar:function(){var t=this;return g(h().mark((function a(){var i,o,r,d,s,n,l,c,p,m,u,v;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(i=t,r=!1,t.categoriesAssets.categories.forEach((function(e){e.required?((o=t.customizations.find((function(t){return e.id===t.categoryId})))||(o=t.disabledCategories.find((function(t){return e.id===t.categoryId}))),o||(r=!0,d=e)):(e.code.includes("mooner")||e.code.includes("pet"))&&(o=t.disabledCategories.find((function(t){return e.id===t.categoryId})))})),r){a.next=18;break}return t.$emit("startedMethod"),s=null,n=[],t.customizations.forEach((function(t){var e={parent_id:t.categoryId,id:t.optionId?t.optionId:t.relatedCategoryId};e.parent_id&&e.id&&n.push(e)})),l={properties:i.userDataProperties,type:t.characterTypeId},c={custom_character:{character_id:t.characterId,product_id:t.builderProductId,type_id:t.characterTypeId,categories:n,user_data:l}},t.builderLayoutId&&(c.custom_character.layout_id=t.builderLayoutId),t.language&&(c.custom_character.language=t.language),a.next=14,e({method:"POST",url:"".concat(t.builderApi,"/customs_characters/"),headers:{"Content-Type":"application/json"},data:c}).then((function(t){return t})).catch((function(t){return t}));case 14:(p=a.sent)&&(200===p.status?t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:p.data.custom.uuid,categories:n,success:!0}):(console.log("tentou pegar o segundo request"),p&&p.response&&p.response.reques&&(m=JSON.parse(p.response.request.responseText),s=m?m.error:"Não foi possível gerar o avatar. Tente novamente."),s&&(t.error=s,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)),t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:p.data.custom.uuid,categories:n,success:!1}))),a.next=22;break;case 18:u=d.code,v="pele"===u?"Necessário selecionar um tom de pele":"Necessário selecionar um tipo de ".concat(u),screen.width>1023&&("roupa"===u||"tenis"===u)?(t.error=v,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)):(document.getElementsByClassName("error")[0].style.opacity="1",document.getElementsByClassName("error")[0].textContent=v,setTimeout((function(){document.getElementsByClassName("error")[0].style.opacity="0",document.getElementsByClassName("error")[0].textContent=""}),5e3)),t.$refs[u][0].click();case 22:case"end":return a.stop()}}),a)})))()},getCustomizationTitle:function(t){var e=t?t.toLowerCase():"";switch(e){case"pele":return"Tons de pele";default:return"Tipos de ".concat(e)}},getCustomizationByCategoryId:function(t){return this.customizations.find((function(e){return e.categoryId===t}))},handleSelectCategory:function(t){if(!this.isCategoryDisabled(t)&&this.selectedCategory!==t){this.selectedCharacter.slug;var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];"cabelo"===t.code||"olhos"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):"roupa"===t.code||"tenis"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-out"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0})),this.selectedGroup=null,this.selectedCollection=null,this.selectedCategory=t}},handleSelectGroup:function(t){if(this.selectedGroup!==t){if(screen.width<=1023){var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];this.selectedCharacter.slug;"acessorio"===t.code||"acessorios"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0}))}this.selectedCategory=null,this.selectedCollection=null,this.selectedGroup=t}},handleSelectCollection:function(t){this.selectedCollection!==t&&(this.selectedCategory=null,this.selectedGroup=null,this.selectedCollection=t)},handleUpdateCustomization:function(t){this.$emit("update:customization",t)},isCategoryDisabled:function(t){return void 0!==this.disabledCategories.find((function(e){return e.categoryId===t.id}))},screenResize:function(){if(screen.width>1023){document.getElementsByClassName("customization-preview-asset");
|
|
77
|
-
// const transform = "scale(1) translateY(0)"
|
|
73
|
+
type:{type:String,default:"regular"}},data:function(){return{}}},"data-v-494fbeae",!1,"data-v-494fbeae",!1,void 0,b,void 0),z=f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"avatar-page"},[a("CustomizationView",{attrs:{custom_properties:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,is_male:t.is_male,slug:t.character_slug,uuid:t.uuid,user_data:{properties:t.custom_properties,type_id:t.type_id}},gradient_colors:t.gradient_colors,is_subscription:t.is_subscription,builder_api:"https://builder.dentrodahistoria.com.br/api",builderLayoutId:t.builderLayoutId,language:t.language},on:{startedMethod:t.started,completedMethod:t.completed}})],1)},staticRenderFns:[]},(function(t){t&&t("data-v-1969f868_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);[data-v-1969f868]:root{--column-width:6.6666666667vw}@media (min-width:0px){[data-v-1969f868]:root{--column-width:6.6666666667vw}}@media (min-width:480px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:0px){html[data-v-1969f868]{font-size:2.9166666667vw}}@media (min-width:480px){html[data-v-1969f868]{font-size:14px}}@media (min-width:1024px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1920px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:2620px){[data-v-1969f868]:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html[data-v-1969f868]{font-size:1.5648854962vw}}@media (min-width:2620px){html[data-v-1969f868]{font-size:1.56vw}}html[data-v-1969f868]{box-sizing:border-box}*[data-v-1969f868],[data-v-1969f868]::after,[data-v-1969f868]::before{box-sizing:border-box}hr[data-v-1969f868]{margin:10px -1.5rem}h1[data-v-1969f868]{font-family:Nunito;font-size:24px;font-weight:900;font-style:normal;font-stretch:normal;line-height:normal;letter-spacing:normal;color:#000;margin-top:0;margin-bottom:15px}h1[data-v-1969f868]:first-child{display:none}.ddh-sidebar[data-v-1969f868],.ddh-sidebar.hide-sidebar[data-v-1969f868]{display:none!important}html[data-v-1969f868]{--scale:1;--translate:0%}.loading-view[data-v-1969f868]{position:absolute;top:0;width:100%;height:100%;background:#fff;position:absolute;width:100%;top:0;z-index:200;display:flex;align-items:center;justify-content:center;flex-direction:column}.avatar-page-1[data-v-1969f868]{position:absolute;z-index:3}.avatar-page[data-v-1969f868]{min-height:100vh;position:absolute;width:100%;height:100vh;top:0;left:0;background:#fff}@media (max-width:992px){.avatar-page[data-v-1969f868]{min-height:0;height:100vh;height:calc(var(--vh,1vh) * 100);overflow:hidden}}.return[data-v-1969f868]{position:fixed;z-index:99}.return .icon[data-v-1969f868]{width:38px;height:38px;position:absolute;z-index:30;padding:.95238rem 2.77778vw}.return .icon svg[data-v-1969f868]{width:38px;height:38px}.return .icon svg path[data-v-1969f868]{fill:#afa2ba!important;stroke:#afa2ba!important;transition:all .1s cubic-bezier(.4,0,.2,1)}.return .icon[data-v-1969f868]:hover{cursor:pointer}.return .icon:hover path[data-v-1969f868],.return .icon:hover svg[data-v-1969f868]{fill:#1ad3d9!important;stroke:#1ad3d9!important}.return .icon:active svg[data-v-1969f868]{transform:scale(.9)}',map:void 0,media:void 0})}),{name:"Avatar",components:{CustomizationView:f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._ssrNode('<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous"> <div class="mobile-tooltip"><div class="tooltip">\n\t\t\tLorem ipsum dolor sit amet, eum ne sale vidit epicuri, usu populo\n\t\t\tincorrupte ex. His falli intellegebat no.\n\t\t\t<i class="fas fa-times"></i></div></div> '),a("CustomizationPreview",{attrs:{customizations:t.customizations,"selected-character":t.selectedCharacter,"character-height":t.characterHeight?t.characterHeight:null,"gradient-colors":t.gradient_colors,"character-slug":t.custom_properties.slug,characterHeight:1}}),t._ssrNode(" "),a("CustomizationPanel",{attrs:{"builder-api":t.builder_api,"selected-character":t.selectedCharacter,"character-name":t.custom_properties.user_data.properties.nome.value,"subscription-id":"1","stack-id":"1","character-slug":t.custom_properties.slug,"character-id":t.characterId,"character-type-id":t.characterTypeId,"character-is-male":t.custom_properties.is_male,"categories-assets":t.categoriesAssets,"disabled-categories":t.disabledCategories,customizations:t.customizations,"builder-product-id":t.builderProductId?t.builderProductId:this.custom_properties.product_id,userDataProperties:t.custom_properties.user_data.properties,builderLayoutId:t.builderLayoutId,language:t.language},on:{"update:customization":t.handleCustomization,startedMethod:t.startedMethod,completedMethod:t.completedMethod}})],2)},staticRenderFns:[]},(function(t){t&&t("data-v-264948b7_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.mobile-tooltip{display:none}@media (max-width:992px){.mobile-tooltip{display:none;position:absolute;z-index:90000000;height:calc(100vh - 59px);width:100%;transition:all .3s;bottom:0}.mobile-tooltip .tooltip{border-radius:5px;color:#fff;font-size:14px;padding:10px 36px 10px 16px;width:350px;margin-left:15px;box-shadow:0 1px 2px 0 rgba(0,0,0,.31);line-height:1.5;position:relative;margin-top:auto;bottom:calc(var(--cp) + 25px)}.mobile-tooltip .tooltip:after{top:100%;left:5%;border:solid transparent;content:" ";position:absolute;border-width:10px}.mobile-tooltip .tooltip i{position:absolute;right:10px;top:10px}}',map:void 0,media:void 0})}),{name:"CustomizationView",components:{CustomizationPanel:f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"customization-panel"},[t._ssrNode('<div class="overlay-opacity"></div> '),t._ssrNode('<div class="customization-panel-head">',"</div>",[t._ssrNode('<div class="customization-panel-heading">'+t._ssrEscape("\n\t\t\t\tEditar o personagem "+t._s(t.characterIsMale?"do":"da")+"\n\t\t\t\t")+"<b>"+t._ssrEscape(t._s(t.characterName))+"</b></div> "),t._ssrNode('<div class="customization-categories">',"</div>",[t._l(t.categoriesAssets.categories,(function(e){return t._ssrNode("<a"+t._ssrAttr("id",e.code)+t._ssrClass("customization-categories-item",[{"is-selected":e===t.selectedCategory,"is-disabled":t.isCategoryDisabled(e)},"category-"+e.code])+t._ssrStyle(null,null,{display:"mooner"!==e.code&&"pet"!==e.code?"":"none"})+">","</a>",[t._ssrNode((e.assets.icon?"<img"+t._ssrAttr("src",e.assets.icon)+' class="customization-categories-item-icon">':'<span class="customization-categories-item-icon customization-categories-item-icon-placeholder"></span>')+" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],2)})),t._ssrNode(" "),t._l(t.categoriesAssets.groups,(function(e){return t._ssrNode("<a"+t._ssrClass("customization-categories-item",[{"is-selected":e===t.selectedGroup},"category-"+e.code])+">","</a>",[t._ssrNode((e.assets.icon?"<img"+t._ssrAttr("src",e.assets.icon)+' class="customization-categories-item-icon">':'<span class="customization-categories-item-icon customization-categories-item-icon-placeholder"></span>')+" "),a("Caption",{staticClass:"customization-categories-item-label",attrs:{color:"#AFA2BA"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.name)+"\n\t\t\t\t\t")])],2)}))],2)],2),t._ssrNode(" "),t._ssrNode('<div id="customization-panel-body" class="customization-panel-body">',"</div>",[t._l(t.visibleCategoriesCustomizations,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedCategory,expression:"selectedCategory"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.id),relatedCustomization:t.getCustomizationByCategoryId(e.depends_category),disabledCategories:t.disabledCategories,removableCategory:!e.required},on:{"update:customization":t.handleUpdateCustomization}})})),t._ssrNode(" "),t._l(t.categoriesAssets.groups,(function(e){return a("CategoryCustomizations",{directives:[{name:"show",rawName:"v-show",value:t.selectedGroup,expression:"selectedGroup"}],key:e.id,attrs:{title:e.subtitle,category:e,categoryId:e.id,customization:t.getCustomizationByCategoryId(e.assets.subcategories[0].parent_id),removableCategory:!e.required,customizations:t.customizations},on:{"update:customization":t.handleUpdateCustomization}})}))],2),t._ssrNode(' <div class="helper"><div class="error">'+t._s(t.error)+'</div> <div class="btn-avatar"><div class="btn-avatar-preload">\n\t\t\t\t\tCONTINUAR\n\t\t\t\t\t<div class="icon icon-check"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path fill="#000" fill-rule="evenodd" d="M22.65 17.828a1.996 1.996 0 0 1-.579 1.586l-5.657 5.657a2 2 0 0 1-2.828-2.828L18 17.828l-4.414-4.414a2 2 0 0 1 2.828-2.828l5.657 5.657c.434.434.627 1.018.579 1.585z"></path></svg></div></div> <div class="btn-avatar-loading"><span class="btn-avatar-loading-content">'+t._s(t.loadingContent)+'</span> <span class="btn-avatar-loading-icon"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path fill="#000" fill-rule="evenodd" d="M26.383 12.728c-.433-.47-.986-.727-1.48-.728-.293 0-.569.092-.776.29l-2.306 2.179v-.002l-3.136 2.963c-.055.052-.093.109-.13.16l-3.008 2.841-3.545-3.855c-.217-.235-.526-.347-.858-.347-.47 0-.992.217-1.424.625-.465.44-.719 1-.72 1.5 0 .298.092.576.287.788l3.25 3.533 1.823 1.981c.214.235.52.344.85.344.147 0 .295-.021.448-.061l.085.002c.292.001.566-.087.776-.284l5.44-5.14c.054-.052.094-.11.13-.162l4.567-4.315c.234-.22.344-.532.344-.87 0-.474-.215-1.002-.617-1.442z"></path></svg></span></div></div></div>')],2)},staticRenderFns:[]},(function(t){t&&t("data-v-9bed85a8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.postingCharacter{height:100vh}.customization-panel-heading b{font-weight:400;color:#923fda;text-transform:capitalize}.customization-panel{z-index:100;position:fixed;width:520px;height:100%;top:0;right:0;background:#f8f7fc;border-left:1px solid #dfdae4;transition:all .3s;overflow:hidden}@media (max-width:992px){.customization-panel{width:100%;bottom:0;top:unset;min-height:180px;height:auto}}.customization-panel-head{background:#fff;border-bottom:1px solid #f0ebf5;box-shadow:0 10px 26px 0 #d7d1ef;position:relative;z-index:150}@media (max-width:992px){.customization-panel-head{box-shadow:0 0 26px 0 #d7d1ef}}.customization-panel-heading{height:80px;max-width:100%;line-height:80px;text-align:center;font-family:Roboto,sans-serif;color:#afa2ba;background:#fff;border-bottom:1px solid #dfdae4;font-size:16px}@media (max-width:992px){.customization-panel-heading{display:none}}.customization-panel-body{height:70%;scroll-behavior:smooth;padding-bottom:70px;z-index:20;overflow-y:auto;position:relative}.customization-panel-body::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.customization-panel-body::-webkit-scrollbar{width:7px;background-color:transparent}.customization-panel-body::-webkit-scrollbar-thumb{border-radius:20px;background-color:#e4e4e4}@media (max-width:992px){.customization-panel-body{padding-bottom:0;z-index:0}}.customization-panel .helper{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #dfdae4;box-shadow:0 0 26px 0 #d7d1ef;padding:.7619047619rem 1.1428571429rem;display:flex;align-items:center;justify-content:center;z-index:999}@media (max-width:992px){.customization-panel .helper{display:none;z-index:0}}.customization-panel .helper .error{background:red;width:100%;color:#fff;font-family:Roboto,sans-serif;font-size:14px;padding:15px 0;text-align:center;text-transform:uppercase;position:absolute;transition:all .3s;top:-45px;opacity:0}.btn-avatar{width:100%;height:65px;font-family:Nunito;font-weight:900;padding:0!important;background:#12d3db;background-size:200%;background-position-x:99%;box-shadow:0 .2381rem .95238rem 0 #89e6e8;border-radius:1.90476rem;color:#fff;transition:all .2s cubic-bezier(.4,0,.2,1);border:0;font-size:14px;letter-spacing:.0381rem;line-height:1.2rem;position:relative;display:flex;align-items:center;justify-content:center}.btn-avatar:hover{box-shadow:0 .2381rem .95238rem 0 #89e6e8;-webkit-transform:translateY(-.09524rem);transform:translateY(-.09524rem);cursor:pointer;background-position-x:0;-webkit-transform:translateY(-.14286rem);transform:translateY(-.14286rem);color:#fff}.btn-avatar:active,.btn-avatar:focus{outline:0;box-shadow:0 0 0 #89e6e8;background-position-x:0;-webkit-transform:translateY(.14286rem) scale(.97);transform:translateY(.14286rem) scale(.97)}.btn-avatar .icon{position:absolute;display:flex;justify-content:center;align-items:center;right:0;top:0;margin:15px!important}.btn-avatar .icon path,.btn-avatar .icon svg{fill:#fff;stroke:#fff}@media (max-width:992px){.btn-avatar{display:none!important}}.btn-avatar-mobile{display:none!important}@media (max-width:992px){.btn-avatar-mobile{display:flex!important;width:150px;height:40px;box-shadow:none;font-size:12px;float:right;line-height:1;position:fixed;right:0;top:10px;z-index:200;border-radius:100px;margin-right:.7619047619rem}.btn-avatar-mobile .icon{display:none}}.customization-categories{display:flex;align-items:center;align-content:center;padding:.7619047619rem .7619047619rem}@media (max-width:992px){.customization-categories{padding:0}}.customization-categories .category-vestuario{display:none!important}.customization-categories-item{position:relative;font-size:inherit;flex-basis:0;flex-grow:1;max-width:100%;height:100%;text-align:center}.customization-categories-item:hover{cursor:pointer}.customization-categories-item:hover .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item{height:50px;display:flex;justify-content:center;align-items:center;border:0}}.customization-categories-item-icon{height:52px;width:52px;display:block;border-radius:30px;margin:auto}.customization-categories-item-icon-placeholder{background-color:#dfdae4;border-radius:2px}@media (max-width:992px){.customization-categories-item-icon{display:none}}.customization-categories-item-label{font-weight:400;display:block;font-size:12px;color:#000;text-transform:capitalize!important;font-family:Roboto;padding-top:.380952381rem}@media (max-width:992px){.customization-categories-item-label{margin:0}}.customization-categories-item:first-child{border-left:none}.customization-categories-item.is-selected .customization-categories-item-label{color:#12d3db!important}@media (max-width:992px){.customization-categories-item.is-selected:after{content:"";position:absolute;left:0;bottom:-2px;width:100%;height:3px;background:#12d3db}}@media (max-width:992px) and (max-width:992px){.customization-categories-item.is-selected:after{bottom:0}}.customization-categories-item.is-disabled{opacity:.6}.btn-avatar-reduced{background:#2dd4d9!important;width:65px!important;cursor:wait}@media (max-width:479px){.btn-avatar-reduced{width:40px!important;height:40px!important}}.btn-avatar-loading-completed{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-position:0 0;background-repeat:no-repeat;-webkit-animation:1s loadingCompleted;-moz-animation:1s loadingCompleted;animation:1s loadingCompleted;cursor:wait}@-webkit-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@-moz-keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}@keyframes loadingCompleted{0%{background-position:41% 0}100%{background-position:0 0}}.btn-avatar-loading-started{background-color:#2dd4d9;background-image:linear-gradient(90deg,#04bb69 50%,#00cf72 50%);background-repeat:no-repeat;background-position:41% 0;-webkit-animation:4s loadingPosition;-moz-animation:4s loadingPosition;animation:4s loadingPosition;transition:.3s;cursor:wait}@-webkit-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@-moz-keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}@keyframes loadingPosition{0%{background-position:100% 0}35%{background-position:92% 0}50%{background-position:83% 0}75%{background-position:72% 0}100%{background-position:41% 0}}.btn-avatar-loading{font-size:1.4285714286rem;display:none;opacity:0;transition:all .3s;font-size:14px;cursor:wait}.btn-avatar-loading .btn-avatar-loading-icon{display:none;opacity:0;align-items:center;justify-content:center}.btn-avatar-loading .btn-avatar-loading-icon svg{width:2.1904761905rem;height:2.1904761905rem}@media (max-width:479px){.btn-avatar-loading .btn-avatar-loading-icon svg{width:3.5514018692rem;height:3.5514018692rem}}.btn-avatar-loading .btn-avatar-loading-icon path,.btn-avatar-loading .btn-avatar-loading-icon svg{fill:#fff;stroke:#fff}@media (max-width:479px){.btn-avatar-loading{font-size:12px}.btn-avatar-loading .btn-avatar-loading-content{font-size:12px}}',map:void 0,media:void 0})}),{name:"CustomizationPanel",components:{CategoryCustomizations:x,Caption:y},props:{builderApi:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},selectedCharacter:{type:Object,default:{}},characterSlug:{type:String,required:!0},characterId:{type:[Number,String],required:!0},characterTypeId:{type:[Number,String],required:!0},characterName:{type:String,required:!0},characterIsMale:{type:Boolean,required:!0},categoriesAssets:{type:Object,required:!0},disabledCategories:{type:Array,required:!1,default:function(){return[]}},customizations:{type:Array,required:!0},builderProductId:{type:[String,Number],required:!1,default:null},subscriptionId:{type:[Number,String],required:!0},stackId:{type:[Number,String],required:!0},userDataProperties:{type:Object,required:!0},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{selectedCategory:null,selectedGroup:null,selectedCollection:null,error:null,isMobile:null,loadingContent:screen.width<1023?"ENVIANDO":"ENVIANDO PERSONAGEM"}},mounted:function(){if(!document.body.getElementsByClassName("btn-avatar-mobile")[0]){var t=document.getElementsByClassName("btn-avatar")[0].cloneNode(!0);t.classList.add("btn-avatar-mobile"),document.body.appendChild(t),document.body.getElementsByClassName("btn-avatar-mobile")[0].addEventListener("click",this.generateAvatar)}var e=document.getElementsByClassName("top-bar")[0];if(screen.width<=1023&&e&&!e.getElementsByClassName("overlay-opacity")[0]){var a=document.getElementsByClassName("overlay-opacity")[0].cloneNode(!0);e.appendChild(a)}if(!document.body.getElementsByClassName("error-mobile")[0]){var i=document.getElementsByClassName("error")[0].cloneNode(!0);i.classList.add("error-mobile"),document.body.appendChild(i)}window.addEventListener("resize",this.screenResize),screen.width>1023?this.isMobile=!1:this.isMobile=!0},beforeDestroy:function(){document.body.getElementsByClassName("btn-avatar-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("btn-avatar-mobile")[0]),document.body.getElementsByClassName("error-mobile")[0]&&document.body.removeChild(document.getElementsByClassName("error-mobile")[0])},computed:{showColorsCustomizations:function(){return!1},showSubcategoriesCustomizations:function(){return!1},visibleCategoriesCustomizations:function(){var t=this,e=[];return this.selectedCategory?e.push(this.selectedCategory):this.selectedCollection&&this.selectedCollection.categories.forEach((function(a){var i=t.categoriesAssets.categories.find((function(t){return t.id===a}));i&&e.push(i)})),e}},methods:{monthsHelper:function(t){switch(t){case 1:return"Janeiro";case 2:return"Fevereiro";case 3:return"Março";case 4:return"Abril";case 5:return"Maio";case 6:return"Junho";case 7:return"Julho";case 8:return"Agosto";case 9:return"Setembro";case 10:return"Outubro";case 11:return"Novembro";case 12:return"Dezembro"}},generateAvatar:function(){var t=this;return g(h().mark((function a(){var i,o,r,d,s,n,l,c,p,m,u,v;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(i=t,r=!1,t.categoriesAssets.categories.forEach((function(e){e.required?((o=t.customizations.find((function(t){return e.id===t.categoryId})))||(o=t.disabledCategories.find((function(t){return e.id===t.categoryId}))),o||(r=!0,d=e)):(e.code.includes("mooner")||e.code.includes("pet"))&&(o=t.disabledCategories.find((function(t){return e.id===t.categoryId})))})),r){a.next=18;break}return t.$emit("startedMethod"),s=null,n=[],t.customizations.forEach((function(t){var e={parent_id:t.categoryId,id:t.optionId?t.optionId:t.relatedCategoryId};e.parent_id&&e.id&&n.push(e)})),l={properties:i.userDataProperties,type:t.characterTypeId},c={custom_character:{character_id:t.characterId,product_id:t.builderProductId,type_id:t.characterTypeId,categories:n,user_data:l}},t.builderLayoutId&&(c.custom_character.layout_id=t.builderLayoutId),t.language&&(c.custom_character.language=t.language),a.next=14,e({method:"POST",url:"".concat(t.builderApi,"/customs_characters/"),headers:{"Content-Type":"application/json"},data:c}).then((function(t){return t})).catch((function(t){return t}));case 14:(p=a.sent)&&(200===p.status?t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:p.data.custom.uuid,categories:n,success:!0}):(console.log("tentou pegar o segundo request"),p&&p.response&&p.response.reques&&(m=JSON.parse(p.response.request.responseText),s=m?m.error:"Não foi possível gerar o avatar. Tente novamente."),s&&(t.error=s,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)),t.$emit("completedMethod",{updatedCustomizations:t.customizations,updatedUuid:p.data.custom.uuid,categories:n,success:!1}))),a.next=22;break;case 18:u=d.code,v="pele"===u?"Necessário selecionar um tom de pele":"Necessário selecionar um tipo de ".concat(u),screen.width>1023&&("roupa"===u||"tenis"===u)?(t.error=v,t.$refs.error.style.opacity="1",setTimeout((function(){t.$refs.error.style.opacity="0"}),5e3)):(document.getElementsByClassName("error")[0].style.opacity="1",document.getElementsByClassName("error")[0].textContent=v,setTimeout((function(){document.getElementsByClassName("error")[0].style.opacity="0",document.getElementsByClassName("error")[0].textContent=""}),5e3)),t.$refs[u][0].click();case 22:case"end":return a.stop()}}),a)})))()},getCustomizationTitle:function(t){var e=t?t.toLowerCase():"";switch(e){case"pele":return"Tons de pele";default:return"Tipos de ".concat(e)}},getCustomizationByCategoryId:function(t){return this.customizations.find((function(e){return e.categoryId===t}))},handleSelectCategory:function(t){if(!this.isCategoryDisabled(t)&&this.selectedCategory!==t){this.selectedCharacter.slug;var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];"cabelo"===t.code||"olhos"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):"roupa"===t.code||"tenis"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-out"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0})),this.selectedGroup=null,this.selectedCollection=null,this.selectedCategory=t}},handleSelectGroup:function(t){if(this.selectedGroup!==t){if(screen.width<=1023){var e=document.getElementsByClassName("customization-preview-asset"),a=document.getElementsByClassName("customization-preview")[0];this.selectedCharacter.slug;"acessorio"===t.code||"acessorios"===t.code||"oculos"===t.code?(a.classList.remove("zoom-in"),a.classList.remove("zoom-out"),a.className+=" zoom-in"):(a.classList.remove("zoom-in"),a.classList.remove("zoom-out")),Array.from(e).forEach((function(t){t.style.transform=void 0}))}this.selectedCategory=null,this.selectedCollection=null,this.selectedGroup=t}},handleSelectCollection:function(t){this.selectedCollection!==t&&(this.selectedCategory=null,this.selectedGroup=null,this.selectedCollection=t)},handleUpdateCustomization:function(t){this.$emit("update:customization",t)},isCategoryDisabled:function(t){return void 0!==this.disabledCategories.find((function(e){return e.categoryId===t.id}))},screenResize:function(){if(screen.width>1023){document.getElementsByClassName("customization-preview-asset");// const transform = "scale(1) translateY(0)"
|
|
78
74
|
// Array.from(avatar).forEach(piece => {
|
|
79
75
|
// piece.style.transform = transform
|
|
80
76
|
// })
|
|
81
|
-
this.isMobile&&(this.isMobile=!1)}else this.isMobile||(this.isMobile=!0);this.categoriesAssets&&this.categoriesAssets.categories&&(this.selectedCategory=this.categoriesAssets.categories[0]),this.selectedGroup=null,this.selectedCollection=null}},updated:function(){!this.categoriesAssets||!this.categoriesAssets.categories||this.selectedCategory||this.selectedGroup||this.selectedCollection||(this.selectedCategory=this.categoriesAssets.categories[0])}},void 0,!1,"data-v-9bed85a8",!1,void 0,b,void 0),CustomizationPreview:f({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"customization-preview",class:"avatar-"+t.characterSlug,style:t.gradientColors&&t.gradientColors.bgInner?"background-image: radial-gradient(circle, "+t.gradientColors.bgInner+" 0%, "+t.gradientColors.bgCentral+" 10%, "+t.gradientColors.bgOuter+" 100%);":null},[t._ssrNode('<div class="overlay-opacity"></div> <div class="customization-preview-stage">'+t._ssrList(t.customizations,(function(e){return"<img"+t._ssrAttr("src",e.optionAsset)+t._ssrClass("customization-preview-asset",t.characterHeight?"alt":"com")+t._ssrStyle(null,[{transform:"scale("+t.selectedCharacter.fixers.size*t.scaleFixerMobile+") translate("+(t.selectedCharacter.fixers.x*t.scaleFixerMobile-32)+"px, "+(t.selectedCharacter.fixers.y*t.scaleFixerMobile-28)+"px)",zIndex:null!=e.priorityZIndex?e.priorityZIndex:e.zIndex?e.zIndex:e.categoryZIndex}],null)+">"}))+"</div>")])},staticRenderFns:[]},(function(t){t&&t("data-v-f9a501c8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.customization-preview{position:relative;width:calc(100vw - 520px);height:100vh;transition:all .5s}@media (max-width:479px){.customization-preview{height:calc(var(--vh,1vh) * 100 - var(--cp));width:100%;top:0;min-width:100vw}}.customization-preview-asset{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s}.customization-preview.zoom-in{transform:scale(1.8) translate(-2%,10%)!important}@media (max-width:479px){.customization-preview.zoom-in{transform:scale(1.7) translate(0,12%)!important}}',map:void 0,media:void 0})}),{name:"CustomizationPreview",props:{customizations:{type:Array,required:!0},selectedCharacter:{type:Object,required:!0},characterHeight:{type:Number,default:0},gradientColors:{type:Object,required:!1},characterSlug:{type:String,required:!1,default:"noone"}},data:function(){return{screenWidth:null,isMobile:!1,scaleFixer:1.2,scaleFixerMobile:1.1}},mounted:function(){var t=this;console.log(t.isMobile);var e=document.querySelector(".customization-panel").clientHeight;console.log(document.documentElement.style),document.documentElement.style.setProperty("--cp","".concat(e,"px")),this.screenWidth=screen.width,t.detectSize(),window.addEventListener("resize",(function(e){t.detectSize();
|
|
82
|
-
//alert(self.isMobile);
|
|
77
|
+
this.isMobile&&(this.isMobile=!1)}else this.isMobile||(this.isMobile=!0);this.categoriesAssets&&this.categoriesAssets.categories&&(this.selectedCategory=this.categoriesAssets.categories[0]),this.selectedGroup=null,this.selectedCollection=null}},updated:function(){!this.categoriesAssets||!this.categoriesAssets.categories||this.selectedCategory||this.selectedGroup||this.selectedCollection||(this.selectedCategory=this.categoriesAssets.categories[0])}},void 0,!1,"data-v-9bed85a8",!1,void 0,b,void 0),CustomizationPreview:f({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"customization-preview",class:"avatar-"+t.characterSlug,style:t.gradientColors&&t.gradientColors.bgInner?"background-image: radial-gradient(circle, "+t.gradientColors.bgInner+" 0%, "+t.gradientColors.bgCentral+" 10%, "+t.gradientColors.bgOuter+" 100%);":null},[t._ssrNode('<div class="overlay-opacity"></div> <div class="customization-preview-stage">'+t._ssrList(t.customizations,(function(e){return"<img"+t._ssrAttr("src",e.optionAsset)+t._ssrClass("customization-preview-asset",t.characterHeight?"alt":"com")+t._ssrStyle(null,[{transform:"scale("+t.selectedCharacter.fixers.size*t.scaleFixerMobile+") translate("+(t.selectedCharacter.fixers.x*t.scaleFixerMobile-32)+"px, "+(t.selectedCharacter.fixers.y*t.scaleFixerMobile-28)+"px)",zIndex:null!=e.priorityZIndex?e.priorityZIndex:e.zIndex?e.zIndex:e.categoryZIndex}],null)+">"}))+"</div>")])},staticRenderFns:[]},(function(t){t&&t("data-v-f9a501c8_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.customization-preview{position:relative;width:calc(100vw - 520px);height:100vh;transition:all .5s}@media (max-width:479px){.customization-preview{height:calc(var(--vh,1vh) * 100 - var(--cp));width:100%;top:0;min-width:100vw}}.customization-preview-asset{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s}.customization-preview.zoom-in{transform:scale(1.8) translate(-2%,10%)!important}@media (max-width:479px){.customization-preview.zoom-in{transform:scale(1.7) translate(0,12%)!important}}',map:void 0,media:void 0})}),{name:"CustomizationPreview",props:{customizations:{type:Array,required:!0},selectedCharacter:{type:Object,required:!0},characterHeight:{type:Number,default:0},gradientColors:{type:Object,required:!1},characterSlug:{type:String,required:!1,default:"noone"}},data:function(){return{screenWidth:null,isMobile:!1,scaleFixer:1.2,scaleFixerMobile:1.1}},mounted:function(){var t=this;console.log(t.isMobile);var e=document.querySelector(".customization-panel").clientHeight;console.log(document.documentElement.style),document.documentElement.style.setProperty("--cp","".concat(e,"px")),this.screenWidth=screen.width,t.detectSize(),window.addEventListener("resize",(function(e){t.detectSize();//alert(self.isMobile);
|
|
83
78
|
}))},methods:{detectSize:function(){this.isMobile=!1,this.screenWidth<990&&(this.isMobile=!0)}}},void 0,!1,"data-v-f9a501c8",!1,void 0,b,void 0)},props:{custom_properties:{type:Object,required:!0},builder_api:{type:String,default:"https://builder.dentrodahistoria.com.br/api"},is_subscription:{type:Boolean,default:!1},gradient_colors:{type:Object,required:!1},builderLayoutId:{type:[Number,String],required:!1},language:{type:String,required:!1}},data:function(){return{categoriesAssets:{},customizations:[],
|
|
84
79
|
// Velho e bom customizations
|
|
85
80
|
requiredCategories:[],
|
|
@@ -109,8 +104,7 @@ initDisabledCategories:function(){var t=this;this.customizations.forEach((functi
|
|
|
109
104
|
i=t.categoriesAssets.groups.find((function(t){t.groupedCategories.includes(e.categoryId)}))),i){
|
|
110
105
|
// Caso a categoria dependa de outra descemos o nível da arvore
|
|
111
106
|
// de assets para pegar apenas as subcategorias e cores dependêntes
|
|
112
|
-
if(i.depends_category){var o=t.getCustomization(i.depends_category);i=i.assets.categories.find((function(t){return a=o.optionId,t.parent_id===a}))}
|
|
113
|
-
// Buscando a subbategoria com as informações a respeito das
|
|
107
|
+
if(i.depends_category){var o=t.getCustomization(i.depends_category);i=i.assets.categories.find((function(t){return a=o.optionId,t.parent_id===a}))}// Buscando a subbategoria com as informações a respeito das
|
|
114
108
|
// categorias para desabilitar
|
|
115
109
|
a=e.optionId;var r=i.assets.subcategories.find((function(t){if(t.assets.colors&&t.assets.colors.length){var e=!1;return t.assets.colors.forEach((function(t){t.id===a&&(e=!0)})),e}return t.id===a}));r&&t.updateDisabledCategories(e,r.disable)}}))},
|
|
116
110
|
/*
|
|
@@ -122,8 +116,7 @@ initDefaultCustomizationCharacter:function(){var t,e=this,a=[];
|
|
|
122
116
|
* Definindo as customizações default das categorias sem
|
|
123
117
|
* dependencia
|
|
124
118
|
*/
|
|
125
|
-
this.categoriesAssets.categories.forEach((function(i){i.depends_category?a.push(i):(t=e.getCategoryDefaultCustomization(i),i.code.includes("mooner")&&(console.log(i)
|
|
126
|
-
// c.assets.subcategories[0].parent_id;
|
|
119
|
+
this.categoriesAssets.categories.forEach((function(i){i.depends_category?a.push(i):(t=e.getCategoryDefaultCustomization(i),i.code.includes("mooner")&&(console.log(i),// c.assets.subcategories[0].parent_id;
|
|
127
120
|
// null
|
|
128
121
|
// c.assets.subcategories[0].id;
|
|
129
122
|
// c.assets.subcategories[0].name;
|
|
@@ -141,8 +134,7 @@ loadCustomizationCharacter:function(){var t=this;return g(h().mark((function e()
|
|
|
141
134
|
// Verifica se há outra customização que deve ser atualizada
|
|
142
135
|
// em função dessa atualização e atualiza essa customização
|
|
143
136
|
// antes
|
|
144
|
-
this.handleUpdateRelatedCategories(e);var l=this.updateCustomizations(e.categoryId,e.relatedCategoryId,e.optionId,e.optionName,e.optionAsset,e.optionZIndex,e.categoryZIndex,o,d,n)
|
|
145
|
-
// Desabilitando categorias associadas a customização
|
|
137
|
+
this.handleUpdateRelatedCategories(e);var l=this.updateCustomizations(e.categoryId,e.relatedCategoryId,e.optionId,e.optionName,e.optionAsset,e.optionZIndex,e.categoryZIndex,o,d,n);// Desabilitando categorias associadas a customização
|
|
146
138
|
this.updateDisabledCategories(l,a)},
|
|
147
139
|
/**
|
|
148
140
|
* Essa funçaão recebe a customização da categoria pai
|
|
@@ -155,8 +147,7 @@ handleUpdateRelatedCategories:function(t){var e=this;this.categoriesAssets.categ
|
|
|
155
147
|
// Pegando a customização da categoria relacionada
|
|
156
148
|
// e recuperando a subcategoryId para atualizar depois
|
|
157
149
|
// as informações de customização da categoria relacionada
|
|
158
|
-
var i=e.getCustomization(a.id),o=null,r=null;if(!i)return;a.assets.categories.forEach((function(t){t.assets.subcategories.forEach((function(t){t.assets.colors.forEach((function(e){e.id===i.optionId&&(o=t)}))}))})),(
|
|
159
|
-
// Procurando a nova subcategoria
|
|
150
|
+
var i=e.getCustomization(a.id),o=null,r=null;if(!i)return;a.assets.categories.forEach((function(t){t.assets.subcategories.forEach((function(t){t.assets.colors.forEach((function(e){e.id===i.optionId&&(o=t)}))}))})),(// Procurando a nova subcategoria
|
|
160
151
|
// já com a referência correta da categoria
|
|
161
152
|
r=a.assets.categories.find((function(e){return e.parent_id===t.optionId})))&&r.assets.subcategories.forEach((function(t){t.id===o.id&&t.assets.colors.forEach((function(e){e.hexa===i.optionName&&(i.optionId=e.id,i.optionName=e.hexa,i.optionAsset=e.assets.asset,i.optionZIndex=t.z_index)}))}))}}))},fakeData:function(){var t=this.categoriesAssets.categories[0]?this.categoriesAssets.categories[0].id:0,e=this.categoriesAssets.categories[1]?this.categoriesAssets.categories[1].id:0;this.categoriesAssets.collections=[],this.categoriesAssets.collections.push({id:1e4,name:"Vestuario",icon:"https://dka04237waacy.cloudfront.net/uploads/turma-da-monica/tp-corpo-branco-3.png",categories:[t,e]})},parseCollection:function(){var t=this;this.categoriesAssets.collections&&this.categoriesAssets.collections[0]&&this.categoriesAssets.collections[0].categories.forEach((function(e,a){t.categoriesAssets.collections[0].categories[a]=parseInt(e)}))},removeTooltip:function(){var t=document.getElementsByClassName("mobile-tooltip")[0];t.parentNode.removeChild(t)}}},void 0,!1,"data-v-264948b7",!1,void 0,b,void 0)},props:{
|
|
162
153
|
/**
|
|
@@ -321,8 +312,7 @@ loadingProgress:{type:Number,required:!1},
|
|
|
321
312
|
*/
|
|
322
313
|
isLoadingCompleted:{type:Boolean,required:!1}},watch:{isLoadingCompleted:{
|
|
323
314
|
// the callback will be called immediately after the start of the observation
|
|
324
|
-
immediate:!0,handler:function(t,e){var a=this;!0===t?setTimeout((function(){a.isLoadingCompleteCheck=!0}),3e3):a.isLoadingCompleteCheck=!1
|
|
325
|
-
// if(this.initialValue === ''){
|
|
315
|
+
immediate:!0,handler:function(t,e){var a=this;!0===t?setTimeout((function(){a.isLoadingCompleteCheck=!0}),3e3):a.isLoadingCompleteCheck=!1;// if(this.initialValue === ''){
|
|
326
316
|
// this.initialValue = val
|
|
327
317
|
// }
|
|
328
318
|
// this.finalValue = val
|
|
@@ -534,8 +524,7 @@ link:{type:String,required:!1},
|
|
|
534
524
|
* Existe campo de validação<br>
|
|
535
525
|
* Values: `lg` `sm`
|
|
536
526
|
*/
|
|
537
|
-
linkLabel:{type:String,required:!1}},data:function(){return{isCallingOne:!1,isCallingAll:!1,condCpfCnpn:this.onChangeCpf,cpf:{numero:"",cpfLengthUnmasked:11,cpfLengthMasked:14},card:{mask:"#### #### #### ####",length:17,flag:"",error:""}}},methods:{onChangeCardNumber:function(t){t.e;var e=t.target;if(e.value.length>=3){o.number(e.value).card?("american-express"===o.number(e.value).card.type||"diners-club"===o.number(e.value).card.type?(this.card.mask="#### ###### #####",this.card.length=17):(this.card.mask="#### #### #### ####",this.card.length=19),this.card.flag=o.number(e.value).card.type):this.card.flag="",e.value.length>=this.card.length&&(o.number(e.value).isValid?this.card.error="":this.card.error="Número incorreto");var a={target:e.name,value:e.value,flag:this.card.flag,error:this.card.error};this.$emit("update",a)}else{this.card.flag="",this.card.error="";var i={target:e.name,value:e.value,flag:""};this.$emit("update",i)}},onChangeCardExpiration:function(t){t.e;var e,a=t.target;if(5===a.value.length){e=o.expirationDate(a.value).isValid?"":"Data de validade inválida";var i={target:a.name,value:a.value,error:e};this.$emit("update",i)}else{e="";var r={target:a.name,value:a.value};this.$emit("update",r)}},condCpfCnpj:function(t){t.target.value.length<=14?this.onChangeCpf(t,t.target):this.onChangeCnpj(t,t.target)},onChangeCnpj:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^\d]+/g,"");if(i.length>=13)if(""==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else if("00000000000000"==i
|
|
538
|
-
// Elimina CNPJs invalidos conhecidos
|
|
527
|
+
linkLabel:{type:String,required:!1}},data:function(){return{isCallingOne:!1,isCallingAll:!1,condCpfCnpn:this.onChangeCpf,cpf:{numero:"",cpfLengthUnmasked:11,cpfLengthMasked:14},card:{mask:"#### #### #### ####",length:17,flag:"",error:""}}},methods:{onChangeCardNumber:function(t){t.e;var e=t.target;if(e.value.length>=3){o.number(e.value).card?("american-express"===o.number(e.value).card.type||"diners-club"===o.number(e.value).card.type?(this.card.mask="#### ###### #####",this.card.length=17):(this.card.mask="#### #### #### ####",this.card.length=19),this.card.flag=o.number(e.value).card.type):this.card.flag="",e.value.length>=this.card.length&&(o.number(e.value).isValid?this.card.error="":this.card.error="Número incorreto");var a={target:e.name,value:e.value,flag:this.card.flag,error:this.card.error};this.$emit("update",a)}else{this.card.flag="",this.card.error="";var i={target:e.name,value:e.value,flag:""};this.$emit("update",i)}},onChangeCardExpiration:function(t){t.e;var e,a=t.target;if(5===a.value.length){e=o.expirationDate(a.value).isValid?"":"Data de validade inválida";var i={target:a.name,value:a.value,error:e};this.$emit("update",i)}else{e="";var r={target:a.name,value:a.value};this.$emit("update",r)}},condCpfCnpj:function(t){t.target.value.length<=14?this.onChangeCpf(t,t.target):this.onChangeCnpj(t,t.target)},onChangeCnpj:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^\d]+/g,"");if(i.length>=13)if(""==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else if("00000000000000"==i||// Elimina CNPJs invalidos conhecidos
|
|
539
528
|
"11111111111111"==i||"22222222222222"==i||"33333333333333"==i||"44444444444444"==i||"55555555555555"==i||"66666666666666"==i||"77777777777777"==i||"88888888888888"==i||"99999999999999"==i)e={target:a.name,value:a.value,error:"CNPJ inválido"};else{for(
|
|
540
529
|
// Valida DVs
|
|
541
530
|
var o=i.length-2,r=i.substring(0,o),d=i.substring(o),s=0,n=o-7,l=o;l>=1;l--)s+=r.charAt(o-l)*n--,n<2&&(n=9);var c=s%11<2?0:11-s%11;if(c!=d.charAt(0))e={target:a.name,value:a.value,error:"CNPJ inválido"};else{o+=1,r=i.substring(0,o),s=0,n=o-7;for(var p=o;p>=1;p--)s+=r.charAt(o-p)*n--,n<2&&(n=9);e=(c=s%11<2?0:11-s%11)!=d.charAt(1)?{target:a.name,value:a.value,error:"CNPJ inválido"}:{target:a.name,value:a.value,error:""}}}else e={target:a.name,value:a.value,error:""};this.$emit("update",e)},onChangeCpf:function(t){t.e;var e,a=t.target,i=a.value.replace(/[^0-9]/g,"");if(i.length===this.cpf.cpfLengthUnmasked){var o,r,d;d="",o=0,"00000000000"!==i&&"11111111111"!==i&&"22222222222"!==i&&"33333333333"!==i&&"44444444444"!==i&&"55555555555"!==i&&"66666666666"!==i&&"77777777777"!==i&&"88888888888"!==i&&"99999999999"!==i||(d="CPF Inválido");for(var s=1;s<=9;s++)o+=parseInt(i.substring(s-1,s))*(11-s);10!==(r=10*o%11)&&11!==r||(r=0),r!==parseInt(i.substring(9,10))&&(d="CPF Inválido"),o=0;for(var n=1;n<=10;n++)o+=parseInt(i.substring(n-1,n))*(12-n);10!==(r=10*o%11)&&11!==r||(r=0),r!==parseInt(i.substring(10,11))&&(d="CPF Inválido"),e={target:a.name,value:a.value,error:d}}else e={target:a.name,value:a.value,error:""};
|
|
@@ -1304,30 +1293,23 @@ o="",r=1;case 5:if(!(r<6)){e.next=13;break}return e.next=8,a.getImagePuzzle(r);c
|
|
|
1304
1293
|
// "&v=0&update=" +
|
|
1305
1294
|
// n +
|
|
1306
1295
|
// "' alt=''></div>";
|
|
1307
|
-
return vt("#flipbook").html(o),e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)})))()},initBook:function(){var t=this,e=t.resize();this.flipbookWidth=e.width,this.flipbookHeight=e.height
|
|
1308
|
-
// this.flipbookWidth = self.formato === "square" ? "100vh" : "100vh";
|
|
1296
|
+
return vt("#flipbook").html(o),e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)})))()},initBook:function(){var t=this,e=t.resize();this.flipbookWidth=e.width,this.flipbookHeight=e.height,// this.flipbookWidth = self.formato === "square" ? "100vh" : "100vh";
|
|
1309
1297
|
// this.flipbookHeight =
|
|
1310
1298
|
// self.formato === "square"
|
|
1311
1299
|
// ? "calc(100vh - 91px)"
|
|
1312
1300
|
// : "calc(100vh - 91px)";
|
|
1313
|
-
vt("#flipbook").turn({width:t.flipbookWidth,height:t.flipbookHeight,autoCenter:!1,gradients:!0,acceleration:!0,duration:800,elevation:150}),vt("#flipbook").bind("start",(function(t,e,a){console.log(t),console.log(e),console.log(a),"r"==a||"l"==a?vt(".page-wrapper").css("cursor","pointer"):vt(".page-wrapper").css("cursor","unset"),"tl"!=a&&"tr"!=a&&"bl"!=a&&"br"!=a||t.preventDefault()})),vt("#flipbook").bind("end",(function(t,e,a){
|
|
1314
|
-
|
|
1315
|
-
})),
|
|
1316
|
-
// Habilitar passagem via o dedo
|
|
1317
|
-
vt(document).keydown((function(t){switch(t.keyCode){case 37:n("#flipbook").turn("previous");break;case 39:n("#flipbook").turn("next")}})),t.isCover="-"+vt(".page-wrapper[page="+t.currentPage+"]").width(),vt("#flipbook").bind("turning",(function(e,a,i){t.currentPage=a,t.currentPage>=t.loadedPages-2&&t.morePages(),1===t.currentPage?(t.numberPositions=0,t.isCover="-"+vt(".page-wrapper[page="+t.currentPage+"]").width()):t.currentPage===t.pages?(t.isCover=vt(".page-wrapper[page="+t.currentPage+"]").width(),t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1)):(t.isCover=0,t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1))}));for(var a=this.loadedPages;a<this.pages-2;a++){var i=vt("#flipbook").turn("pages")+1,o=vt('<div><img class="img-book" width="100%" src="'+this.apiUrl+"/api/builder/getplaceholder/"+this.product_id+"?page="+a+"&w="+this.bookDimensions.widthPlaceholder+'&pw=0&noCache=true" alt=""><div class="loading-bg"><div class="loading book-loading"></div></div> </div>');vt("#flipbook").turn("addPage",o),vt("#flipbook").turn("pages",i)}this.started()},toTheLeft:function(){vt("#flipbook").turn("previous")},toTheRight:function(){vt("#flipbook").turn("next")},zoomTo:function(t){setTimeout((function(){vt(".flipbook-container").data().regionClicked?vt(".flipbook-container").data().regionClicked=!1:1==vt(".flipbook-container").zoom("value")?vt(".flipbook-container").zoom("zoomIn",t):vt(".flipbook-container").zoom("zoomOut")}),1)},activateZoom:function(){var t=this;vt(".flipbook-container").zoom({flipbook:vt("#flipbook"),max:function(){return 1452/vt("#flipbook").width()},when:{swipeLeft:function(){vt(this).zoom("flipbook").turn("next")},swipeRight:function(){vt(this).zoom("flipbook").turn("previous")},resize:function(t,e,a,i){
|
|
1318
|
-
// if (scale==1)
|
|
1301
|
+
vt("#flipbook").turn({width:t.flipbookWidth,height:t.flipbookHeight,autoCenter:!1,gradients:!0,acceleration:!0,duration:800,elevation:150}),vt("#flipbook").bind("start",(function(t,e,a){console.log(t),console.log(e),console.log(a),"r"==a||"l"==a?vt(".page-wrapper").css("cursor","pointer"):vt(".page-wrapper").css("cursor","unset"),"tl"!=a&&"tr"!=a&&"bl"!=a&&"br"!=a||t.preventDefault()})),vt("#flipbook").bind("end",(function(t,e,a){//$(".page-wrapper").css("cursor", "unset");
|
|
1302
|
+
})),// Habilitar passagem via o dedo
|
|
1303
|
+
vt(document).keydown((function(t){switch(t.keyCode){case 37:n("#flipbook").turn("previous");break;case 39:n("#flipbook").turn("next")}})),t.isCover="-"+vt(".page-wrapper[page="+t.currentPage+"]").width(),vt("#flipbook").bind("turning",(function(e,a,i){t.currentPage=a,t.currentPage>=t.loadedPages-2&&t.morePages(),1===t.currentPage?(t.numberPositions=0,t.isCover="-"+vt(".page-wrapper[page="+t.currentPage+"]").width()):t.currentPage===t.pages?(t.isCover=vt(".page-wrapper[page="+t.currentPage+"]").width(),t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1)):(t.isCover=0,t.currentPage%2==0?t.numberPositions=30*t.currentPage:t.numberPositions=30*(t.currentPage-1))}));for(var a=this.loadedPages;a<this.pages-2;a++){var i=vt("#flipbook").turn("pages")+1,o=vt('<div><img class="img-book" width="100%" src="'+this.apiUrl+"/api/builder/getplaceholder/"+this.product_id+"?page="+a+"&w="+this.bookDimensions.widthPlaceholder+'&pw=0&noCache=true" alt=""><div class="loading-bg"><div class="loading book-loading"></div></div> </div>');vt("#flipbook").turn("addPage",o),vt("#flipbook").turn("pages",i)}this.started()},toTheLeft:function(){vt("#flipbook").turn("previous")},toTheRight:function(){vt("#flipbook").turn("next")},zoomTo:function(t){setTimeout((function(){vt(".flipbook-container").data().regionClicked?vt(".flipbook-container").data().regionClicked=!1:1==vt(".flipbook-container").zoom("value")?vt(".flipbook-container").zoom("zoomIn",t):vt(".flipbook-container").zoom("zoomOut")}),1)},activateZoom:function(){var t=this;vt(".flipbook-container").zoom({flipbook:vt("#flipbook"),max:function(){return 1452/vt("#flipbook").width()},when:{swipeLeft:function(){vt(this).zoom("flipbook").turn("next")},swipeRight:function(){vt(this).zoom("flipbook").turn("previous")},resize:function(t,e,a,i){// if (scale==1)
|
|
1319
1304
|
// loadSmallPage(page, pageElement);
|
|
1320
1305
|
// else
|
|
1321
1306
|
// loadLargePage(page, pageElement);
|
|
1322
|
-
},zoomIn:function(){vt(".flipbook-container").removeClass("zoom-in"),vt(".flipbook-container").removeClass("zoom-out"),vt(".flipbook-container").addClass("zoom-in")},zoomOut:function(){vt(".flipbook-container").removeClass("zoom-in"),vt(".flipbook-container").removeClass("zoom-out"),vt(".flipbook-container").addClass("zoom-out")
|
|
1323
|
-
// $('.exit-message').hide();
|
|
1307
|
+
},zoomIn:function(){vt(".flipbook-container").removeClass("zoom-in"),vt(".flipbook-container").removeClass("zoom-out"),vt(".flipbook-container").addClass("zoom-in")},zoomOut:function(){vt(".flipbook-container").removeClass("zoom-in"),vt(".flipbook-container").removeClass("zoom-out"),vt(".flipbook-container").addClass("zoom-out"),// $('.exit-message').hide();
|
|
1324
1308
|
// $('.thumbnails').fadeIn();
|
|
1325
1309
|
// $('.made').fadeIn();
|
|
1326
1310
|
// $('.zoom-icon').removeClass('zoom-icon-out').addClass('zoom-icon-in');
|
|
1327
|
-
setTimeout((function(){vt("#flipbook").addClass("animated").removeClass("zoom-in"),t.resizeViewport()}),0)}}})
|
|
1328
|
-
//
|
|
1329
|
-
vt.isTouch?vt(".flipbook-container").bind("zoom.doubleTap",t.zoomTo):vt(".flipbook-container").bind("zoom.tap",t.zoomTo)},resizeViewport:function(){var t=self.resize(),e=t.width,a=t.height,i=vt("#flipbook").turn("options");if(vt("#flipbook").removeClass("animated"),vt(".flipbook-container").css({width:e,height:a}).zoom("resize"),1==vt("#flipbook").turn("zoom")){var o=calculateBound({width:i.width,height:i.height,boundWidth:Math.min(i.width,e),boundHeight:Math.min(i.height,a)});o.width%2!=0&&(o.width-=1),o.width==vt("#flipbook").width()&&o.height==vt("#flipbook").height()||(vt("#flipbook").turn("size",o.width,o.height),1==vt("#flipbook").turn("page")&&vt("#flipbook").turn("peel","br")),vt("#flipbook").css({top:-o.height/2,left:-o.width/2})}
|
|
1330
|
-
// var magazineOffset = $('#flipbook').offset(),
|
|
1311
|
+
setTimeout((function(){vt("#flipbook").addClass("animated").removeClass("zoom-in"),t.resizeViewport()}),0)}}}),// Zoom event
|
|
1312
|
+
vt.isTouch?vt(".flipbook-container").bind("zoom.doubleTap",t.zoomTo):vt(".flipbook-container").bind("zoom.tap",t.zoomTo)},resizeViewport:function(){var t=self.resize(),e=t.width,a=t.height,i=vt("#flipbook").turn("options");if(vt("#flipbook").removeClass("animated"),vt(".flipbook-container").css({width:e,height:a}).zoom("resize"),1==vt("#flipbook").turn("zoom")){var o=calculateBound({width:i.width,height:i.height,boundWidth:Math.min(i.width,e),boundHeight:Math.min(i.height,a)});o.width%2!=0&&(o.width-=1),o.width==vt("#flipbook").width()&&o.height==vt("#flipbook").height()||(vt("#flipbook").turn("size",o.width,o.height),1==vt("#flipbook").turn("page")&&vt("#flipbook").turn("peel","br")),vt("#flipbook").css({top:-o.height/2,left:-o.width/2})}// var magazineOffset = $('#flipbook').offset(),
|
|
1331
1313
|
// boundH = height - magazineOffset.top - $('#flipbook').height(),
|
|
1332
1314
|
// marginTop = (boundH - $('.thumbnails > div').height()) / 2;
|
|
1333
1315
|
// if (marginTop<0) {
|
|
@@ -1390,8 +1372,7 @@ currentLanguage:null,
|
|
|
1390
1372
|
// Layouts
|
|
1391
1373
|
currentLayout:null,
|
|
1392
1374
|
// Preview default props
|
|
1393
|
-
pages:[],pageNum:36,isMobile:!1,isPagesNumLoaded:!1,isLoading:!0,custom_character:null,custom:null,callingLayout:!1,currentShirtNumber:7,modalMoonerFirstOpen:!1,firstBookSelected:!1,type_id:0}}},T(ut,"computed",{cssProps:function(){return{"--preview_color":this.preview_color}}}),T(ut,"mounted",(function(){var t=this;window.addEventListener("resize",(function(e){t.isMobile=t.detectSize()})),t.isMobile=t.detectSize(),this.initMounted()})),T(ut,"methods",{detectSize:function(){var t=!1;return window.innerWidth<990&&(t=!0),t},setCurrentMoonerName:function(t){this.currentMoonerName=t,this.haveCustomMoonerName=!0},toggleSidebar:function(){this.sidebarOpen=!this.sidebarOpen},modalIsOpen:function(){return!!(this.modalLayout||this.modalName||this.modalDedication||this.modalShirtNumber||this.modalPet||this.modalMooner||this.modalBirthdate)},updateName:function(t){console.log(this.current_character_name),this.current_character_name=t.value,console.log(t)},updateDedicationText:function(t){this.current_dedcation_text=t.value},updateShirtNumber:function(t){this.currentShirtNumber=t.value},onChangeDay:function(t){this.selectedBirthDay=t.target.value
|
|
1394
|
-
// this.validateDays({
|
|
1375
|
+
pages:[],pageNum:36,isMobile:!1,isPagesNumLoaded:!1,isLoading:!0,custom_character:null,custom:null,callingLayout:!1,currentShirtNumber:7,modalMoonerFirstOpen:!1,firstBookSelected:!1,type_id:0}}},T(ut,"computed",{cssProps:function(){return{"--preview_color":this.preview_color}}}),T(ut,"mounted",(function(){var t=this;window.addEventListener("resize",(function(e){t.isMobile=t.detectSize()})),t.isMobile=t.detectSize(),this.initMounted()})),T(ut,"methods",{detectSize:function(){var t=!1;return window.innerWidth<990&&(t=!0),t},setCurrentMoonerName:function(t){this.currentMoonerName=t,this.haveCustomMoonerName=!0},toggleSidebar:function(){this.sidebarOpen=!this.sidebarOpen},modalIsOpen:function(){return!!(this.modalLayout||this.modalName||this.modalDedication||this.modalShirtNumber||this.modalPet||this.modalMooner||this.modalBirthdate)},updateName:function(t){console.log(this.current_character_name),this.current_character_name=t.value,console.log(t)},updateDedicationText:function(t){this.current_dedcation_text=t.value},updateShirtNumber:function(t){this.currentShirtNumber=t.value},onChangeDay:function(t){this.selectedBirthDay=t.target.value;// this.validateDays({
|
|
1395
1376
|
// year: payload.value,
|
|
1396
1377
|
// });
|
|
1397
1378
|
},onChangeMonth:function(t){
|
|
@@ -1400,59 +1381,38 @@ var e=this;e.months.forEach((function(a){
|
|
|
1400
1381
|
// if (property[1].code === propertyName) {
|
|
1401
1382
|
// returnProperty = property[1];
|
|
1402
1383
|
// }
|
|
1403
|
-
a.value==t.target.value&&(e.selectedBirthMonth=a.key)}))},updateHaveDedication:function(t){this.haveDedication=t},setMooner:function(t){var e=this,a=this;a.moonerAnimation=!1,a.haveCustomMoonerName||(a.currentMoonerName=t.name.toUpperCase()),setTimeout((function(){a.moonerAnimation=!0,e.currentMooner=t,setTimeout((function(){a.moonerInitAnimation=!0}),"500")}),"500")},setPet:function(t){var e=this;e.petAnimation=!1,setTimeout((function(){e.petAnimation=!0,e.currentPet=t,e.currentPetColor=e.currentPet.assets.colors[0],setTimeout((function(){e.petInitAnimation=!0}),"500")}),"500")},setFantasy:function(t){var e=this;e.fantasyAnimation=!1,setTimeout((function(){e.fantasyAnimation=!0,e.currentFantasy=t
|
|
1404
|
-
//self.currentPetColor = self.currentPet.assets.colors[0];
|
|
1384
|
+
a.value==t.target.value&&(e.selectedBirthMonth=a.key)}))},updateHaveDedication:function(t){this.haveDedication=t},setMooner:function(t){var e=this,a=this;a.moonerAnimation=!1,a.haveCustomMoonerName||(a.currentMoonerName=t.name.toUpperCase()),setTimeout((function(){a.moonerAnimation=!0,e.currentMooner=t,setTimeout((function(){a.moonerInitAnimation=!0}),"500")}),"500")},setPet:function(t){var e=this;e.petAnimation=!1,setTimeout((function(){e.petAnimation=!0,e.currentPet=t,e.currentPetColor=e.currentPet.assets.colors[0],setTimeout((function(){e.petInitAnimation=!0}),"500")}),"500")},setFantasy:function(t){var e=this;e.fantasyAnimation=!1,setTimeout((function(){e.fantasyAnimation=!0,e.currentFantasy=t,//self.currentPetColor = self.currentPet.assets.colors[0];
|
|
1405
1385
|
setTimeout((function(){e.fantasyAnimation=!0}),"500")}),"500")},setColor:function(t){
|
|
1406
1386
|
//this.currentPetColor = selectedColor;
|
|
1407
1387
|
//this.searchExtraProperty("pet").value.newPetColor = selectedColor;
|
|
1408
1388
|
this.currentPetColor=t},showModal:function(t){
|
|
1409
|
-
// alert(key);
|
|
1410
1389
|
//var modalName = Object.keys(key)[0];
|
|
1411
1390
|
// console.log(modalName);
|
|
1412
|
-
"nome"===t&&(this.modalName=!0),t.includes("dedicatoria")&&(this.modalDedication=!0),t.includes("nome-do-mooner")&&(this.modalMooner=!0),t.includes("nome-pet")&&(this.modalPet=!0),t.includes("script")&&(this.modalLayout=!0),t.includes("camisa")&&(this.modalShirtNumber=!0),t.includes("birthday")&&(this.modalBirthdate=!0),t.includes("fantasy")&&(this.modalFantasy=!0),t.includes("languages")&&(this.modalLanguage=!0),t.includes("layouts")&&(this.modalLayout=!0)},showModalName:function(){this.modalName=!0},showmodalLayout:function(){this.modalLayout=!0},showModalDedication:function(){this.modalDedication=!0},showModalShirtNumber:function(){this.modalShirtNumber=!0},showModalBirthdate:function(){this.modalBirthdate=!0},showModalPet:function(){
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
// Get mooner from extra character customization
|
|
1418
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"mooner"===t.code&&(i.typeRead||(i.modalMooner=!0,i.listMooner=t,i.setMooner(i.listMooner.assets.subcategories[0])))})),
|
|
1419
|
-
//Get pet from extra character customization
|
|
1420
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"pet"===t.code&&(i.typeRead||(i.modalPet=!0,i.listPet=t,i.setPet(i.listPet.assets.subcategories[0])))}));var e=[];
|
|
1421
|
-
//Get pet from extra character customization
|
|
1422
|
-
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"fantasia"===t.code&&(i.typeRead||(i.modalFantasy=!0,
|
|
1423
|
-
// Criar categorias com ou sem cadeirante
|
|
1424
|
-
t.assets.subcategories.forEach((function(t){(1==i.haveWheelChair&&1==t.name.includes("cadeirante")||0==i.haveWheelChair&&0==t.name.includes("cadeirante"))&&e.push(t)})))),i.listFantasy=e,i.setFantasy(i.listFantasy[0])}))})).catch((function(t){console.log(t)})));case 4:case"end":return a.stop()}}),a)})))()},closeModal:function(){this.modalLayout=!1,this.modalName=!1,this.modalDedication=!1,this.modalShirtNumber=!1,this.modalPet=!1,this.modalMooner=!1,this.modalBirthdate=!1,this.modalFantasy=!1,this.modalLanguage=!1},setCurrentLayout:function(t){this.currentLayout=t,this.firstBookSelected=!0},initMounted:function(){var t=this;return g(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.getProductInfo();case 3:a.getCustomCharacter();
|
|
1425
|
-
// self.getProductInfo();
|
|
1391
|
+
"nome"===t&&(this.modalName=!0),t.includes("dedicatoria")&&(this.modalDedication=!0),t.includes("nome-do-mooner")&&(this.modalMooner=!0),t.includes("nome-pet")&&(this.modalPet=!0),t.includes("script")&&(this.modalLayout=!0),t.includes("camisa")&&(this.modalShirtNumber=!0),t.includes("birthday")&&(this.modalBirthdate=!0),t.includes("fantasy")&&(this.modalFantasy=!0),t.includes("languages")&&(this.modalLanguage=!0),t.includes("layouts")&&(this.modalLayout=!0)},showModalName:function(){this.modalName=!0},showmodalLayout:function(){this.modalLayout=!0},showModalDedication:function(){this.modalDedication=!0},showModalShirtNumber:function(){this.modalShirtNumber=!0},showModalBirthdate:function(){this.modalBirthdate=!0},showModalPet:function(){},searchExtraProperty:function(t){var e=null;return Object.entries(this.properties).forEach((function(a){a[1].code===t&&(e=a[1])})),e},searchCustomUserDataProperty:function(t){var e=null;return Object.entries(t).forEach((function(t){"nome-do-mooner"==t[0]&&(e=t[1])})),e},searchCategoryProperty:function(t,e){var a=null;return Object.keys(t).forEach((function(i){t[i].code.includes(e)&&(a=t[i]),console.log(i+" - "+t[i])})),a},getTreeList:function(){var t=this;return g(h().mark((function a(){var i,o;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:// Todo Guto
|
|
1392
|
+
return o="https://hb.dentrodahistoria.com.br/api/v2/characters/"+(i=t).character_id+"/categories/assets/treelist?character_type_id="+i.type_id+"&subscription="+i.is_subscription+"&product_id="+parseInt(i.product_id),i.character_position_id&&(o=o+"&character_position_id="+parseInt(i.character_position_id)),a.abrupt("return",e.get(o).then((function(t){t.data.character_categories_assets[0].characters_extra.forEach((function(t){"mooner"===t.code&&(i.typeRead||(i.modalMooner=!0,i.listMooner=t,i.setMooner(i.listMooner.assets.subcategories[0])))})),//Get pet from extra character customization
|
|
1393
|
+
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"pet"===t.code&&(i.typeRead||(i.modalPet=!0,i.listPet=t,i.setPet(i.listPet.assets.subcategories[0])))}));var e=[];//Get pet from extra character customization
|
|
1394
|
+
t.data.character_categories_assets[0].characters_extra.forEach((function(t){"fantasia"===t.code&&(i.typeRead||(i.modalFantasy=!0,// Criar categorias com ou sem cadeirante
|
|
1395
|
+
t.assets.subcategories.forEach((function(t){(1==i.haveWheelChair&&1==t.name.includes("cadeirante")||0==i.haveWheelChair&&0==t.name.includes("cadeirante"))&&e.push(t)})))),i.listFantasy=e,i.setFantasy(i.listFantasy[0])}))})).catch((function(t){console.log(t)})));case 4:case"end":return a.stop()}}),a)})))()},closeModal:function(){this.modalLayout=!1,this.modalName=!1,this.modalDedication=!1,this.modalShirtNumber=!1,this.modalPet=!1,this.modalMooner=!1,this.modalBirthdate=!1,this.modalFantasy=!1,this.modalLanguage=!1},setCurrentLayout:function(t){this.currentLayout=t,this.firstBookSelected=!0},initMounted:function(){var t=this;return g(h().mark((function e(){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.getProductInfo();case 3:a.getCustomCharacter();// self.getProductInfo();
|
|
1426
1396
|
// self.getTreeList();
|
|
1427
|
-
case 4:case"end":return e.stop()}}),e)})))()},getCustomCharacter:function(){var t=this;e.get(this.lang.urlBuilder+"/api/customs_characters/"+t.uuid).then((function(e){
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
t.properties
|
|
1432
|
-
// Dedicatória
|
|
1433
|
-
t.properties.dedicatoria&&(t.current_dedcation_text=t.properties.dedicatoria.value),
|
|
1434
|
-
// Pet
|
|
1435
|
-
t.properties["nome-pet"]&&(t.mooner_name=t.properties["nome-pet"].value),t.properties.numero&&t.properties.mes){t.selectedBirthDay=t.properties.numero.value,t.months.forEach((function(e,a){e.value==t.properties.mes.value&&(t.selectedBirthMonth=e.key)}));var a={code:"birthday",value:t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value};delete t.properties.numero,delete t.properties.mes,t.properties.birthday=a}
|
|
1436
|
-
// Fantasia
|
|
1397
|
+
case 4:case"end":return e.stop()}}),e)})))()},getCustomCharacter:function(){var t=this;e.get(this.lang.urlBuilder+"/api/customs_characters/"+t.uuid).then((function(e){// Aniversário
|
|
1398
|
+
if(t.properties=e.data.custom.user_data.properties,// Nome
|
|
1399
|
+
t.properties.nome&&(t.current_character_name=t.properties.nome.value),// Dedicatória
|
|
1400
|
+
t.properties.dedicatoria&&(t.current_dedcation_text=t.properties.dedicatoria.value),// Pet
|
|
1401
|
+
t.properties["nome-pet"]&&(t.mooner_name=t.properties["nome-pet"].value),t.properties.numero&&t.properties.mes){t.selectedBirthDay=t.properties.numero.value,t.months.forEach((function(e,a){e.value==t.properties.mes.value&&(t.selectedBirthMonth=e.key)}));var a={code:"birthday",value:t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value};delete t.properties.numero,delete t.properties.mes,t.properties.birthday=a}// Fantasia
|
|
1437
1402
|
// Linguagens
|
|
1438
|
-
if(e.data.assets.forEach((function(e,a){e.assets.name.includes("roupa-cadeirante")&&(t.haveWheelChair=!0)})),e.data.assets.forEach((function(a,i){if(a.assets.name.includes("fantasia")){var o={code:"fantasy",value:a.assets.name};t.properties.fantasy=o,t.avatarFantasy=e.data.assets}})),t.languages&&t.language){t.languages.forEach((function(e){e.Slug==t.language&&(t.currentLanguage=e)}));var i={code:"languages",value:t.currentLanguage.Label};t.properties.languages=i}
|
|
1439
|
-
|
|
1440
|
-
if(t.layouts&&t.layout){t.layouts.forEach((function(e){e.builderProductId==t.layout&&(t.currentLayout=e)}));var o={code:"layouts",value:t.currentLayout.name};t.properties.layouts=o}t.getTreeList()})).catch((function(t){console.log(t)}))},getProductInfo:function(){var t=this;return g(h().mark((function a(){var i;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return i=t,a.abrupt("return",e.get(t.lang.urlBuilder+"/api/products/info/"+i.product_id).then((function(t){i.pageNum=t.data.product.pages,i.isPagesNumLoaded=!0,i.availableLayouts=t.data.product.layout,
|
|
1441
|
-
// Gender
|
|
1403
|
+
if(e.data.assets.forEach((function(e,a){e.assets.name.includes("roupa-cadeirante")&&(t.haveWheelChair=!0)})),e.data.assets.forEach((function(a,i){if(a.assets.name.includes("fantasia")){var o={code:"fantasy",value:a.assets.name};t.properties.fantasy=o,t.avatarFantasy=e.data.assets}})),t.languages&&t.language){t.languages.forEach((function(e){e.Slug==t.language&&(t.currentLanguage=e)}));var i={code:"languages",value:t.currentLanguage.Label};t.properties.languages=i}// Layouts
|
|
1404
|
+
if(t.layouts&&t.layout){t.layouts.forEach((function(e){e.builderProductId==t.layout&&(t.currentLayout=e)}));var o={code:"layouts",value:t.currentLayout.name};t.properties.layouts=o}t.getTreeList()})).catch((function(t){console.log(t)}))},getProductInfo:function(){var t=this;return g(h().mark((function a(){var i;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return i=t,a.abrupt("return",e.get(t.lang.urlBuilder+"/api/products/info/"+i.product_id).then((function(t){i.pageNum=t.data.product.pages,i.isPagesNumLoaded=!0,i.availableLayouts=t.data.product.layout,// Gender
|
|
1442
1405
|
i.gender&&t.data.product.type.forEach((function(t){t.name==i.gender&&(i.type_id=t.id)}))})).catch((function(t){console.log(t)})));case 2:case"end":return a.stop()}}),a)})))()},changeMoonerLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};t.currentMooner&&
|
|
1443
1406
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1444
|
-
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}}))
|
|
1445
|
-
//var data_custom;
|
|
1407
|
+
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}})),//var data_custom;
|
|
1446
1408
|
// Envio da custom porperties dynamic
|
|
1447
1409
|
e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data);var a=!1,i=null;t.custom.categories.forEach((function(e){if(e.parent_id===t.currentMooner.parent_id){a=!0;var i=t.custom.categories.indexOf(e);t.custom.categories[i]={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id}}})),!1===a&&(i={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id},t.custom.categories.push(i)),t.modalMoonerFirstOpen=!0,t.sidebarOpen=!1,t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},changeFantasyLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};t.currentFantasy&&
|
|
1448
1410
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1449
|
-
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}}))
|
|
1450
|
-
//var data_custom;
|
|
1411
|
+
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}})),//var data_custom;
|
|
1451
1412
|
// Envio da custom porperties dynamic
|
|
1452
1413
|
e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data);var a=!1,i=null;t.custom.categories.forEach((function(e){if(e.parent_id===t.currentMooner.parent_id){a=!0;var i=t.custom.categories.indexOf(e);t.custom.categories[i]={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id}}})),!1===a&&(i={parent_id:t.currentMooner.parent_id,id:t.currentMooner.id},t.custom.categories.push(i)),t.modalMoonerFirstOpen=!0,t.sidebarOpen=!1,t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},updateNameAndDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.currentMooner&&
|
|
1453
1414
|
///var property = self.searchExtraProperty("nome-do-mooner");
|
|
1454
|
-
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}})),t.searchExtraProperty("birthday")){t.searchExtraProperty("birthday");a.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},a.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}
|
|
1455
|
-
// if (self.have_birth_date) {
|
|
1415
|
+
t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={property_id:e.id,value:t.currentMoonerName,code:e.code};e.value=t.currentMoonerName,a.custom_character.user_data.properties[e.code]=i}})),t.searchExtraProperty("birthday")){t.searchExtraProperty("birthday");a.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},a.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}// if (self.have_birth_date) {
|
|
1456
1416
|
// self.extras.forEach((itemProperty) => {
|
|
1457
1417
|
// if (itemProperty.code.includes("birthday")) {
|
|
1458
1418
|
// request.custom_character.user_data.properties["mes"] =
|
|
@@ -1469,15 +1429,12 @@ t.extras.forEach((function(e){if(e.code.includes("nome-do-mooner")){var i={prope
|
|
|
1469
1429
|
// }
|
|
1470
1430
|
// });
|
|
1471
1431
|
// }
|
|
1472
|
-
e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.extras.forEach((function(e){"nome"===e.code&&(e.value=t.current_character_name),"dedicatoria"===e.code&&(e.value=t.dedicationText)})),t.changeUuid(e.data.custom.uuid),t.changeName(t.current_character_name),t.have_birth_date){var a={custom_numero:t.selectedBirthDay,custom_mes:t.months[t.selectedBirthMonth-1].value};t.changeBirthday(a)}})).catch((function(t){console.log(t)}))},updateDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data)
|
|
1473
|
-
// self.extras.forEach((itemProperty) => {
|
|
1432
|
+
e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.extras.forEach((function(e){"nome"===e.code&&(e.value=t.current_character_name),"dedicatoria"===e.code&&(e.value=t.dedicationText)})),t.changeUuid(e.data.custom.uuid),t.changeName(t.current_character_name),t.have_birth_date){var a={custom_numero:t.selectedBirthDay,custom_mes:t.months[t.selectedBirthMonth-1].value};t.changeBirthday(a)}})).catch((function(t){console.log(t)}))},updateDedicationCustomCharacter:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",a).then((function(e){t.custom=JSON.parse(e.data.custom.customCharacter.data),// self.extras.forEach((itemProperty) => {
|
|
1474
1433
|
// if (itemProperty.code === "dedicatoria") {
|
|
1475
1434
|
// itemProperty.value = self.dedicationText;
|
|
1476
1435
|
// }
|
|
1477
1436
|
// });
|
|
1478
|
-
t.searchExtraProperty("dedicatoria").value=t.dedicationText,t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a,i={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.properties["nome-do-mooner"]){var o={property_id:(r=t.properties["nome-do-mooner"]).id,value:r.value,code:r.code};i.custom_character.user_data.properties[r.code]=o}if(t.properties.birthday){var r=t.properties.birthday;i.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},i.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}
|
|
1479
|
-
// Envio da custom porperties dynamic
|
|
1480
|
-
e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",i).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.currentPet&&t.currentPet.parent_id&&(a={parent_id:t.currentPet.parent_id,id:t.currentPetColor.id},t.custom.categories.push(a)),t.custom_mes&&t.custom_numero){var i={mes:t.selectedBirthMonth,dia:t.selectedBirthDay};t.changeBirthday(i),t.properties.birthday.value=t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value}t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},sendCustomCharacter:function(){var t=this;e.post(this.lang.urlBuilder+"/api/customs_characters",{custom_character:t.custom}).then((function(e){
|
|
1437
|
+
t.searchExtraProperty("dedicatoria").value=t.dedicationText,t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeLayout:function(){var t=this;t.callingLayout=!0,t.closeModal(),t.isLoadingMethod(!1);var a,i={custom_character:{character_id:t.character_id,product_id:t.product_id,type_id:t.type_id,user_data:{type:t.type_id,properties:{nome:{code:"nome",property_id:24,value:t.current_character_name},dedicatoria:{code:"dedicatoria",property_id:26,value:t.dedicationText}}},uuid:t.uuid}};if(t.properties["nome-do-mooner"]){var o={property_id:(r=t.properties["nome-do-mooner"]).id,value:r.value,code:r.code};i.custom_character.user_data.properties[r.code]=o}if(t.properties.birthday){var r=t.properties.birthday;i.custom_character.user_data.properties.mes={property_id:38,value:t.months[t.selectedBirthMonth-1].value,code:"mes"},i.custom_character.user_data.properties.numero={property_id:29,value:t.selectedBirthDay,code:"numero"}}e.post(this.lang.urlBuilder+"/api/customs_characters/changePropertiesDynamic",i).then((function(e){if(t.custom=JSON.parse(e.data.custom.customCharacter.data),t.currentPet&&t.currentPet.parent_id&&(a={parent_id:t.currentPet.parent_id,id:t.currentPetColor.id},t.custom.categories.push(a)),t.custom_mes&&t.custom_numero){var i={mes:t.selectedBirthMonth,dia:t.selectedBirthDay};t.changeBirthday(i),t.properties.birthday.value=t.selectedBirthDay+" de "+t.months[t.selectedBirthMonth-1].value}t.sendCustomCharacter()})).catch((function(t){console.log(t)}))},sendCustomCharacter:function(){var t=this;e.post(this.lang.urlBuilder+"/api/customs_characters",{custom_character:t.custom}).then((function(e){
|
|
1481
1438
|
//self.custom = JSON.parse(response.data.custom.customCharacter.data);
|
|
1482
1439
|
//alert("salvou catiolo");
|
|
1483
1440
|
t.changeUuid(e.data.custom.uuid)})).catch((function(t){console.log(t)}))},changeUuid:function(t){this.$emit("changeUuid",t)},changeName:function(t){this.$emit("changeName",t)},changeBirthday:function(t){this.$emit("changeBirthday",t)},isLoadingMethod:function(t){this.$emit("isLoadingMethod",t)},validateDays:function(t){var e,a=t.month?t.month:this.selectedBirthMonth,i=t.year?t.year:this.selectedBirthYear;a||(a=13);var o=[];e=1===a||3===a||5===a||7===a||8===a||10===a||12===a||13===a?31:4===a||6===a||9===a||11===a?30:i%4==0&&i%100>0||i%400==0?29:28,a||i||(e=31);for(var r=1;r<=e;r++)o.push({key:r,value:r});this.days=o}}),ut),"data-v-4521078a",!1,"data-v-4521078a",!1,void 0,b,void 0),wt=f({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"preview-full"},[t.isLoaded&&!t.isMobile?a("Preview",{attrs:{uuid:t.uuid,pages:t.pages,age:t.age,product_id:t.product_id,typeLanguage:t.typeLanguage,apiUrl:t.apiUrl}}):t._e(),t._ssrNode(" "),t.isLoaded&&t.isMobile?a("PreviewMobile",{attrs:{uuid:t.uuid,pages:t.pages,age:t.age,product_id:t.product_id,typeLanguage:t.typeLanguage,apiUrl:t.apiUrl}}):t._e()],2)},staticRenderFns:[]},(function(t){t&&t("data-v-7c5f1153_0",{source:'@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Nunito:400,600,700,900&display=swap);@import url(https://fonts.googleapis.com/css?family=Roboto:400,600,700,900&display=swap);:root{--column-width:6.6666666667vw}@media (min-width:0px){:root{--column-width:6.6666666667vw}}@media (min-width:480px){:root{--column-width:2.7777777778vw}}@media (min-width:0px){html{font-size:2.9166666667vw}}@media (min-width:480px){html{font-size:14px}}@media (min-width:1024px){:root{--column-width:2.7777777778vw}}@media (min-width:1920px){:root{--column-width:2.7777777778vw}}@media (min-width:2620px){:root{--column-width:2.7777777778vw}}@media (min-width:1024px){html{font-size:1.5648854962vw}}@media (min-width:2620px){html{font-size:1.56vw}}html{box-sizing:border-box}*,::after,::before{box-sizing:border-box}.storybook-6{width:16.6666666667vw}.storybook-12{width:33.3333333333vw}.storybook-25{width:69.4444444444vw}.custom-properties{position:absolute;top:30px}',map:void 0,media:void 0})}),{name:"PreviewFull",components:{Preview:gt,PreviewMobile:ft},props:{
|
|
@@ -1560,8 +1517,7 @@ color:{type:String,default:"#DFDAE4"}},data:function(){return{colorDefault:"#DFD
|
|
|
1560
1517
|
**/
|
|
1561
1518
|
visible:{type:Boolean,default:!0,required:!0},title:{type:String,default:"default",required:!0},description:{type:String,default:"default",required:!0},type:{type:String,default:"success",required:!0}},watch:{visible:{
|
|
1562
1519
|
// the callback will be called immediately after the start of the observation
|
|
1563
|
-
immediate:!0,handler:function(t,e){var a=this;!0===t&&setTimeout((function(){a.displayVisible=!0}),300)}}},data:function(){return{displayVisible:!1}},methods:{closeFeedBack:function(){this.$emit("closeFeedBack")}}},"data-v-ae47cb8c",!1,"data-v-ae47cb8c",!1,void 0,b,void 0),Ct=Object.freeze({__proto__:null,Avatar:z,Button:N,Card:S,CardLink:P,CardOption:M,Checkbox:E,Icon:C,Input:A,InputEdit:B,InputName:L,InputEmail:I,InputAddressNumber:R,InputAddress:D,InputAddressBilling:$,InputCardNumber:O,Options:j,Radius:V,Select:q,Birthday:X,BirthdayMobile:it,TextArea:ot,GenderSelect:rt,Tabs:dt,Tooltip:st,Caption:y,Heading:nt,Paragraph:lt,Modal:ct,Preview:gt,PreviewMobile:ft,PreviewTools:bt,PreviewFull:wt,PreviewWithTools:yt,HR:zt,Spinner:_t,FeedBack:kt}),Nt=function(t){Nt.installed||(Nt.installed=!0,Object.entries(Ct).forEach((function(e){var a=m(e,2),i=a[0],o=a[1];t.component(i,o)})))},St={install:Nt},Pt=null;"undefined"!=typeof window?Pt=window.Vue:"undefined"!=typeof global&&(Pt=global.Vue),Pt&&Pt.use(St),
|
|
1564
|
-
// // Import vue component
|
|
1520
|
+
immediate:!0,handler:function(t,e){var a=this;!0===t&&setTimeout((function(){a.displayVisible=!0}),300)}}},data:function(){return{displayVisible:!1}},methods:{closeFeedBack:function(){this.$emit("closeFeedBack")}}},"data-v-ae47cb8c",!1,"data-v-ae47cb8c",!1,void 0,b,void 0),Ct=Object.freeze({__proto__:null,Avatar:z,Button:N,Card:S,CardLink:P,CardOption:M,Checkbox:E,Icon:C,Input:A,InputEdit:B,InputName:L,InputEmail:I,InputAddressNumber:R,InputAddress:D,InputAddressBilling:$,InputCardNumber:O,Options:j,Radius:V,Select:q,Birthday:X,BirthdayMobile:it,TextArea:ot,GenderSelect:rt,Tabs:dt,Tooltip:st,Caption:y,Heading:nt,Paragraph:lt,Modal:ct,Preview:gt,PreviewMobile:ft,PreviewTools:bt,PreviewFull:wt,PreviewWithTools:yt,HR:zt,Spinner:_t,FeedBack:kt}),Nt=function(t){Nt.installed||(Nt.installed=!0,Object.entries(Ct).forEach((function(e){var a=m(e,2),i=a[0],o=a[1];t.component(i,o)})))},St={install:Nt},Pt=null;"undefined"!=typeof window?Pt=window.Vue:"undefined"!=typeof global&&(Pt=global.Vue),Pt&&Pt.use(St),// Default export is library as a whole, registered via Vue.use()
|
|
1565
1521
|
// import MyButton from './components/MyButton/MyButton.vue';
|
|
1566
1522
|
// import Heading from './components/Heading/Heading.vue';
|
|
1567
1523
|
// // Declare install function executed by Vue.use()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiddh/brave-vue",
|
|
3
|
-
"version": "1.91.
|
|
3
|
+
"version": "1.91.82",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/brave-vue.ssr.js",
|
|
6
6
|
"browser": "dist/brave-vue.esm.js",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"rollup-plugin-node-modules": "^0.1.0",
|
|
96
96
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
97
97
|
"rollup-plugin-postcss": "^2.0.6",
|
|
98
|
+
"rollup-plugin-replace": "^2.2.0",
|
|
98
99
|
"rollup-plugin-sass": "^1.2.2",
|
|
99
100
|
"rollup-plugin-sass-variables": "^0.1.1",
|
|
100
101
|
"rollup-plugin-svg-path": "^1.0.1",
|