@dxos/shell 0.4.7-main.344d0d8 โ†’ 0.4.7-main.3df814a

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.
@@ -818,7 +818,7 @@ button {
818
818
  `))):W=G.stylize("[Circular]","special")),C(B)){if(K&&H.match(/^\d+$/))return W;B=JSON.stringify(""+H),B.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(B=B.slice(1,-1),B=G.stylize(B,"name")):(B=B.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),B=G.stylize(B,"string"))}return B+": "+W}function b(G,Y,ie){var pe=G.reduce(function(H,K){return K.indexOf(`
819
819
  `)>=0,H+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return pe>60?ie[0]+(Y===""?"":Y+`
820
820
  `)+" "+G.join(`,
821
- `)+" "+ie[1]:ie[0]+Y+" "+G.join(", ")+" "+ie[1]}e.types=oI();function w(G){return Array.isArray(G)}e.isArray=w;function _(G){return typeof G=="boolean"}e.isBoolean=_;function k(G){return G===null}e.isNull=k;function E(G){return G==null}e.isNullOrUndefined=E;function S(G){return typeof G=="number"}e.isNumber=S;function I(G){return typeof G=="string"}e.isString=I;function P(G){return typeof G=="symbol"}e.isSymbol=P;function C(G){return G===void 0}e.isUndefined=C;function T(G){return N(G)&&J(G)==="[object RegExp]"}e.isRegExp=T,e.types.isRegExp=T;function N(G){return typeof G=="object"&&G!==null}e.isObject=N;function j(G){return N(G)&&J(G)==="[object Date]"}e.isDate=j,e.types.isDate=j;function L(G){return N(G)&&(J(G)==="[object Error]"||G instanceof Error)}e.isError=L,e.types.isNativeError=L;function D(G){return typeof G=="function"}e.isFunction=D;function X(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}e.isPrimitive=X,e.isBuffer=sI();function J(G){return Object.prototype.toString.call(G)}function ee(G){return G<10?"0"+G.toString(10):G.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function fe(){var G=new Date,Y=[ee(G.getHours()),ee(G.getMinutes()),ee(G.getSeconds())].join(":");return[G.getDate(),ae[G.getMonth()],Y].join(" ")}e.log=function(){console.log("%s - %s",fe(),e.format.apply(e,arguments))},e.inherits=fI(),e._extend=function(G,Y){if(!Y||!N(Y))return G;for(var ie=Object.keys(Y),pe=ie.length;pe--;)G[ie[pe]]=Y[ie[pe]];return G};function de(G,Y){return Object.prototype.hasOwnProperty.call(G,Y)}var oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');if(oe&&Y[oe]){var ie=Y[oe];if(typeof ie!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ie,oe,{value:ie,enumerable:!1,writable:!1,configurable:!0}),ie}function ie(){for(var pe,H,K=new Promise(function(V,O){pe=V,H=O}),B=[],W=0;W<arguments.length;W++)B.push(arguments[W]);B.push(function(V,O){V?H(V):pe(O)});try{Y.apply(this,B)}catch(V){H(V)}return K}return Object.setPrototypeOf(ie,Object.getPrototypeOf(Y)),oe&&Object.defineProperty(ie,oe,{value:ie,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ie,n(Y))},e.promisify.custom=oe;function me(G,Y){if(!G){var ie=new Error("Promise was rejected with a falsy value");ie.reason=G,G=ie}return Y(G)}function se(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');function Y(){for(var ie=[],pe=0;pe<arguments.length;pe++)ie.push(arguments[pe]);var H=ie.pop();if(typeof H!="function")throw new TypeError("The last argument must be of type Function");var K=this,B=function(){return H.apply(K,arguments)};G.apply(this,ie).then(function(W){process.nextTick(B.bind(null,null,W))},function(W){process.nextTick(me.bind(null,W,B))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(G)),Object.defineProperties(Y,n(G)),Y}e.callbackify=se}}),lI=ur(H0()),vu=ur(H0());lI.default,vu.callbackify;var Ft=vu.inspect;vu.promisify;var dI=nn({"node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(e,n){var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,T,N){return Function.prototype.apply.call(C,T,N)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:r=function(C){return Object.getOwnPropertyNames(C)};function a(P){console&&console.warn&&console.warn(P)}var o=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}n.exports=s,n.exports.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function d(P){if(typeof P!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(P){if(typeof P!="number"||P<0||o(P))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");f=P}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||o(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(P){return P._maxListeners===void 0?s.defaultMaxListeners:P._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var T=[],N=1;N<arguments.length;N++)T.push(arguments[N]);var j=C==="error",L=this._events;if(L!==void 0)j=j&&L.error===void 0;else if(!j)return!1;if(j){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var X=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw X.context=D,X}var J=L[C];if(J===void 0)return!1;if(typeof J=="function")i(J,this,T);else for(var ee=J.length,ae=w(J,ee),N=0;N<ee;++N)i(ae[N],this,T);return!0};function h(P,C,T,N){var j,L,D;if(d(T),L=P._events,L===void 0?(L=P._events=Object.create(null),P._eventsCount=0):(L.newListener!==void 0&&(P.emit("newListener",C,T.listener?T.listener:T),L=P._events),D=L[C]),D===void 0)D=L[C]=T,++P._eventsCount;else if(typeof D=="function"?D=L[C]=N?[T,D]:[D,T]:N?D.unshift(T):D.push(T),j=u(P),j>0&&D.length>j&&!D.warned){D.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=P,X.type=C,X.count=D.length,a(X)}return P}s.prototype.addListener=function(C,T){return h(this,C,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,T){return h(this,C,T,!0)};function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(P,C,T){var N={fired:!1,wrapFn:void 0,target:P,type:C,listener:T},j=v.bind(N);return j.listener=T,N.wrapFn=j,j}s.prototype.once=function(C,T){return d(T),this.on(C,m(this,C,T)),this},s.prototype.prependOnceListener=function(C,T){return d(T),this.prependListener(C,m(this,C,T)),this},s.prototype.removeListener=function(C,T){var N,j,L,D,X;if(d(T),j=this._events,j===void 0)return this;if(N=j[C],N===void 0)return this;if(N===T||N.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete j[C],j.removeListener&&this.emit("removeListener",C,N.listener||T));else if(typeof N!="function"){for(L=-1,D=N.length-1;D>=0;D--)if(N[D]===T||N[D].listener===T){X=N[D].listener,L=D;break}if(L<0)return this;L===0?N.shift():_(N,L),N.length===1&&(j[C]=N[0]),j.removeListener!==void 0&&this.emit("removeListener",C,X||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var T,N,j;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[C]),this;if(arguments.length===0){var L=Object.keys(N),D;for(j=0;j<L.length;++j)D=L[j],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=N[C],typeof T=="function")this.removeListener(C,T);else if(T!==void 0)for(j=T.length-1;j>=0;j--)this.removeListener(C,T[j]);return this};function g(P,C,T){var N=P._events;if(N===void 0)return[];var j=N[C];return j===void 0?[]:typeof j=="function"?T?[j.listener||j]:[j]:T?k(j):w(j,j.length)}s.prototype.listeners=function(C){return g(this,C,!0)},s.prototype.rawListeners=function(C){return g(this,C,!1)},s.listenerCount=function(P,C){return typeof P.listenerCount=="function"?P.listenerCount(C):b.call(P,C)},s.prototype.listenerCount=b;function b(P){var C=this._events;if(C!==void 0){var T=C[P];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function w(P,C){for(var T=new Array(C),N=0;N<C;++N)T[N]=P[N];return T}function _(P,C){for(;C+1<P.length;C++)P[C]=P[C+1];P.pop()}function k(P){for(var C=new Array(P.length),T=0;T<C.length;++T)C[T]=P[T].listener||P[T];return C}function E(P,C){return new Promise(function(T,N){function j(D){P.removeListener(C,L),N(D)}function L(){typeof P.removeListener=="function"&&P.removeListener("error",j),T([].slice.call(arguments))}I(P,C,L,{once:!0}),C!=="error"&&S(P,j,{once:!0})})}function S(P,C,T){typeof P.on=="function"&&I(P,"error",C,T)}function I(P,C,T,N){if(typeof P.on=="function")N.once?P.once(C,T):P.on(C,T);else if(typeof P.addEventListener=="function")P.addEventListener(C,function j(L){N.once&&P.removeEventListener(C,j),T(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}}}),V0=ur(dI());V0.EventEmitter,V0.EventEmitter;var df=e=>{const n=Object.getPrototypeOf(e).constructor.name;return e.toJSON?`${n}(${Ft(e.toJSON())})`:String(e)},q0=e=>{throw e},G0;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.VERBOSE=1]="VERBOSE",e[e.BOLD=2]="BOLD"})(G0||(G0={}));var uI=(e,n=8)=>{const t=String(e);return t.length<=n?t:t.slice(0,n)},uf=Symbol.for("devtoolsFormatter"),cI=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(e,n)=>{const t=e[uf];if(t===void 0)return null;if(typeof t!="object"||t===null||typeof t.header!="function")throw new Error(`Invalid devtools formatter for ${e.constructor.name}`);return t.header(n)},hasBody:(e,n)=>{const t=e[uf];return!t||!t.hasBody?!1:t.hasBody(n)},body:(e,n)=>{const t=e[uf];return!t||!t.body?null:t.body(n)}})};cI();var hI=Symbol.for("dxos.common.equals"),vI=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),pu="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",pI=32,K0=class Zn{static from(n){if(io(n,void 0,{F:pu,L:30,S:this,A:["source",""]}),n instanceof Zn)return n;if(n instanceof Buffer)return new Zn(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));if(n instanceof Uint8Array)return new Zn(n);if(n instanceof ArrayBuffer)return new Zn(new Uint8Array(n));if(typeof n=="string")return Zn.fromHex(n);if(n.asUint8Array)return new Zn(n.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${n}`)}static safeFrom(n){if(n)try{return Zn.from(n)}catch{return}}static fromHex(n){n.startsWith("0x")&&(n=n.slice(2));const t=Buffer.from(n,"hex");return new Zn(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}static random(){return Zn.from(mI(pI))}static*randomSequence(){for(let n=0;n<1e4;n++)yield Zn.random();throw new Error("Too many keys requested")}static isPublicKey(n){return n instanceof Zn}static assertValidPublicKey(n){if(!this.isPublicKey(n))throw new TypeError("Invalid PublicKey")}static equals(n,t){return Zn.from(n).equals(t)}static bufferize(n){return io(typeof n=="string","Invalid type",{F:pu,L:129,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from(n,"hex")}static stringify(n){return n instanceof Zn?n=n.asBuffer():n instanceof Uint8Array&&(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),io(n instanceof Buffer,"Invalid type",{F:pu,L:148,S:this,A:["key instanceof Buffer","'Invalid type'"]}),n.toString("hex")}static hash(n){return n.toHex()}constructor(n){if(this._value=n,!(n instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${n}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(n=void 0){return uI(this,n)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(n){return Math.abs(this._value.reduce((t,i)=>t^i|0,0))%n}[Ft.custom](n,t){if(!t.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const i=o=>`\x1B[${o}m`,r=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],a=r[this.getInsecureHash(r.length)];return`PublicKey(${i(Ft.colors[a][0])}${this.truncate()}${i(Ft.colors.reset[0])})`}get[uf](){return{header:()=>{const n=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],t=n[this.getInsecureHash(n.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${t};`},this.truncate()],["span",{},")"]]}}}equals(n){const t=Zn.from(n);if(this._value.length!==t._value.length)return!1;let i=!0;for(let r=0;r<this._value.length;r++)i&&(i=this._value[r]===t._value[r]);return i}[hI](n){return Zn.isPublicKey(n)?this.equals(n):!1}},mI=e=>{const n=globalThis.crypto??vI("@dxos/node-std/crypto").webcrypto,t=new Uint8Array(e);return n.getRandomValues(t),t},Y0=10;(class{constructor(e,n){if(this._projection=e,this._values=new Map,n)for(const t of n)this.add(t)}toString(){return df(this)}toJSON(){return this._values.size>Y0?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return df(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,n){n&&(e=e.bind(n)),this._values.forEach(t=>e(t,t,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,n){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,n)for(const[t,i]of n)this.set(t,i)}toString(){return df(this)}toJSON(){return this._values.size>Y0?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return df(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const n=this._keys.delete(this._keyProjection(e)),t=this._values.delete(this._keyProjection(e));return n||t}forEach(e,n){n&&(e=e.bind(n)),this._keys.forEach((t,i)=>e(this._values.get(i)??q0(new Error("Map corrupted.")),t,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,n){const t=this._keyProjection(e);return this._keys.set(t,e),this._values.set(t,n),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,n]of this._keys){const t=this._values.get(e)??q0(new Error("Map corrupted."));yield[n,t]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var J0=["๐Ÿ‘น","๐Ÿ‘ป","๐Ÿ‘ฝ","๐Ÿค–","๐ŸŽƒ","๐Ÿฆพ","๐Ÿฆฟ","๐Ÿฆท","๐Ÿ‘ฃ","๐Ÿ‘๏ธ","๐Ÿงถ","๐Ÿ‘‘","๐Ÿ’","๐Ÿฆ†","๐Ÿฆ‰","๐Ÿด","๐Ÿฆ„","๐Ÿ","๐Ÿฆ‹","๐Ÿž","๐Ÿชฒ","๐Ÿข","๐ŸฆŽ","๐Ÿฆ•","๐Ÿฆ‘","๐Ÿฆ€","๐Ÿ ","๐Ÿฌ","๐Ÿ‹","๐Ÿฆญ","๐Ÿ…","๐Ÿ†","๐Ÿฆ“","๐Ÿฆ","๐Ÿฆง","๐Ÿ˜","๐Ÿซ","๐Ÿฆ’","๐Ÿฆ˜","๐Ÿฆฌ","๐Ÿ–","๐Ÿ","๐ŸฆŒ","๐Ÿ•","๐Ÿˆ","๐Ÿ“","๐Ÿฆš","๐Ÿฆœ","๐Ÿฆข","๐Ÿฆฉ","๐Ÿฆฆ","๐Ÿ","๐Ÿฟ๏ธ","๐ŸŒต","๐ŸŒฒ","๐ŸŒณ","๐Ÿชต","๐ŸŒฑ","๐Ÿ","๐Ÿชบ","๐Ÿ„","๐Ÿš","๐Ÿชธ","๐Ÿชจ","๐ŸŒพ","๐ŸŒท","๐ŸŒป","โ˜€๏ธ","๐ŸŒ™","๐Ÿช","โญ๏ธ","โšก๏ธ","โ˜„๏ธ","๐Ÿ”ฅ","๐ŸŒˆ","โ˜๏ธ","๐Ÿ’ง","โ›ฑ๏ธ","๐ŸŒŠ","๐ŸŽ","๐Ÿ‹","๐Ÿ‰","๐Ÿ‡","๐Ÿซ","๐Ÿˆ","๐Ÿ’","๐Ÿ‘","๐Ÿฅญ","๐Ÿ","๐Ÿฅฅ","๐Ÿฅ","๐Ÿฅ‘","๐ŸŒถ๏ธ","๐ŸŒฝ","๐Ÿฅ•","๐Ÿฌ","๐Ÿฅœ","๐Ÿซ–","โ˜•๏ธ","๐Ÿต","๐ŸงŠ","๐Ÿง‚","๐Ÿ”๏ธ","โš“๏ธ","๐Ÿ›Ÿ","๐Ÿ๏ธ","๐Ÿ›ถ","๐Ÿš€","๐Ÿ›ฐ๏ธ","โ›ฒ๏ธ","๐Ÿฐ","๐Ÿšฒ","โ›บ๏ธ","๐ŸŽ™๏ธ","๐Ÿงฒ","โš™๏ธ","๐Ÿ”ฉ","๐Ÿ”ฎ","๐Ÿ”ญ","๐Ÿ”ฌ","๐Ÿงฌ","๐ŸŒก๏ธ","๐Ÿงบ","๐Ÿ›Ž๏ธ","๐Ÿ”‘","๐Ÿช‘","๐Ÿงธ","๐ŸŽˆ","๐ŸŽ€","๐ŸŽŠ","โ™ป๏ธ","๐ŸŽต"],X0=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],gI=e=>ao(e.toHex()),ao=e=>Z0(parseInt(e,16)),Z0=e=>J0[e%J0.length],bI=e=>Q0(parseInt(e,16)),Q0=e=>X0[e%X0.length],eb=e=>nb(e.toHex()),nb=e=>yI(parseInt(e,16)),yI=e=>({emoji:Z0(e),hue:Q0(e)}),wI=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],_I=class{constructor(e=wI){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,n=4,t="-"){const i=e.match(/(..?)/g);if(!i)throw new Error("");const r=i.map(o=>parseInt(o,16));return this._compress(r,n).map(o=>this.wordlist[o]).join(t)}_compress(e,n){const t=e.length;if(n>t)throw new Error("Fewer input bytes than requested output");const i=t/n>>0,r=[];for(let o=0;o<i*n;o+=i)r.push(e.slice(o,o+i));return r[r.length-1]=r[r.length-1].concat(e.slice(n*i)),r.map(o=>o.reduce((s,f)=>s^f))}},kI=new _I,xI=e=>(e instanceof L0||e instanceof Uint8Array||e instanceof ArrayBuffer?e=K0.stringify(e):e instanceof K0&&(e=e.toHex()),kI.humanize(e)),EI=e=>L0.from(e.buffer,e.byteOffset,e.byteLength),SI=5,mu=(e,n=0,t=new WeakSet)=>{if(n>SI)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(t.has(e))return null;t.add(e);try{if(e instanceof Uint8Array)return EI(e).toString("hex");if(Array.isArray(e))return e.map(i=>mu(i,n+1,t));if(typeof e.toJSON=="function")return e.toJSON();{const i={};for(const r of Object.keys(e))i[r]=mu(e[r],n+1,t);return i}}finally{t.delete(e)}}else return e},CI=(e,n,t)=>{let i=e.get(n);return i===void 0&&(i=typeof t=="function"?t():t,e.set(n,i)),i},$I=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),gu=Symbol("instanceTag"),AI=e=>n=>{n.prototype[gu]=e,Object.defineProperty(n.prototype,Symbol.hasInstance,{value:t=>(t==null?void 0:t[gu])===e}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>(t==null?void 0:t[gu])===e})},bu=Symbol.for("dxos.instance-contexts"),TI=globalThis[bu]??(globalThis[bu]=new WeakMap),OI=e=>{const n=Object.getPrototypeOf(e),t=CI(TI,n,()=>({nextId:0,instanceIds:new WeakMap}));let i=t.instanceIds.get(e);return i===void 0&&(i=t.nextId++,t.instanceIds.set(e,i)),i};Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));const tb=l.forwardRef(({identity:e,presence:n,onClick:t,classNames:i,...r},a)=>{var d,u,h;const o=eb(e.identityKey),s=Tn("identityListItem__label"),f=((d=e.profile)==null?void 0:d.displayName)??ff(e.identityKey.toHex());return l.createElement(_d.Root,{...r,classNames:le("flex gap-2 pis-3 pie-1 items-center",t&&"cursor-pointer",i),onClick:()=>t==null?void 0:t(),"data-testid":"identity-list-item",labelId:s,ref:a},l.createElement(Dn.Root,{status:n===Bo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:s,hue:((u=e.profile)==null?void 0:u.hue)||o.hue},l.createElement(Dn.Frame,{classNames:"place-self-center"},l.createElement(Dn.Fallback,{text:((h=e.profile)==null?void 0:h.emoji)||o.emoji})),l.createElement(Dn.Label,{classNames:"text-sm truncate pli-2"},f)))}),PI=({devices:e,onSelect:n})=>{const{t}=sn("os");return e.length>0?l.createElement(wd,{classNames:"flex flex-col gap-2"},e.map(i=>{var s,f;const r=((s=i.profile)==null?void 0:s.type)||Ki.DeviceType.UNKNOWN,a=(f=i.profile)!=null&&f.label?`${i.profile.label} (${Ki.DeviceType[r]})`:ff(i.deviceKey.toHex()),o={identityKey:i.deviceKey,profile:{displayName:a}};return l.createElement(tb,{key:i.deviceKey.toHex(),identity:o,presence:i.presence,onClick:n&&(()=>n(i))})})):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Mn,"text-center is-full")},t("empty device list message")))},II=({spaceKey:e,includeSelf:n,onSelect:t})=>{const i=Ye.useClient(),r=Bo.useMembers(e),a=l.useMemo(()=>n?r.sort(o=>o.identity.identityKey.equals(i.halo.identity.get().identityKey)?-1:1):r.filter(o=>!o.identity.identityKey.equals(i.halo.identity.get().identityKey)),[r]);return l.createElement(FI,{members:a,onSelect:t})},FI=({members:e,onSelect:n})=>{const{t}=sn("os"),i=e.filter(r=>r.identity);return i.length>0?l.createElement(wd,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},i.map(r=>l.createElement(tb,{key:r.identity.identityKey.toHex(),identity:r.identity,presence:r.presence,onClick:n&&(()=>n(r))}))):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Mn,"text-center is-full mlb-2")},t("empty space members message")))};var ib;(function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"})(ib||(ib={}));var rb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.TRUNCATE=1]="TRUNCATE",n[n.HUMANIZE=2]="HUMANIZE"})(e.KEY_OPTION||(e.KEY_OPTION={}))})(rb||(rb={}));var ab;(function(e){(function(n){n[n.BROWSER=0]="BROWSER",n[n.SHARED_WORKER=1]="SHARED_WORKER",n[n.NODE=2]="NODE"})(e.PLATFORM_TYPE||(e.PLATFORM_TYPE={}))})(ab||(ab={}));var ob;(function(e){e[e.CURRENT=0]="CURRENT",e[e.TRUSTED=1]="TRUSTED"})(ob||(ob={}));var sb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(sb||(sb={}));var fb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(fb||(fb={}));var lb;(function(e){e[e.INACTIVE=2]="INACTIVE",e[e.ACTIVE=6]="ACTIVE",e[e.CLOSED=1]="CLOSED",e[e.CONTROL_ONLY=7]="CONTROL_ONLY",e[e.INITIALIZING=4]="INITIALIZING",e[e.READY=3]="READY",e[e.ERROR=5]="ERROR"})(lb||(lb={}));var db;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.INIT_AUTOMERGE=1]="INIT_AUTOMERGE"})(e.Migration||(e.Migration={}))})(db||(db={}));var _e;(function(e){(function(n){n[n.INTERACTIVE=0]="INTERACTIVE",n[n.OFFLINE=1]="OFFLINE",n[n.MULTIUSE=2]="MULTIUSE"})(e.Type||(e.Type={})),function(n){n[n.DEVICE=0]="DEVICE",n[n.SPACE=1]="SPACE"}(e.Kind||(e.Kind={})),function(n){n[n.NONE=0]="NONE",n[n.SHARED_SECRET=1]="SHARED_SECRET"}(e.AuthMethod||(e.AuthMethod={})),function(n){n[n.INIT=0]="INIT",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",n[n.AUTHENTICATING=4]="AUTHENTICATING",n[n.SUCCESS=5]="SUCCESS",n[n.CANCELLED=6]="CANCELLED",n[n.TIMEOUT=7]="TIMEOUT",n[n.ERROR=8]="ERROR"}(e.State||(e.State={}))})(_e||(_e={}));var ub;(function(e){(function(n){n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED"})(e.Action||(e.Action={})),function(n){n[n.CREATED=0]="CREATED",n[n.ACCEPTED=1]="ACCEPTED"}(e.Type||(e.Type={}))})(ub||(ub={}));var cb;(function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE"})(cb||(cb={}));var hb;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(hb||(hb={}));var vb;(function(e){(function(n){n[n.INCLUSIVE=1]="INCLUSIVE",n[n.EXPLICIT=2]="EXPLICIT"})(e.MatchingOptions||(e.MatchingOptions={}))})(vb||(vb={}));var NI=200,yu="__lodash_hash_undefined__",MI=1/0,pb=9007199254740991,DI="[object Arguments]",LI="[object Function]",BI="[object GeneratorFunction]",jI="[object Symbol]",RI=/[\\^$.*+?()[\]{}|]/g,UI=/^\[object .+?Constructor\]$/,zI=/^(?:0|[1-9]\d*)$/,WI=typeof pn=="object"&&pn&&pn.Object===Object&&pn,HI=typeof self=="object"&&self&&self.Object===Object&&self,wu=WI||HI||Function("return this")();function VI(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function qI(e,n){var t=e?e.length:0;return!!t&&YI(e,n,0)>-1}function GI(e,n,t){for(var i=-1,r=e?e.length:0;++i<r;)if(t(n,e[i]))return!0;return!1}function mb(e,n){for(var t=-1,i=e?e.length:0,r=Array(i);++t<i;)r[t]=n(e[t],t,e);return r}function _u(e,n){for(var t=-1,i=n.length,r=e.length;++t<i;)e[r+t]=n[t];return e}function KI(e,n,t,i){for(var r=e.length,a=t+(i?1:-1);i?a--:++a<r;)if(n(e[a],a,e))return a;return-1}function YI(e,n,t){if(n!==n)return KI(e,JI,t);for(var i=t-1,r=e.length;++i<r;)if(e[i]===n)return i;return-1}function JI(e){return e!==e}function XI(e,n){for(var t=-1,i=Array(e);++t<e;)i[t]=n(t);return i}function ZI(e){return function(n){return e(n)}}function QI(e,n){return e.has(n)}function eF(e,n){return e==null?void 0:e[n]}function nF(e){var n=!1;if(e!=null&&typeof e.toString!="function")try{n=!!(e+"")}catch{}return n}function gb(e,n){return function(t){return e(n(t))}}var tF=Array.prototype,iF=Function.prototype,cf=Object.prototype,ku=wu["__core-js_shared__"],bb=function(){var e=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),yb=iF.toString,ta=cf.hasOwnProperty,xu=cf.toString,rF=RegExp("^"+yb.call(ta).replace(RI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wb=wu.Symbol,aF=gb(Object.getPrototypeOf,Object),oF=cf.propertyIsEnumerable,sF=tF.splice,_b=wb?wb.isConcatSpreadable:void 0,Eu=Object.getOwnPropertySymbols,kb=Math.max,fF=Eb(wu,"Map"),oo=Eb(Object,"create");function cr(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function lF(){this.__data__=oo?oo(null):{}}function dF(e){return this.has(e)&&delete this.__data__[e]}function uF(e){var n=this.__data__;if(oo){var t=n[e];return t===yu?void 0:t}return ta.call(n,e)?n[e]:void 0}function cF(e){var n=this.__data__;return oo?n[e]!==void 0:ta.call(n,e)}function hF(e,n){var t=this.__data__;return t[e]=oo&&n===void 0?yu:n,this}cr.prototype.clear=lF,cr.prototype.delete=dF,cr.prototype.get=uF,cr.prototype.has=cF,cr.prototype.set=hF;function ia(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function vF(){this.__data__=[]}function pF(e){var n=this.__data__,t=vf(n,e);if(t<0)return!1;var i=n.length-1;return t==i?n.pop():sF.call(n,t,1),!0}function mF(e){var n=this.__data__,t=vf(n,e);return t<0?void 0:n[t][1]}function gF(e){return vf(this.__data__,e)>-1}function bF(e,n){var t=this.__data__,i=vf(t,e);return i<0?t.push([e,n]):t[i][1]=n,this}ia.prototype.clear=vF,ia.prototype.delete=pF,ia.prototype.get=mF,ia.prototype.has=gF,ia.prototype.set=bF;function ra(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function yF(){this.__data__={hash:new cr,map:new(fF||ia),string:new cr}}function wF(e){return pf(this,e).delete(e)}function _F(e){return pf(this,e).get(e)}function kF(e){return pf(this,e).has(e)}function xF(e,n){return pf(this,e).set(e,n),this}ra.prototype.clear=yF,ra.prototype.delete=wF,ra.prototype.get=_F,ra.prototype.has=kF,ra.prototype.set=xF;function hf(e){var n=-1,t=e?e.length:0;for(this.__data__=new ra;++n<t;)this.add(e[n])}function EF(e){return this.__data__.set(e,yu),this}function SF(e){return this.__data__.has(e)}hf.prototype.add=hf.prototype.push=EF,hf.prototype.has=SF;function CF(e,n){var t=Su(e)||Sb(e)?XI(e.length,String):[],i=t.length,r=!!i;for(var a in e)(n||ta.call(e,a))&&!(r&&(a=="length"||BF(a,i)))&&t.push(a);return t}function vf(e,n){for(var t=e.length;t--;)if(VF(e[t][0],n))return t;return-1}function $F(e,n,t,i){var r=-1,a=qI,o=!0,s=e.length,f=[],d=n.length;if(!s)return f;t&&(n=mb(n,ZI(t))),i?(a=GI,o=!1):n.length>=NI&&(a=QI,o=!1,n=new hf(n));e:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=i||u!==0?u:0,o&&h===h){for(var v=d;v--;)if(n[v]===h)continue e;f.push(u)}else a(n,h,i)||f.push(u)}return f}function xb(e,n,t,i,r){var a=-1,o=e.length;for(t||(t=LF),r||(r=[]);++a<o;){var s=e[a];n>0&&t(s)?n>1?xb(s,n-1,t,i,r):_u(r,s):i||(r[r.length]=s)}return r}function AF(e,n,t){var i=n(e);return Su(e)?i:_u(i,t(e))}function TF(e){if(!Cu(e)||RF(e))return!1;var n=$b(e)||nF(e)?rF:UI;return n.test(HF(e))}function OF(e){if(!Cu(e))return zF(e);var n=UF(e),t=[];for(var i in e)i=="constructor"&&(n||!ta.call(e,i))||t.push(i);return t}function PF(e,n){return e=Object(e),IF(e,n,function(t,i){return i in e})}function IF(e,n,t){for(var i=-1,r=n.length,a={};++i<r;){var o=n[i],s=e[o];t(s,o)&&(a[o]=s)}return a}function FF(e,n){return n=kb(n===void 0?e.length-1:n,0),function(){for(var t=arguments,i=-1,r=kb(t.length-n,0),a=Array(r);++i<r;)a[i]=t[n+i];i=-1;for(var o=Array(n+1);++i<n;)o[i]=t[i];return o[n]=a,VI(e,this,o)}}function NF(e){return AF(e,YF,DF)}function pf(e,n){var t=e.__data__;return jF(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Eb(e,n){var t=eF(e,n);return TF(t)?t:void 0}var MF=Eu?gb(Eu,Object):Tb,DF=Eu?function(e){for(var n=[];e;)_u(n,MF(e)),e=aF(e);return n}:Tb;function LF(e){return Su(e)||Sb(e)||!!(_b&&e&&e[_b])}function BF(e,n){return n=n??pb,!!n&&(typeof e=="number"||zI.test(e))&&e>-1&&e%1==0&&e<n}function jF(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function RF(e){return!!bb&&bb in e}function UF(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||cf;return e===t}function zF(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}function WF(e){if(typeof e=="string"||KF(e))return e;var n=e+"";return n=="0"&&1/e==-MI?"-0":n}function HF(e){if(e!=null){try{return yb.call(e)}catch{}try{return e+""}catch{}}return""}function VF(e,n){return e===n||e!==e&&n!==n}function Sb(e){return qF(e)&&ta.call(e,"callee")&&(!oF.call(e,"callee")||xu.call(e)==DI)}var Su=Array.isArray;function Cb(e){return e!=null&&GF(e.length)&&!$b(e)}function qF(e){return Ab(e)&&Cb(e)}function $b(e){var n=Cu(e)?xu.call(e):"";return n==LI||n==BI}function GF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pb}function Cu(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function Ab(e){return!!e&&typeof e=="object"}function KF(e){return typeof e=="symbol"||Ab(e)&&xu.call(e)==jI}function YF(e){return Cb(e)?CF(e,!0):OF(e)}FF(function(e,n){return e==null?{}:(n=mb(xb(n,1),WF),PF(e,$F(NF(e),n)))});function Tb(){return[]}var JF=1/0,XF=9007199254740991,ZF="[object Arguments]",QF="[object Function]",eN="[object GeneratorFunction]",nN="[object Symbol]",tN=typeof pn=="object"&&pn&&pn.Object===Object&&pn,iN=typeof self=="object"&&self&&self.Object===Object&&self,rN=tN||iN||Function("return this")();function aN(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function oN(e,n){for(var t=-1,i=e?e.length:0,r=Array(i);++t<i;)r[t]=n(e[t],t,e);return r}function sN(e,n){for(var t=-1,i=n.length,r=e.length;++t<i;)e[r+t]=n[t];return e}var $u=Object.prototype,fN=$u.hasOwnProperty,Au=$u.toString,Ob=rN.Symbol,lN=$u.propertyIsEnumerable,Pb=Ob?Ob.isConcatSpreadable:void 0,Ib=Math.max;function Fb(e,n,t,i,r){var a=-1,o=e.length;for(t||(t=hN),r||(r=[]);++a<o;){var s=e[a];n>0&&t(s)?n>1?Fb(s,n-1,t,i,r):sN(r,s):i||(r[r.length]=s)}return r}function dN(e,n){return e=Object(e),uN(e,n,function(t,i){return i in e})}function uN(e,n,t){for(var i=-1,r=n.length,a={};++i<r;){var o=n[i],s=e[o];t(s,o)&&(a[o]=s)}return a}function cN(e,n){return n=Ib(n===void 0?e.length-1:n,0),function(){for(var t=arguments,i=-1,r=Ib(t.length-n,0),a=Array(r);++i<r;)a[i]=t[n+i];i=-1;for(var o=Array(n+1);++i<n;)o[i]=t[i];return o[n]=a,aN(e,this,o)}}function hN(e){return mN(e)||pN(e)||!!(Pb&&e&&e[Pb])}function vN(e){if(typeof e=="string"||kN(e))return e;var n=e+"";return n=="0"&&1/e==-JF?"-0":n}function pN(e){return bN(e)&&fN.call(e,"callee")&&(!lN.call(e,"callee")||Au.call(e)==ZF)}var mN=Array.isArray;function gN(e){return e!=null&&wN(e.length)&&!yN(e)}function bN(e){return Nb(e)&&gN(e)}function yN(e){var n=_N(e)?Au.call(e):"";return n==QF||n==eN}function wN(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XF}function _N(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function Nb(e){return!!e&&typeof e=="object"}function kN(e){return typeof e=="symbol"||Nb(e)&&Au.call(e)==nN}cN(function(e,n){return e==null?{}:dN(e,oN(Fb(n,1),vN))});var mf={exports:{}};mf.exports,function(e,n){var t=200,i="__lodash_hash_undefined__",r=800,a=16,o=9007199254740991,s="[object Arguments]",f="[object Array]",d="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",v="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",w="[object Number]",_="[object Null]",k="[object Object]",E="[object Proxy]",S="[object RegExp]",I="[object Set]",P="[object String]",C="[object Undefined]",T="[object WeakMap]",N="[object ArrayBuffer]",j="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",X="[object Int8Array]",J="[object Int16Array]",ee="[object Int32Array]",ae="[object Uint8Array]",fe="[object Uint8ClampedArray]",de="[object Uint16Array]",oe="[object Uint32Array]",me=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[L]=Y[D]=Y[X]=Y[J]=Y[ee]=Y[ae]=Y[fe]=Y[de]=Y[oe]=!0,Y[s]=Y[f]=Y[N]=Y[u]=Y[j]=Y[h]=Y[v]=Y[m]=Y[b]=Y[w]=Y[k]=Y[S]=Y[I]=Y[P]=Y[T]=!1;var ie=typeof pn=="object"&&pn&&pn.Object===Object&&pn,pe=typeof self=="object"&&self&&self.Object===Object&&self,H=ie||pe||Function("return this")(),K=n&&!n.nodeType&&n,B=K&&!0&&e&&!e.nodeType&&e,W=B&&B.exports===K,V=W&&ie.process,O=function(){try{var $=B&&B.require&&B.require("util").types;return $||V&&V.binding&&V.binding("util")}catch{}}(),F=O&&O.isTypedArray;function Z($,U,ne){switch(ne.length){case 0:return $.call(U);case 1:return $.call(U,ne[0]);case 2:return $.call(U,ne[0],ne[1]);case 3:return $.call(U,ne[0],ne[1],ne[2])}return $.apply(U,ne)}function te($,U){for(var ne=-1,ve=Array($);++ne<$;)ve[ne]=U(ne);return ve}function he($){return function(U){return $(U)}}function ye($,U){return $==null?void 0:$[U]}function xe($,U){return function(ne){return $(U(ne))}}var Ee=Array.prototype,re=Function.prototype,Be=Object.prototype,hn=H["__core-js_shared__"],Te=re.toString,ze=Be.hasOwnProperty,yn=function(){var $=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Se=Be.toString,Ue=Te.call(Object),y=RegExp("^"+Te.call(ze).replace(me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),c=W?H.Buffer:void 0,p=H.Symbol,x=H.Uint8Array,A=c?c.allocUnsafe:void 0,M=xe(Object.getPrototypeOf,Object),z=Object.create,ge=Be.propertyIsEnumerable,Fe=Ee.splice,Ce=p?p.toStringTag:void 0,Ie=function(){try{var $=No(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Ae=c?c.isBuffer:void 0,pi=Math.max,ya=Date.now,Et=No(H,"Map"),ot=No(Object,"create"),gr=function(){function $(){}return function(U){if(!ft(U))return{};if(z)return z(U);$.prototype=U;var ne=new $;return $.prototype=void 0,ne}}();function Rn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function $o(){this.__data__=ot?ot(null):{},this.size=0}function wa($){var U=this.has($)&&delete this.__data__[$];return this.size-=U?1:0,U}function Ao($){var U=this.__data__;if(ot){var ne=U[$];return ne===i?void 0:ne}return ze.call(U,$)?U[$]:void 0}function _a($){var U=this.__data__;return ot?U[$]!==void 0:ze.call(U,$)}function ka($,U){var ne=this.__data__;return this.size+=this.has($)?0:1,ne[$]=ot&&U===void 0?i:U,this}Rn.prototype.clear=$o,Rn.prototype.delete=wa,Rn.prototype.get=Ao,Rn.prototype.has=_a,Rn.prototype.set=ka;function Fn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function To(){this.__data__=[],this.size=0}function xa($){var U=this.__data__,ne=Bn(U,$);if(ne<0)return!1;var ve=U.length-1;return ne==ve?U.pop():Fe.call(U,ne,1),--this.size,!0}function Oo($){var U=this.__data__,ne=Bn(U,$);return ne<0?void 0:U[ne][1]}function Po($){return Bn(this.__data__,$)>-1}function Io($,U){var ne=this.__data__,ve=Bn(ne,$);return ve<0?(++this.size,ne.push([$,U])):ne[ve][1]=U,this}Fn.prototype.clear=To,Fn.prototype.delete=xa,Fn.prototype.get=Oo,Fn.prototype.has=Po,Fn.prototype.set=Io;function st($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function q(){this.size=0,this.__data__={hash:new Rn,map:new(Et||Fn),string:new Rn}}function ce($){var U=qi(this,$).delete($);return this.size-=U?1:0,U}function ke($){return qi(this,$).get($)}function Me($){return qi(this,$).has($)}function rn($,U){var ne=qi(this,$),ve=ne.size;return ne.set($,U),this.size+=ne.size==ve?0:1,this}st.prototype.clear=q,st.prototype.delete=ce,st.prototype.get=ke,st.prototype.has=Me,st.prototype.set=rn;function Ve($){var U=this.__data__=new Fn($);this.size=U.size}function Xe(){this.__data__=new Fn,this.size=0}function Ge($){var U=this.__data__,ne=U.delete($);return this.size=U.size,ne}function Ln($){return this.__data__.get($)}function En($){return this.__data__.has($)}function Sn($,U){var ne=this.__data__;if(ne instanceof Fn){var ve=ne.__data__;if(!Et||ve.length<t-1)return ve.push([$,U]),this.size=++ne.size,this;ne=this.__data__=new st(ve)}return ne.set($,U),this.size=ne.size,this}Ve.prototype.clear=Xe,Ve.prototype.delete=Ge,Ve.prototype.get=Ln,Ve.prototype.has=En,Ve.prototype.set=Sn;function Xn($,U){var ne=_r($),ve=!ne&&wr($),Oe=!ne&&!ve&&$a($),$e=!ne&&!ve&&!Oe&&tl($),je=ne||ve||Oe||$e,Re=je?te($.length,String):[],Ze=Re.length;for(var Un in $)(U||ze.call($,Un))&&!(je&&(Un=="length"||Oe&&(Un=="offset"||Un=="parent")||$e&&(Un=="buffer"||Un=="byteLength"||Un=="byteOffset")||Xf(Un,Ze)))&&Re.push(Un);return Re}function ut($,U,ne){(ne!==void 0&&!Gi($[U],ne)||ne===void 0&&!(U in $))&&br($,U,ne)}function Ea($,U,ne){var ve=$[U];(!(ze.call($,U)&&Gi(ve,ne))||ne===void 0&&!(U in $))&&br($,U,ne)}function Bn($,U){for(var ne=$.length;ne--;)if(Gi($[ne][0],U))return ne;return-1}function br($,U,ne){U=="__proto__"&&Ie?Ie($,U,{configurable:!0,enumerable:!0,value:ne,writable:!0}):$[U]=ne}var Mc=Gc();function mi($){return $==null?$===void 0?C:_:Ce&&Ce in Object($)?Kc($):Zc($)}function Fo($){return kr($)&&mi($)==s}function Dc($){if(!ft($)||Zf($))return!1;var U=Aa($)?y:se;return U.test(Ca($))}function Lc($){return kr($)&&ei($.length)&&!!Y[mi($)]}function Bc($){if(!ft($))return Xc($);var U=Qf($),ne=[];for(var ve in $)ve=="constructor"&&(U||!ze.call($,ve))||ne.push(ve);return ne}function Sa($,U,ne,ve,Oe){$!==U&&Mc(U,function($e,je){if(Oe||(Oe=new Ve),ft($e))jc($,U,je,ne,Sa,ve,Oe);else{var Re=ve?ve(Do($,je),$e,je+"",$,U,Oe):void 0;Re===void 0&&(Re=$e),ut($,je,Re)}},rl)}function jc($,U,ne,ve,Oe,$e,je){var Re=Do($,ne),Ze=Do(U,ne),Un=je.get(Ze);if(Un){ut($,ne,Un);return}var Vn=$e?$e(Re,Ze,ne+"",$,U,je):void 0,gi=Vn===void 0;if(gi){var Ta=_r(Ze),ih=!Ta&&$a(Ze),a_=!Ta&&!ih&&tl(Ze);Vn=Ze,Ta||ih||a_?_r(Re)?Vn=Re:el(Re)?Vn=Hc(Re):ih?(gi=!1,Vn=Uc(Ze,!0)):a_?(gi=!1,Vn=Wc(Ze,!0)):Vn=[]:nl(Ze)||wr(Ze)?(Vn=Re,wr(Re)?Vn=il(Re):(!ft(Re)||Aa(Re))&&(Vn=Jf(Ze))):gi=!1}gi&&(je.set(Ze,Vn),Oe(Vn,Ze,ve,$e,je),je.delete(Ze)),ut($,ne,Vn)}function Yf($,U){return Qc(Mo($,U,R),$+"")}var Rc=Ie?function($,U){return Ie($,"toString",{configurable:!0,enumerable:!1,value:th(U),writable:!0})}:R;function Uc($,U){if(U)return $.slice();var ne=$.length,ve=A?A(ne):new $.constructor(ne);return $.copy(ve),ve}function zc($){var U=new $.constructor($.byteLength);return new x(U).set(new x($)),U}function Wc($,U){var ne=U?zc($.buffer):$.buffer;return new $.constructor(ne,$.byteOffset,$.length)}function Hc($,U){var ne=-1,ve=$.length;for(U||(U=Array(ve));++ne<ve;)U[ne]=$[ne];return U}function Vc($,U,ne,ve){var Oe=!ne;ne||(ne={});for(var $e=-1,je=U.length;++$e<je;){var Re=U[$e],Ze=ve?ve(ne[Re],$[Re],Re,ne,$):void 0;Ze===void 0&&(Ze=$[Re]),Oe?br(ne,Re,Ze):Ea(ne,Re,Ze)}return ne}function qc($){return Yf(function(U,ne){var ve=-1,Oe=ne.length,$e=Oe>1?ne[Oe-1]:void 0,je=Oe>2?ne[2]:void 0;for($e=$.length>3&&typeof $e=="function"?(Oe--,$e):void 0,je&&Yc(ne[0],ne[1],je)&&($e=Oe<3?void 0:$e,Oe=1),U=Object(U);++ve<Oe;){var Re=ne[ve];Re&&$(U,Re,ve,$e)}return U})}function Gc($){return function(U,ne,ve){for(var Oe=-1,$e=Object(U),je=ve(U),Re=je.length;Re--;){var Ze=je[$?Re:++Oe];if(ne($e[Ze],Ze,$e)===!1)break}return U}}function yr($,U,ne,ve,Oe,$e){return ft($)&&ft(U)&&($e.set(U,$),Sa($,U,void 0,yr,$e),$e.delete(U)),$}function qi($,U){var ne=$.__data__;return Jc(U)?ne[typeof U=="string"?"string":"hash"]:ne.map}function No($,U){var ne=ye($,U);return Dc(ne)?ne:void 0}function Kc($){var U=ze.call($,Ce),ne=$[Ce];try{$[Ce]=void 0;var ve=!0}catch{}var Oe=Se.call($);return ve&&(U?$[Ce]=ne:delete $[Ce]),Oe}function Jf($){return typeof $.constructor=="function"&&!Qf($)?gr(M($)):{}}function Xf($,U){var ne=typeof $;return U=U??o,!!U&&(ne=="number"||ne!="symbol"&&G.test($))&&$>-1&&$%1==0&&$<U}function Yc($,U,ne){if(!ft(ne))return!1;var ve=typeof U;return(ve=="number"?Lo(ne)&&Xf(U,ne.length):ve=="string"&&U in ne)?Gi(ne[U],$):!1}function Jc($){var U=typeof $;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?$!=="__proto__":$===null}function Zf($){return!!yn&&yn in $}function Qf($){var U=$&&$.constructor,ne=typeof U=="function"&&U.prototype||Be;return $===ne}function Xc($){var U=[];if($!=null)for(var ne in Object($))U.push(ne);return U}function Zc($){return Se.call($)}function Mo($,U,ne){return U=pi(U===void 0?$.length-1:U,0),function(){for(var ve=arguments,Oe=-1,$e=pi(ve.length-U,0),je=Array($e);++Oe<$e;)je[Oe]=ve[U+Oe];Oe=-1;for(var Re=Array(U+1);++Oe<U;)Re[Oe]=ve[Oe];return Re[U]=ne(je),Z($,this,Re)}}function Do($,U){if(!(U==="constructor"&&typeof $[U]=="function")&&U!="__proto__")return $[U]}var Qc=eh(Rc);function eh($){var U=0,ne=0;return function(){var ve=ya(),Oe=a-(ve-ne);if(ne=ve,Oe>0){if(++U>=r)return arguments[0]}else U=0;return $.apply(void 0,arguments)}}function Ca($){if($!=null){try{return Te.call($)}catch{}try{return $+""}catch{}}return""}function Gi($,U){return $===U||$!==$&&U!==U}var wr=Fo(function(){return arguments}())?Fo:function($){return kr($)&&ze.call($,"callee")&&!ge.call($,"callee")},_r=Array.isArray;function Lo($){return $!=null&&ei($.length)&&!Aa($)}function el($){return kr($)&&Lo($)}var $a=Ae||Q;function Aa($){if(!ft($))return!1;var U=mi($);return U==m||U==g||U==d||U==E}function ei($){return typeof $=="number"&&$>-1&&$%1==0&&$<=o}function ft($){var U=typeof $;return $!=null&&(U=="object"||U=="function")}function kr($){return $!=null&&typeof $=="object"}function nl($){if(!kr($)||mi($)!=k)return!1;var U=M($);if(U===null)return!0;var ne=ze.call(U,"constructor")&&U.constructor;return typeof ne=="function"&&ne instanceof ne&&Te.call(ne)==Ue}var tl=F?he(F):Lc;function il($){return Vc($,rl($))}var nh=Yf(function($){return $.push(void 0,yr),Z(al,void 0,$)});function rl($){return Lo($)?Xn($,!0):Bc($)}var al=qc(function($,U,ne,ve){Sa($,U,ne,ve)});function th($){return function(){return $}}function R($){return $}function Q(){return!1}e.exports=nh}(mf,mf.exports);var xN=mf.exports;const EN=xr(xN);var Tu=()=>{throw new Error("Not available on this platform")},SN=()=>Tu(),CN=()=>Tu(),$N=()=>Tu(),Mb=nn({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,n){function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function i(o,s){for(var f="",d=0,u=-1,h=0,v,m=0;m<=o.length;++m){if(m<o.length)v=o.charCodeAt(m);else{if(v===47)break;v=47}if(v===47){if(!(u===m-1||h===1))if(u!==m-1&&h===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var g=f.lastIndexOf("/");if(g!==f.length-1){g===-1?(f="",d=0):(f=f.slice(0,g),d=f.length-1-f.lastIndexOf("/")),u=m,h=0;continue}}else if(f.length===2||f.length===1){f="",d=0,u=m,h=0;continue}}s&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+o.slice(u+1,m):f=o.slice(u+1,m),d=m-u-1;u=m,h=0}else v===46&&h!==-1?++h:h=-1}return f}function r(o,s){var f=s.dir||s.root,d=s.base||(s.name||"")+(s.ext||"");return f?f===s.root?f+d:f+o+d:d}var a={resolve:function(){for(var s="",f=!1,d,u=arguments.length-1;u>=-1&&!f;u--){var h;u>=0?h=arguments[u]:(d===void 0&&(d=process.cwd()),h=d),t(h),h.length!==0&&(s=h+"/"+s,f=h.charCodeAt(0)===47)}return s=i(s,!f),f?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(t(s),s.length===0)return".";var f=s.charCodeAt(0)===47,d=s.charCodeAt(s.length-1)===47;return s=i(s,!f),s.length===0&&!f&&(s="."),s.length>0&&d&&(s+="/"),f?"/"+s:s},isAbsolute:function(s){return t(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,f=0;f<arguments.length;++f){var d=arguments[f];t(d),d.length>0&&(s===void 0?s=d:s+="/"+d)}return s===void 0?".":a.normalize(s)},relative:function(s,f){if(t(s),t(f),s===f||(s=a.resolve(s),f=a.resolve(f),s===f))return"";for(var d=1;d<s.length&&s.charCodeAt(d)===47;++d);for(var u=s.length,h=u-d,v=1;v<f.length&&f.charCodeAt(v)===47;++v);for(var m=f.length,g=m-v,b=h<g?h:g,w=-1,_=0;_<=b;++_){if(_===b){if(g>b){if(f.charCodeAt(v+_)===47)return f.slice(v+_+1);if(_===0)return f.slice(v+_)}else h>b&&(s.charCodeAt(d+_)===47?w=_:_===0&&(w=0));break}var k=s.charCodeAt(d+_),E=f.charCodeAt(v+_);if(k!==E)break;k===47&&(w=_)}var S="";for(_=d+w+1;_<=u;++_)(_===u||s.charCodeAt(_)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+f.slice(v+w):(v+=w,f.charCodeAt(v)===47&&++v,f.slice(v))},_makeLong:function(s){return s},dirname:function(s){if(t(s),s.length===0)return".";for(var f=s.charCodeAt(0),d=f===47,u=-1,h=!0,v=s.length-1;v>=1;--v)if(f=s.charCodeAt(v),f===47){if(!h){u=v;break}}else h=!1;return u===-1?d?"/":".":d&&u===1?"//":s.slice(0,u)},basename:function(s,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');t(s);var d=0,u=-1,h=!0,v;if(f!==void 0&&f.length>0&&f.length<=s.length){if(f.length===s.length&&f===s)return"";var m=f.length-1,g=-1;for(v=s.length-1;v>=0;--v){var b=s.charCodeAt(v);if(b===47){if(!h){d=v+1;break}}else g===-1&&(h=!1,g=v+1),m>=0&&(b===f.charCodeAt(m)?--m===-1&&(u=v):(m=-1,u=g))}return d===u?u=g:u===-1&&(u=s.length),s.slice(d,u)}else{for(v=s.length-1;v>=0;--v)if(s.charCodeAt(v)===47){if(!h){d=v+1;break}}else u===-1&&(h=!1,u=v+1);return u===-1?"":s.slice(d,u)}},extname:function(s){t(s);for(var f=-1,d=0,u=-1,h=!0,v=0,m=s.length-1;m>=0;--m){var g=s.charCodeAt(m);if(g===47){if(!h){d=m+1;break}continue}u===-1&&(h=!1,u=m+1),g===46?f===-1?f=m:v!==1&&(v=1):f!==-1&&(v=-1)}return f===-1||u===-1||v===0||v===1&&f===u-1&&f===d+1?"":s.slice(f,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){t(s);var f={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return f;var d=s.charCodeAt(0),u=d===47,h;u?(f.root="/",h=1):h=0;for(var v=-1,m=0,g=-1,b=!0,w=s.length-1,_=0;w>=h;--w){if(d=s.charCodeAt(w),d===47){if(!b){m=w+1;break}continue}g===-1&&(b=!1,g=w+1),d===46?v===-1?v=w:_!==1&&(_=1):v!==-1&&(_=-1)}return v===-1||g===-1||_===0||_===1&&v===g-1&&v===m+1?g!==-1&&(m===0&&u?f.base=f.name=s.slice(1,g):f.base=f.name=s.slice(m,g)):(m===0&&u?(f.name=s.slice(1,v),f.base=s.slice(1,g)):(f.name=s.slice(m,v),f.base=s.slice(m,g)),f.ext=s.slice(v,g)),m>0?f.dir=s.slice(0,m-1):u&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,n.exports=a}});ur(Mb());var Xt=ur(Mb());Xt.basename;var AN=Xt.dirname;Xt.extname,Xt.format,Xt.isAbsolute,Xt.join,Xt.normalize,Xt.parse,Xt.relative,Xt.resolve;var $n;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})($n||($n={}));var TN={trace:5,debug:10,info:11,warn:12,error:13},so;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(so||(so={}));var ON=Symbol("logInfoProperties"),PN=e=>{if(!e)return{};const n={},i=Object.getPrototypeOf(e)[ON]??[];for(const r of i)try{n[r]=typeof e[r]=="function"?e[r]():e[r]}catch(a){n[r]=a.message}return n},IN=(e,n,t)=>n>=e.level&&(!e.pattern||t.includes(e.pattern)),Db=(e,n)=>n===void 0?!0:n.some(t=>{var i;return IN(t,e.level,((i=e.meta)==null?void 0:i.F)??"")}),Ou=e=>{let n;if(e.meta){const t=PN(e.meta.S);Object.keys(t).length>0&&(n=Object.assign(n??{},t))}if(e.context)if(e.context instanceof Error){const t=e.context.context;n=Object.assign(n??{},{error:e.context.stack,...t})}else typeof e.context=="object"&&(n=Object.assign(n??{},e.context));return n&&Object.keys(n).length>0?n:void 0},FN=0,NN=e=>(n,t,i)=>(r,a,o)=>{const s=o.value;o.value=function(...f){const d={...i??{},S:this},u=f.map(h=>Ft(h,!1,1,!0)).join(", ");try{const h=performance.now(),v=s.apply(this,f);if(MN(v)){const m=FN++;e.info(`${a}(${u}) => Promise { #${m} }`,{},d),v.then(g=>{g!==void 0?e.info(`โœ… resolve #${m} ${(performance.now()-h).toFixed(0)}ms => ${Ft(g,!1,1,!0)}`,{},d):e.info(`โœ… resolve #${m} ${(performance.now()-h).toFixed(0)}ms`,{},d)},g=>{e.info(`๐Ÿ”ฅ reject #${m} #${(performance.now()-h).toFixed(0)}ms => ${g}`,{},d)})}else e.info(`${a}(${u}) => ${Ft(v,!1,1,!0)}`,{},d);return v}catch(h){throw e.error(`${a}(${u}) ๐Ÿ”ฅ ${h}`,{},d),h}},Object.defineProperty(o.value,"name",{value:a+"$log"})},MN=e=>e&&typeof e.then=="function",DN=e=>{try{return JSON.parse(localStorage.getItem("dxlog"))}catch{return}},Lb=()=>{},LN=(e,n)=>{console.log(Ft(n,!1,null,!0))},Bb=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},Pu=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},BN=(e,n)=>{var d,u,h;if(!Db(n,e.filters))return;const t=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",i=[];let r="";if(n.meta){const v=Bb(n.meta.F);r=`${`${t.replace(/\/$/,"")}/${v}`}#L${n.meta.L}`}let a=[];if((d=n.meta)!=null&&d.S){const v=(u=n.meta)==null?void 0:u.S,m=Object.getPrototypeOf(v),g=OI(v);a.push(`%c${m.constructor.name}#${g}`,"color:#C026D3;font-weight:bold")}a.push(n.message);const o=Ou(n);o&&a.push(o);const s={[$n.ERROR]:console.error,[$n.WARN]:console.warn,[$n.DEBUG]:console.log};(Pu.printFileLinks||$I())&&(i!=null&&i.length?a=[`%c${r}
821
+ `)+" "+ie[1]:ie[0]+Y+" "+G.join(", ")+" "+ie[1]}e.types=oI();function w(G){return Array.isArray(G)}e.isArray=w;function _(G){return typeof G=="boolean"}e.isBoolean=_;function k(G){return G===null}e.isNull=k;function E(G){return G==null}e.isNullOrUndefined=E;function S(G){return typeof G=="number"}e.isNumber=S;function I(G){return typeof G=="string"}e.isString=I;function P(G){return typeof G=="symbol"}e.isSymbol=P;function C(G){return G===void 0}e.isUndefined=C;function T(G){return N(G)&&J(G)==="[object RegExp]"}e.isRegExp=T,e.types.isRegExp=T;function N(G){return typeof G=="object"&&G!==null}e.isObject=N;function j(G){return N(G)&&J(G)==="[object Date]"}e.isDate=j,e.types.isDate=j;function L(G){return N(G)&&(J(G)==="[object Error]"||G instanceof Error)}e.isError=L,e.types.isNativeError=L;function D(G){return typeof G=="function"}e.isFunction=D;function X(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}e.isPrimitive=X,e.isBuffer=sI();function J(G){return Object.prototype.toString.call(G)}function ee(G){return G<10?"0"+G.toString(10):G.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function fe(){var G=new Date,Y=[ee(G.getHours()),ee(G.getMinutes()),ee(G.getSeconds())].join(":");return[G.getDate(),ae[G.getMonth()],Y].join(" ")}e.log=function(){console.log("%s - %s",fe(),e.format.apply(e,arguments))},e.inherits=fI(),e._extend=function(G,Y){if(!Y||!N(Y))return G;for(var ie=Object.keys(Y),pe=ie.length;pe--;)G[ie[pe]]=Y[ie[pe]];return G};function de(G,Y){return Object.prototype.hasOwnProperty.call(G,Y)}var oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');if(oe&&Y[oe]){var ie=Y[oe];if(typeof ie!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ie,oe,{value:ie,enumerable:!1,writable:!1,configurable:!0}),ie}function ie(){for(var pe,H,K=new Promise(function(V,O){pe=V,H=O}),B=[],W=0;W<arguments.length;W++)B.push(arguments[W]);B.push(function(V,O){V?H(V):pe(O)});try{Y.apply(this,B)}catch(V){H(V)}return K}return Object.setPrototypeOf(ie,Object.getPrototypeOf(Y)),oe&&Object.defineProperty(ie,oe,{value:ie,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ie,n(Y))},e.promisify.custom=oe;function me(G,Y){if(!G){var ie=new Error("Promise was rejected with a falsy value");ie.reason=G,G=ie}return Y(G)}function se(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');function Y(){for(var ie=[],pe=0;pe<arguments.length;pe++)ie.push(arguments[pe]);var H=ie.pop();if(typeof H!="function")throw new TypeError("The last argument must be of type Function");var K=this,B=function(){return H.apply(K,arguments)};G.apply(this,ie).then(function(W){process.nextTick(B.bind(null,null,W))},function(W){process.nextTick(me.bind(null,W,B))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(G)),Object.defineProperties(Y,n(G)),Y}e.callbackify=se}}),lI=ur(H0()),vu=ur(H0());lI.default,vu.callbackify;var Ft=vu.inspect;vu.promisify;var dI=nn({"node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(e,n){var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,T,N){return Function.prototype.apply.call(C,T,N)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:r=function(C){return Object.getOwnPropertyNames(C)};function a(P){console&&console.warn&&console.warn(P)}var o=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}n.exports=s,n.exports.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function d(P){if(typeof P!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(P){if(typeof P!="number"||P<0||o(P))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");f=P}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||o(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(P){return P._maxListeners===void 0?s.defaultMaxListeners:P._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var T=[],N=1;N<arguments.length;N++)T.push(arguments[N]);var j=C==="error",L=this._events;if(L!==void 0)j=j&&L.error===void 0;else if(!j)return!1;if(j){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var X=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw X.context=D,X}var J=L[C];if(J===void 0)return!1;if(typeof J=="function")i(J,this,T);else for(var ee=J.length,ae=w(J,ee),N=0;N<ee;++N)i(ae[N],this,T);return!0};function h(P,C,T,N){var j,L,D;if(d(T),L=P._events,L===void 0?(L=P._events=Object.create(null),P._eventsCount=0):(L.newListener!==void 0&&(P.emit("newListener",C,T.listener?T.listener:T),L=P._events),D=L[C]),D===void 0)D=L[C]=T,++P._eventsCount;else if(typeof D=="function"?D=L[C]=N?[T,D]:[D,T]:N?D.unshift(T):D.push(T),j=u(P),j>0&&D.length>j&&!D.warned){D.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=P,X.type=C,X.count=D.length,a(X)}return P}s.prototype.addListener=function(C,T){return h(this,C,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,T){return h(this,C,T,!0)};function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(P,C,T){var N={fired:!1,wrapFn:void 0,target:P,type:C,listener:T},j=v.bind(N);return j.listener=T,N.wrapFn=j,j}s.prototype.once=function(C,T){return d(T),this.on(C,m(this,C,T)),this},s.prototype.prependOnceListener=function(C,T){return d(T),this.prependListener(C,m(this,C,T)),this},s.prototype.removeListener=function(C,T){var N,j,L,D,X;if(d(T),j=this._events,j===void 0)return this;if(N=j[C],N===void 0)return this;if(N===T||N.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete j[C],j.removeListener&&this.emit("removeListener",C,N.listener||T));else if(typeof N!="function"){for(L=-1,D=N.length-1;D>=0;D--)if(N[D]===T||N[D].listener===T){X=N[D].listener,L=D;break}if(L<0)return this;L===0?N.shift():_(N,L),N.length===1&&(j[C]=N[0]),j.removeListener!==void 0&&this.emit("removeListener",C,X||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var T,N,j;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[C]),this;if(arguments.length===0){var L=Object.keys(N),D;for(j=0;j<L.length;++j)D=L[j],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=N[C],typeof T=="function")this.removeListener(C,T);else if(T!==void 0)for(j=T.length-1;j>=0;j--)this.removeListener(C,T[j]);return this};function g(P,C,T){var N=P._events;if(N===void 0)return[];var j=N[C];return j===void 0?[]:typeof j=="function"?T?[j.listener||j]:[j]:T?k(j):w(j,j.length)}s.prototype.listeners=function(C){return g(this,C,!0)},s.prototype.rawListeners=function(C){return g(this,C,!1)},s.listenerCount=function(P,C){return typeof P.listenerCount=="function"?P.listenerCount(C):b.call(P,C)},s.prototype.listenerCount=b;function b(P){var C=this._events;if(C!==void 0){var T=C[P];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function w(P,C){for(var T=new Array(C),N=0;N<C;++N)T[N]=P[N];return T}function _(P,C){for(;C+1<P.length;C++)P[C]=P[C+1];P.pop()}function k(P){for(var C=new Array(P.length),T=0;T<C.length;++T)C[T]=P[T].listener||P[T];return C}function E(P,C){return new Promise(function(T,N){function j(D){P.removeListener(C,L),N(D)}function L(){typeof P.removeListener=="function"&&P.removeListener("error",j),T([].slice.call(arguments))}I(P,C,L,{once:!0}),C!=="error"&&S(P,j,{once:!0})})}function S(P,C,T){typeof P.on=="function"&&I(P,"error",C,T)}function I(P,C,T,N){if(typeof P.on=="function")N.once?P.once(C,T):P.on(C,T);else if(typeof P.addEventListener=="function")P.addEventListener(C,function j(L){N.once&&P.removeEventListener(C,j),T(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}}}),V0=ur(dI());V0.EventEmitter,V0.EventEmitter;var df=e=>{const n=Object.getPrototypeOf(e).constructor.name;return e.toJSON?`${n}(${Ft(e.toJSON())})`:String(e)},q0=e=>{throw e},G0;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.VERBOSE=1]="VERBOSE",e[e.BOLD=2]="BOLD"})(G0||(G0={}));var uI=(e,n=8)=>{const t=String(e);return t.length<=n?t:t.slice(0,n)},uf=Symbol.for("devtoolsFormatter"),cI=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(e,n)=>{const t=e[uf];if(t===void 0)return null;if(typeof t!="object"||t===null||typeof t.header!="function")throw new Error(`Invalid devtools formatter for ${e.constructor.name}`);return t.header(n)},hasBody:(e,n)=>{const t=e[uf];return!t||!t.hasBody?!1:t.hasBody(n)},body:(e,n)=>{const t=e[uf];return!t||!t.body?null:t.body(n)}})};cI();var hI=Symbol.for("dxos.common.equals"),vI=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),pu="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",pI=32,K0=class Zn{static from(n){if(io(n,void 0,{F:pu,L:30,S:this,A:["source",""]}),n instanceof Zn)return n;if(n instanceof Buffer)return new Zn(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));if(n instanceof Uint8Array)return new Zn(n);if(n instanceof ArrayBuffer)return new Zn(new Uint8Array(n));if(typeof n=="string")return Zn.fromHex(n);if(n.asUint8Array)return new Zn(n.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${n}`)}static safeFrom(n){if(n)try{return Zn.from(n)}catch{return}}static fromHex(n){n.startsWith("0x")&&(n=n.slice(2));const t=Buffer.from(n,"hex");return new Zn(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}static random(){return Zn.from(mI(pI))}static*randomSequence(){for(let n=0;n<1e4;n++)yield Zn.random();throw new Error("Too many keys requested")}static isPublicKey(n){return n instanceof Zn}static assertValidPublicKey(n){if(!this.isPublicKey(n))throw new TypeError("Invalid PublicKey")}static equals(n,t){return Zn.from(n).equals(t)}static bufferize(n){return io(typeof n=="string","Invalid type",{F:pu,L:129,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from(n,"hex")}static stringify(n){return n instanceof Zn?n=n.asBuffer():n instanceof Uint8Array&&(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),io(n instanceof Buffer,"Invalid type",{F:pu,L:148,S:this,A:["key instanceof Buffer","'Invalid type'"]}),n.toString("hex")}static hash(n){return n.toHex()}constructor(n){if(this._value=n,!(n instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${n}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(n=void 0){return uI(this,n)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(n){return Math.abs(this._value.reduce((t,i)=>t^i|0,0))%n}[Ft.custom](n,t){if(!t.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const i=o=>`\x1B[${o}m`,r=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],a=r[this.getInsecureHash(r.length)];return`PublicKey(${i(Ft.colors[a][0])}${this.truncate()}${i(Ft.colors.reset[0])})`}get[uf](){return{header:()=>{const n=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],t=n[this.getInsecureHash(n.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${t};`},this.truncate()],["span",{},")"]]}}}equals(n){const t=Zn.from(n);if(this._value.length!==t._value.length)return!1;let i=!0;for(let r=0;r<this._value.length;r++)i&&(i=this._value[r]===t._value[r]);return i}[hI](n){return Zn.isPublicKey(n)?this.equals(n):!1}},mI=e=>{const n=globalThis.crypto??vI("@dxos/node-std/crypto").webcrypto,t=new Uint8Array(e);return n.getRandomValues(t),t},Y0=10;(class{constructor(e,n){if(this._projection=e,this._values=new Map,n)for(const t of n)this.add(t)}toString(){return df(this)}toJSON(){return this._values.size>Y0?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return df(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,n){n&&(e=e.bind(n)),this._values.forEach(t=>e(t,t,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,n){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,n)for(const[t,i]of n)this.set(t,i)}toString(){return df(this)}toJSON(){return this._values.size>Y0?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return df(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const n=this._keys.delete(this._keyProjection(e)),t=this._values.delete(this._keyProjection(e));return n||t}forEach(e,n){n&&(e=e.bind(n)),this._keys.forEach((t,i)=>e(this._values.get(i)??q0(new Error("Map corrupted.")),t,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,n){const t=this._keyProjection(e);return this._keys.set(t,e),this._values.set(t,n),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,n]of this._keys){const t=this._values.get(e)??q0(new Error("Map corrupted."));yield[n,t]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var J0=["๐Ÿ‘น","๐Ÿ‘ป","๐Ÿ‘ฝ","๐Ÿค–","๐ŸŽƒ","๐Ÿฆพ","๐Ÿฆฟ","๐Ÿฆท","๐Ÿ‘ฃ","๐Ÿ‘๏ธ","๐Ÿงถ","๐Ÿ‘‘","๐Ÿ’","๐Ÿฆ†","๐Ÿฆ‰","๐Ÿด","๐Ÿฆ„","๐Ÿ","๐Ÿฆ‹","๐Ÿž","๐Ÿชฒ","๐Ÿข","๐ŸฆŽ","๐Ÿฆ•","๐Ÿฆ‘","๐Ÿฆ€","๐Ÿ ","๐Ÿฌ","๐Ÿ‹","๐Ÿฆญ","๐Ÿ…","๐Ÿ†","๐Ÿฆ“","๐Ÿฆ","๐Ÿฆง","๐Ÿ˜","๐Ÿซ","๐Ÿฆ’","๐Ÿฆ˜","๐Ÿฆฌ","๐Ÿ–","๐Ÿ","๐ŸฆŒ","๐Ÿ•","๐Ÿˆ","๐Ÿ“","๐Ÿฆš","๐Ÿฆœ","๐Ÿฆข","๐Ÿฆฉ","๐Ÿฆฆ","๐Ÿ","๐Ÿฟ๏ธ","๐ŸŒต","๐ŸŒฒ","๐ŸŒณ","๐Ÿชต","๐ŸŒฑ","๐Ÿ","๐Ÿชบ","๐Ÿ„","๐Ÿš","๐Ÿชธ","๐Ÿชจ","๐ŸŒพ","๐ŸŒท","๐ŸŒป","โ˜€๏ธ","๐ŸŒ™","๐Ÿช","โญ๏ธ","โšก๏ธ","โ˜„๏ธ","๐Ÿ”ฅ","๐ŸŒˆ","โ˜๏ธ","๐Ÿ’ง","โ›ฑ๏ธ","๐ŸŒŠ","๐ŸŽ","๐Ÿ‹","๐Ÿ‰","๐Ÿ‡","๐Ÿซ","๐Ÿˆ","๐Ÿ’","๐Ÿ‘","๐Ÿฅญ","๐Ÿ","๐Ÿฅฅ","๐Ÿฅ","๐Ÿฅ‘","๐ŸŒถ๏ธ","๐ŸŒฝ","๐Ÿฅ•","๐Ÿฌ","๐Ÿฅœ","๐Ÿซ–","โ˜•๏ธ","๐Ÿต","๐ŸงŠ","๐Ÿง‚","๐Ÿ”๏ธ","โš“๏ธ","๐Ÿ›Ÿ","๐Ÿ๏ธ","๐Ÿ›ถ","๐Ÿš€","๐Ÿ›ฐ๏ธ","โ›ฒ๏ธ","๐Ÿฐ","๐Ÿšฒ","โ›บ๏ธ","๐ŸŽ™๏ธ","๐Ÿงฒ","โš™๏ธ","๐Ÿ”ฉ","๐Ÿ”ฎ","๐Ÿ”ญ","๐Ÿ”ฌ","๐Ÿงฌ","๐ŸŒก๏ธ","๐Ÿงบ","๐Ÿ›Ž๏ธ","๐Ÿ”‘","๐Ÿช‘","๐Ÿงธ","๐ŸŽˆ","๐ŸŽ€","๐ŸŽŠ","โ™ป๏ธ","๐ŸŽต"],X0=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],gI=e=>ao(e.toHex()),ao=e=>Z0(parseInt(e,16)),Z0=e=>J0[e%J0.length],bI=e=>Q0(parseInt(e,16)),Q0=e=>X0[e%X0.length],eb=e=>nb(e.toHex()),nb=e=>yI(parseInt(e,16)),yI=e=>({emoji:Z0(e),hue:Q0(e)}),wI=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],_I=class{constructor(e=wI){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,n=4,t="-"){const i=e.match(/(..?)/g);if(!i)throw new Error("");const r=i.map(o=>parseInt(o,16));return this._compress(r,n).map(o=>this.wordlist[o]).join(t)}_compress(e,n){const t=e.length;if(n>t)throw new Error("Fewer input bytes than requested output");const i=t/n>>0,r=[];for(let o=0;o<i*n;o+=i)r.push(e.slice(o,o+i));return r[r.length-1]=r[r.length-1].concat(e.slice(n*i)),r.map(o=>o.reduce((s,f)=>s^f))}},kI=new _I,xI=e=>(e instanceof L0||e instanceof Uint8Array||e instanceof ArrayBuffer?e=K0.stringify(e):e instanceof K0&&(e=e.toHex()),kI.humanize(e)),EI=e=>L0.from(e.buffer,e.byteOffset,e.byteLength),SI=5,mu=(e,n=0,t=new WeakSet)=>{if(n>SI)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(t.has(e))return null;t.add(e);try{if(e instanceof Uint8Array)return EI(e).toString("hex");if(Array.isArray(e))return e.map(i=>mu(i,n+1,t));if(typeof e.toJSON=="function")return e.toJSON();{const i={};for(const r of Object.keys(e))i[r]=mu(e[r],n+1,t);return i}}finally{t.delete(e)}}else return e},CI=(e,n,t)=>{let i=e.get(n);return i===void 0&&(i=typeof t=="function"?t():t,e.set(n,i)),i},$I=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),gu=Symbol("instanceTag"),AI=e=>n=>{n.prototype[gu]=e,Object.defineProperty(n.prototype,Symbol.hasInstance,{value:t=>(t==null?void 0:t[gu])===e}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>(t==null?void 0:t[gu])===e})},bu=Symbol.for("dxos.instance-contexts"),TI=globalThis[bu]??(globalThis[bu]=new WeakMap),OI=e=>{const n=Object.getPrototypeOf(e),t=CI(TI,n,()=>({nextId:0,instanceIds:new WeakMap}));let i=t.instanceIds.get(e);return i===void 0&&(i=t.nextId++,t.instanceIds.set(e,i)),i};Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));const tb=l.forwardRef(({identity:e,presence:n,onClick:t,classNames:i,...r},a)=>{var d,u,h,v,m;const o=eb(e.identityKey),s=Tn("identityListItem__label"),f=((d=e.profile)==null?void 0:d.displayName)??ff(e.identityKey.toHex());return l.createElement(_d.Root,{...r,classNames:le("flex gap-2 pis-3 pie-1 items-center",t&&"cursor-pointer",i),onClick:()=>t==null?void 0:t(),"data-testid":"identity-list-item",labelId:s,ref:a},l.createElement(Dn.Root,{status:n===Bo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:s,hue:((h=(u=e.profile)==null?void 0:u.data)==null?void 0:h.hue)||o.hue},l.createElement(Dn.Frame,{classNames:"place-self-center"},l.createElement(Dn.Fallback,{text:((m=(v=e.profile)==null?void 0:v.data)==null?void 0:m.emoji)||o.emoji})),l.createElement(Dn.Label,{classNames:"text-sm truncate pli-2"},f)))}),PI=({devices:e,onSelect:n})=>{const{t}=sn("os");return e.length>0?l.createElement(wd,{classNames:"flex flex-col gap-2"},e.map(i=>{var s,f;const r=((s=i.profile)==null?void 0:s.type)||Ki.DeviceType.UNKNOWN,a=(f=i.profile)!=null&&f.label?`${i.profile.label} (${Ki.DeviceType[r]})`:ff(i.deviceKey.toHex()),o={identityKey:i.deviceKey,profile:{displayName:a}};return l.createElement(tb,{key:i.deviceKey.toHex(),identity:o,presence:i.presence,onClick:n&&(()=>n(i))})})):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Mn,"text-center is-full")},t("empty device list message")))},II=({spaceKey:e,includeSelf:n,onSelect:t})=>{const i=Ye.useClient(),r=Bo.useMembers(e),a=l.useMemo(()=>n?r.sort(o=>o.identity.identityKey.equals(i.halo.identity.get().identityKey)?-1:1):r.filter(o=>!o.identity.identityKey.equals(i.halo.identity.get().identityKey)),[r]);return l.createElement(FI,{members:a,onSelect:t})},FI=({members:e,onSelect:n})=>{const{t}=sn("os"),i=e.filter(r=>r.identity);return i.length>0?l.createElement(wd,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},i.map(r=>l.createElement(tb,{key:r.identity.identityKey.toHex(),identity:r.identity,presence:r.presence,onClick:n&&(()=>n(r))}))):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Mn,"text-center is-full mlb-2")},t("empty space members message")))};var ib;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(ib||(ib={}));var rb;(function(e){(function(n){n[n.INCLUSIVE=1]="INCLUSIVE",n[n.EXPLICIT=2]="EXPLICIT"})(e.MatchingOptions||(e.MatchingOptions={}))})(rb||(rb={}));var ab;(function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"})(ab||(ab={}));var ob;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.TRUNCATE=1]="TRUNCATE",n[n.HUMANIZE=2]="HUMANIZE"})(e.KEY_OPTION||(e.KEY_OPTION={}))})(ob||(ob={}));var sb;(function(e){(function(n){n[n.BROWSER=0]="BROWSER",n[n.SHARED_WORKER=1]="SHARED_WORKER",n[n.NODE=2]="NODE"})(e.PLATFORM_TYPE||(e.PLATFORM_TYPE={}))})(sb||(sb={}));var fb;(function(e){e[e.CURRENT=0]="CURRENT",e[e.TRUSTED=1]="TRUSTED"})(fb||(fb={}));var lb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(lb||(lb={}));var db;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(db||(db={}));var ub;(function(e){e[e.INACTIVE=2]="INACTIVE",e[e.ACTIVE=6]="ACTIVE",e[e.CLOSED=1]="CLOSED",e[e.CONTROL_ONLY=7]="CONTROL_ONLY",e[e.INITIALIZING=4]="INITIALIZING",e[e.READY=3]="READY",e[e.ERROR=5]="ERROR"})(ub||(ub={}));var cb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.INIT_AUTOMERGE=1]="INIT_AUTOMERGE"})(e.Migration||(e.Migration={}))})(cb||(cb={}));var _e;(function(e){(function(n){n[n.INTERACTIVE=0]="INTERACTIVE",n[n.OFFLINE=1]="OFFLINE",n[n.MULTIUSE=2]="MULTIUSE"})(e.Type||(e.Type={})),function(n){n[n.DEVICE=0]="DEVICE",n[n.SPACE=1]="SPACE"}(e.Kind||(e.Kind={})),function(n){n[n.NONE=0]="NONE",n[n.SHARED_SECRET=1]="SHARED_SECRET"}(e.AuthMethod||(e.AuthMethod={})),function(n){n[n.INIT=0]="INIT",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",n[n.AUTHENTICATING=4]="AUTHENTICATING",n[n.SUCCESS=5]="SUCCESS",n[n.CANCELLED=6]="CANCELLED",n[n.TIMEOUT=7]="TIMEOUT",n[n.ERROR=8]="ERROR"}(e.State||(e.State={}))})(_e||(_e={}));var hb;(function(e){(function(n){n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED"})(e.Action||(e.Action={})),function(n){n[n.CREATED=0]="CREATED",n[n.ACCEPTED=1]="ACCEPTED"}(e.Type||(e.Type={}))})(hb||(hb={}));var vb;(function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE"})(vb||(vb={}));var NI=200,yu="__lodash_hash_undefined__",MI=1/0,pb=9007199254740991,DI="[object Arguments]",LI="[object Function]",BI="[object GeneratorFunction]",jI="[object Symbol]",RI=/[\\^$.*+?()[\]{}|]/g,UI=/^\[object .+?Constructor\]$/,zI=/^(?:0|[1-9]\d*)$/,WI=typeof pn=="object"&&pn&&pn.Object===Object&&pn,HI=typeof self=="object"&&self&&self.Object===Object&&self,wu=WI||HI||Function("return this")();function VI(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function qI(e,n){var t=e?e.length:0;return!!t&&YI(e,n,0)>-1}function GI(e,n,t){for(var i=-1,r=e?e.length:0;++i<r;)if(t(n,e[i]))return!0;return!1}function mb(e,n){for(var t=-1,i=e?e.length:0,r=Array(i);++t<i;)r[t]=n(e[t],t,e);return r}function _u(e,n){for(var t=-1,i=n.length,r=e.length;++t<i;)e[r+t]=n[t];return e}function KI(e,n,t,i){for(var r=e.length,a=t+(i?1:-1);i?a--:++a<r;)if(n(e[a],a,e))return a;return-1}function YI(e,n,t){if(n!==n)return KI(e,JI,t);for(var i=t-1,r=e.length;++i<r;)if(e[i]===n)return i;return-1}function JI(e){return e!==e}function XI(e,n){for(var t=-1,i=Array(e);++t<e;)i[t]=n(t);return i}function ZI(e){return function(n){return e(n)}}function QI(e,n){return e.has(n)}function eF(e,n){return e==null?void 0:e[n]}function nF(e){var n=!1;if(e!=null&&typeof e.toString!="function")try{n=!!(e+"")}catch{}return n}function gb(e,n){return function(t){return e(n(t))}}var tF=Array.prototype,iF=Function.prototype,cf=Object.prototype,ku=wu["__core-js_shared__"],bb=function(){var e=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),yb=iF.toString,ta=cf.hasOwnProperty,xu=cf.toString,rF=RegExp("^"+yb.call(ta).replace(RI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wb=wu.Symbol,aF=gb(Object.getPrototypeOf,Object),oF=cf.propertyIsEnumerable,sF=tF.splice,_b=wb?wb.isConcatSpreadable:void 0,Eu=Object.getOwnPropertySymbols,kb=Math.max,fF=Eb(wu,"Map"),oo=Eb(Object,"create");function cr(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function lF(){this.__data__=oo?oo(null):{}}function dF(e){return this.has(e)&&delete this.__data__[e]}function uF(e){var n=this.__data__;if(oo){var t=n[e];return t===yu?void 0:t}return ta.call(n,e)?n[e]:void 0}function cF(e){var n=this.__data__;return oo?n[e]!==void 0:ta.call(n,e)}function hF(e,n){var t=this.__data__;return t[e]=oo&&n===void 0?yu:n,this}cr.prototype.clear=lF,cr.prototype.delete=dF,cr.prototype.get=uF,cr.prototype.has=cF,cr.prototype.set=hF;function ia(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function vF(){this.__data__=[]}function pF(e){var n=this.__data__,t=vf(n,e);if(t<0)return!1;var i=n.length-1;return t==i?n.pop():sF.call(n,t,1),!0}function mF(e){var n=this.__data__,t=vf(n,e);return t<0?void 0:n[t][1]}function gF(e){return vf(this.__data__,e)>-1}function bF(e,n){var t=this.__data__,i=vf(t,e);return i<0?t.push([e,n]):t[i][1]=n,this}ia.prototype.clear=vF,ia.prototype.delete=pF,ia.prototype.get=mF,ia.prototype.has=gF,ia.prototype.set=bF;function ra(e){var n=-1,t=e?e.length:0;for(this.clear();++n<t;){var i=e[n];this.set(i[0],i[1])}}function yF(){this.__data__={hash:new cr,map:new(fF||ia),string:new cr}}function wF(e){return pf(this,e).delete(e)}function _F(e){return pf(this,e).get(e)}function kF(e){return pf(this,e).has(e)}function xF(e,n){return pf(this,e).set(e,n),this}ra.prototype.clear=yF,ra.prototype.delete=wF,ra.prototype.get=_F,ra.prototype.has=kF,ra.prototype.set=xF;function hf(e){var n=-1,t=e?e.length:0;for(this.__data__=new ra;++n<t;)this.add(e[n])}function EF(e){return this.__data__.set(e,yu),this}function SF(e){return this.__data__.has(e)}hf.prototype.add=hf.prototype.push=EF,hf.prototype.has=SF;function CF(e,n){var t=Su(e)||Sb(e)?XI(e.length,String):[],i=t.length,r=!!i;for(var a in e)(n||ta.call(e,a))&&!(r&&(a=="length"||BF(a,i)))&&t.push(a);return t}function vf(e,n){for(var t=e.length;t--;)if(VF(e[t][0],n))return t;return-1}function $F(e,n,t,i){var r=-1,a=qI,o=!0,s=e.length,f=[],d=n.length;if(!s)return f;t&&(n=mb(n,ZI(t))),i?(a=GI,o=!1):n.length>=NI&&(a=QI,o=!1,n=new hf(n));e:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=i||u!==0?u:0,o&&h===h){for(var v=d;v--;)if(n[v]===h)continue e;f.push(u)}else a(n,h,i)||f.push(u)}return f}function xb(e,n,t,i,r){var a=-1,o=e.length;for(t||(t=LF),r||(r=[]);++a<o;){var s=e[a];n>0&&t(s)?n>1?xb(s,n-1,t,i,r):_u(r,s):i||(r[r.length]=s)}return r}function AF(e,n,t){var i=n(e);return Su(e)?i:_u(i,t(e))}function TF(e){if(!Cu(e)||RF(e))return!1;var n=$b(e)||nF(e)?rF:UI;return n.test(HF(e))}function OF(e){if(!Cu(e))return zF(e);var n=UF(e),t=[];for(var i in e)i=="constructor"&&(n||!ta.call(e,i))||t.push(i);return t}function PF(e,n){return e=Object(e),IF(e,n,function(t,i){return i in e})}function IF(e,n,t){for(var i=-1,r=n.length,a={};++i<r;){var o=n[i],s=e[o];t(s,o)&&(a[o]=s)}return a}function FF(e,n){return n=kb(n===void 0?e.length-1:n,0),function(){for(var t=arguments,i=-1,r=kb(t.length-n,0),a=Array(r);++i<r;)a[i]=t[n+i];i=-1;for(var o=Array(n+1);++i<n;)o[i]=t[i];return o[n]=a,VI(e,this,o)}}function NF(e){return AF(e,YF,DF)}function pf(e,n){var t=e.__data__;return jF(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Eb(e,n){var t=eF(e,n);return TF(t)?t:void 0}var MF=Eu?gb(Eu,Object):Tb,DF=Eu?function(e){for(var n=[];e;)_u(n,MF(e)),e=aF(e);return n}:Tb;function LF(e){return Su(e)||Sb(e)||!!(_b&&e&&e[_b])}function BF(e,n){return n=n??pb,!!n&&(typeof e=="number"||zI.test(e))&&e>-1&&e%1==0&&e<n}function jF(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function RF(e){return!!bb&&bb in e}function UF(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||cf;return e===t}function zF(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}function WF(e){if(typeof e=="string"||KF(e))return e;var n=e+"";return n=="0"&&1/e==-MI?"-0":n}function HF(e){if(e!=null){try{return yb.call(e)}catch{}try{return e+""}catch{}}return""}function VF(e,n){return e===n||e!==e&&n!==n}function Sb(e){return qF(e)&&ta.call(e,"callee")&&(!oF.call(e,"callee")||xu.call(e)==DI)}var Su=Array.isArray;function Cb(e){return e!=null&&GF(e.length)&&!$b(e)}function qF(e){return Ab(e)&&Cb(e)}function $b(e){var n=Cu(e)?xu.call(e):"";return n==LI||n==BI}function GF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pb}function Cu(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function Ab(e){return!!e&&typeof e=="object"}function KF(e){return typeof e=="symbol"||Ab(e)&&xu.call(e)==jI}function YF(e){return Cb(e)?CF(e,!0):OF(e)}FF(function(e,n){return e==null?{}:(n=mb(xb(n,1),WF),PF(e,$F(NF(e),n)))});function Tb(){return[]}var JF=1/0,XF=9007199254740991,ZF="[object Arguments]",QF="[object Function]",eN="[object GeneratorFunction]",nN="[object Symbol]",tN=typeof pn=="object"&&pn&&pn.Object===Object&&pn,iN=typeof self=="object"&&self&&self.Object===Object&&self,rN=tN||iN||Function("return this")();function aN(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function oN(e,n){for(var t=-1,i=e?e.length:0,r=Array(i);++t<i;)r[t]=n(e[t],t,e);return r}function sN(e,n){for(var t=-1,i=n.length,r=e.length;++t<i;)e[r+t]=n[t];return e}var $u=Object.prototype,fN=$u.hasOwnProperty,Au=$u.toString,Ob=rN.Symbol,lN=$u.propertyIsEnumerable,Pb=Ob?Ob.isConcatSpreadable:void 0,Ib=Math.max;function Fb(e,n,t,i,r){var a=-1,o=e.length;for(t||(t=hN),r||(r=[]);++a<o;){var s=e[a];n>0&&t(s)?n>1?Fb(s,n-1,t,i,r):sN(r,s):i||(r[r.length]=s)}return r}function dN(e,n){return e=Object(e),uN(e,n,function(t,i){return i in e})}function uN(e,n,t){for(var i=-1,r=n.length,a={};++i<r;){var o=n[i],s=e[o];t(s,o)&&(a[o]=s)}return a}function cN(e,n){return n=Ib(n===void 0?e.length-1:n,0),function(){for(var t=arguments,i=-1,r=Ib(t.length-n,0),a=Array(r);++i<r;)a[i]=t[n+i];i=-1;for(var o=Array(n+1);++i<n;)o[i]=t[i];return o[n]=a,aN(e,this,o)}}function hN(e){return mN(e)||pN(e)||!!(Pb&&e&&e[Pb])}function vN(e){if(typeof e=="string"||kN(e))return e;var n=e+"";return n=="0"&&1/e==-JF?"-0":n}function pN(e){return bN(e)&&fN.call(e,"callee")&&(!lN.call(e,"callee")||Au.call(e)==ZF)}var mN=Array.isArray;function gN(e){return e!=null&&wN(e.length)&&!yN(e)}function bN(e){return Nb(e)&&gN(e)}function yN(e){var n=_N(e)?Au.call(e):"";return n==QF||n==eN}function wN(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XF}function _N(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function Nb(e){return!!e&&typeof e=="object"}function kN(e){return typeof e=="symbol"||Nb(e)&&Au.call(e)==nN}cN(function(e,n){return e==null?{}:dN(e,oN(Fb(n,1),vN))});var mf={exports:{}};mf.exports,function(e,n){var t=200,i="__lodash_hash_undefined__",r=800,a=16,o=9007199254740991,s="[object Arguments]",f="[object Array]",d="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",v="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",w="[object Number]",_="[object Null]",k="[object Object]",E="[object Proxy]",S="[object RegExp]",I="[object Set]",P="[object String]",C="[object Undefined]",T="[object WeakMap]",N="[object ArrayBuffer]",j="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",X="[object Int8Array]",J="[object Int16Array]",ee="[object Int32Array]",ae="[object Uint8Array]",fe="[object Uint8ClampedArray]",de="[object Uint16Array]",oe="[object Uint32Array]",me=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[L]=Y[D]=Y[X]=Y[J]=Y[ee]=Y[ae]=Y[fe]=Y[de]=Y[oe]=!0,Y[s]=Y[f]=Y[N]=Y[u]=Y[j]=Y[h]=Y[v]=Y[m]=Y[b]=Y[w]=Y[k]=Y[S]=Y[I]=Y[P]=Y[T]=!1;var ie=typeof pn=="object"&&pn&&pn.Object===Object&&pn,pe=typeof self=="object"&&self&&self.Object===Object&&self,H=ie||pe||Function("return this")(),K=n&&!n.nodeType&&n,B=K&&!0&&e&&!e.nodeType&&e,W=B&&B.exports===K,V=W&&ie.process,O=function(){try{var $=B&&B.require&&B.require("util").types;return $||V&&V.binding&&V.binding("util")}catch{}}(),F=O&&O.isTypedArray;function Z($,U,ne){switch(ne.length){case 0:return $.call(U);case 1:return $.call(U,ne[0]);case 2:return $.call(U,ne[0],ne[1]);case 3:return $.call(U,ne[0],ne[1],ne[2])}return $.apply(U,ne)}function te($,U){for(var ne=-1,ve=Array($);++ne<$;)ve[ne]=U(ne);return ve}function he($){return function(U){return $(U)}}function ye($,U){return $==null?void 0:$[U]}function xe($,U){return function(ne){return $(U(ne))}}var Ee=Array.prototype,re=Function.prototype,Be=Object.prototype,hn=H["__core-js_shared__"],Te=re.toString,ze=Be.hasOwnProperty,yn=function(){var $=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Se=Be.toString,Ue=Te.call(Object),y=RegExp("^"+Te.call(ze).replace(me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),c=W?H.Buffer:void 0,p=H.Symbol,x=H.Uint8Array,A=c?c.allocUnsafe:void 0,M=xe(Object.getPrototypeOf,Object),z=Object.create,ge=Be.propertyIsEnumerable,Fe=Ee.splice,Ce=p?p.toStringTag:void 0,Ie=function(){try{var $=No(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Ae=c?c.isBuffer:void 0,pi=Math.max,ya=Date.now,Et=No(H,"Map"),ot=No(Object,"create"),gr=function(){function $(){}return function(U){if(!ft(U))return{};if(z)return z(U);$.prototype=U;var ne=new $;return $.prototype=void 0,ne}}();function Rn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function $o(){this.__data__=ot?ot(null):{},this.size=0}function wa($){var U=this.has($)&&delete this.__data__[$];return this.size-=U?1:0,U}function Ao($){var U=this.__data__;if(ot){var ne=U[$];return ne===i?void 0:ne}return ze.call(U,$)?U[$]:void 0}function _a($){var U=this.__data__;return ot?U[$]!==void 0:ze.call(U,$)}function ka($,U){var ne=this.__data__;return this.size+=this.has($)?0:1,ne[$]=ot&&U===void 0?i:U,this}Rn.prototype.clear=$o,Rn.prototype.delete=wa,Rn.prototype.get=Ao,Rn.prototype.has=_a,Rn.prototype.set=ka;function Fn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function To(){this.__data__=[],this.size=0}function xa($){var U=this.__data__,ne=Bn(U,$);if(ne<0)return!1;var ve=U.length-1;return ne==ve?U.pop():Fe.call(U,ne,1),--this.size,!0}function Oo($){var U=this.__data__,ne=Bn(U,$);return ne<0?void 0:U[ne][1]}function Po($){return Bn(this.__data__,$)>-1}function Io($,U){var ne=this.__data__,ve=Bn(ne,$);return ve<0?(++this.size,ne.push([$,U])):ne[ve][1]=U,this}Fn.prototype.clear=To,Fn.prototype.delete=xa,Fn.prototype.get=Oo,Fn.prototype.has=Po,Fn.prototype.set=Io;function st($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function q(){this.size=0,this.__data__={hash:new Rn,map:new(Et||Fn),string:new Rn}}function ce($){var U=qi(this,$).delete($);return this.size-=U?1:0,U}function ke($){return qi(this,$).get($)}function Me($){return qi(this,$).has($)}function rn($,U){var ne=qi(this,$),ve=ne.size;return ne.set($,U),this.size+=ne.size==ve?0:1,this}st.prototype.clear=q,st.prototype.delete=ce,st.prototype.get=ke,st.prototype.has=Me,st.prototype.set=rn;function Ve($){var U=this.__data__=new Fn($);this.size=U.size}function Xe(){this.__data__=new Fn,this.size=0}function Ge($){var U=this.__data__,ne=U.delete($);return this.size=U.size,ne}function Ln($){return this.__data__.get($)}function En($){return this.__data__.has($)}function Sn($,U){var ne=this.__data__;if(ne instanceof Fn){var ve=ne.__data__;if(!Et||ve.length<t-1)return ve.push([$,U]),this.size=++ne.size,this;ne=this.__data__=new st(ve)}return ne.set($,U),this.size=ne.size,this}Ve.prototype.clear=Xe,Ve.prototype.delete=Ge,Ve.prototype.get=Ln,Ve.prototype.has=En,Ve.prototype.set=Sn;function Xn($,U){var ne=_r($),ve=!ne&&wr($),Oe=!ne&&!ve&&$a($),$e=!ne&&!ve&&!Oe&&tl($),je=ne||ve||Oe||$e,Re=je?te($.length,String):[],Ze=Re.length;for(var Un in $)(U||ze.call($,Un))&&!(je&&(Un=="length"||Oe&&(Un=="offset"||Un=="parent")||$e&&(Un=="buffer"||Un=="byteLength"||Un=="byteOffset")||Xf(Un,Ze)))&&Re.push(Un);return Re}function ut($,U,ne){(ne!==void 0&&!Gi($[U],ne)||ne===void 0&&!(U in $))&&br($,U,ne)}function Ea($,U,ne){var ve=$[U];(!(ze.call($,U)&&Gi(ve,ne))||ne===void 0&&!(U in $))&&br($,U,ne)}function Bn($,U){for(var ne=$.length;ne--;)if(Gi($[ne][0],U))return ne;return-1}function br($,U,ne){U=="__proto__"&&Ie?Ie($,U,{configurable:!0,enumerable:!0,value:ne,writable:!0}):$[U]=ne}var Mc=Gc();function mi($){return $==null?$===void 0?C:_:Ce&&Ce in Object($)?Kc($):Zc($)}function Fo($){return kr($)&&mi($)==s}function Dc($){if(!ft($)||Zf($))return!1;var U=Aa($)?y:se;return U.test(Ca($))}function Lc($){return kr($)&&ei($.length)&&!!Y[mi($)]}function Bc($){if(!ft($))return Xc($);var U=Qf($),ne=[];for(var ve in $)ve=="constructor"&&(U||!ze.call($,ve))||ne.push(ve);return ne}function Sa($,U,ne,ve,Oe){$!==U&&Mc(U,function($e,je){if(Oe||(Oe=new Ve),ft($e))jc($,U,je,ne,Sa,ve,Oe);else{var Re=ve?ve(Do($,je),$e,je+"",$,U,Oe):void 0;Re===void 0&&(Re=$e),ut($,je,Re)}},rl)}function jc($,U,ne,ve,Oe,$e,je){var Re=Do($,ne),Ze=Do(U,ne),Un=je.get(Ze);if(Un){ut($,ne,Un);return}var Vn=$e?$e(Re,Ze,ne+"",$,U,je):void 0,gi=Vn===void 0;if(gi){var Ta=_r(Ze),ih=!Ta&&$a(Ze),a_=!Ta&&!ih&&tl(Ze);Vn=Ze,Ta||ih||a_?_r(Re)?Vn=Re:el(Re)?Vn=Hc(Re):ih?(gi=!1,Vn=Uc(Ze,!0)):a_?(gi=!1,Vn=Wc(Ze,!0)):Vn=[]:nl(Ze)||wr(Ze)?(Vn=Re,wr(Re)?Vn=il(Re):(!ft(Re)||Aa(Re))&&(Vn=Jf(Ze))):gi=!1}gi&&(je.set(Ze,Vn),Oe(Vn,Ze,ve,$e,je),je.delete(Ze)),ut($,ne,Vn)}function Yf($,U){return Qc(Mo($,U,R),$+"")}var Rc=Ie?function($,U){return Ie($,"toString",{configurable:!0,enumerable:!1,value:th(U),writable:!0})}:R;function Uc($,U){if(U)return $.slice();var ne=$.length,ve=A?A(ne):new $.constructor(ne);return $.copy(ve),ve}function zc($){var U=new $.constructor($.byteLength);return new x(U).set(new x($)),U}function Wc($,U){var ne=U?zc($.buffer):$.buffer;return new $.constructor(ne,$.byteOffset,$.length)}function Hc($,U){var ne=-1,ve=$.length;for(U||(U=Array(ve));++ne<ve;)U[ne]=$[ne];return U}function Vc($,U,ne,ve){var Oe=!ne;ne||(ne={});for(var $e=-1,je=U.length;++$e<je;){var Re=U[$e],Ze=ve?ve(ne[Re],$[Re],Re,ne,$):void 0;Ze===void 0&&(Ze=$[Re]),Oe?br(ne,Re,Ze):Ea(ne,Re,Ze)}return ne}function qc($){return Yf(function(U,ne){var ve=-1,Oe=ne.length,$e=Oe>1?ne[Oe-1]:void 0,je=Oe>2?ne[2]:void 0;for($e=$.length>3&&typeof $e=="function"?(Oe--,$e):void 0,je&&Yc(ne[0],ne[1],je)&&($e=Oe<3?void 0:$e,Oe=1),U=Object(U);++ve<Oe;){var Re=ne[ve];Re&&$(U,Re,ve,$e)}return U})}function Gc($){return function(U,ne,ve){for(var Oe=-1,$e=Object(U),je=ve(U),Re=je.length;Re--;){var Ze=je[$?Re:++Oe];if(ne($e[Ze],Ze,$e)===!1)break}return U}}function yr($,U,ne,ve,Oe,$e){return ft($)&&ft(U)&&($e.set(U,$),Sa($,U,void 0,yr,$e),$e.delete(U)),$}function qi($,U){var ne=$.__data__;return Jc(U)?ne[typeof U=="string"?"string":"hash"]:ne.map}function No($,U){var ne=ye($,U);return Dc(ne)?ne:void 0}function Kc($){var U=ze.call($,Ce),ne=$[Ce];try{$[Ce]=void 0;var ve=!0}catch{}var Oe=Se.call($);return ve&&(U?$[Ce]=ne:delete $[Ce]),Oe}function Jf($){return typeof $.constructor=="function"&&!Qf($)?gr(M($)):{}}function Xf($,U){var ne=typeof $;return U=U??o,!!U&&(ne=="number"||ne!="symbol"&&G.test($))&&$>-1&&$%1==0&&$<U}function Yc($,U,ne){if(!ft(ne))return!1;var ve=typeof U;return(ve=="number"?Lo(ne)&&Xf(U,ne.length):ve=="string"&&U in ne)?Gi(ne[U],$):!1}function Jc($){var U=typeof $;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?$!=="__proto__":$===null}function Zf($){return!!yn&&yn in $}function Qf($){var U=$&&$.constructor,ne=typeof U=="function"&&U.prototype||Be;return $===ne}function Xc($){var U=[];if($!=null)for(var ne in Object($))U.push(ne);return U}function Zc($){return Se.call($)}function Mo($,U,ne){return U=pi(U===void 0?$.length-1:U,0),function(){for(var ve=arguments,Oe=-1,$e=pi(ve.length-U,0),je=Array($e);++Oe<$e;)je[Oe]=ve[U+Oe];Oe=-1;for(var Re=Array(U+1);++Oe<U;)Re[Oe]=ve[Oe];return Re[U]=ne(je),Z($,this,Re)}}function Do($,U){if(!(U==="constructor"&&typeof $[U]=="function")&&U!="__proto__")return $[U]}var Qc=eh(Rc);function eh($){var U=0,ne=0;return function(){var ve=ya(),Oe=a-(ve-ne);if(ne=ve,Oe>0){if(++U>=r)return arguments[0]}else U=0;return $.apply(void 0,arguments)}}function Ca($){if($!=null){try{return Te.call($)}catch{}try{return $+""}catch{}}return""}function Gi($,U){return $===U||$!==$&&U!==U}var wr=Fo(function(){return arguments}())?Fo:function($){return kr($)&&ze.call($,"callee")&&!ge.call($,"callee")},_r=Array.isArray;function Lo($){return $!=null&&ei($.length)&&!Aa($)}function el($){return kr($)&&Lo($)}var $a=Ae||Q;function Aa($){if(!ft($))return!1;var U=mi($);return U==m||U==g||U==d||U==E}function ei($){return typeof $=="number"&&$>-1&&$%1==0&&$<=o}function ft($){var U=typeof $;return $!=null&&(U=="object"||U=="function")}function kr($){return $!=null&&typeof $=="object"}function nl($){if(!kr($)||mi($)!=k)return!1;var U=M($);if(U===null)return!0;var ne=ze.call(U,"constructor")&&U.constructor;return typeof ne=="function"&&ne instanceof ne&&Te.call(ne)==Ue}var tl=F?he(F):Lc;function il($){return Vc($,rl($))}var nh=Yf(function($){return $.push(void 0,yr),Z(al,void 0,$)});function rl($){return Lo($)?Xn($,!0):Bc($)}var al=qc(function($,U,ne,ve){Sa($,U,ne,ve)});function th($){return function(){return $}}function R($){return $}function Q(){return!1}e.exports=nh}(mf,mf.exports);var xN=mf.exports;const EN=xr(xN);var Tu=()=>{throw new Error("Not available on this platform")},SN=()=>Tu(),CN=()=>Tu(),$N=()=>Tu(),Mb=nn({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,n){function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function i(o,s){for(var f="",d=0,u=-1,h=0,v,m=0;m<=o.length;++m){if(m<o.length)v=o.charCodeAt(m);else{if(v===47)break;v=47}if(v===47){if(!(u===m-1||h===1))if(u!==m-1&&h===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var g=f.lastIndexOf("/");if(g!==f.length-1){g===-1?(f="",d=0):(f=f.slice(0,g),d=f.length-1-f.lastIndexOf("/")),u=m,h=0;continue}}else if(f.length===2||f.length===1){f="",d=0,u=m,h=0;continue}}s&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+o.slice(u+1,m):f=o.slice(u+1,m),d=m-u-1;u=m,h=0}else v===46&&h!==-1?++h:h=-1}return f}function r(o,s){var f=s.dir||s.root,d=s.base||(s.name||"")+(s.ext||"");return f?f===s.root?f+d:f+o+d:d}var a={resolve:function(){for(var s="",f=!1,d,u=arguments.length-1;u>=-1&&!f;u--){var h;u>=0?h=arguments[u]:(d===void 0&&(d=process.cwd()),h=d),t(h),h.length!==0&&(s=h+"/"+s,f=h.charCodeAt(0)===47)}return s=i(s,!f),f?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(t(s),s.length===0)return".";var f=s.charCodeAt(0)===47,d=s.charCodeAt(s.length-1)===47;return s=i(s,!f),s.length===0&&!f&&(s="."),s.length>0&&d&&(s+="/"),f?"/"+s:s},isAbsolute:function(s){return t(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,f=0;f<arguments.length;++f){var d=arguments[f];t(d),d.length>0&&(s===void 0?s=d:s+="/"+d)}return s===void 0?".":a.normalize(s)},relative:function(s,f){if(t(s),t(f),s===f||(s=a.resolve(s),f=a.resolve(f),s===f))return"";for(var d=1;d<s.length&&s.charCodeAt(d)===47;++d);for(var u=s.length,h=u-d,v=1;v<f.length&&f.charCodeAt(v)===47;++v);for(var m=f.length,g=m-v,b=h<g?h:g,w=-1,_=0;_<=b;++_){if(_===b){if(g>b){if(f.charCodeAt(v+_)===47)return f.slice(v+_+1);if(_===0)return f.slice(v+_)}else h>b&&(s.charCodeAt(d+_)===47?w=_:_===0&&(w=0));break}var k=s.charCodeAt(d+_),E=f.charCodeAt(v+_);if(k!==E)break;k===47&&(w=_)}var S="";for(_=d+w+1;_<=u;++_)(_===u||s.charCodeAt(_)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+f.slice(v+w):(v+=w,f.charCodeAt(v)===47&&++v,f.slice(v))},_makeLong:function(s){return s},dirname:function(s){if(t(s),s.length===0)return".";for(var f=s.charCodeAt(0),d=f===47,u=-1,h=!0,v=s.length-1;v>=1;--v)if(f=s.charCodeAt(v),f===47){if(!h){u=v;break}}else h=!1;return u===-1?d?"/":".":d&&u===1?"//":s.slice(0,u)},basename:function(s,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');t(s);var d=0,u=-1,h=!0,v;if(f!==void 0&&f.length>0&&f.length<=s.length){if(f.length===s.length&&f===s)return"";var m=f.length-1,g=-1;for(v=s.length-1;v>=0;--v){var b=s.charCodeAt(v);if(b===47){if(!h){d=v+1;break}}else g===-1&&(h=!1,g=v+1),m>=0&&(b===f.charCodeAt(m)?--m===-1&&(u=v):(m=-1,u=g))}return d===u?u=g:u===-1&&(u=s.length),s.slice(d,u)}else{for(v=s.length-1;v>=0;--v)if(s.charCodeAt(v)===47){if(!h){d=v+1;break}}else u===-1&&(h=!1,u=v+1);return u===-1?"":s.slice(d,u)}},extname:function(s){t(s);for(var f=-1,d=0,u=-1,h=!0,v=0,m=s.length-1;m>=0;--m){var g=s.charCodeAt(m);if(g===47){if(!h){d=m+1;break}continue}u===-1&&(h=!1,u=m+1),g===46?f===-1?f=m:v!==1&&(v=1):f!==-1&&(v=-1)}return f===-1||u===-1||v===0||v===1&&f===u-1&&f===d+1?"":s.slice(f,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){t(s);var f={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return f;var d=s.charCodeAt(0),u=d===47,h;u?(f.root="/",h=1):h=0;for(var v=-1,m=0,g=-1,b=!0,w=s.length-1,_=0;w>=h;--w){if(d=s.charCodeAt(w),d===47){if(!b){m=w+1;break}continue}g===-1&&(b=!1,g=w+1),d===46?v===-1?v=w:_!==1&&(_=1):v!==-1&&(_=-1)}return v===-1||g===-1||_===0||_===1&&v===g-1&&v===m+1?g!==-1&&(m===0&&u?f.base=f.name=s.slice(1,g):f.base=f.name=s.slice(m,g)):(m===0&&u?(f.name=s.slice(1,v),f.base=s.slice(1,g)):(f.name=s.slice(m,v),f.base=s.slice(m,g)),f.ext=s.slice(v,g)),m>0?f.dir=s.slice(0,m-1):u&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,n.exports=a}});ur(Mb());var Xt=ur(Mb());Xt.basename;var AN=Xt.dirname;Xt.extname,Xt.format,Xt.isAbsolute,Xt.join,Xt.normalize,Xt.parse,Xt.relative,Xt.resolve;var $n;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})($n||($n={}));var TN={trace:5,debug:10,info:11,warn:12,error:13},so;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(so||(so={}));var ON=Symbol("logInfoProperties"),PN=e=>{if(!e)return{};const n={},i=Object.getPrototypeOf(e)[ON]??[];for(const r of i)try{n[r]=typeof e[r]=="function"?e[r]():e[r]}catch(a){n[r]=a.message}return n},IN=(e,n,t)=>n>=e.level&&(!e.pattern||t.includes(e.pattern)),Db=(e,n)=>n===void 0?!0:n.some(t=>{var i;return IN(t,e.level,((i=e.meta)==null?void 0:i.F)??"")}),Ou=e=>{let n;if(e.meta){const t=PN(e.meta.S);Object.keys(t).length>0&&(n=Object.assign(n??{},t))}if(e.context)if(e.context instanceof Error){const t=e.context.context;n=Object.assign(n??{},{error:e.context.stack,...t})}else typeof e.context=="object"&&(n=Object.assign(n??{},e.context));return n&&Object.keys(n).length>0?n:void 0},FN=0,NN=e=>(n,t,i)=>(r,a,o)=>{const s=o.value;o.value=function(...f){const d={...i??{},S:this},u=f.map(h=>Ft(h,!1,1,!0)).join(", ");try{const h=performance.now(),v=s.apply(this,f);if(MN(v)){const m=FN++;e.info(`${a}(${u}) => Promise { #${m} }`,{},d),v.then(g=>{g!==void 0?e.info(`โœ… resolve #${m} ${(performance.now()-h).toFixed(0)}ms => ${Ft(g,!1,1,!0)}`,{},d):e.info(`โœ… resolve #${m} ${(performance.now()-h).toFixed(0)}ms`,{},d)},g=>{e.info(`๐Ÿ”ฅ reject #${m} #${(performance.now()-h).toFixed(0)}ms => ${g}`,{},d)})}else e.info(`${a}(${u}) => ${Ft(v,!1,1,!0)}`,{},d);return v}catch(h){throw e.error(`${a}(${u}) ๐Ÿ”ฅ ${h}`,{},d),h}},Object.defineProperty(o.value,"name",{value:a+"$log"})},MN=e=>e&&typeof e.then=="function",DN=e=>{try{return JSON.parse(localStorage.getItem("dxlog"))}catch{return}},Lb=()=>{},LN=(e,n)=>{console.log(Ft(n,!1,null,!0))},Bb=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},Pu=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},BN=(e,n)=>{var d,u,h;if(!Db(n,e.filters))return;const t=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",i=[];let r="";if(n.meta){const v=Bb(n.meta.F);r=`${`${t.replace(/\/$/,"")}/${v}`}#L${n.meta.L}`}let a=[];if((d=n.meta)!=null&&d.S){const v=(u=n.meta)==null?void 0:u.S,m=Object.getPrototypeOf(v),g=OI(v);a.push(`%c${m.constructor.name}#${g}`,"color:#C026D3;font-weight:bold")}a.push(n.message);const o=Ou(n);o&&a.push(o);const s={[$n.ERROR]:console.error,[$n.WARN]:console.warn,[$n.DEBUG]:console.log};(Pu.printFileLinks||$I())&&(i!=null&&i.length?a=[`%c${r}
822
822
  %c${a.join(" ")}`,...i]:a=[r+`
823
823
  `,...a]);const f=s[n.level]??console.log;typeof((h=n.meta)==null?void 0:h.C)=="function"?n.meta.C(f,a):f(...a)},jN=(e,n)=>{var s;if(!Db(n,e.filters))return;let t="";n.meta&&(t=`${Bb(n.meta.F)}:${n.meta.L}`);let i=[];i.push(n.message);const r=Ou(n);r&&i.push(r);const a={[$n.ERROR]:console.error,[$n.WARN]:console.warn,[$n.DEBUG]:console.log};Pu.printFileLinks&&(i=[t,...i]);const o=a[n.level]??console.log;typeof((s=n.meta)==null?void 0:s.C)=="function"?n.meta.C(o,i):o(...i)},jb=Pu.useTestProcessor?jN:BN,RN=({path:e,levels:n})=>{let t;return(i,r)=>{var o,s;if(!n.includes(r.level))return;if(!t){try{CN(AN(e))}catch{}t=$N()}const a={...r,timestamp:Date.now(),meta:{file:(o=r.meta)==null?void 0:o.F,line:(s=r.meta)==null?void 0:s.L},context:mu(Ou(r))};SN(t,JSON.stringify(a)+`
824
824
  `)}},Rb,UN=()=>(Rb??(Rb=process.env.LOG_FILE??(process.env.HOME?`${process.env.HOME}/.dxlog/${new Date().toISOString()}.log`:void 0)),Rb);RN({path:UN(),levels:[$n.ERROR,$n.WARN,$n.INFO,$n.TRACE]});var zN={[so.CONSOLE]:Lb,[so.BROWSER]:jb,[so.DEBUG]:LN},WN=typeof window<"u"||typeof navigator<"u",Iu=[WN?jb:Lb],Ub=e=>{if(typeof e=="number")return[{level:e}];const n=(i,r=$n.WARN)=>TN[i.toLowerCase()]??r;return(typeof e=="string"?e.split(/,\s*/):e).map(i=>{const[r,a]=i.split(":");return a?{level:n(a),pattern:r}:{level:n(r)}})},zb=e=>{const n="process"in globalThis?{file:process.env.LOG_CONFIG,filter:process.env.LOG_FILTER,processor:process.env.LOG_PROCESSOR}:void 0,t=EN({},e,n&&DN(n.file),n);return{options:t,filters:Ub(t.filter??$n.INFO),captureFilters:Ub(t.captureFilter??$n.WARN),processors:t.processor?[zN[t.processor]]:Iu,prefix:t.prefix}},HN=()=>{const e=(...t)=>n($n.DEBUG,...t);e._config=zb(),Object.defineProperty(e,"runtimeConfig",{get:()=>e._config}),e.addProcessor=t=>{Iu.filter(i=>i===t).length===0&&Iu.push(t),e._config.processors.filter(i=>i===t).length===0&&e._config.processors.push(t)},e.config=t=>{e._config=zb(t)},e.trace=(...t)=>n($n.TRACE,...t),e.debug=(...t)=>n($n.DEBUG,...t),e.info=(...t)=>n($n.INFO,...t),e.warn=(...t)=>n($n.WARN,...t),e.error=(...t)=>n($n.ERROR,...t),e.catch=(t,i,r)=>n($n.ERROR,t.stack,i,r),e.break=()=>e.info("โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”"),e.stack=(t,i,r)=>n($n.INFO,`${t??"Stack Dump"}
@@ -924,7 +924,7 @@ Event: `).concat(JSON.stringify(v.data))),i.state;if(i.status!==On.Running&&!i.o
924
924
  Event: `).concat(JSON.stringify(v.data)));return i.scheduler.schedule(function(){i.forward(v);var m=i._nextState(v);i.update(m,v)}),i._state},this.sendTo=function(u,h,v){var m=i.parent&&(h===la.Parent||i.parent.id===h),g=m?i.parent:dn(h)?h===la.Internal?i:i.children.get(h)||So.get(h):xL(h)?h:void 0;if(!g){if(!m)throw new Error("Unable to send event to child '".concat(h,"' from service '").concat(i.id,"'."));In||Wn(!1,"Service '".concat(i.id,"' has no parent: unable to send event ").concat(u.type));return}if("machine"in g){if(i.status!==On.Stopped||i.parent!==g||i.state.done){var b=we(we({},u),{name:u.name===uL?"".concat(_o(i.id)):u.name,origin:i.sessionId});!v&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([g,b]):g.send(b)}}else!v&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([g,u.data]):g.send(u.data)},this._exec=function(u,h,v,m){m===void 0&&(m=i.machine.options.actions);var g=u.exec||_c(u.type,m),b=cn(g)?g:g?g.exec:u.exec;if(b)try{return b(h,v.data,i.machine.config.predictableActionArguments?{action:u,_event:v}:{action:u,state:i.state,_event:v})}catch(J){throw i.parent&&i.parent.send({type:"xstate.error",data:J}),J}switch(u.type){case go:{var w=u;i.defer(w);break}case Pf:var _=u;if(typeof _.delay=="number"){i.defer(_);return}else _.to?i.sendTo(_._event,_.to,v===ca):i.send(_._event);break;case uw:i.cancel(u.sendId);break;case hc:{if(i.status!==On.Running)return;var k=u.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[k.id||k.type])break;if(k.type===gn.Invoke){var E=Sw(k.src),S=i.machine.options.services?i.machine.options.services[E.type]:void 0,I=k.id,P=k.data;In||Wn(!("forward"in k),"`forward` property is deprecated (found in invocation of '".concat(k.src,"' in in machine '").concat(i.machine.id,"'). ")+"Please use `autoForward` instead.");var C="autoForward"in k?k.autoForward:!!k.forward;if(!S){In||Wn(!1,"No service found for invocation '".concat(k.src,"' in machine '").concat(i.machine.id,"'."));return}var T=P?Mf(P,h,v):void 0;if(typeof S=="string")return;var N=cn(S)?S(h,v.data,{data:T,src:E,meta:k.meta}):S;if(!N)return;var j=void 0;mr(N)&&(N=T?N.withContext(T):N,j={autoForward:C}),i.spawn(N,I,j)}else i.spawnActivity(k);break}case vc:{i.stopChild(u.activity.id);break}case cw:var L=u,D=L.label,X=L.value;D?i.logger(D,X):i.logger(X);break;default:In||Wn(!1,"No implementation found for action type '".concat(u.type,"'"));break}};var r=we(we({},e.defaultOptions),t),a=r.clock,o=r.logger,s=r.parent,f=r.id,d=f!==void 0?f:n.id;this.id=d,this.logger=o,this.clock=a,this.parent=s,this.options=r,this.scheduler=new Fw({deferEvents:this.options.deferEvents}),this.sessionId=So.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var n=this;return this._initialState?this._initialState:ha(this,function(){return n._initialState=n.machine.initialState,n._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return In||Wn(this.status!==On.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(n,t){var i,r;try{for(var a=tn(n.actions),o=a.next();!o.done;o=a.next()){var s=o.value;this.exec(s,n,t)}}catch(f){i={error:f}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},e.prototype.update=function(n,t){var i,r,a,o,s,f,d,u,h=this;if(n._sessionid=this.sessionId,this._state=n,(!this.machine.config.predictableActionArguments||t===ca)&&this.options.execute)this.execute(this.state);else for(var v=void 0;v=this._outgoingQueue.shift();)v[0].send(v[1]);if(this.children.forEach(function(N){h.state.children[N.id]=N}),this.devTools&&this.devTools.send(t.data,n),n.event)try{for(var m=tn(this.eventListeners),g=m.next();!g.done;g=m.next()){var b=g.value;b(n.event)}}catch(N){i={error:N}}finally{try{g&&!g.done&&(r=m.return)&&r.call(m)}finally{if(i)throw i.error}}try{for(var w=tn(this.listeners),_=w.next();!_.done;_=w.next()){var b=_.value;b(n,n.event)}}catch(N){a={error:N}}finally{try{_&&!_.done&&(o=w.return)&&o.call(w)}finally{if(a)throw a.error}}try{for(var k=tn(this.contextListeners),E=k.next();!E.done;E=k.next()){var S=E.value;S(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(N){s={error:N}}finally{try{E&&!E.done&&(f=k.return)&&f.call(k)}finally{if(s)throw s.error}}if(this.state.done){var I=n.configuration.find(function(N){return N.type==="final"&&N.parent===h.machine}),P=I&&I.doneData?Mf(I.doneData,n.context,t):void 0;this._doneEvent=Rf(this.id,P);try{for(var C=tn(this.doneListeners),T=C.next();!T.done;T=C.next()){var b=T.value;b(this._doneEvent)}}catch(N){d={error:N}}finally{try{T&&!T.done&&(u=C.return)&&u.call(C)}finally{if(d)throw d.error}}this._stop(),this._stopChildren(),So.free(this.sessionId)}},e.prototype.onTransition=function(n){return this.listeners.add(n),this.status===On.Running&&n(this.state,this.state.event),this},e.prototype.subscribe=function(n,t,i){var r=this,a=Lf(n,t,i);this.listeners.add(a.next),this.status!==On.NotStarted&&a.next(this.state);var o=function(){r.doneListeners.delete(o),r.stopListeners.delete(o),a.complete()};return this.status===On.Stopped?a.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){r.listeners.delete(a.next),r.doneListeners.delete(o),r.stopListeners.delete(o)}}},e.prototype.onEvent=function(n){return this.eventListeners.add(n),this},e.prototype.onSend=function(n){return this.sendListeners.add(n),this},e.prototype.onChange=function(n){return this.contextListeners.add(n),this},e.prototype.onStop=function(n){return this.stopListeners.add(n),this},e.prototype.onDone=function(n){return this.status===On.Stopped&&this._doneEvent?n(this._doneEvent):this.doneListeners.add(n),this},e.prototype.off=function(n){return this.listeners.delete(n),this.eventListeners.delete(n),this.sendListeners.delete(n),this.stopListeners.delete(n),this.doneListeners.delete(n),this.contextListeners.delete(n),this},e.prototype.start=function(n){var t=this;if(this.status===On.Running)return this;this.machine._init(),So.register(this.sessionId,this),this.initialized=!0,this.status=On.Running;var i=n===void 0?this.initialState:ha(this,function(){return VL(n)?t.machine.resolveState(n):t.machine.resolveState(xt.from(n,t.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){t.update(i,ca)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(n){cn(n.stop)&&n.stop()}),this.children.clear()},e.prototype._stop=function(){var n,t,i,r,a,o,s,f,d,u;try{for(var h=tn(this.listeners),v=h.next();!v.done;v=h.next()){var m=v.value;this.listeners.delete(m)}}catch(C){n={error:C}}finally{try{v&&!v.done&&(t=h.return)&&t.call(h)}finally{if(n)throw n.error}}try{for(var g=tn(this.stopListeners),b=g.next();!b.done;b=g.next()){var m=b.value;m(),this.stopListeners.delete(m)}}catch(C){i={error:C}}finally{try{b&&!b.done&&(r=g.return)&&r.call(g)}finally{if(i)throw i.error}}try{for(var w=tn(this.contextListeners),_=w.next();!_.done;_=w.next()){var m=_.value;this.contextListeners.delete(m)}}catch(C){a={error:C}}finally{try{_&&!_.done&&(o=w.return)&&o.call(w)}finally{if(a)throw a.error}}try{for(var k=tn(this.doneListeners),E=k.next();!E.done;E=k.next()){var m=E.value;this.doneListeners.delete(m)}}catch(C){s={error:C}}finally{try{E&&!E.done&&(f=k.return)&&f.call(k)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=On.Stopped,this._initialState=void 0;try{for(var S=tn(Object.keys(this.delayedEventsMap)),I=S.next();!I.done;I=S.next()){var P=I.value;this.clock.clearTimeout(this.delayedEventsMap[P])}}catch(C){d={error:C}}finally{try{I&&!I.done&&(u=S.return)&&u.call(S)}finally{if(d)throw d.error}}this.scheduler.clear(),this.scheduler=new Fw({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var n=this,t=this.scheduler;return this._stop(),t.schedule(function(){var i=Hn({type:"xstate.stop"}),r=ha(n,function(){var a=An(xn([],ln(n.state.configuration),!1).sort(function(u,h){return h.order-u.order}).map(function(u){return Wi(u.onExit,n.machine.options.actions)})),o=ln(Uf(n.machine,n.state,n.state.context,i,[{type:"exit",actions:a}],n.machine.config.predictableActionArguments?n._exec:void 0,n.machine.config.predictableActionArguments||n.machine.config.preserveActionOrder),2),s=o[0],f=o[1],d=new xt({value:n.state.value,context:f,_event:i,_sessionid:n.sessionId,historyValue:void 0,history:n.state,actions:s.filter(function(u){return!wc(u)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:n.state.done,tags:n.state.tags,machine:n.machine});return d.changed=!0,d});n.update(r,i),n._stopChildren(),So.free(n.sessionId)}),this},e.prototype.batch=function(n){var t=this;if(this.status===On.NotStarted&&this.options.deferEvents)In||Wn(!1,"".concat(n.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
925
925
  Event: `).concat(JSON.stringify(event)));else if(this.status!==On.Running)throw new Error("".concat(n.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(n.length){var i=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,a,o=t.state,s=!1,f=[],d=function(m){var g=Hn(m);t.forward(g),o=ha(t,function(){return t.machine.transition(o,g,void 0,i||void 0)}),f.push.apply(f,xn([],ln(t.machine.config.predictableActionArguments?o.actions:o.actions.map(function(b){return qL(b,o)})),!1)),s=s||!!o.changed};try{for(var u=tn(n),h=u.next();!h.done;h=u.next()){var v=h.value;d(v)}}catch(m){r={error:m}}finally{try{h&&!h.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}o.changed=s,o.actions=f,t.update(o,Hn(n[n.length-1]))})}},e.prototype.sender=function(n){return this.send.bind(this,n)},e.prototype._nextState=function(n,t){var i=this;t===void 0&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=Hn(n);if(r.name.indexOf(hw)===0&&!this.state.nextEvents.some(function(o){return o.indexOf(hw)===0}))throw r.data.data;var a=ha(this,function(){return i.machine.transition(i.state,r,void 0,t||void 0)});return a},e.prototype.nextState=function(n){return this._nextState(n,!1)},e.prototype.forward=function(n){var t,i;try{for(var r=tn(this.forwardTo),a=r.next();!a.done;a=r.next()){var o=a.value,s=this.children.get(o);if(!s)throw new Error("Unable to forward event '".concat(n,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));s.send(n)}}catch(f){t={error:f}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(n){var t=this,i=this.clock.setTimeout(function(){"to"in n&&n.to?t.sendTo(n._event,n.to,!0):t.send(n._event)},n.delay);n.id&&(this.delayedEventsMap[n.id]=i)},e.prototype.cancel=function(n){this.clock.clearTimeout(this.delayedEventsMap[n]),delete this.delayedEventsMap[n]},e.prototype.exec=function(n,t,i){i===void 0&&(i=this.machine.options.actions),this._exec(n,t.context,t._event,i)},e.prototype.removeChild=function(n){var t;this.children.delete(n),this.forwardTo.delete(n),(t=this.state)===null||t===void 0||delete t.children[n]},e.prototype.stopChild=function(n){var t=this.children.get(n);t&&(this.removeChild(n),cn(t.stop)&&t.stop())},e.prototype.spawn=function(n,t,i){if(this.status!==On.Running)return $w(n,t);if(ww(n))return this.spawnPromise(Promise.resolve(n),t);if(cn(n))return this.spawnCallback(n,t);if(RL(n))return this.spawnActor(n,t);if(kL(n))return this.spawnObservable(n,t);if(mr(n))return this.spawnMachine(n,we(we({},i),{id:t}));if(yL(n))return this.spawnBehavior(n,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof n,'".'))},e.prototype.spawnMachine=function(n,t){var i=this;t===void 0&&(t={});var r=new e(n,we(we({},this.options),{parent:this,id:t.id||n.id})),a=we(we({},ZL),t);a.sync&&r.onTransition(function(s){i.send(vw,{state:s,id:r.id})});var o=r;return this.children.set(r.id,o),a.autoForward&&this.forwardTo.add(r.id),r.onDone(function(s){i.removeChild(r.id),i.send(Hn(s,{origin:r.id}))}).start(),o},e.prototype.spawnBehavior=function(n,t){var i=XL(n,{id:t,parent:this});return this.children.set(t,i),i},e.prototype.spawnPromise=function(n,t){var i,r=this,a=!1,o;n.then(function(f){a||(o=f,r.removeChild(t),r.send(Hn(Rf(t,f),{origin:t})))},function(f){if(!a){r.removeChild(t);var d=_o(t,f);try{r.send(Hn(d,{origin:t}))}catch(u){SL(f,u,t),r.devTools&&r.devTools.send(d,r.state),r.machine.strict&&r.stop()}}});var s=(i={id:t,send:function(){},subscribe:function(f,d,u){var h=Lf(f,d,u),v=!1;return n.then(function(m){v||(h.next(m),!v&&h.complete())},function(m){v||h.error(m)}),{unsubscribe:function(){return v=!0}}},stop:function(){a=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return o}},i[zi]=function(){return this},i);return this.children.set(t,s),s},e.prototype.spawnCallback=function(n,t){var i,r=this,a=!1,o=new Set,s=new Set,f,d=function(v){f=v,s.forEach(function(m){return m(v)}),!a&&r.send(Hn(v,{origin:t}))},u;try{u=n(d,function(v){o.add(v)})}catch(v){this.send(_o(t,v))}if(ww(u))return this.spawnPromise(u,t);var h=(i={id:t,send:function(v){return o.forEach(function(m){return m(v)})},subscribe:function(v){var m=Lf(v);return s.add(m.next),{unsubscribe:function(){s.delete(m.next)}}},stop:function(){a=!0,cn(u)&&u()},toJSON:function(){return{id:t}},getSnapshot:function(){return f}},i[zi]=function(){return this},i);return this.children.set(t,h),h},e.prototype.spawnObservable=function(n,t){var i,r=this,a,o=n.subscribe(function(f){a=f,r.send(Hn(f,{origin:t}))},function(f){r.removeChild(t),r.send(Hn(_o(t,f),{origin:t}))},function(){r.removeChild(t),r.send(Hn(Rf(t),{origin:t}))}),s=(i={id:t,send:function(){},subscribe:function(f,d,u){return n.subscribe(f,d,u)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return a},toJSON:function(){return{id:t}}},i[zi]=function(){return this},i);return this.children.set(t,s),s},e.prototype.spawnActor=function(n,t){return this.children.set(t,n),n},e.prototype.spawnActivity=function(n){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[n.type]:void 0;if(!t){In||Wn(!1,"No implementation found for activity '".concat(n.type,"'"));return}var i=t(this.state.context,n);this.spawnEffect(n.id,i)},e.prototype.spawnEffect=function(n,t){var i;this.children.set(n,(i={id:n,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:n}}},i[zi]=function(){return this},i))},e.prototype.attachDev=function(){var n=Sc();if(this.options.devTools&&n){if(n.__REDUX_DEVTOOLS_EXTENSION__){var t=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=n.__REDUX_DEVTOOLS_EXTENSION__.connect(we(we({name:this.id,autoPause:!0,stateSanitizer:function(i){return{value:i.value,context:i.context,actions:i.actions}}},t),{features:we({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}JL(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[zi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===On.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(n,t){return setTimeout(n,t)},clearTimeout:function(n){return clearTimeout(n)}},logger:console.log.bind(console),devTools:!1},e.interpret=Nw,e}();function Nw(e,n){var t=new QL(e,n);return t}function eB(e){if(typeof e=="string"){var n={type:e};return n.toString=function(){return e},n}return e}function Hf(e){return we(we({type:mc},e),{toJSON:function(){e.onDone,e.onError;var n=cc(e,["onDone","onError"]);return we(we({},n),{type:mc,src:eB(e.src)})}})}var va="",Cc="#",Co="*",pa={},ma=function(e){return e[0]===Cc},nB=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},tB=function(e,n,t){var i=t.slice(0,-1).some(function(a){return!("cond"in a)&&!("in"in a)&&(dn(a.target)||mr(a.target))}),r=n===va?"the transient event":"event '".concat(n,"'");Wn(!i,"One or more transitions for ".concat(r," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},iB=function(){function e(n,t,i,r){i===void 0&&(i="context"in n?n.context:void 0);var a=this,o;this.config=n,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(nB(),t),this.parent=r==null?void 0:r.parent,this.key=this.config.key||(r==null?void 0:r.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:pw),this.id=this.config.id||xn([this.machine.key],ln(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(o=this.config.schema)!==null&&o!==void 0?o:{},this.description=this.config.description,In||Wn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?yo(this.config.states,function(d,u){var h,v=new e(d,{},void 0,{parent:a,key:u});return Object.assign(a.idMap,we((h={},h[v.id]=v,h),v.idMap)),v}):pa;var s=0;function f(d){var u,h;d.order=s++;try{for(var v=tn(Aw(d)),m=v.next();!m.done;m=v.next()){var g=m.value;f(g)}}catch(b){u={error:b}}finally{try{m&&!m.done&&(h=v.return)&&h.call(v)}finally{if(u)throw u.error}}}f(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(d){var u=d.event;return u===va}):va in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=Nt(this.config.entry||this.config.onEntry).map(function(d){return wo(d)}),this.onExit=Nt(this.config.exit||this.config.onExit).map(function(d){return wo(d)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=Nt(this.config.invoke).map(function(d,u){var h,v;if(mr(d)){var m=Bf(a.id,u);return a.machine.options.services=we((h={},h[m]=d,h),a.machine.options.services),Hf({src:m,id:m})}else if(dn(d.src)){var m=d.id||Bf(a.id,u);return Hf(we(we({},d),{id:m,src:d.src}))}else if(mr(d.src)||cn(d.src)){var m=d.id||Bf(a.id,u);return a.machine.options.services=we((v={},v[m]=d.src,v),a.machine.options.services),Hf(we(we({id:m},d),{src:m}))}else{var g=d.src;return Hf(we(we({id:Bf(a.id,u)},d),{src:g}))}}),this.activities=Nt(this.config.activities).concat(this.invoke).map(function(d){return kc(d)}),this.transition=this.transition.bind(this),this.tags=Nt(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||Tw(this).forEach(function(n){return n.on})},e.prototype.withConfig=function(n,t){var i=this.options,r=i.actions,a=i.activities,o=i.guards,s=i.services,f=i.delays;return new e(this.config,{actions:we(we({},r),n.actions),activities:we(we({},a),n.activities),guards:we(we({},o),n.guards),services:we(we({},s),n.services),delays:we(we({},f),n.delays)},t??this.context)},e.prototype.withContext=function(n){return new e(this.config,this.options,n)},Object.defineProperty(e.prototype,"context",{get:function(){return cn(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:yo(this.states,function(n){return n.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var n=this.transitions;return this.__cache.on=n.reduce(function(t,i){return t[i.eventType]=t[i.eventType]||[],t[i.eventType].push(i),t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(n){if(this.__cache.candidates[n])return this.__cache.candidates[n];var t=n===va,i=this.transitions.filter(function(r){var a=r.eventType===n;return t?a:a||r.eventType===Co});return this.__cache.candidates[n]=i,i},e.prototype.getDelayedTransitions=function(){var n=this,t=this.config.after;if(!t)return[];var i=function(a,o){var s=cn(a)?"".concat(n.id,":delay[").concat(o,"]"):a,f=DL(s,n.id);return n.onEntry.push(AL(f,{delay:a})),n.onExit.push(PL(f)),f},r=da(t)?t.map(function(a,o){var s=i(a.delay,o);return we(we({},a),{event:s})}):An(Object.keys(t).map(function(a,o){var s=t[a],f=dn(s)?{target:s}:s,d=isNaN(+a)?a:+a,u=i(d,o);return Nt(f).map(function(h){return we(we({},h),{event:u,delay:d})})}));return r.map(function(a){var o=a.delay;return we(we({},n.formatTransition(a)),{delay:o})})},e.prototype.getStateNodes=function(n){var t,i=this;if(!n)return[];var r=n instanceof xt?n.value:bo(n,this.delimiter);if(dn(r)){var a=this.getStateNode(r).initial;return a!==void 0?this.getStateNodes((t={},t[r]=a,t)):[this,this.states[r]]}var o=Object.keys(r),s=[this];return s.push.apply(s,xn([],ln(An(o.map(function(f){return i.getStateNode(f).getStateNodes(r[f])}))),!1)),s},e.prototype.handles=function(n){var t=gw(n);return this.events.includes(t)},e.prototype.resolveState=function(n){var t=n instanceof xt?n:xt.create(n),i=Array.from(xo([],this.getStateNodes(t.value)));return new xt(we(we({},t),{value:this.resolve(t.value),configuration:i,done:Wf(i,this),tags:Pw(i),machine:this.machine}))},e.prototype.transitionLeafNode=function(n,t,i){var r=this.getStateNode(n),a=r.next(t,i);return!a||!a.transitions.length?this.next(t,i):a},e.prototype.transitionCompoundNode=function(n,t,i){var r=Object.keys(n),a=this.getStateNode(r[0]),o=a._transition(n[r[0]],t,i);return!o||!o.transitions.length?this.next(t,i):o},e.prototype.transitionParallelNode=function(n,t,i){var r,a,o={};try{for(var s=tn(Object.keys(n)),f=s.next();!f.done;f=s.next()){var d=f.value,u=n[d];if(u){var h=this.getStateNode(d),v=h._transition(u,t,i);v&&(o[d]=v)}}}catch(_){r={error:_}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}var m=Object.keys(o).map(function(_){return o[_]}),g=An(m.map(function(_){return _.transitions})),b=m.some(function(_){return _.transitions.length>0});if(!b)return this.next(t,i);var w=An(Object.keys(o).map(function(_){return o[_].configuration}));return{transitions:g,exitSet:An(m.map(function(_){return _.exitSet})),configuration:w,source:t,actions:An(Object.keys(o).map(function(_){return o[_].actions}))}},e.prototype._transition=function(n,t,i){return dn(n)?this.transitionLeafNode(n,t,i):Object.keys(n).length===1?this.transitionCompoundNode(n,t,i):this.transitionParallelNode(n,t,i)},e.prototype.getTransitionData=function(n,t){return this._transition(n.value,n,Hn(t))},e.prototype.next=function(n,t){var i,r,a=this,o=t.name,s=[],f=[],d;try{for(var u=tn(this.getCandidates(o)),h=u.next();!h.done;h=u.next()){var v=h.value,m=v.cond,g=v.in,b=n.context,w=g?dn(g)&&ma(g)?n.matches(bo(this.getStateNodeById(g).path,this.delimiter)):bc(bo(g,this.delimiter),mL(this.path.slice(0,-2))(n.value)):!0,_=!1;try{_=!m||Ew(this.machine,m,b,t,n)}catch(S){throw new Error("Unable to evaluate guard '".concat(m.name||m.type,"' in transition for event '").concat(o,"' in state node '").concat(this.id,`':
926
926
  `).concat(S.message))}if(_&&w){v.target!==void 0&&(f=v.target),s.push.apply(s,xn([],ln(v.actions),!1)),d=v;break}}}catch(S){i={error:S}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}if(d){if(!f.length)return{transitions:[d],exitSet:[],configuration:n.value?[this]:[],source:n,actions:s};var k=An(f.map(function(S){return a.getRelativeStateNodes(S,n.historyValue)})),E=!!d.internal;return{transitions:[d],exitSet:E?[]:An(f.map(function(S){return a.getPotentiallyReenteringNodes(S)})),configuration:k,source:n,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(n){if(this.order<n.order)return[this];for(var t=[],i=this,r=n;i&&i!==r;)t.push(i),i=i.parent;return i!==r?[]:(t.push(r),t)},e.prototype.getActions=function(n,t,i,r,a,o,s){var f,d,u,h,v=this,m=o?xo([],this.getStateNodes(o.value)):[],g=new Set;try{for(var b=tn(Array.from(n).sort(function(L,D){return L.order-D.order})),w=b.next();!w.done;w=b.next()){var _=w.value;(!Eo(m,_)||Eo(i.exitSet,_)||_.parent&&g.has(_.parent))&&g.add(_)}}catch(L){f={error:L}}finally{try{w&&!w.done&&(d=b.return)&&d.call(b)}finally{if(f)throw f.error}}try{for(var k=tn(m),E=k.next();!E.done;E=k.next()){var _=E.value;(!Eo(n,_)||Eo(i.exitSet,_.parent))&&i.exitSet.push(_)}}catch(L){u={error:L}}finally{try{E&&!E.done&&(h=k.return)&&h.call(k)}finally{if(u)throw u.error}}i.exitSet.sort(function(L,D){return D.order-L.order});var S=Array.from(g).sort(function(L,D){return L.order-D.order}),I=new Set(i.exitSet),P=An(S.map(function(L){var D=[];if(L.type!=="final")return D;var X=L.parent;if(!X.parent)return D;D.push(jf(L.id,L.doneData),jf(X.id,L.doneData?Mf(L.doneData,r,a):void 0));var J=X.parent;return J.type==="parallel"&&ko(J).every(function(ee){return Wf(i.configuration,ee)})&&D.push(jf(J.id)),D})),C=S.map(function(L){var D=L.onEntry,X=L.activities.map(function(J){return IL(J)});return{type:"entry",actions:Wi(s?xn(xn([],ln(D),!1),ln(X),!1):xn(xn([],ln(X),!1),ln(D),!1),v.machine.options.actions)}}).concat({type:"state_done",actions:P.map(function(L){return CL(L)})}),T=Array.from(I).map(function(L){return{type:"exit",actions:Wi(xn(xn([],ln(L.onExit),!1),ln(L.activities.map(function(D){return FL(D)})),!1),v.machine.options.actions)}}),N=T.concat({type:"transition",actions:Wi(i.actions,this.machine.options.actions)}).concat(C);if(t){var j=Wi(An(xn([],ln(n),!1).sort(function(L,D){return D.order-L.order}).map(function(L){return L.onExit})),this.machine.options.actions).filter(function(L){return!wc(L)});return N.concat({type:"stop",actions:j})}return N},e.prototype.transition=function(n,t,i,r){n===void 0&&(n=this.initialState);var a=Hn(t),o;if(n instanceof xt)o=i===void 0?n:this.resolveState(xt.from(n,i));else{var s=dn(n)?this.resolve(Ff(this.getResolvedPath(n))):this.resolve(n),f=i??this.machine.context;o=this.resolveState(xt.from(s,f))}if(!In&&a.name===Co)throw new Error("An event cannot have the wildcard type ('".concat(Co,"')"));if(this.strict&&!this.events.includes(a.name)&&!bL(a.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var d=this._transition(o.value,o,a)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},u=xo([],this.getStateNodes(o.value)),h=d.configuration.length?xo(u,d.configuration):u;return d.configuration=xn([],ln(h),!1),this.resolveTransition(d,o,o.context,r,a)},e.prototype.resolveRaisedTransition=function(n,t,i,r){var a,o=n.actions;return n=this.transition(n,t,void 0,r),n._event=i,n.event=i.data,(a=n.actions).unshift.apply(a,xn([],ln(o),!1)),n},e.prototype.resolveTransition=function(n,t,i,r,a){var o,s,f,d,u=this;a===void 0&&(a=ca);var h=n.configuration,v=!t||n.transitions.length>0,m=v?n.configuration:t?t.configuration:[],g=Wf(m,this),b=v?zL(this.machine,h):void 0,w=t?t.historyValue?t.historyValue:n.source?this.machine.historyValue(t.value):void 0:void 0,_=this.getActions(new Set(m),g,n,i,a,t,r),k=t?we({},t.activities):{};try{for(var E=tn(_),S=E.next();!S.done;S=E.next()){var I=S.value;try{for(var P=(f=void 0,tn(I.actions)),C=P.next();!C.done;C=P.next()){var T=C.value;T.type===hc?k[T.activity.id||T.activity.type]=T:T.type===vc&&(k[T.activity.id||T.activity.type]=!1)}}catch(ie){f={error:ie}}finally{try{C&&!C.done&&(d=P.return)&&d.call(P)}finally{if(f)throw f.error}}}}catch(ie){o={error:ie}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(o)throw o.error}}var N=ln(Uf(this,t,i,a,_,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),j=N[0],L=N[1],D=ln(wL(j,wc),2),X=D[0],J=D[1],ee=j.filter(function(ie){var pe;return ie.type===hc&&((pe=ie.activity)===null||pe===void 0?void 0:pe.type)===mc}),ae=ee.reduce(function(ie,pe){return ie[pe.activity.id]=BL(pe.activity,u.machine,L,a),ie},t?we({},t.children):{}),fe=new xt({value:b||t.value,context:L,_event:a,_sessionid:t?t._sessionid:null,historyValue:b?w?_L(w,b):void 0:t?t.historyValue:void 0,history:!b||n.source?t:void 0,actions:b?J:[],activities:b?k:t?t.activities:{},events:[],configuration:m,transitions:n.transitions,children:ae,done:g,tags:Pw(m),machine:this}),de=i!==L;fe.changed=a.name===vw||de;var oe=fe.history;oe&&delete oe.history;var me=!g&&(this._transient||h.some(function(ie){return ie._transient}));if(!v&&(!me||a.name===va))return fe;var se=fe;if(!g)for(me&&(se=this.resolveRaisedTransition(se,{type:lL},a,r));X.length;){var G=X.shift();se=this.resolveRaisedTransition(se,G._event,a,r)}var Y=se.changed||(oe?!!se.actions.length||de||typeof oe.value!=typeof se.value||!Iw(se.value,oe.value):void 0);return se.changed=Y,se.history=oe,se},e.prototype.getStateNode=function(n){if(ma(n))return this.machine.getStateNodeById(n);if(!this.states)throw new Error("Unable to retrieve child state '".concat(n,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[n];if(!t)throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(n){var t=ma(n)?n.slice(Cc.length):n;if(t===this.id)return this;var i=this.machine.idMap[t];if(!i)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return i},e.prototype.getStateNodeByPath=function(n){if(typeof n=="string"&&ma(n))try{return this.getStateNodeById(n.slice(1))}catch{}for(var t=yc(n,this.delimiter).slice(),i=this;t.length;){var r=t.shift();if(!r.length)break;i=i.getStateNode(r)}return i},e.prototype.resolve=function(n){var t,i=this;if(!n)return this.initialStateValue||pa;switch(this.type){case"parallel":return yo(this.initialStateValue,function(a,o){return a?i.getStateNode(o).resolve(n[o]||a):pa});case"compound":if(dn(n)){var r=this.getStateNode(n);return r.type==="parallel"||r.type==="compound"?(t={},t[n]=r.initialStateValue,t):n}return Object.keys(n).length?yo(n,function(a,o){return a?i.getStateNode(o).resolve(a):pa}):this.initialStateValue||{};default:return n||pa}},e.prototype.getResolvedPath=function(n){if(ma(n)){var t=this.machine.idMap[n.slice(Cc.length)];if(!t)throw new Error("Unable to find state node '".concat(n,"'"));return t.path}return yc(n,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var n;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var t;if(this.type==="parallel")t=bw(this.states,function(i){return i.initialStateValue||pa},function(i){return i.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=zf(this.states[this.initial])?this.initial:(n={},n[this.initial]=this.states[this.initial].initialStateValue,n)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(n,t){this._init();var i=this.getStateNodes(n);return this.resolveTransition({configuration:i,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,t??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var n=this.initialStateValue;if(!n)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var n;if(this.type==="history"){var t=this.config;dn(t.target)?n=ma(t.target)?Ff(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target:n=t.target}return n},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(n,t,i){return i===void 0&&(i=!0),i?n.type==="history"?n.resolveHistory(t):n.initialStateNodes:[n]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var n=this;if(zf(this))return[this];if(this.type==="compound"&&!this.initial)return In||Wn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=Nf(this.initialStateValue);return An(t.map(function(i){return n.getFromRelativePath(i)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(n){if(!n.length)return[this];var t=ln(n),i=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(i,"' from node with no states"));var a=this.getStateNode(i);if(a.type==="history")return a.resolveHistory();if(!this.states[i])throw new Error("Child state '".concat(i,"' does not exist on '").concat(this.id,"'"));return this.states[i].getFromRelativePath(r)},e.prototype.historyValue=function(n){if(Object.keys(this.states).length)return{current:n||this.initialStateValue,states:bw(this.states,function(t,i){if(!n)return t.historyValue();var r=dn(n)?void 0:n[i];return t.historyValue(r||t.initialStateValue)},function(t){return!t.history})}},e.prototype.resolveHistory=function(n){var t=this;if(this.type!=="history")return[this];var i=this.parent;if(!n){var r=this.target;return r?An(Nf(r).map(function(o){return i.getFromRelativePath(o)})):i.initialStateNodes}var a=gL(i.path,"states")(n).current;return dn(a)?[i.getStateNode(a)]:An(Nf(a).map(function(o){return t.history==="deep"?i.getFromRelativePath(o):[i.states[o[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var n=this,t=An(Object.keys(this.states).map(function(i){return n.states[i].stateIds}));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var n,t,i,r;if(this.__cache.events)return this.__cache.events;var a=this.states,o=new Set(this.ownEvents);if(a)try{for(var s=tn(Object.keys(a)),f=s.next();!f.done;f=s.next()){var d=f.value,u=a[d];if(u.states)try{for(var h=(i=void 0,tn(u.events)),v=h.next();!v.done;v=h.next()){var m=v.value;o.add("".concat(m))}}catch(g){i={error:g}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(t=s.return)&&t.call(s)}finally{if(n)throw n.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var n=new Set(this.transitions.filter(function(t){return!(!t.target&&!t.actions.length&&t.internal)}).map(function(t){return t.eventType}));return Array.from(n)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(n){var t=this;if(n!==void 0)return n.map(function(i){if(!dn(i))return i;var r=i[0]===t.delimiter;if(r&&!t.parent)return t.getStateNodeByPath(i.slice(1));var a=r?t.key+i:i;if(t.parent)try{var o=t.parent.getStateNodeByPath(a);return o}catch(s){throw new Error("Invalid transition definition for state node '".concat(t.id,`':
927
- `).concat(s.message))}else return t.getStateNodeByPath(a)})},e.prototype.formatTransition=function(n){var t=this,i=EL(n.target),r="internal"in n?n.internal:i?i.some(function(f){return dn(f)&&f[0]===t.delimiter}):!0,a=this.machine.options.guards,o=this.resolveTarget(i),s=we(we({},n),{actions:Wi(Nt(n.actions)),cond:xw(n.cond,a),target:o,source:this,internal:r,eventType:n.event,toJSON:function(){return we(we({},s),{target:s.target?s.target.map(function(f){return"#".concat(f.id)}):void 0,source:"#".concat(t.id)})}});return s},e.prototype.formatTransitions=function(){var n,t,i=this,r;if(!this.config.on)r=[];else if(Array.isArray(this.config.on))r=this.config.on;else{var a=this.config.on,o=Co,s=a[o],f=s===void 0?[]:s,d=cc(a,[typeof o=="symbol"?o:o+""]);r=An(Object.keys(d).map(function(k){!In&&k===va&&Wn(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(i.id,'".'));var E=ua(k,d[k]);return In||tB(i,k,E),E}).concat(ua(Co,f)))}var u=this.config.always?ua("",this.config.always):[],h=this.config.onDone?ua(String(jf(this.id)),this.config.onDone):[];In||Wn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=An(this.invoke.map(function(k){var E=[];return k.onDone&&E.push.apply(E,xn([],ln(ua(String(Rf(k.id)),k.onDone)),!1)),k.onError&&E.push.apply(E,xn([],ln(ua(String(_o(k.id)),k.onError)),!1)),E})),m=this.after,g=An(xn(xn(xn(xn([],ln(h),!1),ln(v),!1),ln(r),!1),ln(u),!1).map(function(k){return Nt(k).map(function(E){return i.formatTransition(E)})}));try{for(var b=tn(m),w=b.next();!w.done;w=b.next()){var _=w.value;g.push(_)}}catch(k){n={error:k}}finally{try{w&&!w.done&&(t=b.return)&&t.call(b)}finally{if(n)throw n.error}}return g},e}(),Mw=!1;function $c(e,n){return!In&&!("predictableActionArguments"in e)&&!Mw&&(Mw=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new iB(e,n)}var rt=ML,rB=l.useLayoutEffect;function Dw(e){var n=be.useRef();return n.current||(n.current={v:e()}),n.current.v}var Vf=function(){return Vf=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vf.apply(this,arguments)},aB=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]]);return t},oB=function(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],o;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a};function sB(e,n){var t=Dw(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var i=oB(l.useState(t),1),r=i[0];e!==r&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var a=n.context,o=n.guards,s=n.actions,f=n.activities,d=n.services,u=n.delays;n.state;var h=aB(n,["context","guards","actions","activities","services","delays","state"]),v=Dw(function(){var m={context:a,guards:o,actions:s,activities:f,services:d,delays:u},g=t.withConfig(m,function(){return Vf(Vf({},t.context),a)});return Nw(g,h)});return rB(function(){Object.assign(v.machine.options.actions,s),Object.assign(v.machine.options.guards,o),Object.assign(v.machine.options.activities,f),Object.assign(v.machine.options.services,d),Object.assign(v.machine.options.delays,u)},[s,o,f,d,u]),v}function fB(e,n,t){if(e.status===On.NotStarted)return!0;var i=t.changed===void 0&&(Object.keys(t.children).length>0||typeof n.changed=="boolean");return!(t.changed||i)}var lB=function(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],o;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a};function dB(e){return e}function Ac(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=lB(n,1),r=i[0],a=r===void 0?{}:r,o=sB(e,a),s=l.useCallback(function(){return o.status===On.NotStarted?a.state?xt.create(a.state):o.machine.initialState:o.getSnapshot()},[o]),f=l.useCallback(function(h,v){return fB(o,h,v)},[o]),d=l.useCallback(function(h){var v=o.subscribe(h).unsubscribe;return v},[o]),u=fL.useSyncExternalStoreWithSelector(d,s,s,dB,f);return l.useEffect(function(){var h=a.state;return o.start(h?xt.create(h):void 0),function(){o.stop(),o.status=On.NotStarted}},[]),[u,o.send,o]}const uB=$c({id:"identity",predictableActionArguments:!0,context:{identity:null,identitySubscribable:null},initial:"choosingAction",invoke:{src:e=>e.identitySubscribable},states:{choosingAction:{},managingDeviceInvitation:{},managingAgent:{initial:"idle",states:{idle:{},pending:{}}},managingDevices:{},managingProfile:{initial:"idle",states:{idle:{},pending:{}},on:{setIdentity:{target:"choosingAction",actions:["setIdentity","log"]},updateProfile:{target:".pending",actions:"log"}}},signingOut:{}},on:{unchooseAction:{target:".choosingAction",actions:["unsetInvitation","log"]},deselectInvitation:{target:".choosingAction",actions:["unsetInvitation","log"]},selectInvitation:{target:".managingDeviceInvitation",actions:["setInvitation","log"]},chooseDevices:{target:".managingDevices",actions:"log"},chooseProfile:{target:".managingProfile",actions:"log"},chooseSignOut:{target:".signingOut",actions:"log"},chooseAgent:{target:".managingAgent",actions:"log"}}},{actions:{setIdentity:rt({identity:(e,n)=>(n==null?void 0:n.identity)??null}),setInvitation:rt({invitation:(e,n)=>(n==null?void 0:n.invitation)??null}),unsetInvitation:rt({invitation:()=>{}}),log:(e,n)=>{fn("[transition]",{event:n,context:e})}}}),cB=(e,n)=>Ac(uB,{...n,context:{...n==null?void 0:n.context,identity:e.halo.identity.get(),identitySubscribable:e.halo.identity.map(t=>({type:"setIdentity",identity:t}))}}),hB=e=>{const{active:n,onAgentCreate:t,onAgentDestroy:i,send:r,validationMessage:a,agentStatus:o,agentActive:s,agentProviderDisabled:f}=e,d=!n,{t:u}=sn("os");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,null,"Agent Status"),disabled:d,"data-testid":"agent-status",value:o})),l.createElement(it,null,l.createElement(un,{disabled:s||f,onClick:()=>t==null?void 0:t(),"data-testid":"create-agent"},"Create Agent"),l.createElement(un,{disabled:!s||f,onClick:()=>i==null?void 0:i(),"data-testid":"destroy-agent"},"Destroy Agent"),l.createElement(un,{disabled:d,onClick:()=>r==null?void 0:r({type:"unchooseAction"}),"data-testid":"update-profile-form-back"},u("back label"))))},vB=({devices:e,active:n,send:t})=>{const{t:i}=sn("os"),r=!n;return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow"},l.createElement(PI,{devices:e})),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:r,onClick:()=>t==null?void 0:t({type:"unchooseAction"}),"data-testid":"manage-devices-back"},i("back label"))))},pB=e=>{const{send:n}=e,t=Ye.useClient(),i=Ki.useHaloInvitations(),r=Ye.useAgentHostingProviderClient(t.config),a=l.useCallback(s=>{const f=yi.InvitationEncoder.encode(s);s.state===_e.State.CONNECTING&&console.log(JSON.stringify({invitationCode:f,authCode:s.authCode}))},[]),o=s=>{const f=s.altKey&&s.shiftKey;i.forEach(u=>u.cancel());const d=t.halo.share(f?{type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE}:void 0);process.env.NODE_ENV!=="production"&&d.subscribe(a),n==null||n({type:"selectInvitation",invitation:d})};return l.createElement(mB,{...e,onCreateInvitationClick:s=>o(s),agentHostingEnabled:!!r})},mB=({onCreateInvitationClick:e,active:n,send:t,onDone:i,doneActionParent:r,agentHostingEnabled:a})=>{const{t:o}=sn("os");return l.createElement("div",{role:"none",className:"grow flex flex-col gap-1"},l.createElement(Rr,{density:"coarse"},l.createElement("div",{className:"grow justify-center flex flex-col gap-1"},a&&l.createElement(un,{"data-testid":"manage-agent",onClick:()=>t==null?void 0:t({type:"chooseAgent"}),classNames:"plb-4"},l.createElement(qe.HardDrive,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},"Manage Agent"),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{disabled:!n,"data-testid":"devices-panel.create-invitation",onClick:e,classNames:"plb-4"},l.createElement(qe.Plus,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose add device label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"manage-devices",onClick:()=>t==null?void 0:t({type:"chooseDevices"}),classNames:"plb-4"},l.createElement(qe.Devices,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose devices label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"manage-profile",onClick:()=>t==null?void 0:t({type:"chooseProfile"}),classNames:"plb-4"},l.createElement(qe.UserGear,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose profile label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"devices-panel.sign-out",onClick:()=>t==null?void 0:t({type:"chooseSignOut"}),classNames:"plb-4"},l.createElement(qe.Power,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose sign out label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})))))},gB=e=>{const{onUpdateProfile:n}=e,{t}=sn("os"),[i,r]=l.useState(""),a=async o=>{await(n==null?void 0:n(o).catch(s=>{fn.catch(s),r(t("failed to update profile message"))}))};return l.createElement(bB,{...e,onUpdateProfile:a,validationMessage:i})},Lw=e=>{var n;return((n=e==null?void 0:e.profile)==null?void 0:n.hue)||bI((e==null?void 0:e.identityKey.toHex())??"0")},Bw=e=>{var n;return((n=e==null?void 0:e.profile)==null?void 0:n.emoji)||ao((e==null?void 0:e.identityKey.toHex())??"0")},bB=e=>{const{active:n,identity:t,send:i,onUpdateProfile:r,validationMessage:a}=e,o=t==null?void 0:t.profile,s=!n,{t:f}=sn("os"),[d,u]=l.useState((o==null?void 0:o.displayName)??""),[h,v]=l.useState(Lw(t)),[m,g]=l.useState(Bw(t)),{textValue:b,setTextValue:w}=Jd(),_=t==null?void 0:t.identityKey.toHex(),k=b===_;return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,{className:"m-0"},f("display name input label")),disabled:s,"data-testid":"display-name-input",placeholder:f("display name input placeholder"),value:d,onChange:({target:{value:E}})=>u(E)}),l.createElement(kt,{className:"mbe-2"},f("emoji and color label")),l.createElement("div",{role:"none",className:"grid grid-cols-[1fr_min-content] gap-y-2"},l.createElement(fP,{emoji:m,onChangeEmoji:g,disabled:s,onClickClear:()=>g(Bw(t))}),l.createElement(lP,{hue:h,onChangeHue:v,disabled:s,onClickClear:()=>v(Lw(t))}))),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>{_&&w(_)},"data-testid":"update-profile-form-copy-key"},f(k?"copy success label":"copy self public key label")),l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>i==null?void 0:i({type:"unchooseAction"}),"data-testid":"update-profile-form-back"},f("back label")),l.createElement(un,{variant:"primary",disabled:s,onClick:()=>r==null?void 0:r({displayName:d,emoji:m,hue:h}),"data-testid":"update-profile-form-continue"},f("done label"))))},yB=e=>{const{t:n}=sn("os"),t=()=>{var i;window.confirm(n("reset device confirm message"))&&((i=e.onResetDevice)==null||i.call(e))};return l.createElement(wB,{disabled:!e.active,onBack:()=>{var i;return(i=e.send)==null?void 0:i.call(e,{type:"unchooseAction"})},onResetDevice:t,onJoinNewIdentity:e.onJoinNewIdentity})},wB=({disabled:e,onResetDevice:n,onJoinNewIdentity:t,onBack:i})=>{const{t:r}=sn("os");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(Ed.Root,{valence:"error"},l.createElement(Ed.Title,null,l.createElement(qe.Warning,{className:le(We(6),"inline mie-2")}),r("sign out chooser title")),l.createElement(Ed.Body,null,r("sign out chooser message")))),l.createElement(it,null,l.createElement(un,{disabled:e,onClick:i},r("back label")),l.createElement(un,{variant:"primary","data-testid":"sign-out.join-new-identity",classNames:"!bg-error-500 hover:!bg-error-550",disabled:e,onClick:t},r("join new identity label")),l.createElement(un,{variant:"primary","data-testid":"sign-out.reset-device",classNames:"!bg-error-500 hover:!bg-error-550",disabled:e,onClick:n},r("reset device label"))))},_B=({client:e,invitations:n,identity:t})=>{const[i,r]=l.useState(""),[a,o]=l.useState(""),[s,f]=l.useState(!1),d=Ye.useAgentHostingProviderClient(e.config);l.useEffect(()=>{(async()=>{if(d){const g=await(d==null?void 0:d.getAgent((t==null?void 0:t.identityKey.truncate())??"foo"));g?(f(!0),o(g)):(f(!1),r("No agent deployed via provider."))}else r("No agent provider configured.")})()},[]);const u=l.useCallback(async m=>{const g=yi.InvitationEncoder.encode(m);if(m.state===_e.State.CONNECTING&&(console.log(JSON.stringify({invitationCode:g,authCode:m.authCode})),io(t,"Identity not found"),d))try{const b=await(d==null?void 0:d.createAgent(g,t.identityKey.truncate()));o(b),f(!0),r("")}catch(b){r(`error creating agent: ${b.message}`)}},[]);return{onAgentCreate:async()=>{n.forEach(g=>g.cancel()),e.halo.share({type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE}).subscribe(u)},onAgentDestroy:async()=>{const m=e.halo.identity.get();io(m,"Identity not found");try{await(d==null?void 0:d.destroyAgent(m.identityKey.truncate())),r("No agent deployed via provider."),o(""),f(!1)}catch(g){r(`error destroying agent: ${g.message}`)}},validationMessage:i,agentStatus:a,agentActive:s}};var jw={exports:{}};(function(e,n){var t=function(){var i=function(I,P){var C=236,T=17,N=I,j=a[P],L=null,D=0,X=null,J=[],ee={},ae=function(B,W){D=N*4+17,L=function(V){for(var O=new Array(V),F=0;F<V;F+=1){O[F]=new Array(V);for(var Z=0;Z<V;Z+=1)O[F][Z]=null}return O}(D),fe(0,0),fe(D-7,0),fe(0,D-7),me(),oe(),G(B,W),N>=7&&se(B),X==null&&(X=pe(N,j,J)),Y(X,W)},fe=function(B,W){for(var V=-1;V<=7;V+=1)if(!(B+V<=-1||D<=B+V))for(var O=-1;O<=7;O+=1)W+O<=-1||D<=W+O||(0<=V&&V<=6&&(O==0||O==6)||0<=O&&O<=6&&(V==0||V==6)||2<=V&&V<=4&&2<=O&&O<=4?L[B+V][W+O]=!0:L[B+V][W+O]=!1)},de=function(){for(var B=0,W=0,V=0;V<8;V+=1){ae(!0,V);var O=s.getLostPoint(ee);(V==0||B>O)&&(B=O,W=V)}return W},oe=function(){for(var B=8;B<D-8;B+=1)L[B][6]==null&&(L[B][6]=B%2==0);for(var W=8;W<D-8;W+=1)L[6][W]==null&&(L[6][W]=W%2==0)},me=function(){for(var B=s.getPatternPosition(N),W=0;W<B.length;W+=1)for(var V=0;V<B.length;V+=1){var O=B[W],F=B[V];if(L[O][F]==null)for(var Z=-2;Z<=2;Z+=1)for(var te=-2;te<=2;te+=1)Z==-2||Z==2||te==-2||te==2||Z==0&&te==0?L[O+Z][F+te]=!0:L[O+Z][F+te]=!1}},se=function(B){for(var W=s.getBCHTypeNumber(N),V=0;V<18;V+=1){var O=!B&&(W>>V&1)==1;L[Math.floor(V/3)][V%3+D-8-3]=O}for(var V=0;V<18;V+=1){var O=!B&&(W>>V&1)==1;L[V%3+D-8-3][Math.floor(V/3)]=O}},G=function(B,W){for(var V=j<<3|W,O=s.getBCHTypeInfo(V),F=0;F<15;F+=1){var Z=!B&&(O>>F&1)==1;F<6?L[F][8]=Z:F<8?L[F+1][8]=Z:L[D-15+F][8]=Z}for(var F=0;F<15;F+=1){var Z=!B&&(O>>F&1)==1;F<8?L[8][D-F-1]=Z:F<9?L[8][15-F-1+1]=Z:L[8][15-F-1]=Z}L[D-8][8]=!B},Y=function(B,W){for(var V=-1,O=D-1,F=7,Z=0,te=s.getMaskFunction(W),he=D-1;he>0;he-=2)for(he==6&&(he-=1);;){for(var ye=0;ye<2;ye+=1)if(L[O][he-ye]==null){var xe=!1;Z<B.length&&(xe=(B[Z]>>>F&1)==1);var Ee=te(O,he-ye);Ee&&(xe=!xe),L[O][he-ye]=xe,F-=1,F==-1&&(Z+=1,F=7)}if(O+=V,O<0||D<=O){O-=V,V=-V;break}}},ie=function(B,W){for(var V=0,O=0,F=0,Z=new Array(W.length),te=new Array(W.length),he=0;he<W.length;he+=1){var ye=W[he].dataCount,xe=W[he].totalCount-ye;O=Math.max(O,ye),F=Math.max(F,xe),Z[he]=new Array(ye);for(var Ee=0;Ee<Z[he].length;Ee+=1)Z[he][Ee]=255&B.getBuffer()[Ee+V];V+=ye;var re=s.getErrorCorrectPolynomial(xe),Be=d(Z[he],re.getLength()-1),hn=Be.mod(re);te[he]=new Array(re.getLength()-1);for(var Ee=0;Ee<te[he].length;Ee+=1){var Te=Ee+hn.getLength()-te[he].length;te[he][Ee]=Te>=0?hn.getAt(Te):0}}for(var ze=0,Ee=0;Ee<W.length;Ee+=1)ze+=W[Ee].totalCount;for(var yn=new Array(ze),Se=0,Ee=0;Ee<O;Ee+=1)for(var he=0;he<W.length;he+=1)Ee<Z[he].length&&(yn[Se]=Z[he][Ee],Se+=1);for(var Ee=0;Ee<F;Ee+=1)for(var he=0;he<W.length;he+=1)Ee<te[he].length&&(yn[Se]=te[he][Ee],Se+=1);return yn},pe=function(B,W,V){for(var O=u.getRSBlocks(B,W),F=h(),Z=0;Z<V.length;Z+=1){var te=V[Z];F.put(te.getMode(),4),F.put(te.getLength(),s.getLengthInBits(te.getMode(),B)),te.write(F)}for(var he=0,Z=0;Z<O.length;Z+=1)he+=O[Z].dataCount;if(F.getLengthInBits()>he*8)throw"code length overflow. ("+F.getLengthInBits()+">"+he*8+")";for(F.getLengthInBits()+4<=he*8&&F.put(0,4);F.getLengthInBits()%8!=0;)F.putBit(!1);for(;!(F.getLengthInBits()>=he*8||(F.put(C,8),F.getLengthInBits()>=he*8));)F.put(T,8);return ie(F,O)};ee.addData=function(B,W){W=W||"Byte";var V=null;switch(W){case"Numeric":V=v(B);break;case"Alphanumeric":V=m(B);break;case"Byte":V=g(B);break;case"Kanji":V=b(B);break;default:throw"mode:"+W}J.push(V),X=null},ee.isDark=function(B,W){if(B<0||D<=B||W<0||D<=W)throw B+","+W;return L[B][W]},ee.getModuleCount=function(){return D},ee.make=function(){if(N<1){for(var B=1;B<40;B++){for(var W=u.getRSBlocks(B,j),V=h(),O=0;O<J.length;O++){var F=J[O];V.put(F.getMode(),4),V.put(F.getLength(),s.getLengthInBits(F.getMode(),B)),F.write(V)}for(var Z=0,O=0;O<W.length;O++)Z+=W[O].dataCount;if(V.getLengthInBits()<=Z*8)break}N=B}ae(!1,de())},ee.createTableTag=function(B,W){B=B||2,W=typeof W>"u"?B*4:W;var V="";V+='<table style="',V+=" border-width: 0px; border-style: none;",V+=" border-collapse: collapse;",V+=" padding: 0px; margin: "+W+"px;",V+='">',V+="<tbody>";for(var O=0;O<ee.getModuleCount();O+=1){V+="<tr>";for(var F=0;F<ee.getModuleCount();F+=1)V+='<td style="',V+=" border-width: 0px; border-style: none;",V+=" border-collapse: collapse;",V+=" padding: 0px; margin: 0px;",V+=" width: "+B+"px;",V+=" height: "+B+"px;",V+=" background-color: ",V+=ee.isDark(O,F)?"#000000":"#ffffff",V+=";",V+='"/>';V+="</tr>"}return V+="</tbody>",V+="</table>",V},ee.createSvgTag=function(B,W,V,O){var F={};typeof arguments[0]=="object"&&(F=arguments[0],B=F.cellSize,W=F.margin,V=F.alt,O=F.title),B=B||2,W=typeof W>"u"?B*4:W,V=typeof V=="string"?{text:V}:V||{},V.text=V.text||null,V.id=V.text?V.id||"qrcode-description":null,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-title":null;var Z=ee.getModuleCount()*B+W*2,te,he,ye,xe,Ee="",re;for(re="l"+B+",0 0,"+B+" -"+B+",0 0,-"+B+"z ",Ee+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Ee+=F.scalable?"":' width="'+Z+'px" height="'+Z+'px"',Ee+=' viewBox="0 0 '+Z+" "+Z+'" ',Ee+=' preserveAspectRatio="xMinYMin meet"',Ee+=O.text||V.text?' role="img" aria-labelledby="'+H([O.id,V.id].join(" ").trim())+'"':"",Ee+=">",Ee+=O.text?'<title id="'+H(O.id)+'">'+H(O.text)+"</title>":"",Ee+=V.text?'<description id="'+H(V.id)+'">'+H(V.text)+"</description>":"",Ee+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Ee+='<path d="',ye=0;ye<ee.getModuleCount();ye+=1)for(xe=ye*B+W,te=0;te<ee.getModuleCount();te+=1)ee.isDark(ye,te)&&(he=te*B+W,Ee+="M"+he+","+xe+re);return Ee+='" stroke="transparent" fill="black"/>',Ee+="</svg>",Ee},ee.createDataURL=function(B,W){B=B||2,W=typeof W>"u"?B*4:W;var V=ee.getModuleCount()*B+W*2,O=W,F=V-W;return S(V,V,function(Z,te){if(O<=Z&&Z<F&&O<=te&&te<F){var he=Math.floor((Z-O)/B),ye=Math.floor((te-O)/B);return ee.isDark(ye,he)?0:1}else return 1})},ee.createImgTag=function(B,W,V){B=B||2,W=typeof W>"u"?B*4:W;var O=ee.getModuleCount()*B+W*2,F="";return F+="<img",F+=' src="',F+=ee.createDataURL(B,W),F+='"',F+=' width="',F+=O,F+='"',F+=' height="',F+=O,F+='"',V&&(F+=' alt="',F+=H(V),F+='"'),F+="/>",F};var H=function(B){for(var W="",V=0;V<B.length;V+=1){var O=B.charAt(V);switch(O){case"<":W+="&lt;";break;case">":W+="&gt;";break;case"&":W+="&amp;";break;case'"':W+="&quot;";break;default:W+=O;break}}return W},K=function(B){var W=1;B=typeof B>"u"?W*2:B;var V=ee.getModuleCount()*W+B*2,O=B,F=V-B,Z,te,he,ye,xe,Ee={"โ–ˆโ–ˆ":"โ–ˆ","โ–ˆ ":"โ–€"," โ–ˆ":"โ–„"," ":" "},re={"โ–ˆโ–ˆ":"โ–€","โ–ˆ ":"โ–€"," โ–ˆ":" "," ":" "},Be="";for(Z=0;Z<V;Z+=2){for(he=Math.floor((Z-O)/W),ye=Math.floor((Z+1-O)/W),te=0;te<V;te+=1)xe="โ–ˆ",O<=te&&te<F&&O<=Z&&Z<F&&ee.isDark(he,Math.floor((te-O)/W))&&(xe=" "),O<=te&&te<F&&O<=Z+1&&Z+1<F&&ee.isDark(ye,Math.floor((te-O)/W))?xe+=" ":xe+="โ–ˆ",Be+=B<1&&Z+1>=F?re[xe]:Ee[xe];Be+=`
927
+ `).concat(s.message))}else return t.getStateNodeByPath(a)})},e.prototype.formatTransition=function(n){var t=this,i=EL(n.target),r="internal"in n?n.internal:i?i.some(function(f){return dn(f)&&f[0]===t.delimiter}):!0,a=this.machine.options.guards,o=this.resolveTarget(i),s=we(we({},n),{actions:Wi(Nt(n.actions)),cond:xw(n.cond,a),target:o,source:this,internal:r,eventType:n.event,toJSON:function(){return we(we({},s),{target:s.target?s.target.map(function(f){return"#".concat(f.id)}):void 0,source:"#".concat(t.id)})}});return s},e.prototype.formatTransitions=function(){var n,t,i=this,r;if(!this.config.on)r=[];else if(Array.isArray(this.config.on))r=this.config.on;else{var a=this.config.on,o=Co,s=a[o],f=s===void 0?[]:s,d=cc(a,[typeof o=="symbol"?o:o+""]);r=An(Object.keys(d).map(function(k){!In&&k===va&&Wn(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(i.id,'".'));var E=ua(k,d[k]);return In||tB(i,k,E),E}).concat(ua(Co,f)))}var u=this.config.always?ua("",this.config.always):[],h=this.config.onDone?ua(String(jf(this.id)),this.config.onDone):[];In||Wn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=An(this.invoke.map(function(k){var E=[];return k.onDone&&E.push.apply(E,xn([],ln(ua(String(Rf(k.id)),k.onDone)),!1)),k.onError&&E.push.apply(E,xn([],ln(ua(String(_o(k.id)),k.onError)),!1)),E})),m=this.after,g=An(xn(xn(xn(xn([],ln(h),!1),ln(v),!1),ln(r),!1),ln(u),!1).map(function(k){return Nt(k).map(function(E){return i.formatTransition(E)})}));try{for(var b=tn(m),w=b.next();!w.done;w=b.next()){var _=w.value;g.push(_)}}catch(k){n={error:k}}finally{try{w&&!w.done&&(t=b.return)&&t.call(b)}finally{if(n)throw n.error}}return g},e}(),Mw=!1;function $c(e,n){return!In&&!("predictableActionArguments"in e)&&!Mw&&(Mw=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new iB(e,n)}var rt=ML,rB=l.useLayoutEffect;function Dw(e){var n=be.useRef();return n.current||(n.current={v:e()}),n.current.v}var Vf=function(){return Vf=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vf.apply(this,arguments)},aB=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]]);return t},oB=function(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],o;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a};function sB(e,n){var t=Dw(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var i=oB(l.useState(t),1),r=i[0];e!==r&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var a=n.context,o=n.guards,s=n.actions,f=n.activities,d=n.services,u=n.delays;n.state;var h=aB(n,["context","guards","actions","activities","services","delays","state"]),v=Dw(function(){var m={context:a,guards:o,actions:s,activities:f,services:d,delays:u},g=t.withConfig(m,function(){return Vf(Vf({},t.context),a)});return Nw(g,h)});return rB(function(){Object.assign(v.machine.options.actions,s),Object.assign(v.machine.options.guards,o),Object.assign(v.machine.options.activities,f),Object.assign(v.machine.options.services,d),Object.assign(v.machine.options.delays,u)},[s,o,f,d,u]),v}function fB(e,n,t){if(e.status===On.NotStarted)return!0;var i=t.changed===void 0&&(Object.keys(t.children).length>0||typeof n.changed=="boolean");return!(t.changed||i)}var lB=function(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],o;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a};function dB(e){return e}function Ac(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=lB(n,1),r=i[0],a=r===void 0?{}:r,o=sB(e,a),s=l.useCallback(function(){return o.status===On.NotStarted?a.state?xt.create(a.state):o.machine.initialState:o.getSnapshot()},[o]),f=l.useCallback(function(h,v){return fB(o,h,v)},[o]),d=l.useCallback(function(h){var v=o.subscribe(h).unsubscribe;return v},[o]),u=fL.useSyncExternalStoreWithSelector(d,s,s,dB,f);return l.useEffect(function(){var h=a.state;return o.start(h?xt.create(h):void 0),function(){o.stop(),o.status=On.NotStarted}},[]),[u,o.send,o]}const uB=$c({id:"identity",predictableActionArguments:!0,context:{identity:null,identitySubscribable:null},initial:"choosingAction",invoke:{src:e=>e.identitySubscribable},states:{choosingAction:{},managingDeviceInvitation:{},managingAgent:{initial:"idle",states:{idle:{},pending:{}}},managingDevices:{},managingProfile:{initial:"idle",states:{idle:{},pending:{}},on:{setIdentity:{target:"choosingAction",actions:["setIdentity","log"]},updateProfile:{target:".pending",actions:"log"}}},signingOut:{}},on:{unchooseAction:{target:".choosingAction",actions:["unsetInvitation","log"]},deselectInvitation:{target:".choosingAction",actions:["unsetInvitation","log"]},selectInvitation:{target:".managingDeviceInvitation",actions:["setInvitation","log"]},chooseDevices:{target:".managingDevices",actions:"log"},chooseProfile:{target:".managingProfile",actions:"log"},chooseSignOut:{target:".signingOut",actions:"log"},chooseAgent:{target:".managingAgent",actions:"log"}}},{actions:{setIdentity:rt({identity:(e,n)=>(n==null?void 0:n.identity)??null}),setInvitation:rt({invitation:(e,n)=>(n==null?void 0:n.invitation)??null}),unsetInvitation:rt({invitation:()=>{}}),log:(e,n)=>{fn("[transition]",{event:n,context:e})}}}),cB=(e,n)=>Ac(uB,{...n,context:{...n==null?void 0:n.context,identity:e.halo.identity.get(),identitySubscribable:e.halo.identity.map(t=>({type:"setIdentity",identity:t}))}}),hB=e=>{const{active:n,onAgentCreate:t,onAgentDestroy:i,send:r,validationMessage:a,agentStatus:o,agentActive:s,agentProviderDisabled:f}=e,d=!n,{t:u}=sn("os");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,null,"Agent Status"),disabled:d,"data-testid":"agent-status",value:o})),l.createElement(it,null,l.createElement(un,{disabled:s||f,onClick:()=>t==null?void 0:t(),"data-testid":"create-agent"},"Create Agent"),l.createElement(un,{disabled:!s||f,onClick:()=>i==null?void 0:i(),"data-testid":"destroy-agent"},"Destroy Agent"),l.createElement(un,{disabled:d,onClick:()=>r==null?void 0:r({type:"unchooseAction"}),"data-testid":"update-profile-form-back"},u("back label"))))},vB=({devices:e,active:n,send:t})=>{const{t:i}=sn("os"),r=!n;return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow"},l.createElement(PI,{devices:e})),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:r,onClick:()=>t==null?void 0:t({type:"unchooseAction"}),"data-testid":"manage-devices-back"},i("back label"))))},pB=e=>{const{send:n}=e,t=Ye.useClient(),i=Ki.useHaloInvitations(),r=Ye.useAgentHostingProviderClient(t.config),a=l.useCallback(s=>{const f=yi.InvitationEncoder.encode(s);s.state===_e.State.CONNECTING&&console.log(JSON.stringify({invitationCode:f,authCode:s.authCode}))},[]),o=s=>{const f=s.altKey&&s.shiftKey;i.forEach(u=>u.cancel());const d=t.halo.share(f?{type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE}:void 0);process.env.NODE_ENV!=="production"&&d.subscribe(a),n==null||n({type:"selectInvitation",invitation:d})};return l.createElement(mB,{...e,onCreateInvitationClick:s=>o(s),agentHostingEnabled:!!r})},mB=({onCreateInvitationClick:e,active:n,send:t,onDone:i,doneActionParent:r,agentHostingEnabled:a})=>{const{t:o}=sn("os");return l.createElement("div",{role:"none",className:"grow flex flex-col gap-1"},l.createElement(Rr,{density:"coarse"},l.createElement("div",{className:"grow justify-center flex flex-col gap-1"},a&&l.createElement(un,{"data-testid":"manage-agent",onClick:()=>t==null?void 0:t({type:"chooseAgent"}),classNames:"plb-4"},l.createElement(qe.HardDrive,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},"Manage Agent"),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{disabled:!n,"data-testid":"devices-panel.create-invitation",onClick:e,classNames:"plb-4"},l.createElement(qe.Plus,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose add device label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"manage-devices",onClick:()=>t==null?void 0:t({type:"chooseDevices"}),classNames:"plb-4"},l.createElement(qe.Devices,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose devices label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"manage-profile",onClick:()=>t==null?void 0:t({type:"chooseProfile"}),classNames:"plb-4"},l.createElement(qe.UserGear,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose profile label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})),l.createElement(un,{"data-testid":"devices-panel.sign-out",onClick:()=>t==null?void 0:t({type:"chooseSignOut"}),classNames:"plb-4"},l.createElement(qe.Power,{className:We(6)}),l.createElement("span",{className:"grow mli-3"},o("choose sign out label")),l.createElement(qe.CaretRight,{weight:"bold",className:We(4)})))))},gB=e=>{const{onUpdateProfile:n}=e,{t}=sn("os"),[i,r]=l.useState(""),a=async o=>{await(n==null?void 0:n(o).catch(s=>{fn.catch(s),r(t("failed to update profile message"))}))};return l.createElement(bB,{...e,onUpdateProfile:a,validationMessage:i})},Lw=e=>{var n,t;return((t=(n=e==null?void 0:e.profile)==null?void 0:n.data)==null?void 0:t.hue)||bI((e==null?void 0:e.identityKey.toHex())??"0")},Bw=e=>{var n,t;return((t=(n=e==null?void 0:e.profile)==null?void 0:n.data)==null?void 0:t.emoji)||ao((e==null?void 0:e.identityKey.toHex())??"0")},bB=e=>{const{active:n,identity:t,send:i,onUpdateProfile:r,validationMessage:a}=e,o=t==null?void 0:t.profile,s=!n,{t:f}=sn("os"),[d,u]=l.useState((o==null?void 0:o.displayName)??""),[h,v]=l.useState(Lw(t)),[m,g]=l.useState(Bw(t)),{textValue:b,setTextValue:w}=Jd(),_=t==null?void 0:t.identityKey.toHex(),k=b===_;return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,{className:"m-0"},f("display name input label")),disabled:s,"data-testid":"display-name-input",placeholder:f("display name input placeholder"),value:d,onChange:({target:{value:E}})=>u(E)}),l.createElement(kt,{className:"mbe-2"},f("emoji and color label")),l.createElement("div",{role:"none",className:"grid grid-cols-[1fr_min-content] gap-y-2"},l.createElement(fP,{emoji:m,onChangeEmoji:g,disabled:s,onClickClear:()=>g(Bw(t))}),l.createElement(lP,{hue:h,onChangeHue:v,disabled:s,onClickClear:()=>v(Lw(t))}))),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>{_&&w(_)},"data-testid":"update-profile-form-copy-key"},f(k?"copy success label":"copy self public key label")),l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>i==null?void 0:i({type:"unchooseAction"}),"data-testid":"update-profile-form-back"},f("back label")),l.createElement(un,{variant:"primary",disabled:s,onClick:()=>r==null?void 0:r({displayName:d,data:{emoji:m,hue:h}}),"data-testid":"update-profile-form-continue"},f("done label"))))},yB=e=>{const{t:n}=sn("os"),t=()=>{var i;window.confirm(n("reset device confirm message"))&&((i=e.onResetDevice)==null||i.call(e))};return l.createElement(wB,{disabled:!e.active,onBack:()=>{var i;return(i=e.send)==null?void 0:i.call(e,{type:"unchooseAction"})},onResetDevice:t,onJoinNewIdentity:e.onJoinNewIdentity})},wB=({disabled:e,onResetDevice:n,onJoinNewIdentity:t,onBack:i})=>{const{t:r}=sn("os");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(Ed.Root,{valence:"error"},l.createElement(Ed.Title,null,l.createElement(qe.Warning,{className:le(We(6),"inline mie-2")}),r("sign out chooser title")),l.createElement(Ed.Body,null,r("sign out chooser message")))),l.createElement(it,null,l.createElement(un,{disabled:e,onClick:i},r("back label")),l.createElement(un,{variant:"primary","data-testid":"sign-out.join-new-identity",classNames:"!bg-error-500 hover:!bg-error-550",disabled:e,onClick:t},r("join new identity label")),l.createElement(un,{variant:"primary","data-testid":"sign-out.reset-device",classNames:"!bg-error-500 hover:!bg-error-550",disabled:e,onClick:n},r("reset device label"))))},_B=({client:e,invitations:n,identity:t})=>{const[i,r]=l.useState(""),[a,o]=l.useState(""),[s,f]=l.useState(!1),d=Ye.useAgentHostingProviderClient(e.config);l.useEffect(()=>{(async()=>{if(d){const g=await(d==null?void 0:d.getAgent((t==null?void 0:t.identityKey.truncate())??"foo"));g?(f(!0),o(g)):(f(!1),r("No agent deployed via provider."))}else r("No agent provider configured.")})()},[]);const u=l.useCallback(async m=>{const g=yi.InvitationEncoder.encode(m);if(m.state===_e.State.CONNECTING&&(console.log(JSON.stringify({invitationCode:g,authCode:m.authCode})),io(t,"Identity not found"),d))try{const b=await(d==null?void 0:d.createAgent(g,t.identityKey.truncate()));o(b),f(!0),r("")}catch(b){r(`error creating agent: ${b.message}`)}},[]);return{onAgentCreate:async()=>{n.forEach(g=>g.cancel()),e.halo.share({type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE}).subscribe(u)},onAgentDestroy:async()=>{const m=e.halo.identity.get();io(m,"Identity not found");try{await(d==null?void 0:d.destroyAgent(m.identityKey.truncate())),r("No agent deployed via provider."),o(""),f(!1)}catch(g){r(`error destroying agent: ${g.message}`)}},validationMessage:i,agentStatus:a,agentActive:s}};var jw={exports:{}};(function(e,n){var t=function(){var i=function(I,P){var C=236,T=17,N=I,j=a[P],L=null,D=0,X=null,J=[],ee={},ae=function(B,W){D=N*4+17,L=function(V){for(var O=new Array(V),F=0;F<V;F+=1){O[F]=new Array(V);for(var Z=0;Z<V;Z+=1)O[F][Z]=null}return O}(D),fe(0,0),fe(D-7,0),fe(0,D-7),me(),oe(),G(B,W),N>=7&&se(B),X==null&&(X=pe(N,j,J)),Y(X,W)},fe=function(B,W){for(var V=-1;V<=7;V+=1)if(!(B+V<=-1||D<=B+V))for(var O=-1;O<=7;O+=1)W+O<=-1||D<=W+O||(0<=V&&V<=6&&(O==0||O==6)||0<=O&&O<=6&&(V==0||V==6)||2<=V&&V<=4&&2<=O&&O<=4?L[B+V][W+O]=!0:L[B+V][W+O]=!1)},de=function(){for(var B=0,W=0,V=0;V<8;V+=1){ae(!0,V);var O=s.getLostPoint(ee);(V==0||B>O)&&(B=O,W=V)}return W},oe=function(){for(var B=8;B<D-8;B+=1)L[B][6]==null&&(L[B][6]=B%2==0);for(var W=8;W<D-8;W+=1)L[6][W]==null&&(L[6][W]=W%2==0)},me=function(){for(var B=s.getPatternPosition(N),W=0;W<B.length;W+=1)for(var V=0;V<B.length;V+=1){var O=B[W],F=B[V];if(L[O][F]==null)for(var Z=-2;Z<=2;Z+=1)for(var te=-2;te<=2;te+=1)Z==-2||Z==2||te==-2||te==2||Z==0&&te==0?L[O+Z][F+te]=!0:L[O+Z][F+te]=!1}},se=function(B){for(var W=s.getBCHTypeNumber(N),V=0;V<18;V+=1){var O=!B&&(W>>V&1)==1;L[Math.floor(V/3)][V%3+D-8-3]=O}for(var V=0;V<18;V+=1){var O=!B&&(W>>V&1)==1;L[V%3+D-8-3][Math.floor(V/3)]=O}},G=function(B,W){for(var V=j<<3|W,O=s.getBCHTypeInfo(V),F=0;F<15;F+=1){var Z=!B&&(O>>F&1)==1;F<6?L[F][8]=Z:F<8?L[F+1][8]=Z:L[D-15+F][8]=Z}for(var F=0;F<15;F+=1){var Z=!B&&(O>>F&1)==1;F<8?L[8][D-F-1]=Z:F<9?L[8][15-F-1+1]=Z:L[8][15-F-1]=Z}L[D-8][8]=!B},Y=function(B,W){for(var V=-1,O=D-1,F=7,Z=0,te=s.getMaskFunction(W),he=D-1;he>0;he-=2)for(he==6&&(he-=1);;){for(var ye=0;ye<2;ye+=1)if(L[O][he-ye]==null){var xe=!1;Z<B.length&&(xe=(B[Z]>>>F&1)==1);var Ee=te(O,he-ye);Ee&&(xe=!xe),L[O][he-ye]=xe,F-=1,F==-1&&(Z+=1,F=7)}if(O+=V,O<0||D<=O){O-=V,V=-V;break}}},ie=function(B,W){for(var V=0,O=0,F=0,Z=new Array(W.length),te=new Array(W.length),he=0;he<W.length;he+=1){var ye=W[he].dataCount,xe=W[he].totalCount-ye;O=Math.max(O,ye),F=Math.max(F,xe),Z[he]=new Array(ye);for(var Ee=0;Ee<Z[he].length;Ee+=1)Z[he][Ee]=255&B.getBuffer()[Ee+V];V+=ye;var re=s.getErrorCorrectPolynomial(xe),Be=d(Z[he],re.getLength()-1),hn=Be.mod(re);te[he]=new Array(re.getLength()-1);for(var Ee=0;Ee<te[he].length;Ee+=1){var Te=Ee+hn.getLength()-te[he].length;te[he][Ee]=Te>=0?hn.getAt(Te):0}}for(var ze=0,Ee=0;Ee<W.length;Ee+=1)ze+=W[Ee].totalCount;for(var yn=new Array(ze),Se=0,Ee=0;Ee<O;Ee+=1)for(var he=0;he<W.length;he+=1)Ee<Z[he].length&&(yn[Se]=Z[he][Ee],Se+=1);for(var Ee=0;Ee<F;Ee+=1)for(var he=0;he<W.length;he+=1)Ee<te[he].length&&(yn[Se]=te[he][Ee],Se+=1);return yn},pe=function(B,W,V){for(var O=u.getRSBlocks(B,W),F=h(),Z=0;Z<V.length;Z+=1){var te=V[Z];F.put(te.getMode(),4),F.put(te.getLength(),s.getLengthInBits(te.getMode(),B)),te.write(F)}for(var he=0,Z=0;Z<O.length;Z+=1)he+=O[Z].dataCount;if(F.getLengthInBits()>he*8)throw"code length overflow. ("+F.getLengthInBits()+">"+he*8+")";for(F.getLengthInBits()+4<=he*8&&F.put(0,4);F.getLengthInBits()%8!=0;)F.putBit(!1);for(;!(F.getLengthInBits()>=he*8||(F.put(C,8),F.getLengthInBits()>=he*8));)F.put(T,8);return ie(F,O)};ee.addData=function(B,W){W=W||"Byte";var V=null;switch(W){case"Numeric":V=v(B);break;case"Alphanumeric":V=m(B);break;case"Byte":V=g(B);break;case"Kanji":V=b(B);break;default:throw"mode:"+W}J.push(V),X=null},ee.isDark=function(B,W){if(B<0||D<=B||W<0||D<=W)throw B+","+W;return L[B][W]},ee.getModuleCount=function(){return D},ee.make=function(){if(N<1){for(var B=1;B<40;B++){for(var W=u.getRSBlocks(B,j),V=h(),O=0;O<J.length;O++){var F=J[O];V.put(F.getMode(),4),V.put(F.getLength(),s.getLengthInBits(F.getMode(),B)),F.write(V)}for(var Z=0,O=0;O<W.length;O++)Z+=W[O].dataCount;if(V.getLengthInBits()<=Z*8)break}N=B}ae(!1,de())},ee.createTableTag=function(B,W){B=B||2,W=typeof W>"u"?B*4:W;var V="";V+='<table style="',V+=" border-width: 0px; border-style: none;",V+=" border-collapse: collapse;",V+=" padding: 0px; margin: "+W+"px;",V+='">',V+="<tbody>";for(var O=0;O<ee.getModuleCount();O+=1){V+="<tr>";for(var F=0;F<ee.getModuleCount();F+=1)V+='<td style="',V+=" border-width: 0px; border-style: none;",V+=" border-collapse: collapse;",V+=" padding: 0px; margin: 0px;",V+=" width: "+B+"px;",V+=" height: "+B+"px;",V+=" background-color: ",V+=ee.isDark(O,F)?"#000000":"#ffffff",V+=";",V+='"/>';V+="</tr>"}return V+="</tbody>",V+="</table>",V},ee.createSvgTag=function(B,W,V,O){var F={};typeof arguments[0]=="object"&&(F=arguments[0],B=F.cellSize,W=F.margin,V=F.alt,O=F.title),B=B||2,W=typeof W>"u"?B*4:W,V=typeof V=="string"?{text:V}:V||{},V.text=V.text||null,V.id=V.text?V.id||"qrcode-description":null,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-title":null;var Z=ee.getModuleCount()*B+W*2,te,he,ye,xe,Ee="",re;for(re="l"+B+",0 0,"+B+" -"+B+",0 0,-"+B+"z ",Ee+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Ee+=F.scalable?"":' width="'+Z+'px" height="'+Z+'px"',Ee+=' viewBox="0 0 '+Z+" "+Z+'" ',Ee+=' preserveAspectRatio="xMinYMin meet"',Ee+=O.text||V.text?' role="img" aria-labelledby="'+H([O.id,V.id].join(" ").trim())+'"':"",Ee+=">",Ee+=O.text?'<title id="'+H(O.id)+'">'+H(O.text)+"</title>":"",Ee+=V.text?'<description id="'+H(V.id)+'">'+H(V.text)+"</description>":"",Ee+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Ee+='<path d="',ye=0;ye<ee.getModuleCount();ye+=1)for(xe=ye*B+W,te=0;te<ee.getModuleCount();te+=1)ee.isDark(ye,te)&&(he=te*B+W,Ee+="M"+he+","+xe+re);return Ee+='" stroke="transparent" fill="black"/>',Ee+="</svg>",Ee},ee.createDataURL=function(B,W){B=B||2,W=typeof W>"u"?B*4:W;var V=ee.getModuleCount()*B+W*2,O=W,F=V-W;return S(V,V,function(Z,te){if(O<=Z&&Z<F&&O<=te&&te<F){var he=Math.floor((Z-O)/B),ye=Math.floor((te-O)/B);return ee.isDark(ye,he)?0:1}else return 1})},ee.createImgTag=function(B,W,V){B=B||2,W=typeof W>"u"?B*4:W;var O=ee.getModuleCount()*B+W*2,F="";return F+="<img",F+=' src="',F+=ee.createDataURL(B,W),F+='"',F+=' width="',F+=O,F+='"',F+=' height="',F+=O,F+='"',V&&(F+=' alt="',F+=H(V),F+='"'),F+="/>",F};var H=function(B){for(var W="",V=0;V<B.length;V+=1){var O=B.charAt(V);switch(O){case"<":W+="&lt;";break;case">":W+="&gt;";break;case"&":W+="&amp;";break;case'"':W+="&quot;";break;default:W+=O;break}}return W},K=function(B){var W=1;B=typeof B>"u"?W*2:B;var V=ee.getModuleCount()*W+B*2,O=B,F=V-B,Z,te,he,ye,xe,Ee={"โ–ˆโ–ˆ":"โ–ˆ","โ–ˆ ":"โ–€"," โ–ˆ":"โ–„"," ":" "},re={"โ–ˆโ–ˆ":"โ–€","โ–ˆ ":"โ–€"," โ–ˆ":" "," ":" "},Be="";for(Z=0;Z<V;Z+=2){for(he=Math.floor((Z-O)/W),ye=Math.floor((Z+1-O)/W),te=0;te<V;te+=1)xe="โ–ˆ",O<=te&&te<F&&O<=Z&&Z<F&&ee.isDark(he,Math.floor((te-O)/W))&&(xe=" "),O<=te&&te<F&&O<=Z+1&&Z+1<F&&ee.isDark(ye,Math.floor((te-O)/W))?xe+=" ":xe+="โ–ˆ",Be+=B<1&&Z+1>=F?re[xe]:Ee[xe];Be+=`
928
928
  `}return V%2&&B>0?Be.substring(0,Be.length-V-1)+Array(V+1).join("โ–€"):Be.substring(0,Be.length-1)};return ee.createASCII=function(B,W){if(B=B||1,B<2)return K(W);B-=1,W=typeof W>"u"?B*2:W;var V=ee.getModuleCount()*B+W*2,O=W,F=V-W,Z,te,he,ye,xe=Array(B+1).join("โ–ˆโ–ˆ"),Ee=Array(B+1).join(" "),re="",Be="";for(Z=0;Z<V;Z+=1){for(he=Math.floor((Z-O)/B),Be="",te=0;te<V;te+=1)ye=1,O<=te&&te<F&&O<=Z&&Z<F&&ee.isDark(he,Math.floor((te-O)/B))&&(ye=0),Be+=ye?xe:Ee;for(he=0;he<B;he+=1)re+=Be+`
929
- `}return re.substring(0,re.length-1)},ee.renderTo2dContext=function(B,W){W=W||2;for(var V=ee.getModuleCount(),O=0;O<V;O++)for(var F=0;F<V;F++)B.fillStyle=ee.isDark(O,F)?"black":"white",B.fillRect(O*W,F*W,W,W)},ee};i.stringToBytesFuncs={default:function(I){for(var P=[],C=0;C<I.length;C+=1){var T=I.charCodeAt(C);P.push(T&255)}return P}},i.stringToBytes=i.stringToBytesFuncs.default,i.createStringToBytes=function(I,P){var C=function(){for(var N=k(I),j=function(){var oe=N.read();if(oe==-1)throw"eof";return oe},L=0,D={};;){var X=N.read();if(X==-1)break;var J=j(),ee=j(),ae=j(),fe=String.fromCharCode(X<<8|J),de=ee<<8|ae;D[fe]=de,L+=1}if(L!=P)throw L+" != "+P;return D}(),T=63;return function(N){for(var j=[],L=0;L<N.length;L+=1){var D=N.charCodeAt(L);if(D<128)j.push(D);else{var X=C[N.charAt(L)];typeof X=="number"?(X&255)==X?j.push(X):(j.push(X>>>8),j.push(X&255)):j.push(T)}}return j}};var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},a={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var I=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],P=1335,C=7973,T=21522,N={},j=function(L){for(var D=0;L!=0;)D+=1,L>>>=1;return D};return N.getBCHTypeInfo=function(L){for(var D=L<<10;j(D)-j(P)>=0;)D^=P<<j(D)-j(P);return(L<<10|D)^T},N.getBCHTypeNumber=function(L){for(var D=L<<12;j(D)-j(C)>=0;)D^=C<<j(D)-j(C);return L<<12|D},N.getPatternPosition=function(L){return I[L-1]},N.getMaskFunction=function(L){switch(L){case o.PATTERN000:return function(D,X){return(D+X)%2==0};case o.PATTERN001:return function(D,X){return D%2==0};case o.PATTERN010:return function(D,X){return X%3==0};case o.PATTERN011:return function(D,X){return(D+X)%3==0};case o.PATTERN100:return function(D,X){return(Math.floor(D/2)+Math.floor(X/3))%2==0};case o.PATTERN101:return function(D,X){return D*X%2+D*X%3==0};case o.PATTERN110:return function(D,X){return(D*X%2+D*X%3)%2==0};case o.PATTERN111:return function(D,X){return(D*X%3+(D+X)%2)%2==0};default:throw"bad maskPattern:"+L}},N.getErrorCorrectPolynomial=function(L){for(var D=d([1],0),X=0;X<L;X+=1)D=D.multiply(d([1,f.gexp(X)],0));return D},N.getLengthInBits=function(L,D){if(1<=D&&D<10)switch(L){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw"mode:"+L}else if(D<27)switch(L){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw"mode:"+L}else if(D<41)switch(L){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw"mode:"+L}else throw"type:"+D},N.getLostPoint=function(L){for(var D=L.getModuleCount(),X=0,J=0;J<D;J+=1)for(var ee=0;ee<D;ee+=1){for(var ae=0,fe=L.isDark(J,ee),de=-1;de<=1;de+=1)if(!(J+de<0||D<=J+de))for(var oe=-1;oe<=1;oe+=1)ee+oe<0||D<=ee+oe||de==0&&oe==0||fe==L.isDark(J+de,ee+oe)&&(ae+=1);ae>5&&(X+=3+ae-5)}for(var J=0;J<D-1;J+=1)for(var ee=0;ee<D-1;ee+=1){var me=0;L.isDark(J,ee)&&(me+=1),L.isDark(J+1,ee)&&(me+=1),L.isDark(J,ee+1)&&(me+=1),L.isDark(J+1,ee+1)&&(me+=1),(me==0||me==4)&&(X+=3)}for(var J=0;J<D;J+=1)for(var ee=0;ee<D-6;ee+=1)L.isDark(J,ee)&&!L.isDark(J,ee+1)&&L.isDark(J,ee+2)&&L.isDark(J,ee+3)&&L.isDark(J,ee+4)&&!L.isDark(J,ee+5)&&L.isDark(J,ee+6)&&(X+=40);for(var ee=0;ee<D;ee+=1)for(var J=0;J<D-6;J+=1)L.isDark(J,ee)&&!L.isDark(J+1,ee)&&L.isDark(J+2,ee)&&L.isDark(J+3,ee)&&L.isDark(J+4,ee)&&!L.isDark(J+5,ee)&&L.isDark(J+6,ee)&&(X+=40);for(var se=0,ee=0;ee<D;ee+=1)for(var J=0;J<D;J+=1)L.isDark(J,ee)&&(se+=1);var G=Math.abs(100*se/D/D-50)/5;return X+=G*10,X},N}(),f=function(){for(var I=new Array(256),P=new Array(256),C=0;C<8;C+=1)I[C]=1<<C;for(var C=8;C<256;C+=1)I[C]=I[C-4]^I[C-5]^I[C-6]^I[C-8];for(var C=0;C<255;C+=1)P[I[C]]=C;var T={};return T.glog=function(N){if(N<1)throw"glog("+N+")";return P[N]},T.gexp=function(N){for(;N<0;)N+=255;for(;N>=256;)N-=255;return I[N]},T}();function d(I,P){if(typeof I.length>"u")throw I.length+"/"+P;var C=function(){for(var N=0;N<I.length&&I[N]==0;)N+=1;for(var j=new Array(I.length-N+P),L=0;L<I.length-N;L+=1)j[L]=I[L+N];return j}(),T={};return T.getAt=function(N){return C[N]},T.getLength=function(){return C.length},T.multiply=function(N){for(var j=new Array(T.getLength()+N.getLength()-1),L=0;L<T.getLength();L+=1)for(var D=0;D<N.getLength();D+=1)j[L+D]^=f.gexp(f.glog(T.getAt(L))+f.glog(N.getAt(D)));return d(j,0)},T.mod=function(N){if(T.getLength()-N.getLength()<0)return T;for(var j=f.glog(T.getAt(0))-f.glog(N.getAt(0)),L=new Array(T.getLength()),D=0;D<T.getLength();D+=1)L[D]=T.getAt(D);for(var D=0;D<N.getLength();D+=1)L[D]^=f.gexp(f.glog(N.getAt(D))+j);return d(L,0).mod(N)},T}var u=function(){var I=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],P=function(N,j){var L={};return L.totalCount=N,L.dataCount=j,L},C={},T=function(N,j){switch(j){case a.L:return I[(N-1)*4+0];case a.M:return I[(N-1)*4+1];case a.Q:return I[(N-1)*4+2];case a.H:return I[(N-1)*4+3];default:return}};return C.getRSBlocks=function(N,j){var L=T(N,j);if(typeof L>"u")throw"bad rs block @ typeNumber:"+N+"/errorCorrectionLevel:"+j;for(var D=L.length/3,X=[],J=0;J<D;J+=1)for(var ee=L[J*3+0],ae=L[J*3+1],fe=L[J*3+2],de=0;de<ee;de+=1)X.push(P(ae,fe));return X},C}(),h=function(){var I=[],P=0,C={};return C.getBuffer=function(){return I},C.getAt=function(T){var N=Math.floor(T/8);return(I[N]>>>7-T%8&1)==1},C.put=function(T,N){for(var j=0;j<N;j+=1)C.putBit((T>>>N-j-1&1)==1)},C.getLengthInBits=function(){return P},C.putBit=function(T){var N=Math.floor(P/8);I.length<=N&&I.push(0),T&&(I[N]|=128>>>P%8),P+=1},C},v=function(I){var P=r.MODE_NUMBER,C=I,T={};T.getMode=function(){return P},T.getLength=function(L){return C.length},T.write=function(L){for(var D=C,X=0;X+2<D.length;)L.put(N(D.substring(X,X+3)),10),X+=3;X<D.length&&(D.length-X==1?L.put(N(D.substring(X,X+1)),4):D.length-X==2&&L.put(N(D.substring(X,X+2)),7))};var N=function(L){for(var D=0,X=0;X<L.length;X+=1)D=D*10+j(L.charAt(X));return D},j=function(L){if("0"<=L&&L<="9")return L.charCodeAt(0)-48;throw"illegal char :"+L};return T},m=function(I){var P=r.MODE_ALPHA_NUM,C=I,T={};T.getMode=function(){return P},T.getLength=function(j){return C.length},T.write=function(j){for(var L=C,D=0;D+1<L.length;)j.put(N(L.charAt(D))*45+N(L.charAt(D+1)),11),D+=2;D<L.length&&j.put(N(L.charAt(D)),6)};var N=function(j){if("0"<=j&&j<="9")return j.charCodeAt(0)-48;if("A"<=j&&j<="Z")return j.charCodeAt(0)-65+10;switch(j){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+j}};return T},g=function(I){var P=r.MODE_8BIT_BYTE,C=i.stringToBytes(I),T={};return T.getMode=function(){return P},T.getLength=function(N){return C.length},T.write=function(N){for(var j=0;j<C.length;j+=1)N.put(C[j],8)},T},b=function(I){var P=r.MODE_KANJI,C=i.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(j,L){var D=C(j);if(D.length!=2||(D[0]<<8|D[1])!=L)throw"sjis not supported."})("ๅ‹",38726);var T=C(I),N={};return N.getMode=function(){return P},N.getLength=function(j){return~~(T.length/2)},N.write=function(j){for(var L=T,D=0;D+1<L.length;){var X=(255&L[D])<<8|255&L[D+1];if(33088<=X&&X<=40956)X-=33088;else if(57408<=X&&X<=60351)X-=49472;else throw"illegal char at "+(D+1)+"/"+X;X=(X>>>8&255)*192+(X&255),j.put(X,13),D+=2}if(D<L.length)throw"illegal char at "+(D+1)},N},w=function(){var I=[],P={};return P.writeByte=function(C){I.push(C&255)},P.writeShort=function(C){P.writeByte(C),P.writeByte(C>>>8)},P.writeBytes=function(C,T,N){T=T||0,N=N||C.length;for(var j=0;j<N;j+=1)P.writeByte(C[j+T])},P.writeString=function(C){for(var T=0;T<C.length;T+=1)P.writeByte(C.charCodeAt(T))},P.toByteArray=function(){return I},P.toString=function(){var C="";C+="[";for(var T=0;T<I.length;T+=1)T>0&&(C+=","),C+=I[T];return C+="]",C},P},_=function(){var I=0,P=0,C=0,T="",N={},j=function(D){T+=String.fromCharCode(L(D&63))},L=function(D){if(!(D<0)){if(D<26)return 65+D;if(D<52)return 97+(D-26);if(D<62)return 48+(D-52);if(D==62)return 43;if(D==63)return 47}throw"n:"+D};return N.writeByte=function(D){for(I=I<<8|D&255,P+=8,C+=1;P>=6;)j(I>>>P-6),P-=6},N.flush=function(){if(P>0&&(j(I<<6-P),I=0,P=0),C%3!=0)for(var D=3-C%3,X=0;X<D;X+=1)T+="="},N.toString=function(){return T},N},k=function(I){var P=I,C=0,T=0,N=0,j={};j.read=function(){for(;N<8;){if(C>=P.length){if(N==0)return-1;throw"unexpected end of file./"+N}var D=P.charAt(C);if(C+=1,D=="=")return N=0,-1;if(D.match(/^\s$/))continue;T=T<<6|L(D.charCodeAt(0)),N+=6}var X=T>>>N-8&255;return N-=8,X};var L=function(D){if(65<=D&&D<=90)return D-65;if(97<=D&&D<=122)return D-97+26;if(48<=D&&D<=57)return D-48+52;if(D==43)return 62;if(D==47)return 63;throw"c:"+D};return j},E=function(I,P){var C=I,T=P,N=new Array(I*P),j={};j.setPixel=function(J,ee,ae){N[ee*C+J]=ae},j.write=function(J){J.writeString("GIF87a"),J.writeShort(C),J.writeShort(T),J.writeByte(128),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(255),J.writeByte(255),J.writeByte(255),J.writeString(","),J.writeShort(0),J.writeShort(0),J.writeShort(C),J.writeShort(T),J.writeByte(0);var ee=2,ae=D(ee);J.writeByte(ee);for(var fe=0;ae.length-fe>255;)J.writeByte(255),J.writeBytes(ae,fe,255),fe+=255;J.writeByte(ae.length-fe),J.writeBytes(ae,fe,ae.length-fe),J.writeByte(0),J.writeString(";")};var L=function(J){var ee=J,ae=0,fe=0,de={};return de.write=function(oe,me){if(oe>>>me)throw"length over";for(;ae+me>=8;)ee.writeByte(255&(oe<<ae|fe)),me-=8-ae,oe>>>=8-ae,fe=0,ae=0;fe=oe<<ae|fe,ae=ae+me},de.flush=function(){ae>0&&ee.writeByte(fe)},de},D=function(J){for(var ee=1<<J,ae=(1<<J)+1,fe=J+1,de=X(),oe=0;oe<ee;oe+=1)de.add(String.fromCharCode(oe));de.add(String.fromCharCode(ee)),de.add(String.fromCharCode(ae));var me=w(),se=L(me);se.write(ee,fe);var G=0,Y=String.fromCharCode(N[G]);for(G+=1;G<N.length;){var ie=String.fromCharCode(N[G]);G+=1,de.contains(Y+ie)?Y=Y+ie:(se.write(de.indexOf(Y),fe),de.size()<4095&&(de.size()==1<<fe&&(fe+=1),de.add(Y+ie)),Y=ie)}return se.write(de.indexOf(Y),fe),se.write(ae,fe),se.flush(),me.toByteArray()},X=function(){var J={},ee=0,ae={};return ae.add=function(fe){if(ae.contains(fe))throw"dup key:"+fe;J[fe]=ee,ee+=1},ae.size=function(){return ee},ae.indexOf=function(fe){return J[fe]},ae.contains=function(fe){return typeof J[fe]<"u"},ae};return j},S=function(I,P,C){for(var T=E(I,P),N=0;N<P;N+=1)for(var j=0;j<I;j+=1)T.setPixel(j,N,C(j,N));var L=w();T.write(L);for(var D=_(),X=L.toByteArray(),J=0;J<X.length;J+=1)D.writeByte(X[J]);return D.flush(),"data:image/gif;base64,"+D};return i}();(function(){t.stringToBytesFuncs["UTF-8"]=function(i){function r(a){for(var o=[],s=0;s<a.length;s++){var f=a.charCodeAt(s);f<128?o.push(f):f<2048?o.push(192|f>>6,128|f&63):f<55296||f>=57344?o.push(224|f>>12,128|f>>6&63,128|f&63):(s++,f=65536+((f&1023)<<10|a.charCodeAt(s)&1023),o.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return o}return r(i)}})(),function(i){e.exports=i()}(function(){return t})})(jw);var kB=jw.exports;const Tc=xr(kB);var xB=Object.defineProperty,qf=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Uw=Object.prototype.propertyIsEnumerable,zw=(e,n,t)=>n in e?xB(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,EB=(e,n)=>{for(var t in n||(n={}))Rw.call(n,t)&&zw(e,t,n[t]);if(qf)for(var t of qf(n))Uw.call(n,t)&&zw(e,t,n[t]);return e},SB=(e,n)=>{var t={};for(var i in e)Rw.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&qf)for(var i of qf(e))n.indexOf(i)<0&&Uw.call(e,i)&&(t[i]=e[i]);return t},vi=1e3,CB=/code length overflow/i;Tc.stringToBytes=Tc.stringToBytesFuncs["UTF-8"];var $B=(e,n,t)=>{t=Math.max(1,t);for(let i=t;i<=40;i+=1)try{const r=Tc(i,n);r.addData(e),r.make();const a=r.getModuleCount();return{text:e,level:n,version:i,moduleCount:a,isDark:(s,f)=>s>=0&&s<a&&f>=0&&f<a&&r.isDark(s,f)}}catch(r){if(!(i<40&&CB.test(String(r))))throw r}return null},Hi=Math.round,ga=(e,n)=>`M ${Hi(e)} ${Hi(n)}`,Jn=(e,n)=>`L ${Hi(e)} ${Hi(n)}`,Vi=(e,n,t)=>`A ${Hi(t)} ${Hi(t)} 0 0 1 ${Hi(e)} ${Hi(n)}`,AB=(e,n,t,i,r,a,o,s,f)=>{const d=[];return a?d.push(ga(e+r,n)):d.push(ga(e,n)),o?d.push(Jn(t-r,n),Vi(t,n+r,r)):d.push(Jn(t,n)),s?d.push(Jn(t,i-r),Vi(t-r,i,r)):d.push(Jn(t,i)),f?d.push(Jn(e+r,i),Vi(e,i-r,r)):d.push(Jn(e,i)),a?d.push(Jn(e,n+r),Vi(e+r,n,r)):d.push(Jn(e,n)),d.join(" ")},TB=(e,n,t,i,r,a,o,s,f)=>{const d=[];return a&&d.push(ga(e+r,n),Jn(e,n),Jn(e,n+r),Vi(e+r,n,r)),o&&d.push(ga(t,n+r),Jn(t,n),Jn(t-r,n),Vi(t,n+r,r)),s&&d.push(ga(t-r,i),Jn(t,i),Jn(t,i-r),Vi(t-r,i,r)),f&&d.push(ga(e,i-r),Jn(e,i),Jn(e+r,i),Vi(e,i-r,r)),d.join(" ")},OB=(e,n,t,i,r)=>{const a=r*t,o=i*t,s=a+t,f=o+t,d=n*.005*t,u=e.isDark,h=i-1,v=i+1,m=r-1,g=r+1,b=u(i,r),w=u(h,m),_=u(h,r),k=u(h,g),E=u(i,g),S=u(v,g),I=u(v,r),P=u(v,m),C=u(i,m);return b?AB(a,o,s,f,d,!_&&!C,!_&&!E,!I&&!E,!I&&!C):TB(a,o,s,f,d,_&&C&&w,_&&E&&k,I&&E&&S,I&&C&&P)},PB=(e,n)=>{if(!e)return"";const t=e.moduleCount,i=vi/t,r=[];for(let a=0;a<t;a+=1)for(let o=0;o<t;o+=1)r.push(OB(e,n,i,a,o));return r.join(" ")},IB=e=>{var n=e,{color:t="#000",backgroundColor:i,cutout:r=!1,cutoutElement:a,errorCorrectionLevel:o="Q",rounding:s=0,children:f}=n,d=SB(n,["color","backgroundColor","cutout","cutoutElement","errorCorrectionLevel","rounding","children"]),u,h;const v=l.useMemo(()=>$B(f,o,1),[f,o]);if(!v)return null;const m=(u=v==null?void 0:v.moduleCount)!=null?u:1,b=vi/((h=v==null?void 0:v.moduleCount)!=null?h:1)*(Math.floor(m*.18)*2-1)+2,w=(vi-b)/2;return be.createElement("svg",EB({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${vi} ${vi}`},d),r?be.createElement("mask",{id:"react-qr-rounded__mask"},be.createElement("rect",{x:"0",y:"0",width:vi,height:vi,fill:"#fff"}),be.createElement("rect",{x:w,y:w,width:b,height:b,rx:s,ry:s,fill:"#000"})):null,i?be.createElement("rect",{x:"0",y:"0",width:vi,height:vi,fill:i}):null,be.createElement("path",{fill:t,d:PB(v,s),mask:r?"url(#react-qr-rounded__mask)":void 0}),a?be.createElement("foreignObject",{x:w,y:w,width:b,height:b},be.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%",overflow:"hidden",borderRadius:s}},a)):null)};const FB=new Map([[_e.State.ERROR,-3],[_e.State.TIMEOUT,-2],[_e.State.CANCELLED,-1],[_e.State.INIT,0],[_e.State.CONNECTING,1],[_e.State.CONNECTED,2],[_e.State.READY_FOR_AUTHENTICATION,3],[_e.State.AUTHENTICATING,4],[_e.State.SUCCESS,5]]),Oc=({children:e,...n})=>l.createElement(vn.View,{...n,classNames:"grow flex flex-col justify-around items-center"},e),Ww=({invitationUrl:e,active:n,send:t,status:i,type:r,authCode:a,id:o="0"})=>{const{t:s}=sn("os"),f=Tn("invitation-manager__qr-code"),d=r===_e.Type.MULTIUSE?0:FB.get(i)??0,u=d===3,h=ao(o),v=l.useMemo(()=>{switch(!0){case d===5:case d<0:return"showing final";case d===3:return"showing auth code";default:return"showing qr"}},[d]);return l.createElement(l.Fragment,null,l.createElement(vn.Root,{activeView:v,classNames:"grow plb-1"},l.createElement(vn.Views,null,l.createElement(Oc,{id:"showing qr",emoji:h},l.createElement("p",{className:"text-sm mlb-1 font-normal text-center"},s(r===_e.Type.MULTIUSE?"invite many qr label":"invite one qr label")),l.createElement("div",{role:"none",className:le(Mn,"is-full max-is-[14rem] relative")},l.createElement(IB,{rounding:100,backgroundColor:"transparent",color:"currentColor",className:le("is-full bs-full p-2",u&&"invisible"),"aria-labelledby":f,errorCorrectionLevel:"Q",cutout:!0},e??"never"),l.createElement(lD,null,l.createElement(ec,{text:h}))),l.createElement("span",{id:f,className:"sr-only"},s("qr label")),l.createElement(wO,{variant:"ghost",value:e??"never"})),l.createElement(Oc,{id:"showing auth code"},l.createElement(jy,null,s("auth code message")),l.createElement(Ly,{code:a,large:!0,classNames:"text-black dark:text-white"}),l.createElement(jy,null,"Be sure the other device is showing this symbol:"),h&&l.createElement(ec,{text:h})),l.createElement(Oc,{id:"showing final"},d>0?l.createElement(qe.Check,{className:le("m-1.5",We(6))}):l.createElement(qe.X,{className:le("m-1.5",We(6))})))),l.createElement(it,{classNames:"mbs-4"},l.createElement(un,{disabled:!n,onClick:()=>t==null?void 0:t({type:"deselectInvitation"})},s("back label"))))},ba="pbs-1 pbe-3 pli-3",NB=({titleId:e,title:n,identity:t,onDone:i})=>{var a,o,s;const r=eb(t.identityKey);return l.createElement(nc,{titleId:e,title:n,corner:l.createElement(By,{onDone:i})},l.createElement(Dn.Root,{size:12,variant:"circle",status:"active",hue:((a=t.profile)==null?void 0:a.hue)||r.hue},l.createElement(Dn.Frame,{classNames:"block mbs-4 mbe-2 mli-auto chromatic-ignore"},l.createElement(Dn.Fallback,{text:((o=t.profile)==null?void 0:o.emoji)||r.emoji})),l.createElement(Dn.Label,{classNames:"block text-center font-light text-xl","data-testid":"identityHeading.displayName"},((s=t.profile)==null?void 0:s.displayName)??ff(t.identityKey.toHex()))))},Hw=e=>{const{identity:n,titleId:t,activeView:i,onUpdateProfile:r,onResetDevice:a,onJoinNewIdentity:o,IdentityActionChooser:s=pB,InvitationManager:f=Ww,onDone:d,...u}=e,{t:h}=sn("os"),v=l.useMemo(()=>{switch(i){case"agent manager":return"Manage Agent";case"device invitation manager":return h("choose add device label");default:return h("identity heading")}},[i,h]);return l.createElement(Rr,{density:"fine"},l.createElement(NB,{identity:n,titleId:t,title:v,onDone:d}),l.createElement(vn.Root,{activeView:i},l.createElement(vn.Views,null,l.createElement(vn.View,{id:"identity action chooser",classNames:ba},l.createElement(s,{active:i==="identity action chooser",...u})),l.createElement(vn.View,{id:"device invitation manager",classNames:ba},l.createElement(f,{active:i==="device invitation manager",...u,invitationUrl:u.createInvitationUrl(u.invitationCode)})),l.createElement(vn.View,{id:"device manager",classNames:ba},l.createElement(vB,{active:i==="device manager",...u})),l.createElement(vn.View,{classNames:ba,id:"update profile form"},l.createElement(gB,{send:u.send,active:i==="update profile form",identity:n,onUpdateProfile:r})),l.createElement(vn.View,{classNames:ba,id:"signing out"},l.createElement(yB,{send:u.send,active:i==="signing out",onResetDevice:a,onJoinNewIdentity:o})),l.createElement(vn.View,{classNames:ba,id:"agent manager"},l.createElement(hB,{send:u.send,active:i==="agent manager",...u})))))},MB=({invitation:e,...n})=>{const t=Qu(e);return l.createElement(Hw,{...n,...t})},DB=({titleId:e,createInvitationUrl:n=i=>i,...t})=>{const i=Tn("identityPanel__heading",e),r=Ye.useClient(),a=Ki.useDevices(),o=Ki.useIdentity(),s=Ki.useHaloInvitations(),f=_B({client:r,identity:o,invitations:s});if(!o)return console.error("IdentityPanel rendered with no active identity."),null;const[d,u,h]=cB(r);l.useEffect(()=>h.subscribe(w=>{fn("[state]",w)}).unsubscribe,[h]);const v=l.useMemo(()=>{switch(!0){case d.matches("choosingAction"):return"identity action chooser";case d.matches("managingDeviceInvitation"):return"device invitation manager";case d.matches("managingDevices"):return"device manager";case[{managingProfile:"idle"},{managingProfile:"pending"}].some(d.matches):return"update profile form";case d.matches("signingOut"):return"signing out";case[{managingAgent:"idle"},{managingAgent:"pending"}].some(d.matches):return"agent manager";default:return"identity action chooser"}},[d]),g={...t,identity:o,devices:a,activeView:v,send:u,titleId:i,createInvitationUrl:n,onUpdateProfile:async b=>{u({type:"updateProfile"}),await r.halo.updateProfile(b)},...f};return d.context.invitation?l.createElement(MB,{...g,invitation:d.context.invitation}):l.createElement(Hw,{...g})},LB=l.forwardRef(({mode:e,titleId:n,onExit:t,exitActionParent:i},r)=>{const{t:a}=sn("os"),o=l.createElement(tt,{variant:"ghost",...t&&{onClick:t},classNames:le(Mn,"plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),"data-testid":"join-exit"},l.createElement(qe.X,{weight:"bold",className:We(4)}),l.createElement("span",{className:"sr-only"},a("exit label")));return l.createElement(nc,{ref:r,titleId:n,title:a(e==="halo-only"?"selecting identity heading":"joining space heading"),...e==="halo-only"?{titleSrOnly:!0}:{corner:i?l.cloneElement(i,{},o):o},titleSrOnly:e==="halo-only"})}),Vw=(e,n)=>(fn("[subscribing to invitation]",n),{subscribe:(t,i,r)=>n.subscribe(a=>{switch(a.state){case _e.State.CONNECTING:return fn("[invitation connecting]",{Kind:e,invitation:a}),t({type:`connecting${e}Invitation`,invitation:a});case _e.State.CONNECTED:return fn("[invitation connected]",{Kind:e,invitation:a}),t({type:`connected${e}Invitation`,invitation:a});case _e.State.READY_FOR_AUTHENTICATION:return fn("[invitation ready for authentication]",{Kind:e,invitation:a}),t({type:`readyForAuthentication${e}Invitation`,invitation:a});case _e.State.AUTHENTICATING:return fn("[invitation authenticating]",{Kind:e,invitation:a}),t({type:`authenticating${e}Invitation`,invitation:a});case _e.State.SUCCESS:return fn("[invitation success]",{Kind:e,invitation:a}),t({type:`success${e}Invitation`,invitation:a}),r==null?void 0:r();case _e.State.CANCELLED:return fn.warn("[invitation cancelled]",{Kind:e}),t({type:`fail${e}Invitation`,reason:"cancelled"});case _e.State.TIMEOUT:return fn.error("[invitation timeout]",{Kind:e}),t({type:`fail${e}Invitation`,reason:"timeout"})}},a=>a instanceof Ye.AlreadyJoinedError?(fn("[already joined]",{Kind:e,error:a}),t({type:`success${e}Invitation`,invitation:n.get()}),r==null?void 0:r()):(fn.error("[invitation errored]",{Kind:e,error:a}),t({type:`fail${e}Invitation`,reason:"error"}),i==null?void 0:i(a)))}),qw=(e,n)=>({initial:`unknown${e}`,states:{[`unknown${e}`]:{always:[{cond:({mode:i})=>i==="halo-only"&&e==="Space",target:"#join.finishingJoiningHalo"},{cond:i=>!!i[e.toLowerCase()].unredeemedCode,target:`acceptingRedeemed${e}Invitation`,actions:[`redeem${e}InvitationCode`,`invalidate${e}InvitationCode`,"log"]},{target:`inputting${e}InvitationCode`,actions:"log"}]},[`inputting${e}InvitationCode`]:{},[`acceptingRedeemed${e}Invitation`]:{invoke:{src:i=>i[e.toLowerCase()].invitationSubscribable},initial:`unknown${e}Invitation`,states:{[`unknown${e}Invitation`]:{always:[{cond:i=>{var r,a;if(e!=="Space")return!1;{const o=(a=(r=i.space.invitation)==null?void 0:r.spaceKey)==null?void 0:a.toHex(),s=i.space.succeededKeys;return o?!!(s!=null&&s.has(o)):!1}},target:n,actions:"log"},{cond:i=>{const r=i[e.toLowerCase()].invitation;return!r||(r==null?void 0:r.state)===_e.State.CONNECTING},target:`connecting${e}Invitation`,actions:"log"},{target:`inputting${e}VerificationCode`,actions:"log"}]},[`connecting${e}Invitation`]:{},[`inputting${e}VerificationCode`]:{},[`authenticating${e}VerificationCode`]:{on:{[`readyForAuthentication${e}Invitation`]:{target:`authenticationFailing${e}VerificationCode`,actions:["setInvitation","log"]}}},[`authenticationFailing${e}VerificationCode`]:{},[`failing${e}Invitation`]:{},[`success${e}Invitation`]:{}},on:{[`reset${e}Invitation`]:{target:`#join${e==="Halo"?".choosingIdentity":""}.accepting${e}Invitation.unknown${e}`,actions:["resetInvitation","log"]},[`connecting${e}Invitation`]:{target:`.connecting${e}Invitation`,actions:["setInvitation","log"]},[`connected${e}Invitation`]:{target:`.connecting${e}Invitation`,actions:["setInvitation","log"]},[`readyForAuthentication${e}Invitation`]:{target:`.inputting${e}VerificationCode`,actions:["setInvitation","log"]},[`authenticating${e}Invitation`]:{target:`.authenticating${e}VerificationCode`,actions:["setInvitation","log"]},[`success${e}Invitation`]:{target:n,actions:["setInvitation","log"]},[`fail${e}Invitation`]:{target:`.failing${e}Invitation`,actions:[rt({[e.toLowerCase()]:(i,r)=>({...i[e.toLowerCase()],failReason:r.reason})}),"log"]}}}},on:{[`set${e}InvitationCode`]:{target:`.acceptingRedeemed${e}Invitation`,actions:[rt({[e.toLowerCase()]:(i,r)=>({...i[e.toLowerCase()],unredeemedCode:r.code,succeededKeys:r.succeededKeys})}),`redeem${e}InvitationCode`,`invalidate${e}InvitationCode`,"log"]}}}),BB=$c({id:"join",predictableActionArguments:!0,context:{mode:"default",identity:null,halo:{},space:{}},initial:"unknown",states:{unknown:{always:[{cond:"existingIdentity",target:"resettingIdentity",actions:"log"},{cond:"noSelectedIdentity",target:"choosingIdentity",actions:"log"},{target:"acceptingSpaceInvitation",actions:"log"}]},choosingIdentity:{initial:"unknownAuthMethod",states:{unknownAuthMethod:{always:[{cond:"hasHaloUnredeemedCode",target:"acceptingHaloInvitation",actions:"log"},{target:"choosingAuthMethod",actions:"log"}]},choosingAuthMethod:{},recoveringIdentity:{},creatingIdentity:{},acceptingHaloInvitation:qw("Halo","#join.acceptingSpaceInvitation"),confirmingAddedIdentity:{}},on:{recoverIdentity:{target:".recoveringIdentity",actions:"log"},createIdentity:{target:".creatingIdentity",actions:"log"},acceptHaloInvitation:{target:".acceptingHaloInvitation",actions:"log"},addIdentity:{target:".confirmingAddedIdentity",actions:"log"},selectIdentity:{target:"acceptingSpaceInvitation",actions:["setIdentity","log"]},deselectAuthMethod:{target:".choosingAuthMethod",actions:"log"}}},resettingIdentity:{},acceptingSpaceInvitation:qw("Space","#join.finishingJoiningSpace"),finishingJoiningSpace:{type:"final"},finishingJoiningHalo:{type:"final"}},on:{resetIdentity:{target:"choosingIdentity",actions:"unsetIdentity"}}},{guards:{existingIdentity:({identity:e,mode:n},t)=>n==="halo-only"&&!!e,noSelectedIdentity:({identity:e},n)=>!e,hasHaloUnredeemedCode:({halo:e},n)=>!!e.unredeemedCode,noSpaceInvitation:({space:e},n)=>!e.invitation&&!e.unredeemedCode},actions:{setIdentity:rt({identity:(e,n)=>n.identity}),unsetIdentity:rt({identity:()=>null}),resetInvitation:rt({halo:(e,n)=>n.type!=="resetHaloInvitation"?e.halo:(e.halo.invitationObservable&&e.halo.invitationObservable.cancel(),{...e.halo,invitation:void 0,invitationObservable:void 0,invitationSubscribable:void 0}),space:(e,n)=>n.type!=="resetSpaceInvitation"?e.space:(e.space.invitationObservable&&e.space.invitationObservable.cancel(),{...e.space,invitation:void 0,invitationObservable:void 0,invitationSubscribable:void 0})}),setInvitation:rt({halo:(e,n)=>n.type.includes("Halo")?{...e.halo,invitation:n.invitation}:e.halo,space:(e,n)=>n.type.includes("Space")?{...e.space,invitation:n.invitation}:e.space}),log:(e,n)=>{fn("[transition]",{event:n,haloInvitation:e.halo.invitation,spaceInvitation:e.space.invitation})}}}),Gw=(e,n)=>{try{const t=new URLSearchParams(n.substring(n.lastIndexOf("?")));return t.get(`${e}InvitationCode`)??t.get(`${e}Invitation`)??t.get("invitationCode")??t.get("invitation")??n}catch(t){return fn.catch(t),n}},jB=(e,n)=>{const t=l.useCallback(({halo:o})=>{if(o.unredeemedCode)try{const s=yi.InvitationEncoder.decode(Gw("halo",o.unredeemedCode)),f=e.halo.join(s);return{...o,invitationObservable:f,invitationSubscribable:Vw("Halo",f)}}catch(s){return fn.error("Could not redeem device invitation code",s),o}else return o},[e]),i=l.useCallback(({space:o})=>{if(o.unredeemedCode)try{const s=yi.InvitationEncoder.decode(Gw("space",o.unredeemedCode)),f=e.spaces.join(s);return{...o,invitationObservable:f,invitationSubscribable:Vw("Space",f)}}catch(s){return fn.error("Could not redeem space invitation code",s),o}else return o},[e]),r=l.useCallback(({halo:o})=>{var s;return o.unredeemedCode?((s=n==null?void 0:n.onInvalidateInvitationCode)==null||s.call(n,o.unredeemedCode),{...o,unredeemedCode:void 0}):o},[n==null?void 0:n.onInvalidateInvitationCode]),a=l.useCallback(({space:o})=>{var s;return o.unredeemedCode?((s=n==null?void 0:n.onInvalidateInvitationCode)==null||s.call(n,o.unredeemedCode),{...o,unredeemedCode:void 0}):o},[n==null?void 0:n.onInvalidateInvitationCode]);return Ac(BB,{...n,actions:{...n==null?void 0:n.actions,redeemHaloInvitationCode:rt({halo:t}),redeemSpaceInvitationCode:rt({space:i}),invalidateHaloInvitationCode:rt({halo:r}),invalidateSpaceInvitationCode:rt({space:a})}})},RB=e=>{const n=!e.active,{send:t}=e,{t:i}=sn("os"),r={disabled:n,after:l.createElement(qe.CaretRight,{className:We(4),weight:"bold"}),slots:{label:{className:"text-sm"}}};return l.createElement(l.Fragment,null,l.createElement(kt,null,i("addition method chooser title")),l.createElement("div",{role:"none",className:"flex flex-col gap-1 grow"},l.createElement(Zd,{...r,description:i("create identity description"),before:l.createElement(qe.Plus,{className:We(6)}),onClick:()=>t({type:"createIdentity"}),"data-autofocus":"choosingAuthMethod","data-testid":"identity-chooser.create-identity"},i("create identity label")),l.createElement(Zd,{...r,description:i("join identity description"),before:l.createElement(qe.QrCode,{className:We(6)}),onClick:()=>t({type:"acceptHaloInvitation"}),"data-testid":"identity-chooser.join-identity"},i("join identity label")),l.createElement(Zd,{...r,disabled:!0,description:i("recover identity description"),before:l.createElement(qe.Textbox,{className:We(6)}),onClick:()=>t({type:"recoverIdentity"}),"data-testid":"identity-chooser.recover-identity"},i("recover identity label"))))},UB=e=>{var g,b,w,_;const{mode:n,addedIdentity:t,active:i,send:r,onDone:a,doneActionParent:o}=e,s=!i,{t:f}=sn("os"),d=(t==null?void 0:t.identityKey.toHex())??"0",u=nb(d),h=Tn("identityListItem__label"),v=((g=t==null?void 0:t.profile)==null?void 0:g.displayName)??(t&&ff(d)),m=l.createElement(un,{...a&&{onClick:()=>a(null)},disabled:s,"data-autofocus":"confirmingAddedIdentity","data-testid":"identity-added-done"},l.createElement("span",null,f("done label")));return l.createElement(l.Fragment,null,l.createElement(kt,null,f("identity added label")),l.createElement("div",{role:"none",className:"grow flex flex-col items-center justify-center text-center gap-2"},l.createElement(Dn.Root,{status:"active",labelId:h,hue:((b=t==null?void 0:t.profile)==null?void 0:b.hue)||u.hue},l.createElement(Dn.Frame,null,l.createElement(Dn.Fallback,{text:((w=t==null?void 0:t.profile)==null?void 0:w.emoji)||u.emoji})),l.createElement(Dn.Label,{classNames:le("text-lg truncate",!((_=t==null?void 0:t.profile)!=null&&_.displayName)&&"font-mono")},v))),l.createElement(it,null,n==="halo-only"?o?l.cloneElement(o,{},m):m:l.createElement(un,{variant:"primary",disabled:s||!t,onClick:()=>t&&r({type:"selectIdentity",identity:t}),"data-autofocus":"confirmingAddedIdentity"},f("continue label"))))},zB=e=>{const{send:n,method:t}=e,i=t==="recover identity",r=Ye.useClient(),{t:a}=sn("os"),[o,s]=l.useState(""),f=d=>{r.halo.createIdentity({[i?"seedphrase":"displayName"]:d}).then(u=>{n==null||n({type:"selectIdentity",identity:u})},u=>{fn.catch(u),s(a(i?"failed to recover identity message":"failed to create identity message"))})};return l.createElement(WB,{...e,onDisplayNameConfirm:f,validationMessage:o})},WB=e=>{const{method:n,send:t,active:i,onDisplayNameConfirm:r,validationMessage:a}=e,o=!i,{t:s}=sn("os"),[f,d]=l.useState(""),u=n==="recover identity";return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,null,s(u?"recover identity input label":"new identity input label")),disabled:o,"data-testid":"identity-input",placeholder:u?"Type your recovery phrase":"Type a display name",onChange:({target:{value:h}})=>d(h)})),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:o,onClick:()=>t==null?void 0:t({type:"deselectAuthMethod"}),"data-testid":`${n==="recover identity"?"recover":"create"}-identity-input-back`},s("back label")),l.createElement(un,{variant:"primary",disabled:o,onClick:()=>r==null?void 0:r(f),"data-testid":`${n==="recover identity"?"recover":"create"}-identity-input-continue`},s("continue label"))))},Kw=e=>{const{active:n,Kind:t,doneActionParent:i,onDone:r}=e,a=!n,{t:o}=sn("os"),s=l.createElement(un,{variant:"primary",onClick:r,disabled:a,"data-autofocus":`success${t}Invitation finishingJoining${t}`,"data-testid":`${t.toLowerCase()}-invitation-accepted-done`},o("done label"));return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement("p",{className:"text-center text-sm font-normal"},o("welcome message"))),l.createElement(it,null,i?l.cloneElement(i,{},s):s))},HB=e=>{try{const n=new URLSearchParams(e.substring(e.lastIndexOf("?")));return n.get("spaceInvitationCode")??n.get("deviceInvitationCode")??e}catch(n){return fn.catch(n),e}},Yw=e=>{const{Kind:n,active:t,send:i,unredeemedCode:r,onExit:a,exitActionParent:o,onDone:s,doneActionParent:f,succeededKeys:d}=e,u=!t,{t:h}=sn("os"),[v,m]=l.useState(r??"");l.useEffect(()=>{r&&m(r??"")},[r]);const g=()=>{v.trim().length!==0&&i({type:`set${n}InvitationCode`,code:HB(v),...n==="Space"&&{succeededKeys:d}})},b=l.createElement(un,{variant:"ghost",disabled:u,...a?{onClick:()=>a()}:{onClick:()=>s==null?void 0:s(null)},"data-testid":"join-exit"},h("cancel label"));return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{label:l.createElement(kt,null,h("invitation input label")),placeholder:"Type an invitation code",disabled:u,value:v,onChange:({target:{value:w}})=>m(w),"data-autofocus":`inputting${n}InvitationCode`,"data-testid":`${n.toLowerCase()}-invitation-input`,onKeyUp:({key:w})=>w==="Enter"&&g()})),l.createElement(it,null,n==="Halo"?l.createElement(un,{variant:"ghost",disabled:u,onClick:()=>i({type:"deselectAuthMethod"}),"data-testid":`${n.toLowerCase()}-invitation-input-back`},h("back label")):o?l.cloneElement(o,{},b):f?l.cloneElement(f,{},b):b,l.createElement(un,{variant:"primary",disabled:u,onClick:g,"data-testid":`${n.toLowerCase()}-invitation-input-continue`},h("continue label"))))},VB=({invitationState:e,onInvitationCancel:n,active:t,send:i,Kind:r,failReason:a})=>{const{t:o}=sn("os");return a?l.createElement(l.Fragment,null,l.createElement(kt,{className:Mn},o(a==="timeout"?"timeout status label":a==="cancelled"?"cancelled status label":"error status label")),l.createElement("div",{role:"none",className:"grow"}),l.createElement(it,null,l.createElement(un,{disabled:!t,onClick:()=>i({type:`reset${r}Invitation`}),"data-testid":"invitation-rescuer-reset"},o("reset label")))):l.createElement(l.Fragment,null,l.createElement(kt,{className:Mn},o("connecting status label")),l.createElement("div",{role:"none",className:"grow"}),l.createElement(it,null,l.createElement(un,{disabled:!0,classNames:"order-2","data-testid":"next"},o("next label")),l.createElement(un,{disabled:!t,onClick:n,"data-testid":"invitation-rescuer-cancel"},o("cancel label"))))},Jw=e=>{const{Kind:n,invitationState:t,active:i,send:r}=e,{t:a}=sn("os");return l.createElement(l.Fragment,null,typeof t>"u"?l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(kt,{className:Mn},"There was a problem joining the space")),l.createElement(it,null,l.createElement(un,{disabled:!i,"data-testid":"invitation-rescuer-blank-reset",onClick:()=>r({type:`reset${n}Invitation`})},a("reset label")))):l.createElement(VB,{...e}))},Xw=6,Zw=({failed:e,Kind:n,active:t,pending:i,invitationId:r,onInvitationAuthenticate:a,onInvitationCancel:o})=>{const s=!t||i,{t:f}=sn("os"),d=n.toLowerCase(),[u,h]=l.useState(""),v=({target:{value:m}})=>{var g;h(m),m.length===Xw&&((g=document.querySelector(`[data-autofocus-pinlength="${d}"]`))==null||g.focus())};return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},r&&l.createElement(ec,{text:ao(r)}),l.createElement(Gt.Root,{...e&&{validationValence:"error"}},l.createElement(Gt.Label,{asChild:!0},l.createElement(kt,null,f("auth code input label"))),l.createElement(Gt.PinInput,{disabled:s,length:Xw,onChange:v,inputMode:"numeric",autoComplete:"off",pattern:"\\d*","data-autofocus":`connecting${n}Invitation inputting${n}VerificationCode authenticationFailing${n}VerificationCode authenticating${n}VerificationCode`,"data-prevent-ios-autofocus":!0,"data-testid":`${d}-auth-code-input`,"data-1p-ignore":!0}),e&&l.createElement(Gt.DescriptionAndValidation,{classNames:"text-center"},l.createElement(Gt.Validation,null,f("failed to authenticate message"))))),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>o==null?void 0:o(),"data-testid":`${d}-invitation-authenticator-cancel`},f("cancel label")),l.createElement(un,{variant:"primary",disabled:s,onClick:()=>a==null?void 0:a(u),"data-autofocus-pinlength":d,"data-testid":`${d}-invitation-authenticator-next`},f("next label"))))},qB=({send:e,active:n})=>{const t=Ye.useClient(),{t:i}=sn("os"),[r,a]=l.useState(""),[o,s]=l.useState(!1),f=()=>{s(!0),t.reset().then(()=>e==null?void 0:e({type:"resetIdentity"}),d=>{fn.catch(d),a(i("failed to reset identity message")),s(!1)})};return l.createElement(GB,{disabled:!n,pending:o,validationMessage:r,onConfirm:()=>f()})},GB=({disabled:e,pending:n,validationMessage:t,onConfirm:i})=>{const{t:r}=sn("os"),a=r("confirmation value"),[o,s]=l.useState("");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:t,label:l.createElement(kt,null,r("reset identity input label",{confirmationValue:a})),disabled:e,"data-testid":"reset-identity-input",placeholder:a,onChange:({target:{value:f}})=>s(f)})),l.createElement(it,null,l.createElement(un,{variant:"primary",disabled:e||n||o!==a,onClick:()=>i==null?void 0:i(),"data-testid":"reset-identity-input-confirm"},r(n?"reset in progress label":"confirm label"))))},at="pbs-1 pbe-3 pli-3",KB=e=>{const{titleId:n,send:t,activeView:i,failed:r,mode:a,unredeemedCodes:o,invitationStates:s,succeededKeys:f,failReasons:d,onExit:u,onHaloDone:h,onSpaceDone:v,exitActionParent:m,doneActionParent:g,onHaloInvitationCancel:b,onSpaceInvitationCancel:w,onHaloInvitationAuthenticate:_,onSpaceInvitationAuthenticate:k,IdentityInput:E=zB,ResetIdentity:S=qB}=e;return l.createElement(Rr,{density:"fine"},a!=="halo-only"&&l.createElement(LB,{titleId:n,mode:a,onExit:u,exitActionParent:m}),l.createElement(vn.Root,{focusManaged:!0,activeView:i},l.createElement(vn.Views,null,l.createElement(vn.View,{classNames:at,id:"addition method chooser"},l.createElement(RB,{send:t,active:i==="addition method chooser"})),l.createElement(vn.View,{classNames:at,id:"reset identity confirmation"},l.createElement(S,{send:t,method:"reset identity",active:i==="reset identity confirmation"})),l.createElement(vn.View,{classNames:at,id:"create identity input"},l.createElement(E,{send:t,method:"create identity",active:i==="create identity input"})),l.createElement(vn.View,{classNames:at,id:"recover identity input"},l.createElement(E,{send:t,method:"recover identity",active:i==="recover identity input"})),l.createElement(vn.View,{classNames:at,id:"halo invitation input"},l.createElement(Yw,{send:t,Kind:"Halo",active:i==="halo invitation input",...(o==null?void 0:o.Halo)&&{unredeemedCode:o.Halo},...(f==null?void 0:f.Halo)&&{succeededKeys:f.Halo}})),l.createElement(vn.View,{classNames:at,id:"halo invitation rescuer"},l.createElement(Jw,{send:t,Kind:"Halo",active:i==="halo invitation rescuer",invitationState:s==null?void 0:s.Halo,onInvitationCancel:b,failReason:d==null?void 0:d.Halo})),l.createElement(vn.View,{classNames:at,id:"halo invitation authenticator"},l.createElement(Zw,{send:t,Kind:"Halo",active:i==="halo invitation authenticator",onInvitationCancel:b,onInvitationAuthenticate:_,...r.has("Halo")&&{failed:!0}})),l.createElement(vn.View,{classNames:at,id:"halo invitation accepted"},l.createElement(Kw,{send:t,Kind:"Halo",active:i==="halo invitation accepted",doneActionParent:g,onDone:h})),l.createElement(vn.View,{classNames:at,id:"identity added"},l.createElement(UB,{send:t,mode:a,active:i==="identity added",doneActionParent:g,onDone:h})),l.createElement(vn.View,{classNames:at,id:"space invitation input"},l.createElement(Yw,{send:t,Kind:"Space",active:i==="space invitation input",...(o==null?void 0:o.Space)&&{unredeemedCode:o.Space},...(f==null?void 0:f.Space)&&{succeededKeys:f.Space},onExit:u,exitActionParent:m})),l.createElement(vn.View,{classNames:at,id:"space invitation rescuer"},l.createElement(Jw,{send:t,Kind:"Space",active:i==="space invitation rescuer",invitationState:s==null?void 0:s.Space,onInvitationCancel:w,failReason:d==null?void 0:d.Space})),l.createElement(vn.View,{classNames:at,id:"space invitation authenticator"},l.createElement(Zw,{send:t,Kind:"Space",active:i==="space invitation authenticator",onInvitationCancel:w,onInvitationAuthenticate:k,...r.has("Space")&&{failed:!0}})),l.createElement(vn.View,{classNames:at,id:"space invitation accepted"},l.createElement(Kw,{send:t,Kind:"Space",active:i==="space invitation accepted",doneActionParent:g,onDone:v})))))},YB=({titleId:e,mode:n="default",initialInvitationCode:t,exitActionParent:i,onExit:r,doneActionParent:a,onDone:o})=>{const s=Ye.useClient(),f=Ki.useIdentity(),{hasIosKeyboard:d}=Pe(),u=Tn("joinPanel__heading",e),[h,v,m]=jB(s,{context:{mode:n,identity:f,...t&&{[n==="halo-only"?"halo":"space"]:{unredeemedCode:t}}}});l.useEffect(()=>m.subscribe(T=>{fn("[state]",T)}).unsubscribe,[m]),l.useEffect(()=>{const C=h.configuration[0].id.split("."),T=C[C.length-1],N=T==="finishingJoining"?"successSpaceInvitation":T,j=document.querySelector(`[data-autofocus~="${N}"]`);j&&!(d&&j.hasAttribute("data-prevent-ios-autofocus"))&&j.focus()},[h.value,d]);const g=l.useMemo(()=>{switch(!0){case h.matches({choosingIdentity:"choosingAuthMethod"}):return"addition method chooser";case h.matches("resettingIdentity"):return"reset identity confirmation";case h.matches({choosingIdentity:"creatingIdentity"}):return"create identity input";case h.matches({choosingIdentity:"recoveringIdentity"}):return"recover identity input";case h.matches({choosingIdentity:{acceptingHaloInvitation:"inputtingHaloInvitationCode"}}):return"halo invitation input";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"connectingHaloInvitation"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"failingHaloInvitation"}}}].some(h.matches):return"halo invitation rescuer";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"inputtingHaloVerificationCode"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticatingHaloVerificationCode"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticationFailingHaloVerificationCode"}}}].some(h.matches):return"halo invitation authenticator";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"successHaloInvitation"}}},"finishingJoiningHalo"].some(h.matches):return"halo invitation accepted";case h.matches({choosingIdentity:"confirmingAddedIdentity"}):return"identity added";case h.matches({acceptingSpaceInvitation:"inputtingSpaceInvitationCode"}):return"space invitation input";case[{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"connectingSpaceInvitation"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"failingSpaceInvitation"}}].some(h.matches):return"space invitation rescuer";case[{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"inputtingSpaceVerificationCode"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticatingSpaceVerificationCode"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticationFailingSpaceVerificationCode"}}].some(h.matches):return"space invitation authenticator";case h.matches("finishingJoiningSpace"):return"space invitation accepted";default:return"never"}},[h]),b=l.useMemo(()=>{const C=new Set;switch(!0){case h.matches({choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticationFailingHaloVerificationCode"}}}):C.add("Halo");break;case h.matches({acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticationFailingSpaceVerificationCode"}}):C.add("Space");break}return C},[h]),w=l.useMemo(()=>({Halo:h.context.halo.unredeemedCode,Space:h.context.space.unredeemedCode}),[h]),_=Ye.useMulticastObservable(s.spaces),k=l.useMemo(()=>({Space:_?new Set(_.map(({key:C})=>C.toHex())):void 0}),[_]),E=l.useMemo(()=>{var C,T;return{Halo:(C=h.context.halo.invitationObservable)==null?void 0:C.get().state,Space:(T=h.context.space.invitationObservable)==null?void 0:T.get().state}},[h]),S=l.useMemo(()=>({Halo:h.context.halo.failReason,Space:h.context.space.failReason}),[h]),I=l.useCallback(()=>{var C,T,N,j;o==null||o({identityKey:((C=h.context.halo.invitation)==null?void 0:C.identityKey)??null,swarmKey:((T=h.context.halo.invitation)==null?void 0:T.swarmKey)??null,spaceKey:((N=h.context.halo.invitation)==null?void 0:N.spaceKey)??null,target:((j=h.context.halo.invitation)==null?void 0:j.target)??null})},[h,o]),P=l.useCallback(()=>{var C,T,N,j;o==null||o({identityKey:((C=h.context.space.invitation)==null?void 0:C.identityKey)??null,swarmKey:((T=h.context.space.invitation)==null?void 0:T.swarmKey)??null,spaceKey:((N=h.context.space.invitation)==null?void 0:N.spaceKey)??null,target:((j=h.context.space.invitation)==null?void 0:j.target)??null})},[h,o]);return l.createElement(KB,{titleId:u,mode:n,send:v,activeView:g,failed:b,failReasons:S,pending:["connecting","authenticating"].some(C=>h==null?void 0:h.configuration[0].id.includes(C)),unredeemedCodes:w,invitationStates:E,succeededKeys:k,identity:f,onExit:r,exitActionParent:i,doneActionParent:a,onHaloDone:I,onSpaceDone:P,onHaloInvitationCancel:()=>{var C;return(C=h.context.halo.invitationObservable)==null?void 0:C.cancel()},onSpaceInvitationCancel:()=>{var C;return(C=h.context.space.invitationObservable)==null?void 0:C.cancel()},onHaloInvitationAuthenticate:C=>{var T;return v({type:"authenticateHaloVerificationCode"}),(T=h.context.halo.invitationObservable)==null?void 0:T.authenticate(C)},onSpaceInvitationAuthenticate:C=>{var T;return v({type:"authenticateSpaceVerificationCode"}),(T=h.context.space.invitationObservable)==null?void 0:T.authenticate(C)}})},JB=$c({id:"space",predictableActionArguments:!0,context:{space:null},initial:"managingSpace",states:{managingSpace:{},managingSpaceInvitation:{}},on:{deselectInvitation:{target:".managingSpace",actions:["unsetInvitation","log"]},selectInvitation:{target:".managingSpaceInvitation",actions:["setInvitation","log"]}}},{actions:{setInvitation:rt({invitation:(e,n)=>(n==null?void 0:n.invitation)??null}),unsetInvitation:rt({invitation:()=>{}}),log:(e,n)=>{fn("[transition]",{event:n,context:e})}}}),XB=e=>Ac(JB,{...e,context:{...e==null?void 0:e.context}}),Qw="dxos:react-shell/space-manager/active-action",ZB=e=>{const{space:n,target:t}=e,{t:i}=sn("os"),r=Ye.useConfig(),a=Bo.useSpaceInvitations(n==null?void 0:n.key),o=l.useCallback(f=>{const d=yi.InvitationEncoder.encode(f);f.state===_e.State.CONNECTING&&console.log(JSON.stringify({invitationCode:d,authCode:f.authCode}))},[]),s={inviteOne:{label:i("invite one label"),description:i("invite one description"),icon:qe.UserPlus,onClick:l.useCallback(()=>{var d,u,h,v;const f=(d=n.share)==null?void 0:d.call(n,{type:_e.Type.INTERACTIVE,authMethod:_e.AuthMethod.SHARED_SECRET,target:t});f&&((v=(h=(u=r.values.runtime)==null?void 0:u.app)==null?void 0:h.env)==null?void 0:v.DX_ENVIRONMENT)!=="production"&&f.subscribe(o)},[n])},inviteMany:{label:i("invite many label"),description:i("invite many description"),icon:qe.UsersThree,onClick:l.useCallback(()=>{var d,u,h,v;const f=(d=n.share)==null?void 0:d.call(n,{type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE,target:t});f&&((v=(h=(u=r.values.runtime)==null?void 0:u.app)==null?void 0:h.env)==null?void 0:v.DX_ENVIRONMENT)!=="production"&&f.subscribe(o)},[n])}};return l.createElement(QB,{...e,invitations:a,inviteActions:s})},e_="pis-3 pie-1 plb-1 mbe-1 font-medium",QB=e=>{const{active:n,space:t,createInvitationUrl:i,send:r,inviteActions:a,invitations:o,showInactiveInvitations:s,SpaceMemberList:f=II,InvitationList:d=oD}=e,{t:u}=sn("os"),h=a??{noopInvite:{label:u("create space invitation label"),description:"",icon:qe.Placeholder,onClick:()=>{}}},[v,m]=l.useState(localStorage.getItem(Qw)??"inviteOne"),g=w=>{m(w),localStorage.setItem(Qw,w)},b=s?o:o==null?void 0:o.filter(w=>![_e.State.CANCELLED].includes(w.get().state));return l.createElement(l.Fragment,null,l.createElement(Os.Root,{classNames:"grow shrink basis-28 -mli-2"},l.createElement(Os.Viewport,{classNames:"is-full pie-2"},!!(b!=null&&b.length)&&l.createElement(l.Fragment,null,l.createElement("h3",{className:le(e_,Mn)},u("invitation list heading")),l.createElement(d,{className:"mb-2",send:r,invitations:b??[],onClickRemove:w=>w.cancel(),createInvitationUrl:i}),l.createElement("h3",{className:le(e_,Mn,"mbs-2")},u("space member list heading"))),l.createElement(f,{spaceKey:t.key,includeSelf:!0})),l.createElement(Os.Scrollbar,{orientation:"vertical"},l.createElement(Os.Thumb,null))),l.createElement(it,null,l.createElement(fD,{disabled:!n,actions:h,activeAction:v,onChangeActiveAction:g,"data-testid":"spaces-panel.create-invitation"})))},ej=({titleId:e,space:n,onDone:t})=>{const{t:i}=sn("os"),r=n.properties.name;return l.createElement(nc,{titleId:e,title:i("space panel heading"),corner:l.createElement(By,{"data-testid":"identity-panel-done",onDone:t})},l.createElement("div",{role:"none",className:"flex gap-4 items-center justify-center mlb-4"},l.createElement(qe.Planet,{size:32,weight:"light"}),l.createElement("div",{className:"block text-start font-light text-xl"},r??n.key.truncate())))},n_=e=>{const{titleId:n,activeView:t,space:i,target:r,SpaceManager:a=ZB,InvitationManager:o=Ww,...s}=e;return l.createElement(Rr,{density:"fine"},l.createElement(ej,{...s,titleId:n,space:i}),l.createElement(vn.Root,{activeView:t},l.createElement(vn.Views,null,l.createElement(vn.View,{id:"space manager",classNames:at},l.createElement(a,{active:t==="space manager",space:i,target:r,...s})),l.createElement(vn.View,{id:"space invitation manager",classNames:at},l.createElement(o,{active:t==="space invitation manager",...s,invitationUrl:e.invitationUrl})))))},nj=({invitation:e,...n})=>{const t=Qu(e);return l.createElement(n_,{...n,...t,invitationUrl:n.createInvitationUrl(t.invitationCode)})},tj=({titleId:e,createInvitationUrl:n=i=>i,...t})=>{const i=Tn("spacePanel__heading",e),[r,a,o]=XB({context:{space:t.space}});l.useEffect(()=>o.subscribe(u=>{fn("[state]",u)}).unsubscribe,[o]);const s=l.useMemo(()=>{switch(!0){case r.matches("managingSpace"):return"space manager";case r.matches("managingSpaceInvitation"):return"space invitation manager";default:return"never"}},[r]),f={...t,activeView:s,send:a,titleId:i,createInvitationUrl:n};return r.context.invitation?l.createElement(nj,{...f,invitation:r.context.invitation}):l.createElement(n_,{...f})},ij=e=>{const n=Tn("spaceDialog__title");return l.createElement(qt.Root,{defaultOpen:!0,onOpenChange:t=>{var i;return t||((i=e.onDone)==null?void 0:i.call(e))}},l.createElement(qt.Portal,null,l.createElement(qt.Overlay,null,l.createElement(qt.Content,{"aria-labelledby":n,onOpenAutoFocus:t=>t.preventDefault()},l.createElement(Xd,null,l.createElement(DB,{...e,titleId:n,doneActionParent:l.createElement(qt.Close,{asChild:!0})}))))))},t_=e=>{const n=Tn("joinDialog__title"),{height:t}=M9();return l.createElement(jr.Root,{defaultOpen:!0,onOpenChange:i=>{var r;return i||(e.onExit?e.onExit():(r=e.onDone)==null?void 0:r.call(e,null))}},l.createElement(jr.Portal,null,l.createElement(jr.Overlay,{classNames:"backdrop-blur",...t&&{style:{blockSize:`${t}px`}}},l.createElement(jr.Content,{"aria-labelledby":n},l.createElement(YB,{...e,titleId:n,exitActionParent:l.createElement(jr.Cancel,{asChild:!0}),doneActionParent:l.createElement(jr.Action,{asChild:!0})})))))};var Pc,Gf=bi;if(process.env.NODE_ENV==="production")Pc=Gf.createRoot,Gf.hydrateRoot;else{var i_=Gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Pc=function(e,n){i_.usingClientEntryPoint=!0;try{return Gf.createRoot(e,n)}finally{i_.usingClientEntryPoint=!1}}}var Ic={exports:{}};(function(e,n){(function(t,i){var r="1.0.35",a="",o="?",s="function",f="undefined",d="object",u="string",h="major",v="model",m="name",g="type",b="vendor",w="version",_="architecture",k="console",E="mobile",S="tablet",I="smarttv",P="wearable",C="embedded",T=350,N="Amazon",j="Apple",L="ASUS",D="BlackBerry",X="Browser",J="Chrome",ee="Edge",ae="Firefox",fe="Google",de="Huawei",oe="LG",me="Microsoft",se="Motorola",G="Opera",Y="Samsung",ie="Sharp",pe="Sony",H="Xiaomi",K="Zebra",B="Facebook",W="Chromium OS",V="Mac OS",O=function(Se,Ue){var y={};for(var c in Se)Ue[c]&&Ue[c].length%2===0?y[c]=Ue[c].concat(Se[c]):y[c]=Se[c];return y},F=function(Se){for(var Ue={},y=0;y<Se.length;y++)Ue[Se[y].toUpperCase()]=Se[y];return Ue},Z=function(Se,Ue){return typeof Se===u?te(Ue).indexOf(te(Se))!==-1:!1},te=function(Se){return Se.toLowerCase()},he=function(Se){return typeof Se===u?Se.replace(/[^\d\.]/g,a).split(".")[0]:i},ye=function(Se,Ue){if(typeof Se===u)return Se=Se.replace(/^\s\s*/,a),typeof Ue===f?Se:Se.substring(0,T)},xe=function(Se,Ue){for(var y=0,c,p,x,A,M,z;y<Ue.length&&!M;){var ge=Ue[y],Fe=Ue[y+1];for(c=p=0;c<ge.length&&!M&&ge[c];)if(M=ge[c++].exec(Se),M)for(x=0;x<Fe.length;x++)z=M[++p],A=Fe[x],typeof A===d&&A.length>0?A.length===2?typeof A[1]==s?this[A[0]]=A[1].call(this,z):this[A[0]]=A[1]:A.length===3?typeof A[1]===s&&!(A[1].exec&&A[1].test)?this[A[0]]=z?A[1].call(this,z,A[2]):i:this[A[0]]=z?z.replace(A[1],A[2]):i:A.length===4&&(this[A[0]]=z?A[3].call(this,z.replace(A[1],A[2])):i):this[A]=z||i;y+=2}},Ee=function(Se,Ue){for(var y in Ue)if(typeof Ue[y]===d&&Ue[y].length>0){for(var c=0;c<Ue[y].length;c++)if(Z(Ue[y][c],Se))return y===o?i:y}else if(Z(Ue[y],Se))return y===o?i:y;return Se},re={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Be={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},hn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[m,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[m,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,w],[/opios[\/ ]+([\w\.]+)/i],[w,[m,G+" Mini"]],[/\bopr\/([\w\.]+)/i],[w,[m,G]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[m,w],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[m,"UC"+X]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[w,[m,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[w,[m,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[m,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[m,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[m,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+)/,"$1 Secure "+X],w],[/\bfocus\/([\w\.]+)/i],[w,[m,ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[m,G+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[m,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[m,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[m,G+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[m,"MIUI "+X]],[/fxios\/([-\w\.]+)/i],[w,[m,ae]],[/\bqihu|(qi?ho?o?|360)browser/i],[[m,"360 "+X]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[m,/(.+)/,"$1 "+X],w],[/(comodo_dragon)\/([\w\.]+)/i],[[m,/_/g," "],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[m,w],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,B],w],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[m,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[m,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[m,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[m,J+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,J+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[m,"Android "+X]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[m,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[w,Ee,re]],[/(webkit|khtml)\/([\w\.]+)/i],[m,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[m,ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[m,w],[/(cobalt)\/([\w\.]+)/i],[m,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,te]],[/((?:i[346]|x)86)[;\)]/i],[[_,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,a,te]],[/(sun4\w)[;\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,te]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[b,Y],[g,S]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[v,[b,Y],[g,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[b,j],[g,E]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[b,j],[g,S]],[/(macintosh);/i],[v,[b,j]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[b,ie],[g,E]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[b,de],[g,S]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[b,de],[g,E]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[v,/_/g," "],[b,H],[g,E]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[b,H],[g,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[b,"OPPO"],[g,E]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[b,"Vivo"],[g,E]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[v,[b,"Realme"],[g,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[b,se],[g,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[b,se],[g,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[b,oe],[g,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[b,oe],[g,E]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[b,"Lenovo"],[g,S]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[b,"Nokia"],[g,E]],[/(pixel c)\b/i],[v,[b,fe],[g,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[b,fe],[g,E]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[b,pe],[g,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[b,pe],[g,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[b,"OnePlus"],[g,E]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[b,N],[g,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[b,N],[g,E]],[/(playbook);[-\w\),; ]+(rim)/i],[v,b,[g,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[b,D],[g,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[b,L],[g,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[b,L],[g,E]],[/(nexus 9)/i],[v,[b,"HTC"],[g,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[v,/_/g," "],[g,E]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[b,"Acer"],[g,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[b,"Meizu"],[g,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,v,[g,E]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,v,[g,S]],[/(surface duo)/i],[v,[b,me],[g,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[b,"Fairphone"],[g,E]],[/(u304aa)/i],[v,[b,"AT&T"],[g,E]],[/\bsie-(\w*)/i],[v,[b,"Siemens"],[g,E]],[/\b(rct\w+) b/i],[v,[b,"RCA"],[g,S]],[/\b(venue[\d ]{2,7}) b/i],[v,[b,"Dell"],[g,S]],[/\b(q(?:mv|ta)\w+) b/i],[v,[b,"Verizon"],[g,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[b,"Barnes & Noble"],[g,S]],[/\b(tm\d{3}\w+) b/i],[v,[b,"NuVision"],[g,S]],[/\b(k88) b/i],[v,[b,"ZTE"],[g,S]],[/\b(nx\d{3}j) b/i],[v,[b,"ZTE"],[g,E]],[/\b(gen\d{3}) b.+49h/i],[v,[b,"Swiss"],[g,E]],[/\b(zur\d{3}) b/i],[v,[b,"Swiss"],[g,S]],[/\b((zeki)?tb.*\b) b/i],[v,[b,"Zeki"],[g,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],v,[g,S]],[/\b(ns-?\w{0,9}) b/i],[v,[b,"Insignia"],[g,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[b,"NextBook"],[g,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],v,[g,E]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],v,[g,E]],[/\b(ph-1) /i],[v,[b,"Essential"],[g,E]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[b,"Envizen"],[g,S]],[/\b(trio[-\w\. ]+) b/i],[v,[b,"MachSpeed"],[g,S]],[/\btu_(1491) b/i],[v,[b,"Rotor"],[g,S]],[/(shield[\w ]+) b/i],[v,[b,"Nvidia"],[g,S]],[/(sprint) (\w+)/i],[b,v,[g,E]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[b,me],[g,E]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[b,K],[g,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[b,K],[g,E]],[/smart-tv.+(samsung)/i],[b,[g,I]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[b,Y],[g,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,oe],[g,I]],[/(apple) ?tv/i],[b,[v,j+" TV"],[g,I]],[/crkey/i],[[v,J+"cast"],[b,fe],[g,I]],[/droid.+aft(\w)( bui|\))/i],[v,[b,N],[g,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[b,ie],[g,I]],[/(bravia[\w ]+)( bui|\))/i],[v,[b,pe],[g,I]],[/(mitv-\w{5}) bui/i],[v,[b,H],[g,I]],[/Hbbtv.*(technisat) (.*);/i],[b,v,[g,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,ye],[v,ye],[g,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,I]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,v,[g,k]],[/droid.+; (shield) bui/i],[v,[b,"Nvidia"],[g,k]],[/(playstation [345portablevi]+)/i],[v,[b,pe],[g,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[b,me],[g,k]],[/((pebble))app/i],[b,v,[g,P]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[b,j],[g,P]],[/droid.+; (glass) \d/i],[v,[b,fe],[g,P]],[/droid.+; (wt63?0{2,3})\)/i],[v,[b,K],[g,P]],[/(quest( 2| pro)?)/i],[v,[b,B],[g,P]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[g,C]],[/(aeobc)\b/i],[v,[b,N],[g,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[v,[g,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[g,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,E]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[m,ee+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[m,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,m]],os:[[/microsoft (windows) (vista|xp)/i],[m,w],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[m,[w,Ee,Be]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,"Windows"],[w,Ee,Be]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[m,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[m,V],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,m],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[m,w],[/\(bb(10);/i],[w,[m,D]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[m,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[m,ae+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[m,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[m,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[m,J+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,W],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[m,w],[/(sunos) ?([\w\.\d]*)/i],[[m,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,w]]},Te=function(Se,Ue){if(typeof Se===d&&(Ue=Se,Se=i),!(this instanceof Te))return new Te(Se,Ue).getResult();var y=typeof t!==f&&t.navigator?t.navigator:i,c=Se||(y&&y.userAgent?y.userAgent:a),p=y&&y.userAgentData?y.userAgentData:i,x=Ue?O(hn,Ue):hn,A=y&&y.userAgent==c;return this.getBrowser=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.browser),M[h]=he(M[w]),A&&y&&y.brave&&typeof y.brave.isBrave==s&&(M[m]="Brave"),M},this.getCPU=function(){var M={};return M[_]=i,xe.call(M,c,x.cpu),M},this.getDevice=function(){var M={};return M[b]=i,M[v]=i,M[g]=i,xe.call(M,c,x.device),A&&!M[g]&&p&&p.mobile&&(M[g]=E),A&&M[v]=="Macintosh"&&y&&typeof y.standalone!==f&&y.maxTouchPoints&&y.maxTouchPoints>2&&(M[v]="iPad",M[g]=S),M},this.getEngine=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.engine),M},this.getOS=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.os),A&&!M[m]&&p&&p.platform!="Unknown"&&(M[m]=p.platform.replace(/chrome os/i,W).replace(/macos/i,V)),M},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return c},this.setUA=function(M){return c=typeof M===u&&M.length>T?ye(M,T):M,this},this.setUA(c),this};Te.VERSION=r,Te.BROWSER=F([m,w,h]),Te.CPU=F([_]),Te.DEVICE=F([v,b,g,k,E,I,S,P,C]),Te.ENGINE=Te.OS=F([m,w]),e.exports&&(n=e.exports=Te),n.UAParser=Te;var ze=typeof t!==f&&(t.jQuery||t.Zepto);if(ze&&!ze.ua){var yn=new Te;ze.ua=yn.getResult(),ze.ua.get=function(){return yn.getUA()},ze.ua.set=function(Se){yn.setUA(Se);var Ue=yn.getResult();for(var y in Ue)ze.ua[y]=Ue[y]}}})(typeof window=="object"?window:pn)})(Ic,Ic.exports);var rj=Ic.exports,Kf="/home/runner/work/dxos/dxos/packages/core/mesh/rpc-tunnel/src/ports/iframe.ts",Fc,Nc;if(typeof navigator<"u"){const e=new rj.UAParser(navigator.userAgent);Fc=e.getBrowser().name,Nc=e.getOS().name}var aj=(e,n,t)=>{if(!e.contentWindow){fn("IFrame content window missing",{origin:n},{F:Kf,L:24,S:void 0,C:(i,r)=>i(...r)});return}Fc==="Chrome"&&Nc==="iOS"?e.contentWindow.postMessage(t,n):e.contentWindow.postMessage(t,n,[t.payload])},oj=(e,n)=>{Fc==="Chrome"&&Nc==="iOS"?window.parent.postMessage(n,e):window.parent.postMessage(n,e,[n.payload])},r_=({channel:e,iframe:n,origin:t,onOrigin:i})=>({send:async r=>{if(!t){fn("no origin set",{channel:e},{F:Kf,L:62,S:void 0,C:(s,f)=>s(...f)});return}fn("sending",{channel:e,data:r.length},{F:Kf,L:66,S:void 0,C:(s,f)=>s(...f)});const a=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),o={channel:e,payload:a};n?aj(n,t,o):oj(t,o)},subscribe:r=>{const a=o=>{if(!n&&o.source!==window.parent)return;if(n&&o.source!==n.contentWindow)return;const f=o.data&&typeof o.data=="object"&&"channel"in o.data&&"payload"in o.data?o.data:void 0;(f==null?void 0:f.channel)===e&&(t||(t=o.origin,i==null||i(t)),fn("received",f,{F:Kf,L:98,S:void 0,C:(d,u)=>d(...u)}),r(new Uint8Array(f.payload)))};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)}});const sj=e=>{const n=Tn("spaceDialog__title");return l.createElement(qt.Root,{defaultOpen:!0,onOpenChange:t=>{var i;return t||((i=e.onDone)==null?void 0:i.call(e))}},l.createElement(qt.Portal,null,l.createElement(qt.Overlay,null,l.createElement(qt.Content,{"aria-labelledby":n},l.createElement(Xd,null,l.createElement(tj,{...e,titleId:n,doneActionParent:l.createElement(qt.Close,{asChild:!0})}))))))},fj=({runtime:e,origin:n})=>{const[{layout:t,invitationCode:i,spaceKey:r,target:a},o]=l.useState({layout:e.layout,invitationCode:e.invitationCode,spaceKey:e.spaceKey,target:e.target}),s=Ye.useClient(),f=Bo.useSpace(r);switch(l.useEffect(()=>e.layoutUpdate.on(d=>o(d)),[e]),l.useEffect(()=>{if(t===Ye.ShellLayout.SPACE&&!f){fn.warn("No space found for shell space invitations.");const d=setTimeout(async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})});return()=>clearTimeout(d)}},[e,t,f]),t){case Ye.ShellLayout.INITIALIZE_IDENTITY:return l.createElement(t_,{mode:"halo-only",initialInvitationCode:i,onDone:()=>{e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});case Ye.ShellLayout.IDENTITY:case Ye.ShellLayout.SHARE_IDENTITY:case Ye.ShellLayout.EDIT_PROFILE:return l.createElement(ij,{createInvitationUrl:d=>`${n}?deviceInvitationCode=${d}`,onResetDevice:async()=>{await s.reset(),await e.setAppContext({display:Ye.ShellDisplay.NONE,reload:!0})},onJoinNewIdentity:()=>e.setLayout({layout:Ye.ShellLayout.INITIALIZE_IDENTITY}),onDone:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});case Ye.ShellLayout.SPACE:return f?l.createElement(sj,{space:f,target:a,createInvitationUrl:d=>`${n}?spaceInvitationCode=${d}`,onDone:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}}):null;case Ye.ShellLayout.JOIN_SPACE:return l.createElement(t_,{initialInvitationCode:i,onDone:async d=>{const u=(d==null?void 0:d.target)??void 0;await e.setAppContext({display:Ye.ShellDisplay.NONE,spaceKey:(d==null?void 0:d.spaceKey)??void 0,target:u}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})},onExit:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});default:return null}},lj={"en-US":Object.freeze(Object.defineProperty({__proto__:null,os:{"manage profile label":"Manage identity","identity offline description":"Offline","sidebar label":"DXOS sidebar","copy invitation code label":"Copy URL","copy success label":"Copied","copy self public key label":"Copy public key","open share panel label":"View QR code","joining space heading":"Joining space","join space heading":"Enter space invitation","halo heading":"Initialize device identity","exit label":"Exit","identity selector title":"Join as","identity radio group title":"Select an identity youโ€™ve associated with this device already","add identity label":"Add","continue label":"Continue","back label":"Back","next label":"Next","close label":"Close","auth choices label":"Choose an identity","create identity label":"Create an identity","create identity description":"Create a new identity.","recover identity label":"Use a seed phrase","recover identity description":"Enter your seed phrase to log in manually.","join identity label":"Use another device","join identity description":"Add this device to an identity youโ€™re already logged into on another device.","deselect identity label":"Back to identities","addition method chooser title":"An identity is required to continue","new identity input label":"Set display name","recover identity input label":"Type or paste your seed phrase","failed to create identity message":"Failed to create an identity.","failed to recover identity message":"Failed to recover an identity from the provided seed phrase.","failed to authenticate message":"Incorrect PIN.","identity added label":"Created identity & added to this device:","join space as identity heading":"<part>as </part><part><icon/><label>{{labelValue}}</label></part>","error status label":"Failed","timeout status label":"Timed out","cancelled status label":"Cancelled","init status label":"Ready to connect","connecting status label":"Connectingโ€ฆ","connected status label":"Enter confirmation PIN","authenticating status label":"Enter confirmation PIN","success status label":"Success","connect label":"Connect","reconnect label":"Reconnect","cancel label":"Cancel","done label":"Done","reset label":"Start over","auth code input label":"Enter the verification code","invitation input label":"Paste an invitation code or URL","create device invitation label":"Add device","create space invitation label":"Invite","qr label":"Scan to accept invitation","empty invitations message":"No pending invitations","empty device list message":"No devices authenticated other than this device.","show all spaces label":"All spaces","all spaces label":"All spaces","create space label":"Create a new space","join space label":"Join a space","show current space label":"Current space","view space invitations label":"View space invitations","toggle sidebar label":"Open/close sidebar","open sidebar label":"Open sidebar","close sidebar label":"Close sidebar","welcome message":"Welcome","selecting identity heading":"Selecting identity","devices heading":"Devices","identity heading":"Profile settings","choose add device label":"Add device","choose devices label":"Manage devices","choose profile label":"Edit profile","choose sign out label":"Sign out","empty space members message":"There is nobody in this space yet.","back to all invitations label":"Back to all invitations","invitation heading":"Invitation","invitation list heading":"Invitations","device invitation list heading":"Pending device invitations","space invitation list heading":"Pending invitations","device list heading":"Devices","space member list heading":"Members","space panel heading":"Space membership","auth code message":"Enter the following auth code on the joining device.","display name input label":"Display name","display name input placeholder":"Enter a display name","invite one label":"Invite one","invite one description":"Only one user may join.","invite one qr label":"Single-use","invite one list item label":"Active single-use invitation","invite many label":"Invite many","invite many description":"Anyone with the link can join.","invite many qr label":"Multiple-use","invite many list item label":"Active multiple-use invitation","invite options label":"Change the active invite option.","reset in progress label":"Resetting...","confirm label":"Confirm","reset identity input label":"This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.","failed to reset identity message":"Failed to reset identity.","confirmation value":"CONFIRM","sign out chooser title":"DANGER ZONE","sign out chooser message":"Proceeding with either action below will erase all data on this device.","join new identity label":"Join a new identity","reset device label":"Reset device","reset device confirm message":"Are you sure you want to reset your device? All data will be lost.","emoji and color label":"Emoji and color","clear label":"Use default","select emoji label":"Choose an emoji to use in your avatar","select hue label":"Choose a hue to use in your avatar","red label":"Red","orange label":"Orange","amber label":"Amber","yellow label":"Yellow","lime label":"Lime","green label":"Green","emerald label":"Emerald","teal label":"Teal","cyan label":"Cyan","sky label":"Sky","blue label":"Blue","indigo label":"Indigo","violet label":"Violet","purple label":"Purple","fuchsia label":"Fuchsia","pink label":"Pink","rose label":"Rose"}},Symbol.toStringTag,{value:"Module"}))},dj=async(e=new Ye.Config)=>{const n=new Ye.ClientServicesProxy(r_({channel:yi.DEFAULT_CLIENT_CHANNEL})),t=new Ye.Client({config:e,services:n}),i=new f_.ShellRuntimeImpl(r_({channel:yi.DEFAULT_SHELL_CHANNEL}));await Promise.all([i.open(),t.initialize()]),Pc(document.getElementById("root")).render(l.createElement(l.StrictMode,null,l.createElement(fS,{tx:yO,resourceExtensions:[lj]},l.createElement(Ye.ClientContext.Provider,{value:{client:t,status:Ye.SystemStatus.ACTIVE}},l.createElement(Xd,null,l.createElement(Pn.Provider,null,l.createElement(fj,{runtime:i,origin:location.origin})))))))};l.createContext({}),lt.runShell=dj,Object.defineProperty(lt,Symbol.toStringTag,{value:"Module"})});
929
+ `}return re.substring(0,re.length-1)},ee.renderTo2dContext=function(B,W){W=W||2;for(var V=ee.getModuleCount(),O=0;O<V;O++)for(var F=0;F<V;F++)B.fillStyle=ee.isDark(O,F)?"black":"white",B.fillRect(O*W,F*W,W,W)},ee};i.stringToBytesFuncs={default:function(I){for(var P=[],C=0;C<I.length;C+=1){var T=I.charCodeAt(C);P.push(T&255)}return P}},i.stringToBytes=i.stringToBytesFuncs.default,i.createStringToBytes=function(I,P){var C=function(){for(var N=k(I),j=function(){var oe=N.read();if(oe==-1)throw"eof";return oe},L=0,D={};;){var X=N.read();if(X==-1)break;var J=j(),ee=j(),ae=j(),fe=String.fromCharCode(X<<8|J),de=ee<<8|ae;D[fe]=de,L+=1}if(L!=P)throw L+" != "+P;return D}(),T=63;return function(N){for(var j=[],L=0;L<N.length;L+=1){var D=N.charCodeAt(L);if(D<128)j.push(D);else{var X=C[N.charAt(L)];typeof X=="number"?(X&255)==X?j.push(X):(j.push(X>>>8),j.push(X&255)):j.push(T)}}return j}};var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},a={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var I=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],P=1335,C=7973,T=21522,N={},j=function(L){for(var D=0;L!=0;)D+=1,L>>>=1;return D};return N.getBCHTypeInfo=function(L){for(var D=L<<10;j(D)-j(P)>=0;)D^=P<<j(D)-j(P);return(L<<10|D)^T},N.getBCHTypeNumber=function(L){for(var D=L<<12;j(D)-j(C)>=0;)D^=C<<j(D)-j(C);return L<<12|D},N.getPatternPosition=function(L){return I[L-1]},N.getMaskFunction=function(L){switch(L){case o.PATTERN000:return function(D,X){return(D+X)%2==0};case o.PATTERN001:return function(D,X){return D%2==0};case o.PATTERN010:return function(D,X){return X%3==0};case o.PATTERN011:return function(D,X){return(D+X)%3==0};case o.PATTERN100:return function(D,X){return(Math.floor(D/2)+Math.floor(X/3))%2==0};case o.PATTERN101:return function(D,X){return D*X%2+D*X%3==0};case o.PATTERN110:return function(D,X){return(D*X%2+D*X%3)%2==0};case o.PATTERN111:return function(D,X){return(D*X%3+(D+X)%2)%2==0};default:throw"bad maskPattern:"+L}},N.getErrorCorrectPolynomial=function(L){for(var D=d([1],0),X=0;X<L;X+=1)D=D.multiply(d([1,f.gexp(X)],0));return D},N.getLengthInBits=function(L,D){if(1<=D&&D<10)switch(L){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw"mode:"+L}else if(D<27)switch(L){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw"mode:"+L}else if(D<41)switch(L){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw"mode:"+L}else throw"type:"+D},N.getLostPoint=function(L){for(var D=L.getModuleCount(),X=0,J=0;J<D;J+=1)for(var ee=0;ee<D;ee+=1){for(var ae=0,fe=L.isDark(J,ee),de=-1;de<=1;de+=1)if(!(J+de<0||D<=J+de))for(var oe=-1;oe<=1;oe+=1)ee+oe<0||D<=ee+oe||de==0&&oe==0||fe==L.isDark(J+de,ee+oe)&&(ae+=1);ae>5&&(X+=3+ae-5)}for(var J=0;J<D-1;J+=1)for(var ee=0;ee<D-1;ee+=1){var me=0;L.isDark(J,ee)&&(me+=1),L.isDark(J+1,ee)&&(me+=1),L.isDark(J,ee+1)&&(me+=1),L.isDark(J+1,ee+1)&&(me+=1),(me==0||me==4)&&(X+=3)}for(var J=0;J<D;J+=1)for(var ee=0;ee<D-6;ee+=1)L.isDark(J,ee)&&!L.isDark(J,ee+1)&&L.isDark(J,ee+2)&&L.isDark(J,ee+3)&&L.isDark(J,ee+4)&&!L.isDark(J,ee+5)&&L.isDark(J,ee+6)&&(X+=40);for(var ee=0;ee<D;ee+=1)for(var J=0;J<D-6;J+=1)L.isDark(J,ee)&&!L.isDark(J+1,ee)&&L.isDark(J+2,ee)&&L.isDark(J+3,ee)&&L.isDark(J+4,ee)&&!L.isDark(J+5,ee)&&L.isDark(J+6,ee)&&(X+=40);for(var se=0,ee=0;ee<D;ee+=1)for(var J=0;J<D;J+=1)L.isDark(J,ee)&&(se+=1);var G=Math.abs(100*se/D/D-50)/5;return X+=G*10,X},N}(),f=function(){for(var I=new Array(256),P=new Array(256),C=0;C<8;C+=1)I[C]=1<<C;for(var C=8;C<256;C+=1)I[C]=I[C-4]^I[C-5]^I[C-6]^I[C-8];for(var C=0;C<255;C+=1)P[I[C]]=C;var T={};return T.glog=function(N){if(N<1)throw"glog("+N+")";return P[N]},T.gexp=function(N){for(;N<0;)N+=255;for(;N>=256;)N-=255;return I[N]},T}();function d(I,P){if(typeof I.length>"u")throw I.length+"/"+P;var C=function(){for(var N=0;N<I.length&&I[N]==0;)N+=1;for(var j=new Array(I.length-N+P),L=0;L<I.length-N;L+=1)j[L]=I[L+N];return j}(),T={};return T.getAt=function(N){return C[N]},T.getLength=function(){return C.length},T.multiply=function(N){for(var j=new Array(T.getLength()+N.getLength()-1),L=0;L<T.getLength();L+=1)for(var D=0;D<N.getLength();D+=1)j[L+D]^=f.gexp(f.glog(T.getAt(L))+f.glog(N.getAt(D)));return d(j,0)},T.mod=function(N){if(T.getLength()-N.getLength()<0)return T;for(var j=f.glog(T.getAt(0))-f.glog(N.getAt(0)),L=new Array(T.getLength()),D=0;D<T.getLength();D+=1)L[D]=T.getAt(D);for(var D=0;D<N.getLength();D+=1)L[D]^=f.gexp(f.glog(N.getAt(D))+j);return d(L,0).mod(N)},T}var u=function(){var I=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],P=function(N,j){var L={};return L.totalCount=N,L.dataCount=j,L},C={},T=function(N,j){switch(j){case a.L:return I[(N-1)*4+0];case a.M:return I[(N-1)*4+1];case a.Q:return I[(N-1)*4+2];case a.H:return I[(N-1)*4+3];default:return}};return C.getRSBlocks=function(N,j){var L=T(N,j);if(typeof L>"u")throw"bad rs block @ typeNumber:"+N+"/errorCorrectionLevel:"+j;for(var D=L.length/3,X=[],J=0;J<D;J+=1)for(var ee=L[J*3+0],ae=L[J*3+1],fe=L[J*3+2],de=0;de<ee;de+=1)X.push(P(ae,fe));return X},C}(),h=function(){var I=[],P=0,C={};return C.getBuffer=function(){return I},C.getAt=function(T){var N=Math.floor(T/8);return(I[N]>>>7-T%8&1)==1},C.put=function(T,N){for(var j=0;j<N;j+=1)C.putBit((T>>>N-j-1&1)==1)},C.getLengthInBits=function(){return P},C.putBit=function(T){var N=Math.floor(P/8);I.length<=N&&I.push(0),T&&(I[N]|=128>>>P%8),P+=1},C},v=function(I){var P=r.MODE_NUMBER,C=I,T={};T.getMode=function(){return P},T.getLength=function(L){return C.length},T.write=function(L){for(var D=C,X=0;X+2<D.length;)L.put(N(D.substring(X,X+3)),10),X+=3;X<D.length&&(D.length-X==1?L.put(N(D.substring(X,X+1)),4):D.length-X==2&&L.put(N(D.substring(X,X+2)),7))};var N=function(L){for(var D=0,X=0;X<L.length;X+=1)D=D*10+j(L.charAt(X));return D},j=function(L){if("0"<=L&&L<="9")return L.charCodeAt(0)-48;throw"illegal char :"+L};return T},m=function(I){var P=r.MODE_ALPHA_NUM,C=I,T={};T.getMode=function(){return P},T.getLength=function(j){return C.length},T.write=function(j){for(var L=C,D=0;D+1<L.length;)j.put(N(L.charAt(D))*45+N(L.charAt(D+1)),11),D+=2;D<L.length&&j.put(N(L.charAt(D)),6)};var N=function(j){if("0"<=j&&j<="9")return j.charCodeAt(0)-48;if("A"<=j&&j<="Z")return j.charCodeAt(0)-65+10;switch(j){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+j}};return T},g=function(I){var P=r.MODE_8BIT_BYTE,C=i.stringToBytes(I),T={};return T.getMode=function(){return P},T.getLength=function(N){return C.length},T.write=function(N){for(var j=0;j<C.length;j+=1)N.put(C[j],8)},T},b=function(I){var P=r.MODE_KANJI,C=i.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(j,L){var D=C(j);if(D.length!=2||(D[0]<<8|D[1])!=L)throw"sjis not supported."})("ๅ‹",38726);var T=C(I),N={};return N.getMode=function(){return P},N.getLength=function(j){return~~(T.length/2)},N.write=function(j){for(var L=T,D=0;D+1<L.length;){var X=(255&L[D])<<8|255&L[D+1];if(33088<=X&&X<=40956)X-=33088;else if(57408<=X&&X<=60351)X-=49472;else throw"illegal char at "+(D+1)+"/"+X;X=(X>>>8&255)*192+(X&255),j.put(X,13),D+=2}if(D<L.length)throw"illegal char at "+(D+1)},N},w=function(){var I=[],P={};return P.writeByte=function(C){I.push(C&255)},P.writeShort=function(C){P.writeByte(C),P.writeByte(C>>>8)},P.writeBytes=function(C,T,N){T=T||0,N=N||C.length;for(var j=0;j<N;j+=1)P.writeByte(C[j+T])},P.writeString=function(C){for(var T=0;T<C.length;T+=1)P.writeByte(C.charCodeAt(T))},P.toByteArray=function(){return I},P.toString=function(){var C="";C+="[";for(var T=0;T<I.length;T+=1)T>0&&(C+=","),C+=I[T];return C+="]",C},P},_=function(){var I=0,P=0,C=0,T="",N={},j=function(D){T+=String.fromCharCode(L(D&63))},L=function(D){if(!(D<0)){if(D<26)return 65+D;if(D<52)return 97+(D-26);if(D<62)return 48+(D-52);if(D==62)return 43;if(D==63)return 47}throw"n:"+D};return N.writeByte=function(D){for(I=I<<8|D&255,P+=8,C+=1;P>=6;)j(I>>>P-6),P-=6},N.flush=function(){if(P>0&&(j(I<<6-P),I=0,P=0),C%3!=0)for(var D=3-C%3,X=0;X<D;X+=1)T+="="},N.toString=function(){return T},N},k=function(I){var P=I,C=0,T=0,N=0,j={};j.read=function(){for(;N<8;){if(C>=P.length){if(N==0)return-1;throw"unexpected end of file./"+N}var D=P.charAt(C);if(C+=1,D=="=")return N=0,-1;if(D.match(/^\s$/))continue;T=T<<6|L(D.charCodeAt(0)),N+=6}var X=T>>>N-8&255;return N-=8,X};var L=function(D){if(65<=D&&D<=90)return D-65;if(97<=D&&D<=122)return D-97+26;if(48<=D&&D<=57)return D-48+52;if(D==43)return 62;if(D==47)return 63;throw"c:"+D};return j},E=function(I,P){var C=I,T=P,N=new Array(I*P),j={};j.setPixel=function(J,ee,ae){N[ee*C+J]=ae},j.write=function(J){J.writeString("GIF87a"),J.writeShort(C),J.writeShort(T),J.writeByte(128),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(0),J.writeByte(255),J.writeByte(255),J.writeByte(255),J.writeString(","),J.writeShort(0),J.writeShort(0),J.writeShort(C),J.writeShort(T),J.writeByte(0);var ee=2,ae=D(ee);J.writeByte(ee);for(var fe=0;ae.length-fe>255;)J.writeByte(255),J.writeBytes(ae,fe,255),fe+=255;J.writeByte(ae.length-fe),J.writeBytes(ae,fe,ae.length-fe),J.writeByte(0),J.writeString(";")};var L=function(J){var ee=J,ae=0,fe=0,de={};return de.write=function(oe,me){if(oe>>>me)throw"length over";for(;ae+me>=8;)ee.writeByte(255&(oe<<ae|fe)),me-=8-ae,oe>>>=8-ae,fe=0,ae=0;fe=oe<<ae|fe,ae=ae+me},de.flush=function(){ae>0&&ee.writeByte(fe)},de},D=function(J){for(var ee=1<<J,ae=(1<<J)+1,fe=J+1,de=X(),oe=0;oe<ee;oe+=1)de.add(String.fromCharCode(oe));de.add(String.fromCharCode(ee)),de.add(String.fromCharCode(ae));var me=w(),se=L(me);se.write(ee,fe);var G=0,Y=String.fromCharCode(N[G]);for(G+=1;G<N.length;){var ie=String.fromCharCode(N[G]);G+=1,de.contains(Y+ie)?Y=Y+ie:(se.write(de.indexOf(Y),fe),de.size()<4095&&(de.size()==1<<fe&&(fe+=1),de.add(Y+ie)),Y=ie)}return se.write(de.indexOf(Y),fe),se.write(ae,fe),se.flush(),me.toByteArray()},X=function(){var J={},ee=0,ae={};return ae.add=function(fe){if(ae.contains(fe))throw"dup key:"+fe;J[fe]=ee,ee+=1},ae.size=function(){return ee},ae.indexOf=function(fe){return J[fe]},ae.contains=function(fe){return typeof J[fe]<"u"},ae};return j},S=function(I,P,C){for(var T=E(I,P),N=0;N<P;N+=1)for(var j=0;j<I;j+=1)T.setPixel(j,N,C(j,N));var L=w();T.write(L);for(var D=_(),X=L.toByteArray(),J=0;J<X.length;J+=1)D.writeByte(X[J]);return D.flush(),"data:image/gif;base64,"+D};return i}();(function(){t.stringToBytesFuncs["UTF-8"]=function(i){function r(a){for(var o=[],s=0;s<a.length;s++){var f=a.charCodeAt(s);f<128?o.push(f):f<2048?o.push(192|f>>6,128|f&63):f<55296||f>=57344?o.push(224|f>>12,128|f>>6&63,128|f&63):(s++,f=65536+((f&1023)<<10|a.charCodeAt(s)&1023),o.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return o}return r(i)}})(),function(i){e.exports=i()}(function(){return t})})(jw);var kB=jw.exports;const Tc=xr(kB);var xB=Object.defineProperty,qf=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Uw=Object.prototype.propertyIsEnumerable,zw=(e,n,t)=>n in e?xB(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,EB=(e,n)=>{for(var t in n||(n={}))Rw.call(n,t)&&zw(e,t,n[t]);if(qf)for(var t of qf(n))Uw.call(n,t)&&zw(e,t,n[t]);return e},SB=(e,n)=>{var t={};for(var i in e)Rw.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&qf)for(var i of qf(e))n.indexOf(i)<0&&Uw.call(e,i)&&(t[i]=e[i]);return t},vi=1e3,CB=/code length overflow/i;Tc.stringToBytes=Tc.stringToBytesFuncs["UTF-8"];var $B=(e,n,t)=>{t=Math.max(1,t);for(let i=t;i<=40;i+=1)try{const r=Tc(i,n);r.addData(e),r.make();const a=r.getModuleCount();return{text:e,level:n,version:i,moduleCount:a,isDark:(s,f)=>s>=0&&s<a&&f>=0&&f<a&&r.isDark(s,f)}}catch(r){if(!(i<40&&CB.test(String(r))))throw r}return null},Hi=Math.round,ga=(e,n)=>`M ${Hi(e)} ${Hi(n)}`,Jn=(e,n)=>`L ${Hi(e)} ${Hi(n)}`,Vi=(e,n,t)=>`A ${Hi(t)} ${Hi(t)} 0 0 1 ${Hi(e)} ${Hi(n)}`,AB=(e,n,t,i,r,a,o,s,f)=>{const d=[];return a?d.push(ga(e+r,n)):d.push(ga(e,n)),o?d.push(Jn(t-r,n),Vi(t,n+r,r)):d.push(Jn(t,n)),s?d.push(Jn(t,i-r),Vi(t-r,i,r)):d.push(Jn(t,i)),f?d.push(Jn(e+r,i),Vi(e,i-r,r)):d.push(Jn(e,i)),a?d.push(Jn(e,n+r),Vi(e+r,n,r)):d.push(Jn(e,n)),d.join(" ")},TB=(e,n,t,i,r,a,o,s,f)=>{const d=[];return a&&d.push(ga(e+r,n),Jn(e,n),Jn(e,n+r),Vi(e+r,n,r)),o&&d.push(ga(t,n+r),Jn(t,n),Jn(t-r,n),Vi(t,n+r,r)),s&&d.push(ga(t-r,i),Jn(t,i),Jn(t,i-r),Vi(t-r,i,r)),f&&d.push(ga(e,i-r),Jn(e,i),Jn(e+r,i),Vi(e,i-r,r)),d.join(" ")},OB=(e,n,t,i,r)=>{const a=r*t,o=i*t,s=a+t,f=o+t,d=n*.005*t,u=e.isDark,h=i-1,v=i+1,m=r-1,g=r+1,b=u(i,r),w=u(h,m),_=u(h,r),k=u(h,g),E=u(i,g),S=u(v,g),I=u(v,r),P=u(v,m),C=u(i,m);return b?AB(a,o,s,f,d,!_&&!C,!_&&!E,!I&&!E,!I&&!C):TB(a,o,s,f,d,_&&C&&w,_&&E&&k,I&&E&&S,I&&C&&P)},PB=(e,n)=>{if(!e)return"";const t=e.moduleCount,i=vi/t,r=[];for(let a=0;a<t;a+=1)for(let o=0;o<t;o+=1)r.push(OB(e,n,i,a,o));return r.join(" ")},IB=e=>{var n=e,{color:t="#000",backgroundColor:i,cutout:r=!1,cutoutElement:a,errorCorrectionLevel:o="Q",rounding:s=0,children:f}=n,d=SB(n,["color","backgroundColor","cutout","cutoutElement","errorCorrectionLevel","rounding","children"]),u,h;const v=l.useMemo(()=>$B(f,o,1),[f,o]);if(!v)return null;const m=(u=v==null?void 0:v.moduleCount)!=null?u:1,b=vi/((h=v==null?void 0:v.moduleCount)!=null?h:1)*(Math.floor(m*.18)*2-1)+2,w=(vi-b)/2;return be.createElement("svg",EB({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${vi} ${vi}`},d),r?be.createElement("mask",{id:"react-qr-rounded__mask"},be.createElement("rect",{x:"0",y:"0",width:vi,height:vi,fill:"#fff"}),be.createElement("rect",{x:w,y:w,width:b,height:b,rx:s,ry:s,fill:"#000"})):null,i?be.createElement("rect",{x:"0",y:"0",width:vi,height:vi,fill:i}):null,be.createElement("path",{fill:t,d:PB(v,s),mask:r?"url(#react-qr-rounded__mask)":void 0}),a?be.createElement("foreignObject",{x:w,y:w,width:b,height:b},be.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%",overflow:"hidden",borderRadius:s}},a)):null)};const FB=new Map([[_e.State.ERROR,-3],[_e.State.TIMEOUT,-2],[_e.State.CANCELLED,-1],[_e.State.INIT,0],[_e.State.CONNECTING,1],[_e.State.CONNECTED,2],[_e.State.READY_FOR_AUTHENTICATION,3],[_e.State.AUTHENTICATING,4],[_e.State.SUCCESS,5]]),Oc=({children:e,...n})=>l.createElement(vn.View,{...n,classNames:"grow flex flex-col justify-around items-center"},e),Ww=({invitationUrl:e,active:n,send:t,status:i,type:r,authCode:a,id:o="0"})=>{const{t:s}=sn("os"),f=Tn("invitation-manager__qr-code"),d=r===_e.Type.MULTIUSE?0:FB.get(i)??0,u=d===3,h=ao(o),v=l.useMemo(()=>{switch(!0){case d===5:case d<0:return"showing final";case d===3:return"showing auth code";default:return"showing qr"}},[d]);return l.createElement(l.Fragment,null,l.createElement(vn.Root,{activeView:v,classNames:"grow plb-1"},l.createElement(vn.Views,null,l.createElement(Oc,{id:"showing qr",emoji:h},l.createElement("p",{className:"text-sm mlb-1 font-normal text-center"},s(r===_e.Type.MULTIUSE?"invite many qr label":"invite one qr label")),l.createElement("div",{role:"none",className:le(Mn,"is-full max-is-[14rem] relative")},l.createElement(IB,{rounding:100,backgroundColor:"transparent",color:"currentColor",className:le("is-full bs-full p-2",u&&"invisible"),"aria-labelledby":f,errorCorrectionLevel:"Q",cutout:!0},e??"never"),l.createElement(lD,null,l.createElement(ec,{text:h}))),l.createElement("span",{id:f,className:"sr-only"},s("qr label")),l.createElement(wO,{variant:"ghost",value:e??"never"})),l.createElement(Oc,{id:"showing auth code"},l.createElement(jy,null,s("auth code message")),l.createElement(Ly,{code:a,large:!0,classNames:"text-black dark:text-white"}),l.createElement(jy,null,"Be sure the other device is showing this symbol:"),h&&l.createElement(ec,{text:h})),l.createElement(Oc,{id:"showing final"},d>0?l.createElement(qe.Check,{className:le("m-1.5",We(6))}):l.createElement(qe.X,{className:le("m-1.5",We(6))})))),l.createElement(it,{classNames:"mbs-4"},l.createElement(un,{disabled:!n,onClick:()=>t==null?void 0:t({type:"deselectInvitation"})},s("back label"))))},ba="pbs-1 pbe-3 pli-3",NB=({titleId:e,title:n,identity:t,onDone:i})=>{var a,o,s,f,d;const r=eb(t.identityKey);return l.createElement(nc,{titleId:e,title:n,corner:l.createElement(By,{onDone:i})},l.createElement(Dn.Root,{size:12,variant:"circle",status:"active",hue:((o=(a=t.profile)==null?void 0:a.data)==null?void 0:o.hue)||r.hue},l.createElement(Dn.Frame,{classNames:"block mbs-4 mbe-2 mli-auto chromatic-ignore"},l.createElement(Dn.Fallback,{text:((f=(s=t.profile)==null?void 0:s.data)==null?void 0:f.emoji)||r.emoji})),l.createElement(Dn.Label,{classNames:"block text-center font-light text-xl","data-testid":"identityHeading.displayName"},((d=t.profile)==null?void 0:d.displayName)??ff(t.identityKey.toHex()))))},Hw=e=>{const{identity:n,titleId:t,activeView:i,onUpdateProfile:r,onResetDevice:a,onJoinNewIdentity:o,IdentityActionChooser:s=pB,InvitationManager:f=Ww,onDone:d,...u}=e,{t:h}=sn("os"),v=l.useMemo(()=>{switch(i){case"agent manager":return"Manage Agent";case"device invitation manager":return h("choose add device label");default:return h("identity heading")}},[i,h]);return l.createElement(Rr,{density:"fine"},l.createElement(NB,{identity:n,titleId:t,title:v,onDone:d}),l.createElement(vn.Root,{activeView:i},l.createElement(vn.Views,null,l.createElement(vn.View,{id:"identity action chooser",classNames:ba},l.createElement(s,{active:i==="identity action chooser",...u})),l.createElement(vn.View,{id:"device invitation manager",classNames:ba},l.createElement(f,{active:i==="device invitation manager",...u,invitationUrl:u.createInvitationUrl(u.invitationCode)})),l.createElement(vn.View,{id:"device manager",classNames:ba},l.createElement(vB,{active:i==="device manager",...u})),l.createElement(vn.View,{classNames:ba,id:"update profile form"},l.createElement(gB,{send:u.send,active:i==="update profile form",identity:n,onUpdateProfile:r})),l.createElement(vn.View,{classNames:ba,id:"signing out"},l.createElement(yB,{send:u.send,active:i==="signing out",onResetDevice:a,onJoinNewIdentity:o})),l.createElement(vn.View,{classNames:ba,id:"agent manager"},l.createElement(hB,{send:u.send,active:i==="agent manager",...u})))))},MB=({invitation:e,...n})=>{const t=Qu(e);return l.createElement(Hw,{...n,...t})},DB=({titleId:e,createInvitationUrl:n=i=>i,...t})=>{const i=Tn("identityPanel__heading",e),r=Ye.useClient(),a=Ki.useDevices(),o=Ki.useIdentity(),s=Ki.useHaloInvitations(),f=_B({client:r,identity:o,invitations:s});if(!o)return console.error("IdentityPanel rendered with no active identity."),null;const[d,u,h]=cB(r);l.useEffect(()=>h.subscribe(w=>{fn("[state]",w)}).unsubscribe,[h]);const v=l.useMemo(()=>{switch(!0){case d.matches("choosingAction"):return"identity action chooser";case d.matches("managingDeviceInvitation"):return"device invitation manager";case d.matches("managingDevices"):return"device manager";case[{managingProfile:"idle"},{managingProfile:"pending"}].some(d.matches):return"update profile form";case d.matches("signingOut"):return"signing out";case[{managingAgent:"idle"},{managingAgent:"pending"}].some(d.matches):return"agent manager";default:return"identity action chooser"}},[d]),g={...t,identity:o,devices:a,activeView:v,send:u,titleId:i,createInvitationUrl:n,onUpdateProfile:async b=>{u({type:"updateProfile"}),await r.halo.updateProfile(b)},...f};return d.context.invitation?l.createElement(MB,{...g,invitation:d.context.invitation}):l.createElement(Hw,{...g})},LB=l.forwardRef(({mode:e,titleId:n,onExit:t,exitActionParent:i},r)=>{const{t:a}=sn("os"),o=l.createElement(tt,{variant:"ghost",...t&&{onClick:t},classNames:le(Mn,"plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),"data-testid":"join-exit"},l.createElement(qe.X,{weight:"bold",className:We(4)}),l.createElement("span",{className:"sr-only"},a("exit label")));return l.createElement(nc,{ref:r,titleId:n,title:a(e==="halo-only"?"selecting identity heading":"joining space heading"),...e==="halo-only"?{titleSrOnly:!0}:{corner:i?l.cloneElement(i,{},o):o},titleSrOnly:e==="halo-only"})}),Vw=(e,n)=>(fn("[subscribing to invitation]",n),{subscribe:(t,i,r)=>n.subscribe(a=>{switch(a.state){case _e.State.CONNECTING:return fn("[invitation connecting]",{Kind:e,invitation:a}),t({type:`connecting${e}Invitation`,invitation:a});case _e.State.CONNECTED:return fn("[invitation connected]",{Kind:e,invitation:a}),t({type:`connected${e}Invitation`,invitation:a});case _e.State.READY_FOR_AUTHENTICATION:return fn("[invitation ready for authentication]",{Kind:e,invitation:a}),t({type:`readyForAuthentication${e}Invitation`,invitation:a});case _e.State.AUTHENTICATING:return fn("[invitation authenticating]",{Kind:e,invitation:a}),t({type:`authenticating${e}Invitation`,invitation:a});case _e.State.SUCCESS:return fn("[invitation success]",{Kind:e,invitation:a}),t({type:`success${e}Invitation`,invitation:a}),r==null?void 0:r();case _e.State.CANCELLED:return fn.warn("[invitation cancelled]",{Kind:e}),t({type:`fail${e}Invitation`,reason:"cancelled"});case _e.State.TIMEOUT:return fn.error("[invitation timeout]",{Kind:e}),t({type:`fail${e}Invitation`,reason:"timeout"})}},a=>a instanceof Ye.AlreadyJoinedError?(fn("[already joined]",{Kind:e,error:a}),t({type:`success${e}Invitation`,invitation:n.get()}),r==null?void 0:r()):(fn.error("[invitation errored]",{Kind:e,error:a}),t({type:`fail${e}Invitation`,reason:"error"}),i==null?void 0:i(a)))}),qw=(e,n)=>({initial:`unknown${e}`,states:{[`unknown${e}`]:{always:[{cond:({mode:i})=>i==="halo-only"&&e==="Space",target:"#join.finishingJoiningHalo"},{cond:i=>!!i[e.toLowerCase()].unredeemedCode,target:`acceptingRedeemed${e}Invitation`,actions:[`redeem${e}InvitationCode`,`invalidate${e}InvitationCode`,"log"]},{target:`inputting${e}InvitationCode`,actions:"log"}]},[`inputting${e}InvitationCode`]:{},[`acceptingRedeemed${e}Invitation`]:{invoke:{src:i=>i[e.toLowerCase()].invitationSubscribable},initial:`unknown${e}Invitation`,states:{[`unknown${e}Invitation`]:{always:[{cond:i=>{var r,a;if(e!=="Space")return!1;{const o=(a=(r=i.space.invitation)==null?void 0:r.spaceKey)==null?void 0:a.toHex(),s=i.space.succeededKeys;return o?!!(s!=null&&s.has(o)):!1}},target:n,actions:"log"},{cond:i=>{const r=i[e.toLowerCase()].invitation;return!r||(r==null?void 0:r.state)===_e.State.CONNECTING},target:`connecting${e}Invitation`,actions:"log"},{target:`inputting${e}VerificationCode`,actions:"log"}]},[`connecting${e}Invitation`]:{},[`inputting${e}VerificationCode`]:{},[`authenticating${e}VerificationCode`]:{on:{[`readyForAuthentication${e}Invitation`]:{target:`authenticationFailing${e}VerificationCode`,actions:["setInvitation","log"]}}},[`authenticationFailing${e}VerificationCode`]:{},[`failing${e}Invitation`]:{},[`success${e}Invitation`]:{}},on:{[`reset${e}Invitation`]:{target:`#join${e==="Halo"?".choosingIdentity":""}.accepting${e}Invitation.unknown${e}`,actions:["resetInvitation","log"]},[`connecting${e}Invitation`]:{target:`.connecting${e}Invitation`,actions:["setInvitation","log"]},[`connected${e}Invitation`]:{target:`.connecting${e}Invitation`,actions:["setInvitation","log"]},[`readyForAuthentication${e}Invitation`]:{target:`.inputting${e}VerificationCode`,actions:["setInvitation","log"]},[`authenticating${e}Invitation`]:{target:`.authenticating${e}VerificationCode`,actions:["setInvitation","log"]},[`success${e}Invitation`]:{target:n,actions:["setInvitation","log"]},[`fail${e}Invitation`]:{target:`.failing${e}Invitation`,actions:[rt({[e.toLowerCase()]:(i,r)=>({...i[e.toLowerCase()],failReason:r.reason})}),"log"]}}}},on:{[`set${e}InvitationCode`]:{target:`.acceptingRedeemed${e}Invitation`,actions:[rt({[e.toLowerCase()]:(i,r)=>({...i[e.toLowerCase()],unredeemedCode:r.code,succeededKeys:r.succeededKeys})}),`redeem${e}InvitationCode`,`invalidate${e}InvitationCode`,"log"]}}}),BB=$c({id:"join",predictableActionArguments:!0,context:{mode:"default",identity:null,halo:{},space:{}},initial:"unknown",states:{unknown:{always:[{cond:"existingIdentity",target:"resettingIdentity",actions:"log"},{cond:"noSelectedIdentity",target:"choosingIdentity",actions:"log"},{target:"acceptingSpaceInvitation",actions:"log"}]},choosingIdentity:{initial:"unknownAuthMethod",states:{unknownAuthMethod:{always:[{cond:"hasHaloUnredeemedCode",target:"acceptingHaloInvitation",actions:"log"},{target:"choosingAuthMethod",actions:"log"}]},choosingAuthMethod:{},recoveringIdentity:{},creatingIdentity:{},acceptingHaloInvitation:qw("Halo","#join.acceptingSpaceInvitation"),confirmingAddedIdentity:{}},on:{recoverIdentity:{target:".recoveringIdentity",actions:"log"},createIdentity:{target:".creatingIdentity",actions:"log"},acceptHaloInvitation:{target:".acceptingHaloInvitation",actions:"log"},addIdentity:{target:".confirmingAddedIdentity",actions:"log"},selectIdentity:{target:"acceptingSpaceInvitation",actions:["setIdentity","log"]},deselectAuthMethod:{target:".choosingAuthMethod",actions:"log"}}},resettingIdentity:{},acceptingSpaceInvitation:qw("Space","#join.finishingJoiningSpace"),finishingJoiningSpace:{type:"final"},finishingJoiningHalo:{type:"final"}},on:{resetIdentity:{target:"choosingIdentity",actions:"unsetIdentity"}}},{guards:{existingIdentity:({identity:e,mode:n},t)=>n==="halo-only"&&!!e,noSelectedIdentity:({identity:e},n)=>!e,hasHaloUnredeemedCode:({halo:e},n)=>!!e.unredeemedCode,noSpaceInvitation:({space:e},n)=>!e.invitation&&!e.unredeemedCode},actions:{setIdentity:rt({identity:(e,n)=>n.identity}),unsetIdentity:rt({identity:()=>null}),resetInvitation:rt({halo:(e,n)=>n.type!=="resetHaloInvitation"?e.halo:(e.halo.invitationObservable&&e.halo.invitationObservable.cancel(),{...e.halo,invitation:void 0,invitationObservable:void 0,invitationSubscribable:void 0}),space:(e,n)=>n.type!=="resetSpaceInvitation"?e.space:(e.space.invitationObservable&&e.space.invitationObservable.cancel(),{...e.space,invitation:void 0,invitationObservable:void 0,invitationSubscribable:void 0})}),setInvitation:rt({halo:(e,n)=>n.type.includes("Halo")?{...e.halo,invitation:n.invitation}:e.halo,space:(e,n)=>n.type.includes("Space")?{...e.space,invitation:n.invitation}:e.space}),log:(e,n)=>{fn("[transition]",{event:n,haloInvitation:e.halo.invitation,spaceInvitation:e.space.invitation})}}}),Gw=(e,n)=>{try{const t=new URLSearchParams(n.substring(n.lastIndexOf("?")));return t.get(`${e}InvitationCode`)??t.get(`${e}Invitation`)??t.get("invitationCode")??t.get("invitation")??n}catch(t){return fn.catch(t),n}},jB=(e,n)=>{const t=l.useCallback(({halo:o})=>{if(o.unredeemedCode)try{const s=yi.InvitationEncoder.decode(Gw("halo",o.unredeemedCode)),f=e.halo.join(s);return{...o,invitationObservable:f,invitationSubscribable:Vw("Halo",f)}}catch(s){return fn.error("Could not redeem device invitation code",s),o}else return o},[e]),i=l.useCallback(({space:o})=>{if(o.unredeemedCode)try{const s=yi.InvitationEncoder.decode(Gw("space",o.unredeemedCode)),f=e.spaces.join(s);return{...o,invitationObservable:f,invitationSubscribable:Vw("Space",f)}}catch(s){return fn.error("Could not redeem space invitation code",s),o}else return o},[e]),r=l.useCallback(({halo:o})=>{var s;return o.unredeemedCode?((s=n==null?void 0:n.onInvalidateInvitationCode)==null||s.call(n,o.unredeemedCode),{...o,unredeemedCode:void 0}):o},[n==null?void 0:n.onInvalidateInvitationCode]),a=l.useCallback(({space:o})=>{var s;return o.unredeemedCode?((s=n==null?void 0:n.onInvalidateInvitationCode)==null||s.call(n,o.unredeemedCode),{...o,unredeemedCode:void 0}):o},[n==null?void 0:n.onInvalidateInvitationCode]);return Ac(BB,{...n,actions:{...n==null?void 0:n.actions,redeemHaloInvitationCode:rt({halo:t}),redeemSpaceInvitationCode:rt({space:i}),invalidateHaloInvitationCode:rt({halo:r}),invalidateSpaceInvitationCode:rt({space:a})}})},RB=e=>{const n=!e.active,{send:t}=e,{t:i}=sn("os"),r={disabled:n,after:l.createElement(qe.CaretRight,{className:We(4),weight:"bold"}),slots:{label:{className:"text-sm"}}};return l.createElement(l.Fragment,null,l.createElement(kt,null,i("addition method chooser title")),l.createElement("div",{role:"none",className:"flex flex-col gap-1 grow"},l.createElement(Zd,{...r,description:i("create identity description"),before:l.createElement(qe.Plus,{className:We(6)}),onClick:()=>t({type:"createIdentity"}),"data-autofocus":"choosingAuthMethod","data-testid":"identity-chooser.create-identity"},i("create identity label")),l.createElement(Zd,{...r,description:i("join identity description"),before:l.createElement(qe.QrCode,{className:We(6)}),onClick:()=>t({type:"acceptHaloInvitation"}),"data-testid":"identity-chooser.join-identity"},i("join identity label")),l.createElement(Zd,{...r,disabled:!0,description:i("recover identity description"),before:l.createElement(qe.Textbox,{className:We(6)}),onClick:()=>t({type:"recoverIdentity"}),"data-testid":"identity-chooser.recover-identity"},i("recover identity label"))))},UB=e=>{var g,b,w,_,k,E;const{mode:n,addedIdentity:t,active:i,send:r,onDone:a,doneActionParent:o}=e,s=!i,{t:f}=sn("os"),d=(t==null?void 0:t.identityKey.toHex())??"0",u=nb(d),h=Tn("identityListItem__label"),v=((g=t==null?void 0:t.profile)==null?void 0:g.displayName)??(t&&ff(d)),m=l.createElement(un,{...a&&{onClick:()=>a(null)},disabled:s,"data-autofocus":"confirmingAddedIdentity","data-testid":"identity-added-done"},l.createElement("span",null,f("done label")));return l.createElement(l.Fragment,null,l.createElement(kt,null,f("identity added label")),l.createElement("div",{role:"none",className:"grow flex flex-col items-center justify-center text-center gap-2"},l.createElement(Dn.Root,{status:"active",labelId:h,hue:((w=(b=t==null?void 0:t.profile)==null?void 0:b.data)==null?void 0:w.hue)||u.hue},l.createElement(Dn.Frame,null,l.createElement(Dn.Fallback,{text:((k=(_=t==null?void 0:t.profile)==null?void 0:_.data)==null?void 0:k.emoji)||u.emoji})),l.createElement(Dn.Label,{classNames:le("text-lg truncate",!((E=t==null?void 0:t.profile)!=null&&E.displayName)&&"font-mono")},v))),l.createElement(it,null,n==="halo-only"?o?l.cloneElement(o,{},m):m:l.createElement(un,{variant:"primary",disabled:s||!t,onClick:()=>t&&r({type:"selectIdentity",identity:t}),"data-autofocus":"confirmingAddedIdentity"},f("continue label"))))},zB=e=>{const{send:n,method:t}=e,i=t==="recover identity",r=Ye.useClient(),{t:a}=sn("os"),[o,s]=l.useState(""),f=d=>{r.halo.createIdentity({[i?"seedphrase":"displayName"]:d}).then(u=>{n==null||n({type:"selectIdentity",identity:u})},u=>{fn.catch(u),s(a(i?"failed to recover identity message":"failed to create identity message"))})};return l.createElement(WB,{...e,onDisplayNameConfirm:f,validationMessage:o})},WB=e=>{const{method:n,send:t,active:i,onDisplayNameConfirm:r,validationMessage:a}=e,o=!i,{t:s}=sn("os"),[f,d]=l.useState(""),u=n==="recover identity";return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:a,label:l.createElement(kt,null,s(u?"recover identity input label":"new identity input label")),disabled:o,"data-testid":"identity-input",placeholder:u?"Type your recovery phrase":"Type a display name",onChange:({target:{value:h}})=>d(h)})),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:o,onClick:()=>t==null?void 0:t({type:"deselectAuthMethod"}),"data-testid":`${n==="recover identity"?"recover":"create"}-identity-input-back`},s("back label")),l.createElement(un,{variant:"primary",disabled:o,onClick:()=>r==null?void 0:r(f),"data-testid":`${n==="recover identity"?"recover":"create"}-identity-input-continue`},s("continue label"))))},Kw=e=>{const{active:n,Kind:t,doneActionParent:i,onDone:r}=e,a=!n,{t:o}=sn("os"),s=l.createElement(un,{variant:"primary",onClick:r,disabled:a,"data-autofocus":`success${t}Invitation finishingJoining${t}`,"data-testid":`${t.toLowerCase()}-invitation-accepted-done`},o("done label"));return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement("p",{className:"text-center text-sm font-normal"},o("welcome message"))),l.createElement(it,null,i?l.cloneElement(i,{},s):s))},HB=e=>{try{const n=new URLSearchParams(e.substring(e.lastIndexOf("?")));return n.get("spaceInvitationCode")??n.get("deviceInvitationCode")??e}catch(n){return fn.catch(n),e}},Yw=e=>{const{Kind:n,active:t,send:i,unredeemedCode:r,onExit:a,exitActionParent:o,onDone:s,doneActionParent:f,succeededKeys:d}=e,u=!t,{t:h}=sn("os"),[v,m]=l.useState(r??"");l.useEffect(()=>{r&&m(r??"")},[r]);const g=()=>{v.trim().length!==0&&i({type:`set${n}InvitationCode`,code:HB(v),...n==="Space"&&{succeededKeys:d}})},b=l.createElement(un,{variant:"ghost",disabled:u,...a?{onClick:()=>a()}:{onClick:()=>s==null?void 0:s(null)},"data-testid":"join-exit"},h("cancel label"));return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{label:l.createElement(kt,null,h("invitation input label")),placeholder:"Type an invitation code",disabled:u,value:v,onChange:({target:{value:w}})=>m(w),"data-autofocus":`inputting${n}InvitationCode`,"data-testid":`${n.toLowerCase()}-invitation-input`,onKeyUp:({key:w})=>w==="Enter"&&g()})),l.createElement(it,null,n==="Halo"?l.createElement(un,{variant:"ghost",disabled:u,onClick:()=>i({type:"deselectAuthMethod"}),"data-testid":`${n.toLowerCase()}-invitation-input-back`},h("back label")):o?l.cloneElement(o,{},b):f?l.cloneElement(f,{},b):b,l.createElement(un,{variant:"primary",disabled:u,onClick:g,"data-testid":`${n.toLowerCase()}-invitation-input-continue`},h("continue label"))))},VB=({invitationState:e,onInvitationCancel:n,active:t,send:i,Kind:r,failReason:a})=>{const{t:o}=sn("os");return a?l.createElement(l.Fragment,null,l.createElement(kt,{className:Mn},o(a==="timeout"?"timeout status label":a==="cancelled"?"cancelled status label":"error status label")),l.createElement("div",{role:"none",className:"grow"}),l.createElement(it,null,l.createElement(un,{disabled:!t,onClick:()=>i({type:`reset${r}Invitation`}),"data-testid":"invitation-rescuer-reset"},o("reset label")))):l.createElement(l.Fragment,null,l.createElement(kt,{className:Mn},o("connecting status label")),l.createElement("div",{role:"none",className:"grow"}),l.createElement(it,null,l.createElement(un,{disabled:!0,classNames:"order-2","data-testid":"next"},o("next label")),l.createElement(un,{disabled:!t,onClick:n,"data-testid":"invitation-rescuer-cancel"},o("cancel label"))))},Jw=e=>{const{Kind:n,invitationState:t,active:i,send:r}=e,{t:a}=sn("os");return l.createElement(l.Fragment,null,typeof t>"u"?l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(kt,{className:Mn},"There was a problem joining the space")),l.createElement(it,null,l.createElement(un,{disabled:!i,"data-testid":"invitation-rescuer-blank-reset",onClick:()=>r({type:`reset${n}Invitation`})},a("reset label")))):l.createElement(VB,{...e}))},Xw=6,Zw=({failed:e,Kind:n,active:t,pending:i,invitationId:r,onInvitationAuthenticate:a,onInvitationCancel:o})=>{const s=!t||i,{t:f}=sn("os"),d=n.toLowerCase(),[u,h]=l.useState(""),v=({target:{value:m}})=>{var g;h(m),m.length===Xw&&((g=document.querySelector(`[data-autofocus-pinlength="${d}"]`))==null||g.focus())};return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},r&&l.createElement(ec,{text:ao(r)}),l.createElement(Gt.Root,{...e&&{validationValence:"error"}},l.createElement(Gt.Label,{asChild:!0},l.createElement(kt,null,f("auth code input label"))),l.createElement(Gt.PinInput,{disabled:s,length:Xw,onChange:v,inputMode:"numeric",autoComplete:"off",pattern:"\\d*","data-autofocus":`connecting${n}Invitation inputting${n}VerificationCode authenticationFailing${n}VerificationCode authenticating${n}VerificationCode`,"data-prevent-ios-autofocus":!0,"data-testid":`${d}-auth-code-input`,"data-1p-ignore":!0}),e&&l.createElement(Gt.DescriptionAndValidation,{classNames:"text-center"},l.createElement(Gt.Validation,null,f("failed to authenticate message"))))),l.createElement(it,null,l.createElement(un,{variant:"ghost",disabled:s,onClick:()=>o==null?void 0:o(),"data-testid":`${d}-invitation-authenticator-cancel`},f("cancel label")),l.createElement(un,{variant:"primary",disabled:s,onClick:()=>a==null?void 0:a(u),"data-autofocus-pinlength":d,"data-testid":`${d}-invitation-authenticator-next`},f("next label"))))},qB=({send:e,active:n})=>{const t=Ye.useClient(),{t:i}=sn("os"),[r,a]=l.useState(""),[o,s]=l.useState(!1),f=()=>{s(!0),t.reset().then(()=>e==null?void 0:e({type:"resetIdentity"}),d=>{fn.catch(d),a(i("failed to reset identity message")),s(!1)})};return l.createElement(GB,{disabled:!n,pending:o,validationMessage:r,onConfirm:()=>f()})},GB=({disabled:e,pending:n,validationMessage:t,onConfirm:i})=>{const{t:r}=sn("os"),a=r("confirmation value"),[o,s]=l.useState("");return l.createElement(l.Fragment,null,l.createElement("div",{role:"none",className:"grow flex flex-col justify-center"},l.createElement(vo,{validationMessage:t,label:l.createElement(kt,null,r("reset identity input label",{confirmationValue:a})),disabled:e,"data-testid":"reset-identity-input",placeholder:a,onChange:({target:{value:f}})=>s(f)})),l.createElement(it,null,l.createElement(un,{variant:"primary",disabled:e||n||o!==a,onClick:()=>i==null?void 0:i(),"data-testid":"reset-identity-input-confirm"},r(n?"reset in progress label":"confirm label"))))},at="pbs-1 pbe-3 pli-3",KB=e=>{const{titleId:n,send:t,activeView:i,failed:r,mode:a,unredeemedCodes:o,invitationStates:s,succeededKeys:f,failReasons:d,onExit:u,onHaloDone:h,onSpaceDone:v,exitActionParent:m,doneActionParent:g,onHaloInvitationCancel:b,onSpaceInvitationCancel:w,onHaloInvitationAuthenticate:_,onSpaceInvitationAuthenticate:k,IdentityInput:E=zB,ResetIdentity:S=qB}=e;return l.createElement(Rr,{density:"fine"},a!=="halo-only"&&l.createElement(LB,{titleId:n,mode:a,onExit:u,exitActionParent:m}),l.createElement(vn.Root,{focusManaged:!0,activeView:i},l.createElement(vn.Views,null,l.createElement(vn.View,{classNames:at,id:"addition method chooser"},l.createElement(RB,{send:t,active:i==="addition method chooser"})),l.createElement(vn.View,{classNames:at,id:"reset identity confirmation"},l.createElement(S,{send:t,method:"reset identity",active:i==="reset identity confirmation"})),l.createElement(vn.View,{classNames:at,id:"create identity input"},l.createElement(E,{send:t,method:"create identity",active:i==="create identity input"})),l.createElement(vn.View,{classNames:at,id:"recover identity input"},l.createElement(E,{send:t,method:"recover identity",active:i==="recover identity input"})),l.createElement(vn.View,{classNames:at,id:"halo invitation input"},l.createElement(Yw,{send:t,Kind:"Halo",active:i==="halo invitation input",...(o==null?void 0:o.Halo)&&{unredeemedCode:o.Halo},...(f==null?void 0:f.Halo)&&{succeededKeys:f.Halo}})),l.createElement(vn.View,{classNames:at,id:"halo invitation rescuer"},l.createElement(Jw,{send:t,Kind:"Halo",active:i==="halo invitation rescuer",invitationState:s==null?void 0:s.Halo,onInvitationCancel:b,failReason:d==null?void 0:d.Halo})),l.createElement(vn.View,{classNames:at,id:"halo invitation authenticator"},l.createElement(Zw,{send:t,Kind:"Halo",active:i==="halo invitation authenticator",onInvitationCancel:b,onInvitationAuthenticate:_,...r.has("Halo")&&{failed:!0}})),l.createElement(vn.View,{classNames:at,id:"halo invitation accepted"},l.createElement(Kw,{send:t,Kind:"Halo",active:i==="halo invitation accepted",doneActionParent:g,onDone:h})),l.createElement(vn.View,{classNames:at,id:"identity added"},l.createElement(UB,{send:t,mode:a,active:i==="identity added",doneActionParent:g,onDone:h})),l.createElement(vn.View,{classNames:at,id:"space invitation input"},l.createElement(Yw,{send:t,Kind:"Space",active:i==="space invitation input",...(o==null?void 0:o.Space)&&{unredeemedCode:o.Space},...(f==null?void 0:f.Space)&&{succeededKeys:f.Space},onExit:u,exitActionParent:m})),l.createElement(vn.View,{classNames:at,id:"space invitation rescuer"},l.createElement(Jw,{send:t,Kind:"Space",active:i==="space invitation rescuer",invitationState:s==null?void 0:s.Space,onInvitationCancel:w,failReason:d==null?void 0:d.Space})),l.createElement(vn.View,{classNames:at,id:"space invitation authenticator"},l.createElement(Zw,{send:t,Kind:"Space",active:i==="space invitation authenticator",onInvitationCancel:w,onInvitationAuthenticate:k,...r.has("Space")&&{failed:!0}})),l.createElement(vn.View,{classNames:at,id:"space invitation accepted"},l.createElement(Kw,{send:t,Kind:"Space",active:i==="space invitation accepted",doneActionParent:g,onDone:v})))))},YB=({titleId:e,mode:n="default",initialInvitationCode:t,exitActionParent:i,onExit:r,doneActionParent:a,onDone:o})=>{const s=Ye.useClient(),f=Ki.useIdentity(),{hasIosKeyboard:d}=Pe(),u=Tn("joinPanel__heading",e),[h,v,m]=jB(s,{context:{mode:n,identity:f,...t&&{[n==="halo-only"?"halo":"space"]:{unredeemedCode:t}}}});l.useEffect(()=>m.subscribe(T=>{fn("[state]",T)}).unsubscribe,[m]),l.useEffect(()=>{const C=h.configuration[0].id.split("."),T=C[C.length-1],N=T==="finishingJoining"?"successSpaceInvitation":T,j=document.querySelector(`[data-autofocus~="${N}"]`);j&&!(d&&j.hasAttribute("data-prevent-ios-autofocus"))&&j.focus()},[h.value,d]);const g=l.useMemo(()=>{switch(!0){case h.matches({choosingIdentity:"choosingAuthMethod"}):return"addition method chooser";case h.matches("resettingIdentity"):return"reset identity confirmation";case h.matches({choosingIdentity:"creatingIdentity"}):return"create identity input";case h.matches({choosingIdentity:"recoveringIdentity"}):return"recover identity input";case h.matches({choosingIdentity:{acceptingHaloInvitation:"inputtingHaloInvitationCode"}}):return"halo invitation input";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"connectingHaloInvitation"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"failingHaloInvitation"}}}].some(h.matches):return"halo invitation rescuer";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"inputtingHaloVerificationCode"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticatingHaloVerificationCode"}}},{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticationFailingHaloVerificationCode"}}}].some(h.matches):return"halo invitation authenticator";case[{choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"successHaloInvitation"}}},"finishingJoiningHalo"].some(h.matches):return"halo invitation accepted";case h.matches({choosingIdentity:"confirmingAddedIdentity"}):return"identity added";case h.matches({acceptingSpaceInvitation:"inputtingSpaceInvitationCode"}):return"space invitation input";case[{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"connectingSpaceInvitation"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"failingSpaceInvitation"}}].some(h.matches):return"space invitation rescuer";case[{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"inputtingSpaceVerificationCode"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticatingSpaceVerificationCode"}},{acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticationFailingSpaceVerificationCode"}}].some(h.matches):return"space invitation authenticator";case h.matches("finishingJoiningSpace"):return"space invitation accepted";default:return"never"}},[h]),b=l.useMemo(()=>{const C=new Set;switch(!0){case h.matches({choosingIdentity:{acceptingHaloInvitation:{acceptingRedeemedHaloInvitation:"authenticationFailingHaloVerificationCode"}}}):C.add("Halo");break;case h.matches({acceptingSpaceInvitation:{acceptingRedeemedSpaceInvitation:"authenticationFailingSpaceVerificationCode"}}):C.add("Space");break}return C},[h]),w=l.useMemo(()=>({Halo:h.context.halo.unredeemedCode,Space:h.context.space.unredeemedCode}),[h]),_=Ye.useMulticastObservable(s.spaces),k=l.useMemo(()=>({Space:_?new Set(_.map(({key:C})=>C.toHex())):void 0}),[_]),E=l.useMemo(()=>{var C,T;return{Halo:(C=h.context.halo.invitationObservable)==null?void 0:C.get().state,Space:(T=h.context.space.invitationObservable)==null?void 0:T.get().state}},[h]),S=l.useMemo(()=>({Halo:h.context.halo.failReason,Space:h.context.space.failReason}),[h]),I=l.useCallback(()=>{var C,T,N,j;o==null||o({identityKey:((C=h.context.halo.invitation)==null?void 0:C.identityKey)??null,swarmKey:((T=h.context.halo.invitation)==null?void 0:T.swarmKey)??null,spaceKey:((N=h.context.halo.invitation)==null?void 0:N.spaceKey)??null,target:((j=h.context.halo.invitation)==null?void 0:j.target)??null})},[h,o]),P=l.useCallback(()=>{var C,T,N,j;o==null||o({identityKey:((C=h.context.space.invitation)==null?void 0:C.identityKey)??null,swarmKey:((T=h.context.space.invitation)==null?void 0:T.swarmKey)??null,spaceKey:((N=h.context.space.invitation)==null?void 0:N.spaceKey)??null,target:((j=h.context.space.invitation)==null?void 0:j.target)??null})},[h,o]);return l.createElement(KB,{titleId:u,mode:n,send:v,activeView:g,failed:b,failReasons:S,pending:["connecting","authenticating"].some(C=>h==null?void 0:h.configuration[0].id.includes(C)),unredeemedCodes:w,invitationStates:E,succeededKeys:k,identity:f,onExit:r,exitActionParent:i,doneActionParent:a,onHaloDone:I,onSpaceDone:P,onHaloInvitationCancel:()=>{var C;return(C=h.context.halo.invitationObservable)==null?void 0:C.cancel()},onSpaceInvitationCancel:()=>{var C;return(C=h.context.space.invitationObservable)==null?void 0:C.cancel()},onHaloInvitationAuthenticate:C=>{var T;return v({type:"authenticateHaloVerificationCode"}),(T=h.context.halo.invitationObservable)==null?void 0:T.authenticate(C)},onSpaceInvitationAuthenticate:C=>{var T;return v({type:"authenticateSpaceVerificationCode"}),(T=h.context.space.invitationObservable)==null?void 0:T.authenticate(C)}})},JB=$c({id:"space",predictableActionArguments:!0,context:{space:null},initial:"managingSpace",states:{managingSpace:{},managingSpaceInvitation:{}},on:{deselectInvitation:{target:".managingSpace",actions:["unsetInvitation","log"]},selectInvitation:{target:".managingSpaceInvitation",actions:["setInvitation","log"]}}},{actions:{setInvitation:rt({invitation:(e,n)=>(n==null?void 0:n.invitation)??null}),unsetInvitation:rt({invitation:()=>{}}),log:(e,n)=>{fn("[transition]",{event:n,context:e})}}}),XB=e=>Ac(JB,{...e,context:{...e==null?void 0:e.context}}),Qw="dxos:react-shell/space-manager/active-action",ZB=e=>{const{space:n,target:t}=e,{t:i}=sn("os"),r=Ye.useConfig(),a=Bo.useSpaceInvitations(n==null?void 0:n.key),o=l.useCallback(f=>{const d=yi.InvitationEncoder.encode(f);f.state===_e.State.CONNECTING&&console.log(JSON.stringify({invitationCode:d,authCode:f.authCode}))},[]),s={inviteOne:{label:i("invite one label"),description:i("invite one description"),icon:qe.UserPlus,onClick:l.useCallback(()=>{var d,u,h,v;const f=(d=n.share)==null?void 0:d.call(n,{type:_e.Type.INTERACTIVE,authMethod:_e.AuthMethod.SHARED_SECRET,target:t});f&&((v=(h=(u=r.values.runtime)==null?void 0:u.app)==null?void 0:h.env)==null?void 0:v.DX_ENVIRONMENT)!=="production"&&f.subscribe(o)},[n])},inviteMany:{label:i("invite many label"),description:i("invite many description"),icon:qe.UsersThree,onClick:l.useCallback(()=>{var d,u,h,v;const f=(d=n.share)==null?void 0:d.call(n,{type:_e.Type.MULTIUSE,authMethod:_e.AuthMethod.NONE,target:t});f&&((v=(h=(u=r.values.runtime)==null?void 0:u.app)==null?void 0:h.env)==null?void 0:v.DX_ENVIRONMENT)!=="production"&&f.subscribe(o)},[n])}};return l.createElement(QB,{...e,invitations:a,inviteActions:s})},e_="pis-3 pie-1 plb-1 mbe-1 font-medium",QB=e=>{const{active:n,space:t,createInvitationUrl:i,send:r,inviteActions:a,invitations:o,showInactiveInvitations:s,SpaceMemberList:f=II,InvitationList:d=oD}=e,{t:u}=sn("os"),h=a??{noopInvite:{label:u("create space invitation label"),description:"",icon:qe.Placeholder,onClick:()=>{}}},[v,m]=l.useState(localStorage.getItem(Qw)??"inviteOne"),g=w=>{m(w),localStorage.setItem(Qw,w)},b=s?o:o==null?void 0:o.filter(w=>![_e.State.CANCELLED].includes(w.get().state));return l.createElement(l.Fragment,null,l.createElement(Os.Root,{classNames:"grow shrink basis-28 -mli-2"},l.createElement(Os.Viewport,{classNames:"is-full pie-2"},!!(b!=null&&b.length)&&l.createElement(l.Fragment,null,l.createElement("h3",{className:le(e_,Mn)},u("invitation list heading")),l.createElement(d,{className:"mb-2",send:r,invitations:b??[],onClickRemove:w=>w.cancel(),createInvitationUrl:i}),l.createElement("h3",{className:le(e_,Mn,"mbs-2")},u("space member list heading"))),l.createElement(f,{spaceKey:t.key,includeSelf:!0})),l.createElement(Os.Scrollbar,{orientation:"vertical"},l.createElement(Os.Thumb,null))),l.createElement(it,null,l.createElement(fD,{disabled:!n,actions:h,activeAction:v,onChangeActiveAction:g,"data-testid":"spaces-panel.create-invitation"})))},ej=({titleId:e,space:n,onDone:t})=>{const{t:i}=sn("os"),r=n.properties.name;return l.createElement(nc,{titleId:e,title:i("space panel heading"),corner:l.createElement(By,{"data-testid":"identity-panel-done",onDone:t})},l.createElement("div",{role:"none",className:"flex gap-4 items-center justify-center mlb-4"},l.createElement(qe.Planet,{size:32,weight:"light"}),l.createElement("div",{className:"block text-start font-light text-xl"},r??n.key.truncate())))},n_=e=>{const{titleId:n,activeView:t,space:i,target:r,SpaceManager:a=ZB,InvitationManager:o=Ww,...s}=e;return l.createElement(Rr,{density:"fine"},l.createElement(ej,{...s,titleId:n,space:i}),l.createElement(vn.Root,{activeView:t},l.createElement(vn.Views,null,l.createElement(vn.View,{id:"space manager",classNames:at},l.createElement(a,{active:t==="space manager",space:i,target:r,...s})),l.createElement(vn.View,{id:"space invitation manager",classNames:at},l.createElement(o,{active:t==="space invitation manager",...s,invitationUrl:e.invitationUrl})))))},nj=({invitation:e,...n})=>{const t=Qu(e);return l.createElement(n_,{...n,...t,invitationUrl:n.createInvitationUrl(t.invitationCode)})},tj=({titleId:e,createInvitationUrl:n=i=>i,...t})=>{const i=Tn("spacePanel__heading",e),[r,a,o]=XB({context:{space:t.space}});l.useEffect(()=>o.subscribe(u=>{fn("[state]",u)}).unsubscribe,[o]);const s=l.useMemo(()=>{switch(!0){case r.matches("managingSpace"):return"space manager";case r.matches("managingSpaceInvitation"):return"space invitation manager";default:return"never"}},[r]),f={...t,activeView:s,send:a,titleId:i,createInvitationUrl:n};return r.context.invitation?l.createElement(nj,{...f,invitation:r.context.invitation}):l.createElement(n_,{...f})},ij=e=>{const n=Tn("spaceDialog__title");return l.createElement(qt.Root,{defaultOpen:!0,onOpenChange:t=>{var i;return t||((i=e.onDone)==null?void 0:i.call(e))}},l.createElement(qt.Portal,null,l.createElement(qt.Overlay,null,l.createElement(qt.Content,{"aria-labelledby":n,onOpenAutoFocus:t=>t.preventDefault()},l.createElement(Xd,null,l.createElement(DB,{...e,titleId:n,doneActionParent:l.createElement(qt.Close,{asChild:!0})}))))))},t_=e=>{const n=Tn("joinDialog__title"),{height:t}=M9();return l.createElement(jr.Root,{defaultOpen:!0,onOpenChange:i=>{var r;return i||(e.onExit?e.onExit():(r=e.onDone)==null?void 0:r.call(e,null))}},l.createElement(jr.Portal,null,l.createElement(jr.Overlay,{classNames:"backdrop-blur",...t&&{style:{blockSize:`${t}px`}}},l.createElement(jr.Content,{"aria-labelledby":n},l.createElement(YB,{...e,titleId:n,exitActionParent:l.createElement(jr.Cancel,{asChild:!0}),doneActionParent:l.createElement(jr.Action,{asChild:!0})})))))};var Pc,Gf=bi;if(process.env.NODE_ENV==="production")Pc=Gf.createRoot,Gf.hydrateRoot;else{var i_=Gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Pc=function(e,n){i_.usingClientEntryPoint=!0;try{return Gf.createRoot(e,n)}finally{i_.usingClientEntryPoint=!1}}}var Ic={exports:{}};(function(e,n){(function(t,i){var r="1.0.35",a="",o="?",s="function",f="undefined",d="object",u="string",h="major",v="model",m="name",g="type",b="vendor",w="version",_="architecture",k="console",E="mobile",S="tablet",I="smarttv",P="wearable",C="embedded",T=350,N="Amazon",j="Apple",L="ASUS",D="BlackBerry",X="Browser",J="Chrome",ee="Edge",ae="Firefox",fe="Google",de="Huawei",oe="LG",me="Microsoft",se="Motorola",G="Opera",Y="Samsung",ie="Sharp",pe="Sony",H="Xiaomi",K="Zebra",B="Facebook",W="Chromium OS",V="Mac OS",O=function(Se,Ue){var y={};for(var c in Se)Ue[c]&&Ue[c].length%2===0?y[c]=Ue[c].concat(Se[c]):y[c]=Se[c];return y},F=function(Se){for(var Ue={},y=0;y<Se.length;y++)Ue[Se[y].toUpperCase()]=Se[y];return Ue},Z=function(Se,Ue){return typeof Se===u?te(Ue).indexOf(te(Se))!==-1:!1},te=function(Se){return Se.toLowerCase()},he=function(Se){return typeof Se===u?Se.replace(/[^\d\.]/g,a).split(".")[0]:i},ye=function(Se,Ue){if(typeof Se===u)return Se=Se.replace(/^\s\s*/,a),typeof Ue===f?Se:Se.substring(0,T)},xe=function(Se,Ue){for(var y=0,c,p,x,A,M,z;y<Ue.length&&!M;){var ge=Ue[y],Fe=Ue[y+1];for(c=p=0;c<ge.length&&!M&&ge[c];)if(M=ge[c++].exec(Se),M)for(x=0;x<Fe.length;x++)z=M[++p],A=Fe[x],typeof A===d&&A.length>0?A.length===2?typeof A[1]==s?this[A[0]]=A[1].call(this,z):this[A[0]]=A[1]:A.length===3?typeof A[1]===s&&!(A[1].exec&&A[1].test)?this[A[0]]=z?A[1].call(this,z,A[2]):i:this[A[0]]=z?z.replace(A[1],A[2]):i:A.length===4&&(this[A[0]]=z?A[3].call(this,z.replace(A[1],A[2])):i):this[A]=z||i;y+=2}},Ee=function(Se,Ue){for(var y in Ue)if(typeof Ue[y]===d&&Ue[y].length>0){for(var c=0;c<Ue[y].length;c++)if(Z(Ue[y][c],Se))return y===o?i:y}else if(Z(Ue[y],Se))return y===o?i:y;return Se},re={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Be={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},hn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[m,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[m,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,w],[/opios[\/ ]+([\w\.]+)/i],[w,[m,G+" Mini"]],[/\bopr\/([\w\.]+)/i],[w,[m,G]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[m,w],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[m,"UC"+X]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[w,[m,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[w,[m,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[m,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[m,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[m,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+)/,"$1 Secure "+X],w],[/\bfocus\/([\w\.]+)/i],[w,[m,ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[m,G+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[m,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[m,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[m,G+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[m,"MIUI "+X]],[/fxios\/([-\w\.]+)/i],[w,[m,ae]],[/\bqihu|(qi?ho?o?|360)browser/i],[[m,"360 "+X]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[m,/(.+)/,"$1 "+X],w],[/(comodo_dragon)\/([\w\.]+)/i],[[m,/_/g," "],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[m,w],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,B],w],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[m,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[m,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[m,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[m,J+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,J+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[m,"Android "+X]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[m,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[w,Ee,re]],[/(webkit|khtml)\/([\w\.]+)/i],[m,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[m,ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[m,w],[/(cobalt)\/([\w\.]+)/i],[m,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,te]],[/((?:i[346]|x)86)[;\)]/i],[[_,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,a,te]],[/(sun4\w)[;\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,te]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[b,Y],[g,S]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[v,[b,Y],[g,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[b,j],[g,E]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[b,j],[g,S]],[/(macintosh);/i],[v,[b,j]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[b,ie],[g,E]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[b,de],[g,S]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[b,de],[g,E]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[v,/_/g," "],[b,H],[g,E]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[b,H],[g,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[b,"OPPO"],[g,E]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[b,"Vivo"],[g,E]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[v,[b,"Realme"],[g,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[b,se],[g,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[b,se],[g,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[b,oe],[g,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[b,oe],[g,E]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[b,"Lenovo"],[g,S]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[b,"Nokia"],[g,E]],[/(pixel c)\b/i],[v,[b,fe],[g,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[b,fe],[g,E]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[b,pe],[g,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[b,pe],[g,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[b,"OnePlus"],[g,E]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[b,N],[g,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[b,N],[g,E]],[/(playbook);[-\w\),; ]+(rim)/i],[v,b,[g,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[b,D],[g,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[b,L],[g,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[b,L],[g,E]],[/(nexus 9)/i],[v,[b,"HTC"],[g,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[v,/_/g," "],[g,E]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[b,"Acer"],[g,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[b,"Meizu"],[g,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,v,[g,E]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,v,[g,S]],[/(surface duo)/i],[v,[b,me],[g,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[b,"Fairphone"],[g,E]],[/(u304aa)/i],[v,[b,"AT&T"],[g,E]],[/\bsie-(\w*)/i],[v,[b,"Siemens"],[g,E]],[/\b(rct\w+) b/i],[v,[b,"RCA"],[g,S]],[/\b(venue[\d ]{2,7}) b/i],[v,[b,"Dell"],[g,S]],[/\b(q(?:mv|ta)\w+) b/i],[v,[b,"Verizon"],[g,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[b,"Barnes & Noble"],[g,S]],[/\b(tm\d{3}\w+) b/i],[v,[b,"NuVision"],[g,S]],[/\b(k88) b/i],[v,[b,"ZTE"],[g,S]],[/\b(nx\d{3}j) b/i],[v,[b,"ZTE"],[g,E]],[/\b(gen\d{3}) b.+49h/i],[v,[b,"Swiss"],[g,E]],[/\b(zur\d{3}) b/i],[v,[b,"Swiss"],[g,S]],[/\b((zeki)?tb.*\b) b/i],[v,[b,"Zeki"],[g,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],v,[g,S]],[/\b(ns-?\w{0,9}) b/i],[v,[b,"Insignia"],[g,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[b,"NextBook"],[g,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],v,[g,E]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],v,[g,E]],[/\b(ph-1) /i],[v,[b,"Essential"],[g,E]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[b,"Envizen"],[g,S]],[/\b(trio[-\w\. ]+) b/i],[v,[b,"MachSpeed"],[g,S]],[/\btu_(1491) b/i],[v,[b,"Rotor"],[g,S]],[/(shield[\w ]+) b/i],[v,[b,"Nvidia"],[g,S]],[/(sprint) (\w+)/i],[b,v,[g,E]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[b,me],[g,E]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[b,K],[g,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[b,K],[g,E]],[/smart-tv.+(samsung)/i],[b,[g,I]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[b,Y],[g,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,oe],[g,I]],[/(apple) ?tv/i],[b,[v,j+" TV"],[g,I]],[/crkey/i],[[v,J+"cast"],[b,fe],[g,I]],[/droid.+aft(\w)( bui|\))/i],[v,[b,N],[g,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[b,ie],[g,I]],[/(bravia[\w ]+)( bui|\))/i],[v,[b,pe],[g,I]],[/(mitv-\w{5}) bui/i],[v,[b,H],[g,I]],[/Hbbtv.*(technisat) (.*);/i],[b,v,[g,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,ye],[v,ye],[g,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,I]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,v,[g,k]],[/droid.+; (shield) bui/i],[v,[b,"Nvidia"],[g,k]],[/(playstation [345portablevi]+)/i],[v,[b,pe],[g,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[b,me],[g,k]],[/((pebble))app/i],[b,v,[g,P]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[b,j],[g,P]],[/droid.+; (glass) \d/i],[v,[b,fe],[g,P]],[/droid.+; (wt63?0{2,3})\)/i],[v,[b,K],[g,P]],[/(quest( 2| pro)?)/i],[v,[b,B],[g,P]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[g,C]],[/(aeobc)\b/i],[v,[b,N],[g,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[v,[g,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[g,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,E]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[m,ee+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[m,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,m]],os:[[/microsoft (windows) (vista|xp)/i],[m,w],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[m,[w,Ee,Be]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,"Windows"],[w,Ee,Be]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[m,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[m,V],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,m],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[m,w],[/\(bb(10);/i],[w,[m,D]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[m,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[m,ae+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[m,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[m,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[m,J+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,W],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[m,w],[/(sunos) ?([\w\.\d]*)/i],[[m,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,w]]},Te=function(Se,Ue){if(typeof Se===d&&(Ue=Se,Se=i),!(this instanceof Te))return new Te(Se,Ue).getResult();var y=typeof t!==f&&t.navigator?t.navigator:i,c=Se||(y&&y.userAgent?y.userAgent:a),p=y&&y.userAgentData?y.userAgentData:i,x=Ue?O(hn,Ue):hn,A=y&&y.userAgent==c;return this.getBrowser=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.browser),M[h]=he(M[w]),A&&y&&y.brave&&typeof y.brave.isBrave==s&&(M[m]="Brave"),M},this.getCPU=function(){var M={};return M[_]=i,xe.call(M,c,x.cpu),M},this.getDevice=function(){var M={};return M[b]=i,M[v]=i,M[g]=i,xe.call(M,c,x.device),A&&!M[g]&&p&&p.mobile&&(M[g]=E),A&&M[v]=="Macintosh"&&y&&typeof y.standalone!==f&&y.maxTouchPoints&&y.maxTouchPoints>2&&(M[v]="iPad",M[g]=S),M},this.getEngine=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.engine),M},this.getOS=function(){var M={};return M[m]=i,M[w]=i,xe.call(M,c,x.os),A&&!M[m]&&p&&p.platform!="Unknown"&&(M[m]=p.platform.replace(/chrome os/i,W).replace(/macos/i,V)),M},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return c},this.setUA=function(M){return c=typeof M===u&&M.length>T?ye(M,T):M,this},this.setUA(c),this};Te.VERSION=r,Te.BROWSER=F([m,w,h]),Te.CPU=F([_]),Te.DEVICE=F([v,b,g,k,E,I,S,P,C]),Te.ENGINE=Te.OS=F([m,w]),e.exports&&(n=e.exports=Te),n.UAParser=Te;var ze=typeof t!==f&&(t.jQuery||t.Zepto);if(ze&&!ze.ua){var yn=new Te;ze.ua=yn.getResult(),ze.ua.get=function(){return yn.getUA()},ze.ua.set=function(Se){yn.setUA(Se);var Ue=yn.getResult();for(var y in Ue)ze.ua[y]=Ue[y]}}})(typeof window=="object"?window:pn)})(Ic,Ic.exports);var rj=Ic.exports,Kf="/home/runner/work/dxos/dxos/packages/core/mesh/rpc-tunnel/src/ports/iframe.ts",Fc,Nc;if(typeof navigator<"u"){const e=new rj.UAParser(navigator.userAgent);Fc=e.getBrowser().name,Nc=e.getOS().name}var aj=(e,n,t)=>{if(!e.contentWindow){fn("IFrame content window missing",{origin:n},{F:Kf,L:24,S:void 0,C:(i,r)=>i(...r)});return}Fc==="Chrome"&&Nc==="iOS"?e.contentWindow.postMessage(t,n):e.contentWindow.postMessage(t,n,[t.payload])},oj=(e,n)=>{Fc==="Chrome"&&Nc==="iOS"?window.parent.postMessage(n,e):window.parent.postMessage(n,e,[n.payload])},r_=({channel:e,iframe:n,origin:t,onOrigin:i})=>({send:async r=>{if(!t){fn("no origin set",{channel:e},{F:Kf,L:62,S:void 0,C:(s,f)=>s(...f)});return}fn("sending",{channel:e,data:r.length},{F:Kf,L:66,S:void 0,C:(s,f)=>s(...f)});const a=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),o={channel:e,payload:a};n?aj(n,t,o):oj(t,o)},subscribe:r=>{const a=o=>{if(!n&&o.source!==window.parent)return;if(n&&o.source!==n.contentWindow)return;const f=o.data&&typeof o.data=="object"&&"channel"in o.data&&"payload"in o.data?o.data:void 0;(f==null?void 0:f.channel)===e&&(t||(t=o.origin,i==null||i(t)),fn("received",f,{F:Kf,L:98,S:void 0,C:(d,u)=>d(...u)}),r(new Uint8Array(f.payload)))};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)}});const sj=e=>{const n=Tn("spaceDialog__title");return l.createElement(qt.Root,{defaultOpen:!0,onOpenChange:t=>{var i;return t||((i=e.onDone)==null?void 0:i.call(e))}},l.createElement(qt.Portal,null,l.createElement(qt.Overlay,null,l.createElement(qt.Content,{"aria-labelledby":n},l.createElement(Xd,null,l.createElement(tj,{...e,titleId:n,doneActionParent:l.createElement(qt.Close,{asChild:!0})}))))))},fj=({runtime:e,origin:n})=>{const[{layout:t,invitationCode:i,spaceKey:r,target:a},o]=l.useState({layout:e.layout,invitationCode:e.invitationCode,spaceKey:e.spaceKey,target:e.target}),s=Ye.useClient(),f=Bo.useSpace(r);switch(l.useEffect(()=>e.layoutUpdate.on(d=>o(d)),[e]),l.useEffect(()=>{if(t===Ye.ShellLayout.SPACE&&!f){fn.warn("No space found for shell space invitations.");const d=setTimeout(async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})});return()=>clearTimeout(d)}},[e,t,f]),t){case Ye.ShellLayout.INITIALIZE_IDENTITY:return l.createElement(t_,{mode:"halo-only",initialInvitationCode:i,onDone:()=>{e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});case Ye.ShellLayout.IDENTITY:case Ye.ShellLayout.SHARE_IDENTITY:case Ye.ShellLayout.EDIT_PROFILE:return l.createElement(ij,{createInvitationUrl:d=>`${n}?deviceInvitationCode=${d}`,onResetDevice:async()=>{await s.reset(),await e.setAppContext({display:Ye.ShellDisplay.NONE,reload:!0})},onJoinNewIdentity:()=>e.setLayout({layout:Ye.ShellLayout.INITIALIZE_IDENTITY}),onDone:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});case Ye.ShellLayout.SPACE:return f?l.createElement(sj,{space:f,target:a,createInvitationUrl:d=>`${n}?spaceInvitationCode=${d}`,onDone:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}}):null;case Ye.ShellLayout.JOIN_SPACE:return l.createElement(t_,{initialInvitationCode:i,onDone:async d=>{const u=(d==null?void 0:d.target)??void 0;await e.setAppContext({display:Ye.ShellDisplay.NONE,spaceKey:(d==null?void 0:d.spaceKey)??void 0,target:u}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})},onExit:async()=>{await e.setAppContext({display:Ye.ShellDisplay.NONE}),e.setLayout({layout:Ye.ShellLayout.DEFAULT})}});default:return null}},lj={"en-US":Object.freeze(Object.defineProperty({__proto__:null,os:{"manage profile label":"Manage identity","identity offline description":"Offline","sidebar label":"DXOS sidebar","copy invitation code label":"Copy URL","copy success label":"Copied","copy self public key label":"Copy public key","open share panel label":"View QR code","joining space heading":"Joining space","join space heading":"Enter space invitation","halo heading":"Initialize device identity","exit label":"Exit","identity selector title":"Join as","identity radio group title":"Select an identity youโ€™ve associated with this device already","add identity label":"Add","continue label":"Continue","back label":"Back","next label":"Next","close label":"Close","auth choices label":"Choose an identity","create identity label":"Create an identity","create identity description":"Create a new identity.","recover identity label":"Use a seed phrase","recover identity description":"Enter your seed phrase to log in manually.","join identity label":"Use another device","join identity description":"Add this device to an identity youโ€™re already logged into on another device.","deselect identity label":"Back to identities","addition method chooser title":"An identity is required to continue","new identity input label":"Set display name","recover identity input label":"Type or paste your seed phrase","failed to create identity message":"Failed to create an identity.","failed to recover identity message":"Failed to recover an identity from the provided seed phrase.","failed to authenticate message":"Incorrect PIN.","identity added label":"Created identity & added to this device:","join space as identity heading":"<part>as </part><part><icon/><label>{{labelValue}}</label></part>","error status label":"Failed","timeout status label":"Timed out","cancelled status label":"Cancelled","init status label":"Ready to connect","connecting status label":"Connectingโ€ฆ","connected status label":"Enter confirmation PIN","authenticating status label":"Enter confirmation PIN","success status label":"Success","connect label":"Connect","reconnect label":"Reconnect","cancel label":"Cancel","done label":"Done","reset label":"Start over","auth code input label":"Enter the verification code","invitation input label":"Paste an invitation code or URL","create device invitation label":"Add device","create space invitation label":"Invite","qr label":"Scan to accept invitation","empty invitations message":"No pending invitations","empty device list message":"No devices authenticated other than this device.","show all spaces label":"All spaces","all spaces label":"All spaces","create space label":"Create a new space","join space label":"Join a space","show current space label":"Current space","view space invitations label":"View space invitations","toggle sidebar label":"Open/close sidebar","open sidebar label":"Open sidebar","close sidebar label":"Close sidebar","welcome message":"Welcome","selecting identity heading":"Selecting identity","devices heading":"Devices","identity heading":"Profile settings","choose add device label":"Add device","choose devices label":"Manage devices","choose profile label":"Edit profile","choose sign out label":"Sign out","empty space members message":"There is nobody in this space yet.","back to all invitations label":"Back to all invitations","invitation heading":"Invitation","invitation list heading":"Invitations","device invitation list heading":"Pending device invitations","space invitation list heading":"Pending invitations","device list heading":"Devices","space member list heading":"Members","space panel heading":"Space membership","auth code message":"Enter the following auth code on the joining device.","display name input label":"Display name","display name input placeholder":"Enter a display name","invite one label":"Invite one","invite one description":"Only one user may join.","invite one qr label":"Single-use","invite one list item label":"Active single-use invitation","invite many label":"Invite many","invite many description":"Anyone with the link can join.","invite many qr label":"Multiple-use","invite many list item label":"Active multiple-use invitation","invite options label":"Change the active invite option.","reset in progress label":"Resetting...","confirm label":"Confirm","reset identity input label":"This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.","failed to reset identity message":"Failed to reset identity.","confirmation value":"CONFIRM","sign out chooser title":"DANGER ZONE","sign out chooser message":"Proceeding with either action below will erase all data on this device.","join new identity label":"Join a new identity","reset device label":"Reset device","reset device confirm message":"Are you sure you want to reset your device? All data will be lost.","emoji and color label":"Emoji and color","clear label":"Use default","select emoji label":"Choose an emoji to use in your avatar","select hue label":"Choose a hue to use in your avatar","red label":"Red","orange label":"Orange","amber label":"Amber","yellow label":"Yellow","lime label":"Lime","green label":"Green","emerald label":"Emerald","teal label":"Teal","cyan label":"Cyan","sky label":"Sky","blue label":"Blue","indigo label":"Indigo","violet label":"Violet","purple label":"Purple","fuchsia label":"Fuchsia","pink label":"Pink","rose label":"Rose"}},Symbol.toStringTag,{value:"Module"}))},dj=async(e=new Ye.Config)=>{const n=new Ye.ClientServicesProxy(r_({channel:yi.DEFAULT_CLIENT_CHANNEL})),t=new Ye.Client({config:e,services:n}),i=new f_.ShellRuntimeImpl(r_({channel:yi.DEFAULT_SHELL_CHANNEL}));await Promise.all([i.open(),t.initialize()]),Pc(document.getElementById("root")).render(l.createElement(l.StrictMode,null,l.createElement(fS,{tx:yO,resourceExtensions:[lj]},l.createElement(Ye.ClientContext.Provider,{value:{client:t,status:Ye.SystemStatus.ACTIVE}},l.createElement(Xd,null,l.createElement(Pn.Provider,null,l.createElement(fj,{runtime:i,origin:location.origin})))))))};l.createContext({}),lt.runShell=dj,Object.defineProperty(lt,Symbol.toStringTag,{value:"Module"})});
930
930
  //# sourceMappingURL=shell.umd.js.map