var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,i){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,u){return f[l]=u,this},directive:function(l,u){return u?(n.directive(l,u),v):n.directive(l)},mount:function(l,u){return o||(o=new n(Object.assign({propsData:i},a,{provide:Object.assign(f,a.provide)})),o.$mount(l,u),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=function(){return!!e.getCurrentInstance()},e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=function(){return!!e.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,i){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,i),i):(s[a]=i,i)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,d,t,h){"use strict";function s(a,i){const o=n.ref();let f=[];const v=t.createEventHook(),l=t.createEventHook(),u=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...i?.brush});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var c;return(c=o.value)==null?void 0:c.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(c=>c()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...i}),H(),f=[o.value.on("canceled",()=>l.trigger()),o.value.on("committed",c=>u.trigger(c)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:u.on,onStart:g.on,onEnd:b.on,onCanceled:l.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);