@stonecrop/desktop 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ Only state can be modified.`);l[0]="$state",Z=!1,o.set(a,l,o.state.value),Z=!0}}
8
8
  state: () => new MyClass()
9
9
  Found in store "${g.$id}".`),h&&a&&n.hydrate&&n.hydrate(g.$state,h),c=!0,d=!0,g}/*! #__NO_SIDE_EFFECTS__ */function zo(t,e,n){let o,s;const a=typeof e=="function";o=t,s=a?n:e;function l(i,u){const c=r.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&lt&&lt._testing?null:i)||(c?r.inject(Oe,null):null),i&&ct(i),process.env.NODE_ENV!=="production"&&!lt)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
10
10
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
11
- This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,D({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&z){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Jo=zo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){t||(t=r.inject("$registry"));let e;try{e=Jo()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}const n=r.ref(new go(t,e)),o=r.ref(!1);return r.onBeforeMount(async()=>{var s,a,l;if(!t||!t.router)return;const i=t.router.currentRoute.value,u=(s=i.params.records)==null?void 0:s.toString().toLowerCase(),c=(a=i.params.record)==null?void 0:a.toString().toLowerCase();if(!u&&!c)return;const d=await((l=t.getMeta)==null?void 0:l.call(t,u));d&&(t.addDoctype(d),n.value.setup(d),u&&(c?await n.value.getRecord(d,c):await n.value.getRecords(d)),n.value.runAction(d,"LOAD",c?[c]:void 0)),o.value=!0}),{stonecrop:n,isReady:o}}V(class Dt{constructor(e,n){if(V(this,"name"),V(this,"registry"),V(this,"router"),V(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Go(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Yo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function $t(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Xo=$t,Qo="native";function qo(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Ko(t){t.bc.close(),t.subFns=[]}function Zo(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function tr(t,e){t.messagesCallback=e}function er(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function nr(){return 150}var or={create:qo,close:Ko,onMessage:tr,postMessage:Zo,canBeUsed:er,type:Qo,averageResponseTime:nr,microSeconds:Xo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,rr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function rr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var sr=$t,ar="pubkey.broadcast-channel-0-",U="messages",Nt={durability:"relaxed"},ir="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function lr(t){var e=Qe(),n=ar+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(U,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function cr(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([U],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(U);u.add(s),Yt(a)})}function ur(t,e){var n=t.transaction(U,"readonly",Nt),o=n.objectStore(U),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function dr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(U,"readwrite",Nt),o=n.objectStore(U);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function fr(t,e){var n=new Date().getTime()-e,o=t.transaction(U,"readonly",Nt),s=o.objectStore(U),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function pr(t){return fr(t.db,t.options.idb.ttl).then(function(e){return dr(t,e.map(function(n){return n.id}))})}function mr(t,e){return e=Gt(e),lr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function hr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:ur(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return hr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function gr(t){t.closed=!0,t.db.close()}function yr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return cr(t.db,t.uuid,e)}).then(function(){Yo(0,10)===0&&pr(t)}),t.writeBlockPromise}function wr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function br(){return!!Qe()}function Er(t){return t.idb.fallbackInterval*2}var _r={create:mr,close:gr,onMessage:wr,postMessage:yr,canBeUsed:br,type:ir,averageResponseTime:Er,microSeconds:sr},vr=$t,kr="pubkey.broadcastChannel-",Sr="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return kr+t}function $r(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function Nr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function xr(t){window.removeEventListener("storage",t)}function Or(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=Nr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Cr(t){xr(t.listener)}function Ir(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Pr(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Vr={create:Or,close:Cr,onMessage:Ir,postMessage:$r,canBeUsed:en,type:Sr,averageResponseTime:Pr,microSeconds:vr},Dr=$t,Tr="simulate",Xt=new Set;function Ar(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Br(t){Xt.delete(t)}function Rr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function jr(t,e){t.messagesCallback=e}function Mr(){return!0}function Lr(){return 5}var Ur={create:Ar,close:Br,onMessage:jr,postMessage:Rr,canBeUsed:Mr,type:Tr,averageResponseTime:Lr,microSeconds:Dr},nn=[or,_r,Vr];function Wr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Ur;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Hr=0,Qt=function(t,e){this.id=Hr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Wr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Fr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function Fr(t){var e=t.method.create(t.name,t.options);Go(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),zr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Jr(t)}function zr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Jr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Gr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Gr}function Xr(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
11
+ This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,D({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&z){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Jo=zo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){const e=r.ref();return r.onMounted(async()=>{var n,o,s;t||(t=r.inject("$registry"));let a;try{a=Jo()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(e.value=new go(t,a),!t||!t.router)return;const l=t.router.currentRoute.value,i=(n=l.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=l.params.record)==null?void 0:o.toString().toLowerCase();if(!i&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,i));c&&(t.addDoctype(c),e.value.setup(c),i&&(u?await e.value.getRecord(c,u):await e.value.getRecords(c)),e.value.runAction(c,"LOAD",u?[u]:void 0))}),{stonecrop:e}}V(class Dt{constructor(e,n){if(V(this,"name"),V(this,"registry"),V(this,"router"),V(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Go(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Yo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function $t(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Xo=$t,Qo="native";function qo(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Ko(t){t.bc.close(),t.subFns=[]}function Zo(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function tr(t,e){t.messagesCallback=e}function er(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function nr(){return 150}var or={create:qo,close:Ko,onMessage:tr,postMessage:Zo,canBeUsed:er,type:Qo,averageResponseTime:nr,microSeconds:Xo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,rr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function rr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var sr=$t,ar="pubkey.broadcast-channel-0-",U="messages",Nt={durability:"relaxed"},ir="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function lr(t){var e=Qe(),n=ar+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(U,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function cr(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([U],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(U);u.add(s),Yt(a)})}function ur(t,e){var n=t.transaction(U,"readonly",Nt),o=n.objectStore(U),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function dr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(U,"readwrite",Nt),o=n.objectStore(U);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function fr(t,e){var n=new Date().getTime()-e,o=t.transaction(U,"readonly",Nt),s=o.objectStore(U),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function pr(t){return fr(t.db,t.options.idb.ttl).then(function(e){return dr(t,e.map(function(n){return n.id}))})}function mr(t,e){return e=Gt(e),lr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function hr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:ur(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return hr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function gr(t){t.closed=!0,t.db.close()}function yr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return cr(t.db,t.uuid,e)}).then(function(){Yo(0,10)===0&&pr(t)}),t.writeBlockPromise}function wr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function br(){return!!Qe()}function Er(t){return t.idb.fallbackInterval*2}var _r={create:mr,close:gr,onMessage:wr,postMessage:yr,canBeUsed:br,type:ir,averageResponseTime:Er,microSeconds:sr},vr=$t,kr="pubkey.broadcastChannel-",Sr="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return kr+t}function $r(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function Nr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function xr(t){window.removeEventListener("storage",t)}function Or(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=Nr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Cr(t){xr(t.listener)}function Ir(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Pr(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Vr={create:Or,close:Cr,onMessage:Ir,postMessage:$r,canBeUsed:en,type:Sr,averageResponseTime:Pr,microSeconds:vr},Dr=$t,Tr="simulate",Xt=new Set;function Ar(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Br(t){Xt.delete(t)}function Rr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function jr(t,e){t.messagesCallback=e}function Mr(){return!0}function Lr(){return 5}var Ur={create:Ar,close:Br,onMessage:jr,postMessage:Rr,canBeUsed:Mr,type:Tr,averageResponseTime:Lr,microSeconds:Dr},nn=[or,_r,Vr];function Wr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Ur;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Hr=0,Qt=function(t,e){this.id=Hr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Wr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Fr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function Fr(t){var e=t.method.create(t.name,t.options);Go(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),zr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Jr(t)}function zr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Jr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Gr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Gr}function Xr(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
12
12
  `:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function nt(t){let e="",n=0;const o=t.length;for(let s=0;s<o;s+=1){const a=t[s],l=Qr(a);l&&(e+=t.slice(n,s)+l,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Kt=-1,un=-2,dn=-3,fn=-4,pn=-5,Zt=-6;function mn(t,e){return qr(JSON.parse(t))}function qr(t,e){if(typeof t=="number")return s(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,o=Array(n.length);function s(a,l=!1){if(a===Kt)return;if(a===dn)return NaN;if(a===fn)return 1/0;if(a===pn)return-1/0;if(a===Zt)return-0;if(l)throw new Error("Invalid input");if(a in o)return o[a];const i=n[a];if(!i||typeof i!="object")o[a]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0];switch(u){case"Date":o[a]=new Date(i[1]);break;case"Set":const c=new Set;o[a]=c;for(let p=1;p<i.length;p+=1)c.add(s(i[p]));break;case"Map":const d=new Map;o[a]=d;for(let p=1;p<i.length;p+=2)d.set(s(i[p]),s(i[p+1]));break;case"RegExp":o[a]=new RegExp(i[1],i[2]);break;case"Object":o[a]=Object(i[1]);break;case"BigInt":o[a]=BigInt(i[1]);break;case"null":const f=Object.create(null);o[a]=f;for(let p=1;p<i.length;p+=2)f[i[p]]=s(i[p+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(i.length);o[a]=u;for(let c=0;c<i.length;c+=1){const d=i[c];d!==un&&(u[c]=s(d))}}else{const u={};o[a]=u;for(const c in i){const d=i[c];u[c]=s(d)}}return o[a]}return s(0)}function hn(t,e){const n=[],o=new Map,s=[];for(const c in e)s.push({key:c,fn:e[c]});const a=[];let l=0;function i(c){if(typeof c=="function")throw new qt("Cannot stringify a function",a);if(o.has(c))return o.get(c);if(c===void 0)return Kt;if(Number.isNaN(c))return dn;if(c===1/0)return fn;if(c===-1/0)return pn;if(c===0&&1/c<0)return Zt;const d=l++;o.set(c,d);for(const{key:p,fn:w}of s){const h=w(c);if(h)return n[d]=`["${p}",${i(h)}]`,d}let f="";if(cn(c))f=te(c);else switch(Xr(c)){case"Number":case"String":case"Boolean":f=`["Object",${te(c)}]`;break;case"BigInt":f=`["BigInt",${c}]`;break;case"Date":f=`["Date","${isNaN(c.getDate())?"":c.toISOString()}"]`;break;case"RegExp":const{source:p,flags:w}=c;f=w?`["RegExp",${nt(p)},"${w}"]`:`["RegExp",${nt(p)}]`;break;case"Array":f="[";for(let h=0;h<c.length;h+=1)h>0&&(f+=","),h in c?(a.push(`[${h}]`),f+=i(c[h]),a.pop()):f+=un;f+="]";break;case"Set":f='["Set"';for(const h of c)f+=`,${i(h)}`;f+="]";break;case"Map":f='["Map"';for(const[h,E]of c)a.push(`.get(${cn(h)?te(h):"..."})`),f+=`,${i(h)},${i(E)}`,a.pop();f+="]";break;default:if(!Yr(c))throw new qt("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(c).length>0)throw new qt("Cannot stringify POJOs with symbolic keys",a);if(Object.getPrototypeOf(c)===null){f='["null"';for(const h in c)a.push(`.${h}`),f+=`,${nt(h)},${i(c[h])}`,a.pop();f+="]"}else{f="{";let h=!1;for(const E in c)h&&(f+=","),h=!0,a.push(`.${E}`),f+=`${nt(E)}:${i(c[E])}`,a.pop();f+="}"}}return n[d]=f,d}const u=i(t);return u<0?`${u}`:`[${n.join(",")}]`}function te(t){const e=typeof t;return e==="string"?nt(t):t instanceof String?nt(t.toString()):t===void 0?Kt.toString():t===0&&1/t<0?Zt.toString():e==="bigint"?`["BigInt","${t}"]`:String(t)}function Kr(t,e,{initialize:n,type:o}){let s=`${e.$id}-${t.toString()}`,a=new Qt(s,{type:o}),l=!1,i=0;r.watch(()=>e[t],d=>{l||(i=Date.now(),a.postMessage({timestamp:i,state:mn(hn(d))})),l=!1},{deep:!0}),a.onmessage=d=>{if(d===void 0){a.postMessage({timestamp:i,state:mn(hn(e[t]))});return}d.timestamp<=i||(l=!0,i=d.timestamp,e[t]=d.state)};let u=()=>a.postMessage(void 0),c=()=>a.close();return n&&u(),{sync:u,unshare:c}}var Zr=(t,e)=>Object.keys(e).includes(t),ts=({initialize:t=!0,enable:e=!0,type:n})=>({store:o,options:s})=>{var a,l;let i=((a=s==null?void 0:s.share)==null?void 0:a.enable)??e,u=((l=s==null?void 0:s.share)==null?void 0:l.omit)??[];!i||Object.keys(o.$state).forEach(c=>{var d;u.includes(c)||!Zr(c,o.$state)||Kr(c,o,{initialize:((d=s==null?void 0:s.share)==null?void 0:d.initialize)??t,type:n})})};Uo().use(ts({enable:!0,initialize:!0}));const gn=r.defineComponent({__name:"Doctype",setup(t){const{stonecrop:e,isReady:n}=ze(),o=r.ref([]);return r.watch(n,()=>{if(n.value){let s=e.value.schema.schema.toArray();s.forEach((a,l)=>{const u=e.value.store.record[a.fieldname];s[l].value=u}),o.value=s}}),(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(po),{key:0,class:"aform-main",modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l)},null,8,["modelValue"])):r.createCommentVNode("",!0)}});var es=!1;function xt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function ee(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}/*!
13
13
  * pinia v2.3.0
14
14
  * (c) 2024 Eduardo San Martin Morote