frontend-fastposter/dist/js/app.1f365507.js
2025-05-31 16:00:35 +08:00

1 line
120 KiB
JavaScript

(function(t){function e(e){for(var i,o,r=e[0],c=e[1],l=e[2],u=0,p=[];u<r.length;u++)o=r[u],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=c[i]);d&&d(e);while(p.length)p.shift()();return s.push.apply(s,l||[]),n()}function n(){for(var t,e=0;e<s.length;e++){for(var n=s[e],i=!0,o=1;o<n.length;o++){var c=n[o];0!==a[c]&&(i=!1)}i&&(s.splice(e--,1),t=r(r.s=n[0]))}return t}var i={},a={app:0},s=[];function o(t){return r.p+"js/"+({about:"about"}[t]||t)+"."+{about:"dc28adc2"}[t]+".js"}function r(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.e=function(t){var e=[],n=a[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,i){n=a[t]=[e,i]}));e.push(n[2]=i);var s,c=document.createElement("script");c.charset="utf-8",c.timeout=120,r.nc&&c.setAttribute("nonce",r.nc),c.src=o(t);var l=new Error;s=function(e){c.onerror=c.onload=null,clearTimeout(u);var n=a[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",l.name="ChunkLoadError",l.type=i,l.request=s,n[1](l)}a[t]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:c})}),12e4);c.onerror=c.onload=s,document.head.appendChild(c)}return Promise.all(e)},r.m=t,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r.oe=function(t){throw console.error(t),t};var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=e,c=c.slice();for(var u=0;u<c.length;u++)e(c[u]);var d=l;s.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"072f":function(t,e,n){"use strict";n("1a5b")},1:function(t,e){},"165a":function(t,e,n){"use strict";n("905a")},"1a5b":function(t,e,n){},"1d18":function(t,e,n){"use strict";n("434d")},"207a":function(t,e,n){},2599:function(t,e,n){"use strict";n("9bd0")},"25fa":function(t,e,n){"use strict";n("2c62")},"263c":function(t,e,n){},"2a6b":function(t,e,n){},"2ac4":function(t,e,n){},"2c18":function(t,e,n){},"2c62":function(t,e,n){},"2fca":function(t,e,n){},3100:function(t,e,n){},"31bf":function(t,e,n){"use strict";n("418c")},"33c4":function(t,e,n){},"3a0c":function(t,e,n){"use strict";n("4578")},"3cbc":function(t,e,n){},"3ffd":function(t,e,n){t.exports=n.p+"img/default.44f169e9.png"},"418c":function(t,e,n){},"42ec":function(t,e,n){"use strict";n("54a4")},"434d":function(t,e,n){},4578:function(t,e,n){},"461a":function(t,e,n){"use strict";n("263c")},"46e2":function(t,e,n){},"472a":function(t,e,n){},4822:function(t,e,n){},"4f29":function(t,e,n){"use strict";n("3100")},"4fbb":function(t,e,n){},5228:function(t,e,n){"use strict";n("5773")},"54a4":function(t,e,n){},"56d7":function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var i=n("5c96"),a=n.n(i),s=n("2b0e"),o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},r=[],c=n("2877"),l={},u=Object(c["a"])(l,o,r,!1,null,null,null),d=u.exports,p=(n("472a"),{UPDATE_DRAG:"update_drag",UPDATE_RECORD:"update_record"}),f=function(t){s["default"].prototype.$EventBus=t},h=f,m=(n("d3b7"),n("3ca3"),n("ddb0"),n("8c4f")),v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home"},[n("fp-design")],1)},g=[],b=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-design-container"},[n("fp-header"),n("fp-aside"),n("fp-aside-extend",{staticClass:"noselect"},[3===t.activeId?n("fp-aside-panel-component"):t._e(),2===t.activeId?n("fp-aside-material"):t._e(),4===t.activeId?n("fp-aside-panel-layer"):t._e(),5===t.activeId?n("fp-aside-panel-poster"):t._e(),6===t.activeId?n("fp-aside-batch"):t._e()],1),n("fp-main-container"),n("fp-setting-container"),n("fp-debug-panel"),n("fp-login"),n("fp-change-pwd"),n("fp-token-manager"),n("fp-user-manager"),n("fp-code-container"),n("fp-batch")],1)},w=[],y=n("5530"),x=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"fp-header-container"},[n("div",{staticClass:"fp-logo"},[n("a",{attrs:{href:t.baseURL}},[t._v("fastposter 专业版")])]),n("div",{staticClass:"fp-header-button-container"},[n("el-tooltip",{attrs:{content:"新建",placement:"bottom"}},[n("fp-button",{on:{click:t.create}},[t._v("新建")])],1),n("el-tooltip",{attrs:{content:"生成代码",placement:"bottom"}},[n("fp-button",{on:{click:function(e){t.editor.showCode=!0}}},[t._v("代码")])],1),n("el-divider",{attrs:{direction:"vertical"}}),n("el-tooltip",{attrs:{content:"撤销",placement:"bottom"}},[n("fp-button",{attrs:{disabled:!t.canUndo},on:{click:t.undo}},[n("i",{staticClass:"iconfont icon-chexiao"})])],1),n("el-tooltip",{attrs:{content:"重做",placement:"bottom"}},[n("fp-button",{attrs:{disabled:!t.canRedo},on:{click:t.redo}},[n("i",{staticClass:"iconfont icon-zhongzuo"})])],1),n("el-tooltip",{attrs:{content:"保存",placement:"bottom"}},[n("fp-button",{on:{click:t.save}},[n("i",{staticClass:"iconfont icon-baocun"})])],1),n("el-tooltip",{attrs:{content:"预览",placement:"bottom"}},[n("fp-button",{on:{click:t.preview}},[n("i",{staticClass:"iconfont icon-yulan"})])],1),n("el-tooltip",{attrs:{content:"下载",placement:"bottom"}},[n("fp-button",{on:{click:t.download}},[n("i",{staticClass:"iconfont icon-xiazai1"})])],1)],1),n("div",{staticClass:"fp-header-button-container-right"},[n("fp-header-user-info")],1),t._m(0)]),n("div",{attrs:{id:"imgViewer"}},[n("img",{ref:"previewImg"})])])},C=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-header-button-container-right github"},[n("a",{attrs:{href:"https://github.com/psoho/fast-poster",target:"_blank",title:"https://github.com/"}},[n("i",{staticClass:"iconfont icon-github"})]),n("a",{attrs:{href:"https://gitee.com/psoho/fast-poster",target:"_blank",title:"https://gitee.com/"}},[n("i",{staticClass:"iconfont icon-gitee",staticStyle:{color:"#C71D23"}})])])}],k=(n("2b3d"),n("9861"),n("b0c0"),n("aeb1")),_=n.n(k),j=n("c82c"),O=n.n(j),P=(n("0808"),n("2f62")),F=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-button",{staticClass:"fp-btn is-plain",attrs:{size:t.size,type:"info",plain:"",disabled:t.disabled},on:{click:function(e){return t.$emit("click")}}},[t._t("default")],2)},I=[],S={name:"FpButton",props:{disabled:{type:Boolean,default:!1},size:{type:String,default:"small"}}},E=S,$=(n("c99f"),Object(c["a"])(E,F,I,!1,null,"7b8e8fc8",null)),A=$.exports,B=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-popover",{attrs:{placement:"top","popper-class":"user-info-popover",trigger:"click"}},[n("div",{staticClass:"user-info-container"},[n("div",{staticClass:"user-info"},[n("h3",[t._v("账号")]),n("span",[t._v(t._s(t.user.username))])]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLogin,expression:"isLogin"}],staticClass:"user-info-item",on:{click:function(e){t.editor.showChangePwd=!0}}},[n("i",{staticClass:"iconfont icon-xiugaimima1"}),n("span",{staticClass:"title"},[t._v("修改密码")])]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLogin,expression:"isLogin"}],staticClass:"user-info-item",on:{click:function(e){t.editor.showTokenManager=!0}}},[n("i",{staticClass:"iconfont icon-shouquan"}),n("span",{staticClass:"title"},[t._v("凭证管理")])]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLogin&&2===t.user.type,expression:"isLogin && user.type === 2"}],staticClass:"user-info-item",on:{click:function(e){t.editor.showUserManager=!0}}},[n("i",{staticClass:"iconfont icon-yonghuguanli"}),n("span",{staticClass:"title"},[t._v("用户管理")])]),n("div",{staticClass:"el-divider el-divider--horizontal",staticStyle:{margin:"8px 0"}}),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLogin,expression:"isLogin"}],staticClass:"user-info-item",on:{click:t.tologout}},[n("i",{staticClass:"iconfont icon-logout"}),n("span",{staticClass:"title"},[t._v("退出账户")])]),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.isLogin,expression:"!isLogin"}],staticClass:"user-info-item",on:{click:function(e){t.editor.showLogin=!0}}},[n("i",{staticClass:"iconfont icon-login"}),n("span",{staticClass:"title"},[t._v("快速登录")])])]),n("el-avatar",{staticStyle:{cursor:"pointer","margin-top":"4px"},attrs:{slot:"reference",size:"medium",icon:"el-icon-user-solid"},slot:"reference"})],1)},R=[],T={name:"FpHeaderUserInfo",computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({isLogin:"editor/isLogin"})),Object(P["e"])({user:function(t){return t.editor.user},editor:function(t){return t.editor}})),methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({logout:"editor/logout"})),{},{tologout:function(){this.logout().then((function(){}))}})},H=T,U=(n("79b1"),n("b14c"),Object(c["a"])(H,B,R,!1,null,"4c1dac08",null)),M=U.exports,z={name:"FpDesignHeader",components:{FpHeaderUserInfo:M,FpButton:A},comments:{FpButton:A},data:function(){return{baseURL:window.API_URL,viewer:null,imgUrl:""}},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p},editor:function(t){return t.editor}})),Object(P["c"])({canUndo:"snapshots/canUndo",canRedo:"snapshots/canRedo"})),mounted:function(){},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({savePoster:"poster/savePoster",createPoster:"poster/createPoster",previewPoster:"poster/previewPoster",loadPosters:"panelposter/getItems"})),Object(P["d"])({undo:"snapshots/undo",redo:"snapshots/redo",clear:"snapshots/clear"})),{},{create:function(){var t=this;this.$confirm("确定要新建海报么?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.clear(),t.createPoster()}))},save:function(){var t=this;this.savePoster().then((function(e){t.$message({message:"保存成功",type:"success",duration:1e3}),t.loadPosters()}))},preview:function(){var t=this.$refs.previewImg;this.previewPoster().then((function(e){t.src=window.URL.createObjectURL(e);var n=new O.a(document.getElementById("imgViewer"),{hide:function(){n.destroy()}});n.show()}))},download:function(){var t=this;this.previewPoster().then((function(e){_()(e,t.p.name+"."+t.p.type,"","image/png")}))}})},D=z,L=(n("8428"),Object(c["a"])(D,x,C,!1,null,"3980d805",null)),N=L.exports,q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-aside-container"},[n("div",{staticClass:"fp-aside-body"},t._l(t.items,(function(e){return n("fp-aside-button",{key:e.id,attrs:{activated:e.activated,icon:e.icon,text:e.text,type:e.type,link:e.link,id:e.id,extend:e.extend},on:{"update:activated":function(n){return t.$set(e,"activated",n)},changeState:function(n){return t.changeState(e)}}})})),1)])},K=[],J=function(){var t=this,e=t.$createElement,n=t._self._c||e;return"link"===t.type?n("a",{staticClass:"fp-aside-btn",class:{activated:t.activated},attrs:{href:t.link,target:"_blank"}},[n("i",{staticClass:"iconfont",class:["icon-"+t.icon]}),t._v(" "+t._s(t.text)+" ")]):"button"===t.type?n("button",{staticClass:"fp-aside-btn",class:{activated:t.activated},on:{click:t.clickHandler}},[n("i",{staticClass:"iconfont",class:["icon-"+t.icon]}),t._v(" "+t._s(t.text)+" ")]):t._e()},W=[],V=(n("a9e3"),{name:"FpAsideButton",props:{id:{type:Number,default:0},activated:{type:Boolean,default:!1},extend:{type:Boolean,default:!1},icon:{type:String,default:"zujian"},text:{type:String,default:""},type:{type:String,default:"button"},link:{type:String,default:"/"}},methods:{clickHandler:function(){var t=!this.activated;this.$emit("update:activated",t),this.$emit("changeState")}}}),G=V,Z=(n("d4a4"),Object(c["a"])(G,J,W,!1,null,"7c01c181",null)),X=Z.exports,Y={name:"FpAside",components:{FpAsideButton:X},computed:Object(y["a"])({},Object(P["e"])({items:function(t){return t.aside.items},activeId:function(t){return t.aside.activeId}})),created:function(){this.getItems()},methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({getItems:"aside/getItems",setActiveItem:"aside/setActiveItem",setDebug:"editor/setDebug"})),{},{changeState:function(t){"debug"===t.icon&&this.setDebug(!0),t.extend&&this.setActiveItem(t)}})},Q=Y,tt=(n("67da"),Object(c["a"])(Q,q,K,!1,null,"92048244",null)),et=tt.exports,nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-aside-extend-container",class:{"fp-extended":t.isActived}},[n("div",{staticClass:"fp-aside-extend-panel"},[t._t("default")],2),n("div",{staticClass:"fp-aside-extend-close",class:{"fp-extended-btn":t.isActived},on:{click:function(e){return t.setActiveItem({id:0,activated:!1,extend:!0})}}},[n("i",{staticClass:"btn-close"})])])},it=[],at={name:"FpAsideExtend",computed:Object(y["a"])({},Object(P["c"])({isActived:"aside/isActived"})),methods:Object(y["a"])({},Object(P["b"])({setActiveItem:"aside/setActiveItem"}))},st=at,ot=(n("eb43"),Object(c["a"])(st,nt,it,!1,null,"27fb45f4",null)),rt=ot.exports,ct=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-main-container",class:{"fp-collapse":t.AsideIsActived}},[n("fp-design-editor"),n("fp-editor-bottom-bar")],1)},lt=[],ut=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-design-editor",on:{mousedown:t.onDown}},[n("div",{staticClass:"fp-editor-container"},[n("fp-poster")],1)])},dt=[],pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{key:t.p.key,staticClass:"fp-editor-wrapper",style:{width:t.wpx,height:t.hpx}},[n("div",{staticClass:"fp-poster-canvas",style:{width:t.wpx,height:t.hpx}},[n("div",{staticClass:"fp-poster",style:t.pointerStyle,attrs:{id:"key-down",tabindex:0},on:{keydown:t.keydownHandler,click:function(e){return e.stopPropagation(),t.cancelActive.apply(null,arguments)}}},t._l(t.p.items,(function(e){return n("fp-poster-item",{key:e.uuid,attrs:{item:e},nativeOn:{click:function(n){return t.click(n,e)}}})})),1),t.ai&&t.ai.lock?n("fp-lock",{attrs:{scale:t.scale,item:t.ai}}):t._e(),t.ai&&!t.ai.lock?n("fp-drag",{ref:"fpDragRef",attrs:{width:t.w,height:t.h,scale:t.scale},on:{change:t.change,changeEnd:t.changeEnd},nativeOn:{dblclick:function(e){return t.dblclickDrag(e)}}}):t._e(),n("fp-line",{ref:"fpLineRef"})],1),n("div",{attrs:{id:"imgViewer"}},[n("img",{ref:"previewImg"})])])},ft=[],ht=(n("99af"),n("ac1f"),n("5319"),n("00b4"),n("2ca0"),n("e9c4"),n("bc3a")),mt=n.n(ht),vt=n("4328"),gt=n.n(vt),bt=n("2ef0"),wt=n.n(bt);n("8a79"),n("fb6a"),n("159b");function yt(t){return t.endsWith("/")?t.slice(0,-1):t}var xt={debug:!1,showLogin:!1,showCode:!1,showChangePwd:!1,showTokenManager:!1,showUserManager:!1,showBatch:!1,batchPosterId:0,batchId:0,user:{username:"",type:1},fonts:[],token:""},Ct={debug:function(){return xt.debug},isLogin:function(){return""!==xt.user.username},token:function(){return $t.token()},apiUrl:function(){return yt($t.baseURL)},uploadUrl:function(){return $t.baseURL+"api/upload"},fonts:function(){return xt.fonts}},kt={setDebug:function(t,e){var n=t.commit;n("setDebug",e)},changepwd:function(t,e){t.commit;return new Promise((function(t){$t.changepwd(e,(function(e){0===e.code&&t(e)}))}))},login:function(t,e){var n=t.commit;return new Promise((function(t){$t.login(e,(function(e){0===e.code&&(n("login",e),kt.getUserInfo({commit:n}),t(e))}))}))},logout:function(t,e){var n=t.commit;return new Promise((function(t){$t.logout(e,(function(e){0===e.code&&(n("logout",e),t(e))}))}))},getUserInfo:function(t,e){var n=t.commit;return new Promise((function(t){$t.userinfo(e,(function(e){0===e.code&&(n("setUserInfo",e),kt.loadFonts({commit:n}),t(e))}))}))},loadFonts:function(t,e){var n=t.commit;return new Promise((function(t){$t.http.get("api/fonts").then((function(e){0===e.code&&(n("setFonts",e),e.data.fonts.forEach((function(t){return $t.loadfont(t.code)})),t(e))}))}))}},_t={setDebug:function(t,e){t.debug=e},login:function(t,e){t.token=e.data.token,localStorage.setItem("FPJTOKEN",e.data.token),t.showLogin=!1},logout:function(t,e){localStorage.removeItem("FPJTOKEN"),t.token="";var n={username:"",type:1};t.user=Object(y["a"])({},n)},setUserInfo:function(t,e){t.token=localStorage.getItem("FPJTOKEN"),t.user=Object(y["a"])({},e.data.user)},setFonts:function(t,e){t.fonts=e.data.fonts}},jt={namespaced:!0,state:xt,getters:Ct,actions:kt,mutations:_t},Ot="/";function Pt(){var t=window.location.href,e=Ft(t);return(null===e||void 0===e?void 0:e.token)||localStorage.getItem("FPJTOKEN")||""}function Ft(t){var e,n=/[?&]([^=#]+)=([^&#]*)/g,i={};while(e=n.exec(t))i[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return i}"/"===Ot&&(Ot=(location.protocol+"//"+location.host+location.pathname).replace(/(.+\/).*$/,"$1")),window.API_URL=Ot,console.info("baseURL",Ot);var It=mt.a.create({baseURL:Ot,timeout:3e3});It.interceptors.request.use((function(t){t.headers["token"]=Pt();var e={_t:(new Date).getTime()};return"get"===t.method?Object(bt["isPlainObject"])(t.params)&&(t.params=Object(y["a"])(Object(y["a"])({},e),t.params)):"post"===t.method&&(Object(bt["isPlainObject"])(t.data)&&(t.data=Object(y["a"])(Object(y["a"])({},e),t.data)),/^application\/x-www-form-urlencoded/.test(t.headers["content-type"])&&(t.data=gt.a.stringify(t.data))),t}),(function(t){return Promise.reject(t)})),It.interceptors.response.use((function(t){return t.data&&401===t.data.code?(console.warn("没有登录"),jt.state.showLogin=!0):t.data&&0!==t.data.code&&i["Message"].warning(t.data.msg),t.data}),(function(t){return console.error(t),i["Message"].error(t),Promise.reject(t)}));var St=[{id:5,text:"海报",icon:"haibao",activated:!1,extend:!0},{id:2,text:"素材",icon:"sucai",activated:!1,extend:!0},{id:3,text:"组件",icon:"zujian",activated:!1,extend:!0},{id:4,text:"图层",icon:"tuceng",activated:!1,extend:!0},{id:6,text:"批量",icon:"piliang1",activated:!1,extend:!0},{id:20,text:"帮助",icon:"help1",activated:!1,extend:!1,type:"link",link:"https://fastposter.net/doc/"},{id:11,text:"调试",icon:"debug",activated:!1,extend:!1}],Et={},$t={baseURL:Ot,token:Pt,http:It,imgUrl:function(t){return t&&!t.startsWith("http")?Ot+t:t},loadAsideItems:function(t){t(St)},userinfo:function(t,e){It.get("api/user").then(e)},changepwd:function(t,e){It.post("api/changepwd",t).then(e)},login:function(t,e){It.post("api/login",t).then(e)},logout:function(t,e){It.post("api/logout",t).then(e)},loadPosters:function(t){It.get("api/posters").then(t)},loadBatchs:function(t){It.get("api/batchs").then(t)},loadBatch:function(t,e){It.get("api/batchs/".concat(t)).then(e)},saveBatch:function(t,e){It.post("api/batchs",t).then(e)},updatBatch:function(t,e){It.put("api/batchs",t).then(e)},removeBatch:function(t,e){It.delete("api/batchs/"+t).then(e)},loadMaterial:function(t,e){It.get("api/materials",{params:t}).then(e)},removeMaterial:function(t,e){It.delete("api/materials/"+t).then(e)},loadPoster:function(t,e){It.get("api/posters/"+t).then(e)},savePoster:function(t,e){It.post("api/posters",t).then(e)},updatePoster:function(t,e){It.put("api/posters",t).then(e)},copyPoster:function(t,e){It.post("api/posters/".concat(t,"/copy")).then(e)},removePoster:function(t,e){It.delete("api/posters/"+t).then(e)},previewPoster:function(t,e){return new Promise((function(n){var i=new XMLHttpRequest;i.withCredentials=!0,i.open("POST",Ot+"api/preview",!0),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("token",Pt()),i.responseType="blob",i.onload=function(t){var i=t.currentTarget;if(200===i.status){var a=i.response;e(a),n(a)}},i.send(JSON.stringify(t))}))},queryTokenList:function(t,e){return It.get("api/tokens",t).then(e)},updateToken:function(t,e){return It.put("api/tokens",t).then(e)},loadfont:function(t){if(t&&!(t in Et)){Et[t]=1;var e=Ot+"store/fonts/"+t,n=document.createElement("style");n.innerText='@font-face {font-family: "'+t+'"; src:url("'+e+'")}; font-display: swap;',document.getElementsByTagName("head")[0].appendChild(n)}}},At=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-base"},[n("svg",{ref:"svg",staticClass:"svg-overflow",attrs:{viewBox:t.viewBoxBase,draggable:"false",width:t.width*t.scale,height:t.height*t.scale}},[n("g",{attrs:{transform:t.transformG}},[n("rect",{attrs:{fill:"none",stroke:"#2c8ef8","stroke-width":"1.5",width:t.cWidth,height:t.cHeight,x:t.current.x,y:t.current.y}}),n("svg",{staticClass:"svg-overflow",attrs:{viewBox:t.viewBox,width:t.cWidth,height:t.cHeight,x:t.current.x,y:t.current.y}},[n("rect",{staticClass:"fp-point fp-point-move",attrs:{width:"100%",height:"100%",fill:"transparent"},on:{mousedown:t.dragElement}}),n("g",{attrs:{stroke:"#2c8ef8","stroke-width":"1.5",fill:"#fff"}},[n("rect",{staticClass:"fp-point fp-point-revolve",attrs:{width:"20",height:"20",stroke:"rgba(0, 0, 0, 0.2)",x:t.current.width/2-10,y:"-32",rx:"10",ry:"10"},on:{mousedown:t.dragRotateHandle}}),n("svg",{staticClass:"fp-point fp-point-revolve",attrs:{x:t.current.width/2-7,y:-29,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8926",width:"14",height:"14"}},[n("path",{attrs:{d:"M929 849a30 30 0 0 1-30-30v-83.137a447.514 447.514 0 0 1-70.921 92.209C722.935 933.225 578.442 975.008 442 953.482a444.917 444.917 0 0 1-241.139-120.591 30 30 0 1 1 37.258-47.01l0.231-0.231A385.175 385.175 0 0 0 442 892.625v-0.006c120.855 22.123 250.206-13.519 343.656-106.975a386.646 386.646 0 0 0 70.6-96.653h-87.247a30 30 0 0 1 0-60H929a30 30 0 0 1 30 30V819a30 30 0 0 1-30 30zM512 392a120 120 0 1 1-120 120 120 120 0 0 1 120-120z m293.005-147.025a29.87 29.87 0 0 1-19.117-6.882l-0.232 0.231A386.5 386.5 0 0 0 689.478 168h-0.011c-145.646-75.182-329.021-51.747-451.117 70.35a386.615 386.615 0 0 0-70.6 96.65H255a30 30 0 0 1 0 60H95a30 30 0 0 1-30-30V205a30 30 0 0 1 60 0v83.129a447.534 447.534 0 0 1 70.923-92.206C317.981 73.866 493.048 37.2 647 85.836v-0.045a444.883 444.883 0 0 1 176.143 105.291 30 30 0 0 1-18.138 53.893z",fill:"#2c8ef8","p-id":"8927"}})]),n("circle",{staticClass:"fp-point",style:t.getDragCursor("lt"),attrs:{title:"tl",cx:"0",r:"4",cy:"0"},on:{mousedown:t.dragTopLeftHandle}}),t.current.width>t.minLength&&!t.lockProportion.x?n("rect",{staticClass:"fp-point",style:t.getDragCursor("t"),attrs:{title:"tm",width:"16",height:"6",x:t.current.width/2-8,y:"-3",rx:"3",ry:"3"},on:{mousedown:t.dragTopMiddleHandle}}):t._e(),n("circle",{staticClass:"fp-point",style:t.getDragCursor("rt"),attrs:{title:"tr",cx:"100%",r:"4",cy:"0"},on:{mousedown:t.dragTopRightHandle}}),n("circle",{staticClass:"fp-point",style:t.getDragCursor("lb"),attrs:{title:"bl",cx:"0",r:"4",cy:"100%"},on:{mousedown:t.dragBottomLeftHandle}}),t.current.width>t.minLength&&!t.lockProportion.x?n("rect",{staticClass:"fp-point",style:t.getDragCursor("b"),attrs:{title:"bm",width:"16",height:"6",x:t.current.width/2-8,y:t.current.height-3,rx:"3",ry:"3"},on:{mousedown:t.dragBottomMiddleHandle}}):t._e(),n("circle",{staticClass:"fp-point",style:t.getDragCursor("rb"),attrs:{title:"br",cx:"100%",r:"4",cy:"100%"},on:{mousedown:t.dragBottomRightHandle}}),t.current.height>t.minLength&&!t.lockProportion.y?n("rect",{staticClass:"fp-point",style:t.getDragCursor("l"),attrs:{title:"ml",width:"6",height:"16",x:"-3",y:t.current.height/2-8,rx:"3",ry:"3"},on:{mousedown:t.dragMiddleLeftHandle}}):t._e(),t.current.height>t.minLength&&!t.lockProportion.y?n("rect",{staticClass:"fp-point",style:t.getDragCursor("r"),attrs:{title:"mr",width:"6",height:"16",x:t.current.width-3,y:t.current.height/2-8,rx:"3",ry:"3"},on:{mousedown:t.dragMiddleRightHandle}}):t._e()])])])])])},Bt=[],Rt={data:function(){return{tempSpan:document.createElement("div")}},mounted:function(){this.tempSpan.style.visibility="hidden",this.tempSpan.style.position="absolute",this.tempSpan.style["white-space"]="break-spaces",this.tempSpan.style["word-break"]="break-all",document.body.appendChild(this.tempSpan)},beforeDestroy:function(){document.body.removeChild(this.tempSpan)},methods:{getDivHeight:function(t,e,n,i){this.tempSpan.style.fontSize=t+"px";var a=Number(t||"0")+Number(e||"0");this.tempSpan.style.lineHeight=a+"px",this.tempSpan.style.width=n+"px",this.tempSpan.innerHTML=i;var s=this.tempSpan.getBoundingClientRect();return s.height}}},Tt=(n("b680"),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.x+e,a=t.x+t.width/2+e,s=t.x+t.width+e,o=t.y+n,r=t.y+t.height/2+n,c=t.y+t.height+n;return[[i,a,s],[o,r,c]]}),Ht=function(t){return{x:t[0][0],y:t[1][0],width:t[0][2]-t[0][0],height:t[1][2]-t[1][0]}},Ut=function(t,e){var n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;var i=n.matrixTransform(t.getScreenCTM().inverse());return{x:i.x,y:i.y}},Mt=function(t){return 2*Math.PI/360*t},zt=function(t,e,n){return{x:(t.x-e.x)*Math.cos(Mt(n))-(t.y-e.y)*Math.sin(Mt(n))+e.x,y:(t.x-e.x)*Math.sin(Mt(n))+(t.y-e.y)*Math.cos(Mt(n))+e.y}},Dt=function(t,e){return(t/e*100).toFixed(2)},Lt=function(t,e,n){var i;switch(n){case"tl":return i={x:t.x,y:t.y},zt(i,e,t.rotate);case"tm":return i={x:t.x+t.width/2,y:t.y},zt(i,e,t.rotate);case"tr":return i={x:t.x+t.width,y:t.y},zt(i,e,t.rotate);case"bl":return i={x:t.x,y:t.y+t.height},zt(i,e,t.rotate);case"bm":return i={x:t.x+t.width/2,y:t.y+t.height},zt(i,e,t.rotate);case"br":return i={x:t.x+t.width,y:t.y+t.height},zt(i,e,t.rotate);case"ml":return i={x:t.x,y:t.y+t.height/2},zt(i,e,t.rotate);case"mr":return i={x:t.x+t.width,y:t.y+t.height/2},zt(i,e,t.rotate);default:return i={x:t.x,y:t.y},zt(i,e,t.rotate)}},Nt=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},qt=function(t,e,n){if(e.x>n.x){if(t.x<n.x)return!1}else if(t.x>n.x)return!1;if(e.y>n.y){if(t.y<n.y)return!1}else if(t.y>n.y)return!1;return!0},Kt={getPoint:Lt,getCenterPoint:Nt,pointInRect:qt,sizeToPoints:Tt,pointsToSize:Ht,getPositionInSvg:Ut,degreeToRadian:Mt,getRotatedPoint:zt,absoluteZoom:Dt},Jt=["lt","t","rt","r","rb","b","lb","l"],Wt={lt:0,t:45,rt:90,r:135,rb:180,b:225,lb:270,l:315},Vt=[{start:338,end:23,cursor:"nwse"},{start:23,end:68,cursor:"ns"},{start:68,end:113,cursor:"nesw"},{start:113,end:158,cursor:"ew"},{start:158,end:203,cursor:"nwse"},{start:203,end:248,cursor:"ns"},{start:248,end:293,cursor:"nesw"},{start:293,end:338,cursor:"ew"}];function Gt(t){var e={},n=-1,i=!0;return Jt.forEach((function(a){var s=(Wt[a]+t)%360,o=Vt.length;while(i){n=(n+1)%o;var r=Vt[n];if(s<23||s>=338)return void(e[a]="nwse-resize");if(r.start<=s&&s<r.end)return void(e[a]=r.cursor+"-resize")}})),e}function Zt(t){if(t=Object(y["a"])({},t),0!=t.angle){var e=t.w*Yt(t.angle)+t.h*Xt(t.angle),n=(t.w-e)/2;t.x+=n,t.right=t.x+e;var i=t.h*Yt(t.angle)+t.w*Xt(t.angle),a=(i-t.h)/2;t.y-=a,t.bottom=t.y+i,t.w=e,t.h=i}else t.bottom=t.y+t.h,t.right=t.x+t.w;return t}function Xt(t){return Math.abs(Math.sin(Qt(t)))}function Yt(t){return Math.abs(Math.cos(Qt(t)))}function Qt(t){return t*Math.PI/360}var te={getCursor:Gt,getComponentRotatedStyle:Zt},ee=50,ne=4,ie=20,ae={mixins:[Rt],data:function(){return{oldlineHeight:null,oldHeight:null,minLength:ie,id:"",item:{},current:{x:0,y:0,width:0,height:0,rotate:0},cursors:{},lockProportion:{x:!1,y:!1},textFix:1.5}},props:{width:{type:Number,default:0},height:{type:Number,default:0},scale:{type:Number,default:1}},computed:{transformG:function(){return"rotate(".concat(this.current.rotate,",").concat(this.current.x+this.current.width/2,",").concat(this.current.y+this.current.height/2,")")},viewBoxBase:function(){return"0 0 ".concat(this.width*this.scale," ").concat(this.height*this.scale)},viewBox:function(){return"0 0 ".concat(this.current.width," ").concat(this.current.height)},cHeight:function(){return this.current.height+this.textFix},cWidth:function(){return this.current.width+this.textFix}},watch:{scale:function(t,e){t!=e&&this.setItem(this.item)}},methods:{setItem:function(t){this.item=t,this.id=t.uuid,"text"==t.t?(this.lockProportion.x=!0,this.lockProportion.y=!1):(this.lockProportion.x=t.aspectRatio,this.lockProportion.y=t.aspectRatio);var e={x:t.x*this.scale,y:t.y*this.scale,width:t.w*this.scale,height:t.h*this.scale,rotate:t.angle};Object.assign(this.current,e),this.cursors=te.getCursor(e.rotate)},getDragCursor:function(t){return{cursor:this.cursors[t]}},getKeyVariable:function(t){var e=this.$refs.svg,n={x:this.current.x,y:this.current.y,width:this.current.width,height:this.current.height,rotate:this.current.rotate},i={x:n.x+n.width/2,y:n.y+n.height/2},a=Kt.getPoint(n,i,t),s={x:i.x+Math.abs(a.x-i.x)*(a.x<i.x?1:-1),y:i.y+Math.abs(a.y-i.y)*(a.y<i.y?1:-1)},o=this.lockProportion.x?n.width/n.height:1;return{viewportRef:e,rect:n,center:i,handlePoint:a,sPoint:s,proportion:o}},stopEvent:function(t){t=t||window.event,t.stopPropagation()},dragElement:function(t){var e=this;this.stopEvent(t);var n=this.$refs.svg,i=Kt.getPositionInSvg(n,t),a={x:this.current.x,y:this.current.y},s=function(t){var s=Kt.getPositionInSvg(n,t);Object.assign(e.current,{x:a.x+s.x-i.x,y:a.y+s.y-i.y}),e.$emit("change",e.id,"move",e.current)},o=wt.a.throttle(s,ee,{trailing:!1});this.configListener(o,this.id,"move")},dragRotateHandle:function(t){var e=this;this.stopEvent(t);var n=this.$refs.svg,i={x:this.current.x,y:this.current.y,width:this.current.width,height:this.current.height,rotate:this.current.rotate},a={x:i.x+i.width/2,y:i.y+i.height/2},s=wt.a.throttle((function(t){var i=Kt.getPositionInSvg(n,t),s=Math.abs(i.x-a.x),o=Math.abs(i.y-a.y),r=Math.sqrt(s*s+o*o),c=Math.round(Math.asin(o/r)/Math.PI*180);i.x>=a.x&&i.y<=a.y?c=90-c:i.x<=a.x&&i.y<=a.y?c=270+c:i.x<=a.x&&i.y>=a.y?c=270-c:i.x>=a.x&&i.y>=a.y&&(c=90+c),e.current.rotate=360===c?0:parseInt(c),e.cursors=te.getCursor(e.current.rotate),e.$emit("change",e.id,"rotate",e.current)}),ee,{trailing:!1});this.configListener(s,this.id,"rotate")},dragTopLeftHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("tl"),i=n.viewportRef,a=n.sPoint,s=n.rect,o=n.proportion,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(i,t),r=Kt.getCenterPoint(n,a),c=Kt.getRotatedPoint(n,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y;if(e.lockProportion.x){u/d>o?(c.x=c.x+Math.abs(u-d*o),u=d*o):(c.y=c.y+Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(c,r,s.rotate);r=Kt.getCenterPoint(p,a),c=Kt.getRotatedPoint(p,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y}u<ne||d<ne||(Object.assign(e.current,{x:c.x,y:c.y,height:d,width:u}),e.getTextLine("tl",e.current),e.$emit("change",e.id,"tl",e.current,c))}),ee,{trailing:!1});this.configListener(r,this.id,"tl")},dragTopMiddleHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("tm"),i=n.rect,a=n.viewportRef,s=n.sPoint,o=n.handlePoint,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(a,t),r=Kt.getRotatedPoint(n,o,-i.rotate),c=Kt.getRotatedPoint({x:o.x,y:r.y},o,i.rotate),l=Math.sqrt(Math.pow(c.x-s.x,2)+Math.pow(c.y-s.y,2),2),u={x:c.x-Math.abs(s.x-c.x)/2*(c.x>s.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};l<ne||Kt.pointInRect(u,o,s)&&(Object.assign(e.current,{height:l,y:u.y-l/2,x:u.x-i.width/2}),e.$emit("change",e.id,"tm",e.current,c,n))}),ee,{trailing:!1});this.configListener(r,this.id,"tm")},dragTopRightHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("tr"),i=n.viewportRef,a=n.sPoint,s=n.rect,o=n.proportion,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(i,t),r=Kt.getCenterPoint(n,a),c=Kt.getRotatedPoint(n,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=c.x-l.x,d=l.y-c.y;if(e.lockProportion.x){u/d>o?(c.x=c.x-Math.abs(u-d*o),u=d*o):(c.y=c.y+Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(c,r,s.rotate);r=Kt.getCenterPoint(p,a),c=Kt.getRotatedPoint(p,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=c.x-l.x,d=l.y-c.y}u<ne||d<ne||(Object.assign(e.current,{x:l.x,y:c.y,height:d,width:u}),e.getTextLine("tr",e.current),e.$emit("change",e.id,"tr",e.current,c,n))}),ee,{trailing:!1});this.configListener(r,this.id,"tr")},dragBottomLeftHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("bl"),i=n.viewportRef,a=n.sPoint,s=n.rect,o=n.proportion,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(i,t),r=Kt.getCenterPoint(n,a),c=Kt.getRotatedPoint(a,r,-s.rotate),l=Kt.getRotatedPoint(n,r,-s.rotate),u=c.x-l.x,d=l.y-c.y;if(e.lockProportion.x){u/d>o?(l.x=l.x+Math.abs(u-d*o),u=d*o):(l.y=l.y-Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(l,r,s.rotate);r=Kt.getCenterPoint(p,a),l=Kt.getRotatedPoint(p,r,-s.rotate),c=Kt.getRotatedPoint(a,r,-s.rotate),u=c.x-l.x,d=l.y-c.y}u<ne||d<ne||(Object.assign(e.current,{x:l.x,y:c.y,height:d,width:u}),e.getTextLine("bl",e.current),e.$emit("change",e.id,"bl",e.current,l))}),ee,{trailing:!1});this.configListener(r,this.id,"bl")},dragBottomMiddleHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("bm"),i=n.rect,a=n.viewportRef,s=n.sPoint,o=n.handlePoint,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(a,t),r=Kt.getRotatedPoint(n,o,-i.rotate),c=Kt.getRotatedPoint({x:o.x,y:r.y},o,i.rotate),l=Math.sqrt(Math.pow(c.x-s.x,2)+Math.pow(c.y-s.y,2),2),u={x:c.x-Math.abs(s.x-c.x)/2*(c.x>s.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};l<ne||Kt.pointInRect(u,o,s)&&(Object.assign(e.current,{height:l,y:u.y-l/2,x:u.x-i.width/2}),e.$emit("change",e.id,"bm",e.current,c,n))}),ee,{trailing:!1});this.configListener(r,this.id,"bm")},dragBottomRightHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("br"),i=n.viewportRef,a=n.sPoint,s=n.rect,o=n.proportion,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(i,t),r=Kt.getCenterPoint(n,a),c=Kt.getRotatedPoint(a,r,-s.rotate),l=Kt.getRotatedPoint(n,r,-s.rotate),u=l.x-c.x,d=l.y-c.y;if(e.lockProportion.x){u/d>o?(l.x=l.x-Math.abs(u-d*o),u=d*o):(l.y=l.y-Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(l,r,s.rotate);r=Kt.getCenterPoint(p,a),l=Kt.getRotatedPoint(p,r,-s.rotate),c=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y}u<ne||d<ne||(Object.assign(e.current,{x:c.x,y:c.y,height:d,width:u}),e.getTextLine("br",e.current),e.$emit("change",e.id,"br",e.current,l,n))}),ee,{trailing:!1});this.configListener(r,this.id,"br")},dragMiddleLeftHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("ml"),i=n.rect,a=n.viewportRef,s=n.sPoint,o=n.handlePoint,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(a,t),r=Kt.getRotatedPoint(n,o,-i.rotate),c=Kt.getRotatedPoint({x:r.x,y:o.y},o,i.rotate),l=Math.sqrt(Math.pow(c.x-s.x,2)+Math.pow(c.y-s.y,2),2),u={x:c.x-Math.abs(s.x-c.x)/2*(c.x>s.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};l<ne||Kt.pointInRect(u,o,s)&&(Object.assign(e.current,{width:l,y:u.y-i.height/2,x:u.x-l/2}),e.getTextLine("ml",e.current),e.$emit("change",e.id,"ml",e.current,c,n))}),ee,{trailing:!1});this.configListener(r,this.id,"ml")},dragMiddleRightHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("mr"),i=n.rect,a=n.viewportRef,s=n.sPoint,o=n.handlePoint,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(a,t),r=Kt.getRotatedPoint(n,o,-i.rotate),c=Kt.getRotatedPoint({x:r.x,y:o.y},o,i.rotate),l=Math.sqrt(Math.pow(c.x-s.x,2)+Math.pow(c.y-s.y,2),2),u={x:c.x-Math.abs(s.x-c.x)/2*(c.x>s.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};l<ne||Kt.pointInRect(u,o,s)&&(Object.assign(e.current,{width:l,y:u.y-i.height/2,x:u.x-l/2}),e.getTextLine("mr",e.current),e.$emit("change",e.id,"mr",e.current,c,n))}),ee,{trailing:!1});this.configListener(r,this.id,"mr")},configListener:function(t,e,n){var i=this,a=function a(s){i.$emit("changeEnd",e,n),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",a)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",a),"text"==this.item.t&&("ml"==n||"mr"==n||(this.oldlineHeight=Number(this.item.s||"0")+Number(this.item.vs||"0"),this.oldHeight=this.item.h))},getTextLine:function(t,e){if("text"==this.item.t)if("ml"==t||"mr"==t){var n=this.getDivHeight(this.item.s,this.item.vs,e.width/this.scale,this.item.v);e.height=n*this.scale}else e["s"]=e.height/this.scale*this.oldlineHeight/this.oldHeight-this.item.vs}}},se=ae,oe=(n("c791"),Object(c["a"])(se,At,Bt,!1,null,"d2ccc460",null)),re=oe.exports,ce=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showX,expression:"showX"}],staticClass:"fp-line fp-x-line",style:t.xStyle}),n("div",{directives:[{name:"show",rawName:"v-show",value:t.showY,expression:"showY"}],staticClass:"fp-line fp-y-line",style:t.yStyle})])},le=[],ue={data:function(){return{diff:3,showX:!1,showY:!1,xStyle:{top:"0px"},yStyle:{left:"0px"}}},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p}})),Object(P["c"])({w:"poster/w",h:"poster/h",scale:"poster/scale",ai:"poster/ai"})),methods:{hideLine:function(){this.showX=!1,this.showY=!1},showLine:function(){var t=this,e=this.p.items,n=Zt(this.ai),i=n.w/2,a=n.h/2;this.hideLine(),e.forEach((function(e){if(e.uuid!=t.ai.uuid){var s=Zt(e),o=s.x,r=s.y,c=s.bottom,l=s.right,u=s.w/2,d=s.h/2;t.isNearly(n.y,r)||t.isNearly(n.bottom,r)?(t.showX=!0,t.xStyle.top="".concat(r*t.scale,"px")):t.isNearly(n.y+a,r+d)?(t.showX=!0,t.xStyle.top="".concat((r+d)*t.scale,"px")):(t.isNearly(n.y,c)||t.isNearly(n.bottom,c))&&(t.showX=!0,t.xStyle.top="".concat(c*t.scale,"px")),t.isNearly(n.x,o)||t.isNearly(n.right,o)?(t.showY=!0,t.yStyle.left="".concat(o*t.scale,"px")):t.isNearly(n.x+i,o+u)?(t.showY=!0,t.yStyle.left="".concat((o+u)*t.scale,"px")):(t.isNearly(n.x,l)||t.isNearly(n.right,l))&&(t.showY=!0,t.yStyle.left="".concat(l*t.scale,"px"))}}))},isNearly:function(t,e){return Math.abs(t-e)<=this.diff}}},de=ue,pe=(n("5228"),Object(c["a"])(de,ce,le,!1,null,"0a58001f",null)),fe=pe.exports,he=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-lock",style:t.lockStyle})},me=[],ve={props:{item:{type:Object,default:function(){}},scale:{type:Number,default:1}},computed:{lockStyle:function(){return{"z-index":this.item.z+1,width:this.item.w*this.scale+"px",height:this.item.h*this.scale+"px",top:this.item.y*this.scale+"px",left:this.item.x*this.scale+"px",transform:"rotate(".concat(this.item.angle,"deg)")}}}},ge=ve,be=(n("9fb2"),Object(c["a"])(ge,he,me,!1,null,null,null)),we=be.exports,ye=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["text"===t.item.t?n("fp-item-text",{attrs:{scale:t.scale,item:t.item}}):t._e(),"image"===t.item.t?n("fp-item-image",{attrs:{scale:t.scale,item:t.item}}):t._e(),"avatar"===t.item.t?n("fp-item-avatar",{attrs:{scale:t.scale,item:t.item}}):t._e(),"qrcode"===t.item.t?n("fp-item-qrcode",{attrs:{scale:t.scale,item:t.item}}):t._e()],1)},xe=[],Ce=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("fp-item-image",{staticStyle:{"border-radius":"50%"},style:{border:"1px solid "+t.item.c},attrs:{scale:t.scale,item:t.item}})},ke=[],_e=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-image",{staticClass:"fp-absolute",style:t.itemStyle,attrs:{fit:"fit",draggable:"false",src:t.imgSrc,onerror:t.defaultImg}})},je=[],Oe={name:"FpItemImage",data:function(){return{defaultImg:'this.src="'+n("3ffd")+'"; this.style.background="#fff"'}},computed:{imgSrc:function(){return $t.imgUrl(this.item.v)},itemStyle:function(){return{"z-index":this.item.z,width:this.item.w*this.scale+"px",height:this.item.h*this.scale+"px",top:this.item.y*this.scale+"px",left:this.item.x*this.scale+"px",transform:"rotate(".concat(this.item.angle,"deg)")}}},props:{item:{type:Object,default:function(){}},scale:{type:Number,default:1}}},Pe=Oe,Fe=(n("072f"),Object(c["a"])(Pe,_e,je,!1,null,"60325c34",null)),Ie=Fe.exports,Se={name:"FpItemAvatar",components:{FpItemImage:Ie},props:{item:{type:Object,default:function(){}},scale:{type:Number,default:1}}},Ee=Se,$e=Object(c["a"])(Ee,Ce,ke,!1,null,null,null),Ae=$e.exports,Be=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-image",{ref:"qrcode",staticClass:"fp-absolute",style:t.itemStyle,attrs:{fit:"fit",draggable:"false",src:t.imgSrc}})},Re=[],Te=n("d055"),He=n.n(Te),Ue={name:"FpItemQrcode",data:function(){return{imgSrc:""}},props:{item:{type:Object,default:function(){}},scale:{type:Number,default:1}},watch:{"item.v":{handler:function(){this.gen()}},"item.c":{handler:function(){this.gen()}},"item.bgc":{handler:function(){this.gen()}}},computed:{itemStyle:function(){return{"z-index":this.item.z,width:this.item.w*this.scale+"px",height:this.item.h*this.scale+"px",top:this.item.y*this.scale+"px",left:this.item.x*this.scale+"px",transform:"rotate(".concat(this.item.angle,"deg)")}}},created:function(){this.gen()},methods:{gen:function(){var t,e=this.item;if(this.item.v){var n={errorCorrectionLevel:"M",margin:null!==(t=0)&&void 0!==t?t:e.p,width:e.w,color:{dark:e.c,light:""!==e.bgc?e.bgc:"#ffffff00"}},i=e.v+"",a=this;He.a.toDataURL(i,n,(function(t,e){if(t)throw t;a.imgSrc=e}))}}}},Me=Ue,ze=(n("8747"),Object(c["a"])(Me,Be,Re,!1,null,"13b2a610",null)),De=ze.exports,Le=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-absolute",style:t.itemStyle,attrs:{id:t.item.uuid,contenteditable:t.item.bool},on:{input:t.handleInputEvent,blur:t.handleBlurEvent}},[n("span",[t._v(" "+t._s(t.item.v))])])},Ne=[],qe=(n("1276"),n("caad"),n("2532"),{name:"FpItemText",mixins:[Rt],props:{item:{type:Object,default:function(){}},scale:{type:Number,default:1}},computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({ai:"poster/ai"})),{},{itemStyle:function(){var t={"z-index":this.item.bool?1e3:this.item.z,width:this.item.w*this.scale+"px",height:this.item.h*this.scale+"px",top:this.item.y*this.scale+"px",left:this.item.x*this.scale+"px",transform:"rotate(".concat(this.item.angle,"deg)"),"font-size":this.item.s*this.scale+"px","font-family":'"'.concat(this.item.fn,'"'),color:"".concat(this.item.c),"text-align":"".concat(this.item.a),"font-style":"normal","box-sizing":"content-box","white-space":"pre-line","word-break":"break-all","line-height":"".concat((this.item.s+this.item.vs)*this.scale,"px"),"background-color":"".concat(this.item.bgc),"letter-spacing":this.item.ls*this.scale+"px",opacity:this.item.opacity},e=this.item.bius.split("");return e.includes("u")&&(t["text-decoration"]="underline"),e.includes("s")&&(t["text-decoration"]="line-through"),e.includes("b")&&(t["font-weight"]="bold"),e.includes("i")&&(t["font-style"]="italic"),t}}),watch:{"item.bool":function(t){var e=this;t&&this.$nextTick((function(){document.getElementById(e.item.uuid).focus()}))}},methods:{handleInputEvent:function(){var t=document.getElementById(this.item.uuid).innerText;this.ai.h=this.getDivHeight(this.ai.s,this.ai.vs,this.ai.w,t)},handleBlurEvent:function(){var t=document.getElementById(this.item.uuid).innerText;this.ai&&(this.ai.v=t)}}}),Ke=qe,Je=(n("a1b9"),Object(c["a"])(Ke,Le,Ne,!1,null,"3a1cbb8c",null)),We=Je.exports,Ve={name:"FpPosterItem",components:{FpItemText:We,FpItemAvatar:Ae,FpItemQrcode:De,FpItemImage:Ie},data:function(){return{}},props:{item:{type:Object,default:function(){}}},computed:Object(y["a"])({},Object(P["c"])({scale:"poster/scale"})),methods:{}},Ge=Ve,Ze=Object(c["a"])(Ge,ye,xe,!1,null,"7e0d8686",null),Xe=Ze.exports,Ye={name:"FpPoster",components:{FpPosterItem:Xe,fpDrag:re,fpLock:we,fpLine:fe},computed:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p}})),Object(P["c"])({w:"poster/w",h:"poster/h",scale:"poster/scale",ai:"poster/ai"})),{},{wpx:function(){return this.w*this.scale+"px"},hpx:function(){return this.h*this.scale+"px"},pointerStyle:function(){return{width:this.wpx,height:this.hpx,"background-color":this.p.bgc,"background-size":"".concat(this.wpx," ").concat(this.hpx),"background-image":"bgUrl"===this.p.use?"url(".concat($t.imgUrl(this.p.bgUrl),")"):""}}}),watch:{ai:{handler:function(t,e){var n=this;t&&!t.lock?this.$nextTick((function(){n.$refs.fpDragRef.setItem(t)})):this.isTextEdit(!1)},deep:!0}},mounted:function(){var t=this;this.$route.query.id?this.loadPoster(this.$route.query.id):(this.clear(),this.createPoster(this.$route.query.appId)),this.$EventBus.$on(p.UPDATE_DRAG,(function(e){var n;null===(n=t.$refs.fpDragRef)||void 0===n||n.setItem(t.ai)})),this.$EventBus.$on(p.UPDATE_RECORD,(function(e){t.changeEnd("",e)}))},beforeDestroy:function(){this.$EventBus.$off(p.UPDATE_DRAG),this.$EventBus.$off(p.UPDATE_RECORD)},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["d"])({setActiveItemId:"poster/setActiveItemId",record:"snapshots/record",undo:"snapshots/undo",redo:"snapshots/redo",up:"poster/up",down:"poster/down",clear:"snapshots/clear",removeActiveItem:"poster/removeActiveItem",copyActiveItem:"poster/copyActiveItem",changeActiveItem:"poster/changeActiveItem",setUnActiveAllItem:"poster/setUnActiveAllItem",isTextEdit:"poster/isTextEdit"})),Object(P["b"])({createPoster:"poster/createPoster",copyPoster:"poster/copyPoster",loadPoster:"poster/loadPoster",savePoster:"poster/savePoster",previewPoster:"poster/previewPoster"})),{},{click:function(t,e){var n=this;t=t||window.event,t.stopPropagation(),e.bool||(this.setActiveItemId(e.uuid),this.$nextTick((function(){n.$refs.fpDragRef.setItem(e)})))},cancelActive:function(t){console.log("cancelActive"),this.setUnActiveAllItem()},change:function(t,e,n){var i;this.changeActiveItem(n),null===(i=this.$refs.fpLineRef)||void 0===i||i.showLine()},preview:function(){var t=this.$refs.previewImg;this.previewPoster().then((function(e){t.src=window.URL.createObjectURL(e);var n=new O.a(document.getElementById("imgViewer"),{hide:function(){n.destroy()}});n.show()}))},dblclickDrag:function(t){console.log("dblclickDrag"),t.stopPropagation(),"text"==this.ai.t&&this.isTextEdit(!0)},changeEnd:function(t,e){var n,i,a,s;switch(e){case"move":this.record("".concat(null===(n=this.ai)||void 0===n?void 0:n.name," 移动位置 "));break;case"rotate":this.record("".concat(null===(i=this.ai)||void 0===i?void 0:i.name," 旋转角度 "));break;default:this.record("".concat(null===(a=this.ai)||void 0===a?void 0:a.name," 更改尺寸 "));break}null===(s=this.$refs.fpLineRef)||void 0===s||s.hideLine()},keydownHandler:function(t){var e=this;switch(t.code){case"KeyZ":(t.ctrlKey||t.metaKey)&&t.shiftKey?this.redo():(t.ctrlKey||t.metaKey)&&this.undo();break;case"KeyP":(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.preview());break;case"KeyS":(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.savePoster().then((function(t){e.$message({message:"保存成功",type:"success",duration:1e3})})));break}console.log(t);var n=this.ai;if(n){var i=t.altKey?5:t.metaKey||t.ctrlKey?10:1;switch(t.code){case"ArrowLeft":this.ai.bool||(n.x-=i,t.preventDefault());break;case"ArrowRight":this.ai.bool||(n.x+=i,t.preventDefault());break;case"ArrowUp":t.shiftKey?this.up(n):n.y-=i,t.preventDefault();break;case"ArrowDown":t.shiftKey?this.down(n):n.y+=i,t.preventDefault();break;case"Delete":case"Backspace":this.ai.bool||(this.removeActiveItem(),this.record("删除组件: ".concat(n.name," - ").concat(n.uuid)));break;case"KeyV":(t.ctrlKey||t.metaKey)&&(this.copyActiveItem(n),this.record("复制组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))),t.preventDefault();break}}}})},Qe=Ye,tn=(n("b720"),Object(c["a"])(Qe,pt,ft,!1,null,"5f1a79c9",null)),en=tn.exports,nn={name:"FpDesignEditor",components:{FpPoster:en},mounted:function(){var t=this;this.getUserInfo().then((function(){t.openPoster()}))},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["d"])({setUnActiveAllItem:"poster/setUnActiveAllItem"})),Object(P["b"])({getUserInfo:"editor/getUserInfo",openPoster:"aside/openPoster"})),{},{onDown:function(t){}})},an=nn,sn=(n("7a7a"),Object(c["a"])(an,ut,dt,!1,null,"20002043",null)),on=sn.exports,rn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-editor-bottom-bar"},[n("i",{staticClass:"iconfont icon--minus",on:{click:t.shrink}}),n("span",{staticClass:"scale-num"},[t._v(t._s(t._f("formatPrcent")(t.scale)))]),n("i",{staticClass:"iconfont icon--plus",on:{click:t.magnify}})])},cn=[],ln={name:"FpEditorBottomBar",computed:Object(y["a"])({},Object(P["e"])({scale:function(t){return t.poster.p.scale}})),filters:{formatPrcent:function(t){return(100*Number(t)).toFixed(0)+"%"}},methods:Object(y["a"])({},Object(P["b"])({shrink:"poster/shrink",magnify:"poster/magnify"}))},un=ln,dn=(n("ab8b"),Object(c["a"])(un,rn,cn,!1,null,"7bd32b20",null)),pn=dn.exports,fn={name:"FpMainContainer",components:{FpEditorBottomBar:pn,FpDesignEditor:on},computed:Object(y["a"])({},Object(P["c"])({AsideIsActived:"aside/isActived"}))},hn=fn,mn=(n("42ec"),Object(c["a"])(hn,ct,lt,!1,null,"df62822e",null)),vn=mn.exports,gn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-setting-container"},[n("fp-setting-canvas",{directives:[{name:"show",rawName:"v-show",value:!t.ai,expression:"!ai"}]}),t.ai?n("fp-setting-component"):t._e()],1)},bn=[],wn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("fp-setting-wrapper",[n("template",{slot:"header"},[n("button",{staticClass:"active"},[t._v("海报设置")])]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" UUID ")])]),n("div",[n("el-input",{staticStyle:{display:"none"},attrs:{readonly:""},model:{value:t.p.id,callback:function(e){t.$set(t.p,"id",e)},expression:"p.id"}}),n("el-input",{staticStyle:{width:"100%"},attrs:{readonly:""},model:{value:t.p.uuid,callback:function(e){t.$set(t.p,"uuid",e)},expression:"p.uuid"}})],1)]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 名称 ")])]),n("div",[n("el-input",{staticStyle:{width:"100%"},model:{value:t.p.name,callback:function(e){t.$set(t.p,"name",e)},expression:"p.name"}})],1)]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 格式 ")])]),n("div",[n("el-radio",{attrs:{label:"jpeg"},model:{value:t.p.type,callback:function(e){t.$set(t.p,"type",e)},expression:"p.type"}},[t._v("jpg")]),n("el-radio",{attrs:{label:"png"},model:{value:t.p.type,callback:function(e){t.$set(t.p,"type",e)},expression:"p.type"}},[t._v("png")]),n("el-radio",{attrs:{label:"webp"},model:{value:t.p.type,callback:function(e){t.$set(t.p,"type",e)},expression:"p.type"}},[t._v("webp")])],1),n("div",[n("el-slider",{attrs:{disabled:"png"==t.p.type,min:20,max:100},model:{value:t.p.quality,callback:function(e){t.$set(t.p,"quality",e)},expression:"p.quality"}})],1)]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 尺寸(px) ")])]),n("div",{staticClass:"fp-canvas-view"},[n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("宽")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{size:"small","controls-position":"right",min:1,max:5999},model:{value:t.p.w,callback:function(e){t.$set(t.p,"w",e)},expression:"p.w"}})],1),n("i"),n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("高")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{size:"small","controls-position":"right",min:1,max:9999},model:{value:t.p.h,callback:function(e){t.$set(t.p,"h",e)},expression:"p.h"}})],1)])]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 常用尺寸 ")])]),n("div",{},[n("el-select",{staticStyle:{width:"100%"},attrs:{size:"small",placeholder:"请选择"},on:{change:t.changeCanvasSize},model:{value:t.canvasSize,callback:function(e){t.canvasSize=e},expression:"canvasSize"}},t._l(t.options,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)]),n("div",{staticClass:"fp-setting-panel-row"},[n("el-tabs",{attrs:{stretch:""},model:{value:t.p.use,callback:function(e){t.$set(t.p,"use",e)},expression:"p.use"}},[n("el-tab-pane",{attrs:{label:"颜色",name:"bgc"}},[n("el-tooltip",{attrs:{content:"设置背景颜色",placement:"left"}},[n("fp-setting-color-picker",{attrs:{value:t.p.bgc,"show-alpha":""},on:{"update:value":function(e){return t.$set(t.p,"bgc",e)}}})],1)],1),n("el-tab-pane",{attrs:{label:"图片",name:"bgUrl"}},[n("div",{staticStyle:{"text-align":"center"}},[n("el-input",{staticStyle:{"margin-bottom":"16px"},attrs:{size:"small",type:"textarea",rows:"4"},model:{value:t.p.bgUrl,callback:function(e){t.$set(t.p,"bgUrl",e)},expression:"p.bgUrl"}})],1),n("div",{staticStyle:{display:"flex","justify-content":"space-around"}},[n("fp-file-upload",{on:{success:t.changeImg}}),n("fp-button",{on:{click:t.resize}},[t._v("原始尺寸")]),n("fp-button",{on:{click:function(e){return t.changeImg("")}}},[t._v("清除")])],1)])],1)],1)],2)},yn=[],xn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-setting-wrapper"},[n("div",{staticClass:"fp-setting-header"},[t._t("header",(function(){return[t._v("标题")]}))],2),n("div",{staticClass:"fp-setting-panel"},[n("div",{staticClass:"fp-setting-panel-content"},[t._t("default")],2)])])},Cn=[],kn={name:"FpSettingWrapper"},_n=kn,jn=(n("3a0c"),Object(c["a"])(_n,xn,Cn,!1,null,"224eea16",null)),On=jn.exports,Pn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-color-picker",{staticClass:"fp-color-picker",attrs:{size:"normal",value:t.value,predefine:t.predefineColors,"show-alpha":t.showAlpha},on:{change:t.change}})},Fn=[],In=(n("498a"),n("25f0"),{name:"FpSettingColorPicker",data:function(){return{predefineColors2:["#606266","#ffffff","#000000","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#409EFF","#67C23A","#F56C6C","#909399","#FF5F7E","#142F43","#94B3FD","#17D7A0","#A2D2FF","#C32BAD"],predefineColors3:["#000000","#105EF5","#F53333","#FFDE00","#3CE025","#3AEFF4","#6929E1","#E633E6","#B0B0B0","#4D7CFF","#DDE0E3","#FF5F7E","#759FFF","#FFFFFF","#C7DBFF","#142F43","#94B3FD","#17D7A0","#A2D2FF","#C32BAD"],predefineColors:["#FEC514","#F04E98","#00BFB3","#0077CC","#3CE025","#343741","#6929E1","#E633E6","#B0B0B0","#4D7CFF","#DDE0E3","#FF5F7E","#759FFF","#FFFFFF","#C7DBFF","#142F43","#94B3FD","#17D7A0","#A2D2FF","#C32BAD"]}},props:{value:{default:""},showAlpha:{default:!1}},methods:{change:function(t){t=null==t?"":t,this.$emit("change",this.rgba2hex(t)),this.$emit("update:value",this.rgba2hex(t))},rgba2hex:function(t){if(!t||t.startsWith("#"))return t;var e=t.slice(5,t.length-1),n=e.split(","),i=parseInt(255*Number(n[3].trim())),a="#",s=Number(n[0].trim()),o=Number(n[1].trim()),r=Number(n[2].trim()),c=("0"+i.toString(16)).slice(-2);return a+=((1<<24)+(s<<16)+(o<<8)+r).toString(16).slice(1),a+=c,a}}}),Sn=In,En=(n("2599"),Object(c["a"])(Sn,Pn,Fn,!1,null,"00b34835",null)),$n=En.exports,An=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-upload",{staticClass:"fp-setting-upload",attrs:{"show-file-list":!1,"on-success":t.handleSuccess,"on-error":t.handleError,"on-preview":t.handlePreview,"on-change":t.changeHandler,"before-upload":t.beforeUploadHandler,headers:{token:t.token},action:t.uploadUrl,"auto-upload":t.autoUpload,accept:t.accept}},[n("fp-button",{attrs:{disabled:t.disabled}},[t._v(t._s(t.buttonText))])],1)},Bn=[],Rn={name:"FpFileUpload",components:{FpButton:A},props:{buttonText:{default:"上传"},accept:{default:"image/png, image/jpeg"},disabled:{default:!1},autoUpload:{default:!0}},computed:Object(y["a"])({},Object(P["c"])({uploadUrl:"editor/uploadUrl",token:"editor/token"})),methods:{handleSuccess:function(t){0===t.code?this.$emit("success",t.data.files[0].path):(this.$message.error("上传失败,请联系管理员查看日志"),console.error("上传失败",t.msg))},handleError:function(t){this.$message.error("上传失败,请联系管理员查看日志"),console.error("上传失败",t)},beforeUploadHandler:function(t){this.$emit("before-upload",t)},handlePreview:function(t){},changeHandler:function(t){this.$emit("change",t)}}},Tn=Rn,Hn=(n("4f29"),Object(c["a"])(Tn,An,Bn,!1,null,"6d949b58",null)),Un=Hn.exports,Mn={name:"FpSettingCanvas",components:{FpButton:A,FpFileUpload:Un,FpSettingWrapper:On,FpSettingColorPicker:$n},data:function(){return{options:[{value:"750,1333",label:"海报 750 x 1333"},{value:"900,500",label:"课程封面 900 x 500"},{value:"900,383",label:"公众号首图 900 x 383"},{value:"640,1008",label:"海报 640 x 1008"},{value:"720,1280",label:"海报 720 x 1280"},{value:"1078,2280",label:"海报 1078 x 2280"},{value:"1242,2208",label:"海报 1242 x 2208"},{value:"800,800",label:"朋友圈背景 800 x 800"},{value:"800,2000",label:"长图海报 800 x 2000"},{value:"1200,1200",label:"方形海报 1200 x 1200"},{value:"1080,1080",label:"方形 1080 x 1080"}],canvasSize:""}},computed:Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p}})),methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({changePosterSize:"poster/changePosterSize",record:"snapshots/record"})),{},{changeCanvasSize:function(t){var e=t.split(","),n=~~e[0],i=~~e[1];this.changePosterSize({w:n,h:i})},resize:function(){var t=this,e=new Image;e.src=$t.imgUrl(this.p.bgUrl),e.onload=function(){t.changePosterSize({w:e.width,h:e.height}),t.record("更改海报原始尺寸")}},changeImg:function(t){var e=this;if(t){var n=new Image;n.src=$t.imgUrl(t),n.onload=function(i){e.p.bgUrl=t,e.changePosterSize({w:n.width,h:n.height}),e.record("更改背景图片, url=",t)}}else this.p.bgUrl=t,this.record("清除背景图片, url=",t)}})},zn=Mn,Dn=Object(c["a"])(zn,wn,yn,!1,null,"3fa2255a",null),Ln=Dn.exports,Nn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("fp-setting-wrapper",[n("template",{slot:"header"},[n("button",{staticClass:"active"},[t._v(t._s(t.title))])]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 尺寸(px) ")])]),n("div",{staticClass:"fp-canvas-view"},[n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("宽")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{disabled:t.ai.lock,size:"small","controls-position":"right",min:1},on:{change:function(e){return t.changeW()}},model:{value:t.ai.w,callback:function(e){t.$set(t.ai,"w",e)},expression:"ai.w"}})],1),n("i"),n("div",{staticClass:"fp-canvas-view-item1"},[n("span",{staticClass:"iconfont icon-lock",staticStyle:{cursor:"pointer"},style:{color:t.ai.aspectRatio?"#f00":"unset"},attrs:{title:"锁定比例"},on:{click:t.changeAspectRatio}})]),n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("高")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{disabled:t.ai.lock,size:"small","controls-position":"right",min:1},on:{change:function(e){return t.changeH()}},model:{value:t.ai.h,callback:function(e){t.$set(t.ai,"h",e)},expression:"ai.h"}})],1)])]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 位置(px) ")])]),n("div",{staticClass:"fp-canvas-view"},[n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("x")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{disabled:t.ai.lock,size:"small","controls-position":"right"},on:{change:function(e){return t.changeHandler("move")}},model:{value:t.ai.x,callback:function(e){t.$set(t.ai,"x",e)},expression:"ai.x"}})],1),n("i"),n("div",{staticClass:"fp-canvas-view-item1"},[n("span",{staticClass:"iconfont icon-lock",staticStyle:{cursor:"pointer",display:"none"},style:{color:t.ai.aspectRatio?"#f00":"unset"},on:{click:t.changeAspectRatio}})]),n("div",{staticClass:"fp-canvas-view-item"},[n("span",{staticClass:"fp-canvas-view-item-label"},[t._v("y")]),n("el-input-number",{staticStyle:{width:"80px"},attrs:{disabled:t.ai.lock,size:"small","controls-position":"right"},on:{change:function(e){return t.changeHandler("move")}},model:{value:t.ai.y,callback:function(e){t.$set(t.ai,"y",e)},expression:"ai.y"}})],1)])]),n("div",{staticClass:"fp-setting-panel-row",staticStyle:{"margin-bottom":"8px"}},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 旋转(角度) ")])]),n("div",[n("el-slider",{staticStyle:{width:"76%",display:"inline-block",position:"relative","vertical-align":"middle"},attrs:{size:"small",disabled:t.ai.lock,min:0,max:360},on:{change:function(e){return t.changeHandler("rotate")}},model:{value:t.ai.angle,callback:function(e){t.$set(t.ai,"angle",e)},expression:"ai.angle"}}),n("el-input-number",{staticStyle:{width:"23%","padding-left":"4px",display:"inline-block"},attrs:{disabled:t.ai.lock,size:"small","controls-position":"right",min:0,max:360},on:{change:function(e){return t.changeHandler("rotate")}},model:{value:t.ai.angle,callback:function(e){t.$set(t.ai,"angle",e)},expression:"ai.angle"}})],1)]),n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 参数设置 ")])]),n("el-form",{ref:"form",attrs:{model:t.ai,"label-width":"40px",size:"small"}},[n("el-form-item",{attrs:{label:"名称"}},[n("el-input",{model:{value:t.ai.vd,callback:function(e){t.$set(t.ai,"vd",e)},expression:"ai.vd"}})],1),n("el-form-item",{attrs:{label:"备注"}},[n("el-input",{model:{value:t.ai.name,callback:function(e){t.$set(t.ai,"name",e)},expression:"ai.name"}})],1),n("el-form-item",{attrs:{label:"内容"}},[n("el-input",{attrs:{type:"textarea",rows:"2"},on:{input:t.changeDragHeight},model:{value:t.ai.v,callback:function(e){t.$set(t.ai,"v",e)},expression:"ai.v"}})],1)],1)],1),"text"===t.ai.t?n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 字体 ")])]),n("div",[n("el-select",{staticClass:"fp-select-font",staticStyle:{width:"76%"},style:{"font-family":"'"+t.ai.fn+"'"},attrs:{placeholder:"请选择"},model:{value:t.ai.fn,callback:function(e){t.$set(t.ai,"fn",e)},expression:"ai.fn"}},t._l(t.fonts,(function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.code}},[n("span",{staticStyle:{float:"left"},style:{"font-family":"'"+e.code+"'"}},[t._v(t._s(e.name))])])})),1),n("el-input-number",{staticStyle:{width:"23%","padding-left":"4px"},attrs:{precision:0,disabled:t.ai.lock,size:"small","controls-position":"right",min:4,max:800},on:{change:t.changeDragHeight},model:{value:t.ai.s,callback:function(e){t.$set(t.ai,"s",e)},expression:"ai.s"}})],1)]):t._e(),"text"===t.ai.t?n("div",{staticClass:"fp-setting-panel-row flex"},[n("div",[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 字间距 ")])]),n("div",[n("el-input-number",{staticStyle:{width:"80px"},attrs:{precision:0,disabled:t.ai.lock,size:"small","controls-position":"right",min:-100,max:100},model:{value:t.ai.ls,callback:function(e){t.$set(t.ai,"ls",e)},expression:"ai.ls"}})],1)]),n("div",{staticClass:"ml10"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 行间距 ")])]),n("div",[n("el-input-number",{staticStyle:{width:"80px"},attrs:{disabled:t.ai.lock,size:"small",precision:0,"controls-position":"right",min:-100,max:100},on:{change:t.changeDragHeight},model:{value:t.ai.vs,callback:function(e){t.$set(t.ai,"vs",e)},expression:"ai.vs"}})],1)])]):t._e(),"image"!==t.ai.t?n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" "+t._s("avatar"===t.ai.t?"边框":"")+"颜色 "+t._s(t.ai.c)+" ")])]),n("div",{staticStyle:{display:"flex","justify-content":"space-around"}},[n("el-tooltip",{attrs:{content:"设置颜色",placement:"top"}},[n("fp-setting-color-picker",{staticStyle:{width:"48%"},attrs:{value:t.ai.c},on:{"update:value":function(e){return t.$set(t.ai,"c",e)},change:t.changeC}})],1),"qrcode"===t.ai.t||"sqrcode"===t.ai.t||"text"===t.ai.t?n("el-tooltip",{attrs:{content:"设置背景颜色",placement:"top"}},[n("fp-setting-color-picker",{staticStyle:{width:"48%"},attrs:{value:t.ai.bgc},on:{"update:value":function(e){return t.$set(t.ai,"bgc",e)}}})],1):t._e()],1)]):t._e(),"avatar"===t.ai.t||"image"===t.ai.t?n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-setting-panel-row-cell"},[n("div",{staticClass:"fp-setting-panel-row-cell-label"},[t._v(" 图片 ")])]),n("div",{staticStyle:{display:"flex","justify-content":"space-around"}},[n("fp-file-upload",{on:{success:t.changeImg,"before-upload":t.onBeforeUpload}}),n("fp-button",{attrs:{disabled:t.ai.aspectRatio},on:{click:t.changeImgSize}},[t._v("原始尺寸")]),n("fp-button",{on:{click:function(e){return t.changeImg("")}}},[t._v("清除")])],1)]):t._e(),n("fp-setting-component-bottom-bar")],2)},qn=[],Kn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-setting-panel-row"},[n("div",{staticClass:"fp-settting-component-bar"},[t.ai.lock?t._e():n("el-tooltip",{attrs:{content:"锁定",placement:"top"}},[n("button",{on:{click:function(e){t.ai.lock=!0}}},[n("i",{staticClass:"iconfont icon-lock"})])]),t.ai.lock?n("el-tooltip",{attrs:{content:"解锁",placement:"top"}},[n("button",{staticClass:"locked",on:{click:function(e){t.ai.lock=!1}}},[n("i",{staticClass:"iconfont icon-unlock"})])]):t._e(),n("el-tooltip",{attrs:{content:"复制",placement:"top"}},[n("button",{attrs:{disabled:t.disabled},on:{click:t.copyItem}},[n("i",{staticClass:"iconfont icon-copy"})])]),n("el-tooltip",{attrs:{content:"删除",placement:"top"}},[n("button",{attrs:{disabled:t.disabled},on:{click:t.removeItem}},[n("i",{staticClass:"iconfont icon-shanchu"})])])],1),n("div",{staticClass:"fp-settting-component-bar",staticStyle:{"margin-top":"2px"}},[n("el-tooltip",{attrs:{content:"置顶",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z>=t.maxZ},on:{click:t.toTop}},[n("i",{staticClass:"iconfont icon-top"})])]),n("el-tooltip",{attrs:{content:"向上",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z>=t.maxZ},on:{click:t.toUp}},[n("i",{staticClass:"iconfont icon-up"})])]),n("el-tooltip",{attrs:{content:"向下",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z<=1},on:{click:t.toDown}},[n("i",{staticClass:"iconfont icon-down"})])]),n("el-tooltip",{attrs:{content:"置底",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z<=1},on:{click:t.toBottom}},[n("i",{staticClass:"iconfont icon-bottom"})])])],1),"text"===t.ai.t?n("div",{staticClass:"fp-settting-component-bar text",staticStyle:{"margin-top":"2px"}},[n("el-tooltip",{attrs:{content:"加粗",placement:"top"}},[n("button",{class:{active:/b/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("b")}}},[n("i",{staticClass:"iconfont icon-font-bold"})])]),n("el-tooltip",{attrs:{content:"斜体",placement:"top"}},[n("button",{class:{active:/i/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("i")}}},[n("i",{staticClass:"iconfont icon-font-italic"})])]),n("el-tooltip",{attrs:{content:"下划线",placement:"top"}},[n("button",{class:{active:/u/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("u")}}},[n("i",{staticClass:"iconfont icon-font-underline"})])]),n("el-tooltip",{attrs:{content:"删除线",placement:"top"}},[n("button",{class:{active:/s/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("s")}}},[n("i",{staticClass:"iconfont icon-font-strickout"})])])],1):t._e(),"text"===t.ai.t?n("div",{staticClass:"fp-settting-component-bar text",staticStyle:{"margin-top":"2px"}},[n("el-tooltip",{attrs:{content:"左对齐",placement:"top"}},[n("button",{class:{active:"left"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="left"}}},[n("i",{staticClass:"iconfont icon-align-left"})])]),n("el-tooltip",{attrs:{content:"居中对齐",placement:"top"}},[n("button",{class:{active:"center"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="center"}}},[n("i",{staticClass:"iconfont icon-align-center"})])]),n("el-tooltip",{attrs:{content:"右对齐",placement:"top"}},[n("button",{class:{active:"right"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="right"}}},[n("i",{staticClass:"iconfont icon-align-right"})])]),n("div",{staticStyle:{width:"32px"}})],1):t._e()])},Jn=[],Wn=(n("a15b"),{name:"FpSettingComponentBottomBar",data:function(){return{value1:0}},computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({ai:"poster/ai",maxZ:"poster/maxZ"})),{},{disabled:function(){return this.ai.lock}}),methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({removeActiveItem:"poster/removeActiveItem",copyActiveItem:"poster/copyActiveItem",record:"snapshots/record",top:"poster/top",bottom:"poster/bottom",up:"poster/up",down:"poster/down"})),{},{removeItem:function(){var t=this.ai;this.removeActiveItem(),this.record("删除组件: ".concat(t.name," - ").concat(t.uuid))},copyItem:function(){this.copyActiveItem(this.ai),this.record("复制组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toTop:function(){this.top(this.ai),this.record("置顶组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toBottom:function(){this.bottom(this.ai),this.record("置底组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toUp:function(){this.up(this.ai),this.record("上移组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toDown:function(){this.down(this.ai),this.record("下移组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},biusHandle:function(t){var e=this.ai.bius.split("");"u"===t&&wt.a.remove(e,(function(t){return"s"===t})),"s"===t&&wt.a.remove(e,(function(t){return"u"===t})),wt.a.includes(e,t)?wt.a.remove(e,(function(e){return e===t})):e.push(t),e=wt.a.uniq(e).join(""),this.ai.bius=e}})}),Vn=Wn,Gn=(n("eaf8"),Object(c["a"])(Vn,Kn,Jn,!1,null,"4da293e3",null)),Zn=Gn.exports,Xn={text:"文字",image:"图片",avatar:"头像",qrcode:"二维码"},Yn={name:"FpSettingComponent",components:{FpButton:A,FpFileUpload:Un,FpSettingColorPicker:$n,FpSettingComponentBottomBar:Zn,FpSettingWrapper:On},mixins:[Rt],data:function(){return{scaleWH:1}},computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({w:"poster/w",h:"poster/h",ai:"poster/ai",fonts:"editor/fonts",scale:"poster/scale"})),{},{title:function(){var t=Xn[this.ai.t];return"undefined"!==typeof t?t:this.ai.name}}),mounted:function(){this.h&&(this.scaleWH=this.ai.w/this.ai.h)},methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({record:"snapshots/record"})),{},{changeImg:function(t){var e=this.ai;this.ai.v=t,this.record("更改图片: ".concat(e.name,", url=").concat(t))},onBeforeUpload:function(t){var e=this,n=new FileReader;n.onload=function(t){var n=new Image;n.onload=function(){e.ai.w=Math.round(n.width*e.scale),e.ai.h=Math.round(n.height*e.scale),e.ai.aspectRatio=!0},n.src=t.target.result},n.readAsDataURL(t)},changeHandler:function(t){t&&this.$EventBus.$emit(p.UPDATE_DRAG,t),t&&this.$EventBus.$emit(p.UPDATE_RECORD,t)},changeC:function(t){t||(this.ai.c="#000000")},changeW:function(){this.ai.aspectRatio&&(this.ai.h=Math.round(this.ai.w/this.scaleWH)),this.changeHandler("wh")},changeH:function(){this.ai.aspectRatio&&(this.ai.w=Math.round(this.ai.h*this.scaleWH)),this.changeHandler("wh")},changeAspectRatio:function(){this.ai.aspectRatio=!this.ai.aspectRatio,this.h&&(this.scaleWH=this.ai.w/this.ai.h)},changeDragHeight:function(){"text"===this.ai.t&&(this.ai.h=this.getDivHeight(this.ai.s,this.ai.vs,this.ai.w,this.ai.v))},changeImgSize:function(){var t=this.ai,e=new Image,n=this;e.src=$t.imgUrl(t.v),e.onload=function(){t.w=e.width,setTimeout((function(){t.h=e.height,n.record("更改图片原始尺寸: ".concat(t.name))}),10)}}})},Qn=Yn,ti=(n("acbe"),Object(c["a"])(Qn,Nn,qn,!1,null,"0d9f7451",null)),ei=ti.exports,ni={name:"FpSettingContainer",components:{FpSettingComponent:ei,FpSettingCanvas:Ln},computed:Object(y["a"])({},Object(P["c"])({ai:"poster/ai"}))},ii=ni,ai=(n("da01"),n("888c"),Object(c["a"])(ii,gn,bn,!1,null,"5872bc14",null)),si=ai.exports,oi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-debug-panel",class:{active:t.editor.debug},on:{click:function(e){return t.setDebug(!0)},dblclick:function(e){return t.setDebug(!1)}}},[n("pre",{staticClass:"code language-json line-numbers",domProps:{innerHTML:t._s(t.html)}})])},ri=[],ci=n("c197"),li=n.n(ci),ui=(n("f393"),{name:"FpDebugPanel",computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p},editor:function(t){return t.editor}})),{},{html:function(){return li.a.highlight(JSON.stringify(this.p,"",2),li.a.languages.json,"json")}}),methods:Object(y["a"])({},Object(P["b"])({setDebug:"editor/setDebug"}))}),di=ui,pi=(n("7316"),Object(c["a"])(di,oi,ri,!1,null,"347529be",null)),fi=pi.exports,hi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[t._m(0),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items,(function(e){return n("fp-aside-panel-component-item",{key:e.t,attrs:{icon:e.t,title:e.name,desc:"点击创建"},on:{click:function(n){return t.addItemToEditor(e)}}})})),1)])])},mi=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"title"},[n("h3",[t._v("组件")])])}];n("4de4"),n("d81d");function vi(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,i=arguments.length>1?arguments[1]:void 0,a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(i=i||a.length,n)for(t=0;t<n;t++)s[t]=a[0|Math.random()*i];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",t=0;t<36;t++)s[t]||(e=0|16*Math.random(),s[t]=a[19===t?3&e|8:e]);return s.join("")}var gi,bi,wi={name:"未命名",id:0,w:750,h:1333,use:"bgUrl",bgc:"#fafbfc",bgUrl:"",type:"jpeg",quality:80,scale:.5,key:vi(),items:[]},yi={p:Object(y["a"])({},wi)},xi={w:function(){return yi.p.w},h:function(){return yi.p.h},ai:function(){var t=yi.p.items.filter((function(t){return t.active}));return t.length>=1?t[0]:void 0},maxZ:function(){return yi.p.items.length>=1?Object(bt["max"])(yi.p.items.map((function(t){return t.z}))):1},scale:function(){return yi.p.scale}},Ci={createPoster:function(t){var e=t.commit,n=JSON.parse(JSON.stringify(wi));e("loadPoster",n)},savePoster:function(){return new Promise((function(t){var e=yi.p,n=Object(y["a"])({},e);0===e.id?$t.savePoster(n,(function(n){0===n.code&&n.data.poster&&(e.id=n.data.poster.id,e.uuid=n.data.poster.uuid),t(n)})):$t.updatePoster(n,(function(e){t(e)}))}))},loadPoster:function(t,e){var n=t.commit;return new Promise((function(t){$t.loadPoster(e,(function(i){var a=i.data.poster,s=JSON.parse(a.json);s.id=e,s.uuid=a.uuid,n("loadPoster",s),s.items.filter((function(t){return""!==t.fn})).forEach((function(t){return $t.loadfont(t.fn)})),t(i)}))}))},getPoster:function(t,e){t.commit;return new Promise((function(t){$t.loadPoster(e,(function(e){var n=e.data.poster,i=JSON.parse(n.json);i.id=n.id,t(i)}))}))},copyPoster:function(t,e){t.commit;return new Promise((function(t){$t.copyPoster(e,(function(e){t(e)}))}))},removePoster:function(t,e){t.commit;return new Promise((function(t){$t.removePoster(e,(function(e){t(e)}))}))},previewPoster:function(){return new Promise((function(t){var e=yi.p;$t.previewPoster(e,(function(e){t(e)}))}))},shrink:function(t){var e=t.commit;e("changeScale",-.1)},magnify:function(t){var e=t.commit;e("changeScale",.1)},isTextEdit:function(t,e){var n=t.commit;n("isTextEdit",e)}},ki={changeScale:function(t,e){if(t.p.scale<=.35&&(e/=10),t.p.scale<=.05&&e<0||t.p.scale>=3&&e>0)console.warn("已到极致缩放比: ",t.p.scale);else{var n=t.p.scale+e;.36===n&&(n=.4),t.p.scale=Number(n.toFixed(2))}},loadPoster:function(t,e){var n=0;e.items.forEach((function(t){t.active=!1,"undefined"===typeof t.lock&&(t.lock=!1),"undefined"===typeof t.angle&&(t.angle=0),"undefined"===typeof t.aspectRatio&&(t.aspectRatio=!1),"undefined"===typeof t.vs&&(t.vs=0),"undefined"===typeof t.bool&&(t.bool=!1),"text"===t.t&&("undefined"===typeof t.a&&(t.a="left"),"undefined"===typeof t.wrap&&(t.wrap=!0),"undefined"!==typeof t.bius&&t.bius||(t.bius=""),"undefined"!==typeof t.ls&&t.ls||(t.ls=0)),t.z=++n})),"undefined"!==typeof e.editor&&delete e["editor"],"undefined"===typeof e.use&&(e.use=e.bgUrl?"bgUrl":"bgc"),"undefined"===typeof e.key&&(e.key=vi()),e.scale||(e.scale=.5),t.p=e},setActiveItemId:function(t,e){t.p.items.filter((function(t){return t.active&&t.uuid!==e})).forEach((function(t){return t.active=!1})),t.p.items.filter((function(t){return t.uuid===e})).forEach((function(t){return t.active=!0}))},setUnActiveItemId:function(t,e){t.p.items.filter((function(t){return t.uuid===e})).forEach((function(t){return t.active=!1}))},setUnActiveAllItem:function(t){t.p.items.forEach((function(t){return t.active=!1}))},addItem:function(t,e){if(t.p.items.length>=100)console.warn("元素超过最数量: ",t.p.items.length);else{this.commit("poster/setUnActiveAllItem");var n=t.p.items.length>=1?xi.maxZ()+1:1,i={t:e.t,name:e.name,uuid:vi(),x:e.x?e.x:100,y:e.y?e.y:100,w:e.w?e.w:200,h:e.h?e.h:200,z:n,angle:e.angle?e.angle:0,s:e.s?e.s:30,c:e.c?e.c:"#000000",bgc:e.bgc?e.bgc:"",v:e.v,vs:e.vs?e.vs:0,vd:e.vd?e.vd:"",fn:e.fn?e.fn:"",st:e.st?e.st:0,active:!0,lock:!1,aspectRatio:!1,bool:!1};"undefined"!==typeof e.p&&(i["p"]=e.p),"qrcode"!==e.t&&"avatar"!==e.t&&"image"!==e.t||(i.aspectRatio=!0),"text"===e.t&&(i.a=e.a?e.a:"left",i.fn=e.fn?e.fn:"01/0d44d315557a4a25.woff",i.wrap=!0,i.bius=e.bius?e.bius:"",i.ls=e.ls?e.ls:0),t.p.items.push(i)}},removeActiveItem:function(t){var e=t.p.items.filter((function(t){return!t.active})),n=0;e.forEach((function(t){t.z=++n})),t.p.items=e},copyActiveItem:function(t,e){var n=JSON.parse(JSON.stringify(e));n.y+=20,this.commit("poster/addItem",n)},changeActiveItem:function(t,e){for(var n=0;n<t.p.items.length;n++)if(t.p.items[n].active)return t.p.items[n].x=Math.round(e.x/t.p.scale),t.p.items[n].y=Math.round(e.y/t.p.scale),t.p.items[n].w=Math.round(e.width/t.p.scale),t.p.items[n].h=Math.round(e.height/t.p.scale),t.p.items[n].angle=e.rotate,void("text"===t.p.items[n].t&&e.s&&(t.p.items[n].s=e.s))},changePosterSize:function(t,e){var n=e.w,i=e.h;t.p.w=n,t.p.h=i},top:function(t,e){var n=xi.maxZ();t.p.items.filter((function(t){return t.z>e.z})).forEach((function(t){return t.z--})),e.z=n,t.p.items=Object(bt["sortBy"])(t.p.items,["z"])},bottom:function(t,e){t.p.items.filter((function(t){return t.z<e.z})).forEach((function(t){return t.z++})),e.z=1,t.p.items=Object(bt["sortBy"])(t.p.items,["z"])},up:function(t,e){var n=xi.maxZ();e.z!==n&&(t.p.items.filter((function(t){return t.z===e.z+1})).forEach((function(t){return t.z--})),e.z=e.z+1,t.p.items=Object(bt["sortBy"])(t.p.items,["z"]))},down:function(t,e){e.z<=1||(t.p.items.filter((function(t){return t.z===e.z-1})).forEach((function(t){return t.z++})),e.z=e.z-1,t.p.items=Object(bt["sortBy"])(t.p.items,["z"]))},isTextEdit:function(t,e){t.p.items.forEach((function(t){t.active?t.bool=e:t.bool=!1}))}},_i={namespaced:!0,state:yi,getters:xi,actions:Ci,mutations:ki},ji=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"item",on:{click:function(e){return t.$emit("click")}}},[n("i",{staticClass:"iconfont",class:["icon-"+t.icon]}),n("div",{staticClass:"item-desc"},[n("h3",[t._v(t._s(t.title))]),n("p",[t._v(t._s(t.desc))])])])},Oi=[],Pi={name:"FpAsidePanelComponentItem",props:{icon:{default:"icon-zujian"},title:{default:"标题"},desc:{default:"描述"}}},Fi=Pi,Ii=(n("8a15"),Object(c["a"])(Fi,ji,Oi,!1,null,"25da81ab",null)),Si=Ii.exports,Ei={name:"FpAsidePanelComponent",components:{FpAsidePanelComponentItem:Si},data:function(){return{items:[{t:"text",name:"文字",v:"请输入文字",w:220,h:42,s:42},{t:"image",name:"图片",v:"https://fastposter.net/dassets/default.png",w:200},{t:"avatar",name:"头像",v:"https://fastposter.net/dassets/default.png",w:80,h:80},{t:"qrcode",name:"二维码",v:"https://fastposter.net/doc/",w:120,h:120,p:0,c:"#000000",bgc:"#ffffff"}]}},methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({addItem:"poster/addItem",record:"snapshots/record"})),{},{addItemToEditor:function(t){this.addItem(Object(y["a"])(Object(y["a"])({},t),{},{vd:t.name+vi(6)})),this.record("新增组件: ".concat(t.name)),document.getElementById("key-down").focus()}})},$i=Ei,Ai=(n("ba4e"),Object(c["a"])($i,hi,mi,!1,null,"216c4da7",null)),Bi=Ai.exports,Ri=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[t._m(0),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.p.items,(function(e){return n("div",{key:e.uuid,staticClass:"fp-component-layer",class:{active:e.active,lock:e.lock},on:{click:function(n){return t.setActiveItemId(e.uuid)}}},[n("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(t.maxNum-e.z))]),n("i",{staticClass:"iconfont",class:["icon-"+e.t]}),e.vd?n("span",[t._v(t._s(e.vd))]):t._e(),e.vd?t._e():n("span",[t._v("未设置参数名称")])])})),0),n("fp-empty",{attrs:{data:t.p.items}})],1)])},Ti=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"title"},[n("h3",[t._v("图层")])])}],Hi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShow,expression:"isShow"}],staticStyle:{"text-align":"center","padding-top":"16px"},attrs:{title:"暂无数据"}},[n("i",{staticClass:"iconfont icon-ziyuan",style:{"font-size":t.size+"px"}})])},Ui=[],Mi={name:"FpEmpty",props:{size:{default:40},data:{type:[Boolean,Object,Array,String],default:!0}},computed:{isShow:function(){return Object(bt["isEmpty"])(this.data)}}},zi=Mi,Di=Object(c["a"])(zi,Hi,Ui,!1,null,"37804b7f",null),Li=Di.exports,Ni={name:"FpAsidePanelLayer",components:{FpEmpty:Li},data:function(){return{drag:!1}},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p}})),{},{maxNum:function(){return this.p.items.length+1}}),methods:Object(y["a"])({},Object(P["d"])({setActiveItemId:"poster/setActiveItemId",layerSort:"poster/layerSort"}))},qi=Ni,Ki=(n("e72f"),Object(c["a"])(qi,Ri,Ti,!1,null,"66d452fd",null)),Ji=Ki.exports,Wi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"快速登录",visible:t.editor.showLogin,width:"40%"},on:{"update:visible":function(e){return t.$set(t.editor,"showLogin",e)}}},[n("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:t.ruleForm,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"账号",prop:"username"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{placeholder:"账号"},model:{value:t.ruleForm.username,callback:function(e){t.$set(t.ruleForm,"username",e)},expression:"ruleForm.username"}})],1),n("el-form-item",{attrs:{label:"密码",prop:"password"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{"show-password":""},model:{value:t.ruleForm.password,callback:function(e){t.$set(t.ruleForm,"password",e)},expression:"ruleForm.password"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("立即登录")])],1)],1)],1)},Vi=[],Gi={name:"FpLogin",computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),data:function(){return{ruleForm:{username:"demo",password:"demo"},rules:{username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:3,max:32,message:"长度在 3 到 32 个字符",trigger:"blur"}]}}},methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({login:"editor/login",openPoster:"aside/openPoster"})),{},{submitForm:function(t){var e=this;return this.$refs[t].validate((function(t){t&&e.login(e.ruleForm).then((function(t){e.openPoster()}))})),!1}})},Zi=Gi,Xi=Object(c["a"])(Zi,Wi,Vi,!1,null,"27571c88",null),Yi=Xi.exports,Qi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[t._m(0),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items,(function(e){return n("div",{key:e.id,staticClass:"fp-poster",on:{click:function(n){return t.changePoster(e)}}},[n("div",{staticClass:"fp-poster-title",attrs:{title:e.id+" "+e.name}},[t._v(" "+t._s(e.name)+" ")]),n("img",{attrs:{src:e.preview}}),n("div",{staticClass:"fp-poster-tool"},[n("i",{staticClass:"iconfont icon-fuzhi1 i-btn",attrs:{title:"复制"},on:{click:function(n){return n.stopPropagation(),t.copy(e.id)}}}),n("i",{staticClass:"iconfont icon-shanchu i-btn",attrs:{title:"删除"},on:{click:function(n){return n.stopPropagation(),t.remove(e.id)}}})])])})),0),n("fp-empty",{attrs:{data:t.items}})],1)])},ta=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"title"},[n("h3",[t._v("海报")])])}],ea={name:"FpAsidePanelPoster",components:{FpEmpty:Li},computed:Object(y["a"])({},Object(P["e"])({items:function(t){return t.panelposter.items},p:function(t){return t.poster.p}})),methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({loadPosters:"panelposter/getItems",loadPoster:"poster/loadPoster",copyPoster:"poster/copyPoster",removePoster:"poster/removePoster"})),Object(P["d"])({clear:"snapshots/clear",record:"snapshots/record"})),{},{changePoster:function(t){var e=this;t.id!==this.p.id&&this.$confirm("确定要切换海报么?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.loadPoster(t.id).then((function(){e.clear(),e.record("重新加载")}))}))},copy:function(t){var e=this;this.copyPoster(t).then((function(){e.loadPosters()}))},remove:function(t){var e=this;this.$confirm("确定要删除海报吗?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t!==e.p.id&&e.clear(),e.removePoster(t).then((function(){e.loadPosters()}))}))}}),created:function(){this.loadPosters()}},na=ea,ia=(n("1d18"),Object(c["a"])(na,Qi,ta,!1,null,"21e95c9b",null)),aa=ia.exports,sa=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"生成代码",visible:t.editor.showCode,"custom-class":"code-dialog",width:"70%"},on:{"update:visible":function(e){return t.$set(t.editor,"showCode",e)}}},[n("el-tabs",{model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[n("el-tab-pane",{attrs:{label:"JS",name:"JS"}},[n("fp-code-js")],1),n("el-tab-pane",{attrs:{label:"Java",name:"Java"}},[n("fp-code-java")],1),n("el-tab-pane",{attrs:{label:"Python",name:"Python"}},[n("fp-code-python")],1),n("el-tab-pane",{attrs:{label:"Go",name:"Go"}},[n("fp-code-go")],1),n("el-tab-pane",{attrs:{label:"PHP",name:"PHP"}},[n("fp-code-php")],1)],1)],1)},oa=[],ra=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-java line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},ca=[],la=(n("922d"),n("b311")),ua=n.n(la),da={name:"FpCodeMixin",mounted:function(){var t=this,e=this,n=new ua.a(this.$refs["btnCopy"].$el,{text:function(){return e.code()}});n.on("success",(function(){t.$message({message:"复制成功",type:"success",duration:1e3})}))},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({items:function(t){return t.poster.p.items},posterId:function(t){return t.poster.p.uuid}})),Object(P["c"])({token:"editor/token",apiUrl:"editor/apiUrl"})),methods:{code:function(){return""},json:function(){var t={};return this.items.filter((function(t){return t.vd})).forEach((function(e){t[e.vd]=e.v})),t=JSON.stringify(t,""," "),t}}},pa=da,fa=(n("165a"),Object(c["a"])(pa,gi,bi,!1,null,"28f0fa20",null)),ha=fa.exports,ma={name:"FpCodeJava",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.java,"java")}},methods:{code:function(){var t="";this.items.forEach((function(e){e.vd&&(t+=' params.put("'.concat(e.vd,'", "').concat(e.v.replace("\n","\\n"),'");\n'))})),t=t||" // 暂未指定任何动态参数\n";var e='import net.fastposter.client.FastposterClient;\nimport java.util.*;\n\npublic class FastposterClientDemo {\n\n public static void main(String[] args) {\n\n // 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n // 1.创建海报客户端对象\n FastposterClient client = FastposterClient.builder()\n .token("'.concat(this.token,'") // 设置token\n .endpoint("').concat(this.apiUrl,'")\n .build();\n\n // 2.准备海报参数(从实际业务系统中获取)\n Map<String, Object> params = new HashMap<>();\n').concat(t,'\n\n // 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\n client.buildPoster("').concat(this.posterId||"未生成",'").params(params).build().save("demo.png");\n\n }\n}');return e}}},va=ma,ga=(n("d8cd"),Object(c["a"])(va,ra,ca,!1,null,"3fa1de92",null)),ba=ga.exports,wa=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-python line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},ya=[],xa=(n("3d21"),{name:"FpCodePython",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.python,"python")}},methods:{code:function(){var t=this.json()||" # 暂未指定任何动态参数\n",e='from fastposter import Client\n\n# 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n# 1.创建海报客户端对象\nclient = Client("'.concat(this.token,'", "').concat(this.apiUrl,'")\n\n# 2.准备海报参数(从实际业务系统中获取)\nparams = ').concat(t,'\n\n# 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\nclient.buildPoster("').concat(this.posterId||"未生成",'", params=params).save("demo.png")');return e}}}),Ca=xa,ka=(n("461a"),Object(c["a"])(Ca,wa,ya,!1,null,"f65933c8",null)),_a=ka.exports,ja=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-go line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},Oa=[],Pa=(n("1989"),{name:"FpCodeGo",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.go,"go")}},methods:{code:function(){var t=this.json()||" # 暂未指定任何动态参数\n",e='package main\n\nimport (\n\t"fmt"\n\t"github.com/psoho/fastposter-client-go/fastposter"\n)\n\nfunc main() {\n\n\t// 创建海报客户端\n\tclient := fastposter.Client("'.concat(this.token,'")\n\n\t// 设置参数\n\tparams := map[string]interface{}').concat(t,'\n\n\t// 生成海报\n\tposter, err := client.BuildPoster("').concat(this.posterId,'", params, "png")\n\tif err != nil {\n\t\tfmt.Println("Error:", err)\n\t\treturn\n\t}\n\n\tposter.Save()\n}\n');return e}}}),Fa=Pa,Ia=(n("dce8"),Object(c["a"])(Fa,ja,Oa,!1,null,"15e8fd9e",null)),Sa=Ia.exports,Ea=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-shell line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},$a=[],Aa=(n("8009"),{name:"FpCodeCurl",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.bash,"bash")}},methods:{code:function(){var t={};this.items.filter((function(t){return t.vd})).forEach((function(e){t[e.vd]=e.v})),t["id"]=this.posterId,t=JSON.stringify(t,""," ");var e="curl --location --request POST '".concat(this.apiUrl,"api/link' --header 'token: ").concat(this.token,"' --header 'Content-Type: application/json' \\\n--data-raw '").concat(t,"'");return e}}}),Ba=Aa,Ra=(n("fefd"),Object(c["a"])(Ba,Ea,$a,!1,null,"eef3d0a6",null)),Ta=(Ra.exports,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-php line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)}),Ha=[],Ua=(n("5b81"),n("6217"),n("8e9b"),{name:"FpCodePhp",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.php,"php")}},methods:{code:function(){var t=this.json().replaceAll('":','" =>');t="["+t.substring(1,t.length-1)+"]";var e='include_once "vendor/autoload.php";\n\n# 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n# 1.创建海报客户端对象\n$client = new Fastposter\\Client("'.concat(this.token,'", "').concat(this.apiUrl,'");\n\n# 2.准备海报参数(从实际业务系统中获取)\n$params = ').concat(t,';\n\n# 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\n$client->buildPoster("').concat(this.posterId||"未生成",'", $params)->save("demo.png");');return e}}}),Ma=Ua,za=(n("e5de"),Object(c["a"])(Ma,Ta,Ha,!1,null,"653b3ad6",null)),Da=za.exports,La=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-javascript line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},Na=[],qa=(n("416b"),{name:"FpCodeJs",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.javascript,"javascript")}},methods:{code:function(){var t=this.json();return"import fastposter from 'fastposter';\n\n// 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n// 1.创建海报客户端对象\nlet client = fastposter.init({token: \"".concat(this.token,'", endpoint: "').concat(this.apiUrl,'"});\n\n// 2.准备海报参数(从实际业务系统中获取)\nlet params = ').concat(t,"\n\n// 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\nclient.buildPoster('").concat(this.posterId||"未生成","', params)\n .then((res)=>{\n // 将res 信息直接复制到 img 标签的 src 属性上即可\n // document.getElementById('myImg').src = res\n })")}}}),Ka=qa,Ja=(n("25fa"),Object(c["a"])(Ka,La,Na,!1,null,"55653a6e",null)),Wa=Ja.exports,Va={name:"FpCodeContainer",components:{FpCodeJs:Wa,FpCodePhp:Da,FpCodePython:_a,FpCodeJava:ba,FpCodeGo:Sa},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),data:function(){return{activeName:"JS"}},methods:{}},Ga=Va,Za=Object(c["a"])(Ga,sa,oa,!1,null,null,null),Xa=Za.exports,Ya=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"修改密码",visible:t.editor.showChangePwd,width:"35%"},on:{"update:visible":function(e){return t.$set(t.editor,"showChangePwd",e)}}},[n("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:t.ruleForm,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"原密码",prop:"password"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{"show-password":"",placeholder:"请输入原密码"},model:{value:t.ruleForm.password,callback:function(e){t.$set(t.ruleForm,"password",e)},expression:"ruleForm.password"}})],1),n("el-form-item",{attrs:{label:"新密码",prop:"passwordNew"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{"show-password":"",placeholder:"请输入新密码"},model:{value:t.ruleForm.passwordNew,callback:function(e){t.$set(t.ruleForm,"passwordNew",e)},expression:"ruleForm.passwordNew"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("确定")])],1)],1)],1)},Qa=[],ts={name:"FpChangePwd",computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),data:function(){return{ruleForm:{password:"",passwordNew:""},rules:{password:[{required:!0,message:"请输入原密码",trigger:"blur"},{min:3,max:32,message:"长度在 3 到 32 个字符",trigger:"blur"}],passwordNew:[{required:!0,message:"请输入新密码",trigger:"blur"},{min:3,max:32,message:"长度在 3 到 32 个字符",trigger:"blur"}]}}},methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({changepwd:"editor/changepwd"})),{},{submitForm:function(t){var e=this;return this.$refs[t].validate((function(t){t&&e.changepwd(e.ruleForm).then((function(t){e.$message.success("操作成功"),e.editor.showChangePwd=!1}))})),!1}})},es=ts,ns=Object(c["a"])(es,Ya,Qa,!1,null,"99604cd0",null),is=ns.exports,as=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"凭证管理",visible:t.editor.showTokenManager,width:"50%","custom-class":"token-manager-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showTokenManager",e)}}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list}},[n("el-table-column",{attrs:{prop:"code",label:"令牌",width:"300"}}),n("el-table-column",{attrs:{prop:"create_time",label:"创建时间",width:"180"}}),n("el-table-column",{attrs:{prop:"status",label:"启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{attrs:{"active-value":1,"inactive-value":2,"active-color":"#13ce66"},on:{change:function(n){return t.updateToken(e.row)}},model:{value:e.row.status,callback:function(n){t.$set(e.row,"status",n)},expression:"scope.row.status"}})]}}])}),n("el-table-column",{attrs:{prop:"remark",label:"备注",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{on:{blur:function(n){return t.updateToken(e.row)}},model:{value:e.row.remark,callback:function(n){t.$set(e.row,"remark",n)},expression:"scope.row.remark"}})]}}])})],1)],1)},ss=[],os={name:"FpTokenManager",data:function(){return{list:[]}},watch:{"editor.showTokenManager":{handler:function(t){t&&this.query()}}},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),methods:{query:function(){var t=this;$t.queryTokenList().then((function(e){0===e.code&&(t.list=e.data.list)}))},updateToken:function(t){$t.updateToken(t)}}},rs=os,cs=(n("660e"),Object(c["a"])(rs,as,ss,!1,null,null,null)),ls=cs.exports,us=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-dialog",{attrs:{title:"用户管理",visible:t.editor.showUserManager,width:"60%","custom-class":"user-manager-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showUserManager",e)}}},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.dataForm}},[n("el-form-item",[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"用户名"},model:{value:t.dataForm.keyword,callback:function(e){t.$set(t.dataForm,"keyword",e)},expression:"dataForm.keyword"}})],1),n("el-form-item",{attrs:{label:"状态"}},[n("el-select",{staticStyle:{width:"100px"},attrs:{clearable:"",placeholder:"状态"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[n("el-option",{attrs:{label:"启用",value:1}}),n("el-option",{attrs:{label:"禁用",value:2}})],1)],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.query}},[t._v("查询")])],1),n("el-form-item",[n("el-button",{attrs:{type:"success"},on:{click:function(e){return t.editHandler({})}}},[t._v("新增")])],1)],1),n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list,height:"450"}},[n("el-table-column",{attrs:{prop:"id",label:"ID",width:"80"}}),n("el-table-column",{attrs:{prop:"username",label:"用户名",width:"150"}}),n("el-table-column",{attrs:{prop:"remark",label:"备注",width:"150"}}),n("el-table-column",{attrs:{prop:"create_time",label:"创建时间",width:"180"}}),n("el-table-column",{attrs:{prop:"status",label:"启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{attrs:{"active-value":1,"inactive-value":2,"active-color":"#13ce66"},on:{change:function(n){return t.update(e.row)}},model:{value:e.row.status,callback:function(n){t.$set(e.row,"status",n)},expression:"scope.row.status"}})]}}])}),n("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-tag",{staticStyle:{"margin-right":"10px"},on:{click:function(n){return t.editHandler(e.row)}}},[t._v("编辑")]),n("el-tag",{attrs:{type:"danger"},on:{click:function(n){return t.deleteHandler(e.row)}}},[t._v("删除")])]}}])})],1),n("el-pagination",{staticStyle:{position:"absolute",bottom:"20px"},attrs:{"current-page":t.page,"page-sizes":[10,20,30,40],"page-size":t.limit,layout:"total, sizes, prev, pager, next",total:t.total},on:{"current-change":function(e){return t.query()},"update:currentPage":function(e){t.page=e},"update:current-page":function(e){t.page=e},"update:pageSize":function(e){t.limit=e},"update:page-size":function(e){t.limit=e}}})],1),n("el-dialog",{attrs:{title:this.edit.title+"用户",visible:t.edit.show,width:"40%"},on:{"update:visible":function(e){return t.$set(t.edit,"show",e)}}},[n("el-form",{ref:"dataForm",attrs:{model:t.edit.dataForm,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"用户名",prop:"username"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"用户名"},model:{value:t.edit.dataForm.username,callback:function(e){t.$set(t.edit.dataForm,"username",e)},expression:"edit.dataForm.username"}})],1),n("el-form-item",{attrs:{label:"密码",prop:"password"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{"show-password":"",placeholder:"密码"},model:{value:t.edit.dataForm.password,callback:function(e){t.$set(t.edit.dataForm,"password",e)},expression:"edit.dataForm.password"}})],1),n("el-form-item",{attrs:{label:"备注",prop:"remark"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"备注"},model:{value:t.edit.dataForm.remark,callback:function(e){t.$set(t.edit.dataForm,"remark",e)},expression:"edit.dataForm.remark"}})],1),n("el-form-item",{attrs:{label:"状态",prop:"status"}},[n("el-select",{staticStyle:{width:"100px"},attrs:{clearable:"",placeholder:"状态"},model:{value:t.edit.dataForm.status,callback:function(e){t.$set(t.edit.dataForm,"status",e)},expression:"edit.dataForm.status"}},[n("el-option",{attrs:{label:"启用",value:1}}),n("el-option",{attrs:{label:"禁用",value:2}})],1)],1),n("el-form-item",[n("el-button",{on:{click:function(e){t.edit.show=!1}}},[t._v("取消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataFormSubmitHandle()}}},[t._v("确认")])],1)],1)],1)],1)},ds=[],ps={name:"FpUserManager",data:function(){return{list:[],page:1,limit:10,total:0,dataForm:{keyword:""},edit:{show:!1,title:"",dataForm:{id:"",username:"",password:"",remark:"",status:1}}}},watch:{"editor.showUserManager":{handler:function(t){t&&this.query()}}},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),methods:{query:function(t){var e=this;$t.http.get("api/admin/users",{params:Object(y["a"])(Object(y["a"])({},this.dataForm),{},{page:this.page,limit:this.limit})}).then((function(t){0===t.code&&(e.list=t.data.list,e.total=t.data.total)}))},update:function(t){var e=this;$t.http.put("api/admin/users",t).then((function(t){0===t.code&&(e.$message.success("操作成功"),e.edit.show=!1,e.query())}))},editHandler:function(t){var e=this;this.edit.show=!0,t&&t.id?this.edit.title="编辑":this.edit.title="新增",this.$nextTick((function(){e.$refs["dataForm"].resetFields(),t.id&&$t.http.get("api/admin/users/"+t.id).then((function(t){0===t.code&&(e.edit.dataForm=t.data.user)}))}))},deleteHandler:function(t){var e=this;this.$confirm("是否删除此[".concat(t.username,"]记录?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){$t.http.delete("api/admin/users/"+t.id).then((function(t){0===t.code&&(e.$message.success("操作成功"),e.query())}))}))},dataFormSubmitHandle:function(){var t=this,e=Object(y["a"])({},this.edit.dataForm);e.id?this.update(e):$t.http.post("api/admin/users",e).then((function(e){0===e.code&&(t.$message.success("操作成功"),t.edit.show=!1,t.query())}))}}},fs=ps,hs=(n("d461"),Object(c["a"])(fs,us,ds,!1,null,"26d826a8",null)),ms=hs.exports,vs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[n("div",{staticClass:"title",on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchHandler.apply(null,arguments)}}},[n("el-input",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"搜索素材",size:"normal"},model:{value:t.params.name,callback:function(e){t.$set(t.params,"name",e)},expression:"params.name"}},[n("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"prefix"},slot:"prefix"})])],1),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items2,(function(e){return n("div",{key:e.id,staticClass:"fp-img",attrs:{title:e.name},on:{click:function(n){return t.addItemToEditor(e)}}},[n("img",{attrs:{src:e.preview}}),n("div",{staticClass:"fp-material-tool"},[n("i",{staticClass:"iconfont icon-shanchu i-btn",attrs:{title:"删除"},on:{click:function(n){return n.stopPropagation(),t.remove(e.id)}}})])])})),0),n("fp-empty",{attrs:{data:t.items}})],1)])},gs=[],bs=(n("841c"),{name:"FpAsideMaterial",components:{FpEmpty:Li},data:function(){return{params:{name:""}}},computed:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["e"])({items:function(t){return t.panelmaterial.items},p:function(t){return t.poster.p}})),Object(P["c"])({scale:"poster/scale"})),{},{items2:function(){return this.items.map((function(t){return{id:t.id,t:"image",name:t.filename,desc:"点击创建",v:t.path,preview:t.preview,w:200,uid:t.uid}}))}}),created:function(){this.searchHandler()},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({search:"panelmaterial/search",_remove:"panelmaterial/remove"})),Object(P["d"])({addItem:"poster/addItem",record:"snapshots/record"})),{},{addItemToEditor:function(t){var e=new Image,n=this;e.src=$t.imgUrl(t.v),e.onload=function(){t.w=e.width,t.h=e.height,n.addItem(t),n.record("新增素材: ".concat(t.name))}},searchHandler:function(){this.search(Object(y["a"])({},this.params))},remove:function(t){var e=this;this.$confirm("确定要删除素材吗?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e._remove(t).then((function(){e.searchHandler()}))}))}})}),ws=bs,ys=(n("746b"),Object(c["a"])(ws,vs,gs,!1,null,"6b5a316c",null)),xs=ys.exports,Cs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"批量生成",width:"80%",visible:t.editor.showBatch,"custom-class":"batch-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showBatch",e)},open:t.openDialog}},[n("div",{staticClass:"batch-container"},[n("div",{staticClass:"batch-preview"},[n("img",{attrs:{src:t.poster.preview}}),n("fp-empty",{attrs:{data:t.poster.preview,size:"60"}})],1),n("div",{staticClass:"batch-form"},[n("el-form",{ref:"form",attrs:{inline:!0,model:t.form,"label-width":"100px"}},[n("div",[n("el-form-item",{attrs:{label:"海报"}},[n("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择海报"},on:{change:t.changeHandler},model:{value:t.form.posterId,callback:function(e){t.$set(t.form,"posterId",e)},expression:"form.posterId"}},t._l(t.options,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),n("el-form-item",{attrs:{label:"类型"}},[n("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[n("el-radio",{attrs:{value:"jpeg",label:"jpeg"}}),n("el-radio",{attrs:{value:"png",label:"png"}}),n("el-radio",{attrs:{value:"pdf",label:"pdf"}})],1)],1)],1),n("el-form-item",{attrs:{label:"数据"}},[n("div",{staticStyle:{display:"flex","justify-content":"left","align-items":"flex-start",width:"200px"}},[t.showDownTemplate?n("fp-button",{on:{click:t.downTemplateHandler}},[t._v("1.下载模板")]):n("fp-button",{staticStyle:{color:"#d84689"},attrs:{disabled:""}},[t._v(t._s(t.temlateTipText))]),n("fp-file-upload",{directives:[{name:"show",rawName:"v-show",value:t.showDownTemplate,expression:"showDownTemplate"}],staticStyle:{"margin-left":"12px"},attrs:{buttonText:"2.导入数据",accept:".xls,.xlsx,.csv","auto-upload":!1},on:{change:t.importHandler}})],1)]),n("el-form-item",{attrs:{label:"数量"}},[n("el-input-number",{staticStyle:{width:"100px"},attrs:{size:"small","controls-position":"right",min:0,max:t.raw.length},model:{value:t.form.num,callback:function(e){t.$set(t.form,"num",e)},expression:"form.num"}})],1),n("el-form-item",[n("el-button",{attrs:{loading:t.fullscreenLoading,type:"primary"},on:{click:t.onSubmit}},[t._v(" 生成 ")])],1)],1),n("div",{staticStyle:{height:"46.8vh"}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.raw,height:"100%",stripe:"",border:""}},t._l(t.table,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.prop,label:t.label}})})),1)],1)],1)])])},ks=[],_s=n("1da1"),js=(n("96cf"),n("25ca")),Os={name:"FpPatch",components:{FpEmpty:Li,FpButton:A,FpFileUpload:Un},data:function(){return{poster:{},row:[],table:[],raw:[],fullscreenLoading:!1,form:{id:"",name:"",type:"jpeg",posterId:"",num:0,doneNum:0,path:"",status:0}}},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor},panelposter:function(t){return t.panelposter},p:function(t){return t.poster.p}})),{},{options:function(){return this.panelposter.items.map((function(t){return{value:t.id,label:t.name}}))},showDownTemplate:function(){return!Object(bt["isEmpty"])(this.row)},temlateTipText:function(){return"无法生成模板"+(this.poster.id?",请先设置海报参数":",请先选择海报")}}),methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({getPoster:"poster/getPoster",saveOrUpdate:"batch/saveOrUpdate",loadBatch:"batch/loadBatch",getItems:"batch/getItems"})),{},{openDialog:function(){this.getBatch(this.editor.batchId)},getBatch:function(t){var e=this;this.fullscreenLoading=!1,this.raw=[],0===t&&(this.row={},this.poster={},this.table=[],this.form={id:"",name:"",type:"jpeg",posterId:"",num:0,doneNum:0,path:"",status:0}),t?this.loadBatch(t).then((function(t){var n=t.raw;delete t["raw"],e.form=Object(y["a"])(Object(y["a"])({},e.form),t),e.getPoster(t.posterId).then((function(t){e.loadPoster(t),e.raw=JSON.parse(n),e.form.num=e.raw.length}))})):this.p.id&&this.changeHandler(this.p.id)},loadPoster:function(t){this.poster=this.panelposter.items.filter((function(e){return e.id===t.id}))[0];var e={},n=[];t.items.forEach((function(t){t.vd&&(e[t.vd]=t.v,n.push({key:t.uuid,prop:t.vd,label:t.vd}))})),this.row=e,this.table=n,this.form.name=this.poster.name,this.form.posterId=this.poster.id},changeHandler:function(t){var e=this;this.getPoster(t).then((function(t){return e.loadPoster(t)}))},onSubmit:function(){var t=this;if(this.form.posterId)if(Object(bt["isEmpty"])(this.raw))this.$message.warning("请先导入数据");else{var e=Object(y["a"])(Object(y["a"])({},this.form),{},{raw:JSON.stringify(this.raw)});this.fullscreenLoading=!0,this.saveOrUpdate(e).then((function(e){t.form=Object(y["a"])(Object(y["a"])({},t.form),e),t.fullscreenLoading=!1,t.$message.success("处理成功,请稍后"),t.editor.showBatch=!1,t.editor.batchPosterId=0,t.getItems().then((function(t){return console.info("重新加载")}))}))}else this.$message.warning("请先选择海报")},downTemplateHandler:function(){var t=[this.row],e=js["b"].json_to_sheet(t),n=js["b"].book_new();js["b"].book_append_sheet(n,e,"sheet"),js["c"](n,"".concat(this.poster.name,"-模板.xlsx"))},importHandler:function(t){var e=this;return Object(_s["a"])(regeneratorRuntime.mark((function n(){var i,a,s,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.raw,n.next=3,i.arrayBuffer();case 3:a=n.sent,s=js["a"](a),o=s.Sheets[s.SheetNames[0]],e.raw=js["b"].sheet_to_json(o),e.form.num=e.raw.length;case 8:case"end":return n.stop()}}),n)})))()}})},Ps=Os,Fs=(n("a268"),n("9a55"),Object(c["a"])(Ps,Cs,ks,!1,null,"69dd9502",null)),Is=Fs.exports,Ss=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[n("div",{staticClass:"title"},[n("h3",[t._v("批量生成")]),n("fp-button",{staticStyle:{position:"absolute",right:"20px",top:"10px"},on:{click:t.createBatch}},[t._v("创建 ")])],1),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items,(function(e){return n("div",{key:e.id+"-"+e.doneNum,staticClass:"batch-item",on:{click:function(n){return t.editBatch(e)}}},[n("h4",[t._v(t._s(e.name))]),n("p",{staticStyle:{color:"#606266"}},[t._v(t._s(e.doneNum)+"/"+t._s(e.num))]),n("el-progress",{attrs:{percentage:~~(e.doneNum/e.num*100)}}),n("div",[n("el-tag",{staticStyle:{"margin-right":"10px"},attrs:{type:"info",effect:"dark",title:"删除"},on:{click:function(n){return n.stopPropagation(),t.removeHandler(e)}}},[t._v("删除 ")]),n("el-tag",{attrs:{type:t._f("statusTypeFilter")(e.status),effect:"dark"}},[t._v(t._s(t._f("statusFilter")(e.status)))]),2===e.status?n("a",{staticStyle:{"text-decoration":"none","margin-left":"10px"},attrs:{href:t._f("downLoadUrl")(e.path),target:"_blank"},on:{click:t.downloadHandler}},[n("el-tag",{attrs:{type:"primary",effect:"dark",title:"点击下载"}},[t._v("下载")])],1):t._e()],1)],1)})),0),n("fp-empty",{attrs:{data:t.items}})],1)])},Es=[],$s={name:"FpAsideBatch",components:{FpButton:A,FpEmpty:Li},data:function(){return{params:{name:""},timer:null}},filters:{statusTypeFilter:function(t){var e="0info 1primary 2success 3warning".split(" ");return t>=e.length?"danger":e[t].slice(1)},statusFilter:function(t){var e="0暂未开始 1正在处理 2处理完成 3异常结束".split(" ");return t>=e.length?"未知状态":e[t].slice(1)},downLoadUrl:function(t){return t&&!t.startsWith("http")?window.API_URL+t:t}},computed:Object(y["a"])({},Object(P["e"])({items:function(t){return t.batch.items},p:function(t){return t.poster.p},editor:function(t){return t.editor}})),created:function(){this.search();var t=this;this.timer=setInterval((function(){t.search()}),5e3)},destroyed:function(){window.clearInterval(this.timer)},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({search:"batch/getItems",remove:"batch/remove"})),Object(P["d"])({})),{},{searchHandler:function(){this.search()},editBatch:function(t){this.editor.showBatch=!0,this.editor.batchPosterId=t.posterId,this.editor.batchId=t.id},createBatch:function(){this.editor.showBatch=!0,this.editor.batchPosterId=0,this.editor.batchId=0},downloadHandler:function(t){t.stopPropagation()},removeHandler:function(t,e){var n=this,i=t.id;this.$confirm("确定要删除该批量记录吗?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.remove(i).then((function(){n.search()}))}))}})},As=$s,Bs=(n("8d9a"),Object(c["a"])(As,Ss,Es,!1,null,"90643bea",null)),Rs=Bs.exports,Ts={name:"FpDesign",components:{FpAsideBatch:Rs,FpAsideMaterial:xs,FpUserManager:ms,FpTokenManager:ls,FpChangePwd:is,FpCodeContainer:Xa,FpAsidePanelPoster:aa,FpLogin:Yi,FpAsidePanelLayer:Ji,FpAsidePanelComponent:Bi,FpBatch:Is,FpDebugPanel:fi,FpSettingContainer:si,FpMainContainer:vn,FpAsideExtend:rt,FpAside:et,FpHeader:N},computed:Object(y["a"])({},Object(P["e"])({activeId:function(t){return t.aside.activeId}}))},Hs=Ts,Us=(n("68f4"),n("31bf"),Object(c["a"])(Hs,b,w,!1,null,"9ae2cca4",null)),Ms=Us.exports,zs={name:"Home",components:{FpDesign:Ms}},Ds=zs,Ls=(n("972d"),Object(c["a"])(Ds,v,g,!1,null,"1bb0581b",null)),Ns=Ls.exports;s["default"].use(m["a"]);var qs=[{path:"/",name:"Home",component:Ns},{path:"/about",name:"About",component:function(){return n.e("about").then(n.bind(null,"f820"))}},{path:"*",name:"HomePattern",component:Ns}],Ks=new m["a"]({mode:"history",routes:qs}),Js=Ks,Ws={items:[],activeId:0},Vs={isActived:function(){return 0!==Ws.activeId}},Gs={getItems:function(t){var e=t.commit;$t.loadAsideItems((function(t){e("set_items",t)}))},setActiveItem:function(t,e){var n=t.commit;n("set_active_id",e)},openPoster:function(t){var e=t.commit;e("set_active_id",{id:5,activated:!0})}},Zs={set_items:function(t,e){t.items=e,t.items.filter((function(t){return t.activated})).forEach((function(e){return t.activeId=e.id}))},set_active_id:function(t,e){var n=e.id,i=e.activated;e.extend;t.activeId!==n||i?(t.activeId=n,t.items.filter((function(t){return t.id!==n})).forEach((function(t){return t.activated=!1})),t.items.filter((function(t){return t.id===n})).forEach((function(t){return t.activated=!0}))):t.activeId=0}},Xs={namespaced:!0,state:Ws,getters:Vs,actions:Gs,mutations:Zs},Ys={snapshots:[],snapshots2:[],index:-1,maxIndex:100},Qs={canUndo:function(){return Ys.index>0},canRedo:function(){return Ys.index<Ys.snapshots.length-1}},to={},eo={clear:function(t){t.snapshots=[],t.snapshots2=[],t.index=-1},record:function(t,e){var n=t.snapshots2[t.index],i=JSON.stringify(_i.state.p);n!==i?(t.index++,console.info("record state.index=",t.index,"name=",e),t.snapshots[t.index]=e,t.snapshots2[t.index]=JSON.stringify(_i.state.p),t.index<t.snapshots.length-1&&(t.snapshots=t.snapshots.slice(0,t.index+1),t.snapshots2=t.snapshots2.slice(0,t.index+1))):console.warn("no any change to record!")},undo:function(t){if(t.index>0){t.index--;var e=JSON.parse(t.snapshots2[t.index]);e.key=Object(bt["uniqueId"])(),s["default"].set(_i.state,"p",e)}},redo:function(t){if(t.index<t.snapshots.length-1){t.index++;var e=JSON.parse(t.snapshots2[t.index]);e.key=Object(bt["uniqueId"])(),s["default"].set(_i.state,"p",e)}}},no={namespaced:!0,state:Ys,getters:Qs,actions:to,mutations:eo},io={items:[]},ao={},so={getItems:function(t){var e=t.commit;return new Promise((function(t){$t.loadPosters((function(n){var i=n.data.posters;i.forEach((function(t){t.preview=t.preview.startsWith("http")?t.preview:$t.baseURL+t.preview})),e("setItems",i),t(i)}))}))}},oo={setItems:function(t,e){t.items=e}},ro={namespaced:!0,state:io,getters:ao,actions:so,mutations:oo},co={items:[]},lo={},uo={search:function(t,e){var n=t.commit;return new Promise((function(t){$t.loadMaterial(e,(function(e){var i=e.data.items;i.forEach((function(t){t.preview=t.path.startsWith("http")?t.path:$t.baseURL+t.path})),n("setItems",i),t(e)}))}))},remove:function(t,e){t.commit;return new Promise((function(t){$t.removeMaterial(e,(function(e){t(e)}))}))}},po={setItems:function(t,e){t.items=e}},fo={namespaced:!0,state:co,getters:lo,actions:uo,mutations:po},ho={items:[]},mo={},vo={getItems:function(t){var e=t.commit;return new Promise((function(t){$t.loadBatchs((function(n){var i=n.data.items;e("setItems",i),t(i)}))}))},loadBatch:function(t,e){t.commit;return new Promise((function(t){console.info("loadBatch",e),$t.loadBatch(e,(function(e){t(e.data.batch)}))}))},saveOrUpdate:function(t,e){t.commit;return new Promise((function(t){e.id?$t.updatBatch(e,(function(e){t(e.data.batch)})):$t.saveBatch(e,(function(e){t(e.data.batch)}))}))},remove:function(t,e){t.commit;return new Promise((function(t){$t.removeBatch(e,(function(e){t(e.data.batch)}))}))}},go={setItems:function(t,e){t.items=e}},bo={namespaced:!0,state:ho,getters:mo,actions:vo,mutations:go},wo={aside:Xs,poster:_i,editor:jt,snapshots:no,panelposter:ro,panelmaterial:fo,batch:bo};s["default"].use(P["a"]);var yo=new P["a"].Store({state:{},mutations:{},actions:{},modules:Object(y["a"])({},wo)});n("f689");s["default"].use(a.a,{size:"small"}),s["default"].config.productionTip=!1;var xo=new s["default"]({router:Js,store:yo,render:function(t){return t(d)}});h(xo),xo.$mount("#app")},5773:function(t,e,n){},"5f36":function(t,e,n){},"660e":function(t,e,n){"use strict";n("9dd8")},"67da":function(t,e,n){"use strict";n("4fbb")},"68f4":function(t,e,n){"use strict";n("4822")},7316:function(t,e,n){"use strict";n("2fca")},"746b":function(t,e,n){"use strict";n("2ac4")},7791:function(t,e,n){},"79b1":function(t,e,n){"use strict";n("fd28")},"7a7a":function(t,e,n){"use strict";n("d93b")},"7ad2":function(t,e,n){},8428:function(t,e,n){"use strict";n("2a6b")},8747:function(t,e,n){"use strict";n("33c4")},"888c":function(t,e,n){"use strict";n("bc89")},8966:function(t,e,n){},"8a15":function(t,e,n){"use strict";n("5f36")},"8d9a":function(t,e,n){"use strict";n("d55e")},9035:function(t,e,n){},"905a":function(t,e,n){},"92c7":function(t,e,n){},"964f":function(t,e,n){},"972d":function(t,e,n){"use strict";n("a627")},"9a55":function(t,e,n){"use strict";n("b506")},"9bd0":function(t,e,n){},"9c7c":function(t,e,n){},"9dd8":function(t,e,n){},"9fb2":function(t,e,n){"use strict";n("3cbc")},a1b9:function(t,e,n){"use strict";n("9035")},a268:function(t,e,n){"use strict";n("207a")},a627:function(t,e,n){},a62c:function(t,e,n){},ab8b:function(t,e,n){"use strict";n("cff1")},acbe:function(t,e,n){"use strict";n("f18f")},b14c:function(t,e,n){"use strict";n("a62c")},b506:function(t,e,n){},b720:function(t,e,n){"use strict";n("2c18")},ba4e:function(t,e,n){"use strict";n("d5ed")},bc89:function(t,e,n){},bcbd:function(t,e,n){},c791:function(t,e,n){"use strict";n("e15a")},c99f:function(t,e,n){"use strict";n("9c7c")},cff1:function(t,e,n){},d461:function(t,e,n){"use strict";n("92c7")},d4a4:function(t,e,n){"use strict";n("7791")},d55e:function(t,e,n){},d5ed:function(t,e,n){},d8cd:function(t,e,n){"use strict";n("ec41")},d93b:function(t,e,n){},da01:function(t,e,n){"use strict";n("bcbd")},dce8:function(t,e,n){"use strict";n("964f")},e15a:function(t,e,n){},e5de:function(t,e,n){"use strict";n("f49f")},e72f:function(t,e,n){"use strict";n("fdee")},eaf8:function(t,e,n){"use strict";n("46e2")},eb43:function(t,e,n){"use strict";n("8966")},ec41:function(t,e,n){},f18f:function(t,e,n){},f49f:function(t,e,n){},f689:function(t,e,n){},fd28:function(t,e,n){},fdee:function(t,e,n){},fefd:function(t,e,n){"use strict";n("7ad2")}});