(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-10f43502"],{"01fe":function(t,e,i){"use strict";i("76c0")},"02d9":function(t,e,i){"use strict";i("f2f2")},"0492":function(t,e,i){},"0725":function(t,e,i){t.exports=i.p+"static/img/size.ba727178.svg"},"0b20":function(t,e,i){t.exports=i.p+"static/img/rotate.848ed5a0.svg"},"0c1b":function(t,e,i){},"0c67a":function(t,e,i){},"17a0":function(t,e,i){"use strict";i("a8ae")},"17b5":function(t,e,i){t.exports=i.p+"static/img/text-icon.91834b31.svg"},"188e":function(t,e,i){"use strict";i("8aac")},"18e4":function(t,e,i){t.exports=i.p+"static/img/align-top.097f7063.svg"},"1be4":function(t,e,i){var a=i("d066");t.exports=a("document","documentElement")},"1d4e":function(t,e,i){},"1e67":function(t,e,i){"use strict";i("a66b")},"1faf":function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return o})),i.d(e,"d",(function(){return r}));var a=i("66a5");const n=t=>Object(a["a"])({url:"/shopapi/pay/shopify/application_charge/status",method:"post",data:t}),s=t=>Object(a["a"])({url:"/shopapi/pay/shopify/subscription/change",method:"post",data:t}),o=t=>Object(a["a"])({url:"/shopapi/pay/shopify/subscription/status",method:"post",data:t}),r=t=>Object(a["a"])({url:"/shopapi/pay/subscription/cancel",method:"post",data:t})},"243b":function(t,e,i){t.exports=i.p+"static/img/reflect-vertical.4841af97.svg"},"24f0":function(t,e,i){"use strict";i("9b92")},"27aa":function(t,e,i){"use strict";i("866a")},"27d6":function(t,e,i){var a;(function(){function n(t,e,i){return t.call.apply(t.bind,arguments)}function s(t,e,i){if(!t)throw Error();if(2=e.f?n():t.fonts.load(x(e.a),e.h).then((function(t){1<=t.length?a():setTimeout(s,25)}),(function(){n()}))}s()})),n=null,s=new Promise((function(t,i){n=setTimeout(i,e.f)}));Promise.race([s,a]).then((function(){n&&(clearTimeout(n),n=null),e.g(e.a)}),(function(){e.j(e.a)}))};var $={D:"serif",C:"sans-serif"},H=null;function R(){if(null===H){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);H=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return H}function X(t,e,i){for(var a in $)if($.hasOwnProperty(a)&&e===t.f[$[a]]&&i===t.f[$[a]])return!0;return!1}function V(t){var e,i=t.g.a.offsetWidth,a=t.h.a.offsetWidth;(e=i===t.f.serif&&a===t.f["sans-serif"])||(e=R()&&X(t,i,a)),e?r()-t.A>=t.w?R()&&X(t,i,a)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?U(t,t.v):U(t,t.B):Y(t):U(t,t.v)}function Y(t){setTimeout(o((function(){V(this)}),t),50)}function U(t,e){setTimeout(o((function(){h(this.g.a),h(this.h.a),h(this.j.a),h(this.m.a),e(this.a)}),t),0)}function W(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}M.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=r(),V(this)};var Q=null;function J(t){0==--t.f&&t.j&&(t.m?(t=t.a,t.g&&m(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),E(t,"active")):j(t.a))}function Z(t){this.j=t,this.a=new T,this.h=0,this.f=this.g=!0}function q(t,e,i,a,n){var s=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=n||null,r=a||{};if(0===i.length&&s)j(e.a);else{e.f+=i.length,s&&(e.j=s);var c,l=[];for(c=0;cd)s.f(t,i=n[d++],a[i]);return t}},3805:function(t,e,i){"use strict";i("68dd")},"38e8":function(t,e,i){},"38ef":function(t,e,i){t.exports=i.p+"static/img/end-icon.54ff305d.svg"},"3a61":function(t,e,i){},"3bc0":function(t,e,i){t.exports=i.p+"static/img/delete-icon.bfa4129e.svg"},"3c15":function(t,e,i){t.exports=i.p+"static/img/unlock-icon.9c0a5124.svg"},"3e2a":function(t,e,i){"use strict";i("aaf5")},"3f3e":function(t,e,i){},4172:function(t,e,i){},"44d2":function(t,e,i){var a=i("b622"),n=i("7c73"),s=i("9bf2"),o=a("unscopables"),r=Array.prototype;void 0==r[o]&&s.f(r,o,{configurable:!0,value:n(null)}),t.exports=function(t){r[o][t]=!0}},4578:function(t,e,i){t.exports=i.p+"static/img/halfDropPattern.2c0b30f5.svg"},"47e1":function(t,e,i){t.exports=i.p+"static/img/set-max.da15220a.svg"},"48ac":function(t,e,i){},"48ee":function(t,e,i){"use strict";i("d13c")},"4a47":function(t,e,i){"use strict";var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{visible:t.dialogVisible,"close-on-click-modal":!1,top:"30vh"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.close}},[i("PaypalSubscriptionButton",{ref:"PaypalButton"})],1)},n=[],s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{"text-align":"center"},attrs:{id:"paypal-button-container3"}})},o=[],r=i("7b32"),c=i("6b29"),l=i("ed08"),d={name:"PaypalSubscriptionButton",data(){return{paypal:null}},inject:["reload"],watch:{},created(){},mounted(){this.paypalReady()},methods:{close(){const t=document.querySelector("#paypal-button-container3");t.removeChild(t.lastElementChild)},async paypalReady(){var t=this;try{this.paypal=await Object(r["a"])({"client-id":"Ad_2nWfHg-jljIyJdtNKa_8Vt9CzTPSn99w5REF3BFBV13lrA1QUF7HV5uSN3dwfV1Gag-YUMKfQyl2B",intent:"subscription",vault:!0})}catch(e){console.error("failed to load the PayPal JS SDK script",e)}this.paypal&&await this.paypal.Buttons({env:"production",commit:!0,style:{size:"large",color:"blue",shape:"rect",label:"subscribe"},locale:"en_US",createSubscription:function(e,i){return t.ceatePayPals().then(t=>i.subscription.create({plan_id:t.planId,custom_id:t.customId,subscriber:{email:t.email}}))},onApprove:(e,i)=>{t.queryStatus(e.subscriptionID)},onError:t=>{console.log(t,"paypal err")}}).render("#paypal-button-container3")},async ceatePayPals(){const t=await Object(c["b"])({});return t.data},async queryStatus(t){var e={};e.subscriptionID=t;var i=this,a=await Object(c["d"])(e);if(200===a.code){if(2===a.data.status)return i.$message.success("Change subscription success!"),void setTimeout(()=>{i.reload()},500);if(3===a.data.status)return i.$message.error(a.data.failReason),void this.reload();1===a.data.status&&(await Object(l["e"])(2e3),i.queryStatus(t))}}}},u=d,h=i("2877"),m=Object(h["a"])(u,s,o,!1,null,"4c3d627c",null),p=m.exports,f={name:"PaypalSubscriptionDialog",components:{PaypalSubscriptionButton:p},props:{value:{type:Boolean,default:!1}},data(){return{dialogVisible:!1}},watch:{value:{handler(t){this.dialogVisible=t},immediate:!0},dialogVisible:{handler(t){this.$emit("input",t)},immediate:!0}},mounted(){},methods:{close(){this.dialogVisible=!1}}},g=f,v=Object(h["a"])(g,a,n,!1,null,"2cd31193",null);e["a"]=v.exports},"4d56":function(t,e,i){t.exports=i.p+"static/img/upload.4a2d4268.svg"},"4f51":function(t,e,i){},"526f":function(t,e,i){"use strict";i.d(e,"e",(function(){return d})),i.d(e,"d",(function(){return u})),i.d(e,"f",(function(){return h})),i.d(e,"c",(function(){return m})),i.d(e,"a",(function(){return p})),i.d(e,"g",(function(){return f})),i.d(e,"b",(function(){return g}));var a=i("2b0e");const n=a["default"].prototype.$isServer,s=/([\:\-\_]+(.))/g,o=/^moz([A-Z])/,r=n?0:Number(document.documentMode),c=function(t){return(t||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},l=function(t){return t.replace(s,(function(t,e,i,a){return a?i.toUpperCase():i})).replace(o,"Moz$1")},d=function(){return!n&&document.addEventListener?function(t,e,i){t&&e&&i&&t.addEventListener(e,i,!1)}:function(t,e,i){t&&e&&i&&t.attachEvent("on"+e,i)}}(),u=function(){return!n&&document.removeEventListener?function(t,e,i){t&&e&&t.removeEventListener(e,i,!1)}:function(t,e,i){t&&e&&t.detachEvent("on"+e,i)}}(),h=function(t,e,i){var a=function(){i&&i.apply(this,arguments),u(t,e,a)};d(t,e,a)};function m(t,e){if(!t||!e)return!1;if(-1!==e.indexOf(" "))throw new Error("className should not contain space.");return t.classList?t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}function p(t,e){if(t){for(var i=t.className,a=(e||"").split(" "),n=0,s=a.length;n{var e={};return t&&"[object Function]"===e.toString.call(t)};"object"===typeof Int8Array||!a["default"].prototype.$isServer&&"function"===typeof document.childNodes||(n=function(t){return"function"===typeof t||!1});Object.prototype.hasOwnProperty;const s=function(){return!a["default"].prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)},o=function(t){const e=/([^-])([A-Z])/g;return t.replace(e,"$1-$2").replace(e,"$1-$2").toLowerCase()};function r(t){let e=!1;return function(...i){e||(e=!0,window.requestAnimationFrame(a=>{t.apply(this,i),e=!1}))}}},"6c04":function(t,e,i){"use strict";i("9bea")},"6cd5":function(t,e,i){t.exports=i.p+"static/img/align-bottom.353833ea.svg"},7474:function(t,e,i){},"75d9":function(t,e,i){},"76c0":function(t,e,i){},7896:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAACXBIWXMAAAsSAAALEgHS3X78AAADcklEQVRogc2aQWsTQRTHX5dErdZmK/QgRZKLHlqwES3edCt4lXwBMYJX0YN3I3oVBa8WVv0C8Sxo0puIJRFa0EJNERQs0ompsTaFkbedWaab2c3uzk62P1g2mSa7/3198+a9NxmhlIIiJgBYAFBkZ+SycMk2ADQAgLBzjR1qoPAYh0kpLVNKGzQehFJqU0qtmPePLBwFV9iNkwIfvqRTeClhwV5qlNJCksLRylWNgkUIc0Fl4QUFP1bBHiQ8EzCzi2z255QjQHRusG+U/b7pFw4LLHSlIVrkhZ94QzKGcbl6AEQDs3xF9geZxW3hX+VAdnvwqUOguUWA9HacsfXtLqxv/wHS68Gv3j+wZy7CpYlJXQ8w7120vD5e8opGUPTVJfXFTgGbzTnCr+F1ladxL67R2kgeAO6KA6LFy+wDfZDdnb6x8UwWFqbn4NrklE7BIveZ5Vvgsbh0EiDNDukb+73bg8rasuP/Q8S1Ohde8rO2l7NjpjuyvNWGKx/fDVO8GxoN78AgHp8pwvWThbTE55iRXeFW0KcXyca+98+n59IU7wq3oiw2uUzWOaco3jEyLkDo8E/iXuXWygd49aPlvp8Zy8Hb8/NgsgfUxITB8pLYpGT5osFWJCVk4u99aegUbsqSrFiI4tFdLoyfgLn3b3RZvhiUj0cGxc8eNyE7YsCdz0vO19FtdPh8Yhbn3D51Gla7Hfe9Lp9PXDgMZ5FqGWKqmCRhog2+fvZtFR6uLcPi5kaUuzvCtU3/QeIxz8fo8+jrCtQ3f0a5tF7hMEB8RLGcNheuvbQJ4zZm9lDYyzl6M8zHmwAwm7hiARSP8PQAxePBmRXS5TDCeVSxdQkW8Vo+JtiBcEs3WyXRGgR2A15+37N0Tm0hes1LNy6csOZLX4WfiPC/XSdyBBGy2HaL+VA1pyqyYltk6vBomDvUxUDibQhVWDWdKLi4YOjDPMbM7EWP/OhRyB85FuU25/aFbklLuZVCd3YQFW+3VtaCS7NLK6MpqxlkSVbD2zVKkbZfIe+XHWJ4vHlAREuTwKC0Nk3x60y0bx4VZp/TGnK/vM56J4HpdphCosYmRz05bb48CHKPfUTcXyxpCpfVKFuFcTZo+VFm+5Iq8N3lYhwNqnv5BeaPVshWHsZkvp+P8yZ22ZjEjxBEMKmWNZj4DxCSAQD+A6vcUK7SXRunAAAAAElFTkSuQmCC"},"7af5":function(t,e,i){t.exports=i.p+"static/img/align-left.d8de580a.svg"},"7c73":function(t,e,i){var a,n=i("825a"),s=i("37e8"),o=i("7839"),r=i("d012"),c=i("1be4"),l=i("cc12"),d=i("f772"),u=">",h="<",m="prototype",p="script",f=d("IE_PROTO"),g=function(){},v=function(t){return h+p+u+t+h+"/"+p+u},b=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},w=function(){var t,e=l("iframe"),i="java"+p+":";return e.style.display="none",c.appendChild(e),e.src=String(i),t=e.contentWindow.document,t.open(),t.write(v("document.F=Object")),t.close(),t.F},y=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}y="undefined"!=typeof document?document.domain&&a?b(a):w():b(a);var t=o.length;while(t--)delete y[m][o[t]];return y()};r[f]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(g[m]=n(t),i=new g,g[m]=null,i[f]=t):i=y(),void 0===e?i:s.f(i,e)}},"7e33":function(t,e,i){"use strict";i("0492")},"7e96":function(t,e,i){t.exports=i.p+"static/img/letterSpacing.31b8fc3a.svg"},"7ec3":function(t,e,i){"use strict";i("6371")},"7f5a":function(t,e,i){"use strict";var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("paypal-subscription-dialog",{model:{value:t.showPaypal,callback:function(e){t.showPaypal=e},expression:"showPaypal"}})],1)},n=[],s=i("1faf"),o=i("86b8"),r=i("2f62"),c=i("4a47"),l={name:"SubscriptionAction",components:{PaypalSubscriptionDialog:c["a"]},inject:["reload"],data(){return{showPaypal:!1}},computed:{...Object(r["b"])("user",{currentShop:"getCurrentShop",fittingsLevel:"getFittingsLevel"}),...Object(r["b"])("shopify",{app:"getApp",shop:"getShop"})},methods:{SelectSubscription(t){var e=this;1===this.currentShop.shopType?(this.loadingInstance=this.$loading(),Object(s["b"])({level:t,returnUrl:this.getReturnUrl()}).then(t=>{if(200===t.code){var i=t.data;if(1===i.status)return this.$message.success("Change subscription success!"),void setTimeout(()=>{e.reload()},500);2===i.status&&this.toShopifyConfirmationUrl(i.confirmationUrl)}else this.$message.error(t.msg)}).finally(()=>{this.loadingInstance.close()})):(console.log("show paypal"),this.showPaypal=!0)},getReturnUrl(){if(this.app){var t="e0080c246e19620838062418c3259ac2",e=this.shop;return`https://${e}/admin/apps/${t}/PaymentStatus`}return"https://"+location.host+"/PaymentStatus"},toShopifyConfirmationUrl(t){if(this.app){const e=o["Redirect"].create(this.app);e.dispatch(o["Redirect"].Action.REMOTE,{url:t,newContext:!1})}else location.href=t}}},d=l,u=i("2877"),h=Object(u["a"])(d,a,n,!1,null,"0db2ce20",null);e["a"]=h.exports},"847f":function(t,e,i){},"84c5":function(t,e,i){},"866a":function(t,e,i){},"87cd":function(t,e,i){t.exports=i.p+"static/img/pattern-pre-icon.691d52fe.svg"},8828:function(t,e,i){},"8aac":function(t,e,i){},"91bb":function(t,e,i){"use strict";i("c1bb")},"91fa":function(t,e,i){t.exports=i.p+"static/img/lock-icon.46540a45.svg"},9249:function(t,e,i){t.exports=i.p+"static/img/pull-down.a5929953.svg"},9486:function(t,e,i){t.exports=i.p+"static/img/eyes-icon.96da6581.svg"},"9a6e":function(t,e,i){t.exports=i.p+"static/img/pull-down-gray.8e5a18d6.svg"},"9a7f":function(t,e,i){t.exports=i.p+"static/img/info-icon.4d73c4f7.svg"},"9b92":function(t,e,i){},"9bea":function(t,e,i){},a3a4:function(t,e,i){"use strict";i("3f3e")},a3ba:function(t,e,i){"use strict";i("0c1b")},a66b:function(t,e,i){},a810:function(t,e,i){},a8ae:function(t,e,i){},a8b2:function(t,e,i){"use strict";i("1d4e")},a8fa:function(t,e,i){t.exports=i.p+"static/img/add-image-icon.970bdb01.svg"},aaf5:function(t,e,i){},abbe:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"detail-box"},[a("back-page",{staticClass:"backBtn",attrs:{path:"/CustomAccessories",text:"Attachment list"}}),a("div",{staticClass:"detail-info-box"},[a("div",{staticClass:"media-list-box default-scrollbar"},[a("div",{staticClass:"media-list"},t._l(t.mediaList,(function(e){return a("div",{key:e.id},[a("img",{staticClass:"media-item",attrs:{alt:"media-item",src:e,"data-scr":e},on:{click:function(i){return t.showMedia(e)}}})])})),0)]),a("div",{staticClass:"display-media-box"},[t.displayMedia?a("img",{staticClass:"display-media",attrs:{src:t.displayMedia,alt:"displayMedia"}}):t._e()]),a("div",{staticClass:"detail-info"},[a("div",{staticClass:"info-item1"},[t._v(" "+t._s(t.fullName)+" ")]),a("div",{staticClass:"info-item2"},[a("div",{staticClass:"plus-icon-div-box"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.showPlus,expression:"showPlus"}],staticClass:"plus-icon-div"},[a("div",{staticClass:"plus-icon-inner-div"},[a("img",{staticClass:"plus-icon",attrs:{alt:"plus-icon",src:i("bca9")}}),a("span",{staticClass:"plus-icon-text"},[t._v("Plus")])])])]),a("div",{staticClass:"info-item2-text"},[t._v(" "+t._s(t.inventoryAllocation)+" ")])]),a("div",{staticClass:"info-item3",domProps:{innerHTML:t._s(t.blankContent)}}),a("div",{staticClass:"content-sku-option-box"},t._l(t.saleAttrs,(function(e,i){return a("div",{key:i,staticClass:"content-sku-item"},[2===e.type?[a("div",{staticClass:"content-sku-color-top"},[a("div",{staticClass:"content-sku-item-label"},[t._v(t._s(e.name))]),a("div",{staticClass:"content-sku-color-select-text"},[t._v(" "+t._s(t.selectOption(e))+" ")])]),a("div",{staticClass:"content-sku-color-list"},[t._l(e.values,(function(i,n){return a("el-tooltip",{key:n,attrs:{content:i.value,placement:"top-start"}},[a("div",{staticClass:"content-sku-color-item-box",class:[{active:e.check===i.id},i.disabled?"no-click":"div-hover"],attrs:{disabled:i.disabled},on:{click:function(a){!i.disabled&&t.clickBack(e,i,i.id)}}},[i.disabled?a("div",{staticClass:"content-sku-color-disabled"},[a("div",{staticClass:"content-sku-color-disabled-item"}),a("div",{staticClass:"content-sku-color-disabled-item"})]):a("div",{staticClass:"content-sku-color-item",style:[{background:i.color}]})])])})),a("i",{staticStyle:{"margin-right":"10px"}}),a("i"),a("i"),a("i"),a("i"),a("i")],2)]:4===e.type?[a("div",{staticClass:"content-sku-color-top"},[a("div",{staticClass:"content-sku-item-label"},[t._v(t._s(e.name))]),a("div",{staticClass:"content-sku-color-select-text"},[t._v(" "+t._s(t.selectOption(e))+" ")])]),a("div",{staticClass:"content-sku-image-list"},[t._l(e.values,(function(i,n){return a("el-tooltip",{key:n,attrs:{content:i.value,placement:"top-start"}},[a("div",{staticClass:"content-sku-image-item-box",class:[{active:e.check===i.id},i.disabled?"no-click":"div-hover"],staticStyle:{"border-radius":"0"},attrs:{disabled:i.disabled},on:{click:function(a){!i.disabled&&t.clickBack(e,i,i.id)}}},[i.disabled?a("div",{staticClass:"content-sku-color-disabled"},[a("div",{staticClass:"content-sku-color-disabled-item"}),a("div",{staticClass:"content-sku-color-disabled-item"})]):a("div",{staticClass:"content-sku-image-item",style:{"background-image":"url("+i.imageUrl+")"}})])])})),a("i",{staticStyle:{"margin-right":"10px"}}),a("i"),a("i"),a("i"),a("i"),a("i")],2)]:[a("div",{staticClass:"content-sku-item-label"},[t._v(t._s(e.name))]),a("div",{staticClass:"content-sku-attr-list"},t._l(e.values,(function(i,n){return a("div",{key:n,staticClass:"content-sku-attr-item",class:[{active:e.check===i.id},i.disabled?"no-click":"div-hover"],attrs:{disabled:i.disabled},on:{click:function(a){!i.disabled&&t.clickBack(e,i,i.id)}}},[t._v(" "+t._s(i.value)+" ")])})),0)]],2)})),0),a("div",{staticClass:"info-item6"},[t._v(" Scope of application ")]),a("div",{staticClass:"info-item7"},[a("div",{staticClass:"popper-box"},[a("span",{staticClass:"available",on:{click:t.showAvailableBoxClick}},[t._v(" Available for "+t._s(t.fittingJewelryNum)+" jewelry ")]),t.showAvailableBox?a("div",[a("div",{staticClass:"tool-marks",on:{click:t.showAvailableBoxClick}}),a("AvailableList",{ref:"AvailableList",attrs:{"blank-id":this.blankId}})],1):t._e()])]),t.customizable?a("div",{staticClass:"info-item8",on:{click:t.showAopPreview}},[a("button",{staticClass:"customize-button"},[t._v("Customization")])]):a("div",{staticClass:"info-item8"},[a("button",{staticClass:"customize-button disabled-button",attrs:{disabled:t.dropshiped},on:{click:t.jumpToFreeBlankProductFreePage}},[t._v(" "+t._s(t.dropshiped?"Already added":"Add")+" ")])])])]),a("div",{staticClass:"detail-info-box-bottom"},[a("div",{staticClass:"description"},[t._v("Description")]),a("div",{staticClass:"description-content",domProps:{innerHTML:t._s(t.desc)}})])],1),t.isShowAopPreview?a("AopPreview",{ref:"AopPreview",model:{value:t.isShowAopPreview,callback:function(e){t.isShowAopPreview=e},expression:"isShowAopPreview"}}):t._e(),a("subscription-action",{ref:"SubscriptionAction"})],1)},n=[],s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"available-box"},[i("header",{staticClass:"header"},[i("el-input",{staticClass:"bind-search",attrs:{"prefix-icon":"el-icon-search",placeholder:"Product lD, product name, product sku"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getPageByKeyword.apply(null,arguments)}},model:{value:t.query.keyword,callback:function(e){t.$set(t.query,"keyword",e)},expression:"query.keyword"}})],1),i("main",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"bindListBox",staticClass:"bind-list-box default-scrollbar",on:{scroll:t.checkScroll}},[t._l(t.list,(function(e){return i("div",{key:e.id,staticClass:"list-item"},[i("img",{staticClass:"item-image",attrs:{src:e.mainShowImageUrl}}),i("div",{staticClass:"item-info"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.fullName,"open-delay":600,placement:"top-end"}},[i("div",{staticClass:"item-info1"},[t._v(t._s(e.fullName))])]),i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.skuInfo,"open-delay":600,placement:"top-start"}},[i("div",{staticClass:"item-info2"},[t._v(t._s(e.skuInfo))])])],1)])})),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.bottomLoading,expression:"bottomLoading"}],ref:"bottomItem",staticClass:"bottom-item"})],2)])},o=[],r=i("6d68"),c={name:"AvailableList",props:{blankId:{type:Number,default:null}},data(){return{list:[],query:{keyword:"",current:1,size:10,category1:1,fittingsId:null},total:0,bottomLoading:!1,listLoading:!1,lastScrollTop:0,loadMoreDataDebounced:()=>{}}},watch:{blankId:{handler(t){this.query.fittingsId=t},immediate:!0}},mounted(){this.loadMoreDataDebounced=this.debounce((function(){const t=this.query.current,e=this.total,i=this.query.size;e-i*t<=0||(this.query.current++,this.getPage())}),150)},created(){this.getPage()},methods:{getPageByKeyword(){this.query.current=1,this.list=[],this.getPage()},checkScroll(){const t=this.$refs.bindListBox,e=this.$refs.bottomItem,i=t.scrollTop,a=t.offsetHeight,n=e.offsetTop;i>this.lastScrollTop&&i+a>=n&&this.loadMoreDataDebounced(),this.lastScrollTop=i},debounce(t,e){let i;return function(){const a=this,n=arguments;clearTimeout(i),i=setTimeout(()=>{t.apply(a,n)},e)}},async getPage(){if(null==this.query.fittingsId)return;this.bottomLoading=!0,this.listLoading=!0;const t=await Object(r["c"])(this.query);if(200!==t.code)return this.bottomLoading=!1,void(this.listLoading=!1);this.total=t.data.total;const e=t.data.records;console.log(e),e.forEach(t=>{let e="";t.option1Num&&(e+=t.option1Num+" "+t.option1Name),t.option2Num&&(e+=" * "+t.option2Num+" "+t.option2Name),t.option3Num&&(e+=" * "+t.option3Num+" "+t.option3Name),t.skuInfo=e}),this.list.length>0?this.list.push(...e):this.list=e,console.log(this.list),this.bottomLoading=!1,this.listLoading=!1}}},l=c,d=(i("ec02"),i("2877")),u=Object(d["a"])(l,s,o,!1,null,"51c85d85",null),h=u.exports,m=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"aop-preview",style:{visibility:t.isOpen?"visible":"hidden"}},[i("div",{staticClass:"aop-container",style:{transform:t.isOpen?"translateY(0px)":"translateY(100%)",visibility:t.isOpen?"visible":"hidden"}},[i("AopHeader",{attrs:{"close-fn":t.close,"next-fn":t.next}}),1===t.step?i("PreviewBody"):t._e(),2===t.step?i("ShippingPage"):t._e(),i("ReminderNoElementDialog",{attrs:{content:t.reminderContent,"confirm-fn":t.checkQuality},model:{value:t.showReminderNoElementDialog,callback:function(e){t.showReminderNoElementDialog=e},expression:"showReminderNoElementDialog"}}),i("ReminderProblemDialog",{attrs:{content:t.reminderContent,"submit-fn":t.submit},model:{value:t.showReminderProblemDialog,callback:function(e){t.showReminderProblemDialog=e},expression:"showReminderProblemDialog"}})],1)])},p=[],f=i("623f"),g=i("66a5");const v=t=>Object(g["a"])({url:"/shopapi/custom/product/realtimePreview",method:"post",data:t}),b=t=>Object(g["a"])({url:"/shopapi/custom/product/generate",method:"post",data:t}),w=t=>Object(g["a"])({url:"/shopapi/custom/product/generateStatus",method:"post",data:t});var y=i("2f62"),C=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"header"},[a("div",{staticClass:"back",on:{click:t.closeFn}},[a("img",{staticClass:"back-icon",attrs:{alt:"back-icon",src:i("ccb8")}}),a("span",{staticClass:"back-title"},[t._v("Back")])]),1===t.step?a("div",{staticClass:"next",on:{click:t.nextFn}},[t._v("Next")]):t._e()])},k=[],I={name:"AopHeader",props:{closeFn:{type:Function,required:!0},nextFn:{type:Function,required:!0}},computed:{...Object(y["c"])("aopCustomize",["step"])}},x=I,A=(i("f1b3"),Object(d["a"])(x,C,k,!1,null,"44d05bec",null)),O=A.exports,S=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"preview-body"},[i("OperationArea"),i("div",{staticClass:"preview-area"},[i("PreviewHeader"),i("div",{staticClass:"pre-container"},[i("DesignArea"),i("ShowPreviewArea")],1)],1),i("PatternArea")],1)},P=[],_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"operation-area"},[i("AddArea"),i("Layers"),i("Settings")],1)},D=[],j=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"add-area"},[a("div",{staticClass:"add-img",staticStyle:{"margin-right":"20px"},on:{click:t.openImageArea}},[a("img",{staticClass:"add-image-icon",attrs:{alt:"add-image-icon",src:i("a8fa")}}),a("span",{staticClass:"title"},[t._v("Add Image")])]),a("div",{staticClass:"add-text",on:{click:t.addTextFn}},[a("img",{staticClass:"add-text-icon",attrs:{alt:"add-text-icon",src:i("5ef0")}}),a("span",{staticClass:"title"},[t._v("Add Text")])])]),a("ImageArea",{model:{value:t.isOpenImageArea,callback:function(e){t.isOpenImageArea=e},expression:"isOpenImageArea"}})],1)},E=[],T=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-area"},[i("el-drawer",{attrs:{visible:t.isOpen,direction:"btt","with-header":!0},on:{"update:visible":function(e){t.isOpen=e}}},[i("div",{staticClass:"image-list"},[i("UploadImage"),i("SearchArea"),i("ImageList",{attrs:{"close-image-area":t.closeImageArea}})],1)])],1)},N=[],z=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.loading?a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"loading"}):t._e(),a("div",{staticClass:"upload-image-view"},[a("el-upload",{staticClass:"upload-image el-upload-dragger",attrs:{drag:"",method:"put",action:t.uploadUrl,"http-request":t.ossRequest,"show-file-list":!1,"before-upload":t.beforeUploadFn},scopedSlots:t._u([{key:"default",fn:function(){return[a("div",{staticClass:"upload-drop"},[a("span",{staticClass:"title"},[t._v("Upload image")]),a("img",{staticClass:"icon",attrs:{alt:"upload-icon",src:i("4d56")}}),a("span",{staticClass:"hint"},[t._v("Drag and drop images here, or select from disk.")])])]},proxy:!0}])})],1)])},L=[],F=(i("caad"),i("4f7f")),B=i("88e7"),M={name:"UploadImage",data(){return{loading:!1,uploadUrl:"https://www.artshiney.com/shopapi/file/submitOssFile",acceptType:["png","jpg","jpeg","svg"]}},computed:{...Object(y["b"])("app",{submitOssFileApi:"submitOssFileApi",stsApi:"stsApi"}),...Object(y["c"])("aopCustomize",["addImg"])},methods:{async beforeUploadFn(t){const e=t.name.split("."),i=this.acceptType.includes(e[e.length-1]);return!!i||(this.$message.error(`只能上传 ${this.acceptType.join(",")} 等类型的图片`),!1)},async ossRequest(t){this.loading=!0;const e=t.file;try{const t=await B["a"].oss(this.stsApi),i=B["a"].getRandomObjectName(t.ossObjectNamePrefix,t.domain,e.name),a=await t.client.multipartUpload(i.objectName,e,{progress:async t=>{},headers:{"Cache-Control":"max-age=360000"}}),n=new Image;n.src=i.objectUrl,n.onload=async()=>{const t={fileName:e.name,fileType:1,width:n.width,height:n.height,fileUrl:i.objectUrl,bucketName:a.bucket,objectName:a.name,fileSize:e.size};await Object(F["c"])(t),this.$message.success("successfully upload"),this.$store.commit("aopCustomize/setCurrentPage",1),this.$store.commit("aopCustomize/setFileName",""),await this.$store.dispatch("aopCustomize/fetchImageList"),console.log(t),await this.addImg(t.fileUrl,t.fileName)}}catch(i){this.$message.success("fail to upload")}finally{this.loading=!1}}}},$=M,H=(i("7ec3"),Object(d["a"])($,z,L,!1,null,"b6cd29f8",null)),R=H.exports,X=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"search-area icon"},[i("el-input",{attrs:{placeholder:"Search file library","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getImageList.apply(null,arguments)}},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1)},V=[],Y={name:"SearchArea",data(){return{val:""}},watch:{val:{handler(t){this.$store.commit("aopCustomize/setFileName",t)}}},methods:{getImageList(){this.$store.commit("aopCustomize/setCurrentPage",1),this.$store.dispatch("aopCustomize/fetchImageList")}}},U=Y,W=(i("48ee"),i("dd95"),Object(d["a"])(U,X,V,!1,null,"71395d8c",null)),Q=W.exports,J=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{ref:"imageListBox",staticClass:"image-list",on:{scroll:t.checkScroll}},[t._l(t.imageList,(function(e){return i("ImageItem",{key:e.id,attrs:{data:e,"close-image-area":t.closeImageArea}})})),t.isDouble?t._e():i("div",{staticClass:"hidden-img"}),i("div",{ref:"bottomItem",staticClass:"bottom-item"})],2)},Z=[],q=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"image-item"},[a("div",{staticClass:"img-area"},[a("el-image",{staticClass:"img",attrs:{src:t.data.smallImageUrl,"initial-index":0},on:{click:t.addImgClick}}),t.showViewer?a("image-viewer",{attrs:{"initial-index":0,"on-close":t.closeViewer,"url-list":[t.data.fileUrl]}}):t._e(),a("div",{staticClass:"scale-box"},[a("div",{staticClass:"scale",on:{click:t.previewImage}},[a("img",{staticClass:"icon",attrs:{alt:"scale-icon",src:i("cf3c")}})])])],1),a("p",{staticClass:"file-name"},[t._v(t._s(t.data.fileName))]),a("div",{staticClass:"info"},[a("div",{staticClass:"size"},[t._v(" "+t._s(t.data.imageWidth)+"px * "+t._s(t.data.imageHeight)+" px ")])])])},G=[],K=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"viewer-fade"}},[i("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":t.viewerZIndex},attrs:{tabindex:"-1"}},[i("div",{staticClass:"el-image-viewer__mask",on:{click:function(e){return e.target!==e.currentTarget?null:t.handleMaskClick.apply(null,arguments)}}}),i("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:t.hide}},[i("i",{staticClass:"el-icon-close"})]),t.isSingle?t._e():[i("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!t.infinite&&t.isFirst},on:{click:t.prev}},[i("i",{staticClass:"el-icon-arrow-left"})]),i("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!t.infinite&&t.isLast},on:{click:t.next}},[i("i",{staticClass:"el-icon-arrow-right"})])],i("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[i("div",{staticClass:"el-image-viewer__actions__inner"},[i("i",{staticClass:"el-icon-zoom-out",on:{click:function(e){return t.handleActions("zoomOut")}}}),i("i",{staticClass:"el-icon-zoom-in",on:{click:function(e){return t.handleActions("zoomIn")}}}),i("i",{staticClass:"el-image-viewer__actions__divider"}),i("i",{class:t.mode.icon,on:{click:t.toggleMode}}),i("i",{staticClass:"el-image-viewer__actions__divider"}),i("i",{staticClass:"el-icon-refresh-left",on:{click:function(e){return t.handleActions("anticlocelise")}}}),i("i",{staticClass:"el-icon-refresh-right",on:{click:function(e){return t.handleActions("clocelise")}}})])]),i("div",{staticClass:"el-image-viewer__canvas"},t._l(t.urlList,(function(e,a){return a===t.index?i("img",{key:e,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:t.imgStyle,attrs:{src:t.currentImg},on:{load:t.handleImgLoad,error:t.handleImgError,mousedown:t.handleMouseDown}}):t._e()})),0)],2)])},tt=[],et=i("526f"),it=i("6bd7"),at=i("2b0e"),nt=i("eab7");let st,ot=!1,rt=!1;const ct=function(){if(at["default"].prototype.$isServer)return;let t=dt.modalDom;return t?ot=!0:(ot=!1,t=document.createElement("div"),dt.modalDom=t,t.addEventListener("touchmove",(function(t){t.preventDefault(),t.stopPropagation()})),t.addEventListener("click",(function(){dt.doOnModalClick&&dt.doOnModalClick()}))),t},lt={},dt={modalFade:!0,getInstance:function(t){return lt[t]},register:function(t,e){t&&e&&(lt[t]=e)},deregister:function(t){t&&(lt[t]=null,delete lt[t])},nextZIndex:function(){return dt.zIndex++},modalStack:[],doOnModalClick:function(){const t=dt.modalStack[dt.modalStack.length-1];if(!t)return;const e=dt.getInstance(t.id);e&&e.closeOnClickModal&&e.close()},openModal:function(t,e,i,a,n){if(at["default"].prototype.$isServer)return;if(!t||void 0===e)return;this.modalFade=n;const s=this.modalStack;for(let r=0,c=s.length;rObject(et["a"])(o,t))}setTimeout(()=>{Object(et["g"])(o,"v-modal-enter")},200),i&&i.parentNode&&11!==i.parentNode.nodeType?i.parentNode.appendChild(o):document.body.appendChild(o),e&&(o.style.zIndex=e),o.tabIndex=0,o.style.display="",this.modalStack.push({id:t,zIndex:e,modalClass:a})},closeModal:function(t){const e=this.modalStack,i=ct();if(e.length>0){const a=e[e.length-1];if(a.id===t){if(a.modalClass){let t=a.modalClass.trim().split(/\s+/);t.forEach(t=>Object(et["g"])(i,t))}e.pop(),e.length>0&&(i.style.zIndex=e[e.length-1].zIndex)}else for(let i=e.length-1;i>=0;i--)if(e[i].id===t){e.splice(i,1);break}}0===e.length&&(this.modalFade&&Object(et["a"])(i,"v-modal-leave"),setTimeout(()=>{0===e.length&&(i.parentNode&&i.parentNode.removeChild(i),i.style.display="none",dt.modalDom=void 0),Object(et["g"])(i,"v-modal-leave")},200))}};Object.defineProperty(dt,"zIndex",{configurable:!0,get(){return rt||(st=st||(at["default"].prototype.$ELEMENT||{}).zIndex||2e3,rt=!0),st},set(t){st=t}});const ut=function(){if(!at["default"].prototype.$isServer&&dt.modalStack.length>0){const t=dt.modalStack[dt.modalStack.length-1];if(!t)return;const e=dt.getInstance(t.id);return e}};at["default"].prototype.$isServer||window.addEventListener("keydown",(function(t){if(27===t.keyCode){const t=ut();t&&t.closeOnPressEscape&&(t.handleClose?t.handleClose():t.handleAction?t.handleAction("cancel"):t.close())}}));var ht=dt;let mt;var pt=function(){if(at["default"].prototype.$isServer)return 0;if(void 0!==mt)return mt;const t=document.createElement("div");t.className="el-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const e=t.offsetWidth;t.style.overflow="scroll";const i=document.createElement("div");i.style.width="100%",t.appendChild(i);const a=i.offsetWidth;return t.parentNode.removeChild(t),mt=e-a,mt};let ft,gt=1;Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const vt={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},bt=Object(it["a"])()?"DOMMouseScroll":"mousewheel";var wt={name:"elImageViewer",props:{urlList:{type:Array,default:()=>[]},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:()=>{}},onClose:{type:Function,default:()=>{}},initialIndex:{type:Number,default:0},appendToBody:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0}},data(){return{index:this.initialIndex,isShow:!1,infinite:!0,loading:!1,mode:vt.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle(){return this.urlList.length<=1},isFirst(){return 0===this.index},isLast(){return this.index===this.urlList.length-1},currentImg(){return this.urlList[this.index]},imgStyle(){const{scale:t,deg:e,offsetX:i,offsetY:a,enableTransition:n}=this.transform,s={transform:`scale(${t}) rotate(${e}deg)`,transition:n?"transform .3s":"","margin-left":i+"px","margin-top":a+"px"};return this.mode===vt.CONTAIN&&(s.maxWidth=s.maxHeight="100%"),s},viewerZIndex(){const t=ht.nextZIndex();return this.zIndex>t?this.zIndex:t}},watch:{index:{handler:function(t){this.reset(),this.onSwitch(t)}},currentImg(t){this.$nextTick(t=>{const e=this.$refs.img[0];e.complete||(this.loading=!0)})}},methods:{hide(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall(){this._keyDownHandler=t=>{t.stopPropagation();const e=t.keyCode;switch(e){case 27:this.hide();break;case 32:this.toggleMode();break;case 37:this.prev();break;case 38:this.handleActions("zoomIn");break;case 39:this.next();break;case 40:this.handleActions("zoomOut");break}},this._mouseWheelHandler=Object(it["c"])(t=>{const e=t.wheelDelta?t.wheelDelta:-t.detail;e>0?this.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):this.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),Object(et["e"])(document,"keydown",this._keyDownHandler),Object(et["e"])(document,bt,this._mouseWheelHandler)},deviceSupportUninstall(){Object(et["d"])(document,"keydown",this._keyDownHandler),Object(et["d"])(document,bt,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad(t){this.loading=!1},handleImgError(t){this.loading=!1,t.target.alt="加载失败"},handleMouseDown(t){if(this.loading||0!==t.button)return;const{offsetX:e,offsetY:i}=this.transform,a=t.pageX,n=t.pageY;this._dragHandler=Object(it["c"])(t=>{this.transform.offsetX=e+t.pageX-a,this.transform.offsetY=i+t.pageY-n}),Object(et["e"])(document,"mousemove",this._dragHandler),Object(et["e"])(document,"mouseup",t=>{Object(et["d"])(document,"mousemove",this._dragHandler)}),t.preventDefault()},handleMaskClick(){this.maskClosable&&this.hide()},reset(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode(){if(this.loading)return;const t=Object.keys(vt),e=Object.values(vt),i=e.indexOf(this.mode),a=(i+1)%t.length;this.mode=vt[t[a]],this.reset()},prev(){if(this.isFirst&&!this.infinite)return;const t=this.urlList.length;this.index=(this.index-1+t)%t},next(){if(this.isLast&&!this.infinite)return;const t=this.urlList.length;this.index=(this.index+1)%t},handleActions(t,e={}){if(this.loading)return;const{zoomRate:i,rotateDeg:a,enableTransition:n}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...e},{transform:s}=this;switch(t){case"zoomOut":s.scale>.2&&(s.scale=parseFloat((s.scale-i).toFixed(3)));break;case"zoomIn":s.scale=parseFloat((s.scale+i).toFixed(3));break;case"clocelise":s.deg+=a;break;case"anticlocelise":s.deg-=a;break}s.enableTransition=n}},mounted(){this.deviceSupportInstall(),this.appendToBody&&document.body.appendChild(this.$el),this.$refs["el-image-viewer__wrapper"].focus()},destroyed(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},yt=wt,Ct=Object(d["a"])(yt,K,tt,!1,null,null,null),kt=Ct.exports,It={name:"ImageItem",components:{ImageViewer:kt},props:{data:{type:Object,default:()=>({smallImageUrl:"",fileUrl:"",like:!0,fileName:"",imageWidth:"",imageHeight:""})},closeImageArea:{type:Function,default:()=>{}}},data(){return{showViewer:!1,imageLike:!1}},watch:{data:{handler(t){this.imageLike=t.like},immediate:!0},imageLike:{handler(t){this.data.like=t},immediate:!0}},computed:{...Object(y["c"])("aopCustomize",["addImg"])},methods:{previewImage(){this.showViewer=!0},likeImage(){this.data.like=!0},unLikeImage(){this.data.like=!1},addImgClick(){this.addImg(this.data.fileUrl,this.data.fileName),this.$store.commit("aopCustomize/setShowImageArea",!1)},closeViewer(){this.showViewer=!1}}},xt=It,At=(i("297c"),Object(d["a"])(xt,q,G,!1,null,"174f1360",null)),Ot=At.exports,St={name:"ImageList",components:{ImageItem:Ot},props:{closeImageArea:{type:Function,default:()=>{}}},data(){return{lastScrollTop:0,loadMoreDataDebounced:()=>{}}},computed:{...Object(y["c"])("aopCustomize",["currentPage","pageSize"]),...Object(y["b"])("aopCustomize",["imageTotal","imageList","isDouble"])},mounted(){this.loadMoreDataDebounced=this.debounce((function(){let t=this.currentPage;const e=this.imageTotal,i=this.pageSize;e-i*t<=0||(t++,this.$store.commit("aopCustomize/setCurrentPage",t),this.getPage())}),150)},methods:{checkScroll(){const t=this.$refs.imageListBox,e=this.$refs.bottomItem,i=t.scrollTop,a=t.offsetHeight,n=e.offsetTop;i>this.lastScrollTop&&i+a>=n&&this.loadMoreDataDebounced(),this.lastScrollTop=i},debounce(t,e){let i;return function(){const a=this,n=arguments;clearTimeout(i),i=setTimeout(()=>{t.apply(a,n)},e)}},async getPage(){await this.$store.dispatch("aopCustomize/fetchImageList")}}},Pt=St,_t=(i("a3a4"),Object(d["a"])(Pt,J,Z,!1,null,"9622ee9c",null)),Dt=_t.exports,jt={name:"ImageArea",components:{UploadImage:R,SearchArea:Q,ImageList:Dt},props:{value:{type:Boolean,default:!1}},data(){return{isOpen:!1}},computed:{...Object(y["c"])("aopCustomize",["showImageArea","listLoading"])},watch:{value:{handler(t){this.isOpen=t,t&&this.$store.dispatch("aopCustomize/fetchImageList")},immediate:!0},isOpen:{handler(t){this.$emit("input",t)},immediate:!0},showImageArea:{handler(t){this.isOpen=t},immediate:!0}},mounted(){},methods:{closeImageArea:()=>{(void 0).isOpen=!1,(void 0).$emit("input",!1)}}},Et=jt,Tt=(i("f499"),Object(d["a"])(Et,T,N,!1,null,null,null)),Nt=Tt.exports,zt={name:"AddArea",components:{ImageArea:Nt},data(){return{isOpenImageArea:!1}},computed:{...Object(y["c"])("aopCustomize",["addText"])},methods:{openImageArea(){this.isOpenImageArea=!0,this.$store.commit("aopCustomize/setShowImageArea",!0),setTimeout(()=>{document.getElementsByClassName("v-modal")[0].style.zIndex=255},100)},addTextFn(){this.addText("Hello")}}},Lt=zt,Ft=(i("e2e7"),Object(d["a"])(Lt,j,E,!1,null,"71054119",null)),Bt=Ft.exports,Mt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.list.length>0,expression:"list.length > 0"}],ref:"layers",staticClass:"layers"},[i("div",{staticClass:"title"},[t._v("Layers")]),i("div",{staticClass:"layer-body",attrs:{id:"sortList"}},t._l(t.list,(function(e,a){return i("div",{key:a,class:{"non-draggable":1e3===e.id},style:{backgroundColor:t.selectObjId===e.id?"#e4edff":"white"},attrs:{id:e.id},on:{mouseup:function(i){return t.chooseObj(e)}}},["image"===e.type?i("ImageItem",{attrs:{data:e}}):t._e(),"text"===e.type?i("TextItem",{attrs:{data:e}}):t._e(),"color"===e.type?i("ColorItem",{attrs:{data:e}}):t._e()],1)})),0),i("div",{staticClass:"layer-hint-box"},[t.recommendHeight&&t.recommendWidth?i("div",{staticClass:"layer-hint"},[t._v(" Recommend pic pixel: "+t._s(t.recommendHeight)+" * "+t._s(t.recommendWidth)+"px ")]):t._e()])])},$t=[],Ht=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"image-item"},[a("div",{staticClass:"item-inner"},[a("div",{staticClass:"move-box"},[a("img",{staticClass:"move-icon",attrs:{src:i("6aded")}})]),a("div",{staticClass:"icon-body"},[a("img",{attrs:{src:t.data.src}})]),a("div",{staticClass:"img-info"},[a("div",{staticClass:"info-box"},[a("p",{staticClass:"title"},[t._v(t._s(t.data.name||"picture")+"(JPEG)")]),a("div",{staticClass:"quality"},[1===t.quality?a("span",{staticClass:"quality-good"},[t._v(" Good quality ")]):t._e(),2===t.quality?a("span",{staticClass:"quality-normal"},[t._v(" Normal quality ")]):t._e(),3===t.quality?a("span",{staticClass:"quality-bad"},[t._v(" Bad quality ")]):t._e()])])])]),a("LayerOperation",{attrs:{data:t.data}})],1)},Rt=[],Xt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"layer-operation"},[i("img",{directives:[{name:"show",rawName:"v-show",value:"color"!==t.data.type,expression:"data.type !== 'color'"}],staticClass:"icon",attrs:{src:t.data.selectable?t.unlockIcon:t.lockIcon},on:{click:t.setLock}}),i("img",{staticClass:"icon",attrs:{src:t.visibleIcon},on:{click:t.setVisible}}),i("img",{staticClass:"icon",attrs:{src:t.deleteIcon},on:{click:t.deleteObj}})])},Vt=[];const Yt=i("9486");var Ut={name:"LayerOperation",props:{data:{type:Object,default:null}},data(){return{eyesIcon:Yt,closeEyesIcon:i("ffe8"),unlockIcon:i("3c15"),lockIcon:i("91fa"),deleteIcon:i("3bc0"),visibleIcon:Yt,storageColor:null}},computed:{...Object(y["b"])("aopCustomize",["getCurrentDrawingData"]),...Object(y["c"])("aopCustomize",["renderCanvas","canvas","saveDrawingData"])},methods:{async setValue(t,e){const i=this.data.id,a=this.canvas.getObjects();let n=null;a.forEach(a=>{a.evented&&a.id===i&&(n=a,a[t]=e)}),this.canvas.discardActiveObject(n),this.$store.commit("aopCustomize/setCurrentDrawingData",a),this.saveDrawingData(),this.canvas.renderAll()},setLock(){this.setValue("selectable",!this.data.selectable)},async setVisible(){"color"===this.data.type?(this.data.visible&&(this.storageColor=this.canvas.backgroundColor),this.data.visible=!this.data.visible,this.visibleIcon=this.data.visible?this.eyesIcon:this.closeEyesIcon,this.canvas.backgroundColor=this.data.visible?this.storageColor:"",this.canvas.renderAll()):(await this.setValue("visible",!this.data.visible),this.visibleIcon=this.data.visible?this.eyesIcon:this.closeEyesIcon)},deleteObj(){const t=this.data.id,e=this.canvas;if("color"===this.data.type)e.backgroundColor="",e.renderAll(),this.$store.commit("aopCustomize/setBackgroundColor","");else{const i=e.getObjects().find(e=>e.id===t);e.discardActiveObject(i),e.remove(i);const a=e.getObjects(),n=a.filter(t=>t.isPattern);n.forEach(t=>{e.remove(t)})}this.saveDrawingData();const i=e.getObjects();1===i.length&&this.$store.commit("aopCustomize/setSelectObjId",-1)}}},Wt=Ut,Qt=(i("a8b2"),Object(d["a"])(Wt,Xt,Vt,!1,null,"72976e11",null)),Jt=Qt.exports,Zt={name:"ImageItem",components:{LayerOperation:Jt},props:{data:{type:Object}},computed:{...Object(y["c"])("aopCustomize",["canvas","selectPartIdx","checkImageQuality"]),...Object(y["b"])("aopCustomize",["getKnifeList"]),quality(){return this.checkImageQuality(this.data,this.getKnifeList.knifeInfoList[this.selectPartIdx])}}},qt=Zt,Gt=(i("3805"),Object(d["a"])(qt,Ht,Rt,!1,null,"1670d64b",null)),Kt=Gt.exports,te=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"text-item"},[a("div",{staticClass:"item-inner"},[a("div",{staticClass:"move-box"},[a("img",{staticClass:"move-icon",attrs:{src:i("6aded")}})]),a("div",{staticClass:"text-box"},[a("img",{staticClass:"text-icon",attrs:{src:i("17b5")}})]),a("div",{staticClass:"input-box"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.content,expression:"content"}],staticClass:"font-input",attrs:{disabled:!t.data.selectable},domProps:{value:t.content},on:{input:function(e){e.target.composing||(t.content=e.target.value)}}})]),a("LayerOperation",{attrs:{data:t.data}})],1)])},ee=[],ie={name:"TextItem",components:{LayerOperation:Jt},props:{data:{}},data(){return{}},computed:{...Object(y["c"])("aopCustomize",["renderCanvas","canvas"]),...Object(y["b"])("aopCustomize",["getCurrentDrawingData"]),content:{get(){return this.data.text},async set(t){const e=this.data.id,i=this.getCurrentDrawingData,a=this.canvas;i.forEach(i=>{i.id===e&&(i.text=t)}),await this.$store.commit("aopCustomize/setCurrentDrawingData",i);const n=a.getObjects().find(t=>t.id===e);a.setActiveObject(n),n.text=t,a.renderAll()}}}},ae=ie,ne=(i("ff3d"),Object(d["a"])(ae,te,ee,!1,null,"680efc82",null)),se=ne.exports,oe=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"color-item"},[a("div",{staticClass:"item-inner"},[a("div",{staticClass:"move-box"},[a("img",{staticClass:"move-icon",attrs:{src:i("6aded")}})]),a("div",{staticClass:"color-box",style:{background:t.data.content}}),a("div",{staticClass:"text-box"},[t._v(" Background Color ")]),a("LayerOperation",{attrs:{data:t.data}})],1)])},re=[],ce={name:"ColorItem",components:{LayerOperation:Jt},props:{data:{}},data(){return{}},computed:{...Object(y["c"])("aopCustomize",["renderCanvas","canvas"]),...Object(y["b"])("aopCustomize",["getCurrentDrawingData"]),content:{get(){return this.data.text},async set(t){const e=this.data.id,i=this.getCurrentDrawingData,a=this.canvas;i.forEach(i=>{i.id===e&&(i.text=t)}),await this.$store.commit("aopCustomize/setCurrentDrawingData",i);const n=await this.renderCanvas();if(n){const t=a.getObjects().find(t=>t.id===e);a.setActiveObject(t)}}}}},le=ce,de=(i("d8cb"),Object(d["a"])(le,oe,re,!1,null,"665d7e83",null)),ue=de.exports; /**! * Sortable 1.15.2 * @author RubaXa * @author owenm * @license MIT */ function he(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function me(t){for(var e=1;e=0||(n[i]=t[i]);return n}function be(t,e){if(null==t)return{};var i,a,n=ve(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}var we="1.15.2";function ye(t){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Ce=ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ke=ye(/Edge/i),Ie=ye(/firefox/i),xe=ye(/safari/i)&&!ye(/chrome/i)&&!ye(/android/i),Ae=ye(/iP(ad|od|hone)/i),Oe=ye(/chrome/i)&&ye(/android/i),Se={capture:!1,passive:!1};function Pe(t,e,i){t.addEventListener(e,i,!Ce&&Se)}function _e(t,e,i){t.removeEventListener(e,i,!Ce&&Se)}function De(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(i){return!1}return!1}}function je(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ee(t,e,i,a){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&De(t,e):De(t,e))||a&&t===i)return t;if(t===i)break}while(t=je(t))}return null}var Te,Ne=/\s+/g;function ze(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var a=(" "+t.className+" ").replace(Ne," ").replace(" "+e+" "," ");t.className=(a+(i?" "+e:"")).replace(Ne," ")}}function Le(t,e,i){var a=t&&t.style;if(a){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in a||-1!==e.indexOf("webkit")||(e="-webkit-"+e),a[e]=i+("string"===typeof i?"":"px")}}function Fe(t,e){var i="";if("string"===typeof t)i=t;else do{var a=Le(t,"transform");a&&"none"!==a&&(i=a+" "+i)}while(!e&&(t=t.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function Be(t,e,i){if(t){var a=t.getElementsByTagName(e),n=0,s=a.length;if(i)for(;n=s:n<=s,!o)return a;if(a===Me())break;a=We(a,!1)}return!1}function Re(t,e,i,a){var n=0,s=0,o=t.children;while(s2&&void 0!==arguments[2]?arguments[2]:{},a=i.evt,n=be(i,li);ri.pluginEvent.bind(na)(t,e,me({dragEl:hi,parentEl:mi,ghostEl:pi,rootEl:fi,nextEl:gi,lastDownEl:vi,cloneEl:bi,cloneHidden:wi,dragStarted:Ei,putSortable:Ai,activeSortable:na.active,originalEvent:a,oldIndex:yi,oldDraggableIndex:ki,newIndex:Ci,newDraggableIndex:Ii,hideGhostForTarget:ta,unhideGhostForTarget:ea,cloneNowHidden:function(){wi=!0},cloneNowShown:function(){wi=!1},dispatchSortableEvent:function(t){ui({sortable:e,name:t,originalEvent:a})}},n))};function ui(t){ci(me({putSortable:Ai,cloneEl:bi,targetEl:hi,rootEl:fi,oldIndex:yi,oldDraggableIndex:ki,newIndex:Ci,newDraggableIndex:Ii},t))}var hi,mi,pi,fi,gi,vi,bi,wi,yi,Ci,ki,Ii,xi,Ai,Oi,Si,Pi,_i,Di,ji,Ei,Ti,Ni,zi,Li,Fi=!1,Bi=!1,Mi=[],$i=!1,Hi=!1,Ri=[],Xi=!1,Vi=[],Yi="undefined"!==typeof document,Ui=Ae,Wi=ke||Ce?"cssFloat":"float",Qi=Yi&&!Oe&&!Ae&&"draggable"in document.createElement("div"),Ji=function(){if(Yi){if(Ce)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Zi=function(t,e){var i=Le(t),a=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),n=Re(t,0,e),s=Re(t,1,e),o=n&&Le(n),r=s&&Le(s),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+$e(n).width,l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+$e(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&o["float"]&&"none"!==o["float"]){var d="left"===o["float"]?"left":"right";return!s||"both"!==r.clear&&r.clear!==d?"horizontal":"vertical"}return n&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||c>=a&&"none"===i[Wi]||s&&"none"===i[Wi]&&c+l>a)?"vertical":"horizontal"},qi=function(t,e,i){var a=i?t.left:t.top,n=i?t.right:t.bottom,s=i?t.width:t.height,o=i?e.left:e.top,r=i?e.right:e.bottom,c=i?e.width:e.height;return a===o||n===r||a+s/2===o+c/2},Gi=function(t,e){var i;return Mi.some((function(a){var n=a[ei].options.emptyInsertThreshold;if(n&&!Xe(a)){var s=$e(a),o=t>=s.left-n&&t<=s.right+n,r=e>=s.top-n&&e<=s.bottom+n;return o&&r?i=a:void 0}})),i},Ki=function(t){function e(t,i){return function(a,n,s,o){var r=a.options.group.name&&n.options.group.name&&a.options.group.name===n.options.group.name;if(null==t&&(i||r))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"===typeof t)return e(t(a,n,s,o),i)(a,n,s,o);var c=(i?a:n).options.group.name;return!0===t||"string"===typeof t&&t===c||t.join&&t.indexOf(c)>-1}}var i={},a=t.group;a&&"object"==pe(a)||(a={name:a}),i.name=a.name,i.checkPull=e(a.pull,!0),i.checkPut=e(a.put),i.revertClone=a.revertClone,t.group=i},ta=function(){!Ji&&pi&&Le(pi,"display","none")},ea=function(){!Ji&&pi&&Le(pi,"display","")};Yi&&!Oe&&document.addEventListener("click",(function(t){if(Bi)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Bi=!1,!1}),!0);var ia=function(t){if(hi){t=t.touches?t.touches[0]:t;var e=Gi(t.clientX,t.clientY);if(e){var i={};for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[ei]._onDragOver(i)}}},aa=function(t){hi&&hi.parentNode[ei]._isOutsideThisEl(t.target)};function na(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=ge({},e),t[ei]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Zi(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==na.supportPointer&&"PointerEvent"in window&&!xe,emptyInsertThreshold:5};for(var a in ri.initializePlugins(this,t,i),i)!(a in e)&&(e[a]=i[a]);for(var n in Ki(e),this)"_"===n.charAt(0)&&"function"===typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!e.forceFallback&&Qi,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Pe(t,"pointerdown",this._onTapStart):(Pe(t,"mousedown",this._onTapStart),Pe(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Pe(t,"dragover",this),Pe(t,"dragenter",this)),Mi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ge(this,ii())}function sa(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function oa(t,e,i,a,n,s,o,r){var c,l,d=t[ei],u=d.options.onMove;return!window.CustomEvent||Ce||ke?(c=document.createEvent("Event"),c.initEvent("move",!0,!0)):c=new CustomEvent("move",{bubbles:!0,cancelable:!0}),c.to=e,c.from=t,c.dragged=i,c.draggedRect=a,c.related=n||e,c.relatedRect=s||$e(e),c.willInsertAfter=r,c.originalEvent=o,t.dispatchEvent(c),u&&(l=u.call(d,c,o)),l}function ra(t){t.draggable=!1}function ca(){Xi=!1}function la(t,e,i){var a=$e(Re(i.el,0,i.options,!0)),n=ti(i.el,i.options,pi),s=10;return e?t.clientXn.right+s||t.clientY>a.bottom&&t.clientX>a.left:t.clientY>n.bottom+s||t.clientX>a.right&&t.clientY>a.top}function ua(t,e,i,a,n,s,o,r){var c=a?t.clientY:t.clientX,l=a?i.height:i.width,d=a?i.top:i.left,u=a?i.bottom:i.right,h=!1;if(!o)if(r&&zid+l*s/2:cu-zi)return-Ni}else if(c>d+l*(1-n)/2&&cu-l*s/2)?c>d+l/2?1:-1:0}function ha(t){return Ve(hi)=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){hi&&ra(hi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;_e(t,"mouseup",this._disableDelayedDrag),_e(t,"touchend",this._disableDelayedDrag),_e(t,"touchcancel",this._disableDelayedDrag),_e(t,"mousemove",this._delayedDragTouchMoveHandler),_e(t,"touchmove",this._delayedDragTouchMoveHandler),_e(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Pe(document,"pointermove",this._onTouchMove):Pe(document,e?"touchmove":"mousemove",this._onTouchMove):(Pe(hi,"dragend",this),Pe(fi,"dragstart",this._onDragStart));try{document.selection?fa((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(i){}},_dragStarted:function(t,e){if(Fi=!1,fi&&hi){di("dragStarted",this,{evt:e}),this.nativeDraggable&&Pe(document,"dragover",aa);var i=this.options;!t&&ze(hi,i.dragClass,!1),ze(hi,i.ghostClass,!0),na.active=this,t&&this._appendGhost(),ui({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Si){this._lastX=Si.clientX,this._lastY=Si.clientY,ta();var t=document.elementFromPoint(Si.clientX,Si.clientY),e=t;while(t&&t.shadowRoot){if(t=t.shadowRoot.elementFromPoint(Si.clientX,Si.clientY),t===e)break;e=t}if(hi.parentNode[ei]._isOutsideThisEl(t),e)do{if(e[ei]){var i=void 0;if(i=e[ei]._onDragOver({clientX:Si.clientX,clientY:Si.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);ea()}},_onTouchMove:function(t){if(Oi){var e=this.options,i=e.fallbackTolerance,a=e.fallbackOffset,n=t.touches?t.touches[0]:t,s=pi&&Fe(pi,!0),o=pi&&s&&s.a,r=pi&&s&&s.d,c=Ui&&Li&&Ye(Li),l=(n.clientX-Oi.clientX+a.x)/(o||1)+(c?c[0]-Ri[0]:0)/(o||1),d=(n.clientY-Oi.clientY+a.y)/(r||1)+(c?c[1]-Ri[1]:0)/(r||1);if(!na.active&&!Fi){if(i&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))=0&&(ui({rootEl:mi,name:"add",toEl:mi,fromEl:fi,originalEvent:t}),ui({sortable:this,name:"remove",toEl:mi,originalEvent:t}),ui({rootEl:mi,name:"sort",toEl:mi,fromEl:fi,originalEvent:t}),ui({sortable:this,name:"sort",toEl:mi,originalEvent:t})),Ai&&Ai.save()):Ci!==yi&&Ci>=0&&(ui({sortable:this,name:"update",toEl:mi,originalEvent:t}),ui({sortable:this,name:"sort",toEl:mi,originalEvent:t})),na.active&&(null!=Ci&&-1!==Ci||(Ci=yi,Ii=ki),ui({sortable:this,name:"end",toEl:mi,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){di("nulling",this),fi=hi=mi=pi=gi=bi=vi=wi=Oi=Si=Ei=Ci=Ii=yi=ki=Ti=Ni=Ai=xi=na.dragged=na.ghost=na.clone=na.active=null,Vi.forEach((function(t){t.checked=!0})),Vi.length=Pi=_i=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":hi&&(this._onDragOver(t),sa(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t,e=[],i=this.el.children,a=0,n=i.length,s=this.options;a-1;i--){const a=e[i];t.push(a)}return this.canvas&&this.canvas.backgroundColor&&t.push({id:1e3,type:"color",evented:!1,content:this.canvas.backgroundColor,selectable:!0,visible:!0,isPattern:!1}),t},set(t){this.getCurrentDrawingData&&(this.$store.commit("aopCustomize/setCurrentDrawingData",t.slice().reverse()),this.renderCanvas())}}},watch:{getSelectPartData:{handler(){try{this.recommendHeight=this.getSelectPartData.recommendImageHeight,this.recommendWidth=this.getSelectPartData.recommendImageWidth}catch(t){this.recommendHeight="",this.recommendWidth=""}},deep:!0}},mounted(){Ea.create(document.getElementById("sortList"),{animation:200,filter:".non-draggable",onEnd:()=>{const t=this.list,e=[];Array.from(document.getElementById("sortList").children).map(i=>{e.push(t.find(t=>t.id+""===i.id))}),this.list=e}})},methods:{chooseObj(t){const e=t.id,i="color"===t.type,a=this.canvas;if(i)a.discardActiveObject(a.getActiveObject());else{this.$store.commit("aopCustomize/setSelectObjId",e);const t=a.getObjects().find(t=>t.id===e);a.setActiveObject(t)}a.renderAll()}}},Na=Ta,za=(i("a3ba"),Object(d["a"])(Na,Mt,$t,!1,null,"0e25d5d1",null)),La=za.exports,Fa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.showSetting?i("div",{staticClass:"settings"},[i("div",{staticClass:"s-title"},[t._v(t._s(t.settingTitle))]),i("div",{staticClass:"s-body"},[i("div",{staticClass:"s-icon"},t._l(t.settings,(function(t,e){return i("OperationIcon",{key:e,attrs:{data:t}})})),1),i("ChangeFontFamily"),i("div",{staticClass:"s-input-area"},t._l(t.inputData,(function(t,e){return i("InputItem",{key:e,attrs:{data:t,"is-open":!0}})})),1)],1)]):t._e()},Ba=[];const Ma={Normal:0,Color:1},$a={Image:"image",Text:"text"};var Ha=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-tooltip",{staticClass:"tooltip",attrs:{effect:"dark",content:t.icon.name,placement:"top-start"}},[i("img",{staticClass:"operation-icon",attrs:{src:t.icon.url},on:{click:t.data.fn}})])},Ra=[],Xa={name:"OperationIcon",props:{data:{type:Object,default:null}},data(){return{icon:{name:"",icon:"",storeKey:"",fn:()=>{}}}},watch:{data:{handler(t){this.icon=t},immediate:!0},icon:{handler(t){this.$emit("input",t)},immediate:!0}},computed:{}},Va=Xa,Ya=(i("3e2a"),Object(d["a"])(Va,Ha,Ra,!1,null,"3e72d7d1",null)),Ua=Ya.exports,Wa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.isShow?i("div",[i("div",{staticClass:"title"},[t._v("Font")]),i("div",{staticClass:"change-font-family"},[i("el-select",{attrs:{placeholder:"Select",size:"small"},model:{value:t.font,callback:function(e){t.font=e},expression:"font"}},t._l(t.fontList,(function(t){return i("el-option",{key:t.uid,attrs:{label:t.name,value:t.uid}})})),1)],1)]):t._e()},Qa=[],Ja={name:"ChangeFontFamily",data(){return{isShow:!1,font:""}},computed:{...Object(y["b"])("aopCustomize",["currentSelectedObj"]),...Object(y["c"])("aopCustomize",["saveDrawingData","renderPreview","fontList","canvas","selectObjId"])},watch:{selectObjId:{handler(){if(!this.selectObjId||-1===this.selectObjId)return void(this.isShow=!1);if(!this.canvas)return void(this.isShow=!1);const t=this.canvas.getActiveObject();t?(this.font=t.fontFamily,this.isShow="text"===t.type):this.isShow=!1},immediate:!0},font:{handler(t){if(!this.canvas)return;const e=this.canvas.getActiveObject();e?(e.fontFamily=t,this.canvas.renderAll(),this.saveDrawingData(),this.renderPreview()):this.$message.error("Please select a font")}}}},Za=Ja,qa=(i("24f0"),Object(d["a"])(Za,Wa,Qa,!1,null,null,null)),Ga=qa.exports,Ka=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.show?a("div",{staticClass:"input-item"},[t.data.name?a("div",{staticClass:"input-item-title"},[t._v(t._s(t.data.name))]):t._e(),t.data.type===t.EInputType.Normal?a("div",{staticClass:"input-addon",style:{cursor:t.isOpen?"default":"not-allowed",backgroundColor:t.isOpen?"#fff":"#f6f6f6",color:t.isOpen?"#3f3f3f":"#808080b3",border:t.isOpen?"none":"1px solid #e6e6e6",borderRadius:"6px"}},[t.isOpen?a("input",{directives:[{name:"model",rawName:"v-model",value:t.inputVal,expression:"inputVal"}],ref:"valueInput",staticClass:"input",domProps:{value:t.inputVal},on:{input:function(e){e.target.composing||(t.inputVal=e.target.value)}}}):t._e(),a("img",{staticClass:"icon-pre",style:{color:t.isOpen?"#3f3f3f":"#808080b3"},attrs:{src:t.data.prependIcon}}),a("img",{staticClass:"icon-after",style:{color:t.isOpen?"#3f3f3f":"#808080b3"},attrs:{src:i("38ef")},on:{mousedown:t.handleMouseDown}})]):t._e(),t.data.type===t.EInputType.Color?a("div",{staticClass:"input-color",on:{click:t.showColor}},[a("div",{staticClass:"color-item"},[a("el-color-picker",{ref:"dropdown",attrs:{"show-alpha":""},model:{value:t.inputVal,callback:function(e){t.inputVal=e},expression:"inputVal"}})],1),a("div",{staticClass:"color-title"},[t._v("Color")]),a("img",{staticClass:"icon-pull",style:{color:t.isOpen?"#3f3f3f":"#808080b3"},attrs:{src:t.data.endIcon}})]):t._e()]):t._e()},tn=[],en={name:"InputItem",props:{data:{type:Object,default:null},isOpen:{type:Boolean}},data(){return{clickHeight:0,EInputType:{Normal:0,Color:1},show:!1}},computed:{...Object(y["b"])("aopCustomize",["currentSelectedObj"]),...Object(y["c"])("aopCustomize",["canvas","selectObjId"]),inputVal:{get(){const t=this.data.unit,e=this.data.key,i=this.data.step,a=this.data.isStoreData,n=i||1,s=t||"";return a?(this.$store.state.aopCustomize[e]/n).toFixed(0)+s:"Color"===this.data.name?this.currentSelectedObj?this.currentSelectedObj[e]:"":this.currentSelectedObj?(this.currentSelectedObj[e]/n).toFixed(0)+s:""},set(t){this.$forceUpdate();const e=this.data.fn,i=this.data.min,a=this.data.max,n=this.data.step,s=this.data.type;if(s===this.EInputType.Color)e(t);else{const s=n||1,o=Number(t.replace(/[^-0-9.]/g,""))*s;e(o>a?a:o<=i?i:o)}}}},watch:{selectObjId:{handler(){if(!this.selectObjId||-1===this.selectObjId)return void(this.show=!1);const t=this.canvas;if(this.show=!1,!t)return;const e=t.getActiveObject();if(!e)return;const i=this.data.allowType;i&&(this.show=i.includes(e.type),"scale"===this.data.key&&"image"===e.type&&(this.data.name="Scale"))},immediate:!0}},methods:{showColor(){this.$refs.dropdown.showPicker=!this.$refs.dropdown.showPicker},handleMouseDown:function(t){this.clickHeight=t.y,window.addEventListener("mousemove",this.mouseMoveFn),window.addEventListener("mouseup",this.handleMouseUp)},mouseMoveFn(t){const e=Number(this.inputVal.replace(/[^-\d.]/g,"")),i=t.y,a=this.clickHeight-i,n=a/2;this.inputVal=""+(Number(e)+n)},handleMouseUp(){window.removeEventListener("mousemove",this.mouseMoveFn)}}},an=en,nn=(i("7e33"),i("6c04"),Object(d["a"])(an,Ka,tn,!1,null,"19374b40",null)),sn=nn.exports,on=i("7a94"),rn={name:"Settings",components:{OperationIcon:Ua,ChangeFontFamily:Ga,InputItem:sn},data(){return{settingTitle:"",showSetting:!1,settings:[{name:"align top",url:i("18e4"),fn:this.alignTop()},{name:"align vertical",url:i("ad93"),fn:this.alignVertical()},{name:"align bottom",url:i("6cd5"),fn:this.alignBottom()},{name:"align left",url:i("7af5"),fn:this.alignLeft()},{name:"align horizontal",url:i("c3a6"),fn:this.alignHorizontal()},{name:"align right",url:i("bbb7"),fn:this.alignRight()},{name:"reflect horizontal",url:i("5e02"),fn:this.reflectHorizontal()},{name:"reflect vertical",url:i("243b"),fn:this.reflectVertical()},{name:"copy",url:i("fa98"),fn:this.copy()},{name:"pattern",url:i("ae50"),fn:this.setPattern(),storeKey:"isShowPatternArea"},{name:"set max",url:i("47e1"),fn:this.setMax()}],inputData:[{name:"Size",key:"scaleX",prependIcon:i("0725"),endIcon:i("38ef"),type:Ma.Normal,allowType:[$a.Image,$a.Text],fn:this.setSize(),step:.01,max:10,min:.1,unit:"%"},{name:"Letter Spacing",key:"charSpacing",prependIcon:i("7e96"),endIcon:i("38ef"),type:Ma.Normal,allowType:[$a.Text],fn:this.setSpacing(),step:1,max:300,min:0,unit:"%"},{name:"Color",key:"fill",endIcon:i("9a6e"),type:Ma.Color,allowType:[$a.Text],fn:this.setColor()},{name:"Opacity",key:"opacity",prependIcon:i("fae5"),endIcon:i("38ef"),type:Ma.Normal,allowType:[$a.Image,$a.Text],fn:this.setOpacity(),step:.01,max:1,min:.01,unit:"%"},{name:"Rotate",key:"angle",prependIcon:i("0b20"),endIcon:i("38ef"),type:Ma.Normal,allowType:[$a.Image,$a.Text],fn:this.setRotate(),step:1,max:360,min:-360,unit:"°"}]}},computed:{...Object(y["c"])("aopCustomize",["renderPreview","isShowPatternArea","canvas","saveDrawingData","increaseId","addHistory","selectObjId"])},watch:{selectObjId:{handler(){if(!this.selectObjId||-1===this.selectObjId)return void(this.settingTitle="");const t=this.canvas;if(!t)return void(this.settingTitle="");const e=t.getActiveObject();this.settingTitle=e?"text"===e.type?"Text settings":"Image settings":""}},canvas:{handler(){const t=this.canvas;if(!t)return void(this.showSetting=!1);const e=t.getActiveObject();this.showSetting=!!e},deep:!0},isShowPatternArea:{handler(t){t?setTimeout(()=>{document.addEventListener("click",this.handleClickOutside)},500):document.removeEventListener("click",this.handleClickOutside)},immediate:!0}},methods:{handleClickOutside(t){const e=document.getElementById("patternArea");e&&!e.contains(t.target)&&this.$store.commit("aopCustomize/setIsShowPatternArea",!1)},getActiveObj(){const t=this.canvas,e=t.getActiveObject();return e||(this.$message.error("Please select a font or image"),null)},alignTop(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;let i;i=e.scaleY?e.height*e.scaleY/2:e.height/2,e.set({top:i}),t.renderAll(),this.addHistory(),this.renderPreview()}},alignVertical(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;const i=t.height/2;e.set({top:i}),t.renderAll(),this.renderPreview()}},alignBottom(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;let i;i=e.scaleY?t.height-e.height*e.scaleY/2:t.height-e.height/2,e.set({top:i}),t.renderAll(),this.addHistory(),this.renderPreview()}},alignLeft(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;let i;i=e.scaleX?e.width*e.scaleX/2:e.width/2,e.set({left:i}),t.renderAll(),this.addHistory(),this.renderPreview()}},alignHorizontal(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;const i=t.width/2;e.set({left:i}),t.renderAll(),this.addHistory(),this.renderPreview()}},alignRight(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;let i;i=e.scaleX?t.width-e.width*e.scaleX/2:t.width-e.width/2,e.set({left:i}),t.renderAll(),this.addHistory(),this.renderPreview()}},reflectHorizontal(){return()=>{const t=this.canvas,e=this.getActiveObj();e&&(e.set({flipX:!e.flipX}),t.renderAll(),this.addHistory(),this.renderPreview())}},reflectVertical(){return()=>{const t=this.canvas,e=this.getActiveObj();e&&(e.set({flipY:!e.flipY}),t.renderAll(),this.addHistory(),this.renderPreview())}},copy(){return()=>{const t=this.canvas,e=this.getActiveObj(),i=(new Date).getTime();on["fabric"].util.enlivenObjects([e.toObject()],(function(a){const n=a[0];n.set({id:i,left:e.left,top:e.top}),t.add(n),t.setActiveObject(n),t.renderAll()})),this.$store.commit("aopCustomize/setIncreaseId",i),this.renderPreview()}},setPattern(){return()=>{const t=this.getActiveObj();if(!t)return;const e=this.isShowPatternArea;this.$store.commit("aopCustomize/setIsShowPatternArea",!e)}},setMax(){return()=>{const t=this.canvas,e=this.getActiveObj();if(!e)return;const i=t.width/e.width,a=t.height/e.height;e.set({scaleX:i,scaleY:a,left:t.width/2,top:t.width/2}),t.renderAll(),this.renderPreview()}},setSize(){return t=>{const e=this.canvas,i=this.getActiveObj();i.set({scaleX:Number(t),scaleY:Number(t)}),e.renderAll(),this.saveDrawingData(),this.renderPreview()}},setSpacing(){return t=>{const e=this.canvas,i=this.getActiveObj();i.set({charSpacing:t}),e.renderAll(),this.saveDrawingData(),this.renderPreview()}},setColor(){return t=>{const e=this.canvas,i=this.getActiveObj();i.set({fill:t}),e.renderAll(),this.saveDrawingData(),this.renderPreview()}},setOpacity(){return t=>{const e=this.canvas,i=this.getActiveObj();i.set({opacity:t}),e.renderAll(),this.saveDrawingData(),this.renderPreview()}},setRotate(){return t=>{const e=this.canvas,i=this.getActiveObj();i.set({angle:t}),e.renderAll(),this.saveDrawingData(),this.renderPreview()}}}},cn=rn,ln=(i("188e"),Object(d["a"])(cn,Fa,Ba,!1,null,"6b277327",null)),dn=ln.exports,un={name:"OperationArea",components:{AddArea:Bt,Layers:La,Settings:dn},props:{}},hn=un,mn=(i("1e67"),Object(d["a"])(hn,_,D,!1,null,"311bd168",null)),pn=mn.exports,fn=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"design-area"},[i("div",{staticClass:"main-design"},[i("Thumbnail"),i("CanvasView")],1)])},gn=[],vn=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"thumbnail"},t._l(t.getKnifeList.knifeInfoList,(function(e,a){return i("div",{key:a,staticClass:"thumbnail-item",on:{click:function(){return t.clickFn(a)}}},[i("img",{staticClass:"img",style:{borderColor:t.selectPartIdx===a?"#000000":"transparent"},attrs:{src:e.tipImageUrl}}),i("div",{staticClass:"name"},[t._v(t._s(e.name))]),e.status?[i("div",{staticClass:"status",style:{backgroundColor:1===e.status?"#3CCA1D":2===e.status?"#F1D51E":"#F01616"}})]:t._e()],2)})),0)},bn=[];async function wn(t){if(!t)return;const e=t.getObjects();e.forEach(t=>{-999===t.id&&(t.visible=!1)});const i=document.createElement("canvas"),a=1*t.width,n=1*t.height;i.width=a,i.height=n;const s=i.getContext("2d");return s.drawImage(t.toCanvasElement(),0,0,a,n),new Promise(a=>{i.toBlob(i=>{const n=URL.createObjectURL(i);e.forEach(t=>{-999===t.id&&(t.visible=!0)}),t.renderAll(),a(n)})})}var yn={name:"Thumbnail",data(){return{}},computed:{...Object(y["b"])("aopCustomize",["getKnifeList","getSelectPartData"]),...Object(y["c"])("aopCustomize",["selectPartIdx","canvas"])},methods:{async clickFn(t){const e=await wn(this.canvas),i=this.getSelectPartData,a={partName:i.name,url:e};this.$store.commit("aopCustomize/setPartDrawingData",{partId:i.id,data:a}),this.$store.commit("aopCustomize/setSelectPartIdx",t),this.$store.commit("aopCustomize/clearHistory")}}},Cn=yn,kn=(i("02d9"),Object(d["a"])(Cn,vn,bn,!1,null,"bbe4269c",null)),In=kn.exports,xn=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},An=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"canvas-view"},[i("div",{attrs:{id:"canvasBox"}},[i("canvas",{attrs:{id:"domCanvas"}})])])}],On=i("e47b"),Sn=i.n(On),Pn=i("54a5"),_n=i.n(Pn),Dn=i("7896"),jn=i.n(Dn),En=i("371b"),Tn=i.n(En),Nn=i("b304");function zn(){Fn(),Rn()}function Ln(t){return{id:t.id,scaleX:Number(t.scaleX.toFixed(6)),scaleY:Number(t.scaleY.toFixed(6)),imgSrc:t.imgSrc,selectable:t.selectable,name:t.name,evented:t.evented,isPattern:t.isPattern,patternParentId:t.patternParentId,x:t.x,y:t.y}}function Fn(){on["fabric"].Object.prototype.centeredRotation=!0,on["fabric"].Object.prototype.centeredScaling=!1,on["fabric"].Object.prototype.transparentCorners=!0,on["fabric"].Object.prototype._controlsVisibility={bl:!1,br:!1,mb:!1,ml:!1,mr:!1,mt:!1,mtr:!1,tl:!1,tr:!1},on["fabric"].Object.prototype.cornerSize=25,on["fabric"].Object.prototype.cornerStyle="circle",on["fabric"].Object.prototype.cornerStrokeColor="#00b2a5",on["fabric"].Object.prototype.borderColor="#00b2a5",on["fabric"].Object.prototype.padding=0,on["fabric"].Image.prototype.toObject=function(t){return function(){return on["fabric"].util.object.extend(t.call(this),Ln(this))}}(on["fabric"].Image.prototype.toObject),on["fabric"].Text.prototype.toObject=function(t){return function(){return on["fabric"].util.object.extend(t.call(this),Ln(this))}}(on["fabric"].Text.prototype.toObject)}at["default"].use(y["a"]);const Bn=document.createElement("img");Bn.src=Sn.a;const Mn=document.createElement("img");Mn.src=_n.a;const $n=document.createElement("img");$n.src=jn.a;const Hn=document.createElement("img");function Rn(){on["fabric"].Object.prototype.controls.deleteControl=new on["fabric"].Control({x:-.5,y:-.5,offsetY:0,cursorStyle:"pointer",mouseUpHandler:Vn,render:Yn(Bn)}),on["fabric"].Object.prototype.controls.duplicateControl=new on["fabric"].Control({x:-.5,y:.5,offsetY:0,cursorStyle:"copy",mouseUpHandler:Xn,render:Yn(Hn)}),on["fabric"].Object.prototype.controls.rotateControl=on["fabric"].Object.prototype.controls.mtr,on["fabric"].Object.prototype.controls.rotateControl.render=Yn(Mn),on["fabric"].Object.prototype.controls.rotateControl.x=.5,on["fabric"].Object.prototype.controls.rotateControl.y=-.5,on["fabric"].Object.prototype.controls.rotateControl.offsetY=0,on["fabric"].Object.prototype.controls.scaleControl=on["fabric"].Object.prototype.controls.br,on["fabric"].Object.prototype.controls.scaleControl.render=Yn($n)}function Xn(t,e){const i=e.target,a=i.canvas,n=(new Date).getTime();return on["fabric"].util.enlivenObjects([i.toObject()],(function(t){const e=t[0];e.set({id:n,left:i.left,top:i.top}),a.add(e),a.setActiveObject(e),a.renderAll()})),Nn["b"].mutations.setIncreaseId(Nn["b"].state(),n),a.fire("object:duplicated",{}),!0}function Vn(t,e){const i=e.target,a=i.canvas;a.discardActiveObject(i),a.remove(i);const n=a.getObjects(),s=n.filter(t=>t.isPattern);return s.forEach(t=>{a.remove(t)}),a.renderAll(),a.fire("object:deleteObject",{}),!0}function Yn(t){return function(e,i,a,n,s){const o=24;e.save(),e.translate(i,a),e.rotate(on["fabric"].util.degreesToRadians(s.angle||0)),e.drawImage(t,-o/2,-o/2,o,o),e.restore()}}Hn.src=Tn.a;var Un=zn;const Wn={None:0,HalfDrop:1,HorizontalBrick:2,VerticalBrick:3,HalfDropMirror:4,Horizontal:5,Vertical:6},Qn=(t,e,i)=>{const a=Nn["b"].state().patternType,n=Nn["b"].state().patternPadding;let s=0,o=0;switch(a){case Wn.HalfDrop:s=1,o=1;break;case Wn.HorizontalBrick:e+=.8*i,o=1;break;case Wn.VerticalBrick:i+=.8*e,s=1;break;case Wn.HalfDropMirror:s=1,o=1;break}const r=Math.cos(Math.PI/180*t.angle),c=Math.sin(Math.PI/180*t.angle),l=e*t.width*t.scaleX,d=i*t.height*t.scaleY,u=t.left+l*r-s*d*c+n/2*e,h=t.top+d*r+o*l*c+n/2*i;return{left:u,top:h}};function Jn(t,e,i){const a=t.canvas;for(let n=-e;n<=e;n++)for(let s=-e;s<=e;s++){if(0===n&&0===s)continue;if(i===Wn.Horizontal&&0!==n)continue;if(i===Wn.Vertical&&0!==s)continue;const{left:e,top:o}=Qn(t,n,s);let r;"text"===t.type?r=new on["fabric"].Text(t.text,{fontSize:t.fontSize,fontFamily:t.fontFamily,fill:t.fill,angle:t.angle,scaleX:t.scaleX,scaleY:t.scaleY,originX:"center",originY:"center",left:e,top:o,selectable:!1}):(r=on["fabric"].util.object.clone(t),r.set({selectable:!1,left:e,top:o})),i===Wn.HalfDropMirror&&(0===n?r.flipY=!0:(0===s||(r.flipY=!0),r.flipX=!0)),r.x=n,r.y=s,r.isPattern=!0,r.patternParentId=t.id,a.add(r),a.sendToBack(r),a.renderAll()}}var Zn=i("27d6"),qn=i.n(Zn),Gn={name:"CanvasView",data(){return{fImg:"",fBgImg:"",fText:"",currentPartIdx:0,domCanvas:null,canvas:{}}},computed:{...Object(y["c"])("aopCustomize",["selectPartIdx","selectObjId","increaseId","fontList","partDrawingData","renderPreview","renderCanvas","historyIdx","historyList","patternType"]),...Object(y["b"])("aopCustomize",["getSelectPartData","canvasSize","getPartList"]),idIncrease:{get(){return this.increaseId},set(t){this.$store.commit("aopCustomize/setIncreaseId",t)}}},watch:{selectPartData:()=>{!(void 0).fBgImg&&(void 0).selectPartData&&(void 0).addMaskImage()},selectPartIdx:{handler(){this.saveDrawingData(),this.renderPreview(),this.renderCanvasFn()}},canvas:{handler(t){this.domCanvas=t},deep:!0},fontList:{handler(){this.loadFont()}}},mounted(){Un(),this.initCanvas()},methods:{async saveDrawingData(){const t=this.getPartList[this.currentPartIdx],e=t.id,i=this.canvas.toJSON(),a=this.canvas.getObjects();a.forEach(t=>{-999===t.id&&(t.visible=!1)});const n=this.canvas.toSVG();a.forEach(t=>{-999===t.id&&(t.visible=!0)}),i.svgObj=n,this.$store.commit("aopCustomize/setPartDrawingData",{partId:e,data:i}),this.currentPartIdx=this.selectPartIdx,this.$store.commit("aopCustomize/setSelectPartIdx",null),this.$store.commit("aopCustomize/setSelectPartIdx",this.currentPartIdx)},async renderCanvasFn(){return new Promise(t=>{if(!this.getSelectPartData.id)return;const e=this.partDrawingData[this.getSelectPartData.id];if(e){let i="";e.objects.forEach(t=>{"color"===t.type&&(i=t.content,e.objects.remove(t))}),this.canvas.loadFromJSON(e,()=>{const e=[];this.canvas.forEachObject(t=>{e.push(t)}),this.canvas.clear(),e.forEach(t=>{this.canvas.add(t)}),this.canvas.backgroundColor=i,t(!0)})}else this.canvas.clear(),this.addMaskImage(),this.currentPartIdx=this.selectPartIdx,t(!0)})},async addImg(t,e){const i=new Image;i.setAttribute("crossOrigin","anonymous"),i.src=t;const a=this.canvas.width;return new Promise(n=>{i.onload=()=>{const s=a/i.width*.8;this.fImg=new on["fabric"].Image(i,{originX:"center",originY:"center",scaleX:s,scaleY:s});const o=a/2,r=a/2;this.idIncrease=(new Date).getTime(),this.fImg.set({left:o,top:r,name:e,id:this.idIncrease,imgSrc:t}),this.canvas&&this.canvas.add(this.fImg),this.canvas.setActiveObject(this.fImg);const c=this.canvas.getObjects(),l=c.find(t=>!t.evented);this.canvas.bringToFront(l),this.canvas.renderAll(),this.saveDrawingData(),this.renderPreview(),this.addHistory(),n(!0)}})},addText(t){const e=this.fontList&&this.fontList.length>0?this.fontList[0].uid:"";this.fText=new on["fabric"].Text(t,{fill:"#165ef0",selectable:!0,fontSize:100,originX:"center",originY:"center",fontFamily:e});const i=this.canvas.width,a=i/2,n=i/2;this.idIncrease=(new Date).getTime(),this.fText.set({left:a,top:n,id:this.idIncrease}),this.canvas.add(this.fText),this.canvas.setActiveObject(this.fText);const s=this.canvas.getObjects(),o=s.find(t=>!t.evented);this.canvas.bringToFront(o),this.canvas.renderAll(),this.saveDrawingData(),this.renderPreview(),this.addHistory()},addBackgroundColor(t){const e=this.canvas;e&&(e.backgroundColor=t,e.renderAll(),this.$store.commit("aopCustomize/setBackgroundColor",t),this.saveDrawingData(),this.renderPreview())},async addMaskImage(){if(!this.canvas||!this.getSelectPartData)return;const t=new Image;t.setAttribute("crossOrigin","anonymous"),t.src=this.getSelectPartData.knifePlateImageUrl;const e=this.canvas.height;return new Promise(i=>{t.onload=()=>{const a=e/t.width;this.fBgImg=new on["fabric"].Image(t,{scaleX:a,scaleY:a,z:999,evented:!1}),this.fBgImg.id=-999,this.canvas&&this.canvas.add(this.fBgImg),this.canvas.bringToFront(this.fBgImg),i(!0)}})},loadFont(){const t=[];this.fontList&&this.fontList.forEach(e=>t.push(e.uid)),qn.a.load({custom:t})},setSelectedObjId:function(){var t;const e=null===(t=this.canvas)||void 0===t?void 0:t.getActiveObject();e&&this.$store.commit("aopCustomize/setSelectObjId",e.id)},addHistory:function(){const t=this.historyIdx,e=this.canvas.toJSON(),i=this.historyList.length;te.isPattern&&e.patternParentId===t.id);i.forEach(e=>{const{x:i,y:a}=e,{left:n,top:s}=Qn(t,i,a);e.set({left:n,top:s})})},patternScaling:function(){const t=this.canvas.getActiveObject(),e=this.canvas.getObjects(),i=e.filter(e=>e.isPattern&&e.patternParentId===t.id);i.forEach(e=>{const{x:i,y:a}=e,{left:n,top:s}=Qn(t,i,a);e.set({scaleX:t.scaleX,scaleY:t.scaleY,left:n,top:s})})},patternRotating:function(){const t=this.canvas.getActiveObject(),e=this.canvas.getObjects(),i=e.filter(e=>e.isPattern&&e.patternParentId===t.id);i.forEach(e=>{const{x:i,y:a}=e,{left:n,top:s}=Qn(t,i,a);e.set({angle:t.angle,left:n,top:s})})},patternModified:function(){const t=this.canvas.getActiveObject(),e=this.canvas.getObjects(),i=e.filter(e=>e.isPattern&&e.patternParentId===t.id);if(0===i.length)return;i.forEach(t=>{this.canvas.remove(t)});const a=Math.ceil(this.canvas.width/(t.width*t.scaleX)),n=Math.ceil(this.canvas.height/(t.height*t.scaleY)),s=Math.ceil((a>n?a:n)/2),o=s<6?s:6;Jn(t,o,this.patternType)},canvasEvents:function(){this.canvas&&(this.canvas.on("object:modified",()=>{this.setSelectedObjId(),this.patternModified(),this.addHistory(),this.saveDrawingData(),this.renderPreview()}),this.canvas.on("selection:updated",()=>{this.setSelectedObjId()}),this.canvas.on("object:added",t=>{!t.target.isPattern&&t.target.evented&&(this.saveDrawingData(),this.renderPreview())}),this.canvas.on("object:moving:end",()=>{this.canvas.getActiveObject().isMoving||(this.patternMoving(),this.renderPreview())}),this.canvas.on("object:rotating:end",()=>{this.patternRotating(),this.saveDrawingData(),this.renderPreview()}),this.canvas.on("object:scaling:end",()=>{this.patternScaling(),this.saveDrawingData(),this.renderPreview()}),this.canvas.on("mouse:down",()=>{const t=this.canvas.getActiveObject();this.$store.commit("aopCustomize/setSelectObjId",t?t.id:-1),this.$store.commit("aopCustomize/setIsShowPatternArea",!1)}),this.canvas.on("object:deleteObject",()=>{this.saveDrawingData()}),this.canvas.on("object:duplicated",()=>{this.saveDrawingData(),this.addHistory()}))},async initCanvas(){const t=document.getElementById("domCanvas");this.canvas=new on["fabric"].Canvas(t,{width:this.canvasSize,height:this.canvasSize,selection:!1,preserveObjectStacking:!0}),this.canvasEvents(),await this.addMaskImage(),await this.$store.commit("aopCustomize/setAddTextFn",this.addText),await this.$store.commit("aopCustomize/setAddImgFn",this.addImg),await this.$store.commit("aopCustomize/setAddMasImageFn",this.addMaskImage),await this.$store.commit("aopCustomize/setAddBackgroundColorFn",this.addBackgroundColor),await this.$store.commit("aopCustomize/setRenderCanvas",this.renderCanvasFn),await this.$store.commit("aopCustomize/setSaveDrawingData",this.saveDrawingData),await this.$store.commit("aopCustomize/setAddHistory",this.addHistory),await this.$store.commit("aopCustomize/setCanvas",this.canvas),await this.$store.commit("aopCustomize/setOriginalCanvasState"),this.addHistory(),setTimeout(()=>{this.renderPreview()},100)}}},Kn=Gn,ts=(i("b898"),Object(d["a"])(Kn,xn,An,!1,null,"cf98b8c2",null)),es=ts.exports,is={name:"DesignArea",components:{Thumbnail:In,CanvasView:es}},as=is,ns=(i("53dd"),Object(d["a"])(as,fn,gn,!1,null,"d5a955d6",null)),ss=ns.exports,os=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"show-preview-area"},[i("PreviewCanvas"),i("Thumbnails")],1)},rs=[],cs=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"preview-canvas"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.showProgress,expression:"showProgress"}],staticClass:"progress-box"},[t._v(" ")]),a("el-progress",{directives:[{name:"show",rawName:"v-show",value:t.showProgress,expression:"showProgress"}],staticClass:"progress",attrs:{color:"#409EFF",percentage:t.progressPercentage}}),a("div",{directives:[{name:"show",rawName:"v-show",value:t.previewImageUrl,expression:"previewImageUrl"}],staticClass:"scale-box",on:{click:function(e){t.showViewer=!0}}},[a("div",{staticClass:"scale"},[a("img",{staticClass:"icon",attrs:{alt:"scale-icon",src:i("cf3c")}})])]),a("img",{directives:[{name:"show",rawName:"v-show",value:t.previewImageUrl,expression:"previewImageUrl"}],staticClass:"preview-image",attrs:{alt:"previewImage",src:t.previewImageUrl},on:{click:function(e){t.showViewer=!0}}}),t.showViewer?a("image-viewer",{attrs:{"initial-index":0,"on-close":t.closeViewer,"url-list":[t.previewImageUrl]}}):t._e()],1)])},ls=[],ds={name:"PreviewCanvas",components:{ImageViewer:kt},data(){return{previewCanvas:null,sceneList:[],previewImage:"",showViewer:!1,progressPercentage:0,loading:!1,showProgress:!1}},computed:{...Object(y["c"])("aopCustomize",["canvas","knifeIdx","previewImageList"]),...Object(y["b"])("aopCustomize",["getKnifeList","previewImageUrl"])},mounted(){const t=this.debounce(this.renderPreviewFn,1e3);this.$store.commit("aopCustomize/setRenderPreview",t)},methods:{closeViewer(){this.showViewer=!1},debounce(t,e){let i;return function(){const a=this,n=arguments;clearTimeout(i),i=setTimeout(()=>{t.apply(a,n)},e)}},renderPreviewFn:async function(){try{const t=this.canvas,e=this.getKnifeList;if(!t||!e)return;const i=e.id;if(!i)return;const a=t.toSVG(),n=await v({setId:i,svg:a});if(200!==n.code)return;this.$store.commit("aopCustomize/setPreviewImageList",n.data)}catch(t){this.$message.error(t.message)}finally{const t=this.previewImageUrl,e=new Image;e.src=t,this.processProgress(99),e.onload=()=>{this.progressPercentage=100,setTimeout(()=>{this.showProgress=!1},500)}}},async processProgress(t){this.showProgress=!0;const e=5e3,i=e/50;this.progressPercentage=0;while(this.progressPercentagesetTimeout(t,i))}}},us=ds,hs=(i("d166"),Object(d["a"])(us,cs,ls,!1,null,"050ffa70",null)),ms=hs.exports,ps=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.previewImageList?i("div",{staticClass:"thumbnails default-scrollbar"},t._l(t.previewImageList,(function(e,a){return i("img",{key:a,staticClass:"thumbnail-img",attrs:{src:e},on:{click:function(e){return t.clickPreviewImage(a)}}})})),0):t._e()},fs=[],gs={name:"Thumbnails",data(){return{modules:[]}},computed:{...Object(y["b"])("aopCustomize",["getKnifeList"]),...Object(y["c"])("aopCustomize",["previewImageList"])},methods:{clickPreviewImage(t){this.$store.commit("aopCustomize/setSelectedPreviewImageIdx",t)}}},vs=gs,bs=(i("e103"),Object(d["a"])(vs,ps,fs,!1,null,"10f77a95",null)),ws=bs.exports,ys={name:"ShowPreviewArea",components:{PreviewCanvas:ms,Thumbnails:ws},computed:{...Object(y["c"])("aopCustomize",[])}},Cs=ys,ks=(i("d51c"),Object(d["a"])(Cs,os,rs,!1,null,"6eeb59b6",null)),Is=ks.exports,xs=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"preview-header"},[a("History"),a("BackgroundColor"),a("Clear"),a("ElPopover",{attrs:{placement:"bottom",trigger:"click"}},[a("div",{staticClass:"tool-tip-box"},[a("div",{staticClass:"tool-tip-title"},[t._v(" Double check the designed exhaust area ")]),a("div",{staticClass:"tool-tip-content"},[t._v(" Please make sure your design covers the entire print area. This includes the bleeding area (marked in gray). ")]),a("div",{staticClass:"tool-tip-content"},[t._v(" Otherwise, the sides of the product may be left empty. Important design elements should be kept within the safe zone (marked with a dotted line) as they may be cut off if left outside. ")])]),a("img",{staticClass:"info-icon",attrs:{slot:"reference",alt:"information-icon",src:i("9a7f")},slot:"reference"})])],1)},As=[],Os=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"history"},[a("img",{staticClass:"icon",style:{color:t.canBack?"#000000":"rgb(159, 164, 165)",cursor:t.canBack?"pointer":"not-allowed"},attrs:{alt:"back-icon",src:i("55b5")},on:{click:t.backFn}}),a("img",{staticClass:"icon",style:{color:t.canNext?"#000000":"rgb(159, 164, 165)",cursor:t.canNext?"pointer":"not-allowed"},attrs:{alt:"next-icon",src:i("341b")},on:{click:t.nextFn}})])},Ss=[],Ps={name:"History",data(){return{}},computed:{...Object(y["c"])("aopCustomize",["historyList","historyIdx","canvas"]),canBack(){return 0!==this.historyList.length&&this.historyIdx>0},canNext(){return 0!==this.historyList.length&&this.historyIdx{const t=[];i.forEachObject(e=>{t.push(e)}),i.clear(),t.forEach(t=>{i.add(t)})})},backFn(){if(0===this.historyIdx)return;const t=this.historyIdx-1;this.$store.commit("aopCustomize/setHistoryIdx",t),this.renderHistory(t)},nextFn(){const t=this.historyIdx+1;this.$store.commit("aopCustomize/setHistoryIdx",t),this.renderHistory(t)}}},_s=Ps,Ds=(i("555a"),Object(d["a"])(_s,Os,Ss,!1,null,"ab5bae0e",null)),js=Ds.exports,Es=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"background-color",on:{click:t.showColor}},[a("div",{staticClass:"color-item"},[a("el-color-picker",{ref:"headerDropdown",attrs:{"show-alpha":""},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1),a("div",{staticClass:"color-title"},[t._v("Background")]),a("img",{staticClass:"icon-pull",attrs:{src:i("9249")}})])},Ts=[],Ns={name:"BackgroundColor",data(){return{colorObj:{},show:!1}},computed:{...Object(y["c"])("aopCustomize",["canvas","addBackgroundColor","backgroundColor"]),val:{get(){return this.backgroundColor},set(t){this.$store.commit("aopCustomize/setBackgroundColor",t)}}},watch:{val:{handler(t){this.addBackgroundColor(t)},immediate:!0}},methods:{showColor(){this.$refs.headerDropdown.showPicker=!this.show,this.show=this.$refs.headerDropdown.showPicker}}},zs=Ns,Ls=(i("5ccb"),i("c742"),Object(d["a"])(zs,Es,Ts,!1,null,"17926953",null)),Fs=Ls.exports,Bs=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"clear",on:{click:t.clearFn}},[a("img",{staticClass:"icon",attrs:{alt:"clean-icon",src:i("bffd")}})])},Ms=[],$s={name:"Clear",data(){return{}},computed:{...Object(y["c"])("aopCustomize",["canvas","originalCanvasState","renderPreview","selectPartIdx","restoreCanvasState","handelSizeChange","saveDrawingData"])},methods:{clearFn(){const t=this.canvas;t.backgroundColor="",this.$store.commit("aopCustomize/setBackgroundColor","");const e=t.getObjects();e.forEach(e=>{e.evented&&t.remove(e)}),t.renderAll(),this.$store.commit("aopCustomize/clearHistory"),this.renderPreview(),this.$store.commit("aopCustomize/setHistoryIdx",0);const i=this.selectPartIdx;this.$store.commit("aopCustomize/setSelectPartIdx",null),this.$store.commit("aopCustomize/setSelectPartIdx",i),this.saveDrawingData()}}},Hs=$s,Rs=(i("27aa"),Object(d["a"])(Hs,Bs,Ms,!1,null,"2a89fe88",null)),Xs=Rs.exports,Vs={name:"PreviewHeader",components:{History:js,BackgroundColor:Fs,Clear:Xs}},Ys=Vs,Us=(i("c708"),Object(d["a"])(Ys,xs,As,!1,null,"a29adf14",null)),Ws=Us.exports,Qs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.isShowPatternArea?i("div",{staticClass:"pattern-area",attrs:{id:"patternArea"}},[t._m(0),i("div",{staticClass:"pattern-list"},t._l(t.patternDataList,(function(t){return i("PatternItem",{key:t.name,attrs:{data:t}})})),1)]):t._e()},Js=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pattern-header"},[i("span",{staticClass:"title"},[t._v("Pattern maker")])])}],Zs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pattern-item"},[i("div",{staticClass:"item-title"},[t._v(t._s(t.data.name))]),i("div",{staticClass:"item-body"},[i("img",{staticClass:"item-body-icon",attrs:{alt:"icon",src:t.data.icon}}),i("div",{staticClass:"item-body-input"},[i("InputItem",{attrs:{data:t.inputData,"is-open":t.isOpen}})],1),i("div",{staticClass:"switch-area"},[i("el-switch",{attrs:{"active-color":"#13ce66"},model:{value:t.isOpen,callback:function(e){t.isOpen=e},expression:"isOpen"}})],1)])])},qs=[],Gs={name:"PatternItem",components:{InputItem:sn},props:{data:{type:Object,default:null}},data(){return{inputData:{key:"patternPadding",isStoreData:!0,prependIcon:i("87cd"),endIcon:i("38ef"),allowType:[$a.Image,$a.Text],type:Ma.Normal,fn:this.setPadding,step:1,max:100,min:-100}}},computed:{...Object(y["c"])("aopCustomize",["patternType","canvas"]),isOpen:{get(){return this.patternType===this.data.type},set(t){if(t)this.$store.commit("aopCustomize/setPatternType",this.data.type);else{const t=this.canvas;this.$store.commit("aopCustomize/setPatternType",Nn["a"].None);const e=t.getObjects(),i=e.filter(t=>t.isPattern);i.forEach(e=>{t.remove(e)})}}}},watch:{isOpen:{handler(t){t&&this.data.fn()},immediate:!0}},methods:{setPadding(t){this.$store.commit("aopCustomize/setPatternPadding",t),this.data.fn()}}},Ks=Gs,to=(i("be13"),Object(d["a"])(Ks,Zs,qs,!1,null,"ce0cff2a",null)),eo=to.exports,io={name:"PatternArea",components:{PatternItem:eo},data(){return{patternDataList:[{name:"Half Drop Pattern",icon:i("4578"),fn:this.setPattern,type:Nn["a"].HalfDrop},{name:"Horizontal Brick Pattern",icon:i("5b31"),fn:this.setPattern,type:Nn["a"].HorizontalBrick},{name:"Vertical Brick Pattern",icon:i("60c4"),fn:this.setPattern,type:Nn["a"].VerticalBrick},{name:"Halfdrop Mirror Pattern",icon:i("f5ae"),fn:this.setPattern,type:Nn["a"].HalfDropMirror},{name:"Horizontal Pattern",icon:i("309f"),fn:this.setPattern,type:Nn["a"].Horizontal},{name:"Vertical Pattern",icon:i("de74"),fn:this.setPattern,type:Nn["a"].Vertical}]}},computed:{...Object(y["c"])("aopCustomize",["isShowPatternArea","canvas","patternType"])},methods:{setPattern(){const t=this.canvas,e=t.getActiveObject();if(!e)return void this.$message.error("Please select a font or image");const i=t.getObjects(),a=i.filter(t=>t.isPattern);a.forEach(e=>{t.remove(e)}),Jn(e,2,this.patternType)}}},ao=io,no=(i("f10f"),Object(d["a"])(ao,Qs,Js,!1,null,"49b7901d",null)),so=no.exports,oo={name:"PreviewBody",components:{OperationArea:pn,DesignArea:ss,ShowPreviewArea:Is,PreviewHeader:Ws,PatternArea:so}},ro=oo,co=(i("c823"),Object(d["a"])(ro,S,P,!1,null,"14efc421",null)),lo=co.exports,uo=i("01ad"),ho=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"dialog el-dialog__title",attrs:{title:"Print Quality Reminder","append-to-body":!0,visible:t.dialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogVisible=e},close:t.close}},[i("div",{staticClass:"dialog-inner-box"},[i("div",{staticClass:"warning-icon-box"},[i("img",{staticClass:"warning-icon",attrs:{alt:"warning-icon",src:t.warningIcon}})]),i("div",{staticClass:"dialog-text"},[i("div",{staticClass:"main-text"},[t._v("Some Problems Of The Design, Please Check Carefully:")]),i("div",{staticClass:"sub-text"},[t._v(" 1. No design on the "+t._s(t.content)+" ")])])]),i("div",{staticClass:"button-box"},[i("el-button",{staticClass:"cancel-button",on:{click:t.close}},[t._v("Cancel")]),i("el-button",{staticClass:"confirm-button",on:{click:t.submitFn}},[t._v("Confirm")])],1)])},mo=[],po={name:"ReminderProblemDialog",data(){return{dialogVisible:!1,warningIcon:i("f647"),warningIcon2:i("6510")}},props:{value:{type:Boolean,default:!1},content:{type:String,default:""},submitFn:{type:Function,default:()=>{}}},watch:{value:{handler(t){this.dialogVisible=t},immediate:!0},dialogVisible:{handler(t){this.$emit("input",t)},immediate:!0}},methods:{close(){this.dialogVisible=!1}}},fo=po,go=(i("91bb"),Object(d["a"])(fo,ho,mo,!1,null,"3596b0fc",null)),vo=go.exports,bo=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"dialog el-dialog__title",attrs:{title:"Print Quality Reminder","append-to-body":!0,visible:t.dialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogVisible=e},close:t.close}},[i("div",{staticClass:"dialog-inner-box"},[i("div",{staticClass:"left"},[t._v(" If You Ign are Menti ")]),i("div",{staticClass:"right"},[i("div",{staticClass:"dialog-text"},[i("div",{staticClass:"main-text-box"},[i("div",{staticClass:"warning-icon-box"},[i("img",{staticClass:"warning-icon",attrs:{alt:"warning-icon",src:t.warningIcon}})]),i("div",{staticClass:"main-text"},[t._v(" The Following Design Board Has No Elements Uploaded ")])]),i("div",{staticClass:"sub-text"},[t._v(" 1. No design on the "+t._s(t.content)+" ")])])])]),i("div",{staticClass:"button-box"},[i("el-button",{staticClass:"cancel-button",on:{click:t.close}},[t._v("Cancel")]),i("el-button",{staticClass:"confirm-button",on:{click:t.confirmFn}},[t._v("Confirm")])],1)])},wo=[],yo={name:"ReminderNoElementDialog",data(){return{dialogVisible:!1,warningIcon:i("6510")}},props:{value:{type:Boolean,default:!1},content:{type:String,default:""},confirmFn:{type:Function,default:()=>{}}},watch:{value:{handler(t){this.dialogVisible=t},immediate:!0},dialogVisible:{handler(t){this.$emit("input",t)},immediate:!0}},methods:{close(){this.dialogVisible=!1}}},Co=yo,ko=(i("beb4"),Object(d["a"])(Co,bo,wo,!1,null,"f1ec5166",null)),Io=ko.exports,xo={name:"AopPreview",components:{ShippingPage:uo["a"],AopHeader:O,PreviewBody:lo,ReminderProblemDialog:vo,ReminderNoElementDialog:Io},props:{value:{type:Boolean,default:!1}},data(){return{loading:!1,showReminderProblemDialog:!1,showReminderNoElementDialog:!1,isOpen:!1,reminderContent:"",intervalId:null,preRouterPath:""}},watch:{value:{handler(t){this.isOpen=t},immediate:!0},isOpen:{handler(t){this.$emit("input",t)},immediate:!0}},computed:{...Object(y["c"])("aopCustomize",["step","handelSizeChange","restoreCanvasState","partDrawingData","productInfo","selectPartIdx","modeIdx","canvas","fontList","customProductId","notCustomizable","fromRouter"]),...Object(y["b"])("aopCustomize",["getKnifeList","getSelectPartData"])},beforeDestroy(){this.$store.commit("aopCustomize/setJumpToDetailShowAopPreview",!1)},mounted(){this.fetchFontList(),this.$store.commit("aopCustomize/setCheckImageQuality",this.checkImageQualityFn),this.$store.commit("aopCustomize/setClosePage",this.close)},methods:{async fetchFontList(){const t=await Object(f["l"])();200===t.code&&this.$store.commit("aopCustomize/setFontList",t.data.records)},close(){const t=this.notCustomizable||localStorage.getItem("notCustomizable");document.body.style.overflow="auto",1===this.step||t?(this.isOpen=!1,this.$store.commit("aopCustomize/setStep",1),this.$store.commit("aopCustomize/setNotCustomizable",!1),this.$store.commit("aopCustomize/setBlankProductId",null),"ProductsDetail"===this.fromRouter&&(this.$store.commit("aopCustomize/setFromRouter",""),this.$router.go(-1))):this.$store.commit("aopCustomize/setStep",1),this.$store.commit("aopCustomize/setCustomProductId",null)},async next(){this.handelSizeChange(1),this.restoreCanvasState(),this.$store.commit("aopCustomize/setDraggable",!1);const t=this.getNoCustomizationObjectKnifeNameList();t.length>0?(this.getNameList(t),this.showReminderNoElementDialog=!0):this.checkQuality()},getNoCustomizationObjectKnifeNameList(){const t=this.getKnifeList.knifeInfoList;if(!t||0===t.length)return[];const e=[];for(let i=0;i{i0?(this.getNameList(t),this.showReminderProblemDialog=!0):this.submit()},checkImageQualityFn(t,e){if(!e)return 0;const i=e.knifePlateImageTransverseInch,a=e.knifePlateImageDpiGoodMin,n=e.knifePlateImageDpiGoodMax,s=e.knifePlateImageDpiNormalMin,o=e.knifePlateImageDpiNormalMax,r=e.knifePlateImageDpiBadMin,c=e.knifePlateImageDpiBadMax,l=t,d=l.width,u=l.scaleX,h=d/(d*u/d)/i;return h>=a&&h<=n?1:h>=s&&h<=o?2:h>=r&&h<=c?3:0},async submit(){this.loading=!0;const t=this.productInfo,e=this.canvas,i=[],a=[],n=e.getObjects();n&&n.length>0&&n.forEach(t=>{t.evented&&("image"===t.type?i.push(t.imgSrc):"text"===t.type&&a.push(t.fontFamily))});const s={blankProductId:t.id,selectSkuIdList:t.skuList.map(t=>t.id),patternId:t.patternInfos[this.modeIdx].id,knifeSetInfo:{setId:t.patternInfos[this.modeIdx].knifeSetInfoList[this.selectPartIdx].id,userImages:i,canvasWidth:e.width,canvasHeight:e.height,canvasJson:JSON.stringify(e.toJSON()),canvasSvg:e.toSVG(),fontList:a}};try{const t=await b(s);200===t.code?this.intervalId=setInterval(await this.getGenerateStatus(t.data.customProductGenerateId),1e3):(this.$message.error(t.msg),this.close())}catch(o){this.$message.error(o.message)}finally{this.loading=!1}},async getGenerateStatus(t){this.customProductId||clearInterval(this.intervalId);try{const e=await w({customProductGenerateId:t});200===e.code&&2===e.data.status?(this.$store.commit("aopCustomize/setCustomProductId",e.data.customProductId),this.$store.commit("aopCustomize/nextStep")):3===e.data.status&&this.$message.error(e.msg)}catch(e){this.$message.error(e.message)}}}},Ao=xo,Oo=(i("17a0"),Object(d["a"])(Ao,m,p,!1,null,null,null)),So=Oo.exports,Po=i("7f5a"),_o=i("ad7e"),Do={name:"AccessoryDetail",components:{AvailableList:h,SubscriptionAction:Po["a"],AopPreview:So},data(){return{detailInfo:null,isShowAopPreview:!1,showAvailableBox:!1,blankContent:"",desc:"",fullName:"",showPlus:!1,customizable:!1,dropshiped:!0,mediaList:[],saleAttrs:[],saleArrtType:{1:"Common properties",2:"Color",3:"Size",4:"Image"},dataInfo:{level1Fittingses:[],level2Fittingses:[],blankProductInfo:{}},skuList:[],skuForm:{itemList:[{skuId:"",num:1,fittingsLevel:"",blankFittingsId:""}],currentSku:{},currentFittings:{name:"",salePrice:""}},displayMedia:"",query:{id:this.$route.params.id,blankProductInfo:!0,sku:!0,knife:!0,blankFittings:!0,option:!0,shippingRateInfos:!0,showImageList:!0,blankContent:!0,blankDescToC:!0,blankDescToShopify:!0,blankSpecMetric:!0,fontList:!0,printAreaList:!0,fittingsMaskImage:!0,blankPattern:!0},category2:"",stockingStrategy:0,minStockingNum:0,inventoryAllocationStrategy:0,inventoryAllocationNum:0,fittingJewelryNum:0,blankId:null}},beforeRouteEnter(t,e,i){"ProductsDetail"===e.name?sessionStorage.setItem("fromRouter","ProductsDetail"):sessionStorage.removeItem("fromRouter"),i()},computed:{...Object(y["c"])("aopCustomize",["jumpToDetailShowAopPreview","notCustomizable"]),...Object(y["b"])("user",{userBaseInfo:"getUserBaseInfo"}),userFittingLevel(){return this.userBaseInfo.fittingsLevel||0},inventoryAllocation(){const t=this.inventoryAllocationNum;switch(this.inventoryAllocationStrategy){case 1:return"Each item consumes "+t+"PCS";case 3:return"Each order consumes "+t+"PCS";default:return""}},stocking(){return 1===this.stockingStrategy?"No need to stock":"Mini order of "+this.minStockingNum+" PCS"},selectOption(){return t=>{var e,i;return null===t||void 0===t||null===(e=t.values)||void 0===e||null===(i=e.find(e=>e.id===t.check))||void 0===i?void 0:i.value}}},watch:{showAvailableBox:{handler(t){t||this.$refs.AvailableList.$destroy()}},isShowAopPreview:{handler(t){t?this.$store.commit("aopCustomize/setProductInfo",this.detailInfo):(this.$store.commit("aopCustomize/setPreviewImageList",[]),this.$store.commit("aopCustomize/setSelectedPreviewImageIdx",0),this.$store.commit("aopCustomize/setProductInfo",{}))}}},mounted(){const t=sessionStorage.getItem("fromRouter");"ProductsDetail"===t?this.$store.commit("aopCustomize/setFromRouter","ProductsDetail"):this.$store.commit("aopCustomize/setFromRouter",""),this.getDetail()},methods:{async getDetail(){try{const t=await Object(r["a"])(this.query);if(200!==t.code)return void this.$message.error(t.msg);const e=t.data;this.detailInfo=e,this.skuInit(),this.mediaList=e.showImageList,this.displayMedia=this.mediaList.length>0?this.mediaList[0]:"",this.desc=e.blankDescToC,this.blankContent=e.blankContent,this.dropshiped=e.blankProductInfo.dropshiped,this.stockingStrategy=e.blankProductInfo.stockingStrategy,this.minStockingNum=e.blankProductInfo.minStockingNum,this.inventoryAllocationStrategy=e.blankProductInfo.inventoryAllocationStrategy,this.inventoryAllocationNum=e.blankProductInfo.inventoryAllocationNum,this.customizable=e.blankProductInfo.customizable;const i=e.skuList;if(i)for(let a=0;a<3;a++){const t=e["option"+(a+1)];if(!t)break;this.skuList.push({skuInfo:i[a],option:t})}this.fullName=e.blankProductInfo.fullName,this.showPlus=e.blankProductInfo.level>1,this.fittingJewelryNum=e.fittingJewelryNum,this.blankId=e.id}catch(t){this.$message.error(t.message)}finally{const t=this.jumpToDetailShowAopPreview||localStorage.getItem("jumpToDetailShowAopPreview"),e=this.notCustomizable||localStorage.getItem("notCustomizable");t?this.showAopPreview():e&&(this.$store.commit("aopCustomize/setBlankProductId",this.blankId),this.showNotCustomizableShipping())}},jumpToFreeBlankProductFreePage(){this.checkLoginAndUserLevel()&&(this.$store.commit("aopCustomize/setNotCustomizable",!0),this.$store.commit("aopCustomize/setBlankProductId",this.blankId),this.showNotCustomizableShipping())},showNotCustomizableShipping(){this.checkLoginAndUserLevel()&&(this.$store.commit("aopCustomize/setStep",2),this.isShowAopPreview=!0)},showAopPreview(){this.checkLoginAndUserLevel()&&(this.hiddenScroll(),this.$store.commit("aopCustomize/setStep",1),this.isShowAopPreview=!0)},checkLoginAndUserLevel(){const t=this.$store.getters["user/getUserBaseInfo"];return t.id?!(this.showPlus&&this.userFittingLevel{this.$refs.SubscriptionAction.SelectSubscription(2)}).catch(()=>{this.callNewPage("/Subscription")}),!1):(localStorage.setItem("jumpToDetailShowAopPreview",!0),this.$loginDialog({loginType:"login"}),!1)},hiddenScroll(){document.body.style.overflow="hidden"},showScroll(){document.body.style.overflow="auto"},showMedia(t){this.displayMedia=t},showAvailableBoxClick(){this.showAvailableBox=!this.showAvailableBox,this.showAvailableBox?(this.hiddenScroll(),document.body.style.paddingRight="15px"):(this.showScroll(),document.body.style.paddingRight=0),setTimeout(()=>{if(this.showAvailableBox){const t=document.getElementsByClassName("available")[0],e=document.getElementsByClassName("available-box")[0];window.innerHeight-t.getBoundingClientRect().top>e.offsetHeight?e.style.top="10px":e.style.top=-e.offsetHeight-t.offsetHeight-5+"px"}},5)},skuInit(){this.dataInfo=JSON.parse(JSON.stringify(this.detailInfo)),this.initSku(),this.initDefSelect()},initSku(){const{option1:t={},option2:e={},option3:i={}}=this.dataInfo;null!==t&&void 0!==t&&t.type&&this.saleAttrs.push(t),null!==e&&void 0!==e&&e.type&&this.saleAttrs.push(e),null!==i&&void 0!==i&&i.type&&this.saleAttrs.push(i)},initDefSelect(){this.skuList=this.dataInfo.skuList,this.saleAttrs.forEach(t=>{for(const e in this.saleArrtType)t.name===this.skuList[0][`option${e}Name`]&&t.values.forEach((i,a)=>{i.id===this.skuList[0][`option${e}ValueId`]&&this.clickBack(t,i,i.id)})})},clickBack(t,e,i){if(t.check!==e.id){if(this.$set(t,"check",t.check===e.id?"":e.id),this.completeCanClick(),t.type===_o["a"].COLOR.value){if(e.imageUrls&&e.imageUrls.length>0&&(this.$emit("imgChange",e.imageUrls[0]),this.skuForm.imgList=e.imageUrls),this.dataInfo.knifeList){const t=this.dataInfo.knifeList.map(t=>{const e=JSON.parse(JSON.stringify(t));return e.colorImages=e.colorImages.filter(t=>t.optionValueId===i)[0],e});this.$emit("knifeListChange",t)}this.selectImgIndex=0}4===t.type&&(e.imageUrl&&this.$emit("imgChange",e.imageUrl),this.selectImgIndex=0),this.saveCurrentSku()}},completeCanClick(){this.saleAttrs.forEach(t=>{t.values.forEach(e=>{const i=this.findSku(t,e);this.$set(e,"disabled",i.length<=0)})})},findSku(t,e){let i=this.skuList.filter(t=>{for(const i in this.saleArrtType)if(e.id===t[`option${i}ValueId`])return t});return this.saleAttrs.forEach(e=>{e.name!==t.name&&e.check&&(i=i.filter(t=>{for(const i in this.saleArrtType)if(e.check===t[`option${i}ValueId`])return t}))}),i},saveCurrentSku(){if(this.saleAttrs.every(t=>t.check)){const t=this.skuList.find(t=>this.saleAttrs.every(e=>t[`option${e.optionIndex}ValueId`]===e.check));this.skuForm.itemList[0].skuId=t.id,this.skuForm={...this.skuForm,currentSku:t}}else this.skuForm.currentSku={}}}},jo=Do,Eo=(i("01fe"),Object(d["a"])(jo,a,n,!1,null,"28bcc66a",null));e["default"]=Eo.exports},ad93:function(t,e,i){t.exports=i.p+"static/img/align-vertical.093bf03f.svg"},ae50:function(t,e,i){t.exports=i.p+"static/img/pattern.97c0346f.svg"},b60a:function(t,e,i){},b898:function(t,e,i){"use strict";i("fe98")},bbb7:function(t,e,i){t.exports=i.p+"static/img/align-right.66ef8ecd.svg"},bca9:function(t,e,i){t.exports=i.p+"static/img/vip-icon.bb0e808f.svg"},be13:function(t,e,i){"use strict";i("0c67a")},beb4:function(t,e,i){"use strict";i("4f51")},bffd:function(t,e,i){t.exports=i.p+"static/img/clean-icon.5ab879e7.svg"},c167:function(t,e,i){},c1bb:function(t,e,i){},c3a6:function(t,e,i){t.exports=i.p+"static/img/align-horizontal.057cf72f.svg"},c708:function(t,e,i){"use strict";i("c9d5")},c742:function(t,e,i){"use strict";i("3a61")},c823:function(t,e,i){"use strict";i("e2ee")},c9d5:function(t,e,i){},caad:function(t,e,i){"use strict";var a=i("23e7"),n=i("4d64").includes,s=i("44d2");a({target:"Array",proto:!0},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},cf3c:function(t,e,i){t.exports=i.p+"static/img/lens-plus-white.a997414d.svg"},d104:function(t,e,i){},d13c:function(t,e,i){},d166:function(t,e,i){"use strict";i("84c5")},d51c:function(t,e,i){"use strict";i("d6ae")},d6ae:function(t,e,i){},d8cb:function(t,e,i){"use strict";i("7474")},d9d0:function(t,e,i){},dd95:function(t,e,i){"use strict";i("847f")},de74:function(t,e,i){t.exports=i.p+"static/img/verticalPattern.6152e2e7.svg"},df75:function(t,e,i){var a=i("ca84"),n=i("7839");t.exports=Object.keys||function(t){return a(t,n)}},e103:function(t,e,i){"use strict";i("38e8")},e2e7:function(t,e,i){"use strict";i("4172")},e2ee:function(t,e,i){},e47b:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAACXBIWXMAAAsSAAALEgHS3X78AAADO0lEQVRogc2avW4TQRCAB8uRkADZKVJQ5WgpsPmrkOAaKgqcB0BYAnoKHsA8AZZoKWx4ACxKaAwVIopwkJIiFFyQIEUKXxBICEdaNKcds2zuZ2ZvHfuTTnZsr/XdZnd2ZtcnlFJQkiYAhPox0I816yvfAkAMACMAGOqrFK7iKNjW16pD+wMAGABAz/kmUFxwBUqpnvLLUCkVCj1E4h3PwjZD3THexPHLRjOWJmKlVMuHeFN/2XHTKSPenoOwSS9PPCuqYEj76DTb/dLXkesIlZTXAh9x1hN3s8TTehwXicaCiBMXtdcUu8c7CygNeqH6Hyvssbm39SG5XOh//6KuvH+txpM/ktZtc3KaPd7h3v797XV4sRclFz6X8Hwvggfb6/DpZww3N4YQH064rbsAUKc/SDzQE4EtTUjkSZoQymPi1rLFU2dukbRE3pZ2lH9IT0TieeTJZ0k70NBrTCIecFPTZ+evwp2zQeb7afJF0hdO1+HN5RDq1SXubYQk3ir+7D8k8jOQBvKtUtdL5UkyDXx99/cveDfe9y0N5IsrJy7vN6StIWeyFlFCmlimMe5E0bBJw4M00qw41oxTJPKepBPSskMxKH99eSW3Wa265E3amzhGj7yJiBwcTuDRzij3MxIqequglDR3cXHJbbKo2HmuBJcV0ZN8VNE7TN6lazlj2YN85NTjnBVx59otcXrABLfzkqEy8C1NIc8lt2EwAmOMsyaoS+4xA/kBGOGQ1etPv37OfC9vcSmSf7X/LcltGOzSDgSJdzmtUAwFJdJF8snCdCmE1ZOnOArTotncnmAlW1ipYMWClQtX2sRMzEi6ceZoZ2RwDiNK8pZROYfcchurc6zSHSr1BNwdWBm+VKMfY0mzbt4WHI7125xbpxrRNffAMc0cHqCDR2CuObZ4Xf8r7KOQebNmBxA7yYp9FM6e6adFvazdWtwGeLIA0ptZpWVWWtvVdzpPNqmil4iDHjKP5yRO0tkJIOO8pX3Mxym5JxHSU7dAn4rNEvbBlfS4kHo/8iwf68OqusRFKm7eQNkjxMhFuOjwikugt8ToLL9oqwOLAMyJMC6Xqpx9/AjBJi2EoaRTiZgKAPwF915UCVAJW+YAAAAASUVORK5CYII="},eab7:function(t,e,i){"use strict";e["a"]=function(t){for(let e=1,i=arguments.length;e