(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-45512059"],{"2de2":function(e,t,r){r.d(t,"e",(function(){return n})),r.d(t,"d",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c}));let n="/duoduo-service/setup-service/",o="/duoduo-service/object-service/",a="/duoduo-service/duoduoenv-service/",i="/duoduo-service",s="/duoduo-service/",c="/duoduo-service/custom-service/"},4244:function(e,t,r){r("b1eb")},"4b9e":function(e,t,r){r.d(t,"a",(function(){return h}));t=r("23f9");var n=r("7a23"),o=r("1fba"),a=r("e5f6"),i=r("d243"),s=r("8db7"),c=r("450f"),l=r("efd9");let[u,d]=Object(o.a)("form");r={colon:Boolean,disabled:Boolean,readonly:Boolean,showError:Boolean,labelWidth:a.f,labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,submitOnEnter:a.g,showErrorMessage:a.g,errorMessageAlign:String,validateTrigger:{type:[String,Array],default:"onBlur"}},o=Object(n.defineComponent)({name:u,props:r,emits:["submit","failed"],setup(e,{emit:t,slots:r}){let{children:o,linkChildren:a}=Object(c.useChildren)(i.f),u=e=>e?o.filter(t=>e.includes(t.name)):o,h=e=>new Promise((t,r)=>{let n=[];u(e).reduce((e,t)=>e.then(()=>{if(!n.length)return t.validate().then(e=>{e&&n.push(e)})}),Promise.resolve()).then(()=>{n.length?r(n):t()})}),f=e=>new Promise((t,r)=>{var n=u(e);Promise.all(n.map(e=>e.validate())).then(e=>{(e=e.filter(Boolean)).length?r(e):t()})}),m=e=>{let t=o.find(t=>t.name===e);return t?new Promise((e,r)=>{t.validate().then(t=>{t?r(t):e()})}):Promise.reject()},g=t=>("string"==typeof t?m:e.validateFirst?h:f)(t),p=(e,t)=>{o.some(r=>r.name===e&&(r.$el.scrollIntoView(t),!0))},v=()=>o.reduce((e,t)=>(e[t.name]=t.formValue.value,e),{}),b=()=>{let r=v();g().then(()=>t("submit",r)).catch(n=>{t("failed",{values:r,errors:n}),e.scrollToError&&n[0].name&&p(n[0].name)})},y=e=>{Object(s.e)(e),b()};return a({props:e}),Object(l.a)({submit:b,validate:g,getValues:v,scrollToField:p,resetValidation:e=>{"string"==typeof e&&(e=[e]),u(e).forEach(e=>{e.resetValidation()})},getValidationStatus:()=>o.reduce((e,t)=>(e[t.name]=t.getValidationStatus(),e),{})}),()=>{var e;return Object(n.createVNode)("form",{class:d(),onSubmit:y},[null==(e=r.default)?void 0:e.call(r)])}}});let h=Object(t.a)(o)},5118:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r("6017"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r("c8ba"))},6017:function(e,t,r){(function(e,t){function r(e){delete c[e]}function n(e){if(l)setTimeout(n,0,e);else{var t=c[e];if(t){l=!0;try{var o=t,a=o.callback,s=o.args;switch(s.length){case 0:a();break;case 1:a(s[0]);break;case 2:a(s[0],s[1]);break;case 3:a(s[0],s[1],s[2]);break;default:a.apply(i,s)}}finally{r(e),l=!1}}}}function o(){function e(e){e.source===a&&"string"==typeof e.data&&0===e.data.indexOf(t)&&n(+e.data.slice(t.length))}var t="setImmediate$"+Math.random()+"$";a.addEventListener?a.addEventListener("message",e,!1):a.attachEvent("onmessage",e),d=function(e){a.postMessage(t+e,"*")}}var a,i,s,c,l,u,d,h,f;(a="undefined"==typeof self?void 0===e?this:e:self).setImmediate||(s=1,l=!(c={}),u=a.document,e=(e=Object.getPrototypeOf&&Object.getPrototypeOf(a))&&e.setTimeout?e:a,"[object process]"==={}.toString.call(a.process)?d=function(e){t.nextTick((function(){n(e)}))}:(()=>{var e,t;return a.postMessage&&!a.importScripts&&(e=!0,t=a.onmessage,a.onmessage=function(){e=!1},a.postMessage("","*"),a.onmessage=t,e)})()?o():d=a.MessageChannel?((f=new MessageChannel).port1.onmessage=function(e){n(e.data)},function(e){f.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(h=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){n(e),t.onreadystatechange=null,h.removeChild(t),t=null},h.appendChild(t)}):function(e){setTimeout(n,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r{e.queryPageWorkSpace()}):r(e=>{e.showLogin=!0,Object(T.a)()}):r("/error")},setup(e){let t=Object(b.d)();var r=Object(y.u)();let o=Object(C.b)(),a=location.origin,i=Object(n.reactive)({parseImgUrl:y.z,codeValue:a+"/ipad/home",showLogin:!1,size:134,spaceTimer:null,type:1,userInfo:r,checkLoginType(){1===i.type?i.type=2:i.type=1,1===i.type?i.getPadQrCodeStatus():i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null)},username:"",password:"",onSubmit(e){e=e,Object(E.b)().request("/server/login",O.b.POST,e,O.a.json).then(e=>{"success"===e.result?(Object(T.j)(e.token),t.push({path:"/choice-project"})):Object(N.a)("登录失败!")})},queryPageWorkSpace(){var e;i.userInfo.mac?(e={criteria:{macAddress:i.userInfo.mac,isMajorSpace:1},orders:[{column:"createTime",asc:!1}],page:1,size:1},Object(I.H)(e).then(e=>{var r;"success"===e.result?(e=null!=(e=null==e?void 0:e.content)?e:[])&&e.length?(i.showLogin=!1,r=e[0].projectId,o.commit(R.a.SET_PROJECT_ID,r),t.push({name:"envmonitor",query:{spaceId:e[0].spaceId}})):i.showLogin=!0:(i.showLogin=!0,i.spaceTimer=Object(P.setTimeout)(()=>{i.queryPageWorkSpace(),Object(P.clearTimeout)(i.spaceTimer)},5e3))}).catch(()=>{i.showLogin=!0,i.spaceTimer=Object(P.setTimeout)(()=>{i.queryPageWorkSpace(),Object(P.clearTimeout)(i.spaceTimer)},5e3)})):(i.showLogin=!0,t.push({name:"error"}))},getQrcode(){var e=i.userInfo.mac;return Object(y.y)(0,1e5,e)},qrCodeId:"",setCodeUrl(){var e=i.userInfo.mac,t=i.getQrcode();i.qrCodeId=t,i.codeValue=`${a}/ipad/home?type=ipad&id=${i.qrCodeId}&mac=`+e},clearTimer(){i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null)},refreshCode(){i.setCodeUrl(),i.clearTimer(),i.getPadQrCodeStatus()},codeStatus:{},timer:null,getPadQrCodeStatus(){var e=Object(y.C)({qrCodeId:i.qrCodeId});Object(I.p)(e).then(e=>{var r;i.codeStatus=null!=(e=null==e?void 0:e.data)?e:{},2===i.codeStatus.status?(e=i.codeStatus.projectId,r=i.codeStatus.spaceId,e&&r?(o.commit(R.a.SET_PROJECT_ID,e),t.push({name:"choiceSpace",query:{id:e,spaceId:r}})):e&&(o.commit(R.a.SET_PROJECT_ID,e),t.push({name:"choiceSpace",query:{id:e}}))):(i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null),i.timer=Object(P.setTimeout)(()=>{i.getPadQrCodeStatus()},1e3))})}});return Object(n.onBeforeUnmount)(()=>{i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null,Object(P.clearTimeout)(i.spaceTimer),i.spaceTimer=null)}),Object(n.onMounted)(()=>{i.setCodeUrl(),i.getPadQrCodeStatus()}),{...Object(n.toRefs)(i)}}}),r("4244"),r("72b2"),w=r("6b0d"),S=r.n(w);t.default=S()(v,[["render",function(e,t,r,v,b,y){var C=Object(n.resolveComponent)("qrcode-vue"),E=Object(n.resolveComponent)("van-icon");let O=Object(n.resolveComponent)("van-field"),w=Object(n.resolveComponent)("van-cell-group"),S=Object(n.resolveComponent)("van-button");var M=Object(n.resolveComponent)("van-form");return e.showLogin?(Object(n.openBlock)(),Object(n.createElementBlock)("div",o,[Object(n.createElementVNode)("div",{class:"home-btn",onClick:t[0]||(t[0]=(...t)=>e.checkLoginType&&e.checkLoginType(...t))},[2===e.type?(Object(n.openBlock)(),Object(n.createElementBlock)("span",a,"二维码登录")):(Object(n.openBlock)(),Object(n.createElementBlock)("span",i,"账号登录"))]),Object(n.createElementVNode)("div",s,[Object(n.createElementVNode)("div",c,[Object(n.createElementVNode)("div",l,[Object(n.createElementVNode)("img",{src:e.parseImgUrl("ipdImages","logo.svg"),alt:""},null,8,u),t[3]||(t[3]=Object(n.createElementVNode)("div",{class:"logo-text"},"SagaCare",-1))])]),Object(n.createElementVNode)("div",d,[1===e.type?(Object(n.openBlock)(),Object(n.createElementBlock)("div",h,[Object(n.createElementVNode)("div",f,[Object(n.createVNode)(C,{value:e.codeValue,class:"qrcode",foreground:"#CE9F27",level:"H"},null,8,["value"]),e.codeStatus.status?(Object(n.openBlock)(),Object(n.createElementBlock)("div",m,[1===e.codeStatus.status?(Object(n.openBlock)(),Object(n.createElementBlock)("span",g,"已扫描")):Object(n.createCommentVNode)("",!0),2===e.codeStatus.status||3===e.codeStatus.status?(Object(n.openBlock)(),Object(n.createBlock)(E,{key:1,class:"code-replay",onClick:e.refreshCode,name:"replay"},null,8,["onClick"])):Object(n.createCommentVNode)("",!0)])):Object(n.createCommentVNode)("",!0)]),t[4]||(t[4]=Object(n.createElementVNode)("div",{class:"qrcode-text"}," 请使用朵朵小程序,扫描上面二维码进行授权登录 ",-1))])):(Object(n.openBlock)(),Object(n.createElementBlock)("div",p,[Object(n.createVNode)(M,{onSubmit:e.onSubmit,class:"box-form"},{default:Object(n.withCtx)(()=>[Object(n.createVNode)(w,{inset:""},{default:Object(n.withCtx)(()=>[Object(n.createVNode)(O,{modelValue:e.username,"onUpdate:modelValue":t[1]||(t[1]=t=>e.username=t),name:"username",placeholder:"用户名",rules:[{required:!0,message:"请填写用户名"}]},null,8,["modelValue"]),Object(n.createVNode)(O,{modelValue:e.password,"onUpdate:modelValue":t[2]||(t[2]=t=>e.password=t),type:"password",name:"password",placeholder:"密码",rules:[{required:!0,message:"请填写密码"}]},null,8,["modelValue"])]),_:1}),Object(n.createElementVNode)("div",null,[Object(n.createVNode)(S,{round:"",block:"","native-type":"submit"},{default:Object(n.withCtx)(()=>t[5]||(t[5]=[Object(n.createTextVNode)(" 提交 ")])),_:1})])]),_:1},8,["onSubmit"])]))])]),t[6]||(t[6]=Object(n.createElementVNode)("div",{class:"fotter"},"欢迎使用智能办公",-1))])):Object(n.createCommentVNode)("",!0)}],["__scopeId","data-v-5db0a943"]])},a136:function(e,t,r){r.d(t,"a",(function(){return l}));t=r("23f9");var n=r("7a23"),o=r("1fba"),a=r("e5f6"),i=r("d243");let[s,c]=Object(o.a)("cell-group");r={title:String,inset:Boolean,border:a.g},o=Object(n.defineComponent)({name:s,inheritAttrs:!1,props:r,setup(e,{slots:t,attrs:r}){let o=()=>{var o;return Object(n.createVNode)("div",Object(n.mergeProps)({class:[c({inset:e.inset}),{[i.d]:e.border&&!e.inset}]},r),[null==(o=t.default)?void 0:o.call(t)])};return()=>e.title||t.title?Object(n.createVNode)(n.Fragment,null,[Object(n.createVNode)("div",{class:c("title",{inset:e.inset})},[t.title?t.title():e.title]),o()]):o()}});let l=Object(t.a)(o)},b1eb:function(e,t,r){},c280:function(e,t,r){e.exports={menuBg:"#fff",menuText:"#162b64",menuActiveText:"#435ebe"}},d39c:function(e,t,r){function n(e,t,r){if(t<0||31>>t!=0)throw new RangeError("Value out of range");for(var n=t-1;0<=n;n--)r.push(e>>>n&1)}function o(e,t){return 0!=(e>>>t&1)}function a(e){if(!e)throw new Error("Assertion error")}function i(e){return e in p}function s(e,t){void 0===t&&(t=0);var r=[];return e.forEach((function(e,n){var o=null;e.forEach((function(a,i){if(a||null===o)return i===e.length-1?a?void r.push(null===o?"M".concat(i+t,",").concat(n+t," h1v1H").concat(i+t,"z"):"M".concat(o+t,",").concat(n+t," h").concat(i+1-o,"v1H").concat(o+t,"z")):void 0:void(a&&null===o&&(o=i));r.push("M".concat(o+t," ").concat(n+t,"h").concat(i-o,"v1H").concat(o+t,"z")),o=null}))})),r.join("")}function c(e,t,r,n){var o=n.width,a=n.height,i=n.x,s=n.y,c=(r=e.length+2*r,Math.floor(.1*t));r/=t,t=(o||c)*r,o=(a||c)*r,a=null==i?e.length/2-t/2:i*r,c=null==s?e.length/2-o/2:s*r,i=null;return{x:a,y:c,h:o,w:t,excavation:i=n.excavate?{x:e=Math.floor(a),y:s=Math.floor(c),w:Math.ceil(t+a-e),h:Math.ceil(o+c-s)}:i}}function l(e,t){return e.slice().map((function(e,r){return r=t.y+t.h?e:e.map((function(e,r){return(r=t.x+t.w)&&e}))}))} /*! * qrcode.vue v3.6.0 * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3 * © 2017-PRESENT @scopewu(https://github.com/scopewu) * MIT License. */var u,d,h,f,m,g,p,v,b,y,C;t=t,u=r("7a23"),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{function e(t,r,n,o){if(this.version=t,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],t>>3]|=e<<7-(7&t)})),new e(u,r,j,s)},e.prototype.getModule=function(e,t){return 0<=e&&e>>9);var n=21522^(e<<10|t);for(a(n>>>15==0),r=0;r<=5;r++)this.setFunctionModule(8,r,o(n,r));for(this.setFunctionModule(8,7,o(n,6)),this.setFunctionModule(8,8,o(n,7)),this.setFunctionModule(7,8,o(n,8)),r=9;r<15;r++)this.setFunctionModule(14-r,8,o(n,r));for(r=0;r<8;r++)this.setFunctionModule(this.size-1-r,8,o(n,r));for(r=8;r<15;r++)this.setFunctionModule(8,this.size-15+r,o(n,r));this.setFunctionModule(8,this.size-8,!0)},e.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^7973*(e>>>11);var r=this.version<<12|e;for(a(r>>>18==0),t=0;t<18;t++){var n=o(r,t),i=this.size-11+t%3,s=Math.floor(t/3);this.setFunctionModule(i,s,n),this.setFunctionModule(s,i,n)}}},e.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var o=Math.max(Math.abs(n),Math.abs(r)),a=e+n,i=t+r;0<=a&&a{l.forEach((function(t,r){(e!=c-i||s<=r)&&g.push(t[e])}))})(d);return a(g.length==n),g},e.prototype.drawCodewords=function(t){if(t.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var r=0,n=this.size-1;1<=n;n-=2){6==n&&(n=5);for(var i=0;i>>3],7-(7&r)),r++)}}a(r==8*t.length)},e.prototype.applyMask=function(e){if(e<0||7{var o=t^n.shift();n.push(0),r.forEach((function(t,r){return n[r]^=e.reedSolomonMultiply(t,o)}))})(a[o]);return n},e.reedSolomonMultiply=function(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");for(var r=0,n=7;0<=n;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return a(r>>>8==0),r},e.prototype.finderPenaltyCountPatterns=function(e){var t=e[1],r=(a(t<=3*this.size),0=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)},e.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},e.prototype.finderPenaltyAddHistory=function(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)},e.MIN_VERSION=1,e.MAX_VERSION=40,e.PENALTY_N1=3,e.PENALTY_N2=3,e.PENALTY_N3=40,e.PENALTY_N4=10,e.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],e.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e})(),h.QrCode=r,f=(()=>{function e(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return e.makeBytes=function(t){for(var r=[],o=0,a=t;o=1<{function e(e,t){this.ordinal=e,this.formatBits=t}return e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2),e})(),r.Ecc=m,m=(r=C=C||{}).QrSegment||(r.QrSegment={}),r=(()=>{function e(e,t){this.modeBits=e,this.numBitsCharCount=t}return e.prototype.numCharCountBits=function(e){return this.numBitsCharCount[Math.floor((e+7)/17)]},e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]),e})(),m.Mode=r,p={L:(g=C).QrCode.Ecc.LOW,M:g.QrCode.Ecc.MEDIUM,Q:g.QrCode.Ecc.QUARTILE,H:g.QrCode.Ecc.HIGH},v=(()=>{try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0})(),m={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:"L",validator:i},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(e){return-1<["linear","radial"].indexOf(e)}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},r=d(d({},m),{renderAs:{type:String,required:!1,default:"canvas",validator:function(e){return-1<["canvas","svg"].indexOf(e)}}}),b=u.defineComponent({name:"QRCodeSvg",props:m,setup:function(e){function t(){var t=e.value,a=e.level,u=e.margin>>>0;t=g.QrCode.encodeText(t,p[i(a)?a:"L"]).getModules();n.value=t.length+2*u,e.imageSettings.src&&(a=c(t,e.size,u,e.imageSettings),r={x:a.x+u,y:a.y+u,width:a.w,height:a.h},a.excavation)&&(t=l(t,a.excavation)),o.value=s(t,u)}var r,n=u.ref(0),o=u.ref("");return t(),u.onUpdated(t),function(){return u.h("svg",{width:e.size,height:e.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(n.value," ").concat(n.value)},[u.h("defs",{},[e.gradient?u.h("linear"===e.gradientType?"linearGradient":"radialGradient",d({id:"qr-gradient"},"linear"===e.gradientType?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"}),[u.h("stop",{offset:"0%",style:{stopColor:e.gradientStartColor}}),u.h("stop",{offset:"100%",style:{stopColor:e.gradientEndColor}})]):null]),u.h("rect",{width:"100%",height:"100%",fill:e.background}),u.h("path",{fill:e.gradient?"url(#qr-gradient)":e.foreground,d:o.value}),e.imageSettings.src&&u.h("image",d({href:e.imageSettings.src},r))])}}}),y=u.defineComponent({name:"QRCodeCanvas",props:m,setup:function(e,t){function r(){var t,r,a,u,d,h,f=e.value,m=e.level,b=e.size,y=e.background,C=e.foreground,E=e.gradient,O=e.gradientType,w=e.gradientStartColor,S=e.gradientEndColor,M=e.margin>>>0,j=(m=i(m)?m:"L",n.value);j&&(t=j.getContext("2d"))&&(m=(f=g.QrCode.encodeText(f,p[m]).getModules()).length+2*M,r=o.value,u={x:0,y:0,width:0,height:0},(a=e.imageSettings.src&&null!=r&&0!==r.naturalWidth&&0!==r.naturalHeight)&&(u={x:(d=c(f,e.size,M,e.imageSettings)).x+M,y:d.y+M,width:d.w,height:d.h},d.excavation)&&(f=l(f,d.excavation)),h=b/m*(d=window.devicePixelRatio||1),j.height=j.width=b*d,t.scale(h,h),t.fillStyle=y,t.fillRect(0,0,m,m),E?(j=void 0,(j="linear"===O?t.createLinearGradient(0,0,m,m):t.createRadialGradient(m/2,m/2,0,m/2,m/2,m/2)).addColorStop(0,w),j.addColorStop(1,S),t.fillStyle=j):t.fillStyle=C,v?t.fill(new Path2D(s(f,M))):f.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+M,r+M,1,1)}))})),a)&&t.drawImage(r,u.x,u.y,u.width,u.height)}var n=u.ref(null),o=u.ref(null),a=(u.onMounted(r),u.onUpdated(r),t.attrs.style);return function(){return u.h(u.Fragment,[u.h("canvas",d(d({},t.attrs),{ref:n,style:d(d({},a),{width:"".concat(e.size,"px"),height:"".concat(e.size,"px")})})),e.imageSettings.src&&u.h("img",{ref:o,src:e.imageSettings.src,style:{display:"none"},onLoad:r})])}}}),C=u.defineComponent({name:"Qrcode",render:function(){var e=this.$props,t=e.renderAs;return u.h("svg"===t?b:y,{value:e.value,size:e.size,margin:e.margin,level:e.level,background:e.background,foreground:e.foreground,imageSettings:e.imageSettings,gradient:e.gradient,gradientType:e.gradientType,gradientStartColor:e.gradientStartColor,gradientEndColor:e.gradientEndColor})},props:r}),t.QrcodeCanvas=y,t.QrcodeSvg=b,t.default=C,Object.defineProperty(t,"__esModule",{value:!0})}}]);