@fugood/bricks-cli 2.24.0-beta.14 → 2.24.0-beta.15

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.
Files changed (2) hide show
  1. package/lib/index.js +3 -3
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -682,7 +682,7 @@ import{createRequire as e}from"node:module";const t=e(import.meta.url);import*as
682
682
  `},8323:(e,t,a)=>{const n=a(4876),r=a(3246),i={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},o=Symbol("failure");function s(e){return n.ucs2.decode(e).length}function p(e,t){const a=e[t];return isNaN(a)?void 0:String.fromCodePoint(a)}function l(e){return e>=48&&e<=57}function u(e){return e>=65&&e<=90||e>=97&&e<=122}function d(e){return l(e)||e>=65&&e<=70||e>=97&&e<=102}function c(e){return"."===e||"%2e"===e.toLowerCase()}function m(e){return 2===e.length&&u(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function f(e){return void 0!==i[e]}function h(e){return f(e.scheme)}function _(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t="0"+t),"%"+t}function y(e){return e<=31||e>126}const E=new Set([32,34,35,60,62,63,96,123,125]);function T(e){return y(e)||E.has(e)}const g=new Set([47,58,59,61,64,91,92,93,94,124]);function v(e){return T(e)||g.has(e)}function R(e,t){const a=String.fromCodePoint(e);return t(e)?function(e){const t=new Buffer(e);let a="";for(let e=0;e<t.length;++e)a+=_(t[e]);return a}(a):a}function b(e){let t=10;if(e.length>=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e)return 0;return(10===t?/[^0-9]/:16===t?/[^0-9A-Fa-f]/:/[^0-7]/).test(e)?o:parseInt(e,t)}function O(e,t){if("["===e[0])return"]"!==e[e.length-1]?o:function(e){const t=[0,0,0,0,0,0,0,0];let a=0,r=null,i=0;if(58===(e=n.ucs2.decode(e))[i]){if(58!==e[i+1])return o;i+=2,++a,r=a}for(;i<e.length;){if(8===a)return o;if(58===e[i]){if(null!==r)return o;++i,++a,r=a;continue}let n=0,s=0;for(;s<4&&d(e[i]);)n=16*n+parseInt(p(e,i),16),++i,++s;if(46===e[i]){if(0===s)return o;if(i-=s,a>6)return o;let n=0;for(;void 0!==e[i];){let r=null;if(n>0){if(!(46===e[i]&&n<4))return o;++i}if(!l(e[i]))return o;for(;l(e[i]);){const t=parseInt(p(e,i));if(null===r)r=t;else{if(0===r)return o;r=10*r+t}if(r>255)return o;++i}t[a]=256*t[a]+r,++n,2!==n&&4!==n||++a}if(4!==n)return o;break}if(58===e[i]){if(++i,void 0===e[i])return o}else if(void 0!==e[i])return o;t[a]=n,++a}if(null!==r){let e=a-r;for(a=7;0!==a&&e>0;){const n=t[r+e-1];t[r+e-1]=t[a],t[a]=n,--a,--e}}else if(null===r&&8!==a)return o;return t}(e.substring(1,e.length-1));if(!t)return function(e){if(function(e){return-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/)}(e))return o;let t="";const a=n.ucs2.decode(e);for(let e=0;e<a.length;++e)t+=R(a[e],y);return t}(e);const a=function(e){const t=new Buffer(e),a=[];for(let e=0;e<t.length;++e)37!==t[e]?a.push(t[e]):37===t[e]&&d(t[e+1])&&d(t[e+2])?(a.push(parseInt(t.slice(e+1,e+3).toString(),16)),e+=2):a.push(t[e]);return new Buffer(a).toString()}(e),i=r.toASCII(a,!1,r.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===i)return o;if(function(e){return-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/)}(i))return o;const s=function(e){const t=e.split(".");if(""===t[t.length-1]&&t.length>1&&t.pop(),t.length>4)return e;const a=[];for(const n of t){if(""===n)return e;const t=b(n);if(t===o)return e;a.push(t)}for(let e=0;e<a.length-1;++e)if(a[e]>255)return o;if(a[a.length-1]>=Math.pow(256,5-a.length))return o;let n=a.pop(),r=0;for(const e of a)n+=e*Math.pow(256,3-r),++r;return n}(i);return"number"==typeof s||s===o?s:i}function N(e){return"number"==typeof e?function(e){let t="",a=e;for(let e=1;e<=4;++e)t=String(a%256)+t,4!==e&&(t="."+t),a=Math.floor(a/256);return t}(e):e instanceof Array?"["+function(e){let t="";const a=function(e){let t=null,a=1,n=null,r=0;for(let i=0;i<e.length;++i)0!==e[i]?(r>a&&(t=n,a=r),n=null,r=0):(null===n&&(n=i),++r);return r>a&&(t=n,a=r),{idx:t,len:a}}(e).idx;let n=!1;for(let r=0;r<=7;++r)if(!n||0!==e[r]){if(n&&(n=!1),a===r){t+=0===r?"::":":",n=!0;continue}t+=e[r].toString(16),7!==r&&(t+=":")}return t}(e)+"]":e}function A(e){const t=e.path;0!==t.length&&("file"===e.scheme&&1===t.length&&function(e){return/^[A-Za-z]:$/.test(e)}(t[0])||t.pop())}function S(e){return""!==e.username||""!==e.password}function w(e,t,a,r,i){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=a||"utf-8",this.stateOverride=i,this.url=r,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const e=function(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);e!==this.input&&(this.parseError=!0),this.input=e}const s=function(e){return e.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=n.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),a=this["parse "+this.state](e,t);if(!a)break;if(a===o){this.failure=!0;break}}}w.prototype["parse scheme start"]=function(e,t){if(u(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,o;this.state="no scheme",--this.pointer}return!0},w.prototype["parse scheme"]=function(e,t){if(function(e){return u(e)||l(e)}(e)||43===e||45===e||46===e)this.buffer+=t.toLowerCase();else if(58===e){if(this.stateOverride){if(h(this.url)&&!f(this.buffer))return!1;if(!h(this.url)&&f(this.buffer))return!1;if((S(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):h(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":h(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,o;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},w.prototype["parse no scheme"]=function(e){return null===this.base||this.base.cannotBeABaseURL&&35!==e?o:(this.base.cannotBeABaseURL&&35===e?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},w.prototype["parse special relative or authority"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},w.prototype["parse path or authority"]=function(e){return 47===e?this.state="authority":(this.state="path",--this.pointer),!0},w.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,isNaN(e)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===e?this.state="relative slash":63===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):h(this.url)&&92===e?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},w.prototype["parse relative slash"]=function(e){return!h(this.url)||47!==e&&92!==e?47===e?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===e&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},w.prototype["parse special authority slashes"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},w.prototype["parse special authority ignore slashes"]=function(e){return 47!==e&&92!==e?(this.state="authority",--this.pointer):this.parseError=!0,!0},w.prototype["parse authority"]=function(e,t){if(64===e){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const e=s(this.buffer);for(let t=0;t<e;++t){const e=this.buffer.codePointAt(t);if(58===e&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const a=R(e,v);this.passwordTokenSeenFlag?this.url.password+=a:this.url.username+=a}this.buffer=""}else if(isNaN(e)||47===e||63===e||35===e||h(this.url)&&92===e){if(this.atFlag&&""===this.buffer)return this.parseError=!0,o;this.pointer-=s(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=t;return!0},w.prototype["parse hostname"]=w.prototype["parse host"]=function(e,t){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==e||this.arrFlag)if(isNaN(e)||47===e||63===e||35===e||h(this.url)&&92===e){if(--this.pointer,h(this.url)&&""===this.buffer)return this.parseError=!0,o;if(this.stateOverride&&""===this.buffer&&(S(this.url)||null!==this.url.port))return this.parseError=!0,!1;const e=O(this.buffer,h(this.url));if(e===o)return o;if(this.url.host=e,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===e?this.arrFlag=!0:93===e&&(this.arrFlag=!1),this.buffer+=t;else{if(""===this.buffer)return this.parseError=!0,o;const e=O(this.buffer,h(this.url));if(e===o)return o;if(this.url.host=e,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},w.prototype["parse port"]=function(e,t){if(l(e))this.buffer+=t;else{if(!(isNaN(e)||47===e||63===e||35===e||h(this.url)&&92===e||this.stateOverride))return this.parseError=!0,o;if(""!==this.buffer){const e=parseInt(this.buffer);if(e>Math.pow(2,16)-1)return this.parseError=!0,o;this.url.port=e===(a=this.url.scheme,i[a])?null:e,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var a;return!0};const I=new Set([47,92,63,35]);w.prototype["parse file"]=function(e){var t,a;return this.url.scheme="file",47===e||92===e?(92===e&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(e)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(t=e,a=this.input[this.pointer+1],!u(t)||58!==a&&124!==a)||this.input.length-this.pointer-1>=2&&!I.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),A(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},w.prototype["parse file slash"]=function(e){return 47===e||92===e?(92===e&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(!function(e){return 2===e.length&&u(e.codePointAt(0))&&":"===e[1]}(this.base.path[0])?this.url.host=this.base.host:this.url.path.push(this.base.path[0])),this.state="path",--this.pointer),!0},w.prototype["parse file host"]=function(e,t){if(isNaN(e)||47===e||92===e||63===e||35===e)if(--this.pointer,!this.stateOverride&&m(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=O(this.buffer,h(this.url));if(e===o)return o;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=t;return!0},w.prototype["parse path start"]=function(e){return h(this.url)?(92===e&&(this.parseError=!0),this.state="path",47!==e&&92!==e&&--this.pointer):this.stateOverride||63!==e?this.stateOverride||35!==e?void 0!==e&&(this.state="path",47!==e&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},w.prototype["parse path"]=function(e){if(isNaN(e)||47===e||h(this.url)&&92===e||!this.stateOverride&&(63===e||35===e)){if(h(this.url)&&92===e&&(this.parseError=!0),".."===(t=(t=this.buffer).toLowerCase())||"%2e."===t||".%2e"===t||"%2e%2e"===t?(A(this.url),47===e||h(this.url)&&92===e||this.url.path.push("")):!c(this.buffer)||47===e||h(this.url)&&92===e?c(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&m(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===e||63===e||35===e))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===e&&(this.url.query="",this.state="query"),35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||d(this.input[this.pointer+1])&&d(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=R(e,T);var t;return!0},w.prototype["parse cannot-be-a-base-URL path"]=function(e){return 63===e?(this.url.query="",this.state="query"):35===e?(this.url.fragment="",this.state="fragment"):(isNaN(e)||37===e||(this.parseError=!0),37!==e||d(this.input[this.pointer+1])&&d(this.input[this.pointer+2])||(this.parseError=!0),isNaN(e)||(this.url.path[0]=this.url.path[0]+R(e,y))),!0},w.prototype["parse query"]=function(e,t){if(isNaN(e)||!this.stateOverride&&35===e){h(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const t=new Buffer(this.buffer);for(let e=0;e<t.length;++e)t[e]<33||t[e]>126||34===t[e]||35===t[e]||60===t[e]||62===t[e]?this.url.query+=_(t[e]):this.url.query+=String.fromCodePoint(t[e]);this.buffer="",35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||d(this.input[this.pointer+1])&&d(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=t;return!0},w.prototype["parse fragment"]=function(e){return isNaN(e)||(0===e?this.parseError=!0:(37!==e||d(this.input[this.pointer+1])&&d(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=R(e,y))),!0},e.exports.serializeURL=function(e,t){let a=e.scheme+":";if(null!==e.host?(a+="//",""===e.username&&""===e.password||(a+=e.username,""!==e.password&&(a+=":"+e.password),a+="@"),a+=N(e.host),null!==e.port&&(a+=":"+e.port)):null===e.host&&"file"===e.scheme&&(a+="//"),e.cannotBeABaseURL)a+=e.path[0];else for(const t of e.path)a+="/"+t;return null!==e.query&&(a+="?"+e.query),t||null===e.fragment||(a+="#"+e.fragment),a},e.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return e.exports.serializeURLOrigin(e.exports.parseURL(t.path[0]))}catch(e){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(e){let t=e.scheme+"://";return t+=N(e.host),null!==e.port&&(t+=":"+e.port),t}({scheme:t.scheme,host:t.host,port:t.port});case"file":return"file://";default:return"null"}},e.exports.basicURLParse=function(e,t){void 0===t&&(t={});const a=new w(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return a.failure?"failure":a.url},e.exports.setTheUsername=function(e,t){e.username="";const a=n.ucs2.decode(t);for(let t=0;t<a.length;++t)e.username+=R(a[t],v)},e.exports.setThePassword=function(e,t){e.password="";const a=n.ucs2.decode(t);for(let t=0;t<a.length;++t)e.password+=R(a[t],v)},e.exports.serializeHost=N,e.exports.cannotHaveAUsernamePasswordPort=function(e){return null===e.host||""===e.host||e.cannotBeABaseURL||"file"===e.scheme},e.exports.serializeInteger=function(e){return String(e)},e.exports.parseURL=function(t,a){return void 0===a&&(a={}),e.exports.basicURLParse(t,{baseURL:a.baseURL,encodingOverride:a.encodingOverride})}},8338:(e,t,a)=>{a.d(t,{l:()=>S,m:()=>I});var n=a(5608),r=a(9212),i=a(8907),o=a(6563),s=a(1777),p=a(5207),l=a(3767),u=a(777),d=a(671),c=Object.create(null);function m(e){var t=JSON.stringify(e);return c[t]||(c[t]=Object.create(null))}function f(e){var t=m(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,a){var n=function(e,t){return a.readField(t,e)},i=a.keyObject=_(e,function(e){var i=T(a.storeObject,e,n);return void 0===i&&t!==a.storeObject&&p.$3.call(t,e[0])&&(i=T(t,e,E)),(0,r.invariant)(void 0!==i,5,e.join("."),t),i});return"".concat(a.typename,":").concat(JSON.stringify(i))})}function h(e){var t=m(e);return t.keyArgsFn||(t.keyArgsFn=function(t,a){var n=a.field,r=a.variables,o=a.fieldName,s=_(e,function(e){var a=e[0],o=a.charAt(0);if("@"!==o)if("$"!==o){if(t)return T(t,e)}else{var s=a.slice(1);if(r&&p.$3.call(r,s)){var u=e.slice(0);return u[0]=s,T(r,u)}}else if(n&&(0,l.E)(n.directives)){var d=a.slice(1),c=n.directives.find(function(e){return e.name.value===d}),m=c&&(0,i.MB)(c,r);return m&&T(m,e.slice(1))}}),u=JSON.stringify(s);return(t||"{}"!==u)&&(o+=":"+u),o})}function _(e,t){var a=new d.ZI;return y(e).reduce(function(e,n){var r,i=t(n);if(void 0!==i){for(var o=n.length-1;o>=0;--o)(r={})[n[o]]=i,i=r;e=a.merge(e,i)}return e},Object.create(null))}function y(e){var t=m(e);if(!t.paths){var a=t.paths=[],n=[];e.forEach(function(t,r){(0,l.c)(t)?(y(t).forEach(function(e){return a.push(n.concat(e))}),n.length=0):(n.push(t),(0,l.c)(e[r+1])||(a.push(n.slice(0)),n.length=0))})}return t.paths}function E(e,t){return e[t]}function T(e,t,a){return a=a||E,g(t.reduce(function e(t,n){return(0,l.c)(t)?t.map(function(t){return e(t,n)}):t&&a(t,n)},e))}function g(e){return(0,s.U)(e)?(0,l.c)(e)?e.map(g):_(Object.keys(e).sort(),function(t){return T(e,t)}):e}var v=a(7150);function R(e){return void 0!==e.args?e.args:e.field?(0,i.MB)(e.field,e.variables):null}var b=function(){},O=function(e,t){return t.fieldName},N=function(e,t,a){return(0,a.mergeObjects)(e,t)},A=function(e,t){return t},S=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,n.__assign)({dataIdFromObject:p.or},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var a,r=this,i=t&&(t.typename||(null===(a=t.storeObject)||void 0===a?void 0:a.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var o,s=t&&t.storeObject||e,p=(0,n.__assign)((0,n.__assign)({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=I(arguments,s);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),u=i&&this.getTypePolicy(i),d=u&&u.keyFn||this.config.dataIdFromObject;return v.yV.withValue(!0,function(){for(;d;){var t=d((0,n.__assign)((0,n.__assign)({},e),s),p);if(!(0,l.c)(t)){o=t;break}d=f(t)}}),o=o?String(o):void 0,p.keyObject?[o,p.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(a){var r=e[a],i=r.queryType,o=r.mutationType,s=r.subscriptionType,l=(0,n.__rest)(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",a),o&&t.setRootTypename("Mutation",a),s&&t.setRootTypename("Subscription",a),p.$3.call(t.toBeAdded,a)?t.toBeAdded[a].push(l):t.toBeAdded[a]=[l]})},e.prototype.updateTypePolicy=function(e,t){var a=this,n=this.getTypePolicy(e),r=t.keyFields,i=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?N:!1===t?A:e.merge}o(n,t.merge),n.keyFn=!1===r?b:(0,l.c)(r)?f(r):"function"==typeof r?r:n.keyFn,i&&Object.keys(i).forEach(function(t){var n=a.getFieldPolicy(e,t,!0),r=i[t];if("function"==typeof r)n.read=r;else{var s=r.keyArgs,p=r.read,u=r.merge;n.keyFn=!1===s?O:(0,l.c)(s)?h(s):"function"==typeof s?s:n.keyFn,"function"==typeof p&&(n.read=p),o(n,u)}n.read&&n.merge&&(n.keyFn=n.keyFn||O)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var a="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[a];t!==n&&((0,r.invariant)(!n||n===e,6,e),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=a,this.rootTypenamesById[a]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(a){t.getSupertypeSet(a,!0),e[a].forEach(function(e){t.getSupertypeSet(e,!0).add(a);var n=e.match(p.gk);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!p.$3.call(this.typePolicies,e)){var a=this.typePolicies[e]=Object.create(null);a.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(a,n){if(a.test(e)){var i=t.supertypeMap.get(n);i&&i.forEach(function(e){return r.add(e)})}})),r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields,o=(0,n.__rest)(r,["fields"]);Object.assign(a,o),Object.assign(a.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(a){t.updateTypePolicy(e,a)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,a){if(e){var n=this.getTypePolicy(e).fields;return n[t]||a&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var a=this.supertypeMap.get(e);return!a&&t&&this.supertypeMap.set(e,a=new Set),a},e.prototype.fragmentMatches=function(e,t,a,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),l=[s],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&l.indexOf(t)<0&&l.push(t)},d=!(!a||!this.fuzzySubtypes.size),c=!1,m=0;m<l.length;++m){var f=l[m];if(f.has(o))return s.has(o)||(c&&!1!==globalThis.__DEV__&&r.invariant.warn(7,t,o),s.add(o)),!0;f.forEach(u),d&&m===l.length-1&&(0,p.T9)(e.selectionSet,a,n)&&(d=!1,c=!0,this.fuzzySubtypes.forEach(function(e,a){var n=t.match(e);n&&n[0]===t&&u(a)}))}return!1},e.prototype.hasKeyArgs=function(e,t){var a=this.getFieldPolicy(e,t,!1);return!(!a||!a.keyFn)},e.prototype.getStoreFieldName=function(e){var t,a=e.typename,n=e.fieldName,r=this.getFieldPolicy(a,n,!1),o=r&&r.keyFn;if(o&&a)for(var s={typename:a,fieldName:n,field:e.field||null,variables:e.variables},u=R(e);o;){var d=o(u,s);if(!(0,l.c)(d)){t=d||n;break}o=h(d)}return void 0===t&&(t=e.field?(0,i.Ii)(e.field,e.variables):(0,i.o5)(n,R(e))),!1===t?n:n===(0,p.iJ)(t)?t:n+":"+t},e.prototype.readField=function(e,t){var a=e.from;if(a&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(a,"__typename");n&&(e.typename=n)}var r=this.getStoreFieldName(e),o=(0,p.iJ)(r),s=t.store.getFieldValue(a,r),l=this.getFieldPolicy(e.typename,o,!1),d=l&&l.read;if(d){var c=w(this,a,e,t,t.store.getStorage((0,i.A_)(a)?a.__ref:a,r));return u.bl.withValue(this.cache,d,[s,c])}return s}},e.prototype.getReadFunction=function(e,t){var a=this.getFieldPolicy(e,t,!1);return a&&a.read},e.prototype.getMergeFunction=function(e,t,a){var n=this.getFieldPolicy(e,t,!1),r=n&&n.merge;return!r&&a&&(r=(n=this.getTypePolicy(a))&&n.merge),r},e.prototype.runMergeFunction=function(e,t,a,n,r){var i=a.field,o=a.typename,s=a.merge;return s===N?C(n.store)(e,t):s===A?t:(n.overwrite&&(e=void 0),s(e,t,w(this,void 0,{typename:o,fieldName:i.name.value,field:i,variables:n.variables},n,r||Object.create(null))))},e}();function w(e,t,a,n,r){var o=e.getStoreFieldName(a),s=(0,p.iJ)(o),l=a.variables||n.variables,u=n.store,d=u.toReference,c=u.canRead;return{args:R(a),field:a.field||null,fieldName:s,storeFieldName:o,variables:l,isReference:i.A_,toReference:d,storage:r,cache:e.cache,canRead:c,readField:function(){return e.readField(I(arguments,t,l),n)},mergeObjects:C(n.store)}}function I(e,t,a){var i,s=e[0],l=e[1],u=e.length;return"string"==typeof s?i={fieldName:s,from:u>1?l:t}:(i=(0,n.__assign)({},s),p.$3.call(i,"from")||(i.from=t)),!1!==globalThis.__DEV__&&void 0===i.from&&!1!==globalThis.__DEV__&&r.invariant.warn(8,(0,o.p)(Array.from(e))),void 0===i.variables&&(i.variables=a),i}function C(e){return function(t,a){if((0,l.c)(t)||(0,l.c)(a))throw(0,r.newInvariantError)(9);if((0,s.U)(t)&&(0,s.U)(a)){var o=e.getFieldValue(t,"__typename"),u=e.getFieldValue(a,"__typename");if(o&&u&&o!==u)return a;if((0,i.A_)(t)&&(0,p.d1)(a))return e.merge(t.__ref,a),t;if((0,p.d1)(t)&&(0,i.A_)(a))return e.merge(t,a.__ref),a;if((0,p.d1)(t)&&(0,p.d1)(a))return(0,n.__assign)((0,n.__assign)({},t),a)}return a}}},8354:(e,t,a)=>{a.d(t,{m:()=>p});var n=a(9212),r=a(2904),i=a(3777),o=a(5186),s=a(7150);function p(e,t,a){var p;if(!a.fragmentMatches)return!1!==globalThis.__DEV__&&(0,s.Ki)(),e;var l=(0,i.Vu)(t);return(0,n.invariant)(l,51),null==e?e:(0,o.S)(e,l.selectionSet,{operationType:l.operation,operationName:null===(p=l.name)||void 0===p?void 0:p.value,fragmentMap:(0,r.JG)((0,i.zK)(t)),cache:a,mutableTargets:new s.jq,knownChanged:new s.xm})}},8414:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(3777);function r(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?(0,n.n4)(t.query)||void 0:""),t}},8417:e=>{e.exports=JSON.parse('{"name":"GeneratorMediaFlow","brickDescription":{"default":"","en-us":"Fetch box\'s file list from Media Flow","zh-tw":"從 Media Flow 取得投遞箱檔案列表","ja-jp":"Media Flow から配信ボックスのファイルリストを取得"},"brickDisplayName":"Media Flow","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"photo-film"},"brickMeta":{"scriptMember":true},"propTypes":{"boxId":{"type":"string"},"accessToken":{"type":"string"},"passcode":{"type":"string"},"includeTypes":{"type":"arrayOf","content":{"type":"oneOf","content":["IMAGE","VIDEO","AUDIO","FILE"],"forcePropertyBank":false},"forcePropertyBank":false},"fetchPolicy":{"type":"oneOf","content":["cache-first","network-and-cache","network-only"],"forcePropertyBank":false},"subscribeBoxChange":{"type":"bool"},"saveToStorage":{"type":"bool"},"saveToStorageDownloadMode":{"type":"oneOf","content":["sequence","concurrent"],"forcePropertyBank":false},"loadSizeLimit":{"type":"string"},"allowLoadSizeLimitExceed":{"type":"bool"},"source":{"type":"oneOf","content":["original","auto","converted","video-thumbnail-original","use-source-versions"],"forcePropertyBank":false},"sourceVersionAlternatives":{"type":"arrayOf","content":{"type":"number"},"forcePropertyBank":false},"allowlist":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"blocklist":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false}},"brickPropDescriptions":{"boxId":{"default":"","en-us":"The box id of Media Flow","zh-tw":"Media Flow 的投遞箱 id","ja-jp":"Media Flow の配信ボックス ID"},"accessToken":{"default":"","en-us":"Authorize accessToken, use `passcode` if `accessToken` is empty","zh-tw":"驗證用 Access token, 如果為空則使用 `passcode`","ja-jp":"認証用アクセストークン、 空の場合は `passcode` を使用"},"passcode":{"default":"","en-us":"Authorize passcode","zh-tw":"驗證用 Passcode","ja-jp":"認証用パスコード"},"includeTypes":{"default":"","en-us":"Include File Types","zh-tw":"包含的檔案類型","ja-jp":"含めるファイルタイプ"},"fetchPolicy":{"default":"","en-us":"Determine the cache behavior \\n \\n cache-first: Cache first if existing, then fetch from network \\n network-and-cache: Fetch from network, then save cache \\n network-only: Fetch from network only","zh-tw":"決定 cache 的行為 \\n \\n cache-first: 如果有 cache 則優先使用,然後從網路取得 \\n network-and-cache: 從網路取得,然後儲存 cache \\n network-only: 只從網路取得","ja-jp":"キャッシュの動作を決定 \\n \\n cache-first: 既存のキャッシュを優先し、その後ネットワークから取得 \\n network-and-cache: ネットワークから取得し、その後キャッシュに保存 \\n network-only: ネットワークからのみ取得"},"subscribeBoxChange":{"default":"","en-us":"Subscribe box change to refresh file list (file deleted / new file uploaded)","zh-tw":"訂閱投遞箱變更,以更新檔案列表 (檔案刪除 / 新增檔案)","ja-jp":"ボックスの変更を購読してファイルリストを更新(ファイル削除 / 新ファイルアップロード)"},"saveToStorage":{"default":"","en-us":"Save files into local file storage","zh-tw":"儲存檔案到本地儲存空間","ja-jp":"ファイルをローカルストレージに保存"},"saveToStorageDownloadMode":{"default":"","en-us":"Concurrent download files or sequence for saveToStorage","zh-tw":"平行下載檔案或依序下載檔案,用於 saveToStorage","ja-jp":"並行ダウンロードまたは順次ダウンロード(saveToStorage 用)"},"loadSizeLimit":{"default":"","en-us":"Limit the load size (* GB, * MB, * KB)","zh-tw":"限制讀取大小 (* GB, * MB, * KB)","ja-jp":"読み込みサイズの制限 (* GB, * MB, * KB)"},"allowLoadSizeLimitExceed":{"default":"","en-us":"Allow Load size limit exceed, just call event","zh-tw":"允許超過讀取大小限制,僅呼叫事件","ja-jp":"読み込みサイズ制限の超過を許可し、イベントのみを呼び出す"},"source":{"default":"","en-us":"Select download source","zh-tw":"選擇下載來源","ja-jp":"ダウンロードソースを選択"},"sourceVersionAlternatives":{"default":"","en-us":"Select download source with image version (use width, e.g. [250, 360])","zh-tw":"選擇下載來源,並指定圖片版本 (使用寬度,例如 [250, 360])","ja-jp":"画像バージョンを指定してダウンロードソースを選択(幅を使用、例:[250, 360])"},"allowlist":{"default":"","en-us":"Allowlist patterns to filter media files (supports regex or plain text)","zh-tw":"允許名單過濾模式 (支援正則表達式或純文字)","ja-jp":"メディアファイルをフィルタリングする許可リストパターン(正規表現またはプレーンテキストをサポート)"},"blocklist":{"default":"","en-us":"Blocklist patterns to filter media files (supports regex or plain text)","zh-tw":"拒絕名單過濾模式 (支援正則表達式或純文字)","ja-jp":"メディアファイルをフィルタリングするブロックリストパターン(正規表現またはプレーンテキストをサポート)"}},"propertyControls":{"boxId":{"required":true},"accessToken":{"required":{"unlessSome":["passcode"]}},"passcode":{"required":{"unlessSome":["accessToken"]}},"loadSizeLimit":{"placeholder":"GB / MB / KB"},"saveToStorageDownloadMode":{"displayName":"Download Mode","normalizeDisplayName":false,"oneOfEmptyOption":false},"source":{"displayName":"Source Size"},"fetchPolicy":{"oneOfEmptyOption":false}},"defaultBrickProps":{"includeTypes":["IMAGE","VIDEO","AUDIO","FILE"],"fetchPolicy":"cache-first","subscribeBoxChange":false,"saveToStorageDownloadMode":"sequence","loadSizeLimit":"","allowLoadSizeLimitExceed":true,"source":"original","sourceVersionAlternatives":[]},"eventTypes":{"GENERATOR_MEDIA_FLOW_FETCH_ERROR":"GENERATOR_MEDIA_FLOW_FETCH_ERROR","GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT":"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT","GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_ERROR":"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_ERROR","GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT_ERROR":"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT_ERROR","GENERATOR_MEDIA_FLOW_SAVE_STORAGE_COMPLETED":"GENERATOR_MEDIA_FLOW_SAVE_STORAGE_COMPLETED","GENERATOR_MEDIA_FLOW_FILE_SIZE_EXCEED":"GENERATOR_MEDIA_FLOW_FILE_SIZE_EXCEED"},"brickEventDescriptions":{"GENERATOR_MEDIA_FLOW_FETCH_ERROR":{"default":"","en-us":"Event of media box fetch error","zh-tw":"Event of media box fetch error","ja-jp":"メディアボックスの取得エラー"},"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT":{"default":"","en-us":"Event of subscribe box change connected (If set `Subscribe Box Change`)","zh-tw":"Event of subscribe box change connected (If set `Subscribe Box Change`)","ja-jp":"ボックスの変更を購読してファイルリストを更新(ファイル削除 / 新ファイルアップロード)"},"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_ERROR":{"default":"","en-us":"Event of subscribe box change error (If set `Subscribe Box Change`)","zh-tw":"Event of subscribe box change error (If set `Subscribe Box Change`)","ja-jp":"ボックスの変更を購読してファイルリストを更新(ファイル削除 / 新ファイルアップロード)"},"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT_ERROR":{"default":"","en-us":"Event of subscribe box change connection error (If set `Subscribe Box Change`)","zh-tw":"Event of subscribe box change connection error (If set `Subscribe Box Change`)","ja-jp":"ボックスの変更を購読してファイルリストを更新(ファイル削除 / 新ファイルアップロード)"},"GENERATOR_MEDIA_FLOW_SAVE_STORAGE_COMPLETED":{"default":"","en-us":"Event of file sync completed for used `saveToStorage`","zh-tw":"當使用 `saveToStorage`,檔案同步完成觸發的事件","ja-jp":"`saveToStorage` を使用した場合、ファイル同期が完了したときに発生するイベント"},"GENERATOR_MEDIA_FLOW_FILE_SIZE_EXCEED":{"default":"","en-us":"Event when file list size exceed of Load size limit","zh-tw":"Event when file list size exceed of Load size limit","ja-jp":"ファイルリストサイズが読み込みサイズの制限を超えたときに発生するイベント"}},"eventPropertyControls":{"GENERATOR_MEDIA_FLOW_FETCH_ERROR":{"properties":{"GENERATOR_MEDIA_FLOW_ERROR":{"name":"Error","type":"string"},"GENERATOR_MEDIA_FLOW_ERROR_IS_FROM_CACHE":{"name":"From Cache","type":"boolean"}}},"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_ERROR":{"properties":{"GENERATOR_MEDIA_FLOW_ERROR":{"name":"Error","type":"string"}}},"GENERATOR_MEDIA_FLOW_SUBSCRIBE_BOX_CONNECT_ERROR":{"properties":{"GENERATOR_MEDIA_FLOW_ERROR":{"name":"Error","type":"string"}}}},"outletTypes":{"GENERATOR_MEDIA_FLOW_DOWNLOAD_STATUS":{"outlet":"GENERATOR_MEDIA_FLOW_DOWNLOAD_STATUS","type":"string"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_PROGRESS":{"outlet":"GENERATOR_MEDIA_FLOW_DOWNLOAD_PROGRESS","type":"array"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_ERRORS":{"outlet":"GENERATOR_MEDIA_FLOW_DOWNLOAD_ERRORS","type":"array"},"GENERATOR_MEDIA_FLOW_BOX":{"outlet":"GENERATOR_MEDIA_FLOW_BOX","type":"object"},"GENERATOR_MEDIA_FLOW_RESULT":{"outlet":"GENERATOR_MEDIA_FLOW_RESULT","type":"array","displayName":"File List"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_FILE_URLS":{"outlet":"GENERATOR_MEDIA_FLOW_DOWNLOAD_FILE_URLS","type":"array","displayName":"Downloaded File List"}},"brickOutletDescriptions":{"GENERATOR_MEDIA_FLOW_DOWNLOAD_STATUS":{"default":"","en-us":"File sync status","zh-tw":"檔案同步的狀態","ja-jp":"ファイル同期の状態"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_PROGRESS":{"default":"","en-us":"File sync progress","zh-tw":"檔案下載的進度","ja-jp":"ファイルダウンロードの進捗"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_ERRORS":{"default":"","en-us":"File sync download errors","zh-tw":"檔案下載的 errors","ja-jp":"ファイルダウンロードのエラー"},"GENERATOR_MEDIA_FLOW_BOX":{"default":"","en-us":"Media box info","zh-tw":"Media box 資訊","ja-jp":"Media ボックスの情報"},"GENERATOR_MEDIA_FLOW_RESULT":{"default":"","en-us":"Save Media Flow fetch result [ { \\"url\\": \\"https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1\\" \\"extension\\": \\"\\", // enum(\\"jpg\\", \\"png\\", \\"mp4\\") \\"id\\": \\"5b431e37efd40c01e8b201d1\\", \\"md5\\": \\"6134ab412351651324\\" // md5 came from media resource api } ]","zh-tw":"存入 Media Flow 獲取結果 [ { \\"url\\": \\"https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1\\" \\"extension\\": \\"\\" // enum(\\"jpg\\", \\"png\\", \\"mp4\\"), \\"id\\": \\"5b431e37efd40c01e8b201d1\\", \\"md5\\": \\"6134ab412351651324\\" // md5 came from media resource api } ]","ja-jp":"Media Flow の取得結果を保存 [ { \\"url\\": \\"https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1\\" \\"extension\\": \\"\\" // enum(\\"jpg\\", \\"png\\", \\"mp4\\"), \\"id\\": \\"5b431e37efd40c01e8b201d1\\", \\"md5\\": \\"6134ab412351651324\\" // md5 came from media resource api } ]"},"GENERATOR_MEDIA_FLOW_DOWNLOAD_FILE_URLS":{"default":"","en-us":"File sync result [ { \\"url\\": \\"/storage/emulated/0/Download/SyncFolder/Asset/1.png\\", \\"mediaType\\": \\"photo\\" // enum(\\"photo\\", \\"video\\"), used to distingiush \\"id\\": \\"\\", } ]","zh-tw":"檔案同步的結果 [ { \\"url\\": \\"/storage/emulated/0/Download/SyncFolder/Asset/1.png\\", \\"mediaType\\": \\"photo\\" // enum(\\"photo\\", \\"video\\"), used to distingiush \\"id\\": \\"\\", } ]","ja-jp":"ファイル同期の結果 [ { \\"url\\": \\"/storage/emulated/0/Download/SyncFolder/Asset/1.png\\", \\"mediaType\\": \\"photo\\" // enum(\\"photo\\", \\"video\\"), used to distingiush \\"id\\": \\"\\", } ]"}},"actionTypes":{"GENERATOR_MEDIA_FLOW_FETCH":{"canProvideProperty":false},"GENERATOR_MEDIA_FLOW_RESET_CACHE":{"canProvideProperty":false},"GENERATOR_MEDIA_FLOW_ABORT_FETCH":{"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_MEDIA_FLOW_FETCH":{"default":"","en-us":"Start fetcn Media box file list","zh-tw":"開始獲取 Media box 檔案列表","ja-jp":"Media ボックスのファイルリストを取得する"},"GENERATOR_MEDIA_FLOW_RESET_CACHE":{"default":"","en-us":"Reset cache","zh-tw":"重置 cache","ja-jp":"キャッシュをリセット"},"GENERATOR_MEDIA_FLOW_ABORT_FETCH":{"default":"","en-us":"Abort current fetch request of media list","zh-tw":"終止目前媒體列表的獲取請求","ja-jp":"現在のメディアリストの取得要求を中止"}},"propertyControlGroups":{"storage":{"name":"Storage","type":"group","content":["saveToStorage","saveToStorageDownloadMode","loadSizeLimit","allowLoadSizeLimitExceed","source","sourceVersionAlternatives"]}},"propertyControlGroupDescriptions":{},"scriptMemberFunctionDefs":{"fetch":{"arguments":[],"required":[],"return":{"type":"array"}},"resetCache":{"arguments":[],"required":[],"return":{"type":"void"}},"abortFetch":{"arguments":[],"required":[],"return":{"type":"void"}},"getFileList":{"arguments":[],"required":[],"return":{"type":"array"}},"getBoxInfo":{"arguments":[],"required":[],"return":{"type":"object"}},"getDownloadedFileUrls":{"arguments":[],"required":[],"return":{"type":"array"}}},"scriptMemberFunctionDefDescriptions":{"fetch":{"default":"","en-us":"Fetch media files from Media Flow","zh-tw":"從 Media Flow 取得媒體檔案","ja-jp":"Media Flow からメディアファイルを取得する"},"resetCache":{"default":"","en-us":"Reset Media Flow cache","zh-tw":"重置 Media Flow 快取","ja-jp":"Media Flow キャッシュをリセットする"},"abortFetch":{"default":"","en-us":"Abort current fetch request","zh-tw":"中止目前的取得請求","ja-jp":"現在のフェッチリクエストを中止する"},"getFileList":{"default":"","en-us":"Get current file list","zh-tw":"取得目前的檔案列表","ja-jp":"現在のファイルリストを取得する"},"getBoxInfo":{"default":"","en-us":"Get current box information","zh-tw":"取得目前的投遞箱資訊","ja-jp":"現在のボックス情報を取得する"},"getDownloadedFileUrls":{"default":"","en-us":"Get downloaded file URLs","zh-tw":"取得已下載的檔案網址","ja-jp":"ダウンロードされたファイルのURLを取得する"}}}')},8422:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(4450),r=a(7898),i=a(458),o=a(458),s={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,data:s,parentSchema:p,it:l}=e,{opts:u}=l,d=(0,n.allSchemaProperties)(a),c=d.filter(e=>(0,i.alwaysValidSchema)(l,a[e]));if(0===d.length||c.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const m=u.strictSchema&&!u.allowMatchingProperties&&p.properties,f=t.name("valid");!0===l.props||l.props instanceof r.Name||(l.props=(0,o.evaluatedPropsToName)(t,l.props));const{props:h}=l;function _(e){for(const t in m)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(a){t.forIn("key",s,i=>{t.if(r._`${(0,n.usePattern)(e,a)}.test(${i})`,()=>{const n=c.includes(a);n||e.subschema({keyword:"patternProperties",schemaProp:a,dataProp:i,dataPropType:o.Type.Str},f),l.opts.unevaluated&&!0!==h?t.assign(r._`${h}[${i}]`,!0):n||l.allErrors||t.if((0,r.not)(f),()=>t.break())})})}!function(){for(const e of d)m&&_(e),l.allErrors?y(e):(t.var(f,!0),y(e),t.if(f))}()}};t.default=s},8472:(e,t,a)=>{a.d(t,{Ey:()=>h,JG:()=>p,MQ:()=>S,Z_:()=>l,qA:()=>f});var n=a(9841),r=a(9762),i=a(7714),o=a(5881),s=a(2039);class p{constructor(e){const t=new r.ou(s.Y.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.Y.EOF)do{if(e.next)e=e.next;else{const t=_(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===s.Y.COMMENT);return e}}function l(e){return e===s.Y.BANG||e===s.Y.DOLLAR||e===s.Y.AMP||e===s.Y.PAREN_L||e===s.Y.PAREN_R||e===s.Y.DOT||e===s.Y.SPREAD||e===s.Y.COLON||e===s.Y.EQUALS||e===s.Y.AT||e===s.Y.BRACKET_L||e===s.Y.BRACKET_R||e===s.Y.BRACE_L||e===s.Y.PIPE||e===s.Y.BRACE_R}function u(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function d(e,t){return c(e.charCodeAt(t))&&m(e.charCodeAt(t+1))}function c(e){return e>=55296&&e<=56319}function m(e){return e>=56320&&e<=57343}function f(e,t){const a=e.source.body.codePointAt(t);if(void 0===a)return s.Y.EOF;if(a>=32&&a<=126){const e=String.fromCodePoint(a);return'"'===e?"'\"'":`"${e}"`}return"U+"+a.toString(16).toUpperCase().padStart(4,"0")}function h(e,t,a,n,i){const o=e.line,s=1+a-e.lineStart;return new r.ou(t,a,n,o,s,i)}function _(e,t){const a=e.source.body,r=a.length;let i=t;for(;i<r;){const t=a.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===a.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return y(e,i);case 33:return h(e,s.Y.BANG,i,i+1);case 36:return h(e,s.Y.DOLLAR,i,i+1);case 38:return h(e,s.Y.AMP,i,i+1);case 40:return h(e,s.Y.PAREN_L,i,i+1);case 41:return h(e,s.Y.PAREN_R,i,i+1);case 46:if(46===a.charCodeAt(i+1)&&46===a.charCodeAt(i+2))return h(e,s.Y.SPREAD,i,i+3);break;case 58:return h(e,s.Y.COLON,i,i+1);case 61:return h(e,s.Y.EQUALS,i,i+1);case 64:return h(e,s.Y.AT,i,i+1);case 91:return h(e,s.Y.BRACKET_L,i,i+1);case 93:return h(e,s.Y.BRACKET_R,i,i+1);case 123:return h(e,s.Y.BRACE_L,i,i+1);case 124:return h(e,s.Y.PIPE,i,i+1);case 125:return h(e,s.Y.BRACE_R,i,i+1);case 34:return 34===a.charCodeAt(i+1)&&34===a.charCodeAt(i+2)?A(e,i):g(e,i)}if((0,o.yp)(t)||45===t)return E(e,i,t);if((0,o.un)(t))return S(e,i);throw(0,n.I)(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":u(t)||d(a,i)?`Unexpected character: ${f(e,i)}.`:`Invalid character: ${f(e,i)}.`)}return h(e,s.Y.EOF,r,r)}function y(e,t){const a=e.source.body,n=a.length;let r=t+1;for(;r<n;){const e=a.charCodeAt(r);if(10===e||13===e)break;if(u(e))++r;else{if(!d(a,r))break;r+=2}}return h(e,s.Y.COMMENT,t,r,a.slice(t+1,r))}function E(e,t,a){const r=e.source.body;let i=t,p=a,l=!1;if(45===p&&(p=r.charCodeAt(++i)),48===p){if(p=r.charCodeAt(++i),(0,o.yp)(p))throw(0,n.I)(e.source,i,`Invalid number, unexpected digit after 0: ${f(e,i)}.`)}else i=T(e,i,p),p=r.charCodeAt(i);if(46===p&&(l=!0,p=r.charCodeAt(++i),i=T(e,i,p),p=r.charCodeAt(i)),69!==p&&101!==p||(l=!0,p=r.charCodeAt(++i),43!==p&&45!==p||(p=r.charCodeAt(++i)),i=T(e,i,p),p=r.charCodeAt(i)),46===p||(0,o.un)(p))throw(0,n.I)(e.source,i,`Invalid number, expected digit but got: ${f(e,i)}.`);return h(e,l?s.Y.FLOAT:s.Y.INT,t,i,r.slice(t,i))}function T(e,t,a){if(!(0,o.yp)(a))throw(0,n.I)(e.source,t,`Invalid number, expected digit but got: ${f(e,t)}.`);const r=e.source.body;let i=t+1;for(;(0,o.yp)(r.charCodeAt(i));)++i;return i}function g(e,t){const a=e.source.body,r=a.length;let i=t+1,o=i,p="";for(;i<r;){const r=a.charCodeAt(i);if(34===r)return p+=a.slice(o,i),h(e,s.Y.STRING,t,i+1,p);if(92===r){p+=a.slice(o,i);const t=117===a.charCodeAt(i+1)?123===a.charCodeAt(i+2)?v(e,i):R(e,i):N(e,i);p+=t.value,i+=t.size,o=i;continue}if(10===r||13===r)break;if(u(r))++i;else{if(!d(a,i))throw(0,n.I)(e.source,i,`Invalid character within String: ${f(e,i)}.`);i+=2}}throw(0,n.I)(e.source,i,"Unterminated string.")}function v(e,t){const a=e.source.body;let r=0,i=3;for(;i<12;){const e=a.charCodeAt(t+i++);if(125===e){if(i<5||!u(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|O(e),r<0)break}throw(0,n.I)(e.source,t,`Invalid Unicode escape sequence: "${a.slice(t,t+i)}".`)}function R(e,t){const a=e.source.body,r=b(a,t+2);if(u(r))return{value:String.fromCodePoint(r),size:6};if(c(r)&&92===a.charCodeAt(t+6)&&117===a.charCodeAt(t+7)){const e=b(a,t+8);if(m(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,n.I)(e.source,t,`Invalid Unicode escape sequence: "${a.slice(t,t+6)}".`)}function b(e,t){return O(e.charCodeAt(t))<<12|O(e.charCodeAt(t+1))<<8|O(e.charCodeAt(t+2))<<4|O(e.charCodeAt(t+3))}function O(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function N(e,t){const a=e.source.body;switch(a.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,n.I)(e.source,t,`Invalid character escape sequence: "${a.slice(t,t+2)}".`)}function A(e,t){const a=e.source.body,r=a.length;let o=e.lineStart,p=t+3,l=p,c="";const m=[];for(;p<r;){const r=a.charCodeAt(p);if(34===r&&34===a.charCodeAt(p+1)&&34===a.charCodeAt(p+2)){c+=a.slice(l,p),m.push(c);const n=h(e,s.Y.BLOCK_STRING,t,p+3,(0,i.OC)(m).join("\n"));return e.line+=m.length-1,e.lineStart=o,n}if(92!==r||34!==a.charCodeAt(p+1)||34!==a.charCodeAt(p+2)||34!==a.charCodeAt(p+3))if(10!==r&&13!==r)if(u(r))++p;else{if(!d(a,p))throw(0,n.I)(e.source,p,`Invalid character within String: ${f(e,p)}.`);p+=2}else c+=a.slice(l,p),m.push(c),13===r&&10===a.charCodeAt(p+1)?p+=2:++p,c="",l=p,o=p;else c+=a.slice(l,p),l=p+1,p+=4}throw(0,n.I)(e.source,p,"Unterminated string.")}function S(e,t){const a=e.source.body,n=a.length;let r=t+1;for(;r<n;){const e=a.charCodeAt(r);if(!(0,o.xr)(e))break;++r}return h(e,s.Y.NAME,t,r,a.slice(t,r))}},8474:e=>{e.exports=t("node:events")},8498:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({Box:()=>i.Box,Text:()=>i.Text,render:()=>i.render,useApp:()=>i.useApp,useInput:()=>i.useInput})},8525:(e,t,a)=>{var n=a(9893);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},8549:(e,t,a)=>{var n=a(5608),r=a(9891),i=a(7029);t.o=function(e){return new r.ApolloLink(function(t,a){var r=n.__rest(t,[]);return new i.Observable(function(n){var i,o=!1;return Promise.resolve(r).then(function(a){return e(a,t.getContext())}).then(t.setContext).then(function(){o||(i=a(t).subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}))}).catch(n.error.bind(n)),function(){o=!0,i&&i.unsubscribe()}})})}},8558:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const a="maxItems"===e?"more":"fewer";return n.str`must NOT have ${a} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:a,schemaCode:r}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${a}.length ${i} ${r}`)}};t.default=r},8568:(e,t,a)=>{a.d(t,{Ay:()=>x});const n=(e=0)=>t=>`[${t+e}m`,r=(e=0)=>t=>`[${38+e};5;${t}m`,i=(e=0)=>(t,a,n)=>`[${38+e};2;${t};${a};${n}m`,o={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(o.modifier),Object.keys(o.color),Object.keys(o.bgColor);const s=function(){const e=new Map;for(const[t,a]of Object.entries(o)){for(const[t,n]of Object.entries(a))o[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},a[t]=o[t],e.set(n[0],n[1]);Object.defineProperty(o,t,{value:a,enumerable:!1})}return Object.defineProperty(o,"codes",{value:e,enumerable:!1}),o.color.close="",o.bgColor.close="",o.color.ansi=n(),o.color.ansi256=r(),o.color.ansi16m=i(),o.bgColor.ansi=n(10),o.bgColor.ansi256=r(10),o.bgColor.ansi16m=i(10),Object.defineProperties(o,{rgbToAnsi256:{value:(e,t,a)=>e===t&&t===a?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(a/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[a]=t;3===a.length&&(a=[...a].map(e=>e+e).join(""));const n=Number.parseInt(a,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>o.rgbToAnsi256(...o.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,a,n;if(e>=232)t=(10*(e-232)+8)/255,a=t,n=t;else{const r=(e-=16)%36;t=Math.floor(e/36)/5,a=Math.floor(r/6)/5,n=r%6/5}const r=2*Math.max(t,a,n);if(0===r)return 30;let i=30+(Math.round(n)<<2|Math.round(a)<<1|Math.round(t));return 2===r&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,a)=>o.ansi256ToAnsi(o.rgbToAnsi256(e,t,a)),enumerable:!1},hexToAnsi:{value:e=>o.ansi256ToAnsi(o.hexToAnsi256(e)),enumerable:!1}}),o}(),p=s;var l=a(1708),u=a(8161),d=a(7066);function c(e,t=(globalThis.Deno?globalThis.Deno.args:l.argv)){const a=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(a+e),r=t.indexOf("--");return-1!==n&&(-1===r||n<r)}const{env:m}=l;let f;function h(e,{streamIsTTY:t,sniffFlags:a=!0}={}){const n=function(){if("FORCE_COLOR"in m)return"true"===m.FORCE_COLOR?1:"false"===m.FORCE_COLOR?0:0===m.FORCE_COLOR.length?1:Math.min(Number.parseInt(m.FORCE_COLOR,10),3)}();void 0!==n&&(f=n);const r=a?f:n;if(0===r)return 0;if(a){if(c("color=16m")||c("color=full")||c("color=truecolor"))return 3;if(c("color=256"))return 2}if("TF_BUILD"in m&&"AGENT_NAME"in m)return 1;if(e&&!t&&void 0===r)return 0;const i=r||0;if("dumb"===m.TERM)return i;if("win32"===l.platform){const e=u.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in m)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in m)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in m)||"codeship"===m.CI_NAME?1:i;if("TEAMCITY_VERSION"in m)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m.TEAMCITY_VERSION)?1:0;if("truecolor"===m.COLORTERM)return 3;if("xterm-kitty"===m.TERM)return 3;if("xterm-ghostty"===m.TERM)return 3;if("wezterm"===m.TERM)return 3;if("TERM_PROGRAM"in m){const e=Number.parseInt((m.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m.TERM)||"COLORTERM"in m?1:i}function _(e,t={}){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(h(e,{streamIsTTY:e&&e.isTTY,...t}))}c("no-color")||c("no-colors")||c("color=false")||c("color=never")?f=0:(c("color")||c("colors")||c("color=true")||c("color=always"))&&(f=1);const y={stdout:_({isTTY:d.isatty(1)}),stderr:_({isTTY:d.isatty(2)})};function E(e,t,a){let n=e.indexOf(t);if(-1===n)return e;const r=t.length;let i=0,o="";do{o+=e.slice(i,n)+t+a,i=n+r,n=e.indexOf(t,i)}while(-1!==n);return o+=e.slice(i),o}const{stdout:T,stderr:g}=y,v=Symbol("GENERATOR"),R=Symbol("STYLER"),b=Symbol("IS_EMPTY"),O=["ansi","ansi","ansi256","ansi16m"],N=Object.create(null);const A=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const a=T?T.level:0;e.level=void 0===t.level?a:t.level})(t,e),Object.setPrototypeOf(t,S.prototype),t};function S(e){return A(e)}Object.setPrototypeOf(S.prototype,Function.prototype);for(const[e,t]of Object.entries(p))N[e]={get(){const a=P(this,D(t.open,t.close,this[R]),this[b]);return Object.defineProperty(this,e,{value:a}),a}};N.visible={get(){const e=P(this,this[R],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const w=(e,t,a,...n)=>"rgb"===e?"ansi16m"===t?p[a].ansi16m(...n):"ansi256"===t?p[a].ansi256(p.rgbToAnsi256(...n)):p[a].ansi(p.rgbToAnsi(...n)):"hex"===e?w("rgb",t,a,...p.hexToRgb(...n)):p[a][e](...n),I=["rgb","hex","ansi256"];for(const e of I){N[e]={get(){const{level:t}=this;return function(...a){const n=D(w(e,O[t],"color",...a),p.color.close,this[R]);return P(this,n,this[b])}}};N["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...a){const n=D(w(e,O[t],"bgColor",...a),p.bgColor.close,this[R]);return P(this,n,this[b])}}}}const C=Object.defineProperties(()=>{},{...N,level:{enumerable:!0,get(){return this[v].level},set(e){this[v].level=e}}}),D=(e,t,a)=>{let n,r;return void 0===a?(n=e,r=t):(n=a.openAll+e,r=t+a.closeAll),{open:e,close:t,openAll:n,closeAll:r,parent:a}},P=(e,t,a)=>{const n=(...e)=>j(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,C),n[v]=e,n[R]=t,n[b]=a,n},j=(e,t)=>{if(e.level<=0||!t)return e[b]?"":t;let a=e[R];if(void 0===a)return t;const{openAll:n,closeAll:r}=a;if(t.includes(""))for(;void 0!==a;)t=E(t,a.close,a.open),a=a.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,a,n){let r=0,i="";do{const o="\r"===e[n-1];i+=e.slice(r,o?n-1:n)+t+(o?"\r\n":"\n")+a,r=n+1,n=e.indexOf("\n",r)}while(-1!==n);return i+=e.slice(r),i}(t,r,n,i)),n+t+r};Object.defineProperties(S.prototype,N);const k=S(),x=(S({level:g?g.level:0}),k)},8572:(e,t,a)=>{const n=a(8474).EventEmitter,r=a(1421),i=a(6760),o=a(3024),s=a(1708),{Argument:p,humanReadableArgName:l}=a(1762),{CommanderError:u}=a(3823),{Help:d}=a(9690),{Option:c,DualOptions:m}=a(2088),{suggestSimilar:f}=a(6054);class h extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>s.stdout.write(e),writeErr:e=>s.stderr.write(e),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,a){let n=t,r=a;"object"==typeof n&&null!==n&&(r=n,n=null),r=r||{};const[,i,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(i);return n&&(s.description(n),s._executableHandler=!0),r.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!r.noHelp&&!r.hidden),s._executableFile=r.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),n?this:s}createCommand(e){return new h(e)}createHelp(){return Object.assign(new d,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new p(e,t)}argument(e,t,a,n){const r=this.createArgument(e,t);return"function"==typeof a?r.default(n).argParser(a):r.default(a),this.addArgument(r),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,this;e=e??"help [command]";const[,a,n]=e.match(/([^ ]+) *(.*)/),r=t??"display help for command",i=this.createCommand(a);return i.helpOption(!1),n&&i.arguments(n),r&&i.description(r),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,t){return"object"!=typeof e?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const a=["preSubcommand","preAction","postAction"];if(!a.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${a.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,a){this._exitCallback&&this._exitCallback(new u(e,t,a)),s.exit(e)}action(e){return this._actionHandler=t=>{const a=this.registeredArguments.length,n=t.slice(0,a);return this._storeOptionsAsProperties?n[a]=this:n[a]=this.opts(),n.push(this),e.apply(this,n)},this}createOption(e,t){return new c(e,t)}_callParseArg(e,t,a,n){try{return e.parseArg(t,a)}catch(e){if("commander.invalidArgument"===e.code){const t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const a=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${a}'\n- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const t=e=>[e.name()].concat(e.aliases()),a=t(e).find(e=>this._findCommand(e));if(a){const n=t(this._findCommand(a)).join("|"),r=t(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),a=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(a,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(a,e.defaultValue,"default");const n=(t,n,r)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(a);null!==t&&e.parseArg?t=this._callParseArg(e,t,i,n):null!==t&&e.variadic&&(t=e._concatValue(t,i)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(a,t,r)};return this.on("option:"+t,t=>{const a=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,a,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{const a=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,a,"env")}),this}_optionEx(e,t,a,n,r){if("object"==typeof t&&t instanceof c)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,a);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof n)i.default(r).argParser(n);else if(n instanceof RegExp){const e=n;n=(t,a)=>{const n=e.exec(t);return n?n[0]:a},i.default(r).argParser(n)}else i.default(n);return this.addOption(i)}option(e,t,a,n){return this._optionEx({},e,t,a,n)}requiredOption(e,t,a,n){return this._optionEx({mandatory:!0},e,t,a,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,a){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=a,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(a=>{void 0!==a.getOptionValueSource(e)&&(t=a.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){s.versions?.electron&&(t.from="electron");const e=s.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}let a;switch(void 0===e&&(e=s.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],a=e.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=e[1],a=e.slice(2)):a=e.slice(1);break;case"user":a=e.slice(0);break;case"eval":a=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",a}parse(e,t){const a=this._prepareUserArgs(e,t);return this._parseCommand([],a),this}async parseAsync(e,t){const a=this._prepareUserArgs(e,t);return await this._parseCommand([],a),this}_executeSubCommand(e,t){t=t.slice();let a=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function p(e,t){const a=i.resolve(e,t);if(o.existsSync(a))return a;if(n.includes(i.extname(t)))return;const r=n.find(e=>o.existsSync(`${a}${e}`));return r?`${a}${r}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l,d=e._executableFile||`${this._name}-${e._name}`,c=this._executableDir||"";if(this._scriptPath){let e;try{e=o.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}c=i.resolve(i.dirname(e),c)}if(c){let t=p(c,d);if(!t&&!e._executableFile&&this._scriptPath){const a=i.basename(this._scriptPath,i.extname(this._scriptPath));a!==this._name&&(t=p(c,`${a}-${e._name}`))}d=t||d}if(a=n.includes(i.extname(d)),"win32"!==s.platform?a?(t.unshift(d),t=_(s.execArgv).concat(t),l=r.spawn(s.argv[0],t,{stdio:"inherit"})):l=r.spawn(d,t,{stdio:"inherit"}):(t.unshift(d),t=_(s.execArgv).concat(t),l=r.spawn(s.execPath,t,{stdio:"inherit"})),!l.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{s.on(e,()=>{!1===l.killed&&null===l.exitCode&&l.kill(e)})})}const m=this._exitCallback;l.on("close",e=>{e=e??1,m?m(new u(e,"commander.executeSubCommandAsync","(close)")):s.exit(e)}),l.on("error",t=>{if("ENOENT"===t.code){const t=c?`searched for local subcommand relative to directory '${c}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${d}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(a)}if("EACCES"===t.code)throw new Error(`'${d}' not executable`);if(m){const e=new u(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,m(e)}else s.exit(1)}),this.runningCommand=l}_dispatchSubcommand(e,t,a){const n=this._findCommand(e);let r;return n||this.help({error:!0}),r=this._chainOrCallSubCommandHook(r,n,"preSubcommand"),r=this._chainOrCall(r,()=>{if(!n._executableHandler)return n._parseCommand(t,a);this._executeSubCommand(n,t.concat(a))}),r}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,a)=>{let n=t;if(null!==t&&e.parseArg){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;n=this._callParseArg(e,t,a,r)}return n};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((a,n)=>{let r=a.defaultValue;a.variadic?n<this.args.length?(r=this.args.slice(n),a.parseArg&&(r=r.reduce((t,n)=>e(a,n,t),a.defaultValue))):void 0===r&&(r=[]):n<this.args.length&&(r=this.args[n],a.parseArg&&(r=e(a,r,a.defaultValue))),t[n]=r}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let a=e;const n=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{n.push({hookedCommand:e,callback:t})})}),"postAction"===t&&n.reverse(),n.forEach(e=>{a=this._chainOrCall(a,()=>e.callback(e.hookedCommand,this))}),a}_chainOrCallSubCommandHook(e,t,a){let n=e;return void 0!==this._lifeCycleHooks[a]&&this._lifeCycleHooks[a].forEach(e=>{n=this._chainOrCall(n,()=>e(this,t))}),n}_parseCommand(e,t){const a=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(a.operands),t=a.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(a.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{a.unknown.length>0&&this.unknownOption(a.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){let a;return n(),this._processArguments(),a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(r,e,t)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent&&this.parent.listenerCount(r))n(),this._processArguments(),this.parent.emit(r,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{const a=e.find(e=>t.conflictsWith.includes(e.attributeName()));a&&this._conflictingOption(t,a)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],a=[];let n=t;const r=e.slice();function i(e){return e.length>1&&"-"===e[0]}let o=null;for(;r.length;){const e=r.shift();if("--"===e){n===a&&n.push(e),n.push(...r);break}if(!o||i(e)){if(o=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=r.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;r.length>0&&!i(r[0])&&(e=r.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),r.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),a=this._findOption(e.slice(0,t));if(a&&(a.required||a.optional)){this.emit(`option:${a.name()}`,e.slice(t+1));continue}}if(i(e)&&(n=a),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===a.length){if(this._findCommand(e)){t.push(e),r.length>0&&a.push(...r);break}if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e),r.length>0&&t.push(...r);break}if(this._defaultCommandName){a.push(e),r.length>0&&a.push(...r);break}}if(this._passThroughOptions){n.push(e),r.length>0&&n.push(...r);break}n.push(e)}else this.emit(`option:${o.name()}`,e)}return{operands:t,unknown:a}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let a=0;a<t;a++){const t=this.options[a].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const a=t||{},n=a.exitCode||1,r=a.code||"commander.error";this._exit(n,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in s.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,s.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new m(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(a=>void 0!==a.implied&&t(a.attributeName())&&e.valueFromOption(this.getOptionValue(a.attributeName()),a)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const a=e=>{const t=e.attributeName(),a=this.getOptionValue(t),n=this.options.find(e=>e.negate&&t===e.attributeName()),r=this.options.find(e=>!e.negate&&t===e.attributeName());return n&&(void 0===n.presetArg&&!1===a||void 0!==n.presetArg&&a===n.presetArg)?n:r||e},n=e=>{const t=a(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},r=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let a=[],n=this;do{const e=n.createHelp().visibleOptions(n).filter(e=>e.long).map(e=>e.long);a=a.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=f(e,a)}const a=`error: unknown option '${e}'${t}`;this.error(a,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,a=1===t?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${a} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const a=[];this.createHelp().visibleCommands(this).forEach(e=>{a.push(e.name()),e.alias()&&a.push(e.alias())}),t=f(e,a)}const a=`error: unknown command '${e}'${t}`;this.error(a,{code:"commander.unknownCommand"})}version(e,t,a){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",a=a||"output the version number";const n=this.createOption(t,a);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const a=this.parent?._findCommand(e);if(a){const t=[a.name()].concat(a.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>l(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let a;return a=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||a,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const a=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",a)),this.emit("beforeHelp",a);let n=this.helpInformation(a);if(t&&(n=t(n),"string"!=typeof n&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");a.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",a),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",a))}helpOption(e,t){return"boolean"==typeof e?(this._helpOption=e?this._helpOption??void 0:null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=s.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const a=["beforeAll","before","after","afterAll"];if(!a.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${a.join("', '")}'`);const n=`${e}Help`;return this.on(n,e=>{let a;a="function"==typeof t?t({error:e.error,command:e.command}):t,a&&e.write(`${a}\n`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function _(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,a,n="127.0.0.1",r="9229";return null!==(a=e.match(/^(--inspect(-brk)?)$/))?t=a[1]:null!==(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=a[1],/^\d+$/.test(a[3])?r=a[3]:n=a[3]):null!==(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=a[1],n=a[3],r=a[4]),t&&"0"!==r?`${t}=${n}:${parseInt(r)+1}`:e})}t.Command=h},8611:e=>{e.exports=t("http")},8662:e=>{e.exports=JSON.parse('{"name":"GeneratorMQTTBroker","brickDescription":{"default":"","en-us":"MQTT Broker server","zh-tw":"MQTT Broker 伺服器","ja-jp":"MQTT Broker サーバー"},"brickDisplayName":"MQTT Broker","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"server"},"propTypes":{"init":{"type":"bool"},"port":{"type":"number","isRequired":true},"retryInterval":{"type":"number"},"keepalive":{"type":"number"},"authenticate":{"type":"bool"},"authTable":{"type":"arrayOf","content":{"type":"shape","content":{"username":{"type":"string"},"password":{"type":"string"}},"forcePropertyBank":false},"forcePropertyBank":false}},"brickPropDescriptions":{"init":{"default":"","en-us":"Start MQTT broker on generator initialized","zh-tw":"Generator 初始化後直接啟動","ja-jp":"ジェネレータの初期化後に MQTT ブローカーを起動"},"port":{"default":"","en-us":"Bind port of MQTT server","zh-tw":"MQTT 伺服器連接埠","ja-jp":"MQTT サーバーのバインドポート"},"retryInterval":{"default":"","en-us":"Retry interval when publish failed","zh-tw":"當發布訊息失敗時的重試間隔","ja-jp":"公開に失敗した場合の再試行間隔"},"keepalive":{"default":"","en-us":"Keep-alive interval","zh-tw":"Keep-alive 間隔","ja-jp":"キープアライブ間隔"},"authenticate":{"default":"","en-us":"Enable authentication","zh-tw":"啟用身份驗證","ja-jp":"認証を有効にする"},"authTable":{"default":"","en-us":"Authentication table","zh-tw":"身份驗證表","ja-jp":"認証テーブル"}},"defaultBrickProps":{"init":false,"port":1883,"retryInterval":5,"keepalive":60,"authenticate":false},"propertyControls":{"port":{"required":true},"retryInterval":{"kind":"unit","min":1,"unit":"s"},"keepalive":{"kind":"unit","min":1,"unit":"s"}},"outletTypes":{"GENERATOR_MQTT_BROKER_STARTED":{"outlet":"GENERATOR_MQTT_BROKER_STARTED","type":"bool"},"GENERATOR_MQTT_BROKER_LAST_MESSAGE":{"outlet":"GENERATOR_MQTT_BROKER_LAST_MESSAGE","type":"object"},"GENERATOR_MQTT_BROKER_ERROR_MESSAGE":{"outlet":"GENERATOR_MQTT_BROKER_ERROR_MESSAGE","type":"string"}},"brickOutletDescriptions":{"GENERATOR_MQTT_BROKER_STARTED":{"default":"","en-us":"Is server started","zh-tw":"伺服器啟動狀態","ja-jp":"サーバーが起動しているか"},"GENERATOR_MQTT_BROKER_LAST_MESSAGE":{"default":"","en-us":"Last received message","zh-tw":"最後收到的訊息","ja-jp":"最後に受信したメッセージ"},"GENERATOR_MQTT_BROKER_ERROR_MESSAGE":{"default":"","en-us":"Error message","zh-tw":"錯誤訊息","ja-jp":"エラーメッセージ"}},"eventTypes":{"GENERATOR_MQTT_BROKER_ON_READY":"GENERATOR_MQTT_BROKER_ON_READY","GENERATOR_MQTT_BROKER_ON_ERROR":"GENERATOR_MQTT_BROKER_ON_ERROR","GENERATOR_MQTT_BROKER_ON_CLIENT_CONNECTED":"GENERATOR_MQTT_BROKER_ON_CLIENT_CONNECTED","GENERATOR_MQTT_BROKER_ON_CLIENT_DISCONNECTED":"GENERATOR_MQTT_BROKER_ON_CLIENT_DISCONNECTED","GENERATOR_MQTT_BROKER_ON_MESSAGE_RECEIVED":"GENERATOR_MQTT_BROKER_ON_MESSAGE_RECEIVED","GENERATOR_MQTT_BROKER_ON_MESSAGE_PUBLISHED":"GENERATOR_MQTT_BROKER_ON_MESSAGE_PUBLISHED"},"brickEventDescriptions":{"GENERATOR_MQTT_BROKER_ON_READY":{"default":"","en-us":"Event of MQTT server is ready","zh-tw":"當 MQTT 伺服器啟動完成時觸發事件","ja-jp":"MQTT サーバーの準備完了時のイベント"},"GENERATOR_MQTT_BROKER_ON_ERROR":{"default":"","en-us":"Event of server or connection error","zh-tw":"當伺服器或連線發生錯誤時觸發事件","ja-jp":"サーバーまたは接続エラー時のイベント"},"GENERATOR_MQTT_BROKER_ON_CLIENT_CONNECTED":{"default":"","en-us":"Event of client connected","zh-tw":"當有客戶端連線時觸發事件","ja-jp":"クライアント接続時のイベント"},"GENERATOR_MQTT_BROKER_ON_CLIENT_DISCONNECTED":{"default":"","en-us":"Event of client disconnected","zh-tw":"當有客戶端斷線時觸發事件","ja-jp":"クライアント切断時のイベント"},"GENERATOR_MQTT_BROKER_ON_MESSAGE_RECEIVED":{"default":"","en-us":"Event of message received","zh-tw":"當收到訊息時觸發事件","ja-jp":"メッセージ受信時のイベント"},"GENERATOR_MQTT_BROKER_ON_MESSAGE_PUBLISHED":{"default":"","en-us":"Event of message published","zh-tw":"當訊息發佈時觸發事件","ja-jp":"メッセージ公開時のイベント"}},"eventPropertyControls":{"GENERATOR_MQTT_BROKER_ON_ERROR":{"properties":{"GENERATOR_MQTT_BROKER_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MQTT_BROKER_ON_CLIENT_CONNECTED":{"properties":{"GENERATOR_MQTT_BROKER_CLIENT_ID":{"name":"Client ID","type":"string"}}},"GENERATOR_MQTT_BROKER_ON_CLIENT_DISCONNECTED":{"properties":{"GENERATOR_MQTT_BROKER_CLIENT_ID":{"name":"Client ID","type":"string"}}},"GENERATOR_MQTT_BROKER_ON_MESSAGE_RECEIVED":{"properties":{"GENERATOR_MQTT_BROKER_TOPIC":{"name":"Topic","type":"string"},"GENERATOR_MQTT_BROKER_PAYLOAD":{"name":"Payload","type":"string"}}},"GENERATOR_MQTT_BROKER_ON_MESSAGE_PUBLISHED":{"properties":{"GENERATOR_MQTT_BROKER_CLIENT_ID":{"name":"Client ID","type":"string"},"GENERATOR_MQTT_BROKER_MESSAGE_ID":{"name":"Message ID","type":"number"}}}},"actionTypes":{"GENERATOR_MQTT_BROKER_START":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_MQTT_BROKER_PUBLISH":{"disallowMultiple":false,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MQTT_BROKER_TOPIC":{"name":"Topic","type":"string"},"GENERATOR_MQTT_BROKER_PAYLOAD":{"name":"Payload","type":"string"},"GENERATOR_MQTT_BROKER_MESSAGE_ID":{"name":"Message ID","type":"number"}}},"GENERATOR_MQTT_BROKER_STOP":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_MQTT_BROKER_START":{"default":"","en-us":"Start MQTT broker server","zh-tw":"啟動 MQTT 伺服器","ja-jp":"MQTT ブローカーサーバーを起動"},"GENERATOR_MQTT_BROKER_PUBLISH":{"default":"","en-us":"Publish message to topic","zh-tw":"發佈訊息到指定主題","ja-jp":"指定トピックにメッセージを公開"},"GENERATOR_MQTT_BROKER_STOP":{"default":"","en-us":"Stop MQTT broker server","zh-tw":"停止 MQTT 伺服器","ja-jp":"MQTT ブローカーサーバーを停止"}}}')},8678:(e,t,a)=>{a.d(t,{y:()=>p});var n,r=a(2704),i=a(5078),o=a(555),s=a(4114),p=Object.assign(function(e){var t=n.get(e);return t||(t=(0,r.y)(e),n.set(e,t)),t},{reset:function(){n=new i.A(o.v.print||2e3)}});p.reset(),!1!==globalThis.__DEV__&&(0,s.D_)("print",function(){return n?n.size:0})},8706:(e,t,a)=>{const n=a(8323);t.implementation=class{constructor(e){const t=e[0],a=e[1];let r=null;if(void 0!==a&&(r=n.basicURLParse(a),"failure"===r))throw new TypeError("Invalid base URL");const i=n.basicURLParse(t,{baseURL:r});if("failure"===i)throw new TypeError("Invalid URL");this._url=i}get href(){return n.serializeURL(this._url)}set href(e){const t=n.basicURLParse(e);if("failure"===t)throw new TypeError("Invalid URL");this._url=t}get origin(){return n.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(e){n.basicURLParse(e+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){n.cannotHaveAUsernamePasswordPort(this._url)||n.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){n.cannotHaveAUsernamePasswordPort(this._url)||n.setThePassword(this._url,e)}get host(){const e=this._url;return null===e.host?"":null===e.port?n.serializeHost(e.host):n.serializeHost(e.host)+":"+n.serializeInteger(e.port)}set host(e){this._url.cannotBeABaseURL||n.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":n.serializeHost(this._url.host)}set hostname(e){this._url.cannotBeABaseURL||n.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":n.serializeInteger(this._url.port)}set port(e){n.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:n.basicURLParse(e,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(e){this._url.cannotBeABaseURL||(this._url.path=[],n.basicURLParse(e,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(e){const t=this._url;if(""===e)return void(t.query=null);const a="?"===e[0]?e.substring(1):e;t.query="",n.basicURLParse(a,{url:t,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(e){if(""===e)return void(this._url.fragment=null);const t="#"===e[0]?e.substring(1):e;this._url.fragment="",n.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},8709:(e,t,a)=>{a.d(t,{U:()=>T,y:()=>v});var n=a(5608),r=a(9212),i=a(5888),o=a(5950),s=a(3673),p=a(3777),l=a(234),u=a(906),d=a(7613),c=a(5892),m=a(492),f=a(3570),h=a(5427),_=a(7634),y=Object.assign,E=Object.hasOwnProperty,T=function(e){function t(a){var r=a.queryManager,i=a.queryInfo,o=a.options,s=this,l=t.inactiveOnCreation.getValue();(s=e.call(this,function(e){l&&(r.queries.set(s.queryId,i),l=!1);try{var t=e._subscription._observer;t&&!t.error&&(t.error=g)}catch(e){}var a=!s.observers.size;s.observers.add(e);var n=s.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(s.maskResult(n.result)),a&&s.reobserve().catch(function(){}),function(){s.observers.delete(e)&&!s.observers.size&&s.tearDownQuery()}})||this).observers=new Set,s.subscriptions=new Set,s.dirty=!1,s.queryInfo=i,s.queryManager=r,s.waitForOwnResult=R(o.fetchPolicy),s.isTornDown=!1,s.subscribeToMore=s.subscribeToMore.bind(s),s.maskResult=s.maskResult.bind(s);var u=r.defaultOptions.watchQuery,d=(void 0===u?{}:u).fetchPolicy,c=void 0===d?"cache-first":d,m=o.fetchPolicy,f=void 0===m?c:m,h=o.initialFetchPolicy,_=void 0===h?"standby"===f?c:f:h;s.options=(0,n.__assign)((0,n.__assign)({},o),{initialFetchPolicy:_,fetchPolicy:f}),s.queryId=i.queryId||r.generateQueryId();var y=(0,p.Vu)(s.query);return s.queryName=y&&y.name&&y.name.value,s}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise(function(t,a){var n={next:function(a){t(a),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){r.unsubscribe()},0)},error:a},r=e.subscribe(n)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentFullResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),a=this.queryInfo.networkStatus||t&&t.networkStatus||o.pT.ready,r=(0,n.__assign)((0,n.__assign)({},t),{loading:(0,o.bi)(a),networkStatus:a}),s=this.options.fetchPolicy,p=void 0===s?"cache-first":s;if(R(p)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(r.data=l.result),(0,i.equal)(r.data,{})&&(r.data=void 0),l.complete?(delete r.partial,!l.complete||r.networkStatus!==o.pT.loading||"cache-first"!==p&&"cache-only"!==p||(r.networkStatus=o.pT.ready,r.loading=!1)):r.partial=!0,r.networkStatus===o.pT.ready&&(r.error||r.errors)&&(r.networkStatus=o.pT.error),!1===globalThis.__DEV__||l.complete||this.options.partialRefetch||r.loading||r.data||r.error||v(l.missing)}return e&&this.updateLastResult(r),r},t.prototype.getCurrentResult=function(e){return void 0===e&&(e=!0),this.maskResult(this.getCurrentFullResult(e))},t.prototype.isDifferentFromLastResult=function(e,t){if(!this.last)return!0;var a=this.queryManager.getDocumentInfo(this.query),n=this.queryManager.dataMasking,r=n?a.nonReactiveQuery:this.query;return(n||a.hasNonreactiveDirective?!(0,h.a)(r,this.last.result,e,this.variables):!(0,i.equal)(this.last.result,e))||t&&!(0,i.equal)(this.last.variables,t)},t.prototype.getLast=function(e,t){var a=this.last;if(a&&a[e]&&(!t||(0,i.equal)(a.variables,this.variables)))return a[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,a={pollInterval:0},s=this.options.fetchPolicy;if(a.fetchPolicy="no-cache"===s?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&E.call(e,"variables")){var l=(0,p.AT)(this.query),u=l.variableDefinitions;u&&u.some(function(e){return"variables"===e.variable.name.value})||!1!==globalThis.__DEV__&&r.invariant.warn(21,e,(null===(t=l.name)||void 0===t?void 0:t.value)||l)}return e&&!(0,i.equal)(this.options.variables,e)&&(a.variables=this.options.variables=(0,n.__assign)((0,n.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(a,o.pT.refetch)},t.prototype.fetchMore=function(e){var t=this,a=(0,n.__assign)((0,n.__assign)({},e.query?e:(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.options),{query:this.options.query}),e),{variables:(0,n.__assign)((0,n.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});a.query=this.transformDocument(a.query);var i=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):a.query;var s=this.queryInfo,p=s.networkStatus;s.networkStatus=o.pT.fetchMore,a.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=null==e?void 0:e.updateQuery,d="no-cache"!==this.options.fetchPolicy;return d||(0,r.invariant)(u,22),this.queryManager.fetchQuery(i,a,o.pT.fetchMore).then(function(r){if(t.queryManager.removeQuery(i),s.networkStatus===o.pT.fetchMore&&(s.networkStatus=p),d)t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},function(e){return i(e,{fetchMoreResult:r.data,variables:a.variables})}):n.writeQuery({query:a.query,variables:a.variables,data:r.data})},onWatchUpdated:function(e){l.add(e.query)}});else{var c=t.getLast("result"),m=u(c.data,{fetchMoreResult:r.data,variables:a.variables});t.reportResult((0,n.__assign)((0,n.__assign)({},c),{networkStatus:p,loading:(0,o.bi)(p),data:m}),t.variables)}return t.maskResult(r)}).finally(function(){d&&!l.has(t.query)&&t.reobserveCacheFirst()})},t.prototype.subscribeToMore=function(e){var t=this,a=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(a){var r=e.updateQuery;r&&t.updateQuery(function(e,t){return r(e,(0,n.__assign)({subscriptionData:a},t))})},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&r.invariant.error(23,t)}});return this.subscriptions.add(a),function(){t.subscriptions.delete(a)&&a.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=(0,m.o)(this.options,e||{});y(this.options,t)},t.prototype.setVariables=function(e){return(0,i.equal)(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},o.pT.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,a=t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),n=a.result,r=a.complete,i=e(n,{variables:this.variables,complete:!!r,previousData:n});i&&(t.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var a=t.fetchPolicy,n=void 0===a?"cache-first":a,r=t.initialFetchPolicy,i=void 0===r?n:r;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:i}):t.fetchPolicy="variables-changed"===e?i:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,a){var n=this.queryManager.getOrCreateQuery(this.queryId);return n.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(n,e,t,a)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,a=this.options.pollInterval;if(a&&this.hasObservers()){if(!t||t.interval!==a){(0,r.invariant)(a,24),(t||(this.pollingInfo={})).interval=a;var n=function(){var t,a;e.pollingInfo&&((0,o.bi)(e.queryInfo.networkStatus)||(null===(a=(t=e.options).skipPollAttempt)||void 0===a?void 0:a.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},o.pT.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var a=this.getLastError();return a&&this.last&&!(0,i.equal)(t,this.last.variables)&&(a=void 0),this.last=(0,n.__assign)({result:this.queryManager.assumeImmutableResults?e:(0,u.m)(e),variables:t},a?{error:a}:null)},t.prototype.reobserveAsConcast=function(e,t){var a=this;this.isTornDown=!1;var r=t===o.pT.refetch||t===o.pT.fetchMore||t===o.pT.poll,s=this.options.variables,p=this.options.fetchPolicy,l=(0,m.o)(this.options,e||{}),u=r?l:y(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,r||(this.updatePolling(),!e||!e.variables||(0,i.equal)(e.variables,s)||"standby"===u.fetchPolicy||u.fetchPolicy!==p&&"function"!=typeof u.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=o.pT.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=R(u.fetchPolicy));var c=function(){a.concast===E&&(a.waitForOwnResult=!1)},h=u.variables&&(0,n.__assign)({},u.variables),_=this.fetch(u,t,d),E=_.concast,T=_.fromLink,g={next:function(e){(0,i.equal)(a.variables,h)&&(c(),a.reportResult(e,h))},error:function(e){(0,i.equal)(a.variables,h)&&((0,f.isApolloError)(e)||(e=new f.ApolloError({networkError:e})),c(),a.reportError(e,h))}};return r||!T&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=E,this.observer=g),E.addObserver(g),E},t.prototype.reobserve=function(e,t){return(0,l.X)(this.reobserveAsConcast(e,t).promise.then(this.maskResult))},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var a=this.last;this.resetLastResults();var n=this.subscribe.apply(this,e);return this.last=a,n},t.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var a=this.getLastError(),n=this.isDifferentFromLastResult(e,t);(a||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(a||n)&&(0,d.w)(this.observers,"next",this.maskResult(e))},t.prototype.reportError=function(e,t){var a=(0,n.__assign)((0,n.__assign)({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:o.pT.error,loading:!1});this.updateLastResult(a,t),(0,d.w)(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t.prototype.maskResult=function(e){return e&&"data"in e?(0,n.__assign)((0,n.__assign)({},e),{data:this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):e},t.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},t.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},t.prototype.scheduleNotify=function(){var e=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return e.notify()},0)))},t.prototype.notify=function(){(this.cancelNotifyTimeout(),this.dirty)&&("cache-only"!=this.options.fetchPolicy&&"cache-and-network"!=this.options.fetchPolicy&&(0,o.bi)(this.queryInfo.networkStatus)||(this.queryInfo.getDiff().fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()));this.dirty=!1},t.prototype.reobserveCacheFirst=function(){var e=this.options,t=e.fetchPolicy,a=e.nextFetchPolicy;return"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,n){return this.nextFetchPolicy=a,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,n):t}}):this.reobserve()},t.inactiveOnCreation=new _.Slot,t}(s.c);function g(e){!1!==globalThis.__DEV__&&r.invariant.error(25,e.message,e.stack)}function v(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&r.invariant.debug(26,e)}function R(e){return"network-only"===e||"no-cache"===e||"standby"===e}(0,c.r)(T)},8752:e=>{e.exports=JSON.parse('{"name":"GeneratorTick","brickDescription":{"default":"Execute event in countdown manner","en-us":"Execute event in countdown manner","zh-tw":"以倒數計時的方式執行事件","ja-jp":"カウントダウン方式でイベントを実行"},"brickDisplayName":"Tick","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"clock"},"propTypes":{"init":{"type":"bool"},"interval":{"type":"number"},"countdownStartValue":{"type":"number"},"countdownInterval":{"type":"number"},"repeat":{"type":"bool"},"map":{"type":"object"},"mapFallback":{"type":"any"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Start tick on generator initialized","zh-tw":"Generator 初始化後直接開始執行事件","ja-jp":"ジェネレータの初期化時にティックを開始"},"interval":{"default":"","en-us":"Interval of second for countdown","zh-tw":"每次間隔變動的時間(秒)","ja-jp":"カウントダウンの秒間隔"},"countdownStartValue":{"default":"","en-us":"Initial value of countdown","zh-tw":"倒數的起始值","ja-jp":"カウントダウンの初期値"},"countdownInterval":{"default":"","en-us":"Interval of value for countdown","zh-tw":"每次間隔變動的數值","ja-jp":"カウントダウンの値の間隔"},"repeat":{"default":"","en-us":"Make countdown repeatable","zh-tw":"是否在倒數完畢後重新開始","ja-jp":"カウントダウンを繰り返し可能にする"},"map":{"default":"","en-us":"Map for PROPERTY_BANK_RESULT","zh-tw":"PROPERTY_BANK_RESULT 對應的轉換表","ja-jp":"PROPERTY_BANK_RESULTのマッピング"},"mapFallback":{"default":"","en-us":"Fallback of MAP_OBJECT","zh-tw":"MAP_OBJECT 的預設回傳值","ja-jp":"MAP_OBJECTのフォールバック"}},"propertyControls":{"interval":{"kind":"unit","min":0,"unit":"ms"},"countdownStartValue":{"kind":"unit","min":0,"required":true},"countdownInterval":{"kind":"unit","min":0}},"outletTypes":{"GENERATOR_TICK_COUNTDOWN":{"outlet":"GENERATOR_TICK_COUNTDOWN","oneOfType":["string","number"]},"GENERATOR_TICK_RUNNING":{"outlet":"GENERATOR_TICK_RUNNING","oneOfType":["bool","string","number"]}},"brickOutletDescriptions":{"GENERATOR_TICK_COUNTDOWN":{"default":"","en-us":"Countdown step value","zh-tw":"倒數的變數值","ja-jp":"カウントダウンステップ値"},"GENERATOR_TICK_RUNNING":{"default":"","en-us":"Is tick running?","zh-tw":"Tick 是否運作中","ja-jp":"ティックは実行中か"}},"defaultBrickProps":{},"eventTypes":{"GENERATOR_TICK_TICKING":"GENERATOR_TICK_TICKING","GENERATOR_TICK_COMPLETED":"GENERATOR_TICK_COMPLETED"},"brickEventDescriptions":{"GENERATOR_TICK_TICKING":{"default":"","en-us":"Event for each tick start","zh-tw":"每次倒數觸發的事件","ja-jp":"ティック開始時のイベント"},"GENERATOR_TICK_COMPLETED":{"default":"","en-us":"Event for tick completed","zh-tw":"當 Tick 完成時觸發的事件","ja-jp":"ティック完了時のイベント"}},"eventPropertyControls":{"GENERATOR_TICK_TICKING":{"properties":{"GENERATOR_TICK_COUNTDOWN":{"name":"Countdown","type":"number"},"GENERATOR_TICK_VALUE":{"name":"Value","type":"any"}}},"GENERATOR_TICK_COMPLETED":{"properties":{"GENERATOR_TICK_COUNTDOWN":{"name":"Countdown","type":"number"},"GENERATOR_TICK_VALUE":{"name":"Value","type":"any"}}}},"actionTypes":{"GENERATOR_TICK":{"canProvideProperty":false},"GENERATOR_TICK_CANCEL":{"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_TICK":{"default":"","en-us":"Start the tick","zh-tw":"開始倒數","ja-jp":"ティックを開始"},"GENERATOR_TICK_CANCEL":{"default":"","en-us":"Cancel the tick","zh-tw":"取消倒數","ja-jp":"ティックをキャンセル"}}}')},8765:(e,a,n)=>{n.d(a,{clearConfig:()=>v,default:()=>R,getBaseUrl:()=>l,getCurrentProfile:()=>E,getToken:()=>c,getTokenInfo:()=>m,getTokens:()=>d,listProfiles:()=>g,removeToken:()=>h,setBaseUrl:()=>u,setCurrentProfile:()=>T,setProfileOverride:()=>y,setToken:()=>f}),n.r(a);var r=n(6928);const i=t("os");var s=r.join(i.homedir(),".bricks-cli"),p=new o({projectName:"bricks-cli",cwd:s,schema:{tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},createdAt:{type:"string"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"}}}),l=()=>p.get("baseUrl"),u=e=>p.set("baseUrl",e),d=()=>p.get("tokens"),c=(e="default")=>{var t=p.get("tokens");return t[e]?.token},m=(e="default")=>p.get("tokens")[e],f=(e,t)=>{var a=p.get("tokens");a[e]={...t,createdAt:(new Date).toISOString()},p.set("tokens",a)},h=e=>{var t=p.get("tokens");delete t[e],p.set("tokens",t)},_=null,y=e=>{_=e},E=()=>_||process.env.BRICKS_PROFILE||p.get("currentProfile"),T=e=>p.set("currentProfile",e),g=()=>{var e=p.get("tokens"),t=p.get("currentProfile");return Object.keys(e).map(a=>({...e[a],name:a,current:a===t}))},v=()=>{p.clear()};const R=p},8768:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r=a(458),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:a,parentSchema:i,it:o}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");if(o.opts.discriminator&&i.discriminator)return;const s=a,p=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block(function(){s.forEach((a,i)=>{let s;(0,r.alwaysValidSchema)(o,a)?t.var(u,!0):s=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(n._`${u} && ${p}`).assign(p,!1).assign(l,n._`[${l}, ${i}]`).else(),t.if(u,()=>{t.assign(p,!0),t.assign(l,i),s&&e.mergeEvaluated(s,n.Name)})})}),e.result(p,()=>e.reset(),()=>e.error(!0))}};t.default=i},8792:e=>{e.exports=function e(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var n,r,i;if(Array.isArray(t)){if((n=t.length)!=a.length)return!1;for(r=n;0!==r--;)if(!e(t[r],a[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(a,i[r]))return!1;for(r=n;0!==r--;){var o=i[r];if(!e(t[o],a[o]))return!1}return!0}return t!=t&&a!=a}},8802:e=>{e.exports=JSON.parse('{"name":"GeneratorMCPServer","brickDescription":{"default":"Model Context Protocol (MCP) Server","en-us":"Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp)","zh-tw":"MCP 伺服器(https://docs.anthropic.com/zh-TW/docs/agents-and-tools/mcp)","ja-jp":"Model Context Protocol (MCP) サーバー(https://docs.anthropic.com/ja/docs/agents-and-tools/mcp)"},"brickDisplayName":"MCP Server","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"server"},"brickMeta":{"canBeGlobalGenerator":true},"propTypes":{"enabled":{"type":"bool"},"globalGeneratorKey":{"type":"string"},"listening":{"type":"bool"},"port":{"type":"number"},"authType":{"type":"oneOf","content":["none","bearer"],"forcePropertyBank":false},"bearerToken":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"},"resources":{"type":"arrayOf","content":{"type":"shape","content":{"enabled":{"type":"bool"},"name":{"type":"string"},"description":{"type":"string"},"uriOrTemplate":{"type":"string"},"type":{"type":"oneOf","content":["static","detect-data-change","script"],"forcePropertyBank":false},"staticData":{"type":"any"},"dataChangeConfig":{"type":"shape","content":{"target":{"type":"string"},"timeout":{"type":"number"},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"scriptConfig":{"type":"shape","content":{"code":{"type":"string"},"timeout":{"type":"number"},"members":{"type":"arrayOf","content":{"type":"shape","content":{"handler":{"type":"string"},"varName":{"type":"string"}},"forcePropertyBank":false},"forcePropertyBank":false},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"responseType":{"type":"oneOf","content":["text","object"],"forcePropertyBank":false}},"forcePropertyBank":false},"forcePropertyBank":false},"tools":{"type":"arrayOf","content":{"type":"shape","content":{"enabled":{"type":"bool"},"name":{"type":"string"},"description":{"type":"string"},"params":{"type":"object"},"type":{"type":"oneOf","content":["static","detect-data-change","script"],"forcePropertyBank":false},"staticData":{"type":"any"},"dataChangeConfig":{"type":"shape","content":{"target":{"type":"string"},"timeout":{"type":"number"},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"scriptConfig":{"type":"shape","content":{"code":{"type":"string"},"timeout":{"type":"number"},"members":{"type":"arrayOf","content":{"type":"shape","content":{"handler":{"type":"string"},"varName":{"type":"string"}},"forcePropertyBank":false},"forcePropertyBank":false},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"responseType":{"type":"oneOf","content":["text","object"],"forcePropertyBank":false}},"forcePropertyBank":false},"forcePropertyBank":false},"prompts":{"type":"arrayOf","content":{"type":"shape","content":{"enabled":{"type":"bool"},"name":{"type":"string"},"description":{"type":"string"},"arguments":{"type":"object"},"type":{"type":"oneOf","content":["static","detect-data-change","script"],"forcePropertyBank":false},"staticData":{"type":"any"},"dataChangeConfig":{"type":"shape","content":{"target":{"type":"string"},"timeout":{"type":"number"},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"scriptConfig":{"type":"shape","content":{"code":{"type":"string"},"timeout":{"type":"number"},"members":{"type":"arrayOf","content":{"type":"shape","content":{"handler":{"type":"string"},"varName":{"type":"string"}},"forcePropertyBank":false},"forcePropertyBank":false},"additionalParams":{"type":"object"}},"forcePropertyBank":false},"responseType":{"type":"oneOf","content":["text","object"],"forcePropertyBank":false}},"forcePropertyBank":false},"forcePropertyBank":false}},"brickPropDescriptions":{"enabled":{"default":"","en-us":"Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources.","zh-tw":"啟用 MCP 伺服器。如果啟用且 Listening 為 false,generator 仍然可以提供應用程式範圍的資源。","ja-jp":"MCP サーバーを有効にします。有効で Listening が false の場合でも、ジェネレーターはアプリケーションスコープのリソースを提供できます。"},"globalGeneratorKey":{"default":"","en-us":"Application-scoped generator key, key cannot be the same with other application-scoped generators","zh-tw":"應用程式範圍的 generator key,key 不能與其他應用程式範圍的 generator 相同","ja-jp":"アプリケーションスコープのジェネレーターキー、キーは他のアプリケーションスコープのジェネレーターと同じにできません"},"listening":{"default":"","en-us":"Start MCP server","zh-tw":"Generator 開始執行 MCP 伺服器","ja-jp":"MCP サーバーを起動する"},"port":{"default":"","en-us":"HTTP server port","zh-tw":"HTTP 伺服器連接埠","ja-jp":"HTTP サーバーポート"},"authType":{"default":"","en-us":"Authorization type of HTTP request","zh-tw":"HTTP 認證方式","ja-jp":"HTTP リクエストの認証タイプ"},"bearerToken":{"default":"","en-us":"Token of bearer auth","zh-tw":"Bearer 認證 token","ja-jp":"Bearer 認証のトークン"},"name":{"default":"","en-us":"Name of the MCP server","zh-tw":"MCP 伺服器名稱","ja-jp":"MCP サーバーの名前"},"version":{"default":"","en-us":"Version of the MCP server","zh-tw":"MCP 伺服器版本","ja-jp":"MCP サーバーのバージョン"},"resources":{"default":"","en-us":"Resources \\n Type: \\n `static`: Return static data \\n `detect-data-change`: Watch data target change to return data, \\n please update data with ({ id: string, content: string | object }), \\n and ensure the id is same with request id \\n `script`: Run a JavaScript code to return data \\n - Script can define members to call generator functions \\n - Script support async/await","zh-tw":"資源 \\n Type: \\n `static`: 返回靜態資料 \\n `detect-data-change`: 監控資料目標變更以返回資料, \\n 請更新資料為 ({ id: string, content: string | object }), \\n 並請確保 id 與請求 id 相同 \\n `script`: 執行 JavaScript 程式碼以返回資料 \\n - 腳本可以定義成員來調用 Generator 函數 \\n - 腳本支持 async/await","ja-jp":"リソース \\n タイプ: \\n `static`: 静的データを返す \\n `detect-data-change`: データターゲットの変更を監視してデータを返す, \\n データを ({ id: string, content: string | object }) で更新し, \\n id がリクエスト id と同じであることを確認してください \\n `script`: JavaScript 程式碼を実行して資料を返す \\n - スクリプトは Generator 関数を呼び出すメンバーを定義できます \\n - スクリプトは async/await をサポートします"},"tools":{"default":"","en-us":"Tools \\n Type: \\n `static`: Return static data \\n `detect-data-change`: Watch data target change to return data, \\n please update data with ({ id: string, content: string | object }), \\n and ensure the id is same with request id. \\n `script`: Run a JavaScript code to return data \\n - Script can define members to call generator functions \\n - Script support async/await","zh-tw":"工具 \\n Type: \\n `static`: 返回靜態資料 \\n `detect-data-change`: 監控資料目標變更以返回資料, \\n 請更新資料為 ({ id: string, content: string | object }), \\n 並請確保 id 與請求 id 相同。 \\n `script`: 執行 JavaScript 程式碼以返回資料 \\n - 腳本可以定義成員來調用 Generator 函數 \\n - 腳本支持 async/await","ja-jp":"ツール \\n タイプ: \\n `static`: 静的データを返す \\n `detect-data-change`: データターゲットの変更を監視してデータを返す, \\n データを ({ id: string, content: string | object }) で更新し, \\n id がリクエスト id と同じであることを確認してください。 \\n `script`: JavaScript 程式碼を実行して資料を返す \\n - スクリプトは Generator 関数を呼び出すメンバーを定義できます \\n - スクリプトは async/await をサポートします"},"prompts":{"default":"","en-us":"Prompts \\n Type: \\n `static`: Return static data \\n `detect-data-change`: Watch data target change to return data, \\n please update data with ({ id: string, content: string | object }), \\n and ensure the id is same with request id \\n `script`: Run a JavaScript code to return data \\n - Script can define members to call generator functions \\n - Script support async/await","zh-tw":"提示 \\n Type: \\n `static`: 返回靜態資料 \\n `detect-data-change`: 監控資料目標變更以返回資料, \\n 請更新資料為 ({ id: string, content: string | object }), \\n 並請確保 id 與請求 id 相同 \\n `script`: 執行 JavaScript 程式碼以返回資料 \\n - 腳本可以定義成員來調用 Generator 函數 \\n - 腳本支持 async/await","ja-jp":"プロンプト \\n タイプ: \\n `static`: 静的データを返す \\n `detect-data-change`: データターゲットの変更を監視してデータを返す, \\n データを ({ id: string, content: string | object }) で更新し, \\n id がリクエスト id と同じであることを確認してください \\n `script`: JavaScript 程式碼を実行して資料を返す \\n - スクリプトは Generator 関数を呼び出すメンバーを定義できます \\n - スクリプトは async/await をサポートします"}},"propertyControls":{"resources":{"extendSchema":{"properties":{"dataChangeConfig":{"type":"object","properties":{"target":{"type":"string","kind":"id","idType":"property_bank"},"timeout":{"type":"number"},"payload":{"type":"any"}}},"scriptConfig":{"type":"object","properties":{"members":{"type":"array","properties":{"handler":{"type":"string","kind":"id","idType":"generator"}}}}}}},"kind":"mcp-server-resources"},"tools":{"extendSchema":{"properties":{"dataChangeConfig":{"type":"object","properties":{"target":{"type":"string","kind":"id","idType":"property_bank"},"timeout":{"type":"number"},"payload":{"type":"any"}}},"scriptConfig":{"type":"object","properties":{"members":{"type":"array","properties":{"handler":{"type":"string","kind":"id","idType":"generator"}}}}}}},"kind":"mcp-server-tools"},"prompts":{"extendSchema":{"properties":{"dataChangeConfig":{"type":"object","properties":{"target":{"type":"string","kind":"id","idType":"property_bank"},"timeout":{"type":"number"},"payload":{"type":"any"}}},"scriptConfig":{"type":"object","properties":{"members":{"type":"array","properties":{"handler":{"type":"string","kind":"id","idType":"generator"}}}}}}},"kind":"mcp-server-prompts"},"authType":{"oneOfEmptyOption":false}},"propertyControlGroups":{"httpServer":{"name":"HTTP Server Config","type":"group","content":["listening","port","authType","bearerToken"]}},"propertyControlGroupDescriptions":{},"defaultBrickProps":{"enabled":true,"listening":true,"authType":"none","name":"bricks-foundation-mcp-server-default","version":"1.0.0","resources":[],"tools":[],"prompts":[]},"eventTypes":{"GENERATOR_MCP_SERVER_ON_LISTENING":"GENERATOR_MCP_SERVER_ON_LISTENING","GENERATOR_MCP_SERVER_ON_ERROR":"GENERATOR_MCP_SERVER_ON_ERROR","GENERATOR_MCP_SERVER_ON_CLIENT_ERROR":"GENERATOR_MCP_SERVER_ON_CLIENT_ERROR","GENERATOR_MCP_SERVER_ON_CLIENT_CLOSE":"GENERATOR_MCP_SERVER_ON_CLIENT_CLOSE","GENERATOR_MCP_SERVER_ON_REQUEST_RESOURCE":"GENERATOR_MCP_SERVER_ON_REQUEST_RESOURCE","GENERATOR_MCP_SERVER_ON_CALL_TOOL":"GENERATOR_MCP_SERVER_ON_CALL_TOOL","GENERATOR_MCP_SERVER_ON_GET_PROMPT":"GENERATOR_MCP_SERVER_ON_GET_PROMPT"},"brickEventDescriptions":{"GENERATOR_MCP_SERVER_ON_LISTENING":{"default":"","en-us":"Listening of HTTP server","zh-tw":"HTTP 伺服器聆聽","ja-jp":"HTTP サーバーのリスニング"},"GENERATOR_MCP_SERVER_ON_ERROR":{"default":"","en-us":"Error of HTTP server","zh-tw":"HTTP 伺服器錯誤","ja-jp":"HTTP サーバーのエラー"},"GENERATOR_MCP_SERVER_ON_CLIENT_ERROR":{"default":"","en-us":"Client error of HTTP server","zh-tw":"HTTP 伺服器客戶端錯誤","ja-jp":"HTTP サーバーのクライアントエラー"},"GENERATOR_MCP_SERVER_ON_CLIENT_CLOSE":{"default":"","en-us":"Client close of HTTP server","zh-tw":"HTTP 伺服器客戶端關閉","ja-jp":"HTTP サーバーのクライアント閉じる"},"GENERATOR_MCP_SERVER_ON_REQUEST_RESOURCE":{"default":"","en-us":"On request resource (Request: { name: string, uri: string, params: object })","zh-tw":"當請求資源 (Request: { name: string, uri: string, params: object })","ja-jp":"リクエストリソース (Request: { name: string, uri: string, params: object })"},"GENERATOR_MCP_SERVER_ON_CALL_TOOL":{"default":"","en-us":"On call tool (Request: { name: string, params: object })","zh-tw":"當呼叫工具 (Request: { name: string, params: object })","ja-jp":"ツールの呼び出し (Request: { name: string, params: object })"},"GENERATOR_MCP_SERVER_ON_GET_PROMPT":{"default":"","en-us":"On get prompt (Request: { name: string, arguments: object })","zh-tw":"當獲取提示 (Request: { name: string, arguments: object })","ja-jp":"プロンプトの取得 (Request: { name: string, arguments: object })"}},"eventPropertyControls":{"GENERATOR_MCP_SERVER_ON_ERROR":{"properties":{"GENERATOR_MCP_SERVER_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_SERVER_ON_CLIENT_ERROR":{"properties":{"GENERATOR_MCP_SERVER_CLIENT_ADDRESS":{"name":"Client Address","type":"string"},"GENERATOR_MCP_SERVER_SESSION_ID":{"name":"Session ID","type":"string"},"GENERATOR_MCP_SERVER_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_SERVER_ON_CLIENT_CLOSE":{"properties":{"GENERATOR_MCP_SERVER_CLIENT_ADDRESS":{"name":"Client Address","type":"string"},"GENERATOR_MCP_SERVER_SESSION_ID":{"name":"Session ID","type":"string"}}},"GENERATOR_MCP_SERVER_ON_REQUEST_RESOURCE":{"properties":{"GENERATOR_MCP_SERVER_REQUEST_TYPE":{"name":"Request Type","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_NAME":{"name":"Request Name","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_URI":{"name":"Request URI","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_VARIABLES":{"name":"Request Variables","type":"object"},"GENERATOR_MCP_SERVER_REQUEST_TIMEOUT":{"name":"Request Timeout","type":"number"},"GENERATOR_MCP_SERVER_REQUEST":{"name":"Request Full Body","type":"object"}}},"GENERATOR_MCP_SERVER_ON_CALL_TOOL":{"properties":{"GENERATOR_MCP_SERVER_REQUEST_TYPE":{"name":"Request Type","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_NAME":{"name":"Request Name","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_VARIABLES":{"name":"Request Params","type":"object"},"GENERATOR_MCP_SERVER_REQUEST_TIMEOUT":{"name":"Request Timeout","type":"number"},"GENERATOR_MCP_SERVER_REQUEST":{"name":"Request Full Body","type":"object"}}},"GENERATOR_MCP_SERVER_ON_GET_PROMPT":{"properties":{"GENERATOR_MCP_SERVER_REQUEST_TYPE":{"name":"Request Type","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_NAME":{"name":"Request Name","type":"string"},"GENERATOR_MCP_SERVER_REQUEST_VARIABLES":{"name":"Request Variables","type":"object"},"GENERATOR_MCP_SERVER_REQUEST_TIMEOUT":{"name":"Request Timeout","type":"number"},"GENERATOR_MCP_SERVER_REQUEST":{"name":"Request Full Body","type":"object"}}}},"outletTypes":{"GENERATOR_MCP_SERVER_IS_LISTENING":{"outlet":"GENERATOR_MCP_SERVER_IS_LISTENING","type":"bool"},"GENERATOR_MCP_SERVER_LAST_ERROR":{"outlet":"GENERATOR_MCP_SERVER_LAST_ERROR","type":"string"},"GENERATOR_MCP_SERVER_ENDPOINT":{"outlet":"GENERATOR_MCP_SERVER_ENDPOINT","type":"string"},"GENERATOR_MCP_SERVER_CONNECTED_REMOTES":{"outlet":"GENERATOR_MCP_SERVER_CONNECTED_REMOTES","type":"array"},"GENERATOR_MCP_SERVER_LAST_RESOURCE_REQUEST":{"outlet":"GENERATOR_MCP_SERVER_LAST_RESOURCE_REQUEST","type":"object"},"GENERATOR_MCP_SERVER_LAST_TOOL_CALL":{"outlet":"GENERATOR_MCP_SERVER_LAST_TOOL_CALL","type":"object"},"GENERATOR_MCP_SERVER_LAST_PROMPT_GET":{"outlet":"GENERATOR_MCP_SERVER_LAST_PROMPT_GET","type":"object"}},"brickOutletDescriptions":{"GENERATOR_MCP_SERVER_IS_LISTENING":{"default":"","en-us":"Whether the HTTP server is listening","zh-tw":"HTTP 伺服器是否正在聆聽","ja-jp":"HTTP サーバーがリスニングしているかどうか"},"GENERATOR_MCP_SERVER_LAST_ERROR":{"default":"","en-us":"Last error of HTTP server","zh-tw":"HTTP 伺服器最後的錯誤","ja-jp":"HTTP サーバーの最後のエラー"},"GENERATOR_MCP_SERVER_ENDPOINT":{"default":"","en-us":"MCP server endpoint URL","zh-tw":"MCP 伺服器端點 URL","ja-jp":"MCP サーバーのエンドポイント URL"},"GENERATOR_MCP_SERVER_CONNECTED_REMOTES":{"default":"","en-us":"Connected remotes (Session ID)","zh-tw":"連接的遠端 (Session ID)","ja-jp":"接続されたリモート (セッション ID)"},"GENERATOR_MCP_SERVER_LAST_RESOURCE_REQUEST":{"default":"","en-us":"Last resource request ({ name: string, uri: string, params: object })","zh-tw":"最後的資源請求 ({ name: string, uri: string, params: object })","ja-jp":"最後のリソース要求 ({ name: string, uri: string, params: object })"},"GENERATOR_MCP_SERVER_LAST_TOOL_CALL":{"default":"","en-us":"Last tool call ({ name: string, params: object })","zh-tw":"最後的工具呼叫 ({ name: string, params: object })","ja-jp":"最後のツール呼び出し ({ name: string, params: object })"},"GENERATOR_MCP_SERVER_LAST_PROMPT_GET":{"default":"","en-us":"Last prompt get ({ name: string, arguments: object })","zh-tw":"最後的提示獲取 ({ name: string, arguments: object })","ja-jp":"最後のプロンプトの取得 ({ name: string, arguments: object })"}},"actionTypes":{"GENERATOR_MCP_SERVER_REFRESH_RESOURCES":{"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_MCP_SERVER_REFRESH_RESOURCES":{"default":"","en-us":"Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed.","zh-tw":"重新整理工具和資源,用於工具或資源變更時。注意,目前連線將會關閉。","ja-jp":"ツールとリソースを更新します。ツールやリソースが変更された場合に使用します。注意、現在の接続は閉じられます。"}}}')},8832:(e,t,a)=>{var n=a(3634),r=a(6525),i=a(8243),o=a(5523);e.exports=function(e,t){return n(e)||r(e,t)||i(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},8870:(e,t,a)=>{var n=a(5650),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),a=e[s];try{e[s]=void 0;var n=!0}catch(e){}var r=o.call(e);return n&&(t?e[s]=a:delete e[s]),r}},8875:function(e){!function(t){const a="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${a}\\.${a}\\.${a}\\.${a}$`,"i"),threeOctet:new RegExp(`^${a}\\.${a}\\.${a}$`,"i"),twoOctet:new RegExp(`^${a}\\.${a}$`,"i"),longValue:new RegExp(`^${a}$`,"i")},r=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${a}\\.${a}\\.${a}\\.${a}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${a}\\.${a}\\.${a}\\.${a}(${o})?$`,"i")};function l(e,t){if(e.indexOf("::")!==e.lastIndexOf("::"))return null;let a,n,r=0,i=-1,o=(e.match(p.zoneIndex)||[])[0];for(o&&(o=o.substring(1),e=e.replace(/%.+$/,""));(i=e.indexOf(":",i+1))>=0;)r++;if("::"===e.substr(0,2)&&r--,"::"===e.substr(-2,2)&&r--,r>t)return null;for(n=t-r,a=":";n--;)a+="0:";return":"===(e=e.replace("::",a))[0]&&(e=e.slice(1)),":"===e[e.length-1]&&(e=e.slice(0,-1)),t=function(){const t=e.split(":"),a=[];for(let e=0;e<t.length;e++)a.push(parseInt(t[e],16));return a}(),{parts:t,zoneId:o}}function u(e,t,a,n){if(e.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let r,i=0;for(;n>0;){if(r=a-n,r<0&&(r=0),e[i]>>r!==t[i]>>r)return!1;n-=a,i+=1}return!0}function d(e){if(i.test(e))return parseInt(e,16);if("0"===e[0]&&!isNaN(parseInt(e[1],10))){if(r.test(e))return parseInt(e,8);throw new Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function c(e,t){for(;e.length<t;)e=`0${e}`;return e}const m={};m.IPv4=function(){function e(e){if(4!==e.length)throw new Error("ipaddr: ipv4 octet count should be 4");let t,a;for(t=0;t<e.length;t++)if(a=e[t],!(0<=a&&a<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return"ipv4"},e.prototype.match=function(e,t){let a;if(void 0===t&&(a=e,e=a[0],t=a[1]),"ipv4"!==e.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const a={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let n,r,i;for(n=3;n>=0;n-=1){if(r=this.octets[n],!(r in a))return null;if(i=a[r],t&&0!==i)return null;8!==i&&(t=!0),e+=i}return 32-e},e.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return m.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(".")},e}(),m.IPv4.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),a=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),r=[];let i=0;for(;i<4;)r.push(parseInt(a[i],10)|255^parseInt(n[i],10)),i++;return new this(r)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.isIPv4=function(e){return null!==this.parser(e)},m.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch(e){return!1}},m.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch(e){return!1}},m.IPv4.isValidFourPartDecimal=function(e){return!(!m.IPv4.isValid(e)||!e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},m.IPv4.isValidCIDRFourPartDecimal=function(e){const t=e.match(/^(.+)\/(\d+)$/);return!(!m.IPv4.isValidCIDR(e)||!t)&&m.IPv4.isValidFourPartDecimal(t[1])},m.IPv4.networkAddressFromCIDR=function(e){let t,a,n,r,i;try{for(t=this.parseCIDR(e),n=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),r=[],a=0;a<4;)r.push(parseInt(n[a],10)&parseInt(i[a],10)),a++;return new this(r)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.parse=function(e){const t=this.parser(e);if(null===t)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(t)},m.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){const e=parseInt(t[2]);if(e>=0&&e<=32){const a=[this.parse(t[1]),e];return Object.defineProperty(a,"toString",{value:function(){return this.join("/")}}),a}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},m.IPv4.parser=function(e){let t,a,r;if(t=e.match(n.fourOctet))return function(){const e=t.slice(1,6),n=[];for(let t=0;t<e.length;t++)a=e[t],n.push(d(a));return n}();if(t=e.match(n.longValue)){if(r=d(t[1]),r>4294967295||r<0)throw new Error("ipaddr: address outside defined range");return function(){const e=[];let t;for(t=0;t<=24;t+=8)e.push(r>>t&255);return e}().reverse()}return(t=e.match(n.twoOctet))?function(){const e=t.slice(1,4),a=[];if(r=d(e[1]),r>16777215||r<0)throw new Error("ipaddr: address outside defined range");return a.push(d(e[0])),a.push(r>>16&255),a.push(r>>8&255),a.push(255&r),a}():(t=e.match(n.threeOctet))?function(){const e=t.slice(1,5),a=[];if(r=d(e[2]),r>65535||r<0)throw new Error("ipaddr: address outside defined range");return a.push(d(e[0])),a.push(d(e[1])),a.push(r>>8&255),a.push(255&r),a}():null},m.IPv4.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>32)throw new Error("ipaddr: invalid IPv4 prefix length");const t=[0,0,0,0];let a=0;const n=Math.floor(e/8);for(;a<n;)t[a]=255,a++;return n<4&&(t[n]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},m.IPv6=function(){function e(e,t){let a,n;if(16===e.length)for(this.parts=[],a=0;a<=14;a+=2)this.parts.push(e[a]<<8|e[a+1]);else{if(8!==e.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=e}for(a=0;a<this.parts.length;a++)if(n=this.parts[a],!(0<=n&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32]]},e.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},e.prototype.kind=function(){return"ipv6"},e.prototype.match=function(e,t){let a;if(void 0===t&&(a=e,e=a[0],t=a[1]),"ipv6"!==e.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let n,r;for(let i=7;i>=0;i-=1){if(n=this.parts[i],!(n in a))return null;if(r=a[n],t&&0!==r)return null;16!==r&&(t=!0),e+=r}return 128-e},e.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e;const t=[],a=this.parts;for(let n=0;n<a.length;n++)e=a[n],t.push(e>>8),t.push(255&e);return t},e.prototype.toFixedLengthString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(c(this.parts[t].toString(16),4));return e}.call(this).join(":");let t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const e=this.parts.slice(-2),t=e[0],a=e[1];return new m.IPv4([t>>8,255&t,a>>8,255&a])},e.prototype.toNormalizedString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}.call(this).join(":");let t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){const e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString();let a,n=0,r=-1;for(;a=e.exec(t);)a[0].length>r&&(n=a.index,r=a[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e}(),m.IPv6.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),a=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),r=[];let i=0;for(;i<16;)r.push(parseInt(a[i],10)|255^parseInt(n[i],10)),i++;return new this(r)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},m.IPv6.isIPv6=function(e){return null!==this.parser(e)},m.IPv6.isValid=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{const t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch(e){return!1}},m.IPv6.isValidCIDR=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{return this.parseCIDR(e),!0}catch(e){return!1}},m.IPv6.networkAddressFromCIDR=function(e){let t,a,n,r,i;try{for(t=this.parseCIDR(e),n=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),r=[],a=0;a<16;)r.push(parseInt(n[a],10)&parseInt(i[a],10)),a++;return new this(r)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},m.IPv6.parse=function(e){const t=this.parser(e);if(null===t.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(t.parts,t.zoneId)},m.IPv6.parseCIDR=function(e){let t,a,n;if((a=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(a[2]),t>=0&&t<=128))return n=[this.parse(a[1]),t],Object.defineProperty(n,"toString",{value:function(){return this.join("/")}}),n;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},m.IPv6.parser=function(e){let t,a,n,r,i,o;if(n=e.match(p.deprecatedTransitional))return this.parser(`::ffff:${n[1]}`);if(p.native.test(e))return l(e,8);if((n=e.match(p.transitional))&&(o=n[6]||"",t=n[1],n[1].endsWith("::")||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(i=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])],a=0;a<i.length;a++)if(r=i[a],!(0<=r&&r<=255))return null;return t.parts.push(i[0]<<8|i[1]),t.parts.push(i[2]<<8|i[3]),{parts:t.parts,zoneId:t.zoneId}}return null},m.IPv6.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>128)throw new Error("ipaddr: invalid IPv6 prefix length");const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let a=0;const n=Math.floor(e/8);for(;a<n;)t[a]=255,a++;return n<16&&(t[n]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},m.fromByteArray=function(e){const t=e.length;if(4===t)return new m.IPv4(e);if(16===t)return new m.IPv6(e);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},m.isValid=function(e){return m.IPv6.isValid(e)||m.IPv4.isValid(e)},m.isValidCIDR=function(e){return m.IPv6.isValidCIDR(e)||m.IPv4.isValidCIDR(e)},m.parse=function(e){if(m.IPv6.isValid(e))return m.IPv6.parse(e);if(m.IPv4.isValid(e))return m.IPv4.parse(e);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},m.parseCIDR=function(e){try{return m.IPv6.parseCIDR(e)}catch(t){try{return m.IPv4.parseCIDR(e)}catch(e){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},m.process=function(e){const t=this.parse(e);return"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t},m.subnetMatch=function(e,t,a){let n,r,i,o;for(r in null==a&&(a="unicast"),t)if(Object.prototype.hasOwnProperty.call(t,r))for(i=t[r],!i[0]||i[0]instanceof Array||(i=[i]),n=0;n<i.length;n++)if(o=i[n],e.kind()===o[0].kind()&&e.match.apply(e,o))return r;return a},e.exports?e.exports=m:t.ipaddr=m}(this)},8897:e=>{e.exports=JSON.parse('{"name":"math","description":null,"description_zh_TW":null,"description_ja_JP":null,"commands":{"MATH_ABS":{"name":"Abs","description":"Abs","description_zh_TW":"絕對值","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_ADD":{"name":"Add","description":"Add","description_zh_TW":"兩數相加","arg":[{"name":"augend","type":"number","subType":false,"defaultValue":"0"},{"name":"addend","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_CEIL":{"name":"Ceil","description":"Ceil","description_zh_TW":"取得無條件進位值","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_DIVIDE":{"name":"Divide","description":"Divide (Return integer if precision is 0)","description_zh_TW":"兩數相除 (如果 precision 為 0 則會回傳整數值)","arg":[{"name":"dividend","type":"number","subType":false,"defaultValue":"0"},{"name":"divisor","type":"number","subType":false,"defaultValue":"1"},{"name":"precision","type":"integer","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_EQUAL":{"name":"Equal","description":"Alias of LOGICTYPE_EQUAL_VALUE","description_zh_TW":"LOGICTYPE_EQUAL_VALUE 別名","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"MATH_EQUATION":{"name":"Run equation","description":"Use string to write math functions, and use object as variables. (You can use OBJECT_DEFAULTS to make object)","description_zh_TW":"使用字串撰寫數學函數,並可使用物件作為傳入參數, 函數計算時會以物件的 Key 作為參數的名稱,帶入對應的參數至公式中計算結果(傳入參數物件可使用 OBJECT_DEFAULTS 製作)","arg":[{"name":"arguments","type":"object","subType":false,"defaultValue":"{}"},{"name":"equation","type":"string","subType":false}],"return":[{"name":"result","type":"number"}]},"MATH_FLOOR":{"name":"Floor","description":"Floor number","description_zh_TW":"無條件捨去","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"},{"name":"precision","type":"integer","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_GCD":{"name":"GCD","description":"GCD","description_zh_TW":"最大公因數","arg":[{"name":"number_list","type":"array","subType":"number","defaultValue":"[]"}],"return":[{"name":"result","type":"number"}]},"MATH_IS_NEGATIVE":{"name":"Is Negative","description":"Is negative","description_zh_TW":"是否為負數","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"MATH_IS_POSITIVE":{"name":"Is Positive","description":"Is positive","description_zh_TW":"是否為正數","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"MATH_IS_PRIME":{"name":"Is Prime","description":"Is prime","description_zh_TW":"是否為質數","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"MATH_IS_ZERO":{"name":"Is zero","description":"Is zero","description_zh_TW":"是否為零","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"MATH_LARGER":{"name":"Larger","description":"Larger","description_zh_TW":"大於","arg":[{"name":"x","type":"number","subType":false,"defaultValue":"0"},{"name":"y","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"bool"}]},"MATH_LARGER_AND_EQUAL":{"name":"Larger and Equal","description":"Larger and Equal","description_zh_TW":"大於等於","arg":[{"name":"x","type":"number","subType":false,"defaultValue":"0"},{"name":"y","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"bool"}]},"MATH_LCM":{"name":"LCM","description":"LCM","description_zh_TW":"最小公倍數","arg":[{"name":"x","type":"number","subType":false,"defaultValue":"0"},{"name":"y","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_MAX":{"name":"Max","description":"Get max value in array of number (ignore non-numeric value)","description_zh_TW":"取得數字陣列中的最大值 (傳入的陣列中若有非數字元素,會被直接忽略)","arg":[{"name":"number_list","type":"array","subType":"number","defaultValue":"[]"}],"return":[{"name":"result","type":"number"}]},"MATH_MEAN":{"name":"Mean","description":"Get average value in array of number (ignore non-numeric value)","description_zh_TW":"取得數字陣列中的平均值 (傳入的陣列中若有非數字元素,會被直接忽略)","arg":[{"name":"number_list","type":"array","subType":"number","defaultValue":"[]"}],"return":[{"name":"result","type":"number"}]},"MATH_MIN":{"name":"Min","description":"Get min in array of number (ignore non-numeric value)","description_zh_TW":"傳入的陣列中若有非數字元素,會被直接忽略","arg":[{"name":"number_list","type":"array","subType":"number","defaultValue":"[]"}],"return":[{"name":"result","type":"number"}]},"MATH_MOD":{"name":"Mod","description":"Mod","description_zh_TW":"餘數","arg":[{"name":"dividend","type":"number","subType":false,"defaultValue":"0"},{"name":"divisor","type":"number","subType":false,"defaultValue":"1"}],"return":[{"name":"result","type":"number"}]},"MATH_MULTIPLY":{"name":"Multiply","description":"Multiply","description_zh_TW":"兩數相乘","arg":[{"name":"multiplier","type":"number","subType":false,"defaultValue":"1"},{"name":"multiplicand","type":"number","subType":false,"defaultValue":"1"}],"return":[{"name":"result","type":"number"}]},"MATH_NOT_EQUAL":{"name":"Not Equal","description":"Not equal","description_zh_TW":"不等於","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"MATH_NTH_ROOT":{"name":"Root","description":"Root","description_zh_TW":"開方根","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"},{"name":"root","type":"integer","subType":false,"defaultValue":"2"}],"return":[{"name":"result","type":"number"}]},"MATH_POW":{"name":"Pow","description":"Pow","description_zh_TW":"次方","arg":[{"name":"base","type":"number","subType":false,"defaultValue":"0"},{"name":"exponent","type":"integer","subType":false,"defaultValue":"2"}],"return":[{"name":"result","type":"number"}]},"MATH_RANDOM":{"name":"Random","description":"Get a random number","description_zh_TW":"取得亂數值","arg":[{"name":"trigger","type":"any","subType":false,"defaultValue":"undefined"},{"name":"lower","type":"number","subType":false,"defaultValue":"0"},{"name":"upper","type":"number","subType":false,"defaultValue":"1"},{"name":"floating","type":"bool","subType":false,"defaultValue":"true"}],"return":[{"name":"result","type":"number"}]},"MATH_ROUND":{"name":"Round","description":"Round number","description_zh_TW":"取得四捨五入值","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"},{"name":"precision","type":"integer","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_SIGN":{"name":"Sign","description":"Sign number","description_zh_TW":"取得正負數","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_SMALLER":{"name":"Smaller","description":"Result = x < y","description_zh_TW":"小於 (Result = x < y)","arg":[{"name":"x","type":"number","subType":false,"defaultValue":"0"},{"name":"y","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"bool"}]},"MATH_SMALLER_AND_EQUAL":{"name":"Smaller And Equal","description":"Result = x <= y","description_zh_TW":"小於等於 (Result = x <= y)","arg":[{"name":"x","type":"number","subType":false,"defaultValue":"0"},{"name":"y","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"bool"}]},"MATH_SUBTRACT":{"name":"Substract","description":"Substract","description_zh_TW":"兩數相減","arg":[{"name":"minuend","type":"number","subType":false,"defaultValue":"0"},{"name":"subtrahend","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_SUM":{"name":"Sum","description":"Get sum in array of number (ignore non-numeric value)","description_zh_TW":"取得數字陣列中的總和 (傳入的陣列中若有非數字元素,會被直接忽略)","arg":[{"name":"number_list","type":"array","subType":"number","defaultValue":"[]"}],"return":[{"name":"result","type":"number"}]},"MATH_UNARY_MINUS":{"name":"Unary minus","description":"Unary minus (Result = value * -1)","description_zh_TW":"反向負數 (Result = value * -1)","arg":[{"name":"value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"MATH_UNARY_PLUS":{"name":"Unary plus","description":"Unary plus","description_zh_TW":"數值化","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]}}}')},8904:e=>{e.exports=JSON.parse('{"name":"BrickWebRTCStream","brickDescription":{"default":"Brick WebRTC stream viewer component","en-us":"WebRTCStream brick","zh-tw":"WebRTC 串流方塊","ja-jp":"WebRTCストリームブリック"},"brickDisplayName":"WebRTC Stream","brickTip":{"default":"@brick-tip-webrtc-stream","en-us":"Add WebRTC Stream Viewer (Control by WebRTC Generator and Event)","zh-tw":"WebRTC 顯示畫面元件,需搭配 WebRTC Generator 及事件做控制","ja-jp":"WebRTC ストリームビューアを追加(WebRTC ジェネレーターとイベントによる制御)"},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"video"},"propTypes":{"mirror":{"type":"bool"},"resizeMode":{"type":"oneOf","content":["contain","cover"],"forcePropertyBank":false},"noStreamViewText":{"type":"string"},"noStreamViewTextSize":{"type":"number"},"noStreamViewTextColor":{"type":"string"}},"brickPropDescriptions":{"mirror":{"default":"","en-us":"Mirror video","zh-tw":"鏡像影像","ja-jp":"ミラービデオ"},"resizeMode":{"default":"","en-us":"The stream resize mode","zh-tw":"串流呈現模式","ja-jp":"ストリームのリサイズモード"},"noStreamViewText":{"default":"","en-us":"Show text content if no stream","zh-tw":"如果沒有串流,則顯示文字","ja-jp":"ストリームがない場合にテキストを表示"},"noStreamViewTextSize":{"default":"","en-us":"The font size of shown text content if no stream","zh-tw":"如果沒有串流,則顯示的文字大小","ja-jp":"ストリームがない場合に表示されるテキストのフォントサイズ"},"noStreamViewTextColor":{"default":"","en-us":"The color of shown text content if no stream","zh-tw":"如果沒有串流,則顯示的文字顏色","ja-jp":"ストリームがない場合に表示されるテキストの色"}},"defaultBrickProps":{"mirror":false,"resizeMode":"contain","noStreamViewText":"no stream","noStreamViewTextSize":44,"noStreamViewTextColor":"#000"},"propertyControls":{"noStreamViewTextSize":{"kind":"unit","min":1},"noStreamViewTextColor":{"kind":"color","placeholder":"#000"}},"propertyControlGroups":{"noStreamView":{"name":"No Stream View Cases","type":"prefix","content":"noStreamView"}},"propertyControlGroupDescriptions":{}}')},8907:(e,t,a)=>{a.d(t,{A_:()=>p,D$:()=>y,Ii:()=>d,J:()=>u,Kc:()=>l,MB:()=>h,WU:()=>s,dt:()=>E,kd:()=>T,o5:()=>f,ue:()=>_});var n=a(9212),r=a(1777),i=a(2904),o=a(4214);function s(e){return{__ref:String(e)}}function p(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function l(e){return(0,r.U)(e)&&"Document"===e.kind&&Array.isArray(e.definitions)}function u(e,t,a,r){if(function(e){return"IntValue"===e.kind}(a)||function(e){return"FloatValue"===e.kind}(a))e[t.value]=Number(a.value);else if(function(e){return"BooleanValue"===e.kind}(a)||function(e){return"StringValue"===e.kind}(a))e[t.value]=a.value;else if(function(e){return"ObjectValue"===e.kind}(a)){var i={};a.fields.map(function(e){return u(i,e.name,e.value,r)}),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(a)){var o=(r||{})[a.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(a))e[t.value]=a.values.map(function(e){var a={};return u(a,t,e,r),a[t.value]});else if(function(e){return"EnumValue"===e.kind}(a))e[t.value]=a.value;else{if(!function(e){return"NullValue"===e.kind}(a))throw(0,n.newInvariantError)(96,t.value,a.kind);e[t.value]=null}}function d(e,t){var a=null;e.directives&&(a={},e.directives.forEach(function(e){a[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var r=n.name,i=n.value;return u(a[e.name.value],r,i,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var a=e.name,r=e.value;return u(n,a,r,t)})),f(e.name.value,n,a)}var c=["connection","include","skip","client","rest","export","nonreactive"],m=o.M,f=Object.assign(function(e,t,a){if(t&&a&&a.connection&&a.connection.key){if(a.connection.filter&&a.connection.filter.length>0){var n=a.connection.filter?a.connection.filter:[];n.sort();var r={};return n.forEach(function(e){r[e]=t[e]}),"".concat(a.connection.key,"(").concat(m(r),")")}return a.connection.key}var i=e;if(t){var o=m(t);i+="(".concat(o,")")}return a&&Object.keys(a).forEach(function(e){-1===c.indexOf(e)&&(a[e]&&Object.keys(a[e]).length?i+="@".concat(e,"(").concat(m(a[e]),")"):i+="@".concat(e))}),i},{setStringify:function(e){var t=m;return m=e,t}});function h(e,t){if(e.arguments&&e.arguments.length){var a={};return e.arguments.forEach(function(e){var n=e.name,r=e.value;return u(a,n,r,t)}),a}return null}function _(e){return e.alias?e.alias.value:e.name.value}function y(e,t,a){for(var n,r=0,o=t.selections;r<o.length;r++){if(E(l=o[r])){if("__typename"===l.name.value)return e[_(l)]}else n?n.push(l):n=[l]}if("string"==typeof e.__typename)return e.__typename;if(n)for(var s=0,p=n;s<p.length;s++){var l=p[s],u=y(e,(0,i.HQ)(l,a).selectionSet,a);if("string"==typeof u)return u}}function E(e){return"Field"===e.kind}function T(e){return"InlineFragment"===e.kind}},8925:(e,t)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(a||(t.DiscrError=a={}))},8931:(e,t,a)=>{var n=a(3501);e.exports=function(e,t,a){var r=e.length;return a=void 0===a?r:a,!t&&a>=r?e:n(e,t,a)}},8942:(e,t,a)=>{var n=a(4967),r="object"==typeof self&&self&&self.Object===Object&&self,i=n||r||Function("return this")();e.exports=i},9003:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=a(383),r=a(4758),i=a(9409),o=a(7898),s=a(458);var p;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(p||(t.DataType=p={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:a,data:n,opts:i}=e,s=function(e,t){return t?e.filter(e=>u.has(e)||"array"===t&&"array"===e):[]}(t,i.coerceTypes),l=t.length>0&&!(0===s.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(l){const r=c(t,n,i.strictNumbers,p.Wrong);a.if(r,()=>{s.length?function(e,t,a){const{gen:n,data:r,opts:i}=e,s=n.let("dataType",o._`typeof ${r}`),p=n.let("coerced",o._`undefined`);"array"===i.coerceTypes&&n.if(o._`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>n.assign(r,o._`${r}[0]`).assign(s,o._`typeof ${r}`).if(c(t,r,i.strictNumbers),()=>n.assign(p,r)));n.if(o._`${p} !== undefined`);for(const e of a)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void n.elseIf(o._`${s} == "number" || ${s} == "boolean"`).assign(p,o._`"" + ${r}`).elseIf(o._`${r} === null`).assign(p,o._`""`);case"number":return void n.elseIf(o._`${s} == "boolean" || ${r} === null
683
683
  || (${s} == "string" && ${r} && ${r} == +${r})`).assign(p,o._`+${r}`);case"integer":return void n.elseIf(o._`${s} === "boolean" || ${r} === null
684
684
  || (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(p,o._`+${r}`);case"boolean":return void n.elseIf(o._`${r} === "false" || ${r} === 0 || ${r} === null`).assign(p,!1).elseIf(o._`${r} === "true" || ${r} === 1`).assign(p,!0);case"null":return n.elseIf(o._`${r} === "" || ${r} === 0 || ${r} === false`),void n.assign(p,null);case"array":n.elseIf(o._`${s} === "string" || ${s} === "number"
685
- || ${s} === "boolean" || ${r} === null`).assign(p,o._`[${r}]`)}}n.else(),f(e),n.endIf(),n.if(o._`${p} !== undefined`,()=>{n.assign(r,p),function({gen:e,parentData:t,parentDataProperty:a},n){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${a}]`,n))}(e,p)})}(e,t,s):f(e)})}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,a,n=p.Correct){const r=n===p.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${r} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return o._`typeof ${t} ${r} ${e}`}return n===p.Correct?i:(0,o.not)(i);function s(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,a?o._`isFinite(${t})`:o.nil)}}function c(e,t,a,n){if(1===e.length)return d(e[0],t,a,n);let r;const i=(0,s.toHash)(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;r=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else r=o.nil;i.number&&delete i.integer;for(const e in i)r=(0,o.and)(r,d(e,t,a,n));return r}t.checkDataType=d,t.checkDataTypes=c;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:a,schema:n}=e,r=(0,s.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:a,schema:n.type,schemaCode:r,schemaValue:r,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=f},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9011:(e,t,a)=>{var n=a(8250);function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(r.Cache||n),a}r.Cache=n,e.exports=r},9041:e=>{e.exports=JSON.parse('{"name":"GeneratorReranker","brickDescription":{"default":"Reranker (GGML)","en-us":"Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp) \\n\\n ## Notice \\n - The device RAM must be larger than 8GB \\n - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal. \\n - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal. \\n - Android: Recommended use Android 13+ system. \\n - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported. \\n - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs. \\n - Linux / Windows \\n - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \\n - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)","zh-tw":"基於 GGML 和 [llama.cpp](https://github.com/ggerganov/llama.cpp) 的本地重排序 \\n\\n ## 注意事項 \\n - 設備 RAM 必須大於 8GB \\n - iOS: 建議使用 M1+ / A17+ 晶片的設備。支援 GPU 加速 by Metal. \\n - macOS: 建議使用 M1+ 晶片的設備。支援 GPU 加速 by Metal. \\n - Android: 建議使用 Android 13+ 系統。 \\n - 支援透過 OpenCL 進行 GPU 加速,目前僅支援 Qualcomm Adreno 700+ 的 GPU,其他 GPU 不支援。 \\n - 支援 Qualcomm Snapdragon 8 Gen 2+ 的 Hexagon NPU。 \\n - Linux / Windows \\n - 支援 GPU 加速,您可以在 Accel Variant 屬性中選擇 `vulkan` 或 `cuda` 後端 \\n - 支援 Qualcomm Dragonwing IQ9 系列+ 的 Hexagon NPU (Linux)","ja-jp":"GGML と [llama.cpp](https://github.com/ggerganov/llama.cpp) をベースにしたローカルリランキング \\n\\n ## 注意事項 \\n - デバイスの RAM は 8GB 以上である必要があります \\n - iOS: M1+ / A17+ チップのデバイスを推奨。Metal による GPU 加速をサポート。 \\n - macOS: M1+ チップのデバイスを推奨。Metal による GPU 加速をサポート。 \\n - Android: Android 13+ システムを推奨。 \\n - OpenCL による GPU 加速をサポート、現在 Qualcomm Adreno 700+ の GPU のみサポート、他の GPU はサポートされていません。 \\n - Qualcomm Snapdragon 8 Gen 2+ の Hexagon NPU をサポート。 \\n - Linux / Windows \\n - GPU 加速をサポート、Accel Variant プロパティで `vulkan` または `cuda` バックエンドを選択できます \\n - Qualcomm Dragonwing IQ9 シリーズ+ の Hexagon NPU をサポート (Linux)"},"brickDisplayName":"Reranker (GGML)","brickTip":{"default":""},"brickMeta":{"preview":true,"scriptMember":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"ranking-star"},"propTypes":{"init":{"type":"bool"},"modelUrl":{"type":"string"},"modelHash":{"type":"string"},"modelHashType":{"type":"oneOf","content":["md5","sha256","sha1"],"forcePropertyBank":false},"contextSize":{"type":"number"},"batchSize":{"type":"number"},"uBatchSize":{"type":"number"},"accelVariant":{"type":"oneOf","content":["default","vulkan","cuda","snapdragon"],"forcePropertyBank":false},"devices":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"mainGpu":{"type":"number"},"gpuLayers":{"type":"number"},"maxThreads":{"type":"number"},"useMlock":{"type":"bool"},"useMmap":{"type":"bool"},"query":{"type":"string"},"documents":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"normalize":{"type":"oneOfType","content":[{"type":"number"},{"type":"bool"}],"forcePropertyBank":false},"topK":{"type":"number"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Initialize the Reranker context on generator initialization","zh-tw":"在生成器初始化時初始化重排序上下文","ja-jp":"ジェネレーター初期化時にリランカーコンテキストを初期化する"},"modelUrl":{"default":"Model Configuration","en-us":"The URL or path of reranker model (GGUF format)","zh-tw":"重排序模型的 URL 或路径(GGUF 格式)","ja-jp":"リランカーモデルのURLまたはパス(GGUF形式)"},"modelHash":{"default":"","en-us":"Hash of reranker model","zh-tw":"重排序模型的哈希值","ja-jp":"リランカーモデルのハッシュ"},"modelHashType":{"default":"","en-us":"Hash type of reranker model","zh-tw":"重排序模型的哈希类型","ja-jp":"リランカーモデルのハッシュタイプ"},"contextSize":{"default":"Context Parameters","en-us":"Context size (0 ~ 4096) (Default to 512)","zh-tw":"上下文大小(0 ~ 4096)(默认为 512)","ja-jp":"コンテキストサイズ(0 ~ 4096)(デフォルト:512)"},"batchSize":{"default":"","en-us":"Logical batch size for processing (default: 512)","zh-tw":"处理的逻辑批次大小(默认:512)","ja-jp":"処理のための論理バッチサイズ(デフォルト:512)"},"uBatchSize":{"default":"","en-us":"Physical maximum batch size (default: 512)","zh-tw":"物理最大批次大小(默认:512)","ja-jp":"物理的な最大バッチサイズ(デフォルト:512)"},"accelVariant":{"default":"Hardware Acceleration","en-us":"GGML accelerator variant (Only for desktop) \\n `default` - CPU / Metal (macOS) \\n `vulkan` - Use Vulkan \\n `cuda` - Use CUDA \\n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon","zh-tw":"加速器變體 (僅適用於桌面版) \\n `default` - 使用 CPU / Metal (macOS) \\n `vulkan` - 使用 Vulkan \\n `cuda` - 使用 CUDA \\n `snapdragon` - 使用 OpenCL/Hexagon of Qualcomm Snapdragon","ja-jp":"アクセラレータのバリアント(デスクトップのみ) \\n `default` - CPU / Metal (macOS) \\n `vulkan` - Vulkan を使用 \\n `cuda` - CUDA を使用 \\n `snapdragon` - OpenCL/Hexagon of Qualcomm Snapdragon を使用"},"devices":{"default":"","en-us":"Devices. For example: \\n \\n Metal or CPU for iOS/tvOS/MacOS \\n OpenCL or CPU for Android \\n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \\n For Desktop, you may want to include/exclude GPUs","zh-tw":"裝置。例如: \\n \\n iOS/tvOS/MacOS 使用 Metal 或 CPU \\n Android 使用 OpenCL、CPU \\n - 對於 OpenCL/Hexagon 裝置可新增 `HTP0`、`HTP1`、`...`(使用 HTP* 代表所有 HTP 裝置) \\n 對於桌面版,您可能想要包含/排除 GPU","ja-jp":"デバイス。例: \\n \\n iOS/tvOS/MacOS の場合:Metal また CPU \\n Android の場合:OpenCL、CPU \\n - OpenCL/Hexagon デバイスの場合、`HTP0`、`HTP1`、`...` を追加します(すべての HTP デバイスには HTP* を使用) \\n デスクトップの場合、GPU を含める/除外することができます"},"mainGpu":{"default":"","en-us":"Main GPU index (default: 0)","zh-tw":"主 GPU 索引(默认:0)","ja-jp":"メインGPUインデックス(デフォルト:0)"},"gpuLayers":{"default":"","en-us":"Number of layers to store in VRAM (default: 0)","zh-tw":"存储在 VRAM 中的层数(默认:0)","ja-jp":"VRAMに格納するレイヤー数(デフォルト:0)"},"maxThreads":{"default":"","en-us":"Maximum number of threads to use (default: auto)","zh-tw":"使用的最大线程数(默认:自动)","ja-jp":"使用する最大スレッド数(デフォルト:自動)"},"useMlock":{"default":"Memory Settings","en-us":"Use mlock to keep model in memory (default: true)","zh-tw":"使用 mlock 将模型保持在内存中(默认:true)","ja-jp":"モデルをメモリに保持するためにmlockを使用(デフォルト:true)"},"useMmap":{"default":"","en-us":"Use mmap for model loading (default: true)","zh-tw":"使用 mmap 加载模型(默认:true)","ja-jp":"モデル読み込みにmmapを使用(デフォルト:true)"},"query":{"default":"Reranking Parameters","en-us":"Query text for reranking","zh-tw":"重排序的查询文本","ja-jp":"リランキング用のクエリテキスト"},"documents":{"default":"","en-us":"Array of documents to rerank","zh-tw":"要重排序的文档数组","ja-jp":"リランキングする文書の配列"},"normalize":{"default":"","en-us":"Normalize reranking scores (default: from model config)","zh-tw":"标准化重排序分数(默认:来自模型配置)","ja-jp":"リランキングスコアを正規化(デフォルト:モデル設定から)"},"topK":{"default":"","en-us":"Maximum number of documents to return (default: unlimited)","zh-tw":"返回的最大文档数(默认:无限制)","ja-jp":"返す文書の最大数(デフォルト:無制限)"}},"propertyControls":{"modelUrl":{"kind":"gguf-model-asset","displayName":"URL","normalizeDisplayName":false,"validator":{"fn":"uri","protocols":["https?","file"]},"fields":{"hashType":"modelHashType","hash":"modelHash"},"mediaFields":{"metadata":"_modelMediaMetadata"},"resetPropertiesOnChange":["modelHash"]},"modelHash":{"displayName":"Hash","normalizeDisplayName":false},"modelHashType":{"displayName":"Hash Type","normalizeDisplayName":false,"oneOfEmptyOption":false},"accelVariant":{"displayName":"Accelerator Variant","normalizeDisplayName":false},"mainGpu":{"displayName":"Main GPU","normalizeDisplayName":false},"gpuLayers":{"displayName":"GPU Layers","normalizeDisplayName":false},"maxThreads":{"displayName":"Max Threads","normalizeDisplayName":false},"useMlock":{"displayName":"Use mlock","normalizeDisplayName":false},"useMmap":{"displayName":"Use mmap","normalizeDisplayName":false},"query":{"displayName":"Query","normalizeDisplayName":false,"multiline":true},"documents":{"displayName":"Documents","normalizeDisplayName":false,"kind":"arrayOf","itemKind":"string"},"normalize":{"displayName":"Normalize Scores","normalizeDisplayName":false},"topK":{"displayName":"Top K","normalizeDisplayName":false}},"defaultBrickProps":{"init":false,"contextSize":512,"batchSize":512,"uBatchSize":512,"accelVariant":"default","mainGpu":0,"gpuLayers":0,"useMlock":true,"useMmap":true,"normalize":1},"propertyControlGroups":{"model":{"name":"Model Parameters","type":"group","content":["modelUrl","modelHash","modelHashType"]},"context":{"name":"Context Parameters","type":"group","content":["contextSize","batchSize","uBatchSize"]},"hardware":{"name":"Hardware Acceleration","type":"group","content":["accelVariant","mainGpu","gpuLayers","maxThreads"]},"memory":{"name":"Memory Settings","type":"group","content":["useMlock","useMmap"]},"reranking":{"name":"Reranking Parameters","type":"group","content":["query","documents","normalize","topK"]}},"propertyControlGroupDescriptions":{},"eventTypes":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE","GENERATOR_RERANKER_ON_ERROR":"GENERATOR_RERANKER_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":{"default":"","en-us":"Event triggered when the reranker context state changes (loading, ready, error, released)","zh-tw":"當重排序上下文狀態變更時觸發的事件(加載中、就緒、錯誤、已釋放)","ja-jp":"リランカーコンテキストの状態が変更されたときにトリガーされるイベント(読み込み中、準備完了、エラー、解放済み)"},"GENERATOR_RERANKER_ON_ERROR":{"default":"","en-us":"Event triggered when an error occurs during reranker operations","zh-tw":"在重排序操作過程中發生錯誤時觸發的事件","ja-jp":"リランカー操作中にエラーが発生したときにトリガーされるイベント"}},"eventPropertyControls":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":{"properties":{"GENERATOR_RERANKER_CONTEXT_STATE":{"name":"Context State","type":"string"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"name":"Context Details","type":"object"}}},"GENERATOR_RERANKER_ON_ERROR":{"properties":{"GENERATOR_RERANKER_ERROR":{"name":"Error","type":"string"}}}},"outletTypes":{"GENERATOR_RERANKER_CONTEXT_STATE":{"outlet":"GENERATOR_RERANKER_CONTEXT_STATE","type":"string"},"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS":{"outlet":"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS","type":"number"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"outlet":"GENERATOR_RERANKER_CONTEXT_DETAILS","type":"object"},"GENERATOR_RERANKER_RERANK_RESULT":{"outlet":"GENERATOR_RERANKER_RERANK_RESULT","type":"array"},"GENERATOR_RERANKER_IS_PROCESSING":{"outlet":"GENERATOR_RERANKER_IS_PROCESSING","type":"bool"}},"brickOutletDescriptions":{"GENERATOR_RERANKER_CONTEXT_STATE":{"default":"","en-us":"Current state of the reranker context (loading, ready, error, released)","zh-tw":"重排序上下文的當前狀態(加載中、就緒、錯誤、已釋放)","ja-jp":"リランカーコンテキストの現在の状態(読み込み中、準備完了、エラー、解放済み)"},"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS":{"default":"","en-us":"Loading progress of the reranker model (0-100)","zh-tw":"重排序模型的加載進度(0-100)","ja-jp":"リランカーモデルの読み込み進捗(0-100)"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"default":"","en-us":"Detailed information about the reranker context including instance ID and processing status","zh-tw":"關於重排序上下文的詳細信息,包括實例ID和處理狀態","ja-jp":"インスタンスIDと処理状況を含むリランカーコンテキストの詳細情報"},"GENERATOR_RERANKER_RERANK_RESULT":{"default":"","en-us":"Result of the reranking operation containing scored and ranked documents","zh-tw":"包含評分和排序文檔的重排序操作結果","ja-jp":"スコア付きおよびランク付きドキュメントを含むリランキング操作の結果"},"GENERATOR_RERANKER_IS_PROCESSING":{"default":"","en-us":"Boolean indicating whether the reranker is currently processing a request","zh-tw":"表示重排序器是否正在處理請求的布爾值","ja-jp":"リランカーが現在リクエストを処理中かどうかを示すブール値"}},"actionTypes":{"GENERATOR_RERANKER_LOAD_MODEL":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_RERANKER_RERANK":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_RERANKER_QUERY":{"name":"Query","type":"string"},"GENERATOR_RERANKER_DOCUMENTS":{"name":"Documents","type":"array"}}},"GENERATOR_RERANKER_RELEASE_CONTEXT":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_RERANKER_LOAD_MODEL":{"default":"","en-us":"Load the model","zh-tw":"讀取模型","ja-jp":"モデルを読み込む"},"GENERATOR_RERANKER_RERANK":{"default":"","en-us":"Rerank documents based on query relevance","zh-tw":"根據查詢相關性重新排序文件","ja-jp":"クエリの関連性に基づいてドキュメントを再ランキング"},"GENERATOR_RERANKER_RELEASE_CONTEXT":{"default":"","en-us":"Release context","zh-tw":"釋放上下文","ja-jp":"コンテキストを解放する"}},"scriptMemberFunctionDefs":{"load":{"arguments":[],"required":[],"return":{"type":"bool"}},"getModelInfo":{"arguments":[],"required":[],"return":{"type":"object"}},"rerank":{"arguments":[{"type":"object","name":"params","properties":{"query":{"name":"Query","type":"string"},"documents":{"name":"Documents","type":"array"},"normalize":{"name":"Normalize Scores","type":"number"},"topK":{"name":"Top K","type":"number"}}}],"required":["params"],"return":{"type":"array"}},"isProcessing":{"arguments":[],"required":[],"return":{"type":"bool"}},"release":{"arguments":[],"required":[],"return":{"type":"bool"}}},"scriptMemberFunctionDefDescriptions":{"load":{"default":"","en-us":"Load reranker model","zh-tw":"讀取重排序模型","ja-jp":"リランカーモデルを読み込む"},"getModelInfo":{"default":"","en-us":"Get reranker model information","zh-tw":"取得重排序模型資訊","ja-jp":"リランカーモデル情報を取得"},"rerank":{"default":"","en-us":"Rerank documents based on query relevance","zh-tw":"根據查詢相關性重新排序文件","ja-jp":"クエリの関連性に基づいてドキュメントを再ランキング"},"isProcessing":{"default":"","en-us":"Check if the reranker is currently processing a request","zh-tw":"檢查重排序器是否正在處理請求","ja-jp":"リランカーが現在リクエストを処理中かどうかを確認"},"release":{"default":"","en-us":"Release the reranker context","zh-tw":"釋放重排序上下文","ja-jp":"リランカーコンテキストを解放"}}}')},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9068:(e,t,a)=>{var n=a(4700);e.exports=function(e,t){var a=n(this,e),r=a.size;return a.set(e,t),this.size+=a.size==r?0:1,this}},9073:e=>{e.exports=JSON.parse('{"name":"GeneratorMCP","brickDescription":{"default":"Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link","en-us":"Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link","zh-tw":"MCP 客戶端,支援 SSE 和 Generator MCPServer 直接連接","ja-jp":"Model Context Protocol (MCP) クライアント、SSE と Generator MCPServer の直接リンクをサポート"},"brickDisplayName":"MCP","brickTip":{"default":""},"brickPreviewIcon":{"type":"material-community","name":"protocol"},"brickMeta":{"canBeGlobalGenerator":true,"scriptMember":true},"propTypes":{"globalGeneratorKey":{"type":"string"},"init":{"type":"bool"},"type":{"type":"oneOf","content":["streamable-http","sse","direct-link"],"forcePropertyBank":false},"url":{"type":"string"},"autoReconnect":{"type":"bool"},"maxReconnectAttempts":{"type":"number"},"reconnectInterval":{"type":"number"},"sseHeaders":{"type":"object"},"sendHeaders":{"type":"object"},"bearerToken":{"type":"string"},"generatorId":{"type":"string"},"generatorKey":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"},"ignoreResourceInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"ignoreToolInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"ignorePromptInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"requestTimeout":{"type":"number"}},"brickPropDescriptions":{"globalGeneratorKey":{"default":"","en-us":"Application-scoped generator key, key cannot be the same with other application-scoped generators","zh-tw":"應用程式範圍的 generator key,key 不能與其他應用程式範圍的 generator 相同","ja-jp":"アプリケーションスコープのジェネレーターキー、キーは他のアプリケーションスコープのジェネレーターと同じにできません"},"init":{"default":"","en-us":"Initialize the MCP client on start","zh-tw":"在啟動時初始化 MCP 客戶端","ja-jp":"起動時に MCP クライアントを初期化する"},"type":{"default":"","en-us":"Type of the MCP connection, e.g. sse or direct-link (generator)","zh-tw":"MCP 連接類型,例如 sse 或 direct-link (generator)","ja-jp":"MCP 接続のタイプ、例えば sse または direct-link (generator)"},"url":{"default":"","en-us":"URL of the MCP server, e.g. http://localhost:19853/sse","zh-tw":"MCP 伺服器的 URL,例如 http://localhost:19853/sse","ja-jp":"MCP サーバーの URL、例えば http://localhost:19853/sse"},"autoReconnect":{"default":"","en-us":"Whether to automatically reconnect to the MCP server","zh-tw":"是否自動重新連接到 MCP 伺服器","ja-jp":"MCP サーバーへの自動再接続を行うかどうか"},"maxReconnectAttempts":{"default":"","en-us":"Maximum number of reconnection attempts","zh-tw":"最大重連嘗試次數","ja-jp":"再接続の最大試行回数"},"reconnectInterval":{"default":"","en-us":"Reconnection interval in milliseconds","zh-tw":"重連間隔(毫秒)","ja-jp":"再接続間隔(ミリ秒)"},"sseHeaders":{"default":"","en-us":"SSE connection headers","zh-tw":"SSE 連線標頭","ja-jp":"SSE 接続ヘッダー"},"sendHeaders":{"default":"","en-us":"Send request headers","zh-tw":"傳送請求標頭","ja-jp":"リクエストヘッダーを送信"},"bearerToken":{"default":"","en-us":"Bearer token for authentication","zh-tw":"用於身份驗證的 Bearer 令牌","ja-jp":"認証用の Bearer トークン"},"generatorId":{"default":"","en-us":"Generator MCP Server ID for direct link","zh-tw":"Generator MCP Server ID,用於直接連接","ja-jp":"直接リンク用の Generator MCP Server ID"},"generatorKey":{"default":"","en-us":"Application-scoped key of Generator MCP Server for direct link (If ID is not provided)","zh-tw":"應用程式範圍的 Generator MCP Server key,用於直接連接(如果 ID 未提供)","ja-jp":"直接リンク用の Generator MCP Server のアプリケーションスコープキー(ID が提供されていない場合)"},"name":{"default":"","en-us":"Name of the MCP client","zh-tw":"MCP 客戶端的名稱","ja-jp":"MCP クライアントの名前"},"version":{"default":"","en-us":"Version of the MCP client","zh-tw":"MCP 客戶端的版本","ja-jp":"MCP クライアントのバージョン"},"ignoreResourceInList":{"default":"","en-us":"Ignore resources in list response","zh-tw":"忽略資源列表回應","ja-jp":"リスト応答内のリソースを無視する"},"ignoreToolInList":{"default":"","en-us":"Ignore tools in list response","zh-tw":"忽略工具列表回應","ja-jp":"リスト応答内のツールを無視する"},"ignorePromptInList":{"default":"","en-us":"Ignore prompts in list response","zh-tw":"忽略提示列表回應","ja-jp":"リスト応答内のプロンプトを無視する"},"requestTimeout":{"default":"","en-us":"Request timeout in milliseconds","zh-tw":"請求超時時間(毫秒)","ja-jp":"リクエストタイムアウト(ミリ秒)"}},"defaultBrickProps":{"init":false,"type":"streamable-http","url":"","autoReconnect":true,"maxReconnectAttempts":10,"reconnectInterval":1000,"generatorId":"","generatorKey":"","name":"bricks-foundation-mcp-client-default","version":"1.0.0","ignoreResourceInList":[],"ignoreToolInList":[],"ignorePromptInList":[],"requestTimeout":60000},"propertyControls":{"type":{"oneOfEmptyOption":false},"url":{"displayName":"URL","normalizeDisplayName":false},"sseHeaders":{"displayName":"SSE Headers","normalizeDisplayName":false},"generatorId":{"displayName":"Generator ID","normalizeDisplayName":false,"kind":"id","idType":"generator","idTypeFilter":["GENERATOR_MCP_SERVER"]}},"propertyControlGroups":{"sse":{"name":"Streamable-HTTP/SSE Config","type":"group","content":["url","sseHeaders","sendHeaders","bearerToken"]},"directLink":{"name":"Direct Link Config","type":"group","content":["generatorId","generatorKey"]},"client":{"name":"Client Config","type":"group","content":["name","version","ignoreToolInList","ignoreResourceInList","ignorePromptInList","requestTimeout"]}},"propertyControlGroupDescriptions":{"directLink":{"default":"","en-us":"Link to existing Generator MCPServer without network","zh-tw":"連接到現有的 Generator MCPServer 而不需要網路","ja-jp":"ネットワークなしで既存の Generator MCPServer に接続"}},"outletTypes":{"GENERATOR_MCP_CONNECTION_STATE":{"outlet":"GENERATOR_MCP_CONNECTION_STATE","type":"string"},"GENERATOR_MCP_LIST_RESOURCES_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_RESOURCES_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_RESOURCES_ERROR":{"outlet":"GENERATOR_MCP_LIST_RESOURCES_ERROR","type":"object"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR":{"outlet":"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR","type":"object"},"GENERATOR_MCP_READ_RESOURCE_RESPONSE":{"outlet":"GENERATOR_MCP_READ_RESOURCE_RESPONSE","type":"object"},"GENERATOR_MCP_READ_RESOURCE_ERROR":{"outlet":"GENERATOR_MCP_READ_RESOURCE_ERROR","type":"object"},"GENERATOR_MCP_LIST_TOOLS_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_TOOLS_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_TOOLS_ERROR":{"outlet":"GENERATOR_MCP_LIST_TOOLS_ERROR","type":"object"},"GENERATOR_MCP_CALL_TOOL_RESPONSE":{"outlet":"GENERATOR_MCP_CALL_TOOL_RESPONSE","type":"object"},"GENERATOR_MCP_CALL_TOOL_ERROR":{"outlet":"GENERATOR_MCP_CALL_TOOL_ERROR","type":"object"},"GENERATOR_MCP_LIST_PROMPTS_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_PROMPTS_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_PROMPTS_ERROR":{"outlet":"GENERATOR_MCP_LIST_PROMPTS_ERROR","type":"object"},"GENERATOR_MCP_GET_PROMPT_RESPONSE":{"outlet":"GENERATOR_MCP_GET_PROMPT_RESPONSE","type":"object"},"GENERATOR_MCP_GET_PROMPT_ERROR":{"outlet":"GENERATOR_MCP_GET_PROMPT_ERROR","type":"object"},"GENERATOR_MCP_LAST_ERROR":{"outlet":"GENERATOR_MCP_LAST_ERROR","type":"string"}},"brickOutletDescriptions":{"GENERATOR_MCP_CONNECTION_STATE":{"default":"","en-us":"Connection state","zh-tw":"連線狀態","ja-jp":"接続状態"},"GENERATOR_MCP_LIST_RESOURCES_RESPONSE":{"default":"","en-us":"List resources response","zh-tw":"列出資源回應","ja-jp":"リソースのリスト応答"},"GENERATOR_MCP_LIST_RESOURCES_ERROR":{"default":"","en-us":"List resources error","zh-tw":"列出資源錯誤","ja-jp":"リソースのリストエラー"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE":{"default":"","en-us":"List resource templates response","zh-tw":"列出資源範本回應","ja-jp":"リソーステンプレートのリスト応答"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR":{"default":"","en-us":"List resource templates error","zh-tw":"列出資源範本錯誤","ja-jp":"リソーステンプレートのリストエラー"},"GENERATOR_MCP_READ_RESOURCE_RESPONSE":{"default":"","en-us":"Read resource response","zh-tw":"讀取資源回應","ja-jp":"リソースの読み取り応答"},"GENERATOR_MCP_READ_RESOURCE_ERROR":{"default":"","en-us":"Read resource error","zh-tw":"讀取資源錯誤","ja-jp":"リソースの読み取りエラー"},"GENERATOR_MCP_LIST_TOOLS_RESPONSE":{"default":"","en-us":"List tools response","zh-tw":"列出工具回應","ja-jp":"ツールのリスト応答"},"GENERATOR_MCP_LIST_TOOLS_ERROR":{"default":"","en-us":"List tools error","zh-tw":"列出工具錯誤","ja-jp":"ツールのリストエラー"},"GENERATOR_MCP_CALL_TOOL_RESPONSE":{"default":"","en-us":"Call tool response","zh-tw":"呼叫工具回應","ja-jp":"ツールの呼び出し応答"},"GENERATOR_MCP_CALL_TOOL_ERROR":{"default":"","en-us":"Call tool error","zh-tw":"呼叫工具錯誤","ja-jp":"ツールの呼び出しエラー"},"GENERATOR_MCP_LIST_PROMPTS_RESPONSE":{"default":"","en-us":"List prompts response","zh-tw":"列出提示回應","ja-jp":"プロンプトのリスト応答"},"GENERATOR_MCP_LIST_PROMPTS_ERROR":{"default":"","en-us":"List prompts error","zh-tw":"列出提示錯誤","ja-jp":"プロンプトのリストエラー"},"GENERATOR_MCP_GET_PROMPT_RESPONSE":{"default":"","en-us":"Get prompt response","zh-tw":"獲取提示回應","ja-jp":"プロンプトの取得応答"},"GENERATOR_MCP_GET_PROMPT_ERROR":{"default":"","en-us":"Request prompt error","zh-tw":"請求提示錯誤","ja-jp":"プロンプトの取得エラー"},"GENERATOR_MCP_LAST_ERROR":{"default":"","en-us":"Last error","zh-tw":"最後的錯誤","ja-jp":"最後のエラー"}},"eventTypes":{"GENERATOR_MCP_ON_CONNECTED":"GENERATOR_MCP_ON_CONNECTED","GENERATOR_MCP_ON_CONNECTION_ERROR":"GENERATOR_MCP_ON_CONNECTION_ERROR","GENERATOR_MCP_ON_DISCONNECTED":"GENERATOR_MCP_ON_DISCONNECTED","GENERATOR_MCP_ON_LIST_RESOURCES":"GENERATOR_MCP_ON_LIST_RESOURCES","GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR","GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES","GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR","GENERATOR_MCP_ON_READ_RESOURCE":"GENERATOR_MCP_ON_READ_RESOURCE","GENERATOR_MCP_ON_READ_RESOURCE_ERROR":"GENERATOR_MCP_ON_READ_RESOURCE_ERROR","GENERATOR_MCP_ON_LIST_TOOLS":"GENERATOR_MCP_ON_LIST_TOOLS","GENERATOR_MCP_ON_LIST_TOOLS_ERROR":"GENERATOR_MCP_ON_LIST_TOOLS_ERROR","GENERATOR_MCP_ON_CALL_TOOL":"GENERATOR_MCP_ON_CALL_TOOL","GENERATOR_MCP_ON_CALL_TOOL_ERROR":"GENERATOR_MCP_ON_CALL_TOOL_ERROR","GENERATOR_MCP_ON_LIST_PROMPTS":"GENERATOR_MCP_ON_LIST_PROMPTS","GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR","GENERATOR_MCP_ON_GET_PROMPT":"GENERATOR_MCP_ON_GET_PROMPT","GENERATOR_MCP_ON_GET_PROMPT_ERROR":"GENERATOR_MCP_ON_GET_PROMPT_ERROR"},"brickEventDescriptions":{"GENERATOR_MCP_ON_CONNECTED":{"default":"","en-us":"On connected","zh-tw":"當連接時","ja-jp":"接続時"},"GENERATOR_MCP_ON_CONNECTION_ERROR":{"default":"","en-us":"On connection error","zh-tw":"當連接錯誤時","ja-jp":"接続エラー時"},"GENERATOR_MCP_ON_DISCONNECTED":{"default":"","en-us":"On disconnected","zh-tw":"當斷開連接時","ja-jp":"断開時"},"GENERATOR_MCP_ON_LIST_RESOURCES":{"default":"","en-us":"On list resources","zh-tw":"當列出資源時","ja-jp":"リソースのリスト時"},"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":{"default":"","en-us":"On list resources error","zh-tw":"當列出資源錯誤時","ja-jp":"リストエラー時"},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":{"default":"","en-us":"On list resource templates","zh-tw":"當列出資源範本時","ja-jp":"リソーステンプレートのリスト時"},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":{"default":"","en-us":"On list resource templates error","zh-tw":"當列出資源範本錯誤時","ja-jp":"リストエラー時"},"GENERATOR_MCP_ON_READ_RESOURCE":{"default":"","en-us":"On read resource","zh-tw":"當讀取資源時","ja-jp":"リソースの読み取り時"},"GENERATOR_MCP_ON_READ_RESOURCE_ERROR":{"default":"","en-us":"On read resource error","zh-tw":"當讀取資源錯誤時","ja-jp":"リソースの読み取りエラー時"},"GENERATOR_MCP_ON_LIST_TOOLS":{"default":"","en-us":"On list tools","zh-tw":"當列出工具時","ja-jp":"ツールのリスト時"},"GENERATOR_MCP_ON_LIST_TOOLS_ERROR":{"default":"","en-us":"On list tools error","zh-tw":"當列出工具錯誤時","ja-jp":"ツールのリストエラー時"},"GENERATOR_MCP_ON_CALL_TOOL":{"default":"","en-us":"On call tool","zh-tw":"當呼叫工具時","ja-jp":"ツールの呼び出し時"},"GENERATOR_MCP_ON_CALL_TOOL_ERROR":{"default":"","en-us":"On call tool error","zh-tw":"當呼叫工具錯誤時","ja-jp":"ツールの呼び出しエラー時"},"GENERATOR_MCP_ON_LIST_PROMPTS":{"default":"","en-us":"On list prompts","zh-tw":"當列出提示時","ja-jp":"プロンプトのリスト時"},"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":{"default":"","en-us":"On list prompts error","zh-tw":"當列出提示錯誤時","ja-jp":"プロンプトのリストエラー時"},"GENERATOR_MCP_ON_GET_PROMPT":{"default":"","en-us":"On get prompt","zh-tw":"當獲取提示時","ja-jp":"プロンプトの取得時"},"GENERATOR_MCP_ON_GET_PROMPT_ERROR":{"default":"","en-us":"On get prompt error","zh-tw":"當獲取提示錯誤時","ja-jp":"プロンプトの取得エラー時"}},"eventPropertyControls":{"GENERATOR_MCP_ON_CONNECTION_ERROR":{"properties":{"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_RESOURCES":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_READ_RESOURCE":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_READ_RESOURCE_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_TOOLS":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_TOOLS_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_CALL_TOOL":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_CALL_TOOL_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_PROMPTS":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_GET_PROMPT":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_GET_PROMPT_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_MCP_CONNECT":{"canProvideProperty":false},"GENERATOR_MCP_DISCONNECT":{"canProvideProperty":false},"GENERATOR_MCP_LIST_RESOURCES":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_READ_RESOURCE":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_URI":{"name":"Resource URI","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Variables","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}},"GENERATOR_MCP_LIST_TOOLS":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_CALL_TOOL":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_NAME":{"name":"Tool Name","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Variables","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}},"GENERATOR_MCP_LIST_PROMPTS":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_GET_PROMPT":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_NAME":{"name":"Prompt Name","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Arguments","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}}},"brickActionDescriptions":{"GENERATOR_MCP_CONNECT":{"default":"","en-us":"Connect to MCP server","zh-tw":"連接到 MCP 伺服器","ja-jp":"MCP サーバーに接続"},"GENERATOR_MCP_DISCONNECT":{"default":"","en-us":"Disconnect from MCP server","zh-tw":"從 MCP 伺服器斷開連接","ja-jp":"MCP サーバーから切断"},"GENERATOR_MCP_LIST_RESOURCES":{"default":"","en-us":"List resources","zh-tw":"列出資源","ja-jp":"リソースのリスト"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES":{"default":"","en-us":"List resource templates","zh-tw":"列出資源範本","ja-jp":"リソーステンプレートのリスト"},"GENERATOR_MCP_READ_RESOURCE":{"default":"","en-us":"Read resource","zh-tw":"讀取資源","ja-jp":"リソースの読み取り"},"GENERATOR_MCP_LIST_TOOLS":{"default":"","en-us":"List tools","zh-tw":"列出工具","ja-jp":"ツールのリスト"},"GENERATOR_MCP_CALL_TOOL":{"default":"","en-us":"Call tool","zh-tw":"呼叫工具","ja-jp":"ツールの呼び出し"},"GENERATOR_MCP_LIST_PROMPTS":{"default":"","en-us":"List prompts","zh-tw":"列出提示","ja-jp":"プロンプトのリスト"},"GENERATOR_MCP_GET_PROMPT":{"default":"","en-us":"Request prompt","zh-tw":"請求提示","ja-jp":"プロンプトの要求"}},"scriptMemberFunctionDefs":{"connect":{"arguments":[],"required":[],"return":{"type":"bool"}},"disconnect":{"arguments":[],"required":[],"return":{"type":"void"}},"getConnectionState":{"arguments":[],"required":[],"return":{"type":"string"}},"getLastError":{"arguments":[],"required":[],"return":{"type":"string"}},"listResources":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"listResourceTemplates":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"readResource":{"arguments":[{"type":"object","name":"options","properties":{"uri":{"name":"Resource URI","type":"string"},"variables":{"name":"Variables","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["uri"],"return":{"type":"object"}},"listTools":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"callTool":{"arguments":[{"type":"object","name":"options","properties":{"name":{"name":"Tool Name","type":"string"},"arguments":{"name":"Arguments","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["name"],"return":{"type":"object"}},"listPrompts":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"getPrompt":{"arguments":[{"type":"object","name":"options","properties":{"name":{"name":"Prompt Name","type":"string"},"arguments":{"name":"Arguments","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["name"],"return":{"type":"object"}}},"scriptMemberFunctionDefDescriptions":{"connect":{"default":"","en-us":"Connect to MCP server","zh-tw":"連接到 MCP 伺服器","ja-jp":"MCP サーバーに接続する"},"disconnect":{"default":"","en-us":"Disconnect from MCP server","zh-tw":"從 MCP 伺服器斷開連接","ja-jp":"MCP サーバーから切断する"},"getConnectionState":{"default":"","en-us":"Get connection state","zh-tw":"取得連線狀態","ja-jp":"接続状態を取得する"},"getLastError":{"default":"","en-us":"Get last error","zh-tw":"取得最後的錯誤","ja-jp":"最後のエラーを取得する"},"listResources":{"default":"","en-us":"List resources from MCP server","zh-tw":"列出 MCP 伺服器的資源","ja-jp":"MCP サーバーからリソースをリストする"},"listResourceTemplates":{"default":"","en-us":"List resource templates from MCP server","zh-tw":"列出 MCP 伺服器的資源範本","ja-jp":"MCP サーバーからリソーステンプレートをリストする"},"readResource":{"default":"","en-us":"Read a resource from MCP server","zh-tw":"從 MCP 伺服器讀取資源","ja-jp":"MCP サーバーからリソースを読み取る"},"listTools":{"default":"","en-us":"List tools from MCP server","zh-tw":"列出 MCP 伺服器的工具","ja-jp":"MCP サーバーからツールをリストする"},"callTool":{"default":"","en-us":"Call a tool on MCP server","zh-tw":"呼叫 MCP 伺服器上的工具","ja-jp":"MCP サーバー上のツールを呼び出す"},"listPrompts":{"default":"","en-us":"List prompts from MCP server","zh-tw":"列出 MCP 伺服器的提示","ja-jp":"MCP サーバーからプロンプトをリストする"},"getPrompt":{"default":"","en-us":"Get a prompt from MCP server","zh-tw":"從 MCP 伺服器取得提示","ja-jp":"MCP サーバーからプロンプトを取得する"}}}')},9074:(e,t,a)=>{a.d(t,{C:()=>d});var n=a(9212),r=a(3673),i=a(6192),o=a(6878),s=a(8414);function p(e,t){return t?t(e):r.c.of()}function l(e){return"function"==typeof e?new d(e):e}function u(e){return e.request.length<=1}var d=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return r.c.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(l).reduce(function(e,t){return e.concat(t)})},e.split=function(t,a,n){var i,o=l(a),s=l(n||new e(p));return i=u(o)&&u(s)?new e(function(e){return t(e)?o.request(e)||r.c.of():s.request(e)||r.c.of()}):new e(function(e,a){return t(e)?o.request(e,a)||r.c.of():s.request(e,a)||r.c.of()}),Object.assign(i,{left:o,right:s})},e.execute=function(e,t){return e.request((0,o.k)(t.context,(0,s.A)((0,i.K)(t))))||r.c.of()},e.concat=function(t,a){var i=l(t);if(u(i))return!1!==globalThis.__DEV__&&n.invariant.warn(38,i),i;var o,s=l(a);return o=u(s)?new e(function(e){return i.request(e,function(e){return s.request(e)||r.c.of()})||r.c.of()}):new e(function(e,t){return i.request(e,function(e){return s.request(e,t)||r.c.of()})||r.c.of()}),Object.assign(o,{left:i,right:s})},e.prototype.split=function(t,a,n){return this.concat(e.split(t,a,n||new e(p)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw(0,n.newInvariantError)(39)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},9122:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(1708);function r(){const{env:e}=n,{TERM:t,TERM_PROGRAM:a}=e;return"win32"!==n.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===a||"vscode"===a||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}},9212:(e,t,a)=>{a.d(t,{DEV:()=>h,InvariantError:()=>n.InvariantError,__DEV__:()=>h,global:()=>o,invariant:()=>l,maybe:()=>i,newInvariantError:()=>u}),a.r(t);var n=a(9371),r=a(3972);function i(e){try{return e()}catch(e){}}const o=i(function(){return globalThis})||i(function(){return window})||i(function(){return self})||i(function(){return global})||i(function(){return i.constructor("return this")()});var s=a(6563);function p(e){return function(t){for(var a=[],n=1;n<arguments.length;n++)a[n-1]=arguments[n];if("number"==typeof t){var r=t;(t=m(r))||(t=f(r,a),a=[])}e.apply(void 0,[t].concat(a))}}var l=Object.assign(function(e,t){for(var a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];e||(0,n.invariant)(e,m(t,a)||f(t,a))},{debug:p(n.invariant.debug),log:p(n.invariant.log),warn:p(n.invariant.warn),error:p(n.invariant.error)});function u(e){for(var t=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];return new n.InvariantError(m(e,t)||f(e,t))}var d=Symbol.for("ApolloErrorMessageHandler_"+r.r);function c(e){if("string"==typeof e)return e;try{return(0,s.p)(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function m(e,t){if(void 0===t&&(t=[]),e)return o[d]&&o[d](e,t.map(c))}function f(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:r.r,message:e,args:t.map(c)})))}var h=!1!==globalThis.__DEV__},9218:e=>{e.exports=JSON.parse('{"name":"GeneratorUDP","brickDescription":{"default":"","en-us":"TCP Server","zh-tw":"TCP 伺服器","ja-jp":"TCPサーバー"},"brickDisplayName":"UDP","brickTip":{"default":""},"brickMeta":{"scriptMember":true},"brickPreviewIcon":{"type":"material-community","name":"network-outline"},"propTypes":{"init":{"type":"bool"},"type":{"type":"oneOf","content":["udp4","udp6"],"forcePropertyBank":false},"encoding":{"type":"oneOf","content":["base64","utf8","ascii"],"forcePropertyBank":false},"localPort":{"type":"number"},"broadcast":{"type":"bool"},"multicast":{"type":"string"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Bind port on generator initialized","zh-tw":"Generator 初始化後直接啟動","ja-jp":"ジェネレータの初期化時にポートをバインドする"},"type":{"default":"","en-us":"The family of socket","zh-tw":"接口種類","ja-jp":"ソケットファミリー"},"encoding":{"default":"","en-us":"Encoding of data","zh-tw":"資料編碼","ja-jp":"データのエンコーディング"},"localPort":{"default":"","en-us":"Local bind port of UDP (0 or empty is random)","zh-tw":"UDP 本地連接埠(0 或留空為隨機)","ja-jp":"UDPのローカルバインドポート(0または空は任意)"},"broadcast":{"default":"","en-us":"Enable receive broadcast packets","zh-tw":"啟動接收廣播封包","ja-jp":"ブロードキャストパケットの受信を有効にする"},"multicast":{"default":"","en-us":"Join multicast group (Multicast address)","zh-tw":"加入多播群組(多播位置)","ja-jp":"マルチキャストグループに参加する(マルチキャストアドレス)"}},"defaultBrickProps":{"init":false,"type":"udp4","encoding":"base64","broadcast":false,"multicast":""},"propertyControls":{"localPort":{"required":true}},"outletTypes":{"GENERATOR_UDP_PORT":{"outlet":"GENERATOR_UDP_PORT","type":"number"},"GENERATOR_UDP_LAST_RECEIVE":{"outlet":"GENERATOR_UDP_LAST_RECEIVE","type":"object"},"GENERATOR_UDP_ERROR_MESSAGE":{"outlet":"GENERATOR_UDP_ERROR_MESSAGE","type":"string"}},"brickOutletDescriptions":{"GENERATOR_UDP_PORT":{"default":"","en-us":"Local UDP binded port","zh-tw":"本地 UDP 連接埠","ja-jp":"ローカルUDPバインドポート"},"GENERATOR_UDP_LAST_RECEIVE":{"default":"","en-us":"Last received packet","zh-tw":"最後收到的封包","ja-jp":"最後に受信したパケット"},"GENERATOR_UDP_ERROR_MESSAGE":{"default":"","en-us":"Error message","zh-tw":"錯誤訊息","ja-jp":"エラーメッセージ"}},"eventTypes":{"GENERATOR_UDP_ON_READY":"GENERATOR_UDP_ON_READY","GENERATOR_UDP_ON_DATA":"GENERATOR_UDP_ON_DATA","GENERATOR_UDP_ON_CLOSE":"GENERATOR_UDP_ON_CLOSE","GENERATOR_UDP_ON_ERROR":"GENERATOR_UDP_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_UDP_ON_READY":{"default":"","en-us":"Event of UDP port is binded","zh-tw":"當 UDP 伺服器啟動完成時觸發事件","ja-jp":"UDPポートがバインドされた時のイベント"},"GENERATOR_UDP_ON_DATA":{"default":"","en-us":"Event of receive data","zh-tw":"當收到資料時觸發事件","ja-jp":"データを受信した時のイベント"},"GENERATOR_UDP_ON_CLOSE":{"default":"","en-us":"Event of socket closeed","zh-tw":"當接口結束時觸發事件","ja-jp":"ソケットが閉じられた時のイベント"},"GENERATOR_UDP_ON_ERROR":{"default":"","en-us":"Event of socket error","zh-tw":"當接口發生錯誤時觸發事件","ja-jp":"ソケットエラー発生時のイベント"}},"eventPropertyControls":{"GENERATOR_UDP_ON_DATA":{"properties":{"GENERATOR_UDP_REMOTE_ADDRESS":{"name":"Address","type":"string"},"GENERATOR_UDP_REMOTE_PORT":{"name":"Port","type":"number"},"GENERATOR_UDP_DATA":{"name":"Data","type":"string"}}},"GENERATOR_UDP_ON_ERROR":{"properties":{"GENERATOR_UDP_ERROR_MESSAGE":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_UDP_BIND":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_UDP_SEND":{"disallowMultiple":false,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_UDP_TARGET_HOST":{"name":"Host","type":"string"},"GENERATOR_UDP_TARGET_PORT":{"name":"Port","type":"number"},"GENERATOR_UDP_SEND_DATA":{"name":"Data","type":"string"}}},"GENERATOR_UDP_CLOSE":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_UDP_BIND":{"default":"","en-us":"Bind UDP port","zh-tw":"綁定 UDP 連接埠","ja-jp":"UDPポートをバインドする"},"GENERATOR_UDP_SEND":{"default":"","en-us":"Send data to target","zh-tw":"傳送資料到目標位置","ja-jp":"ターゲットにデータを送信する"},"GENERATOR_UDP_CLOSE":{"default":"","en-us":"Close UDP","zh-tw":"關閉 UDP","ja-jp":"UDPを閉じる"}},"scriptMemberFunctionDefs":{"getStatus":{"arguments":[],"required":[],"return":{"type":"object"}},"bind":{"arguments":[],"required":[],"return":{"type":"void"}},"send":{"arguments":[{"name":"data","type":"string"}],"required":[],"return":{"type":"void"}},"close":{"arguments":[],"required":[],"return":{"type":"void"}}},"scriptMemberFunctionDefDescriptions":{"getStatus":{"default":"","en-us":"Get the status of the UDP","zh-tw":"取得 UDP 的狀態","ja-jp":"UDPの状態を取得"},"bind":{"default":"","en-us":"Bind the UDP port","zh-tw":"綁定 UDP 連接埠","ja-jp":"UDPポートをバインドする"},"send":{"default":"","en-us":"Send data to the UDP","zh-tw":"傳送資料到 UDP","ja-jp":"UDPにデータを送信する"},"close":{"default":"","en-us":"Close the UDP","zh-tw":"關閉 UDP","ja-jp":"UDPを閉じる"}}}')},9220:e=>{e.exports=JSON.parse('{"name":"BrickVideoStreaming","brickDescription":{"default":"Brick video streaming component, supports RTSP / RTMP streaming."},"brickDisplayName":"Video Streaming","brickTip":{"default":"@brick-tip-video-streaming","en-us":"Add Video Streaming with URI, Cache, Ratio, etc. setting.","zh-tw":"串流影片元件,可透過 URI 設定來源,另可變更快取、比例等多種控制設定","ja-jp":"URI、キャッシュ、比率などの設定でビデオストリーミングを追加します。"},"brickMeta":{"pressable":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"tower-broadcast"},"propTypes":{"uri":{"type":"string","isRequired":true},"networkCaching":{"type":"number"},"paused":{"type":"bool"},"volume":{"type":"number"},"muted":{"type":"bool"},"autoAspectRatio":{"type":"bool"},"aspectRatio":{"type":"string"},"repeat":{"type":"bool"},"replayOnError":{"type":"bool"},"replayTimeout":{"type":"number"}},"brickPropDescriptions":{"uri":{"default":"","en-us":"The video path list or single path (File, URL)","zh-tw":"Video 的播放清單或單一檔案 (File, URL)","ja-jp":"ビデオのパスリストまたは単一パス(ファイル、URL)"},"networkCaching":{"default":"","en-us":"Set cache time from streaming (You can adjust according to network conditions), it will delay the playing.","zh-tw":"設置快取時間(你可以視網路情況調整),如此將會延遲播放時間","ja-jp":"ストリーミングからキャッシュ時間を設定します(ネットワーク状況に応じて調整可能)、再生が遅延します。"},"paused":{"default":"","en-us":"Controls whether the video is paused","zh-tw":"控制影片是否暂停","ja-jp":"ビデオが一時停止しているかどうかを制御"},"volume":{"default":"","en-us":"Volume","zh-tw":"音量","ja-jp":"音量"},"muted":{"default":"","en-us":"Muted","zh-tw":"靜音","ja-jp":"ミュート"},"autoAspectRatio":{"default":"","en-us":"Video Auto Aspect Ratio","zh-tw":"自動寬高比","ja-jp":"ビデオの自動アスペクト比"},"aspectRatio":{"default":"","en-us":"Video Aspect Ratio","zh-tw":"影片寬高比","ja-jp":"ビデオのアスペクト比"},"repeat":{"default":"","en-us":"Repeat the video path list","zh-tw":"重播影片清單","ja-jp":"ビデオパスリストを繰り返す"},"replayOnError":{"default":"","en-us":"Replay on playing error","zh-tw":"重播影片清單","ja-jp":"再生エラー時に再生"},"replayTimeout":{"default":"","en-us":"Timeout to replay if repeat or replayOnError is true and video is end or error","zh-tw":"如果影片結束或錯誤且 repeat 或 replayOnError 為 true,需要等待的重播時間","ja-jp":"repeatまたはreplayOnErrorがtrueで、ビデオが終了またはエラーの場合の再生タイムアウト"}},"defaultBrickProps":{"networkCaching":300,"paused":false,"volume":100,"muted":false,"replayTimeout":500},"propertyControls":{"uri":{"displayName":"URI","normalizeDisplayName":false,"resetOnTemplateChange":true,"required":true,"validator":{"fn":"uri","protocols":["https?","rtsp","rtmps?","rtmpt","rtmpe","rtmfp"]}},"replayTimeout":{"kind":"unit","min":0,"unit":"ms"},"resizeMode":{"resetOnTemplateChange":true},"volume":{"kind":"unit","min":0,"max":100,"unit":"%","step":5}},"eventTypes":{"BRICK_VIDEO_STREAMING_ON_PRESS":"BRICK_VIDEO_STREAMING_ON_PRESS","BRICK_VIDEO_STREAMING_ON_PRESS_IN":"BRICK_VIDEO_STREAMING_ON_PRESS_IN","BRICK_VIDEO_STREAMING_ON_PRESS_OUT":"BRICK_VIDEO_STREAMING_ON_PRESS_OUT","BRICK_VIDEO_STREAMING_ON_LONG_PRESS":"BRICK_VIDEO_STREAMING_ON_LONG_PRESS","BRICK_VIDEO_STREAMING_ON_FOCUS":"BRICK_VIDEO_STREAMING_ON_FOCUS","BRICK_VIDEO_STREAMING_ON_BLUR":"BRICK_VIDEO_STREAMING_ON_BLUR","BRICK_VIDEO_STREAMING_ON_END":"BRICK_VIDEO_STREAMING_ON_END","BRICK_VIDEO_STREAMING_ON_LOAD":"BRICK_VIDEO_STREAMING_ON_LOAD","BRICK_VIDEO_STREAMING_ON_ERROR":"BRICK_VIDEO_STREAMING_ON_ERROR"},"brickEventDescriptions":{"BRICK_VIDEO_STREAMING_ON_PRESS":{"default":"","en-us":"Event of the brick press","zh-tw":"當 brick 被點擊時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_PRESS_IN":{"default":"","en-us":"Event of the brick press in","zh-tw":"當 brick 被按下時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_PRESS_OUT":{"default":"","en-us":"Event of the brick press out","zh-tw":"當 brick 按下後被放開時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_LONG_PRESS":{"default":"","en-us":"Event of the brick long press","zh-tw":"當 brick 被長按時觸發","ja-jp":"ブリックが長押しされたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_FOCUS":{"default":"","en-us":"Event of the brick focus (Use TV Device with controller)","zh-tw":"當 brick 獲得焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを獲得したときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_VIDEO_STREAMING_ON_BLUR":{"default":"","en-us":"Event of the brick blur (Use TV Device with controller)","zh-tw":"當 brick 失去焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを失ったときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_VIDEO_STREAMING_ON_END":{"default":"","en-us":"Event on plays of path are end","zh-tw":"當 path 完全播放完畢時觸發事件","ja-jp":"パスの再生が終了した時のイベント"},"BRICK_VIDEO_STREAMING_ON_LOAD":{"default":"","en-us":"Event on plays of path are end","zh-tw":"當影片讀取完成時觸發事件","ja-jp":"ビデオの読み込みが完了した時のイベント"},"BRICK_VIDEO_STREAMING_ON_ERROR":{"default":"","en-us":"Event of the video playing error","zh-tw":"當影片讀取錯誤時觸發事件","ja-jp":"ビデオ再生エラー時のイベント"}},"eventPropertyControls":{},"outletTypes":{"BRICK_PRESSING":{"outlet":"BRICK_PRESSING","type":"bool"},"BRICK_FOCUSING":{"outlet":"BRICK_FOCUSING","type":"bool"}},"brickOutletDescriptions":{"BRICK_PRESSING":{"default":"","en-us":"Brick is pressing","zh-tw":"Brick 被按住中","ja-jp":"ブリックが押されています"},"BRICK_FOCUSING":{"default":"","en-us":"Brick is focusing (Use TV Device with controller)","zh-tw":"Brick 處於焦點狀態中 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスされています (TV デバイスとコントローラーを使用)"}}}')},9222:(e,t,a)=>{a.d(t,{D:()=>U});var n=a(5608),r=a(9212),i=a(7634),o=a(5888),s=a(2495),p=a(5702),l=a(9354),u=a(3925),d=a(555),c=a(4214),m=a(8678),f=a(8907),h=a(2455),_=a(1360),y=a(492),E=a(3777),T=a(671),g=a(2307),v=a(2904),R=a(7236),b=a(1777),O=a(3906),N=a(5207),A=a(3767),S=a(4592);var w=function(){function e(){this.known=new(_.En?WeakSet:Set),this.pool=new S.Trie(_.et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return(0,b.U)(e)&&this.known.has(e)},e.prototype.pass=function(e){if((0,b.U)(e)){var t=function(e){return(0,b.U)(e)?(0,A.c)(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if((0,b.U)(e)){var a=this.passes.get(e);if(a)return a;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(s=this.pool.lookupArray(n)).array||(this.known.add(s.array=n),!1!==globalThis.__DEV__&&Object.freeze(n)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var r=Object.getPrototypeOf(e),i=[r],o=this.sortedKeys(e);i.push(o.json);var s,p=i.length;if(o.sorted.forEach(function(a){i.push(t.admit(e[a]))}),!(s=this.pool.lookupArray(i)).object){var l=s.object=Object.create(r);this.known.add(l),o.sorted.forEach(function(e,t){l[e]=i[p+t]}),!1!==globalThis.__DEV__&&Object.freeze(l)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),a=this.pool.lookupArray(t);if(!a.keys){t.sort();var n=JSON.stringify(t);(a.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,a.keys={sorted:t,json:n})}return a.keys},e}();function I(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var C=function(){function e(e){var t=this;this.knownResults=new(_.et?WeakMap:Map),this.config=(0,y.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:(0,N.Xx)(e)}),this.canon=e.canon||new w,this.executeSelectionSet=(0,i.wrap)(function(e){var a,r=e.context.canonizeResults,i=I(e);i[3]=!r;var o=(a=t.executeSelectionSet).peek.apply(a,i);return o?r?(0,n.__assign)((0,n.__assign)({},o),{result:t.canon.admit(o.result)}):o:((0,O.M2)(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:I,makeCacheKey:function(e,t,a,n){if((0,O.$7)(a.store))return a.store.makeCacheKey(e,(0,f.A_)(t)?t.__ref:t,a.varString,n)}}),this.executeSubSelectedArray=(0,i.wrap)(function(e){return(0,O.M2)(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,a=e.array,n=e.context;if((0,O.$7)(n.store))return n.store.makeCacheKey(t,a,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new w},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,a=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,s=e.returnPartialData,l=void 0===s||s,u=e.canonizeResults,d=void 0===u?this.config.canonizeResults:u,m=this.config.cache.policies;o=(0,n.__assign)((0,n.__assign)({},(0,E.wY)((0,E.AT)(a))),o);var h,_=(0,f.WU)(i),y=this.executeSelectionSet({selectionSet:(0,E.Vn)(a).selectionSet,objectOrReference:_,enclosingRef:_,context:(0,n.__assign)({store:t,query:a,policies:m,variables:o,varString:(0,c.M)(o),canonizeResults:d},(0,N.lq)(a,this.config.fragments))});if(y.missing&&(h=[new p.Z(D(y.missing),y.missing,a,o)],!l))throw h[0];return{result:y.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,a,n){if((0,O.$7)(n.store)&&this.knownResults.get(e)===a){var r=this.executeSelectionSet.peek(a,t,n,this.canon.isKnown(e));if(r&&e===r.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,a=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if((0,f.A_)(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,p=o.variables,l=o.policies,d=o.store.getFieldValue(n,"__typename"),c=[],m=new T.ZI;function _(e,t){var a;return e.missing&&(s=m.merge(s,((a={})[t]=e.missing,a))),e.result}this.config.addTypename&&"string"==typeof d&&!l.rootIdsByTypename[d]&&c.push({__typename:d});var y=new Set(a.selections);y.forEach(function(e){var a,E;if((0,g.MS)(e,p))if((0,f.dt)(e)){var T=l.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),R=(0,f.ue)(e);void 0===T?u.XY.added(e)||(s=m.merge(s,((a={})[R]="Can't find field '".concat(e.name.value,"' on ").concat((0,f.A_)(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),a))):(0,A.c)(T)?T.length>0&&(T=_(t.executeSubSelectedArray({field:e,array:T,enclosingRef:i,context:o}),R)):e.selectionSet?null!=T&&(T=_(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:T,enclosingRef:(0,f.A_)(T)?T:i,context:o}),R)):o.canonizeResults&&(T=t.canon.pass(T)),void 0!==T&&c.push(((E={})[R]=T,E))}else{var b=(0,v.HQ)(e,o.lookupFragment);if(!b&&e.kind===h.b.FRAGMENT_SPREAD)throw(0,r.newInvariantError)(10,e.name.value);b&&l.fragmentMatches(b,d)&&b.selectionSet.selections.forEach(y.add,y)}});var E={result:(0,T.IM)(c),missing:s},b=o.canonizeResults?this.canon.admit(E):(0,R.G)(E);return b.result&&this.knownResults.set(b.result,a),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,a=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,p=new T.ZI;function l(e,a){var n;return e.missing&&(t=p.merge(t,((n={})[a]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,A.c)(e)?l(a.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?l(a.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:(0,f.A_)(e)?e:o,context:s}),t):(!1!==globalThis.__DEV__&&function(e,t,a){if(!t.selectionSet){var n=new Set([a]);n.forEach(function(a){(0,b.U)(a)&&((0,r.invariant)(!(0,f.A_)(a),11,(0,N.Ui)(e,a),t.name.value),Object.values(a).forEach(n.add,n))})}}(s.store,n,e),e)}),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function D(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(e){return e}}var P=a(906),j=a(8338);function k(e,t,a){var r="".concat(t).concat(a),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===a?e:(0,n.__assign)((0,n.__assign)({},e),{clientOnly:t,deferred:a})),i}var x=function(){function e(e,t,a){this.cache=e,this.reader=t,this.fragments=a}return e.prototype.writeToStore=function(e,t){var a=this,i=t.query,s=t.result,p=t.dataId,l=t.variables,u=t.overwrite,d=(0,E.Vu)(i),m=(0,N.mv)();l=(0,n.__assign)((0,n.__assign)({},(0,E.wY)(d)),l);var h=(0,n.__assign)((0,n.__assign)({store:e,written:Object.create(null),merge:function(e,t){return m.merge(e,t)},variables:l,varString:(0,c.M)(l)},(0,N.lq)(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),_=this.processSelectionSet({result:s||Object.create(null),dataId:p,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:h});if(!(0,f.A_)(_))throw(0,r.newInvariantError)(12,s);return h.incomingById.forEach(function(t,i){var s=t.storeObject,p=t.mergeTree,l=t.fieldNodeSet,u=(0,f.WU)(i);if(p&&p.map.size){var d=a.applyMerges(p,u,s,h);if((0,f.A_)(d))return;s=d}if(!1!==globalThis.__DEV__&&!h.overwrite){var c=Object.create(null);l.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});Object.keys(s).forEach(function(e){(function(e){return!0===c[(0,N.iJ)(e)]})(e)&&!function(e){var t=p&&p.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,a,i){var s=function(e){var t=i.getFieldValue(e,a);return"object"==typeof t&&t},p=s(e);if(!p)return;var l=s(t);if(!l)return;if((0,f.A_)(p))return;if((0,o.equal)(p,l))return;if(Object.keys(p).every(function(e){return void 0!==i.getFieldValue(l,e)}))return;var u=i.getFieldValue(e,"__typename")||i.getFieldValue(t,"__typename"),d=(0,N.iJ)(a),c="".concat(u,".").concat(d);if(z.has(c))return;z.add(c);var m=[];(0,A.c)(p)||(0,A.c)(l)||[p,l].forEach(function(e){var t=i.getFieldValue(e,"__typename");"string"!=typeof t||m.includes(t)||m.push(t)});!1!==globalThis.__DEV__&&r.invariant.warn(15,d,u,m.length?"either ensure all objects of type "+m.join(" and ")+" have an ID or a custom merge function, or ":"",c,(0,n.__assign)({},p),(0,n.__assign)({},l))}(u,s,e,h.store)})}e.merge(i,s)}),e.retain(_.__ref),_},e.prototype.processSelectionSet=function(e){var t=this,a=e.dataId,i=e.result,o=e.selectionSet,s=e.context,p=e.mergeTree,l=this.cache.policies,d=Object.create(null),c=a&&l.rootTypenamesById[a]||(0,f.D$)(i,o,s.fragmentMap)||a&&s.store.get(a,"__typename");"string"==typeof c&&(d.__typename=c);var m=function(){var e=(0,j.m)(arguments,d,s.variables);if((0,f.A_)(e.from)){var t=s.incomingById.get(e.from.__ref);if(t){var a=l.readField((0,n.__assign)((0,n.__assign)({},e),{from:t.storeObject}),s);if(void 0!==a)return a}}return l.readField(e,s)},h=new Set;this.flattenFields(o,i,s,c).forEach(function(e,a){var n,o=(0,f.ue)(a),s=i[o];if(h.add(a),void 0!==s){var _=l.getStoreFieldName({typename:c,fieldName:a.name.value,field:a,variables:e.variables}),y=M(p,_),E=t.processFieldValue(s,a,a.selectionSet?k(e,!1,!1):e,y),T=void 0;a.selectionSet&&((0,f.A_)(E)||(0,N.d1)(E))&&(T=m("__typename",E));var g=l.getMergeFunction(c,a.name.value,T);g?y.info={field:a,typename:c,merge:g}:B(p,_),d=e.merge(d,((n={})[_]=E,n))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||u.XY.added(a)||l.getReadFunction(c,a.name.value)||!1!==globalThis.__DEV__&&r.invariant.error(13,(0,f.ue)(a),i)});try{var _=l.identify(i,{typename:c,selectionSet:o,fragmentMap:s.fragmentMap,storeObject:d,readField:m}),y=_[0],E=_[1];a=a||y,E&&(d=s.merge(d,E))}catch(e){if(!a)throw e}if("string"==typeof a){var T=(0,f.WU)(a),g=s.written[a]||(s.written[a]=[]);if(g.indexOf(o)>=0)return T;if(g.push(o),this.reader&&this.reader.isFresh(i,T,o,s))return T;var v=s.incomingById.get(a);return v?(v.storeObject=s.merge(v.storeObject,d),v.mergeTree=G(v.mergeTree,p),h.forEach(function(e){return v.fieldNodeSet.add(e)})):s.incomingById.set(a,{storeObject:d,mergeTree:F(p)?void 0:p,fieldNodeSet:h}),T}return d},e.prototype.processFieldValue=function(e,t,a,n){var r=this;return t.selectionSet&&null!==e?(0,A.c)(e)?e.map(function(e,i){var o=r.processFieldValue(e,t,a,M(n,i));return B(n,i),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:a,mergeTree:n}):!1!==globalThis.__DEV__?(0,P.m)(e):e},e.prototype.flattenFields=function(e,t,a,n){void 0===n&&(n=(0,f.D$)(t,e,a.fragmentMap));var i=new Map,o=this.cache.policies,s=new S.Trie(!1);return function e(p,l){var u=s.lookup(p,l.clientOnly,l.deferred);u.visited||(u.visited=!0,p.selections.forEach(function(s){if((0,g.MS)(s,a.variables)){var p=l.clientOnly,u=l.deferred;if(p&&u||!(0,A.E)(s.directives)||s.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(p=!0),"defer"===t){var n=(0,f.MB)(e,a.variables);n&&!1===n.if||(u=!0)}}),(0,f.dt)(s)){var d=i.get(s);d&&(p=p&&d.clientOnly,u=u&&d.deferred),i.set(s,k(a,p,u))}else{var c=(0,v.HQ)(s,a.lookupFragment);if(!c&&s.kind===h.b.FRAGMENT_SPREAD)throw(0,r.newInvariantError)(14,s.name.value);c&&o.fragmentMatches(c,n,t,a.variables)&&e(c.selectionSet,k(a,p,u))}}}))}(e,a),i},e.prototype.applyMerges=function(e,t,a,i,o){var s,p=this;if(e.map.size&&!(0,f.A_)(a)){var l,u=(0,A.c)(a)||!(0,f.A_)(t)&&!(0,N.d1)(t)?void 0:t,d=a;u&&!o&&(o=[(0,f.A_)(u)?u.__ref:u]);var c=function(e,t){return(0,A.c)(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var a=c(u,t),n=c(d,t);if(void 0!==n){o&&o.push(t);var s=p.applyMerges(e,a,n,i,o);s!==n&&(l=l||new Map).set(t,s),o&&(0,r.invariant)(o.pop()===t)}}),l&&(a=(0,A.c)(d)?d.slice(0):(0,n.__assign)({},d),l.forEach(function(e,t){a[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,a,e.info,i,o&&(s=i.store).getStorage.apply(s,o)):a},e}(),L=[];function M(e,t){var a=e.map;return a.has(t)||a.set(t,L.pop()||{map:new Map}),a.get(t)}function G(e,t){if(e===t||!t||F(t))return e;if(!e||F(e))return t;var a=e.info&&t.info?(0,n.__assign)((0,n.__assign)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:a,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,a){i.map.set(a,G(e,t.map.get(a))),o.delete(a)}),o.forEach(function(a){i.map.set(a,G(t.map.get(a),e.map.get(a)))})}return i}function F(e){return!e||!(e.info||e.map.size)}function B(e,t){var a=e.map,n=a.get(t);n&&F(n)&&(L.push(n),a.delete(t))}var z=new Set;var V=a(777),$=a(4114),U=function(e){function t(t){void 0===t&&(t={});var a=e.call(this)||this;return a.watches=new Set,a.addTypenameTransform=new l.c(u.XY),a.assumeImmutableResults=!0,a.makeVar=V.UT,a.txCount=0,a.config=(0,N.I6)(t),a.addTypename=!!a.config.addTypename,a.policies=new j.l({cache:a,dataIdFromObject:a.config.dataIdFromObject,possibleTypes:a.config.possibleTypes,typePolicies:a.config.typePolicies}),a.init(),a}return(0,n.__extends)(t,e),t.prototype.init=function(){var e=this.data=new O.D_.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,a=this.storeReader,n=this.config.fragments;this.storeWriter=new x(this,this.storeReader=new C({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:(0,N.Xx)(this.config),canon:e?void 0:a&&a.canon,fragments:n}),n),this.maybeBroadcastWatch=(0,i.wrap)(function(e,a){return t.broadcastWatch(e,a)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var a=e.optimistic?t.optimisticData:t.data;if((0,O.$7)(a)){var n=e.optimistic,r=e.id,i=e.variables;return a.makeCacheKey(e.query,e.callback,(0,c.M)({optimistic:n,id:r,variables:i}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,a=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:a})).result||null}catch(e){if(e instanceof p.Z)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(N.$3.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||(0,V.MS)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&(0,V.WR)(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;c.M.reset(),m.y.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var a=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),a},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if((0,f.A_)(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&r.invariant.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(N.$3.call(e,"id"))return!1;e=(0,n.__assign)((0,n.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),c.M.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),(0,V.WR)(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,a=this,r=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,p=e.onWatchUpdated,l=function(e){var n=a,i=n.data,o=n.optimisticData;++a.txCount,e&&(a.data=a.optimisticData=e);try{return t=r(a)}finally{--a.txCount,a.data=i,a.optimisticData=o}},u=new Set;return p&&!this.txCount&&this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,l):!1===o?l(this.data):l(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),p&&u.size?(this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e,t){var a=p.call(this,e,t);return!1!==a&&u.delete(e),a}})),u.size&&u.forEach(function(e){return a.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.fragmentMatches=function(e,t){return this.policies.fragmentMatches(e,t)},t.prototype.lookupFragment=function(e){var t;return(null===(t=this.config.fragments)||void 0===t?void 0:t.lookup(e))||null},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(a){return t.maybeBroadcastWatch(a,e)})},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var a=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,a))||a&&(0,o.equal)(a.result,n.result)||e.callback(e.lastDiff=n,a)},t}(s.k);!1!==globalThis.__DEV__&&(U.prototype.getMemoryInternals=$.cM)},9283:(e,t,a)=>{a.r(t),a.d(t,{disableWarningsSlot:()=>n.yV,maskFragment:()=>r.z,maskOperation:()=>i.m});var n=a(7150),r=a(2959),i=a(8354)},9348:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=a(7898),r=a(3036),i=a(4450),o=a(9409);function s(e){const{gen:t,data:a,it:r}=e;t.if(r.parentData,()=>t.assign(a,n._`${r.parentData}[${r.parentDataProperty}]`))}function p(e,t,a){if(void 0===a)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof a?{ref:a}:{ref:a,code:(0,n.stringify)(a)})}t.macroKeywordCode=function(e,t){const{gen:a,keyword:r,schema:i,parentSchema:o,it:s}=e,l=t.macro.call(s.self,i,o,s),u=p(a,r,l);!1!==s.opts.validateSchema&&s.self.validateSchema(l,!0);const d=a.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var a;const{gen:l,keyword:u,schema:d,parentSchema:c,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,d,c,f):t.validate,_=p(l,u,h),y=l.let("valid");function E(a=(t.async?n._`await `:n.nil)){const o=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in t&&!m||!1===t.schema);l.assign(y,n._`${a}${(0,i.callValidateCode)(e,_,o,s)}`,t.modifying)}function T(e){var a;l.if((0,n.not)(null!==(a=t.valid)&&void 0!==a?a:y),e)}e.block$data(y,function(){if(!1===t.errors)E(),t.modifying&&s(e),T(()=>e.error());else{const a=t.async?function(){const e=l.let("ruleErrs",null);return l.try(()=>E(n._`await `),t=>l.assign(y,!1).if(n._`${t} instanceof ${f.ValidationError}`,()=>l.assign(e,n._`${t}.errors`),()=>l.throw(t))),e}():function(){const e=n._`${_}.errors`;return l.assign(e,null),E(n.nil),e}();t.modifying&&s(e),T(()=>function(e,t){const{gen:a}=e;a.if(n._`Array.isArray(${t})`,()=>{a.assign(r.default.vErrors,n._`${r.default.vErrors} === null ? ${t} : ${r.default.vErrors}.concat(${t})`).assign(r.default.errors,n._`${r.default.vErrors}.length`),(0,o.extendErrors)(e)},()=>e.error())}(e,a))}}),e.ok(null!==(a=t.valid)&&void 0!==a?a:y)},t.validSchemaType=function(e,t,a=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||a&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:a,errSchemaPath:n},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const o=r.dependencies;if(null==o?void 0:o.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(r.validateSchema){if(!r.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+a.errorsText(r.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);a.logger.error(e)}}}},9354:(e,t,a)=>{a.d(t,{c:()=>d});var n=a(4592),r=a(1360),i=a(3777),o=a(9212),s=a(4019),p=a(7634),l=a(555);function u(e){return e}var d=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=r.En?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(u,{cache:!1})},e.split=function(t,a,n){return void 0===n&&(n=e.identity()),Object.assign(new e(function(e){return(t(e)?a:n).transformDocument(e)},{cache:!1}),{left:a,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var a=new n.Trie(r.et);this.performWork=(0,p.wrap)(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var n=t.getCacheKey(e);if(n)return(0,o.invariant)(Array.isArray(n),77),a.lookupArray(n)},max:l.v["documentTransform.cache"],cache:s.l})}},e.prototype.performWork=function(e){return(0,i.sw)(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var a=this;return Object.assign(new e(function(e){return t.transformDocument(a.transformDocument(e))},{cache:!1}),{left:this,right:t})},e}()},9355:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(458),r={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:a,it:r}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const i=t.name("valid");a.forEach((t,a)=>{if((0,n.alwaysValidSchema)(r,t))return;const o=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(o)})}};t.default=r},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9367:e=>{e.exports=JSON.parse('{"name":"BrickRect","brickDescription":{"default":"Brick rect component","en-us":"Rect brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378573-rect))","zh-tw":"矩形方塊 ([教學](https://intercom.help/bricks-dag-inc/articles/5378573-rect))","ja-jp":"長方形ブリック ([チュートリアル](https://intercom.help/bricks-dag-inc/articles/5378573-rect))"},"brickDisplayName":"Rect","brickTip":{"default":"@brick-tip-rect","en-us":"Add a Rectangle shape with Background, Border and Corner Radius.","zh-tw":"矩形元件,可設置顏色、邊框及外框導角半徑","ja-jp":"背景、境界線、角丸を設定できる長方形シェイプを追加します。"},"brickMeta":{"useBaseStyle":true,"pressable":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"rectangle"},"propTypes":{"linearGradientEnabled":{"type":"bool"},"linearGradientColors":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"linearGradientStart":{"type":"shape","content":{"x":{"type":"number"},"y":{"type":"number"}},"forcePropertyBank":false},"linearGradientEnd":{"type":"shape","content":{"x":{"type":"number"},"y":{"type":"number"}},"forcePropertyBank":false},"linearGradientLocations":{"type":"arrayOf","content":{"type":"number"},"forcePropertyBank":false}},"brickPropDescriptions":{"linearGradientEnabled":{"default":"","en-us":"Enables or disables linear gradient","zh-tw":"Enables or disables linear gradient","ja-jp":"リニアグラデーションの有効/無効を切り替え"},"linearGradientColors":{"default":"","en-us":"An array of at least two color values that represent gradient colors","zh-tw":"一個包含至少兩個顏色值的數組,表示漸變顏色","ja-jp":"グラデーションカラーを表す少なくとも2つのカラー値を含む配列"},"linearGradientStart":{"default":"","en-us":"An optional object of the following type: { x: number, y: number }","zh-tw":"一個可選的對象,類型為:{ x: number, y: number }","ja-jp":"オプションのオブジェクト、タイプ: { x: number, y: number }"},"linearGradientEnd":{"default":"","en-us":"Same as start, but for the end of the gradient","zh-tw":"與 start 相同,但用於漸變的結束","ja-jp":"開始と同じですが、グラデーションの終了位置用"},"linearGradientLocations":{"default":"","en-us":"An optional array of numbers defining the location of each gradient color stop","zh-tw":"一個可選的數組,定義每個漸變顏色停止的位置","ja-jp":"各グラデーションカラーストップの位置を定義するオプションの数値配列"}},"propertyControls":{"linearGradientColors":{"popover":true,"popoverExpectIncludedModalOpen":true,"extendSchema":{"type":"string","kind":"color","popover":true}},"linearGradientStart":{"popover":true,"extendSchema":{"unallowRemoveProperty":true,"properties":{"x":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05},"y":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05}}}},"linearGradientEnd":{"popover":true,"extendSchema":{"unallowRemoveProperty":true,"properties":{"x":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05},"y":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05}}}},"linearGradientLocations":{"popover":true}},"propertyControlGroups":{"linearGradient":{"name":"Linear Gradient","type":"prefix","content":"linearGradient","editor":"gradient-editor"}},"propertyControlGroupDescriptions":{},"defaultBrickProps":{"linearGradientEnabled":false,"linearGradientColors":["#000000","#FFFFFF"],"linearGradientStart":{"x":0,"y":0},"linearGradientEnd":{"x":1,"y":1},"linearGradientLocations":[0,1]},"eventTypes":{"BRICK_RECT_ON_PRESS":"BRICK_RECT_ON_PRESS","BRICK_RECT_ON_PRESS_IN":"BRICK_RECT_ON_PRESS_IN","BRICK_RECT_ON_PRESS_OUT":"BRICK_RECT_ON_PRESS_OUT","BRICK_RECT_ON_LONG_PRESS":"BRICK_RECT_ON_LONG_PRESS","BRICK_RECT_ON_FOCUS":"BRICK_RECT_ON_FOCUS","BRICK_RECT_ON_BLUR":"BRICK_RECT_ON_BLUR"},"brickEventDescriptions":{"BRICK_RECT_ON_PRESS":{"default":"","en-us":"Event of the brick press","zh-tw":"當 brick 被點擊時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_PRESS_IN":{"default":"","en-us":"Event of the brick press in","zh-tw":"當 brick 被按下時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_PRESS_OUT":{"default":"","en-us":"Event of the brick press out","zh-tw":"當 brick 按下後被放開時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_LONG_PRESS":{"default":"","en-us":"Event of the brick long press","zh-tw":"當 brick 被長按時觸發","ja-jp":"ブリックが長押しされたときに発生するイベント"},"BRICK_RECT_ON_FOCUS":{"default":"","en-us":"Event of the brick focus (Use TV Device with controller)","zh-tw":"當 brick 獲得焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを獲得したときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_RECT_ON_BLUR":{"default":"","en-us":"Event of the brick blur (Use TV Device with controller)","zh-tw":"當 brick 失去焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを失ったときに発生するイベント (TV デバイスとコントローラーを使用)"}},"outletTypes":{"BRICK_PRESSING":{"outlet":"BRICK_PRESSING","type":"bool"},"BRICK_FOCUSING":{"outlet":"BRICK_FOCUSING","type":"bool"}},"brickOutletDescriptions":{"BRICK_PRESSING":{"default":"","en-us":"Brick is pressing","zh-tw":"Brick 被按住中","ja-jp":"ブリックが押されています"},"BRICK_FOCUSING":{"default":"","en-us":"Brick is focusing (Use TV Device with controller)","zh-tw":"Brick 處於焦點狀態中 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスされています (TV デバイスとコントローラーを使用)"}}}')},9371:(e,t,a)=>{a.r(t),a.d(t,{InvariantError:()=>s,default:()=>m,invariant:()=>p,setVerbosity:()=>c});var n=a(5608),r="Invariant Violation",i=Object.setPrototypeOf,o=void 0===i?function(e,t){return e.__proto__=t,e}:i,s=function(e){function t(a){void 0===a&&(a=r);var n=e.call(this,"number"==typeof a?r+": "+a+" (see https://github.com/apollographql/invariant-packages)":a)||this;return n.framesToPop=1,n.name=r,o(n,t.prototype),n}return(0,n.__extends)(t,e),t}(Error);function p(e,t){if(!e)throw new s(t)}var l=["debug","log","warn","error","silent"],u=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=u)return(console[e]||console.log).apply(console,arguments)}}function c(e){var t=l[u];return u=Math.max(0,l.indexOf(e)),t}!function(e){e.debug=d("debug"),e.log=d("log"),e.warn=d("warn"),e.error=d("error")}(p||(p={}));const m=p},9392:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=a(7898),r=a(5031),i=a(3036),o=a(4856),s=a(458),p=a(6223);class l{constructor(e){var t;let a;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(a=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==a?void 0:a[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==a?void 0:a.$async,this.refs={}}}function u(e){const t=c.call(this,e);if(t)return t;const a=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new n.CodeGen(this.scope,{es5:s,lines:l,ownProperties:u});let m;e.$async&&(m=d.scopeValue("Error",{ref:r.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const h={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:a,baseId:e.baseId||a,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let _;try{this._compilations.add(e),(0,p.validateFunctionCode)(h),d.optimize(this.opts.code.optimize);const t=d.toString();_=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(_=this.opts.code.process(_,e));const a=new Function(`${i.default.self}`,`${i.default.scope}`,_)(this,this.scope.get());if(this.scope.value(f,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=h;a.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},a.source&&(a.source.evaluated=(0,n.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,_&&this.logger.error("Error compiling schema, function code:",_),t}finally{this._compilations.delete(e)}}function d(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function c(e){for(const t of this._compilations)if(m(t,e))return t}function m(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function f(e,t){let a;for(;"string"==typeof(a=this.refs[t]);)t=a;return a||this.schemas[t]||h.call(this,e,t)}function h(e,t){const a=this.opts.uriResolver.parse(t),n=(0,o._getFullPath)(this.opts.uriResolver,a);let r=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===r)return y.call(this,a,e);const i=(0,o.normalizeId)(n),s=this.refs[i]||this.schemas[i];if("string"==typeof s){const t=h.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,a,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||u.call(this,s),i===(0,o.normalizeId)(t)){const{schema:t}=s,{schemaId:a}=this.opts,n=t[a];return n&&(r=(0,o.resolveUrl)(this.opts.uriResolver,r,n)),new l({schema:t,schemaId:a,root:e,baseId:r})}return y.call(this,a,s)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,a){var n;a=(0,o.resolveUrl)(this.opts.uriResolver,t,a);const r=e.refs[a];if(r)return r;let i=f.call(this,e,a);if(void 0===i){const r=null===(n=e.localRefs)||void 0===n?void 0:n[a],{schemaId:o}=this.opts;r&&(i=new l({schema:r,schemaId:o,root:e,baseId:t}))}return void 0!==i?e.refs[a]=d.call(this,i):void 0},t.getCompilingSchema=c,t.resolveSchema=h;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:a,root:n}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof a)return;const e=a[(0,s.unescapeFragment)(n)];if(void 0===e)return;const r="object"==typeof(a=e)&&a[this.opts.schemaId];!_.has(n)&&r&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,r))}let i;if("boolean"!=typeof a&&a.$ref&&!(0,s.schemaHasRulesButRef)(a,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,a.$ref);i=h.call(this,n,e)}const{schemaId:p}=this.opts;return i=i||new l({schema:a,schemaId:p,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},9409:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=a(7898),r=a(458),i=a(3036);function o(e,t){const a=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,n._`[${a}]`),n._`${i.default.vErrors}.push(${a})`),e.code(n._`${i.default.errors}++`)}function s(e,t){const{gen:a,validateName:r,schemaEnv:i}=e;i.$async?a.throw(n._`new ${e.ValidationError}(${t})`):(a.assign(n._`${r}.errors`,t),a.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,a=t.keywordError,r,i){const{it:p}=e,{gen:u,compositeRule:d,allErrors:c}=p,m=l(e,a,r);(null!=i?i:d||c)?o(u,m):s(p,n._`[${m}]`)},t.reportExtraError=function(e,a=t.keywordError,n){const{it:r}=e,{gen:p,compositeRule:u,allErrors:d}=r;o(p,l(e,a,n)),u||d||s(r,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:a,data:r,errsCount:o,it:s}){if(void 0===o)throw new Error("ajv implementation error");const p=e.name("err");e.forRange("i",o,i.default.errors,o=>{e.const(p,n._`${i.default.vErrors}[${o}]`),e.if(n._`${p}.instancePath === undefined`,()=>e.assign(n._`${p}.instancePath`,(0,n.strConcat)(i.default.instancePath,s.errorPath))),e.assign(n._`${p}.schemaPath`,n.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(n._`${p}.schema`,a),e.assign(n._`${p}.data`,r))})};const p={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,a){const{createErrors:r}=e.it;return!1===r?n._`{}`:function(e,t,a={}){const{gen:r,it:o}=e,s=[u(o,a),d(e,a)];return function(e,{params:t,message:a},r){const{keyword:o,data:s,schemaValue:l,it:u}=e,{opts:d,propertyName:c,topSchemaRef:m,schemaPath:f}=u;r.push([p.keyword,o],[p.params,"function"==typeof t?t(e):t||n._`{}`]),d.messages&&r.push([p.message,"function"==typeof a?a(e):a]);d.verbose&&r.push([p.schema,l],[p.parentSchema,n._`${m}${f}`],[i.default.data,s]);c&&r.push([p.propertyName,c])}(e,t,s),r.object(...s)}(e,t,a)}function u({errorPath:e},{instancePath:t}){const a=t?n.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:a,parentSchema:i}){let o=i?t:n.str`${t}/${e}`;return a&&(o=n.str`${o}${(0,r.getErrorPath)(a,r.Type.Str)}`),[p.schemaPath,o]}},9417:e=>{e.exports=JSON.parse('{"name":"logictype","description":null,"description_zh_TW":null,"description_ja_JP":null,"commands":{"LOGICTYPE_AND":{"name":"And","description":"And","description_zh_TW":"且","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_CLONE":{"name":"Clone","description":"Clone value","description_zh_TW":"Clone value","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"any"}]},"LOGICTYPE_EQUAL_VALUE":{"name":"Equal value","description":"Compare by value (deep)","description_zh_TW":"判斷兩個參數是否相等 (深度比對)","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IF":{"name":"If","description":"Condition for return truthy or falsy","description_zh_TW":"判斷 condition 來決定是傳回 truthy 或是 falsy 的指定值","arg":[{"name":"condition","type":"any","subType":false,"defaultValue":"undefined"},{"name":"truthy","type":"any","subType":false,"defaultValue":"undefined"},{"name":"falsy","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"any"}]},"LOGICTYPE_IS_ARRAY":{"name":"Is array","description":"Is it an array?","description_zh_TW":"判斷是否為陣列","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_BOOLEAN":{"name":"Is boolean","description":"Is it boolean?","description_zh_TW":"判斷是否為布林值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_DATETIME":{"name":"Is datetime","description":"Is it a datetime?","description_zh_TW":"判斷是否為時間","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_EMPTY":{"name":"Is empty","description":"Is it empty?","description_zh_TW":"判斷是否為空值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_INTEGER":{"name":"Is integer","description":"Is it integer?","description_zh_TW":"判斷是否為整數","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_NUMBER":{"name":"Is number","description":"Is it a number?","description_zh_TW":"判斷是否為數字","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_OBJECT":{"name":"Is object","description":"Is it a object?","description_zh_TW":"判斷是否為物件","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_STRING":{"name":"Is string","description":"Is it string?","description_zh_TW":"判斷是否為字串","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_NOT":{"name":"Not","description":"Not","description_zh_TW":"反向值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_NOT_EQUAL_VALUE":{"name":"Not equal value","description":"Compare not equal by value (deep)","description_zh_TW":"判斷兩個參數是否不相等 (深度比對)","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_OR":{"name":"或","description":"","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_TO_ARRAY":{"name":"Convert to array","description":"Convert to array if possible, return fail_value if failed (Supported JSON)","description_zh_TW":"盡可能的轉換為陣列,若轉換失敗則回傳 fail_value (支援 JSON)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"array","subType":false,"defaultValue":"[]"}],"return":[{"name":"result","type":"array"}]},"LOGICTYPE_TO_BOOLEAN":{"name":"Convert to boolean","description":"Convert to boolean","description_zh_TW":"轉換為布林值","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_TO_DATETIME":{"name":"Convert to datetime","description":"Convert to datetime if possible, return fail_value if failed","description_zh_TW":"盡可能的換為日期時間,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"datetime","subType":false,"defaultValue":"DATETIME_NOW"}],"return":[{"name":"result","type":"datetime"}]},"LOGICTYPE_TO_INTEGER":{"name":"Convert to integer","description":"Convert to integer if possible, return fail_value if failed","description_zh_TW":"盡可能的換為整數,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"integer","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"integer"}]},"LOGICTYPE_TO_NUMBER":{"name":"Convert to number","description":"Convert to number if possible, return fail_value if failed","description_zh_TW":"盡可能的換為數字,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"LOGICTYPE_TO_OBJECT":{"name":"Convert to object","description":"Convert to object if possible, return fail_value if failed (Supported JSON)","description_zh_TW":"盡可能的轉換為物件,若轉換失敗則回傳 fail_value (支援 JSON)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"object","subType":false,"defaultValue":"{}"}],"return":[{"name":"result","type":"object"}]},"LOGICTYPE_TO_STRING":{"name":"Convert to string","description":"Convert to string if possible, return fail_value if failed (Supported JSON and Datetime format)","description_zh_TW":"盡可能的轉換為日期時間,若轉換失敗則回傳 fail_value (支援 JSON 以及 Datetime format)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"string","subType":false,"defaultValue":"\\"\\""}],"return":[{"name":"result","type":"string"}]},"LOGICTYPE_XOR":{"name":"XOR","description":"XOR","description_zh_TW":"互斥或","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]}}}')},9430:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:a(4450).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},9436:e=>{function t(e,t,a,n,r,i,o){try{var s=e[i](o),p=s.value}catch(e){return void a(e)}s.done?t(p):Promise.resolve(p).then(n,r)}e.exports=function(e){return function(){var a=this,n=arguments;return new Promise(function(r,i){var o=e.apply(a,n);function s(e){t(o,r,i,s,p,"next",e)}function p(e){t(o,r,i,s,p,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},9458:(e,t,a)=>{const{getIDPattern:n}=a(1639),r=n("SUBSPACE"),i=n("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/root.schema.json5",title:"Root",description:"A brick root config",type:"object",properties:{title:{type:"string",description:"The root config name."},root_subspace_id:{type:"string",description:"The root subspace id.",pattern:r},subspace_map:{type:"object",patternProperties:{[r]:{$ref:"http://display.bricks.tools/subspace.schema.json5",description:"Root config can have many subspace."}},additionalProperties:!1},test_map:{type:"object",patternProperties:{[i]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"Root config can have many test."}},additionalProperties:!1,deprecated:!0,description:"Deprecated in favor of automation_map.AUTOMATION_MAP_DEFAULT"},automation_map:{$ref:"http://display.bricks.tools/automation_map.schema.json5",description:"Maps of automation tests organized by collection"},show_viewports:{type:"boolean",description:"Show device viewport reference on editor"},enable_unstable_bricks:{type:"boolean",description:"Enable unstable bricks / generators"},hide_short_refs:{type:"boolean",description:"Hide all instances in Short Edit mode"},warnings:{type:"array",description:"Config validation warnings from server"}},required:["title","subspace_map","root_subspace_id"]}},9470:e=>{e.exports=JSON.parse('{"name":"BrickCamera","brickDescription":{"default":"Brick camera component","en-us":"Camera view brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378589-camera))","zh-tw":"攝像頭顯示方塊 ([教學](https://intercom.help/bricks-dag-inc/articles/5378589-camera))","ja-jp":"カメラビューブリック ([チュートリアル](https://intercom.help/bricks-dag-inc/articles/5378589-camera))"},"brickDisplayName":"Camera","brickTip":{"default":"@brick-tip-camera","en-us":"Add a Device Camera Viewer with Type, Ratio, etc. setting.(Control by Camera Generator and Event)","zh-tw":"攝影機顯示元件,可透過 Type 決定鏡頭。需透過 Camera Generator 及事件做控制","ja-jp":"タイプやアスペクト比などの設定を備えたデバイスカメラビューアーを追加します。(カメラジェネレーターとイベントで制御)"},"brickMeta":{"hasActions":true,"scriptMember":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"camera"},"propTypes":{"type":{"type":"oneOf","content":["back","front","external"],"forcePropertyBank":false},"isActive":{"type":"bool"},"zoom":{"type":"number"},"flashMode":{"type":"oneOf","content":["off","on","torch","auto"],"forcePropertyBank":false},"ratio":{"type":"string"},"captureAudio":{"type":"bool"},"whiteBalance":{"type":"oneOf","content":["auto","sunny","cloudy","shadow","incandescent","fluorescent"],"forcePropertyBank":false},"faceDetectionEnabled":{"type":"bool"},"faceDetectionEventMode":{"type":"oneOf","content":["when-detected","interval"],"forcePropertyBank":false},"pictureQuality":{"type":"number"},"pictureBase64":{"type":"bool"},"pictureIsMirrorImage":{"type":"bool"},"recordQuality":{"type":"oneOf","content":["4:3","288p","480p","720p","1080p","2160p"],"forcePropertyBank":false},"recordVideoBitrate":{"type":"number"},"recordMirrorVideo":{"type":"bool"},"recordMaxDuration":{"type":"number"},"recordMaxFileSize":{"type":"number"}},"brickPropDescriptions":{"type":{"default":"","en-us":"Camera type","zh-tw":"攝像頭位置","ja-jp":"カメラタイプ"},"isActive":{"default":"","en-us":"Enable or disable camera","zh-tw":"啟用或停用攝像頭","ja-jp":"カメラを有効または無効にする"},"zoom":{"default":"","en-us":"Camera zoom","zh-tw":"放大比例","ja-jp":"カメラズーム"},"flashMode":{"default":"","en-us":"Camera flash mode","zh-tw":"閃光模式","ja-jp":"カメラのフラッシュモード"},"ratio":{"default":"","en-us":"Camera ratio (Unsupported ratio will be ignored)","zh-tw":"相機比例(不支援的比例會被忽略)","ja-jp":"カメラ比率(サポートされていない比率は無視されます)"},"captureAudio":{"default":"","en-us":"Capture audio when start recording","zh-tw":"錄製影片時包含聲音","ja-jp":"録画開始時に音声もキャプチャする"},"whiteBalance":{"default":"","en-us":"Allows you to control the color temperature in your photos by cooling down or warming up the colors.","zh-tw":"白平衡設定","ja-jp":"色温度を調整して写真の色を冷たくしたり暖かくしたりすることができます"},"faceDetectionEnabled":{"default":"","en-us":"Enable face detection (Note: Barcode detection will be disabled when enabled)","zh-tw":"啟用臉部偵測(注意:啟用時條碼偵測將會停用)","ja-jp":"顔検出を有効化(注意:有効にするとバーコード検出は無効になります)"},"faceDetectionEventMode":{"default":"","en-us":"Face detection event mode","zh-tw":"Face detection event mode","ja-jp":"顔検出イベントモード"},"pictureQuality":{"default":"","en-us":"Quality of take picture","zh-tw":"擷取照片品質","ja-jp":"撮影画質"},"pictureBase64":{"default":"","en-us":"Take picture format as base64","zh-tw":"以 base64 格式資料作為擷取照片結果","ja-jp":"撮影画像をbase64形式で出力"},"pictureIsMirrorImage":{"default":"","en-us":"Mirror image of take picture","zh-tw":"擷取照片以鏡像呈現","ja-jp":"撮影画像を鏡像として表示"},"recordQuality":{"default":"","en-us":"Quality of record video","zh-tw":"錄製影片品質","ja-jp":"録画品質"},"recordVideoBitrate":{"default":"","en-us":"Bitrate of record video (bit/s)","zh-tw":"錄製影片位元傳輸率 (bit/s)","ja-jp":"録画ビットレート (bit/s)"},"recordMirrorVideo":{"default":"","en-us":"Mirror video of record video","zh-tw":"擷取照片以鏡像呈現","ja-jp":"録画を鏡像として表示"},"recordMaxDuration":{"default":"","en-us":"Max duration of record video (s)","zh-tw":"限制錄製最大時間 (s)","ja-jp":"録画の最大時間 (s)"},"recordMaxFileSize":{"default":"","en-us":"Max file size of record video (bytes)","zh-tw":"限制錄製最大檔案大小 (bytes)","ja-jp":"録画の最大ファイルサイズ (bytes)"}},"defaultBrickProps":{"type":"back","flashMode":"off","captureAudio":false,"whiteBalance":"auto","faceDetectionEnabled":false,"faceDetectionEventMode":"when-detected"},"propertyControls":{"zoom":{"kind":"unit","step":0.5,"max":16,"min":1},"flashMode":{"oneOfEmptyOption":false},"type":{"oneOfEmptyOption":false},"whiteBalance":{"oneOfEmptyOption":false},"faceDetectionEventMode":{"oneOfEmptyOption":false},"pictureQuality":{"kind":"unit","step":0.1,"max":1,"min":0},"recordVideoBitrate":{"kind":"unit","unit":"bit/s"},"recordMaxDuration":{"kind":"unit","unit":"s"},"recordMaxFileSize":{"kind":"unit","unit":"bytes"}},"propertyControlGroups":{"faceDetection":{"name":"Face Detection","type":"prefix","content":"faceDetection"},"picture":{"name":"Picture","type":"prefix","content":"picture"},"record":{"name":"Record","type":"prefix","content":"record"}},"propertyControlGroupDescriptions":{},"outletTypes":{"BRICK_CAMERA_INFO":{"outlet":"BRICK_CAMERA_INFO","type":"object"},"BRICK_CAMERA_PICTURE_TAKEN":{"outlet":"BRICK_CAMERA_PICTURE_TAKEN","type":"object"},"BRICK_CAMERA_RECORD_VIDEO":{"outlet":"BRICK_CAMERA_RECORD_VIDEO","type":"object"},"BRICK_CAMERA_BARCODE_READ":{"outlet":"BRICK_CAMERA_BARCODE_READ","type":"object"},"BRICK_CAMERA_FACE_DETECTED":{"outlet":"BRICK_CAMERA_FACE_DETECTED","type":"object"}},"brickOutletDescriptions":{"BRICK_CAMERA_INFO":{"default":"","en-us":"Camera device and format information","zh-tw":"攝像頭裝置與格式資訊","ja-jp":"カメラデバイスとフォーマット情報"},"BRICK_CAMERA_PICTURE_TAKEN":{"default":"","en-us":"Picture taken result","zh-tw":"擷取照片結果","ja-jp":"撮影結果"},"BRICK_CAMERA_RECORD_VIDEO":{"default":"","en-us":"Record video result","zh-tw":"錄製影片結果","ja-jp":"録画結果"},"BRICK_CAMERA_BARCODE_READ":{"default":"","en-us":"Barcode read result","zh-tw":"條碼辨識結果","ja-jp":"バーコード読み取り結果"},"BRICK_CAMERA_FACE_DETECTED":{"default":"","en-us":"Faces detected result","zh-tw":"人臉偵測結果","ja-jp":"顔検出結果"}},"actionTypes":{"BRICK_CAMERA_TAKE_PICTURE":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_WIDTH":{"type":"number"},"BRICK_CAMERA_QUALITY":{"type":"string"},"BRICK_CAMERA_BASE64":{"type":"bool"},"BRICK_CAMERA_MIRROR_IMAGE":{"type":"bool"}}},"BRICK_CAMERA_RECORD":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_QUALITY":{"type":"oneOf","oneOf":["4:3","288p","480p","720p","1080p","2160p"]},"BRICK_CAMERA_MIRROR_VIDEO":{"type":"bool"},"BRICK_CAMERA_VIDEO_BITRATE":{"type":"string"},"BRICK_CAMERA_MAX_DURATION":{"type":"number"},"BRICK_CAMERA_MAX_FILE_SIZE":{"type":"string"}}},"BRICK_CAMERA_STOP_RECORD":{"disallowMultiple":true,"canProvideProperty":false},"BRICK_CAMERA_FOCUS":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_FOCUS_X":{"type":"number"},"BRICK_CAMERA_FOCUS_Y":{"type":"number"}}}},"brickActionDescriptions":{"BRICK_CAMERA_TAKE_PICTURE":{"default":"","en-us":"Take picture on the Camera","zh-tw":"擷取照片","ja-jp":"カメラで写真を撮る"},"BRICK_CAMERA_RECORD":{"default":"","en-us":"Record video on the Camera","zh-tw":"錄製影片","ja-jp":"カメラで動画を録画"},"BRICK_CAMERA_STOP_RECORD":{"default":"","en-us":"Record video on the Camera","zh-tw":"結束錄製影片","ja-jp":"カメラでの録画を停止"},"BRICK_CAMERA_FOCUS":{"default":"","en-us":"Focus the Camera at a specific point","zh-tw":"對焦至指定位置","ja-jp":"指定位置にフォーカスを合わせる"}},"eventTypes":{"BRICK_CAMERA_STATE_CHANGE":"BRICK_CAMERA_STATE_CHANGE","BRICK_CAMERA_RECORD_START":"BRICK_CAMERA_RECORD_START","BRICK_CAMERA_RECORD_END":"BRICK_CAMERA_RECORD_END","BRICK_CAMERA_BARCODE_READ":"BRICK_CAMERA_BARCODE_READ","BRICK_CAMERA_PICTURE_TAKEN":"BRICK_CAMERA_PICTURE_TAKEN","BRICK_CAMERA_RECORD_FINISH":"BRICK_CAMERA_RECORD_FINISH","BRICK_CAMERA_MOUNT_ERROR":"BRICK_CAMERA_MOUNT_ERROR"},"brickEventDescriptions":{"BRICK_CAMERA_STATE_CHANGE":{"default":"","en-us":"Event of the Camera state change","zh-tw":"Event of the Camera state change","ja-jp":"カメラの状態変更イベント"},"BRICK_CAMERA_RECORD_START":{"default":"","en-us":"Event of the Camera record start","zh-tw":"當錄製開始時觸發事件","ja-jp":"カメラの録画開始イベント"},"BRICK_CAMERA_RECORD_END":{"default":"","en-us":"Event of the Camera record end","zh-tw":"當錄製結束時觸發事件","ja-jp":"カメラの録画終了イベント"},"BRICK_CAMERA_BARCODE_READ":{"default":"","en-us":"Event of the Camera barcode read","zh-tw":"當讀取到條碼時觸發事件","ja-jp":"カメラのバーコード読み取りイベント"},"BRICK_CAMERA_PICTURE_TAKEN":{"default":"","en-us":"Event of the Camera picture taken","zh-tw":"當擷取照片完畢時觸發事件","ja-jp":"カメラの写真撮影完了イベント"},"BRICK_CAMERA_RECORD_FINISH":{"default":"","en-us":"Event of the Camera record finished","zh-tw":"當錄製影片完畢時觸發事件","ja-jp":"カメラの録画完了イベント"},"BRICK_CAMERA_MOUNT_ERROR":{"default":"","en-us":"Event of the Camera mount error","zh-tw":"當攝像頭掛載失敗時觸發事件","ja-jp":"カメラのマウントエラーイベント"}},"eventPropertyControls":{"BRICK_CAMERA_STATE_CHANGE":{"properties":{"BRICK_CAMERA_STATUS":{"name":"Status","type":"string"},"BRICK_CAMERA_RECORD_AUDIO_PERM_STATUS":{"name":"Record Audio Permission Status","type":"string"}}},"BRICK_CAMERA_BARCODE_READ":{"properties":{"BRICK_CAMERA_BARCODE_TYPE":{"name":"Type","type":"string"},"BRICK_CAMERA_BARCODE_DATA":{"name":"Data","type":"string"},"BRICK_CAMERA_BARCODE_RAW_DATA":{"name":"Raw Data","type":"string"},"BRICK_CAMERA_BARCODE_X":{"name":"X","type":"number"},"BRICK_CAMERA_BARCODE_Y":{"name":"Y","type":"number"},"BRICK_CAMERA_BARCODE_WIDTH":{"name":"Width","type":"number"},"BRICK_CAMERA_BARCODE_HEIGHT":{"name":"Height","type":"number"}}},"BRICK_CAMERA_PICTURE_TAKEN":{"properties":{"BRICK_CAMERA_WIDTH":{"name":"Width","type":"number"},"BRICK_CAMERA_HEIGHT":{"name":"Height","type":"number"},"BRICK_CAMERA_URI":{"name":"URI","type":"string"}}},"BRICK_CAMERA_RECORD_FINISH":{"properties":{"BRICK_CAMERA_URI":{"name":"URI","type":"string"}}},"BRICK_CAMERA_MOUNT_ERROR":{"properties":{"BRICK_CAMERA_MOUNT_ERROR":{"name":"Error","type":"string"}}}},"scriptMemberFunctionDefs":{"takePicture":{"description":"Take a picture with the camera","arguments":[{"type":"object","name":"options","properties":{"quality":{"type":"number","description":"Picture quality (0-1)","default":0.6},"base64":{"type":"boolean","description":"Return base64 encoded image data","default":false},"isImageMirror":{"type":"boolean","description":"Mirror the captured image","default":false}}}],"required":[],"return":{"type":"object","description":"Picture data with width, height, uri, and optional base64"},"timeout":10000},"startRecord":{"description":"Start recording video with the camera","arguments":[{"type":"object","name":"options","properties":{"quality":{"type":"string","description":"Video quality (4:3, 288p, 480p, 720p, 1080p, 2160p)"},"videoBitrate":{"type":"number","description":"Video bitrate in bit/s"},"mirror":{"type":"boolean","description":"Mirror the recorded video","default":false},"maxDuration":{"type":"number","description":"Maximum recording duration in seconds"},"maxFileSize":{"type":"number","description":"Maximum file size in bytes"},"waitEnd":{"type":"boolean","description":"Wait for recording to end before resolving","default":false}}}],"required":[],"return":{"type":"object","description":"Recording result with uri (if waitEnd is true) or recording start confirmation"}},"stopRecord":{"description":"Stop recording video","arguments":[],"required":[],"return":{"type":"boolean"}},"pausePreview":{"description":"Pause camera preview","arguments":[],"required":[],"return":{"type":"boolean"}},"resumePreview":{"description":"Resume camera preview","arguments":[],"required":[],"return":{"type":"boolean"}},"focus":{"description":"Focus the camera at a specific point (tap-to-focus)","arguments":[{"type":"object","name":"point","properties":{"x":{"type":"number","description":"X coordinate (0-1 normalized or pixel value). 0 = left edge, 1 = right edge"},"y":{"type":"number","description":"Y coordinate (0-1 normalized or pixel value). 0 = top edge, 1 = bottom edge"}}}],"required":["point"],"return":{"type":"boolean","description":"True if focus was triggered successfully"}}},"scriptMemberFunctionDefDescriptions":{}}')},9520:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r=a(458),i=a(2725),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:a,$data:o,schemaCode:s,schema:p}=e;o||p&&"object"==typeof p?e.fail$data(n._`!${(0,r.useFunc)(t,i.default)}(${a}, ${s})`):e.fail(n._`${p} !== ${a}`)}};t.default=o},9537:(e,t,a)=>{a.d(t,{_:()=>s,k:()=>o});var n=a(3217),r=a(5198),i=a(792);class o{constructor(e,t="GraphQL request",a={line:1,column:1}){"string"==typeof e||(0,n.U)(!1,`Body must be a string. Received: ${(0,r.N)(e)}.`),this.body=e,this.name=t,this.locationOffset=a,this.locationOffset.line>0||(0,n.U)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,n.U)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function s(e){return(0,i.h)(e,o)}},9546:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},9557:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({TerminalInfoProvider:()=>s.TerminalInfoProvider,default:()=>s.default})},9563:e=>{e.exports=JSON.parse('{"name":"GeneratorIterator","brickDescription":{"default":"","en-us":"Iterate through values (Array, Object, Number, String)","zh-tw":"數值迭代 (Array, Object, Number, String)","ja-jp":"値を反復処理 (配列、オブジェクト、数値、文字列)"},"brickDisplayName":"Iterator","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"rotate"},"propTypes":{"data":{"type":"any"},"start":{"type":"number"},"step":{"type":"number"},"maxQuantity":{"type":"number"},"loop":{"type":"bool"}},"brickPropDescriptions":{"data":{"default":"","en-us":"Data source for iteration. If it\'s an Array, it will iterate through elements. If it\'s an Object, it will use Object.entries() to get key-value pairs. If it\'s a String, it will iterate through characters. If it\'s a Number, it represents count from 1 to N.","zh-tw":"用來取值的資料來源,如果為 Array 則會取得元素,如果為 Object 則使用 Object.entries() 取得鍵值對,如果為 String 則迭代字元,如果為 Number 則代表由 1~N 的計數","ja-jp":"反復処理のためのデータソース。配列の場合は要素を取得し、オブジェクトの場合はObject.entries()でキーと値のペアを取得し、文字列の場合は文字を反復処理し、数値の場合は1〜Nのカウントを表します"},"start":{"default":"","en-us":"Starting element position","zh-tw":"起始元素位置","ja-jp":"開始要素の位置"},"step":{"default":"","en-us":"Step size for each iteration","zh-tw":"單次跳動的位移量","ja-jp":"各反復の増分"},"maxQuantity":{"default":"","en-us":"Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored.","zh-tw":"總共可迭代個數上限 (可以設置為 -1 作為無上限)。達到上限後,後續的迭代動作將被靜默忽略。","ja-jp":"反復処理の最大数(無制限の場合は-1に設定可能)。上限に達すると、それ以降の反復アクションは静かに無視されます。"},"loop":{"default":"","en-us":"Whether to loop the iteration","zh-tw":"是否循環迭代","ja-jp":"反復処理をループするかどうか"}},"defaultBrickProps":{"data":[],"start":0,"step":1},"propertyControls":{"data":{"setupDefaultAfterNewItemOfSchema":true,"required":true},"step":{"kind":"unit","min":1,"step":1}},"outletTypes":{"GENERATOR_ITERATOR_ITERATED_ARRAY":{"outlet":"GENERATOR_ITERATOR_ITERATED_ARRAY","type":"array"},"GENERATOR_ITERATOR_UPCOMING_ARRAY":{"outlet":"GENERATOR_ITERATOR_UPCOMING_ARRAY","type":"array"},"GENERATOR_ITERATOR_VALUE":{"outlet":"GENERATOR_ITERATOR_VALUE","type":"any"},"GENERATOR_ITERATOR_KEY":{"outlet":"GENERATOR_ITERATOR_KEY","type":"any"},"GENERATOR_ITERATOR_INDEX":{"outlet":"GENERATOR_ITERATOR_INDEX","type":"number"}},"brickOutletDescriptions":{"GENERATOR_ITERATOR_ITERATED_ARRAY":{"default":"","en-us":"Elements that have been iterated (including current one)","zh-tw":"已經迭代過的元素(包含目前的)","ja-jp":"反復処理された要素(現在のものを含む)"},"GENERATOR_ITERATOR_UPCOMING_ARRAY":{"default":"","en-us":"Elements that will be iterated but have not been iterated yet","zh-tw":"會參與迭代但尚未迭代過的元素","ja-jp":"反復処理される予定だがまだ処理されていない要素"},"GENERATOR_ITERATOR_VALUE":{"default":"","en-us":"Current iteration element","zh-tw":"目前的迭代元素","ja-jp":"現在の反復要素"},"GENERATOR_ITERATOR_KEY":{"default":"","en-us":"Key of the current iteration element (for number: same as value, for array/string: index, for object: string key)","zh-tw":"目前迭代元素的 Key(number: 則此值與 value 相同,array, string: 則此值為 index,object: 則此值為字串)","ja-jp":"現在の反復要素のキー(数値の場合:値と同じ、配列・文字列の場合:インデックス、オブジェクトの場合:文字列キー)"},"GENERATOR_ITERATOR_INDEX":{"default":"","en-us":"Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence)","zh-tw":"目前的迭代次數(如果 data 為 6, step 為 2,則此值會依序回傳:1,2,3)","ja-jp":"現在の反復回数(dataが6でstepが2の場合、この値は順番に1,2,3を返します)"}},"actionTypes":{"GENERATOR_ITERATOR_NEXT":{"canProvideProperty":false},"GENERATOR_ITERATOR_PREVIOUS":{"canProvideProperty":false},"GENERATOR_ITERATOR_FIRST":{"canProvideProperty":false},"GENERATOR_ITERATOR_LAST":{"canProvideProperty":false},"GENERATOR_ITERATOR_RESET":{"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_ITERATOR_NEXT":{"default":"","en-us":"Proceed to next iteration","zh-tw":"進行下一次迭代","ja-jp":"次の反復に進む"},"GENERATOR_ITERATOR_PREVIOUS":{"default":"","en-us":"Go back to previous iteration","zh-tw":"退回至上一次迭代","ja-jp":"前の反復に戻る"},"GENERATOR_ITERATOR_FIRST":{"default":"","en-us":"Jump to the first iteration element","zh-tw":"跳至第一個迭代元素","ja-jp":"最初の反復要素にジャンプする"},"GENERATOR_ITERATOR_LAST":{"default":"","en-us":"Jump to the last iteration element (ignoring the loop setting)","zh-tw":"跳至最後一個迭代元素(忽略 loop 的設定值)","ja-jp":"最後の反復要素にジャンプする(loop設定を無視)"},"GENERATOR_ITERATOR_RESET":{"default":"","en-us":"Reset iteration state","zh-tw":"重置迭代狀態","ja-jp":"反復状態をリセット"}},"eventTypes":{"GENERATOR_ITERATOR_ITERATE":"GENERATOR_ITERATOR_ITERATE","GENERATOR_ITERATOR_FIRST":"GENERATOR_ITERATOR_FIRST","GENERATOR_ITERATOR_END":"GENERATOR_ITERATOR_END","GENERATOR_ITERATOR_ERROR":"GENERATOR_ITERATOR_ERROR"},"brickEventDescriptions":{"GENERATOR_ITERATOR_ITERATE":{"default":"","en-us":"Event triggered on each iteration","zh-tw":"每次發生迭代都會觸發此 Event","ja-jp":"各反復処理で発生するイベント"},"GENERATOR_ITERATOR_FIRST":{"default":"","en-us":"Event triggered on the first iteration of a round","zh-tw":"當單輪首次迭代會觸發此 Event","ja-jp":"1回の反復処理の最初に発生するイベント"},"GENERATOR_ITERATOR_END":{"default":"","en-us":"Event triggered on the last iteration of a round","zh-tw":"當單輪迭代至最後會觸發此 Event","ja-jp":"1回の反復処理の最後に発生するイベント"},"GENERATOR_ITERATOR_ERROR":{"default":"","en-us":"Event triggered when data type is invalid or unexpected","zh-tw":"當資料類型無效或非預期時觸發此 Event","ja-jp":"データ型が無効または予期しない場合に発生するイベント"}},"eventPropertyControls":{"GENERATOR_ITERATOR_ITERATE":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_FIRST":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_END":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_ERROR":{"properties":{"GENERATOR_ITERATOR_ERROR_MESSAGE":{"name":"Error Message","type":"string"},"GENERATOR_ITERATOR_ERROR_DATA":{"name":"Invalid Data","type":"any"}}}}}')},9594:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(4450),r=a(7898),i=a(458),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>r.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>r._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:a,schemaCode:o,data:s,$data:p,it:l}=e,{opts:u}=l;if(!p&&0===a.length)return;const d=a.length>=u.loopRequired;if(l.allErrors?function(){if(d||p)e.block$data(r.nil,c);else for(const t of a)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||p){const a=t.let("valid",!0);e.block$data(a,()=>function(a,i){e.setParams({missingProperty:a}),t.forOf(a,o,()=>{t.assign(i,(0,n.propertyInData)(t,s,a,u.ownProperties)),t.if((0,r.not)(i),()=>{e.error(),t.break()})},r.nil)}(i,a)),e.ok(a)}else t.if((0,n.checkMissingProp)(e,a,i)),(0,n.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of a)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function c(){t.forOf("prop",o,a=>{e.setParams({missingProperty:a}),t.if((0,n.noPropertyInData)(t,s,a,u.ownProperties),()=>e.error())})}}};t.default=o},9611:e=>{e.exports=JSON.parse('{"name":"GeneratorOnnxLLM","brickDescription":{"default":"Local LLM inference","en-us":"Local LLM inference based on [transformers.js](https://huggingface.co/docs/transformers.js) \\n You can use any converted model on HuggingFace.","zh-tw":"基於 [transformers.js](https://huggingface.co/docs/transformers.js) 的本地 LLM 推論 \\n 您可以使用 HuggingFace 上任何轉換過的模型。","ja-jp":"[transformers.js](https://huggingface.co/docs/transformers.js) に基づくローカル LLM 推論 \\n HuggingFace で変換されたどのモデルでも使用できます。"},"brickDisplayName":"LLM (ONNX)","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"microchip-ai"},"brickMeta":{"preview":true,"scriptMember":true},"propTypes":{"init":{"type":"bool"},"model":{"type":"string"},"modelType":{"type":"string"},"quantizeType":{"type":"oneOf","content":["auto","none","fp16","q8","int8","uint8","q4","bnb4","q4f16"],"forcePropertyBank":false},"prompt":{"type":"string"},"messages":{"type":"arrayOf","content":{"type":"shape","content":{},"forcePropertyBank":false},"forcePropertyBank":false},"images":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"audios":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"toolCallParser":{"type":"oneOf","content":["llama3_json","mistral","hermes","internlm","phi4"],"forcePropertyBank":false},"tools":{"type":"arrayOf","content":{"type":"object"},"forcePropertyBank":false},"toolChoice":{"type":"oneOf","content":["none","auto"],"forcePropertyBank":false},"maxNewTokens":{"type":"number"},"temperature":{"type":"number"},"topK":{"type":"number"},"topP":{"type":"number"},"repetitionPenalty":{"type":"number"},"noRepeatNgramSize":{"type":"number"},"numBeams":{"type":"number"},"doSample":{"type":"bool"},"executors":{"type":"arrayOf","content":{"type":"oneOf","content":["qnn","dml","nnapi","xnnpack","coreml","cpu","wasm","webgpu"],"forcePropertyBank":false},"forcePropertyBank":false},"executionMode":{"type":"oneOf","content":["sequential","parallel"],"forcePropertyBank":false},"qnnBackend":{"type":"oneOf","content":["HTP","HTA","DSP","GPU","CPU"],"forcePropertyBank":false},"qnnHtpEnableFp16":{"type":"bool"},"qnnEnableDebug":{"type":"bool"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Initialize the TTS context on generator initialization","zh-tw":"在 generator 初始化時是否要初始化","ja-jp":"generator の初期化時に TTS コンテキストを初期化する"},"model":{"default":"","en-us":"LLM model","zh-tw":"LLM 模型","ja-jp":"LLM モデル"},"modelType":{"default":"","en-us":"Model type","zh-tw":"模型類型","ja-jp":"モデルタイプ"},"quantizeType":{"default":"","en-us":"Quantize type","zh-tw":"量化類型","ja-jp":"量子化タイプ"},"prompt":{"default":"","en-us":"Prompt to inference","zh-tw":"要推論的提示","ja-jp":"推論するためのプロンプト"},"messages":{"default":"","en-us":"Messages to inference","zh-tw":"要推論的訊息","ja-jp":"推論するためのメッセージ"},"images":{"default":"","en-us":"Images with message to inference","zh-tw":"訊息附帶的圖片","ja-jp":"メッセージに添付する画像"},"audios":{"default":"","en-us":"Audios with message to inference","zh-tw":"訊息附帶的音檔","ja-jp":"メッセージに添付する音声"},"toolCallParser":{"default":"","en-us":"Tool call parser","zh-tw":"工具調用解析器","ja-jp":"ツールコールパーサー"},"tools":{"default":"","en-us":"Tools for chat mode using OpenAI-compatible function calling format \\n Format: Array of objects with {type, function: {name, description, parameters}} structure \\n See: https://platform.openai.com/docs/guides/function-calling","zh-tw":"聊天模式的工具,使用 OpenAI 相容的函數調用格式 \\n 格式:由 {type, function: {name, description, parameters}} 結構的物件陣列 \\n 參考:https://platform.openai.com/docs/guides/function-calling","ja-jp":"チャットモードで使用するツール。OpenAI 互換の関数呼び出し形式を使用します。 \\n 形式:{type, function: {name, description, parameters}} 構造のオブジェクトの配列 \\n 詳細:https://platform.openai.com/docs/guides/function-calling"},"toolChoice":{"default":"","en-us":"Tool choice for chat mode","zh-tw":"聊天模式的工具選擇"},"maxNewTokens":{"default":"","en-us":"Max new tokens to generate","zh-tw":"最大生成新 tokens","ja-jp":"生成する最大の新しいトークン数"},"temperature":{"default":"","en-us":"Temperature","zh-tw":"溫度","ja-jp":"温度"},"topK":{"default":"","en-us":"Top k","zh-tw":"Top k","ja-jp":"トップ k"},"topP":{"default":"","en-us":"Top p","zh-tw":"Top p","ja-jp":"トップ p"},"repetitionPenalty":{"default":"","en-us":"Repetition penalty","zh-tw":"重複懲罰","ja-jp":"繰り返しペナルティ"},"noRepeatNgramSize":{"default":"","en-us":"No repeat ngram size","zh-tw":"不重複 ngram 大小","ja-jp":"繰り返さない ngram サイズ"},"numBeams":{"default":"","en-us":"Number of beams","zh-tw":"光束數","ja-jp":"ビーム数"},"doSample":{"default":"","en-us":"Do sampling","zh-tw":"是否採樣","ja-jp":"サンプリングを行う"},"executors":{"default":"","en-us":"Executor candidates, descending order of priority \\n Default will be xnnpack, wasm, cpu","zh-tw":"執行器候選,按優先順序降序排列 \\n 預設為 xnnpack、wasm、cpu","ja-jp":"実行候補、優先順位の降順 \\n デフォルトは xnnpack、wasm、cpu"},"executionMode":{"default":"","en-us":"Execution mode \\n Usually when the model has many branches, setting this option to `parallel` will give you better performance.","zh-tw":"執行模式 \\n 通常當模型有許多分支時,將此選項設置為 `parallel` 將為您提供更好的性能。","ja-jp":"実行モード \\n 通常、モデルに多くの分岐がある場合、このオプションを `parallel` に設定するとパフォーマンスが向上します。"},"qnnBackend":{"default":"","en-us":"QNN backend","zh-tw":"QNN 後端","ja-jp":"QNN バックエンド"},"qnnHtpEnableFp16":{"default":"","en-us":"Enable FP16 for QNN HTP","zh-tw":"啟用 QNN HTP 的 FP16","ja-jp":"QNN HTP の FP16 を有効にする"},"qnnEnableDebug":{"default":"","en-us":"Enable QNN debug","zh-tw":"啟用 QNN 調試","ja-jp":"QNN デバッグを有効にする"}},"defaultBrickProps":{"modelType":"auto","toolCallParser":"llama3_json","toolChoice":"auto","maxNewTokens":256,"temperature":0.7,"topK":50,"topP":0.9,"repetitionPenalty":1,"noRepeatNgramSize":0,"numBeams":1,"doSample":true,"executionMode":"sequential"},"propertyControls":{"model":{"kind":"onnx-model-asset","fields":{"modelType":"modelType","quantizeType":"quantizeType"},"required":true},"messages":{"kind":"llm-messages"},"tools":{"kind":"llm-tools"}},"propertyControlGroups":{"inputs":{"name":"Input","type":"group","content":["prompt","messages","images","audios"]},"tools":{"name":"Tools","type":"group","content":["toolCallParser","tools","toolChoice"]},"providerOpts":{"name":"Provider Options","type":"group","content":["executors","executionMode","qnnBackend","qnnHtpEnableFp16","qnnEnableDebug"]}},"propertyControlGroupDescriptions":{},"outletTypes":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"outlet":"GENERATOR_ONNX_LLM_CONTEXT_STATE","type":"string"},"GENERATOR_ONNX_LLM_GENERATED":{"outlet":"GENERATOR_ONNX_LLM_GENERATED","type":"string"},"GENERATOR_ONNX_LLM_FULL_RESULT":{"outlet":"GENERATOR_ONNX_LLM_FULL_RESULT","type":"string"},"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL":{"outlet":"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL","type":"object"}},"brickOutletDescriptions":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"default":"","en-us":"Context state","zh-tw":"Context 狀態","ja-jp":"コンテキスト状態"},"GENERATOR_ONNX_LLM_GENERATED":{"default":"","en-us":"Generated output","zh-tw":"產生的輸出","ja-jp":"生成された出力"},"GENERATOR_ONNX_LLM_FULL_RESULT":{"default":"","en-us":"Full result of generation","zh-tw":"生成的完整結果","ja-jp":"生成の完全な結果"},"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL":{"default":"","en-us":"Last function call","zh-tw":"最後的函數調用"}},"eventTypes":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE","GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL","GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED","GENERATOR_ONNX_LLM_ON_ERROR":"GENERATOR_ONNX_LLM_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":{"default":"","en-us":"Event triggered when state change","zh-tw":"在狀態變更時觸發事件","ja-jp":"状態が変更されたときに発生するイベント"},"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":{"default":"","en-us":"Event triggered on get function call request","zh-tw":"在獲取函數調用請求時觸發事件"},"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":{"default":"","en-us":"Event triggered on completion finished","zh-tw":"在完成時觸發事件"},"GENERATOR_ONNX_LLM_ON_ERROR":{"default":"","en-us":"Event triggered when error occurs","zh-tw":"在發生錯誤時觸發事件","ja-jp":"エラーが発生したときに発生するイベント"}},"eventPropertyControls":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":{"properties":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"name":"Context State","type":"string"}}},"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":{"properties":{"GENERATOR_ONNX_LLM_FUNCTION_CALL_NAME":{"name":"Function Call Name","type":"string"},"GENERATOR_ONNX_LLM_FUNCTION_CALL_ARGUMENTS":{"name":"Function Call Arguments","type":"object"},"GENERATOR_ONNX_LLM_FUNCTION_CALL_DETAILS":{"name":"Function Call Details","type":"object"}}},"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":{"properties":{"GENERATOR_ONNX_LLM_COMPLETION_RESULT":{"name":"Result","type":"string"},"GENERATOR_ONNX_LLM_COMPLETION_TOOL_CALLS":{"name":"Tool Calls","type":"array"},"GENERATOR_ONNX_LLM_COMPLETION_FULL_CONTEXT":{"name":"Full Context","type":"string"}}},"GENERATOR_ONNX_LLM_ON_ERROR":{"properties":{"GENERATOR_ONNX_LLM_ERROR":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_ONNX_LLM_LOAD_MODEL":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_ONNX_LLM_INFER":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_ONNX_LLM_PROMPT":{"name":"Prompt","type":"string"},"GENERATOR_ONNX_LLM_CHAT":{"name":"Chat","type":"array"},"GENERATOR_ONNX_LLM_IMAGES":{"name":"Image URLs","type":"array"},"GENERATOR_ONNX_LLM_AUDIOS":{"name":"Audio URLs","type":"array"},"GENERATOR_ONNX_LLM_TOOLS":{"name":"Tools","type":"array"},"GENERATOR_ONNX_LLM_TOOL_CHOICE":{"name":"Tool Choice","type":"string"}}},"GENERATOR_ONNX_LLM_CLEAN_CACHE":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_ONNX_LLM_RELEASE_CONTEXT":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_ONNX_LLM_LOAD_MODEL":{"default":"","en-us":"Load the model","zh-tw":"讀取模型","ja-jp":"モデルを読み込む"},"GENERATOR_ONNX_LLM_INFER":{"default":"","en-us":"Inference","zh-tw":"推論","ja-jp":"推論"},"GENERATOR_ONNX_LLM_CLEAN_CACHE":{"default":"","en-us":"Clean cache","zh-tw":"清除快取","ja-jp":"キャッシュをクリアする"},"GENERATOR_ONNX_LLM_RELEASE_CONTEXT":{"default":"","en-us":"Release context","zh-tw":"釋放 context","ja-jp":"コンテキストを解放する"}},"scriptMemberFunctionDefs":{"load":{"arguments":[],"required":[],"return":{"type":"bool"}},"getState":{"arguments":[],"required":[],"return":{"type":"string"}},"infer":{"arguments":[{"type":"object","name":"params","properties":{"prompt":{"name":"Prompt","type":"string"},"messages":{"name":"Messages","type":"array"},"images":{"name":"Images","type":"array"},"audios":{"name":"Audios","type":"array"},"tools":{"name":"Tools","type":"array"},"toolChoice":{"name":"Tool Choice","type":"string"}}}],"required":["params"],"return":{"type":"object"}},"cleanCache":{"arguments":[],"required":[],"return":{"type":"bool"}},"release":{"arguments":[],"required":[],"return":{"type":"bool"}}},"scriptMemberFunctionDefDescriptions":{"load":{"default":"","en-us":"Load ONNX model","zh-tw":"讀取 ONNX 模型","ja-jp":"ONNX モデルを読み込む"},"getState":{"default":"","en-us":"Get model state","zh-tw":"取得模型狀態","ja-jp":"モデル状態を取得"},"infer":{"default":"","en-us":"Run text inference","zh-tw":"執行文字推論","ja-jp":"テキスト推論を実行"},"cleanCache":{"default":"","en-us":"Clean model cache","zh-tw":"清除模型快取","ja-jp":"モデルキャッシュをクリア"},"release":{"default":"","en-us":"Release the model","zh-tw":"釋放模型","ja-jp":"モデルを解放"}}}')},9624:(e,t,a)=>{var n=a(3655),r=a(4759),i=a(1580),o=a(4066),s=/^\[object .+?Constructor\]$/,p=Function.prototype,l=Object.prototype,u=p.toString,d=l.hasOwnProperty,c=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||r(e))&&(n(e)?c:s).test(o(e))}},9657:(e,t,a)=>{a.d(t,{Ay:()=>J});var n=a(2203),r=a(8611),i=a(7016),o=a(4044),s=a(5692),p=a(3106);const l=n.Readable,u=Symbol("buffer"),d=Symbol("type");class c{constructor(){this[d]="";const e=arguments[0],t=arguments[1],a=[];let n=0;if(e){const t=e,r=Number(t.length);for(let e=0;e<r;e++){const r=t[e];let i;i=r instanceof Buffer?r:ArrayBuffer.isView(r)?Buffer.from(r.buffer,r.byteOffset,r.byteLength):r instanceof ArrayBuffer?Buffer.from(r):r instanceof c?r[u]:Buffer.from("string"==typeof r?r:String(r)),n+=i.length,a.push(i)}}this[u]=Buffer.concat(a);let r=t&&void 0!==t.type&&String(t.type).toLowerCase();r&&!/[^\u0020-\u007E]/.test(r)&&(this[d]=r)}get size(){return this[u].length}get type(){return this[d]}text(){return Promise.resolve(this[u].toString())}arrayBuffer(){const e=this[u],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new l;return e._read=function(){},e.push(this[u]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],a=arguments[1];let n,r;n=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),r=void 0===a?e:a<0?Math.max(e+a,0):Math.min(a,e);const i=Math.max(r-n,0),o=this[u].slice(n,n+i),s=new c([],{type:arguments[2]});return s[u]=o,s}}function m(e,t,a){Error.call(this,e),this.message=e,this.type=t,a&&(this.code=this.errno=a.code),Error.captureStackTrace(this,this.constructor)}let f;Object.defineProperties(c.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(c.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),m.prototype=Object.create(Error.prototype),m.prototype.constructor=m,m.prototype.name="FetchError";try{f=require("encoding").convert}catch(e){}const h=Symbol("Body internals"),_=n.PassThrough;function y(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a.size;let i=void 0===r?0:r;var o=a.timeout;let s=void 0===o?0:o;null==e?e=null:T(e)?e=Buffer.from(e.toString()):g(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof n||(e=Buffer.from(String(e)))),this[h]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof n&&e.on("error",function(e){const a="AbortError"===e.name?e:new m(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[h].error=a})}function E(){var e=this;if(this[h].disturbed)return y.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[h].disturbed=!0,this[h].error)return y.Promise.reject(this[h].error);let t=this.body;if(null===t)return y.Promise.resolve(Buffer.alloc(0));if(g(t)&&(t=t.stream()),Buffer.isBuffer(t))return y.Promise.resolve(t);if(!(t instanceof n))return y.Promise.resolve(Buffer.alloc(0));let a=[],r=0,i=!1;return new y.Promise(function(n,o){let s;e.timeout&&(s=setTimeout(function(){i=!0,o(new m(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))},e.timeout)),t.on("error",function(t){"AbortError"===t.name?(i=!0,o(t)):o(new m(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))}),t.on("data",function(t){if(!i&&null!==t){if(e.size&&r+t.length>e.size)return i=!0,void o(new m(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,a.push(t)}}),t.on("end",function(){if(!i){clearTimeout(s);try{n(Buffer.concat(a,r))}catch(t){o(new m(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}})})}function T(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function g(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(e){let t,a,r=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof n&&"function"!=typeof r.getBoundary&&(t=new _,a=new _,r.pipe(t),r.pipe(a),e[h].body=t,r=a),r}function R(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":T(e)?"application/x-www-form-urlencoded;charset=UTF-8":g(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof n?null:"text/plain;charset=UTF-8"}function b(e){const t=e.body;return null===t?0:g(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}y.prototype={get body(){return this[h].body},get bodyUsed(){return this[h].disturbed},arrayBuffer(){return E.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let e=this.headers&&this.headers.get("content-type")||"";return E.call(this).then(function(t){return Object.assign(new c([],{type:e.toLowerCase()}),{[u]:t})})},json(){var e=this;return E.call(this).then(function(t){try{return JSON.parse(t.toString())}catch(t){return y.Promise.reject(new m(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}})},text(){return E.call(this).then(function(e){return e.toString()})},buffer(){return E.call(this)},textConverted(){var e=this;return E.call(this).then(function(t){return function(e,t){if("function"!=typeof f)throw new Error("The package `encoding` must be installed to use the textConverted() function");const a=t.get("content-type");let n,r,i="utf-8";a&&(n=/charset=([^;]*)/i.exec(a));r=e.slice(0,1024).toString(),!n&&r&&(n=/<meta.+?charset=(['"])(.+?)\1/i.exec(r));!n&&r&&(n=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(r),n||(n=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(r),n&&n.pop()),n&&(n=/charset=(.*)/i.exec(n.pop())));!n&&r&&(n=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(r));n&&(i=n.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return f(e,"UTF-8",i).toString()}(t,e.headers)})}},Object.defineProperties(y.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),y.mixIn=function(e){for(const t of Object.getOwnPropertyNames(y.prototype))if(!(t in e)){const a=Object.getOwnPropertyDescriptor(y.prototype,t);Object.defineProperty(e,t,a)}},y.Promise=global.Promise;const O=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,N=/[^\t\x20-\x7e\x80-\xff]/;function A(e){if(e=`${e}`,O.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function S(e){if(e=`${e}`,N.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function w(e,t){t=t.toLowerCase();for(const a in e)if(a.toLowerCase()===t)return a}const I=Symbol("map");class C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[I]=Object.create(null),e instanceof C){const t=e.raw(),a=Object.keys(t);for(const e of a)for(const a of t[e])this.append(e,a);return}if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const a=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");a.push(Array.from(t))}for(const e of a){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const a=e[t];this.append(t,a)}}}}get(e){A(e=`${e}`);const t=w(this[I],e);return void 0===t?null:this[I][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=D(this),n=0;for(;n<a.length;){var r=a[n];const i=r[0],o=r[1];e.call(t,o,i,this),a=D(this),n++}}set(e,t){t=`${t}`,A(e=`${e}`),S(t);const a=w(this[I],e);this[I][void 0!==a?a:e]=[t]}append(e,t){t=`${t}`,A(e=`${e}`),S(t);const a=w(this[I],e);void 0!==a?this[I][a].push(t):this[I][e]=[t]}has(e){return A(e=`${e}`),void 0!==w(this[I],e)}delete(e){A(e=`${e}`);const t=w(this[I],e);void 0!==t&&delete this[I][t]}raw(){return this[I]}keys(){return j(this,"key")}values(){return j(this,"value")}[Symbol.iterator](){return j(this,"key+value")}}function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[I]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[I][t].join(", ")}:function(t){return[t.toLowerCase(),e[I][t].join(", ")]})}C.prototype.entries=C.prototype[Symbol.iterator],Object.defineProperty(C.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(C.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const P=Symbol("internal");function j(e,t){const a=Object.create(k);return a[P]={target:e,kind:t,index:0},a}const k=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==k)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[P];const t=e.target,a=e.kind,n=e.index,r=D(t,a);return n>=r.length?{value:void 0,done:!0}:(this[P].index=n+1,{value:r[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function x(e){const t=Object.assign({__proto__:null},e[I]),a=w(e[I],"Host");return void 0!==a&&(t[a]=t[a][0]),t}Object.defineProperty(k,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const L=Symbol("Response internals"),M=r.STATUS_CODES;class G{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y.call(this,e,t);const a=t.status||200,n=new C(t.headers);if(null!=e&&!n.has("Content-Type")){const t=R(e);t&&n.append("Content-Type",t)}this[L]={url:t.url,status:a,statusText:t.statusText||M[a],headers:n,counter:t.counter}}get url(){return this[L].url||""}get status(){return this[L].status}get ok(){return this[L].status>=200&&this[L].status<300}get redirected(){return this[L].counter>0}get statusText(){return this[L].statusText}get headers(){return this[L].headers}clone(){return new G(v(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}y.mixIn(G.prototype),Object.defineProperties(G.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(G.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const F=Symbol("Request internals"),B=i.URL||o.URL,z=i.parse,V=i.format;function $(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new B(e).toString()),z(e)}const U="destroy"in n.Readable.prototype;function H(e){return"object"==typeof e&&"object"==typeof e[F]}class q{constructor(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};H(e)?t=$(e.url):(t=e&&e.href?$(e.href):$(`${e}`),e={});let n=a.method||e.method||"GET";if(n=n.toUpperCase(),(null!=a.body||H(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let r=null!=a.body?a.body:H(e)&&null!==e.body?v(e):null;y.call(this,r,{timeout:a.timeout||e.timeout||0,size:a.size||e.size||0});const i=new C(a.headers||e.headers||{});if(null!=r&&!i.has("Content-Type")){const e=R(r);e&&i.append("Content-Type",e)}let o=H(e)?e.signal:null;if("signal"in a&&(o=a.signal),null!=o&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[F]={method:n,redirect:a.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:o},this.follow=void 0!==a.follow?a.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==a.compress?a.compress:void 0===e.compress||e.compress,this.counter=a.counter||e.counter||0,this.agent=a.agent||e.agent}get method(){return this[F].method}get url(){return V(this[F].parsedURL)}get headers(){return this[F].headers}get redirect(){return this[F].redirect}get signal(){return this[F].signal}clone(){return new q(this)}}function K(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}y.mixIn(q.prototype),Object.defineProperty(q.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(q.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),K.prototype=Object.create(Error.prototype),K.prototype.constructor=K,K.prototype.name="AbortError";const W=i.URL||o.URL,Q=n.PassThrough;function Y(e,t){if(!Y.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return y.Promise=Y.Promise,new Y.Promise(function(a,i){const o=new q(e,t),l=function(e){const t=e[F].parsedURL,a=new C(e[F].headers);if(a.has("Accept")||a.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof n.Readable&&!U)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=b(e);"number"==typeof t&&(r=String(t))}r&&a.set("Content-Length",r),a.has("User-Agent")||a.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!a.has("Accept-Encoding")&&a.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),Object.assign({},t,{method:e.method,headers:x(a),agent:i})}(o),u=("https:"===l.protocol?s:r).request,d=o.signal;let c=null;const f=function(){let e=new K("The user aborted a request.");i(e),o.body&&o.body instanceof n.Readable&&X(o.body,e),c&&c.body&&c.body.emit("error",e)};if(d&&d.aborted)return void f();const h=function(){f(),E()},_=u(l);let y;function E(){_.abort(),d&&d.removeEventListener("abort",h),clearTimeout(y)}d&&d.addEventListener("abort",h),o.timeout&&_.once("socket",function(e){y=setTimeout(function(){i(new m(`network timeout at: ${o.url}`,"request-timeout")),E()},o.timeout)}),_.on("error",function(e){i(new m(`request to ${o.url} failed, reason: ${e.message}`,"system",e)),c&&c.body&&X(c.body,e),E()}),function(e,t){let a;e.on("socket",function(e){a=e}),e.on("response",function(e){const n=e.headers;"chunked"!==n["transfer-encoding"]||n["content-length"]||e.once("close",function(e){if(a&&a.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}})})}(_,function(e){d&&d.aborted||c&&c.body&&X(c.body,e)}),parseInt(process.version.substring(1))<14&&_.on("socket",function(e){e.addListener("close",function(t){const a=e.listenerCount("data")>0;if(c&&a&&!t&&(!d||!d.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",e)}})}),_.on("response",function(e){clearTimeout(y);const t=function(e){const t=new C;for(const a of Object.keys(e))if(!O.test(a))if(Array.isArray(e[a]))for(const n of e[a])N.test(n)||(void 0===t[I][a]?t[I][a]=[n]:t[I][a].push(n));else N.test(e[a])||(t[I][a]=[e[a]]);return t}(e.headers);if(Y.isRedirect(e.statusCode)){const r=t.get("Location");let s=null;try{s=null===r?null:new W(r,o.url).toString()}catch(e){if("manual"!==o.redirect)return i(new m(`uri requested responds with an invalid redirect URL: ${r}`,"invalid-redirect")),void E()}switch(o.redirect){case"error":return i(new m(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),void E();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){i(e)}break;case"follow":if(null===s)break;if(o.counter>=o.follow)return i(new m(`maximum redirect reached at: ${o.url}`,"max-redirect")),void E();const r={headers:new C(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:o.body,signal:o.signal,timeout:o.timeout,size:o.size};if(!function(e,t){const a=new W(t).hostname,n=new W(e).hostname;return a===n||"."===a[a.length-n.length-1]&&a.endsWith(n)}(o.url,s)||(n=o.url,new W(s).protocol!==new W(n).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(e);return 303!==e.statusCode&&o.body&&null===b(o)?(i(new m("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void E()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==o.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),a(Y(new q(s,r))),void E())}}var n;e.once("end",function(){d&&d.removeEventListener("abort",h)});let r=e.pipe(new Q);const s={url:o.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:o.size,timeout:o.timeout,counter:o.counter},l=t.get("Content-Encoding");if(!o.compress||"HEAD"===o.method||null===l||204===e.statusCode||304===e.statusCode)return c=new G(r,s),void a(c);const u={flush:p.Z_SYNC_FLUSH,finishFlush:p.Z_SYNC_FLUSH};if("gzip"==l||"x-gzip"==l)return r=r.pipe(p.createGunzip(u)),c=new G(r,s),void a(c);if("deflate"==l||"x-deflate"==l){const t=e.pipe(new Q);return t.once("data",function(e){r=8==(15&e[0])?r.pipe(p.createInflate()):r.pipe(p.createInflateRaw()),c=new G(r,s),a(c)}),void t.on("end",function(){c||(c=new G(r,s),a(c))})}if("br"==l&&"function"==typeof p.createBrotliDecompress)return r=r.pipe(p.createBrotliDecompress()),c=new G(r,s),void a(c);c=new G(r,s),a(c)}),function(e,t){const a=t.body;null===a?e.end():g(a)?a.stream().pipe(e):Buffer.isBuffer(a)?(e.write(a),e.end()):a.pipe(e)}(_,o)})}function X(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Y.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Y.Promise=global.Promise;const J=Y},9660:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(6223),r=a(4450),i=a(458),o=a(2697),s={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,parentSchema:s,data:p,it:l}=e;"all"===l.opts.removeAdditional&&void 0===s.additionalProperties&&o.default.code(new n.KeywordCxt(l,o.default,"additionalProperties"));const u=(0,r.allSchemaProperties)(a);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter(e=>!(0,i.alwaysValidSchema)(l,a[e]));if(0===d.length)return;const c=t.name("valid");for(const a of d)m(a)?f(a):(t.if((0,r.propertyInData)(t,p,a,l.opts.ownProperties)),f(a),l.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(a),e.ok(c);function m(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==a[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};t.default=s},9690:(e,t,a)=>{const{humanReadableArgName:n}=a(1762);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),a=e._getHelpCommand();return a&&!a._hidden&&t.push(a),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const a=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return a(e).localeCompare(a(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),a=e._getHelpOption();if(a&&!a.hidden){const n=a.short&&e._findOption(a.short),r=a.long&&e._findOption(a.long);n||r?a.long&&!r?t.push(e.createOption(a.long,a.description)):a.short&&!n&&t.push(e.createOption(a.short,a.description)):t.push(a)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let a=e.parent;a;a=a.parent){const e=a.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){const t=e.registeredArguments.map(e=>n(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,a)=>Math.max(e,t.subcommandTerm(a).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,a)=>Math.max(e,t.optionTerm(a).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,a)=>Math.max(e,t.optionTerm(a).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,a)=>Math.max(e,t.argumentTerm(a).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let a="";for(let t=e.parent;t;t=t.parent)a=t.name()+" "+a;return a+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const a=`(${t.join(", ")})`;return e.description?`${e.description} ${a}`:a}return e.description}formatHelp(e,t){const a=t.padWidth(e,t),n=t.helpWidth||80;function r(e,r){if(r){const i=`${e.padEnd(a+2)}${r}`;return t.wrap(i,n-2,a+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,""];const s=t.commandDescription(e);s.length>0&&(o=o.concat([t.wrap(s,n,0),""]));const p=t.visibleArguments(e).map(e=>r(t.argumentTerm(e),t.argumentDescription(e)));p.length>0&&(o=o.concat(["Arguments:",i(p),""]));const l=t.visibleOptions(e).map(e=>r(t.optionTerm(e),t.optionDescription(e)));if(l.length>0&&(o=o.concat(["Options:",i(l),""])),this.showGlobalOptions){const a=t.visibleGlobalOptions(e).map(e=>r(t.optionTerm(e),t.optionDescription(e)));a.length>0&&(o=o.concat(["Global Options:",i(a),""]))}const u=t.visibleCommands(e).map(e=>r(t.subcommandTerm(e),t.subcommandDescription(e)));return u.length>0&&(o=o.concat(["Commands:",i(u),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,a,n=40){const r=new RegExp("[\\n][ \\f\\t\\v   -    \ufeff]+");if(e.match(r))return e;const i=t-a;if(i<n)return e;const o=e.slice(0,a),s=e.slice(a).replace("\r\n","\n"),p=" ".repeat(a),l="\\s​",u=new RegExp(`\n|.{1,${i-1}}([${l}]|$)|[^${l}]+?([${l}]|$)`,"g");return o+(s.match(u)||[]).map((e,t)=>"\n"===e?"":(t>0?p:"")+e.trimEnd()).join("\n")}}},9741:(e,t,a)=>{const n=a(5479),{animationRunTypes:r,autoGeneratedItemIdKind:i}=a(7089);t.systemActionDescriptions={PROPERTY_BANK_EXPRESSION:{default:"","en-us":"Change Data value with script expression. One expression of return value","zh-tw":"使用腳本表達式改變 Data 值。 一個表達式回傳值","ja-jp":"スクリプト式を使用して Data の値を変更する。1つの式で値を返す"},PROPERTY_BANK:{default:"","en-us":"Change Data value","zh-tw":"改變 Data 值","ja-jp":"Data の値を変更する"},PROPERTY_BANK_COMMAND:{default:"","en-us":"Trigger Data calculation flow without value change","zh-tw":"不需改變值,觸發 Data 計算流程","ja-jp":"値を変更せずに Data の計算フローをトリガーする"},DYNAMIC_BRICK:{default:"","en-us":"[Unstable] Dynamically generate bricks","zh-tw":"[Unstable] 動態地産生 Bricks","ja-jp":"動的に生成されたブリック"},DYNAMIC_BRICK_RESET:{default:"","en-us":"[Unstable] Reset Dynamic Bricks","zh-tw":"[Unstable] 重設 Dynamic Bricks","ja-jp":"動的に生成されたブリックをリセットする"},DYNAMIC_ANIMATION:{default:"","en-us":"Run specific Animation on specific Brick","zh-tw":"在指定的 Brick 上運行指定的 Animation","ja-jp":"指定されたブリックで指定されたアニメーションを実行する"},DYNAMIC_ANIMATION_RESET:{default:"","en-us":"Reset Dynamic Animation","zh-tw":"重設 Dynamic Animation","ja-jp":"動的なアニメーションをリセットする"},DYNAMIC_ANIMATION_STOP:{default:"","en-us":"Stop Dynamic Animation","zh-tw":"停止 Dynamic Animation","ja-jp":"動的なアニメーションを停止する"},CHANGE_CANVAS:{default:"","en-us":"Change canvas on the current Subspace","zh-tw":"在當前的 Subspace 中切換 Canvas","ja-jp":"現在の Subspace の Canvas を変更する"},MESSAGE:{default:"","en-us":"Log System message","zh-tw":"Log System message","ja-jp":"システムメッセージをログに記録する"},ALERT:{default:"","en-us":"Show system alert popup with custom message","zh-tw":"顯示自定義訊息的系統警告彈窗","ja-jp":"カスタムメッセージを使用してシステム警告ポップアップを表示する"},POPUP_RESET:{default:"","en-us":"Close current showing popups with type or id.","zh-tw":"關閉目前顯示的 Popup,可以指定 Popup 類型或 id。","ja-jp":"現在表示されているポップアップを閉じる、または ID で指定されたポップアップを閉じる。"},TAKE_SCREENSHOT:{default:"","en-us":"Take screenshot for current subspace","zh-tw":"為當前的 Subspace 截圖","ja-jp":"現在の Subspace のスクリーンショットを撮る"},STORAGE_SET:{default:"","en-us":"Store a value in application-specific storage","zh-tw":"在應用程式特定的儲存空間中儲存值","ja-jp":"アプリケーション固有のストレージに値を保存する"},STORAGE_RETRIEVE:{default:"","en-us":"Retrieve a value from application-specific storage","zh-tw":"從應用程式特定的儲存空間中取得值","ja-jp":"アプリケーション固有のストレージから値を取得する"},STORAGE_DELETE:{default:"","en-us":"Delete a value from application-specific storage or clear all values","zh-tw":"從應用程式特定的儲存空間中刪除值或清除所有值","ja-jp":"アプリケーション固有のストレージから値を削除するか、すべての値をクリアする"},CHANNEL_SUBSCRIBE:{default:"","en-us":"Subscribe to a channel for data update","zh-tw":"訂閱一個 Channel 以接收資料更新","ja-jp":"チャンネルを購読してデータ更新を受け取る"},CHANNEL_UNSUBSCRIBE:{default:"","en-us":"Unsubscribe from a channel","zh-tw":"取消訂閱一個 Channel","ja-jp":"チャンネルから購読を解除する"},CHANNEL_PUBLISH:{default:"","en-us":"Publish data to a channel","zh-tw":"發布資料到一個 Channel","ja-jp":"チャンネルにデータを発行する"},DELAY:{default:"","en-us":"Delay for a certain time between actions","zh-tw":"延遲一段時間,用於兩個動作之間","ja-jp":"一定時間遅延する、2つのアクションの間"},USE_SHARE_APPLICATION:{default:"","en-us":"[Internal] Use a shared application","zh-tw":"[Internal] 切換到分享的應用程式","ja-jp":"[Internal] 共有アプリケーションを使用する"},AUTH_IN_DEVICE:{default:"","en-us":"[Internal] Auth in device","zh-tw":"[Internal] 在裝置上進行帳號登入","ja-jp":"[Internal] デバイスで認証する"},REFRESH_BINDCODE:{default:"","en-us":"[Internal] Refresh passcode for bind device","zh-tw":"[Internal] 更新裝置綁定碼","ja-jp":"[Internal] デバイスのバインドコードを更新する"},OPEN_URL:{default:"","en-us":"Open URL","zh-tw":"開啟 URL","ja-jp":"URL を開く"},OPEN_FILE:{default:"","en-us":"Open File or Directory","zh-tw":"開啟檔案或目錄","ja-jp":"ファイルまたはディレクトリを開く"},THROW_EXCEPTION:{default:"","en-us":"Throw exception","zh-tw":"拋出例外","ja-jp":"例外を投げる"},RESTART_FOUNDATION:{default:"","en-us":"Restart the foundation (React Native bundle)","zh-tw":"重新啟動基礎設施 (React Native bundle)","ja-jp":"基盤を再起動する (React Native bundle)"},DISMISS_KEYBOARD:{default:"","en-us":"Dismiss keyboard","zh-tw":"關閉鍵盤","ja-jp":"キーボードを閉じる"},TRIGGER_APPLICATION_FILTER:{default:"","en-us":"Trigger application AI filter","zh-tw":"觸發應用程式 AI 過濾器","ja-jp":"アプリケーション AI フィルターをトリガーする"},STOP_APPLICATION_FILTER:{default:"","en-us":"Stop running application AI filter","zh-tw":"停止運行中的應用程式 AI 過濾器","ja-jp":"実行中のアプリケーション AI フィルターを停止する"},SAVE_UPDATE_SNAPSHOT:{default:"","en-us":"Save update snapshot (from Application Filter or DevTools MCP Server) to media system","zh-tw":"儲存更新快照 (來自 Application Filter 或 DevTools MCP Server) 到媒體系統","ja-jp":"メディアシステムに更新スナップショット (Application Filter または DevTools MCP サーバーから) を保存する"}},t.systemActions={PROPERTY_BANK_EXPRESSION:{displayName:"CHANGE DATA WITH EXPRESSION",canProvideProperty:!0,filterKind:[i],propertyNameType:"defined_properties",property:{EXPRESSION:{type:"string",displayName:"Expression",normalizeDisplayName:!1},VARIABLES:{type:"nested",schema:{type:"object",properties:{id:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Data ID",normalizeDisplayName:!1},key:{type:"string"}},allowNewItem:!0},popover:!0,defaultValue:[]},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},RESULT_ASSIGN_PATH:{type:"string"},ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK:{displayName:"CHANGE DATA",canProvideProperty:!0,filterKind:[i],propertyNameType:"property_bank",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK_COMMAND:{displayName:"TRIGGER DATA COMMAND",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"property_bank",type:"bool",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:16}},DYNAMIC_BRICK:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_BRICK_ADD_LIST:{type:"string"},DYNAMIC_BRICK_PREFER_AFTER_ITEM_ID:{type:"string"},DYNAMIC_BRICK_RESET:{type:"bool"},DYNAMIC_BRICK_REMOVE_ITEM_ID:{type:"string"},DYNAMIC_BRICK_REMOVE_ITEMS:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"grid-2"}},DYNAMIC_BRICK_RESET:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"},DYNAMIC_ANIMATION_ANIMATION_ID:{type:"string",kind:"id",idType:"animation"},DYNAMIC_ANIMATION_RUN_TYPE:{type:"oneOf",oneOf:r},DYNAMIC_ANIMATION_RESET_INITIAL_VALUE:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bars-staggered",size:16}},DYNAMIC_ANIMATION_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION_STOP:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"stop"}},CHANGE_CANVAS:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{CANVAS_ID:{type:"string",kind:"id",idType:"canvas"},CANVAS_TITLE_LIKE:{type:"string"},CANVAS_KEY_MAP_LIST:{type:"nested",schema:{type:"object",properties:{key:{displayName:"Key",type:"string"},value:{displayName:"Canvas ID",type:"string",kind:"id",idType:"canvas"}},allowNewItem:!0},popover:!0,defaultValue:[]},CANVAS_KEY:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"diamond-turn-right",size:16}},MESSAGE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{SYSTEM_MESSAGE_TYPE:{type:"oneOf",oneOf:["SYSTEM_MESSAGE_TYPE_INFO","SYSTEM_MESSAGE_TYPE_SUCCESS","SYSTEM_MESSAGE_TYPE_WARNING","SYSTEM_MESSAGE_TYPE_ERROR"]},SYSTEM_MESSAGE_TITLE:{type:"string"},SYSTEM_MESSAGE_MESSAGE:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"note"}},ALERT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{ALERT_ID:{type:"string"},ALERT_TYPE:{type:"oneOf",oneOf:["info","success","warning","error"]},ALERT_TITLE:{type:"string"},ALERT_MESSAGE:{type:"string"},ALERT_SELECTIONS:{type:"nested",schema:{type:"object",properties:{label:{type:"string"},color:{type:"string"},value:{type:"string"},disableResult:{type:"bool"}},allowNewItem:!0},popover:!0,defaultValue:[]},ALERT_SELECTION_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ALERT_TIMEOUT:{type:"number",defaultValue:1e4},ALERT_HIDE_SELECTIONS:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bell"}},POPUP_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{POPUP_CLEAR_TYPE:{type:"oneOf",oneOf:["all","alert","generator"]},POPUP_ID:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},TAKE_SCREENSHOT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{TAKE_SCREENSHOT_CURRENT_SUBSPACE:{type:"bool"},TAKE_SCREENSHOT_BRICK_ID:{type:"string",kind:"id",idType:"brick",displayName:"Brick ID",normalizeDisplayName:!1},TAKE_SCREENSHOT_FORMAT:{type:"oneOf",oneOf:["jpg","png"]},TAKE_SCREENSHOT_QUALITY:{type:"number",max:1,min:0,step:.1},TAKE_SCREENSHOT_WIDTH:{type:"number"},TAKE_SCREENSHOT_HEIGHT:{type:"number"},TAKE_SCREENSHOT_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"camera",size:16}},STORAGE_SET:{displayName:"STORAGE SET",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_VALUE:{type:"any",displayName:"Value",normalizeDisplayName:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_RETRIEVE:{displayName:"STORAGE RETRIEVE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_RETRIEVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},STORAGE_RETRIEVE_DEFAULT_VALUE:{type:"string",displayName:"Default Value",normalizeDisplayName:!1},STORAGE_RETRIEVE_SKIP_IF_NOT_FOUND:{type:"bool",displayName:"Skip if Not Found",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_DELETE:{displayName:"STORAGE DELETE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_DELETE_ALL:{type:"bool",displayName:"Delete All Values",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"trash",size:14}},CHANNEL_SUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_SUBSCRIBE_KEY:{type:"string"},CHANNEL_SUBSCRIBE_TYPE:{type:"oneOf",oneOf:["on","once"]},CHANNEL_SUBSCRIBE_LIVETIME:{type:"number",kind:"unit",unit:"ms"},CHANNEL_SUBSCRIBE_DATA_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result"},CHANNEL_SUBSCRIBE_DATA_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_PROGRESS_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Progress"},CHANNEL_SUBSCRIBE_PROGRESS_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},CHANNEL_UNSUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_UNSUBSCRIBE_KEY_MATCH:{type:"string"}}},CHANNEL_PUBLISH:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_PUBLISH_KEY_MATCH:{type:"string"},CHANNEL_PUBLISH_PAYLOAD_TYPE:{type:"oneOf",oneOf:["result","progress","error"]},CHANNEL_PUBLISH_PAYLOAD:{type:"string"}}},DELAY:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{DELAY_TIME:{type:"number",kind:"unit",unit:"ms"}}},USE_SHARE_APPLICATION:{hidden:"internal",canProvideProperty:!0,propertyNameType:"defined_properties",property:{APPLICATION_ID:{type:"string"},RELEASE_VERSION:{type:"string"},USE_TYPE:{type:"oneOf",oneOf:["run","use-after-bind","cancel-use"]},VIEWPORT_PRESET_NAME_LIKE:{type:"string"},VIEWPORT_PRESET_DEVICE_TARGET:{type:"string"},ENABLE_LOCAL_SYNC:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},AUTH_IN_DEVICE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"user",size:16}},REFRESH_BINDCODE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},OPEN_URL:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{URL:{type:"string",normalizeDisplayName:!1,displayName:"URL"},BEHAVIOR:{type:"oneOf",oneOf:["in-app","new-window"]},IN_APP_TINT_COLOR:{type:"string",kind:"color",popover:!0}},previewIcon:{type:"font-awesome-6pro",name:"external-link",size:16}},OPEN_FILE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{PICK_TYPE:{type:"oneOf",oneOf:["file","multiple","directory"],oneOfEmptyOption:!1},FILE_TYPE:{type:"any"},COPY_TO:{type:"oneOf",oneOf:["cache","document"]},MODE:{type:"oneOf",oneOf:["import","open"]},SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},SAVE_DETAIL_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ERROR_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"folder-open",size:16}},THROW_EXCEPTION:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{BEHAVIOR:{type:"oneOf",oneOf:["application","native"]},EXCEPTION_MESSAGE:{type:"string",displayName:"Exception Message"}},previewIcon:{type:"font-awesome-6pro",name:"bomb",size:16}},RESTART_FOUNDATION:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},DISMISS_KEYBOARD:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"keyboard-down",size:16}},TRIGGER_APPLICATION_FILTER:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{NAME:{type:"string",displayName:"Filter Name",normalizeDisplayName:!1},VARIABLES:{type:"any",displayName:"Variables",normalizeDisplayName:!1},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},ERROR:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"robot",size:16}},STOP_APPLICATION_FILTER:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"stop",size:16}},SAVE_UPDATE_SNAPSHOT:{displayName:"SAVE UPDATE SNAPSHOT",canProvideProperty:!0,propertyNameType:"defined_properties",property:{SNAPSHOT_FILE_INDENTIFIER:{type:"string",displayName:"Filename Identifier",defaultValue:"default",normalizeDisplayName:!1},SNAPSHOT_SAVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},SNAPSHOT_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"camera-retro",size:16}}},t.getSubspaceActionTypes=e=>Object.entries(e.action_map||{}).reduce((e,[t,a])=>(e[`SUBSPACE_ACTION_${t}`]={canProvideProperty:Object.keys(a.event_property_map||{}).length>0,property:Object.entries(a.event_property_map||{}).reduce((e,[t,a])=>(e[`SUBSPACE_${t}`]={type:a.type,name:n(t)},e),{}),propertyNameType:"defined_properties"},e),{})},9753:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r=a(458),i=a(4450),o=a(3426),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:a,it:n}=e,{prefixItems:s}=a;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,o.validateAdditionalItems)(e,s):e.ok((0,i.validateArray)(e)))}};t.default=s},9760:(e,t,a)=>{a.d(t,{$:()=>T});var n=a(5608),r=a(9212),i=a(9074),o=a(3673),s=a(2307),p=a(3647),l=a(3068),u=a(4874),d=a(7195),c=a(4559),m=a(1151),f=a(3161),h=a(783),_=a(3777),y=a(3925),E=(0,r.maybe)(function(){return fetch}),T=function(e){void 0===e&&(e={});var t=e.uri,a=void 0===t?"/graphql":t,T=e.fetch,g=e.print,v=void 0===g?c.i1:g,R=e.includeExtensions,b=e.preserveHeaderCase,O=e.useGETForQueries,N=e.includeUnusedVariables,A=void 0!==N&&N,S=(0,n.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&(0,d.S)(T||E);var w={http:{includeExtensions:R,preserveHeaderCase:b},options:S.fetchOptions,credentials:S.credentials,headers:S.headers};return new i.C(function(e){var t=(0,l.z)(e,a),i=e.getContext(),d={};if(i.clientAwareness){var g=i.clientAwareness,R=g.name,b=g.version;R&&(d["apollographql-client-name"]=R),b&&(d["apollographql-client-version"]=b)}var N=(0,n.__assign)((0,n.__assign)({},d),i.headers),S={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:N};if((0,s.d8)(["client"],e.query)){var I=(0,y.er)(e.query);if(!I)return(0,f.N)(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=I}var C,D=(0,c.HY)(e,v,c.R4,w,S),P=D.options,j=D.body;j.variables&&!A&&(j.variables=(0,h.X)(j.variables,e.query)),P.signal||"undefined"==typeof AbortController||(C=new AbortController,P.signal=C.signal);var k,x="OperationDefinition"===(k=(0,_.Vn)(e.query)).kind&&"subscription"===k.operation,L=(0,s.d8)(["defer"],e.query);if(O&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(P.method="GET"),L||x){P.headers=P.headers||{};var M="multipart/mixed;";x&&L&&!1!==globalThis.__DEV__&&r.invariant.warn(41),x?M+="boundary=graphql;subscriptionSpec=1.0,application/json":L&&(M+="deferSpec=20220824,application/json"),P.headers.accept=M}if("GET"===P.method){var G=(0,m.E)(t,j),F=G.newURI,B=G.parseError;if(B)return(0,f.N)(B);t=F}else try{P.body=(0,p.Y)(j,"Payload")}catch(B){return(0,f.N)(B)}return new o.c(function(a){var n=T||(0,r.maybe)(function(){return fetch})||E,i=a.next.bind(a);return n(t,P).then(function(t){var a;e.setContext({response:t});var n=null===(a=t.headers)||void 0===a?void 0:a.get("content-type");return null!==n&&/^multipart\/mixed/i.test(n)?(0,u.tD)(t,i):(0,u.OQ)(e)(t).then(i)}).then(function(){C=void 0,a.complete()}).catch(function(e){C=void 0,(0,u.H4)(e,a)}),function(){C&&C.abort()}})})}},9762:(e,t,a)=>{a.d(t,{Ll:()=>s,aD:()=>i,aZ:()=>n,cE:()=>p,ou:()=>r});class n{constructor(e,t,a){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=a}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class r{constructor(e,t,a,n,r,i){this.kind=e,this.start=t,this.end=a,this.line=n,this.column=r,this.value=i,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const i={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},o=new Set(Object.keys(i));function s(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&o.has(t)}var p;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(p||(p={}))},9770:(e,t,a)=>{var n=a(4715)(a(8942),"Map");e.exports=n},9787:e=>{e.exports=JSON.parse('{"name":"GeneratorIntent","brickDescription":{"default":"","en-us":"Send intent to app and get result (Android only)","zh-tw":"向應用發送意圖並獲取結果 (僅限 Android)","ja-jp":"アプリにインテントを送信して結果を取得(Androidのみ)"},"brickDisplayName":"Intent","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"bullseye-arrow"},"brickMeta":{"preview":true},"propTypes":{"action":{"type":"string"},"data":{"type":"string"},"type":{"type":"string"},"extra":{"type":"object"},"className":{"type":"string"},"packageName":{"type":"string"},"category":{"type":"string"},"foregroundService":{"type":"bool"}},"brickPropDescriptions":{"action":{"default":"","en-us":"Intent action","zh-tw":"意圖動作","ja-jp":"インテントアクション"},"data":{"default":"","en-us":"Intent data","zh-tw":"意圖資料","ja-jp":"インテントデータ"},"type":{"default":"","en-us":"Intent type","zh-tw":"意圖類型","ja-jp":"インテントタイプ"},"extra":{"default":"","en-us":"Extra data","zh-tw":"額外資料","ja-jp":"追加データ"},"className":{"default":"","en-us":"Intent target class name in package","zh-tw":"意圖目標類名","ja-jp":"インテントターゲットのクラス名"},"packageName":{"default":"","en-us":"Intent target package name","zh-tw":"意圖目標包名","ja-jp":"インテントターゲットのパッケージ名"},"category":{"default":"","en-us":"Intent category","zh-tw":"意圖類別","ja-jp":"インテントカテゴリ"},"foregroundService":{"default":"","en-us":"Intent start foreground service","zh-tw":"意圖啟動前景服務","ja-jp":"インテント前景サービス"}},"defaultBrickProps":{},"propertyControls":{},"propertyControlGroups":{},"propertyControlGroupDescriptions":{},"eventTypes":{"GENERATOR_INTENT_ON_RESULT":"GENERATOR_INTENT_ON_RESULT","GENERATOR_INTENT_ON_ERROR":"GENERATOR_INTENT_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_INTENT_ON_RESULT":{"default":"","en-us":"On intent return a result trigger","zh-tw":"在意圖返回結果時觸發","ja-jp":"インテントが結果を返した時に発生するイベント"},"GENERATOR_INTENT_ON_ERROR":{"default":"","en-us":"On intent error trigger","zh-tw":"在意圖錯誤時觸發","ja-jp":"インテントエラー時に発生するイベント"}},"eventPropertyControls":{"GENERATOR_INTENT_ON_RESULT":{"properties":{"GENERATOR_INTENT_RESULT_CODE":{"name":"Result Code","type":"number"},"GENERATOR_INTENT_RESULT_DATA":{"name":"Result Data","type":"string"},"GENERATOR_INTENT_RESULT_EXTRAS":{"name":"Extra Data","type":"object"}}},"GENERATOR_INTENT_ON_ERROR":{"properties":{"GENERATOR_INTENT_ERROR":{"name":"Error Message","type":"string"}}}},"outletTypes":{"GENERATOR_INTENT_RESULT":{"outlet":"GENERATOR_INTENT_RESULT","type":"object"}},"brickOutletDescriptions":{"GENERATOR_INTENT_RESULT":{"default":"","en-us":"Last intent result","zh-tw":"最後意圖結果","ja-jp":"最後のインテント結果"}},"actionTypes":{"GENERATOR_INTENT_SEND_INTENT":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_INTENT_ACTION":{"name":"Action","type":"string"},"GENERATOR_INTENT_DATA":{"name":"Data","type":"string"},"GENERATOR_INTENT_TYPE":{"name":"Type","type":"string"},"GENERATOR_INTENT_EXTRA":{"name":"Extra","type":"object"},"GENERATOR_INTENT_CLASS_NAME":{"name":"Class Name","type":"string"},"GENERATOR_INTENT_PACKAGE_NAME":{"name":"Package Name","type":"string"},"GENERATOR_INTENT_CATEGORY":{"name":"Category","type":"string"}}},"GENERATOR_INTENT_START_SERVICE":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_INTENT_ACTION":{"name":"Action","type":"string"},"GENERATOR_INTENT_DATA":{"name":"Data","type":"string"},"GENERATOR_INTENT_TYPE":{"name":"Type","type":"string"},"GENERATOR_INTENT_EXTRA":{"name":"Extra","type":"object"},"GENERATOR_INTENT_CLASS_NAME":{"name":"Class Name","type":"string"},"GENERATOR_INTENT_PACKAGE_NAME":{"name":"Package Name","type":"string"},"GENERATOR_INTENT_CATEGORY":{"name":"Category","type":"string"},"GENERATOR_INTENT_FOREGROUND":{"name":"Foreground Service","type":"boolean"}}}},"brickActionDescriptions":{"GENERATOR_INTENT_SEND_INTENT":{"default":"","en-us":"Read stats","zh-tw":"讀取 stats","ja-jp":"統計情報を読み取る"},"GENERATOR_INTENT_START_SERVICE":{"default":"","en-us":"Start intent service","zh-tw":"啟動意圖服務","ja-jp":"インテントサービスを起動する"}}}')},9790:(e,t,a)=>{a.d(t,{default:()=>Q,oraPromise:()=>Y,spinners:()=>D}),a.r(t);var n=a(1708),r=a(8568);const i=(e,t,a,n)=>{if("length"===a||"prototype"===a)return;if("arguments"===a||"caller"===a)return;const r=Object.getOwnPropertyDescriptor(e,a),i=Object.getOwnPropertyDescriptor(t,a);!o(r,i)&&n||Object.defineProperty(e,a,i)},o=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},s=(e,t)=>`/* Wrapped ${e}*/\n${t}`,p=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),l=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function u(e,t,{ignoreNonConfigurable:a=!1}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t))i(e,t,n,a);return((e,t)=>{const a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)})(e,t),((e,t,a)=>{const n=""===a?"":`with ${a.trim()}() `,r=s.bind(null,n,t.toString());Object.defineProperty(r,"name",l);const{writable:i,enumerable:o,configurable:u}=p;Object.defineProperty(e,"toString",{value:r,writable:i,enumerable:o,configurable:u})})(e,t,n),e}const d=new WeakMap,c=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let a,n=0;const r=e.displayName||e.name||"<anonymous>",i=function(...o){if(d.set(i,++n),1===n)a=e.apply(this,o),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${r}\` can only be called once`);return a};return u(i,e),d.set(i,n),i};c.callCount=e=>{if(!d.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return d.get(e)};const m=c,f=[];f.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&f.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&f.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const h=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,_=Symbol.for("signal-exit emitter"),y=globalThis,E=Object.defineProperty.bind(Object);class T{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(y[_])return y[_];E(y,_,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const a=this.listeners[e],n=a.indexOf(t);-1!==n&&(0===n&&1===a.length?a.length=0:a.splice(n,1))}emit(e,t,a){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const r of this.listeners[e])n=!0===r(t,a)||n;return"exit"===e&&(n=this.emit("afterExit",t,a)||n),n}}class g{}const v=globalThis.process,{onExit:R,load:b,unload:O}=(N=h(v)?new class extends g{#e="win32"===v.platform?"SIGINT":"SIGHUP";#t=new T;#a;#n;#r;#i={};#o=!1;constructor(e){super(),this.#a=e,this.#i={};for(const t of f)this.#i[t]=()=>{const a=this.#a.listeners(t);let{count:n}=this.#t;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(n+=r.__signal_exit_emitter__.count),a.length===n){this.unload();const a=this.#t.emit("exit",null,t),n="SIGHUP"===t?this.#e:t;a||e.kill(e.pid,n)}};this.#r=e.reallyExit,this.#n=e.emit}onExit(e,t){if(!h(this.#a))return()=>{};!1===this.#o&&this.load();const a=t?.alwaysLast?"afterExit":"exit";return this.#t.on(a,e),()=>{this.#t.removeListener(a,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of f)try{const t=this.#i[e];t&&this.#a.on(e,t)}catch(e){}this.#a.emit=(e,...t)=>this.#s(e,...t),this.#a.reallyExit=e=>this.#p(e)}}unload(){this.#o&&(this.#o=!1,f.forEach(e=>{const t=this.#i[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#a.removeListener(e,t)}catch(e){}}),this.#a.emit=this.#n,this.#a.reallyExit=this.#r,this.#t.count-=1)}#p(e){return h(this.#a)?(this.#a.exitCode=e||0,this.#t.emit("exit",this.#a.exitCode,null),this.#r.call(this.#a,this.#a.exitCode)):0}#s(e,...t){const a=this.#n;if("exit"===e&&h(this.#a)){"number"==typeof t[0]&&(this.#a.exitCode=t[0]);const n=a.call(this.#a,e,...t);return this.#t.emit("exit",this.#a.exitCode,null),n}return a.call(this.#a,e,...t)}}(v):new class extends g{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>N.onExit(e,t),load:()=>N.load(),unload:()=>N.unload()});var N;const A=n.stderr.isTTY?n.stderr:n.stdout.isTTY?n.stdout:void 0,S=A?m(()=>{R(()=>{A.write("[?25h")},{alwaysLast:!0})}):()=>{};let w=!1;const I={show:(e=n.stderr)=>{e.isTTY&&(w=!1,e.write("[?25h"))},hide:(e=n.stderr)=>{e.isTTY&&(S(),w=!0,e.write("[?25l"))},toggle:(e,t)=>{void 0!==e&&(w=e),w?I.show(t):I.hide(t)}},C=I;var D=a(7661);const P={info:r.Ay.blue("ℹ"),success:r.Ay.green("✔"),warning:r.Ay.yellow("⚠"),error:r.Ay.red("✖")},j={info:r.Ay.blue("i"),success:r.Ay.green("√"),warning:r.Ay.yellow("‼"),error:r.Ay.red("×")},k=("win32"!==n.platform?"linux"!==n.env.TERM:Boolean(n.env.CI)||Boolean(n.env.WT_SESSION)||Boolean(n.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===n.env.ConEmuTask||"Terminus-Sublime"===n.env.TERM_PROGRAM||"vscode"===n.env.TERM_PROGRAM||"xterm-256color"===n.env.TERM||"alacritty"===n.env.TERM||"JetBrains-JediTerm"===n.env.TERMINAL_EMULATOR)?P:j;const x=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function L(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(x,"")}function M(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function G(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}function F(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||129736===e||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function B(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function z(e,{ambiguousAsWide:t=!1}={}){return B(e),G(e)||F(e)||t&&M(e)?2:1}const V=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,$=new Intl.Segmenter,U=/^\p{Default_Ignorable_Code_Point}$/u;function H(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:a=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=L(e)),0===e.length)return 0;let r=0;const i={ambiguousAsWide:!a};for(const{segment:t}of $.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||U.test(t)||(V().test(t)?r+=2:r+=z(e,i)))}return r}var q=a(9122);const K=new class{#l=0;start(){this.#l++,1===this.#l&&this.#u()}stop(){if(this.#l<=0)throw new Error("`stop` called more times than `start`");this.#l--,0===this.#l&&this.#d()}#u(){"win32"!==n.platform&&n.stdin.isTTY&&(n.stdin.setRawMode(!0),n.stdin.on("data",this.#c),n.stdin.resume())}#d(){n.stdin.isTTY&&(n.stdin.off("data",this.#c),n.stdin.pause(),n.stdin.setRawMode(!1))}#c(e){3===e[0]&&n.emit("SIGINT")}};class W{#m=0;#f=!1;#h=0;#_=-1;#y=0;#E;#T;#g;#v;#R;#b;#O;#N;#A;#S;#w;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#E={color:"cyan",stream:n.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#E.color,this.spinner=this.#E.spinner,this.#R=this.#E.interval,this.#g=this.#E.stream,this.#b="boolean"==typeof this.#E.isEnabled?this.#E.isEnabled:function({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#g}),this.#O="boolean"==typeof this.#E.isSilent&&this.#E.isSilent,this.text=this.#E.text,this.prefixText=this.#E.prefixText,this.suffixText=this.#E.suffixText,this.indent=this.#E.indent}get indent(){return this.#N}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#N=e,this.#I()}get interval(){return this.#R??this.#T.interval??100}get spinner(){return this.#T}set spinner(e){if(this.#_=-1,this.#R=void 0,"object"==typeof e){if(void 0===e.frames)throw new Error("The given spinner must have a `frames` property");this.#T=e}else if((0,q.A)())if(void 0===e)this.#T=D.dots;else{if("default"===e||!D[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#T=D[e]}else this.#T=D.line}get text(){return this.#A}set text(e=""){this.#A=e,this.#I()}get prefixText(){return this.#S}set prefixText(e=""){this.#S=e,this.#I()}get suffixText(){return this.#w}set suffixText(e=""){this.#w=e,this.#I()}get isSpinning(){return void 0!==this.#v}#C(e=this.#S,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#D(e=this.#w,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#I(){const e=this.#g.columns??80,t=this.#C(this.#S,"-"),a=this.#D(this.#w,"-"),n=" ".repeat(this.#N)+t+"--"+this.#A+"--"+a;this.#h=0;for(const t of L(n).split("\n"))this.#h+=Math.max(1,Math.ceil(H(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#b&&!this.#O}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this.#b=e}get isSilent(){return this.#O}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this.#O=e}frame(){const e=Date.now();(-1===this.#_||e-this.#y>=this.interval)&&(this.#_=++this.#_%this.#T.frames.length,this.#y=e);const{frames:t}=this.#T;let a=t[this.#_];this.color&&(a=r.Ay[this.color](a));return("string"==typeof this.#S&&""!==this.#S?this.#S+" ":"")+a+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#w&&""!==this.#w?" "+this.#w:"")}clear(){if(!this.#b||!this.#g.isTTY)return this;this.#g.cursorTo(0);for(let e=0;e<this.#m;e++)e>0&&this.#g.moveCursor(0,-1),this.#g.clearLine(1);return(this.#N||this.lastIndent!==this.#N)&&this.#g.cursorTo(this.#N),this.lastIndent=this.#N,this.#m=0,this}render(){return this.#O||(this.clear(),this.#g.write(this.frame()),this.#m=this.#h),this}start(e){return e&&(this.text=e),this.#O?this:this.#b?(this.isSpinning||(this.#E.hideCursor&&C.hide(this.#g),this.#E.discardStdin&&n.stdin.isTTY&&(this.#f=!0,K.start()),this.render(),this.#v=setInterval(this.render.bind(this),this.interval)),this):(this.text&&this.#g.write(`- ${this.text}\n`),this)}stop(){return this.#b?(clearInterval(this.#v),this.#v=void 0,this.#_=0,this.clear(),this.#E.hideCursor&&C.show(this.#g),this.#E.discardStdin&&n.stdin.isTTY&&this.#f&&(K.stop(),this.#f=!1),this):this}succeed(e){return this.stopAndPersist({symbol:k.success,text:e})}fail(e){return this.stopAndPersist({symbol:k.error,text:e})}warn(e){return this.stopAndPersist({symbol:k.warning,text:e})}info(e){return this.stopAndPersist({symbol:k.info,text:e})}stopAndPersist(e={}){if(this.#O)return this;const t=e.prefixText??this.#S,a=this.#C(t," "),n=e.symbol??" ",r=e.text??this.text,i="string"==typeof r?(n?" ":"")+r:"",o=e.suffixText??this.#w,s=a+n+i+this.#D(o," ")+"\n";return this.stop(),this.#g.write(s),this}}function Q(e){return new W(e)}async function Y(e,t){const a="function"==typeof e,n="function"==typeof e.then;if(!a&&!n)throw new TypeError("Parameter `action` must be a Function or a Promise");const{successText:r,failText:i}="object"==typeof t?t:{successText:void 0,failText:void 0},o=Q(t).start();try{const t=a?e(o):e,n=await t;return o.succeed(void 0===r?void 0:"string"==typeof r?r:r(n)),n}catch(e){throw o.fail(void 0===i?void 0:"string"==typeof i?i:i(e)),e}}},9841:(e,t,a)=>{a.d(t,{I:()=>r});var n=a(8255);function r(e,t,a){return new n.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},9850:(e,t,a)=>{var n=a(9546),r=a(5813),i=a(5243),o=a(482);e.exports=function(e,t,a){return e=i(e),void 0===(t=a?void 0:t)?r(e)?o(e):n(e):e.match(t)||[]}},9868:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=a(7898),r=a(458),i=a(4450);t.error={message:({params:{property:e,depsCount:t,deps:a}})=>{const r=1===t?"property":"properties";return n.str`must have ${r} ${a} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:a,missingProperty:r}})=>n._`{property: ${e},
685
+ || ${s} === "boolean" || ${r} === null`).assign(p,o._`[${r}]`)}}n.else(),f(e),n.endIf(),n.if(o._`${p} !== undefined`,()=>{n.assign(r,p),function({gen:e,parentData:t,parentDataProperty:a},n){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${a}]`,n))}(e,p)})}(e,t,s):f(e)})}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,a,n=p.Correct){const r=n===p.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${r} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return o._`typeof ${t} ${r} ${e}`}return n===p.Correct?i:(0,o.not)(i);function s(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,a?o._`isFinite(${t})`:o.nil)}}function c(e,t,a,n){if(1===e.length)return d(e[0],t,a,n);let r;const i=(0,s.toHash)(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;r=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else r=o.nil;i.number&&delete i.integer;for(const e in i)r=(0,o.and)(r,d(e,t,a,n));return r}t.checkDataType=d,t.checkDataTypes=c;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:a,schema:n}=e,r=(0,s.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:a,schema:n.type,schemaCode:r,schemaValue:r,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=f},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9011:(e,t,a)=>{var n=a(8250);function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(r.Cache||n),a}r.Cache=n,e.exports=r},9041:e=>{e.exports=JSON.parse('{"name":"GeneratorReranker","brickDescription":{"default":"Reranker (GGML)","en-us":"Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp) \\n\\n ## Notice \\n - The device RAM must be larger than 8GB \\n - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal. \\n - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal. \\n - Android: Recommended use Android 13+ system. \\n - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported. \\n - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs. \\n - Linux / Windows \\n - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \\n - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)","zh-tw":"基於 GGML 和 [llama.cpp](https://github.com/ggerganov/llama.cpp) 的本地重排序 \\n\\n ## 注意事項 \\n - 設備 RAM 必須大於 8GB \\n - iOS: 建議使用 M1+ / A17+ 晶片的設備。支援 GPU 加速 by Metal. \\n - macOS: 建議使用 M1+ 晶片的設備。支援 GPU 加速 by Metal. \\n - Android: 建議使用 Android 13+ 系統。 \\n - 支援透過 OpenCL 進行 GPU 加速,目前僅支援 Qualcomm Adreno 700+ 的 GPU,其他 GPU 不支援。 \\n - 支援 Qualcomm Snapdragon 8 Gen 2+ 的 Hexagon NPU。 \\n - Linux / Windows \\n - 支援 GPU 加速,您可以在 Accel Variant 屬性中選擇 `vulkan` 或 `cuda` 後端 \\n - 支援 Qualcomm Dragonwing IQ9 系列+ 的 Hexagon NPU (Linux)","ja-jp":"GGML と [llama.cpp](https://github.com/ggerganov/llama.cpp) をベースにしたローカルリランキング \\n\\n ## 注意事項 \\n - デバイスの RAM は 8GB 以上である必要があります \\n - iOS: M1+ / A17+ チップのデバイスを推奨。Metal による GPU 加速をサポート。 \\n - macOS: M1+ チップのデバイスを推奨。Metal による GPU 加速をサポート。 \\n - Android: Android 13+ システムを推奨。 \\n - OpenCL による GPU 加速をサポート、現在 Qualcomm Adreno 700+ の GPU のみサポート、他の GPU はサポートされていません。 \\n - Qualcomm Snapdragon 8 Gen 2+ の Hexagon NPU をサポート。 \\n - Linux / Windows \\n - GPU 加速をサポート、Accel Variant プロパティで `vulkan` または `cuda` バックエンドを選択できます \\n - Qualcomm Dragonwing IQ9 シリーズ+ の Hexagon NPU をサポート (Linux)"},"brickDisplayName":"Reranker (GGML)","brickTip":{"default":""},"brickMeta":{"preview":true,"scriptMember":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"ranking-star"},"propTypes":{"init":{"type":"bool"},"modelUrl":{"type":"string"},"modelHash":{"type":"string"},"modelHashType":{"type":"oneOf","content":["md5","sha256","sha1"],"forcePropertyBank":false},"contextSize":{"type":"number"},"batchSize":{"type":"number"},"uBatchSize":{"type":"number"},"accelVariant":{"type":"oneOf","content":["default","vulkan","cuda","snapdragon"],"forcePropertyBank":false},"devices":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"mainGpu":{"type":"number"},"gpuLayers":{"type":"number"},"maxThreads":{"type":"number"},"useMlock":{"type":"bool"},"useMmap":{"type":"bool"},"query":{"type":"string"},"documents":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"normalize":{"type":"oneOfType","content":[{"type":"number"},{"type":"bool"}],"forcePropertyBank":false},"topK":{"type":"number"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Initialize the Reranker context on generator initialization","zh-tw":"在生成器初始化時初始化重排序上下文","ja-jp":"ジェネレーター初期化時にリランカーコンテキストを初期化する"},"modelUrl":{"default":"Model Configuration","en-us":"The URL or path of reranker model (GGUF format)","zh-tw":"重排序模型的 URL 或路径(GGUF 格式)","ja-jp":"リランカーモデルのURLまたはパス(GGUF形式)"},"modelHash":{"default":"","en-us":"Hash of reranker model","zh-tw":"重排序模型的哈希值","ja-jp":"リランカーモデルのハッシュ"},"modelHashType":{"default":"","en-us":"Hash type of reranker model","zh-tw":"重排序模型的哈希类型","ja-jp":"リランカーモデルのハッシュタイプ"},"contextSize":{"default":"Context Parameters","en-us":"Context size (0 ~ 4096) (Default to 512)","zh-tw":"上下文大小(0 ~ 4096)(默认为 512)","ja-jp":"コンテキストサイズ(0 ~ 4096)(デフォルト:512)"},"batchSize":{"default":"","en-us":"Logical batch size for processing (default: 512)","zh-tw":"处理的逻辑批次大小(默认:512)","ja-jp":"処理のための論理バッチサイズ(デフォルト:512)"},"uBatchSize":{"default":"","en-us":"Physical maximum batch size (default: 512)","zh-tw":"物理最大批次大小(默认:512)","ja-jp":"物理的な最大バッチサイズ(デフォルト:512)"},"accelVariant":{"default":"Hardware Acceleration","en-us":"GGML accelerator variant (Only for desktop) \\n `default` - CPU / Metal (macOS) \\n `vulkan` - Use Vulkan \\n `cuda` - Use CUDA \\n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon","zh-tw":"加速器變體 (僅適用於桌面版) \\n `default` - 使用 CPU / Metal (macOS) \\n `vulkan` - 使用 Vulkan \\n `cuda` - 使用 CUDA \\n `snapdragon` - 使用 OpenCL/Hexagon of Qualcomm Snapdragon","ja-jp":"アクセラレータのバリアント(デスクトップのみ) \\n `default` - CPU / Metal (macOS) \\n `vulkan` - Vulkan を使用 \\n `cuda` - CUDA を使用 \\n `snapdragon` - OpenCL/Hexagon of Qualcomm Snapdragon を使用"},"devices":{"default":"","en-us":"Devices. For example: \\n \\n Metal or CPU for iOS/tvOS/MacOS \\n OpenCL or CPU for Android \\n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \\n For Desktop, you may want to include/exclude GPUs","zh-tw":"裝置。例如: \\n \\n iOS/tvOS/MacOS 使用 Metal 或 CPU \\n Android 使用 OpenCL、CPU \\n - 對於 OpenCL/Hexagon 裝置可新增 `HTP0`、`HTP1`、`...`(使用 HTP* 代表所有 HTP 裝置) \\n 對於桌面版,您可能想要包含/排除 GPU","ja-jp":"デバイス。例: \\n \\n iOS/tvOS/MacOS の場合:Metal また CPU \\n Android の場合:OpenCL、CPU \\n - OpenCL/Hexagon デバイスの場合、`HTP0`、`HTP1`、`...` を追加します(すべての HTP デバイスには HTP* を使用) \\n デスクトップの場合、GPU を含める/除外することができます"},"mainGpu":{"default":"","en-us":"Main GPU index (default: 0)","zh-tw":"主 GPU 索引(默认:0)","ja-jp":"メインGPUインデックス(デフォルト:0)"},"gpuLayers":{"default":"","en-us":"Number of layers to store in VRAM (default: 0)","zh-tw":"存储在 VRAM 中的层数(默认:0)","ja-jp":"VRAMに格納するレイヤー数(デフォルト:0)"},"maxThreads":{"default":"","en-us":"Maximum number of threads to use (default: auto)","zh-tw":"使用的最大线程数(默认:自动)","ja-jp":"使用する最大スレッド数(デフォルト:自動)"},"useMlock":{"default":"Memory Settings","en-us":"Use mlock to keep model in memory (default: true)","zh-tw":"使用 mlock 将模型保持在内存中(默认:true)","ja-jp":"モデルをメモリに保持するためにmlockを使用(デフォルト:true)"},"useMmap":{"default":"","en-us":"Use mmap for model loading (default: true)","zh-tw":"使用 mmap 加载模型(默认:true)","ja-jp":"モデル読み込みにmmapを使用(デフォルト:true)"},"query":{"default":"Reranking Parameters","en-us":"Query text for reranking","zh-tw":"重排序的查询文本","ja-jp":"リランキング用のクエリテキスト"},"documents":{"default":"","en-us":"Array of documents to rerank","zh-tw":"要重排序的文档数组","ja-jp":"リランキングする文書の配列"},"normalize":{"default":"","en-us":"Normalize reranking scores (default: from model config)","zh-tw":"标准化重排序分数(默认:来自模型配置)","ja-jp":"リランキングスコアを正規化(デフォルト:モデル設定から)"},"topK":{"default":"","en-us":"Maximum number of documents to return (default: unlimited)","zh-tw":"返回的最大文档数(默认:无限制)","ja-jp":"返す文書の最大数(デフォルト:無制限)"}},"propertyControls":{"modelUrl":{"kind":"gguf-model-asset","displayName":"URL","normalizeDisplayName":false,"validator":{"fn":"uri","protocols":["https?","file"]},"fields":{"hashType":"modelHashType","hash":"modelHash"},"mediaFields":{"metadata":"_modelMediaMetadata"},"resetPropertiesOnChange":["modelHash"]},"modelHash":{"displayName":"Hash","normalizeDisplayName":false},"modelHashType":{"displayName":"Hash Type","normalizeDisplayName":false,"oneOfEmptyOption":false},"accelVariant":{"displayName":"Accelerator Variant","normalizeDisplayName":false},"mainGpu":{"displayName":"Main GPU","normalizeDisplayName":false},"gpuLayers":{"displayName":"GPU Layers","normalizeDisplayName":false},"maxThreads":{"displayName":"Max Threads","normalizeDisplayName":false},"useMlock":{"displayName":"Use mlock","normalizeDisplayName":false},"useMmap":{"displayName":"Use mmap","normalizeDisplayName":false},"query":{"displayName":"Query","normalizeDisplayName":false,"multiline":true},"documents":{"displayName":"Documents","normalizeDisplayName":false,"kind":"arrayOf","itemKind":"string"},"normalize":{"displayName":"Normalize Scores","normalizeDisplayName":false},"topK":{"displayName":"Top K","normalizeDisplayName":false}},"defaultBrickProps":{"init":false,"contextSize":512,"batchSize":512,"uBatchSize":512,"accelVariant":"default","mainGpu":0,"gpuLayers":0,"useMlock":true,"useMmap":true,"normalize":1},"propertyControlGroups":{"model":{"name":"Model Parameters","type":"group","content":["modelUrl","modelHash","modelHashType"]},"context":{"name":"Context Parameters","type":"group","content":["contextSize","batchSize","uBatchSize"]},"hardware":{"name":"Hardware Acceleration","type":"group","content":["accelVariant","mainGpu","gpuLayers","maxThreads"]},"memory":{"name":"Memory Settings","type":"group","content":["useMlock","useMmap"]},"reranking":{"name":"Reranking Parameters","type":"group","content":["query","documents","normalize","topK"]}},"propertyControlGroupDescriptions":{},"eventTypes":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE","GENERATOR_RERANKER_ON_ERROR":"GENERATOR_RERANKER_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":{"default":"","en-us":"Event triggered when the reranker context state changes (loading, ready, error, released)","zh-tw":"當重排序上下文狀態變更時觸發的事件(加載中、就緒、錯誤、已釋放)","ja-jp":"リランカーコンテキストの状態が変更されたときにトリガーされるイベント(読み込み中、準備完了、エラー、解放済み)"},"GENERATOR_RERANKER_ON_ERROR":{"default":"","en-us":"Event triggered when an error occurs during reranker operations","zh-tw":"在重排序操作過程中發生錯誤時觸發的事件","ja-jp":"リランカー操作中にエラーが発生したときにトリガーされるイベント"}},"eventPropertyControls":{"GENERATOR_RERANKER_ON_CONTEXT_STATE_CHANGE":{"properties":{"GENERATOR_RERANKER_CONTEXT_STATE":{"name":"Context State","type":"string"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"name":"Context Details","type":"object"}}},"GENERATOR_RERANKER_ON_ERROR":{"properties":{"GENERATOR_RERANKER_ERROR":{"name":"Error","type":"string"}}}},"outletTypes":{"GENERATOR_RERANKER_CONTEXT_STATE":{"outlet":"GENERATOR_RERANKER_CONTEXT_STATE","type":"string"},"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS":{"outlet":"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS","type":"number"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"outlet":"GENERATOR_RERANKER_CONTEXT_DETAILS","type":"object"},"GENERATOR_RERANKER_RERANK_RESULT":{"outlet":"GENERATOR_RERANKER_RERANK_RESULT","type":"array"},"GENERATOR_RERANKER_IS_PROCESSING":{"outlet":"GENERATOR_RERANKER_IS_PROCESSING","type":"bool"}},"brickOutletDescriptions":{"GENERATOR_RERANKER_CONTEXT_STATE":{"default":"","en-us":"Current state of the reranker context (loading, ready, error, released)","zh-tw":"重排序上下文的當前狀態(加載中、就緒、錯誤、已釋放)","ja-jp":"リランカーコンテキストの現在の状態(読み込み中、準備完了、エラー、解放済み)"},"GENERATOR_RERANKER_CONTEXT_LOAD_PROGRESS":{"default":"","en-us":"Loading progress of the reranker model (0-100)","zh-tw":"重排序模型的加載進度(0-100)","ja-jp":"リランカーモデルの読み込み進捗(0-100)"},"GENERATOR_RERANKER_CONTEXT_DETAILS":{"default":"","en-us":"Detailed information about the reranker context including instance ID and processing status","zh-tw":"關於重排序上下文的詳細信息,包括實例ID和處理狀態","ja-jp":"インスタンスIDと処理状況を含むリランカーコンテキストの詳細情報"},"GENERATOR_RERANKER_RERANK_RESULT":{"default":"","en-us":"Result of the reranking operation containing scored and ranked documents","zh-tw":"包含評分和排序文檔的重排序操作結果","ja-jp":"スコア付きおよびランク付きドキュメントを含むリランキング操作の結果"},"GENERATOR_RERANKER_IS_PROCESSING":{"default":"","en-us":"Boolean indicating whether the reranker is currently processing a request","zh-tw":"表示重排序器是否正在處理請求的布爾值","ja-jp":"リランカーが現在リクエストを処理中かどうかを示すブール値"}},"actionTypes":{"GENERATOR_RERANKER_LOAD_MODEL":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_RERANKER_RERANK":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_RERANKER_QUERY":{"name":"Query","type":"string"},"GENERATOR_RERANKER_DOCUMENTS":{"name":"Documents","type":"array"}}},"GENERATOR_RERANKER_RELEASE_CONTEXT":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_RERANKER_LOAD_MODEL":{"default":"","en-us":"Load the model","zh-tw":"讀取模型","ja-jp":"モデルを読み込む"},"GENERATOR_RERANKER_RERANK":{"default":"","en-us":"Rerank documents based on query relevance","zh-tw":"根據查詢相關性重新排序文件","ja-jp":"クエリの関連性に基づいてドキュメントを再ランキング"},"GENERATOR_RERANKER_RELEASE_CONTEXT":{"default":"","en-us":"Release context","zh-tw":"釋放上下文","ja-jp":"コンテキストを解放する"}},"scriptMemberFunctionDefs":{"load":{"arguments":[],"required":[],"return":{"type":"bool"}},"getModelInfo":{"arguments":[],"required":[],"return":{"type":"object"}},"rerank":{"arguments":[{"type":"object","name":"params","properties":{"query":{"name":"Query","type":"string"},"documents":{"name":"Documents","type":"array"},"normalize":{"name":"Normalize Scores","type":"number"},"topK":{"name":"Top K","type":"number"}}}],"required":["params"],"return":{"type":"array"}},"isProcessing":{"arguments":[],"required":[],"return":{"type":"bool"}},"release":{"arguments":[],"required":[],"return":{"type":"bool"}}},"scriptMemberFunctionDefDescriptions":{"load":{"default":"","en-us":"Load reranker model","zh-tw":"讀取重排序模型","ja-jp":"リランカーモデルを読み込む"},"getModelInfo":{"default":"","en-us":"Get reranker model information","zh-tw":"取得重排序模型資訊","ja-jp":"リランカーモデル情報を取得"},"rerank":{"default":"","en-us":"Rerank documents based on query relevance","zh-tw":"根據查詢相關性重新排序文件","ja-jp":"クエリの関連性に基づいてドキュメントを再ランキング"},"isProcessing":{"default":"","en-us":"Check if the reranker is currently processing a request","zh-tw":"檢查重排序器是否正在處理請求","ja-jp":"リランカーが現在リクエストを処理中かどうかを確認"},"release":{"default":"","en-us":"Release the reranker context","zh-tw":"釋放重排序上下文","ja-jp":"リランカーコンテキストを解放"}}}')},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9068:(e,t,a)=>{var n=a(4700);e.exports=function(e,t){var a=n(this,e),r=a.size;return a.set(e,t),this.size+=a.size==r?0:1,this}},9073:e=>{e.exports=JSON.parse('{"name":"GeneratorMCP","brickDescription":{"default":"Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link","en-us":"Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link","zh-tw":"MCP 客戶端,支援 SSE 和 Generator MCPServer 直接連接","ja-jp":"Model Context Protocol (MCP) クライアント、SSE と Generator MCPServer の直接リンクをサポート"},"brickDisplayName":"MCP","brickTip":{"default":""},"brickPreviewIcon":{"type":"material-community","name":"protocol"},"brickMeta":{"canBeGlobalGenerator":true,"scriptMember":true},"propTypes":{"globalGeneratorKey":{"type":"string"},"init":{"type":"bool"},"type":{"type":"oneOf","content":["streamable-http","sse","direct-link"],"forcePropertyBank":false},"url":{"type":"string"},"autoReconnect":{"type":"bool"},"maxReconnectAttempts":{"type":"number"},"reconnectInterval":{"type":"number"},"sseHeaders":{"type":"object"},"sendHeaders":{"type":"object"},"bearerToken":{"type":"string"},"generatorId":{"type":"string"},"generatorKey":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"},"ignoreResourceInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"ignoreToolInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"ignorePromptInList":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"requestTimeout":{"type":"number"}},"brickPropDescriptions":{"globalGeneratorKey":{"default":"","en-us":"Application-scoped generator key, key cannot be the same with other application-scoped generators","zh-tw":"應用程式範圍的 generator key,key 不能與其他應用程式範圍的 generator 相同","ja-jp":"アプリケーションスコープのジェネレーターキー、キーは他のアプリケーションスコープのジェネレーターと同じにできません"},"init":{"default":"","en-us":"Initialize the MCP client on start","zh-tw":"在啟動時初始化 MCP 客戶端","ja-jp":"起動時に MCP クライアントを初期化する"},"type":{"default":"","en-us":"Type of the MCP connection, e.g. sse or direct-link (generator)","zh-tw":"MCP 連接類型,例如 sse 或 direct-link (generator)","ja-jp":"MCP 接続のタイプ、例えば sse または direct-link (generator)"},"url":{"default":"","en-us":"URL of the MCP server, e.g. http://localhost:19853/sse","zh-tw":"MCP 伺服器的 URL,例如 http://localhost:19853/sse","ja-jp":"MCP サーバーの URL、例えば http://localhost:19853/sse"},"autoReconnect":{"default":"","en-us":"Whether to automatically reconnect to the MCP server","zh-tw":"是否自動重新連接到 MCP 伺服器","ja-jp":"MCP サーバーへの自動再接続を行うかどうか"},"maxReconnectAttempts":{"default":"","en-us":"Maximum number of reconnection attempts","zh-tw":"最大重連嘗試次數","ja-jp":"再接続の最大試行回数"},"reconnectInterval":{"default":"","en-us":"Reconnection interval in milliseconds","zh-tw":"重連間隔(毫秒)","ja-jp":"再接続間隔(ミリ秒)"},"sseHeaders":{"default":"","en-us":"SSE connection headers","zh-tw":"SSE 連線標頭","ja-jp":"SSE 接続ヘッダー"},"sendHeaders":{"default":"","en-us":"Send request headers","zh-tw":"傳送請求標頭","ja-jp":"リクエストヘッダーを送信"},"bearerToken":{"default":"","en-us":"Bearer token for authentication","zh-tw":"用於身份驗證的 Bearer 令牌","ja-jp":"認証用の Bearer トークン"},"generatorId":{"default":"","en-us":"Generator MCP Server ID for direct link","zh-tw":"Generator MCP Server ID,用於直接連接","ja-jp":"直接リンク用の Generator MCP Server ID"},"generatorKey":{"default":"","en-us":"Application-scoped key of Generator MCP Server for direct link (If ID is not provided)","zh-tw":"應用程式範圍的 Generator MCP Server key,用於直接連接(如果 ID 未提供)","ja-jp":"直接リンク用の Generator MCP Server のアプリケーションスコープキー(ID が提供されていない場合)"},"name":{"default":"","en-us":"Name of the MCP client","zh-tw":"MCP 客戶端的名稱","ja-jp":"MCP クライアントの名前"},"version":{"default":"","en-us":"Version of the MCP client","zh-tw":"MCP 客戶端的版本","ja-jp":"MCP クライアントのバージョン"},"ignoreResourceInList":{"default":"","en-us":"Ignore resources in list response","zh-tw":"忽略資源列表回應","ja-jp":"リスト応答内のリソースを無視する"},"ignoreToolInList":{"default":"","en-us":"Ignore tools in list response","zh-tw":"忽略工具列表回應","ja-jp":"リスト応答内のツールを無視する"},"ignorePromptInList":{"default":"","en-us":"Ignore prompts in list response","zh-tw":"忽略提示列表回應","ja-jp":"リスト応答内のプロンプトを無視する"},"requestTimeout":{"default":"","en-us":"Request timeout in milliseconds","zh-tw":"請求超時時間(毫秒)","ja-jp":"リクエストタイムアウト(ミリ秒)"}},"defaultBrickProps":{"init":false,"type":"streamable-http","url":"","autoReconnect":true,"maxReconnectAttempts":10,"reconnectInterval":1000,"generatorId":"","generatorKey":"","name":"bricks-foundation-mcp-client-default","version":"1.0.0","ignoreResourceInList":[],"ignoreToolInList":[],"ignorePromptInList":[],"requestTimeout":60000},"propertyControls":{"type":{"oneOfEmptyOption":false},"url":{"displayName":"URL","normalizeDisplayName":false},"sseHeaders":{"displayName":"SSE Headers","normalizeDisplayName":false},"generatorId":{"displayName":"Generator ID","normalizeDisplayName":false,"kind":"id","idType":"generator","idTypeFilter":["GENERATOR_MCP_SERVER"]}},"propertyControlGroups":{"sse":{"name":"Streamable-HTTP/SSE Config","type":"group","content":["url","sseHeaders","sendHeaders","bearerToken"]},"directLink":{"name":"Direct Link Config","type":"group","content":["generatorId","generatorKey"]},"client":{"name":"Client Config","type":"group","content":["name","version","ignoreToolInList","ignoreResourceInList","ignorePromptInList","requestTimeout"]}},"propertyControlGroupDescriptions":{"directLink":{"default":"","en-us":"Link to existing Generator MCPServer without network","zh-tw":"連接到現有的 Generator MCPServer 而不需要網路","ja-jp":"ネットワークなしで既存の Generator MCPServer に接続"}},"outletTypes":{"GENERATOR_MCP_CONNECTION_STATE":{"outlet":"GENERATOR_MCP_CONNECTION_STATE","type":"string"},"GENERATOR_MCP_LIST_RESOURCES_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_RESOURCES_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_RESOURCES_ERROR":{"outlet":"GENERATOR_MCP_LIST_RESOURCES_ERROR","type":"object"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR":{"outlet":"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR","type":"object"},"GENERATOR_MCP_READ_RESOURCE_RESPONSE":{"outlet":"GENERATOR_MCP_READ_RESOURCE_RESPONSE","type":"object"},"GENERATOR_MCP_READ_RESOURCE_ERROR":{"outlet":"GENERATOR_MCP_READ_RESOURCE_ERROR","type":"object"},"GENERATOR_MCP_LIST_TOOLS_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_TOOLS_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_TOOLS_ERROR":{"outlet":"GENERATOR_MCP_LIST_TOOLS_ERROR","type":"object"},"GENERATOR_MCP_CALL_TOOL_RESPONSE":{"outlet":"GENERATOR_MCP_CALL_TOOL_RESPONSE","type":"object"},"GENERATOR_MCP_CALL_TOOL_ERROR":{"outlet":"GENERATOR_MCP_CALL_TOOL_ERROR","type":"object"},"GENERATOR_MCP_LIST_PROMPTS_RESPONSE":{"outlet":"GENERATOR_MCP_LIST_PROMPTS_RESPONSE","type":"object"},"GENERATOR_MCP_LIST_PROMPTS_ERROR":{"outlet":"GENERATOR_MCP_LIST_PROMPTS_ERROR","type":"object"},"GENERATOR_MCP_GET_PROMPT_RESPONSE":{"outlet":"GENERATOR_MCP_GET_PROMPT_RESPONSE","type":"object"},"GENERATOR_MCP_GET_PROMPT_ERROR":{"outlet":"GENERATOR_MCP_GET_PROMPT_ERROR","type":"object"},"GENERATOR_MCP_LAST_ERROR":{"outlet":"GENERATOR_MCP_LAST_ERROR","type":"string"}},"brickOutletDescriptions":{"GENERATOR_MCP_CONNECTION_STATE":{"default":"","en-us":"Connection state","zh-tw":"連線狀態","ja-jp":"接続状態"},"GENERATOR_MCP_LIST_RESOURCES_RESPONSE":{"default":"","en-us":"List resources response","zh-tw":"列出資源回應","ja-jp":"リソースのリスト応答"},"GENERATOR_MCP_LIST_RESOURCES_ERROR":{"default":"","en-us":"List resources error","zh-tw":"列出資源錯誤","ja-jp":"リソースのリストエラー"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_RESPONSE":{"default":"","en-us":"List resource templates response","zh-tw":"列出資源範本回應","ja-jp":"リソーステンプレートのリスト応答"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES_ERROR":{"default":"","en-us":"List resource templates error","zh-tw":"列出資源範本錯誤","ja-jp":"リソーステンプレートのリストエラー"},"GENERATOR_MCP_READ_RESOURCE_RESPONSE":{"default":"","en-us":"Read resource response","zh-tw":"讀取資源回應","ja-jp":"リソースの読み取り応答"},"GENERATOR_MCP_READ_RESOURCE_ERROR":{"default":"","en-us":"Read resource error","zh-tw":"讀取資源錯誤","ja-jp":"リソースの読み取りエラー"},"GENERATOR_MCP_LIST_TOOLS_RESPONSE":{"default":"","en-us":"List tools response","zh-tw":"列出工具回應","ja-jp":"ツールのリスト応答"},"GENERATOR_MCP_LIST_TOOLS_ERROR":{"default":"","en-us":"List tools error","zh-tw":"列出工具錯誤","ja-jp":"ツールのリストエラー"},"GENERATOR_MCP_CALL_TOOL_RESPONSE":{"default":"","en-us":"Call tool response","zh-tw":"呼叫工具回應","ja-jp":"ツールの呼び出し応答"},"GENERATOR_MCP_CALL_TOOL_ERROR":{"default":"","en-us":"Call tool error","zh-tw":"呼叫工具錯誤","ja-jp":"ツールの呼び出しエラー"},"GENERATOR_MCP_LIST_PROMPTS_RESPONSE":{"default":"","en-us":"List prompts response","zh-tw":"列出提示回應","ja-jp":"プロンプトのリスト応答"},"GENERATOR_MCP_LIST_PROMPTS_ERROR":{"default":"","en-us":"List prompts error","zh-tw":"列出提示錯誤","ja-jp":"プロンプトのリストエラー"},"GENERATOR_MCP_GET_PROMPT_RESPONSE":{"default":"","en-us":"Get prompt response","zh-tw":"獲取提示回應","ja-jp":"プロンプトの取得応答"},"GENERATOR_MCP_GET_PROMPT_ERROR":{"default":"","en-us":"Request prompt error","zh-tw":"請求提示錯誤","ja-jp":"プロンプトの取得エラー"},"GENERATOR_MCP_LAST_ERROR":{"default":"","en-us":"Last error","zh-tw":"最後的錯誤","ja-jp":"最後のエラー"}},"eventTypes":{"GENERATOR_MCP_ON_CONNECTED":"GENERATOR_MCP_ON_CONNECTED","GENERATOR_MCP_ON_CONNECTION_ERROR":"GENERATOR_MCP_ON_CONNECTION_ERROR","GENERATOR_MCP_ON_DISCONNECTED":"GENERATOR_MCP_ON_DISCONNECTED","GENERATOR_MCP_ON_LIST_RESOURCES":"GENERATOR_MCP_ON_LIST_RESOURCES","GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR","GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES","GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR","GENERATOR_MCP_ON_READ_RESOURCE":"GENERATOR_MCP_ON_READ_RESOURCE","GENERATOR_MCP_ON_READ_RESOURCE_ERROR":"GENERATOR_MCP_ON_READ_RESOURCE_ERROR","GENERATOR_MCP_ON_LIST_TOOLS":"GENERATOR_MCP_ON_LIST_TOOLS","GENERATOR_MCP_ON_LIST_TOOLS_ERROR":"GENERATOR_MCP_ON_LIST_TOOLS_ERROR","GENERATOR_MCP_ON_CALL_TOOL":"GENERATOR_MCP_ON_CALL_TOOL","GENERATOR_MCP_ON_CALL_TOOL_ERROR":"GENERATOR_MCP_ON_CALL_TOOL_ERROR","GENERATOR_MCP_ON_LIST_PROMPTS":"GENERATOR_MCP_ON_LIST_PROMPTS","GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR","GENERATOR_MCP_ON_GET_PROMPT":"GENERATOR_MCP_ON_GET_PROMPT","GENERATOR_MCP_ON_GET_PROMPT_ERROR":"GENERATOR_MCP_ON_GET_PROMPT_ERROR"},"brickEventDescriptions":{"GENERATOR_MCP_ON_CONNECTED":{"default":"","en-us":"On connected","zh-tw":"當連接時","ja-jp":"接続時"},"GENERATOR_MCP_ON_CONNECTION_ERROR":{"default":"","en-us":"On connection error","zh-tw":"當連接錯誤時","ja-jp":"接続エラー時"},"GENERATOR_MCP_ON_DISCONNECTED":{"default":"","en-us":"On disconnected","zh-tw":"當斷開連接時","ja-jp":"断開時"},"GENERATOR_MCP_ON_LIST_RESOURCES":{"default":"","en-us":"On list resources","zh-tw":"當列出資源時","ja-jp":"リソースのリスト時"},"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":{"default":"","en-us":"On list resources error","zh-tw":"當列出資源錯誤時","ja-jp":"リストエラー時"},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":{"default":"","en-us":"On list resource templates","zh-tw":"當列出資源範本時","ja-jp":"リソーステンプレートのリスト時"},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":{"default":"","en-us":"On list resource templates error","zh-tw":"當列出資源範本錯誤時","ja-jp":"リストエラー時"},"GENERATOR_MCP_ON_READ_RESOURCE":{"default":"","en-us":"On read resource","zh-tw":"當讀取資源時","ja-jp":"リソースの読み取り時"},"GENERATOR_MCP_ON_READ_RESOURCE_ERROR":{"default":"","en-us":"On read resource error","zh-tw":"當讀取資源錯誤時","ja-jp":"リソースの読み取りエラー時"},"GENERATOR_MCP_ON_LIST_TOOLS":{"default":"","en-us":"On list tools","zh-tw":"當列出工具時","ja-jp":"ツールのリスト時"},"GENERATOR_MCP_ON_LIST_TOOLS_ERROR":{"default":"","en-us":"On list tools error","zh-tw":"當列出工具錯誤時","ja-jp":"ツールのリストエラー時"},"GENERATOR_MCP_ON_CALL_TOOL":{"default":"","en-us":"On call tool","zh-tw":"當呼叫工具時","ja-jp":"ツールの呼び出し時"},"GENERATOR_MCP_ON_CALL_TOOL_ERROR":{"default":"","en-us":"On call tool error","zh-tw":"當呼叫工具錯誤時","ja-jp":"ツールの呼び出しエラー時"},"GENERATOR_MCP_ON_LIST_PROMPTS":{"default":"","en-us":"On list prompts","zh-tw":"當列出提示時","ja-jp":"プロンプトのリスト時"},"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":{"default":"","en-us":"On list prompts error","zh-tw":"當列出提示錯誤時","ja-jp":"プロンプトのリストエラー時"},"GENERATOR_MCP_ON_GET_PROMPT":{"default":"","en-us":"On get prompt","zh-tw":"當獲取提示時","ja-jp":"プロンプトの取得時"},"GENERATOR_MCP_ON_GET_PROMPT_ERROR":{"default":"","en-us":"On get prompt error","zh-tw":"當獲取提示錯誤時","ja-jp":"プロンプトの取得エラー時"}},"eventPropertyControls":{"GENERATOR_MCP_ON_CONNECTION_ERROR":{"properties":{"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_RESOURCES":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_RESOURCES_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_RESOURCE_TEMPLATES_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_READ_RESOURCE":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_READ_RESOURCE_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_TOOLS":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_TOOLS_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_CALL_TOOL":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_CALL_TOOL_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_LIST_PROMPTS":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_LIST_PROMPTS_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}},"GENERATOR_MCP_ON_GET_PROMPT":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_RESPONSE":{"name":"Response","type":"object"}}},"GENERATOR_MCP_ON_GET_PROMPT_ERROR":{"properties":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID","type":"string"},"GENERATOR_MCP_ERROR_MESSAGE":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_MCP_CONNECT":{"canProvideProperty":false},"GENERATOR_MCP_DISCONNECT":{"canProvideProperty":false},"GENERATOR_MCP_LIST_RESOURCES":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_READ_RESOURCE":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_URI":{"name":"Resource URI","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Variables","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}},"GENERATOR_MCP_LIST_TOOLS":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_CALL_TOOL":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_NAME":{"name":"Tool Name","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Variables","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}},"GENERATOR_MCP_LIST_PROMPTS":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"}}},"GENERATOR_MCP_GET_PROMPT":{"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_MCP_REQUEST_ID":{"name":"Request ID (Custom)","type":"string"},"GENERATOR_MCP_NAME":{"name":"Prompt Name","type":"string"},"GENERATOR_MCP_VARIABLES":{"name":"Arguments","type":"object","popover":true,"schema":{"allowCustomProperty":true,"type":"object","properties":{}}}}}},"brickActionDescriptions":{"GENERATOR_MCP_CONNECT":{"default":"","en-us":"Connect to MCP server","zh-tw":"連接到 MCP 伺服器","ja-jp":"MCP サーバーに接続"},"GENERATOR_MCP_DISCONNECT":{"default":"","en-us":"Disconnect from MCP server","zh-tw":"從 MCP 伺服器斷開連接","ja-jp":"MCP サーバーから切断"},"GENERATOR_MCP_LIST_RESOURCES":{"default":"","en-us":"List resources","zh-tw":"列出資源","ja-jp":"リソースのリスト"},"GENERATOR_MCP_LIST_RESOURCE_TEMPLATES":{"default":"","en-us":"List resource templates","zh-tw":"列出資源範本","ja-jp":"リソーステンプレートのリスト"},"GENERATOR_MCP_READ_RESOURCE":{"default":"","en-us":"Read resource","zh-tw":"讀取資源","ja-jp":"リソースの読み取り"},"GENERATOR_MCP_LIST_TOOLS":{"default":"","en-us":"List tools","zh-tw":"列出工具","ja-jp":"ツールのリスト"},"GENERATOR_MCP_CALL_TOOL":{"default":"","en-us":"Call tool","zh-tw":"呼叫工具","ja-jp":"ツールの呼び出し"},"GENERATOR_MCP_LIST_PROMPTS":{"default":"","en-us":"List prompts","zh-tw":"列出提示","ja-jp":"プロンプトのリスト"},"GENERATOR_MCP_GET_PROMPT":{"default":"","en-us":"Request prompt","zh-tw":"請求提示","ja-jp":"プロンプトの要求"}},"scriptMemberFunctionDefs":{"connect":{"arguments":[],"required":[],"return":{"type":"bool"}},"disconnect":{"arguments":[],"required":[],"return":{"type":"void"}},"getConnectionState":{"arguments":[],"required":[],"return":{"type":"string"}},"getLastError":{"arguments":[],"required":[],"return":{"type":"string"}},"listResources":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"listResourceTemplates":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"readResource":{"arguments":[{"type":"object","name":"options","properties":{"uri":{"name":"Resource URI","type":"string"},"variables":{"name":"Variables","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["uri"],"return":{"type":"object"}},"listTools":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"callTool":{"arguments":[{"type":"object","name":"options","properties":{"name":{"name":"Tool Name","type":"string"},"arguments":{"name":"Arguments","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["name"],"return":{"type":"object"}},"listPrompts":{"arguments":[{"type":"object","name":"options","properties":{"requestId":{"name":"Request ID","type":"string"}}}],"required":[],"return":{"type":"object"}},"getPrompt":{"arguments":[{"type":"object","name":"options","properties":{"name":{"name":"Prompt Name","type":"string"},"arguments":{"name":"Arguments","type":"object"},"requestId":{"name":"Request ID","type":"string"}}}],"required":["name"],"return":{"type":"object"}}},"scriptMemberFunctionDefDescriptions":{"connect":{"default":"","en-us":"Connect to MCP server","zh-tw":"連接到 MCP 伺服器","ja-jp":"MCP サーバーに接続する"},"disconnect":{"default":"","en-us":"Disconnect from MCP server","zh-tw":"從 MCP 伺服器斷開連接","ja-jp":"MCP サーバーから切断する"},"getConnectionState":{"default":"","en-us":"Get connection state","zh-tw":"取得連線狀態","ja-jp":"接続状態を取得する"},"getLastError":{"default":"","en-us":"Get last error","zh-tw":"取得最後的錯誤","ja-jp":"最後のエラーを取得する"},"listResources":{"default":"","en-us":"List resources from MCP server","zh-tw":"列出 MCP 伺服器的資源","ja-jp":"MCP サーバーからリソースをリストする"},"listResourceTemplates":{"default":"","en-us":"List resource templates from MCP server","zh-tw":"列出 MCP 伺服器的資源範本","ja-jp":"MCP サーバーからリソーステンプレートをリストする"},"readResource":{"default":"","en-us":"Read a resource from MCP server","zh-tw":"從 MCP 伺服器讀取資源","ja-jp":"MCP サーバーからリソースを読み取る"},"listTools":{"default":"","en-us":"List tools from MCP server","zh-tw":"列出 MCP 伺服器的工具","ja-jp":"MCP サーバーからツールをリストする"},"callTool":{"default":"","en-us":"Call a tool on MCP server","zh-tw":"呼叫 MCP 伺服器上的工具","ja-jp":"MCP サーバー上のツールを呼び出す"},"listPrompts":{"default":"","en-us":"List prompts from MCP server","zh-tw":"列出 MCP 伺服器的提示","ja-jp":"MCP サーバーからプロンプトをリストする"},"getPrompt":{"default":"","en-us":"Get a prompt from MCP server","zh-tw":"從 MCP 伺服器取得提示","ja-jp":"MCP サーバーからプロンプトを取得する"}}}')},9074:(e,t,a)=>{a.d(t,{C:()=>d});var n=a(9212),r=a(3673),i=a(6192),o=a(6878),s=a(8414);function p(e,t){return t?t(e):r.c.of()}function l(e){return"function"==typeof e?new d(e):e}function u(e){return e.request.length<=1}var d=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return r.c.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(l).reduce(function(e,t){return e.concat(t)})},e.split=function(t,a,n){var i,o=l(a),s=l(n||new e(p));return i=u(o)&&u(s)?new e(function(e){return t(e)?o.request(e)||r.c.of():s.request(e)||r.c.of()}):new e(function(e,a){return t(e)?o.request(e,a)||r.c.of():s.request(e,a)||r.c.of()}),Object.assign(i,{left:o,right:s})},e.execute=function(e,t){return e.request((0,o.k)(t.context,(0,s.A)((0,i.K)(t))))||r.c.of()},e.concat=function(t,a){var i=l(t);if(u(i))return!1!==globalThis.__DEV__&&n.invariant.warn(38,i),i;var o,s=l(a);return o=u(s)?new e(function(e){return i.request(e,function(e){return s.request(e)||r.c.of()})||r.c.of()}):new e(function(e,t){return i.request(e,function(e){return s.request(e,t)||r.c.of()})||r.c.of()}),Object.assign(o,{left:i,right:s})},e.prototype.split=function(t,a,n){return this.concat(e.split(t,a,n||new e(p)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw(0,n.newInvariantError)(39)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},9122:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(1708);function r(){const{env:e}=n,{TERM:t,TERM_PROGRAM:a}=e;return"win32"!==n.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===a||"vscode"===a||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}},9212:(e,t,a)=>{a.d(t,{DEV:()=>h,InvariantError:()=>n.InvariantError,__DEV__:()=>h,global:()=>o,invariant:()=>l,maybe:()=>i,newInvariantError:()=>u}),a.r(t);var n=a(9371),r=a(3972);function i(e){try{return e()}catch(e){}}const o=i(function(){return globalThis})||i(function(){return window})||i(function(){return self})||i(function(){return global})||i(function(){return i.constructor("return this")()});var s=a(6563);function p(e){return function(t){for(var a=[],n=1;n<arguments.length;n++)a[n-1]=arguments[n];if("number"==typeof t){var r=t;(t=m(r))||(t=f(r,a),a=[])}e.apply(void 0,[t].concat(a))}}var l=Object.assign(function(e,t){for(var a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];e||(0,n.invariant)(e,m(t,a)||f(t,a))},{debug:p(n.invariant.debug),log:p(n.invariant.log),warn:p(n.invariant.warn),error:p(n.invariant.error)});function u(e){for(var t=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];return new n.InvariantError(m(e,t)||f(e,t))}var d=Symbol.for("ApolloErrorMessageHandler_"+r.r);function c(e){if("string"==typeof e)return e;try{return(0,s.p)(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function m(e,t){if(void 0===t&&(t=[]),e)return o[d]&&o[d](e,t.map(c))}function f(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:r.r,message:e,args:t.map(c)})))}var h=!1!==globalThis.__DEV__},9218:e=>{e.exports=JSON.parse('{"name":"GeneratorUDP","brickDescription":{"default":"","en-us":"TCP Server","zh-tw":"TCP 伺服器","ja-jp":"TCPサーバー"},"brickDisplayName":"UDP","brickTip":{"default":""},"brickMeta":{"scriptMember":true},"brickPreviewIcon":{"type":"material-community","name":"network-outline"},"propTypes":{"init":{"type":"bool"},"type":{"type":"oneOf","content":["udp4","udp6"],"forcePropertyBank":false},"encoding":{"type":"oneOf","content":["base64","utf8","ascii"],"forcePropertyBank":false},"localPort":{"type":"number"},"broadcast":{"type":"bool"},"multicast":{"type":"string"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Bind port on generator initialized","zh-tw":"Generator 初始化後直接啟動","ja-jp":"ジェネレータの初期化時にポートをバインドする"},"type":{"default":"","en-us":"The family of socket","zh-tw":"接口種類","ja-jp":"ソケットファミリー"},"encoding":{"default":"","en-us":"Encoding of data","zh-tw":"資料編碼","ja-jp":"データのエンコーディング"},"localPort":{"default":"","en-us":"Local bind port of UDP (0 or empty is random)","zh-tw":"UDP 本地連接埠(0 或留空為隨機)","ja-jp":"UDPのローカルバインドポート(0または空は任意)"},"broadcast":{"default":"","en-us":"Enable receive broadcast packets","zh-tw":"啟動接收廣播封包","ja-jp":"ブロードキャストパケットの受信を有効にする"},"multicast":{"default":"","en-us":"Join multicast group (Multicast address)","zh-tw":"加入多播群組(多播位置)","ja-jp":"マルチキャストグループに参加する(マルチキャストアドレス)"}},"defaultBrickProps":{"init":false,"type":"udp4","encoding":"base64","broadcast":false,"multicast":""},"propertyControls":{"localPort":{"required":true}},"outletTypes":{"GENERATOR_UDP_PORT":{"outlet":"GENERATOR_UDP_PORT","type":"number"},"GENERATOR_UDP_LAST_RECEIVE":{"outlet":"GENERATOR_UDP_LAST_RECEIVE","type":"object"},"GENERATOR_UDP_ERROR_MESSAGE":{"outlet":"GENERATOR_UDP_ERROR_MESSAGE","type":"string"}},"brickOutletDescriptions":{"GENERATOR_UDP_PORT":{"default":"","en-us":"Local UDP binded port","zh-tw":"本地 UDP 連接埠","ja-jp":"ローカルUDPバインドポート"},"GENERATOR_UDP_LAST_RECEIVE":{"default":"","en-us":"Last received packet","zh-tw":"最後收到的封包","ja-jp":"最後に受信したパケット"},"GENERATOR_UDP_ERROR_MESSAGE":{"default":"","en-us":"Error message","zh-tw":"錯誤訊息","ja-jp":"エラーメッセージ"}},"eventTypes":{"GENERATOR_UDP_ON_READY":"GENERATOR_UDP_ON_READY","GENERATOR_UDP_ON_DATA":"GENERATOR_UDP_ON_DATA","GENERATOR_UDP_ON_CLOSE":"GENERATOR_UDP_ON_CLOSE","GENERATOR_UDP_ON_ERROR":"GENERATOR_UDP_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_UDP_ON_READY":{"default":"","en-us":"Event of UDP port is binded","zh-tw":"當 UDP 伺服器啟動完成時觸發事件","ja-jp":"UDPポートがバインドされた時のイベント"},"GENERATOR_UDP_ON_DATA":{"default":"","en-us":"Event of receive data","zh-tw":"當收到資料時觸發事件","ja-jp":"データを受信した時のイベント"},"GENERATOR_UDP_ON_CLOSE":{"default":"","en-us":"Event of socket closeed","zh-tw":"當接口結束時觸發事件","ja-jp":"ソケットが閉じられた時のイベント"},"GENERATOR_UDP_ON_ERROR":{"default":"","en-us":"Event of socket error","zh-tw":"當接口發生錯誤時觸發事件","ja-jp":"ソケットエラー発生時のイベント"}},"eventPropertyControls":{"GENERATOR_UDP_ON_DATA":{"properties":{"GENERATOR_UDP_REMOTE_ADDRESS":{"name":"Address","type":"string"},"GENERATOR_UDP_REMOTE_PORT":{"name":"Port","type":"number"},"GENERATOR_UDP_DATA":{"name":"Data","type":"string"}}},"GENERATOR_UDP_ON_ERROR":{"properties":{"GENERATOR_UDP_ERROR_MESSAGE":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_UDP_BIND":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_UDP_SEND":{"disallowMultiple":false,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_UDP_TARGET_HOST":{"name":"Host","type":"string"},"GENERATOR_UDP_TARGET_PORT":{"name":"Port","type":"number"},"GENERATOR_UDP_SEND_DATA":{"name":"Data","type":"string"}}},"GENERATOR_UDP_CLOSE":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_UDP_BIND":{"default":"","en-us":"Bind UDP port","zh-tw":"綁定 UDP 連接埠","ja-jp":"UDPポートをバインドする"},"GENERATOR_UDP_SEND":{"default":"","en-us":"Send data to target","zh-tw":"傳送資料到目標位置","ja-jp":"ターゲットにデータを送信する"},"GENERATOR_UDP_CLOSE":{"default":"","en-us":"Close UDP","zh-tw":"關閉 UDP","ja-jp":"UDPを閉じる"}},"scriptMemberFunctionDefs":{"getStatus":{"arguments":[],"required":[],"return":{"type":"object"}},"bind":{"arguments":[],"required":[],"return":{"type":"void"}},"send":{"arguments":[{"name":"data","type":"string"}],"required":[],"return":{"type":"void"}},"close":{"arguments":[],"required":[],"return":{"type":"void"}}},"scriptMemberFunctionDefDescriptions":{"getStatus":{"default":"","en-us":"Get the status of the UDP","zh-tw":"取得 UDP 的狀態","ja-jp":"UDPの状態を取得"},"bind":{"default":"","en-us":"Bind the UDP port","zh-tw":"綁定 UDP 連接埠","ja-jp":"UDPポートをバインドする"},"send":{"default":"","en-us":"Send data to the UDP","zh-tw":"傳送資料到 UDP","ja-jp":"UDPにデータを送信する"},"close":{"default":"","en-us":"Close the UDP","zh-tw":"關閉 UDP","ja-jp":"UDPを閉じる"}}}')},9220:e=>{e.exports=JSON.parse('{"name":"BrickVideoStreaming","brickDescription":{"default":"Brick video streaming component, supports RTSP / RTMP streaming."},"brickDisplayName":"Video Streaming","brickTip":{"default":"@brick-tip-video-streaming","en-us":"Add Video Streaming with URI, Cache, Ratio, etc. setting.","zh-tw":"串流影片元件,可透過 URI 設定來源,另可變更快取、比例等多種控制設定","ja-jp":"URI、キャッシュ、比率などの設定でビデオストリーミングを追加します。"},"brickMeta":{"pressable":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"tower-broadcast"},"propTypes":{"uri":{"type":"string","isRequired":true},"networkCaching":{"type":"number"},"paused":{"type":"bool"},"volume":{"type":"number"},"muted":{"type":"bool"},"autoAspectRatio":{"type":"bool"},"aspectRatio":{"type":"string"},"repeat":{"type":"bool"},"replayOnError":{"type":"bool"},"replayTimeout":{"type":"number"}},"brickPropDescriptions":{"uri":{"default":"","en-us":"The video path list or single path (File, URL)","zh-tw":"Video 的播放清單或單一檔案 (File, URL)","ja-jp":"ビデオのパスリストまたは単一パス(ファイル、URL)"},"networkCaching":{"default":"","en-us":"Set cache time from streaming (You can adjust according to network conditions), it will delay the playing.","zh-tw":"設置快取時間(你可以視網路情況調整),如此將會延遲播放時間","ja-jp":"ストリーミングからキャッシュ時間を設定します(ネットワーク状況に応じて調整可能)、再生が遅延します。"},"paused":{"default":"","en-us":"Controls whether the video is paused","zh-tw":"控制影片是否暂停","ja-jp":"ビデオが一時停止しているかどうかを制御"},"volume":{"default":"","en-us":"Volume","zh-tw":"音量","ja-jp":"音量"},"muted":{"default":"","en-us":"Muted","zh-tw":"靜音","ja-jp":"ミュート"},"autoAspectRatio":{"default":"","en-us":"Video Auto Aspect Ratio","zh-tw":"自動寬高比","ja-jp":"ビデオの自動アスペクト比"},"aspectRatio":{"default":"","en-us":"Video Aspect Ratio","zh-tw":"影片寬高比","ja-jp":"ビデオのアスペクト比"},"repeat":{"default":"","en-us":"Repeat the video path list","zh-tw":"重播影片清單","ja-jp":"ビデオパスリストを繰り返す"},"replayOnError":{"default":"","en-us":"Replay on playing error","zh-tw":"重播影片清單","ja-jp":"再生エラー時に再生"},"replayTimeout":{"default":"","en-us":"Timeout to replay if repeat or replayOnError is true and video is end or error","zh-tw":"如果影片結束或錯誤且 repeat 或 replayOnError 為 true,需要等待的重播時間","ja-jp":"repeatまたはreplayOnErrorがtrueで、ビデオが終了またはエラーの場合の再生タイムアウト"}},"defaultBrickProps":{"networkCaching":300,"paused":false,"volume":100,"muted":false,"replayTimeout":500},"propertyControls":{"uri":{"displayName":"URI","normalizeDisplayName":false,"resetOnTemplateChange":true,"required":true,"validator":{"fn":"uri","protocols":["https?","rtsp","rtmps?","rtmpt","rtmpe","rtmfp"]}},"replayTimeout":{"kind":"unit","min":0,"unit":"ms"},"resizeMode":{"resetOnTemplateChange":true},"volume":{"kind":"unit","min":0,"max":100,"unit":"%","step":5}},"eventTypes":{"BRICK_VIDEO_STREAMING_ON_PRESS":"BRICK_VIDEO_STREAMING_ON_PRESS","BRICK_VIDEO_STREAMING_ON_PRESS_IN":"BRICK_VIDEO_STREAMING_ON_PRESS_IN","BRICK_VIDEO_STREAMING_ON_PRESS_OUT":"BRICK_VIDEO_STREAMING_ON_PRESS_OUT","BRICK_VIDEO_STREAMING_ON_LONG_PRESS":"BRICK_VIDEO_STREAMING_ON_LONG_PRESS","BRICK_VIDEO_STREAMING_ON_FOCUS":"BRICK_VIDEO_STREAMING_ON_FOCUS","BRICK_VIDEO_STREAMING_ON_BLUR":"BRICK_VIDEO_STREAMING_ON_BLUR","BRICK_VIDEO_STREAMING_ON_END":"BRICK_VIDEO_STREAMING_ON_END","BRICK_VIDEO_STREAMING_ON_LOAD":"BRICK_VIDEO_STREAMING_ON_LOAD","BRICK_VIDEO_STREAMING_ON_ERROR":"BRICK_VIDEO_STREAMING_ON_ERROR"},"brickEventDescriptions":{"BRICK_VIDEO_STREAMING_ON_PRESS":{"default":"","en-us":"Event of the brick press","zh-tw":"當 brick 被點擊時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_PRESS_IN":{"default":"","en-us":"Event of the brick press in","zh-tw":"當 brick 被按下時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_PRESS_OUT":{"default":"","en-us":"Event of the brick press out","zh-tw":"當 brick 按下後被放開時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_LONG_PRESS":{"default":"","en-us":"Event of the brick long press","zh-tw":"當 brick 被長按時觸發","ja-jp":"ブリックが長押しされたときに発生するイベント"},"BRICK_VIDEO_STREAMING_ON_FOCUS":{"default":"","en-us":"Event of the brick focus (Use TV Device with controller)","zh-tw":"當 brick 獲得焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを獲得したときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_VIDEO_STREAMING_ON_BLUR":{"default":"","en-us":"Event of the brick blur (Use TV Device with controller)","zh-tw":"當 brick 失去焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを失ったときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_VIDEO_STREAMING_ON_END":{"default":"","en-us":"Event on plays of path are end","zh-tw":"當 path 完全播放完畢時觸發事件","ja-jp":"パスの再生が終了した時のイベント"},"BRICK_VIDEO_STREAMING_ON_LOAD":{"default":"","en-us":"Event on plays of path are end","zh-tw":"當影片讀取完成時觸發事件","ja-jp":"ビデオの読み込みが完了した時のイベント"},"BRICK_VIDEO_STREAMING_ON_ERROR":{"default":"","en-us":"Event of the video playing error","zh-tw":"當影片讀取錯誤時觸發事件","ja-jp":"ビデオ再生エラー時のイベント"}},"eventPropertyControls":{},"outletTypes":{"BRICK_PRESSING":{"outlet":"BRICK_PRESSING","type":"bool"},"BRICK_FOCUSING":{"outlet":"BRICK_FOCUSING","type":"bool"}},"brickOutletDescriptions":{"BRICK_PRESSING":{"default":"","en-us":"Brick is pressing","zh-tw":"Brick 被按住中","ja-jp":"ブリックが押されています"},"BRICK_FOCUSING":{"default":"","en-us":"Brick is focusing (Use TV Device with controller)","zh-tw":"Brick 處於焦點狀態中 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスされています (TV デバイスとコントローラーを使用)"}}}')},9222:(e,t,a)=>{a.d(t,{D:()=>U});var n=a(5608),r=a(9212),i=a(7634),o=a(5888),s=a(2495),p=a(5702),l=a(9354),u=a(3925),d=a(555),c=a(4214),m=a(8678),f=a(8907),h=a(2455),_=a(1360),y=a(492),E=a(3777),T=a(671),g=a(2307),v=a(2904),R=a(7236),b=a(1777),O=a(3906),N=a(5207),A=a(3767),S=a(4592);var w=function(){function e(){this.known=new(_.En?WeakSet:Set),this.pool=new S.Trie(_.et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return(0,b.U)(e)&&this.known.has(e)},e.prototype.pass=function(e){if((0,b.U)(e)){var t=function(e){return(0,b.U)(e)?(0,A.c)(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if((0,b.U)(e)){var a=this.passes.get(e);if(a)return a;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(s=this.pool.lookupArray(n)).array||(this.known.add(s.array=n),!1!==globalThis.__DEV__&&Object.freeze(n)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var r=Object.getPrototypeOf(e),i=[r],o=this.sortedKeys(e);i.push(o.json);var s,p=i.length;if(o.sorted.forEach(function(a){i.push(t.admit(e[a]))}),!(s=this.pool.lookupArray(i)).object){var l=s.object=Object.create(r);this.known.add(l),o.sorted.forEach(function(e,t){l[e]=i[p+t]}),!1!==globalThis.__DEV__&&Object.freeze(l)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),a=this.pool.lookupArray(t);if(!a.keys){t.sort();var n=JSON.stringify(t);(a.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,a.keys={sorted:t,json:n})}return a.keys},e}();function I(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var C=function(){function e(e){var t=this;this.knownResults=new(_.et?WeakMap:Map),this.config=(0,y.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:(0,N.Xx)(e)}),this.canon=e.canon||new w,this.executeSelectionSet=(0,i.wrap)(function(e){var a,r=e.context.canonizeResults,i=I(e);i[3]=!r;var o=(a=t.executeSelectionSet).peek.apply(a,i);return o?r?(0,n.__assign)((0,n.__assign)({},o),{result:t.canon.admit(o.result)}):o:((0,O.M2)(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:I,makeCacheKey:function(e,t,a,n){if((0,O.$7)(a.store))return a.store.makeCacheKey(e,(0,f.A_)(t)?t.__ref:t,a.varString,n)}}),this.executeSubSelectedArray=(0,i.wrap)(function(e){return(0,O.M2)(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,a=e.array,n=e.context;if((0,O.$7)(n.store))return n.store.makeCacheKey(t,a,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new w},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,a=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,s=e.returnPartialData,l=void 0===s||s,u=e.canonizeResults,d=void 0===u?this.config.canonizeResults:u,m=this.config.cache.policies;o=(0,n.__assign)((0,n.__assign)({},(0,E.wY)((0,E.AT)(a))),o);var h,_=(0,f.WU)(i),y=this.executeSelectionSet({selectionSet:(0,E.Vn)(a).selectionSet,objectOrReference:_,enclosingRef:_,context:(0,n.__assign)({store:t,query:a,policies:m,variables:o,varString:(0,c.M)(o),canonizeResults:d},(0,N.lq)(a,this.config.fragments))});if(y.missing&&(h=[new p.Z(D(y.missing),y.missing,a,o)],!l))throw h[0];return{result:y.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,a,n){if((0,O.$7)(n.store)&&this.knownResults.get(e)===a){var r=this.executeSelectionSet.peek(a,t,n,this.canon.isKnown(e));if(r&&e===r.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,a=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if((0,f.A_)(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,p=o.variables,l=o.policies,d=o.store.getFieldValue(n,"__typename"),c=[],m=new T.ZI;function _(e,t){var a;return e.missing&&(s=m.merge(s,((a={})[t]=e.missing,a))),e.result}this.config.addTypename&&"string"==typeof d&&!l.rootIdsByTypename[d]&&c.push({__typename:d});var y=new Set(a.selections);y.forEach(function(e){var a,E;if((0,g.MS)(e,p))if((0,f.dt)(e)){var T=l.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),R=(0,f.ue)(e);void 0===T?u.XY.added(e)||(s=m.merge(s,((a={})[R]="Can't find field '".concat(e.name.value,"' on ").concat((0,f.A_)(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),a))):(0,A.c)(T)?T.length>0&&(T=_(t.executeSubSelectedArray({field:e,array:T,enclosingRef:i,context:o}),R)):e.selectionSet?null!=T&&(T=_(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:T,enclosingRef:(0,f.A_)(T)?T:i,context:o}),R)):o.canonizeResults&&(T=t.canon.pass(T)),void 0!==T&&c.push(((E={})[R]=T,E))}else{var b=(0,v.HQ)(e,o.lookupFragment);if(!b&&e.kind===h.b.FRAGMENT_SPREAD)throw(0,r.newInvariantError)(10,e.name.value);b&&l.fragmentMatches(b,d)&&b.selectionSet.selections.forEach(y.add,y)}});var E={result:(0,T.IM)(c),missing:s},b=o.canonizeResults?this.canon.admit(E):(0,R.G)(E);return b.result&&this.knownResults.set(b.result,a),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,a=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,p=new T.ZI;function l(e,a){var n;return e.missing&&(t=p.merge(t,((n={})[a]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,A.c)(e)?l(a.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?l(a.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:(0,f.A_)(e)?e:o,context:s}),t):(!1!==globalThis.__DEV__&&function(e,t,a){if(!t.selectionSet){var n=new Set([a]);n.forEach(function(a){(0,b.U)(a)&&((0,r.invariant)(!(0,f.A_)(a),11,(0,N.Ui)(e,a),t.name.value),Object.values(a).forEach(n.add,n))})}}(s.store,n,e),e)}),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function D(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(e){return e}}var P=a(906),j=a(8338);function k(e,t,a){var r="".concat(t).concat(a),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===a?e:(0,n.__assign)((0,n.__assign)({},e),{clientOnly:t,deferred:a})),i}var x=function(){function e(e,t,a){this.cache=e,this.reader=t,this.fragments=a}return e.prototype.writeToStore=function(e,t){var a=this,i=t.query,s=t.result,p=t.dataId,l=t.variables,u=t.overwrite,d=(0,E.Vu)(i),m=(0,N.mv)();l=(0,n.__assign)((0,n.__assign)({},(0,E.wY)(d)),l);var h=(0,n.__assign)((0,n.__assign)({store:e,written:Object.create(null),merge:function(e,t){return m.merge(e,t)},variables:l,varString:(0,c.M)(l)},(0,N.lq)(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),_=this.processSelectionSet({result:s||Object.create(null),dataId:p,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:h});if(!(0,f.A_)(_))throw(0,r.newInvariantError)(12,s);return h.incomingById.forEach(function(t,i){var s=t.storeObject,p=t.mergeTree,l=t.fieldNodeSet,u=(0,f.WU)(i);if(p&&p.map.size){var d=a.applyMerges(p,u,s,h);if((0,f.A_)(d))return;s=d}if(!1!==globalThis.__DEV__&&!h.overwrite){var c=Object.create(null);l.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});Object.keys(s).forEach(function(e){(function(e){return!0===c[(0,N.iJ)(e)]})(e)&&!function(e){var t=p&&p.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,a,i){var s=function(e){var t=i.getFieldValue(e,a);return"object"==typeof t&&t},p=s(e);if(!p)return;var l=s(t);if(!l)return;if((0,f.A_)(p))return;if((0,o.equal)(p,l))return;if(Object.keys(p).every(function(e){return void 0!==i.getFieldValue(l,e)}))return;var u=i.getFieldValue(e,"__typename")||i.getFieldValue(t,"__typename"),d=(0,N.iJ)(a),c="".concat(u,".").concat(d);if(z.has(c))return;z.add(c);var m=[];(0,A.c)(p)||(0,A.c)(l)||[p,l].forEach(function(e){var t=i.getFieldValue(e,"__typename");"string"!=typeof t||m.includes(t)||m.push(t)});!1!==globalThis.__DEV__&&r.invariant.warn(15,d,u,m.length?"either ensure all objects of type "+m.join(" and ")+" have an ID or a custom merge function, or ":"",c,(0,n.__assign)({},p),(0,n.__assign)({},l))}(u,s,e,h.store)})}e.merge(i,s)}),e.retain(_.__ref),_},e.prototype.processSelectionSet=function(e){var t=this,a=e.dataId,i=e.result,o=e.selectionSet,s=e.context,p=e.mergeTree,l=this.cache.policies,d=Object.create(null),c=a&&l.rootTypenamesById[a]||(0,f.D$)(i,o,s.fragmentMap)||a&&s.store.get(a,"__typename");"string"==typeof c&&(d.__typename=c);var m=function(){var e=(0,j.m)(arguments,d,s.variables);if((0,f.A_)(e.from)){var t=s.incomingById.get(e.from.__ref);if(t){var a=l.readField((0,n.__assign)((0,n.__assign)({},e),{from:t.storeObject}),s);if(void 0!==a)return a}}return l.readField(e,s)},h=new Set;this.flattenFields(o,i,s,c).forEach(function(e,a){var n,o=(0,f.ue)(a),s=i[o];if(h.add(a),void 0!==s){var _=l.getStoreFieldName({typename:c,fieldName:a.name.value,field:a,variables:e.variables}),y=M(p,_),E=t.processFieldValue(s,a,a.selectionSet?k(e,!1,!1):e,y),T=void 0;a.selectionSet&&((0,f.A_)(E)||(0,N.d1)(E))&&(T=m("__typename",E));var g=l.getMergeFunction(c,a.name.value,T);g?y.info={field:a,typename:c,merge:g}:B(p,_),d=e.merge(d,((n={})[_]=E,n))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||u.XY.added(a)||l.getReadFunction(c,a.name.value)||!1!==globalThis.__DEV__&&r.invariant.error(13,(0,f.ue)(a),i)});try{var _=l.identify(i,{typename:c,selectionSet:o,fragmentMap:s.fragmentMap,storeObject:d,readField:m}),y=_[0],E=_[1];a=a||y,E&&(d=s.merge(d,E))}catch(e){if(!a)throw e}if("string"==typeof a){var T=(0,f.WU)(a),g=s.written[a]||(s.written[a]=[]);if(g.indexOf(o)>=0)return T;if(g.push(o),this.reader&&this.reader.isFresh(i,T,o,s))return T;var v=s.incomingById.get(a);return v?(v.storeObject=s.merge(v.storeObject,d),v.mergeTree=G(v.mergeTree,p),h.forEach(function(e){return v.fieldNodeSet.add(e)})):s.incomingById.set(a,{storeObject:d,mergeTree:F(p)?void 0:p,fieldNodeSet:h}),T}return d},e.prototype.processFieldValue=function(e,t,a,n){var r=this;return t.selectionSet&&null!==e?(0,A.c)(e)?e.map(function(e,i){var o=r.processFieldValue(e,t,a,M(n,i));return B(n,i),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:a,mergeTree:n}):!1!==globalThis.__DEV__?(0,P.m)(e):e},e.prototype.flattenFields=function(e,t,a,n){void 0===n&&(n=(0,f.D$)(t,e,a.fragmentMap));var i=new Map,o=this.cache.policies,s=new S.Trie(!1);return function e(p,l){var u=s.lookup(p,l.clientOnly,l.deferred);u.visited||(u.visited=!0,p.selections.forEach(function(s){if((0,g.MS)(s,a.variables)){var p=l.clientOnly,u=l.deferred;if(p&&u||!(0,A.E)(s.directives)||s.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(p=!0),"defer"===t){var n=(0,f.MB)(e,a.variables);n&&!1===n.if||(u=!0)}}),(0,f.dt)(s)){var d=i.get(s);d&&(p=p&&d.clientOnly,u=u&&d.deferred),i.set(s,k(a,p,u))}else{var c=(0,v.HQ)(s,a.lookupFragment);if(!c&&s.kind===h.b.FRAGMENT_SPREAD)throw(0,r.newInvariantError)(14,s.name.value);c&&o.fragmentMatches(c,n,t,a.variables)&&e(c.selectionSet,k(a,p,u))}}}))}(e,a),i},e.prototype.applyMerges=function(e,t,a,i,o){var s,p=this;if(e.map.size&&!(0,f.A_)(a)){var l,u=(0,A.c)(a)||!(0,f.A_)(t)&&!(0,N.d1)(t)?void 0:t,d=a;u&&!o&&(o=[(0,f.A_)(u)?u.__ref:u]);var c=function(e,t){return(0,A.c)(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var a=c(u,t),n=c(d,t);if(void 0!==n){o&&o.push(t);var s=p.applyMerges(e,a,n,i,o);s!==n&&(l=l||new Map).set(t,s),o&&(0,r.invariant)(o.pop()===t)}}),l&&(a=(0,A.c)(d)?d.slice(0):(0,n.__assign)({},d),l.forEach(function(e,t){a[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,a,e.info,i,o&&(s=i.store).getStorage.apply(s,o)):a},e}(),L=[];function M(e,t){var a=e.map;return a.has(t)||a.set(t,L.pop()||{map:new Map}),a.get(t)}function G(e,t){if(e===t||!t||F(t))return e;if(!e||F(e))return t;var a=e.info&&t.info?(0,n.__assign)((0,n.__assign)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:a,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,a){i.map.set(a,G(e,t.map.get(a))),o.delete(a)}),o.forEach(function(a){i.map.set(a,G(t.map.get(a),e.map.get(a)))})}return i}function F(e){return!e||!(e.info||e.map.size)}function B(e,t){var a=e.map,n=a.get(t);n&&F(n)&&(L.push(n),a.delete(t))}var z=new Set;var V=a(777),$=a(4114),U=function(e){function t(t){void 0===t&&(t={});var a=e.call(this)||this;return a.watches=new Set,a.addTypenameTransform=new l.c(u.XY),a.assumeImmutableResults=!0,a.makeVar=V.UT,a.txCount=0,a.config=(0,N.I6)(t),a.addTypename=!!a.config.addTypename,a.policies=new j.l({cache:a,dataIdFromObject:a.config.dataIdFromObject,possibleTypes:a.config.possibleTypes,typePolicies:a.config.typePolicies}),a.init(),a}return(0,n.__extends)(t,e),t.prototype.init=function(){var e=this.data=new O.D_.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,a=this.storeReader,n=this.config.fragments;this.storeWriter=new x(this,this.storeReader=new C({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:(0,N.Xx)(this.config),canon:e?void 0:a&&a.canon,fragments:n}),n),this.maybeBroadcastWatch=(0,i.wrap)(function(e,a){return t.broadcastWatch(e,a)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var a=e.optimistic?t.optimisticData:t.data;if((0,O.$7)(a)){var n=e.optimistic,r=e.id,i=e.variables;return a.makeCacheKey(e.query,e.callback,(0,c.M)({optimistic:n,id:r,variables:i}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,a=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:a})).result||null}catch(e){if(e instanceof p.Z)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(N.$3.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||(0,V.MS)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&(0,V.WR)(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;c.M.reset(),m.y.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var a=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),a},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if((0,f.A_)(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&r.invariant.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(N.$3.call(e,"id"))return!1;e=(0,n.__assign)((0,n.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),c.M.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),(0,V.WR)(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,a=this,r=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,p=e.onWatchUpdated,l=function(e){var n=a,i=n.data,o=n.optimisticData;++a.txCount,e&&(a.data=a.optimisticData=e);try{return t=r(a)}finally{--a.txCount,a.data=i,a.optimisticData=o}},u=new Set;return p&&!this.txCount&&this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,l):!1===o?l(this.data):l(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),p&&u.size?(this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e,t){var a=p.call(this,e,t);return!1!==a&&u.delete(e),a}})),u.size&&u.forEach(function(e){return a.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.fragmentMatches=function(e,t){return this.policies.fragmentMatches(e,t)},t.prototype.lookupFragment=function(e){var t;return(null===(t=this.config.fragments)||void 0===t?void 0:t.lookup(e))||null},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(a){return t.maybeBroadcastWatch(a,e)})},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var a=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,a))||a&&(0,o.equal)(a.result,n.result)||e.callback(e.lastDiff=n,a)},t}(s.k);!1!==globalThis.__DEV__&&(U.prototype.getMemoryInternals=$.cM)},9283:(e,t,a)=>{a.r(t),a.d(t,{disableWarningsSlot:()=>n.yV,maskFragment:()=>r.z,maskOperation:()=>i.m});var n=a(7150),r=a(2959),i=a(8354)},9348:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=a(7898),r=a(3036),i=a(4450),o=a(9409);function s(e){const{gen:t,data:a,it:r}=e;t.if(r.parentData,()=>t.assign(a,n._`${r.parentData}[${r.parentDataProperty}]`))}function p(e,t,a){if(void 0===a)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof a?{ref:a}:{ref:a,code:(0,n.stringify)(a)})}t.macroKeywordCode=function(e,t){const{gen:a,keyword:r,schema:i,parentSchema:o,it:s}=e,l=t.macro.call(s.self,i,o,s),u=p(a,r,l);!1!==s.opts.validateSchema&&s.self.validateSchema(l,!0);const d=a.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var a;const{gen:l,keyword:u,schema:d,parentSchema:c,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,d,c,f):t.validate,_=p(l,u,h),y=l.let("valid");function E(a=(t.async?n._`await `:n.nil)){const o=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in t&&!m||!1===t.schema);l.assign(y,n._`${a}${(0,i.callValidateCode)(e,_,o,s)}`,t.modifying)}function T(e){var a;l.if((0,n.not)(null!==(a=t.valid)&&void 0!==a?a:y),e)}e.block$data(y,function(){if(!1===t.errors)E(),t.modifying&&s(e),T(()=>e.error());else{const a=t.async?function(){const e=l.let("ruleErrs",null);return l.try(()=>E(n._`await `),t=>l.assign(y,!1).if(n._`${t} instanceof ${f.ValidationError}`,()=>l.assign(e,n._`${t}.errors`),()=>l.throw(t))),e}():function(){const e=n._`${_}.errors`;return l.assign(e,null),E(n.nil),e}();t.modifying&&s(e),T(()=>function(e,t){const{gen:a}=e;a.if(n._`Array.isArray(${t})`,()=>{a.assign(r.default.vErrors,n._`${r.default.vErrors} === null ? ${t} : ${r.default.vErrors}.concat(${t})`).assign(r.default.errors,n._`${r.default.vErrors}.length`),(0,o.extendErrors)(e)},()=>e.error())}(e,a))}}),e.ok(null!==(a=t.valid)&&void 0!==a?a:y)},t.validSchemaType=function(e,t,a=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||a&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:a,errSchemaPath:n},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const o=r.dependencies;if(null==o?void 0:o.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(r.validateSchema){if(!r.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+a.errorsText(r.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);a.logger.error(e)}}}},9354:(e,t,a)=>{a.d(t,{c:()=>d});var n=a(4592),r=a(1360),i=a(3777),o=a(9212),s=a(4019),p=a(7634),l=a(555);function u(e){return e}var d=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=r.En?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(u,{cache:!1})},e.split=function(t,a,n){return void 0===n&&(n=e.identity()),Object.assign(new e(function(e){return(t(e)?a:n).transformDocument(e)},{cache:!1}),{left:a,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var a=new n.Trie(r.et);this.performWork=(0,p.wrap)(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var n=t.getCacheKey(e);if(n)return(0,o.invariant)(Array.isArray(n),77),a.lookupArray(n)},max:l.v["documentTransform.cache"],cache:s.l})}},e.prototype.performWork=function(e){return(0,i.sw)(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var a=this;return Object.assign(new e(function(e){return t.transformDocument(a.transformDocument(e))},{cache:!1}),{left:this,right:t})},e}()},9355:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(458),r={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:a,it:r}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const i=t.name("valid");a.forEach((t,a)=>{if((0,n.alwaysValidSchema)(r,t))return;const o=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(o)})}};t.default=r},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9367:e=>{e.exports=JSON.parse('{"name":"BrickRect","brickDescription":{"default":"Brick rect component","en-us":"Rect brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378573-rect))","zh-tw":"矩形方塊 ([教學](https://intercom.help/bricks-dag-inc/articles/5378573-rect))","ja-jp":"長方形ブリック ([チュートリアル](https://intercom.help/bricks-dag-inc/articles/5378573-rect))"},"brickDisplayName":"Rect","brickTip":{"default":"@brick-tip-rect","en-us":"Add a Rectangle shape with Background, Border and Corner Radius.","zh-tw":"矩形元件,可設置顏色、邊框及外框導角半徑","ja-jp":"背景、境界線、角丸を設定できる長方形シェイプを追加します。"},"brickMeta":{"useBaseStyle":true,"pressable":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"rectangle"},"propTypes":{"linearGradientEnabled":{"type":"bool"},"linearGradientColors":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"linearGradientStart":{"type":"shape","content":{"x":{"type":"number"},"y":{"type":"number"}},"forcePropertyBank":false},"linearGradientEnd":{"type":"shape","content":{"x":{"type":"number"},"y":{"type":"number"}},"forcePropertyBank":false},"linearGradientLocations":{"type":"arrayOf","content":{"type":"number"},"forcePropertyBank":false}},"brickPropDescriptions":{"linearGradientEnabled":{"default":"","en-us":"Enables or disables linear gradient","zh-tw":"Enables or disables linear gradient","ja-jp":"リニアグラデーションの有効/無効を切り替え"},"linearGradientColors":{"default":"","en-us":"An array of at least two color values that represent gradient colors","zh-tw":"一個包含至少兩個顏色值的數組,表示漸變顏色","ja-jp":"グラデーションカラーを表す少なくとも2つのカラー値を含む配列"},"linearGradientStart":{"default":"","en-us":"An optional object of the following type: { x: number, y: number }","zh-tw":"一個可選的對象,類型為:{ x: number, y: number }","ja-jp":"オプションのオブジェクト、タイプ: { x: number, y: number }"},"linearGradientEnd":{"default":"","en-us":"Same as start, but for the end of the gradient","zh-tw":"與 start 相同,但用於漸變的結束","ja-jp":"開始と同じですが、グラデーションの終了位置用"},"linearGradientLocations":{"default":"","en-us":"An optional array of numbers defining the location of each gradient color stop","zh-tw":"一個可選的數組,定義每個漸變顏色停止的位置","ja-jp":"各グラデーションカラーストップの位置を定義するオプションの数値配列"}},"propertyControls":{"linearGradientColors":{"popover":true,"popoverExpectIncludedModalOpen":true,"extendSchema":{"type":"string","kind":"color","popover":true}},"linearGradientStart":{"popover":true,"extendSchema":{"unallowRemoveProperty":true,"properties":{"x":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05},"y":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05}}}},"linearGradientEnd":{"popover":true,"extendSchema":{"unallowRemoveProperty":true,"properties":{"x":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05},"y":{"type":"number","kind":"unit","unallowRemoveProperty":true,"min":0,"step":0.05}}}},"linearGradientLocations":{"popover":true}},"propertyControlGroups":{"linearGradient":{"name":"Linear Gradient","type":"prefix","content":"linearGradient","editor":"gradient-editor"}},"propertyControlGroupDescriptions":{},"defaultBrickProps":{"linearGradientEnabled":false,"linearGradientColors":["#000000","#FFFFFF"],"linearGradientStart":{"x":0,"y":0},"linearGradientEnd":{"x":1,"y":1},"linearGradientLocations":[0,1]},"eventTypes":{"BRICK_RECT_ON_PRESS":"BRICK_RECT_ON_PRESS","BRICK_RECT_ON_PRESS_IN":"BRICK_RECT_ON_PRESS_IN","BRICK_RECT_ON_PRESS_OUT":"BRICK_RECT_ON_PRESS_OUT","BRICK_RECT_ON_LONG_PRESS":"BRICK_RECT_ON_LONG_PRESS","BRICK_RECT_ON_FOCUS":"BRICK_RECT_ON_FOCUS","BRICK_RECT_ON_BLUR":"BRICK_RECT_ON_BLUR"},"brickEventDescriptions":{"BRICK_RECT_ON_PRESS":{"default":"","en-us":"Event of the brick press","zh-tw":"當 brick 被點擊時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_PRESS_IN":{"default":"","en-us":"Event of the brick press in","zh-tw":"當 brick 被按下時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_PRESS_OUT":{"default":"","en-us":"Event of the brick press out","zh-tw":"當 brick 按下後被放開時觸發","ja-jp":"ブリックが押されたときに発生するイベント"},"BRICK_RECT_ON_LONG_PRESS":{"default":"","en-us":"Event of the brick long press","zh-tw":"當 brick 被長按時觸發","ja-jp":"ブリックが長押しされたときに発生するイベント"},"BRICK_RECT_ON_FOCUS":{"default":"","en-us":"Event of the brick focus (Use TV Device with controller)","zh-tw":"當 brick 獲得焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを獲得したときに発生するイベント (TV デバイスとコントローラーを使用)"},"BRICK_RECT_ON_BLUR":{"default":"","en-us":"Event of the brick blur (Use TV Device with controller)","zh-tw":"當 brick 失去焦點時觸發 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスを失ったときに発生するイベント (TV デバイスとコントローラーを使用)"}},"outletTypes":{"BRICK_PRESSING":{"outlet":"BRICK_PRESSING","type":"bool"},"BRICK_FOCUSING":{"outlet":"BRICK_FOCUSING","type":"bool"}},"brickOutletDescriptions":{"BRICK_PRESSING":{"default":"","en-us":"Brick is pressing","zh-tw":"Brick 被按住中","ja-jp":"ブリックが押されています"},"BRICK_FOCUSING":{"default":"","en-us":"Brick is focusing (Use TV Device with controller)","zh-tw":"Brick 處於焦點狀態中 (適用於 TV 裝置)","ja-jp":"ブリックがフォーカスされています (TV デバイスとコントローラーを使用)"}}}')},9371:(e,t,a)=>{a.r(t),a.d(t,{InvariantError:()=>s,default:()=>m,invariant:()=>p,setVerbosity:()=>c});var n=a(5608),r="Invariant Violation",i=Object.setPrototypeOf,o=void 0===i?function(e,t){return e.__proto__=t,e}:i,s=function(e){function t(a){void 0===a&&(a=r);var n=e.call(this,"number"==typeof a?r+": "+a+" (see https://github.com/apollographql/invariant-packages)":a)||this;return n.framesToPop=1,n.name=r,o(n,t.prototype),n}return(0,n.__extends)(t,e),t}(Error);function p(e,t){if(!e)throw new s(t)}var l=["debug","log","warn","error","silent"],u=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=u)return(console[e]||console.log).apply(console,arguments)}}function c(e){var t=l[u];return u=Math.max(0,l.indexOf(e)),t}!function(e){e.debug=d("debug"),e.log=d("log"),e.warn=d("warn"),e.error=d("error")}(p||(p={}));const m=p},9392:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=a(7898),r=a(5031),i=a(3036),o=a(4856),s=a(458),p=a(6223);class l{constructor(e){var t;let a;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(a=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==a?void 0:a[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==a?void 0:a.$async,this.refs={}}}function u(e){const t=c.call(this,e);if(t)return t;const a=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new n.CodeGen(this.scope,{es5:s,lines:l,ownProperties:u});let m;e.$async&&(m=d.scopeValue("Error",{ref:r.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const h={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:a,baseId:e.baseId||a,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let _;try{this._compilations.add(e),(0,p.validateFunctionCode)(h),d.optimize(this.opts.code.optimize);const t=d.toString();_=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(_=this.opts.code.process(_,e));const a=new Function(`${i.default.self}`,`${i.default.scope}`,_)(this,this.scope.get());if(this.scope.value(f,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=h;a.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},a.source&&(a.source.evaluated=(0,n.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,_&&this.logger.error("Error compiling schema, function code:",_),t}finally{this._compilations.delete(e)}}function d(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function c(e){for(const t of this._compilations)if(m(t,e))return t}function m(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function f(e,t){let a;for(;"string"==typeof(a=this.refs[t]);)t=a;return a||this.schemas[t]||h.call(this,e,t)}function h(e,t){const a=this.opts.uriResolver.parse(t),n=(0,o._getFullPath)(this.opts.uriResolver,a);let r=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===r)return y.call(this,a,e);const i=(0,o.normalizeId)(n),s=this.refs[i]||this.schemas[i];if("string"==typeof s){const t=h.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,a,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||u.call(this,s),i===(0,o.normalizeId)(t)){const{schema:t}=s,{schemaId:a}=this.opts,n=t[a];return n&&(r=(0,o.resolveUrl)(this.opts.uriResolver,r,n)),new l({schema:t,schemaId:a,root:e,baseId:r})}return y.call(this,a,s)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,a){var n;a=(0,o.resolveUrl)(this.opts.uriResolver,t,a);const r=e.refs[a];if(r)return r;let i=f.call(this,e,a);if(void 0===i){const r=null===(n=e.localRefs)||void 0===n?void 0:n[a],{schemaId:o}=this.opts;r&&(i=new l({schema:r,schemaId:o,root:e,baseId:t}))}return void 0!==i?e.refs[a]=d.call(this,i):void 0},t.getCompilingSchema=c,t.resolveSchema=h;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:a,root:n}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof a)return;const e=a[(0,s.unescapeFragment)(n)];if(void 0===e)return;const r="object"==typeof(a=e)&&a[this.opts.schemaId];!_.has(n)&&r&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,r))}let i;if("boolean"!=typeof a&&a.$ref&&!(0,s.schemaHasRulesButRef)(a,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,a.$ref);i=h.call(this,n,e)}const{schemaId:p}=this.opts;return i=i||new l({schema:a,schemaId:p,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},9409:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=a(7898),r=a(458),i=a(3036);function o(e,t){const a=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,n._`[${a}]`),n._`${i.default.vErrors}.push(${a})`),e.code(n._`${i.default.errors}++`)}function s(e,t){const{gen:a,validateName:r,schemaEnv:i}=e;i.$async?a.throw(n._`new ${e.ValidationError}(${t})`):(a.assign(n._`${r}.errors`,t),a.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,a=t.keywordError,r,i){const{it:p}=e,{gen:u,compositeRule:d,allErrors:c}=p,m=l(e,a,r);(null!=i?i:d||c)?o(u,m):s(p,n._`[${m}]`)},t.reportExtraError=function(e,a=t.keywordError,n){const{it:r}=e,{gen:p,compositeRule:u,allErrors:d}=r;o(p,l(e,a,n)),u||d||s(r,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:a,data:r,errsCount:o,it:s}){if(void 0===o)throw new Error("ajv implementation error");const p=e.name("err");e.forRange("i",o,i.default.errors,o=>{e.const(p,n._`${i.default.vErrors}[${o}]`),e.if(n._`${p}.instancePath === undefined`,()=>e.assign(n._`${p}.instancePath`,(0,n.strConcat)(i.default.instancePath,s.errorPath))),e.assign(n._`${p}.schemaPath`,n.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(n._`${p}.schema`,a),e.assign(n._`${p}.data`,r))})};const p={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,a){const{createErrors:r}=e.it;return!1===r?n._`{}`:function(e,t,a={}){const{gen:r,it:o}=e,s=[u(o,a),d(e,a)];return function(e,{params:t,message:a},r){const{keyword:o,data:s,schemaValue:l,it:u}=e,{opts:d,propertyName:c,topSchemaRef:m,schemaPath:f}=u;r.push([p.keyword,o],[p.params,"function"==typeof t?t(e):t||n._`{}`]),d.messages&&r.push([p.message,"function"==typeof a?a(e):a]);d.verbose&&r.push([p.schema,l],[p.parentSchema,n._`${m}${f}`],[i.default.data,s]);c&&r.push([p.propertyName,c])}(e,t,s),r.object(...s)}(e,t,a)}function u({errorPath:e},{instancePath:t}){const a=t?n.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:a,parentSchema:i}){let o=i?t:n.str`${t}/${e}`;return a&&(o=n.str`${o}${(0,r.getErrorPath)(a,r.Type.Str)}`),[p.schemaPath,o]}},9417:e=>{e.exports=JSON.parse('{"name":"logictype","description":null,"description_zh_TW":null,"description_ja_JP":null,"commands":{"LOGICTYPE_AND":{"name":"And","description":"And","description_zh_TW":"且","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_CLONE":{"name":"Clone","description":"Clone value","description_zh_TW":"Clone value","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"any"}]},"LOGICTYPE_EQUAL_VALUE":{"name":"Equal value","description":"Compare by value (deep)","description_zh_TW":"判斷兩個參數是否相等 (深度比對)","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IF":{"name":"If","description":"Condition for return truthy or falsy","description_zh_TW":"判斷 condition 來決定是傳回 truthy 或是 falsy 的指定值","arg":[{"name":"condition","type":"any","subType":false,"defaultValue":"undefined"},{"name":"truthy","type":"any","subType":false,"defaultValue":"undefined"},{"name":"falsy","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"any"}]},"LOGICTYPE_IS_ARRAY":{"name":"Is array","description":"Is it an array?","description_zh_TW":"判斷是否為陣列","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_BOOLEAN":{"name":"Is boolean","description":"Is it boolean?","description_zh_TW":"判斷是否為布林值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_DATETIME":{"name":"Is datetime","description":"Is it a datetime?","description_zh_TW":"判斷是否為時間","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_EMPTY":{"name":"Is empty","description":"Is it empty?","description_zh_TW":"判斷是否為空值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_INTEGER":{"name":"Is integer","description":"Is it integer?","description_zh_TW":"判斷是否為整數","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_NUMBER":{"name":"Is number","description":"Is it a number?","description_zh_TW":"判斷是否為數字","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_OBJECT":{"name":"Is object","description":"Is it a object?","description_zh_TW":"判斷是否為物件","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_IS_STRING":{"name":"Is string","description":"Is it string?","description_zh_TW":"判斷是否為字串","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_NOT":{"name":"Not","description":"Not","description_zh_TW":"反向值","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_NOT_EQUAL_VALUE":{"name":"Not equal value","description":"Compare not equal by value (deep)","description_zh_TW":"判斷兩個參數是否不相等 (深度比對)","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_OR":{"name":"或","description":"","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_TO_ARRAY":{"name":"Convert to array","description":"Convert to array if possible, return fail_value if failed (Supported JSON)","description_zh_TW":"盡可能的轉換為陣列,若轉換失敗則回傳 fail_value (支援 JSON)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"array","subType":false,"defaultValue":"[]"}],"return":[{"name":"result","type":"array"}]},"LOGICTYPE_TO_BOOLEAN":{"name":"Convert to boolean","description":"Convert to boolean","description_zh_TW":"轉換為布林值","arg":[{"name":"value","type":"any","subType":false}],"return":[{"name":"result","type":"bool"}]},"LOGICTYPE_TO_DATETIME":{"name":"Convert to datetime","description":"Convert to datetime if possible, return fail_value if failed","description_zh_TW":"盡可能的換為日期時間,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"datetime","subType":false,"defaultValue":"DATETIME_NOW"}],"return":[{"name":"result","type":"datetime"}]},"LOGICTYPE_TO_INTEGER":{"name":"Convert to integer","description":"Convert to integer if possible, return fail_value if failed","description_zh_TW":"盡可能的換為整數,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"integer","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"integer"}]},"LOGICTYPE_TO_NUMBER":{"name":"Convert to number","description":"Convert to number if possible, return fail_value if failed","description_zh_TW":"盡可能的換為數字,若轉換失敗則回傳 fail_value","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"number","subType":false,"defaultValue":"0"}],"return":[{"name":"result","type":"number"}]},"LOGICTYPE_TO_OBJECT":{"name":"Convert to object","description":"Convert to object if possible, return fail_value if failed (Supported JSON)","description_zh_TW":"盡可能的轉換為物件,若轉換失敗則回傳 fail_value (支援 JSON)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"object","subType":false,"defaultValue":"{}"}],"return":[{"name":"result","type":"object"}]},"LOGICTYPE_TO_STRING":{"name":"Convert to string","description":"Convert to string if possible, return fail_value if failed (Supported JSON and Datetime format)","description_zh_TW":"盡可能的轉換為日期時間,若轉換失敗則回傳 fail_value (支援 JSON 以及 Datetime format)","arg":[{"name":"value","type":"any","subType":false},{"name":"fail_value","type":"string","subType":false,"defaultValue":"\\"\\""}],"return":[{"name":"result","type":"string"}]},"LOGICTYPE_XOR":{"name":"XOR","description":"XOR","description_zh_TW":"互斥或","arg":[{"name":"value","type":"any","subType":false,"defaultValue":"undefined"},{"name":"other","type":"any","subType":false,"defaultValue":"undefined"}],"return":[{"name":"result","type":"bool"}]}}}')},9430:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:a(4450).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},9436:e=>{function t(e,t,a,n,r,i,o){try{var s=e[i](o),p=s.value}catch(e){return void a(e)}s.done?t(p):Promise.resolve(p).then(n,r)}e.exports=function(e){return function(){var a=this,n=arguments;return new Promise(function(r,i){var o=e.apply(a,n);function s(e){t(o,r,i,s,p,"next",e)}function p(e){t(o,r,i,s,p,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},9458:(e,t,a)=>{const{getIDPattern:n}=a(1639),r=n("SUBSPACE"),i=n("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/root.schema.json5",title:"Root",description:"A brick root config",type:"object",properties:{title:{type:"string",description:"The root config name."},root_subspace_id:{type:"string",description:"The root subspace id.",pattern:r},subspace_map:{type:"object",patternProperties:{[r]:{$ref:"http://display.bricks.tools/subspace.schema.json5",description:"Root config can have many subspace."}},additionalProperties:!1},test_map:{type:"object",patternProperties:{[i]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"Root config can have many test."}},additionalProperties:!1,deprecated:!0,description:"Deprecated in favor of automation_map.AUTOMATION_MAP_DEFAULT"},automation_map:{$ref:"http://display.bricks.tools/automation_map.schema.json5",description:"Maps of automation tests organized by collection"},show_viewports:{type:"boolean",description:"Show device viewport reference on editor"},enable_unstable_bricks:{type:"boolean",description:"Enable unstable bricks / generators"},hide_short_refs:{type:"boolean",description:"Hide all instances in Short Edit mode"},warnings:{type:"array",description:"Config validation warnings from server"}},required:["title","subspace_map","root_subspace_id"]}},9470:e=>{e.exports=JSON.parse('{"name":"BrickCamera","brickDescription":{"default":"Brick camera component","en-us":"Camera view brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378589-camera))","zh-tw":"攝像頭顯示方塊 ([教學](https://intercom.help/bricks-dag-inc/articles/5378589-camera))","ja-jp":"カメラビューブリック ([チュートリアル](https://intercom.help/bricks-dag-inc/articles/5378589-camera))"},"brickDisplayName":"Camera","brickTip":{"default":"@brick-tip-camera","en-us":"Add a Device Camera Viewer with Type, Ratio, etc. setting.(Control by Camera Generator and Event)","zh-tw":"攝影機顯示元件,可透過 Type 決定鏡頭。需透過 Camera Generator 及事件做控制","ja-jp":"タイプやアスペクト比などの設定を備えたデバイスカメラビューアーを追加します。(カメラジェネレーターとイベントで制御)"},"brickMeta":{"hasActions":true,"scriptMember":true},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"camera"},"propTypes":{"type":{"type":"oneOf","content":["back","front","external"],"forcePropertyBank":false},"isActive":{"type":"bool"},"zoom":{"type":"number"},"flashMode":{"type":"oneOf","content":["off","on","torch","auto"],"forcePropertyBank":false},"ratio":{"type":"string"},"captureAudio":{"type":"bool"},"whiteBalance":{"type":"oneOf","content":["auto","sunny","cloudy","shadow","incandescent","fluorescent"],"forcePropertyBank":false},"faceDetectionEnabled":{"type":"bool"},"faceDetectionEventMode":{"type":"oneOf","content":["when-detected","interval"],"forcePropertyBank":false},"pictureQuality":{"type":"number"},"pictureBase64":{"type":"bool"},"pictureIsMirrorImage":{"type":"bool"},"recordQuality":{"type":"oneOf","content":["4:3","288p","480p","720p","1080p","2160p"],"forcePropertyBank":false},"recordVideoBitrate":{"type":"number"},"recordMirrorVideo":{"type":"bool"},"recordMaxDuration":{"type":"number"},"recordMaxFileSize":{"type":"number"}},"brickPropDescriptions":{"type":{"default":"","en-us":"Camera type","zh-tw":"攝像頭位置","ja-jp":"カメラタイプ"},"isActive":{"default":"","en-us":"Enable or disable camera","zh-tw":"啟用或停用攝像頭","ja-jp":"カメラを有効または無効にする"},"zoom":{"default":"","en-us":"Camera zoom","zh-tw":"放大比例","ja-jp":"カメラズーム"},"flashMode":{"default":"","en-us":"Camera flash mode","zh-tw":"閃光模式","ja-jp":"カメラのフラッシュモード"},"ratio":{"default":"","en-us":"Camera ratio (Unsupported ratio will be ignored)","zh-tw":"相機比例(不支援的比例會被忽略)","ja-jp":"カメラ比率(サポートされていない比率は無視されます)"},"captureAudio":{"default":"","en-us":"Capture audio when start recording","zh-tw":"錄製影片時包含聲音","ja-jp":"録画開始時に音声もキャプチャする"},"whiteBalance":{"default":"","en-us":"Allows you to control the color temperature in your photos by cooling down or warming up the colors.","zh-tw":"白平衡設定","ja-jp":"色温度を調整して写真の色を冷たくしたり暖かくしたりすることができます"},"faceDetectionEnabled":{"default":"","en-us":"Enable face detection (Note: Barcode detection will be disabled when enabled)","zh-tw":"啟用臉部偵測(注意:啟用時條碼偵測將會停用)","ja-jp":"顔検出を有効化(注意:有効にするとバーコード検出は無効になります)"},"faceDetectionEventMode":{"default":"","en-us":"Face detection event mode","zh-tw":"Face detection event mode","ja-jp":"顔検出イベントモード"},"pictureQuality":{"default":"","en-us":"Quality of take picture","zh-tw":"擷取照片品質","ja-jp":"撮影画質"},"pictureBase64":{"default":"","en-us":"Take picture format as base64","zh-tw":"以 base64 格式資料作為擷取照片結果","ja-jp":"撮影画像をbase64形式で出力"},"pictureIsMirrorImage":{"default":"","en-us":"Mirror image of take picture","zh-tw":"擷取照片以鏡像呈現","ja-jp":"撮影画像を鏡像として表示"},"recordQuality":{"default":"","en-us":"Quality of record video","zh-tw":"錄製影片品質","ja-jp":"録画品質"},"recordVideoBitrate":{"default":"","en-us":"Bitrate of record video (bit/s)","zh-tw":"錄製影片位元傳輸率 (bit/s)","ja-jp":"録画ビットレート (bit/s)"},"recordMirrorVideo":{"default":"","en-us":"Mirror video of record video","zh-tw":"擷取照片以鏡像呈現","ja-jp":"録画を鏡像として表示"},"recordMaxDuration":{"default":"","en-us":"Max duration of record video (s)","zh-tw":"限制錄製最大時間 (s)","ja-jp":"録画の最大時間 (s)"},"recordMaxFileSize":{"default":"","en-us":"Max file size of record video (bytes)","zh-tw":"限制錄製最大檔案大小 (bytes)","ja-jp":"録画の最大ファイルサイズ (bytes)"}},"defaultBrickProps":{"type":"back","flashMode":"off","captureAudio":false,"whiteBalance":"auto","faceDetectionEnabled":false,"faceDetectionEventMode":"when-detected"},"propertyControls":{"zoom":{"kind":"unit","step":0.5,"max":16,"min":1},"flashMode":{"oneOfEmptyOption":false},"type":{"oneOfEmptyOption":false},"whiteBalance":{"oneOfEmptyOption":false},"faceDetectionEventMode":{"oneOfEmptyOption":false},"pictureQuality":{"kind":"unit","step":0.1,"max":1,"min":0},"recordVideoBitrate":{"kind":"unit","unit":"bit/s"},"recordMaxDuration":{"kind":"unit","unit":"s"},"recordMaxFileSize":{"kind":"unit","unit":"bytes"}},"propertyControlGroups":{"faceDetection":{"name":"Face Detection","type":"prefix","content":"faceDetection"},"picture":{"name":"Picture","type":"prefix","content":"picture"},"record":{"name":"Record","type":"prefix","content":"record"}},"propertyControlGroupDescriptions":{},"outletTypes":{"BRICK_CAMERA_INFO":{"outlet":"BRICK_CAMERA_INFO","type":"object"},"BRICK_CAMERA_PICTURE_TAKEN":{"outlet":"BRICK_CAMERA_PICTURE_TAKEN","type":"object"},"BRICK_CAMERA_RECORD_VIDEO":{"outlet":"BRICK_CAMERA_RECORD_VIDEO","type":"object"},"BRICK_CAMERA_BARCODE_READ":{"outlet":"BRICK_CAMERA_BARCODE_READ","type":"object"},"BRICK_CAMERA_FACE_DETECTED":{"outlet":"BRICK_CAMERA_FACE_DETECTED","type":"object"}},"brickOutletDescriptions":{"BRICK_CAMERA_INFO":{"default":"","en-us":"Camera device and format information","zh-tw":"攝像頭裝置與格式資訊","ja-jp":"カメラデバイスとフォーマット情報"},"BRICK_CAMERA_PICTURE_TAKEN":{"default":"","en-us":"Picture taken result","zh-tw":"擷取照片結果","ja-jp":"撮影結果"},"BRICK_CAMERA_RECORD_VIDEO":{"default":"","en-us":"Record video result","zh-tw":"錄製影片結果","ja-jp":"録画結果"},"BRICK_CAMERA_BARCODE_READ":{"default":"","en-us":"Barcode read result","zh-tw":"條碼辨識結果","ja-jp":"バーコード読み取り結果"},"BRICK_CAMERA_FACE_DETECTED":{"default":"","en-us":"Faces detected result","zh-tw":"人臉偵測結果","ja-jp":"顔検出結果"}},"actionTypes":{"BRICK_CAMERA_TAKE_PICTURE":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_WIDTH":{"type":"number"},"BRICK_CAMERA_QUALITY":{"type":"string"},"BRICK_CAMERA_BASE64":{"type":"bool"},"BRICK_CAMERA_MIRROR_IMAGE":{"type":"bool"}}},"BRICK_CAMERA_RECORD":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_QUALITY":{"type":"oneOf","oneOf":["4:3","288p","480p","720p","1080p","2160p"]},"BRICK_CAMERA_MIRROR_VIDEO":{"type":"bool"},"BRICK_CAMERA_VIDEO_BITRATE":{"type":"string"},"BRICK_CAMERA_MAX_DURATION":{"type":"number"},"BRICK_CAMERA_MAX_FILE_SIZE":{"type":"string"}}},"BRICK_CAMERA_STOP_RECORD":{"disallowMultiple":true,"canProvideProperty":false},"BRICK_CAMERA_FOCUS":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"BRICK_CAMERA_FOCUS_X":{"type":"number"},"BRICK_CAMERA_FOCUS_Y":{"type":"number"}}}},"brickActionDescriptions":{"BRICK_CAMERA_TAKE_PICTURE":{"default":"","en-us":"Take picture on the Camera","zh-tw":"擷取照片","ja-jp":"カメラで写真を撮る"},"BRICK_CAMERA_RECORD":{"default":"","en-us":"Record video on the Camera","zh-tw":"錄製影片","ja-jp":"カメラで動画を録画"},"BRICK_CAMERA_STOP_RECORD":{"default":"","en-us":"Record video on the Camera","zh-tw":"結束錄製影片","ja-jp":"カメラでの録画を停止"},"BRICK_CAMERA_FOCUS":{"default":"","en-us":"Focus the Camera at a specific point","zh-tw":"對焦至指定位置","ja-jp":"指定位置にフォーカスを合わせる"}},"eventTypes":{"BRICK_CAMERA_STATE_CHANGE":"BRICK_CAMERA_STATE_CHANGE","BRICK_CAMERA_RECORD_START":"BRICK_CAMERA_RECORD_START","BRICK_CAMERA_RECORD_END":"BRICK_CAMERA_RECORD_END","BRICK_CAMERA_BARCODE_READ":"BRICK_CAMERA_BARCODE_READ","BRICK_CAMERA_PICTURE_TAKEN":"BRICK_CAMERA_PICTURE_TAKEN","BRICK_CAMERA_RECORD_FINISH":"BRICK_CAMERA_RECORD_FINISH","BRICK_CAMERA_MOUNT_ERROR":"BRICK_CAMERA_MOUNT_ERROR"},"brickEventDescriptions":{"BRICK_CAMERA_STATE_CHANGE":{"default":"","en-us":"Event of the Camera state change","zh-tw":"Event of the Camera state change","ja-jp":"カメラの状態変更イベント"},"BRICK_CAMERA_RECORD_START":{"default":"","en-us":"Event of the Camera record start","zh-tw":"當錄製開始時觸發事件","ja-jp":"カメラの録画開始イベント"},"BRICK_CAMERA_RECORD_END":{"default":"","en-us":"Event of the Camera record end","zh-tw":"當錄製結束時觸發事件","ja-jp":"カメラの録画終了イベント"},"BRICK_CAMERA_BARCODE_READ":{"default":"","en-us":"Event of the Camera barcode read","zh-tw":"當讀取到條碼時觸發事件","ja-jp":"カメラのバーコード読み取りイベント"},"BRICK_CAMERA_PICTURE_TAKEN":{"default":"","en-us":"Event of the Camera picture taken","zh-tw":"當擷取照片完畢時觸發事件","ja-jp":"カメラの写真撮影完了イベント"},"BRICK_CAMERA_RECORD_FINISH":{"default":"","en-us":"Event of the Camera record finished","zh-tw":"當錄製影片完畢時觸發事件","ja-jp":"カメラの録画完了イベント"},"BRICK_CAMERA_MOUNT_ERROR":{"default":"","en-us":"Event of the Camera mount error","zh-tw":"當攝像頭掛載失敗時觸發事件","ja-jp":"カメラのマウントエラーイベント"}},"eventPropertyControls":{"BRICK_CAMERA_STATE_CHANGE":{"properties":{"BRICK_CAMERA_STATUS":{"name":"Status","type":"string"},"BRICK_CAMERA_RECORD_AUDIO_PERM_STATUS":{"name":"Record Audio Permission Status","type":"string"}}},"BRICK_CAMERA_BARCODE_READ":{"properties":{"BRICK_CAMERA_BARCODE_TYPE":{"name":"Type","type":"string"},"BRICK_CAMERA_BARCODE_DATA":{"name":"Data","type":"string"},"BRICK_CAMERA_BARCODE_RAW_DATA":{"name":"Raw Data","type":"string"},"BRICK_CAMERA_BARCODE_X":{"name":"X","type":"number"},"BRICK_CAMERA_BARCODE_Y":{"name":"Y","type":"number"},"BRICK_CAMERA_BARCODE_WIDTH":{"name":"Width","type":"number"},"BRICK_CAMERA_BARCODE_HEIGHT":{"name":"Height","type":"number"}}},"BRICK_CAMERA_PICTURE_TAKEN":{"properties":{"BRICK_CAMERA_WIDTH":{"name":"Width","type":"number"},"BRICK_CAMERA_HEIGHT":{"name":"Height","type":"number"},"BRICK_CAMERA_URI":{"name":"URI","type":"string"}}},"BRICK_CAMERA_RECORD_FINISH":{"properties":{"BRICK_CAMERA_URI":{"name":"URI","type":"string"}}},"BRICK_CAMERA_MOUNT_ERROR":{"properties":{"BRICK_CAMERA_MOUNT_ERROR":{"name":"Error","type":"string"}}}},"scriptMemberFunctionDefs":{"takePicture":{"description":"Take a picture with the camera","arguments":[{"type":"object","name":"options","properties":{"quality":{"type":"number","description":"Picture quality (0-1)","default":0.6},"base64":{"type":"boolean","description":"Return base64 encoded image data","default":false},"isImageMirror":{"type":"boolean","description":"Mirror the captured image","default":false}}}],"required":[],"return":{"type":"object","description":"Picture data with width, height, uri, and optional base64"},"timeout":10000},"startRecord":{"description":"Start recording video with the camera","arguments":[{"type":"object","name":"options","properties":{"quality":{"type":"string","description":"Video quality (4:3, 288p, 480p, 720p, 1080p, 2160p)"},"videoBitrate":{"type":"number","description":"Video bitrate in bit/s"},"mirror":{"type":"boolean","description":"Mirror the recorded video","default":false},"maxDuration":{"type":"number","description":"Maximum recording duration in seconds"},"maxFileSize":{"type":"number","description":"Maximum file size in bytes"},"waitEnd":{"type":"boolean","description":"Wait for recording to end before resolving","default":false}}}],"required":[],"return":{"type":"object","description":"Recording result with uri (if waitEnd is true) or recording start confirmation"}},"stopRecord":{"description":"Stop recording video","arguments":[],"required":[],"return":{"type":"boolean"}},"pausePreview":{"description":"Pause camera preview","arguments":[],"required":[],"return":{"type":"boolean"}},"resumePreview":{"description":"Resume camera preview","arguments":[],"required":[],"return":{"type":"boolean"}},"focus":{"description":"Focus the camera at a specific point (tap-to-focus)","arguments":[{"type":"object","name":"point","properties":{"x":{"type":"number","description":"X coordinate (0-1 normalized or pixel value). 0 = left edge, 1 = right edge"},"y":{"type":"number","description":"Y coordinate (0-1 normalized or pixel value). 0 = top edge, 1 = bottom edge"}}}],"required":["point"],"return":{"type":"boolean","description":"True if focus was triggered successfully"}}},"scriptMemberFunctionDefDescriptions":{}}')},9520:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r=a(458),i=a(2725),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:a,$data:o,schemaCode:s,schema:p}=e;o||p&&"object"==typeof p?e.fail$data(n._`!${(0,r.useFunc)(t,i.default)}(${a}, ${s})`):e.fail(n._`${p} !== ${a}`)}};t.default=o},9537:(e,t,a)=>{a.d(t,{_:()=>s,k:()=>o});var n=a(3217),r=a(5198),i=a(792);class o{constructor(e,t="GraphQL request",a={line:1,column:1}){"string"==typeof e||(0,n.U)(!1,`Body must be a string. Received: ${(0,r.N)(e)}.`),this.body=e,this.name=t,this.locationOffset=a,this.locationOffset.line>0||(0,n.U)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,n.U)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function s(e){return(0,i.h)(e,o)}},9546:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},9557:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({TerminalInfoProvider:()=>s.TerminalInfoProvider,default:()=>s.default})},9563:e=>{e.exports=JSON.parse('{"name":"GeneratorIterator","brickDescription":{"default":"","en-us":"Iterate through values (Array, Object, Number, String)","zh-tw":"數值迭代 (Array, Object, Number, String)","ja-jp":"値を反復処理 (配列、オブジェクト、数値、文字列)"},"brickDisplayName":"Iterator","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"rotate"},"propTypes":{"data":{"type":"any"},"start":{"type":"number"},"step":{"type":"number"},"maxQuantity":{"type":"number"},"loop":{"type":"bool"}},"brickPropDescriptions":{"data":{"default":"","en-us":"Data source for iteration. If it\'s an Array, it will iterate through elements. If it\'s an Object, it will use Object.entries() to get key-value pairs. If it\'s a String, it will iterate through characters. If it\'s a Number, it represents count from 1 to N.","zh-tw":"用來取值的資料來源,如果為 Array 則會取得元素,如果為 Object 則使用 Object.entries() 取得鍵值對,如果為 String 則迭代字元,如果為 Number 則代表由 1~N 的計數","ja-jp":"反復処理のためのデータソース。配列の場合は要素を取得し、オブジェクトの場合はObject.entries()でキーと値のペアを取得し、文字列の場合は文字を反復処理し、数値の場合は1〜Nのカウントを表します"},"start":{"default":"","en-us":"Starting element position","zh-tw":"起始元素位置","ja-jp":"開始要素の位置"},"step":{"default":"","en-us":"Step size for each iteration","zh-tw":"單次跳動的位移量","ja-jp":"各反復の増分"},"maxQuantity":{"default":"","en-us":"Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored.","zh-tw":"總共可迭代個數上限 (可以設置為 -1 作為無上限)。達到上限後,後續的迭代動作將被靜默忽略。","ja-jp":"反復処理の最大数(無制限の場合は-1に設定可能)。上限に達すると、それ以降の反復アクションは静かに無視されます。"},"loop":{"default":"","en-us":"Whether to loop the iteration","zh-tw":"是否循環迭代","ja-jp":"反復処理をループするかどうか"}},"defaultBrickProps":{"data":[],"start":0,"step":1},"propertyControls":{"data":{"setupDefaultAfterNewItemOfSchema":true,"required":true},"step":{"kind":"unit","min":1,"step":1}},"outletTypes":{"GENERATOR_ITERATOR_ITERATED_ARRAY":{"outlet":"GENERATOR_ITERATOR_ITERATED_ARRAY","type":"array"},"GENERATOR_ITERATOR_UPCOMING_ARRAY":{"outlet":"GENERATOR_ITERATOR_UPCOMING_ARRAY","type":"array"},"GENERATOR_ITERATOR_VALUE":{"outlet":"GENERATOR_ITERATOR_VALUE","type":"any"},"GENERATOR_ITERATOR_KEY":{"outlet":"GENERATOR_ITERATOR_KEY","type":"any"},"GENERATOR_ITERATOR_INDEX":{"outlet":"GENERATOR_ITERATOR_INDEX","type":"number"}},"brickOutletDescriptions":{"GENERATOR_ITERATOR_ITERATED_ARRAY":{"default":"","en-us":"Elements that have been iterated (including current one)","zh-tw":"已經迭代過的元素(包含目前的)","ja-jp":"反復処理された要素(現在のものを含む)"},"GENERATOR_ITERATOR_UPCOMING_ARRAY":{"default":"","en-us":"Elements that will be iterated but have not been iterated yet","zh-tw":"會參與迭代但尚未迭代過的元素","ja-jp":"反復処理される予定だがまだ処理されていない要素"},"GENERATOR_ITERATOR_VALUE":{"default":"","en-us":"Current iteration element","zh-tw":"目前的迭代元素","ja-jp":"現在の反復要素"},"GENERATOR_ITERATOR_KEY":{"default":"","en-us":"Key of the current iteration element (for number: same as value, for array/string: index, for object: string key)","zh-tw":"目前迭代元素的 Key(number: 則此值與 value 相同,array, string: 則此值為 index,object: 則此值為字串)","ja-jp":"現在の反復要素のキー(数値の場合:値と同じ、配列・文字列の場合:インデックス、オブジェクトの場合:文字列キー)"},"GENERATOR_ITERATOR_INDEX":{"default":"","en-us":"Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence)","zh-tw":"目前的迭代次數(如果 data 為 6, step 為 2,則此值會依序回傳:1,2,3)","ja-jp":"現在の反復回数(dataが6でstepが2の場合、この値は順番に1,2,3を返します)"}},"actionTypes":{"GENERATOR_ITERATOR_NEXT":{"canProvideProperty":false},"GENERATOR_ITERATOR_PREVIOUS":{"canProvideProperty":false},"GENERATOR_ITERATOR_FIRST":{"canProvideProperty":false},"GENERATOR_ITERATOR_LAST":{"canProvideProperty":false},"GENERATOR_ITERATOR_RESET":{"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_ITERATOR_NEXT":{"default":"","en-us":"Proceed to next iteration","zh-tw":"進行下一次迭代","ja-jp":"次の反復に進む"},"GENERATOR_ITERATOR_PREVIOUS":{"default":"","en-us":"Go back to previous iteration","zh-tw":"退回至上一次迭代","ja-jp":"前の反復に戻る"},"GENERATOR_ITERATOR_FIRST":{"default":"","en-us":"Jump to the first iteration element","zh-tw":"跳至第一個迭代元素","ja-jp":"最初の反復要素にジャンプする"},"GENERATOR_ITERATOR_LAST":{"default":"","en-us":"Jump to the last iteration element (ignoring the loop setting)","zh-tw":"跳至最後一個迭代元素(忽略 loop 的設定值)","ja-jp":"最後の反復要素にジャンプする(loop設定を無視)"},"GENERATOR_ITERATOR_RESET":{"default":"","en-us":"Reset iteration state","zh-tw":"重置迭代狀態","ja-jp":"反復状態をリセット"}},"eventTypes":{"GENERATOR_ITERATOR_ITERATE":"GENERATOR_ITERATOR_ITERATE","GENERATOR_ITERATOR_FIRST":"GENERATOR_ITERATOR_FIRST","GENERATOR_ITERATOR_END":"GENERATOR_ITERATOR_END","GENERATOR_ITERATOR_ERROR":"GENERATOR_ITERATOR_ERROR"},"brickEventDescriptions":{"GENERATOR_ITERATOR_ITERATE":{"default":"","en-us":"Event triggered on each iteration","zh-tw":"每次發生迭代都會觸發此 Event","ja-jp":"各反復処理で発生するイベント"},"GENERATOR_ITERATOR_FIRST":{"default":"","en-us":"Event triggered on the first iteration of a round","zh-tw":"當單輪首次迭代會觸發此 Event","ja-jp":"1回の反復処理の最初に発生するイベント"},"GENERATOR_ITERATOR_END":{"default":"","en-us":"Event triggered on the last iteration of a round","zh-tw":"當單輪迭代至最後會觸發此 Event","ja-jp":"1回の反復処理の最後に発生するイベント"},"GENERATOR_ITERATOR_ERROR":{"default":"","en-us":"Event triggered when data type is invalid or unexpected","zh-tw":"當資料類型無效或非預期時觸發此 Event","ja-jp":"データ型が無効または予期しない場合に発生するイベント"}},"eventPropertyControls":{"GENERATOR_ITERATOR_ITERATE":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_FIRST":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_END":{"properties":{"GENERATOR_ITERATOR_ITERATE_VALUE":{"name":"Value","type":"any"},"GENERATOR_ITERATOR_ITERATE_KEY":{"name":"Key","type":"any"},"GENERATOR_ITERATOR_ITERATE_INDEX":{"name":"Index","type":"number"}}},"GENERATOR_ITERATOR_ERROR":{"properties":{"GENERATOR_ITERATOR_ERROR_MESSAGE":{"name":"Error Message","type":"string"},"GENERATOR_ITERATOR_ERROR_DATA":{"name":"Invalid Data","type":"any"}}}}}')},9594:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(4450),r=a(7898),i=a(458),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>r.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>r._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:a,schemaCode:o,data:s,$data:p,it:l}=e,{opts:u}=l;if(!p&&0===a.length)return;const d=a.length>=u.loopRequired;if(l.allErrors?function(){if(d||p)e.block$data(r.nil,c);else for(const t of a)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||p){const a=t.let("valid",!0);e.block$data(a,()=>function(a,i){e.setParams({missingProperty:a}),t.forOf(a,o,()=>{t.assign(i,(0,n.propertyInData)(t,s,a,u.ownProperties)),t.if((0,r.not)(i),()=>{e.error(),t.break()})},r.nil)}(i,a)),e.ok(a)}else t.if((0,n.checkMissingProp)(e,a,i)),(0,n.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of a)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function c(){t.forOf("prop",o,a=>{e.setParams({missingProperty:a}),t.if((0,n.noPropertyInData)(t,s,a,u.ownProperties),()=>e.error())})}}};t.default=o},9611:e=>{e.exports=JSON.parse('{"name":"GeneratorOnnxLLM","brickDescription":{"default":"Local LLM inference","en-us":"Local LLM inference based on [transformers.js](https://huggingface.co/docs/transformers.js) \\n You can use any converted model on HuggingFace.","zh-tw":"基於 [transformers.js](https://huggingface.co/docs/transformers.js) 的本地 LLM 推論 \\n 您可以使用 HuggingFace 上任何轉換過的模型。","ja-jp":"[transformers.js](https://huggingface.co/docs/transformers.js) に基づくローカル LLM 推論 \\n HuggingFace で変換されたどのモデルでも使用できます。"},"brickDisplayName":"LLM (ONNX)","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"microchip-ai"},"brickMeta":{"preview":true,"scriptMember":true},"propTypes":{"init":{"type":"bool"},"model":{"type":"string"},"modelType":{"type":"string"},"quantizeType":{"type":"oneOf","content":["auto","none","fp16","q8","int8","uint8","q4","bnb4","q4f16"],"forcePropertyBank":false},"prompt":{"type":"string"},"messages":{"type":"arrayOf","content":{"type":"shape","content":{},"forcePropertyBank":false},"forcePropertyBank":false},"images":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"audios":{"type":"arrayOf","content":{"type":"string"},"forcePropertyBank":false},"toolCallParser":{"type":"oneOf","content":["llama3_json","mistral","hermes","internlm","phi4"],"forcePropertyBank":false},"tools":{"type":"arrayOf","content":{"type":"object"},"forcePropertyBank":false},"toolChoice":{"type":"oneOf","content":["none","auto"],"forcePropertyBank":false},"maxNewTokens":{"type":"number"},"temperature":{"type":"number"},"topK":{"type":"number"},"topP":{"type":"number"},"repetitionPenalty":{"type":"number"},"noRepeatNgramSize":{"type":"number"},"numBeams":{"type":"number"},"doSample":{"type":"bool"},"executors":{"type":"arrayOf","content":{"type":"oneOf","content":["qnn","dml","nnapi","xnnpack","coreml","cpu","wasm","webgpu"],"forcePropertyBank":false},"forcePropertyBank":false},"executionMode":{"type":"oneOf","content":["sequential","parallel"],"forcePropertyBank":false},"qnnBackend":{"type":"oneOf","content":["HTP","HTA","DSP","GPU","CPU"],"forcePropertyBank":false},"qnnHtpEnableFp16":{"type":"bool"},"qnnEnableDebug":{"type":"bool"}},"brickPropDescriptions":{"init":{"default":"","en-us":"Initialize the TTS context on generator initialization","zh-tw":"在 generator 初始化時是否要初始化","ja-jp":"generator の初期化時に TTS コンテキストを初期化する"},"model":{"default":"","en-us":"LLM model","zh-tw":"LLM 模型","ja-jp":"LLM モデル"},"modelType":{"default":"","en-us":"Model type","zh-tw":"模型類型","ja-jp":"モデルタイプ"},"quantizeType":{"default":"","en-us":"Quantize type","zh-tw":"量化類型","ja-jp":"量子化タイプ"},"prompt":{"default":"","en-us":"Prompt to inference","zh-tw":"要推論的提示","ja-jp":"推論するためのプロンプト"},"messages":{"default":"","en-us":"Messages to inference","zh-tw":"要推論的訊息","ja-jp":"推論するためのメッセージ"},"images":{"default":"","en-us":"Images with message to inference","zh-tw":"訊息附帶的圖片","ja-jp":"メッセージに添付する画像"},"audios":{"default":"","en-us":"Audios with message to inference","zh-tw":"訊息附帶的音檔","ja-jp":"メッセージに添付する音声"},"toolCallParser":{"default":"","en-us":"Tool call parser","zh-tw":"工具調用解析器","ja-jp":"ツールコールパーサー"},"tools":{"default":"","en-us":"Tools for chat mode using OpenAI-compatible function calling format \\n Format: Array of objects with {type, function: {name, description, parameters}} structure \\n See: https://platform.openai.com/docs/guides/function-calling","zh-tw":"聊天模式的工具,使用 OpenAI 相容的函數調用格式 \\n 格式:由 {type, function: {name, description, parameters}} 結構的物件陣列 \\n 參考:https://platform.openai.com/docs/guides/function-calling","ja-jp":"チャットモードで使用するツール。OpenAI 互換の関数呼び出し形式を使用します。 \\n 形式:{type, function: {name, description, parameters}} 構造のオブジェクトの配列 \\n 詳細:https://platform.openai.com/docs/guides/function-calling"},"toolChoice":{"default":"","en-us":"Tool choice for chat mode","zh-tw":"聊天模式的工具選擇"},"maxNewTokens":{"default":"","en-us":"Max new tokens to generate","zh-tw":"最大生成新 tokens","ja-jp":"生成する最大の新しいトークン数"},"temperature":{"default":"","en-us":"Temperature","zh-tw":"溫度","ja-jp":"温度"},"topK":{"default":"","en-us":"Top k","zh-tw":"Top k","ja-jp":"トップ k"},"topP":{"default":"","en-us":"Top p","zh-tw":"Top p","ja-jp":"トップ p"},"repetitionPenalty":{"default":"","en-us":"Repetition penalty","zh-tw":"重複懲罰","ja-jp":"繰り返しペナルティ"},"noRepeatNgramSize":{"default":"","en-us":"No repeat ngram size","zh-tw":"不重複 ngram 大小","ja-jp":"繰り返さない ngram サイズ"},"numBeams":{"default":"","en-us":"Number of beams","zh-tw":"光束數","ja-jp":"ビーム数"},"doSample":{"default":"","en-us":"Do sampling","zh-tw":"是否採樣","ja-jp":"サンプリングを行う"},"executors":{"default":"","en-us":"Executor candidates, descending order of priority \\n Default will be xnnpack, wasm, cpu","zh-tw":"執行器候選,按優先順序降序排列 \\n 預設為 xnnpack、wasm、cpu","ja-jp":"実行候補、優先順位の降順 \\n デフォルトは xnnpack、wasm、cpu"},"executionMode":{"default":"","en-us":"Execution mode \\n Usually when the model has many branches, setting this option to `parallel` will give you better performance.","zh-tw":"執行模式 \\n 通常當模型有許多分支時,將此選項設置為 `parallel` 將為您提供更好的性能。","ja-jp":"実行モード \\n 通常、モデルに多くの分岐がある場合、このオプションを `parallel` に設定するとパフォーマンスが向上します。"},"qnnBackend":{"default":"","en-us":"QNN backend","zh-tw":"QNN 後端","ja-jp":"QNN バックエンド"},"qnnHtpEnableFp16":{"default":"","en-us":"Enable FP16 for QNN HTP","zh-tw":"啟用 QNN HTP 的 FP16","ja-jp":"QNN HTP の FP16 を有効にする"},"qnnEnableDebug":{"default":"","en-us":"Enable QNN debug","zh-tw":"啟用 QNN 調試","ja-jp":"QNN デバッグを有効にする"}},"defaultBrickProps":{"modelType":"auto","toolCallParser":"llama3_json","toolChoice":"auto","maxNewTokens":256,"temperature":0.7,"topK":50,"topP":0.9,"repetitionPenalty":1,"noRepeatNgramSize":0,"numBeams":1,"doSample":true,"executionMode":"sequential"},"propertyControls":{"model":{"kind":"onnx-model-asset","fields":{"modelType":"modelType","quantizeType":"quantizeType"},"required":true},"messages":{"kind":"llm-messages"},"tools":{"kind":"llm-tools"}},"propertyControlGroups":{"inputs":{"name":"Input","type":"group","content":["prompt","messages","images","audios"]},"tools":{"name":"Tools","type":"group","content":["toolCallParser","tools","toolChoice"]},"providerOpts":{"name":"Provider Options","type":"group","content":["executors","executionMode","qnnBackend","qnnHtpEnableFp16","qnnEnableDebug"]}},"propertyControlGroupDescriptions":{},"outletTypes":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"outlet":"GENERATOR_ONNX_LLM_CONTEXT_STATE","type":"string"},"GENERATOR_ONNX_LLM_GENERATED":{"outlet":"GENERATOR_ONNX_LLM_GENERATED","type":"string"},"GENERATOR_ONNX_LLM_FULL_RESULT":{"outlet":"GENERATOR_ONNX_LLM_FULL_RESULT","type":"string"},"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL":{"outlet":"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL","type":"object"}},"brickOutletDescriptions":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"default":"","en-us":"Context state","zh-tw":"Context 狀態","ja-jp":"コンテキスト状態"},"GENERATOR_ONNX_LLM_GENERATED":{"default":"","en-us":"Generated output","zh-tw":"產生的輸出","ja-jp":"生成された出力"},"GENERATOR_ONNX_LLM_FULL_RESULT":{"default":"","en-us":"Full result of generation","zh-tw":"生成的完整結果","ja-jp":"生成の完全な結果"},"GENERATOR_ONNX_LLM_LAST_FUNCTION_CALL":{"default":"","en-us":"Last function call","zh-tw":"最後的函數調用"}},"eventTypes":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE","GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL","GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED","GENERATOR_ONNX_LLM_ON_ERROR":"GENERATOR_ONNX_LLM_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":{"default":"","en-us":"Event triggered when state change","zh-tw":"在狀態變更時觸發事件","ja-jp":"状態が変更されたときに発生するイベント"},"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":{"default":"","en-us":"Event triggered on get function call request","zh-tw":"在獲取函數調用請求時觸發事件"},"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":{"default":"","en-us":"Event triggered on completion finished","zh-tw":"在完成時觸發事件"},"GENERATOR_ONNX_LLM_ON_ERROR":{"default":"","en-us":"Event triggered when error occurs","zh-tw":"在發生錯誤時觸發事件","ja-jp":"エラーが発生したときに発生するイベント"}},"eventPropertyControls":{"GENERATOR_ONNX_LLM_ON_CONTEXT_STATE_CHANGE":{"properties":{"GENERATOR_ONNX_LLM_CONTEXT_STATE":{"name":"Context State","type":"string"}}},"GENERATOR_ONNX_LLM_ON_FUNCTION_CALL":{"properties":{"GENERATOR_ONNX_LLM_FUNCTION_CALL_NAME":{"name":"Function Call Name","type":"string"},"GENERATOR_ONNX_LLM_FUNCTION_CALL_ARGUMENTS":{"name":"Function Call Arguments","type":"object"},"GENERATOR_ONNX_LLM_FUNCTION_CALL_DETAILS":{"name":"Function Call Details","type":"object"}}},"GENERATOR_ONNX_LLM_ON_COMPLETION_FINISHED":{"properties":{"GENERATOR_ONNX_LLM_COMPLETION_RESULT":{"name":"Result","type":"string"},"GENERATOR_ONNX_LLM_COMPLETION_TOOL_CALLS":{"name":"Tool Calls","type":"array"},"GENERATOR_ONNX_LLM_COMPLETION_FULL_CONTEXT":{"name":"Full Context","type":"string"}}},"GENERATOR_ONNX_LLM_ON_ERROR":{"properties":{"GENERATOR_ONNX_LLM_ERROR":{"name":"Error","type":"string"}}}},"actionTypes":{"GENERATOR_ONNX_LLM_LOAD_MODEL":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_ONNX_LLM_INFER":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_ONNX_LLM_PROMPT":{"name":"Prompt","type":"string"},"GENERATOR_ONNX_LLM_CHAT":{"name":"Chat","type":"array"},"GENERATOR_ONNX_LLM_IMAGES":{"name":"Image URLs","type":"array"},"GENERATOR_ONNX_LLM_AUDIOS":{"name":"Audio URLs","type":"array"},"GENERATOR_ONNX_LLM_TOOLS":{"name":"Tools","type":"array"},"GENERATOR_ONNX_LLM_TOOL_CHOICE":{"name":"Tool Choice","type":"string"}}},"GENERATOR_ONNX_LLM_CLEAN_CACHE":{"disallowMultiple":true,"canProvideProperty":false},"GENERATOR_ONNX_LLM_RELEASE_CONTEXT":{"disallowMultiple":true,"canProvideProperty":false}},"brickActionDescriptions":{"GENERATOR_ONNX_LLM_LOAD_MODEL":{"default":"","en-us":"Load the model","zh-tw":"讀取模型","ja-jp":"モデルを読み込む"},"GENERATOR_ONNX_LLM_INFER":{"default":"","en-us":"Inference","zh-tw":"推論","ja-jp":"推論"},"GENERATOR_ONNX_LLM_CLEAN_CACHE":{"default":"","en-us":"Clean cache","zh-tw":"清除快取","ja-jp":"キャッシュをクリアする"},"GENERATOR_ONNX_LLM_RELEASE_CONTEXT":{"default":"","en-us":"Release context","zh-tw":"釋放 context","ja-jp":"コンテキストを解放する"}},"scriptMemberFunctionDefs":{"load":{"arguments":[],"required":[],"return":{"type":"bool"}},"getState":{"arguments":[],"required":[],"return":{"type":"string"}},"infer":{"arguments":[{"type":"object","name":"params","properties":{"prompt":{"name":"Prompt","type":"string"},"messages":{"name":"Messages","type":"array"},"images":{"name":"Images","type":"array"},"audios":{"name":"Audios","type":"array"},"tools":{"name":"Tools","type":"array"},"toolChoice":{"name":"Tool Choice","type":"string"}}}],"required":["params"],"return":{"type":"object"}},"cleanCache":{"arguments":[],"required":[],"return":{"type":"bool"}},"release":{"arguments":[],"required":[],"return":{"type":"bool"}}},"scriptMemberFunctionDefDescriptions":{"load":{"default":"","en-us":"Load ONNX model","zh-tw":"讀取 ONNX 模型","ja-jp":"ONNX モデルを読み込む"},"getState":{"default":"","en-us":"Get model state","zh-tw":"取得模型狀態","ja-jp":"モデル状態を取得"},"infer":{"default":"","en-us":"Run text inference","zh-tw":"執行文字推論","ja-jp":"テキスト推論を実行"},"cleanCache":{"default":"","en-us":"Clean model cache","zh-tw":"清除模型快取","ja-jp":"モデルキャッシュをクリア"},"release":{"default":"","en-us":"Release the model","zh-tw":"釋放模型","ja-jp":"モデルを解放"}}}')},9624:(e,t,a)=>{var n=a(3655),r=a(4759),i=a(1580),o=a(4066),s=/^\[object .+?Constructor\]$/,p=Function.prototype,l=Object.prototype,u=p.toString,d=l.hasOwnProperty,c=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||r(e))&&(n(e)?c:s).test(o(e))}},9657:(e,t,a)=>{a.d(t,{Ay:()=>J});var n=a(2203),r=a(8611),i=a(7016),o=a(4044),s=a(5692),p=a(3106);const l=n.Readable,u=Symbol("buffer"),d=Symbol("type");class c{constructor(){this[d]="";const e=arguments[0],t=arguments[1],a=[];let n=0;if(e){const t=e,r=Number(t.length);for(let e=0;e<r;e++){const r=t[e];let i;i=r instanceof Buffer?r:ArrayBuffer.isView(r)?Buffer.from(r.buffer,r.byteOffset,r.byteLength):r instanceof ArrayBuffer?Buffer.from(r):r instanceof c?r[u]:Buffer.from("string"==typeof r?r:String(r)),n+=i.length,a.push(i)}}this[u]=Buffer.concat(a);let r=t&&void 0!==t.type&&String(t.type).toLowerCase();r&&!/[^\u0020-\u007E]/.test(r)&&(this[d]=r)}get size(){return this[u].length}get type(){return this[d]}text(){return Promise.resolve(this[u].toString())}arrayBuffer(){const e=this[u],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new l;return e._read=function(){},e.push(this[u]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],a=arguments[1];let n,r;n=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),r=void 0===a?e:a<0?Math.max(e+a,0):Math.min(a,e);const i=Math.max(r-n,0),o=this[u].slice(n,n+i),s=new c([],{type:arguments[2]});return s[u]=o,s}}function m(e,t,a){Error.call(this,e),this.message=e,this.type=t,a&&(this.code=this.errno=a.code),Error.captureStackTrace(this,this.constructor)}let f;Object.defineProperties(c.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(c.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),m.prototype=Object.create(Error.prototype),m.prototype.constructor=m,m.prototype.name="FetchError";try{f=require("encoding").convert}catch(e){}const h=Symbol("Body internals"),_=n.PassThrough;function y(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a.size;let i=void 0===r?0:r;var o=a.timeout;let s=void 0===o?0:o;null==e?e=null:T(e)?e=Buffer.from(e.toString()):g(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof n||(e=Buffer.from(String(e)))),this[h]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof n&&e.on("error",function(e){const a="AbortError"===e.name?e:new m(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[h].error=a})}function E(){var e=this;if(this[h].disturbed)return y.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[h].disturbed=!0,this[h].error)return y.Promise.reject(this[h].error);let t=this.body;if(null===t)return y.Promise.resolve(Buffer.alloc(0));if(g(t)&&(t=t.stream()),Buffer.isBuffer(t))return y.Promise.resolve(t);if(!(t instanceof n))return y.Promise.resolve(Buffer.alloc(0));let a=[],r=0,i=!1;return new y.Promise(function(n,o){let s;e.timeout&&(s=setTimeout(function(){i=!0,o(new m(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))},e.timeout)),t.on("error",function(t){"AbortError"===t.name?(i=!0,o(t)):o(new m(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))}),t.on("data",function(t){if(!i&&null!==t){if(e.size&&r+t.length>e.size)return i=!0,void o(new m(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,a.push(t)}}),t.on("end",function(){if(!i){clearTimeout(s);try{n(Buffer.concat(a,r))}catch(t){o(new m(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}})})}function T(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function g(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(e){let t,a,r=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof n&&"function"!=typeof r.getBoundary&&(t=new _,a=new _,r.pipe(t),r.pipe(a),e[h].body=t,r=a),r}function R(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":T(e)?"application/x-www-form-urlencoded;charset=UTF-8":g(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof n?null:"text/plain;charset=UTF-8"}function b(e){const t=e.body;return null===t?0:g(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}y.prototype={get body(){return this[h].body},get bodyUsed(){return this[h].disturbed},arrayBuffer(){return E.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let e=this.headers&&this.headers.get("content-type")||"";return E.call(this).then(function(t){return Object.assign(new c([],{type:e.toLowerCase()}),{[u]:t})})},json(){var e=this;return E.call(this).then(function(t){try{return JSON.parse(t.toString())}catch(t){return y.Promise.reject(new m(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}})},text(){return E.call(this).then(function(e){return e.toString()})},buffer(){return E.call(this)},textConverted(){var e=this;return E.call(this).then(function(t){return function(e,t){if("function"!=typeof f)throw new Error("The package `encoding` must be installed to use the textConverted() function");const a=t.get("content-type");let n,r,i="utf-8";a&&(n=/charset=([^;]*)/i.exec(a));r=e.slice(0,1024).toString(),!n&&r&&(n=/<meta.+?charset=(['"])(.+?)\1/i.exec(r));!n&&r&&(n=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(r),n||(n=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(r),n&&n.pop()),n&&(n=/charset=(.*)/i.exec(n.pop())));!n&&r&&(n=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(r));n&&(i=n.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return f(e,"UTF-8",i).toString()}(t,e.headers)})}},Object.defineProperties(y.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),y.mixIn=function(e){for(const t of Object.getOwnPropertyNames(y.prototype))if(!(t in e)){const a=Object.getOwnPropertyDescriptor(y.prototype,t);Object.defineProperty(e,t,a)}},y.Promise=global.Promise;const O=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,N=/[^\t\x20-\x7e\x80-\xff]/;function A(e){if(e=`${e}`,O.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function S(e){if(e=`${e}`,N.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function w(e,t){t=t.toLowerCase();for(const a in e)if(a.toLowerCase()===t)return a}const I=Symbol("map");class C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[I]=Object.create(null),e instanceof C){const t=e.raw(),a=Object.keys(t);for(const e of a)for(const a of t[e])this.append(e,a);return}if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const a=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");a.push(Array.from(t))}for(const e of a){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const a=e[t];this.append(t,a)}}}}get(e){A(e=`${e}`);const t=w(this[I],e);return void 0===t?null:this[I][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=D(this),n=0;for(;n<a.length;){var r=a[n];const i=r[0],o=r[1];e.call(t,o,i,this),a=D(this),n++}}set(e,t){t=`${t}`,A(e=`${e}`),S(t);const a=w(this[I],e);this[I][void 0!==a?a:e]=[t]}append(e,t){t=`${t}`,A(e=`${e}`),S(t);const a=w(this[I],e);void 0!==a?this[I][a].push(t):this[I][e]=[t]}has(e){return A(e=`${e}`),void 0!==w(this[I],e)}delete(e){A(e=`${e}`);const t=w(this[I],e);void 0!==t&&delete this[I][t]}raw(){return this[I]}keys(){return j(this,"key")}values(){return j(this,"value")}[Symbol.iterator](){return j(this,"key+value")}}function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[I]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[I][t].join(", ")}:function(t){return[t.toLowerCase(),e[I][t].join(", ")]})}C.prototype.entries=C.prototype[Symbol.iterator],Object.defineProperty(C.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(C.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const P=Symbol("internal");function j(e,t){const a=Object.create(k);return a[P]={target:e,kind:t,index:0},a}const k=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==k)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[P];const t=e.target,a=e.kind,n=e.index,r=D(t,a);return n>=r.length?{value:void 0,done:!0}:(this[P].index=n+1,{value:r[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function x(e){const t=Object.assign({__proto__:null},e[I]),a=w(e[I],"Host");return void 0!==a&&(t[a]=t[a][0]),t}Object.defineProperty(k,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const L=Symbol("Response internals"),M=r.STATUS_CODES;class G{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y.call(this,e,t);const a=t.status||200,n=new C(t.headers);if(null!=e&&!n.has("Content-Type")){const t=R(e);t&&n.append("Content-Type",t)}this[L]={url:t.url,status:a,statusText:t.statusText||M[a],headers:n,counter:t.counter}}get url(){return this[L].url||""}get status(){return this[L].status}get ok(){return this[L].status>=200&&this[L].status<300}get redirected(){return this[L].counter>0}get statusText(){return this[L].statusText}get headers(){return this[L].headers}clone(){return new G(v(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}y.mixIn(G.prototype),Object.defineProperties(G.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(G.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const F=Symbol("Request internals"),B=i.URL||o.URL,z=i.parse,V=i.format;function $(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new B(e).toString()),z(e)}const U="destroy"in n.Readable.prototype;function H(e){return"object"==typeof e&&"object"==typeof e[F]}class q{constructor(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};H(e)?t=$(e.url):(t=e&&e.href?$(e.href):$(`${e}`),e={});let n=a.method||e.method||"GET";if(n=n.toUpperCase(),(null!=a.body||H(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let r=null!=a.body?a.body:H(e)&&null!==e.body?v(e):null;y.call(this,r,{timeout:a.timeout||e.timeout||0,size:a.size||e.size||0});const i=new C(a.headers||e.headers||{});if(null!=r&&!i.has("Content-Type")){const e=R(r);e&&i.append("Content-Type",e)}let o=H(e)?e.signal:null;if("signal"in a&&(o=a.signal),null!=o&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[F]={method:n,redirect:a.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:o},this.follow=void 0!==a.follow?a.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==a.compress?a.compress:void 0===e.compress||e.compress,this.counter=a.counter||e.counter||0,this.agent=a.agent||e.agent}get method(){return this[F].method}get url(){return V(this[F].parsedURL)}get headers(){return this[F].headers}get redirect(){return this[F].redirect}get signal(){return this[F].signal}clone(){return new q(this)}}function K(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}y.mixIn(q.prototype),Object.defineProperty(q.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(q.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),K.prototype=Object.create(Error.prototype),K.prototype.constructor=K,K.prototype.name="AbortError";const W=i.URL||o.URL,Q=n.PassThrough;function Y(e,t){if(!Y.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return y.Promise=Y.Promise,new Y.Promise(function(a,i){const o=new q(e,t),l=function(e){const t=e[F].parsedURL,a=new C(e[F].headers);if(a.has("Accept")||a.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof n.Readable&&!U)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=b(e);"number"==typeof t&&(r=String(t))}r&&a.set("Content-Length",r),a.has("User-Agent")||a.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!a.has("Accept-Encoding")&&a.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),Object.assign({},t,{method:e.method,headers:x(a),agent:i})}(o),u=("https:"===l.protocol?s:r).request,d=o.signal;let c=null;const f=function(){let e=new K("The user aborted a request.");i(e),o.body&&o.body instanceof n.Readable&&X(o.body,e),c&&c.body&&c.body.emit("error",e)};if(d&&d.aborted)return void f();const h=function(){f(),E()},_=u(l);let y;function E(){_.abort(),d&&d.removeEventListener("abort",h),clearTimeout(y)}d&&d.addEventListener("abort",h),o.timeout&&_.once("socket",function(e){y=setTimeout(function(){i(new m(`network timeout at: ${o.url}`,"request-timeout")),E()},o.timeout)}),_.on("error",function(e){i(new m(`request to ${o.url} failed, reason: ${e.message}`,"system",e)),c&&c.body&&X(c.body,e),E()}),function(e,t){let a;e.on("socket",function(e){a=e}),e.on("response",function(e){const n=e.headers;"chunked"!==n["transfer-encoding"]||n["content-length"]||e.once("close",function(e){if(a&&a.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}})})}(_,function(e){d&&d.aborted||c&&c.body&&X(c.body,e)}),parseInt(process.version.substring(1))<14&&_.on("socket",function(e){e.addListener("close",function(t){const a=e.listenerCount("data")>0;if(c&&a&&!t&&(!d||!d.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",e)}})}),_.on("response",function(e){clearTimeout(y);const t=function(e){const t=new C;for(const a of Object.keys(e))if(!O.test(a))if(Array.isArray(e[a]))for(const n of e[a])N.test(n)||(void 0===t[I][a]?t[I][a]=[n]:t[I][a].push(n));else N.test(e[a])||(t[I][a]=[e[a]]);return t}(e.headers);if(Y.isRedirect(e.statusCode)){const r=t.get("Location");let s=null;try{s=null===r?null:new W(r,o.url).toString()}catch(e){if("manual"!==o.redirect)return i(new m(`uri requested responds with an invalid redirect URL: ${r}`,"invalid-redirect")),void E()}switch(o.redirect){case"error":return i(new m(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),void E();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){i(e)}break;case"follow":if(null===s)break;if(o.counter>=o.follow)return i(new m(`maximum redirect reached at: ${o.url}`,"max-redirect")),void E();const r={headers:new C(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:o.body,signal:o.signal,timeout:o.timeout,size:o.size};if(!function(e,t){const a=new W(t).hostname,n=new W(e).hostname;return a===n||"."===a[a.length-n.length-1]&&a.endsWith(n)}(o.url,s)||(n=o.url,new W(s).protocol!==new W(n).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(e);return 303!==e.statusCode&&o.body&&null===b(o)?(i(new m("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void E()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==o.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),a(Y(new q(s,r))),void E())}}var n;e.once("end",function(){d&&d.removeEventListener("abort",h)});let r=e.pipe(new Q);const s={url:o.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:o.size,timeout:o.timeout,counter:o.counter},l=t.get("Content-Encoding");if(!o.compress||"HEAD"===o.method||null===l||204===e.statusCode||304===e.statusCode)return c=new G(r,s),void a(c);const u={flush:p.Z_SYNC_FLUSH,finishFlush:p.Z_SYNC_FLUSH};if("gzip"==l||"x-gzip"==l)return r=r.pipe(p.createGunzip(u)),c=new G(r,s),void a(c);if("deflate"==l||"x-deflate"==l){const t=e.pipe(new Q);return t.once("data",function(e){r=8==(15&e[0])?r.pipe(p.createInflate()):r.pipe(p.createInflateRaw()),c=new G(r,s),a(c)}),void t.on("end",function(){c||(c=new G(r,s),a(c))})}if("br"==l&&"function"==typeof p.createBrotliDecompress)return r=r.pipe(p.createBrotliDecompress()),c=new G(r,s),void a(c);c=new G(r,s),a(c)}),function(e,t){const a=t.body;null===a?e.end():g(a)?a.stream().pipe(e):Buffer.isBuffer(a)?(e.write(a),e.end()):a.pipe(e)}(_,o)})}function X(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Y.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Y.Promise=global.Promise;const J=Y},9660:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(6223),r=a(4450),i=a(458),o=a(2697),s={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,parentSchema:s,data:p,it:l}=e;"all"===l.opts.removeAdditional&&void 0===s.additionalProperties&&o.default.code(new n.KeywordCxt(l,o.default,"additionalProperties"));const u=(0,r.allSchemaProperties)(a);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter(e=>!(0,i.alwaysValidSchema)(l,a[e]));if(0===d.length)return;const c=t.name("valid");for(const a of d)m(a)?f(a):(t.if((0,r.propertyInData)(t,p,a,l.opts.ownProperties)),f(a),l.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(a),e.ok(c);function m(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==a[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};t.default=s},9690:(e,t,a)=>{const{humanReadableArgName:n}=a(1762);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),a=e._getHelpCommand();return a&&!a._hidden&&t.push(a),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const a=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return a(e).localeCompare(a(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),a=e._getHelpOption();if(a&&!a.hidden){const n=a.short&&e._findOption(a.short),r=a.long&&e._findOption(a.long);n||r?a.long&&!r?t.push(e.createOption(a.long,a.description)):a.short&&!n&&t.push(e.createOption(a.short,a.description)):t.push(a)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let a=e.parent;a;a=a.parent){const e=a.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){const t=e.registeredArguments.map(e=>n(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,a)=>Math.max(e,t.subcommandTerm(a).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,a)=>Math.max(e,t.optionTerm(a).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,a)=>Math.max(e,t.optionTerm(a).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,a)=>Math.max(e,t.argumentTerm(a).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let a="";for(let t=e.parent;t;t=t.parent)a=t.name()+" "+a;return a+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const a=`(${t.join(", ")})`;return e.description?`${e.description} ${a}`:a}return e.description}formatHelp(e,t){const a=t.padWidth(e,t),n=t.helpWidth||80;function r(e,r){if(r){const i=`${e.padEnd(a+2)}${r}`;return t.wrap(i,n-2,a+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,""];const s=t.commandDescription(e);s.length>0&&(o=o.concat([t.wrap(s,n,0),""]));const p=t.visibleArguments(e).map(e=>r(t.argumentTerm(e),t.argumentDescription(e)));p.length>0&&(o=o.concat(["Arguments:",i(p),""]));const l=t.visibleOptions(e).map(e=>r(t.optionTerm(e),t.optionDescription(e)));if(l.length>0&&(o=o.concat(["Options:",i(l),""])),this.showGlobalOptions){const a=t.visibleGlobalOptions(e).map(e=>r(t.optionTerm(e),t.optionDescription(e)));a.length>0&&(o=o.concat(["Global Options:",i(a),""]))}const u=t.visibleCommands(e).map(e=>r(t.subcommandTerm(e),t.subcommandDescription(e)));return u.length>0&&(o=o.concat(["Commands:",i(u),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,a,n=40){const r=new RegExp("[\\n][ \\f\\t\\v   -    \ufeff]+");if(e.match(r))return e;const i=t-a;if(i<n)return e;const o=e.slice(0,a),s=e.slice(a).replace("\r\n","\n"),p=" ".repeat(a),l="\\s​",u=new RegExp(`\n|.{1,${i-1}}([${l}]|$)|[^${l}]+?([${l}]|$)`,"g");return o+(s.match(u)||[]).map((e,t)=>"\n"===e?"":(t>0?p:"")+e.trimEnd()).join("\n")}}},9741:(e,t,a)=>{const n=a(5479),{animationRunTypes:r,autoGeneratedItemIdKind:i}=a(7089);t.systemActionDescriptions={PROPERTY_BANK_EXPRESSION:{default:"","en-us":"Change Data value with script expression. One expression of return value","zh-tw":"使用腳本表達式改變 Data 值。 一個表達式回傳值","ja-jp":"スクリプト式を使用して Data の値を変更する。1つの式で値を返す"},PROPERTY_BANK:{default:"","en-us":"Change Data value","zh-tw":"改變 Data 值","ja-jp":"Data の値を変更する"},PROPERTY_BANK_COMMAND:{default:"","en-us":"Trigger Data calculation flow without value change","zh-tw":"不需改變值,觸發 Data 計算流程","ja-jp":"値を変更せずに Data の計算フローをトリガーする"},DYNAMIC_BRICK:{default:"","en-us":"[Unstable] Dynamically generate bricks","zh-tw":"[Unstable] 動態地産生 Bricks","ja-jp":"動的に生成されたブリック"},DYNAMIC_BRICK_RESET:{default:"","en-us":"[Unstable] Reset Dynamic Bricks","zh-tw":"[Unstable] 重設 Dynamic Bricks","ja-jp":"動的に生成されたブリックをリセットする"},DYNAMIC_ANIMATION:{default:"","en-us":"Run specific Animation on specific Brick","zh-tw":"在指定的 Brick 上運行指定的 Animation","ja-jp":"指定されたブリックで指定されたアニメーションを実行する"},DYNAMIC_ANIMATION_RESET:{default:"","en-us":"Reset Dynamic Animation","zh-tw":"重設 Dynamic Animation","ja-jp":"動的なアニメーションをリセットする"},DYNAMIC_ANIMATION_STOP:{default:"","en-us":"Stop Dynamic Animation","zh-tw":"停止 Dynamic Animation","ja-jp":"動的なアニメーションを停止する"},CHANGE_CANVAS:{default:"","en-us":"Change canvas on the current Subspace","zh-tw":"在當前的 Subspace 中切換 Canvas","ja-jp":"現在の Subspace の Canvas を変更する"},MESSAGE:{default:"","en-us":"Log System message","zh-tw":"Log System message","ja-jp":"システムメッセージをログに記録する"},ALERT:{default:"","en-us":"Show system alert popup with custom message","zh-tw":"顯示自定義訊息的系統警告彈窗","ja-jp":"カスタムメッセージを使用してシステム警告ポップアップを表示する"},POPUP_RESET:{default:"","en-us":"Close current showing popups with type or id.","zh-tw":"關閉目前顯示的 Popup,可以指定 Popup 類型或 id。","ja-jp":"現在表示されているポップアップを閉じる、または ID で指定されたポップアップを閉じる。"},TAKE_SCREENSHOT:{default:"","en-us":"Take screenshot for current subspace or the full viewport (including portal subspaces)","zh-tw":"為當前的 Subspace 截圖,或截取整個顯示畫面(包含 Portal Subspace)","ja-jp":"現在の Subspace またはビューポート全体(Portal Subspace を含む)のスクリーンショットを撮る"},STORAGE_SET:{default:"","en-us":"Store a value in application-specific storage","zh-tw":"在應用程式特定的儲存空間中儲存值","ja-jp":"アプリケーション固有のストレージに値を保存する"},STORAGE_RETRIEVE:{default:"","en-us":"Retrieve a value from application-specific storage","zh-tw":"從應用程式特定的儲存空間中取得值","ja-jp":"アプリケーション固有のストレージから値を取得する"},STORAGE_DELETE:{default:"","en-us":"Delete a value from application-specific storage or clear all values","zh-tw":"從應用程式特定的儲存空間中刪除值或清除所有值","ja-jp":"アプリケーション固有のストレージから値を削除するか、すべての値をクリアする"},CHANNEL_SUBSCRIBE:{default:"","en-us":"Subscribe to a channel for data update","zh-tw":"訂閱一個 Channel 以接收資料更新","ja-jp":"チャンネルを購読してデータ更新を受け取る"},CHANNEL_UNSUBSCRIBE:{default:"","en-us":"Unsubscribe from a channel","zh-tw":"取消訂閱一個 Channel","ja-jp":"チャンネルから購読を解除する"},CHANNEL_PUBLISH:{default:"","en-us":"Publish data to a channel","zh-tw":"發布資料到一個 Channel","ja-jp":"チャンネルにデータを発行する"},DELAY:{default:"","en-us":"Delay for a certain time between actions","zh-tw":"延遲一段時間,用於兩個動作之間","ja-jp":"一定時間遅延する、2つのアクションの間"},USE_SHARE_APPLICATION:{default:"","en-us":"[Internal] Use a shared application","zh-tw":"[Internal] 切換到分享的應用程式","ja-jp":"[Internal] 共有アプリケーションを使用する"},AUTH_IN_DEVICE:{default:"","en-us":"[Internal] Auth in device","zh-tw":"[Internal] 在裝置上進行帳號登入","ja-jp":"[Internal] デバイスで認証する"},REFRESH_BINDCODE:{default:"","en-us":"[Internal] Refresh passcode for bind device","zh-tw":"[Internal] 更新裝置綁定碼","ja-jp":"[Internal] デバイスのバインドコードを更新する"},OPEN_URL:{default:"","en-us":"Open URL","zh-tw":"開啟 URL","ja-jp":"URL を開く"},OPEN_FILE:{default:"","en-us":"Open File or Directory","zh-tw":"開啟檔案或目錄","ja-jp":"ファイルまたはディレクトリを開く"},THROW_EXCEPTION:{default:"","en-us":"Throw exception","zh-tw":"拋出例外","ja-jp":"例外を投げる"},RESTART_FOUNDATION:{default:"","en-us":"Restart the foundation (React Native bundle)","zh-tw":"重新啟動基礎設施 (React Native bundle)","ja-jp":"基盤を再起動する (React Native bundle)"},DISMISS_KEYBOARD:{default:"","en-us":"Dismiss keyboard","zh-tw":"關閉鍵盤","ja-jp":"キーボードを閉じる"},TRIGGER_APPLICATION_FILTER:{default:"","en-us":"Trigger application AI filter","zh-tw":"觸發應用程式 AI 過濾器","ja-jp":"アプリケーション AI フィルターをトリガーする"},STOP_APPLICATION_FILTER:{default:"","en-us":"Stop running application AI filter","zh-tw":"停止運行中的應用程式 AI 過濾器","ja-jp":"実行中のアプリケーション AI フィルターを停止する"},SAVE_UPDATE_SNAPSHOT:{default:"","en-us":"Save update snapshot (from Application Filter or DevTools MCP Server) to media system","zh-tw":"儲存更新快照 (來自 Application Filter 或 DevTools MCP Server) 到媒體系統","ja-jp":"メディアシステムに更新スナップショット (Application Filter または DevTools MCP サーバーから) を保存する"}},t.systemActions={PROPERTY_BANK_EXPRESSION:{displayName:"CHANGE DATA WITH EXPRESSION",canProvideProperty:!0,filterKind:[i],propertyNameType:"defined_properties",property:{EXPRESSION:{type:"string",displayName:"Expression",normalizeDisplayName:!1},VARIABLES:{type:"nested",schema:{type:"object",properties:{id:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Data ID",normalizeDisplayName:!1},key:{type:"string"}},allowNewItem:!0},popover:!0,defaultValue:[]},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},RESULT_ASSIGN_PATH:{type:"string"},ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK:{displayName:"CHANGE DATA",canProvideProperty:!0,filterKind:[i],propertyNameType:"property_bank",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK_COMMAND:{displayName:"TRIGGER DATA COMMAND",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"property_bank",type:"bool",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:16}},DYNAMIC_BRICK:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_BRICK_ADD_LIST:{type:"string"},DYNAMIC_BRICK_PREFER_AFTER_ITEM_ID:{type:"string"},DYNAMIC_BRICK_RESET:{type:"bool"},DYNAMIC_BRICK_REMOVE_ITEM_ID:{type:"string"},DYNAMIC_BRICK_REMOVE_ITEMS:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"grid-2"}},DYNAMIC_BRICK_RESET:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"},DYNAMIC_ANIMATION_ANIMATION_ID:{type:"string",kind:"id",idType:"animation"},DYNAMIC_ANIMATION_RUN_TYPE:{type:"oneOf",oneOf:r},DYNAMIC_ANIMATION_RESET_INITIAL_VALUE:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bars-staggered",size:16}},DYNAMIC_ANIMATION_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION_STOP:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"stop"}},CHANGE_CANVAS:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{CANVAS_ID:{type:"string",kind:"id",idType:"canvas"},CANVAS_TITLE_LIKE:{type:"string"},CANVAS_KEY_MAP_LIST:{type:"nested",schema:{type:"object",properties:{key:{displayName:"Key",type:"string"},value:{displayName:"Canvas ID",type:"string",kind:"id",idType:"canvas"}},allowNewItem:!0},popover:!0,defaultValue:[]},CANVAS_KEY:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"diamond-turn-right",size:16}},MESSAGE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{SYSTEM_MESSAGE_TYPE:{type:"oneOf",oneOf:["SYSTEM_MESSAGE_TYPE_INFO","SYSTEM_MESSAGE_TYPE_SUCCESS","SYSTEM_MESSAGE_TYPE_WARNING","SYSTEM_MESSAGE_TYPE_ERROR"]},SYSTEM_MESSAGE_TITLE:{type:"string"},SYSTEM_MESSAGE_MESSAGE:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"note"}},ALERT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{ALERT_ID:{type:"string"},ALERT_TYPE:{type:"oneOf",oneOf:["info","success","warning","error"]},ALERT_TITLE:{type:"string"},ALERT_MESSAGE:{type:"string"},ALERT_SELECTIONS:{type:"nested",schema:{type:"object",properties:{label:{type:"string"},color:{type:"string"},value:{type:"string"},disableResult:{type:"bool"}},allowNewItem:!0},popover:!0,defaultValue:[]},ALERT_SELECTION_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ALERT_TIMEOUT:{type:"number",defaultValue:1e4},ALERT_HIDE_SELECTIONS:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bell"}},POPUP_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{POPUP_CLEAR_TYPE:{type:"oneOf",oneOf:["all","alert","generator"]},POPUP_ID:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},TAKE_SCREENSHOT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{TAKE_SCREENSHOT_CURRENT_SUBSPACE:{type:"bool"},TAKE_SCREENSHOT_BRICK_ID:{type:"string",kind:"id",idType:"brick",displayName:"Brick ID",normalizeDisplayName:!1},TAKE_SCREENSHOT_FORMAT:{type:"oneOf",oneOf:["jpg","png"]},TAKE_SCREENSHOT_QUALITY:{type:"number",max:1,min:0,step:.1},TAKE_SCREENSHOT_WIDTH:{type:"number"},TAKE_SCREENSHOT_HEIGHT:{type:"number"},TAKE_SCREENSHOT_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"camera",size:16}},STORAGE_SET:{displayName:"STORAGE SET",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_VALUE:{type:"any",displayName:"Value",normalizeDisplayName:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_RETRIEVE:{displayName:"STORAGE RETRIEVE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_RETRIEVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},STORAGE_RETRIEVE_DEFAULT_VALUE:{type:"string",displayName:"Default Value",normalizeDisplayName:!1},STORAGE_RETRIEVE_SKIP_IF_NOT_FOUND:{type:"bool",displayName:"Skip if Not Found",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_DELETE:{displayName:"STORAGE DELETE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_DELETE_ALL:{type:"bool",displayName:"Delete All Values",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"trash",size:14}},CHANNEL_SUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_SUBSCRIBE_KEY:{type:"string"},CHANNEL_SUBSCRIBE_TYPE:{type:"oneOf",oneOf:["on","once"]},CHANNEL_SUBSCRIBE_LIVETIME:{type:"number",kind:"unit",unit:"ms"},CHANNEL_SUBSCRIBE_DATA_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result"},CHANNEL_SUBSCRIBE_DATA_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_PROGRESS_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Progress"},CHANNEL_SUBSCRIBE_PROGRESS_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},CHANNEL_UNSUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_UNSUBSCRIBE_KEY_MATCH:{type:"string"}}},CHANNEL_PUBLISH:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_PUBLISH_KEY_MATCH:{type:"string"},CHANNEL_PUBLISH_PAYLOAD_TYPE:{type:"oneOf",oneOf:["result","progress","error"]},CHANNEL_PUBLISH_PAYLOAD:{type:"string"}}},DELAY:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{DELAY_TIME:{type:"number",kind:"unit",unit:"ms"}}},USE_SHARE_APPLICATION:{hidden:"internal",canProvideProperty:!0,propertyNameType:"defined_properties",property:{APPLICATION_ID:{type:"string"},RELEASE_VERSION:{type:"string"},USE_TYPE:{type:"oneOf",oneOf:["run","use-after-bind","cancel-use"]},VIEWPORT_PRESET_NAME_LIKE:{type:"string"},VIEWPORT_PRESET_DEVICE_TARGET:{type:"string"},ENABLE_LOCAL_SYNC:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},AUTH_IN_DEVICE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"user",size:16}},REFRESH_BINDCODE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},OPEN_URL:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{URL:{type:"string",normalizeDisplayName:!1,displayName:"URL"},BEHAVIOR:{type:"oneOf",oneOf:["in-app","new-window"]},IN_APP_TINT_COLOR:{type:"string",kind:"color",popover:!0}},previewIcon:{type:"font-awesome-6pro",name:"external-link",size:16}},OPEN_FILE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{PICK_TYPE:{type:"oneOf",oneOf:["file","multiple","directory"],oneOfEmptyOption:!1},FILE_TYPE:{type:"any"},COPY_TO:{type:"oneOf",oneOf:["cache","document"]},MODE:{type:"oneOf",oneOf:["import","open"]},SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},SAVE_DETAIL_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ERROR_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"folder-open",size:16}},THROW_EXCEPTION:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{BEHAVIOR:{type:"oneOf",oneOf:["application","native"]},EXCEPTION_MESSAGE:{type:"string",displayName:"Exception Message"}},previewIcon:{type:"font-awesome-6pro",name:"bomb",size:16}},RESTART_FOUNDATION:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},DISMISS_KEYBOARD:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"keyboard-down",size:16}},TRIGGER_APPLICATION_FILTER:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{NAME:{type:"string",displayName:"Filter Name",normalizeDisplayName:!1},VARIABLES:{type:"any",displayName:"Variables",normalizeDisplayName:!1},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},ERROR:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"robot",size:16}},STOP_APPLICATION_FILTER:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"stop",size:16}},SAVE_UPDATE_SNAPSHOT:{displayName:"SAVE UPDATE SNAPSHOT",canProvideProperty:!0,propertyNameType:"defined_properties",property:{SNAPSHOT_FILE_INDENTIFIER:{type:"string",displayName:"Filename Identifier",defaultValue:"default",normalizeDisplayName:!1},SNAPSHOT_SAVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},SNAPSHOT_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"camera-retro",size:16}}},t.getSubspaceActionTypes=e=>Object.entries(e.action_map||{}).reduce((e,[t,a])=>(e[`SUBSPACE_ACTION_${t}`]={canProvideProperty:Object.keys(a.event_property_map||{}).length>0,property:Object.entries(a.event_property_map||{}).reduce((e,[t,a])=>(e[`SUBSPACE_${t}`]={type:a.type,name:n(t)},e),{}),propertyNameType:"defined_properties"},e),{})},9753:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(7898),r=a(458),i=a(4450),o=a(3426),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:a,it:n}=e,{prefixItems:s}=a;n.items=!0,(0,r.alwaysValidSchema)(n,t)||(s?(0,o.validateAdditionalItems)(e,s):e.ok((0,i.validateArray)(e)))}};t.default=s},9760:(e,t,a)=>{a.d(t,{$:()=>T});var n=a(5608),r=a(9212),i=a(9074),o=a(3673),s=a(2307),p=a(3647),l=a(3068),u=a(4874),d=a(7195),c=a(4559),m=a(1151),f=a(3161),h=a(783),_=a(3777),y=a(3925),E=(0,r.maybe)(function(){return fetch}),T=function(e){void 0===e&&(e={});var t=e.uri,a=void 0===t?"/graphql":t,T=e.fetch,g=e.print,v=void 0===g?c.i1:g,R=e.includeExtensions,b=e.preserveHeaderCase,O=e.useGETForQueries,N=e.includeUnusedVariables,A=void 0!==N&&N,S=(0,n.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&(0,d.S)(T||E);var w={http:{includeExtensions:R,preserveHeaderCase:b},options:S.fetchOptions,credentials:S.credentials,headers:S.headers};return new i.C(function(e){var t=(0,l.z)(e,a),i=e.getContext(),d={};if(i.clientAwareness){var g=i.clientAwareness,R=g.name,b=g.version;R&&(d["apollographql-client-name"]=R),b&&(d["apollographql-client-version"]=b)}var N=(0,n.__assign)((0,n.__assign)({},d),i.headers),S={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:N};if((0,s.d8)(["client"],e.query)){var I=(0,y.er)(e.query);if(!I)return(0,f.N)(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=I}var C,D=(0,c.HY)(e,v,c.R4,w,S),P=D.options,j=D.body;j.variables&&!A&&(j.variables=(0,h.X)(j.variables,e.query)),P.signal||"undefined"==typeof AbortController||(C=new AbortController,P.signal=C.signal);var k,x="OperationDefinition"===(k=(0,_.Vn)(e.query)).kind&&"subscription"===k.operation,L=(0,s.d8)(["defer"],e.query);if(O&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(P.method="GET"),L||x){P.headers=P.headers||{};var M="multipart/mixed;";x&&L&&!1!==globalThis.__DEV__&&r.invariant.warn(41),x?M+="boundary=graphql;subscriptionSpec=1.0,application/json":L&&(M+="deferSpec=20220824,application/json"),P.headers.accept=M}if("GET"===P.method){var G=(0,m.E)(t,j),F=G.newURI,B=G.parseError;if(B)return(0,f.N)(B);t=F}else try{P.body=(0,p.Y)(j,"Payload")}catch(B){return(0,f.N)(B)}return new o.c(function(a){var n=T||(0,r.maybe)(function(){return fetch})||E,i=a.next.bind(a);return n(t,P).then(function(t){var a;e.setContext({response:t});var n=null===(a=t.headers)||void 0===a?void 0:a.get("content-type");return null!==n&&/^multipart\/mixed/i.test(n)?(0,u.tD)(t,i):(0,u.OQ)(e)(t).then(i)}).then(function(){C=void 0,a.complete()}).catch(function(e){C=void 0,(0,u.H4)(e,a)}),function(){C&&C.abort()}})})}},9762:(e,t,a)=>{a.d(t,{Ll:()=>s,aD:()=>i,aZ:()=>n,cE:()=>p,ou:()=>r});class n{constructor(e,t,a){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=a}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class r{constructor(e,t,a,n,r,i){this.kind=e,this.start=t,this.end=a,this.line=n,this.column=r,this.value=i,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const i={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},o=new Set(Object.keys(i));function s(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&o.has(t)}var p;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(p||(p={}))},9770:(e,t,a)=>{var n=a(4715)(a(8942),"Map");e.exports=n},9787:e=>{e.exports=JSON.parse('{"name":"GeneratorIntent","brickDescription":{"default":"","en-us":"Send intent to app and get result (Android only)","zh-tw":"向應用發送意圖並獲取結果 (僅限 Android)","ja-jp":"アプリにインテントを送信して結果を取得(Androidのみ)"},"brickDisplayName":"Intent","brickTip":{"default":""},"brickPreviewIcon":{"type":"font-awesome-6pro","name":"bullseye-arrow"},"brickMeta":{"preview":true},"propTypes":{"action":{"type":"string"},"data":{"type":"string"},"type":{"type":"string"},"extra":{"type":"object"},"className":{"type":"string"},"packageName":{"type":"string"},"category":{"type":"string"},"foregroundService":{"type":"bool"}},"brickPropDescriptions":{"action":{"default":"","en-us":"Intent action","zh-tw":"意圖動作","ja-jp":"インテントアクション"},"data":{"default":"","en-us":"Intent data","zh-tw":"意圖資料","ja-jp":"インテントデータ"},"type":{"default":"","en-us":"Intent type","zh-tw":"意圖類型","ja-jp":"インテントタイプ"},"extra":{"default":"","en-us":"Extra data","zh-tw":"額外資料","ja-jp":"追加データ"},"className":{"default":"","en-us":"Intent target class name in package","zh-tw":"意圖目標類名","ja-jp":"インテントターゲットのクラス名"},"packageName":{"default":"","en-us":"Intent target package name","zh-tw":"意圖目標包名","ja-jp":"インテントターゲットのパッケージ名"},"category":{"default":"","en-us":"Intent category","zh-tw":"意圖類別","ja-jp":"インテントカテゴリ"},"foregroundService":{"default":"","en-us":"Intent start foreground service","zh-tw":"意圖啟動前景服務","ja-jp":"インテント前景サービス"}},"defaultBrickProps":{},"propertyControls":{},"propertyControlGroups":{},"propertyControlGroupDescriptions":{},"eventTypes":{"GENERATOR_INTENT_ON_RESULT":"GENERATOR_INTENT_ON_RESULT","GENERATOR_INTENT_ON_ERROR":"GENERATOR_INTENT_ON_ERROR"},"brickEventDescriptions":{"GENERATOR_INTENT_ON_RESULT":{"default":"","en-us":"On intent return a result trigger","zh-tw":"在意圖返回結果時觸發","ja-jp":"インテントが結果を返した時に発生するイベント"},"GENERATOR_INTENT_ON_ERROR":{"default":"","en-us":"On intent error trigger","zh-tw":"在意圖錯誤時觸發","ja-jp":"インテントエラー時に発生するイベント"}},"eventPropertyControls":{"GENERATOR_INTENT_ON_RESULT":{"properties":{"GENERATOR_INTENT_RESULT_CODE":{"name":"Result Code","type":"number"},"GENERATOR_INTENT_RESULT_DATA":{"name":"Result Data","type":"string"},"GENERATOR_INTENT_RESULT_EXTRAS":{"name":"Extra Data","type":"object"}}},"GENERATOR_INTENT_ON_ERROR":{"properties":{"GENERATOR_INTENT_ERROR":{"name":"Error Message","type":"string"}}}},"outletTypes":{"GENERATOR_INTENT_RESULT":{"outlet":"GENERATOR_INTENT_RESULT","type":"object"}},"brickOutletDescriptions":{"GENERATOR_INTENT_RESULT":{"default":"","en-us":"Last intent result","zh-tw":"最後意圖結果","ja-jp":"最後のインテント結果"}},"actionTypes":{"GENERATOR_INTENT_SEND_INTENT":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_INTENT_ACTION":{"name":"Action","type":"string"},"GENERATOR_INTENT_DATA":{"name":"Data","type":"string"},"GENERATOR_INTENT_TYPE":{"name":"Type","type":"string"},"GENERATOR_INTENT_EXTRA":{"name":"Extra","type":"object"},"GENERATOR_INTENT_CLASS_NAME":{"name":"Class Name","type":"string"},"GENERATOR_INTENT_PACKAGE_NAME":{"name":"Package Name","type":"string"},"GENERATOR_INTENT_CATEGORY":{"name":"Category","type":"string"}}},"GENERATOR_INTENT_START_SERVICE":{"disallowMultiple":true,"canProvideProperty":true,"propertyNameType":"defined_properties","property":{"GENERATOR_INTENT_ACTION":{"name":"Action","type":"string"},"GENERATOR_INTENT_DATA":{"name":"Data","type":"string"},"GENERATOR_INTENT_TYPE":{"name":"Type","type":"string"},"GENERATOR_INTENT_EXTRA":{"name":"Extra","type":"object"},"GENERATOR_INTENT_CLASS_NAME":{"name":"Class Name","type":"string"},"GENERATOR_INTENT_PACKAGE_NAME":{"name":"Package Name","type":"string"},"GENERATOR_INTENT_CATEGORY":{"name":"Category","type":"string"},"GENERATOR_INTENT_FOREGROUND":{"name":"Foreground Service","type":"boolean"}}}},"brickActionDescriptions":{"GENERATOR_INTENT_SEND_INTENT":{"default":"","en-us":"Read stats","zh-tw":"讀取 stats","ja-jp":"統計情報を読み取る"},"GENERATOR_INTENT_START_SERVICE":{"default":"","en-us":"Start intent service","zh-tw":"啟動意圖服務","ja-jp":"インテントサービスを起動する"}}}')},9790:(e,t,a)=>{a.d(t,{default:()=>Q,oraPromise:()=>Y,spinners:()=>D}),a.r(t);var n=a(1708),r=a(8568);const i=(e,t,a,n)=>{if("length"===a||"prototype"===a)return;if("arguments"===a||"caller"===a)return;const r=Object.getOwnPropertyDescriptor(e,a),i=Object.getOwnPropertyDescriptor(t,a);!o(r,i)&&n||Object.defineProperty(e,a,i)},o=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},s=(e,t)=>`/* Wrapped ${e}*/\n${t}`,p=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),l=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function u(e,t,{ignoreNonConfigurable:a=!1}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t))i(e,t,n,a);return((e,t)=>{const a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)})(e,t),((e,t,a)=>{const n=""===a?"":`with ${a.trim()}() `,r=s.bind(null,n,t.toString());Object.defineProperty(r,"name",l);const{writable:i,enumerable:o,configurable:u}=p;Object.defineProperty(e,"toString",{value:r,writable:i,enumerable:o,configurable:u})})(e,t,n),e}const d=new WeakMap,c=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let a,n=0;const r=e.displayName||e.name||"<anonymous>",i=function(...o){if(d.set(i,++n),1===n)a=e.apply(this,o),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${r}\` can only be called once`);return a};return u(i,e),d.set(i,n),i};c.callCount=e=>{if(!d.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return d.get(e)};const m=c,f=[];f.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&f.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&f.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const h=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,_=Symbol.for("signal-exit emitter"),y=globalThis,E=Object.defineProperty.bind(Object);class T{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(y[_])return y[_];E(y,_,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const a=this.listeners[e],n=a.indexOf(t);-1!==n&&(0===n&&1===a.length?a.length=0:a.splice(n,1))}emit(e,t,a){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const r of this.listeners[e])n=!0===r(t,a)||n;return"exit"===e&&(n=this.emit("afterExit",t,a)||n),n}}class g{}const v=globalThis.process,{onExit:R,load:b,unload:O}=(N=h(v)?new class extends g{#e="win32"===v.platform?"SIGINT":"SIGHUP";#t=new T;#a;#n;#r;#i={};#o=!1;constructor(e){super(),this.#a=e,this.#i={};for(const t of f)this.#i[t]=()=>{const a=this.#a.listeners(t);let{count:n}=this.#t;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(n+=r.__signal_exit_emitter__.count),a.length===n){this.unload();const a=this.#t.emit("exit",null,t),n="SIGHUP"===t?this.#e:t;a||e.kill(e.pid,n)}};this.#r=e.reallyExit,this.#n=e.emit}onExit(e,t){if(!h(this.#a))return()=>{};!1===this.#o&&this.load();const a=t?.alwaysLast?"afterExit":"exit";return this.#t.on(a,e),()=>{this.#t.removeListener(a,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of f)try{const t=this.#i[e];t&&this.#a.on(e,t)}catch(e){}this.#a.emit=(e,...t)=>this.#s(e,...t),this.#a.reallyExit=e=>this.#p(e)}}unload(){this.#o&&(this.#o=!1,f.forEach(e=>{const t=this.#i[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#a.removeListener(e,t)}catch(e){}}),this.#a.emit=this.#n,this.#a.reallyExit=this.#r,this.#t.count-=1)}#p(e){return h(this.#a)?(this.#a.exitCode=e||0,this.#t.emit("exit",this.#a.exitCode,null),this.#r.call(this.#a,this.#a.exitCode)):0}#s(e,...t){const a=this.#n;if("exit"===e&&h(this.#a)){"number"==typeof t[0]&&(this.#a.exitCode=t[0]);const n=a.call(this.#a,e,...t);return this.#t.emit("exit",this.#a.exitCode,null),n}return a.call(this.#a,e,...t)}}(v):new class extends g{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>N.onExit(e,t),load:()=>N.load(),unload:()=>N.unload()});var N;const A=n.stderr.isTTY?n.stderr:n.stdout.isTTY?n.stdout:void 0,S=A?m(()=>{R(()=>{A.write("[?25h")},{alwaysLast:!0})}):()=>{};let w=!1;const I={show:(e=n.stderr)=>{e.isTTY&&(w=!1,e.write("[?25h"))},hide:(e=n.stderr)=>{e.isTTY&&(S(),w=!0,e.write("[?25l"))},toggle:(e,t)=>{void 0!==e&&(w=e),w?I.show(t):I.hide(t)}},C=I;var D=a(7661);const P={info:r.Ay.blue("ℹ"),success:r.Ay.green("✔"),warning:r.Ay.yellow("⚠"),error:r.Ay.red("✖")},j={info:r.Ay.blue("i"),success:r.Ay.green("√"),warning:r.Ay.yellow("‼"),error:r.Ay.red("×")},k=("win32"!==n.platform?"linux"!==n.env.TERM:Boolean(n.env.CI)||Boolean(n.env.WT_SESSION)||Boolean(n.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===n.env.ConEmuTask||"Terminus-Sublime"===n.env.TERM_PROGRAM||"vscode"===n.env.TERM_PROGRAM||"xterm-256color"===n.env.TERM||"alacritty"===n.env.TERM||"JetBrains-JediTerm"===n.env.TERMINAL_EMULATOR)?P:j;const x=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function L(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(x,"")}function M(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function G(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}function F(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||129736===e||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function B(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function z(e,{ambiguousAsWide:t=!1}={}){return B(e),G(e)||F(e)||t&&M(e)?2:1}const V=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,$=new Intl.Segmenter,U=/^\p{Default_Ignorable_Code_Point}$/u;function H(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:a=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=L(e)),0===e.length)return 0;let r=0;const i={ambiguousAsWide:!a};for(const{segment:t}of $.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||U.test(t)||(V().test(t)?r+=2:r+=z(e,i)))}return r}var q=a(9122);const K=new class{#l=0;start(){this.#l++,1===this.#l&&this.#u()}stop(){if(this.#l<=0)throw new Error("`stop` called more times than `start`");this.#l--,0===this.#l&&this.#d()}#u(){"win32"!==n.platform&&n.stdin.isTTY&&(n.stdin.setRawMode(!0),n.stdin.on("data",this.#c),n.stdin.resume())}#d(){n.stdin.isTTY&&(n.stdin.off("data",this.#c),n.stdin.pause(),n.stdin.setRawMode(!1))}#c(e){3===e[0]&&n.emit("SIGINT")}};class W{#m=0;#f=!1;#h=0;#_=-1;#y=0;#E;#T;#g;#v;#R;#b;#O;#N;#A;#S;#w;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#E={color:"cyan",stream:n.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#E.color,this.spinner=this.#E.spinner,this.#R=this.#E.interval,this.#g=this.#E.stream,this.#b="boolean"==typeof this.#E.isEnabled?this.#E.isEnabled:function({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#g}),this.#O="boolean"==typeof this.#E.isSilent&&this.#E.isSilent,this.text=this.#E.text,this.prefixText=this.#E.prefixText,this.suffixText=this.#E.suffixText,this.indent=this.#E.indent}get indent(){return this.#N}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#N=e,this.#I()}get interval(){return this.#R??this.#T.interval??100}get spinner(){return this.#T}set spinner(e){if(this.#_=-1,this.#R=void 0,"object"==typeof e){if(void 0===e.frames)throw new Error("The given spinner must have a `frames` property");this.#T=e}else if((0,q.A)())if(void 0===e)this.#T=D.dots;else{if("default"===e||!D[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#T=D[e]}else this.#T=D.line}get text(){return this.#A}set text(e=""){this.#A=e,this.#I()}get prefixText(){return this.#S}set prefixText(e=""){this.#S=e,this.#I()}get suffixText(){return this.#w}set suffixText(e=""){this.#w=e,this.#I()}get isSpinning(){return void 0!==this.#v}#C(e=this.#S,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#D(e=this.#w,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#I(){const e=this.#g.columns??80,t=this.#C(this.#S,"-"),a=this.#D(this.#w,"-"),n=" ".repeat(this.#N)+t+"--"+this.#A+"--"+a;this.#h=0;for(const t of L(n).split("\n"))this.#h+=Math.max(1,Math.ceil(H(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#b&&!this.#O}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this.#b=e}get isSilent(){return this.#O}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this.#O=e}frame(){const e=Date.now();(-1===this.#_||e-this.#y>=this.interval)&&(this.#_=++this.#_%this.#T.frames.length,this.#y=e);const{frames:t}=this.#T;let a=t[this.#_];this.color&&(a=r.Ay[this.color](a));return("string"==typeof this.#S&&""!==this.#S?this.#S+" ":"")+a+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#w&&""!==this.#w?" "+this.#w:"")}clear(){if(!this.#b||!this.#g.isTTY)return this;this.#g.cursorTo(0);for(let e=0;e<this.#m;e++)e>0&&this.#g.moveCursor(0,-1),this.#g.clearLine(1);return(this.#N||this.lastIndent!==this.#N)&&this.#g.cursorTo(this.#N),this.lastIndent=this.#N,this.#m=0,this}render(){return this.#O||(this.clear(),this.#g.write(this.frame()),this.#m=this.#h),this}start(e){return e&&(this.text=e),this.#O?this:this.#b?(this.isSpinning||(this.#E.hideCursor&&C.hide(this.#g),this.#E.discardStdin&&n.stdin.isTTY&&(this.#f=!0,K.start()),this.render(),this.#v=setInterval(this.render.bind(this),this.interval)),this):(this.text&&this.#g.write(`- ${this.text}\n`),this)}stop(){return this.#b?(clearInterval(this.#v),this.#v=void 0,this.#_=0,this.clear(),this.#E.hideCursor&&C.show(this.#g),this.#E.discardStdin&&n.stdin.isTTY&&this.#f&&(K.stop(),this.#f=!1),this):this}succeed(e){return this.stopAndPersist({symbol:k.success,text:e})}fail(e){return this.stopAndPersist({symbol:k.error,text:e})}warn(e){return this.stopAndPersist({symbol:k.warning,text:e})}info(e){return this.stopAndPersist({symbol:k.info,text:e})}stopAndPersist(e={}){if(this.#O)return this;const t=e.prefixText??this.#S,a=this.#C(t," "),n=e.symbol??" ",r=e.text??this.text,i="string"==typeof r?(n?" ":"")+r:"",o=e.suffixText??this.#w,s=a+n+i+this.#D(o," ")+"\n";return this.stop(),this.#g.write(s),this}}function Q(e){return new W(e)}async function Y(e,t){const a="function"==typeof e,n="function"==typeof e.then;if(!a&&!n)throw new TypeError("Parameter `action` must be a Function or a Promise");const{successText:r,failText:i}="object"==typeof t?t:{successText:void 0,failText:void 0},o=Q(t).start();try{const t=a?e(o):e,n=await t;return o.succeed(void 0===r?void 0:"string"==typeof r?r:r(n)),n}catch(e){throw o.fail(void 0===i?void 0:"string"==typeof i?i:i(e)),e}}},9841:(e,t,a)=>{a.d(t,{I:()=>r});var n=a(8255);function r(e,t,a){return new n.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},9850:(e,t,a)=>{var n=a(9546),r=a(5813),i=a(5243),o=a(482);e.exports=function(e,t,a){return e=i(e),void 0===(t=a?void 0:t)?r(e)?o(e):n(e):e.match(t)||[]}},9868:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=a(7898),r=a(458),i=a(4450);t.error={message:({params:{property:e,depsCount:t,deps:a}})=>{const r=1===t?"property":"properties";return n.str`must have ${r} ${a} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:a,missingProperty:r}})=>n._`{property: ${e},
686
686
  missingProperty: ${r},
687
687
  depsCount: ${t},
688
688
  deps: ${a}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,a]=function({schema:e}){const t={},a={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:a)[n]=e[n]}return[t,a]}(e);s(e,t),p(e,a)}};function s(e,t=e.schema){const{gen:a,data:r,it:o}=e;if(0===Object.keys(t).length)return;const s=a.let("missing");for(const p in t){const l=t[p];if(0===l.length)continue;const u=(0,i.propertyInData)(a,r,p,o.opts.ownProperties);e.setParams({property:p,depsCount:l.length,deps:l.join(", ")}),o.allErrors?a.if(u,()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)}):(a.if(n._`${u} && (${(0,i.checkMissingProp)(e,l,s)})`),(0,i.reportMissingProp)(e,s),a.else())}}function p(e,t=e.schema){const{gen:a,data:n,keyword:o,it:s}=e,p=a.name("valid");for(const l in t)(0,r.alwaysValidSchema)(s,t[l])||(a.if((0,i.propertyInData)(a,n,l,s.opts.ownProperties),()=>{const t=e.subschema({keyword:o,schemaProp:l},p);e.mergeValidEvaluated(t,p)},()=>a.var(p,!0)),e.ok(p))}t.validatePropertyDeps=s,t.validateSchemaDeps=p,t.default=o},9891:(e,t,a)=>{a.d(t,{ApolloLink:()=>n.C,concat:()=>s,empty:()=>r,execute:()=>p.g,from:()=>i,split:()=>o}),a.r(t);a(9212);var n=a(9074),r=n.C.empty,i=n.C.from,o=n.C.split,s=n.C.concat,p=a(5174)},9893:e=>{function t(a,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(a,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9896:e=>{e.exports=t("fs")},9952:(e,t,a)=>{a.d(t,{P:()=>o});var n=a(5608),r=a(9074),i=a(9760),o=function(e){function t(t){void 0===t&&(t={});var a=e.call(this,(0,i.$)(t).request)||this;return a.options=t,a}return(0,n.__extends)(t,e),t}(r.C)},9968:(e,t,a)=>{var n=a(1035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=n}},d={};function c(e){var t=d[e];if(void 0!==t)return t.exports;var a=d[e]={id:e,loaded:!1,exports:{}};return u[e].call(a.exports,a,a.exports,c),a.loaded=!0,a.exports}c.m=u,c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var a in t)c.o(t,a)&&!c.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,a)=>(c.f[a](e,t),t),[])),c.u=e=>e+".js",c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),p={57:0},l=e=>{var t,a,{__webpack_esm_ids__:n,__webpack_esm_modules__:r,__webpack_esm_runtime__:i}=e,o=0;for(t in r)c.o(r,t)&&(c.m[t]=r[t]);for(i&&i(c);o<n.length;o++)a=n[o],c.o(p,a)&&p[a]&&p[a][0](),p[n[o]]=0},c.f.j=(e,t)=>{var a=c.o(p,e)?p[e]:void 0;if(0!==a)if(a)t.push(a[1]);else{var n=import("./"+c.u(e)).then(l,t=>{throw 0!==p[e]&&(p[e]=void 0),t});n=Promise.race([n,new Promise(t=>a=p[e]=[t])]),t.push(a[1]=n)}};var m={};c.r(m),c.d(m,{lI:()=>Ac,F3:()=>Oc,mJ:()=>Nc,AW:()=>Cc,$V:()=>wc,J6:()=>Ic,Wt:()=>Dc,qq:()=>Sc,gw:()=>Pc,Yi:()=>bc});var f={};c.r(f),c.d(f,{applicationFragment:()=>Ac,applicationShortFragment:()=>Mc,deviceFragment:()=>Oc,deviceGroupFragment:()=>Nc,deviceShortFragment:()=>Gc,instanceVersionFragment:()=>Cc,mediaBoxFragment:()=>Bc,mediaFileFragment:()=>zc,mediaWorkspaceFragment:()=>Fc,moduleFragment:()=>wc,moduleShortFragment:()=>Ic,operationFragment:()=>Dc,publicApplicationBasicInfoFragment:()=>Sc,userFavoriteFragment:()=>Pc,workspaceFragment:()=>xc,workspaceShortFragment:()=>Lc});var h={};c.r(h),c.d(h,{application:()=>_m,applicationByDevice:()=>am,applicationReleaseVersion:()=>Zc,applicationReleaseVersions:()=>Jc,applicationTestsByDevice:()=>nm,applications:()=>hm,checkBindDevicePasscode:()=>rm,devices:()=>ym,devicesByGroup:()=>om,devicesByUniqueId:()=>im,me:()=>Kc,module:()=>Wc,moduleReleaseVersion:()=>tm,moduleReleaseVersions:()=>em,modules:()=>Qc,publicModules:()=>Yc,publicModulesByIdList:()=>Xc,workspace:()=>mm,workspacePricingPlans:()=>sm,workspaces:()=>fm});var _={};c.r(_),c.d(_,{addUserFavorite:()=>sf,assignGroupPermissions:()=>af,bindApplication:()=>Mm,bindApplicationWithDeviceGroup:()=>Bm,changeWorkspaceAdditionalLimitSpending:()=>uf,changeWorkspaceSubscriptionPlan:()=>lf,controlDevice:()=>wm,createApplication:()=>km,createApplicationWithShareVersion:()=>xm,createConfigChangeOperation:()=>Jm,createDevice:()=>Rm,createDeviceGroup:()=>Im,createDeviceGroupWithApp:()=>$m,createModule:()=>Km,createVirtualDevice:()=>bm,createWorkspace:()=>Tm,createWorkspaceOTP:()=>df,dispatchDeviceGroupAction:()=>Dm,doOperation:()=>Zm,duplicateApplication:()=>Hm,duplicateModule:()=>Ym,forkApplication:()=>Um,moveApplication:()=>Vm,moveDevice:()=>Nm,moveModule:()=>Qm,registerFCMNotification:()=>nf,registerRemoteDebug:()=>rf,removeApplication:()=>qm,removeDevice:()=>Sm,removeDeviceGroup:()=>Pm,removeModule:()=>Xm,removeOperation:()=>tf,removeUserFavorite:()=>pf,removeWorkspace:()=>jm,revokeWorkspaceOTP:()=>cf,shareAccessToken:()=>of,shareApplication:()=>zm,toggleShortEditApplication:()=>Gm,updateApplication:()=>Lm,updateApplicationViewportPreset:()=>Fm,updateDevice:()=>Om,updateDeviceGroup:()=>Cm,updateModule:()=>Wm,updateOperation:()=>ef,updateVirtualDevice:()=>Am,updateWorkspace:()=>gm,updateWorkspaceTokens:()=>vm});var y={};c.r(y),c.d(y,{application:()=>Af,applicationByDevice:()=>Sf,applications:()=>Nf,device:()=>Df,devices:()=>Cf,devicesByApplication:()=>Pf,mediaBox:()=>xf,mediaBoxes:()=>kf,mediaFile:()=>Mf,mediaFiles:()=>Lf,mediaWorkspace:()=>jf,module:()=>If,modules:()=>wf,workspace:()=>Of});var E={};c.r(E),c.d(E,{bindApplication:()=>Vf,copyMediaFiles:()=>Yf,createApplication:()=>Bf,createModule:()=>Uf,deleteMediaBoxFiles:()=>Jf,deleteMediaFiles:()=>Xf,requestFileUpload:()=>qf,setMediaFileAsBoxPreview:()=>Qf,unbindApplication:()=>$f,updateApplication:()=>zf,updateMediaFile:()=>Kf,updateMediaFiles:()=>Wf,updateModule:()=>Hf});var T={};c.r(T),c.d(T,{mediaBox:()=>Wh,mediaBoxes:()=>qh,mediaFile:()=>Yh,mediaFiles:()=>Qh,mediaWorkspace:()=>Kh,mediaWorkspaces:()=>Hh});var g={};c.r(g),c.d(g,{assignGroupPermissions:()=>p_,copyMediaFiles:()=>o_,createMediaBox:()=>Zh,createMediaWorkspace:()=>Xh,deleteMediaFiles:()=>i_,moveMediaBox:()=>e_,requestFileUpload:()=>a_,setMediaFileAsBoxPreview:()=>s_,updateMediaBox:()=>t_,updateMediaFile:()=>n_,updateMediaFiles:()=>r_,updateMediaWorkspace:()=>Jh});var v={};c.r(v),c.d(v,{mediaBox:()=>u_,mediaFile:()=>c_,mediaFiles:()=>d_});var R={};c.r(R),c.d(R,{deleteMediaFiles:()=>__,requestFileUpload:()=>m_,updateMediaFile:()=>f_,updateMediaFiles:()=>h_});var b=c(9436),O=c(5181);const{DM:N,gu:A,er:S,Ww:w,b7:I,Di:C,a2:D,uB:P,ef:j,c$:k,_V:x}=O;var L=c(8568),M=c(8765),G=c(9790);const F=t("readline");var B,z,V,$=c(700),U=new P("auth").description("Authentication and token management");U.command("login").description("Login with a one-time passcode from BRICKS Controller (recommended)").argument("[passcode]","One-time passcode from BRICKS Controller").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((B=b(function*(e,t){var a,n,r=t.profile||(0,M.getCurrentProfile)(),i=t.name,o=e;o||(console.log(L.Ay.cyan("Generate a one-time passcode from BRICKS Controller:")),console.log(L.Ay.gray(" 1. Open the link below (or select your workspace first)")),console.log(` ${L.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(L.Ay.gray(' 2. Click "Generate OTP" to create a one-time passcode\n')),(o=yield(a="Enter passcode: ",n=F.createInterface({input:process.stdin,output:process.stdout}),new Promise(e=>{n.question(a,t=>{n.close(),e(t.trim())})})))||(console.log(L.Ay.red("Passcode is required")),process.exit(1)));var s=(0,G.default)("Validating passcode...").start();try{var p=(0,$.createPublicClient)((0,M.getBaseUrl)()),l=yield p.checkWorkspaceOTP(o);l.valid||(s.fail(`Invalid passcode: ${l.error||"Unknown error"}`),process.exit(1)),s.text=`Exchanging passcode for token (workspace: ${l.workspaceName})...`;var u=yield p.exchangeWorkspaceOTP(o);u.token||(s.fail("Failed to obtain token"),process.exit(1));var d=(0,$.createClient)((0,M.getBaseUrl)(),u.token),c=yield d.workspace();c||(s.fail("Token validation failed"),process.exit(1)),(0,M.setToken)(r,{token:u.token,name:i||c.name,workspaceId:c._id,workspaceName:c.name}),(0,M.setCurrentProfile)(r),s.succeed(`Logged in to workspace: ${L.Ay.green(c.name)} (profile: ${L.Ay.cyan(r)})`)}catch(e){s.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e,t){return B.apply(this,arguments)})),U.command("login-token").description("Login with a workspace token directly").option("-t, --token <token>","Workspace token").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((z=b(function*(e){var t=e.profile||(0,M.getCurrentProfile)(),a=e.token,n=e.name;a||(console.error(L.Ay.red("Error: Token is required. Use -t or --token to provide it.")),console.log(L.Ay.gray("\nYou can get a workspace token from BRICKS Controller:")+L.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")),console.log(` ${L.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(L.Ay.gray("Select your workspace and create a new token.\n")),console.log(L.Ay.yellow("Tip: Use `bricks auth login` for a simpler OTP-based login.")),process.exit(1));var r=(0,G.default)("Validating token...").start();try{var i=(0,$.createClient)((0,M.getBaseUrl)(),a),o=yield i.workspace();o||(r.fail("Invalid token or unable to access workspace"),process.exit(1)),(0,M.setToken)(t,{token:a,name:n||o.name,workspaceId:o._id,workspaceName:o.name}),(0,M.setCurrentProfile)(t),r.succeed(`Logged in to workspace: ${L.Ay.green(o.name)} (profile: ${L.Ay.cyan(t)})`)}catch(e){r.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e){return z.apply(this,arguments)})),U.command("logout").description("Remove saved token").option("-p, --profile <profile>","Profile to remove").option("-a, --all","Remove all profiles").action((V=b(function*(e){var t=e.profile;if(e.all)return(0,M.listProfiles)().forEach(e=>(0,M.removeToken)(e.name)),void console.log(L.Ay.green("All profiles removed"));var a=t||(0,M.getCurrentProfile)();(0,M.getTokenInfo)(a)?((0,M.removeToken)(a),console.log(L.Ay.green(`Logged out from profile: ${a}`))):console.log(L.Ay.yellow(`No token found for profile: ${a}`))}),function(e){return V.apply(this,arguments)})),U.command("status").description("Show current authentication status").action(b(function*(){var e=(0,M.getCurrentProfile)(),t=(0,M.getTokenInfo)(e);if(!t)return console.log(L.Ay.yellow("Not logged in")),void console.log(L.Ay.gray("Use `bricks auth login` to login"));var a=(0,G.default)("Checking connection...").start();try{var n=(0,$.createClient)((0,M.getBaseUrl)(),t.token),r=yield n.workspace();a.stop(),console.log(L.Ay.bold("\nAuthentication Status")),console.log("─".repeat(40)),console.log(`Profile: ${L.Ay.cyan(e)}`),console.log(`Workspace: ${L.Ay.green(r.name)}`),console.log(`Workspace ID: ${L.Ay.gray(r._id)}`),console.log(`Base URL: ${L.Ay.gray((0,M.getBaseUrl)())}`),console.log(`Logged in: ${L.Ay.gray(t.createdAt)}`),console.log("─".repeat(40))}catch(e){a.fail(`Connection failed: ${e.message}`)}})),U.command("list").description("List all saved profiles").action(()=>{var e=(0,M.listProfiles)();if(0===e.length)return console.log(L.Ay.yellow("No saved profiles")),void console.log(L.Ay.gray("Use `bricks auth login` to login"));console.log(L.Ay.bold("\nSaved Profiles")),console.log("─".repeat(60)),e.forEach(e=>{var t=e.current?L.Ay.green("● "):" ",a=e.current?L.Ay.green(e.name):e.name;console.log(`${t}${a.padEnd(15)} ${L.Ay.gray(e.workspaceName||"Unknown")}`)}),console.log("─".repeat(60))}),U.command("use <profile>").description("Switch to a different profile").action(e=>{var t=(0,M.getTokenInfo)(e);if(!t)return console.log(L.Ay.red(`Profile not found: ${e}`)),void console.log(L.Ay.gray("Use `bricks auth list` to see available profiles"));(0,M.setCurrentProfile)(e),console.log(L.Ay.green(`Switched to profile: ${e}`)),t.workspaceName&&console.log(L.Ay.gray(`Workspace: ${t.workspaceName}`))}),U.command("set-url <url>").description("Set the base URL for BRICKS API").action(e=>{(0,M.setBaseUrl)(e),console.log(L.Ay.green(`Base URL set to: ${e}`))});var H,q,K,W,Q,Y=c(7336),X=()=>{var e=(0,M.getCurrentProfile)(),t=(0,M.getToken)(e);return t||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,$.createClient)((0,M.getBaseUrl)(),t)},J=e=>{if(!e)return L.Ay.gray("○ Unknown");var t=Date.now()-new Date(e).getTime();if(t<=3e5)return L.Ay.green("● Online");var a=Math.floor(t/6e4);if(a<60)return L.Ay.yellow(`○ Offline (${a}m ago)`);var n=Math.floor(a/60);if(n<24)return L.Ay.red(`○ Offline (${n}h ago)`);var r=Math.floor(n/24);return L.Ay.red(`○ Offline (${r}d ago)`)},Z=new P("device").description("Device management");Z.command("list").description("List all devices").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=X(),a=(0,G.default)("Fetching devices...").start();try{var n=yield t.devices({keyword:e.keyword});if(a.stop(),e.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(L.Ay.yellow("No devices found"));console.log(L.Ay.bold("\nDevices")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,a=J(t),n=e.entry_detail?.application?.name||L.Ay.gray("No app bound");console.log(`${a} ${L.Ay.cyan(e.name||e.device_name)}`),console.log(` ID: ${L.Ay.gray(e._id)}`),console.log(` App: ${n}`),console.log()})}catch(e){a.fail(`Failed to list devices: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),Z.command("get <id>").description("Get device details").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=X(),n=(0,G.default)("Fetching device...").start();try{var r=yield a.device({id:e});if(n.stop(),r||(console.log(L.Ay.red("Device not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));var i=r.entry_detail?.watch_dog_timer?.last_alive_time,o=J(i);if(console.log(L.Ay.bold(`\nDevice: ${r.name||r.device_name}`)),console.log("─".repeat(60)),console.log(`Status: ${o}`),console.log(`ID: ${L.Ay.gray(r._id)}`),console.log(`Device Name: ${r.device_name||L.Ay.gray("N/A")}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.tags?.join(", ")||L.Ay.gray("None")}`),console.log(`Created: ${L.Ay.gray(r.create_datetime||"N/A")}`),console.log(`Modified: ${L.Ay.gray(r.last_modify_datetime||"N/A")}`),r.entry_detail){var s=r.entry_detail;if(console.log(`\n${L.Ay.bold("Entry Details")}`),console.log(`Type: ${s.type||L.Ay.gray("N/A")}`),console.log(`Unique ID: ${L.Ay.gray(s.unique_id||"N/A")}`),console.log(`Version: ${s.operation_version||L.Ay.gray("N/A")}`),console.log(`Mode: ${s.operation_mode||L.Ay.gray("N/A")}`),Array.isArray(s.screen)&&s.screen.length>0)console.log(`\n${L.Ay.bold("Screens")} (${s.screen.length})`),s.screen.forEach((e,t)=>{var a=e.resolution,n=a?`${a.width}x${a.height} @${a.scale}x`:"N/A",r=e.master?L.Ay.green(" (master)"):"",i=e.orientation?` [${e.orientation}]`:"",o=e.touch?.available?L.Ay.cyan(` touch:${e.touch.touch_point}pt`):"";console.log(` ${t+1}. ${e.title||"Screen"}${r}${i} - ${n}${o}`)});else if(s.screen?.resolution){var p=s.screen.resolution;console.log(`Resolution: ${p.width}x${p.height} @${p.scale}x`)}var l=null!=s.memory_usage,u=null!=s.disk_usage;if(l||u){if(console.log(`\n${L.Ay.bold("System Resources")}`),l){var d=Array.isArray(s.memory_usage)?s.memory_usage[0]:s.memory_usage,c=Math.round(100*d),m=L.Ay.green;c>80?m=L.Ay.red:c>60&&(m=L.Ay.yellow),console.log(`Memory: ${m(`${c}%`)}`)}if(u){var f=Array.isArray(s.disk_usage)?s.disk_usage[0]:s.disk_usage,h=Math.round(100*f),_=L.Ay.green;h>90?_=L.Ay.red:h>75&&(_=L.Ay.yellow),console.log(`Disk: ${_(`${h}%`)}`)}}var y=[];if(s.sound?.available&&y.push("Sound"),s.camera?.available&&y.push("Camera"),s.audio_in?.available&&y.push("Audio Input"),y.length>0&&(console.log(`\n${L.Ay.bold("Capabilities")}`),console.log(`Available: ${y.join(", ")}`),s.camera?.channel?.length>0&&s.camera.channel.forEach(e=>{var t=e.resolution?`${e.resolution.width}x${e.resolution.height}`:"";console.log(` Camera: ${e.title||"Camera"} ${t} [${e.orientation||"N/A"}]`)})),s.local_sync){var E=s.local_sync;console.log(`\n${L.Ay.bold("Local Sync")}`),console.log(`Role: ${E.is_main?L.Ay.cyan("Main"):"Secondary"}`),null!=E.peer_count&&console.log(`Peers: ${E.peer_count}`),null!=E.mean_latency&&console.log(`Latency: ${E.mean_latency.toFixed(2)}ms`)}if(s.update){var T=s.update;console.log(`\n${L.Ay.bold("Update Status")}`),console.log(`Needs Update: ${T.need_update?L.Ay.yellow("Yes"):L.Ay.green("No")}`),T.current_version&&console.log(`App Version: ${T.current_version}`),T.running_mode&&console.log(`Running Mode: ${T.running_mode}`),T.last_update_at&&console.log(`Last Update: ${L.Ay.gray(T.last_update_at)}`)}if(s.watch_dog_timer){var g=s.watch_dog_timer;console.log(`\n${L.Ay.bold("Watchdog")}`),console.log(`Alive: ${g.alive?L.Ay.green("Yes"):L.Ay.red("No")}`),g.last_launch_time&&console.log(`Last Launch: ${L.Ay.gray(g.last_launch_time)}`),g.last_alive_time&&console.log(`Last Alive: ${L.Ay.gray(g.last_alive_time)}`)}}r.bound_application&&(console.log(`\n${L.Ay.bold("Bound Application")}`),console.log(`Name: ${r.bound_application.name}`),console.log(`ID: ${L.Ay.gray(r.bound_application._id)}`)),r.env?.variables&&Object.keys(r.env.variables).length>0&&(console.log(`\n${L.Ay.bold("Environment Variables")}`),Object.entries(r.env.variables).forEach(([e,t])=>{console.log(` ${L.Ay.cyan(e)}: ${t}`)})),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get device: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),Z.command("bind <passcode>").description("Bind a new device using passcode").option("-n, --name <name>","Device name").action(function(){var e=b(function*(e,t){var a=X(),n=(0,G.default)("Checking passcode...").start();try{var r=yield a.checkBindDevicePasscode({passcode:e});r||(n.fail("Invalid passcode or expired"),process.exit(1)),n.text="Binding device...";var i=yield a.createDevice({bindPasscode:e,name:t.name||r.payload?.deviceName||"CLI Device",deviceName:r.payload?.deviceName});n.succeed(`Device bound successfully: ${L.Ay.green(i.name)}`),console.log(L.Ay.gray(`Device ID: ${i._id}`))}catch(e){n.fail(`Failed to bind device: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),Z.command("control <id> <type>").description("Control a device").option("-p, --payload <json>","Event payload as JSON").action((H=b(function*(e,t,a){var n=X(),r=(0,G.default)(`Sending ${t} to device...`).start();try{var i;a.payload&&(i=JSON.parse(a.payload)),yield n.controlDevice({id:e,type:t,eventPayload:i}),r.succeed(`Control event sent: ${L.Ay.green(t)}`)}catch(e){r.fail(`Failed to control device: ${e.message}`),process.exit(1)}}),function(e,t,a){return H.apply(this,arguments)})),Z.command("refresh <id>").description("Refresh device application").action((q=b(function*(e){var t=X(),a=(0,G.default)("Refreshing device...").start();try{yield t.controlDevice({id:e,type:"refresh"}),a.succeed("Device refreshed")}catch(e){a.fail(`Failed to refresh device: ${e.message}`),process.exit(1)}}),function(e){return q.apply(this,arguments)})),Z.command("clear-cache <id>").description("Clear device cache").action((K=b(function*(e){var t=X(),a=(0,G.default)("Clearing cache...").start();try{yield t.controlDevice({id:e,type:"clear-cache"}),a.succeed("Cache cleared")}catch(e){a.fail(`Failed to clear cache: ${e.message}`),process.exit(1)}}),function(e){return K.apply(this,arguments)})),Z.command("screenshot <id>").description("Take device screenshot and save to file").option("-o, --output <path>","Output file path").option("--no-take","Only fetch existing screenshot without taking a new one").action((W=b(function*(e,t){var a=X(),n=(0,G.default)("Fetching workspace info...").start();try{var r=yield a.workspace();r?.media_resource?.enable_media_workspace||(n.fail("Media workspace is not enabled for this workspace"),process.exit(1)),r.media_resource.system_media_box_id||(n.fail("No media box configured for this workspace"),process.exit(1)),!1!==t.take&&(n.text="Sending screenshot request to device...",yield a.controlDevice({id:e,type:"take-screenshot"}),n.text="Waiting for device to capture screenshot...",yield new Promise(e=>setTimeout(e,3e3))),n.text="Fetching screenshot...";var i=yield(0,Y.he)(a,r,e,t.output);if(i.error&&(n.fail(i.error),process.exit(1)),n.succeed("Screenshot saved"),console.log(),console.log(L.Ay.bold("Screenshot saved to:")),console.log(L.Ay.cyan(i.path)),console.log(),i.file?.meta){var o=i.file.meta,s=o.originalWidth,p=o.originalHeight,l=o.originalFileSize;if(s&&p&&console.log(`${L.Ay.gray("Size:")} ${s}x${p}`),l){var u=(l/1024).toFixed(1);console.log(`${L.Ay.gray("File:")} ${u} KB`)}}i.file?.updatedAt&&console.log(`${L.Ay.gray("Updated:")} ${new Date(i.file.updatedAt).toLocaleString()}`)}catch(e){n.fail(`Failed to get screenshot: ${e.message}`),process.exit(1)}}),function(e,t){return W.apply(this,arguments)})),Z.command("monitor").description("Monitor device status (polls every 60s)").option("-g, --group <id>","Monitor devices in a group").option("-i, --interval <seconds>","Polling interval in seconds","60").action((Q=b(function*(e){var t=X(),a=1e3*parseInt(e.interval,10);console.log(L.Ay.bold("\nDevice Monitor")),console.log(L.Ay.gray(`Polling every ${e.interval}s. Press Ctrl+C to stop.\n`));var n,r=(n=b(function*(){try{var a;if(a=e.group?yield t.devicesByGroup({id:e.group}):yield t.devices({}),process.stdout.write(""),console.log(L.Ay.bold("Device Monitor")+L.Ay.gray(` - ${(new Date).toLocaleTimeString()}`)),console.log("─".repeat(80)),!a||0===a.length)return void console.log(L.Ay.yellow("No devices found"));a.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,a=J(t),n=e.name||e.device_name||e.device_target_name,r=e.entry_detail?.application?.name||L.Ay.gray("No app");console.log(`${a} ${L.Ay.cyan(n.padEnd(25))} ${r}`)}),console.log(`\n${L.Ay.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(L.Ay.red(`Error: ${e.message}`))}}),function(){return n.apply(this,arguments)});yield r(),setInterval(r,a)}),function(e){return Q.apply(this,arguments)}));var ee,te,ae=c(9896),ne=c(5704),re=()=>{var e=(0,M.getCurrentProfile)(),t=(0,M.getToken)(e);return t||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,$.createClient)((0,M.getBaseUrl)(),t)},ie=new P("app").description("Application management");ie.command("list").description("List all applications").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=re(),a=(0,G.default)("Fetching applications...").start();try{var n=yield t.applications({keyword:e.keyword});if(a.stop(),e.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(L.Ay.yellow("No applications found"));console.log(L.Ay.bold("\nApplications")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.has_unreleased_changes?L.Ay.yellow("●"):L.Ay.green("●"),a=e.current_version?`v${e.current_version}`:L.Ay.gray("no version");console.log(`${t} ${L.Ay.cyan(e.name)} ${L.Ay.gray(a)}`),console.log(` ID: ${L.Ay.gray(e._id)}`),e.description&&console.log(` ${L.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list applications: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),ie.command("get <id>").description("Get application details").option("-c, --composed","Get composed configuration").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=re(),n=(0,G.default)("Fetching application...").start();try{var r=yield a.application({id:e,composed:t.composed});if(n.stop(),r||(console.log(L.Ay.red("Application not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));if(console.log(L.Ay.bold(`\nApplication: ${r.name}`)),console.log("─".repeat(60)),console.log(`ID: ${L.Ay.gray(r._id)}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.tags?.join(", ")||L.Ay.gray("None")}`),console.log(`Created: ${L.Ay.gray(r.create_datetime)}`),console.log(`Modified: ${L.Ay.gray(r.last_modify_datetime)}`),console.log(`\n${L.Ay.bold("Version")}`),r.current_version){if(console.log(`Current: v${r.current_version}`),r.current_version_details){var i=r.current_version_details;i.name&&console.log(`Release Name: ${i.name}`),i.note&&console.log(`Release Note: ${L.Ay.gray(i.note)}`),i.create_datetime&&console.log(`Released At: ${L.Ay.gray(i.create_datetime)}`)}}else console.log(`Current: ${L.Ay.gray("No version")}`);if(console.log(`Unreleased: ${r.has_unreleased_changes?L.Ay.yellow("Yes"):L.Ay.green("No")}`),console.log(`\n${L.Ay.bold("Features")}`),console.log(`Short Edit: ${r.short_edit?.enabled?L.Ay.green("Enabled"):L.Ay.gray("Disabled")}`),r.short_edit?.enabled&&r.short_edit.ref_map){var o=Object.keys(r.short_edit.ref_map).length;console.log(` References: ${o} editable properties`)}console.log(`Automation: ${r.canvas_control?.enable_schedule?L.Ay.green("Scheduled"):L.Ay.gray("No schedule")}`),r.lock?.locked&&console.log(`Locked: ${L.Ay.yellow("Yes")} (at ${r.lock.locked_at||"N/A"})`),r.sync_key&&console.log(`Sync Key: ${L.Ay.gray(r.sync_key)}`),r.devices?.length>0?(console.log(`\n${L.Ay.bold("Bound Devices")} (${r.devices.length})`),r.devices.forEach(e=>{var t="active"===e.status?L.Ay.green("●"):L.Ay.gray("○"),a=e.frame?L.Ay.gray(` [${e.frame.x||0},${e.frame.y||0} ${e.frame.width}x${e.frame.height}]`):"";console.log(` ${t} ${e.device_id}${a}`)})):console.log(`\n${L.Ay.bold("Bound Devices")}: ${L.Ay.gray("None")}`),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get application: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("update <id>").description("Update application").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("-c, --config <json>","Application config as JSON string").option("-f, --file <path>","Application config from file").option("--validate","Validate configuration").action(function(){var e=b(function*(e,t){var a=re(),n=(0,G.default)("Updating application...").start();try{var r={id:e};t.name&&(r.name=t.name),t.description&&(r.description=t.description),t.validate&&(r.validateConfig=!0),t.config?r.config=t.config:t.file&&(r.config=ae.readFileSync(t.file,"utf-8"));var i=yield a.updateApplication(r);n.succeed(`Application updated: ${L.Ay.green(i.name)}`),i.has_unreleased_changes&&console.log(L.Ay.yellow("Note: Application has unreleased changes"))}catch(e){n.fail(`Failed to update application: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("short-edit <id>").description("Short edit application properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action(function(){var e=b(function*(e,t){var a=re(),n=(0,G.default)("Applying short edit...").start();try{var r=JSON.parse(t.list);Array.isArray(r)||(n.fail("List must be a JSON array"),process.exit(1));var i=yield a.shortEditApplication({id:e,list:r});n.succeed(`Short edit applied to: ${L.Ay.green(i.name)}`)}catch(e){n.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("short-refs <id>").description("List short edit references for an application").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=re(),n=(0,G.default)("Fetching short edit references...").start();try{var r=yield a.application({id:e});if(n.stop(),!r?.short_edit?.enabled)return void console.log(L.Ay.yellow("Short Edit is not enabled for this application"));var i=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,ne.V)(r.short_edit.ref_map,{keyword:t.keyword,types:i});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(L.Ay.yellow("No short edit references found"));console.log(L.Ay.bold(`\nShort Edit References: ${r.name}`)),o.forEach(e=>{console.log(L.Ay.cyan(`\n${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?L.Ay.gray(`- ${t.title}`):"";console.log(` ${L.Ay.green(e)} ${a}`)})}),console.log()}catch(e){n.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").action(function(){var e=b(function*(e,t){var a=re(),n=(0,G.default)("Updating device bindings...").start();try{var r={id:e};t.bind&&(r.bindDevices=t.bind.split(",").map(e=>e.trim())),t.unbind&&(r.unbindDevices=t.unbind.split(",").map(e=>e.trim())),yield a.bindApplication(r),n.succeed("Device bindings updated")}catch(e){n.fail(`Failed to update bindings: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action(function(){var e=b(function*(e,t,a){var n=re(),r=(0,G.default)("Triggering automation...").start();try{yield n.triggerApplicationCanvasControl({id:e,testId:t,play:!a.stop&&a.play,setupAtLaunch:a.setupAtLaunch,matchGroup:a.matchGroup}),r.succeed(`Automation triggered: ${L.Ay.green(t)}`)}catch(e){r.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}});return function(t,a,n){return e.apply(this,arguments)}}()),ie.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=re(),n=t.json?null:(0,G.default)("Releasing application...").start();try{var r=t.config;(t.config.endsWith(".json")||t.config.includes("/"))&&(ae.existsSync(t.config)||(n?n.fail(`Config file not found: ${t.config}`):console.error(JSON.stringify({error:`Config file not found: ${t.config}`})),process.exit(1)),r=ae.readFileSync(t.config,"utf-8"));var i=yield a.application({id:e});i||(n?n.fail("Application not found"):console.error(JSON.stringify({error:"Application not found"})),process.exit(1)),i.lock?.enabled&&(n?n.fail("Application is locked"):console.error(JSON.stringify({error:"Application is locked"})),process.exit(1));var o=t.version||i.name||"Untitled",s=t.changelogs?`${t.changelogs}\n\nRelease by BRICKS CLI`:"Release by BRICKS CLI";yield a.releaseApplication({id:e,config:r,releaseCurrentVersion:o,releaseCurrentVersionNote:s}),t.json?console.log(JSON.stringify({success:!0,name:i.name})):n.succeed(`Application released: ${L.Ay.green(i.name)}`)}catch(e){t.json?console.error(JSON.stringify({error:e.message})):n.fail(`Failed to release application: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ie.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((ee=b(function*(e,t){var a=re(),n=t.json?null:(0,G.default)("Pulling application project...").start();try{var r=yield a.applicationProject({id:e,buildApplicationOnly:!0});r||(n?n.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(r)):(n.succeed(`Application project fetched: ${L.Ay.green(r.files?.length||0)} files`),console.log(JSON.stringify(r,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):n.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return ee.apply(this,arguments)})),ie.command("project-init <id>").description("Initialize a BRICKS Project from an application").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((te=b(function*(e,t){var a=(yield Promise.all([c.e(356),c.e(465)]).then(c.bind(c,6465))).initProject;yield a("application",e,t)}),function(e,t){return te.apply(this,arguments)}));var oe=()=>{var e=(0,M.getCurrentProfile)(),t=(0,M.getToken)(e);return t||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,$.createClient)((0,M.getBaseUrl)(),t)},se=new P("module").description("Module management");se.command("list").description("List all modules").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=oe(),a=(0,G.default)("Fetching modules...").start();try{var n=yield t.modules({keyword:e.keyword});if(a.stop(),e.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(L.Ay.yellow("No modules found"));console.log(L.Ay.bold("\nModules")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.current_version?`v${e.current_version}`:L.Ay.gray("no version");console.log(`● ${L.Ay.cyan(e.name)} ${L.Ay.gray(t)}`),console.log(` ID: ${L.Ay.gray(e._id)}`),e.description&&console.log(` ${L.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list modules: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),se.command("get <id>").description("Get module details").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=oe(),n=(0,G.default)("Fetching module...").start();try{var r=yield a.module({id:e});if(n.stop(),r||(console.log(L.Ay.red("Module not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));if(console.log(L.Ay.bold(`\nModule: ${r.name}`)),console.log("─".repeat(60)),console.log(`ID: ${L.Ay.gray(r._id)}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.tags?.join(", ")||L.Ay.gray("None")}`),console.log(`Created: ${L.Ay.gray(r.create_datetime)}`),console.log(`Modified: ${L.Ay.gray(r.last_modify_datetime)}`),console.log(`\n${L.Ay.bold("Version")}`),console.log(`Current: ${r.current_version?`v${r.current_version}`:L.Ay.gray("No version")}`),console.log(`Unreleased: ${r.has_unreleased_changes?L.Ay.yellow("Yes"):L.Ay.green("No")}`),console.log(`\n${L.Ay.bold("Settings")}`),console.log(`Public: ${r.is_public?L.Ay.green("Yes"):L.Ay.gray("No")}`),console.log(`Allow Modify: ${r.is_allow_modify?L.Ay.green("Yes"):L.Ay.gray("No")}`),console.log(`Short Edit: ${r.short_edit?.enabled?L.Ay.green("Enabled"):L.Ay.gray("Disabled")}`),r.short_edit?.enabled&&r.short_edit.ref_map){var i=Object.keys(r.short_edit.ref_map).length;console.log(` References: ${i} editable properties`)}null!=r.use_count?.total_count&&(console.log(`\n${L.Ay.bold("Usage")}`),console.log(`Used In: ${r.use_count.total_count} application(s)`)),r.expose_properties?.length>0&&(console.log(`\n${L.Ay.bold("Exposed Properties")} (${r.expose_properties.length})`),r.expose_properties.forEach(e=>{console.log(` - ${L.Ay.cyan(e)}`)})),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get module: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("update <id>").description("Update module").option("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("-c, --config <json>","Module config as JSON string").option("-f, --file <path>","Module config from file").option("--validate","Validate configuration").action(function(){var e=b(function*(e,t){var a=oe(),n=(0,G.default)("Updating module...").start();try{var r={id:e};t.name&&(r.name=t.name),t.description&&(r.description=t.description),t.validate&&(r.validateConfig=!0),t.config?r.config=t.config:t.file&&(r.config=ae.readFileSync(t.file,"utf-8"));var i=yield a.updateModule(r);n.succeed(`Module updated: ${L.Ay.green(i.name)}`)}catch(e){n.fail(`Failed to update module: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("short-edit <id>").description("Short edit module properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action(function(){var e=b(function*(e,t){var a=oe(),n=(0,G.default)("Applying short edit...").start();try{var r=JSON.parse(t.list);Array.isArray(r)||(n.fail("List must be a JSON array"),process.exit(1));var i=yield a.shortEditModule({id:e,list:r});n.succeed(`Short edit applied to: ${L.Ay.green(i.name)}`)}catch(e){n.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("short-refs <id>").description("List short edit references for a module").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=oe(),n=(0,G.default)("Fetching short edit references...").start();try{var r=yield a.module({id:e});if(n.stop(),!r?.short_edit?.enabled)return void console.log(L.Ay.yellow("Short Edit is not enabled for this module"));var i=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,ne.V)(r.short_edit.ref_map,{keyword:t.keyword,types:i});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(L.Ay.yellow("No short edit references found"));console.log(L.Ay.bold(`\nShort Edit References: ${r.name}`)),o.forEach(e=>{console.log(L.Ay.cyan(`\n${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?L.Ay.gray(`- ${t.title}`):"";console.log(` ${L.Ay.green(e)} ${a}`)})}),console.log()}catch(e){n.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=oe(),n=t.json?null:(0,G.default)("Releasing module...").start();try{var r=t.config;(t.config.endsWith(".json")||t.config.includes("/"))&&(ae.existsSync(t.config)||(n?n.fail(`Config file not found: ${t.config}`):console.error(JSON.stringify({error:`Config file not found: ${t.config}`})),process.exit(1)),r=ae.readFileSync(t.config,"utf-8"));var i=yield a.module({id:e});i||(n?n.fail("Module not found"):console.error(JSON.stringify({error:"Module not found"})),process.exit(1)),i.is_public&&(n?n.fail("Public module deployment is temporarily not recommended"):console.error(JSON.stringify({error:"Public module deployment is temporarily not recommended"})),process.exit(1));var o=t.version||i.name||"Untitled",s=t.changelogs?`${t.changelogs}\n\nRelease by BRICKS CLI`:"Release by BRICKS CLI";yield a.releaseModule({id:e,config:r,releaseCurrentVersion:o,releaseCurrentVersionNote:s}),t.json?console.log(JSON.stringify({success:!0,name:i.name})):n.succeed(`Module released: ${L.Ay.green(i.name)}`)}catch(e){t.json?console.error(JSON.stringify({error:e.message})):n.fail(`Failed to release module: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action(function(){var e=b(function*(e,t){var a=oe(),n=t.json?null:(0,G.default)("Pulling module project...").start();try{var r=yield a.moduleProject({id:e,buildApplicationOnly:!0});r||(n?n.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(r)):(n.succeed(`Module project fetched: ${L.Ay.green(r.files?.length||0)} files`),console.log(JSON.stringify(r,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):n.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),se.command("project-init <id>").description("Initialize a BRICKS Project from a module").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action(function(){var e=b(function*(e,t){var a=(yield Promise.all([c.e(356),c.e(465)]).then(c.bind(c,6465))).initProject;yield a("module",e,t)});return function(t,a){return e.apply(this,arguments)}}());var pe=c(8832),le=()=>{var e=(0,M.getCurrentProfile)(),t=(0,M.getToken)(e);return t||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,$.createClient)((0,M.getBaseUrl)(),t)},ue=3e5,de=e=>{if(!e)return L.Ay.gray("○");var t=Date.now()-new Date(e).getTime();return t<=ue?L.Ay.green("●"):Math.floor(t/6e4)<60?L.Ay.yellow("○"):L.Ay.red("○")},ce=new P("group").description("Device Group management");ce.command("list").description("List all device groups").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=le(),a=(0,G.default)("Fetching device groups...").start();try{var n=yield t.deviceGroups({});if(a.stop(),e.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(L.Ay.yellow("No device groups found"));console.log(L.Ay.bold("\nDevice Groups")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${L.Ay.cyan(e.name)} ${L.Ay.gray(`(${t} devices)`)}`),console.log(` ID: ${L.Ay.gray(e._id)}`),e.description&&console.log(` ${L.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list groups: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),ce.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=le(),n=(0,G.default)("Fetching device group...").start();try{var r=yield a.deviceGroup({id:e});if(n.stop(),r||(console.log(L.Ay.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));console.log(L.Ay.bold(`\nDevice Group: ${r.name}`)),console.log("─".repeat(60)),console.log(`ID: ${L.Ay.gray(r._id)}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.tags?.join(", ")||L.Ay.gray("None")}`),console.log(`Created: ${L.Ay.gray(r.create_datetime)}`),console.log(`Modified: ${L.Ay.gray(r.last_modify_datetime)}`),r.devices?.length>0&&(console.log(`\n${L.Ay.bold("Devices")} (${r.devices.length})`),r.devices.forEach(e=>{var t=e.device_target_name||e.device_id;console.log(` - ${t} ${L.Ay.gray(`(${e.device_id})`)}`)})),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get group: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ce.command("devices <id>").description("List devices in a group with status").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=le(),n=(0,G.default)("Fetching devices...").start();try{var r=yield a.devicesByGroup({id:e});if(n.stop(),t.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(L.Ay.yellow("No devices in this group"));console.log(L.Ay.bold("\nDevices in Group")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,a=de(t),n=e.name||e.device_name||e.device_target_name,r=e.entry_detail?.application?.name||L.Ay.gray("No app");console.log(`${a} ${L.Ay.cyan(n.padEnd(30))} ${r}`)}),console.log("─".repeat(80))}catch(e){n.fail(`Failed to get devices: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ce.command("dispatch <id> <action>").description("Dispatch action to all devices in group").action(function(){var e=b(function*(e,t){var a=le(),n=(0,G.default)(`Dispatching ${t}...`).start(),r=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"];r.includes(t)||(n.fail(`Invalid action. Valid actions: ${r.join(", ")}`),process.exit(1));try{var i=yield a.dispatchDeviceGroupAction({id:e,action:t});n.succeed(`Action dispatched: ${L.Ay.green(t)}`),i&&(console.log(`Success: ${L.Ay.green(i.success||0)}`),console.log(`Failed: ${L.Ay.red(i.failed||0)}`))}catch(e){n.fail(`Failed to dispatch action: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ce.command("refresh <id>").description("Refresh all devices in group").action(function(){var e=b(function*(e){var t=le(),a=(0,G.default)("Refreshing devices...").start();try{var n=yield t.dispatchDeviceGroupAction({id:e,action:"refresh"});a.succeed("Devices refreshed"),n&&(console.log(`Success: ${L.Ay.green(n.success||0)}`),console.log(`Failed: ${L.Ay.red(n.failed||0)}`))}catch(e){a.fail(`Failed to refresh: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),ce.command("monitor <id>").description("Monitor devices in group (polls every 60s)").option("-i, --interval <seconds>","Polling interval in seconds","60").action(function(){var e=b(function*(e,t){var a=le(),n=1e3*parseInt(t.interval,10);console.log(L.Ay.bold("\nDevice Group Monitor")),console.log(L.Ay.gray(`Polling every ${t.interval}s. Press Ctrl+C to stop.\n`));var r=function(){var t=b(function*(){try{var t=yield Promise.all([a.deviceGroup({id:e}),a.devicesByGroup({id:e})]),n=pe(t,2),r=n[0],i=n[1];if(process.stdout.write(""),console.log(L.Ay.bold(`Device Group: ${r.name}`)+L.Ay.gray(` - ${(new Date).toLocaleTimeString()}`)),console.log("─".repeat(80)),!i||0===i.length)return void console.log(L.Ay.yellow("No devices in this group"));var o=0,s=0;i.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,a=de(t),n=e.name||e.device_name||e.device_target_name,r=e.entry_detail?.application?.name||L.Ay.gray("No app");t&&Date.now()-new Date(t).getTime()<=ue?o++:s++,console.log(`${a} ${L.Ay.cyan(n.padEnd(30))} ${r}`)}),console.log("─".repeat(80)),console.log(`Online: ${L.Ay.green(o)} Offline: ${L.Ay.red(s)}`),console.log(`\n${L.Ay.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(L.Ay.red(`Error: ${e.message}`))}});return function(){return t.apply(this,arguments)}}();yield r(),setInterval(r,n)});return function(t,a){return e.apply(this,arguments)}}());const me=t("fs/promises");var fe=c(6928),he=c(6090),_e=()=>{var e=(0,M.getCurrentProfile)(),t=(0,M.getToken)(e);return t||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,$.createClient)((0,M.getBaseUrl)(),t)},ye=function(){var e=b(function*(e){var t=yield e.workspace();if(!(0,Y.wR)(t))throw new Error("Media workspace not enabled for this workspace")});return function(t){return e.apply(this,arguments)}}(),Ee=e=>{var t=e.meta||{};if(!t.originalFileUploaded)return{ready:!1,label:"Uploading"};if("Video"===e.fileType){if(!t.videoThumbOriginalFileKey)return{ready:!1,label:"Processing"};if(!t.convertedFileUploaded)return{ready:!1,label:"Transcoding"}}return{ready:!0,label:"Ready"}},Te=e=>e.ready?L.Ay.green(e.label):L.Ay.yellow(e.label),ge=new P("media").description("Media Flow support");ge.command("boxes").description("List Media Flow boxes").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=_e(),a=(0,G.default)("Fetching media boxes...").start();try{yield ye(t);var n=yield t.mediaBoxes();if(a.stop(),e.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(L.Ay.yellow("No media boxes found"));console.log(L.Ay.bold("\nMedia Boxes")),console.log("─".repeat(80)),n.forEach(e=>{console.log(`${L.Ay.cyan(e.name||"Unnamed")} ${L.Ay.gray(e.id)}`),e.description&&console.log(` ${e.description}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),null!=e.size&&console.log(` Size: ${e.size}`),console.log()})}catch(e){a.fail(`Failed to list media boxes: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),ge.command("box <id>").description("Get Media Flow box details").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=_e(),n=(0,G.default)("Fetching media box...").start();try{yield ye(a);var r=yield a.mediaBox({id:e});if(n.stop(),r||(console.log(L.Ay.red("Media box not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));console.log(L.Ay.bold(`\nMedia Box: ${r.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${L.Ay.gray(r.id)}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.tags?.join(", ")||L.Ay.gray("None")}`),null!=r.size&&console.log(`Size: ${r.size}`),r.passcodes?.length&&(console.log(`\n${L.Ay.bold("Passcodes")}`),r.passcodes.forEach(e=>{console.log(`- ${e.name||"Passcode"}: ${e.code}`)})),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get media box: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ge.command("files <boxId>").description("List Media Flow files in a box").option("-t, --types <types>","Comma-separated file types to include").option("-u, --user-tag <tag>","Filter by user tag (repeatable)",(e,t)=>[...t,e],[]).option("-l, --limit <limit>","Limit results",e=>Number.parseInt(e,10)).option("-o, --offset <offset>","Offset results",e=>Number.parseInt(e,10)).option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=_e(),n=(0,G.default)("Fetching media files...").start();try{yield ye(a);var r=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):void 0,i=t.userTag?.length?t.userTag:void 0,o=yield a.mediaFiles({boxId:e,includeTypes:r,userTags:i,limit:t.limit,offset:t.offset});if(n.stop(),t.json)return void console.log(JSON.stringify(o,null,2));if(!o||0===o.length)return void console.log(L.Ay.yellow("No media files found"));console.log(L.Ay.bold(`\nMedia Files (${o.length})`)),console.log("─".repeat(100)),o.forEach(e=>{var t=Ee(e);console.log(`${L.Ay.cyan(e.name||"Unnamed")} ${L.Ay.gray(e.id)}`),console.log(` Type: ${e.fileType} Status: ${Te(t)}`),e.userTags?.length&&console.log(` Tags: ${e.userTags.join(", ")}`),e.updatedAt&&console.log(` Updated: ${new Date(e.updatedAt).toLocaleString()}`),console.log()})}catch(e){n.fail(`Failed to list media files: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}()),ge.command("file <id>").description("Get Media Flow file details").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e,t){var a=_e(),n=(0,G.default)("Fetching media file...").start();try{yield ye(a);var r=yield a.mediaFile({id:e});if(n.stop(),r||(console.log(L.Ay.red("Media file not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(r,null,2));var i=Ee(r);console.log(L.Ay.bold(`\nMedia File: ${r.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${L.Ay.gray(r.id)}`),console.log(`Box ID: ${L.Ay.gray(r.boxId)}`),console.log(`Type: ${r.fileType}`),console.log(`Status: ${Te(i)}`),console.log(`Description: ${r.description||L.Ay.gray("N/A")}`),console.log(`Tags: ${r.userTags?.join(", ")||L.Ay.gray("None")}`),console.log(`Created: ${L.Ay.gray(r.createdAt||"N/A")}`),console.log(`Updated: ${L.Ay.gray(r.updatedAt||"N/A")}`);var o=(0,Y.Gu)(r),s=(0,Y.Gu)(r,{preferThumbnail:!0});r.meta?.originalFileKey&&console.log(`Original Key: ${L.Ay.gray(r.meta.originalFileKey)}`),o&&console.log(`Original URL: ${L.Ay.gray(o)}`),s&&s!==o&&console.log(`Thumbnail URL: ${L.Ay.gray(s)}`),console.log("─".repeat(60))}catch(e){n.fail(`Failed to get media file: ${e.message}`),process.exit(1)}});return function(t,a){return e.apply(this,arguments)}}());var ve,Re=e=>{var t=e.match(/^(\d+)x(\d+)(?::(\w+))?$/);if(!t)throw new Error(`Invalid image version spec: "${e}". Expected format: WxH or WxH:STRATEGY`);return{width:parseInt(t[1],10),height:parseInt(t[2],10),strategy:(t[3]||"FILL").toUpperCase(),copypreview:!1}},be=function(){var e=b(function*(e,t,a,n,r){var i=new FormData;for(var o of Object.entries(t)){var s=pe(o,2),p=s[0],l=s[1];i.append(p,l)}i.append("file",new Blob([a],{type:r}),n);var u=yield fetch(e,{method:"POST",body:i});if(!u.ok&&204!==u.status){var d=yield u.text().catch(()=>"");throw new Error(`S3 upload failed (${u.status}): ${d}`)}});return function(t,a,n,r,i){return e.apply(this,arguments)}}(),Oe=function(){var e=b(function*(e,t,a){var n=[],r=0,i=function(){var t=b(function*(){for(;r<e.length;){var t=r++;n[t]=yield a(e[t],t)}});return function(){return t.apply(this,arguments)}}(),o=Array.from({length:Math.min(t,e.length)},()=>i());return yield Promise.all(o),n});return function(t,a,n){return e.apply(this,arguments)}}();ge.command("upload <boxId> <files...>").description("Upload file(s) to a Media Flow box").option("-d, --description <text>","File description","").option("-t, --user-tag <tag>","User tag (repeatable, max 15)",(e,t)=>[...t,e],[]).option("--image-version <spec>","Image resize spec as WxH or WxH:STRATEGY (repeatable)",(e,t)=>[...t,e],[]).option("--image-version-type <type>","Image output format: jpg or png").option("--enable-ai-analysis","Enable AI analysis on uploaded files").option("--ai-instruction <text>","Custom AI analysis instruction").option("--concurrency <n>","Max concurrent uploads",e=>parseInt(e,10),3).option("-j, --json","Output as JSON").action((ve=b(function*(e,t,a){var n,r,i=_e(),o=(0,G.default)("Preparing upload...").start();try{if(yield ye(i),a.userTag.length>15)throw new Error("Maximum 15 user tags allowed");var s=a.imageVersion.map(Re),p=a.enableAiAnalysis||!!a.aiInstruction,l=yield Promise.all(t.map((r=b(function*(e){var t=(0,fe.resolve)(e),a=yield(0,me.stat)(t).catch(()=>null);if(!a||!a.isFile())throw new Error(`Not a file: ${e}`);var n=(0,fe.basename)(t);return{filePath:t,fileName:n,contentType:(0,he.lookup)(n)||"application/octet-stream",size:a.size}}),function(e){return r.apply(this,arguments)})));o.stop();var u=l.length;console.log(L.Ay.bold(`\nUploading ${u} file${u>1?"s":""} to box ${L.Ay.gray(e)}...\n`));var d=[];yield Oe(l,a.concurrency,(n=b(function*(t,n){var r,o,l=`[${n+1}/${u}] ${t.fileName}`,c=(0,G.default)(`${l} — requesting upload...`).start();try{var m=(o=t.contentType)?"image/svg+xml"===o?"FILE":o.startsWith("image/")?"IMAGE":o.startsWith("video/")?"VIDEO":o.startsWith("audio/")?"AUDIO":"FILE":"FILE",f={imageVersions:"IMAGE"===m?s:[],imageVersionType:"IMAGE"===m?a.imageVersionType:void 0,enableAiAnalysis:p,aiCustomInstruction:a.aiInstruction||void 0},h=yield i.createMediaFileUploadRequest({name:t.fileName,description:a.description,boxId:e,fileType:m,contentType:t.contentType,userTags:a.userTag.length?a.userTag:[],meta:f});c.text=`${l} — uploading to storage...`;var _=JSON.parse(h.meta.uploadInfo),y=yield(0,me.readFile)(t.filePath);yield be(_.url,{AWSAccessKeyId:_.AWSAccessKeyId,"Content-Type":_["Content-Type"],key:_.key,Signature:_.Signature,Policy:_.Policy,acl:_.acl},y,t.fileName,t.contentType),c.succeed(`${l} ${L.Ay.green("✓")} ${L.Ay.gray(`(${m}, ${r=t.size,r<1024?`${r} B`:r<1048576?`${(r/1024).toFixed(1)} KB`:r<1073741824?`${(r/1048576).toFixed(1)} MB`:`${(r/1073741824).toFixed(1)} GB`})`)}`),d.push({file:t.fileName,id:h.id,status:"success",fileType:m,size:t.size})}catch(e){c.fail(`${l} — ${e.message}`),d.push({file:t.fileName,id:null,status:"failed",error:e.message})}}),function(e,t){return n.apply(this,arguments)}));var c=d.filter(e=>"success"===e.status).length,m=d.filter(e=>"failed"===e.status).length;a.json?console.log(JSON.stringify({boxId:e,results:d,summary:{total:u,success:c,failed:m}},null,2)):(console.log(),0===m?console.log(L.Ay.green(`Uploaded ${c}/${u} files`)):console.log(L.Ay.yellow(`Uploaded ${c}/${u} files (${m} failed)`))),m>0&&process.exit(1)}catch(e){o.fail(`Upload failed: ${e.message}`),process.exit(1)}}),function(e,t,a){return ve.apply(this,arguments)}));var Ne,Ae,Se={prod:"https://display.bricks.tools",beta:"https://display-beta.bricks.tools",dev:"http://localhost:3001"},we=e=>{var t=Object.entries(Se).find(([,t])=>e===t);return t?t[0]:null},Ie=new P("config").description("CLI configuration management");Ie.command("endpoint").argument("[environment]","Environment to use (prod, beta, dev)").description("Show or set the API endpoint environment").action(e=>{var t=(0,M.getBaseUrl)(),a=we(t);if(!e)return console.log(L.Ay.bold("\nAPI Endpoint Configuration")),console.log("─".repeat(50)),console.log(`Current URL: ${L.Ay.cyan(t)}`),a?console.log(`Environment: ${L.Ay.green(a)}`):console.log(`Environment: ${L.Ay.yellow("custom")}`),console.log("─".repeat(50)),console.log(L.Ay.gray("\nAvailable environments:")),Object.entries(Se).forEach(([e,a])=>{var n=t===a?L.Ay.green("● "):" ",r=t===a?L.Ay.green(e):e;console.log(`${n}${r.padEnd(8)} ${L.Ay.gray(a)}`)}),console.log(""),void console.log(L.Ay.gray("Usage: bricks config endpoint <prod|beta|dev>"));var n=Object.keys(Se);n.includes(e)||(console.error(L.Ay.red(`Invalid environment: ${e}`)),console.log(L.Ay.gray(`Valid options: ${n.join(", ")}`)),process.exit(1));var r=Se[e];t!==r?((0,M.setBaseUrl)(r),console.log(L.Ay.green(`✓ Endpoint changed to ${e}: ${r}`)),console.log(L.Ay.yellow("\nNote: You may need to re-authenticate if your token is for a different environment.")),console.log(L.Ay.gray("Use `bricks auth status` to check your connection."))):console.log(L.Ay.yellow(`Already using ${e} environment: ${r}`))}),Ie.command("show").description("Show current configuration").option("-j, --json","Output as JSON").action(e=>{var t=(0,M.getBaseUrl)(),a=we(t);e.json?console.log(JSON.stringify({endpoint:t,environment:a||"custom"},null,2)):(console.log(L.Ay.bold("\nBRICKS CLI Configuration")),console.log("─".repeat(50)),console.log(`API Endpoint: ${L.Ay.cyan(t)}`),a?console.log(`Environment: ${L.Ay.green(a)}`):console.log(`Environment: ${L.Ay.yellow("custom")}`),console.log("─".repeat(50)))}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of a)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Ne||(Ne={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ae||(Ae={}));const Ce=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),De=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:null===e?Ce.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Ce.promise:"undefined"!=typeof Map&&e instanceof Map?Ce.map:"undefined"!=typeof Set&&e instanceof Set?Ce.set:"undefined"!=typeof Date&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},Pe=Ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class je extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)a._errors.push(t(r));else{let e=a,n=0;for(;n<r.path.length;){const a=r.path[n];n===r.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(r))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}static assert(e){if(!(e instanceof je))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}je.create=e=>new je(e);const ke=(e,t)=>{let a;switch(e.code){case Pe.invalid_type:a=e.received===Ce.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Pe.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:a=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case Pe.invalid_union:a="Invalid input";break;case Pe.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case Pe.invalid_enum_value:a=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case Pe.invalid_arguments:a="Invalid function arguments";break;case Pe.invalid_return_type:a="Invalid function return type";break;case Pe.invalid_date:a="Invalid date";break;case Pe.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:Ne.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Pe.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Pe.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Pe.custom:a="Invalid input";break;case Pe.invalid_intersection_types:a="Intersection results could not be merged";break;case Pe.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case Pe.not_finite:a="Number must be finite";break;default:a=t.defaultError,Ne.assertNever(e)}return{message:a}};let xe=ke;function Le(){return xe}var Me;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(Me||(Me={}));const Ge=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,i=[...a,...r.path||[]],o={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let s="";const p=n.filter(e=>!!e).slice().reverse();for(const e of p)s=e(o,{data:t,defaultError:s}).message;return{...r,path:i,message:s}};function Fe(e,t){const a=Le(),n=Ge({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===ke?void 0:ke].filter(e=>!!e)});e.common.issues.push(n)}class Be{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return ze;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,n=await e.value;a.push({key:t,value:n})}return Be.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:r}=n;if("aborted"===t.status)return ze;if("aborted"===r.status)return ze;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!n.alwaysSet||(a[t.value]=r.value)}return{status:e.value,value:a}}}const ze=Object.freeze({status:"aborted"}),Ve=e=>({status:"dirty",value:e}),$e=e=>({status:"valid",value:e}),Ue=e=>"aborted"===e.status,He=e=>"dirty"===e.status,qe=e=>"valid"===e.status,Ke=e=>"undefined"!=typeof Promise&&e instanceof Promise;class We{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Qe=(e,t)=>{if(qe(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new je(e.common.issues);return this._error=t,this._error}}};function Ye(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??r.defaultError}:void 0===r.data?{message:i??n??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:i??a??r.defaultError}},description:r}}class Xe{get description(){return this._def.description}_getType(e){return De(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:De(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:De(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ke(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Qe(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return qe(a)?{value:a.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>qe(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(Ke(n)?n:Promise.resolve(n));return Qe(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const r=e(t),i=()=>n.addIssue({code:Pe.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1))}_refinement(e){return new Qt({schema:this,typeName:ra.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Yt.create(this,this._def)}nullable(){return Xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this)}promise(){return Wt.create(this,this._def)}or(e){return Mt.create([this,e],this._def)}and(e){return Ft.create(this,e,this._def)}transform(e){return new Qt({...Ye(this._def),schema:this,typeName:ra.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Jt({...Ye(this._def),innerType:this,defaultValue:t,typeName:ra.ZodDefault})}brand(){return new ta({typeName:ra.ZodBranded,type:this,...Ye(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Zt({...Ye(this._def),innerType:this,catchValue:t,typeName:ra.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return aa.create(this,e)}readonly(){return na.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Je=/^c[^\s-]{8,}$/i,Ze=/^[0-9a-z]+$/,et=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,at=/^[a-z0-9_-]{21}$/i,nt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,it=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ot;const st=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ut=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ft=new RegExp(`^${mt}$`);function ht(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function _t(e){return new RegExp(`^${ht(e)}$`)}function yt(e){let t=`${mt}T${ht(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function Et(e,t){return!("v4"!==t&&t||!st.test(e))||!("v6"!==t&&t||!lt.test(e))}function Tt(e,t){if(!nt.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===r?.typ)&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function gt(e,t){return!("v4"!==t&&t||!pt.test(e))||!("v6"!==t&&t||!ut.test(e))}class vt extends Xe{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Ce.string){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.string,received:t.parsedType}),ze}const t=new Be;let a;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const r=e.data.length>n.value,i=e.data.length<n.value;(r||i)&&(a=this._getOrReturnCtx(e,a),r?Fe(a,{code:Pe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&Fe(a,{code:Pe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)it.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"email",code:Pe.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)ot||(ot=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ot.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"emoji",code:Pe.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)tt.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"uuid",code:Pe.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)at.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"nanoid",code:Pe.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Je.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cuid",code:Pe.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)Ze.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cuid2",code:Pe.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)et.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"ulid",code:Pe.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Fe(a,{validation:"url",code:Pe.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"regex",code:Pe.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){yt(n).test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){ft.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){_t(n).test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?rt.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"duration",code:Pe.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?Et(e.data,n.version)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"ip",code:Pe.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?Tt(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"jwt",code:Pe.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?gt(e.data,n.version)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cidr",code:Pe.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?dt.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"base64",code:Pe.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?ct.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"base64url",code:Pe.invalid_string,message:n.message}),t.dirty()):Ne.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:Pe.invalid_string,...Me.errToObj(a)})}_addCheck(e){return new vt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Me.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Me.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Me.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Me.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Me.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Me.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Me.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Me.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Me.errToObj(t)})}nonempty(e){return this.min(1,Me.errToObj(e))}trim(){return new vt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Rt(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}vt.create=e=>new vt({checks:[],typeName:ra.ZodString,coerce:e?.coerce??!1,...Ye(e)});class bt extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Ce.number){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.number,received:t.parsedType}),ze}let t;const a=new Be;for(const n of this._def.checks)if("int"===n.kind)Ne.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==Rt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.not_finite,message:n.message}),a.dirty()):Ne.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Me.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Me.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Me.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Me.toString(t))}setLimit(e,t,a,n){return new bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:Me.toString(n)}]})}_addCheck(e){return new bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Ne.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}bt.create=e=>new bt({checks:[],typeName:ra.ZodNumber,coerce:e?.coerce||!1,...Ye(e)});class Ot extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ce.bigint)return this._getInvalidInput(e);let t;const a=new Be;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Fe(t,{code:Pe.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):Ne.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.bigint,received:t.parsedType}),ze}gte(e,t){return this.setLimit("min",e,!0,Me.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Me.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Me.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Me.toString(t))}setLimit(e,t,a,n){return new Ot({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:Me.toString(n)}]})}_addCheck(e){return new Ot({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Ot.create=e=>new Ot({checks:[],typeName:ra.ZodBigInt,coerce:e?.coerce??!1,...Ye(e)});class Nt extends Xe{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Ce.boolean){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.boolean,received:t.parsedType}),ze}return $e(e.data)}}Nt.create=e=>new Nt({typeName:ra.ZodBoolean,coerce:e?.coerce||!1,...Ye(e)});class At extends Xe{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Ce.date){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.date,received:t.parsedType}),ze}if(Number.isNaN(e.data.getTime())){return Fe(this._getOrReturnCtx(e),{code:Pe.invalid_date}),ze}const t=new Be;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Pe.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):Ne.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new At({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Me.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Me.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}At.create=e=>new At({checks:[],coerce:e?.coerce||!1,typeName:ra.ZodDate,...Ye(e)});class St extends Xe{_parse(e){if(this._getType(e)!==Ce.symbol){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.symbol,received:t.parsedType}),ze}return $e(e.data)}}St.create=e=>new St({typeName:ra.ZodSymbol,...Ye(e)});class wt extends Xe{_parse(e){if(this._getType(e)!==Ce.undefined){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.undefined,received:t.parsedType}),ze}return $e(e.data)}}wt.create=e=>new wt({typeName:ra.ZodUndefined,...Ye(e)});class It extends Xe{_parse(e){if(this._getType(e)!==Ce.null){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.null,received:t.parsedType}),ze}return $e(e.data)}}It.create=e=>new It({typeName:ra.ZodNull,...Ye(e)});class Ct extends Xe{constructor(){super(...arguments),this._any=!0}_parse(e){return $e(e.data)}}Ct.create=e=>new Ct({typeName:ra.ZodAny,...Ye(e)});class Dt extends Xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $e(e.data)}}Dt.create=e=>new Dt({typeName:ra.ZodUnknown,...Ye(e)});class Pt extends Xe{_parse(e){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.never,received:t.parsedType}),ze}}Pt.create=e=>new Pt({typeName:ra.ZodNever,...Ye(e)});class jt extends Xe{_parse(e){if(this._getType(e)!==Ce.undefined){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.void,received:t.parsedType}),ze}return $e(e.data)}}jt.create=e=>new jt({typeName:ra.ZodVoid,...Ye(e)});class kt extends Xe{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==Ce.array)return Fe(t,{code:Pe.invalid_type,expected:Ce.array,received:t.parsedType}),ze;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(Fe(t,{code:e?Pe.too_big:Pe.too_small,minimum:r?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(Fe(t,{code:Pe.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(Fe(t,{code:Pe.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>n.type._parseAsync(new We(t,e,t.path,a)))).then(e=>Be.mergeArray(a,e));const r=[...t.data].map((e,a)=>n.type._parseSync(new We(t,e,t.path,a)));return Be.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new kt({...this._def,minLength:{value:e,message:Me.toString(t)}})}max(e,t){return new kt({...this._def,maxLength:{value:e,message:Me.toString(t)}})}length(e,t){return new kt({...this._def,exactLength:{value:e,message:Me.toString(t)}})}nonempty(e){return this.min(1,e)}}function xt(e){if(e instanceof Lt){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=Yt.create(xt(n))}return new Lt({...e._def,shape:()=>t})}return e instanceof kt?new kt({...e._def,type:xt(e.element)}):e instanceof Yt?Yt.create(xt(e.unwrap())):e instanceof Xt?Xt.create(xt(e.unwrap())):e instanceof Bt?Bt.create(e.items.map(e=>xt(e))):e}kt.create=(e,t)=>new kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ra.ZodArray,...Ye(t)});class Lt extends Xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Ne.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ce.object){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.object,received:t.parsedType}),ze}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof Pt&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||i.push(e);const o=[];for(const e of r){const t=n[e],r=a.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new We(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof Pt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)o.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(Fe(a,{code:Pe.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=a.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new We(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const a=await t.key,n=await t.value;e.push({key:a,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>Be.mergeObjectSync(t,e)):Be.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new Lt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const n=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:Me.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Lt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Lt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ra.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Lt({...this._def,catchall:e})}pick(e){const t={};for(const a of Ne.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new Lt({...this._def,shape:()=>t})}omit(e){const t={};for(const a of Ne.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new Lt({...this._def,shape:()=>t})}deepPartial(){return xt(this)}partial(e){const t={};for(const a of Ne.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new Lt({...this._def,shape:()=>t})}required(e){const t={};for(const a of Ne.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof Yt;)e=e._def.innerType;t[a]=e}return new Lt({...this._def,shape:()=>t})}keyof(){return Ht(Ne.objectKeys(this.shape))}}Lt.create=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strip",catchall:Pt.create(),typeName:ra.ZodObject,...Ye(t)}),Lt.strictCreate=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strict",catchall:Pt.create(),typeName:ra.ZodObject,...Ye(t)}),Lt.lazycreate=(e,t)=>new Lt({shape:e,unknownKeys:"strip",catchall:Pt.create(),typeName:ra.ZodObject,...Ye(t)});class Mt extends Xe{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new je(e.ctx.common.issues));return Fe(t,{code:Pe.invalid_union,unionErrors:a}),ze});{let e;const n=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},i=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=n.map(e=>new je(e));return Fe(t,{code:Pe.invalid_union,unionErrors:r}),ze}}get options(){return this._def.options}}Mt.create=(e,t)=>new Mt({options:e,typeName:ra.ZodUnion,...Ye(t)});function Gt(e,t){const a=De(e),n=De(t);if(e===t)return{valid:!0,data:e};if(a===Ce.object&&n===Ce.object){const a=Ne.objectKeys(t),n=Ne.objectKeys(e).filter(e=>-1!==a.indexOf(e)),r={...e,...t};for(const a of n){const n=Gt(e[a],t[a]);if(!n.valid)return{valid:!1};r[a]=n.data}return{valid:!0,data:r}}if(a===Ce.array&&n===Ce.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const r=Gt(e[n],t[n]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===Ce.date&&n===Ce.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ft extends Xe{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(Ue(e)||Ue(n))return ze;const r=Gt(e.value,n.value);return r.valid?((He(e)||He(n))&&t.dirty(),{status:t.value,value:r.data}):(Fe(a,{code:Pe.invalid_intersection_types}),ze)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ft.create=(e,t,a)=>new Ft({left:e,right:t,typeName:ra.ZodIntersection,...Ye(a)});class Bt extends Xe{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==Ce.array)return Fe(a,{code:Pe.invalid_type,expected:Ce.array,received:a.parsedType}),ze;if(a.data.length<this._def.items.length)return Fe(a,{code:Pe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&a.data.length>this._def.items.length&&(Fe(a,{code:Pe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new We(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(n).then(e=>Be.mergeArray(t,e)):Be.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Bt({...this._def,rest:e})}}Bt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bt({items:e,typeName:ra.ZodTuple,rest:null,...Ye(t)})};class zt extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==Ce.map)return Fe(a,{code:Pe.invalid_type,expected:Ce.map,received:a.parsedType}),ze;const n=this._def.keyType,r=this._def.valueType,i=[...a.data.entries()].map(([e,t],i)=>({key:n._parse(new We(a,e,a.path,[i,"key"])),value:r._parse(new We(a,t,a.path,[i,"value"]))}));if(a.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of i){const n=await a.key,r=await a.value;if("aborted"===n.status||"aborted"===r.status)return ze;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of i){const n=a.key,r=a.value;if("aborted"===n.status||"aborted"===r.status)return ze;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}}zt.create=(e,t,a)=>new zt({valueType:t,keyType:e,typeName:ra.ZodMap,...Ye(a)});class Vt extends Xe{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==Ce.set)return Fe(a,{code:Pe.invalid_type,expected:Ce.set,received:a.parsedType}),ze;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(Fe(a,{code:Pe.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(Fe(a,{code:Pe.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return ze;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const o=[...a.data.values()].map((e,t)=>r._parse(new We(a,e,a.path,t)));return a.common.async?Promise.all(o).then(e=>i(e)):i(o)}min(e,t){return new Vt({...this._def,minSize:{value:e,message:Me.toString(t)}})}max(e,t){return new Vt({...this._def,maxSize:{value:e,message:Me.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Vt.create=(e,t)=>new Vt({valueType:e,minSize:null,maxSize:null,typeName:ra.ZodSet,...Ye(t)});class $t extends Xe{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}$t.create=(e,t)=>new $t({getter:e,typeName:ra.ZodLazy,...Ye(t)});class Ut extends Xe{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Fe(t,{received:t.data,code:Pe.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ht(e,t){return new qt({values:e,typeName:ra.ZodEnum,...Ye(t)})}Ut.create=(e,t)=>new Ut({value:e,typeName:ra.ZodLiteral,...Ye(t)});class qt extends Xe{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return Fe(t,{expected:Ne.joinValues(a),received:t.parsedType,code:Pe.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return Fe(t,{received:t.data,code:Pe.invalid_enum_value,options:a}),ze}return $e(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return qt.create(e,{...this._def,...t})}exclude(e,t=this._def){return qt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}qt.create=Ht;class Kt extends Xe{_parse(e){const t=Ne.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Ce.string&&a.parsedType!==Ce.number){const e=Ne.objectValues(t);return Fe(a,{expected:Ne.joinValues(e),received:a.parsedType,code:Pe.invalid_type}),ze}if(this._cache||(this._cache=new Set(Ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=Ne.objectValues(t);return Fe(a,{received:a.data,code:Pe.invalid_enum_value,options:e}),ze}return $e(e.data)}get enum(){return this._def.values}}Kt.create=(e,t)=>new Kt({values:e,typeName:ra.ZodNativeEnum,...Ye(t)});class Wt extends Xe{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ce.promise&&!1===t.common.async)return Fe(t,{code:Pe.invalid_type,expected:Ce.promise,received:t.parsedType}),ze;const a=t.parsedType===Ce.promise?t.data:Promise.resolve(t.data);return $e(a.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Wt.create=(e,t)=>new Wt({type:e,typeName:ra.ZodPromise,...Ye(t)});class Qt extends Xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ra.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:e=>{Fe(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(a.data,r);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return ze;const n=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===n.status?ze:"dirty"===n.status||"dirty"===t.value?Ve(n.value):n});{if("aborted"===t.value)return ze;const n=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===n.status?ze:"dirty"===n.status||"dirty"===t.value?Ve(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?ze:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(a=>"aborted"===a.status?ze:("dirty"===a.status&&t.dirty(),e(a.value).then(()=>({status:t.value,value:a.value}))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!qe(e))return ze;const i=n.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>qe(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:t.value,value:e})):ze)}Ne.assertNever(n)}}Qt.create=(e,t,a)=>new Qt({schema:e,typeName:ra.ZodEffects,effect:t,...Ye(a)}),Qt.createWithPreprocess=(e,t,a)=>new Qt({schema:t,effect:{type:"preprocess",transform:e},typeName:ra.ZodEffects,...Ye(a)});class Yt extends Xe{_parse(e){return this._getType(e)===Ce.undefined?$e(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yt.create=(e,t)=>new Yt({innerType:e,typeName:ra.ZodOptional,...Ye(t)});class Xt extends Xe{_parse(e){return this._getType(e)===Ce.null?$e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xt.create=(e,t)=>new Xt({innerType:e,typeName:ra.ZodNullable,...Ye(t)});class Jt extends Xe{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===Ce.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Jt.create=(e,t)=>new Jt({innerType:e,typeName:ra.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Ye(t)});class Zt extends Xe{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ke(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new je(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new je(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Zt.create=(e,t)=>new Zt({innerType:e,typeName:ra.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Ye(t)});class ea extends Xe{_parse(e){if(this._getType(e)!==Ce.nan){const t=this._getOrReturnCtx(e);return Fe(t,{code:Pe.invalid_type,expected:Ce.nan,received:t.parsedType}),ze}return{status:"valid",value:e.data}}}ea.create=e=>new ea({typeName:ra.ZodNaN,...Ye(e)});Symbol("zod_brand");class ta extends Xe{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class aa extends Xe{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?ze:"dirty"===e.status?(t.dirty(),Ve(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?ze:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new aa({in:e,out:t,typeName:ra.ZodPipeline})}}class na extends Xe{_parse(e){const t=this._def.innerType._parse(e),a=e=>(qe(e)&&(e.value=Object.freeze(e.value)),e);return Ke(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}na.create=(e,t)=>new na({innerType:e,typeName:ra.ZodReadonly,...Ye(t)});Lt.lazycreate;var ra;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ra||(ra={}));const ia=vt.create,oa=bt.create,sa=(ea.create,Ot.create,Nt.create,At.create,St.create,wt.create,It.create,Ct.create,Dt.create,Pt.create,jt.create,kt.create),pa=Lt.create,la=(Lt.strictCreate,Mt.create,Ft.create,Bt.create,zt.create,Vt.create,$t.create,Ut.create,qt.create);Kt.create,Wt.create,Qt.create,Yt.create,Xt.create,Qt.createWithPreprocess,aa.create,Object.freeze({status:"aborted"});function ua(e,t,a){function n(a,n){var r;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(r=a._zod).traits??(r.traits=new Set),a._zod.traits.add(e),t(a,n);for(const e in o.prototype)e in a||Object.defineProperty(a,e,{value:o.prototype[e].bind(a)});a._zod.constr=o,a._zod.def=n}const r=a?.Parent??Object;class i extends r{}function o(e){var t;const r=a?.Parent?new i:this;n(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(a?.Parent&&t instanceof a.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Symbol("zod_brand");class da extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ca={};function ma(e){return e&&Object.assign(ca,e),ca}const fa=/^[cC][^\s-]{8,}$/,ha=/^[0-9a-z]+$/,_a=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ya=/^[0-9a-vA-V]{20}$/,Ea=/^[A-Za-z0-9]{27}$/,Ta=/^[a-zA-Z0-9_-]{21}$/,ga=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,va=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ra=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ba=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Oa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Na=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Aa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Sa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ia=/^[A-Za-z0-9_-]*$/,Ca=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Da=/^\+(?:[0-9]){6,14}[0-9]$/,Pa="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ja=new RegExp(`^${Pa}$`);function ka(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const xa=/^\d+$/,La=/^-?\d+(?:\.\d+)?/i,Ma=/true|false/i,Ga=/null/i,Fa=/^[^A-Z]*$/,Ba=/^[^a-z]*$/;function za(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,a])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Va(e,t){return"bigint"==typeof t?t.toString():t}function $a(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ua(e){return null==e}function Ha(e){const t=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(t,a)}function qa(e,t,a){Object.defineProperty(e,t,{get(){{const n=a();return e[t]=n,n}},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Ka(e,t,a){Object.defineProperty(e,t,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Wa(e){return JSON.stringify(e)}const Qa=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ya(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Xa=$a(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ja(e){if(!1===Ya(e))return!1;const t=e.constructor;if(void 0===t)return!0;const a=t.prototype;return!1!==Ya(a)&&!1!==Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")}const Za=new Set(["string","number","symbol"]);new Set(["string","number","bigint","boolean","symbol","undefined"]);function en(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(e,t,a){const n=new e._zod.constr(t??e._zod.def);return t&&!a?.parent||(n._zod.parent=e),n}function an(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const nn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function rn(e,t=0){for(let a=t;a<e.issues.length;a++)if(!0!==e.issues[a]?.continue)return!0;return!1}function on(e,t){return t.map(t=>{var a;return(a=t).path??(a.path=[]),t.path.unshift(e),t})}function sn(e){return"string"==typeof e?e:e?.message}function pn(e,t,a){const n={...e,path:e.path??[]};if(!e.message){const r=sn(e.inst?._zod.def?.error?.(e))??sn(t?.error?.(e))??sn(a.customError?.(e))??sn(a.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ln(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function un(...e){const[t,a,n]=e;return"string"==typeof t?{message:t,code:"custom",input:a,inst:n}:{...t}}const dn=ua("$ZodCheck",(e,t)=>{var a;e._zod??(e._zod={}),e._zod.def=t,(a=e._zod).onattach??(a.onattach=[])}),cn={number:"number",bigint:"bigint",object:"date"},mn=ua("$ZodCheckLessThan",(e,t)=>{dn.init(e,t);const a=cn[typeof t.value];e._zod.onattach.push(e=>{const a=e._zod.bag,n=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:a,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fn=ua("$ZodCheckGreaterThan",(e,t)=>{dn.init(e,t);const a=cn[typeof t.value];e._zod.onattach.push(e=>{const a=e._zod.bag,n=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:a,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hn=ua("$ZodCheckMultipleOf",(e,t)=>{dn.init(e,t),e._zod.onattach.push(e=>{var a;(a=e._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=a=>{if(typeof a.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof a.value?a.value%t.value===BigInt(0):0===function(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(a.value,t.value))||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:t.value,input:a.value,inst:e,continue:!t.abort})}}),_n=ua("$ZodCheckNumberFormat",(e,t)=>{dn.init(e,t),t.format=t.format||"float64";const a=t.format?.includes("int"),n=a?"int":"number",[r,i]=nn[t.format];e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,n.minimum=r,n.maximum=i,a&&(n.pattern=xa)}),e._zod.check=o=>{const s=o.value;if(a){if(!Number.isInteger(s))return void o.issues.push({expected:n,format:t.format,code:"invalid_type",input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}))}s<r&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>i&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),yn=ua("$ZodCheckMaxLength",(e,t)=>{var a;dn.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!Ua(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const n=a.value;if(n.length<=t.maximum)return;const r=ln(n);a.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),En=ua("$ZodCheckMinLength",(e,t)=>{var a;dn.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!Ua(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const n=a.value;if(n.length>=t.minimum)return;const r=ln(n);a.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tn=ua("$ZodCheckLengthEquals",(e,t)=>{var a;dn.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!Ua(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=a=>{const n=a.value,r=n.length;if(r===t.length)return;const i=ln(n),o=r>t.length;a.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),gn=ua("$ZodCheckStringFormat",(e,t)=>{var a,n;dn.init(e,t),e._zod.onattach.push(e=>{const a=e._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(a=e._zod).check??(a.check=a=>{t.pattern.lastIndex=0,t.pattern.test(a.value)||a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),vn=ua("$ZodCheckRegex",(e,t)=>{gn.init(e,t),e._zod.check=a=>{t.pattern.lastIndex=0,t.pattern.test(a.value)||a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rn=ua("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fa),gn.init(e,t)}),bn=ua("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ba),gn.init(e,t)}),On=ua("$ZodCheckIncludes",(e,t)=>{dn.init(e,t);const a=en(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${a}`:a);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),Nn=ua("$ZodCheckStartsWith",(e,t)=>{dn.init(e,t);const a=new RegExp(`^${en(t.prefix)}.*`);t.pattern??(t.pattern=a),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),An=ua("$ZodCheckEndsWith",(e,t)=>{dn.init(e,t);const a=new RegExp(`.*${en(t.suffix)}$`);t.pattern??(t.pattern=a),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}});const Sn=ua("$ZodCheckOverwrite",(e,t)=>{dn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class wn{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),a=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(a)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const In=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,Va,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cn=ua("$ZodError",In),Dn=ua("$ZodError",In,{Parent:Error});const Pn=e=>(t,a,n,r)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:a,issues:[]},i);if(o instanceof Promise)throw new da;if(o.issues.length){const t=new(r?.Err??e)(o.issues.map(e=>pn(e,i,ma())));throw Qa(t,r?.callee),t}return o.value},jn=Pn(Dn),kn=e=>async(t,a,n,r)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:a,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(r?.Err??e)(o.issues.map(e=>pn(e,i,ma())));throw Qa(t,r?.callee),t}return o.value},xn=kn(Dn),Ln=e=>(t,a,n)=>{const r=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:a,issues:[]},r);if(i instanceof Promise)throw new da;return i.issues.length?{success:!1,error:new(e??Cn)(i.issues.map(e=>pn(e,r,ma())))}:{success:!0,data:i.value}},Mn=Ln(Dn),Gn=e=>async(t,a,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:a,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>pn(e,r,ma())))}:{success:!0,data:i.value}},Fn=Gn(Dn),Bn={major:4,minor:0,patch:0},zn=ua("$ZodType",(e,t)=>{var a;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bn;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const a of t._zod.onattach)a(e);if(0===n.length)(a=e._zod).deferred??(a.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,a)=>{let n,r=rn(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===a?.async)throw new da;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(r||(r=rn(e,t)))});else{if(e.issues.length===t)continue;r||(r=rn(e,t))}}return n?n.then(()=>e):e};e._zod.run=(a,r)=>{const i=e._zod.parse(a,r);if(i instanceof Promise){if(!1===r.async)throw new da;return i.then(e=>t(e,n,r))}return t(i,n,r)}}e["~standard"]={validate:t=>{try{const a=Mn(e,t);return a.success?{value:a.data}:{issues:a.error?.issues}}catch(a){return Fn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Vn=ua("$ZodString",(e,t)=>{var a;zn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(a=e._zod.bag,new RegExp(`^${a?`[\\s\\S]{${a?.minimum??0},${a?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(a,n)=>{if(t.coerce)try{a.value=String(a.value)}catch(n){}return"string"==typeof a.value||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),$n=ua("$ZodStringFormat",(e,t)=>{gn.init(e,t),Vn.init(e,t)}),Un=ua("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=va),$n.init(e,t)}),Hn=ua("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ra(e))}else t.pattern??(t.pattern=Ra());$n.init(e,t)}),qn=ua("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ba),$n.init(e,t)}),Kn=ua("$ZodURL",(e,t)=>{$n.init(e,t),e._zod.check=a=>{try{const n=a.value,r=new URL(n),i=r.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ca.source,input:a.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:a.value,inst:e,continue:!t.abort})),void(!n.endsWith("/")&&i.endsWith("/")?a.value=i.slice(0,-1):a.value=i)}catch(n){a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!t.abort})}}}),Wn=ua("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$n.init(e,t)}),Qn=ua("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ta),$n.init(e,t)}),Yn=ua("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=fa),$n.init(e,t)}),Xn=ua("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ha),$n.init(e,t)}),Jn=ua("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_a),$n.init(e,t)}),Zn=ua("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ya),$n.init(e,t)}),er=ua("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ea),$n.init(e,t)}),tr=ua("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=ka({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-]\\d{2}:\\d{2})");const n=`${t}(?:${a.join("|")})`;return new RegExp(`^${Pa}T(?:${n})$`)}(t)),$n.init(e,t)}),ar=ua("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ja),$n.init(e,t)}),nr=ua("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ka(t)}$`)),$n.init(e,t)}),rr=ua("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ga),$n.init(e,t)}),ir=ua("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Oa),$n.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),or=ua("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Na),$n.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!t.abort})}}}),sr=ua("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Aa),$n.init(e,t)}),pr=ua("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sa),$n.init(e,t),e._zod.check=a=>{const[n,r]=a.value.split("/");try{if(!r)throw new Error;const e=Number(r);if(`${e}`!==r)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${n}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!t.abort})}}});function lr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ur=ua("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wa),$n.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=a=>{lr(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!t.abort})}});const dr=ua("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ia),$n.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=a=>{(function(e){if(!Ia.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return lr(t.padEnd(4*Math.ceil(t.length/4),"="))})(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!t.abort})}}),cr=ua("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Da),$n.init(e,t)});const mr=ua("$ZodJWT",(e,t)=>{$n.init(e,t),e._zod.check=a=>{(function(e,t=null){try{const a=e.split(".");if(3!==a.length)return!1;const[n]=a;if(!n)return!1;const r=JSON.parse(atob(n));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(a.value,t.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!t.abort})}}),fr=ua("$ZodNumber",(e,t)=>{zn.init(e,t),e._zod.pattern=e._zod.bag.pattern??La,e._zod.parse=(a,n)=>{if(t.coerce)try{a.value=Number(a.value)}catch(e){}const r=a.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return a;const i="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),a}}),hr=ua("$ZodNumber",(e,t)=>{_n.init(e,t),fr.init(e,t)}),_r=ua("$ZodBoolean",(e,t)=>{zn.init(e,t),e._zod.pattern=Ma,e._zod.parse=(a,n)=>{if(t.coerce)try{a.value=Boolean(a.value)}catch(e){}const r=a.value;return"boolean"==typeof r||a.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),a}}),yr=ua("$ZodNull",(e,t)=>{zn.init(e,t),e._zod.pattern=Ga,e._zod.values=new Set([null]),e._zod.parse=(t,a)=>{const n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),Er=ua("$ZodUnknown",(e,t)=>{zn.init(e,t),e._zod.parse=e=>e}),Tr=ua("$ZodNever",(e,t)=>{zn.init(e,t),e._zod.parse=(t,a)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function gr(e,t,a){e.issues.length&&t.issues.push(...on(a,e.issues)),t.value[a]=e.value}const vr=ua("$ZodArray",(e,t)=>{zn.init(e,t),e._zod.parse=(a,n)=>{const r=a.value;if(!Array.isArray(r))return a.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),a;a.value=Array(r.length);const i=[];for(let e=0;e<r.length;e++){const o=r[e],s=t.element._zod.run({value:o,issues:[]},n);s instanceof Promise?i.push(s.then(t=>gr(t,a,e))):gr(s,a,e)}return i.length?Promise.all(i).then(()=>a):a}});function Rr(e,t,a){e.issues.length&&t.issues.push(...on(a,e.issues)),t.value[a]=e.value}function br(e,t,a,n){e.issues.length?void 0===n[a]?t.value[a]=a in n?void 0:e.value:t.issues.push(...on(a,e.issues)):void 0===e.value?a in n&&(t.value[a]=void 0):t.value[a]=e.value}const Or=ua("$ZodObject",(e,t)=>{zn.init(e,t);const a=$a(()=>{const e=Object.keys(t.shape);for(const a of e)if(!(t.shape[a]instanceof zn))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const a=(n=t.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(a)}});qa(e._zod,"propValues",()=>{const e=t.shape,a={};for(const t in e){const n=e[t]._zod;if(n.values){a[t]??(a[t]=new Set);for(const e of n.values)a[t].add(e)}}return a});let n;const r=Ya,i=!ca.jitless,o=i&&Xa.value,s=t.catchall;let p;e._zod.parse=(l,u)=>{p??(p=a.value);const d=l.value;if(!r(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;const c=[];if(i&&o&&!1===u?.async&&!0!==u.jitless)n||(n=(e=>{const t=new wn(["shape","payload","ctx"]),n=a.value,r=e=>{const t=Wa(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {}");for(const e of n.keys)if(n.optionalKeys.has(e)){const a=i[e];t.write(`const ${a} = ${r(e)};`);const n=Wa(e);t.write(`\n if (${a}.issues.length) {\n if (input[${n}] === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${a}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}],\n }))\n );\n }\n } else if (${a}.value === undefined) {\n if (${n} in input) newResult[${n}] = undefined;\n } else {\n newResult[${n}] = ${a}.value;\n }\n `)}else{const a=i[e];t.write(`const ${a} = ${r(e)};`),t.write(`\n if (${a}.issues.length) payload.issues = payload.issues.concat(${a}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${Wa(e)}, ...iss.path] : [${Wa(e)}]\n })));`),t.write(`newResult[${Wa(e)}] = ${a}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,a)=>s(e,t,a)})(t.shape)),l=n(l,u);else{l.value={};const e=p.shape;for(const t of p.keys){const a=e[t],n=a._zod.run({value:d[t],issues:[]},u),r="optional"===a._zod.optin&&"optional"===a._zod.optout;n instanceof Promise?c.push(n.then(e=>r?br(e,l,t,d):Rr(e,l,t))):r?br(n,l,t,d):Rr(n,l,t)}}if(!s)return c.length?Promise.all(c).then(()=>l):l;const m=[],f=p.keySet,h=s._zod,_=h.def.type;for(const e of Object.keys(d)){if(f.has(e))continue;if("never"===_){m.push(e);continue}const t=h.run({value:d[e],issues:[]},u);t instanceof Promise?c.push(t.then(t=>Rr(t,l,e))):Rr(t,l,e)}return m.length&&l.issues.push({code:"unrecognized_keys",keys:m,input:d,inst:e}),c.length?Promise.all(c).then(()=>l):l}});function Nr(e,t,a,n){for(const a of e)if(0===a.issues.length)return t.value=a.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:a,errors:e.map(e=>e.issues.map(e=>pn(e,n,ma())))}),t}const Ar=ua("$ZodUnion",(e,t)=>{zn.init(e,t),qa(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),qa(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),qa(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),qa(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ha(e.source)).join("|")})$`)}}),e._zod.parse=(a,n)=>{let r=!1;const i=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},n);if(t instanceof Promise)i.push(t),r=!0;else{if(0===t.issues.length)return t;i.push(t)}}return r?Promise.all(i).then(t=>Nr(t,a,e,n)):Nr(i,a,e,n)}}),Sr=ua("$ZodDiscriminatedUnion",(e,t)=>{Ar.init(e,t);const a=e._zod.parse;qa(e._zod,"propValues",()=>{const e={};for(const a of t.options){const n=a._zod.propValues;if(!n||0===Object.keys(n).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[t,a]of Object.entries(n)){e[t]||(e[t]=new Set);for(const n of a)e[t].add(n)}}return e});const n=$a(()=>{const e=t.options,a=new Map;for(const n of e){const e=n._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const t of e){if(a.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);a.set(t,n)}}return a});e._zod.parse=(r,i)=>{const o=r.value;if(!Ya(o))return r.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),r;const s=n.value.get(o?.[t.discriminator]);return s?s._zod.run(r,i):t.unionFallback?a(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:o,path:[t.discriminator],inst:e}),r)}}),wr=ua("$ZodIntersection",(e,t)=>{zn.init(e,t),e._zod.parse=(e,a)=>{const n=e.value,r=t.left._zod.run({value:n,issues:[]},a),i=t.right._zod.run({value:n,issues:[]},a);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then(([t,a])=>Cr(e,t,a)):Cr(e,r,i)}});function Ir(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ja(e)&&Ja(t)){const a=Object.keys(t),n=Object.keys(e).filter(e=>-1!==a.indexOf(e)),r={...e,...t};for(const a of n){const n=Ir(e[a],t[a]);if(!n.valid)return{valid:!1,mergeErrorPath:[a,...n.mergeErrorPath]};r[a]=n.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let n=0;n<e.length;n++){const r=Ir(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a.push(r.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function Cr(e,t,a){if(t.issues.length&&e.issues.push(...t.issues),a.issues.length&&e.issues.push(...a.issues),rn(e))return e;const n=Ir(t.value,a.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Dr=ua("$ZodRecord",(e,t)=>{zn.init(e,t),e._zod.parse=(a,n)=>{const r=a.value;if(!Ja(r))return a.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),a;const i=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;a.value={};for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const o=t.valueType._zod.run({value:r[e],issues:[]},n);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&a.issues.push(...on(e,t.issues)),a.value[e]=t.value})):(o.issues.length&&a.issues.push(...on(e,o.issues)),a.value[e]=o.value)}let s;for(const e in r)o.has(e)||(s=s??[],s.push(e));s&&s.length>0&&a.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:s})}else{a.value={};for(const o of Reflect.ownKeys(r)){if("__proto__"===o)continue;const s=t.keyType._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){a.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(e=>pn(e,n,ma())),input:o,path:[o],inst:e}),a.value[s.value]=s.value;continue}const p=t.valueType._zod.run({value:r[o],issues:[]},n);p instanceof Promise?i.push(p.then(e=>{e.issues.length&&a.issues.push(...on(o,e.issues)),a.value[s.value]=e.value})):(p.issues.length&&a.issues.push(...on(o,p.issues)),a.value[s.value]=p.value)}}return i.length?Promise.all(i).then(()=>a):a}});const Pr=ua("$ZodEnum",(e,t)=>{zn.init(e,t);const a=za(t.entries);e._zod.values=new Set(a),e._zod.pattern=new RegExp(`^(${a.filter(e=>Za.has(typeof e)).map(e=>"string"==typeof e?en(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{const r=t.value;return e._zod.values.has(r)||t.issues.push({code:"invalid_value",values:a,input:r,inst:e}),t}}),jr=ua("$ZodLiteral",(e,t)=>{zn.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?en(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(a,n)=>{const r=a.value;return e._zod.values.has(r)||a.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),a}}),kr=ua("$ZodTransform",(e,t)=>{zn.init(e,t),e._zod.parse=(e,a)=>{const n=t.transform(e.value,e);if(a.async){return(n instanceof Promise?n:Promise.resolve(n)).then(t=>(e.value=t,e))}if(n instanceof Promise)throw new da;return e.value=n,e}}),xr=ua("$ZodOptional",(e,t)=>{zn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",qa(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),qa(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ha(e.source)})?$`):void 0}),e._zod.parse=(e,a)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,a):void 0===e.value?e:t.innerType._zod.run(e,a)}),Lr=ua("$ZodNullable",(e,t)=>{zn.init(e,t),qa(e._zod,"optin",()=>t.innerType._zod.optin),qa(e._zod,"optout",()=>t.innerType._zod.optout),qa(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ha(e.source)}|null)$`):void 0}),qa(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,a)=>null===e.value?e:t.innerType._zod.run(e,a)}),Mr=ua("$ZodDefault",(e,t)=>{zn.init(e,t),e._zod.optin="optional",qa(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(e=>Gr(e,t)):Gr(n,t)}});function Gr(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Fr=ua("$ZodPrefault",(e,t)=>{zn.init(e,t),e._zod.optin="optional",qa(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,a))}),Br=ua("$ZodNonOptional",(e,t)=>{zn.init(e,t),qa(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(a,n)=>{const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(t=>zr(t,e)):zr(r,e)}});function zr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Vr=ua("$ZodCatch",(e,t)=>{zn.init(e,t),e._zod.optin="optional",qa(e._zod,"optout",()=>t.innerType._zod.optout),qa(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>{const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>pn(e,a,ma()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>pn(e,a,ma()))},input:e.value}),e.issues=[]),e)}}),$r=ua("$ZodPipe",(e,t)=>{zn.init(e,t),qa(e._zod,"values",()=>t.in._zod.values),qa(e._zod,"optin",()=>t.in._zod.optin),qa(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,a)=>{const n=t.in._zod.run(e,a);return n instanceof Promise?n.then(e=>Ur(e,t,a)):Ur(n,t,a)}});function Ur(e,t,a){return rn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},a)}const Hr=ua("$ZodReadonly",(e,t)=>{zn.init(e,t),qa(e._zod,"propValues",()=>t.innerType._zod.propValues),qa(e._zod,"values",()=>t.innerType._zod.values),qa(e._zod,"optin",()=>t.innerType._zod.optin),qa(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,a)=>{const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(qr):qr(n)}});function qr(e){return e.value=Object.freeze(e.value),e}const Kr=ua("$ZodCustom",(e,t)=>{dn.init(e,t),zn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=a=>{const n=a.value,r=t.fn(n);if(r instanceof Promise)return r.then(t=>Wr(t,a,n,e));Wr(r,a,n,e)}});function Wr(e,t,a,n){if(!e){const e={code:"custom",input:a,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(un(e))}}const Qr=ua("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");zn.init(e,t),e.def=t,e.parse=(t,a)=>jn(e,t,a,{callee:e.parse}),e.safeParse=(t,a)=>Mn(e,t,a),e.parseAsync=async(t,a)=>xn(e,t,a,{callee:e.parseAsync}),e.safeParseAsync=async(t,a)=>Fn(e,t,a),e.check=(...a)=>e.clone({...t,checks:[...t.checks??[],...a.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,a)=>tn(e,t,a),e.brand=()=>e,e.register=(t,a)=>(t.add(e,a),e)});const Yr=ua("ZodMiniObject",(e,t)=>{Or.init(e,t),Qr.init(e,t),qa(e,"shape",()=>t.shape)});function Xr(e,t){const a={type:"object",get shape(){return Ka(this,"shape",{...e}),this.shape},...an(t)};return new Yr(a)}function Jr(e){return!!e._zod}function Zr(e){const t=Object.values(e);if(0===t.length)return Xr({});const a=t.every(Jr),n=t.every(e=>!Jr(e));if(a)return Xr(e);if(n)return pa(e);throw new Error("Mixed Zod versions detected in object shape.")}function ei(e,t){if(Jr(e)){return Mn(e,t)}return e.safeParse(t)}async function ti(e,t){if(Jr(e)){return await Fn(e,t)}const a=e;return await a.safeParseAsync(t)}function ai(e){var t,a;if(!e)return;let n;if(Jr(e)){n=null===(a=null===(t=e._zod)||void 0===t?void 0:t.def)||void 0===a?void 0:a.shape}else{n=e.shape}if(n){if("function"==typeof n)try{return n()}catch(e){return}return n}}function ni(e){var t;if(e){if("object"==typeof e){const t=e;if(!e._def&&!t._zod){const t=Object.values(e);if(t.length>0&&t.every(e=>"object"==typeof e&&null!==e&&(void 0!==e._def||void 0!==e._zod||"function"==typeof e.parse)))return Zr(e)}}if(Jr(e)){const a=null===(t=e._zod)||void 0===t?void 0:t.def;if(a&&("object"===a.type||void 0!==a.shape))return e}else{if(void 0!==e.shape)return e}}}function ri(e){if(e&&"object"==typeof e){if("message"in e&&"string"==typeof e.message)return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){const t=e.issues[0];if(t&&"object"==typeof t&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch(t){return String(e)}}return String(e)}function ii(e){var t;if(Jr(e)){const a=null===(t=e._zod)||void 0===t?void 0:t.def;if(a){if(void 0!==a.value)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const a=e._def;if(a){if(void 0!==a.value)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}const n=e.value;if(void 0!==n)return n}Symbol("ZodOutput"),Symbol("ZodInput");class oi{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const a=t[0];if(this._map.set(e,a),a&&"object"==typeof a&&"id"in a){if(this._idmap.has(a.id))throw new Error(`ID ${a.id} already exists in the registry`);this._idmap.set(a.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const a={...this.get(t)??{}};return delete a.id,{...a,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function si(){return new oi}const pi=si();function li(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...an(t)})}function ui(e,t){return new mn({check:"less_than",...an(t),value:e,inclusive:!1})}function di(e,t){return new mn({check:"less_than",...an(t),value:e,inclusive:!0})}function ci(e,t){return new fn({check:"greater_than",...an(t),value:e,inclusive:!1})}function mi(e,t){return new fn({check:"greater_than",...an(t),value:e,inclusive:!0})}function fi(e,t){return new hn({check:"multiple_of",...an(t),value:e})}function hi(e,t){return new yn({check:"max_length",...an(t),maximum:e})}function _i(e,t){return new En({check:"min_length",...an(t),minimum:e})}function yi(e,t){return new Tn({check:"length_equals",...an(t),length:e})}function Ei(e){return new Sn({check:"overwrite",tx:e})}const Ti=ua("ZodISODateTime",(e,t)=>{tr.init(e,t),Mi.init(e,t)});function gi(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...an(t)})}(Ti,e)}const vi=ua("ZodISODate",(e,t)=>{ar.init(e,t),Mi.init(e,t)});function Ri(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...an(t)})}(vi,e)}const bi=ua("ZodISOTime",(e,t)=>{nr.init(e,t),Mi.init(e,t)});function Oi(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...an(t)})}(bi,e)}const Ni=ua("ZodISODuration",(e,t)=>{rr.init(e,t),Mi.init(e,t)});function Ai(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...an(t)})}(Ni,e)}const Si=(e,t)=>{Cn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const a=t||function(e){return e.message},n={_errors:[]},r=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>r({issues:e}));else if("invalid_key"===t.code)r({issues:t.issues});else if("invalid_element"===t.code)r({issues:t.issues});else if(0===t.path.length)n._errors.push(a(t));else{let e=n,r=0;for(;r<t.path.length;){const n=t.path[r];r===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(a(t))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const a={},n=[];for(const r of e.issues)r.path.length>0?(a[r.path[0]]=a[r.path[0]]||[],a[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:a}}(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},wi=(ua("ZodError",Si),ua("ZodError",Si,{Parent:Error})),Ii=Pn(wi),Ci=kn(wi),Di=Ln(wi),Pi=Gn(wi),ji=ua("ZodType",(e,t)=>(zn.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...a)=>e.clone({...t,checks:[...t.checks??[],...a.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,a)=>tn(e,t,a),e.brand=()=>e,e.register=(t,a)=>(t.add(e,a),e),e.parse=(t,a)=>Ii(e,t,a,{callee:e.parse}),e.safeParse=(t,a)=>Di(e,t,a),e.parseAsync=async(t,a)=>Ci(e,t,a,{callee:e.parseAsync}),e.safeParseAsync=async(t,a)=>Pi(e,t,a),e.spa=e.safeParseAsync,e.refine=(t,a)=>e.check(function(e,t={}){return function(e,t,a){return new e({type:"custom",check:"custom",fn:t,...an(a)})}(qo,e,t)}(t,a)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new dn({check:"custom"});return t._zod.check=e,t}(a=>(a.addIssue=e=>{if("string"==typeof e)a.issues.push(un(e,a.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=a.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),a.issues.push(un(n))}},e(a.value,a)));return t}(t)),e.overwrite=t=>e.check(Ei(t)),e.optional=()=>Lo(e),e.nullable=()=>Go(e),e.nullish=()=>Lo(Go(e)),e.nonoptional=t=>function(e,t){return new zo({type:"nonoptional",innerType:e,...an(t)})}(e,t),e.array=()=>yo(e),e.or=t=>Ro([e,t]),e.and=t=>Ao(e,t),e.transform=t=>Uo(e,ko(t)),e.default=t=>{return a=t,new Fo({type:"default",innerType:e,get defaultValue(){return"function"==typeof a?a():a}});var a},e.prefault=t=>{return a=t,new Bo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof a?a():a}});var a},e.catch=t=>{return new Vo({type:"catch",innerType:e,catchValue:"function"==typeof(a=t)?a:()=>a});var a},e.pipe=t=>Uo(e,t),e.readonly=()=>new Ho({type:"readonly",innerType:e}),e.describe=t=>{const a=e.clone();return pi.add(a,{description:t}),a},Object.defineProperty(e,"description",{get:()=>pi.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return pi.get(e);const a=e.clone();return pi.add(a,t[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ki=ua("_ZodString",(e,t)=>{Vn.init(e,t),ji.init(e,t);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new vn({check:"string_format",format:"regex",...an(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new On({check:"string_format",format:"includes",...an(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Nn({check:"string_format",format:"starts_with",...an(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new An({check:"string_format",format:"ends_with",...an(t),suffix:e})}(...t)),e.min=(...t)=>e.check(_i(...t)),e.max=(...t)=>e.check(hi(...t)),e.length=(...t)=>e.check(yi(...t)),e.nonempty=(...t)=>e.check(_i(1,...t)),e.lowercase=t=>e.check(function(e){return new Rn({check:"string_format",format:"lowercase",...an(e)})}(t)),e.uppercase=t=>e.check(function(e){return new bn({check:"string_format",format:"uppercase",...an(e)})}(t)),e.trim=()=>e.check(Ei(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Ei(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Ei(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Ei(e=>e.toUpperCase()))}),xi=ua("ZodString",(e,t)=>{Vn.init(e,t),ki.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...an(t)})}(Gi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...an(t)})}(zi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...an(t)})}(ao,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...an(t)})}(Vi,t)),e.guid=t=>e.check(li(Fi,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...an(t)})}(Bi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...an(t)})}(Bi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...an(t)})}(Bi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...an(t)})}(Bi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...an(t)})}($i,t)),e.guid=t=>e.check(li(Fi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...an(t)})}(Ui,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...an(t)})}(Hi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...an(t)})}(qi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...an(t)})}(Zi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...an(t)})}(eo,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...an(t)})}(Ki,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...an(t)})}(Wi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...an(t)})}(Qi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...an(t)})}(Yi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...an(t)})}(Xi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...an(t)})}(Ji,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...an(t)})}(to,t)),e.datetime=t=>e.check(gi(t)),e.date=t=>e.check(Ri(t)),e.time=t=>e.check(Oi(t)),e.duration=t=>e.check(Ai(t))});function Li(e){return function(e,t){return new e({type:"string",...an(t)})}(xi,e)}const Mi=ua("ZodStringFormat",(e,t)=>{$n.init(e,t),ki.init(e,t)}),Gi=ua("ZodEmail",(e,t)=>{qn.init(e,t),Mi.init(e,t)});const Fi=ua("ZodGUID",(e,t)=>{Un.init(e,t),Mi.init(e,t)});const Bi=ua("ZodUUID",(e,t)=>{Hn.init(e,t),Mi.init(e,t)});const zi=ua("ZodURL",(e,t)=>{Kn.init(e,t),Mi.init(e,t)});const Vi=ua("ZodEmoji",(e,t)=>{Wn.init(e,t),Mi.init(e,t)});const $i=ua("ZodNanoID",(e,t)=>{Qn.init(e,t),Mi.init(e,t)});const Ui=ua("ZodCUID",(e,t)=>{Yn.init(e,t),Mi.init(e,t)});const Hi=ua("ZodCUID2",(e,t)=>{Xn.init(e,t),Mi.init(e,t)});const qi=ua("ZodULID",(e,t)=>{Jn.init(e,t),Mi.init(e,t)});const Ki=ua("ZodXID",(e,t)=>{Zn.init(e,t),Mi.init(e,t)});const Wi=ua("ZodKSUID",(e,t)=>{er.init(e,t),Mi.init(e,t)});const Qi=ua("ZodIPv4",(e,t)=>{ir.init(e,t),Mi.init(e,t)});const Yi=ua("ZodIPv6",(e,t)=>{or.init(e,t),Mi.init(e,t)});const Xi=ua("ZodCIDRv4",(e,t)=>{sr.init(e,t),Mi.init(e,t)});const Ji=ua("ZodCIDRv6",(e,t)=>{pr.init(e,t),Mi.init(e,t)});const Zi=ua("ZodBase64",(e,t)=>{ur.init(e,t),Mi.init(e,t)});const eo=ua("ZodBase64URL",(e,t)=>{dr.init(e,t),Mi.init(e,t)});const to=ua("ZodE164",(e,t)=>{cr.init(e,t),Mi.init(e,t)});const ao=ua("ZodJWT",(e,t)=>{mr.init(e,t),Mi.init(e,t)});const no=ua("ZodNumber",(e,t)=>{fr.init(e,t),ji.init(e,t),e.gt=(t,a)=>e.check(ci(t,a)),e.gte=(t,a)=>e.check(mi(t,a)),e.min=(t,a)=>e.check(mi(t,a)),e.lt=(t,a)=>e.check(ui(t,a)),e.lte=(t,a)=>e.check(di(t,a)),e.max=(t,a)=>e.check(di(t,a)),e.int=t=>e.check(oo(t)),e.safe=t=>e.check(oo(t)),e.positive=t=>e.check(ci(0,t)),e.nonnegative=t=>e.check(mi(0,t)),e.negative=t=>e.check(ui(0,t)),e.nonpositive=t=>e.check(di(0,t)),e.multipleOf=(t,a)=>e.check(fi(t,a)),e.step=(t,a)=>e.check(fi(t,a)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function ro(e){return function(e,t){return new e({type:"number",checks:[],...an(t)})}(no,e)}const io=ua("ZodNumberFormat",(e,t)=>{hr.init(e,t),no.init(e,t)});function oo(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...an(t)})}(io,e)}const so=ua("ZodBoolean",(e,t)=>{_r.init(e,t),ji.init(e,t)});function po(e){return function(e,t){return new e({type:"boolean",...an(t)})}(so,e)}const lo=ua("ZodNull",(e,t)=>{yr.init(e,t),ji.init(e,t)});function uo(e){return function(e,t){return new e({type:"null",...an(t)})}(lo,e)}const co=ua("ZodUnknown",(e,t)=>{Er.init(e,t),ji.init(e,t)});function mo(){return function(e){return new e({type:"unknown"})}(co)}const fo=ua("ZodNever",(e,t)=>{Tr.init(e,t),ji.init(e,t)});function ho(e){return function(e,t){return new e({type:"never",...an(t)})}(fo,e)}const _o=ua("ZodArray",(e,t)=>{vr.init(e,t),ji.init(e,t),e.element=t.element,e.min=(t,a)=>e.check(_i(t,a)),e.nonempty=t=>e.check(_i(1,t)),e.max=(t,a)=>e.check(hi(t,a)),e.length=(t,a)=>e.check(yi(t,a)),e.unwrap=()=>e.element});function yo(e,t){return function(e,t,a){return new e({type:"array",element:t,...an(a)})}(_o,e,t)}const Eo=ua("ZodObject",(e,t)=>{Or.init(e,t),ji.init(e,t),qa(e,"shape",()=>t.shape),e.keyof=()=>Co(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mo()}),e.loose=()=>e.clone({...e._zod.def,catchall:mo()}),e.strict=()=>e.clone({...e._zod.def,catchall:ho()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ja(t))throw new Error("Invalid input to extend: expected a plain object");const a={...e._zod.def,get shape(){const a={...e._zod.def.shape,...t};return Ka(this,"shape",a),a},checks:[]};return tn(e,a)}(e,t),e.merge=t=>{return n=t,tn(a=e,{...a._zod.def,get shape(){const e={...a._zod.def.shape,...n._zod.def.shape};return Ka(this,"shape",e),e},catchall:n._zod.def.catchall,checks:[]});var a,n},e.pick=t=>function(e,t){const a={},n=e._zod.def;for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(a[e]=n.shape[e])}return tn(e,{...e._zod.def,shape:a,checks:[]})}(e,t),e.omit=t=>function(e,t){const a={...e._zod.def.shape},n=e._zod.def;for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete a[e]}return tn(e,{...e._zod.def,shape:a,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,a){const n=t._zod.def.shape,r={...n};if(a)for(const t in a){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);a[t]&&(r[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)r[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return tn(t,{...t._zod.def,shape:r,checks:[]})}(xo,e,t[0]),e.required=(...t)=>function(e,t,a){const n=t._zod.def.shape,r={...n};if(a)for(const t in a){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);a[t]&&(r[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)r[t]=new e({type:"nonoptional",innerType:n[t]});return tn(t,{...t._zod.def,shape:r,checks:[]})}(zo,e,t[0])});function To(e,t){const a={type:"object",get shape(){return Ka(this,"shape",{...e}),this.shape},...an(t)};return new Eo(a)}function go(e,t){return new Eo({type:"object",get shape(){return Ka(this,"shape",{...e}),this.shape},catchall:mo(),...an(t)})}const vo=ua("ZodUnion",(e,t)=>{Ar.init(e,t),ji.init(e,t),e.options=t.options});function Ro(e,t){return new vo({type:"union",options:e,...an(t)})}const bo=ua("ZodDiscriminatedUnion",(e,t)=>{vo.init(e,t),Sr.init(e,t)});function Oo(e,t,a){return new bo({type:"union",options:t,discriminator:e,...an(a)})}const No=ua("ZodIntersection",(e,t)=>{wr.init(e,t),ji.init(e,t)});function Ao(e,t){return new No({type:"intersection",left:e,right:t})}const So=ua("ZodRecord",(e,t)=>{Dr.init(e,t),ji.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function wo(e,t,a){return new So({type:"record",keyType:e,valueType:t,...an(a)})}const Io=ua("ZodEnum",(e,t)=>{Pr.init(e,t),ji.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const a=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const r={};for(const n of e){if(!a.has(n))throw new Error(`Key ${n} not found in enum`);r[n]=t.entries[n]}return new Io({...t,checks:[],...an(n),entries:r})},e.exclude=(e,n)=>{const r={...t.entries};for(const t of e){if(!a.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new Io({...t,checks:[],...an(n),entries:r})}});function Co(e,t){const a=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Io({type:"enum",entries:a,...an(t)})}const Do=ua("ZodLiteral",(e,t)=>{jr.init(e,t),ji.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Po(e,t){return new Do({type:"literal",values:Array.isArray(e)?e:[e],...an(t)})}const jo=ua("ZodTransform",(e,t)=>{kr.init(e,t),ji.init(e,t),e._zod.parse=(a,n)=>{a.addIssue=n=>{if("string"==typeof n)a.issues.push(un(n,a.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=a.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),a.issues.push(un(t))}};const r=t.transform(a.value,a);return r instanceof Promise?r.then(e=>(a.value=e,a)):(a.value=r,a)}});function ko(e){return new jo({type:"transform",transform:e})}const xo=ua("ZodOptional",(e,t)=>{xr.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Lo(e){return new xo({type:"optional",innerType:e})}const Mo=ua("ZodNullable",(e,t)=>{Lr.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Go(e){return new Mo({type:"nullable",innerType:e})}const Fo=ua("ZodDefault",(e,t)=>{Mr.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Bo=ua("ZodPrefault",(e,t)=>{Fr.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType});const zo=ua("ZodNonOptional",(e,t)=>{Br.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Vo=ua("ZodCatch",(e,t)=>{Vr.init(e,t),ji.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const $o=ua("ZodPipe",(e,t)=>{$r.init(e,t),ji.init(e,t),e.in=t.in,e.out=t.out});function Uo(e,t){return new $o({type:"pipe",in:e,out:t})}const Ho=ua("ZodReadonly",(e,t)=>{Hr.init(e,t),ji.init(e,t)});const qo=ua("ZodCustom",(e,t)=>{Kr.init(e,t),ji.init(e,t)});function Ko(e,t){return Uo(ko(e),t)}const Wo="2025-11-25",Qo=[Wo,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Yo="io.modelcontextprotocol/related-task",Xo="2.0",Jo=function(e,t,a){const n=an(a);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}(qo,(e=>null!==e&&("object"==typeof e||"function"==typeof e))??(()=>!0),Zo);var Zo;const es=Ro([Li(),ro().int()]),ts=Li(),as=go({ttl:Ro([ro(),uo()]).optional(),pollInterval:ro().optional()}),ns=go({taskId:Li()}),rs=go({progressToken:es.optional(),[Yo]:ns.optional()}),is=go({task:as.optional(),_meta:rs.optional()}),os=To({method:Li(),params:is.optional()}),ss=go({_meta:To({[Yo]:Lo(ns)}).passthrough().optional()}),ps=To({method:Li(),params:ss.optional()}),ls=go({_meta:go({[Yo]:ns.optional()}).optional()}),us=Ro([Li(),ro().int()]),ds=To({jsonrpc:Po(Xo),id:us,...os.shape}).strict(),cs=e=>ds.safeParse(e).success,ms=To({jsonrpc:Po(Xo),...ps.shape}).strict(),fs=To({jsonrpc:Po(Xo),id:us,result:ls}).strict(),hs=e=>fs.safeParse(e).success;var _s;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"}(_s||(_s={}));const ys=To({jsonrpc:Po(Xo),id:us,error:To({code:ro().int(),message:Li(),data:Lo(mo())})}).strict(),Es=Ro([ds,ms,fs,ys]),Ts=ls.strict(),gs=ss.extend({requestId:us,reason:Li().optional()}),vs=ps.extend({method:Po("notifications/cancelled"),params:gs}),Rs=To({src:Li(),mimeType:Li().optional(),sizes:yo(Li()).optional()}),bs=To({icons:yo(Rs).optional()}),Os=To({name:Li(),title:Li().optional()}),Ns=Os.extend({...Os.shape,...bs.shape,version:Li(),websiteUrl:Li().optional()}),As=Ao(To({applyDefaults:po().optional()}),wo(Li(),mo())),Ss=Ko(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,Ao(To({form:As.optional(),url:Jo.optional()}),wo(Li(),mo()).optional())),ws=To({list:Lo(To({}).passthrough()),cancel:Lo(To({}).passthrough()),requests:Lo(To({sampling:Lo(To({createMessage:Lo(To({}).passthrough())}).passthrough()),elicitation:Lo(To({create:Lo(To({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),Is=To({list:Lo(To({}).passthrough()),cancel:Lo(To({}).passthrough()),requests:Lo(To({tools:Lo(To({call:Lo(To({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),Cs=To({experimental:wo(Li(),Jo).optional(),sampling:To({context:Jo.optional(),tools:Jo.optional()}).optional(),elicitation:Ss.optional(),roots:To({listChanged:po().optional()}).optional(),tasks:Lo(ws)}),Ds=is.extend({protocolVersion:Li(),capabilities:Cs,clientInfo:Ns}),Ps=os.extend({method:Po("initialize"),params:Ds}),js=To({experimental:wo(Li(),Jo).optional(),logging:Jo.optional(),completions:Jo.optional(),prompts:Lo(To({listChanged:Lo(po())})),resources:To({subscribe:po().optional(),listChanged:po().optional()}).optional(),tools:To({listChanged:po().optional()}).optional(),tasks:Lo(Is)}).passthrough(),ks=ls.extend({protocolVersion:Li(),capabilities:js,serverInfo:Ns,instructions:Li().optional()}),xs=ps.extend({method:Po("notifications/initialized")}),Ls=os.extend({method:Po("ping")}),Ms=To({progress:ro(),total:Lo(ro()),message:Lo(Li())}),Gs=To({...ss.shape,...Ms.shape,progressToken:es}),Fs=ps.extend({method:Po("notifications/progress"),params:Gs}),Bs=is.extend({cursor:ts.optional()}),zs=os.extend({params:Bs.optional()}),Vs=ls.extend({nextCursor:Lo(ts)}),$s=To({taskId:Li(),status:Co(["working","input_required","completed","failed","cancelled"]),ttl:Ro([ro(),uo()]),createdAt:Li(),lastUpdatedAt:Li(),pollInterval:Lo(ro()),statusMessage:Lo(Li())}),Us=ls.extend({task:$s}),Hs=ss.merge($s),qs=ps.extend({method:Po("notifications/tasks/status"),params:Hs}),Ks=os.extend({method:Po("tasks/get"),params:is.extend({taskId:Li()})}),Ws=ls.merge($s),Qs=os.extend({method:Po("tasks/result"),params:is.extend({taskId:Li()})}),Ys=zs.extend({method:Po("tasks/list")}),Xs=Vs.extend({tasks:yo($s)}),Js=os.extend({method:Po("tasks/cancel"),params:is.extend({taskId:Li()})}),Zs=ls.merge($s),ep=To({uri:Li(),mimeType:Lo(Li()),_meta:wo(Li(),mo()).optional()}),tp=ep.extend({text:Li()}),ap=Li().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),np=ep.extend({blob:ap}),rp=To({audience:yo(Co(["user","assistant"])).optional(),priority:ro().min(0).max(1).optional(),lastModified:gi({offset:!0}).optional()}),ip=To({...Os.shape,...bs.shape,uri:Li(),description:Lo(Li()),mimeType:Lo(Li()),annotations:rp.optional(),_meta:Lo(go({}))}),op=To({...Os.shape,...bs.shape,uriTemplate:Li(),description:Lo(Li()),mimeType:Lo(Li()),annotations:rp.optional(),_meta:Lo(go({}))}),sp=zs.extend({method:Po("resources/list")}),pp=Vs.extend({resources:yo(ip)}),lp=zs.extend({method:Po("resources/templates/list")}),up=Vs.extend({resourceTemplates:yo(op)}),dp=is.extend({uri:Li()}),cp=dp,mp=os.extend({method:Po("resources/read"),params:cp}),fp=ls.extend({contents:yo(Ro([tp,np]))}),hp=ps.extend({method:Po("notifications/resources/list_changed")}),_p=dp,yp=os.extend({method:Po("resources/subscribe"),params:_p}),Ep=dp,Tp=os.extend({method:Po("resources/unsubscribe"),params:Ep}),gp=ss.extend({uri:Li()}),vp=ps.extend({method:Po("notifications/resources/updated"),params:gp}),Rp=To({name:Li(),description:Lo(Li()),required:Lo(po())}),bp=To({...Os.shape,...bs.shape,description:Lo(Li()),arguments:Lo(yo(Rp)),_meta:Lo(go({}))}),Op=zs.extend({method:Po("prompts/list")}),Np=Vs.extend({prompts:yo(bp)}),Ap=is.extend({name:Li(),arguments:wo(Li(),Li()).optional()}),Sp=os.extend({method:Po("prompts/get"),params:Ap}),wp=To({type:Po("text"),text:Li(),annotations:rp.optional(),_meta:wo(Li(),mo()).optional()}),Ip=To({type:Po("image"),data:ap,mimeType:Li(),annotations:rp.optional(),_meta:wo(Li(),mo()).optional()}),Cp=To({type:Po("audio"),data:ap,mimeType:Li(),annotations:rp.optional(),_meta:wo(Li(),mo()).optional()}),Dp=To({type:Po("tool_use"),name:Li(),id:Li(),input:To({}).passthrough(),_meta:Lo(To({}).passthrough())}).passthrough(),Pp=To({type:Po("resource"),resource:Ro([tp,np]),annotations:rp.optional(),_meta:wo(Li(),mo()).optional()}),jp=Ro([wp,Ip,Cp,ip.extend({type:Po("resource_link")}),Pp]),kp=To({role:Co(["user","assistant"]),content:jp}),xp=ls.extend({description:Lo(Li()),messages:yo(kp)}),Lp=ps.extend({method:Po("notifications/prompts/list_changed")}),Mp=To({title:Li().optional(),readOnlyHint:po().optional(),destructiveHint:po().optional(),idempotentHint:po().optional(),openWorldHint:po().optional()}),Gp=To({taskSupport:Co(["required","optional","forbidden"]).optional()}),Fp=To({...Os.shape,...bs.shape,description:Li().optional(),inputSchema:To({type:Po("object"),properties:wo(Li(),Jo).optional(),required:yo(Li()).optional()}).catchall(mo()),outputSchema:To({type:Po("object"),properties:wo(Li(),Jo).optional(),required:yo(Li()).optional()}).catchall(mo()).optional(),annotations:Lo(Mp),execution:Lo(Gp),_meta:wo(Li(),mo()).optional()}),Bp=zs.extend({method:Po("tools/list")}),zp=Vs.extend({tools:yo(Fp)}),Vp=ls.extend({content:yo(jp).default([]),structuredContent:wo(Li(),mo()).optional(),isError:Lo(po())}),$p=(Vp.or(ls.extend({toolResult:mo()})),is.extend({name:Li(),arguments:Lo(wo(Li(),mo()))})),Up=os.extend({method:Po("tools/call"),params:$p}),Hp=ps.extend({method:Po("notifications/tools/list_changed")}),qp=Co(["debug","info","notice","warning","error","critical","alert","emergency"]),Kp=is.extend({level:qp}),Wp=os.extend({method:Po("logging/setLevel"),params:Kp}),Qp=ss.extend({level:qp,logger:Li().optional(),data:mo()}),Yp=ps.extend({method:Po("notifications/message"),params:Qp}),Xp=To({name:Li().optional()}),Jp=To({hints:Lo(yo(Xp)),costPriority:Lo(ro().min(0).max(1)),speedPriority:Lo(ro().min(0).max(1)),intelligencePriority:Lo(ro().min(0).max(1))}),Zp=To({mode:Lo(Co(["auto","required","none"]))}),el=To({type:Po("tool_result"),toolUseId:Li().describe("The unique identifier for the corresponding tool call."),content:yo(jp).default([]),structuredContent:To({}).passthrough().optional(),isError:Lo(po()),_meta:Lo(To({}).passthrough())}).passthrough(),tl=Oo("type",[wp,Ip,Cp]),al=Oo("type",[wp,Ip,Cp,Dp,el]),nl=To({role:Co(["user","assistant"]),content:Ro([al,yo(al)]),_meta:Lo(To({}).passthrough())}).passthrough(),rl=is.extend({messages:yo(nl),modelPreferences:Jp.optional(),systemPrompt:Li().optional(),includeContext:Co(["none","thisServer","allServers"]).optional(),temperature:ro().optional(),maxTokens:ro().int(),stopSequences:yo(Li()).optional(),metadata:Jo.optional(),tools:Lo(yo(Fp)),toolChoice:Lo(Zp)}),il=os.extend({method:Po("sampling/createMessage"),params:rl}),ol=ls.extend({model:Li(),stopReason:Lo(Co(["endTurn","stopSequence","maxTokens"]).or(Li())),role:Co(["user","assistant"]),content:tl}),sl=ls.extend({model:Li(),stopReason:Lo(Co(["endTurn","stopSequence","maxTokens","toolUse"]).or(Li())),role:Co(["user","assistant"]),content:Ro([al,yo(al)])}),pl=To({type:Po("boolean"),title:Li().optional(),description:Li().optional(),default:po().optional()}),ll=To({type:Po("string"),title:Li().optional(),description:Li().optional(),minLength:ro().optional(),maxLength:ro().optional(),format:Co(["email","uri","date","date-time"]).optional(),default:Li().optional()}),ul=To({type:Co(["number","integer"]),title:Li().optional(),description:Li().optional(),minimum:ro().optional(),maximum:ro().optional(),default:ro().optional()}),dl=To({type:Po("string"),title:Li().optional(),description:Li().optional(),enum:yo(Li()),default:Li().optional()}),cl=To({type:Po("string"),title:Li().optional(),description:Li().optional(),oneOf:yo(To({const:Li(),title:Li()})),default:Li().optional()}),ml=To({type:Po("string"),title:Li().optional(),description:Li().optional(),enum:yo(Li()),enumNames:yo(Li()).optional(),default:Li().optional()}),fl=Ro([dl,cl]),hl=Ro([To({type:Po("array"),title:Li().optional(),description:Li().optional(),minItems:ro().optional(),maxItems:ro().optional(),items:To({type:Po("string"),enum:yo(Li())}),default:yo(Li()).optional()}),To({type:Po("array"),title:Li().optional(),description:Li().optional(),minItems:ro().optional(),maxItems:ro().optional(),items:To({anyOf:yo(To({const:Li(),title:Li()}))}),default:yo(Li()).optional()})]),_l=Ro([ml,fl,hl]),yl=Ro([_l,pl,ll,ul]),El=Ro([is.extend({mode:Po("form").optional(),message:Li(),requestedSchema:To({type:Po("object"),properties:wo(Li(),yl),required:yo(Li()).optional()})}),is.extend({mode:Po("url"),message:Li(),elicitationId:Li(),url:Li().url()})]),Tl=os.extend({method:Po("elicitation/create"),params:El}),gl=ss.extend({elicitationId:Li()}),vl=ps.extend({method:Po("notifications/elicitation/complete"),params:gl}),Rl=ls.extend({action:Co(["accept","decline","cancel"]),content:Ko(e=>null===e?void 0:e,wo(Li(),Ro([Li(),ro(),po(),yo(Li())])).optional())}),bl=To({type:Po("ref/resource"),uri:Li()}),Ol=To({type:Po("ref/prompt"),name:Li()}),Nl=is.extend({ref:Ro([Ol,bl]),argument:To({name:Li(),value:Li()}),context:To({arguments:wo(Li(),Li()).optional()}).optional()}),Al=os.extend({method:Po("completion/complete"),params:Nl});const Sl=ls.extend({completion:go({values:yo(Li()).max(100),total:Lo(ro().int()),hasMore:Lo(po())})}),wl=To({uri:Li().startsWith("file://"),name:Li().optional(),_meta:wo(Li(),mo()).optional()}),Il=os.extend({method:Po("roots/list")}),Cl=ls.extend({roots:yo(wl)}),Dl=ps.extend({method:Po("notifications/roots/list_changed")});Ro([Ls,Ps,Al,Wp,Sp,Op,sp,lp,mp,yp,Tp,Up,Bp,Ks,Qs,Ys]),Ro([vs,Fs,xs,Dl,qs]),Ro([Ts,ol,sl,Rl,Cl,Ws,Xs,Us]),Ro([Ls,il,Tl,Il,Ks,Qs,Ys]),Ro([vs,Fs,Yp,vp,hp,Hp,Lp,qs,vl]),Ro([Ts,ks,Sl,xp,Np,pp,up,fp,Vp,zp,Ws,Xs,Us]);class Pl extends Error{constructor(e,t,a){super(`MCP error ${e}: ${t}`),this.code=e,this.data=a,this.name="McpError"}static fromError(e,t,a){if(e===_s.UrlElicitationRequired&&a){const e=a;if(e.elicitations)return new jl(e.elicitations,t)}return new Pl(e,t,a)}}class jl extends Pl{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(_s.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){var e,t;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.elicitations)&&void 0!==t?t:[]}}function kl(e){return"completed"===e||"failed"===e||"cancelled"===e}class xl{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??pi,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var a;const n=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){i.count++;return t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema}const o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);const s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{const a={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)o.ref=i,this.process(i,a),this.seen.get(i).isParent=!0;else{const t=o.schema;switch(n.type){case"string":{const a=t;a.type="string";const{minimum:n,maximum:i,format:s,patterns:p,contentEncoding:l}=e._zod.bag;if("number"==typeof n&&(a.minLength=n),"number"==typeof i&&(a.maxLength=i),s&&(a.format=r[s]??s,""===a.format&&delete a.format),l&&(a.contentEncoding=l),p&&p.size>0){const e=[...p];1===e.length?a.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{const a=t,{minimum:n,maximum:r,format:i,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:p}=e._zod.bag;"string"==typeof i&&i.includes("int")?a.type="integer":a.type="number","number"==typeof p&&(a.exclusiveMinimum=p),"number"==typeof n&&(a.minimum=n,"number"==typeof p&&(p>=n?delete a.minimum:delete a.exclusiveMinimum)),"number"==typeof s&&(a.exclusiveMaximum=s),"number"==typeof r&&(a.maximum=r,"number"==typeof s&&(s<=r?delete a.maximum:delete a.exclusiveMaximum)),"number"==typeof o&&(a.multipleOf=o);break}case"boolean":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const r=t,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof o&&(r.maxItems=o),r.type="array",r.items=this.process(n.element,{...a,path:[...a.path,"items"]});break}case"object":{const e=t;e.type="object",e.properties={};const r=n.shape;for(const t in r)e.properties[t]=this.process(r[t],{...a,path:[...a.path,"properties",t]});const i=new Set(Object.keys(r)),o=new Set([...i].filter(e=>{const t=n.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));o.size>0&&(e.required=Array.from(o)),"never"===n.catchall?._zod.def.type?e.additionalProperties=!1:n.catchall?n.catchall&&(e.additionalProperties=this.process(n.catchall,{...a,path:[...a.path,"additionalProperties"]})):"output"===this.io&&(e.additionalProperties=!1);break}case"union":t.anyOf=n.options.map((e,t)=>this.process(e,{...a,path:[...a.path,"anyOf",t]}));break;case"intersection":{const e=t,r=this.process(n.left,{...a,path:[...a.path,"allOf",0]}),i=this.process(n.right,{...a,path:[...a.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,s=[...o(r)?r.allOf:[r],...o(i)?i.allOf:[i]];e.allOf=s;break}case"tuple":{const r=t;r.type="array";const i=n.items.map((e,t)=>this.process(e,{...a,path:[...a.path,"prefixItems",t]}));if("draft-2020-12"===this.target?r.prefixItems=i:r.items=i,n.rest){const e=this.process(n.rest,{...a,path:[...a.path,"items"]});"draft-2020-12"===this.target?r.items=e:r.additionalItems=e}n.rest&&(r.items=this.process(n.rest,{...a,path:[...a.path,"items"]}));const{minimum:o,maximum:s}=e._zod.bag;"number"==typeof o&&(r.minItems=o),"number"==typeof s&&(r.maxItems=s);break}case"record":{const e=t;e.type="object",e.propertyNames=this.process(n.keyType,{...a,path:[...a.path,"propertyNames"]}),e.additionalProperties=this.process(n.valueType,{...a,path:[...a.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const e=t,a=za(n.entries);a.every(e=>"number"==typeof e)&&(e.type="number"),a.every(e=>"string"==typeof e)&&(e.type="string"),e.enum=a;break}case"literal":{const e=t,a=[];for(const e of n.values)if(void 0===e){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(e))}else a.push(e);if(0===a.length);else if(1===a.length){const t=a[0];e.type=null===t?"null":typeof t,e.const=t}else a.every(e=>"number"==typeof e)&&(e.type="number"),a.every(e=>"string"==typeof e)&&(e.type="string"),a.every(e=>"boolean"==typeof e)&&(e.type="string"),a.every(e=>null===e)&&(e.type="null"),e.enum=a;break}case"file":{const a=t,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:i,mime:o}=e._zod.bag;void 0!==r&&(n.minLength=r),void 0!==i&&(n.maxLength=i),o?1===o.length?(n.contentMediaType=o[0],Object.assign(a,n)):a.anyOf=o.map(e=>({...n,contentMediaType:e})):Object.assign(a,n);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const e=this.process(n.innerType,a);t.anyOf=[e,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(n.innerType,a),o.ref=n.innerType;break;case"success":t.type="boolean";break;case"default":this.process(n.innerType,a),o.ref=n.innerType,t.default=JSON.parse(JSON.stringify(n.defaultValue));break;case"prefault":this.process(n.innerType,a),o.ref=n.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break;case"catch":{let e;this.process(n.innerType,a),o.ref=n.innerType;try{e=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const a=t,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=n.source;break}case"pipe":{const e="input"===this.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;this.process(e,a),o.ref=e;break}case"readonly":this.process(n.innerType,a),o.ref=n.innerType,t.readOnly=!0;break;case"lazy":{const t=e._zod.innerType;this.process(t,a),o.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const p=this.metadataRegistry.get(e);p&&Object.assign(o.schema,p),"input"===this.io&&Ll(e)&&(delete o.schema.examples,delete o.schema.default),"input"===this.io&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault;return this.seen.get(e).schema}emit(e,t){const a={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=e=>{const t="draft-2020-12"===this.target?"$defs":"definitions";if(a.external){const n=a.external.registry.get(e[0])?.id,r=a.external.uri??(e=>e);if(n)return{ref:r(n)};const i=e[1].defId??e[1].schema.id??"schema"+this.counter++;return e[1].defId=i,{defId:i,ref:`${r("__shared")}#/${t}/${i}`}}if(e[1]===n)return{ref:"#"};const r=`#/${t}/`,i=e[1].schema.id??"__schema"+this.counter++;return{defId:i,ref:r+i}},i=e=>{if(e[1].schema.$ref)return;const t=e[1],{ref:a,defId:n}=r(e);t.def={...t.schema},n&&(t.defId=n);const i=t.schema;for(const e in i)delete i[e];i.$ref=a};if("throw"===a.cycles)for(const e of this.seen.entries()){const t=e[1];if(t.cycle)throw new Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const t of this.seen.entries()){const n=t[1];if(e===t[0]){i(t);continue}if(a.external){const n=a.external.registry.get(t[0])?.id;if(e!==t[0]&&n){i(t);continue}}const r=this.metadataRegistry.get(t[0])?.id;r?i(t):(n.cycle||n.count>1&&"ref"===a.reused)&&i(t)}const o=(e,t)=>{const a=this.seen.get(e),n=a.def??a.schema,r={...n};if(null===a.ref)return;const i=a.ref;if(a.ref=null,i){o(i,t);const e=this.seen.get(i).schema;e.$ref&&"draft-7"===t.target?(n.allOf=n.allOf??[],n.allOf.push(e)):(Object.assign(n,e),Object.assign(n,r))}a.isParent||this.override({zodSchema:e,jsonSchema:n,path:a.path??[]})};for(const e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});const s={};if("draft-2020-12"===this.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?s.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),a.external?.uri){const t=a.external.registry.get(e)?.id;if(!t)throw new Error("Schema is missing an `id` property");s.$id=a.external.uri(t)}Object.assign(s,n.def);const p=a.external?.defs??{};for(const e of this.seen.entries()){const t=e[1];t.def&&t.defId&&(p[t.defId]=t.def)}a.external||Object.keys(p).length>0&&("draft-2020-12"===this.target?s.$defs=p:s.definitions=p);try{return JSON.parse(JSON.stringify(s))}catch(e){throw new Error("Error converting schema to JSON.")}}}function Ll(e,t){const a=t??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const n=e._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return Ll(n.element,a);case"object":for(const e in n.shape)if(Ll(n.shape[e],a))return!0;return!1;case"union":for(const e of n.options)if(Ll(e,a))return!0;return!1;case"intersection":return Ll(n.left,a)||Ll(n.right,a);case"tuple":for(const e of n.items)if(Ll(e,a))return!0;return!(!n.rest||!Ll(n.rest,a));case"record":case"map":return Ll(n.keyType,a)||Ll(n.valueType,a);case"set":return Ll(n.valueType,a);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return Ll(n.innerType,a);case"lazy":return Ll(n.getter(),a);case"transform":return!0;case"pipe":return Ll(n.in,a)||Ll(n.out,a)}throw new Error(`Unknown schema type: ${n.type}`)}const Ml=Symbol("Let zodToJsonSchema decide on which parser to use"),Gl={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Fl=e=>{const t=(e=>"string"==typeof e?{...Gl,name:e}:{...Gl,...e})(e),a=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},Bl=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function zl(e){if("openAi"!==e.target)return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?Bl(t,e.currentPath):t.join("/")}}function Vl(e,t,a,n){n?.errorMessages&&a&&(e.errorMessage={...e.errorMessage,[t]:a})}function $l(e,t,a,n,r){e[t]=a,Vl(e,t,n,r)}function Ul(e,t){return yu(e.type._def,t)}function Hl(e,t,a){const n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((a,n)=>Hl(e,t,a))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ql(e,t)}}const ql=(e,t)=>{const a={type:"integer",format:"unix-time"};if("openApi3"===t.target)return a;for(const n of e.checks)switch(n.kind){case"min":$l(a,"minimum",n.value,n.message,t);break;case"max":$l(a,"maximum",n.value,n.message,t)}return a};let Kl;const Wl=/^[cC][^\s-]{8,}$/,Ql=/^[0-9a-z]+$/,Yl=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xl=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,Jl=()=>(void 0===Kl&&(Kl=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kl),Zl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,eu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,au=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nu=/^[a-zA-Z0-9_-]{21}$/,ru=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function iu(e,t){const a={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":$l(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t);break;case"max":$l(a,"maxLength","number"==typeof a.maxLength?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":pu(a,"email",n.message,t);break;case"format:idn-email":pu(a,"idn-email",n.message,t);break;case"pattern:zod":lu(a,Xl,n.message,t)}break;case"url":pu(a,"uri",n.message,t);break;case"uuid":pu(a,"uuid",n.message,t);break;case"regex":lu(a,n.regex,n.message,t);break;case"cuid":lu(a,Wl,n.message,t);break;case"cuid2":lu(a,Ql,n.message,t);break;case"startsWith":lu(a,RegExp(`^${ou(n.value,t)}`),n.message,t);break;case"endsWith":lu(a,RegExp(`${ou(n.value,t)}$`),n.message,t);break;case"datetime":pu(a,"date-time",n.message,t);break;case"date":pu(a,"date",n.message,t);break;case"time":pu(a,"time",n.message,t);break;case"duration":pu(a,"duration",n.message,t);break;case"length":$l(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t),$l(a,"maxLength","number"==typeof a.maxLength?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"includes":lu(a,RegExp(ou(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&pu(a,"ipv4",n.message,t),"v4"!==n.version&&pu(a,"ipv6",n.message,t);break;case"base64url":lu(a,au,n.message,t);break;case"jwt":lu(a,ru,n.message,t);break;case"cidr":"v6"!==n.version&&lu(a,Zl,n.message,t),"v4"!==n.version&&lu(a,eu,n.message,t);break;case"emoji":lu(a,Jl(),n.message,t);break;case"ulid":lu(a,Yl,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":pu(a,"binary",n.message,t);break;case"contentEncoding:base64":$l(a,"contentEncoding","base64",n.message,t);break;case"pattern:zod":lu(a,tu,n.message,t)}break;case"nanoid":lu(a,nu,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return a}function ou(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let a=0;a<e.length;a++)su.has(e[a])||(t+="\\"),t+=e[a];return t}(e):e}const su=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function pu(e,t,a,n){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):$l(e,"format",t,a,n)}function lu(e,t,a,n){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:uu(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):$l(e,"pattern",uu(t,n),a,n)}function uu(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const a=e.flags.includes("i"),n=e.flags.includes("m"),r=e.flags.includes("s"),i=a?e.source.toLowerCase():e.source;let o="",s=!1,p=!1,l=!1;for(let e=0;e<i.length;e++)if(s)o+=i[e],s=!1;else{if(a)if(p){if(i[e].match(/[a-z]/)){l?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),l=!1):"-"===i[e+1]&&i[e+2]?.match(/[a-z]/)?(o+=i[e],l=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(n){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}r&&"."===i[e]?o+=p?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?s=!0:p&&"]"===i[e]?p=!1:p||"["!==i[e]||(p=!0))}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function du(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===ra.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((a,n)=>({...a,[n]:yu(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??zl(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};const a={type:"object",additionalProperties:yu(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return a;if(e.keyType?._def.typeName===ra.ZodString&&e.keyType._def.checks?.length){const{type:n,...r}=iu(e.keyType._def,t);return{...a,propertyNames:r}}if(e.keyType?._def.typeName===ra.ZodEnum)return{...a,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===ra.ZodBranded&&e.keyType._def.type._def.typeName===ra.ZodString&&e.keyType._def.type._def.checks?.length){const{type:n,...r}=Ul(e.keyType._def,t);return{...a,propertyNames:r}}return a}const cu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};const mu=(e,t)=>{const a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,a)=>yu(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return a.length?{anyOf:a}:void 0};function fu(e,t){const a="openAi"===t.target,n={type:"object",properties:{}},r=[],i=e.shape();for(const e in i){let o=i[e];if(void 0===o||void 0===o._def)continue;let s=hu(o);s&&a&&("ZodOptional"===o._def.typeName&&(o=o._def.innerType),o.isNullable()||(o=o.nullable()),s=!1);const p=yu(o._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==p&&(n.properties[e]=p,s||r.push(e))}r.length&&(n.required=r);const o=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return yu(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==o&&(n.additionalProperties=o),n}function hu(e){try{return e.isOptional()}catch{return!0}}const _u=(e,t,a)=>{switch(t){case ra.ZodString:return iu(e,a);case ra.ZodNumber:return function(e,t){const a={type:"number"};if(!e.checks)return a;for(const n of e.checks)switch(n.kind){case"int":a.type="integer",Vl(a,"type",n.message,t);break;case"min":"jsonSchema7"===t.target?n.inclusive?$l(a,"minimum",n.value,n.message,t):$l(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),$l(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?$l(a,"maximum",n.value,n.message,t):$l(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),$l(a,"maximum",n.value,n.message,t));break;case"multipleOf":$l(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case ra.ZodObject:return fu(e,a);case ra.ZodBigInt:return function(e,t){const a={type:"integer",format:"int64"};if(!e.checks)return a;for(const n of e.checks)switch(n.kind){case"min":"jsonSchema7"===t.target?n.inclusive?$l(a,"minimum",n.value,n.message,t):$l(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),$l(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?$l(a,"maximum",n.value,n.message,t):$l(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),$l(a,"maximum",n.value,n.message,t));break;case"multipleOf":$l(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case ra.ZodBoolean:return{type:"boolean"};case ra.ZodDate:return Hl(e,a);case ra.ZodUndefined:return function(e){return{not:zl(e)}}(a);case ra.ZodNull:return function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}(a);case ra.ZodArray:return function(e,t){const a={type:"array"};return e.type?._def&&e.type?._def?.typeName!==ra.ZodAny&&(a.items=yu(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&$l(a,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&$l(a,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&($l(a,"minItems",e.exactLength.value,e.exactLength.message,t),$l(a,"maxItems",e.exactLength.value,e.exactLength.message,t)),a}(e,a);case ra.ZodUnion:case ra.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return mu(e,t);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(e=>e._def.typeName in cu&&(!e._def.checks||!e._def.checks.length))){const e=a.reduce((e,t)=>{const a=cu[t._def.typeName];return a&&!e.includes(a)?[...e,a]:e},[]);return{type:e.length>1?e:e[0]}}if(a.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=a.reduce((e,t)=>{const a=typeof t._def.value;switch(a){case"string":case"number":case"boolean":return[...e,a];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===a.length){const t=e.filter((e,t,a)=>a.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:a.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(a.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:a.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return mu(e,t)}(e,a);case ra.ZodIntersection:return function(e,t){const a=[yu(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),yu(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e);let n="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:a,...n}=e;t=n}else n=void 0;r.push(t)}else r.push(...e.allOf),void 0===e.unevaluatedProperties&&(n=void 0);var t}),r.length?{allOf:r,...n}:void 0}(e,a);case ra.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,a)=>yu(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:yu(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,a)=>yu(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,a);case ra.ZodRecord:return du(e,a);case ra.ZodLiteral:return function(e,t){const a=typeof e.value;return"bigint"!==a&&"number"!==a&&"boolean"!==a&&"string"!==a?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===a?"integer":a,enum:[e.value]}:{type:"bigint"===a?"integer":a,const:e.value}}(e,a);case ra.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case ra.ZodNativeEnum:return function(e){const t=e.values,a=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),n=Array.from(new Set(a.map(e=>typeof e)));return{type:1===n.length?"string"===n[0]?"string":"number":["string","number"],enum:a}}(e);case ra.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:cu[e.innerType._def.typeName],nullable:!0}:{type:[cu[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const a=yu(e.innerType._def,{...t,currentPath:[...t.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}const a=yu(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}(e,a);case ra.ZodOptional:return((e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return yu(e.innerType._def,t);const a=yu(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:zl(t)},a]}:zl(t)})(e,a);case ra.ZodMap:return function(e,t){return"record"===t.mapStrategy?du(e,t):{type:"array",maxItems:125,items:{type:"array",items:[yu(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||zl(t),yu(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||zl(t)],minItems:2,maxItems:2}}}(e,a);case ra.ZodSet:return function(e,t){const a={type:"array",uniqueItems:!0,items:yu(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&$l(a,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&$l(a,"maxItems",e.maxSize.value,e.maxSize.message,t),a}(e,a);case ra.ZodLazy:return()=>e.getter()._def;case ra.ZodPromise:return function(e,t){return yu(e.type._def,t)}(e,a);case ra.ZodNaN:case ra.ZodNever:return function(e){return"openAi"===e.target?void 0:{not:zl({...e,currentPath:[...e.currentPath,"not"]})}}(a);case ra.ZodEffects:return function(e,t){return"input"===t.effectStrategy?yu(e.schema._def,t):zl(t)}(e,a);case ra.ZodAny:return zl(a);case ra.ZodUnknown:return function(e){return zl(e)}(a);case ra.ZodDefault:return function(e,t){return{...yu(e.innerType._def,t),default:e.defaultValue()}}(e,a);case ra.ZodBranded:return Ul(e,a);case ra.ZodReadonly:case ra.ZodCatch:return((e,t)=>yu(e.innerType._def,t))(e,a);case ra.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return yu(e.in._def,t);if("output"===t.pipeStrategy)return yu(e.out._def,t);const a=yu(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[a,yu(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]})].filter(e=>void 0!==e)}})(e,a);case ra.ZodFunction:case ra.ZodVoid:case ra.ZodSymbol:default:return}};function yu(e,t,a=!1){const n=t.seen.get(e);if(t.override){const r=t.override?.(e,t,n,a);if(r!==Ml)return r}if(n&&!a){const e=Eu(n,t);if(void 0!==e)return e}const r={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,r);const i=_u(e,e.typeName,t),o="function"==typeof i?yu(i(),t):i;if(o&&Tu(e,t,o),t.postProcess){const a=t.postProcess(o,e,t);return r.jsonSchema=o,a}return r.jsonSchema=o,o}const Eu=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Bl(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,a)=>t.currentPath[a]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),zl(t)):"seen"===t.$refStrategy?zl(t):void 0}},Tu=(e,t,a)=>(e.description&&(a.description=e.description,t.markdownDescription&&(a.markdownDescription=e.description)),a);function gu(e,t){var a,n,r,i;return Jr(e)?function(e,t){if(e instanceof oi){const a=new xl(t),n={};for(const t of e._idmap.entries()){const[e,n]=t;a.process(n)}const r={},i={registry:e,uri:t?.uri,defs:n};for(const n of e._idmap.entries()){const[e,o]=n;r[e]=a.emit(o,{...t,external:i})}if(Object.keys(n).length>0){const e="draft-2020-12"===a.target?"$defs":"definitions";r.__shared={[e]:n}}return{schemas:r}}const a=new xl(t);return a.process(e),a.emit(e,t)}(e,{target:(i=null==t?void 0:t.target,i?"jsonSchema7"===i||"draft-7"===i?"draft-7":"jsonSchema2019-09"===i||"draft-2020-12"===i?"draft-2020-12":"draft-7":"draft-7"),io:null!==(a=null==t?void 0:t.pipeStrategy)&&void 0!==a?a:"input"}):((e,t)=>{const a=Fl(t);let n="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>({...e,[t]:yu(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0)??zl(a)}),{}):void 0;const r="string"==typeof t?t:"title"===t?.nameStrategy?void 0:t?.name,i=yu(e._def,void 0===r?a:{...a,currentPath:[...a.basePath,a.definitionPath,r]},!1)??zl(a),o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o),a.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[a.openAiAnyTypeName]||(n[a.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===a.$refStrategy?"1":[...a.basePath,a.definitionPath,a.openAiAnyTypeName].join("/")}}));const s=void 0===r?n?{...i,[a.definitionPath]:n}:i:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,r].join("/"),[a.definitionPath]:{...n,[r]:i}};return"jsonSchema7"===a.target?s.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==a.target&&"openAi"!==a.target||(s.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===a.target&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s})(e,{strictUnions:null===(n=null==t?void 0:t.strictUnions)||void 0===n||n,pipeStrategy:null!==(r=null==t?void 0:t.pipeStrategy)&&void 0!==r?r:"input"})}function vu(e){const t=ai(e),a=null==t?void 0:t.method;if(!a)throw new Error("Schema is missing a method literal");const n=ii(a);if("string"!=typeof n)throw new Error("Schema method literal must be a string");return n}function Ru(e,t){const a=ei(e,t);if(!a.success)throw a.error;return a.data}class bu{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(vs,e=>{this._oncancel(e)}),this.setNotificationHandler(Fs,e=>{this._onprogress(e)}),this.setRequestHandler(Ls,e=>({})),this._taskStore=null==e?void 0:e.taskStore,this._taskMessageQueue=null==e?void 0:e.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ks,async(e,t)=>{const a=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!a)throw new Pl(_s.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(Qs,async(e,t)=>{const a=async()=>{var n;const r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if("response"===e.type||"error"===e.type){const t=e.message,a=t.id,n=this._requestResolvers.get(a);if(n)if(this._requestResolvers.delete(a),"response"===e.type)n(t);else{const e=t;n(new Pl(e.error.code,e.error.message,e.error.data))}else{const t="response"===e.type?"Response":"Error";this._onerror(new Error(`${t} handler missing for request ${a}`))}continue}await(null===(n=this._transport)||void 0===n?void 0:n.send(e.message,{relatedRequestId:t.requestId}))}}const i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Pl(_s.InvalidParams,`Task not found: ${r}`);if(!kl(i.status))return await this._waitForTaskUpdate(r,t.signal),await a();if(kl(i.status)){const e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Yo]:{taskId:r}}}}return await a()};return await a()}),this.setRequestHandler(Ys,async(e,t)=>{var a;try{const{tasks:n,nextCursor:r}=await this._taskStore.listTasks(null===(a=e.params)||void 0===a?void 0:a.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Pl(_s.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Js,async(e,t)=>{try{const a=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!a)throw new Pl(_s.InvalidParams,`Task not found: ${e.params.taskId}`);if(kl(a.status))throw new Pl(_s.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,"cancelled","Client cancelled task execution.",t.sessionId),this._clearTaskQueue(e.params.taskId);const n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Pl(_s.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...n}}catch(e){if(e instanceof Pl)throw e;throw new Pl(_s.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)}_setupTimeout(e,t,a,n,r=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,t),startTime:Date.now(),timeout:t,maxTotalTimeout:a,resetTimeoutOnProgress:r,onTimeout:n})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const a=Date.now()-t.startTime;if(t.maxTotalTimeout&&a>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Pl.fromError(_s.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:a});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,a,n;this._transport=e;const r=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==r||r(),this._onclose()};const i=null===(a=this.transport)||void 0===a?void 0:a.onerror;this._transport.onerror=e=>{null==i||i(e),this._onerror(e)};const o=null===(n=this._transport)||void 0===n?void 0:n.onmessage;this._transport.onmessage=(e,t)=>{var a;null==o||o(e,t),hs(e)||(a=e,ys.safeParse(a).success)?this._onresponse(e):cs(e)?this._onrequest(e,t):(e=>ms.safeParse(e).success)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const a=Pl.fromError(_s.ConnectionClosed,"Connection closed");this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);for(const e of t.values())e(a)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const a=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==a&&Promise.resolve().then(()=>a(e)).catch(e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var a,n,r,i,o,s;const p=null!==(a=this._requestHandlers.get(e.method))&&void 0!==a?a:this.fallbackRequestHandler,l=this._transport,u=null===(i=null===(r=null===(n=e.params)||void 0===n?void 0:n._meta)||void 0===r?void 0:r[Yo])||void 0===i?void 0:i.taskId;if(void 0===p){const t={jsonrpc:"2.0",id:e.id,error:{code:_s.MethodNotFound,message:"Method not found"}};return void(u&&this._taskMessageQueue?this._enqueueTaskMessage(u,{type:"error",message:t,timestamp:Date.now()},null==l?void 0:l.sessionId).catch(e=>this._onerror(new Error(`Failed to enqueue error response: ${e}`))):null==l||l.send(t).catch(e=>this._onerror(new Error(`Failed to send an error response: ${e}`))))}const d=new AbortController;this._requestHandlerAbortControllers.set(e.id,d);const c=null===(o=e.params)||void 0===o?void 0:o.task,m=this._taskStore?this.requestTaskStore(e,null==l?void 0:l.sessionId):void 0,f={signal:d.signal,sessionId:null==l?void 0:l.sessionId,_meta:null===(s=e.params)||void 0===s?void 0:s._meta,sendNotification:async t=>{const a={relatedRequestId:e.id};u&&(a.relatedTask={taskId:u}),await this.notification(t,a)},sendRequest:async(t,a,n)=>{var r,i;const o={...n,relatedRequestId:e.id};u&&!o.relatedTask&&(o.relatedTask={taskId:u});const s=null!==(i=null===(r=o.relatedTask)||void 0===r?void 0:r.taskId)&&void 0!==i?i:u;return s&&m&&await m.updateTaskStatus(s,"input_required"),await this.request(t,a,o)},authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo,taskId:u,taskStore:m,taskRequestedTtl:null==c?void 0:c.ttl,closeSSEStream:null==t?void 0:t.closeSSEStream,closeStandaloneSSEStream:null==t?void 0:t.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>p(e,f)).then(async t=>{if(d.signal.aborted)return;const a={result:t,jsonrpc:"2.0",id:e.id};u&&this._taskMessageQueue?await this._enqueueTaskMessage(u,{type:"response",message:a,timestamp:Date.now()},null==l?void 0:l.sessionId):await(null==l?void 0:l.send(a))},async t=>{var a;if(d.signal.aborted)return;const n={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:_s.InternalError,message:null!==(a=t.message)&&void 0!==a?a:"Internal error",...void 0!==t.data&&{data:t.data}}};u&&this._taskMessageQueue?await this._enqueueTaskMessage(u,{type:"error",message:n,timestamp:Date.now()},null==l?void 0:l.sessionId):await(null==l?void 0:l.send(n))}).catch(e=>this._onerror(new Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...a}=e.params,n=Number(t),r=this._progressHandlers.get(n);if(!r)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(n),o=this._timeoutInfo.get(n);if(o&&i&&o.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(e){return this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),void i(e)}r(a)}_onresponse(e){const t=Number(e.id),a=this._requestResolvers.get(t);if(a){if(this._requestResolvers.delete(t),hs(e))a(e);else{a(new Pl(e.error.code,e.error.message,e.error.data))}return}const n=this._responseHandlers.get(t);if(void 0===n)return void this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));this._responseHandlers.delete(t),this._cleanupTimeout(t);let r=!1;if(hs(e)&&e.result&&"object"==typeof e.result){const a=e.result;if(a.task&&"object"==typeof a.task){const e=a.task;"string"==typeof e.taskId&&(r=!0,this._taskProgressTokens.set(e.taskId,t))}}if(r||this._progressHandlers.delete(t),hs(e))n(e);else{n(Pl.fromError(e.error.code,e.error.message,e.error.data))}}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}async*requestStream(e,t,a){var n,r,i,o;const{task:s}=null!=a?a:{};if(!s){try{const n=await this.request(e,t,a);yield{type:"result",result:n}}catch(e){yield{type:"error",error:e instanceof Pl?e:new Pl(_s.InternalError,String(e))}}return}let p;try{const s=await this.request(e,Us,a);if(!s.task)throw new Pl(_s.InternalError,"Task creation did not return a task");for(p=s.task.taskId,yield{type:"taskCreated",task:s.task};;){const e=await this.getTask({taskId:p},a);if(yield{type:"taskStatus",task:e},kl(e.status)){if("completed"===e.status){const e=await this.getTaskResult({taskId:p},t,a);yield{type:"result",result:e}}else"failed"===e.status?yield{type:"error",error:new Pl(_s.InternalError,`Task ${p} failed`)}:"cancelled"===e.status&&(yield{type:"error",error:new Pl(_s.InternalError,`Task ${p} was cancelled`)});return}if("input_required"===e.status){const e=await this.getTaskResult({taskId:p},t,a);return void(yield{type:"result",result:e})}const s=null!==(i=null!==(n=e.pollInterval)&&void 0!==n?n:null===(r=this._options)||void 0===r?void 0:r.defaultTaskPollInterval)&&void 0!==i?i:1e3;await new Promise(e=>setTimeout(e,s)),null===(o=null==a?void 0:a.signal)||void 0===o||o.throwIfAborted()}}catch(e){yield{type:"error",error:e instanceof Pl?e:new Pl(_s.InternalError,String(e))}}}request(e,t,a){const{relatedRequestId:n,resumptionToken:r,onresumptiontoken:i,task:o,relatedTask:s}=null!=a?a:{};return new Promise((p,l)=>{var u,d,c,m,f,h,_;const y=e=>{l(e)};if(!this._transport)return void y(new Error("Not connected"));if(!0===(null===(u=this._options)||void 0===u?void 0:u.enforceStrictCapabilities))try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){return void y(e)}null===(d=null==a?void 0:a.signal)||void 0===d||d.throwIfAborted();const E=this._requestMessageId++,T={...e,jsonrpc:"2.0",id:E};(null==a?void 0:a.onprogress)&&(this._progressHandlers.set(E,a.onprogress),T.params={...e.params,_meta:{...(null===(c=e.params)||void 0===c?void 0:c._meta)||{},progressToken:E}}),o&&(T.params={...T.params,task:o}),s&&(T.params={...T.params,_meta:{...(null===(m=T.params)||void 0===m?void 0:m._meta)||{},[Yo]:s}});const g=e=>{var t;this._responseHandlers.delete(E),this._progressHandlers.delete(E),this._cleanupTimeout(E),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,reason:String(e)}},{relatedRequestId:n,resumptionToken:r,onresumptiontoken:i}).catch(e=>this._onerror(new Error(`Failed to send cancellation: ${e}`)));const a=e instanceof Pl?e:new Pl(_s.RequestTimeout,String(e));l(a)};this._responseHandlers.set(E,e=>{var n;if(!(null===(n=null==a?void 0:a.signal)||void 0===n?void 0:n.aborted)){if(e instanceof Error)return l(e);try{const a=ei(t,e.result);a.success?p(a.data):l(a.error)}catch(e){l(e)}}}),null===(f=null==a?void 0:a.signal)||void 0===f||f.addEventListener("abort",()=>{var e;g(null===(e=null==a?void 0:a.signal)||void 0===e?void 0:e.reason)});const v=null!==(h=null==a?void 0:a.timeout)&&void 0!==h?h:6e4;this._setupTimeout(E,v,null==a?void 0:a.maxTotalTimeout,()=>g(Pl.fromError(_s.RequestTimeout,"Request timed out",{timeout:v})),null!==(_=null==a?void 0:a.resetTimeoutOnProgress)&&void 0!==_&&_);const R=null==s?void 0:s.taskId;if(R){const e=e=>{const t=this._responseHandlers.get(E);t?t(e):this._onerror(new Error(`Response handler missing for side-channeled request ${E}`))};this._requestResolvers.set(E,e),this._enqueueTaskMessage(R,{type:"request",message:T,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(E),l(e)})}else this._transport.send(T,{relatedRequestId:n,resumptionToken:r,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(E),l(e)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Ws,t)}async getTaskResult(e,t,a){return this.request({method:"tasks/result",params:e},t,a)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Xs,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Zs,t)}async notification(e,t){var a,n,r,i,o;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=null===(a=null==t?void 0:t.relatedTask)||void 0===a?void 0:a.taskId;if(s){const a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...(null===(n=e.params)||void 0===n?void 0:n._meta)||{},[Yo]:t.relatedTask}}};return void await this._enqueueTaskMessage(s,{type:"notification",message:a,timestamp:Date.now()})}if((null!==(i=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==i?i:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)&&!(null==t?void 0:t.relatedTask)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then(()=>{var a,n;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let r={...e,jsonrpc:"2.0"};(null==t?void 0:t.relatedTask)&&(r={...r,params:{...r.params,_meta:{...(null===(a=r.params)||void 0===a?void 0:a._meta)||{},[Yo]:t.relatedTask}}}),null===(n=this._transport)||void 0===n||n.send(r,t).catch(e=>this._onerror(e))})}let p={...e,jsonrpc:"2.0"};(null==t?void 0:t.relatedTask)&&(p={...p,params:{...p.params,_meta:{...(null===(o=p.params)||void 0===o?void 0:o._meta)||{},[Yo]:t.relatedTask}}}),await this._transport.send(p,t)}setRequestHandler(e,t){const a=vu(e);this.assertRequestHandlerCapability(a),this._requestHandlers.set(a,(a,n)=>{const r=Ru(e,a);return Promise.resolve(t(r,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const a=vu(e);this._notificationHandlers.set(a,a=>{const n=Ru(e,a);return Promise.resolve(t(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);void 0!==t&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,a){var n;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=null===(n=this._options)||void 0===n?void 0:n.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,a,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const a=await this._taskMessageQueue.dequeueAll(e,t);for(const t of a)if("request"===t.type&&cs(t.message)){const a=t.message.id,n=this._requestResolvers.get(a);n?(n(new Pl(_s.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){var a,n,r;let i=null!==(n=null===(a=this._options)||void 0===a?void 0:a.defaultTaskPollInterval)&&void 0!==n?n:1e3;try{const t=await(null===(r=this._taskStore)||void 0===r?void 0:r.getTask(e));(null==t?void 0:t.pollInterval)&&(i=t.pollInterval)}catch(e){}return new Promise((e,a)=>{if(t.aborted)return void a(new Pl(_s.InvalidRequest,"Request cancelled"));const n=setTimeout(e,i);t.addEventListener("abort",()=>{clearTimeout(n),a(new Pl(_s.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const a=this._taskStore;if(!a)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await a.createTask(n,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{const n=await a.getTask(e,t);if(!n)throw new Pl(_s.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(e,n,r)=>{await a.storeTaskResult(e,n,r,t);const i=await a.getTask(e,t);if(i){const t=qs.parse({method:"notifications/tasks/status",params:i});await this.notification(t),kl(i.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>a.getTaskResult(e,t),updateTaskStatus:async(e,n,r)=>{const i=await a.getTask(e,t);if(!i)throw new Pl(_s.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(kl(i.status))throw new Pl(_s.InvalidParams,`Cannot update task "${e}" from terminal status "${i.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await a.updateTaskStatus(e,n,r,t);const o=await a.getTask(e,t);if(o){const t=qs.parse({method:"notifications/tasks/status",params:o});await this.notification(t),kl(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>a.listTasks(e,t)}}}function Ou(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var Nu=c(1601),Au=c(4421);class Su{constructor(e){this._ajv=null!=e?e:function(){const e=new Nu.Ajv({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Au(e),e}()}getValidator(e){var t;const a="$id"in e&&"string"==typeof e.$id&&null!==(t=this._ajv.getSchema(e.$id))&&void 0!==t?t:this._ajv.compile(e);return e=>a(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(a.errors)}}}class wu{constructor(e){this._server=e}requestStream(e,t,a){return this._server.requestStream(e,t,a)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,a){return this._server.getTaskResult({taskId:e},t,a)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}class Iu extends bu{constructor(e,t){var a,n;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(qp.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{const a=this._loggingLevels.get(t);return!!a&&this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(a)},this._capabilities=null!==(a=null==t?void 0:t.capabilities)&&void 0!==a?a:{},this._instructions=null==t?void 0:t.instructions,this._jsonSchemaValidator=null!==(n=null==t?void 0:t.jsonSchemaValidator)&&void 0!==n?n:new Su,this.setRequestHandler(Ps,e=>this._oninitialize(e)),this.setNotificationHandler(xs,()=>{var e;return null===(e=this.oninitialized)||void 0===e?void 0:e.call(this)}),this._capabilities.logging&&this.setRequestHandler(Wp,async(e,t)=>{var a;const n=t.sessionId||(null===(a=t.requestInfo)||void 0===a?void 0:a.headers["mcp-session-id"])||void 0,{level:r}=e.params,i=qp.safeParse(r);return i.success&&this._loggingLevels.set(n,i.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new wu(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){const a={...e};for(const e in t){const n=e,r=t[n];if(void 0===r)continue;const i=a[n];Ou(i)&&Ou(r)?a[n]={...i,...r}:a[n]=r}return a}(this._capabilities,e)}setRequestHandler(e,t){var a,n,r;const i=ai(e),o=null==i?void 0:i.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Jr(o)){const e=o,t=null===(a=e._zod)||void 0===a?void 0:a.def;s=null!==(n=null==t?void 0:t.value)&&void 0!==n?n:e.value}else{const e=o,t=e._def;s=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:e.value}if("string"!=typeof s)throw new Error("Schema method literal must be a string");if("tools/call"===s){const a=async(e,a)=>{const n=ei(Up,e);if(!n.success){const e=n.error instanceof Error?n.error.message:String(n.error);throw new Pl(_s.InvalidParams,`Invalid tools/call request: ${e}`)}const{params:r}=n.data,i=await Promise.resolve(t(e,a));if(r.task){const e=ei(Us,i);if(!e.success){const t=e.error instanceof Error?e.error.message:String(e.error);throw new Pl(_s.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}const o=ei(Vp,i);if(!o.success){const e=o.error instanceof Error?o.error.message:String(o.error);throw new Pl(_s.InvalidParams,`Invalid tools/call result: ${e}`)}return o.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){var t,a,n;switch(e){case"sampling/createMessage":if(!(null===(t=this._clientCapabilities)||void 0===t?void 0:t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(null===(a=this._clientCapabilities)||void 0===a?void 0:a.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(null===(n=this._clientCapabilities)||void 0===n?void 0:n.roots))throw new Error(`Client does not support listing roots (required for ${e})`)}}assertNotificationCapability(e){var t,a;switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!(null===(a=null===(t=this._clientCapabilities)||void 0===t?void 0:t.elicitation)||void 0===a?void 0:a.url))throw new Error(`Client does not support URL elicitation (required for ${e})`)}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){var t,a;!function(e,t,a){var n,r;if(!e)throw new Error(`${a} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!(null===(n=e.sampling)||void 0===n?void 0:n.createMessage))throw new Error(`${a} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!(null===(r=e.elicitation)||void 0===r?void 0:r.create))throw new Error(`${a} does not support task creation for elicitation/create (required for ${t})`)}}(null===(a=null===(t=this._clientCapabilities)||void 0===t?void 0:t.tasks)||void 0===a?void 0:a.requests,e,"Client")}assertTaskHandlerCapability(e){var t;this._capabilities&&function(e,t,a){var n;if(!e)throw new Error(`${a} does not support task creation (required for ${t})`);if("tools/call"===t&&!(null===(n=e.tools)||void 0===n?void 0:n.call))throw new Error(`${a} does not support task creation for tools/call (required for ${t})`)}(null===(t=this._capabilities.tasks)||void 0===t?void 0:t.requests,e,"Server")}async _oninitialize(e){const t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;return{protocolVersion:Qo.includes(t)?t:Wo,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ts)}async createMessage(e,t){var a,n;if((e.tools||e.toolChoice)&&!(null===(n=null===(a=this._clientCapabilities)||void 0===a?void 0:a.sampling)||void 0===n?void 0:n.tools))throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){const t=e.messages[e.messages.length-1],a=Array.isArray(t.content)?t.content:[t.content],n=a.some(e=>"tool_result"===e.type),r=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=r?Array.isArray(r.content)?r.content:[r.content]:[],o=i.some(e=>"tool_use"===e.type);if(n){if(a.some(e=>"tool_result"!==e.type))throw new Error("The last message must contain only tool_result content if any is present");if(!o)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(o){const e=new Set(i.filter(e=>"tool_use"===e.type).map(e=>e.id)),t=new Set(a.filter(e=>"tool_result"===e.type).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},sl,t):this.request({method:"sampling/createMessage",params:e},ol,t)}async elicitInput(e,t){var a,n,r,i,o;switch(null!==(a=e.mode)&&void 0!==a?a:"form"){case"url":{if(!(null===(r=null===(n=this._clientCapabilities)||void 0===n?void 0:n.elicitation)||void 0===r?void 0:r.url))throw new Error("Client does not support url elicitation.");const a=e;return this.request({method:"elicitation/create",params:a},Rl,t)}case"form":{if(!(null===(o=null===(i=this._clientCapabilities)||void 0===i?void 0:i.elicitation)||void 0===o?void 0:o.form))throw new Error("Client does not support form elicitation.");const a="form"===e.mode?e:{...e,mode:"form"},n=await this.request({method:"elicitation/create",params:a},Rl,t);if("accept"===n.action&&n.content&&a.requestedSchema)try{const e=this._jsonSchemaValidator.getValidator(a.requestedSchema)(n.content);if(!e.valid)throw new Pl(_s.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){if(e instanceof Pl)throw e;throw new Pl(_s.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return n}}}createElicitationCompletionNotifier(e,t){var a,n;if(!(null===(n=null===(a=this._clientCapabilities)||void 0===a?void 0:a.elicitation)||void 0===n?void 0:n.url))throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},Cl,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}const Cu=Symbol.for("mcp.completable");var Du;!function(e){e.Completable="McpCompletable"}(Du||(Du={}));const Pu=/^[A-Za-z0-9._-]{1,128}$/;function ju(e){const t=function(e){const t=[];if(0===e.length)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Pu.test(e)){const a=e.split("").filter(e=>!/[A-Za-z0-9._-]/.test(e)).filter((e,t,a)=>a.indexOf(e)===t);return t.push(`Tool name contains invalid characters: ${a.map(e=>`"${e}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}(e);return function(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(const e of t)console.warn(` - ${e}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}(e,t.warnings),t.isValid}class ku{constructor(e){this._mcpServer=e}registerToolTask(e,t,a){const n={taskSupport:"required",...t.execution};if("forbidden"===n.taskSupport)throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,n,t._meta,a)}}class xu{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Iu(e,t)}get experimental(){return this._experimental||(this._experimental={tasks:new ku(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(zu(Bp)),this.server.assertCanSetRequestHandler(zu(Up)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Bp,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{const a={name:e,title:t.title,description:t.description,inputSchema:(()=>{const e=ni(t.inputSchema);return e?gu(e,{strictUnions:!0,pipeStrategy:"input"}):Lu})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){const e=ni(t.outputSchema);e&&(a.outputSchema=gu(e,{strictUnions:!0,pipeStrategy:"output"}))}return a})})),this.server.setRequestHandler(Up,async(e,t)=>{var a;try{const n=this._registeredTools[e.params.name];if(!n)throw new Pl(_s.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new Pl(_s.InvalidParams,`Tool ${e.params.name} disabled`);const r=!!e.params.task,i=null===(a=n.execution)||void 0===a?void 0:a.taskSupport,o="createTask"in n.handler;if(("required"===i||"optional"===i)&&!o)throw new Pl(_s.InternalError,`Tool ${e.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if("required"===i&&!r)throw new Pl(_s.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if("optional"===i&&!r&&o)return await this.handleAutomaticTaskPolling(n,e,t);const s=await this.validateToolInput(n,e.params.arguments,e.params.name),p=await this.executeToolHandler(n,s,t);return r||await this.validateToolOutput(n,p,e.params.name),p}catch(e){if(e instanceof Pl&&e.code===_s.UrlElicitationRequired)throw e;return this.createToolError(e instanceof Error?e.message:String(e))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,a){if(!e.inputSchema)return;const n=ni(e.inputSchema),r=null!=n?n:e.inputSchema,i=await ti(r,t);if(!i.success){const e=ri("error"in i?i.error:"Unknown error");throw new Pl(_s.InvalidParams,`Input validation error: Invalid arguments for tool ${a}: ${e}`)}return i.data}async validateToolOutput(e,t,a){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new Pl(_s.InvalidParams,`Output validation error: Tool ${a} has an output schema but no structured content was provided`);const n=ni(e.outputSchema),r=await ti(n,t.structuredContent);if(!r.success){const e=ri("error"in r?r.error:"Unknown error");throw new Pl(_s.InvalidParams,`Output validation error: Invalid structured content for tool ${a}: ${e}`)}}async executeToolHandler(e,t,a){const n=e.handler;if("createTask"in n){if(!a.taskStore)throw new Error("No task store provided.");const r={...a,taskStore:a.taskStore};if(e.inputSchema){const e=n;return await Promise.resolve(e.createTask(t,r))}{const e=n;return await Promise.resolve(e.createTask(r))}}if(e.inputSchema){const e=n;return await Promise.resolve(e(t,a))}{const e=n;return await Promise.resolve(e(a))}}async handleAutomaticTaskPolling(e,t,a){var n;if(!a.taskStore)throw new Error("No task store provided for task-capable tool.");const r=await this.validateToolInput(e,t.params.arguments,t.params.name),i=e.handler,o={...a,taskStore:a.taskStore},s=r?await Promise.resolve(i.createTask(r,o)):await Promise.resolve(i.createTask(o)),p=s.task.taskId;let l=s.task;const u=null!==(n=l.pollInterval)&&void 0!==n?n:5e3;for(;"completed"!==l.status&&"failed"!==l.status&&"cancelled"!==l.status;){await new Promise(e=>setTimeout(e,u));const e=await a.taskStore.getTask(p);if(!e)throw new Pl(_s.InternalError,`Task ${p} not found during polling`);l=e}return await a.taskStore.getTaskResult(p)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(zu(Al)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Al,async e=>{switch(e.params.ref.type){case"ref/prompt":return function(e){if("ref/prompt"!==e.params.ref.type)throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return function(e){if("ref/resource"!==e.params.ref.type)throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}(e),this.handleResourceCompletion(e,e.params.ref);default:throw new Pl(_s.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){const a=this._registeredPrompts[t.name];if(!a)throw new Pl(_s.InvalidParams,`Prompt ${t.name} not found`);if(!a.enabled)throw new Pl(_s.InvalidParams,`Prompt ${t.name} disabled`);if(!a.argsSchema)return $u;const n=ai(a.argsSchema),r=null==n?void 0:n[e.params.argument.name];if(!function(e){return!!e&&"object"==typeof e&&Cu in e}(r))return $u;const i=function(e){const t=e[Cu];return null==t?void 0:t.complete}(r);if(!i)return $u;return Vu(await i(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){const a=Object.values(this._registeredResourceTemplates).find(e=>e.resourceTemplate.uriTemplate.toString()===t.uri);if(!a){if(this._registeredResources[t.uri])return $u;throw new Pl(_s.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}const n=a.resourceTemplate.completeCallback(e.params.argument.name);if(!n)return $u;return Vu(await n(e.params.argument.value,e.params.context))}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(zu(sp)),this.server.assertCanSetRequestHandler(zu(lp)),this.server.assertCanSetRequestHandler(zu(mp)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(sp,async(e,t)=>{const a=Object.entries(this._registeredResources).filter(([e,t])=>t.enabled).map(([e,t])=>({uri:e,name:t.name,...t.metadata})),n=[];for(const e of Object.values(this._registeredResourceTemplates)){if(!e.resourceTemplate.listCallback)continue;const a=await e.resourceTemplate.listCallback(t);for(const t of a.resources)n.push({...e.metadata,...t})}return{resources:[...a,...n]}}),this.server.setRequestHandler(lp,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler(mp,async(e,t)=>{const a=new URL(e.params.uri),n=this._registeredResources[a.toString()];if(n){if(!n.enabled)throw new Pl(_s.InvalidParams,`Resource ${a} disabled`);return n.readCallback(a,t)}for(const e of Object.values(this._registeredResourceTemplates)){const n=e.resourceTemplate.uriTemplate.match(a.toString());if(n)return e.readCallback(a,n,t)}throw new Pl(_s.InvalidParams,`Resource ${a} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(zu(Op)),this.server.assertCanSetRequestHandler(zu(Sp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Op,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Bu(t.argsSchema):void 0}))})),this.server.setRequestHandler(Sp,async(e,t)=>{const a=this._registeredPrompts[e.params.name];if(!a)throw new Pl(_s.InvalidParams,`Prompt ${e.params.name} not found`);if(!a.enabled)throw new Pl(_s.InvalidParams,`Prompt ${e.params.name} disabled`);if(a.argsSchema){const n=ni(a.argsSchema),r=await ti(n,e.params.arguments);if(!r.success){const t=ri("error"in r?r.error:"Unknown error");throw new Pl(_s.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${t}`)}const i=r.data,o=a.callback;return await Promise.resolve(o(i,t))}{const e=a.callback;return await Promise.resolve(e(t))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(e,t,...a){let n;"object"==typeof a[0]&&(n=a.shift());const r=a[0];if("string"==typeof t){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);const a=this._createRegisteredResource(e,void 0,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);const a=this._createRegisteredResourceTemplate(e,void 0,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(e,t,a,n){if("string"==typeof t){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);const r=this._createRegisteredResource(e,a.title,t,a,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);const r=this._createRegisteredResourceTemplate(e,a.title,t,a,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}}_createRegisteredResource(e,t,a,n,r){const i={name:e,title:t,metadata:n,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:e=>{void 0!==e.uri&&e.uri!==a&&(delete this._registeredResources[a],e.uri&&(this._registeredResources[e.uri]=i)),void 0!==e.name&&(i.name=e.name),void 0!==e.title&&(i.title=e.title),void 0!==e.metadata&&(i.metadata=e.metadata),void 0!==e.callback&&(i.readCallback=e.callback),void 0!==e.enabled&&(i.enabled=e.enabled),this.sendResourceListChanged()}};return this._registeredResources[a]=i,i}_createRegisteredResourceTemplate(e,t,a,n,r){const i={resourceTemplate:a,title:t,metadata:n,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredResourceTemplates[e],t.name&&(this._registeredResourceTemplates[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.template&&(i.resourceTemplate=t.template),void 0!==t.metadata&&(i.metadata=t.metadata),void 0!==t.callback&&(i.readCallback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[e]=i,i}_createRegisteredPrompt(e,t,a,n,r){const i={title:t,description:a,argsSchema:void 0===n?void 0:Zr(n),callback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredPrompts[e],t.name&&(this._registeredPrompts[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.description&&(i.description=t.description),void 0!==t.argsSchema&&(i.argsSchema=Zr(t.argsSchema)),void 0!==t.callback&&(i.callback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=i,i}_createRegisteredTool(e,t,a,n,r,i,o,s,p){ju(e);const l={title:t,description:a,inputSchema:Fu(n),outputSchema:Fu(r),annotations:i,execution:o,_meta:s,handler:p,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&("string"==typeof t.name&&ju(t.name),delete this._registeredTools[e],t.name&&(this._registeredTools[t.name]=l)),void 0!==t.title&&(l.title=t.title),void 0!==t.description&&(l.description=t.description),void 0!==t.paramsSchema&&(l.inputSchema=Zr(t.paramsSchema)),void 0!==t.callback&&(l.handler=t.callback),void 0!==t.annotations&&(l.annotations=t.annotations),void 0!==t._meta&&(l._meta=t._meta),void 0!==t.enabled&&(l.enabled=t.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...t){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let a,n,r;if("string"==typeof t[0]&&(a=t.shift()),t.length>1){const e=t[0];Gu(e)?(n=t.shift(),t.length>1&&"object"==typeof t[0]&&null!==t[0]&&!Gu(t[0])&&(r=t.shift())):"object"==typeof e&&null!==e&&(r=t.shift())}const i=t[0];return this._createRegisteredTool(e,void 0,a,n,undefined,r,{taskSupport:"forbidden"},void 0,i)}registerTool(e,t,a){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);const{title:n,description:r,inputSchema:i,outputSchema:o,annotations:s,_meta:p}=t;return this._createRegisteredTool(e,n,r,i,o,s,{taskSupport:"forbidden"},p,a)}prompt(e,...t){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let a,n;"string"==typeof t[0]&&(a=t.shift()),t.length>1&&(n=t.shift());const r=t[0],i=this._createRegisteredPrompt(e,void 0,a,n,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,t,a){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);const{title:n,description:r,argsSchema:i}=t,o=this._createRegisteredPrompt(e,n,r,i,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),o}isConnected(){return void 0!==this.server.transport}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}const Lu={type:"object",properties:{}};function Mu(e){return null!==e&&"object"==typeof e&&"parse"in e&&"function"==typeof e.parse&&"safeParse"in e&&"function"==typeof e.safeParse}function Gu(e){return"object"==typeof e&&null!==e&&(!function(e){return"_def"in e||"_zod"in e||Mu(e)}(e)&&(0===Object.keys(e).length||Object.values(e).some(Mu)))}function Fu(e){if(e)return Gu(e)?Zr(e):e}function Bu(e){const t=ai(e);return t?Object.entries(t).map(([e,t])=>{const a=function(e){var t,a,n,r;if(Jr(e))return null===(a=null===(t=e._zod)||void 0===t?void 0:t.def)||void 0===a?void 0:a.description;const i=e;return null!==(n=e.description)&&void 0!==n?n:null===(r=i._def)||void 0===r?void 0:r.description}(t),n=function(e){var t,a,n;if(Jr(e))return"optional"===(null===(a=null===(t=e._zod)||void 0===t?void 0:t.def)||void 0===a?void 0:a.type);const r=e;return"function"==typeof e.isOptional?e.isOptional():"ZodOptional"===(null===(n=r._def)||void 0===n?void 0:n.typeName)}(t);return{name:e,description:a,required:!n}}):[]}function zu(e){const t=ai(e),a=null==t?void 0:t.method;if(!a)throw new Error("Schema is missing a method literal");const n=ii(a);if("string"==typeof n)return n;throw new Error("Schema method literal must be a string")}function Vu(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}const $u={completion:{values:[],hasMore:!1}};var Uu=c(1708);class Hu{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;const e=this._buffer.indexOf("\n");if(-1===e)return null;const t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),function(e){return Es.parse(JSON.parse(e))}(t)}clear(){this._buffer=void 0}}class qu{constructor(e=Uu.stdin,t=Uu.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new Hu,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{const t=this._readBuffer.readMessage();if(null===t)break;null===(e=this.onmessage)||void 0===e||e.call(this,t)}catch(e){null===(t=this.onerror)||void 0===t||t.call(this,e)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror);0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),null===(e=this.onclose)||void 0===e||e.call(this)}send(e){return new Promise(t=>{const a=function(e){return JSON.stringify(e)+"\n"}(e);this._stdout.write(a)?t():this._stdout.once("drain",t)})}}var Ku={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},Wu=Object.entries(Ku).reduce((e,[t,a])=>(e[a]=t,e),{}),Qu=["HS256","RS256"],Yu=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"];function Xu(e){try{var t=e.queryStringParameters?.token;if(!t){var a=new Headers(e.headers);t=a.get("authorization")?.replace("Bearer ","")}if(!t)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var t=e.split(".");if(t.length<3)return null;var a=JSON.parse(Buffer.from(t[0],"base64url").toString());return Qu.includes(a?.alg)?JSON.parse(Buffer.from(t[1],"base64url").toString()):null}catch{return null}}(t);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var r=Yu.includes(n.iss)?"user":"workspace";if("workspace"===r){var i=Array.isArray(n.t)?n.t:[];n.permissions=i.reduce((e,t)=>{var a=Wu[t];return a&&e.push(a),e},[])}else n.permissions=Object.keys(Ku);return{success:!0,token:t,tokenInfo:n,tokenType:r}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}const Ju='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96×54 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920×1080 | 96×54 | 20px |\n| 3840×2160 | 96×54 | 40px |\n| 1280×720 | 96×54 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96×54)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96×54 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var Zu=c(181),ed=(e,t={})=>({content:[Zu.Buffer.isBuffer(e)?{...t,blob:e.toString("base64"),type:"blob"}:{...t,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1});var td=c(9657);const ad=t("node:net"),nd=t("node:http"),rd=t("node:https");var id=c(8875);const od=t("node:dns"),sd={allowPrivateIPAddress:!1,allowMetaIPAddress:!1,allowIPAddressList:[],denyIPAddressList:[]},pd=({address:e,host:t,family:a},n)=>{if(0!==ad.isIP(e))try{const r=id.parse(e).range();if(n.allowIPAddressList.length>0&&n.allowIPAddressList.includes(e))return;if(!n.allowMetaIPAddress&&"unspecified"===r)return new Error(`DNS lookup ${e}(family:${a}, host:${t}) is not allowed. Because, It is meta IP address.`);if(!n.allowPrivateIPAddress&&"unicast"!==r)return new Error(`DNS lookup ${e}(family:${a}, host:${t}) is not allowed. Because, It is private IP address.`);if(n.denyIPAddressList.length>0&&n.denyIPAddressList.includes(e))return new Error(`DNS lookup ${e}(family:${a}, host:${t}) is not allowed. Because It is defined in denyIPAddressList.`)}catch(e){return e}},ld=(e,t)=>(a,n,r)=>{const i=e.lookup||od.lookup;let o;o=n.all?(e,n)=>{if(e)r(e);else{for(const{address:e,family:i}of n){const n=pd({address:e,family:i,host:a},t);if(n)return void r(n)}r(null,n)}}:(e,n,i)=>{if(e)return void r(e);const o=pd({address:n,family:i,host:a},t);o?r(o):r(null,n,i)},i(a,n,o)};class ud extends nd.Agent{requestFilterOptions;constructor(e){super(e),this.requestFilterOptions={allowPrivateIPAddress:e&&void 0!==e.allowPrivateIPAddress?e.allowPrivateIPAddress:sd.allowPrivateIPAddress,allowMetaIPAddress:e&&void 0!==e.allowMetaIPAddress?e.allowMetaIPAddress:sd.allowMetaIPAddress,allowIPAddressList:e&&e.allowIPAddressList?e.allowIPAddressList:sd.allowIPAddressList,denyIPAddressList:e&&e.denyIPAddressList?e.denyIPAddressList:sd.denyIPAddressList}}createConnection(e,t){const{host:a}=e;if(void 0!==a){const e=pd({address:a},this.requestFilterOptions);if(e)throw e}return super.createConnection({...e,lookup:ld(e,this.requestFilterOptions)},t)}}class dd extends rd.Agent{requestFilterOptions;constructor(e){super(e),this.requestFilterOptions={allowPrivateIPAddress:!(!e||void 0===e.allowPrivateIPAddress)&&e.allowPrivateIPAddress,allowMetaIPAddress:!(!e||void 0===e.allowMetaIPAddress)&&e.allowMetaIPAddress,allowIPAddressList:e&&e.allowIPAddressList?e.allowIPAddressList:[],denyIPAddressList:e&&e.denyIPAddressList?e.denyIPAddressList:[]}}createConnection(e,t){const{host:a}=e;if(void 0!==a){const e=pd({address:a},this.requestFilterOptions);if(e)throw e}return super.createConnection({...e,lookup:ld(e,this.requestFilterOptions)},t)}}const cd=new ud,md=new dd,fd=(e,t)=>t?e.startsWith("https")?new dd(t):new ud(t):e.startsWith("https")?md:cd;var hd=c(6123),_d=c(211),yd=c(5907),Ed=c(6502),Td=c.n(Ed),gd=c(5838);function vd(){return vd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},vd.apply(this,arguments)}var Rd={enum:1,type:0},bd=/"/g,Od=/NOT/g,Nd=/\//g,Ad=function(e){var t=e.value,a=e.suggestions,n=e.format,r=void 0===n?function(e){return"Did you mean '"+e+"'?"}:n;if(!t)return"";var i=a.reduce(function(e,a){var n=Td()(t,a);return e.distance>n?{value:a,distance:n}:e},{distance:1/0,value:""});return i.distance<t.length?r(i.value):""},Sd=function(e){return e.split("/").pop()},wd=function(e){var t=e.object,a=e.pnter,n=e.fallback;try{return gd.get(t,a)}catch(e){return n}},Id=function(e){var t=e.errors,a=e.data,n=e.schema,r=e.basePath,i=void 0===r?"{base}":r;if(!Array.isArray(t)||0===t.length)return[];var o=function(e){var t=e.reduce(function(e,t){var a,n,r,i,o,s,p=t.instancePath+(null!=(a=null!=(n=null==(r=t.params)?void 0:r.additionalProperty)?n:null==(i=t.params)?void 0:i.missingProperty)?a:""),l=e[p];return l?((null!=(o=Rd[t.keyword])?o:0)>(null!=(s=Rd[l.keyword])?s:0)&&(e[p]=t),e):(e[p]=t,e)},{});return Object.values(t)}(t);return o.map(function(e){var t,r=(i+e.instancePath).replace(Nd,"."),o=Sd(e.instancePath),s={errorType:e.keyword},p=(o?"property '"+o+"'":r)+" "+e.message.replace(bd,"'").replace(Od,"not");switch(e.keyword){case"additionalProperties":var l=e.params.additionalProperty,u=e.schemaPath.replace("#","").replace("/additionalProperties",""),d=wd({object:n,pnter:u,fallback:{properties:{}}}).properties;t={message:"'"+l+"' property is not expected to be here",suggestion:Ad({value:l,suggestions:Object.keys(null!=d?d:{}),format:function(e){return"Did you mean property '"+e+"'?"}}),path:r,context:s};break;case"enum":var c=e.params.allowedValues.map(function(e){return e.toString()}),m=Sd(e.instancePath),f=wd({object:a,pnter:e.instancePath,fallback:""});t={message:"'"+m+"' property must be equal to one of the allowed values",suggestion:Ad({value:f,suggestions:c}),path:r,context:vd({},s,{allowedValues:e.params.allowedValues})};break;case"type":t={message:"'"+Sd(e.instancePath)+"' property type must be "+e.params.type,path:r,context:s};break;case"required":t={message:r+" must have required property '"+e.params.missingProperty+"'",path:r,context:s};break;case"const":return{message:"'"+o+"' property must be equal to the allowed value",path:r,context:vd({},s,{allowedValue:e.params.allowedValue})};default:return{message:p,path:r,context:s}}for(var h=0,_=Object.entries(t);h<_.length;h++){var y=_[h],E=y[0],T=y[1];null!=T&&""!==T||delete t[E]}return t})};const Cd=(e,t="Internal Logic Error")=>{if(!e)throw new Error("function"==typeof t?t():t)};class Dd{constructor(e,t){this.value=e,this.excluded=t,this.isSimpleStarRec="**"===e,this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")"),this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec}}class Pd{constructor(e,t=null){this.left=null===t,this.link=null===t?new Pd(e,this):t,this.type=e,this.isStarRec="**"===this.type,this.node=null,this.pointer=null}setPointer(e){this.pointer=e,this.link.pointer=e}setNode(e){this.node=e,this.link.node=e}}const jd=(e,t,a={})=>{throw new Error(Object.entries(a).reduce((e,[t,a])=>`${e}, ${t} ${a}`,`${e}: ${t}`))},kd=e=>1===e.length?e[0]:e,xd=/^[?*+\d]+$/,Ld=(e,t,a={})=>{throw new Error(Object.entries(a).reduce((e,[t,a])=>`${e}, ${t} ${a}`,`${e}: ${t}`))},Md=(e,t)=>{if(""===e)return new Dd("",!1);if(Array.isArray(e))return 0===e.length?new Dd("",!1):e.map((a,n)=>"number"==typeof a?(t.useArraySelector||Ld("Forbidden Array Selector",JSON.stringify(e),{idx:n}),new Dd(`[${a}]`,!1)):new Dd(a.replaceAll("\\","\\\\"),!1));const a=(e=>{let t=[];t.or=!0;let a=!1,n=!1,r=0;const i=[],o=e=>{!0===t.excluded&&(Cd(!1===n),n=!0),i.push(t),t=[],t.or=e},s=()=>{const e=i.pop(),a=kd(t);!0===e.or&&!0===a.or?e.push(...a):e.push(a),t=e};return o(!1),{setInArray:(t,n)=>{a===t&&jd(a?"Bad Array Start":"Bad Array Terminator",e,{char:n}),a=t},finishElement:(i,o,s,{finReq:p=!1,group:l=!1}={})=>{if(r===i)s.includes(e[i-1]||null)||jd(o,e,{char:i}),r+=1;else{p&&jd(o,e,{char:i});const s=e.slice(r,i);l&&!["**","++"].includes(s)&&jd("Bad Group Start",e,{char:i}),a&&!(xd.test(s)||s.startsWith("(")&&s.endsWith(")"))&&jd("Bad Array Selector",e,{selector:s}),l?t.push(new Pd(s)):(t.push(new Dd(a?`[${s}]`:s,n)),n=!1),r=i+1}},startExclusion:t=>{!1!==n&&jd("Redundant Exclusion",e,{char:t}),n=!0},startGroup:()=>{o(!0),n&&(t.excluded=!0,n=!1),o(!1)},newGroupElement:()=>{s(),o(!1)},finishGroup:a=>{i.length<2&&jd("Unexpected Group Terminator",e,{char:a}),s(),s(),Cd(Array.isArray(t));const n=t[t.length-2];n instanceof Pd&&!0===n.left&&t.push(n.link)},finalizeResult:()=>(s(),Cd(!1===n),0!==i.length&&jd("Non Terminated Group",e),a&&jd("Non Terminated Array",e),kd(t))}})(e),n=e.length;let r=!1,i=0;for(let o=0;o<n;o+=1){const n=e[o];if(!1===r){if(0===i)switch(n){case".":a.finishElement(o,"Bad Path Separator",["]","}"]);break;case"[":t.useArraySelector||Ld("Forbidden Array Selector",e,{char:o}),a.finishElement(o,"Bad Array Start",[null,"!","{",",","}","]"]),a.setInArray(!0,o);break;case"]":a.finishElement(o,"Bad Array Terminator",["}"]),a.setInArray(!1,o);break;case"{":a.finishElement(o,"Bad Group Start",[null,"!",".","[","{",","],{group:!0}),a.startGroup();break;case",":a.finishElement(o,"Bad Group Separator",["]","}"]),a.newGroupElement();break;case"}":a.finishElement(o,"Bad Group Terminator",["]","}"]),a.finishGroup(o);break;case"!":a.finishElement(o,"Bad Exclusion",[null,".",",","{","["],{finReq:!0}),a.startExclusion(o)}switch(n){case"(":i+=1;break;case")":0===i&&Ld("Unexpected Parentheses",e,{char:o}),i-=1}}r="\\"===n&&!r}return!1!==r&&Ld("Dangling Escape",e,{char:n-1}),0!==i&&Ld("Unterminated Parentheses",e),a.finishElement(n,"Bad Terminator",["]","}"]),a.finalizeResult()},Gd=(e,t,a,{onAdd:n,onFin:r})=>{const i=[[[e,null]]];let o=!1;((e,t)=>{const a=[e],n=[null],r=[],i=[];let o=0,s=!0;for(;-1!==o;){const e=a[o];Array.isArray(e)?!0!==e.or?(a.splice(o,1,...e),n.splice(o,1,...new Array(e.length).fill(n[o])),null!==n[o]&&(i[n[o]]+=e.length-1)):(void 0===r[o]?(r[o]=0,i[o]=0):0!==i[o]&&(a.splice(o+1,i[o]),n.splice(o+1,i[o]),i[o]=0),r[o]<e.length?(a.splice(o+1,0,e[r[o]]),n.splice(o+1,0,o),r[o]=(r[o]||0)+1,i[o]+=1,s=!0,o+=1):(r[o]=0,o-=1)):!0===s?(t("ADD",e),o===a.length-1?(t("FIN",e),s=!1):o+=1):(t("RM",e),o-=1)}})(a,(a,s)=>{if("RM"===a)!0===s.excluded&&(o=!1),i.length-=2;else if("ADD"===a){if(!0===s.excluded){if(o)throw new Error(`Redundant Exclusion: "${t}"`);o=!0}const e=[],a=i[i.length-2];i[i.length-1].forEach(([t,r])=>n(t,r,s,a,a=>e.push([a,t]))),i.push(s,e)}else i[i.length-1].filter(([t])=>t!==e).forEach(([e,t])=>r(e,t,s,o))})},Fd=/[?!,.*+[\](){}\\]/g,Bd=/^\^?[^-/\\^$*+?.()|[\]{}]*\$?$/g,zd=e=>{if(Bd.test(e)){const t=e.startsWith("^"),a=e.endsWith("$");if(t&&a){const t=e.slice(1,-1);return{test:e=>String(e)===t}}if(t){const t=e.slice(1);return{test:e=>String(e).startsWith(t)}}if(a){const t=e.slice(0,-1);return{test:e=>String(e).endsWith(t)}}return{test:t=>String(t).includes(e)}}try{return new RegExp(e)}catch(t){throw new Error(`Invalid Regex: "${e}"`)}},Vd=e=>e.reduce((e,t)=>`${e}${"number"==typeof t?`[${t}]`:`${e?".":""}${(e=>e.replace(Fd,"\\$&"))(t)}`}`,""),$d=e=>Array.isArray(e)?Vd(e):e,Ud=["-","/","\\","^","$","*","+","?",".","(",")","|","[","]","{","}"],Hd=e=>{let t="",a=!1,n=!0;for(let r=0;r<e.length;r+=1){const i=e[r];a||"\\"!==i?a||"*"!==i?a||"+"!==i?a||"?"!==i?(Ud.includes(i)&&(n=!1,t+="\\"),t+=i,a=!1):(n=!1,t+="."):(n=!1,t+=".+"):(n=!1,t+=".*"):a=!0}return n?{test:e=>String(e)===t}:".+"===t?{test:e=>""!==e}:new RegExp(`^${t}$`)};class qd{constructor(e,t){if(t.nodes.push(this),this.value=e,this.ctx=t,this.order=t.counter,this.children=[],this.match=!1,this.matches=!1,this.needles=[],this.leafNeedles=[],this.leafNeedlesExclude=[],this.leafNeedlesMatch=[],this.isArrayTarget=e.startsWith("[")&&e.endsWith("]"),this.isSimpleStarRec="**"===e,this.isSimplePlusRec="++"===e,this.isSimpleRec=this.isSimpleStarRec||this.isSimplePlusRec,this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")"),this.isRegexPlusRec=e.startsWith("++(")&&e.endsWith(")"),this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec,this.isPlusRec=this.isSimplePlusRec||this.isRegexPlusRec,this.isRec=this.isStarRec||this.isPlusRec,this.isAnyArrayTarget="[*]"===e,this.isAnyObjTarget="*"===e,this.isSimpleRec||this.isAnyObjTarget||this.isAnyArrayTarget)this.regex=null;else{const{regex:a}=t;e in a||(a[e]=(e=>(e.startsWith("**(")||e.startsWith("++("))&&e.endsWith(")")?zd(e.slice(3,-1)):e.startsWith("[(")&&e.endsWith(")]")?zd(e.slice(2,-2)):e.startsWith("(")&&e.endsWith(")")?zd(e.slice(1,-1)):e.startsWith("[")&&e.endsWith("]")?Hd(e.slice(1,-1)):Hd(e))(e)),this.regex=a[e]}}recMatch(e){return!!this.isRec&&(!!this.isSimpleRec||this.regex.test(e))}typeMatch(e,t){return!!this.isSimpleRec||(this.isAnyArrayTarget?t:this.isAnyObjTarget?!t:!(t!==this.isArrayTarget&&!this.isRec)&&this.regex.test(e))}add(e){this.children.push(e)}get(e){return this.children.find(({value:t})=>t===e)}markMatches(){this.matches=!0}addNeedle(e){this.needles.includes(e)||this.needles.push(e)}setRoots(e){this.roots=e}finish(e,t,a){this.addNeedle(e),this.leafNeedles.includes(e)||this.leafNeedles.push(e);const n=t?this.leafNeedlesExclude:this.leafNeedlesMatch;n.includes(e)||n.push(e),this.match=!t,this.matches=this.match,this.index=a}}const Kd=(e,t,a,n)=>{Gd(e,t,a,{onAdd:(e,a,r,i,o)=>{if(e.addNeedle(t),r instanceof Pd)return void(!0===r.left?(r.isStarRec&&r.setPointer(e),r.setNode(new qd("*",n)),n.links.push(e,r.node),o(r.node)):(r.target="target"in i?i.target:a.get(i.value),n.links.push(r.target,r.node),null!==r.pointer&&(o(r.pointer),r.setPointer(null)),o(e)));const s=r.isStarRec&&r.value===i?.value;if(s&&n.strict)throw new Error(`Redundant Recursion: "${t}"`);if(s)r.target=e;else{let t=e.get(r.value);void 0===t&&(t=new qd(r.value,n),e.add(t)),o(t)}r.isStarRec&&o(e)},onFin:(e,a,r,i)=>{if(n.strict&&r.isSimpleStarRec){const e=a.children.filter(({value:e})=>!["","**"].includes(e));if(0!==e.length)throw new Error(`Needle Target Invalidated: "${e[0].needles[0]}" by "${t}"`)}if(n.strict&&0!==e.leafNeedles.length){const a=$d(e.leafNeedles[0]),n=$d(t);throw new Error(`Redundant Needle Target: "${a}" vs "${n}"`)}e.finish(t,i,n.counter),n.counter+=1}})},Wd=(e,t)=>{const a=[];for(let n=0,r=e.length;n<r;n+=1){const r=e[n][t];for(let e=0,t=r.length;e<t;e+=1){const t=r[e];a.includes(t)||a.push(t)}}return a},Qd=e=>{let t=-1,a=!1,n=e.length;for(;n--;){const{index:r,match:i}=e[n];r>t&&(t=r,a=i)}return a},Yd=(e,t)=>t?Vd(e):[...e],Xd=(e,t,a)=>{const n={haystack:e,context:a.context};if(void 0!==a.beforeFn){const e=a.beforeFn(n);void 0!==e&&(n.haystack=e)}const r=[!1,[t],null,0],i=[],o=[];let s,p,l,u,d=n.haystack;const c={getKey:(e=a.joined)=>Yd(i,e),get key(){return c.getKey()},getValue:()=>d,get value(){return c.getValue()},getEntry:(e=a.joined)=>[Yd(i,e),d],get entry(){return c.getEntry()},getIsMatch:()=>u,get isMatch(){return c.getIsMatch()},getMatchedBy:()=>(e=>Wd(e,"leafNeedlesMatch"))(l),get matchedBy(){return c.getMatchedBy()},getExcludedBy:()=>(e=>Wd(e,"leafNeedlesExclude"))(l),get excludedBy(){return c.getExcludedBy()},getTraversedBy:()=>(e=>Wd(e,"needles"))(l),get traversedBy(){return c.getTraversedBy()},getGproperty:()=>i[i.length-2],get gproperty(){return c.getGproperty()},getProperty:()=>i[i.length-1],get property(){return c.getProperty()},getGparent:()=>o[o.length-2],get gparent(){return c.getGparent()},getParent:()=>o[o.length-1],get parent(){return c.getParent()},getParents:()=>[...o].reverse(),get parents(){return c.getParents()},getIsCircular:()=>o.includes(d),get isCircular(){return c.getIsCircular()},getIsLeaf:()=>!(d instanceof Object),get isLeaf(){return c.getIsLeaf()},getDepth:()=>i.length,get depth(){return c.getDepth()},get result(){return c.getResult()},context:n.context},m=((e,t)=>{if("context"===t.rtn)return{onMatch:()=>{},get:()=>e.context};if("bool"===t.rtn){let e=!1;return{onMatch:()=>{e=!0},get:()=>e}}if("count"===t.rtn){let e=0;return{onMatch:()=>{e+=1},get:()=>e}}if("sum"===t.rtn){let e=0;return{onMatch:({value:t})=>{e+=t},get:()=>e}}const a=[];return{onMatch:"function"==typeof t.rtn?()=>a.push(t.rtn(e)):Array.isArray(t.rtn)?()=>a.push(t.rtn.map(t=>e[t])):()=>a.push(e[t.rtn]),get:()=>t.abort?a[0]:a}})(c,a);if(c.getResult=()=>m.get(),a.useArraySelector||!Array.isArray(n.haystack)){const e=t.get("");void 0!==e&&r[1].push(e)}do{s=r.pop(),p=r.pop(),l=r.pop(),u=r.pop();const e=i.length-s;for(let t=0;t<e;t+=1)o.pop(),i.pop();if(-1===e?(o.push(d),i.push(p),d=d[p]):null!==p?(i[i.length-1]=p,d=o[o.length-1][p]):d=n.haystack,u){void 0!==a.filterFn&&!1===a.filterFn(c)||(m.onMatch(c),a.abort&&(r.length=0));continue}if(!l.some(({matches:e})=>e))continue;const f=!1===a.useArraySelector&&Array.isArray(d);if(!f&&Qd(l)&&(r.push(!0,l,p,s),u=!0),(void 0===a.breakFn||!0!==a.breakFn(c))&&d instanceof Object){const e=Array.isArray(d),n=e?d.map((e,t)=>t).filter(()=>!0):Object.keys(d);!e&&a.compareFn&&n.sort(a.compareFn(c)),a.reverse||n.reverse();for(let i=0,o=n.length;i<o;i+=1){const o=n[i],p=[];if(f)p.push(...l),0===s&&p.push(...t.roots);else for(let t=0,a=l.length;t!==a;t+=1){const a=l[t];a.recMatch(o)&&p.push(a);const{children:n}=a;let r=n.length;for(;r--;){const t=n[r];t.typeMatch(o,e)&&p.push(t)}}if(a.orderByNeedles){p.index=Buffer.from(p.map(({order:e})=>e).sort());let e=r.length-3;const t=e-4*i;for(;e!==t&&1===Buffer.compare(p.index,r[e].index);)e-=4;r.splice(e+3,0,!1,p,o,s+1)}else r.push(!1,p,o,s+1)}}}while(0!==r.length);if(n.result=m.get(),void 0!==a.afterFn){const e=a.afterFn(n);void 0!==e&&(n.result=e)}return n.result},Jd=(e,t,a)=>{Cd(a.includes(typeof e[t]),()=>`Option "${t}" not one of [${a.join(", ")}]`)};var Zd=_d.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),ec=((e,t={})=>{if(Cd(Array.isArray(e),'Argument "needles" expected to be Array'),Cd(t instanceof Object&&!Array.isArray(t),'Argument "opts" expected to be Object'),0===e.length)return(e,t)=>void 0===t?[]:t;const a=(e=>{const t={filterFn:void 0,breakFn:void 0,beforeFn:void 0,afterFn:void 0,compareFn:void 0,reverse:!0,orderByNeedles:!1,abort:!1,rtn:void 0,joined:!1,useArraySelector:!0,strict:!0,...e};return Cd(12===Object.keys(t).length,"Unexpected Option provided"),Jd(t,"filterFn",["function","undefined"]),Jd(t,"breakFn",["function","undefined"]),Jd(t,"beforeFn",["function","undefined"]),Jd(t,"afterFn",["function","undefined"]),Jd(t,"compareFn",["function","undefined"]),Jd(t,"reverse",["boolean"]),Jd(t,"orderByNeedles",["boolean"]),Jd(t,"abort",["boolean"]),Cd("function"==typeof t.rtn&&1===t.rtn.length||[void 0,"context","key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth","bool","count","sum"].includes(t.rtn)||Array.isArray(t.rtn)&&t.rtn.every(e=>["key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth"].includes(e)),'Option "rtn" is malformed'),Jd(t,"joined",["boolean"]),Jd(t,"useArraySelector",["boolean"]),Jd(t,"strict",["boolean"]),t})(t),n=((e,t)=>{t.counter=0,t.links=[],t.nodes=[],t.regex=Object.create(null);const a=new qd("*",t);for(let n=0;n<e.length;n+=1){const r=e[n],i=[Md(r,t)];Kd(a,r,i,t)}return((e,t)=>{const{links:a}=t;for(;0!==a.length;){const e=a.pop(),t=a.pop(),{children:n}=t;t.children=[...e.children.filter(e=>!n.includes(e)),...n]}!1===t.useArraySelector&&e.setRoots(e.children.filter(({isStarRec:e,value:t})=>e||""===t));const{nodes:n}=t;for(;0!==n.length;){const e=n.pop(),{children:t}=e;t.reverse(),t.some(({matches:e})=>e)&&e.markMatches()}})(a,t),a})(e,a);return(e,t)=>Xd(e,n,{context:t,...a,rtn:a.rtn||(void 0===t?"key":"context")})})(["subspace_map.*.property_bank_calc_map.*.script_config"]);function tc(e){var t=[];try{var a=_d(e);t.push(...Id({errors:a,schema:Zd,data:e}).map(({path:e,message:t})=>`${e}: ${t}`));try{t.push(...yd(e).map(({field:e,message:t})=>`${e}: ${t}`))}catch(e){t.push(`Component reference validation failed: ${e.message}`)}return ec(e).forEach(a=>{var n=a.slice(0,-1),r=hd(e,n),i=n.join(".");if(0===Object.keys(r.map).length)t.push(`${i}.map is empty`);else{var o=r.script_config,s=o.inputs,p=o.output,l=o.outputs,u=o.error;s&&Object.keys(s).forEach(e=>{r.map[e]||t.push(`${i}.map.${e} is missing`)}),p&&!r.map[p]&&t.push(`${i}.map.${p} is missing`),l&&Object.values(l).forEach(e=>{r.map[e]||t.push(`${i}.map.${e} is missing`)}),u&&!r.map[u]&&t.push(`${i}.map.${u} is missing`)}}),{valid:0===t.length,errors:t}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var ac=c(9741),nc=c(3981),rc=(e,t="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,a])=>[e,"object"!=typeof a||Array.isArray(a)?a:a[t]??rc(a,t)])):e,ic=rc(ac.systemActionDescriptions),oc=Object.entries(ac.systemActions).map(([e,{propertyNameType:t,property:a}])=>` - \`${e}\`: ${ic[e]}\n${((e,t)=>{switch(e){case"defined_properties":return Object.entries(t).map(([e,t])=>` - \`${e}\`: ${JSON.stringify(t)}`).join("\n");case"property_bank":return" - `PROPERTY_BANK_DATA_NODE_*`: Value";default:return""}})(t,a)}\n`.trim()).join("\n"),sc=Object.keys(nc.brickMapping).map(e=>`- \`${e}\``).join("\n"),pc=Object.keys(nc.generatorMapping).map(e=>`- \`${e}\``).join("\n");const lc=Ju.replace("[:SYSTEM_ACTIONS:]",oc).replace("[:BRICK_IDS:]",sc).replace("[:GENERATOR_IDS:]",pc);var uc=(e,t)=>!t||e.tokenInfo.permissions?.includes(t)||!1,dc=c(4668),cc=c(5018),mc=c(3315),fc=c(409),hc=c(8525),_c=c(9760),yc=c(6078),Ec=c(9222),Tc=c(5608),gc=c(9074),vc=c(3673);var Rc=c(4370);const bc=Rc.default`
@@ -2766,7 +2766,7 @@ import{createRequire as e}from"node:module";const t=e(import.meta.url);import*as
2766
2766
  createdAt
2767
2767
  updatedAt
2768
2768
  }
2769
- `,Uh=e=>{const t=function({endpointURL:e,subscriptionEndpointURL:t,accessToken:a,boxId:n,passcode:r,origin:i,enableSubscription:o,enableRetry:s=!0,subscriptionOnConnectionOrError:p,onNetworkError:l=()=>{}}){const u=n&&r,d={};i&&(d.origin=i),u||(d.authorization=`Bearer ${a}`);const c=new yh({uri:e,headers:d});let m,f,h,_;const y=()=>{_&&(clearTimeout(_),_=void 0)};o&&(m=Ch({url:t,lazy:!0,connectionParams:d,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{y(),p?.(e)},opened:e=>{p?.(),h=e,y()},ping:e=>{e||(y(),_=setTimeout(()=>{h&&h.readyState===WebSocket.OPEN&&h.close(4205,"Client Restart")},5e3))},pong:e=>{e&&y()},closed:()=>{y()}}}),f=new gh(m));const E=gc.C.from([jh(({networkError:e,operation:t})=>{e&&l(e,t)}),s&&new nh({attempts:{max:3,retryIf:e=>{const t="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!!e&&!t.includes("Too many requests")&&429!==e?.response?.status&&403!==e?.statusCode&&403!==e?.status&&!e?.timeout&&"Timeout exceeded"!==t&&"Aborted"!==t&&"AbortError"!==e?.name}}}),new(xh())(3e4),o?gc.C.split(({query:e})=>{const{kind:t,operation:a}=Fh(e);return"OperationDefinition"===t&&"subscription"===a},f,c):c].filter(Boolean));return E.closeSubscriptionClient=()=>o&&m.close(!0,!0),E}(e),a=new Ec.D,n=new yc.R({link:t,cache:a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return n.close=()=>t.closeSubscriptionClient(),n},Hh=Rc.default`
2769
+ `,Uh=e=>{const t=function({endpointURL:e,subscriptionEndpointURL:t,accessToken:a,boxId:n,passcode:r,origin:i,enableSubscription:o,enableRetry:s=!0,subscriptionOnConnectionOrError:p,onNetworkError:l=()=>{}}){const u=n&&r,d={};i&&(d.origin=i),u||(d.authorization=`Bearer ${a}`);const c=new yh({uri:e,headers:d});let m,f,h,_;const y=()=>{_&&(clearTimeout(_),_=void 0)};o&&(m=Ch({url:t,lazy:!0,connectionParams:d,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{y(),p?.(e)},opened:e=>{p?.(),h=e,y()},ping:e=>{e||(y(),_=setTimeout(()=>{h&&h.readyState===WebSocket.OPEN&&h.close(4205,"Client Restart")},5e3))},pong:e=>{e&&y()},closed:()=>{y()}}}),f=new gh(m));const E=gc.C.from([jh(({networkError:e,operation:t})=>{if(e){l(e,t);const a=e?.message||"";if("Aborted"===a||"AbortError"===e?.name||"Timeout exceeded"===a||e?.timeout||403===e?.statusCode||403===e?.status)return new vc.c(e=>e.complete())}}),s&&new nh({attempts:{max:3,retryIf:e=>{const t="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!!e&&!t.includes("Too many requests")&&429!==e?.response?.status&&403!==e?.statusCode&&403!==e?.status&&!e?.timeout&&"Timeout exceeded"!==t&&"Aborted"!==t&&"AbortError"!==e?.name}}}),new(xh())(3e4),o?gc.C.split(({query:e})=>{const{kind:t,operation:a}=Fh(e);return"OperationDefinition"===t&&"subscription"===a},f,c):c].filter(Boolean));return E.closeSubscriptionClient=()=>o&&m.close(!0,!0),E}(e),a=new Ec.D,n=new yc.R({link:t,cache:a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return n.close=()=>t.closeSubscriptionClient(),n},Hh=Rc.default`
2770
2770
  query MediaClient_workspaces {
2771
2771
  mediaWorkspaces {
2772
2772
  ...mediaWorkspaceArguments
@@ -3097,4 +3097,4 @@ import{createRequire as e}from"node:module";const t=e(import.meta.url);import*as
3097
3097
  }
3098
3098
  }
3099
3099
  ${Vh}
3100
- `,E_={query:"query",mutation:"mutate"},T_=(e,t,a)=>([n,r])=>{if(e[n])throw new Error(`Overwriting client.${n}`);e[n]=async(i,o={})=>{let s,p;const l={[t]:r,variables:i,...o};if(a&&(l.variables={...a,...l.variables}),o.readQuery?s=e.readQuery(l):o.writeQuery?e.writeQuery({...l,data:o.writeQuery}):({data:s,errors:p}=await e[E_[t]](l)),p)throw new Error(p.map(e=>e.message).join("\n"));return s?s[n]:null}},g_=e=>{const t=(({endpoint:e="http://localhost:3002",accessToken:t,boxId:a,passcode:n,enableSubscription:r=!0,enableRetry:i=!0,subscriptionOnConnectionOrError:o,onNetworkError:s}={})=>{const p=a&&n;let l=`${e}/api/graphql`;return p&&(l=`${e}/api/graphql_with_passcode`),Uh({endpointURL:l,subscriptionEndpointURL:l.replace("http:","ws:"),accessToken:t,enableSubscription:!p&&r,enableRetry:i,subscriptionOnConnectionOrError:o,onNetworkError:s})})(e);if(e.boxId&&e.passcode){t.type="passcode",t.queries=v,t.mutations=R;const a={boxId:e.boxId,passcode:e.passcode};Object.entries(v).forEach(T_(t,"query",a)),Object.entries(R).forEach(T_(t,"mutation",a)),t.listenBoxChanged=(e,n)=>t.subscribe({query:y_,variables:{...a,...e}}).subscribe({next:async({data:e})=>{await n(null,e.mediaBoxChanged)},error(e){n(e)}})}else t.accessToken=e.accessToken,t.type="token",t.queries=T,t.mutations=g,Object.entries(T).forEach(T_(t,"query")),Object.entries(g).forEach(T_(t,"mutation")),t.listenBoxChanged=(e,a)=>t.subscribe({query:l_,variables:e}).subscribe({next:async({data:e})=>{await a(null,e.mediaBoxChanged)},error(e){a(e)}});return t};function v_(e,t,a){switch(a){case"user":return new ff(e,t);case"workspace":return new eh(e,t);default:throw new Error(`Invalid token type: ${a}.`)}}process.env.STAGE,process.env.URL_BASE;var R_="bricks-mcp",b_={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools"},O_=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,c(1639));const N_=({type:e,title:t,template_key:a})=>{var n,r,i=(0,O_.makeId)(e);switch(e){case"subspace":n={title:t,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},r={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var o=rc(nc.canvas);n={title:t,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(o.propTypes).map(([e,t])=>[e,{...t,description:o.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(o.eventTypes).map(([e])=>[e,{description:o.brickEventDescriptions[e]}]))}},r={property_bank_map:{[(0,O_.makeId)("property_bank")]:{title:`Canvas ID: ${t}`,type:"string",value:i,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=rc(nc.components.Basic),p=rc(nc.brickMapping[a]);if(!p)throw new Error(`Brick ${a} not found`);var l={...p,propTypes:{...s.propTypes,...p.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...p.brickPropDescriptions},eventTypes:{...s.eventTypes,...p.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...p.brickEventDescriptions}};n={title:t,template_key:a,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,t])=>[e,{...t,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},r={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:i,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:t,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};case"generator":var u=rc(nc.generatorMapping[a]);if(!u)throw new Error(`Generator ${a} not found`);n={title:t,template_key:a,property:{$definitions:Object.fromEntries(Object.entries(u.propTypes).map(([e,t])=>[e,{...t,description:u.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(u.eventTypes).map(([e])=>[e,{description:u.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(u.outletTypes).map(([e])=>[e,{description:u.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:t,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:t,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(nc.propertyBank.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var d=(0,O_.makeId)("property_bank_command"),c=(0,O_.makeId)("property_bank_command"),m=(0,O_.makeId)("property_bank_command"),f="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:t,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${d}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${d}`,port:"obj | inputs"}]}},[d]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:f,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:c,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:d,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[c]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:d,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:c,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:c,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:t,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:f,$note:"Required, info for GUI editor"}}}return ed({id:i,example:n,extraInfo:r})};function A_(e,t){var a,n,r,i,o,s,p,l,u,d,c,m,f,h,_="user"===t.tokenType,y=((e,t=null)=>({name:a,description:n,inputSchema:r,permission:i},o)=>{uc(t,i)&&e.tool(a,n,r,o)})(e,t),E=e=>({...e,..._?{workspace_id:ia().describe("Workspace ID")}:{}}),T=t.client,g=_?function(e){var t=e.endpoint,a=e.accessToken;if(!t)throw new Error("Media API endpoint is required");if(!a)throw new Error("Access token is required");return g_({endpoint:t,accessToken:a,enableSubscription:!1,enableRetry:!0})}({endpoint:b_.media,accessToken:t.token}):T;_&&e.tool("list_workspaces","List all workspaces",{},b(function*(){return ed(yield T.workspaces())})),y({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:E({}),permission:"info"},function(){var e=b(function*({workspace_id:e}){var t=yield Promise.all([T.workspace({id:e}),T.applications({workspaceId:e,paginate:{limit:50,offset:0}}),T.modules({workspaceId:e,paginate:{limit:50,offset:0}}),T.devices({workspaceId:e,paginate:{limit:50,offset:0}}),_?g.mediaWorkspace({workspaceId:e}).catch(()=>null):g.mediaWorkspace().catch(()=>null),_?g.mediaBoxes({workspaceId:e}).catch(()=>[]):g.mediaBoxes().catch(()=>[])]),a=pe(t,6),n=a[0],r=a[1],i=a[2],o=a[3],s=a[4],p=a[5];if(!n)throw new Error("Authentication failed, please check your token");return ed({workspace:n,stats:{applications:r?.length??"No permission",modules:i?.length??"No permission",devices:o?.length??"No permission",running_apps:r?.filter(e=>e.status?.running).length??"No permission",media_boxes:p?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:r?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:p?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})});return function(t){return e.apply(this,arguments)}}()),y({name:"get_applications",description:"List all applications in the workspace",inputSchema:E({limit:oa().describe("Maximum number of applications to return").optional().default(50),offset:oa().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.applications({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:E({id:ia().describe("Application ID")}),permission:"query_application"},function(){var e=b(function*({workspace_id:e,id:t}){return ed(yield T.application({workspaceId:e,id:t}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_modules",description:"List all modules in the workspace",inputSchema:E({limit:oa().describe("Maximum number of modules to return").optional().default(50),offset:oa().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.modules({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:E({id:ia().describe("Module ID")}),permission:"query_module"},function(){var e=b(function*({workspace_id:e,id:t}){return ed(yield T.module({workspaceId:e,id:t}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_module_info",description:"Update a specific module info",inputSchema:E({id:ia().describe("Module ID"),name:ia().describe("Module name"),description:ia().describe("Module description")}),permission:"update_module"},function(){var e=b(function*({workspace_id:e,id:t,name:a,description:n}){return ed(yield T.updateModule({workspaceId:e,id:t,name:a,description:n}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_module_config",description:"Update a specific module configuration",inputSchema:E({id:ia().describe("Module ID"),config:pa({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},function(){var e=b(function*({workspace_id:e,id:t,config:a}){var n=yield tc(a);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return ed(yield T.updateModule({workspaceId:e,id:t,config:JSON.stringify(a),validateConfig:!0}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_devices",description:"List all devices in the workspace",inputSchema:E({limit:oa().describe("Maximum number of devices to return").optional().default(50),offset:oa().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.devices({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:E({name:ia().describe("Application name"),description:ia().describe("Application description").optional(),grid_width:oa().describe("Grid width in units").optional().default(96),grid_height:oa().describe("Grid height in units").optional().default(54)}),permission:"create_application"},function(){var e=b(function*({workspace_id:e,name:t,description:a,grid_width:n,grid_height:r}){return ed(yield T.createApplication({workspaceId:e,name:t,description:a,gridWidth:n,gridHeight:r}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_application_info",description:"Update application info",inputSchema:{id:ia().describe("Application ID"),name:ia().describe("Application name"),description:ia().describe("Application description")},permission:"update_application"},function(){var e=b(function*({id:e,name:t,description:a}){return ed(yield T.updateApplication({id:e,name:t,description:a}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:ia().describe("Application ID"),config:pa({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(a=b(function*({id:e,config:t}){var a=yield tc(t);if(!a.valid)throw new Error(`Config validation failed: ${a.errors.join(", ")}`);return ed(yield T.updateApplication({id:e,config:JSON.stringify(t)}))}),function(e){return a.apply(this,arguments)})),y({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:ia().describe("Application ID"),viewports:sa(pa({device_id:ia().describe("Device ID"),x:oa().describe("X coordinate"),y:oa().describe("Y coordinate"),width:oa().describe("Width"),height:oa().describe("Height"),rotate:oa().describe("Rotation"),rotateType:ia().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(n=b(function*({app_id:e,viewports:t}){return ed(yield T.bindApplication({id:e,bind_devices:t.map(e=>e.device_id),device_frames:t.reduce((e,t)=>({...e,[t.device_id]:{x:t.x,y:t.y,width:t.width,height:t.height,rotate:t.rotate,rotateType:t.rotateType}}),{})}))}),function(e){return n.apply(this,arguments)})),y({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:ia().describe("Application ID"),device_id:ia().describe("Device ID")},permission:"bind_application"},(r=b(function*({app_id:e,device_id:t}){return ed(yield T.bindApplication({id:e,unbindDevices:[t]}))}),function(e){return r.apply(this,arguments)})),_&&y({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},b(function*(){return ed(yield g.mediaWorkspaces())})),y({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:E({}),permission:"query_media_flow"},(i=b(function*({workspace_id:e}){return ed(yield g.mediaWorkspace({workspaceId:e}))}),function(e){return i.apply(this,arguments)})),y({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:E({}),permission:"query_media_flow"},(o=b(function*({workspace_id:e}){return ed(yield g.mediaBoxes({workspaceId:e}))}),function(e){return o.apply(this,arguments)})),y({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:ia().describe("Media box ID")},permission:"query_media_flow"},(s=b(function*({box_id:e}){return ed(yield g.mediaBox({boxId:e}))}),function(e){return s.apply(this,arguments)})),y({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:ia().describe("Media box ID"),include_types:sa(ia()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:sa(ia()).optional().describe("Filter by user tags"),limit:oa().optional().default(50).describe("Maximum number of files to return"),offset:oa().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(p=b(function*({box_id:e,include_types:t,user_tags:a,limit:n,offset:r}){return ed(yield g.mediaFiles({boxId:e,includeTypes:t,userTags:a,limit:n,offset:r}))}),function(e){return p.apply(this,arguments)})),y({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:ia().describe("Media file ID")},permission:"query_media_flow"},(l=b(function*({file_id:e}){return ed(yield g.mediaFile({fileId:e}))}),function(e){return l.apply(this,arguments)})),y({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:ia().describe("Target media box ID"),name:ia().describe("File name"),description:ia().optional().default("").describe("File description"),file_type:la(["image","video","audio","file"]).describe("File type"),source_url:ia().optional().describe("URL to download the file from"),base64_data:ia().optional().describe("Base64 encoded file data"),user_tags:sa(ia()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(u=b(function*({box_id:e,name:t,description:a,source_url:n,base64_data:r,file_type:i,user_tags:o}){if(!n&&!r)throw new Error("Either source_url or base64_data must be provided");if(n&&r)throw new Error("Provide either source_url OR base64_data, not both");var s=n?null:"application/octet-stream",p=n?yield(0,td.Ay)(n,{agent:fd(n)}).then(e=>(s=e.headers.get("content-type"),e.blob())):new Blob([Zu.Buffer.from(r,"base64")],{type:s}),l=yield g.requestFileUpload({name:t,description:a,boxId:e,fileType:_?i.toUpperCase():i,contentType:s,userTags:o,meta:{}}),u=JSON.parse(l?.meta.uploadInfo),d=new FormData;d.append("file",p),d.append("Content-Type",s),d.append("AWSAccessKeyId",u.AWSAccessKeyId),d.append("Signature",u.Signature),d.append("Policy",u.Policy),d.append("acl",u.acl),d.append("key",u.key);var c=yield(0,td.Ay)(u.url,{method:"POST",body:d}).then(e=>e.ok).catch(()=>!1);return ed({file_id:l.id,upload_success:c,upload_info:{content_type:s,file_type:i,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return u.apply(this,arguments)})),y({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:ia().describe("Media file ID"),name:ia().optional().describe("New file name"),description:ia().optional().describe("New file description"),user_tags:sa(ia()).optional().describe("New user tags")},permission:"write_media_flow"},(d=b(function*({file_id:e,name:t,description:a,user_tags:n}){return ed(yield g.updateMediaFile({fileId:e,name:t,description:a,userTags:n,requestUploadAgain:!1}))}),function(e){return d.apply(this,arguments)})),y({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:ia().describe("Source media box ID"),to_box_id:ia().describe("Target media box ID"),file_ids:sa(ia()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(c=b(function*({from_box_id:e,to_box_id:t,file_ids:a}){return ed(yield g.copyMediaFiles({fromBoxId:e,toBoxId:t,list:a}))}),function(e){return c.apply(this,arguments)})),y({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:ia().describe("Media box ID"),file_ids:sa(ia()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(m=b(function*({box_id:e,file_ids:t}){return ed(yield g.deleteMediaFiles({boxId:e,list:t}))}),function(e){return m.apply(this,arguments)})),y({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:ia().describe("Media box ID"),include_types:sa(ia()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(f=b(function*({box_id:e,include_types:t}){if("deleteMediaBoxFiles"in g)return ed(yield g.deleteMediaBoxFiles({boxId:e,includeTypes:t}));var a=yield g.mediaFiles({boxId:e,includeTypes:t});return ed(yield g.deleteMediaFiles({boxId:e,list:a.map(e=>e.id)}))}),function(e){return f.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:oa().describe("Device width in pixels"),device_height:oa().describe("Device height in pixels"),app_grid_width:oa().describe("Application grid width").optional().default(96),app_grid_height:oa().describe("Application grid height").optional().default(54)},(h=b(function*({device_width:e,device_height:t,app_grid_width:a,app_grid_height:n}){var r,i,o={deviceBrickWidth:(r=e)/(i=r/a),deviceBrickHeight:t/i,deviceBrickUnit:i},s=function(e,t,a=96){var n=e/a;return t>e&&(n=t/a),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(t/n),deviceBrickUnit:n}}(e,t,a);return ed({device_resolution:{width:e,height:t,aspect_ratio:(e/t).toFixed(2)},current_grid:{width:a,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:s.deviceBrickWidth,height:s.deviceBrickHeight,unit_size_px:s.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return h.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:la(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:ia().describe("Item title"),template_key:ia().optional().describe("Template key for brick or generator")},N_),e.tool("getting_started","Get documentation content for getting started",{},b(function*(){return ed(lc)}))}var S_="2.24.0-beta.14";function w_(){return w_=b(function*(e={}){var t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),new Error("API token is required");var a=Xu({queryStringParameters:{token:t}});if(!a.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(a.message),new Error("Invalid BRICKS_API_TOKEN");var n,r=new xu({name:R_,version:S_}),i={...a,client:v_(b_.bricks,a.token,a.tokenType)};(n=r).prompt("getting-started","Getting started with BRICKS",{},b(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:ia().describe("Name for the new application"),description:ia().describe("Short description for the new application").optional()},function(){var e=b(function*(e){var t=e?.app_name||"New Application",a=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${t}".\n\n${a?`Goal: ${a}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}});return function(t){return e.apply(this,arguments)}}()),function(e){e.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},b(function*(){return ed(Ju,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(r),A_(r,i);var o=new qu;try{yield r.connect(o),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${R_} v${S_}`),console.error(`Token Type: ${a.tokenType}`),console.error(`Permissions: ${a.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}}),w_.apply(this,arguments)}var I_=new P("mcp").description("MCP server management");I_.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action(function(){var e=b(function*(e){var t=(0,M.getCurrentProfile)(),a=e.token||(0,M.getToken)(t);a||(console.error(L.Ay.red("Error: No API token found.")),console.error(L.Ay.gray("Please login first with: bricks auth login <passcode>")),console.error(L.Ay.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{yield function(){return w_.apply(this,arguments)}({token:a})}catch(e){console.error(L.Ay.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}});return function(t){return e.apply(this,arguments)}}());var C_=new P("devtools").description("DevTools server discovery and connection");C_.command("scan").description("Scan LAN for DevTools servers via UDP + HTTP").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-j, --json","Output as JSON").option("--verify","Verify each discovered server via HTTP").option("--udp-only","Skip HTTP subnet probe (UDP only)").option("-p, --port <port>","Port for HTTP probe","19851").action(function(){var e=b(function*(e){var t=(yield Promise.resolve().then(c.bind(c,9790))).default,a=yield c.e(44).then(c.bind(c,2044)),n=a.discoverDevToolsServers,r=a.verifyDevToolsServer,i=a.httpProbeSubnet,o=yield Promise.resolve().then(c.bind(c,8765)),s=o.getCurrentProfile,p=o.getTokenInfo,l=parseInt(e.timeout,10),u=t(`Scanning for DevTools servers (${l}ms)...`).start();try{var d=n({timeout:l}),m=e.udpOnly?Promise.resolve([]):(u.text="Scanning via UDP + HTTP probe...",i({port:parseInt(e.port,10)})),f=yield Promise.all([d,m]),h=pe(f,2),_=h[0],y=h[1],E=[..._,...y],T=new Map;for(var g of E){var v=g.deviceId||`${g.address}:${g.port}`,R=T.get(v);if(R)for(var O of(R.addresses.includes(g.address)||R.addresses.push(g.address),"127.0.0.1"===R.address&&"127.0.0.1"!==g.address&&(R.address=g.address),g.protocols||[]))R.protocols?.includes(O)||R.protocols?.push(O);else T.set(v,{...g,addresses:[g.address]})}var N=[...T.values()];if(0===N.length)return void u.info("No DevTools servers found on the network.");if(e.verify){u.text=`Verifying ${N.length} server(s)...`;var A=yield Promise.all(N.map(function(){var e=b(function*(e){var t=yield r(e.address,e.port);return{...e,verified:!!t}});return function(t){return e.apply(this,arguments)}}()));N.splice(0,N.length,...A)}if(u.stop(),e.json)return void console.log(JSON.stringify(N,null,2));var S=p(s()),w=S?.workspaceId||null;console.log(L.Ay.bold(`\nFound ${N.length} DevTools server(s)`)),console.log("─".repeat(80));var I=function*(e){var t=!1===e.verified?L.Ay.red("unverified"):L.Ay.green("online"),a=e.hasPasscode?L.Ay.yellow("passcode"):L.Ay.gray("open"),n=(e.protocols||[]).map(e=>L.Ay.cyan(e)).join(", "),r=e.workspaceId&&w&&e.workspaceId===w,i=e.addresses||[e.address],o=i.filter(t=>t!==e.address),s=o.length>0?`${e.address}:${e.port} +${o.length} more`:`${e.address}:${e.port}`;console.log(` ${L.Ay.bold(e.name||"Unknown")} ${L.Ay.gray(`(${s})`)} [${t}]`),o.length>0&&console.log(` Addresses: ${i.map(e=>L.Ay.gray(e)).join(", ")}`);var p=` Protocols: ${n||L.Ay.gray("none")} Auth: ${a}`;if(e.deviceId&&(p+=` Device: ${L.Ay.gray(e.deviceId)}`),console.log(p),e.workspaceId){var l=r?L.Ay.green(`${e.workspaceId} (current profile)`):L.Ay.gray(e.workspaceId);console.log(` Workspace: ${l}`)}};for(var C of N)yield*I(C);console.log("─".repeat(80)),console.log(L.Ay.gray(`\nConnect via: devtools://devtools/bundled/js_app.html?ws=<address>:${N[0]?.port||19851}/ws?p=<passcode>`))}catch(e){u.fail(`Scan failed: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),C_.command("open <address>").description("Show connection URLs for a DevTools server").option("-p, --port <port>","Server port","19851").option("--verify","Verify server is reachable first").action(function(){var e=b(function*(e,t){var a=parseInt(t.port,10),n=`${e}:${a}`;if(t.verify){var r=(yield Promise.resolve().then(c.bind(c,9790))).default,i=(yield c.e(44).then(c.bind(c,2044))).verifyDevToolsServer,o=r(`Verifying ${n}...`).start(),s=yield i(e,a);s||(o.fail(`Could not reach DevTools server at ${n}`),process.exit(1)),o.succeed(`${s.name||"DevTools"} is reachable`),console.log()}console.log(L.Ay.bold("Connection URLs")),console.log("─".repeat(60)),console.log(` Web UI: ${L.Ay.cyan(`http://${n}`)}`),console.log(` CDP: ${L.Ay.cyan(`devtools://devtools/bundled/js_app.html?ws=${n}/ws?p=<passcode>`)}`),console.log(` MCP: ${L.Ay.cyan(`http://${n}/mcp`)}`),console.log(` MCP SSE: ${L.Ay.cyan(`http://${n}/sse`)}`),console.log(` Info: ${L.Ay.cyan(`http://${n}/devtools/info`)}`),console.log("─".repeat(60)),console.log(),console.log(L.Ay.bold("Authorization")),console.log(" MCP and MCP SSE require a Bearer token header with the device passcode:"),console.log(` ${L.Ay.gray("Authorization: Bearer <passcode>")}`)});return function(t,a){return e.apply(this,arguments)}}());var D_=function(){var e=b(function*(){var e=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);if(-1!==e&&process.argv[e+1]&&((0,M.setProfileOverride)(process.argv[e+1]),process.argv.splice(e,2)),N.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.24.0-beta.14").enablePositionalOptions(),N.addCommand(U),N.addCommand(Z),N.addCommand(ie),N.addCommand(se),N.addCommand(ce),N.addCommand(ge),N.addCommand(Ie),N.addCommand(I_),N.addCommand(C_),N.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(b(function*(){try{(0,(yield c.e(612).then(c.bind(c,9612))).runInteractiveMode)()}catch(e){console.error(L.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),N.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=yield Promise.resolve().then(c.bind(c,8765)),a=t.getToken,n=t.getBaseUrl,r=t.getCurrentProfile,i=(yield Promise.resolve().then(c.bind(c,700))).createClient,o=(yield Promise.resolve().then(c.bind(c,9790))).default,s=a(r());s||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var p=o("Fetching workspace info...").start();try{var l=i(n(),s),u=yield l.workspace();if(p.stop(),e.json)return void console.log(JSON.stringify(u,null,2));console.log(L.Ay.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${L.Ay.green(u.name)}`),console.log(`ID: ${L.Ay.gray(u._id)}`),console.log(`Description: ${u.description||L.Ay.gray("N/A")}`),console.log(`\n${L.Ay.bold("Data")}`),console.log(`Remote Update: ${u.bank?.enable_remote_update?L.Ay.green("Enabled"):L.Ay.gray("Disabled")}`),console.log(`Spacename: ${u.bank?.spacename||L.Ay.gray("N/A")}`),console.log("─".repeat(60))}catch(e){p.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),N.on("--help",()=>{console.log(""),console.log(L.Ay.bold("Examples:")),console.log(""),console.log(L.Ay.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(L.Ay.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(L.Ay.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(L.Ay.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(L.Ay.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(L.Ay.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(L.Ay.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(L.Ay.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(L.Ay.gray("Get workspace token from BRICKS Controller:")),console.log(L.Ay.cyan(" https://control.bricks.tools")),console.log(L.Ay.gray(" Go to Workspace Settings > API Token"))}),0===process.argv.slice(2).length)try{return void(0,(yield c.e(612).then(c.bind(c,9612))).runInteractiveMode)()}catch(e){console.error(L.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}yield N.parseAsync(process.argv)});return function(){return e.apply(this,arguments)}}();const P_=D_;export{P_ as default,D_ as run};
3100
+ `,E_={query:"query",mutation:"mutate"},T_=(e,t,a)=>([n,r])=>{if(e[n])throw new Error(`Overwriting client.${n}`);e[n]=async(i,o={})=>{let s,p;const l={[t]:r,variables:i,...o};if(a&&(l.variables={...a,...l.variables}),o.readQuery?s=e.readQuery(l):o.writeQuery?e.writeQuery({...l,data:o.writeQuery}):({data:s,errors:p}=await e[E_[t]](l)),p)throw new Error(p.map(e=>e.message).join("\n"));return s?s[n]:null}},g_=e=>{const t=(({endpoint:e="http://localhost:3002",accessToken:t,boxId:a,passcode:n,enableSubscription:r=!0,enableRetry:i=!0,subscriptionOnConnectionOrError:o,onNetworkError:s}={})=>{const p=a&&n;let l=`${e}/api/graphql`;return p&&(l=`${e}/api/graphql_with_passcode`),Uh({endpointURL:l,subscriptionEndpointURL:l.replace("http:","ws:"),accessToken:t,enableSubscription:!p&&r,enableRetry:i,subscriptionOnConnectionOrError:o,onNetworkError:s})})(e);if(e.boxId&&e.passcode){t.type="passcode",t.queries=v,t.mutations=R;const a={boxId:e.boxId,passcode:e.passcode};Object.entries(v).forEach(T_(t,"query",a)),Object.entries(R).forEach(T_(t,"mutation",a)),t.listenBoxChanged=(e,n)=>t.subscribe({query:y_,variables:{...a,...e}}).subscribe({next:async({data:e})=>{await n(null,e.mediaBoxChanged)},error(e){n(e)}})}else t.accessToken=e.accessToken,t.type="token",t.queries=T,t.mutations=g,Object.entries(T).forEach(T_(t,"query")),Object.entries(g).forEach(T_(t,"mutation")),t.listenBoxChanged=(e,a)=>t.subscribe({query:l_,variables:e}).subscribe({next:async({data:e})=>{await a(null,e.mediaBoxChanged)},error(e){a(e)}});return t};function v_(e,t,a){switch(a){case"user":return new ff(e,t);case"workspace":return new eh(e,t);default:throw new Error(`Invalid token type: ${a}.`)}}process.env.STAGE,process.env.URL_BASE;var R_="bricks-mcp",b_={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools"},O_=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,c(1639));const N_=({type:e,title:t,template_key:a})=>{var n,r,i=(0,O_.makeId)(e);switch(e){case"subspace":n={title:t,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},r={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var o=rc(nc.canvas);n={title:t,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(o.propTypes).map(([e,t])=>[e,{...t,description:o.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(o.eventTypes).map(([e])=>[e,{description:o.brickEventDescriptions[e]}]))}},r={property_bank_map:{[(0,O_.makeId)("property_bank")]:{title:`Canvas ID: ${t}`,type:"string",value:i,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=rc(nc.components.Basic),p=rc(nc.brickMapping[a]);if(!p)throw new Error(`Brick ${a} not found`);var l={...p,propTypes:{...s.propTypes,...p.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...p.brickPropDescriptions},eventTypes:{...s.eventTypes,...p.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...p.brickEventDescriptions}};n={title:t,template_key:a,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,t])=>[e,{...t,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},r={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:i,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:t,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};case"generator":var u=rc(nc.generatorMapping[a]);if(!u)throw new Error(`Generator ${a} not found`);n={title:t,template_key:a,property:{$definitions:Object.fromEntries(Object.entries(u.propTypes).map(([e,t])=>[e,{...t,description:u.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(u.eventTypes).map(([e])=>[e,{description:u.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(u.outletTypes).map(([e])=>[e,{description:u.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:t,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:t,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(nc.propertyBank.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var d=(0,O_.makeId)("property_bank_command"),c=(0,O_.makeId)("property_bank_command"),m=(0,O_.makeId)("property_bank_command"),f="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:t,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${d}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${d}`,port:"obj | inputs"}]}},[d]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:f,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:c,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:d,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[c]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:d,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:c,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:c,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:t,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:f,$note:"Required, info for GUI editor"}}}return ed({id:i,example:n,extraInfo:r})};function A_(e,t){var a,n,r,i,o,s,p,l,u,d,c,m,f,h,_="user"===t.tokenType,y=((e,t=null)=>({name:a,description:n,inputSchema:r,permission:i},o)=>{uc(t,i)&&e.tool(a,n,r,o)})(e,t),E=e=>({...e,..._?{workspace_id:ia().describe("Workspace ID")}:{}}),T=t.client,g=_?function(e){var t=e.endpoint,a=e.accessToken;if(!t)throw new Error("Media API endpoint is required");if(!a)throw new Error("Access token is required");return g_({endpoint:t,accessToken:a,enableSubscription:!1,enableRetry:!0})}({endpoint:b_.media,accessToken:t.token}):T;_&&e.tool("list_workspaces","List all workspaces",{},b(function*(){return ed(yield T.workspaces())})),y({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:E({}),permission:"info"},function(){var e=b(function*({workspace_id:e}){var t=yield Promise.all([T.workspace({id:e}),T.applications({workspaceId:e,paginate:{limit:50,offset:0}}),T.modules({workspaceId:e,paginate:{limit:50,offset:0}}),T.devices({workspaceId:e,paginate:{limit:50,offset:0}}),_?g.mediaWorkspace({workspaceId:e}).catch(()=>null):g.mediaWorkspace().catch(()=>null),_?g.mediaBoxes({workspaceId:e}).catch(()=>[]):g.mediaBoxes().catch(()=>[])]),a=pe(t,6),n=a[0],r=a[1],i=a[2],o=a[3],s=a[4],p=a[5];if(!n)throw new Error("Authentication failed, please check your token");return ed({workspace:n,stats:{applications:r?.length??"No permission",modules:i?.length??"No permission",devices:o?.length??"No permission",running_apps:r?.filter(e=>e.status?.running).length??"No permission",media_boxes:p?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:r?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:p?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})});return function(t){return e.apply(this,arguments)}}()),y({name:"get_applications",description:"List all applications in the workspace",inputSchema:E({limit:oa().describe("Maximum number of applications to return").optional().default(50),offset:oa().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.applications({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:E({id:ia().describe("Application ID")}),permission:"query_application"},function(){var e=b(function*({workspace_id:e,id:t}){return ed(yield T.application({workspaceId:e,id:t}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_modules",description:"List all modules in the workspace",inputSchema:E({limit:oa().describe("Maximum number of modules to return").optional().default(50),offset:oa().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.modules({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:E({id:ia().describe("Module ID")}),permission:"query_module"},function(){var e=b(function*({workspace_id:e,id:t}){return ed(yield T.module({workspaceId:e,id:t}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_module_info",description:"Update a specific module info",inputSchema:E({id:ia().describe("Module ID"),name:ia().describe("Module name"),description:ia().describe("Module description")}),permission:"update_module"},function(){var e=b(function*({workspace_id:e,id:t,name:a,description:n}){return ed(yield T.updateModule({workspaceId:e,id:t,name:a,description:n}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_module_config",description:"Update a specific module configuration",inputSchema:E({id:ia().describe("Module ID"),config:pa({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},function(){var e=b(function*({workspace_id:e,id:t,config:a}){var n=yield tc(a);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return ed(yield T.updateModule({workspaceId:e,id:t,config:JSON.stringify(a),validateConfig:!0}))});return function(t){return e.apply(this,arguments)}}()),y({name:"get_devices",description:"List all devices in the workspace",inputSchema:E({limit:oa().describe("Maximum number of devices to return").optional().default(50),offset:oa().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},function(){var e=b(function*({workspace_id:e,limit:t=50,offset:a=0}){return ed(yield T.devices({workspaceId:e,paginate:{limit:t,offset:a}}))});return function(t){return e.apply(this,arguments)}}()),y({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:E({name:ia().describe("Application name"),description:ia().describe("Application description").optional(),grid_width:oa().describe("Grid width in units").optional().default(96),grid_height:oa().describe("Grid height in units").optional().default(54)}),permission:"create_application"},function(){var e=b(function*({workspace_id:e,name:t,description:a,grid_width:n,grid_height:r}){return ed(yield T.createApplication({workspaceId:e,name:t,description:a,gridWidth:n,gridHeight:r}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_application_info",description:"Update application info",inputSchema:{id:ia().describe("Application ID"),name:ia().describe("Application name"),description:ia().describe("Application description")},permission:"update_application"},function(){var e=b(function*({id:e,name:t,description:a}){return ed(yield T.updateApplication({id:e,name:t,description:a}))});return function(t){return e.apply(this,arguments)}}()),y({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:ia().describe("Application ID"),config:pa({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(a=b(function*({id:e,config:t}){var a=yield tc(t);if(!a.valid)throw new Error(`Config validation failed: ${a.errors.join(", ")}`);return ed(yield T.updateApplication({id:e,config:JSON.stringify(t)}))}),function(e){return a.apply(this,arguments)})),y({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:ia().describe("Application ID"),viewports:sa(pa({device_id:ia().describe("Device ID"),x:oa().describe("X coordinate"),y:oa().describe("Y coordinate"),width:oa().describe("Width"),height:oa().describe("Height"),rotate:oa().describe("Rotation"),rotateType:ia().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(n=b(function*({app_id:e,viewports:t}){return ed(yield T.bindApplication({id:e,bind_devices:t.map(e=>e.device_id),device_frames:t.reduce((e,t)=>({...e,[t.device_id]:{x:t.x,y:t.y,width:t.width,height:t.height,rotate:t.rotate,rotateType:t.rotateType}}),{})}))}),function(e){return n.apply(this,arguments)})),y({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:ia().describe("Application ID"),device_id:ia().describe("Device ID")},permission:"bind_application"},(r=b(function*({app_id:e,device_id:t}){return ed(yield T.bindApplication({id:e,unbindDevices:[t]}))}),function(e){return r.apply(this,arguments)})),_&&y({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},b(function*(){return ed(yield g.mediaWorkspaces())})),y({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:E({}),permission:"query_media_flow"},(i=b(function*({workspace_id:e}){return ed(yield g.mediaWorkspace({workspaceId:e}))}),function(e){return i.apply(this,arguments)})),y({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:E({}),permission:"query_media_flow"},(o=b(function*({workspace_id:e}){return ed(yield g.mediaBoxes({workspaceId:e}))}),function(e){return o.apply(this,arguments)})),y({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:ia().describe("Media box ID")},permission:"query_media_flow"},(s=b(function*({box_id:e}){return ed(yield g.mediaBox({boxId:e}))}),function(e){return s.apply(this,arguments)})),y({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:ia().describe("Media box ID"),include_types:sa(ia()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:sa(ia()).optional().describe("Filter by user tags"),limit:oa().optional().default(50).describe("Maximum number of files to return"),offset:oa().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(p=b(function*({box_id:e,include_types:t,user_tags:a,limit:n,offset:r}){return ed(yield g.mediaFiles({boxId:e,includeTypes:t,userTags:a,limit:n,offset:r}))}),function(e){return p.apply(this,arguments)})),y({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:ia().describe("Media file ID")},permission:"query_media_flow"},(l=b(function*({file_id:e}){return ed(yield g.mediaFile({fileId:e}))}),function(e){return l.apply(this,arguments)})),y({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:ia().describe("Target media box ID"),name:ia().describe("File name"),description:ia().optional().default("").describe("File description"),file_type:la(["image","video","audio","file"]).describe("File type"),source_url:ia().optional().describe("URL to download the file from"),base64_data:ia().optional().describe("Base64 encoded file data"),user_tags:sa(ia()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(u=b(function*({box_id:e,name:t,description:a,source_url:n,base64_data:r,file_type:i,user_tags:o}){if(!n&&!r)throw new Error("Either source_url or base64_data must be provided");if(n&&r)throw new Error("Provide either source_url OR base64_data, not both");var s=n?null:"application/octet-stream",p=n?yield(0,td.Ay)(n,{agent:fd(n)}).then(e=>(s=e.headers.get("content-type"),e.blob())):new Blob([Zu.Buffer.from(r,"base64")],{type:s}),l=yield g.requestFileUpload({name:t,description:a,boxId:e,fileType:_?i.toUpperCase():i,contentType:s,userTags:o,meta:{}}),u=JSON.parse(l?.meta.uploadInfo),d=new FormData;d.append("file",p),d.append("Content-Type",s),d.append("AWSAccessKeyId",u.AWSAccessKeyId),d.append("Signature",u.Signature),d.append("Policy",u.Policy),d.append("acl",u.acl),d.append("key",u.key);var c=yield(0,td.Ay)(u.url,{method:"POST",body:d}).then(e=>e.ok).catch(()=>!1);return ed({file_id:l.id,upload_success:c,upload_info:{content_type:s,file_type:i,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return u.apply(this,arguments)})),y({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:ia().describe("Media file ID"),name:ia().optional().describe("New file name"),description:ia().optional().describe("New file description"),user_tags:sa(ia()).optional().describe("New user tags")},permission:"write_media_flow"},(d=b(function*({file_id:e,name:t,description:a,user_tags:n}){return ed(yield g.updateMediaFile({fileId:e,name:t,description:a,userTags:n,requestUploadAgain:!1}))}),function(e){return d.apply(this,arguments)})),y({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:ia().describe("Source media box ID"),to_box_id:ia().describe("Target media box ID"),file_ids:sa(ia()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(c=b(function*({from_box_id:e,to_box_id:t,file_ids:a}){return ed(yield g.copyMediaFiles({fromBoxId:e,toBoxId:t,list:a}))}),function(e){return c.apply(this,arguments)})),y({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:ia().describe("Media box ID"),file_ids:sa(ia()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(m=b(function*({box_id:e,file_ids:t}){return ed(yield g.deleteMediaFiles({boxId:e,list:t}))}),function(e){return m.apply(this,arguments)})),y({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:ia().describe("Media box ID"),include_types:sa(ia()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(f=b(function*({box_id:e,include_types:t}){if("deleteMediaBoxFiles"in g)return ed(yield g.deleteMediaBoxFiles({boxId:e,includeTypes:t}));var a=yield g.mediaFiles({boxId:e,includeTypes:t});return ed(yield g.deleteMediaFiles({boxId:e,list:a.map(e=>e.id)}))}),function(e){return f.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:oa().describe("Device width in pixels"),device_height:oa().describe("Device height in pixels"),app_grid_width:oa().describe("Application grid width").optional().default(96),app_grid_height:oa().describe("Application grid height").optional().default(54)},(h=b(function*({device_width:e,device_height:t,app_grid_width:a,app_grid_height:n}){var r,i,o={deviceBrickWidth:(r=e)/(i=r/a),deviceBrickHeight:t/i,deviceBrickUnit:i},s=function(e,t,a=96){var n=e/a;return t>e&&(n=t/a),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(t/n),deviceBrickUnit:n}}(e,t,a);return ed({device_resolution:{width:e,height:t,aspect_ratio:(e/t).toFixed(2)},current_grid:{width:a,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:s.deviceBrickWidth,height:s.deviceBrickHeight,unit_size_px:s.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return h.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:la(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:ia().describe("Item title"),template_key:ia().optional().describe("Template key for brick or generator")},N_),e.tool("getting_started","Get documentation content for getting started",{},b(function*(){return ed(lc)}))}var S_="2.24.0-beta.15";function w_(){return w_=b(function*(e={}){var t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),new Error("API token is required");var a=Xu({queryStringParameters:{token:t}});if(!a.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(a.message),new Error("Invalid BRICKS_API_TOKEN");var n,r=new xu({name:R_,version:S_}),i={...a,client:v_(b_.bricks,a.token,a.tokenType)};(n=r).prompt("getting-started","Getting started with BRICKS",{},b(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:ia().describe("Name for the new application"),description:ia().describe("Short description for the new application").optional()},function(){var e=b(function*(e){var t=e?.app_name||"New Application",a=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${t}".\n\n${a?`Goal: ${a}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}});return function(t){return e.apply(this,arguments)}}()),function(e){e.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},b(function*(){return ed(Ju,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(r),A_(r,i);var o=new qu;try{yield r.connect(o),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${R_} v${S_}`),console.error(`Token Type: ${a.tokenType}`),console.error(`Permissions: ${a.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}}),w_.apply(this,arguments)}var I_=new P("mcp").description("MCP server management");I_.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action(function(){var e=b(function*(e){var t=(0,M.getCurrentProfile)(),a=e.token||(0,M.getToken)(t);a||(console.error(L.Ay.red("Error: No API token found.")),console.error(L.Ay.gray("Please login first with: bricks auth login <passcode>")),console.error(L.Ay.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{yield function(){return w_.apply(this,arguments)}({token:a})}catch(e){console.error(L.Ay.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}});return function(t){return e.apply(this,arguments)}}());var C_=new P("devtools").description("DevTools server discovery and connection");C_.command("scan").description("Scan LAN for DevTools servers via UDP + HTTP").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-j, --json","Output as JSON").option("--verify","Verify each discovered server via HTTP").option("--udp-only","Skip HTTP subnet probe (UDP only)").option("-p, --port <port>","Port for HTTP probe","19851").action(function(){var e=b(function*(e){var t=(yield Promise.resolve().then(c.bind(c,9790))).default,a=yield c.e(44).then(c.bind(c,2044)),n=a.discoverDevToolsServers,r=a.verifyDevToolsServer,i=a.httpProbeSubnet,o=yield Promise.resolve().then(c.bind(c,8765)),s=o.getCurrentProfile,p=o.getTokenInfo,l=parseInt(e.timeout,10),u=t(`Scanning for DevTools servers (${l}ms)...`).start();try{var d=n({timeout:l}),m=e.udpOnly?Promise.resolve([]):(u.text="Scanning via UDP + HTTP probe...",i({port:parseInt(e.port,10)})),f=yield Promise.all([d,m]),h=pe(f,2),_=h[0],y=h[1],E=[..._,...y],T=new Map;for(var g of E){var v=g.deviceId||`${g.address}:${g.port}`,R=T.get(v);if(R)for(var O of(R.addresses.includes(g.address)||R.addresses.push(g.address),"127.0.0.1"===R.address&&"127.0.0.1"!==g.address&&(R.address=g.address),g.protocols||[]))R.protocols?.includes(O)||R.protocols?.push(O);else T.set(v,{...g,addresses:[g.address]})}var N=[...T.values()];if(0===N.length)return void u.info("No DevTools servers found on the network.");if(e.verify){u.text=`Verifying ${N.length} server(s)...`;var A=yield Promise.all(N.map(function(){var e=b(function*(e){var t=yield r(e.address,e.port);return{...e,verified:!!t}});return function(t){return e.apply(this,arguments)}}()));N.splice(0,N.length,...A)}if(u.stop(),e.json)return void console.log(JSON.stringify(N,null,2));var S=p(s()),w=S?.workspaceId||null;console.log(L.Ay.bold(`\nFound ${N.length} DevTools server(s)`)),console.log("─".repeat(80));var I=function*(e){var t=!1===e.verified?L.Ay.red("unverified"):L.Ay.green("online"),a=e.hasPasscode?L.Ay.yellow("passcode"):L.Ay.gray("open"),n=(e.protocols||[]).map(e=>L.Ay.cyan(e)).join(", "),r=e.workspaceId&&w&&e.workspaceId===w,i=e.addresses||[e.address],o=i.filter(t=>t!==e.address),s=o.length>0?`${e.address}:${e.port} +${o.length} more`:`${e.address}:${e.port}`;console.log(` ${L.Ay.bold(e.name||"Unknown")} ${L.Ay.gray(`(${s})`)} [${t}]`),o.length>0&&console.log(` Addresses: ${i.map(e=>L.Ay.gray(e)).join(", ")}`);var p=` Protocols: ${n||L.Ay.gray("none")} Auth: ${a}`;if(e.deviceId&&(p+=` Device: ${L.Ay.gray(e.deviceId)}`),console.log(p),e.workspaceId){var l=r?L.Ay.green(`${e.workspaceId} (current profile)`):L.Ay.gray(e.workspaceId);console.log(` Workspace: ${l}`)}};for(var C of N)yield*I(C);console.log("─".repeat(80)),console.log(L.Ay.gray(`\nConnect via: devtools://devtools/bundled/js_app.html?ws=<address>:${N[0]?.port||19851}/ws?p=<passcode>`)),process.exit(0)}catch(e){u.fail(`Scan failed: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),C_.command("open <address>").description("Show connection URLs for a DevTools server").option("-p, --port <port>","Server port","19851").option("--verify","Verify server is reachable first").action(function(){var e=b(function*(e,t){var a=parseInt(t.port,10),n=`${e}:${a}`;if(t.verify){var r=(yield Promise.resolve().then(c.bind(c,9790))).default,i=(yield c.e(44).then(c.bind(c,2044))).verifyDevToolsServer,o=r(`Verifying ${n}...`).start(),s=yield i(e,a);s||(o.fail(`Could not reach DevTools server at ${n}`),process.exit(1)),o.succeed(`${s.name||"DevTools"} is reachable`),console.log()}console.log(L.Ay.bold("Connection URLs")),console.log("─".repeat(60)),console.log(` Web UI: ${L.Ay.cyan(`http://${n}`)}`),console.log(` CDP: ${L.Ay.cyan(`devtools://devtools/bundled/js_app.html?ws=${n}/ws?p=<passcode>`)}`),console.log(` MCP: ${L.Ay.cyan(`http://${n}/mcp`)}`),console.log(` MCP SSE: ${L.Ay.cyan(`http://${n}/sse`)}`),console.log(` Info: ${L.Ay.cyan(`http://${n}/devtools/info`)}`),console.log("─".repeat(60)),console.log(),console.log(L.Ay.bold("Authorization")),console.log(" MCP and MCP SSE require a Bearer token header with the device passcode:"),console.log(` ${L.Ay.gray("Authorization: Bearer <passcode>")}`)});return function(t,a){return e.apply(this,arguments)}}());var D_=function(){var e=b(function*(){var e=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);if(-1!==e&&process.argv[e+1]&&((0,M.setProfileOverride)(process.argv[e+1]),process.argv.splice(e,2)),N.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.24.0-beta.15").enablePositionalOptions(),N.addCommand(U),N.addCommand(Z),N.addCommand(ie),N.addCommand(se),N.addCommand(ce),N.addCommand(ge),N.addCommand(Ie),N.addCommand(I_),N.addCommand(C_),N.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(b(function*(){try{(0,(yield c.e(612).then(c.bind(c,9612))).runInteractiveMode)()}catch(e){console.error(L.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),N.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action(function(){var e=b(function*(e){var t=yield Promise.resolve().then(c.bind(c,8765)),a=t.getToken,n=t.getBaseUrl,r=t.getCurrentProfile,i=(yield Promise.resolve().then(c.bind(c,700))).createClient,o=(yield Promise.resolve().then(c.bind(c,9790))).default,s=a(r());s||(console.error(L.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var p=o("Fetching workspace info...").start();try{var l=i(n(),s),u=yield l.workspace();if(p.stop(),e.json)return void console.log(JSON.stringify(u,null,2));console.log(L.Ay.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${L.Ay.green(u.name)}`),console.log(`ID: ${L.Ay.gray(u._id)}`),console.log(`Description: ${u.description||L.Ay.gray("N/A")}`),console.log(`\n${L.Ay.bold("Data")}`),console.log(`Remote Update: ${u.bank?.enable_remote_update?L.Ay.green("Enabled"):L.Ay.gray("Disabled")}`),console.log(`Spacename: ${u.bank?.spacename||L.Ay.gray("N/A")}`),console.log("─".repeat(60))}catch(e){p.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}});return function(t){return e.apply(this,arguments)}}()),N.on("--help",()=>{console.log(""),console.log(L.Ay.bold("Examples:")),console.log(""),console.log(L.Ay.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(L.Ay.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(L.Ay.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(L.Ay.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(L.Ay.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(L.Ay.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(L.Ay.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(L.Ay.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(L.Ay.gray("Get workspace token from BRICKS Controller:")),console.log(L.Ay.cyan(" https://control.bricks.tools")),console.log(L.Ay.gray(" Go to Workspace Settings > API Token"))}),0===process.argv.slice(2).length)try{return void(0,(yield c.e(612).then(c.bind(c,9612))).runInteractiveMode)()}catch(e){console.error(L.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}yield N.parseAsync(process.argv)});return function(){return e.apply(this,arguments)}}();const P_=D_;export{P_ as default,D_ as run};