tmagic-editor/magic-admin/server/runtime/assets/comp-entry.4b446d21.js

10 lines
32 KiB
JavaScript

var kt=Object.defineProperty;var gt=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable;var ht=(t,e,n)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,X=(t,e)=>{for(var n in e||(e={}))vt.call(e,n)&&ht(t,n,e[n]);if(gt)for(var n of gt(e))Dt.call(e,n)&&ht(t,n,e[n]);return t};import{t as Ut,_ as R}from"./plugin-vue_export-helper.8f6f5b47.js";const Ft=Vue.defineComponent({name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(t){var i;const e=(i=Vue.getCurrentInstance())==null?void 0:i.proxy,n=Vue.inject("app");return Vue.provide("hoc",e),{tagName:Vue.computed(()=>`magic-ui-${Ut(t.config.type)}`),style:Vue.computed(()=>n==null?void 0:n.transformStyle(t.config.style)),display:()=>{var o;const r=(o=t.config)==null?void 0:o.display;return typeof r=="function"?r(n):r!==!1}}}});function zt(t,e,n,i,r,o){return t.display()?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.tagName),{key:0,id:t.config.id,class:Vue.normalizeClass(`magic-ui-component${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style),config:t.config},null,8,["id","class","style","config"])):Vue.createCommentVNode("",!0)}var wt=R(Ft,[["render",zt]]),$=t=>{var r,o;const e=Vue.inject("app"),n=(r=e==null?void 0:e.page)==null?void 0:r.getNode(t.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)}),e};const Ot=Vue.defineComponent({name:"magic-ui-page",components:{"magic-ui-component":wt},props:{config:{type:Object,default:()=>({})}},setup(t){const e=$(t);return{style:Vue.computed(()=>e==null?void 0:e.transformStyle(t.config.style||{})),refresh(){window.location.reload()}}}}),jt=["id"];function Ht(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return Vue.openBlock(),Vue.createElementBlock("div",{id:`${t.config.id||""}`,class:Vue.normalizeClass(`magic-ui-page${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style)},[Vue.renderSlot(t.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,jt)}var Kt=R(Ot,[["render",Ht]]),Jt=t=>({show:()=>{t.config.style.display="initial"},hide:()=>{t.config.style.display="none"}});const Yt=Vue.defineComponent({name:"magic-ui-container",components:{"magic-ui-component":wt},props:{config:{type:Object,default:()=>({})}},setup(t){const e=$(t);return X({style:Vue.computed(()=>e==null?void 0:e.transformStyle(t.config.style||{})),display:()=>{var i;const n=(i=t.config)==null?void 0:i.display;return typeof n=="function"?n(e):n!==!1}},Jt(t))}}),qt=["id"];function Gt(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return t.display()?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,id:`${t.config.id||""}`,class:Vue.normalizeClass(`magic-ui-container${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style)},[Vue.renderSlot(t.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,qt)):Vue.createCommentVNode("",!0)}var Qt=R(Yt,[["render",Gt]]);const Wt=Vue.defineComponent({name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){var u;$(t);const e=(u=Vue.getCurrentInstance())==null?void 0:u.proxy,n=Vue.reactive([]),i=Vue.computed(()=>[typeof t.config.preAction=="function"?t.config.preAction:()=>!0,...n,typeof t.config.postAction=="function"?t.config.postAction:()=>!0]);function r(c){n.push(c)}async function o(){for(const c of i.value)if(typeof c=="function"&&await c(e,{model:t.model})===!1)break}const s=Vue.computed(()=>{var c,a,l;return{type:"text",text:((c=t.config)==null?void 0:c.text)||"",disabledText:((a=t.config)==null?void 0:a.disabledText)||"",html:((l=t.config)==null?void 0:l.html)||""}});return{pushAction:r,clickHandler:o,textConfig:s}}});function Zt(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:e[0]||(e[0]=(...u)=>t.clickHandler&&t.clickHandler(...u))},[Vue.renderSlot(t.$slots,"default",{},()=>[Vue.createVNode(s,{config:t.textConfig},null,8,["config"])])])}var Xt=R(Wt,[["render",Zt]]);const xt=Vue.defineComponent({name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(t){var r;$(t);const e=(r=Vue.getCurrentInstance())==null?void 0:r.proxy,n=Vue.inject("hoc");return{displayText:Vue.computed(()=>{var u,c;let o=((u=t.config)==null?void 0:u.text)||"";const{vars:s}=t;if((n==null?void 0:n.disabled)&&((c=t.config)==null?void 0:c.disabledText)&&(o=t.config.disabledText),typeof o=="function")return o.bind(e)(e,{model:t.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 e,n,i,r;const t=(e=this.config)!=null&&e.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:t},[((r=(i=this.$slots)==null?void 0:i.default)==null?void 0:r.call(i))||""]):Vue.h("span",X({class:t},this.displayText?{innerHTML:this.displayText}:{}))}}),te=Vue.defineComponent({name:"magic-ui-img",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){return $(t),{clickHandler(){t.config.url&&(window.location.href=t.config.url)}}}}),ee=["src"];function ne(t,e,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-img",src:t.config.src,onClick:e[0]||(e[0]=(...s)=>t.clickHandler&&t.clickHandler(...s))},null,8,ee)}var oe=R(te,[["render",ne]]),O={},re=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ct={},N={};let ut;const ie=[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(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};N.getSymbolTotalCodewords=function(e){return ie[e]};N.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};N.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ut=e};N.isKanjiModeEnabled=function(){return typeof ut!="undefined"};N.toSJIS=function(e){return ut(e)};var q={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},t.from=function(i,r){if(t.isValid(i))return i;try{return e(i)}catch{return r}}})(q);function Et(){this.buffer=[],this.length=0}Et.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var se=Et;function j(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}j.prototype.set=function(t,e,n,i){const r=t*this.size+e;this.data[r]=n,i&&(this.reservedBit[r]=!0)};j.prototype.get=function(t,e){return this.data[t*this.size+e]};j.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};j.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ce=j,Bt={};(function(t){const e=N.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,u=[o-7];for(let c=1;c<r-1;c++)u[c]=u[c-1]-s;return u.push(6),u.reverse()},t.getPositions=function(i){const r=[],o=t.getRowColCoords(i),s=o.length;for(let u=0;u<s;u++)for(let c=0;c<s;c++)u===0&&c===0||u===0&&c===s-1||u===s-1&&c===0||r.push([o[u],o[c]]);return r}})(Bt);var bt={};const ue=N.getSymbolSize,mt=7;bt.getPositions=function(e){const n=ue(e);return[[0,0],[n-mt,0],[0,n-mt]]};var At={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const o=r.size;let s=0,u=0,c=0,a=null,l=null;for(let C=0;C<o;C++){u=c=0,a=l=null;for(let m=0;m<o;m++){let f=r.get(C,m);f===a?u++:(u>=5&&(s+=e.N1+(u-5)),a=f,u=1),f=r.get(m,C),f===l?c++:(c>=5&&(s+=e.N1+(c-5)),l=f,c=1)}u>=5&&(s+=e.N1+(u-5)),c>=5&&(s+=e.N1+(c-5))}return s},t.getPenaltyN2=function(r){const o=r.size;let s=0;for(let u=0;u<o-1;u++)for(let c=0;c<o-1;c++){const a=r.get(u,c)+r.get(u,c+1)+r.get(u+1,c)+r.get(u+1,c+1);(a===4||a===0)&&s++}return s*e.N2},t.getPenaltyN3=function(r){const o=r.size;let s=0,u=0,c=0;for(let a=0;a<o;a++){u=c=0;for(let l=0;l<o;l++)u=u<<1&2047|r.get(a,l),l>=10&&(u===1488||u===93)&&s++,c=c<<1&2047|r.get(l,a),l>=10&&(c===1488||c===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let c=0;c<s;c++)o+=r.data[c];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function n(i,r,o){switch(i){case t.Patterns.PATTERN000:return(r+o)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(r+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return r*o%2+r*o%3===0;case t.Patterns.PATTERN110:return(r*o%2+r*o%3)%2===0;case t.Patterns.PATTERN111:return(r*o%3+(r+o)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(r,o){const s=o.size;for(let u=0;u<s;u++)for(let c=0;c<s;c++)o.isReserved(c,u)||o.xor(c,u,n(r,c,u))},t.getBestMask=function(r,o){const s=Object.keys(t.Patterns).length;let u=0,c=1/0;for(let a=0;a<s;a++){o(a),t.applyMask(a,r);const l=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(a,r),l<c&&(c=l,u=a)}return u}})(At);var G={};const _=q,H=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],K=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];G.getBlocksCount=function(e,n){switch(n){case _.L:return H[(e-1)*4+0];case _.M:return H[(e-1)*4+1];case _.Q:return H[(e-1)*4+2];case _.H:return H[(e-1)*4+3];default:return}};G.getTotalCodewordsCount=function(e,n){switch(n){case _.L:return K[(e-1)*4+0];case _.M:return K[(e-1)*4+1];case _.Q:return K[(e-1)*4+2];case _.H:return K[(e-1)*4+3];default:return}};var Nt={},Q={};const F=new Uint8Array(512),J=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)F[n]=e,J[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)F[n]=F[n-255]})();Q.log=function(e){if(e<1)throw new Error("log("+e+")");return J[e]};Q.exp=function(e){return F[e]};Q.mul=function(e,n){return e===0||n===0?0:F[J[e]+J[n]]};(function(t){const e=Q;t.mul=function(i,r){const o=new Uint8Array(i.length+r.length-1);for(let s=0;s<i.length;s++)for(let u=0;u<r.length;u++)o[s+u]^=e.mul(i[s],r[u]);return o},t.mod=function(i,r){let o=new Uint8Array(i);for(;o.length-r.length>=0;){const s=o[0];for(let c=0;c<r.length;c++)o[c]^=e.mul(r[c],s);let u=0;for(;u<o.length&&o[u]===0;)u++;o=o.slice(u)}return o},t.generateECPolynomial=function(i){let r=new Uint8Array([1]);for(let o=0;o<i;o++)r=t.mul(r,new Uint8Array([1,e.exp(o)]));return r}})(Nt);const Tt=Nt;function at(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}at.prototype.initialize=function(e){this.degree=e,this.genPoly=Tt.generateECPolynomial(this.degree)};at.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(e.length+this.degree);n.set(e);const i=Tt.mod(n,this.genPoly),r=this.degree-i.length;if(r>0){const o=new Uint8Array(this.degree);return o.set(i,r),o}return i};var ae=at,Vt={},P={},lt={};lt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var I={};const It="[0-9]+",le="[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 fe="(?:(?![A-Z0-9 $%*+\\-./:]|"+z+`)(?:.|[\r
]))+`;I.KANJI=new RegExp(z,"g");I.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");I.BYTE=new RegExp(fe,"g");I.NUMERIC=new RegExp(It,"g");I.ALPHANUMERIC=new RegExp(le,"g");const de=new RegExp("^"+z+"$"),ge=new RegExp("^"+It+"$"),he=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");I.testKanji=function(e){return de.test(e)};I.testNumeric=function(e){return ge.test(e)};I.testAlphanumeric=function(e){return he.test(e)};(function(t){const e=lt,n=I;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.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 t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(o,s){if(t.isValid(o))return o;try{return i(o)}catch{return s}}})(P);(function(t){const e=N,n=G,i=q,r=P,o=lt,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=e.getBCHDigit(s);function c(m,f,y){for(let p=1;p<=40;p++)if(f<=t.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)<=t.getCapacity(y,f,r.MIXED))return y}t.from=function(f,y){return o.isValid(f)?parseInt(f,10):y},t.getCapacity=function(f,y,p){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof p=="undefined"&&(p=r.BYTE);const A=e.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)}},t.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)},t.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let y=f<<12;for(;e.getBCHDigit(y)-u>=0;)y^=s<<e.getBCHDigit(y)-u;return f<<12|y}})(Vt);var St={};const rt=N,Mt=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,me=1<<14|1<<12|1<<10|1<<4|1<<1,yt=rt.getBCHDigit(Mt);St.getEncodedBits=function(e,n){const i=e.bit<<3|n;let r=i<<10;for(;rt.getBCHDigit(r)-yt>=0;)r^=Mt<<rt.getBCHDigit(r)-yt;return(i<<10|r)^me};var _t={};const ye=P;function L(t){this.mode=ye.NUMERIC,this.data=t.toString()}L.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};L.prototype.getLength=function(){return this.data.length};L.prototype.getBitsLength=function(){return L.getBitsLength(this.data.length)};L.prototype.write=function(e){let n,i,r;for(n=0;n+3<=this.data.length;n+=3)i=this.data.substr(n,3),r=parseInt(i,10),e.put(r,10);const o=this.data.length-n;o>0&&(i=this.data.substr(n),r=parseInt(i,10),e.put(r,o*3+1))};var pe=L;const we=P,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 k(t){this.mode=we.ALPHANUMERIC,this.data=t}k.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};k.prototype.getLength=function(){return this.data.length};k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)};k.prototype.write=function(e){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]),e.put(i,11)}this.data.length%2&&e.put(x.indexOf(this.data[n]),6)};var Ce=k,Ee=function(e){for(var n=[],i=e.length,r=0;r<i;r++){var o=e.charCodeAt(r);if(o>=55296&&o<=56319&&i>r+1){var s=e.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 Be=Ee,be=P;function v(t){this.mode=be.BYTE,this.data=new Uint8Array(Be(t))}v.getBitsLength=function(e){return e*8};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var Ae=v;const Ne=P,Te=N;function D(t){this.mode=Ne.KANJI,this.data=t}D.getBitsLength=function(e){return e*13};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=Te.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var Ve=D,Pt={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,i,r){var o={},s={};s[i]=0;var u=e.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=e.single_source_shortest_paths(n,i,r);return e.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(n){var i=e.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}}};t.exports=e})(Pt);(function(t){const e=P,n=pe,i=Ce,r=Ae,o=Ve,s=I,u=N,c=Pt.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,e.NUMERIC,h),g=l(s.ALPHANUMERIC,e.ALPHANUMERIC,h);let d,E;return u.isKanjiModeEnabled()?(d=l(s.BYTE,e.BYTE,h),E=l(s.KANJI,e.KANJI,h)):(d=l(s.BYTE_KANJI,e.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 e.NUMERIC:return n.getBitsLength(h);case e.ALPHANUMERIC:return i.getBitsLength(h);case e.KANJI:return o.getBitsLength(h);case e.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<h.length;g++){const d=h[g];switch(d.mode){case e.NUMERIC:w.push([d,{data:d.data,mode:e.ALPHANUMERIC,length:d.length},{data:d.data,mode:e.BYTE,length:d.length}]);break;case e.ALPHANUMERIC:w.push([d,{data:d.data,mode:e.BYTE,length:d.length}]);break;case e.KANJI:w.push([d,{data:d.data,mode:e.BYTE,length:a(d.data)}]);break;case e.BYTE:w.push([{data:d.data,mode:e.BYTE,length:a(d.data)}])}}return w}function p(h,w){const g={},d={start:{}};let E=["start"];for(let B=0;B<h.length;B++){const b=h[B],T=[];for(let M=0;M<b.length;M++){const V=b[M],U=""+B+M;T.push(U),g[U]={node:V,lastCount:0},d[U]={};for(let Z=0;Z<E.length;Z++){const S=E[Z];g[S]&&g[S].node.mode===V.mode?(d[S][U]=m(g[S].lastCount+V.length,V.mode)-m(g[S].lastCount,V.mode),g[S].lastCount+=V.length):(g[S]&&(g[S].lastCount=V.length),d[S][U]=m(V.length,V.mode)+4+e.getCharCountIndicator(V.mode,w))}}E=T}for(let B=0;B<E.length;B++)d[E[B]].end=0;return{map:d,table:g}}function A(h,w){let g;const d=e.getBestModeForData(h);if(g=e.from(w,d),g!==e.BYTE&&g.bit<d.bit)throw new Error('"'+h+'" cannot be encoded with mode '+e.toString(g)+`.
Suggested mode is: `+e.toString(d));switch(g===e.KANJI&&!u.isKanjiModeEnabled()&&(g=e.BYTE),g){case e.NUMERIC:return new n(h);case e.ALPHANUMERIC:return new i(h);case e.KANJI:return new o(h);case e.BYTE:return new r(h)}}t.fromArray=function(w){return w.reduce(function(g,d){return typeof d=="string"?g.push(A(d,null)):d.data&&g.push(A(d.data,d.mode)),g},[])},t.fromString=function(w,g){const d=C(w,u.isKanjiModeEnabled()),E=y(d),B=p(E,g),b=c.find_path(B.map,"start","end"),T=[];for(let M=1;M<b.length-1;M++)T.push(B.table[b[M]].node);return t.fromArray(f(T))},t.rawSplit=function(w){return t.fromArray(C(w,u.isKanjiModeEnabled()))}})(_t);const W=N,tt=q,Ie=se,Se=ce,Me=Bt,_e=bt,it=At,st=G,Pe=ae,Y=Vt,Re=St,$e=P,et=_t;function Le(t,e){const n=t.size,i=_e.getPositions(e);for(let r=0;r<i.length;r++){const o=i[r][0],s=i[r][1];for(let u=-1;u<=7;u++)if(!(o+u<=-1||n<=o+u))for(let c=-1;c<=7;c++)s+c<=-1||n<=s+c||(u>=0&&u<=6&&(c===0||c===6)||c>=0&&c<=6&&(u===0||u===6)||u>=2&&u<=4&&c>=2&&c<=4?t.set(o+u,s+c,!0,!0):t.set(o+u,s+c,!1,!0))}}function ke(t){const e=t.size;for(let n=8;n<e-8;n++){const i=n%2===0;t.set(n,6,i,!0),t.set(6,n,i,!0)}}function ve(t,e){const n=Me.getPositions(e);for(let i=0;i<n.length;i++){const r=n[i][0],o=n[i][1];for(let s=-2;s<=2;s++)for(let u=-2;u<=2;u++)s===-2||s===2||u===-2||u===2||s===0&&u===0?t.set(r+s,o+u,!0,!0):t.set(r+s,o+u,!1,!0)}}function De(t,e){const n=t.size,i=Y.getEncodedBits(e);let r,o,s;for(let u=0;u<18;u++)r=Math.floor(u/3),o=u%3+n-8-3,s=(i>>u&1)===1,t.set(r,o,s,!0),t.set(o,r,s,!0)}function nt(t,e,n){const i=t.size,r=Re.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=(r>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(i-15+o,8,s,!0),o<8?t.set(8,i-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(i-8,8,1,!0)}function Ue(t,e){const n=t.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(!t.isReserved(r,u-c)){let a=!1;s<e.length&&(a=(e[s]>>>o&1)===1),t.set(r,u-c,a),o--,o===-1&&(s++,o=7)}if(r+=i,r<0||n<=r){r-=i,i=-i;break}}}function Fe(t,e,n){const i=new Ie;n.forEach(function(c){i.put(c.mode.bit,4),i.put(c.getLength(),$e.getCharCountIndicator(c.mode,t)),c.write(i)});const r=W.getSymbolTotalCodewords(t),o=st.getTotalCodewordsCount(t,e),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<u;c++)i.put(c%2?17:236,8);return ze(i,t,e)}function ze(t,e,n){const i=W.getSymbolTotalCodewords(e),r=st.getTotalCodewordsCount(e,n),o=i-r,s=st.getBlocksCount(e,n),u=i%s,c=s-u,a=Math.floor(i/s),l=Math.floor(o/s),C=l+1,m=a-l,f=new Pe(m);let y=0;const p=new Array(s),A=new Array(s);let h=0;const w=new Uint8Array(t.buffer);for(let b=0;b<s;b++){const T=b<c?l:C;p[b]=w.slice(y,y+T),A[b]=f.encode(p[b]),y+=T,h=Math.max(h,T)}const g=new Uint8Array(i);let d=0,E,B;for(E=0;E<h;E++)for(B=0;B<s;B++)E<p[B].length&&(g[d++]=p[B][E]);for(E=0;E<m;E++)for(B=0;B<s;B++)g[d++]=A[B][E];return g}function Oe(t,e,n,i){let r;if(Array.isArray(t))r=et.fromArray(t);else if(typeof t=="string"){let a=e;if(!a){const l=et.rawSplit(t);a=Y.getBestVersionForData(l,n)}r=et.fromString(t,a||40)}else throw new Error("Invalid data");const o=Y.getBestVersionForData(r,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+o+`.
`);const s=Fe(e,n,r),u=W.getSymbolSize(e),c=new Se(u);return Le(c,e),ke(c),ve(c,e),nt(c,n,0),e>=7&&De(c,e),Ue(c,s),isNaN(i)&&(i=it.getBestMask(c,nt.bind(null,c,n))),it.applyMask(i,c),nt(c,n,i),{modules:c,version:e,errorCorrectionLevel:n,maskPattern:i,segments:r}}Ct.create=function(e,n){if(typeof e=="undefined"||e==="")throw new Error("No input text");let i=tt.M,r,o;return typeof n!="undefined"&&(i=tt.from(n.errorCorrectionLevel,tt.M),r=Y.from(n.version),o=it.from(n.maskPattern),n.toSJISFunc&&W.setToSJISFunction(n.toSJISFunc)),Oe(e,r,i,o)};var Rt={},ft={};(function(t){function e(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("")}}t.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:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,r){return r.width&&r.width>=i+r.margin*2?r.width/(i+r.margin*2):r.scale},t.getImageWidth=function(i,r){const o=t.getScale(i,r);return Math.floor((i+r.margin*2)*o)},t.qrToImageData=function(i,r,o){const s=r.modules.size,u=r.modules.data,c=t.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<a;m++)for(let f=0;f<a;f++){let y=(m*a+f)*4,p=o.color.light;if(m>=l&&f>=l&&m<a-l&&f<a-l){const A=Math.floor((m-l)/c),h=Math.floor((f-l)/c);p=C[u[A*s+h]?1:0]}i[y++]=p.r,i[y++]=p.g,i[y++]=p.b,i[y]=p.a}}})(ft);(function(t){const e=ft;function n(r,o,s){r.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,s,u){let c=u,a=s;typeof c=="undefined"&&(!s||!s.getContext)&&(c=s,s=void 0),s||(a=i()),c=e.getOptions(c);const l=e.getImageWidth(o.modules.size,c),C=a.getContext("2d"),m=C.createImageData(l,l);return e.qrToImageData(m.data,o,c),n(C,a,l),C.putImageData(m,0,0),a},t.renderToDataURL=function(o,s,u){let c=u;typeof c=="undefined"&&(!s||!s.getContext)&&(c=s,s=void 0),c||(c={});const a=t.render(o,s,c),l=c.type||"image/png",C=c.rendererOpts||{};return a.toDataURL(l,C.quality)}})(Rt);var $t={};const je=ft;function pt(t,e){const n=t.a/255,i=e+'="'+t.hex+'"';return n<1?i+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function ot(t,e,n){let i=t+e;return typeof n!="undefined"&&(i+=" "+n),i}function He(t,e,n){let i="",r=0,o=!1,s=0;for(let u=0;u<t.length;u++){const c=Math.floor(u%e),a=Math.floor(u/e);!c&&!o&&(o=!0),t[u]?(s++,u>0&&c>0&&t[u-1]||(i+=o?ot("M",c+n,.5+a+n):ot("m",r,0),r=0,o=!1),c+1<e&&t[u+1]||(i+=ot("h",s),s=0)):r++}return i}$t.render=function(e,n,i){const r=je.getOptions(n),o=e.modules.size,s=e.modules.data,u=o+r.margin*2,c=r.color.light.a?"<path "+pt(r.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",a="<path "+pt(r.color.dark,"stroke")+' d="'+He(s,o,r.margin)+'"/>',l='viewBox="0 0 '+u+" "+u+'"',C=r.width?'width="'+r.width+'" height="'+r.width+'" ':"",m='<svg xmlns="http://www.w3.org/2000/svg" '+C+l+' shape-rendering="crispEdges">'+c+a+`</svg>
`;return typeof i=="function"&&i(null,m),m};const Ke=re,ct=Ct,Lt=Rt,Je=$t;function dt(t,e,n,i,r){const o=[].slice.call(arguments,1),s=o.length,u=typeof o[s-1]=="function";if(!u&&!Ke())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=e,e=i=void 0):s===3&&(e.getContext&&typeof r=="undefined"?(r=i,i=void 0):(r=i,i=n,n=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=e,e=i=void 0):s===2&&!e.getContext&&(i=n,n=e,e=void 0),new Promise(function(c,a){try{const l=ct.create(n,i);c(t(l,e,i))}catch(l){a(l)}})}try{const c=ct.create(n,i);r(null,t(c,e,i))}catch(c){r(c)}}O.create=ct.create;O.toCanvas=dt.bind(null,Lt.render);O.toDataURL=dt.bind(null,Lt.renderToDataURL);O.toString=dt.bind(null,function(t,e,n){return Je.render(t,n)});const Ye=Vue.defineComponent({name:"magic-ui-qrcode",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){$(t);const e=Vue.ref();return Vue.watch(()=>t.config.url,(n="")=>{O.toDataURL(n,(i,r)=>{i&&console.error(i),e.value=r})},{immediate:!0}),{imgUrl:e}}}),qe=["src"];function Ge(t,e,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-qrcode",src:t.imgUrl},null,8,qe)}var Qe=R(Ye,[["render",Ge]]);const We=Vue.defineComponent({name:"magic-ui-overlay",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){var s;const e=Vue.ref(!1),n=$(t),i=(s=n==null?void 0:n.page)==null?void 0:s.getNode(t.config.id),r=()=>{e.value=!0,n&&n.emit("overlay:open",i)},o=()=>{e.value=!1,n&&n.emit("overlay:close",i)};return n==null||n.on("editor:select",(u,c)=>{c.find(a=>a.id===t.config.id)?r():o()}),{visible:e,openOverlay:r,closeOverlay:o}}});function Ze(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-container");return t.visible?(Vue.openBlock(),Vue.createBlock(s,{key:0,class:"magic-ui-overlay",config:{items:t.config.items}},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default")]),_:3},8,["config"])):Vue.createCommentVNode("",!0)}var Xe=R(We,[["render",Ze]]);const xe={page:Kt,container:Qt,button:Xt,text:xt,img:oe,qrcode:Qe,overlay:Xe},tn={},en={components:xe,plugins:tn};window.magicPresetComponents=en;export{en as default};
//# sourceMappingURL=comp-entry.4b446d21.js.map