@open-wa/api 5.9.7 → 5.10.0

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.
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-B0Z9INg1.js";var t=e(((e,t)=>{t.exports={}}));export default t();
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-hePW80VL.js";var t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}var g=e=>(f(e)||m(e))&&!!e.anchor,_=Symbol(`break visit`),v=Symbol(`skip children`),y=Symbol(`remove node`);function b(e,t){let n=ee(t);l(e)?x(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):x(null,e,n,Object.freeze([]))}b.BREAK=_,b.SKIP=v,b.REMOVE=y;function x(e,t,n,r){let i=w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),x(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=x(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=x(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=x(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}async function S(e,t){let n=ee(t);l(e)?await C(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):await C(null,e,n,Object.freeze([]))}S.BREAK=_,S.SKIP=v,S.REMOVE=y;async function C(e,t,n,r){let i=await w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),C(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await C(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=await C(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=await C(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}function ee(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function w(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(u(t))return n.Map?.(e,t,r);if(p(t))return n.Seq?.(e,t,r);if(d(t))return n.Pair?.(e,t,r);if(f(t))return n.Scalar?.(e,t,r);if(c(t))return n.Alias?.(e,t,r)}function T(e,t,n){let r=t[t.length-1];if(m(r))r.items[e]=n;else if(d(r))e===`key`?r.key=n:r.value=n;else if(l(r))r.contents=n;else{let e=c(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var te={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ne=e=>e.replace(/[!,[\]{}]/g,e=>te[e]),E=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ne(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&h(e.contents)){let t={};b(e.contents,(e,n)=>{h(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
1
+ import{r as e}from"./rolldown-runtime-B0Z9INg1.js";var t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}var g=e=>(f(e)||m(e))&&!!e.anchor,_=Symbol(`break visit`),v=Symbol(`skip children`),y=Symbol(`remove node`);function b(e,t){let n=ee(t);l(e)?x(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):x(null,e,n,Object.freeze([]))}b.BREAK=_,b.SKIP=v,b.REMOVE=y;function x(e,t,n,r){let i=w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),x(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=x(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=x(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=x(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}async function S(e,t){let n=ee(t);l(e)?await C(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):await C(null,e,n,Object.freeze([]))}S.BREAK=_,S.SKIP=v,S.REMOVE=y;async function C(e,t,n,r){let i=await w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),C(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await C(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=await C(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=await C(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}function ee(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function w(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(u(t))return n.Map?.(e,t,r);if(p(t))return n.Seq?.(e,t,r);if(d(t))return n.Pair?.(e,t,r);if(f(t))return n.Scalar?.(e,t,r);if(c(t))return n.Alias?.(e,t,r)}function T(e,t,n){let r=t[t.length-1];if(m(r))r.items[e]=n;else if(d(r))e===`key`?r.key=n:r.value=n;else if(l(r))r.contents=n;else{let e=c(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var te={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ne=e=>e.replace(/[!,[\]{}]/g,e=>te[e]),E=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ne(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&h(e.contents)){let t={};b(e.contents,(e,n)=>{h(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
2
2
  `)}};E.defaultYaml={explicit:!1,version:`1.2`},E.defaultTags={"!!":`tag:yaml.org,2002:`};function re(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function ie(e){let t=new Set;return b(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function ae(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function oe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ie(e);let a=ae(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(f(t.node)||m(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function D(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=D(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=D(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=D(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=D(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function O(e,t,n){if(Array.isArray(e))return e.map((e,t)=>O(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!g(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var se=class{constructor(e){Object.defineProperty(this,s,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!l(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=O(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?D(i,{"":o},``,o):o}},k=class extends se{constructor(e){super(t),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],b(e,{Node:(e,t)=>{(c(t)||g(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(O(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ce(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(re(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ce(e,t,n){if(c(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(m(t)){let r=0;for(let i of t.items){let t=ce(e,i,n);t>r&&(r=t)}return r}if(d(t)){let r=ce(e,t.key,n),i=ce(e,t.value,n);return Math.max(r,i)}return 1}var le=e=>!e||typeof e!=`function`&&typeof e!=`object`,A=class extends se{constructor(e){super(a),this.value=e}toJSON(e,t){return t?.keep?this.value:O(this.value,e,t)}toString(){return String(this.value)}};A.BLOCK_FOLDED=`BLOCK_FOLDED`,A.BLOCK_LITERAL=`BLOCK_LITERAL`,A.PLAIN=`PLAIN`,A.QUOTE_DOUBLE=`QUOTE_DOUBLE`,A.QUOTE_SINGLE=`QUOTE_SINGLE`;var ue=`tag:yaml.org,2002:`;function de(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function j(e,t,n){if(l(e)&&(e=e.contents),h(e))return e;if(d(e)){let t=n.schema[r].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:a,onTagObj:s,schema:c,sourceObjects:u}=n,f;if(i&&e&&typeof e==`object`){if(f=u.get(e),f)return f.anchor??(f.anchor=a(e)),new k(f.anchor);f={anchor:null,node:null},u.set(e,f)}t?.startsWith(`!!`)&&(t=ue+t.slice(2));let p=de(e,t,c.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new A(e);return f&&(f.node=t),t}p=e instanceof Map?c[r]:Symbol.iterator in Object(e)?c[o]:c[r]}s&&(s(p),delete n.onTagObj);let m=p?.createNode?p.createNode(n.schema,e,n):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(n.schema,e,n):new A(e);return t?m.tag=t:p.default||(m.tag=p.tag),f&&(f.node=m),m}function fe(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return j(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var M=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,pe=class extends se{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>h(t)||d(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(M(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(m(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,fe(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(m(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&f(i)?i.value:i:m(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!d(t))return!1;let n=t.value;return n==null||e&&f(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return m(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(m(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,fe(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},me=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function N(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var P=(e,t,n)=>e.endsWith(`
3
3
  `)?N(n,t):n.includes(`
4
4
  `)?`