var $e=Object.defineProperty;var ge=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;var he=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||(t={}))Le.call(t,n)&&he(e,n,t[n]);if(ge)for(var n of ge(t))De.call(t,n)&&he(e,n,t[n]);return e};import{t as Ue,_ as P}from"./plugin-vue_export-helper.8f6f5b47.js";const Fe=Vue.defineComponent({name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(e){var i;const t=(i=Vue.getCurrentInstance())==null?void 0:i.proxy,n=Vue.inject("app");return Vue.provide("hoc",t),{tagName:Vue.computed(()=>`magic-ui-${Ue(e.config.type)}`),style:Vue.computed(()=>n==null?void 0:n.transformStyle(e.config.style)),display:()=>{var o;const r=(o=e.config)==null?void 0:o.display;return typeof r=="function"?r(n):r!==!1}}}});function ze(e,t,n,i,r,o){return e.display()?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.tagName),{key:0,id:e.config.id,class:Vue.normalizeClass(`magic-ui-component${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style),config:e.config},null,8,["id","class","style","config"])):Vue.createCommentVNode("v-if",!0)}var we=P(Fe,[["render",ze],["__file","/data/magic/tmagic-editor/packages/ui/src/Component.vue"]]),v=e=>{var r,o;const t=Vue.inject("app"),n=(r=t==null?void 0:t.page)==null?void 0:r.getNode(e.config.id),i=(o=Vue.getCurrentInstance())==null?void 0:o.proxy;return n==null||n.emit("created",i),Vue.onMounted(()=>{n==null||n.emit("mounted",i)}),Vue.onUnmounted(()=>{n==null||n.emit("destroy",i)}),t};const Oe=Vue.defineComponent({name:"magic-ui-page",components:{"magic-ui-component":we},props:{config:{type:Object,default:()=>({})}},setup(e){const t=v(e);return{style:Vue.computed(()=>t==null?void 0:t.transformStyle(e.config.style||{})),refresh(){window.location.reload()}}}}),je=["id"];function He(e,t,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return Vue.openBlock(),Vue.createElementBlock("div",{id:`${e.config.id||""}`,class:Vue.normalizeClass(`magic-ui-page magic-ui-container${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,je)}var Ke=P(Oe,[["render",He],["__file","/data/magic/tmagic-editor/packages/ui/src/page/src/index.vue"]]),Je=e=>({show:()=>{e.config.style.display="initial"},hide:()=>{e.config.style.display="none"}});const Ye=Vue.defineComponent({name:"magic-ui-container",components:{"magic-ui-component":we},props:{config:{type:Object,default:()=>({})}},setup(e){const t=v(e);return Z({style:Vue.computed(()=>t==null?void 0:t.transformStyle(e.config.style||{})),display:()=>{var i;const n=(i=e.config)==null?void 0:i.display;return typeof n=="function"?n(t):n!==!1}},Je(e))}}),qe=["id"];function Ge(e,t,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return e.display()?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,id:`${e.config.id||""}`,class:Vue.normalizeClass(`magic-ui-container${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,qe)):Vue.createCommentVNode("v-if",!0)}var Qe=P(Ye,[["render",Ge],["__file","/data/magic/tmagic-editor/packages/ui/src/container/src/Container.vue"]]);const xe=Vue.defineComponent({name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var u;v(e);const t=(u=Vue.getCurrentInstance())==null?void 0:u.proxy,n=Vue.reactive([]),i=Vue.computed(()=>[typeof e.config.preAction=="function"?e.config.preAction:()=>!0,...n,typeof e.config.postAction=="function"?e.config.postAction:()=>!0]);function r(c){n.push(c)}async function o(){for(const c of i.value)if(typeof c=="function"&&await c(t,{model:e.model})===!1)break}const s=Vue.computed(()=>{var c,a,l;return{type:"text",text:((c=e.config)==null?void 0:c.text)||"",disabledText:((a=e.config)==null?void 0:a.disabledText)||"",html:((l=e.config)==null?void 0:l.html)||""}});return{pushAction:r,clickHandler:o,textConfig:s}}});function We(e,t,n,i,r,o){const s=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:t[0]||(t[0]=(...u)=>e.clickHandler&&e.clickHandler(...u))},[Vue.renderSlot(e.$slots,"default",{},()=>[Vue.createVNode(s,{config:e.textConfig},null,8,["config"])])])}var Ze=P(xe,[["render",We],["__file","/data/magic/tmagic-editor/packages/ui/src/button/src/index.vue"]]);const Xe=Vue.defineComponent({name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(e){var r;v(e);const t=(r=Vue.getCurrentInstance())==null?void 0:r.proxy,n=Vue.inject("hoc");return{displayText:Vue.computed(()=>{var u,c;let o=((u=e.config)==null?void 0:u.text)||"";const{vars:s}=e;if((n==null?void 0:n.disabled)&&((c=e.config)==null?void 0:c.disabledText)&&(o=e.config.disabledText),typeof o=="function")return o.bind(t)(t,{model:e.model});if(Object.prototype.toString.call(s)==="[object Object]"){let a=o;return Object.entries(s).forEach(([l,C])=>{a=a.replace(new RegExp(`{{${l}}}`,"g"),C)}),a}return o||""})}},render(){var t,n,i,r;const e=(t=this.config)!=null&&t.multiple?"magic-ui-text":"magic-ui-text magic-ui-text--single-line";return typeof((n=this.$slots)==null?void 0:n.default)=="function"?Vue.h("span",{class:e},[((r=(i=this.$slots)==null?void 0:i.default)==null?void 0:r.call(i))||""]):Vue.h("span",Z({class:e},this.displayText?{innerHTML:this.displayText}:{}))}});var et=P(Xe,[["__file","/data/magic/tmagic-editor/packages/ui/src/text/src/index.vue"]]);const tt=Vue.defineComponent({name:"magic-ui-img",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){return v(e),{clickHandler(){e.config.url&&(window.location.href=e.config.url)}}}}),nt=["src"];function ot(e,t,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-img",src:e.config.src,onClick:t[0]||(t[0]=(...s)=>e.clickHandler&&e.clickHandler(...s))},null,8,nt)}var rt=P(tt,[["render",ot],["__file","/data/magic/tmagic-editor/packages/ui/src/img/src/index.vue"]]),O={},it=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ce={},N={};let ue;const st=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];N.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};N.getSymbolTotalCodewords=function(t){return st[t]};N.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};N.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');ue=t};N.isKanjiModeEnabled=function(){return typeof ue!="undefined"};N.toSJIS=function(t){return ue(t)};var q={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},e.from=function(i,r){if(e.isValid(i))return i;try{return t(i)}catch{return r}}})(q);function Ee(){this.buffer=[],this.length=0}Ee.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ct=Ee;function j(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}j.prototype.set=function(e,t,n,i){const r=e*this.size+t;this.data[r]=n,i&&(this.reservedBit[r]=!0)};j.prototype.get=function(e,t){return this.data[e*this.size+t]};j.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};j.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var ut=j,Be={};(function(e){const t=N.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=t(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,u=[o-7];for(let c=1;c=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const o=r.size;let s=0,u=0,c=0,a=null,l=null;for(let C=0;C=5&&(s+=t.N1+(u-5)),a=f,u=1),f=r.get(m,C),f===l?c++:(c>=5&&(s+=t.N1+(c-5)),l=f,c=1)}u>=5&&(s+=t.N1+(u-5)),c>=5&&(s+=t.N1+(c-5))}return s},e.getPenaltyN2=function(r){const o=r.size;let s=0;for(let u=0;u=10&&(u===1488||u===93)&&s++,c=c<<1&2047|r.get(l,a),l>=10&&(c===1488||c===93)&&s++}return s*t.N3},e.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let c=0;c=0;){const s=o[0];for(let c=0;c0){const o=new Uint8Array(this.degree);return o.set(i,r),o}return i};var lt=ae,_e={},k={},le={};le.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var V={};const Ve="[0-9]+",ft="[A-Z $%*+\\-./:]+";let z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";z=z.replace(/u/g,"\\u");const dt="(?:(?![A-Z0-9 $%*+\\-./:]|"+z+`)(?:.|[\r ]))+`;V.KANJI=new RegExp(z,"g");V.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");V.BYTE=new RegExp(dt,"g");V.NUMERIC=new RegExp(Ve,"g");V.ALPHANUMERIC=new RegExp(ft,"g");const gt=new RegExp("^"+z+"$"),ht=new RegExp("^"+Ve+"$"),mt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");V.testKanji=function(t){return gt.test(t)};V.testNumeric=function(t){return ht.test(t)};V.testAlphanumeric=function(t){return mt.test(t)};(function(e){const t=le,n=V;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return n.testNumeric(o)?e.NUMERIC:n.testAlphanumeric(o)?e.ALPHANUMERIC:n.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+r)}}e.from=function(o,s){if(e.isValid(o))return o;try{return i(o)}catch{return s}}})(k);(function(e){const t=N,n=G,i=q,r=k,o=le,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=t.getBCHDigit(s);function c(m,f,y){for(let p=1;p<=40;p++)if(f<=e.getCapacity(p,y,m))return p}function a(m,f){return r.getCharCountIndicator(m,f)+4}function l(m,f){let y=0;return m.forEach(function(p){y+=a(p.mode,f)+p.getBitsLength()}),y}function C(m,f){for(let y=1;y<=40;y++)if(l(m,y)<=e.getCapacity(y,f,r.MIXED))return y}e.from=function(f,y){return o.isValid(f)?parseInt(f,10):y},e.getCapacity=function(f,y,p){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof p=="undefined"&&(p=r.BYTE);const A=t.getSymbolTotalCodewords(f),h=n.getTotalCodewordsCount(f,y),w=(A-h)*8;if(p===r.MIXED)return w;const g=w-a(p,f);switch(p){case r.NUMERIC:return Math.floor(g/10*3);case r.ALPHANUMERIC:return Math.floor(g/11*2);case r.KANJI:return Math.floor(g/13);case r.BYTE:default:return Math.floor(g/8)}},e.getBestVersionForData=function(f,y){let p;const A=i.from(y,i.M);if(Array.isArray(f)){if(f.length>1)return C(f,A);if(f.length===0)return 1;p=f[0]}else p=f;return c(p.mode,p.getLength(),A)},e.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let y=f<<12;for(;t.getBCHDigit(y)-u>=0;)y^=s<=0;)r^=Se<0&&(i=this.data.substr(n),r=parseInt(i,10),t.put(r,o*3+1))};var wt=R;const Ct=k,X=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function $(e){this.mode=Ct.ALPHANUMERIC,this.data=e}$.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};$.prototype.getLength=function(){return this.data.length};$.prototype.getBitsLength=function(){return $.getBitsLength(this.data.length)};$.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let i=X.indexOf(this.data[n])*45;i+=X.indexOf(this.data[n+1]),t.put(i,11)}this.data.length%2&&t.put(X.indexOf(this.data[n]),6)};var Et=$,Bt=function(t){for(var n=[],i=t.length,r=0;r=55296&&o<=56319&&i>r+1){var s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,r+=1)}if(o<128){n.push(o);continue}if(o<2048){n.push(o>>6|192),n.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){n.push(o>>12|224),n.push(o>>6&63|128),n.push(o&63|128);continue}if(o>=65536&&o<=1114111){n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const bt=Bt,At=k;function L(e){this.mode=At.BYTE,this.data=new Uint8Array(bt(e))}L.getBitsLength=function(t){return t*8};L.prototype.getLength=function(){return this.data.length};L.prototype.getBitsLength=function(){return L.getBitsLength(this.data.length)};L.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var Vt=D,Pe={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,i,r){var o={},s={};s[i]=0;var u=t.PriorityQueue.make();u.push(i,0);for(var c,a,l,C,m,f,y,p,A;!u.empty();){c=u.pop(),a=c.value,C=c.cost,m=n[a]||{};for(l in m)m.hasOwnProperty(l)&&(f=m[l],y=C+f,p=s[l],A=typeof s[l]=="undefined",(A||p>y)&&(s[l]=y,u.push(l,y),o[l]=a))}if(typeof r!="undefined"&&typeof s[r]=="undefined"){var h=["Could not find a path from ",i," to ",r,"."].join("");throw new Error(h)}return o},extract_shortest_path_from_predecessor_list:function(n,i){for(var r=[],o=i;o;)r.push(o),o=n[o];return r.reverse(),r},find_path:function(n,i,r){var o=t.single_source_shortest_paths(n,i,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(n){var i=t.PriorityQueue,r={},o;n=n||{};for(o in i)i.hasOwnProperty(o)&&(r[o]=i[o]);return r.queue=[],r.sorter=n.sorter||i.default_sorter,r},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var r={value:n,cost:i};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Pe);(function(e){const t=k,n=wt,i=Et,r=Nt,o=Vt,s=V,u=N,c=Pe.exports;function a(h){return unescape(encodeURIComponent(h)).length}function l(h,w,g){const d=[];let E;for(;(E=h.exec(g))!==null;)d.push({data:E[0],index:E.index,mode:w,length:E[0].length});return d}function C(h){const w=l(s.NUMERIC,t.NUMERIC,h),g=l(s.ALPHANUMERIC,t.ALPHANUMERIC,h);let d,E;return u.isKanjiModeEnabled()?(d=l(s.BYTE,t.BYTE,h),E=l(s.KANJI,t.KANJI,h)):(d=l(s.BYTE_KANJI,t.BYTE,h),E=[]),w.concat(g,d,E).sort(function(b,T){return b.index-T.index}).map(function(b){return{data:b.data,mode:b.mode,length:b.length}})}function m(h,w){switch(w){case t.NUMERIC:return n.getBitsLength(h);case t.ALPHANUMERIC:return i.getBitsLength(h);case t.KANJI:return o.getBitsLength(h);case t.BYTE:return r.getBitsLength(h)}}function f(h){return h.reduce(function(w,g){const d=w.length-1>=0?w[w.length-1]:null;return d&&d.mode===g.mode?(w[w.length-1].data+=g.data,w):(w.push(g),w)},[])}function y(h){const w=[];for(let g=0;g=0&&u<=6&&(c===0||c===6)||c>=0&&c<=6&&(u===0||u===6)||u>=2&&u<=4&&c>=2&&c<=4?e.set(o+u,s+c,!0,!0):e.set(o+u,s+c,!1,!0))}}function Lt(e){const t=e.size;for(let n=8;n>u&1)===1,e.set(r,o,s,!0),e.set(o,r,s,!0)}function ne(e,t,n){const i=e.size,r=vt.getEncodedBits(t,n);let o,s;for(o=0;o<15;o++)s=(r>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(i-15+o,8,s,!0),o<8?e.set(8,i-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(i-8,8,1,!0)}function Ft(e,t){const n=e.size;let i=-1,r=n-1,o=7,s=0;for(let u=n-1;u>0;u-=2)for(u===6&&u--;;){for(let c=0;c<2;c++)if(!e.isReserved(r,u-c)){let a=!1;s>>o&1)===1),e.set(r,u-c,a),o--,o===-1&&(s++,o=7)}if(r+=i,r<0||n<=r){r-=i,i=-i;break}}}function zt(e,t,n){const i=new It;n.forEach(function(c){i.put(c.mode.bit,4),i.put(c.getLength(),Rt.getCharCountIndicator(c.mode,e)),c.write(i)});const r=x.getSymbolTotalCodewords(e),o=se.getTotalCodewordsCount(e,t),s=(r-o)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(s-i.getLengthInBits())/8;for(let c=0;c=7&&Ut(c,t),Ft(c,s),isNaN(i)&&(i=ie.getBestMask(c,ne.bind(null,c,n))),ie.applyMask(i,c),ne(c,n,i),{modules:c,version:t,errorCorrectionLevel:n,maskPattern:i,segments:r}}Ce.create=function(t,n){if(typeof t=="undefined"||t==="")throw new Error("No input text");let i=ee.M,r,o;return typeof n!="undefined"&&(i=ee.from(n.errorCorrectionLevel,ee.M),r=Y.from(n.version),o=ie.from(n.maskPattern),n.toSJISFunc&&x.setToSJISFunction(n.toSJISFunc)),jt(t,r,i,o)};var ke={},fe={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(o){return[o,o]}))),i.length===6&&i.push("F","F");const r=parseInt(i.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const r=typeof i.margin=="undefined"||i.margin===null||i.margin<0?4:i.margin,o=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:o,scale:o?4:s,margin:r,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,r){return r.width&&r.width>=i+r.margin*2?r.width/(i+r.margin*2):r.scale},e.getImageWidth=function(i,r){const o=e.getScale(i,r);return Math.floor((i+r.margin*2)*o)},e.qrToImageData=function(i,r,o){const s=r.modules.size,u=r.modules.data,c=e.getScale(s,o),a=Math.floor((s+o.margin*2)*c),l=o.margin*c,C=[o.color.light,o.color.dark];for(let m=0;m=l&&f>=l&&m0&&c>0&&e[u-1]||(i+=o?oe("M",c+n,.5+a+n):oe("m",r,0),r=0,o=!1),c+1':"",a="',l='viewBox="0 0 '+u+" "+u+'"',C=r.width?'width="'+r.width+'" height="'+r.width+'" ':"",m=''+c+a+` `;return typeof i=="function"&&i(null,m),m};const Jt=it,ce=Ce,Re=ke,Yt=ve;function de(e,t,n,i,r){const o=[].slice.call(arguments,1),s=o.length,u=typeof o[s-1]=="function";if(!u&&!Jt())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(r=n,n=t,t=i=void 0):s===3&&(t.getContext&&typeof r=="undefined"?(r=i,i=void 0):(r=i,i=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=i=void 0):s===2&&!t.getContext&&(i=n,n=t,t=void 0),new Promise(function(c,a){try{const l=ce.create(n,i);c(e(l,t,i))}catch(l){a(l)}})}try{const c=ce.create(n,i);r(null,e(c,t,i))}catch(c){r(c)}}O.create=ce.create;O.toCanvas=de.bind(null,Re.render);O.toDataURL=de.bind(null,Re.renderToDataURL);O.toString=de.bind(null,function(e,t,n){return Yt.render(e,n)});const qt=Vue.defineComponent({name:"magic-ui-qrcode",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){v(e);const t=Vue.ref();return Vue.watch(()=>e.config.url,(n="")=>{O.toDataURL(n,(i,r)=>{i&&console.error(i),t.value=r})},{immediate:!0}),{imgUrl:t}}}),Gt=["src"];function Qt(e,t,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-qrcode",src:e.imgUrl},null,8,Gt)}var xt=P(qt,[["render",Qt],["__file","/data/magic/tmagic-editor/packages/ui/src/qrcode/src/index.vue"]]);const Wt=Vue.defineComponent({name:"magic-ui-overlay",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var s;const t=Vue.ref(!1),n=v(e),i=(s=n==null?void 0:n.page)==null?void 0:s.getNode(e.config.id),r=()=>{t.value=!0,n&&n.emit("overlay:open",i)},o=()=>{t.value=!1,n&&n.emit("overlay:close",i)};return n==null||n.on("editor:select",(u,c)=>{c.find(a=>a.id===e.config.id)?r():o()}),{visible:t,openOverlay:r,closeOverlay:o}}});function Zt(e,t,n,i,r,o){const s=Vue.resolveComponent("magic-ui-container");return e.visible?(Vue.openBlock(),Vue.createBlock(s,{key:0,class:"magic-ui-overlay",config:{items:e.config.items}},{default:Vue.withCtx(()=>[Vue.renderSlot(e.$slots,"default")]),_:3},8,["config"])):Vue.createCommentVNode("v-if",!0)}var Xt=P(Wt,[["render",Zt],["__file","/data/magic/tmagic-editor/packages/ui/src/overlay/src/index.vue"]]);const en={page:Ke,container:Qe,button:Ze,text:et,img:rt,qrcode:xt,overlay:Xt},tn={},nn={components:en,plugins:tn};window.magicPresetComponents=nn;export{nn as default}; //# sourceMappingURL=comp-entry.d785a88e.js.map