2 lines
83 KiB
JavaScript
2 lines
83 KiB
JavaScript
import{o as t,e,w as i,T as n,k as s,j as r,am as o,H as a,an as h,ao as l,ap as c,aq as d,ar as u,n as f,i as p,as as g,at as m,d as v,a as x,U as y,au as b,l as w,f as S,h as _,a7 as k,r as z,b as I,c as P,m as M,p as W,X as R,g as T,av as O,a4 as B,aw as j,E as C,V as F,G as L,q as A,F as $,K as E,t as H,v as N,W as U,u as D,ax as Y,$ as q,R as X,ay as V}from"./index-de4504bf.js";import{_ as J}from"./page-meta.6ef9508b.js";import{a as G,_ as Q}from"./u-back-top.9c9e6d0a.js";import{_ as K}from"./price.f89460af.js";import{_ as Z}from"./u-icon.a29926e1.js";import{_ as et}from"./u-image.c4f072e6.js";import{_ as it}from"./u-rate.39cd2912.js";import{_ as nt}from"./mp-html.c07d1326.js";import{_ as st}from"./u-button.f68b46c8.js";import{_ as rt}from"./u-empty.51791ef5.js";import{_ as ot}from"./page-status.945e56e1.js";import{a as at,_ as ht}from"./u-popup.41f5d54c.js";import{_ as lt}from"./_plugin-vue_export-helper.1b428a4d.js";import{a as ct}from"./goods.48c13c31.js";import"./u-swiper.699073b8.js";import"./u-loading.dc153382.js";const dt=(t="")=>t.split(";").filter(t=>t&&!/^[\n\s]+$/.test(t)).map(t=>{const e=t.slice(0,t.indexOf(":")),i=t.slice(t.indexOf(":")+1);return{[e.replace(/-([a-z])/g,function(){return arguments[1].toUpperCase()}).replace(/\s+/g,"")]:i.replace(/^\s+/,"").replace(/\s+$/,"")||""}});function ut(t){return{provide(){return{[t]:this}},data:()=>({el:{css:{},views:[]}}),watch:{css:{handler(t){this.canvasId&&(this.el.css=("object"==typeof t?t:t&&Object.assign(...dt(t)))||{},this.canvasWidth=this.el.css&&this.el.css.width||this.canvasWidth,this.canvasHeight=this.el.css&&this.el.css.height||this.canvasHeight)},immediate:!0}}}}function ft(t,e={}){return e.indexKey,{inject:{[t]:{default:null}},watch:{el:{handler(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0},src:{handler(t,e){t!=e&&this.bindRelation()},immediate:!0},text:{handler(t,e){t!=e&&this.bindRelation()},immediate:!0},css:{handler(t,e){t!=e&&(this.el.css=("object"==typeof t?t:t&&Object.assign(...dt(t)))||{})},immediate:!0},replace:{handler(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0}},created(){this._uid||(this._uid=this._.uid),Object.defineProperty(this,"parent",{get:()=>this[t]||[]}),Object.defineProperty(this,"index",{get:()=>{this.bindRelation();const{parent:{el:{views:t=[]}={}}={}}=this;return t.indexOf(this.el)}}),this.el.type=this.type,this.bindRelation()},beforeUnmount(){this.removeEl()},methods:{removeEl(){this.parent&&(this.parent.el.views=this.parent.el.views.filter(t=>t._uid!==this._uid))},bindRelation(){if(this.el._uid||(this.el._uid=this._uid),["text","qrcode"].includes(this.type)&&(this.el.text=this.$slots&&this.$slots.default&&this.$slots.default[0].text||`${this.text||""}`.replace(/\\n/g,"\n")),"image"==this.type&&(this.el.src=this.src),!this.parent)return;let t=this.parent.el.views||[];-1!==t.indexOf(this.el)?this.parent.el.views=t.map(t=>t._uid==this._uid?this.el:t):this.parent.el.views=[...t,this.el]}},mounted(){}}}const pt=lt({name:"lime-painter-image",mixins:[ft("painter")],props:{css:[String,Object],src:String},data:()=>({type:"image",el:{css:{},src:null}})},[["render",function(t,e,i,n,s,r){return null}]]);const gt=lt({name:"lime-painter-text",mixins:[ft("painter")],props:{css:[String,Object],text:[String,Number],replace:Object},data:()=>({type:"text",el:{css:{},text:null}})},[["render",function(r,o,a,h,l,c){const d=s;return t(),e(d,{style:{opacity:"0",height:"0"}},{default:i(()=>[n(r.$slots,"default")]),_:3})}]]);const mt=lt({name:"lime-painter-view",mixins:[ft("painter"),ut("painter")],props:{css:[String,Object]},data:()=>({type:"view",el:{css:{},views:[]}}),mounted(){}},[["render",function(s,o,a,h,l,c){const d=r;return t(),e(d,null,{default:i(()=>[n(s.$slots,"default")]),_:3})}]]);const vt=lt({name:"lime-painter-qrcode",mixins:[ft("painter")],props:{css:[String,Object],text:String},data:()=>({type:"qrcode",el:{css:{},text:null}})},[["render",function(t,e,i,n,s,r){return null}]]),xt={props:{board:Object,pathType:String,fileType:{type:String,default:"png"},hidden:Boolean,quality:{type:Number,default:1},css:[String,Object],width:[Number,String],height:[Number,String],pixelRatio:Number,customStyle:String,isCanvasToTempFilePath:Boolean,sleep:{type:Number,default:1e3/30},beforeDelay:{type:Number,default:100},afterDelay:{type:Number,default:100},useCORS:Boolean}},yt=t=>/^data:image\/(\w+);base64/.test(t);function bt(t){return new Promise(e=>setTimeout(e,t))}["devtools"].includes(o().platform);let wt={};function St(t,e,i=!1){if("number"==typeof t)return t;if(function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t))return 1*t;if("string"==typeof t){const n=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g.exec(t);if(!t||!n)return 0;const s=n[3];t=parseFloat(t);let r=0;return"rpx"===s?r=a(t):"px"===s?r=1*t:"%"===s?r=t*St(e)/100:"em"===s&&(r=t*St(e||14)),i?1*r.toFixed(2):Math.round(r)}return 0}function _t(t){return/^data:/.test(t)?t:new Promise((e,i)=>{let n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){let t=document.createElement("canvas");t.width=this.naturalWidth,t.height=this.naturalHeight,t.getContext("2d").drawImage(n,0,0);let i=t.toDataURL("image/png");e(i),t.height=t.width=0},n.src=t+"?v="+Math.random(),n.onerror=t=>{i(t)}})}function kt(t,e){const i=this&&this.canvas&&this.canvas.createImage;return new Promise(async(n,s)=>{let r=t;if(wt[t]&&wt[t].errMsg)n(wt[t]);else{try{e&&(r=await _t(t))}catch(o){s({...o,src:r})}h({src:r,success:e=>{if(e.path=e.path.replace(/^\./,window.location.origin),i){const i=this.canvas.createImage();return i.onload=function(){e.path=i,wt[t]=e,n(wt[t])},i.onerror=function(e){s({err:e,path:t})},void(i.src=r)}wt[t]=e,n(wt[t])},fail(e){console.error({err:e,path:t}),s({err:e,path:t})}})}})}var zt=function(){return zt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},zt.apply(this,arguments)};function It(t,e,i,n){return new(i||(i=Promise))(function(s,r){function o(t){try{h(n.next(t))}catch(e){r(e)}}function a(t){try{h(n.throw(t))}catch(e){r(e)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}h((n=n.apply(t,e||[])).next())})}function Pt(t,e){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(a){r=[6,a],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}var Mt={MP_WEIXIN:"mp-weixin",MP_QQ:"mp-qq",MP_ALIPAY:"mp-alipay",MP_BAIDU:"mp-baidu",MP_TOUTIAO:"mp-toutiao",MP_DINGDING:"mp-dingding",H5:"h5",WEB:"web",PLUS:"plus"},Wt=["contentSize","clientSize","borderSize","offsetSize"],Rt="view",Tt="text",Ot="image",Bt="qrcode",jt="block",Ct="inline-block",Ft="absolute",Lt="fixed",At={display:jt,color:"#000000",lineHeight:"1.4em",fontSize:14,fontWeight:400,fontFamily:"sans-serif",lineCap:"butt",flexDirection:"row",flexWrap:"nowrap",textAlign:"left",alignItems:"flex-start",justifyContent:"flex-start",position:"static",transformOrigin:"center center"},$t={upx2px:function(t){return window.innerWidth/750*t},getSystemInfoSync:function(){return{screenWidth:window.innerWidth,screenHeight:window.innerHeight}},getImageInfo:function(t){var e=t.src,i=t.success,n=t.fail,s=new Image;s.onload=function(){i({width:s.naturalWidth,height:s.naturalHeight,path:s.src,src:e})},s.onerror=n,s.src=e}},Et="object"==typeof window?"undefined"==typeof uni||"undefined"!=typeof uni&&!c?Mt.WEB:Mt.H5:"object"==typeof swan?Mt.MP_BAIDU:"object"==typeof tt?Mt.MP_TOUTIAO:"object"==typeof plus?Mt.PLUS:"object"==typeof wx?Mt.MP_WEIXIN:void 0,Ht=Et==Mt.MP_WEIXIN?wx:"undefined"!=typeof uni?h?{upx2px:function(t){return a(t)},getSystemInfoSync:function(){return o()},getImageInfo:function(t){return h(t)},downloadFile:function(t){return l(t)}}:Object.assign(uni,$t):"undefined"!=typeof window?$t:uni;if(!Ht.upx2px){var Nt=((Ht.getSystemInfoSync&&o()).screenWidth||375)/750;Ht.upx2px=function(t){return Nt*t}}function Ut(t){return/^-?\d+(\.\d+)?$/.test(t)}function Dt(t,e,i){if("number"==typeof t)return t;if(Ut(t))return 1*t;if("string"==typeof t){var n=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|vw|vh|px|%)$/g.exec(t);if(!t||!n)return 0;var s=n[3];t=parseFloat(t);var r=0;if("rpx"===s)r=Ht.upx2px(t);else if("px"===s)r=1*t;else if("%"===s&&e)r=t*Dt(e)/100;else if("em"===s&&e)r=t*Dt(e||14);else if(["vw","vh"].includes(s)){var o=Ht.getSystemInfoSync(),a=o.screenWidth,h=o.screenHeight;r=t*("vw"==s?a:h)/100}return 1*r.toFixed(2)}return 0}function Yt(t){return/%$/.test(t)}function qt(t){for(var e=[],i=[],n=0,s=t.substring(0,t.length-1).split("%,");n<s.length;n++){var r=s[n];e.push(r.substring(0,r.lastIndexOf(" ")).trim()),i.push(r.substring(r.lastIndexOf(" "),r.length)/100)}return{colors:e,percents:i}}function Xt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Vt(){return Vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Vt.apply(this,arguments)}function Jt(t,e){return(Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Qt(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Gt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Gt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Kt(t){return"number"==typeof t}function Zt(t){return"auto"===t||null===t}function te(t){return/%$/.test(t)}var ee,ie=Ot,ne=Tt,se=Rt,re=Bt,oe=Ct,ae=Ft,he=Lt,le=0,ce=function(){function t(){Xt(this,"elements",[]),Xt(this,"afterElements",[]),Xt(this,"beforeElements",[]),Xt(this,"ids",[]),Xt(this,"width",0),Xt(this,"height",0),Xt(this,"top",0),Xt(this,"left",0),Xt(this,"pre",null),Xt(this,"offsetX",0),Xt(this,"offsetY",0),le++,this.id=le}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return this.outerWidth||t.parent&&t.parent.contentSize.width,!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth&&(this.closeLine(),1))},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)<this.width&&(this.container.lineMaxWidth=this.width)},e.refreshXAlign=function(){if(this.isInline){var t=this.container.contentSize.width-this.width,e=this.container.style.textAlign;"center"===e?t/=2:"left"===e&&(t=0),this.offsetX=t}},e.getOffsetY=function(t){if(!t||!t.style)return 0;var e=(t.style||{}).verticalAlign;return"bottom"===e?this.height-t.contentSize.height:"middle"===e?(this.height-t.contentSize.height)/2:0},e.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach(function(t,e){var n=i.elements[e-1],s=i.getOffsetY(t);t.style.top=i.top+s,t.style.left=n?n.offsetSize.left+n.offsetSize.width:i.left,t.getBoxPosition()})},e.refreshLayout=function(){this.afterElements=this.afterElements.sort(function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex}),this.beforeElements=this.beforeElements.sort(function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex})},t}(),de=((ee={}).row={width:"width",contentWidth:"width",lineMaxWidth:"lineMaxWidth",left:"left",top:"top",height:"height",lineMaxHeight:"lineMaxHeight",marginLeft:"marginLeft"},ee.column={width:"height",contentWidth:"height",lineMaxWidth:"lineMaxHeight",left:"top",top:"left",height:"width",lineMaxHeight:"lineMaxWidth",marginLeft:"marginTop"},ee),ue=function(t){var e,i;function n(){var e;return Xt(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e=t.call(this)||this),"outerWidth",0),e.exactValue=0,e.flexTotal=0,e.width=0,e.key=null,e.flexDirection="row",e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,Jt(e,i);var s=n.prototype;return s.bind=function(t){console.warn("[painter] flex-box 功能未完善谨慎使用"),this.container=t.parent,this.container.line=this,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),t.parent&&(this.flexDirection=t.parent.style.flexDirection,this.key=de[this.flexDirection]),this.initHeight(t),this.outerWidth=t.parent&&t.parent.contentSize[this.key.contentWidth]?t.parent.contentSize[this.key.contentWidth]:1/0,this.add(t)},s.add=function(t){this.ids.push(t.id),Kt(t.style.flex)?this.flexTotal+=t.style.flex:Kt(t.style[this.key.width])&&(this.exactValue+=t.contentSize[this.key.width]||0),this.elements.push(t),this.refreshWidthHeight(t),t.next||this.closeLine()},s.closeLine=function(){this.calcFlex()},s.initHeight=function(t){this[this.key.height]=0},s.calcFlex=function(){var t=this,e=this.container.contentSize[this.key.contentWidth],i=0;this.elements.forEach(function(n){var s=n.style[t.key.width]||n.contentSize[t.key.width]||0;Kt(n.style.flex)&&(s=n.style.flex/t.flexTotal*(e-t.exactValue)),n.computedStyle[t.key.width]=s,n.isFlexCalc=!0,delete n.line,delete n.lines,delete n.lineMaxWidth,n.getBoxWidthHeight(),i=Math.max(i,n.offsetSize[t.key.height])}),this[this.key.height]=i},s.refreshWidthHeight=function(t){this.container.style.alignItems&&!t.style.alignSelf&&(t.style.alignSelf=this.container.style.alignItems),t.offsetSize[this.key.height]>this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=t.offsetSize[this.key.height]),this[this.key.width]+=t.offsetSize[this.key.width]||0;var e=Math.min(this[this.key.width],!this.container.contentSize[this.key.width]&&1/0);(this.container[this.key.lineMaxWidth]||0)<e&&(this.container[this.key.lineMaxWidth]=e)},s.refreshXAlign=function(){var t,e,i=this,n=this.elements.reduce(function(t,e){return t+e.offsetSize[i.key.width]},0),s=(this.outerWidth==1/0?0:this.outerWidth-n)||0,r=this.container.style.justifyContent;"center"===r?s/=2:"flex-start"===r?s=0:["space-between","space-around"].includes(r)&&(t="space-between"==r,void 0===(e=s)&&(e=0),e/=i.elements.length+(t?-1:1),i.elements.forEach(function(n,s){var r;t&&!s||(n.style.margin?n.style.margin[i.key.marginLeft]+=e:n.style.margin=((r={})[i.key.marginLeft]=e,r),n.getBoxPosition())}),e=0,s=0),this.offsetX=s||0,this.refreshYAlign()},s.refreshYAlign=function(){var t=this;if(1==this.container.lines.length)return 0;var e=this.container.lines.reduce(function(e,i){return e+i[t.key.height]},0);if("center"===this.container.style.alignItems){var i=(this.container.contentSize[this.key.height]-e)/(this.container.lines.length+1);this.container.lines.forEach(function(t){t.offsetY=i})}if("flex-end"===this.container.style.alignItems){var n=this.container.contentSize[this.key.height]-e;this.container.lines[0].offsetY=n}},s.getOffsetY=function(t){return this.container.lines.length>1?0:"flex-end"===t.style.alignSelf?this.container.contentSize[this.key.height]-t.offsetSize[this.key.height]:"center"===t.style.alignSelf?(this.container.contentSize[this.key.height]-t.offsetSize[this.key.height])/2:0},s.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach(function(t,e){var n=i.elements[e-1],s=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+s,t.style[i.key.left]=n?n.offsetSize[i.key.left]+n.offsetSize[i.key.width]:i[i.key.left],t.getBoxPosition()})},n}(ce),fe=Ot,pe=Tt,ge=Rt,me=jt,ve=Ct,xe="flex",ye=Ft,be=Lt,we=0,Se={left:null,top:null,width:null,height:null},_e=function(){function t(t,e,i,n){var s=this;Xt(this,"id",we++),Xt(this,"style",{left:null,top:null,width:null,height:null}),Xt(this,"computedStyle",{}),Xt(this,"originStyle",{}),Xt(this,"children",{}),Xt(this,"layoutBox",Vt({},Se)),Xt(this,"contentSize",Vt({},Se)),Xt(this,"clientSize",Vt({},Se)),Xt(this,"borderSize",Vt({},Se)),Xt(this,"offsetSize",Vt({},Se)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.name||t.type,this.attributes=this.getAttributes(t);var r=function(t,e){var i=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],n=t.css,s=void 0===n?{}:n,r=t.type,o=void 0===r?se:r,a=zt({},At);if([ne,ie,re].includes(o)&&!s.display&&(a.display=oe),e)for(var h=0;h<i.length;h++){var l=i[h];(s[l]||e[l])&&(s[l]=s[l]||e[l])}for(var c=function(t){var e,i,n,r,h=s[t];if(/-/.test(t)&&(t=t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()}),a.key=h),/^(box|text)?shadow$/i.test(t)){var l=[];return h.replace(/((-?\d+(rpx|px|vw|vh)?\s+?){3})(.+)/,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];l=t[1].match(/-?\d+(rpx|px|vh|vw)?/g).map(function(t){return Dt(t)}).concat(t[4])}),/^text/.test(t)?a.textShadow=l:a.boxShadow=l,"continue"}if(/^border/i.test(t)&&!/radius$/i.test(t)){var c=t.match(/^border([BTRLa-z]+)?/)[0],d=t.match(/[W|S|C][a-z]+/),u=h.replace(/([\(,])\s+|\s+([\),])/g,"$1$2").split(" ").map(function(t){return/^\d/.test(t)?Dt(t,""):t});return a[c]||(a[c]={}),1==u.length&&d?a[c][c+d[0]]=u[0]:a[c]=((e={})[c+"Width"]=Ut(u[0])?u[0]:0,e[c+"Style"]=u[1]||"solid",e[c+"Color"]=u[2]||"black",e),"continue"}if(/^background(color)?$/i.test(t))return a.backgroundColor=h,"continue";if(/^objectPosition$/i.test(t))return a[t]=h.split(" "),"continue";if(/padding|margin|radius/i.test(t)){var f=/radius$/i.test(t),p=f?"borderRadius":t.match(/[a-z]+/)[0],g=[0,0,0,0].map(function(t,e){return f?["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"][e]:[p+"Top",p+"Right",p+"Bottom",p+"Left"][e]}),m="margin";if("padding"===t||t===m||/^(border)?radius$/i.test(t)){u="".concat(h).split(" ").map(function(e){return/^-?\d+(rpx|px|vh|vw)?$/.test(e)?Dt(e):t!=m&&/auto/.test(e)?0:e},[])||[0];var v=f?"borderRadius":t,x=u[0],y=u[1],b=u[2],w=u[3];a[v]=((i={})[g[0]]=Zt(x)?0:x,i[g[1]]=Ut(y)||Zt(y)?y:x,i[g[2]]=Zt(Ut(b)?b:x)?0:Ut(b)?b:x,i[g[3]]=Ut(w)?w:y||x,i)}else"object"==typeof a[p]||(a[p]=((n={})[g[0]]=a[p]||0,n[g[1]]=a[p]||0,n[g[2]]=a[p]||0,n[g[3]]=a[p]||0,n)),a[p][t]=p==m&&Zt(h)||te(h)?h:Dt(h);return"continue"}if(/^transform$/i.test(t))return a[t]={},h.replace(/([a-zA-Z]+)\(([0-9,-\.%rpxdeg\s]+)\)/g,function(e,i,n){var r=n.split(",").map(function(t){return t.replace(/(^\s*)|(\s*$)/g,"")}),o=function(t,e){return t.includes("deg")?1*t:e&&!te(e)?Dt(t,e):t};i.includes("matrix")?a[t][i]=r.map(function(t){return 1*t}):i.includes("rotate")?a[t][i]=1*n.match(/^-?\d+(\.\d+)?/)[0]:/[X, Y]/.test(i)?a[t][i]=/[X]/.test(i)?o(r[0],s.width):o(r[0],s.height):(a[t][i+"X"]=o(r[0],s.width),a[t][i+"Y"]=o(r[1]||r[0],s.height))}),"continue";if(/^font$/i.test(t)&&console.warn("font 不支持简写"),/^textstroke/i.test(t)){var S=t.match(/color|width|type$/i),_=(c="textStroke",h.split(" ").map(function(t){return/^\d+(rpx|px|vh|vw)?$/.test(t)?Dt(t):t}));return S?a[c]?a[c][S[0]]=_[0]:a[c]=((r={})[S[0]]=_[0],r):a[c]={width:_[0],color:_[1],type:_[2]},"continue"}/^left|top$/i.test(t)&&![ae,he].includes(s.position)?a[t]=0:a[t]=/^-?[\d\.]+(px|rpx|vw|vh)?$/.test(h)?Dt(h):/em$/.test(h)&&o==ne?Dt(h,s.fontSize):h},d=0,u=Object.keys(s);d<u.length;d++)c(u[d]);return a}(t,e&&e.computedStyle);this.isAbsolute=r.position==ye,this.isFixed=r.position==be,this.originStyle=r,Object.keys(r).forEach(function(t){Object.defineProperty(s.style,t,{configurable:!0,enumerable:!0,get:function(){return r[t]},set:function(e){r[t]=e}})});var o={contentSize:Vt({},this.contentSize),clientSize:Vt({},this.clientSize),borderSize:Vt({},this.borderSize),offsetSize:Vt({},this.offsetSize)};Object.keys(o).forEach(function(t){Object.keys(s[t]).forEach(function(e){Object.defineProperty(s[t],e,{configurable:!0,enumerable:!0,get:function(){return o[t][e]},set:function(i){o[t][e]=i}})})}),this.computedStyle=this.style}var e=t.prototype;return e.add=function(t){t.parent=this,this.children[t.id]=t},e.getChildren=function(){var t=this;return Object.keys(this.children).map(function(e){return t.children[e]})},e.prev=function(t){void 0===t&&(t=this);var e=t.parent.getChildren();return e[e.findIndex(function(e){return e.id==t.id})-1]},e.getLineRect=function(t,e){var i=e?e.lines:this.parent&&this.parent.lines;return i&&i.find(function(e){return e.ids.includes(t)})||{width:0,height:0}},e.setPosition=function(t,e){var i={left:"width",top:"height",right:"width",bottom:"height"};Object.keys(i).forEach(function(n){var s="right"==n?"left":"top";["right","bottom"].includes(n)&&void 0!==t.style[n]&&"number"!=typeof t.originStyle[s]?t.style[s]=e[i[n]]-t.offsetSize[i[n]]-Dt(t.style[n],e[i[n]]):t.style[n]=Dt(t.style[n],e[i[n]])})},e.getAttributes=function(t){var e=t.attributes||{};return(t.url||t.src)&&(e.src=e.src||t.url||t.src),t.replace&&(e.replace=t.replace),t.text&&(e.text=t.text),e},e.getOffsetSize=function(t,e,i){void 0===i&&(i=Wt[3]);var n=e||{},s=n.margin,r=(s=void 0===s?{}:s).marginLeft,o=void 0===r?0:r,a=s.marginTop,h=void 0===a?0:a,l=s.marginRight,c=void 0===l?0:l,d=s.marginBottom,u=void 0===d?0:d,f=n.padding,p=(f=void 0===f?{}:f).paddingLeft,g=void 0===p?0:p,m=f.paddingTop,v=void 0===m?0:m,x=f.paddingRight,y=void 0===x?0:x,b=f.paddingBottom,w=void 0===b?0:b,S=n.border,_=(S=void 0===S?{}:S).borderWidth,k=void 0===_?0:_,z=n.borderTop,I=(z=void 0===z?{}:z).borderTopWidth,P=void 0===I?k:I,M=n.borderBottom,W=(M=void 0===M?{}:M).borderBottomWidth,R=void 0===W?k:W,T=n.borderRight,O=(T=void 0===T?{}:T).borderRightWidth,B=void 0===O?k:O,j=n.borderLeft,C=(j=void 0===j?{}:j).borderLeftWidth,F=void 0===C?k:C,L=o<0&&c<0?Math.abs(o+c):0,A=h<0&&u<0?Math.abs(h+u):0,$=o>=0&&c<0,E=h>=0&&u<0;return i==Wt[0]&&(this[i].left=t.left+o+g+F+($?2*-c:0),this[i].top=t.top+h+v+P+(E?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:L),this[i].height=t.height+(this[i].heightAdd?0:A),this[i].widthAdd=L,this[i].heightAdd=A),i==Wt[1]&&(this[i].left=t.left+o+F+($<0?-c:0),this[i].top=t.top+h+P+(E?-u:0),this[i].width=t.width+g+y,this[i].height=t.height+v+w),i==Wt[2]&&(this[i].left=t.left+o+F/2+($<0?-c:0),this[i].top=t.top+h+P/2+(E?-u:0),this[i].width=t.width+g+y+F/2+B/2,this[i].height=t.height+v+w+R/2+P/2),i==Wt[3]&&(this[i].left=t.left+($<0?-c:0),this[i].top=t.top+(E?-u:0),this[i].width=t.width+g+y+F+B+o+c,this[i].height=t.height+v+w+R+P+u+h),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var s=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var r=e||{},o=r.border,a=(o=void 0===o?{}:o).borderWidth,h=void 0===a?0:a,l=r.borderTop,c=(l=void 0===l?{}:l).borderTopWidth,d=void 0===c?h:c,u=r.borderBottom,f=(u=void 0===u?{}:u).borderBottomWidth,p=void 0===f?h:f,g=r.borderRight,m=(g=void 0===g?{}:g).borderRightWidth,v=void 0===m?h:m,x=r.borderLeft,y=(x=void 0===x?{}:x).borderLeftWidth,b=void 0===y?h:y,w=r.padding,S=(w=void 0===w?{}:w).paddingTop,_=void 0===S?0:S,k=w.paddingRight,z=void 0===k?0:k,I=w.paddingBottom,P=void 0===I?0:I,M=w.paddingLeft,W=void 0===M?0:M;i||(t.width-=W+z+v+b),1!==i||n||(t.height-=_+P+d+p)}this.layoutBox&&(Wt.forEach(function(i){return s.layoutBox[i]=s.getOffsetSize(t,e,i)}),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,s=void 0===n?0:n,r=t.top,o=void 0===r?0:r,a=t.padding||{},h=a.paddingBottom,l=void 0===h?0:h,c=a.paddingRight,d=void 0===c?0:c,u=Vt({},this.contentSize,{left:s,top:o}),f=this.contentSize.top-this.offsetSize.top,p=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var g,m=Qt(this.root.fixedLine.elements);!(g=m()).done;){var v=g.value;v.setPosition(v,this.root.offsetSize),v.getBoxPosition()}}if(e)for(var x,y=Qt(e.elements);!(x=y()).done;){var b=x.value;b.setPosition(b,u),b.style.left+=s+p+d,b.style.top+=o+f+l,b.getBoxPosition()}if(i)for(var w,S=Qt(i);!(w=S()).done;)w.value.layout(u.top+f,u.left+p);return this.layoutBoxUpdate(u,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==me},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==xe},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&!!t.parent&&(!(!t.parent||t.parent.style.display!==xe)||void 0)},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==ve},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,s=i.actualBoundingBoxAscent,r=i.actualBoundingBoxDescent;return{ascent:s,descent:r,width:n,fontHeight:s+r||.7*e+1}},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,s=this.parent,r=void 0===s?{}:s,o=this.ctx,a=this.getChildren(),h=i.left,l=void 0===h?0:h,c=i.top,d=void 0===c?0:c,u=i.bottom,f=i.right,p=i.width,g=void 0===p?0:p,m=i.minWidth,v=i.maxWidth,x=i.minHeight,y=i.maxHeight,b=i.height,w=void 0===b?0:b,S=i.fontSize,_=void 0===S?14:S,k=i.fontWeight,z=i.fontFamily,I=i.fontStyle,P=i.position,M=i.lineClamp,W=i.lineHeight,R=i.padding,T=void 0===R?{}:R,O=i.margin,B=void 0===O?{}:O,j=i.border,C=(j=void 0===j?{}:j).borderWidth,F=void 0===C?0:C,L=i.borderRight,A=(L=void 0===L?{}:L).borderRightWidth,$=void 0===A?F:A,E=i.borderLeft,H=(E=void 0===E?{}:E).borderLeftWidth,N=void 0===H?F:H,U=r.contentSize&&r.contentSize.width,D=r.contentSize&&r.contentSize.height;if(te(g)&&U&&(g=Dt(g,U)),te(g)&&!U&&(g=null),te(w)&&D&&(w=Dt(w,D)),te(w)&&!D&&(w=null),te(m)&&U&&(m=Dt(m,U)),te(v)&&U&&(v=Dt(v,U)),te(x)&&D&&(x=Dt(x,D)),te(y)&&D&&(y=Dt(y,D)),i.padding&&U)for(var Y in i.padding)Object.hasOwnProperty.call(i.padding,Y)&&(i.padding[Y]=Dt(i.padding[Y],U));var q=T.paddingRight,X=void 0===q?0:q,V=T.paddingLeft,J=void 0===V?0:V;if(i.margin&&[i.margin.marginLeft,i.margin.marginRight].includes("auto"))if(g){var G=U&&U-g-X-J-N-$||0;i.margin.marginLeft==i.margin.marginRight?i.margin.marginLeft=i.margin.marginRight=G/2:"auto"==i.margin.marginLeft?i.margin.marginLeft=G:i.margin.marginRight=G}else i.margin.marginLeft=i.margin.marginRight=0;var Q=B.marginRight,K=void 0===Q?0:Q,Z=B.marginLeft,tt={width:g,height:w,left:0,top:0},et=J+X+N+$+(void 0===Z?0:Z)+K;if(this.offsetWidth=et,e==pe&&!this.attributes.widths){var it=n.text||"";o.save(),o.setFonts({fontFamily:z,fontSize:_,fontWeight:k,fontStyle:I});var nt=new Map;it.split("\n").map(function(e){var i=e.split("").map(function(e){var i=nt.get(e);if(i)return i;var n=t.measureText(e,_).width;return nt.set(e,n),n}),n=t.measureText(e,_),s=n.fontHeight,r=n.ascent,o=n.descent;t.attributes.fontHeight=s,t.attributes.ascent=r,t.attributes.descent=o,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce(function(t,e){return t+e},0)})}),o.restore()}if(e==fe&&null==g){var st=n.width,rt=n.height;tt.width=this.contrastSize(Math.round(st*w/rt)||0,m,v),this.layoutBoxUpdate(tt,i,0)}if(e==pe&&null==g){var ot=this.attributes.widths,at=Math.max.apply(Math,ot.map(function(t){return t.total}));r&&U>0&&(at>U||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed&&(at=U-et),tt.width=this.contrastSize(at,m,v),this.layoutBoxUpdate(tt,i,0)}if(e==pe&&(r.style.flex||!this.attributes.lines)){var ht=this.attributes.widths.length;this.attributes.widths.forEach(function(t){return t.widths.reduce(function(t,e,i){return t+e>tt.width?(ht++,e):t+e},0)}),ht=M&&ht>M?M:ht,this.attributes.lines=ht}if(e==fe&&null==w){var lt=n.width,ct=n.height;tt.height=this.contrastSize(Dt(tt.width*ct/lt)||0,x,y),this.layoutBoxUpdate(tt,i,1)}e==pe&&null==w&&(W=Dt(W,_),tt.height=this.contrastSize(Dt(this.attributes.lines*W),x,y),this.layoutBoxUpdate(tt,i,1,!0)),r&&r.children&&U&&(!this.isFlex(r)||r.isFlexCalc)&&([ge,pe].includes(e)&&this.isFlex()||e==ge&&this.isBlock(this)&&this.isInFlow())&&(tt.width=this.contrastSize(U-(r.isFlexCalc?0:et),m,v),this.layoutBoxUpdate(tt,i)),g&&!te(g)&&(tt.width=this.contrastSize(g,m,v),this.layoutBoxUpdate(tt,i,0)),w&&!te(w)&&(tt.height=this.contrastSize(tt.height,x,y),this.layoutBoxUpdate(tt,i,1));var dt=0;if(a.length){var ut=null;a.forEach(function(e,n){e.getBoxWidthHeight();var s=a[n+1];if(s&&s.isInFlow()&&(e.next=s),e.isInFlow()&&!e.inFlexBox()){var r=t.getBoxState(ut,e);t.line&&t.line.canIEnter(e)&&!r?t.line.add(e):(new ce).bind(e),ut=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new ue).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new ce).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new ce).fixedBind(e,1)}),this.lines&&(dt=this.lines.reduce(function(t,e){return t+e.height},0))}var ft=0,pt=0;if(!g&&(this.isAbsolute||this.isFixed)&&U){var gt=P==ye?U:this.root.width,mt=gt-(te(l)?Dt(l,gt):l)-(te(f)?Dt(f,gt):f);ft=i.left?mt:this.lineMaxWidth}if(!w&&(null!=d?d:this.isAbsolute||this.isFixed&&D)){var vt=P==ye?D:this.root.height,xt=vt-(te(d)?Dt(d,vt):d)-(te(u)?Dt(u,vt):u);pt=i.top?xt:0}if(g&&!te(g)||tt.width||(tt.width=ft||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?U||r.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,m,v),this.layoutBoxUpdate(tt,i,0)),w||!dt&&!pt||(tt.height=pt||this.contrastSize(dt,x,y),this.layoutBoxUpdate(tt,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var Y in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,Y)&&(i.borderRadius[Y]=Dt(i.borderRadius[Y],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.getBoxPosition(),this.offsetSize},t}(),ke=function(){var t,e,i,n,s,r,o=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],l=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],c=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],d=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],u=[],f=[],p=[],g=[],m=[],v=2;function x(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function y(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)x(t-1,i+n),x(t+1,i-n),x(t-n,i-1),x(t+n,i+1)}function b(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var w=[];function S(t,e,i,n){var s,r,o;for(s=0;s<n;s++)u[i+s]=0;for(s=0;s<e;s++){if(255!=(o=c[u[t+s]^u[i]]))for(r=1;r<n;r++)u[i+r-1]=u[i+r]^d[b(o+w[n-r])];else for(r=i;r<i+n;r++)u[r]=u[r+1];u[i+n-1]=255==o?0:d[b(o+w[0])]}}function _(t,e){var i;return t>e&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function k(t){var i,n,s,r;switch(t){case 0:for(n=0;n<e;n++)for(i=0;i<e;i++)i+n&1||_(i,n)||(p[i+n*e]^=1);break;case 1:for(n=0;n<e;n++)for(i=0;i<e;i++)1&n||_(i,n)||(p[i+n*e]^=1);break;case 2:for(n=0;n<e;n++)for(s=0,i=0;i<e;i++,s++)3==s&&(s=0),s||_(i,n)||(p[i+n*e]^=1);break;case 3:for(r=0,n=0;n<e;n++,r++)for(3==r&&(r=0),s=r,i=0;i<e;i++,s++)3==s&&(s=0),s||_(i,n)||(p[i+n*e]^=1);break;case 4:for(n=0;n<e;n++)for(s=0,r=n>>1&1,i=0;i<e;i++,s++)3==s&&(s=0,r=!r),r||_(i,n)||(p[i+n*e]^=1);break;case 5:for(r=0,n=0;n<e;n++,r++)for(3==r&&(r=0),s=0,i=0;i<e;i++,s++)3==s&&(s=0),(i&n&1)+!(!s|!r)||_(i,n)||(p[i+n*e]^=1);break;case 6:for(r=0,n=0;n<e;n++,r++)for(3==r&&(r=0),s=0,i=0;i<e;i++,s++)3==s&&(s=0),(i&n&1)+(s&&s==r)&1||_(i,n)||(p[i+n*e]^=1);break;case 7:for(r=0,n=0;n<e;n++,r++)for(3==r&&(r=0),s=0,i=0;i<e;i++,s++)3==s&&(s=0),(s&&s==r)+(i+n&1)&1||_(i,n)||(p[i+n*e]^=1)}}function z(t){var e,i=0;for(e=0;e<=t;e++)m[e]>=5&&(i+=3+m[e]-5);for(e=3;e<t-1;e+=2)m[e-2]==m[e+2]&&m[e+2]==m[e-1]&&m[e-1]==m[e+1]&&3*m[e-1]==m[e]&&(0==m[e-3]||e+3>t||3*m[e-3]>=4*m[e]||3*m[e+3]>=4*m[e])&&(i+=40);return i}function I(){var t,i,n,s,r,o=0,a=0;for(i=0;i<e-1;i++)for(t=0;t<e-1;t++)(p[t+e*i]&&p[t+1+e*i]&&p[t+e*(i+1)]&&p[t+1+e*(i+1)]||!(p[t+e*i]||p[t+1+e*i]||p[t+e*(i+1)]||p[t+1+e*(i+1)]))&&(o+=3);for(i=0;i<e;i++){for(m[0]=0,n=s=t=0;t<e;t++)(r=p[t+e*i])==s?m[n]++:m[++n]=1,a+=(s=r)?1:-1;o+=z(n)}a<0&&(a=-a);var h=a,l=0;for(h+=h<<2,h<<=1;h>e*e;)h-=e*e,l++;for(o+=10*l,t=0;t<e;t++){for(m[0]=0,n=s=i=0;i<e;i++)(r=p[t+e*i])==s?m[n]++:m[++n]=1,s=r;o+=z(n)}return o}var P=null;return{api:{get ecclevel(){return v},set ecclevel(t){v=t},get size(){return _size},set size(t){_size=t},get canvas(){return P},set canvas(t){P=t},getFrame:function(m){return function(m){var z,P,M,W,R,T,O,B;W=m.length,t=0;do{if(t++,M=4*(v-1)+16*(t-1),i=l[M++],n=l[M++],s=l[M++],r=l[M],W<=(M=s*(i+n)+n-3+(t<=9)))break}while(t<40);for(e=17+4*t,R=s+(s+r)*(i+n)+n,W=0;W<R;W++)f[W]=0;for(u=m.slice(0),W=0;W<e*e;W++)p[W]=0;for(W=0;W<(e*(e+1)+1)/2;W++)g[W]=0;for(W=0;W<3;W++){for(M=0,P=0,1==W&&(M=e-7),2==W&&(P=e-7),p[P+3+e*(M+3)]=1,z=0;z<6;z++)p[P+z+e*M]=1,p[P+e*(M+z+1)]=1,p[P+6+e*(M+z)]=1,p[P+z+1+e*(M+6)]=1;for(z=1;z<5;z++)x(P+z,M+1),x(P+1,M+z+1),x(P+5,M+z),x(P+z+1,M+5);for(z=2;z<4;z++)p[P+z+e*(M+2)]=1,p[P+2+e*(M+z+1)]=1,p[P+4+e*(M+z)]=1,p[P+z+1+e*(M+4)]=1}if(t>1)for(W=o[t],P=e-7;;){for(z=e-7;z>W-3&&(y(z,P),!(z<W));)z-=W;if(P<=W+9)break;y(6,P-=W),y(P,6)}for(p[8+e*(e-8)]=1,P=0;P<7;P++)x(7,P),x(e-8,P),x(7,P+e-7);for(z=0;z<8;z++)x(z,7),x(z+e-8,7),x(z,e-8);for(z=0;z<9;z++)x(z,8);for(z=0;z<8;z++)x(z+e-8,8),x(8,z);for(P=0;P<7;P++)x(8,P+e-7);for(z=0;z<e-14;z++)1&z?(x(8+z,6),x(6,8+z)):(p[8+z+6*e]=1,p[6+e*(8+z)]=1);if(t>6)for(W=a[t-7],M=17,z=0;z<6;z++)for(P=0;P<3;P++,M--)1&(M>11?t>>M-12:W>>M)?(p[5-z+e*(2-P+e-11)]=1,p[2-P+e-11+e*(5-z)]=1):(x(5-z,2-P+e-11),x(2-P+e-11,5-z));for(P=0;P<e;P++)for(z=0;z<=P;z++)p[z+e*P]&&x(z,P);for(R=u.length,T=0;T<R;T++)f[T]=u.charCodeAt(T);if(u=f.slice(0),R>=(z=s*(i+n)+n)-2&&(R=z-2,t>9&&R--),T=R,t>9){for(u[T+2]=0,u[T+3]=0;T--;)W=u[T],u[T+3]|=255&W<<4,u[T+2]=W>>4;u[2]|=255&R<<4,u[1]=R>>4,u[0]=64|R>>12}else{for(u[T+1]=0,u[T+2]=0;T--;)W=u[T],u[T+2]|=255&W<<4,u[T+1]=W>>4;u[1]|=255&R<<4,u[0]=64|R>>4}for(T=R+3-(t<10);T<z;)u[T++]=236,u[T++]=17;for(w[0]=1,T=0;T<r;T++){for(w[T+1]=1,O=T;O>0;O--)w[O]=w[O]?w[O-1]^d[b(c[w[O]]+T)]:w[O-1];w[0]=d[b(c[w[0]]+T)]}for(T=0;T<=r;T++)w[T]=c[w[T]];for(M=z,P=0,T=0;T<i;T++)S(P,s,M,r),P+=s,M+=r;for(T=0;T<n;T++)S(P,s+1,M,r),P+=s+1,M+=r;for(P=0,T=0;T<s;T++){for(O=0;O<i;O++)f[P++]=u[T+O*s];for(O=0;O<n;O++)f[P++]=u[i*s+T+O*(s+1)]}for(O=0;O<n;O++)f[P++]=u[i*s+T+O*(s+1)];for(T=0;T<r;T++)for(O=0;O<i+n;O++)f[P++]=u[z+T+O*r];for(u=f,z=P=e-1,M=R=1,B=(s+r)*(i+n)+n,T=0;T<B;T++)for(W=u[T],O=0;O<8;O++,W<<=1){128&W&&(p[z+e*P]=1);do{R?z--:(z++,M?0!=P?P--:(M=!M,6==(z-=2)&&(z--,P=9)):P!=e-1?P++:(M=!M,6==(z-=2)&&(z--,P-=8))),R=!R}while(_(z,P))}for(u=p.slice(0),W=0,P=3e4,M=0;M<8&&(k(M),(z=I())<P&&(P=z,W=M),7!=W);M++)p=u.slice(0);for(W!=M&&k(W),P=h[W+(v-1<<3)],M=0;M<8;M++,P>>=1)1&P&&(p[e-1-M+8*e]=1,M<6?p[8+e*M]=1:p[8+e*(M+1)]=1);for(M=0;M<7;M++,P>>=1)1&P&&(p[8+e*(e-7+M)]=1,M?p[6-M+8*e]=1:p[7+8*e]=1);return p}(m)},utf16to8:function(t){var e,i,n,s;for(e="",n=t.length,i=0;i<n;i++)(s=t.charCodeAt(i))>=1&&s<=127?e+=t.charAt(i):s>2047?(e+=String.fromCharCode(224|s>>12&15),e+=String.fromCharCode(128|s>>6&63),e+=String.fromCharCode(128|63&s)):(e+=String.fromCharCode(192|s>>6&31),e+=String.fromCharCode(128|63&s));return e},draw:function(t,i,n,s,r){i.drawView(n,s);var o=i.ctx,a=n.contentSize,h=a.width,l=a.height,c=a.left,d=a.top;s.borderRadius,s.backgroundColor;var u=s.color,f=void 0===u?"#000000":u;if(s.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top,v=r||v,o){o.save(),i.setOpacity(s),i.setTransform(n,s);var p=Math.min(h,l);t=this.utf16to8(t);var g=this.getFrame(t),m=p/e;o.setFillStyle(f);for(var x=0;x<e;x++)for(var y=0;y<e;y++)g[y*e+x]&&o.fillRect(c+m*x,d+m*y,m,m);o.restore(),i.setBorder(n,s)}else console.warn("No canvas provided to draw QR code in!")}}}}(),ze=Ot,Ie=Tt,Pe=Bt,Me=Rt,We="middle",Re="bottom",Te="left",Oe="center",Be="right",je=function(){function t(t){var e,i=this;this.v="1.9.3.5",this.id=null,this.pixelRatio=1,this.width=0,this.height=0,this.sleep=1e3/30,this.count=0,this.isRate=!1,this.isDraw=!0,this.isCache=!0,this.fixed="",this.useCORS=!1,this.imageBus=[],this.createImage=function(t,e){return new Promise(function(n,s){var r=null;window||i.canvas.createImage?(r=i.canvas&&i.canvas.createImage?i.canvas.createImage():new Image,e&&r.setAttribute("crossOrigin","Anonymous"),r.src=t,r.onload=function(){n({width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,path:r,src:this.src})},r.onerror=function(t){s(t)}):s({fail:"getImageInfo fail",src:t})})},this.options=t,Object.assign(this,t),this.ctx=((e=t.context).setFonts=function(t){var i=t.fontFamily,n=void 0===i?"sans-serif":i,s=t.fontSize,r=void 0===s?14:s,o=t.fontWeight,a=void 0===o?"normal":o,h=t.fontStyle,l=void 0===h?"normal":h;Et==Mt.MP_TOUTIAO&&(a="bold"==a?"bold":"",l="italic"==l?"italic":""),e.font="".concat(l," ").concat(a," ").concat(Math.round(r),"px ").concat(n)},e.draw&&e.setFillStyle?e:Object.assign(e,{setStrokeStyle:function(t){e.strokeStyle=t},setLineWidth:function(t){e.lineWidth=t},setLineCap:function(t){e.lineCap=t},setFillStyle:function(t){e.fillStyle=t},setFontSize:function(t){e.font="".concat(String(t),"px sans-serif")},setGlobalAlpha:function(t){e.globalAlpha=t},setLineJoin:function(t){e.lineJoin=t},setTextAlign:function(t){e.textAlign=t},setMiterLimit:function(t){e.miterLimit=t},setShadow:function(t,i,n,s){e.shadowOffsetX=t,e.shadowOffsetY=i,e.shadowBlur=n,e.shadowColor=s},setTextBaseline:function(t){e.textBaseline=t},createCircularGradient:function(){},draw:function(){}})),this.progress=0,this.root={width:t.width,height:t.height,fontSizeRate:1,fixedLine:null},this.size=this.root;var n=0;Object.defineProperty(this,"progress",{configurable:!0,set:function(t){n=t,i.lifecycle("onProgress",t/i.count)},get:function(){return n||0}})}return t.prototype.lifecycle=function(t,e){this.options.listen&&this.options.listen[t]&&this.options.listen[t](e)},t.prototype.setContext=function(t){t&&(this.ctx=t)},t.prototype.init=function(){if(this.canvas.height||Mt.WEB==Et){this.ctx.setTransform(1,0,0,1,0,0);var t=this.size.height*this.pixelRatio,e=this.size.width*this.pixelRatio;this.canvas.height=t,this.canvas.width=e,this.ctx.scale(this.pixelRatio,this.pixelRatio)}},t.prototype.clear=function(){this.ctx.clearRect(0,0,this.size.width,this.size.height)},t.prototype.clipPath=function(t,e,i,n,s,r,o){void 0===r&&(r=!1),void 0===o&&(o=!1);var a=this.ctx;if(/polygon/.test(s)){var h=s.match(/-?\d+(rpx|px|%)?\s+-?\d+(rpx|px|%)?/g)||[];a.beginPath(),h.map(function(s){var r=s.split(" "),o=r[0],a=r[1];return[Dt(o,i)+t,Dt(a,n)+e]}).forEach(function(t,e){0==e?a.moveTo(t[0],t[1]):a.lineTo(t[0],t[1])}),a.closePath(),o&&a.stroke(),r&&a.fill()}},t.prototype.roundRect=function(t,e,i,n,s,r,o){if(void 0===r&&(r=!1),void 0===o&&(o=!1),!(s<0)){var a=this.ctx;if(a.beginPath(),s){var h=s||{},l=h.borderTopLeftRadius,c=void 0===l?s||0:l,d=h.borderTopRightRadius,u=void 0===d?s||0:d,f=h.borderBottomRightRadius,p=void 0===f?s||0:f,g=h.borderBottomLeftRadius,m=void 0===g?s||0:g;a.arc(t+i-p,e+n-p,p,0,.5*Math.PI),a.lineTo(t+m,e+n),a.arc(t+m,e+n-m,m,.5*Math.PI,Math.PI),a.lineTo(t,e+c),a.arc(t+c,e+c,c,Math.PI,1.5*Math.PI),a.lineTo(t+i-u,e),a.arc(t+i-u,e+u,u,1.5*Math.PI,2*Math.PI),a.lineTo(t+i,e+n-p)}else a.rect(t,e,i,n);a.closePath(),o&&a.stroke(),r&&a.fill()}},t.prototype.setTransform=function(t,e){var i=e.transform,n=e.transformOrigin,s=this.ctx,r=i||{},o=r.scaleX,a=void 0===o?1:o,h=r.scaleY,l=void 0===h?1:h,c=r.translateX,d=void 0===c?0:c,u=r.translateY,f=void 0===u?0:u,p=r.rotate,g=void 0===p?0:p,m=r.skewX,v=void 0===m?0:m,x=r.skewY,y=void 0===x?0:x,b=t.left,w=t.top,S=t.width,_=t.height;d=Dt(d,S)||0,f=Dt(f,_)||0;var k={top:Dt("0%",1),center:Dt("50%",1),bottom:Dt("100%",1)},z={left:Dt("0%",1),center:Dt("50%",1),right:Dt("100%",1)};if(n=n.split(" ").filter(function(t,e){return e<2}).reduce(function(t,e){if(/\d+/.test(e)){var i=Dt(e,1)/(/px|rpx$/.test(e)?Ut(t.x)?_:S:1);return Ut(t.x)?Object.assign(t,{y:i}):Object.assign(t,{x:i})}return Ut(z[e])&&!Ut(t.x)?Object.assign(t,{x:z[e]}):Object.assign(t,{y:k[e]||.5})},{}),(d||f)&&s.translate(d,f),(a||l)&&s.scale(a,l),g){var I=b+S*n.x,P=w+_*n.y;s.translate(I,P),s.rotate(g*Math.PI/180),s.translate(-I,-P)}(v||y)&&s.transform(1,Math.tan(y*Math.PI/180),Math.tan(v*Math.PI/180),1,0,0)},t.prototype.setBackground=function(t,e,i,n,s){var r=this.ctx;t&&"transparent"!=t?function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))}(t)?function(t,e,i,n,s,r){t.startsWith("linear")?function(t,e,i,n,s,r){for(var o=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=0);var r=t.match(/([-]?\d{1,3})deg/),o=r&&r[1]?parseFloat(r[1]):0;if(o>=360&&(o-=360),o<0&&(o+=360),0===(o=Math.round(o)))return{x0:Math.round(e/2)+n,y0:i+s,x1:Math.round(e/2)+n,y1:s};if(180===o)return{x0:Math.round(e/2)+n,y0:s,x1:Math.round(e/2)+n,y1:i+s};if(90===o)return{x0:n,y0:Math.round(i/2)+s,x1:e+n,y1:Math.round(i/2)+s};if(270===o)return{x0:e+n,y0:Math.round(i/2)+s,x1:n,y1:Math.round(i/2)+s};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(o===a)return{x0:n,y0:i+s,x1:e+n,y1:s};if(o===180-a)return{x0:n,y0:s,x1:e+n,y1:i+s};if(o===180+a)return{x0:e+n,y0:s,x1:n,y1:i+s};if(o===360-a)return{x0:e+n,y0:i+s,x1:n,y1:s};var h,l=0,c=0,d=0,u=0;if(o<a||o>180-a&&o<180||o>180&&o<180+a||o>360-a){var f=o*Math.PI/180,p=o<a||o>360-a?i/2:-i/2,g=Math.tan(f)*p,m=o<a||o>180-a&&o<180?e/2-g:-e/2-g;l=-(d=g+(h=Math.pow(Math.sin(f),2)*m)),c=-(u=p+h/Math.tan(f))}return(o>a&&o<90||o>90&&o<90+a||o>180+a&&o<270||o>270&&o<360-a)&&(f=(90-o)*Math.PI/180,g=o>a&&o<90||o>90&&o<90+a?e/2:-e/2,p=Math.tan(f)*g,m=o>a&&o<90||o>270&&o<360-a?i/2-p:-i/2-p,l=-(d=g+(h=Math.pow(Math.sin(f),2)*m)/Math.tan(f)),c=-(u=p+h)),{x0:l=Math.round(l+e/2)+n,y0:c=Math.round(i/2-c)+s,x1:d=Math.round(d+e/2)+n,y1:u=Math.round(i/2-u)+s}}(s,t,e,i,n),a=o.x0,h=o.y0,l=o.x1,c=o.y1,d=r.createLinearGradient(a,h,l,c),u=s.match(/linear-gradient\((.+)\)/)[1],f=qt(u.substring(u.indexOf(",")+1)),p=0;p<f.colors.length;p++)d.addColorStop(f.percents[p],f.colors[p]);r.setFillStyle(d)}(e,i,n,s,t,r):t.startsWith("radial")&&function(t,e,i,n,s,r){for(var o=qt(s.match(/radial-gradient\((.+)\)/)[1]),a=Math.round(t/2)+i,h=Math.round(e/2)+n,l=r.createRadialGradient(a,h,0,a,h,Math.max(t,e)/2),c=0;c<o.colors.length;c++)l.addColorStop(o.percents[c],o.colors[c]);r.setFillStyle(l)}(e,i,n,s,t,r)}(t,e,i,n,s,r):r.setFillStyle(t):[Mt.MP_TOUTIAO,Mt.MP_BAIDU].includes(Et)?r.setFillStyle("rgba(0,0,0,0)"):r.setFillStyle("transparent")},t.prototype.setShadow=function(t){var e=t.boxShadow,i=void 0===e?[]:e,n=this.ctx;if(i.length){var s=i[0],r=i[1],o=i[2],a=i[3];n.setShadow(s,r,o,a)}},t.prototype.setBorder=function(t,e){var i=this.ctx,n=t.width,s=t.height,r=t.left,o=t.top,a=e.border,h=e.borderBottom,l=e.borderTop,c=e.borderRight,d=e.borderLeft,u=e.borderRadius,f=e.lineCap,p=a||{},g=p.borderWidth,m=void 0===g?0:g,v=p.borderStyle,x=p.borderColor,y=h||{},b=y.borderBottomWidth,w=void 0===b?m:b,S=y.borderBottomStyle,_=void 0===S?v:S,k=y.borderBottomColor,z=void 0===k?x:k,I=l||{},P=I.borderTopWidth,M=void 0===P?m:P,W=I.borderTopStyle,R=void 0===W?v:W,T=I.borderTopColor,O=void 0===T?x:T,B=c||{},j=B.borderRightWidth,C=void 0===j?m:j,F=B.borderRightStyle,L=void 0===F?v:F,A=B.borderRightColor,$=void 0===A?x:A,E=d||{},H=E.borderLeftWidth,N=void 0===H?m:H,U=E.borderLeftStyle,D=void 0===U?v:U,Y=E.borderLeftColor,q=void 0===Y?x:Y,X=u||{},V=X.borderTopLeftRadius,J=void 0===V?u||0:V,G=X.borderTopRightRadius,Q=void 0===G?u||0:G,K=X.borderBottomRightRadius,Z=void 0===K?u||0:K,tt=X.borderBottomLeftRadius,et=void 0===tt?u||0:tt;if(h||d||l||c||a){var it=function(t,e,n){"dashed"==e?/mp/.test(Et)?i.setLineDash([Math.ceil(4*t/3),Math.ceil(4*t/3)]):i.setLineDash([Math.ceil(6*t),Math.ceil(6*t)]):"dotted"==e&&i.setLineDash([t,t]),i.setStrokeStyle(n)},nt=function(t,e,n,s,r,o,a,h,l,c,d,u,p,g,m){i.save(),i.setLineCap(m?"square":f),i.setLineWidth(u),it(u,p,g),i.beginPath(),i.arc(t,e,a,Math.PI*l,Math.PI*c),i.lineTo(n,s),i.arc(r,o,h,Math.PI*c,Math.PI*d),i.stroke(),i.restore()};if(i.save(),a&&!h&&!d&&!l&&!c)return i.setLineWidth(m),it(m,v,x),this.roundRect(r,o,n,s,u,!1,!!x),void i.restore();w&&nt(r+n-Z,o+s-Z,r+et,o+s,r+et,o+s-et,Z,et,.25,.5,.75,w,_,z,N&&C),N&&nt(r+et,o+s-et,r,o+J,r+J,o+J,et,J,.75,1,1.25,N,D,q,M&&w),M&&nt(r+J,o+J,r+n-Q,o,r+n-Q,o+Q,J,Q,1.25,1.5,1.75,M,R,O,N&&C),C&&nt(r+n-Q,o+Q,r+n,o+s-Z,r+n-Z,o+s-Z,Q,Z,1.75,2,.25,C,L,$,M&&w)}},t.prototype.setOpacity=function(t){var e=t.opacity,i=void 0===e?1:e;this.ctx.setGlobalAlpha(i)},t.prototype.drawPattern=function(t,e,i){return It(this,void 0,void 0,function(){var n=this;return Pt(this,function(s){return[2,new Promise(function(s,r){n.drawView(e,i,!0,!1,!0);var o=n,a=o.ctx;o.canvas;var h,l,c=e.width,d=e.height,u=e.left,f=e.top,p=i||{},g=p.borderRadius,m=void 0===g?0:g,v=p.backgroundImage,x=p.backgroundRepeat,y=void 0===x?"repeat":x;v&&(h=t,l=a.createPattern(h.src,y),a.setFillStyle(l),n.roundRect(u,f,c,d,m,!0,!1),n.setBorder(e,i),s())})]})})},t.prototype.drawView=function(t,e,i,n,s){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===s&&(s=!0);var r=this.ctx,o=t.width,a=t.height,h=t.left,l=t.top,c=e||{},d=c.borderRadius,u=void 0===d?0:d,f=c.backgroundColor,p=void 0===f?"transparent":f,g=c.overflow;e.opacity&&this.setOpacity(e),this.setTransform(t,e),s&&(r.save(),this.setShadow(e)),i&&this.setBackground(p,o,a,h,l),e.clipPath?this.clipPath(h,l,o,a,e.clipPath,i,!1):this.roundRect(h,l,o,a,u,i,!1),s&&r.restore(),n&&this.setBorder(t,e),"hidden"==g&&r.clip()},t.prototype.drawImage=function(t,e,i,n){return void 0===e&&(e={}),void 0===i&&(i={}),void 0===n&&(n=!0),It(this,void 0,void 0,function(){var s=this;return Pt(this,function(r){switch(r.label){case 0:return[4,new Promise(function(r,o){return It(s,void 0,void 0,function(){var s,o,a,h,l,c,d,u,f,p,g,m,v,x,y,b,w,S,_,k,z=this;return Pt(this,function(I){return s=this.ctx,o=i.borderRadius,a=void 0===o?0:o,h=i.backgroundColor,l=void 0===h?"transparent":h,c=i.objectFit,d=void 0===c?"fill":c,u=i.backgroundSize,f=void 0===u?"fill":u,p=i.objectPosition,g=i.backgroundPosition,m=i.boxShadow,i.backgroundImage&&(d=f,p=g),m&&this.drawView(e,Object.assign(i,{backgroundColor:l||m&&(l||"#ffffff")}),!0,!1,!0),v=e.width,x=e.height,y=e.left,b=e.top,s.save(),w=e.contentSize.left-e.borderSize.left,S=e.contentSize.top-e.borderSize.top,n||(this.setOpacity(i),this.setTransform(e,i),this.setBackground(l,v,x,y,b),this.roundRect(y,b,v,x,a,!!(a||!m&&l),!1)),y+=w,b+=S,s.clip(),_=function(t){if("fill"!==d){var i=function(t,e,i){var n=t.objectFit,s=t.objectPosition,r=e.width/e.height,o=i.width/i.height,a=1;"contain"==n&&r>=o||"cover"==n&&r<o?a=e.height/i.height:("contain"==n&&r<o||"cover"==n&&r>=o)&&(a=e.width/i.width);var h=i.width*a,l=i.height*a,c=s||[],d=c[0],u=c[1],f=/^\d+px|rpx$/.test(d)?Dt(d,e.width):(e.width-h)*(Yt(d)?Dt(d,1):{left:0,center:.5,right:1}[d||"center"]),p=/^\d+px|rpx$/.test(u)?Dt(u,e.height):(e.height-l)*(Yt(u)?Dt(u,1):{top:0,center:.5,bottom:1}[u||"center"]),g=function(t,e){return[(t-f)/a,(e-p)/a]},m=g(0,0),v=m[0],x=m[1],y=g(e.width,e.height),b=y[0],w=y[1];return{sx:Math.max(v,0),sy:Math.max(x,0),sw:Math.min(b-v,i.width),sh:Math.min(w-x,i.height),dx:Math.max(f,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(l,e.height)}}({objectFit:d,objectPosition:p},e.contentSize,t),n=i.sx,r=i.sy,o=i.sh,a=i.sw,h=i.dx,l=i.dy,c=i.dh,u=i.dw;Et==Mt.MP_BAIDU?s.drawImage(t.src,h+y,l+b,u,c,n,r,a,o):s.drawImage(t.src,n,r,a,o,h+y,l+b,u,c)}else s.drawImage(t.src,y,b,v,x)},k=function(){s.restore(),z.drawView(e,i,!1,!0,!1),r(1)},function(t){_(t),k()}(t),[2]})})})];case 1:return r.sent(),[2]}})})},t.prototype.drawText=function(t,e,i,n){var s=this,r=this.ctx,o=e.borderSize,a=e.contentSize,h=e.left,l=e.top,c=a.width,d=a.height,u=a.left-o.left,f=a.top-o.top,p=i.color,g=void 0===p?"#000000":p,m=i.lineHeight,v=void 0===m?"1.4em":m,x=i.fontSize,y=void 0===x?14:x,b=i.fontWeight,w=i.fontFamily,S=i.fontStyle,_=i.textAlign,k=void 0===_?"left":_,z=i.textStroke,I=i.verticalAlign,P=void 0===I?We:I,M=i.backgroundColor,W=i.lineClamp,R=i.backgroundClip,T=i.textShadow,O=i.textDecoration;if(this.drawView(e,i,R!=Ie),v=Dt(v,y),t){r.save(),h+=u,l+=f;var B=n.fontHeight,j=n.descent+n.ascent;switch(r.setFonts({fontFamily:w,fontSize:y,fontWeight:b,fontStyle:S}),r.setTextBaseline(We),r.setTextAlign(k),R?this.setBackground(M,c,d,h,l):r.setFillStyle(g),k){case Te:break;case Oe:h+=.5*c;break;case Be:h+=c}var C=n.lines*v,F=Math.ceil((d-C)/2);switch(F<0&&(F=0),P){case"top":break;case We:l+=F;break;case Re:l+=2*F}var L=(v-B)/2,A=v/2,$=function(t){var e=r.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,s=e.actualBoundingBoxAscent;return"top"==P?{fix:j?void 0===s?0:s:A-L/2,lineY:j?0:L-L/2}:P==We?{fix:j?A+n/4:A,lineY:j?0:L}:P==Re?{fix:j?v-n:A+L/2,lineY:j?2*L:L+L/2}:{fix:0,height:0,lineY:0}},E=function(t,e,i){var s=t;switch(k){case Te:s+=i;break;case Oe:s=(t-=i/2)+i;break;case Be:s=t,t-=i}if(O){r.setLineWidth(y/13),r.beginPath();var o=.1*n.fontHeight;/\bunderline\b/.test(O)&&(r.moveTo(t,e+n.fontHeight+o),r.lineTo(s,e+n.fontHeight+o)),/\boverline\b/.test(O)&&(r.moveTo(t,e-o),r.lineTo(s,e-o)),/\bline-through\b/.test(O)&&(r.moveTo(t,e+.5*n.fontHeight),r.lineTo(s,e+.5*n.fontHeight)),r.closePath(),r.setStrokeStyle(g),r.stroke()}},H=function(t,e,i){var n=function(){r.setLineWidth(z.width),r.setStrokeStyle(z.color),r.strokeText(t,e,i)},o="outset";z&&z.type!==o?(r.save(),s.setShadow({boxShadow:T}),r.fillText(t,e,i),r.restore(),n()):z&&z.type==o?(r.save(),s.setShadow({boxShadow:T}),n(),r.restore(),r.save(),r.fillText(t,e,i),r.restore()):(s.setShadow({boxShadow:T}),r.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total<=a.width){var N=$(t),U=N.fix,D=N.lineY;return H(t,h,l+U),E(h,l+D,n&&n.widths&&n.widths[0].total||n.text),l+=v,r.restore(),void this.setBorder(e,i)}for(var Y=t.split(""),q=l,X=h,V="",J=0,G=0;G<=Y.length;G++){var Q=Y[G]||"",K="\n"===Q,Z=""==Q,tt=V+(Q=K?"":Q),et=r.measureText(tt).width;if(J>=W)break;if(X=h,et>a.width||K||Z){if(J++,V=Z&&et<=a.width?tt:V,J===W&&et>c){for(;r.measureText("".concat(V,"...")).width>a.width&&!(V.length<=1);)V=V.substring(0,V.length-1);V+="..."}var it=$(V);if(U=it.fix,D=it.lineY,H(V,X,l+U),E(X,l+D,et),V=Q,(l+=v)>q+d)break}else V=tt}r.restore()}},t.prototype.source=function(t){return It(this,void 0,void 0,function(){var e,i,n,s,r=this;return Pt(this,function(o){switch(o.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(i in t.type=Me,t.css=t.css||{},t)["views","children","type","css"].includes(i)||(t.css[i]=t[i],delete t[i]);return t.css.boxSizing||(t.css.boxSizing="border-box"),[4,this.create(t)];case 1:return(n=o.sent())?(s=n.layout()||{},this.size=s,this.node=n,this.onEffectFinished().then(function(t){return r.lifecycle("onEffectSuccess",t)}).catch(function(t){return r.lifecycle("onEffectFail",t)}),console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}})})},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,e){return It(this,void 0,void 0,function(){var i,n,s,r,o,a,h,l,c,d,u,f,p,g,m,v,x;return Pt(this,function(y){switch(y.label){case 0:if(i=t.type==ze,n=[Ie,Pe].includes(t.type),s=t.css||{},r=s.backgroundImage,o=s.display,i&&!t.src&&!t.url||n&&!t.text)return[2];if("none"==o)return[2];if(n&&(t.text=String(t.text)),!(i||t.type==Me&&r))return[3,4];a=i?t.src:"",h=/url\((.+)\)/.exec(r),r&&h&&h[1]&&(a=h[1]||""),y.label=1;case 1:return y.trys.push([1,3,,4]),[4,this.getImageInfo(a)];case 2:return l=y.sent(),c=l.width,d=l.height,!(u=l.path)&&i?[2]:(u&&(t.attributes=Object.assign(t.attributes||{},{width:c,height:d,path:u,src:u,naturalSrc:a})),[3,4]);case 3:return f=y.sent(),t.type!=Me?[2]:(this.lifecycle("onEffectFail",zt(zt({},f),{src:a})),[3,4]);case 4:if(this.count+=1,p=new _e(t,e,this.root,this.ctx),!(g=t.views||t.children))return[3,8];m=0,y.label=5;case 5:return m<g.length?(v=g[m],[4,this.create(v,p)]):[3,8];case 6:(x=y.sent())&&p.add(x),y.label=7;case 7:return m++,[3,5];case 8:return[2,p]}})})},t.prototype.drawNode=function(t,e){return void 0===e&&(e=!1),It(this,void 0,void 0,function(){var i,n,s,r,o,a,h,l,c,d,u,f,p,g,m,v,x,y,b,w,S,_,k;return Pt(this,function(z){switch(z.label){case 0:return i=t.layoutBox,n=t.computedStyle,s=t.attributes,r=t.name,o=t.children,a=t.fixedLine,h=t.attributes,l=h.src,c=h.text,d=n.position,u=n.backgroundImage,f=n.backgroundRepeat,["fixed"].includes(d)&&!e?[2]:(this.ctx.save(),r!==Me?[3,7]:l&&u?f?[4,this.drawPattern(s,i,n)]:[3,2]:[3,5]);case 1:return z.sent(),[3,4];case 2:return[4,this.drawImage(s,i,n,!1)];case 3:z.sent(),z.label=4;case 4:return[3,6];case 5:this.drawView(i,n),z.label=6;case 6:return[3,10];case 7:return r===ze&&l?[4,this.drawImage(s,i,n,!1)]:[3,9];case 8:return z.sent(),[3,10];case 9:r===Ie?this.drawText(c,i,n,s):r===Pe&&ke.api&&ke.api.draw(c,this,i,n),z.label=10;case 10:if(this.progress+=1,g=(p=a||{}).beforeElements,m=p.afterElements,!g)return[3,14];v=0,x=g,z.label=11;case 11:return v<x.length?(k=x[v],[4,this.drawNode(k)]):[3,14];case 12:z.sent(),z.label=13;case 13:return v++,[3,11];case 14:if(!o)return[3,18];y=Object.values?Object.values(o):Object.keys(o).map(function(t){return o[t]}),b=0,w=y,z.label=15;case 15:return b<w.length?"absolute"===(k=w[b]).computedStyle.position?[3,17]:[4,this.drawNode(k)]:[3,18];case 16:z.sent(),z.label=17;case 17:return b++,[3,15];case 18:if(!m)return[3,22];S=0,_=m,z.label=19;case 19:return S<_.length?(k=_[S],[4,this.drawNode(k)]):[3,22];case 20:z.sent(),z.label=21;case 21:return S++,[3,19];case 22:return this.ctx.restore(),[2]}})})},t.prototype.render=function(t){var e=this;return void 0===t&&(t=30),new Promise(function(i,n){return It(e,void 0,void 0,function(){var e,s,r,o,a,h,l,c,d,u;return Pt(this,function(f){switch(f.label){case 0:return e=+new Date,this.init(),[4,(p=t,void 0===p&&(p=0),new Promise(function(t){return setTimeout(t,p)}))];case 1:f.sent(),f.label=2;case 2:if(f.trys.push([2,14,,15]),!this.node)return[3,12];if(s=this.root.fixedLine||{},r=s.beforeElements,o=s.afterElements,!r)return[3,6];a=0,h=r,f.label=3;case 3:return a<h.length?(d=h[a],[4,this.drawNode(d,!0)]):[3,6];case 4:f.sent(),f.label=5;case 5:return a++,[3,3];case 6:return[4,this.drawNode(this.node)];case 7:if(f.sent(),!o)return[3,11];l=0,c=o,f.label=8;case 8:return l<c.length?(d=c[l],[4,this.drawNode(d,!0)]):[3,11];case 9:f.sent(),f.label=10;case 10:return l++,[3,8];case 11:return i(this.node),[3,13];case 12:this.lifecycle("onEffectFail","node is empty"),f.label=13;case 13:return[3,15];case 14:return u=f.sent(),this.lifecycle("onEffectFail",u),n(u),[3,15];case 15:return console.log("渲染用时:"+(+new Date-e-30)+"ms"),[2]}var p})})})},t.prototype.onEffectFinished=function(){var t=this,e=Object.keys(this.imageBus).map(function(e){return t.imageBus[e]});return Promise.all(e)},t.prototype.destroy=function(){this.node=[]},t.prototype.save=function(t){try{var e=t||{},i=e.fileType,n=void 0===i?"png":i,s=e.quality,r=void 0===s?1:s;return this.canvas.toDataURL("image/".concat(n),r)}catch(o){return this.lifecycle("onEffectFail","image cross domain"),o}},t}();Mt.WEB==Et&&(window.Painter=je);const Ce=lt({name:"lime-painter",mixins:[xt,ut("painter"),{}],data:()=>({use2dCanvas:!1,canvasHeight:150,canvasWidth:null,parentWidth:0,inited:!1,progress:0,firstRender:0,done:!1,isPc:!1}),computed:{styles(){return`${this.size}${this.customStyle||""};`+(this.hidden&&"position: fixed; left: 1500rpx;")},canvasId(){return`l-painter${this._&&this._.uid||this._uid}`},size(){if(this.boardWidth&&this.boardHeight)return`width:${this.boardWidth}px; height: ${this.boardHeight}px;`},dpr(){return this.pixelRatio||o().pixelRatio},boardWidth(){const{width:t=0}=this.elements&&this.elements.css||this.elements||this,e=St(t||this.width);return e||Math.max(e,St(this.canvasWidth))},boardHeight(){const{height:t=0}=this.elements&&this.elements.css||this.elements||this,e=St(t||this.height);return e||Math.max(e,St(this.canvasHeight))},hasBoard(){return this.board&&Object.keys(this.board).length},elements(){return this.hasBoard?this.board:JSON.parse(JSON.stringify(this.el))}},watch:{},created(){this.show=!0,o()},async mounted(){await bt(30),await this.getParentWeith(),this.$nextTick(()=>{setTimeout(()=>{this.$watch("elements",this.watchRender,{deep:!0,immediate:!0})},30)})},unmounted(){this.done=!1,this.inited=!1,this.firstRender=0,this.progress=0,this.painter=null,clearTimeout(this.rendertimer)},methods:{async watchRender(t,e){t&&t.views&&(this.firstRender?this.firstRender:t.views.length)&&Object.keys(t).length&&JSON.stringify(t)!=JSON.stringify(e)&&(this.firstRender=1,this.progress=0,this.done=!1,clearTimeout(this.rendertimer),this.rendertimer=setTimeout(()=>{this.render(t)},this.beforeDelay))},async setFilePath(t,e){let i=t;const{pathType:n=this.pathType}=e||this;var s;return"base64"!=n||yt(t)?"url"==n&&yt(t)&&(i=await(s=t,new Promise((t,e)=>{let i=s.split(",")[0].split(":")[1].split(";")[0],n=atob(s.split(",")[1]),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let s=0;s<n.length;s++)o[s]=n.charCodeAt(s);t(URL.createObjectURL(new Blob([o],{type:i})))}))):i=await _t(t),e&&e.isEmit&&this.$emit("success",i),i},async getSize(t){const{width:e}=t.css||t,{height:i}=t.css||t;this.size||(e||i?(this.canvasWidth=e||this.canvasWidth,this.canvasHeight=i||this.canvasHeight,await bt(30)):await this.getParentWeith())},canvasToTempFilePathSync(t){this.stopWatch=this.$watch("done",e=>{e&&(this.canvasToTempFilePath(t),this.stopWatch&&this.stopWatch())},{immediate:!0})},getParentWeith(){return new Promise(t=>{d().in(this).select(".lime-painter").boundingClientRect().exec(e=>{const{width:i,height:n}=e[0]||{};this.parentWidth=Math.ceil(i||0),this.canvasWidth=this.parentWidth||300,this.canvasHeight=n||this.canvasHeight||150,t(e[0])})})},async render(t={}){if(!Object.keys(t).length)return console.error("空对象");this.progress=0,this.done=!1,await this.getSize(t);const e=await this.getContext();let{use2dCanvas:i,boardWidth:n,boardHeight:s,canvas:r,afterDelay:o}=this;if(i&&!r)return Promise.reject(new Error("render: fail canvas has not been created"));if(this.boundary={top:0,left:0,width:n,height:s},this.painter=null,!this.painter){const{width:i}=t.css||t;t.css,!i&&this.parentWidth&&Object.assign(t,{width:this.parentWidth});const o={context:e,canvas:r,width:n,height:s,pixelRatio:this.dpr,useCORS:this.useCORS,createImage:kt.bind(this),listen:{onProgress:t=>{this.progress=t,this.$emit("progress",t)},onEffectFail:t=>{this.$emit("faill",t)}}};this.painter=new je(o)}const{width:a,height:h}=await this.painter.source(JSON.parse(JSON.stringify(t)));return this.boundary.height=this.canvasHeight=h,this.boundary.width=this.canvasWidth=a,await bt(this.sleep),this.painter.setContext(this.ctx),await this.painter.render(),await new Promise(t=>this.$nextTick(t)),i||await this.canvasDraw(),o&&i&&await bt(o),this.$emit("done"),this.done=!0,this.isCanvasToTempFilePath&&this.canvasToTempFilePath().then(t=>{this.$emit("success",t.tempFilePath)}).catch(t=>{this.$emit("fail",new Error(JSON.stringify(t)))}),Promise.resolve({ctx:e,draw:this.painter,node:this.node})},canvasDraw(t=!1){return new Promise((e,i)=>this.ctx.draw(t,()=>setTimeout(()=>e(),this.afterDelay)))},async getContext(){if(!this.canvasWidth)return this.$emit("fail","painter no size"),console.error("[lime-painter] no size: 请给画板或父级设置尺寸"),Promise.reject();if(this.ctx&&this.inited)return Promise.resolve(this.ctx);const{type:t,use2dCanvas:e,dpr:i,boardWidth:n,boardHeight:s}=this,r=()=>new Promise(t=>{d().in(this).select(`#${this.canvasId}`).boundingClientRect().exec(e=>{if(e){const i=g(this.canvasId,this);this.inited||(this.inited=!0,this.use2dCanvas=!1,this.canvas=e),this.ctx=i,t(this.ctx)}else console.error("[lime-painter] no node")})});return e?new Promise(e=>{d().in(this).select(`#${this.canvasId}`).node().exec(i=>{let{node:n}=i&&i[0]||{};if(n){const i=n.getContext(t);this.inited||(this.inited=!0,this.use2dCanvas=!0,this.canvas=n),this.ctx=i,e(this.ctx)}else console.error("[lime-painter]: no size")})}):r()},canvasToTempFilePath(t={}){return new Promise(async(e,i)=>{const{use2dCanvas:n,canvasId:s,dpr:r,fileType:o,quality:a}=this;let{top:h=0,left:l=0,width:c,height:d}=this.boundary||this,f=c*r,p=d*r;const g=Object.assign({x:l,y:h,width:c,height:d,destWidth:f,destHeight:p,canvasId:s,fileType:o,quality:a},t,{success:async i=>{try{const n=await this.setFilePath(i.tempFilePath||i,t),s=Object.assign(i,{tempFilePath:n});t.success&&t.success(s),e(s)}catch(n){this.$emit("fail",n)}}});if((this.isPc||n)&&(g.canvas=this.canvas),n&&!this.isPc)try{const i=this.canvas.toDataURL(`image/${t.fileType||o}`.replace(/pg/,"peg"),t.quality||a);if(/data:,/.test(i))u(g,this);else{const n=await this.setFilePath(i,t);t.success&&t.success({tempFilePath:n}),e({tempFilePath:n})}}catch(m){t.fail&&t.fail(m),i(m)}else u(g,this)})}}},[["render",function(s,o,a,h,l,c){const d=m,u=r;return t(),e(u,{class:"lime-painter",ref:"limepainter"},{default:i(()=>[c.canvasId&&c.size?(t(),e(u,{key:0,style:f(c.styles)},{default:i(()=>[l.use2dCanvas?(t(),e(d,{key:0,class:"lime-painter__canvas",id:c.canvasId,type:"2d",style:f(c.size)},null,8,["id","style"])):(t(),e(d,{key:1,class:"lime-painter__canvas","canvas-id":c.canvasId,style:f(c.size),id:c.canvasId,width:c.boardWidth*c.dpr,height:c.boardHeight*c.dpr},null,8,["canvas-id","style","id","width","height"]))]),_:1},8,["style"])):p("",!0),n(s.$slots,"default",{},void 0,!0)]),_:3},512)}],["__scopeId","data-v-a3f2bb21"]]),Fe=v({__name:"poster",props:{show:Boolean,link:{type:String,default:""},mnpQrcode:{type:String,default:""},goodsId:{type:String,default:""},goodsPrice:{type:String,default:""},goodsName:{type:String,default:""},goodsImage:{type:String,default:""}},emits:["success","fail"],setup(n,{expose:s,emit:r}){const{getImageUrl:o,config:a}=x(),h=y();b(h);const l=w();return s({handleDrawCanvas:async()=>{var t;console.log("开始生成");try{null==(t=l.value)||t.canvasToTempFilePathSync({fileType:"png",pathType:"base64",quality:1,success:({tempFilePath:t})=>{console.log("生产结果",t),k(),r("success",t)},fail:t=>{console.log(t),r("fail",t),k(),uni.$u.toast("调用海报错误",t)}})}catch(e){console.log("error",e),k(),uni.$u.toast("调用海报错误",e)}}}),(s,r)=>{const o=z(I("l-painter-image"),pt),h=z(I("l-painter-text"),gt),c=z(I("l-painter-view"),mt),d=z(I("l-painter-qrcode"),vt),u=z(I("l-painter"),Ce);return t(),e(u,{ref_key:"painterRef",ref:l,isCanvasToTempFilePath:!1,css:"width: 640rpx;","custom-style":"position: fixed; left: 200%;"},{default:i(()=>[S(c,{css:"\n border-radius: 20rpx;\n overflow: hidden;\n background-color: white;\n padding: 30rpx;\n "},{default:i(()=>[S(o,{src:n.goodsImage,css:"object-fit: cover; object-position: 50% 50%; width: 590rpx; border-radius: 20rpx;"},null,8,["src"]),S(c,{css:"\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n "},{default:i(()=>[S(c,{css:"\n box-sizing: border-box;\n border-radius: 20rpx;\n background: #fff;\n margin-top: 30rpx;\n display: flex;\n "},{default:i(()=>[S(c,{css:"\n box-sizing: border-box;\n "},{default:i(()=>[S(h,{text:n.goodsName,css:"\n width: 400rpx;\n line-clamp: 2;\n color: #333333;\n font-size: 32rpx;\n font-weight: bold;\n "},null,8,["text"])]),_:1}),S(c,{css:"\n width: 2rpx;\n height: 60rpx;\n margin: 0 20rpx;\n flex-shrink: 0;\n background: #EAEAEA;\n box-sizing: border-box;\n "}),S(c,{css:"\n box-sizing: border-box;\n "},{default:i(()=>[S(h,{text:"¥",css:"\n color: #E86016;\n font-size: 24rpx;\n margin-top: 18rpx;\n "}),S(h,{text:n.goodsPrice,css:"\n color: #E86016;\n font-size: 40rpx;\n font-weight: bold;\n "},null,8,["text"])]),_:1})]),_:1}),S(c,{css:"\n display: inline-block;\n margin-top: 40rpx;\n padding-bottom: 40rpx;\n "},{default:i(()=>[S(c,{css:"\n display: inline-block;\n width: 480rpx;\n "},{default:i(()=>[S(c,{css:"\n display: inline-block;\n width: 100rpx;\n text-align: center;\n "},{default:i(()=>[S(d,{css:"\n box-sizing: border-box;\n width: 100rpx;\n height: 100rpx;\n padding: 10rpx;\n border-radius: 8rpx;\n background-color: #FFFFFF;\n ",text:n.link},null,8,["text"])]),_:1}),S(c,{css:"\n display: inline-block;\n width: 350rpx;\n margin-top: 16rpx;\n margin-left: 16rpx;\n "},{default:i(()=>[S(c,{css:"display: block;"},{default:i(()=>[S(h,{text:"①保存图片到相册",css:"\n color: #999999;\n font-size: 24rpx;\n line-height: 30rpx;\n font-weight: bold;\n "})]),_:1}),S(c,{css:"display: block;"},{default:i(()=>[S(h,{text:"②微信扫码可识别",css:"\n color: #999999;\n font-size: 24rpx;\n line-height: 30rpx;\n margin-top: 14rpx;\n font-weight: bold;\n "})]),_:1})]),_:1})]),_:1}),S(c,{css:"display: inline-block; width: 100rpx"},{default:i(()=>{var t;return[S(o,{src:null==(t=_(a))?void 0:t.shop_logo,css:"width: 100rpx; height: 100rpx; border-radius: 20rpx;display: inline-block;"},null,8,["src"])]}),_:1})]),_:1})]),_:1})]),_:1})]),_:1},512)}}}),Le=lt(v({__name:"share-popup",props:{show:Boolean,shareId:{type:[String,Number],default:""},goodsId:{type:String,default:""},goodsPrice:{type:String,default:""},goodsName:{type:String,default:""},goodsImage:{type:String,default:""}},emits:["update:show"],setup(n,{emit:s}){const o=n,a=w(""),h=w(),l=w(!1),c=w("");w({});const d=P(()=>`${O.baseUrl}/mobile/pages/goods/index?id=${o.shareId}`),u=P({get:()=>o.show,set:t=>{s("update:show",t)}}),f=()=>{h.value.handleDrawCanvas()},p=t=>{a.value=t,u.value=!1},g=()=>{uni.$u.toast("生成失败")},m=()=>{l.value=!0,u.value=!1},v=async()=>{uni.$u.toast("请长按图片保存")};return M(()=>o.goodsImage,()=>{(async()=>{await Promise.all([]),setTimeout(()=>{f()},100)})()}),(s,o)=>{const f=r,x=B,y=z(I("u-mask"),at),b=z(I("u-popup"),ht);return t(),e(f,{class:"share-popup"},{default:i(()=>[S(y,{"mask-click-able":!0,show:_(u),zoom:!1,"safe-area-inset-bottom":!0,onClick:o[0]||(o[0]=t=>u.value=!1)},{default:i(()=>[S(f,{class:"flex flex-col min-h-0 h-full"},{default:i(()=>[S(f,{class:"flex items-center justify-center flex-1",style:{"padding-top":"50px"}},{default:i(()=>[W("img",{style:{width:"640rpx"},src:a.value},null,8,["src"])]),_:1}),S(f,{class:"share-tab safe-area-inset-bottom bg-white rounded-t-[20rpx]"},{default:i(()=>[S(f,{class:"flex-col col--center",onClick:R(v,["stop"])},{default:i(()=>[S(x,{mode:"widthFix",class:"share-icon",src:"/mobile/static/images/icon_generate_poster.png"}),S(f,{class:"m-t-10"},{default:i(()=>[T("存到手机")]),_:1})]),_:1},8,["onClick"]),S(f,{oclass:"flex-col col--center",onClick:R(m,["stop"])},{default:i(()=>[S(x,{class:"share-icon",src:"/mobile/static/images/icon_wechat.png"}),S(f,{class:"m-t-10"},{default:i(()=>[T("微信好友")]),_:1})]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["show"]),S(b,{class:"share-tips",modelValue:l.value,"onUpdate:modelValue":o[1]||(o[1]=t=>l.value=t),mode:"top"},{default:i(()=>[S(f,{style:{overflow:"hidden"}},{default:i(()=>[S(x,{src:"/mobile/static/images/share_arrow.png",class:"share-arrow"}),S(f,{class:"white",style:{"text-align":"center","margin-top":"280rpx"}},{default:i(()=>[S(f,{class:"bold lg"},{default:i(()=>[T("立即分享给好友吧")]),_:1}),S(f,{class:"sm m-t-10"},{default:i(()=>[T("点击屏幕右上角将本页面分享给好友")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),S(Fe,{ref_key:"posterRef",ref:h,goodsId:n.goodsId,goodsPrice:n.goodsPrice,goodsName:n.goodsName,goodsImage:n.goodsImage,mnpQrcode:c.value,link:_(d),onSuccess:p,onFail:g},null,8,["goodsId","goodsPrice","goodsName","goodsImage","mnpQrcode","link"])]),_:1})}}}),[["__scopeId","data-v-3dc97cb5"]]),Ae=lt(v({options:{styleIsolation:"shared"},__name:"index",setup(n){const o=U(),h=D(),l=y(),c=w(j.LOADING),d=C({id:-1,name:"",remarks:"",unit_desc:"",image:"",price:"",scribing_price:"",content:"",total_order_num:"",is_collect:"",goods_image:[],comment_lists:[],goods_staff:[],appoint_time:[],comment_count:0,duration:0,tags:""}),u=P(()=>l.token),f=w(""),g=w(!1),m=w(0),v=w(0),x=async()=>{try{const t=await ct({id:f.value,city_id:E.city_id});t.goods_image=t.goods_image.map(t=>({url:t})),Reflect.ownKeys(d).map(e=>d[e]=t[e]),console.log(d),c.value=j.NORMAL,d.tags=d.tags.split("|")}catch(t){console.log("初始化商品详情",t),c.value=j.ERROR}},b=()=>{if(!u.value)return h.navigateTo("/pages/login/login");try{if(o.query.is_shop)return h.navigateTo({path:"/bundle/pages/select_coach/index",query:{goods_id:f.value,shop_id:o.query.shop_id}});o.query.coach_id?h.navigateTo({path:"/pages/order_buy/index",query:{goods_id:f.value,coach_id:o.query.coach_id}}):h.navigateTo({path:"/pages/order_coach/index",query:{id:f.value}})}catch(t){console.log("立即下单",t)}};return F(t=>{if(null==t?void 0:t.scene){const e=decodeURIComponent(t.scene);for(let t of e.split("&"))"id"==t.split("=")[0]&&(f.value=t.split("=")[1])}else f.value=(null==t?void 0:t.id)||0;x()}),L(t=>{m.value=t.scrollTop;const e=a(100);v.value=t.scrollTop/e>1?1:t.scrollTop/e}),(n,o)=>{var a;const l=z(I("page-meta"),J),v=z(I("l-swiper"),Q),y=z(I("price"),K),w=r,k=s,P=z(I("u-icon"),Z),M=z(I("u-image"),et),W=z(I("u-rate"),it),O=z(I("mp-html"),nt),j=B,C=q,F=z(I("u-button"),st),L=z(I("u-empty"),rt),E=z(I("page-status"),ot),U=z(I("u-back-top"),G),D=z(I("share-popup"),Le);return t(),A($,null,[S(l,{"page-style":n.$theme.pageStyle},null,8,["page-style"]),S(E,{status:c.value},{error:i(()=>[S(w,{class:"empty"},{default:i(()=>[S(L,{text:"抱歉,该服务项目不存在~",src:"/static/images/empty/collection.png","icon-size":300,color:"#888888"},{bottom:i(()=>[S(w,{class:"empty-bottom"},{default:i(()=>[S(C,{class:"bg-primary text-lg text-white leading-[80rpx] h-[80rpx]",onClick:o[3]||(o[3]=t=>_(h).reLaunch("/pages/index/index"))},{default:i(()=>[T(" 去看看其它 ")]),_:1})]),_:1})]),_:1},8,["src"])]),_:1})]),default:i(()=>[S(w,{class:"goods"},{default:i(()=>[S(w,null,{default:i(()=>[S(v,{content:{data:d.goods_image},name:"url",height:"750",indicatorPos:"bottomRight",mode:"number",borderRadius:"0"},null,8,["content"]),S(w,{class:"goods-info"},{default:i(()=>{var n;return[S(w,{class:"flex items-end"},{default:i(()=>[S(w,{class:""},{default:i(()=>[S(y,{content:d.price,color:"#E86016",mainSize:"60rpx",minorSize:"36rpx","font-weight":"900"},null,8,["content"])]),_:1}),0!=d.scribing_price?(t(),e(w,{key:0,class:"text-xs normal text-muted mb-1 ml-4"},{default:i(()=>[S(y,{content:d.scribing_price,color:"inherit",mainSize:"28rpx",minorSize:"28rpx","line-through":!0},null,8,["content"])]),_:1})):p("",!0)]),_:1}),S(w,{class:"mt-[16rpx] mb-[20rpx]"},{default:i(()=>[S(k,{class:"font-bold text-2xl mt-[20rpx] mb-[20rpx]"},{default:i(()=>[T(H(d.name),1)]),_:1})]),_:1}),(null==(n=d.tags)?void 0:n.length)?(t(),e(w,{key:0,class:"u-flex text-content text-base"},{default:i(()=>[(t(!0),A($,null,N(d.tags,(n,s)=>(t(),e(k,{class:"service-desc",key:s},{default:i(()=>[S(k,null,{default:i(()=>[T(H(n),1)]),_:2},1024),S(k,{class:"line"},{default:i(()=>[T("|")]),_:1})]),_:2},1024))),128))]),_:1})):p("",!0),S(w,{class:"flex justify-between pt-3 mt-3 text-xs",style:{"border-top":"1px solid #eaeaea"}},{default:i(()=>[S(w,{class:"flex items-center"},{default:i(()=>[S(P,{name:"clock",size:"24",color:"#999"}),S(k,{class:"text-muted ml-1"},{default:i(()=>[T("服务时长:")]),_:1}),S(k,{class:"text-[#C38925]"},{default:i(()=>[T(H(d.duration)+"分钟 ",1)]),_:1})]),_:1}),d.total_order_num?(t(),e(w,{key:0,class:"flex items-center"},{default:i(()=>[S(P,{name:"account",size:"24",color:"#999"}),S(k,{class:"text-muted ml-1"},{default:i(()=>[T("超")]),_:1}),S(k,{class:"text-[#C38925]"},{default:i(()=>[T(H(d.total_order_num)+"人 ",1)]),_:1}),S(k,{class:"text-muted"},{default:i(()=>[T("选择")]),_:1})]),_:1})):p("",!0)]),_:1})]}),_:1}),d.comment_lists.length?(t(),e(w,{key:0,class:"goods-comment",onClick:o[0]||(o[0]=t=>_(h).navigateTo("/bundle/pages/evaluate_goods/index?id="+f.value))},{default:i(()=>[S(w,{class:"flex justify-between items-center"},{default:i(()=>[S(w,{class:"flex items-center"},{default:i(()=>[S(k,{class:"text-lg font-bold"},{default:i(()=>[T(" 评价 ")]),_:1}),S(k,{class:"text-xs"},{default:i(()=>[T(" ("+H(d.comment_count)+") ",1)]),_:1})]),_:1}),S(w,{class:"flex items-center text-xs"},{default:i(()=>[S(k,{class:"text-muted mr-1"},{default:i(()=>[T("查看全部")]),_:1}),S(P,{name:"arrow-right",size:"22",color:"#999"})]),_:1})]),_:1}),S(w,null,{default:i(()=>[(t(!0),A($,null,N(d.comment_lists,n=>(t(),e(w,{class:"goods-comment-item mt-[30rpx]",key:n.id},{default:i(()=>[S(w,{class:"flex justify-between"},{default:i(()=>[S(w,{class:"flex"},{default:i(()=>{var t;return[S(M,{src:null==(t=null==n?void 0:n.user)?void 0:t.avatar,width:"80",height:"80","border-radius":"50%"},null,8,["src"]),S(w,{class:"ml-[20rpx]"},{default:i(()=>[S(w,{class:"text-base normal"},{default:i(()=>{var t;return[T(H(null==(t=null==n?void 0:n.user)?void 0:t.nickname),1)]}),_:2},1024),S(w,{class:"mt-1 text-xs text-muted"},{default:i(()=>[T(H(n.create_time),1)]),_:2},1024)]),_:2},1024)]}),_:2},1024),S(w,null,{default:i(()=>[S(W,{count:5,modelValue:n.service_comment,"onUpdate:modelValue":t=>n.service_comment=t,disabled:!0,"inactive-color":"#eaeaeb",inactiveIcon:"star-fill","active-color":"#d86930"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),S(w,{class:"text-base normal u-line-2 text-content mt-[20rpx] mb-[20rpx]"},{default:i(()=>[T(H(n.comment),1)]),_:2},1024),S(w,{class:"flex flex-wrap"},{default:i(()=>[(t(!0),A($,null,N(n.goods_comment_image,(s,r)=>(t(),e(w,{key:r,class:X(["mt-[10rpx]",{"mr-[10rpx]":(r+1)%4!=0}]),onClick:R(t=>((t,e)=>{V({current:e,urls:t.map(t=>t.uri)})})(n.goods_comment_image,r),["stop"])},{default:i(()=>[S(M,{src:s.uri,width:"150",height:"150","border-radius":"14rpx"},null,8,["src"])]),_:2},1032,["class","onClick"]))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})):p("",!0),S(w,{class:"mt-[24rpx] mx-[24rpx] p-[24rpx] bg-white rounded-[20rpx]",style:{"margin-bottom":"200rpx"}},{default:i(()=>[S(w,{class:"font-medium text-lg text-main"},{default:i(()=>[T(" 服务详情 ")]),_:1}),S(w,{class:"service-content mt-4"},{default:i(()=>[S(O,{content:d.content},null,8,["content"])]),_:1})]),_:1}),S(w,{class:"footer u-flex gap-x-3 fixed"},{default:i(()=>[S(w,{class:"flex flex-col justify-center items-center w-[70rpx]",style:{"line-height":"1"},onClick:o[1]||(o[1]=t=>g.value=!0)},{default:i(()=>[S(j,{class:"w-[54rpx] h-[54rpx]",src:"/mobile/static/images/icon_share.png"}),S(k,{class:"mt-1 text-[22rpx]"},{default:i(()=>[T("分享")]),_:1})]),_:1}),S(w,{class:"flex-none",style:{width:"200rpx"}},{default:i(()=>[S(C,{class:"flex items-center justify-center",style:{height:"80rpx",color:"#ffffff","border-radius":"25rpx","background-color":"#333333"},onClick:o[2]||(o[2]=t=>(async t=>{if(!u.value)return uni.$u.toast("请先登录!");try{await Y({id:_(f),type:2}),t?uni.$u.toast("取消收藏成功"):uni.$u.toast("收藏成功"),await x()}catch(e){console.log("收藏请求错误",e)}})(d.is_collect))},{default:i(()=>[S(P,{name:d.is_collect?"star-fill":"star",color:"#ffffff",size:"30"},null,8,["name"]),S(k,{class:"text-base font-medium ml-1"},{default:i(()=>[T("加收藏")]),_:1})]),_:1})]),_:1}),S(w,{class:"flex-1"},{default:i(()=>[S(F,{type:"primary","custom-style":{display:"flex","align-items":"center","justify-content":"space-between"},onClick:b},{default:i(()=>[S(y,{content:d.price,color:"#ffffff","font-weight":"900",mainSize:"40rpx",minorSize:"40rpx"},{prefix:i(()=>[S(k,{class:"text-xs"},{default:i(()=>[T("¥")]),_:1})]),_:1},8,["content"]),S(k,{class:"text-base font-medium"},{default:i(()=>[T("立即下单")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["status"]),S(U,{"scroll-top":m.value,top:100,customStyle:{backgroundColor:"#FFF",color:"#000",boxShadow:"0px 3px 6px rgba(0, 0, 0, 0.1)"}},null,8,["scroll-top","customStyle"]),S(D,{show:g.value,"onUpdate:show":o[4]||(o[4]=t=>g.value=t),goodsId:d.id,goodsPrice:d.price,goodsName:d.name,goodsImage:(null==(a=d.goods_image[0])?void 0:a.url)||"",onClose:o[5]||(o[5]=t=>g.value=!1)},null,8,["show","goodsId","goodsPrice","goodsName","goodsImage"])],64)}}}),[["__scopeId","data-v-6b97716b"]]);export{Ae as default};
|