@datalayer/agent-runtimes 1.5.2 → 1.5.4

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.
@@ -1743,7 +1743,7 @@ Please use Ctrl + V (or ⌘ + V on macOS) instead.`),buttons:[Dialog.okButton({l
1743
1743
  `)&&(ju=ju.replace(/[^\n]+$/,"")),!1}),typeof ju>"u"?ju=this.raw(Bu,null,"beforeDecl"):ju&&(ju=ju.replace(/\S/g,"")),ju}rawBeforeDecl(Lu,Bu){let ju;return Lu.walkDecls(Fu=>{if(typeof Fu.raws.before<"u")return ju=Fu.raws.before,ju.includes(`
1744
1744
  `)&&(ju=ju.replace(/[^\n]+$/,"")),!1}),typeof ju>"u"?ju=this.raw(Bu,null,"beforeRule"):ju&&(ju=ju.replace(/\S/g,"")),ju}rawBeforeOpen(Lu){let Bu;return Lu.walk(ju=>{if(ju.type!=="decl"&&(Bu=ju.raws.between,typeof Bu<"u"))return!1}),Bu}rawBeforeRule(Lu){let Bu;return Lu.walk(ju=>{if(ju.nodes&&(ju.parent!==Lu||Lu.first!==ju)&&typeof ju.raws.before<"u")return Bu=ju.raws.before,Bu.includes(`
1745
1745
  `)&&(Bu=Bu.replace(/[^\n]+$/,"")),!1}),Bu&&(Bu=Bu.replace(/\S/g,"")),Bu}rawColon(Lu){let Bu;return Lu.walkDecls(ju=>{if(typeof ju.raws.between<"u")return Bu=ju.raws.between.replace(/[^\s:]/g,""),!1}),Bu}rawEmptyBody(Lu){let Bu;return Lu.walk(ju=>{if(ju.nodes&&ju.nodes.length===0&&(Bu=ju.raws.after,typeof Bu<"u"))return!1}),Bu}rawIndent(Lu){if(Lu.raws.indent)return Lu.raws.indent;let Bu;return Lu.walk(ju=>{let Fu=ju.parent;if(Fu&&Fu!==Lu&&Fu.parent&&Fu.parent===Lu&&typeof ju.raws.before<"u"){let zu=ju.raws.before.split(`
1746
- `);return Bu=zu[zu.length-1],Bu=Bu.replace(/\S/g,""),!1}}),Bu}rawSemicolon(Lu){let Bu;return Lu.walk(ju=>{if(ju.nodes&&ju.nodes.length&&ju.last.type==="decl"&&(Bu=ju.raws.semicolon,typeof Bu<"u"))return!1}),Bu}rawValue(Lu,Bu){let ju=Lu[Bu],Fu=Lu.raws[Bu];return Fu&&Fu.value===ju?Fu.raw:ju}root(Lu){!(Lu.parent&&Lu.parent.type==="document")&&Lu.source&&Lu.source.input.hasBOM&&this.builder("\uFEFF",Lu,"start"),this.body(Lu),Lu.raws.after&&this.builder(Lu.raws.after)}rule(Lu){this.block(Lu,this.rawValue(Lu,"selector")),Lu.raws.ownSemicolon&&this.builder(Lu.raws.ownSemicolon,Lu,"end")}stringify(Lu,Bu){if(!this[Lu.type])throw new Error("Unknown AST node type "+Lu.type+". Maybe you need to change PostCSS stringifier.");this[Lu.type](Lu,Bu)}}return stringifier=Mu,Mu.default=Mu,stringifier}var stringify_1,hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify_1;hasRequiredStringify=1;let Au=requireStringifier();const lo=/(<)(\/?style\b)/gi,$u=/(<)(!--)/g;function Ru(Ou){return Ou.includes("<")?Ou.replace(lo,"\\3c $2").replace($u,"\\3c $2"):Ou}class Iu extends Au{escapeHTML(Mu,Du){let Lu=this.builder,Bu,ju;if(this.builder=(zu,Uu,Hu)=>{Bu?(ju+=zu,Bu.push(zu,Uu,Hu)):zu.includes("<")?(ju=zu,Bu=[zu,Uu,Hu]):Lu(zu,Uu,Hu)},Du(),this.builder=Lu,!Bu)return;let Fu=Ru(ju);if(Fu===ju)for(let zu=0;zu<Bu.length;zu+=3)Lu(Bu[zu],Bu[zu+1],Bu[zu+2]);else Lu(Fu,Mu)}root(Mu){Mu.parent&&Mu.parent.type==="document"?(this.escapeHTML(Mu,()=>this.body(Mu)),Mu.raws.after&&this.builder(Mu.raws.after)):this.escapeHTML(Mu,()=>super.root(Mu))}}function Pu(Ou,Mu){let Du=new Iu(Mu);Ou.type==="root"||Ou.type==="document"?Du.stringify(Ou):Du.escapeHTML(Ou,()=>Du.stringify(Ou))}return stringify_1=Pu,Pu.default=Pu,stringify_1}var symbols$1={},hasRequiredSymbols;function requireSymbols(){return hasRequiredSymbols||(hasRequiredSymbols=1,symbols$1.isClean=Symbol("isClean"),symbols$1.my=Symbol("my")),symbols$1}var node$3,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node$3;hasRequiredNode=1;let Au=requireCssSyntaxError(),lo=requireStringifier(),$u=requireStringify(),{isClean:Ru,my:Iu}=requireSymbols();function Pu(Du,Lu){let Bu=new Du.constructor,ju=[[Du,Bu,Lu]];for(;ju.length>0;){let[Fu,zu,Uu]=ju.pop();for(let Hu in Fu){if(!Object.prototype.hasOwnProperty.call(Fu,Hu)||Hu==="proxyCache")continue;let Vu=Fu[Hu],Gu=typeof Vu;if(Hu==="parent"&&Gu==="object")Uu&&(zu[Hu]=Uu);else if(Hu==="source")zu[Hu]=Vu;else if(Array.isArray(Vu)){let Wu=[];zu[Hu]=Wu;for(let Ku of Vu){let Ju=new Ku.constructor;Wu.push(Ju),ju.push([Ku,Ju,zu])}}else{if(Gu==="object"&&Vu!==null){let Wu=new Vu.constructor;ju.push([Vu,Wu,void 0]),Vu=Wu}zu[Hu]=Vu}}}return Bu}function Ou(Du,Lu){if(Lu&&typeof Lu.offset<"u")return Lu.offset;let Bu=1,ju=1,Fu=0;for(let zu=0;zu<Du.length;zu++){if(ju===Lu.line&&Bu===Lu.column){Fu=zu;break}Du[zu]===`
1746
+ `);return Bu=zu[zu.length-1],Bu=Bu.replace(/\S/g,""),!1}}),Bu}rawSemicolon(Lu){let Bu;return Lu.walk(ju=>{if(ju.nodes&&ju.nodes.length&&ju.last.type==="decl"&&(Bu=ju.raws.semicolon,typeof Bu<"u"))return!1}),Bu}rawValue(Lu,Bu){let ju=Lu[Bu],Fu=Lu.raws[Bu];return Fu&&Fu.value===ju?Fu.raw:ju}root(Lu){!(Lu.parent&&Lu.parent.type==="document")&&Lu.source&&Lu.source.input.hasBOM&&this.builder("\uFEFF",Lu,"start"),this.body(Lu),Lu.raws.after&&this.builder(Lu.raws.after)}rule(Lu){this.block(Lu,this.rawValue(Lu,"selector")),Lu.raws.ownSemicolon&&this.builder(Lu.raws.ownSemicolon,Lu,"end")}stringify(Lu,Bu){if(!this[Lu.type])throw new Error("Unknown AST node type "+Lu.type+". Maybe you need to change PostCSS stringifier.");this[Lu.type](Lu,Bu)}}return stringifier=Mu,Mu.default=Mu,stringifier}var stringify_1,hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify_1;hasRequiredStringify=1;let Au=requireStringifier();const lo=/(<)(\/?style\b)/gi,$u=/(<)(!--)/g;function Ru(Ou){return Ou.includes("<")?Ou.replace(lo,"\\3c $2").replace($u,"\\3c $2"):Ou}class Iu extends Au{escapeHTML(Mu,Du){let Lu=this.builder,Bu,ju;if(this.builder=(zu,Uu,Hu)=>{Bu?(ju+=zu,Bu.push(zu,Uu,Hu)):zu.includes("<")?(ju=zu,Bu=[zu,Uu,Hu]):Lu(zu,Uu,Hu)},Du(),this.builder=Lu,!Bu)return;let Fu=Ru(ju);if(Fu===ju)for(let zu=0;zu<Bu.length;zu+=3)Lu(Bu[zu],Bu[zu+1],Bu[zu+2]);else Lu(Fu,Mu,"start")}root(Mu){Mu.parent&&Mu.parent.type==="document"?(this.escapeHTML(Mu,()=>this.body(Mu)),Mu.raws.after&&this.builder(Mu.raws.after)):this.escapeHTML(Mu,()=>super.root(Mu))}}function Pu(Ou,Mu){let Du=new Iu(Mu);Ou.type==="root"||Ou.type==="document"?Du.stringify(Ou):Du.escapeHTML(Ou,()=>Du.stringify(Ou))}return stringify_1=Pu,Pu.default=Pu,stringify_1}var symbols$1={},hasRequiredSymbols;function requireSymbols(){return hasRequiredSymbols||(hasRequiredSymbols=1,symbols$1.isClean=Symbol("isClean"),symbols$1.my=Symbol("my")),symbols$1}var node$3,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node$3;hasRequiredNode=1;let Au=requireCssSyntaxError(),lo=requireStringifier(),$u=requireStringify(),{isClean:Ru,my:Iu}=requireSymbols();function Pu(Du,Lu){let Bu=new Du.constructor,ju=[[Du,Bu,Lu]];for(;ju.length>0;){let[Fu,zu,Uu]=ju.pop();for(let Hu in Fu){if(!Object.prototype.hasOwnProperty.call(Fu,Hu)||Hu==="proxyCache")continue;let Vu=Fu[Hu],Gu=typeof Vu;if(Hu==="parent"&&Gu==="object")Uu&&(zu[Hu]=Uu);else if(Hu==="source")zu[Hu]=Vu;else if(Array.isArray(Vu)){let Wu=[];zu[Hu]=Wu;for(let Ku of Vu){let Ju=new Ku.constructor;Wu.push(Ju),ju.push([Ku,Ju,zu])}}else{if(Gu==="object"&&Vu!==null){let Wu=new Vu.constructor;ju.push([Vu,Wu,void 0]),Vu=Wu}zu[Hu]=Vu}}}return Bu}function Ou(Du,Lu){if(Lu&&typeof Lu.offset<"u")return Lu.offset;let Bu=1,ju=1,Fu=0;for(let zu=0;zu<Du.length;zu++){if(ju===Lu.line&&Bu===Lu.column){Fu=zu;break}Du[zu]===`
1747
1747
  `?(Bu=1,ju+=1):Bu+=1}return Fu}class Mu{get proxyOf(){return this}constructor(Lu={}){this.raws={},this[Ru]=!1,this[Iu]=!0;for(let Bu of Object.keys(Lu))if(Bu!=="__proto__")if(Bu==="nodes"){this.nodes=[];for(let ju of Lu[Bu])typeof ju.clone=="function"&&ju.parent?this.append(ju.clone()):this.append(ju)}else this[Bu]=Lu[Bu]}addToError(Lu){if(Lu.postcssNode=this,Lu.stack&&this.source&&/\n\s{4}at /.test(Lu.stack)){let Bu=this.source;Lu.stack=Lu.stack.replace(/\n\s{4}at /,`$&${Bu.input.from}:${Bu.start.line}:${Bu.start.column}$&`)}return Lu}after(Lu){return this.parent.insertAfter(this,Lu),this}assign(Lu={}){for(let Bu in Lu)this[Bu]=Lu[Bu];return this}before(Lu){return this.parent.insertBefore(this,Lu),this}cleanRaws(Lu){delete this.raws.before,delete this.raws.after,Lu||delete this.raws.between}clone(Lu={}){let Bu=Pu(this);for(let ju in Lu)Bu[ju]=Lu[ju];return Bu}cloneAfter(Lu={}){let Bu=this.clone(Lu);return this.parent.insertAfter(this,Bu),Bu}cloneBefore(Lu={}){let Bu=this.clone(Lu);return this.parent.insertBefore(this,Bu),Bu}error(Lu,Bu={}){if(this.source){let{end:ju,start:Fu}=this.rangeBy(Bu);return this.source.input.error(Lu,{column:Fu.column,line:Fu.line},{column:ju.column,line:ju.line},Bu)}return new Au(Lu)}getProxyProcessor(){return{get(Lu,Bu){return Bu==="proxyOf"?Lu:Bu==="root"?()=>Lu.root().toProxy():Lu[Bu]},set(Lu,Bu,ju){return Lu[Bu]===ju||(Lu[Bu]=ju,(Bu==="prop"||Bu==="value"||Bu==="name"||Bu==="params"||Bu==="important"||Bu==="text")&&Lu.markDirty()),!0}}}markClean(){this[Ru]=!0}markDirty(){if(this[Ru]){this[Ru]=!1;let Lu=this;for(;Lu=Lu.parent;)Lu[Ru]=!1}}next(){if(!this.parent)return;let Lu=this.parent.index(this);return this.parent.nodes[Lu+1]}positionBy(Lu={}){let Bu="document"in this.source.input?this.source.input.document:this.source.input.css,ju={column:this.source.start.column,line:this.source.start.line,offset:Ou(Bu,this.source.start)};if(Lu.index)ju=this.positionInside(Lu.index);else if(Lu.word){let zu=Bu.slice(Ou(Bu,this.source.start),Ou(Bu,this.source.end)).indexOf(Lu.word);zu!==-1&&(ju=this.positionInside(zu))}return ju}positionInside(Lu){let Bu=this.source.start.column,ju=this.source.start.line,Fu="document"in this.source.input?this.source.input.document:this.source.input.css,zu=Ou(Fu,this.source.start),Uu=zu+Lu;for(let Hu=zu;Hu<Uu;Hu++)Fu[Hu]===`
1748
1748
  `?(Bu=1,ju+=1):Bu+=1;return{column:Bu,line:ju,offset:Uu}}prev(){if(!this.parent)return;let Lu=this.parent.index(this);return this.parent.nodes[Lu-1]}rangeBy(Lu={}){let Bu="document"in this.source.input?this.source.input.document:this.source.input.css,ju={column:this.source.start.column,line:this.source.start.line,offset:Ou(Bu,this.source.start)},Fu=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Ou(Bu,this.source.end)+1}:{column:ju.column+1,line:ju.line,offset:ju.offset+1};if(Lu.word){let Uu=Bu.slice(Ou(Bu,this.source.start),Ou(Bu,this.source.end)).indexOf(Lu.word);Uu!==-1&&(ju=this.positionInside(Uu),Fu=this.positionInside(Uu+Lu.word.length))}else Lu.start?ju={column:Lu.start.column,line:Lu.start.line,offset:Ou(Bu,Lu.start)}:typeof Lu.index=="number"&&(ju=this.positionInside(Lu.index)),Lu.end?Fu={column:Lu.end.column,line:Lu.end.line,offset:Ou(Bu,Lu.end)}:typeof Lu.endIndex=="number"?Fu=this.positionInside(Lu.endIndex):typeof Lu.index=="number"&&(Fu=this.positionInside(Lu.index+1));return(Fu.line<ju.line||Fu.line===ju.line&&Fu.column<=ju.column)&&(Fu={column:ju.column+1,line:ju.line,offset:ju.offset+1}),{end:Fu,start:ju}}raw(Lu,Bu){return new lo().raw(this,Lu,Bu)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...Lu){if(this.parent){let Bu=this,ju=!1;for(let Fu of Lu)Fu===this?ju=!0:ju?(this.parent.insertAfter(Bu,Fu),Bu=Fu):this.parent.insertBefore(Bu,Fu);ju||this.remove()}return this}root(){let Lu=this;for(;Lu.parent&&Lu.parent.type!=="document";)Lu=Lu.parent;return Lu}toJSON(Lu,Bu){let ju=Bu==null;Bu=Bu||new Map;let Fu=[],zu=[[this,Fu,0]];for(let Hu=0;Hu<zu.length;Hu++){let[Vu,Gu,Wu]=zu[Hu],Ku={};Gu[Wu]=Ku;for(let Ju in Vu){if(!Object.prototype.hasOwnProperty.call(Vu,Ju)||Ju==="parent"||Ju==="proxyCache")continue;let Yu=Vu[Ju];if(Array.isArray(Yu)){let Xu=[];Ku[Ju]=Xu;for(let ed=0;ed<Yu.length;ed++){let td=Yu[ed];typeof td=="object"&&td.toJSON?td.toJSON===Mu.prototype.toJSON?zu.push([td,Xu,ed]):Xu[ed]=td.toJSON(null,Bu):Xu[ed]=td}}else if(typeof Yu=="object"&&Yu.toJSON)Yu.toJSON===Mu.prototype.toJSON?zu.push([Yu,Ku,Ju]):Ku[Ju]=Yu.toJSON(null,Bu);else if(Ju==="source"){if(Yu==null)continue;let Xu=Bu.get(Yu.input);Xu==null&&(Xu=Bu.size,Bu.set(Yu.input,Xu)),Ku[Ju]={end:Yu.end,inputId:Xu,start:Yu.start}}else Ku[Ju]=Yu}}let Uu=Fu[0];return ju&&(Uu.inputs=[...Bu.keys()].map(Hu=>Hu.toJSON())),Uu}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(Lu=$u){Lu.stringify&&(Lu=Lu.stringify);let Bu="";return Lu(this,ju=>{Bu+=ju}),Bu}warn(Lu,Bu,ju={}){let Fu={node:this};for(let zu in ju)Fu[zu]=ju[zu];return Lu.warn(Bu,Fu)}}return node$3=Mu,Mu.default=Mu,node$3}var comment$6,hasRequiredComment;function requireComment(){if(hasRequiredComment)return comment$6;hasRequiredComment=1;let Au=requireNode();class lo extends Au{constructor(Ru){super(Ru),this.type="comment"}}return comment$6=lo,lo.default=lo,comment$6}var declaration$1,hasRequiredDeclaration;function requireDeclaration(){if(hasRequiredDeclaration)return declaration$1;hasRequiredDeclaration=1;let Au=requireNode();class lo extends Au{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(Ru){Ru&&typeof Ru.value<"u"&&typeof Ru.value!="string"&&(Ru={...Ru,value:String(Ru.value)}),super(Ru),this.type="decl"}}return declaration$1=lo,lo.default=lo,declaration$1}var container,hasRequiredContainer;function requireContainer(){if(hasRequiredContainer)return container;hasRequiredContainer=1;let Au=requireComment(),lo=requireDeclaration(),$u=requireNode(),{isClean:Ru,my:Iu}=requireSymbols(),Pu,Ou,Mu,Du;function Lu(Fu){let zu=Fu.slice();for(;zu.length>0;){let Uu=zu.pop();if(delete Uu.source,Uu.nodes){Uu.nodes=Uu.nodes.slice();for(let Hu of Uu.nodes)zu.push(Hu)}}return Fu.slice()}function Bu(Fu){let zu=[Fu];for(;zu.length>0;){let Uu=zu.pop();if(Uu[Ru]=!1,Uu.proxyOf.nodes)for(let Hu of Uu.proxyOf.nodes)zu.push(Hu)}}class ju extends $u{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...zu){for(let Uu of zu){let Hu=this.normalize(Uu,this.last);for(let Vu of Hu)this.proxyOf.nodes.push(Vu)}return this.markDirty(),this}cleanRaws(zu){let Uu=[this];for(;Uu.length>0;){let Hu=Uu.pop();if(Hu!==this&&Hu.cleanRaws!==ju.prototype.cleanRaws){Hu.cleanRaws(zu);continue}if($u.prototype.cleanRaws.call(Hu,zu),Hu.nodes)for(let Vu of Hu.nodes)Uu.push(Vu)}}each(zu){if(!this.proxyOf.nodes)return;let Uu=this.getIterator(),Hu,Vu;for(;this.indexes[Uu]<this.proxyOf.nodes.length&&(Hu=this.indexes[Uu],Vu=zu(this.proxyOf.nodes[Hu],Hu),Vu!==!1);)this.indexes[Uu]+=1;return delete this.indexes[Uu],Vu}every(zu){return this.nodes.every(zu)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let zu=this.lastEach;return this.indexes[zu]=0,zu}getProxyProcessor(){return{get(zu,Uu){return Uu==="proxyOf"?zu:zu[Uu]?Uu==="each"||typeof Uu=="string"&&Uu.startsWith("walk")?(...Hu)=>zu[Uu](...Hu.map(Vu=>typeof Vu=="function"?(Gu,Wu)=>Vu(Gu.toProxy(),Wu):Vu)):Uu==="every"||Uu==="some"?Hu=>zu[Uu]((Vu,...Gu)=>Hu(Vu.toProxy(),...Gu)):Uu==="root"?()=>zu.root().toProxy():Uu==="nodes"?zu.nodes.map(Hu=>Hu.toProxy()):Uu==="first"||Uu==="last"?zu[Uu].toProxy():zu[Uu]:zu[Uu]},set(zu,Uu,Hu){return zu[Uu]===Hu||(zu[Uu]=Hu,(Uu==="name"||Uu==="params"||Uu==="selector")&&zu.markDirty()),!0}}}index(zu){return typeof zu=="number"?zu:(zu.proxyOf&&(zu=zu.proxyOf),this.proxyOf.nodes.indexOf(zu))}insertAfter(zu,Uu){let Hu=this.index(zu),Vu=this.normalize(Uu,this.proxyOf.nodes[Hu]).reverse();Hu=this.index(zu);for(let Wu of Vu)this.proxyOf.nodes.splice(Hu+1,0,Wu);let Gu;for(let Wu in this.indexes)Gu=this.indexes[Wu],Hu<Gu&&(this.indexes[Wu]=Gu+Vu.length);return this.markDirty(),this}insertBefore(zu,Uu){let Hu=this.index(zu),Vu=Hu===0?"prepend":!1,Gu=this.normalize(Uu,this.proxyOf.nodes[Hu],Vu).reverse();Hu=this.index(zu);for(let Ku of Gu)this.proxyOf.nodes.splice(Hu,0,Ku);let Wu;for(let Ku in this.indexes)Wu=this.indexes[Ku],Hu<=Wu&&(this.indexes[Ku]=Wu+Gu.length);return this.markDirty(),this}normalize(zu,Uu){if(typeof zu=="string")zu=Lu(Ou(zu).nodes);else if(typeof zu>"u")zu=[];else if(Array.isArray(zu)){zu=zu.slice(0);for(let Vu of zu)Vu.parent&&Vu.parent.removeChild(Vu,"ignore")}else if(zu.type==="root"&&this.type!=="document"){zu=zu.nodes.slice(0);for(let Vu of zu)Vu.parent&&Vu.parent.removeChild(Vu,"ignore")}else if(zu.type)zu=[zu];else if(zu.prop){if(typeof zu.value>"u")throw new Error("Value field is missed in node creation");typeof zu.value!="string"&&(zu.value=String(zu.value)),zu=[new lo(zu)]}else if(zu.selector||zu.selectors)zu=[new Du(zu)];else if(zu.name)zu=[new Pu(zu)];else if(zu.text)zu=[new Au(zu)];else throw new Error("Unknown node type in node creation");return zu.map(Vu=>(Vu[Iu]||ju.rebuild(Vu),Vu=Vu.proxyOf,Vu.parent&&Vu.parent.removeChild(Vu),Vu[Ru]&&Bu(Vu),Vu.raws||(Vu.raws={}),typeof Vu.raws.before>"u"&&Uu&&typeof Uu.raws.before<"u"&&(Vu.raws.before=Uu.raws.before.replace(/\S/g,"")),Vu.parent=this.proxyOf,Vu))}prepend(...zu){zu=zu.reverse();for(let Uu of zu){let Hu=this.normalize(Uu,this.first,"prepend").reverse();for(let Vu of Hu)this.proxyOf.nodes.unshift(Vu);for(let Vu in this.indexes)this.indexes[Vu]=this.indexes[Vu]+Hu.length}return this.markDirty(),this}push(zu){return zu.parent=this,this.proxyOf.nodes.push(zu),this}removeAll(){for(let zu of this.proxyOf.nodes)zu.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(zu){zu=this.index(zu),this.proxyOf.nodes[zu].parent=void 0,this.proxyOf.nodes.splice(zu,1);let Uu;for(let Hu in this.indexes)Uu=this.indexes[Hu],Uu>=zu&&(this.indexes[Hu]=Uu-1);return this.markDirty(),this}replaceValues(zu,Uu,Hu){return Hu||(Hu=Uu,Uu={}),this.walkDecls(Vu=>{Uu.props&&!Uu.props.includes(Vu.prop)||Uu.fast&&!Vu.value.includes(Uu.fast)||(Vu.value=Vu.value.replace(zu,Hu))}),this.markDirty(),this}some(zu){return this.nodes.some(zu)}walk(zu){if(!this.proxyOf.nodes)return;let Uu=[{iterator:this.getIterator(),node:this.proxyOf}];for(;Uu.length>0;){let{iterator:Hu,node:Vu}=Uu[Uu.length-1],Gu=Vu.indexes[Hu];if(Gu>=Vu.proxyOf.nodes.length){delete Vu.indexes[Hu],Uu.pop();let Ju=Uu[Uu.length-1];Ju&&(Ju.node.indexes[Ju.iterator]+=1);continue}let Wu=Vu.proxyOf.nodes[Gu],Ku;try{Ku=zu(Wu,Gu)}catch(Ju){throw Wu.addToError(Ju)}if(Ku===!1){for(let Ju of Uu)delete Ju.node.indexes[Ju.iterator];return!1}Wu.walk&&Wu.proxyOf.nodes?Uu.push({iterator:Wu.getIterator(),node:Wu}):Vu.indexes[Hu]+=1}}walkAtRules(zu,Uu){return Uu?zu instanceof RegExp?this.walk((Hu,Vu)=>{if(Hu.type==="atrule"&&zu.test(Hu.name))return Uu(Hu,Vu)}):this.walk((Hu,Vu)=>{if(Hu.type==="atrule"&&Hu.name===zu)return Uu(Hu,Vu)}):(Uu=zu,this.walk((Hu,Vu)=>{if(Hu.type==="atrule")return Uu(Hu,Vu)}))}walkComments(zu){return this.walk((Uu,Hu)=>{if(Uu.type==="comment")return zu(Uu,Hu)})}walkDecls(zu,Uu){return Uu?zu instanceof RegExp?this.walk((Hu,Vu)=>{if(Hu.type==="decl"&&zu.test(Hu.prop))return Uu(Hu,Vu)}):this.walk((Hu,Vu)=>{if(Hu.type==="decl"&&Hu.prop===zu)return Uu(Hu,Vu)}):(Uu=zu,this.walk((Hu,Vu)=>{if(Hu.type==="decl")return Uu(Hu,Vu)}))}walkRules(zu,Uu){return Uu?zu instanceof RegExp?this.walk((Hu,Vu)=>{if(Hu.type==="rule"&&zu.test(Hu.selector))return Uu(Hu,Vu)}):this.walk((Hu,Vu)=>{if(Hu.type==="rule"&&Hu.selector===zu)return Uu(Hu,Vu)}):(Uu=zu,this.walk((Hu,Vu)=>{if(Hu.type==="rule")return Uu(Hu,Vu)}))}}return ju.registerParse=Fu=>{Ou=Fu},ju.registerRule=Fu=>{Du=Fu},ju.registerAtRule=Fu=>{Pu=Fu},ju.registerRoot=Fu=>{Mu=Fu},container=ju,ju.default=ju,ju.rebuild=Fu=>{let zu=[Fu];for(;zu.length>0;){let Uu=zu.pop();if(Uu.type==="atrule"?Object.setPrototypeOf(Uu,Pu.prototype):Uu.type==="rule"?Object.setPrototypeOf(Uu,Du.prototype):Uu.type==="decl"?Object.setPrototypeOf(Uu,lo.prototype):Uu.type==="comment"?Object.setPrototypeOf(Uu,Au.prototype):Uu.type==="root"&&Object.setPrototypeOf(Uu,Mu.prototype),Uu[Iu]=!0,Uu.nodes)for(let Hu of Uu.nodes)zu.push(Hu)}},container}var atRule,hasRequiredAtRule;function requireAtRule(){if(hasRequiredAtRule)return atRule;hasRequiredAtRule=1;let Au=requireContainer();class lo extends Au{constructor(Ru){super(Ru),this.type="atrule"}append(...Ru){return this.proxyOf.nodes||(this.nodes=[]),super.append(...Ru)}prepend(...Ru){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...Ru)}}return atRule=lo,lo.default=lo,Au.registerAtRule(lo),atRule}var document$3,hasRequiredDocument;function requireDocument(){if(hasRequiredDocument)return document$3;hasRequiredDocument=1;let Au=requireContainer(),lo,$u;class Ru extends Au{constructor(Pu){super({type:"document",...Pu}),this.nodes||(this.nodes=[])}toResult(Pu={}){return new lo(new $u,this,Pu).stringify()}}return Ru.registerLazyResult=Iu=>{lo=Iu},Ru.registerProcessor=Iu=>{$u=Iu},document$3=Ru,Ru.default=Ru,document$3}var nonSecure,hasRequiredNonSecure;function requireNonSecure(){if(hasRequiredNonSecure)return nonSecure;hasRequiredNonSecure=1;let Au="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return nonSecure={nanoid:(Ru=21)=>{let Iu="",Pu=Ru|0;for(;Pu-- >0;)Iu+=Au[Math.random()*64|0];return Iu},customAlphabet:(Ru,Iu=21)=>(Pu=Iu)=>{let Ou="",Mu=Pu|0;for(;Mu-- >0;)Ou+=Ru[Math.random()*Ru.length|0];return Ou}},nonSecure}var previousMap,hasRequiredPreviousMap;function requirePreviousMap(){if(hasRequiredPreviousMap)return previousMap;hasRequiredPreviousMap=1;let{existsSync:Au,readFileSync:lo,realpathSync:$u}=require$$0,{dirname:Ru,isAbsolute:Iu,join:Pu,relative:Ou,sep:Mu}=require$$0,{SourceMapConsumer:Du,SourceMapGenerator:Lu}=require$$0;function Bu(zu){try{return $u(zu)}catch{return zu}}function ju(zu){return Buffer?Buffer.from(zu,"base64").toString():window.atob(zu)}class Fu{constructor(Uu,Hu){if(Hu.map===!1)return;Hu.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(Uu),this.inline=this.startWith(this.annotation,"data:");let Vu=Hu.map?Hu.map.prev:void 0,Gu=this.loadMap(Hu.from,Vu);!this.mapFile&&Hu.from&&(this.mapFile=Hu.from),this.mapFile&&(this.root=Ru(this.mapFile)),Gu&&(this.text=Gu)}consumer(){return this.consumerCache||(this.consumerCache=new Du(this.json||this.text)),this.consumerCache}decodeInline(Uu){let Hu=/^data:application\/json;charset=utf-?8;base64,/,Vu=/^data:application\/json;base64,/,Gu=/^data:application\/json;charset=utf-?8,/,Wu=/^data:application\/json,/,Ku=Uu.match(Gu)||Uu.match(Wu);if(Ku)return decodeURIComponent(Uu.substr(Ku[0].length));let Ju=Uu.match(Hu)||Uu.match(Vu);if(Ju)return ju(Uu.substr(Ju[0].length));let Yu=Uu.slice(22);throw Yu=Yu.slice(0,Yu.indexOf(",")),new Error("Unsupported source map encoding "+Yu)}getAnnotationURL(Uu){return Uu.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(Uu){return typeof Uu!="object"?!1:typeof Uu.mappings=="string"||typeof Uu._mappings=="string"||Array.isArray(Uu.sections)}loadAnnotation(Uu){let Hu=Uu.match(/\/\*\s*# sourceMappingURL=/g);if(!Hu)return;let Vu=Uu.lastIndexOf(Hu.pop()),Gu=Uu.indexOf("*/",Vu);Vu>-1&&Gu>-1&&(this.annotation=this.getAnnotationURL(Uu.substring(Vu,Gu)))}loadFile(Uu,Hu,Vu){if(!Vu&&!this.unsafeMap){if(!/\.map$/i.test(Uu)||!Hu)return;let Gu=Ou(Bu(Ru(Hu)),Bu(Uu));if(Gu===".."||Gu.startsWith(".."+Mu)||Iu(Gu))return}if(this.root=Ru(Uu),Au(Uu))return this.mapFile=Uu,lo(Uu,"utf-8").toString().trim()}loadMap(Uu,Hu){if(Hu===!1)return!1;if(Hu){if(typeof Hu=="string")return Hu;if(typeof Hu=="function"){let Vu=Hu(Uu);if(Vu){let Gu=this.loadFile(Vu,Uu,!0);if(!Gu)throw new Error("Unable to load previous source map: "+Vu.toString());return Gu}}else{if(Hu instanceof Du)return Lu.fromSourceMap(Hu).toString();if(Hu instanceof Lu)return Hu.toString();if(this.isMap(Hu))return JSON.stringify(Hu);throw new Error("Unsupported previous source map format: "+Hu.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let Vu=this.annotation;Uu&&(Vu=Pu(Ru(Uu),Vu));let Gu=this.loadFile(Vu,Uu,!1);if(Gu)try{this.json=JSON.parse(Gu.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return Gu}}}startWith(Uu,Hu){return Uu?Uu.substr(0,Hu.length)===Hu:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return previousMap=Fu,Fu.default=Fu,previousMap}var input,hasRequiredInput;function requireInput(){if(hasRequiredInput)return input;hasRequiredInput=1;let{nanoid:Au}=requireNonSecure(),{isAbsolute:lo,resolve:$u}=require$$0,{SourceMapConsumer:Ru,SourceMapGenerator:Iu}=require$$0,{fileURLToPath:Pu,pathToFileURL:Ou}=require$$0,Mu=requireCssSyntaxError(),Du=requirePreviousMap(),Lu=require$$0,Bu=Symbol("lineToIndexCache"),ju=!!(Ru&&Iu),Fu=!!($u&&lo);function zu(Hu){if(Hu[Bu])return Hu[Bu];let Vu=Hu.css.split(`
1749
1749
  `),Gu=new Array(Vu.length),Wu=0;for(let Ku=0,Ju=Vu.length;Ku<Ju;Ku++)Gu[Ku]=Wu,Wu+=Vu[Ku].length+1;return Hu[Bu]=Gu,Gu}class Uu{get from(){return this.file||this.id}constructor(Vu,Gu={}){if(Vu===null||typeof Vu>"u"||typeof Vu=="object"&&!Vu.toString)throw new Error(`PostCSS received ${Vu} instead of CSS string`);if(this.css=Vu.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,Gu.document&&(this.document=Gu.document.toString()),Gu.from&&(!Fu||/^\w+:\/\//.test(Gu.from)||lo(Gu.from)?this.file=Gu.from:this.file=$u(Gu.from)),Fu&&ju){let Wu=new Du(this.css,Gu);if(Wu.text){this.map=Wu;let Ku=Wu.consumer().file;!this.file&&Ku&&(this.file=this.mapResolve(Ku))}}this.file||(this.id="<input css "+Au(6)+">"),this.map&&(this.map.file=this.from)}error(Vu,Gu,Wu,Ku={}){let Ju,Yu,Xu,ed,td;if(Gu&&typeof Gu=="object"){let od=Gu,sd=Wu;if(typeof od.offset=="number"){ed=od.offset;let ad=this.fromOffset(ed);Gu=ad.line,Wu=ad.col}else Gu=od.line,Wu=od.column,ed=this.fromLineAndColumn(Gu,Wu);if(typeof sd.offset=="number"){Xu=sd.offset;let ad=this.fromOffset(Xu);Yu=ad.line,Ju=ad.col}else Yu=sd.line,Ju=sd.column,Xu=this.fromLineAndColumn(sd.line,sd.column)}else if(Wu)ed=this.fromLineAndColumn(Gu,Wu);else{ed=Gu;let od=this.fromOffset(ed);Gu=od.line,Wu=od.col}let nd=this.origin(Gu,Wu,Yu,Ju);return nd?td=new Mu(Vu,nd.endLine===void 0?nd.line:{column:nd.column,line:nd.line},nd.endLine===void 0?nd.column:{column:nd.endColumn,line:nd.endLine},nd.source,nd.file,Ku.plugin):td=new Mu(Vu,Yu===void 0?Gu:{column:Wu,line:Gu},Yu===void 0?Wu:{column:Ju,line:Yu},this.css,this.file,Ku.plugin),td.input={column:Wu,endColumn:Ju,endLine:Yu,endOffset:Xu,line:Gu,offset:ed,source:this.css},this.file&&(Ou&&(td.input.url=Ou(this.file).toString()),td.input.file=this.file),td}fromLineAndColumn(Vu,Gu){return zu(this)[Vu-1]+Gu-1}fromOffset(Vu){let Gu=zu(this),Wu=Gu[Gu.length-1],Ku=0;if(Vu>=Wu)Ku=Gu.length-1;else{let Ju=Gu.length-2,Yu;for(;Ku<Ju;)if(Yu=Ku+(Ju-Ku>>1),Vu<Gu[Yu])Ju=Yu-1;else if(Vu>=Gu[Yu+1])Ku=Yu+1;else{Ku=Yu;break}}return{col:Vu-Gu[Ku]+1,line:Ku+1}}mapResolve(Vu){return/^\w+:\/\//.test(Vu)?Vu:$u(this.map.consumer().sourceRoot||this.map.root||".",Vu)}origin(Vu,Gu,Wu,Ku){if(!this.map)return!1;let Ju=this.map.consumer(),Yu=Ju.originalPositionFor({column:Gu-1,line:Vu});if(!Yu.source)return!1;let Xu;if(typeof Wu=="number"){let od=Ju.originalPositionFor({column:Ku-1,line:Wu});od.source&&(Xu=od)}let ed;lo(Yu.source)?ed=Ou(Yu.source):ed=new URL(Yu.source,this.map.consumer().sourceRoot||Ou(this.map.mapFile));let td={column:Yu.column+1,endColumn:Xu&&Xu.column+1,endLine:Xu&&Xu.line,line:Yu.line,url:ed.toString()};if(ed.protocol==="file:")if(Pu)td.file=Pu(ed);else throw new Error("file: protocol is not available in this PostCSS build");let nd=Ju.sourceContentFor(Yu.source);return nd&&(td.source=nd),td}toJSON(){let Vu={};for(let Gu of["hasBOM","css","file","id"])this[Gu]!=null&&(Vu[Gu]=this[Gu]);return this.map&&(Vu.map={...this.map},Vu.map.consumerCache&&(Vu.map.consumerCache=void 0)),Vu}}return input=Uu,Uu.default=Uu,Lu&&Lu.registerInput&&Lu.registerInput(Uu),input}var root$7,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root$7;hasRequiredRoot=1;let Au=requireContainer(),lo,$u;class Ru extends Au{constructor(Pu){super(Pu),this.type="root",this.nodes||(this.nodes=[])}normalize(Pu,Ou,Mu){let Du=new Set;for(let Bu of Array.isArray(Pu)?Pu:[Pu])Bu&&typeof Bu=="object"&&!Bu.parent&&Bu.raws&&typeof Bu.raws.before<"u"&&Du.add(Bu.raws);let Lu=super.normalize(Pu);if(Ou){if(Mu==="prepend")this.nodes.length>1?Ou.raws.before=this.nodes[1].raws.before:delete Ou.raws.before;else if(this.first!==Ou)for(let Bu of Lu)Du.has(Bu.raws)||(Bu.raws.before=Ou.raws.before)}return Lu}removeChild(Pu,Ou){let Mu=this.index(Pu);return!Ou&&Mu===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[Mu].raws.before),super.removeChild(Pu)}toResult(Pu={}){return new lo(new $u,this,Pu).stringify()}}return Ru.registerLazyResult=Iu=>{lo=Iu},Ru.registerProcessor=Iu=>{$u=Iu},root$7=Ru,Ru.default=Ru,Au.registerRoot(Ru),root$7}var list_1,hasRequiredList;function requireList(){if(hasRequiredList)return list_1;hasRequiredList=1;let Au={comma(lo){return Au.split(lo,[","],!0)},space(lo){let $u=[" ",`
@@ -1752,7 +1752,7 @@ Please use Ctrl + V (or ⌘ + V on macOS) instead.`),buttons:[Dialog.okButton({l
1752
1752
  `)&&(zu=`\r
1753
1753
  `),this.css+=zu+"/*# sourceMappingURL="+Fu+" */"}applyPrevMaps(){for(let Fu of this.previous()){let zu=this.toUrl(this.path(Fu.file)),Uu=Fu.root||Au(Fu.file),Hu;this.mapOpts.sourcesContent===!1?(Hu=new Iu(Fu.text),Hu.sourcesContent&&(Hu.sourcesContent=null)):Hu=Fu.consumer(),this.map.applySourceMap(Hu,zu,this.toUrl(this.path(Uu)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let Fu;for(let zu=this.root.nodes.length-1;zu>=0;zu--)Fu=this.root.nodes[zu],Fu.type==="comment"&&Fu.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(zu)}else if(this.css){let Fu="/*# sourceMappingURL=",zu="",Uu=0,Hu;for(;(Hu=this.css.indexOf(Fu,Uu))!==-1;){let Vu=this.css.indexOf("*/",Hu+Fu.length);if(Vu===-1)break;for(;Hu>Uu&&this.css[Hu-1]===`
1754
1754
  `;)Hu--;zu+=this.css.slice(Uu,Hu),Uu=Vu+2}Uu>0&&(this.css=zu+this.css.slice(Uu))}}}generate(){if(this.clearAnnotation(),Lu&&Du&&this.isMap())return this.generateMap();{let Fu="";return this.stringify(this.root,zu=>{Fu+=zu}),[Fu]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let Fu=this.previous()[0].consumer();Fu.file=this.outputFile(),this.map=Pu.fromSourceMap(Fu,{ignoreInvalidMapping:!0})}else this.map=new Pu({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Pu({file:this.outputFile(),ignoreInvalidMapping:!0});let Fu=1,zu=1,Uu="<no source>",Hu={generated:{column:0,line:0},original:{column:0,line:0},source:""},Vu,Gu;this.stringify(this.root,(Wu,Ku,Ju)=>{if(this.css+=Wu,Ku&&Ju!=="end"&&(Hu.generated.line=Fu,Hu.generated.column=zu-1,Ku.source&&Ku.source.start?(Hu.source=this.sourcePath(Ku),Hu.original.line=Ku.source.start.line,Hu.original.column=Ku.source.start.column-1,this.map.addMapping(Hu)):(Hu.source=Uu,Hu.original.line=1,Hu.original.column=0,this.map.addMapping(Hu))),Gu=Wu.match(/\n/g),Gu?(Fu+=Gu.length,Vu=Wu.lastIndexOf(`
1755
- `),zu=Wu.length-Vu):zu+=Wu.length,Ku&&Ju!=="start"){let Yu=Ku.parent||{raws:{}};(!(Ku.type==="decl"||Ku.type==="atrule"&&!Ku.nodes)||Ku!==Yu.last||Yu.raws.semicolon)&&(Ku.source&&Ku.source.end?(Hu.source=this.sourcePath(Ku),Hu.original.line=Ku.source.end.line,Hu.original.column=Ku.source.end.column-1,Hu.generated.line=Fu,Hu.generated.column=zu-2,this.map.addMapping(Hu)):(Hu.source=Uu,Hu.original.line=1,Hu.original.column=0,Hu.generated.line=Fu,Hu.generated.column=zu-1,this.map.addMapping(Hu)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(Fu=>Fu.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let Fu=this.mapOpts.annotation;return typeof Fu<"u"&&Fu!==!0?!1:this.previous().length?this.previous().some(zu=>zu.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(Fu=>Fu.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(Fu){if(this.mapOpts.absolute||Fu.charCodeAt(0)===60||/^\w+:\/\//.test(Fu))return Fu;let zu=this.memoizedPaths.get(Fu);if(zu)return zu;let Uu=this.opts.to?Au(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(Uu=Au($u(Uu,this.mapOpts.annotation)));let Hu=lo(Uu,Fu);return this.memoizedPaths.set(Fu,Hu),Hu}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(Fu=>{if(Fu.source&&Fu.source.input.map){let zu=Fu.source.input.map;this.previousMaps.includes(zu)||this.previousMaps.push(zu)}});else{let Fu=new Mu(this.originalCSS,this.opts);Fu.map&&this.previousMaps.push(Fu.map)}return this.previousMaps}setSourcesContent(){let Fu={};if(this.root)this.root.walk(zu=>{if(zu.source){let Uu=zu.source.input.from;if(Uu&&!Fu[Uu]){Fu[Uu]=!0;let Hu=this.usesFileUrls?this.toFileUrl(Uu):this.toUrl(this.path(Uu));this.map.setSourceContent(Hu,zu.source.input.css)}}});else if(this.css){let zu=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(zu,this.css)}}sourcePath(Fu){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(Fu.source.input.from):this.toUrl(this.path(Fu.source.input.from))}toBase64(Fu){return Buffer?Buffer.from(Fu).toString("base64"):window.btoa(unescape(encodeURIComponent(Fu)))}toFileUrl(Fu){let zu=this.memoizedFileURLs.get(Fu);if(zu)return zu;if(Ou){let Uu=Ou(Fu).toString();return this.memoizedFileURLs.set(Fu,Uu),Uu}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(Fu){let zu=this.memoizedURLs.get(Fu);if(zu)return zu;Ru==="\\"&&(Fu=Fu.replace(/\\/g,"/"));let Uu=encodeURI(Fu).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(Fu,Uu),Uu}}return mapGenerator=Bu,mapGenerator}var tokenize,hasRequiredTokenize;function requireTokenize(){if(hasRequiredTokenize)return tokenize;hasRequiredTokenize=1;const Au=39,lo=34,$u=92,Ru=47,Iu=10,Pu=32,Ou=12,Mu=9,Du=13,Lu=91,Bu=93,ju=40,Fu=41,zu=123,Uu=125,Hu=59,Vu=42,Gu=58,Wu=64,Ku=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ju=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Yu=/.[\r\n"'(/\\]/,Xu=/[\da-f]/i;return tokenize=function(td,nd={}){let od=td.css.valueOf(),sd=nd.ignoreErrors,ad,pd,gd,xd,yd,bd,wd,Ad,cd,dd,md=od.length,ld=0,hd=[],vd=[],Sd=-1;function Td(){return ld}function Rd(kd){throw td.error("Unclosed "+kd,ld)}function Od(){return vd.length===0&&ld>=md}function Bd(kd){if(vd.length)return vd.pop();if(ld>=md)return;let Id=kd?kd.ignoreUnclosed:!1;switch(ad=od.charCodeAt(ld),ad){case Iu:case Pu:case Mu:case Du:case Ou:{xd=ld;do xd+=1,ad=od.charCodeAt(xd);while(ad===Pu||ad===Iu||ad===Mu||ad===Du||ad===Ou);bd=["space",od.slice(ld,xd)],ld=xd-1;break}case Lu:case Bu:case zu:case Uu:case Gu:case Hu:case Fu:{let Wd=String.fromCharCode(ad);bd=[Wd,Wd,ld];break}case ju:{if(dd=hd.length?hd.pop()[1]:"",cd=od.charCodeAt(ld+1),dd==="url"&&cd!==Au&&cd!==lo&&cd!==Pu&&cd!==Iu&&cd!==Mu&&cd!==Ou&&cd!==Du){xd=ld;do{if(wd=!1,xd=od.indexOf(")",xd+1),xd===-1)if(sd||Id){xd=ld;break}else Rd("bracket");for(Ad=xd;od.charCodeAt(Ad-1)===$u;)Ad-=1,wd=!wd}while(wd);bd=["brackets",od.slice(ld,xd+1),ld,xd],ld=xd}else ld<=Sd?bd=["(","(",ld]:(xd=od.indexOf(")",ld+1),pd=od.slice(ld,xd+1),xd===-1||Yu.test(pd)?(Sd=xd===-1?md:xd,bd=["(","(",ld]):(bd=["brackets",pd,ld,xd],ld=xd));break}case Au:case lo:{yd=ad===Au?"'":'"',xd=ld;do{if(wd=!1,xd=od.indexOf(yd,xd+1),xd===-1)if(sd||Id){xd=ld+1;break}else Rd("string");for(Ad=xd;od.charCodeAt(Ad-1)===$u;)Ad-=1,wd=!wd}while(wd);bd=["string",od.slice(ld,xd+1),ld,xd],ld=xd;break}case Wu:{Ku.lastIndex=ld+1,Ku.test(od),Ku.lastIndex===0?xd=od.length-1:xd=Ku.lastIndex-2,bd=["at-word",od.slice(ld,xd+1),ld,xd],ld=xd;break}case $u:{for(xd=ld,gd=!0;od.charCodeAt(xd+1)===$u;)xd+=1,gd=!gd;if(ad=od.charCodeAt(xd+1),gd&&ad!==Ru&&ad!==Pu&&ad!==Iu&&ad!==Mu&&ad!==Du&&ad!==Ou&&(xd+=1,Xu.test(od.charAt(xd)))){for(;Xu.test(od.charAt(xd+1));)xd+=1;od.charCodeAt(xd+1)===Pu&&(xd+=1)}bd=["word",od.slice(ld,xd+1),ld,xd],ld=xd;break}default:{ad===Ru&&od.charCodeAt(ld+1)===Vu?(xd=od.indexOf("*/",ld+2)+1,xd===0&&(sd||Id?xd=od.length:Rd("comment")),bd=["comment",od.slice(ld,xd+1),ld,xd],ld=xd):(Ju.lastIndex=ld+1,Ju.test(od),Ju.lastIndex===0?xd=od.length-1:xd=Ju.lastIndex-2,bd=["word",od.slice(ld,xd+1),ld,xd],hd.push(bd),ld=xd);break}}return ld++,bd}function Ed(kd){vd.push(kd)}return{back:Ed,endOfFile:Od,nextToken:Bd,position:Td}},tokenize}var parser,hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser;hasRequiredParser=1;let Au=requireAtRule(),lo=requireComment(),$u=requireDeclaration(),Ru=requireRoot(),Iu=requireRule(),Pu=requireTokenize();const Ou={empty:!0,space:!0};function Mu(Bu){for(let ju=Bu.length-1;ju>=0;ju--){let Fu=Bu[ju],zu=Fu[3]||Fu[2];if(zu)return zu}}function Du(Bu,ju,Fu){let zu="";for(let Uu=ju;Uu<Fu;Uu++)zu+=Bu[Uu][1];return zu}class Lu{constructor(ju){this.input=ju,this.root=new Ru,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:ju,start:{column:1,line:1,offset:0}}}atrule(ju){let Fu=new Au;Fu.name=ju[1].slice(1),Fu.name===""&&this.unnamedAtrule(Fu,ju),this.init(Fu,ju[2]);let zu,Uu,Hu,Vu=!1,Gu=!1,Wu=[],Ku=[];for(;!this.tokenizer.endOfFile();){if(ju=this.tokenizer.nextToken(),zu=ju[0],zu==="("||zu==="["?Ku.push(zu==="("?")":"]"):zu==="{"&&Ku.length>0?Ku.push("}"):zu===Ku[Ku.length-1]&&Ku.pop(),Ku.length===0)if(zu===";"){Fu.source.end=this.getPosition(ju[2]),Fu.source.end.offset++,this.semicolon=!0;break}else if(zu==="{"){Gu=!0;break}else if(zu==="}"){if(Wu.length>0){for(Hu=Wu.length-1,Uu=Wu[Hu];Uu&&Uu[0]==="space";)Uu=Wu[--Hu];Uu&&(Fu.source.end=this.getPosition(Uu[3]||Uu[2]),Fu.source.end.offset++)}this.end(ju);break}else Wu.push(ju);else Wu.push(ju);if(this.tokenizer.endOfFile()){Vu=!0;break}}Fu.raws.between=this.spacesAndCommentsFromEnd(Wu),Wu.length?(Fu.raws.afterName=this.spacesAndCommentsFromStart(Wu),this.raw(Fu,"params",Wu),Vu&&(ju=Wu[Wu.length-1],Fu.source.end=this.getPosition(ju[3]||ju[2]),Fu.source.end.offset++,this.spaces=Fu.raws.between,Fu.raws.between="")):(Fu.raws.afterName="",Fu.params=""),Gu&&(Fu.nodes=[],this.current=Fu)}checkMissedSemicolon(ju){let Fu=this.colon(ju);if(Fu===!1)return;let zu=0,Uu;for(let Hu=Fu-1;Hu>=0&&(Uu=ju[Hu],!(Uu[0]!=="space"&&(zu+=1,zu===2)));Hu--);throw this.input.error("Missed semicolon",Uu[0]==="word"?Uu[3]+1:Uu[2])}colon(ju){let Fu=0,zu,Uu,Hu;for(let[Vu,Gu]of ju.entries()){if(Uu=Gu,Hu=Uu[0],Hu==="("&&(Fu+=1),Hu===")"&&(Fu-=1),Fu===0&&Hu===":")if(!zu)this.doubleColon(Uu);else{if(zu[0]==="word"&&zu[1]==="progid")continue;return Vu}zu=Uu}return!1}comment(ju){let Fu=new lo;this.init(Fu,ju[2]),Fu.source.end=this.getPosition(ju[3]||ju[2]),Fu.source.end.offset++;let zu=ju[1].slice(2,-2);if(!zu.trim())Fu.text="",Fu.raws.left=zu,Fu.raws.right="";else{let Uu=zu.match(/^(\s*)([^]*\S)(\s*)$/);Fu.text=Uu[2],Fu.raws.left=Uu[1],Fu.raws.right=Uu[3]}}createTokenizer(){this.tokenizer=Pu(this.input)}decl(ju,Fu){let zu=new $u;this.init(zu,ju[0][2]);let Uu=ju[ju.length-1];Uu[0]===";"&&(this.semicolon=!0,ju.pop()),zu.source.end=this.getPosition(Uu[3]||Uu[2]||Mu(ju)),zu.source.end.offset++;let Hu=0;for(;ju[Hu][0]!=="word";)Hu===ju.length-1&&this.unknownWord([ju[Hu]]),Hu++;zu.raws.before+=Du(ju,0,Hu),zu.source.start=this.getPosition(ju[Hu][2]);let Vu=Hu;for(;Hu<ju.length;){let Xu=ju[Hu][0];if(Xu===":"||Xu==="space"||Xu==="comment")break;Hu++}zu.prop=Du(ju,Vu,Hu);let Gu=Hu,Wu;for(;Hu<ju.length&&(Wu=ju[Hu],Hu++,Wu[0]!==":");)Wu[0]==="word"&&/\w/.test(Wu[1])&&this.unknownWord([Wu]);zu.raws.between=Du(ju,Gu,Hu),(zu.prop[0]==="_"||zu.prop[0]==="*")&&(zu.raws.before+=zu.prop[0],zu.prop=zu.prop.slice(1));let Ku=Hu;for(;Hu<ju.length;){let Xu=ju[Hu][0];if(Xu!=="space"&&Xu!=="comment")break;Hu++}let Ju=ju.slice(Ku,Hu);ju=ju.slice(Hu),this.precheckMissedSemicolon(ju);for(let Xu=ju.length-1;Xu>=0;Xu--){if(Wu=ju[Xu],Wu[1].toLowerCase()==="!important"){zu.important=!0;let ed=this.stringFrom(ju,Xu);ed=this.spacesFromEnd(ju)+ed,ed!==" !important"&&(zu.raws.important=ed);break}else if(Wu[1].toLowerCase()==="important"){let ed=ju.slice(0),td="";for(let nd=Xu;nd>0;nd--){let od=ed[nd][0];if(td.trim().startsWith("!")&&od!=="space")break;td=ed.pop()[1]+td}td.trim().startsWith("!")&&(zu.important=!0,zu.raws.important=td,ju=ed)}if(Wu[0]!=="space"&&Wu[0]!=="comment")break}ju.some(Xu=>Xu[0]!=="space"&&Xu[0]!=="comment")&&(zu.raws.between+=Ju.map(Xu=>Xu[1]).join(""),Ju=[]),this.raw(zu,"value",Ju.concat(ju),Fu),zu.value.includes(":")&&!Fu&&this.checkMissedSemicolon(ju)}doubleColon(ju){throw this.input.error("Double colon",{offset:ju[2]},{offset:ju[2]+ju[1].length})}emptyRule(ju){let Fu=new Iu;this.init(Fu,ju[2]),Fu.selector="",Fu.raws.between="",this.current=Fu}end(ju){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(ju[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(ju)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(ju){if(this.spaces+=ju[1],this.current.nodes){let Fu=this.current.nodes[this.current.nodes.length-1];Fu&&Fu.type==="rule"&&!Fu.raws.ownSemicolon&&(Fu.raws.ownSemicolon=this.spaces,this.spaces="",Fu.source.end=this.getPosition(ju[2]),Fu.source.end.offset++)}}getPosition(ju){let Fu=this.input.fromOffset(ju);return{column:Fu.col,line:Fu.line,offset:ju}}init(ju,Fu){this.current.push(ju),ju.source={input:this.input,start:this.getPosition(Fu)},ju.raws.before=this.spaces,this.spaces="",ju.type!=="comment"&&(this.semicolon=!1)}other(ju){let Fu=!1,zu=null,Uu=!1,Hu=null,Vu=[],Gu=ju[1].startsWith("--"),Wu=[],Ku=ju;for(;Ku;){if(zu=Ku[0],Wu.push(Ku),zu==="("||zu==="[")Hu||(Hu=Ku),Vu.push(zu==="("?")":"]");else if(Gu&&Uu&&zu==="{")Hu||(Hu=Ku),Vu.push("}");else if(Vu.length===0)if(zu===";")if(Uu){this.decl(Wu,Gu);return}else break;else if(zu==="{"){this.rule(Wu);return}else if(zu==="}"){this.tokenizer.back(Wu.pop()),Fu=!0;break}else zu===":"&&(Uu=!0);else zu===Vu[Vu.length-1]&&(Vu.pop(),Vu.length===0&&(Hu=null));Ku=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(Fu=!0),Vu.length>0&&this.unclosedBracket(Hu),Fu&&Uu){if(!Gu)for(;Wu.length&&(Ku=Wu[Wu.length-1][0],!(Ku!=="space"&&Ku!=="comment"));)this.tokenizer.back(Wu.pop());this.decl(Wu,Gu)}else this.unknownWord(Wu)}parse(){let ju;for(;!this.tokenizer.endOfFile();)switch(ju=this.tokenizer.nextToken(),ju[0]){case"space":this.spaces+=ju[1];break;case";":this.freeSemicolon(ju);break;case"}":this.end(ju);break;case"comment":this.comment(ju);break;case"at-word":this.atrule(ju);break;case"{":this.emptyRule(ju);break;default:this.other(ju);break}this.endFile()}precheckMissedSemicolon(){}raw(ju,Fu,zu,Uu){let Hu,Vu,Gu=zu.length,Wu="",Ku="",Ju=!0,Yu,Xu;for(let ed=0;ed<Gu;ed+=1)Hu=zu[ed],Vu=Hu[0],Vu==="space"&&ed===Gu-1&&!Uu?Ju=!1:Vu==="comment"?(Xu=zu[ed-1]?zu[ed-1][0]:"empty",Yu=zu[ed+1]?zu[ed+1][0]:"empty",!Ou[Xu]&&!Ou[Yu]?Ku===","?Ju=!1:(Wu+=Hu[1],Ku=Hu[1].slice(-1)):Ju=!1):(Wu+=Hu[1],Ku=Hu[1].slice(-1));if(!Ju){let ed=zu.reduce((td,nd)=>td+nd[1],"");ju.raws[Fu]={raw:ed,value:Wu}}ju[Fu]=Wu}rule(ju){ju.pop();let Fu=new Iu;this.init(Fu,ju[0][2]),Fu.raws.between=this.spacesAndCommentsFromEnd(ju),this.raw(Fu,"selector",ju),this.current=Fu}spacesAndCommentsFromEnd(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[ju.length-1][0],!(Fu!=="space"&&Fu!=="comment"));)zu=ju.pop()[1]+zu;return zu}spacesAndCommentsFromStart(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[0][0],!(Fu!=="space"&&Fu!=="comment"));)zu+=ju.shift()[1];return zu}spacesFromEnd(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[ju.length-1][0],Fu==="space");)zu=ju.pop()[1]+zu;return zu}stringFrom(ju,Fu){let zu="";for(let Uu=Fu;Uu<ju.length;Uu++)zu+=ju[Uu][1];return ju.splice(Fu,ju.length-Fu),zu}unclosedBlock(){let ju=this.current.source.start;throw this.input.error("Unclosed block",ju.line,ju.column)}unclosedBracket(ju){throw this.input.error("Unclosed bracket",{offset:ju[2]},{offset:ju[2]+1})}unexpectedClose(ju){throw this.input.error("Unexpected }",{offset:ju[2]},{offset:ju[2]+1})}unknownWord(ju){throw this.input.error("Unknown word "+ju[0][1],{offset:ju[0][2]},{offset:ju[0][2]+ju[0][1].length})}unnamedAtrule(ju,Fu){throw this.input.error("At-rule without name",{offset:Fu[2]},{offset:Fu[2]+Fu[1].length})}}return parser=Lu,parser}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1;let Au=requireContainer(),lo=requireInput(),$u=requireParser();function Ru(Iu,Pu){let Ou=new lo(Iu,Pu),Mu=new $u(Ou);try{Mu.parse()}catch(Du){throw Du}return Mu.root}return parse_1=Ru,Ru.default=Ru,Au.registerParse(Ru),parse_1}var warning$1,hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning$1;hasRequiredWarning=1;let Au=requireContainer(),{my:lo}=requireSymbols();class $u{constructor(Iu,Pu={}){if(this.type="warning",this.text=Iu,Pu.node&&Pu.node.source){Pu.node[lo]||Au.rebuild(Pu.node);let Ou=Pu.node.rangeBy(Pu);this.line=Ou.start.line,this.column=Ou.start.column,this.endLine=Ou.end.line,this.endColumn=Ou.end.column}for(let Ou in Pu)this[Ou]=Pu[Ou]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return warning$1=$u,$u.default=$u,warning$1}var result,hasRequiredResult;function requireResult(){if(hasRequiredResult)return result;hasRequiredResult=1;let Au=requireWarning();class lo{get content(){return this.css}constructor(Ru,Iu,Pu){this.processor=Ru,this.messages=[],this.root=Iu,this.opts=Pu,this.css="",this.map=void 0}toString(){return this.css}warn(Ru,Iu={}){Iu.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(Iu.plugin=this.lastPlugin.postcssPlugin);let Pu=new Au(Ru,Iu);return this.messages.push(Pu),Pu}warnings(){return this.messages.filter(Ru=>Ru.type==="warning")}}return result=lo,lo.default=lo,result}var lazyResult,hasRequiredLazyResult;function requireLazyResult(){if(hasRequiredLazyResult)return lazyResult;hasRequiredLazyResult=1;let Au=requireContainer(),lo=requireDocument(),$u=requireMapGenerator(),Ru=requireParse(),Iu=requireResult(),Pu=requireRoot(),Ou=requireStringify(),{isClean:Mu,my:Du}=requireSymbols();const Lu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Bu={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ju={Once:!0,postcssPlugin:!0,prepare:!0},Fu=0;function zu(Ku){return typeof Ku=="object"&&typeof Ku.then=="function"}function Uu(Ku){let Ju=!1,Yu=Lu[Ku.type];return Ku.type==="decl"?Ju=Ku.prop.toLowerCase():Ku.type==="atrule"&&(Ju=Ku.name.toLowerCase()),Ju&&Ku.append?[Yu,Yu+"-"+Ju,Fu,Yu+"Exit",Yu+"Exit-"+Ju]:Ju?[Yu,Yu+"-"+Ju,Yu+"Exit",Yu+"Exit-"+Ju]:Ku.append?[Yu,Fu,Yu+"Exit"]:[Yu,Yu+"Exit"]}function Hu(Ku){let Ju;return Ku.type==="document"?Ju=["Document",Fu,"DocumentExit"]:Ku.type==="root"?Ju=["Root",Fu,"RootExit"]:Ju=Uu(Ku),{eventIndex:0,events:Ju,iterator:0,node:Ku,visitorIndex:0,visitors:[]}}function Vu(Ku){let Ju=[Ku];for(;Ju.length>0;){let Yu=Ju.pop();if(Yu[Mu]=!1,Yu.nodes)for(let Xu of Yu.nodes)Ju.push(Xu)}return Ku}let Gu={};class Wu{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(Ju,Yu,Xu){this.stringified=!1,this.processed=!1;let ed;if(typeof Yu=="object"&&Yu!==null&&(Yu.type==="root"||Yu.type==="document"))ed=Vu(Yu);else if(Yu instanceof Wu||Yu instanceof Iu)ed=Vu(Yu.root),Yu.map&&(typeof Xu.map>"u"&&(Xu.map={}),Xu.map.inline||(Xu.map.inline=!1),Xu.map.prev=Yu.map);else{let td=Ru;Xu.syntax&&(td=Xu.syntax.parse),Xu.parser&&(td=Xu.parser),td.parse&&(td=td.parse);try{ed=td(Yu,Xu)}catch(nd){this.processed=!0,this.error=nd}ed&&!ed[Du]&&Au.rebuild(ed)}this.result=new Iu(Ju,ed,Xu),this.helpers={...Gu,postcss:Gu,result:this.result},this.plugins=this.processor.plugins.map(td=>typeof td=="object"&&td.prepare?{...td,...td.prepare(this.result)}:td)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(Ju){return this.async().catch(Ju)}finally(Ju){return this.async().then(Ju,Ju)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(Ju,Yu){let Xu=this.result.lastPlugin;try{Yu&&Yu.addToError(Ju),this.error=Ju,Ju.name==="CssSyntaxError"&&!Ju.plugin?(Ju.plugin=Xu.postcssPlugin,Ju.setMessage()):Xu.postcssVersion}catch(ed){console&&console.error&&console.error(ed)}return Ju}prepareVisitors(){this.listeners={};let Ju=(Yu,Xu,ed)=>{this.listeners[Xu]||(this.listeners[Xu]=[]),this.listeners[Xu].push([Yu,ed])};for(let Yu of this.plugins)if(typeof Yu=="object")for(let Xu in Yu){if(!Bu[Xu]&&/^[A-Z]/.test(Xu))throw new Error(`Unknown event ${Xu} in ${Yu.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ju[Xu])if(typeof Yu[Xu]=="object")for(let ed in Yu[Xu])ed==="*"?Ju(Yu,Xu,Yu[Xu][ed]):Ju(Yu,Xu+"-"+ed.toLowerCase(),Yu[Xu][ed]);else typeof Yu[Xu]=="function"&&Ju(Yu,Xu,Yu[Xu])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let Ju=0;Ju<this.plugins.length;Ju++){let Yu=this.plugins[Ju],Xu=this.runOnRoot(Yu);if(zu(Xu))try{await Xu}catch(ed){throw this.handleError(ed)}}if(this.prepareVisitors(),this.hasListener){let Ju=this.result.root;for(;!Ju[Mu];){Ju[Mu]=!0;let Yu=[Hu(Ju)];for(;Yu.length>0;){let Xu=this.visitTick(Yu);if(zu(Xu))try{await Xu}catch(ed){let td=Yu[Yu.length-1].node;throw this.handleError(ed,td)}}}if(this.listeners.OnceExit)for(let[Yu,Xu]of this.listeners.OnceExit){this.result.lastPlugin=Yu;try{if(Ju.type==="document"){let ed=Ju.nodes.map(td=>Xu(td,this.helpers));await Promise.all(ed)}else await Xu(Ju,this.helpers)}catch(ed){throw this.handleError(ed)}}}return this.processed=!0,this.stringify()}runOnRoot(Ju){this.result.lastPlugin=Ju;try{if(typeof Ju=="object"&&Ju.Once){if(this.result.root.type==="document"){let Yu=this.result.root.nodes.map(Xu=>Ju.Once(Xu,this.helpers));return zu(Yu[0])?Promise.all(Yu):Yu}return Ju.Once(this.result.root,this.helpers)}else if(typeof Ju=="function")return Ju(this.result.root,this.result)}catch(Yu){throw this.handleError(Yu)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let Ju=this.result.opts,Yu=Ou;Ju.syntax&&(Yu=Ju.syntax.stringify),Ju.stringifier&&(Yu=Ju.stringifier),Yu.stringify&&(Yu=Yu.stringify);let Xu=this.result.root.source;if(Ju.map===void 0&&!(Xu&&Xu.input&&Xu.input.map)){let nd="";return Yu(this.result.root,od=>{nd+=od}),this.result.css=nd,this.result}let td=new $u(Yu,this.result.root,this.result.opts).generate();return this.result.css=td[0],this.result.map=td[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let Ju of this.plugins){let Yu=this.runOnRoot(Ju);if(zu(Yu))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let Ju=this.result.root;for(;!Ju[Mu];)Ju[Mu]=!0,this.walkSync(Ju);if(this.listeners.OnceExit)if(Ju.type==="document")for(let Yu of Ju.nodes)this.visitSync(this.listeners.OnceExit,Yu);else this.visitSync(this.listeners.OnceExit,Ju)}return this.result}then(Ju,Yu){return this.async().then(Ju,Yu)}toString(){return this.css}visitSync(Ju,Yu){for(let[Xu,ed]of Ju){this.result.lastPlugin=Xu;let td;try{td=ed(Yu,this.helpers)}catch(nd){throw this.handleError(nd,Yu.proxyOf)}if(Yu.type!=="root"&&Yu.type!=="document"&&!Yu.parent)return!0;if(zu(td))throw this.getAsyncError()}}visitTick(Ju){let Yu=Ju[Ju.length-1],{node:Xu,visitors:ed}=Yu;if(Xu.type!=="root"&&Xu.type!=="document"&&!Xu.parent){Ju.pop();return}if(ed.length>0&&Yu.visitorIndex<ed.length){let[nd,od]=ed[Yu.visitorIndex];Yu.visitorIndex+=1,Yu.visitorIndex===ed.length&&(Yu.visitors=[],Yu.visitorIndex=0),this.result.lastPlugin=nd;try{return od(Xu.toProxy(),this.helpers)}catch(sd){throw this.handleError(sd,Xu)}}if(Yu.iterator!==0){let nd=Yu.iterator;Yu.descending&&(Yu.descending=!1,Xu.indexes[nd]+=1);let od;for(;od=Xu.nodes[Xu.indexes[nd]];){if(!od[Mu]){od[Mu]=!0,Yu.descending=!0,Ju.push(Hu(od));return}Xu.indexes[nd]+=1}Yu.iterator=0,delete Xu.indexes[nd]}let td=Yu.events;for(;Yu.eventIndex<td.length;){let nd=td[Yu.eventIndex];if(Yu.eventIndex+=1,nd===Fu){Xu.nodes&&Xu.nodes.length&&(Xu[Mu]=!0,Yu.iterator=Xu.getIterator());return}else if(this.listeners[nd]){Yu.visitors=this.listeners[nd];return}}Ju.pop()}walkSync(Ju){Ju[Mu]=!0;let Yu=[{eventIndex:0,events:Uu(Ju),iterator:0,node:Ju}];for(;Yu.length>0;){let Xu=Yu[Yu.length-1],ed=Xu.node;if(Xu.iterator!==0){let td=Xu.iterator;Xu.descending&&(Xu.descending=!1,ed.indexes[td]+=1);let nd,od=!1;for(;nd=ed.nodes[ed.indexes[td]];){if(!nd[Mu]){nd[Mu]=!0,Xu.descending=!0,Yu.push({eventIndex:0,events:Uu(nd),iterator:0,node:nd}),od=!0;break}ed.indexes[td]+=1}if(od)continue;Xu.iterator=0,delete ed.indexes[td]}if(Xu.eventIndex<Xu.events.length){let td=Xu.events[Xu.eventIndex];if(Xu.eventIndex+=1,td===Fu)ed.nodes&&ed.nodes.length&&(Xu.iterator=ed.getIterator());else{let nd=this.listeners[td];nd&&this.visitSync(nd,ed.toProxy())&&Yu.pop()}continue}Yu.pop()}}warnings(){return this.sync().warnings()}}return Wu.registerPostcss=Ku=>{Gu=Ku},lazyResult=Wu,Wu.default=Wu,Pu.registerLazyResult(Wu),lo.registerLazyResult(Wu),lazyResult}var noWorkResult,hasRequiredNoWorkResult;function requireNoWorkResult(){if(hasRequiredNoWorkResult)return noWorkResult;hasRequiredNoWorkResult=1;let Au=requireMapGenerator(),lo=requireParse(),$u=requireResult(),Ru=requireStringify();class Iu{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let Ou,Mu=lo;try{Ou=Mu(this._css,this._opts)}catch(Du){this.error=Du}if(this.error)throw this.error;return this._root=Ou,Ou}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(Ou,Mu,Du){Mu=Mu.toString(),this.stringified=!1,this._processor=Ou,this._css=Mu,this._opts=Du,this._map=void 0;let Lu=Ru;this.result=new $u(this._processor,void 0,this._opts),this.result.css=Mu;let Bu=this;Object.defineProperty(this.result,"root",{get(){return Bu.root}});let ju=new Au(Lu,void 0,this._opts,Mu);if(ju.isMap()){let[Fu,zu]=ju.generate();Fu&&(this.result.css=Fu),zu&&(this.result.map=zu)}else ju.clearAnnotation(),this.result.css=ju.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(Ou){return this.async().catch(Ou)}finally(Ou){return this.async().then(Ou,Ou)}sync(){if(this.error)throw this.error;return this.result}then(Ou,Mu){return this.async().then(Ou,Mu)}toString(){return this._css}warnings(){return[]}}return noWorkResult=Iu,Iu.default=Iu,noWorkResult}var processor,hasRequiredProcessor;function requireProcessor(){if(hasRequiredProcessor)return processor;hasRequiredProcessor=1;let Au=requireDocument(),lo=requireLazyResult(),$u=requireNoWorkResult(),Ru=requireRoot();class Iu{constructor(Ou=[]){this.version="8.5.29",this.plugins=this.normalize(Ou)}normalize(Ou){let Mu=[];for(let Du of Ou)if(Du.postcss===!0?Du=Du():Du.postcss&&(Du=Du.postcss),typeof Du=="object"&&Array.isArray(Du.plugins))Mu=Mu.concat(Du.plugins);else if(typeof Du=="object"&&Du.postcssPlugin)Mu.push(Du);else if(typeof Du=="function")Mu.push(Du);else if(!(typeof Du=="object"&&(Du.parse||Du.stringify)))throw new Error(Du+" is not a PostCSS plugin");return Mu}process(Ou,Mu={}){return!this.plugins.length&&!Mu.parser&&!Mu.stringifier&&!Mu.syntax?new $u(this,Ou,Mu):new lo(this,Ou,Mu)}use(Ou){return this.plugins=this.plugins.concat(this.normalize([Ou])),this}}return processor=Iu,Iu.default=Iu,Ru.registerProcessor(Iu),Au.registerProcessor(Iu),processor}var postcss_1,hasRequiredPostcss;function requirePostcss(){if(hasRequiredPostcss)return postcss_1;hasRequiredPostcss=1;var Au={};let lo=requireAtRule(),$u=requireComment(),Ru=requireContainer(),Iu=requireCssSyntaxError(),Pu=requireDeclaration(),Ou=requireDocument(),Mu=requireFromJSON(),Du=requireInput(),Lu=requireLazyResult(),Bu=requireList(),ju=requireNode(),Fu=requireParse(),zu=requireProcessor(),Uu=requireResult(),Hu=requireRoot(),Vu=requireRule(),Gu=requireStringify(),Wu=requireWarning();function Ku(...Ju){return Ju.length===1&&Array.isArray(Ju[0])&&(Ju=Ju[0]),new zu(Ju)}return Ku.plugin=function(Yu,Xu){let ed=!1;function td(...od){console&&console.warn&&!ed&&(ed=!0,console.warn(Yu+`: postcss.plugin was deprecated. Migration guide:
1755
+ `),zu=Wu.length-Vu):zu+=Wu.length,Ku&&Ju!=="start"){let Yu=Ku.parent||{raws:{}};(!(Ku.type==="decl"||Ku.type==="atrule"&&!Ku.nodes)||Ku!==Yu.last||Yu.raws.semicolon)&&(Ku.source&&Ku.source.end?(Hu.source=this.sourcePath(Ku),Hu.original.line=Ku.source.end.line,Hu.original.column=Ku.source.end.column-1,Hu.generated.line=Fu,Hu.generated.column=zu-2,this.map.addMapping(Hu)):(Hu.source=Uu,Hu.original.line=1,Hu.original.column=0,Hu.generated.line=Fu,Hu.generated.column=zu-1,this.map.addMapping(Hu)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(Fu=>Fu.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let Fu=this.mapOpts.annotation;return typeof Fu<"u"&&Fu!==!0?!1:this.previous().length?this.previous().some(zu=>zu.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(Fu=>Fu.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(Fu){if(this.mapOpts.absolute||Fu.charCodeAt(0)===60||/^\w+:\/\//.test(Fu))return Fu;let zu=this.memoizedPaths.get(Fu);if(zu)return zu;let Uu=this.opts.to?Au(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(Uu=Au($u(Uu,this.mapOpts.annotation)));let Hu=lo(Uu,Fu);return this.memoizedPaths.set(Fu,Hu),Hu}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(Fu=>{if(Fu.source&&Fu.source.input.map){let zu=Fu.source.input.map;this.previousMaps.includes(zu)||this.previousMaps.push(zu)}});else{let Fu=new Mu(this.originalCSS,this.opts);Fu.map&&this.previousMaps.push(Fu.map)}return this.previousMaps}setSourcesContent(){let Fu={};if(this.root)this.root.walk(zu=>{if(zu.source){let Uu=zu.source.input.from;if(Uu&&!Fu[Uu]){Fu[Uu]=!0;let Hu=this.usesFileUrls?this.toFileUrl(Uu):this.toUrl(this.path(Uu));this.map.setSourceContent(Hu,zu.source.input.css)}}});else if(this.css){let zu=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(zu,this.css)}}sourcePath(Fu){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(Fu.source.input.from):this.toUrl(this.path(Fu.source.input.from))}toBase64(Fu){return Buffer?Buffer.from(Fu).toString("base64"):window.btoa(unescape(encodeURIComponent(Fu)))}toFileUrl(Fu){let zu=this.memoizedFileURLs.get(Fu);if(zu)return zu;if(Ou){let Uu=Ou(Fu).toString();return this.memoizedFileURLs.set(Fu,Uu),Uu}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(Fu){let zu=this.memoizedURLs.get(Fu);if(zu)return zu;Ru==="\\"&&(Fu=Fu.replace(/\\/g,"/"));let Uu=encodeURI(Fu).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(Fu,Uu),Uu}}return mapGenerator=Bu,mapGenerator}var tokenize,hasRequiredTokenize;function requireTokenize(){if(hasRequiredTokenize)return tokenize;hasRequiredTokenize=1;const Au=39,lo=34,$u=92,Ru=47,Iu=10,Pu=32,Ou=12,Mu=9,Du=13,Lu=91,Bu=93,ju=40,Fu=41,zu=123,Uu=125,Hu=59,Vu=42,Gu=58,Wu=64,Ku=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ju=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Yu=/.[\r\n"'(/\\]/,Xu=/[\da-f]/i;return tokenize=function(td,nd={}){let od=td.css.valueOf(),sd=nd.ignoreErrors,ad,pd,gd,xd,yd,bd,wd,Ad,cd,dd,md=od.length,ld=0,hd=[],vd=[],Sd=-1;function Td(){return ld}function Rd(kd){throw td.error("Unclosed "+kd,ld)}function Od(){return vd.length===0&&ld>=md}function Bd(kd){if(vd.length)return vd.pop();if(ld>=md)return;let Id=kd?kd.ignoreUnclosed:!1;switch(ad=od.charCodeAt(ld),ad){case Iu:case Pu:case Mu:case Du:case Ou:{xd=ld;do xd+=1,ad=od.charCodeAt(xd);while(ad===Pu||ad===Iu||ad===Mu||ad===Du||ad===Ou);bd=["space",od.slice(ld,xd)],ld=xd-1;break}case Lu:case Bu:case zu:case Uu:case Gu:case Hu:case Fu:{let Wd=String.fromCharCode(ad);bd=[Wd,Wd,ld];break}case ju:{if(dd=hd.length?hd.pop()[1]:"",cd=od.charCodeAt(ld+1),dd==="url"&&cd!==Au&&cd!==lo&&cd!==Pu&&cd!==Iu&&cd!==Mu&&cd!==Ou&&cd!==Du){xd=ld;do{if(wd=!1,xd=od.indexOf(")",xd+1),xd===-1)if(sd||Id){xd=ld;break}else Rd("bracket");for(Ad=xd;od.charCodeAt(Ad-1)===$u;)Ad-=1,wd=!wd}while(wd);bd=["brackets",od.slice(ld,xd+1),ld,xd],ld=xd}else ld<=Sd?bd=["(","(",ld]:(xd=od.indexOf(")",ld+1),pd=od.slice(ld,xd+1),xd===-1||Yu.test(pd)?(Sd=xd===-1?md:xd,bd=["(","(",ld]):(bd=["brackets",pd,ld,xd],ld=xd));break}case Au:case lo:{yd=ad===Au?"'":'"',xd=ld;do{if(wd=!1,xd=od.indexOf(yd,xd+1),xd===-1)if(sd||Id){xd=ld+1;break}else Rd("string");for(Ad=xd;od.charCodeAt(Ad-1)===$u;)Ad-=1,wd=!wd}while(wd);bd=["string",od.slice(ld,xd+1),ld,xd],ld=xd;break}case Wu:{Ku.lastIndex=ld+1,Ku.test(od),Ku.lastIndex===0?xd=od.length-1:xd=Ku.lastIndex-2,bd=["at-word",od.slice(ld,xd+1),ld,xd],ld=xd;break}case $u:{for(xd=ld,gd=!0;od.charCodeAt(xd+1)===$u;)xd+=1,gd=!gd;if(ad=od.charCodeAt(xd+1),gd&&ad!==Ru&&ad!==Pu&&ad!==Iu&&ad!==Mu&&ad!==Du&&ad!==Ou&&(xd+=1,Xu.test(od.charAt(xd)))){for(;Xu.test(od.charAt(xd+1));)xd+=1;od.charCodeAt(xd+1)===Pu&&(xd+=1)}bd=["word",od.slice(ld,xd+1),ld,xd],ld=xd;break}default:{ad===Ru&&od.charCodeAt(ld+1)===Vu?(xd=od.indexOf("*/",ld+2)+1,xd===0&&(sd||Id?xd=od.length:Rd("comment")),bd=["comment",od.slice(ld,xd+1),ld,xd],ld=xd):(Ju.lastIndex=ld+1,Ju.test(od),Ju.lastIndex===0?xd=od.length-1:xd=Ju.lastIndex-2,bd=["word",od.slice(ld,xd+1),ld,xd],hd.push(bd),ld=xd);break}}return ld++,bd}function Ed(kd){vd.push(kd)}return{back:Ed,endOfFile:Od,nextToken:Bd,position:Td}},tokenize}var parser,hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser;hasRequiredParser=1;let Au=requireAtRule(),lo=requireComment(),$u=requireDeclaration(),Ru=requireRoot(),Iu=requireRule(),Pu=requireTokenize();const Ou={empty:!0,space:!0};function Mu(Bu){for(let ju=Bu.length-1;ju>=0;ju--){let Fu=Bu[ju],zu=Fu[3]||Fu[2];if(zu)return zu}}function Du(Bu,ju,Fu){let zu="";for(let Uu=ju;Uu<Fu;Uu++)zu+=Bu[Uu][1];return zu}class Lu{constructor(ju){this.input=ju,this.root=new Ru,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:ju,start:{column:1,line:1,offset:0}}}atrule(ju){let Fu=new Au;Fu.name=ju[1].slice(1),Fu.name===""&&this.unnamedAtrule(Fu,ju),this.init(Fu,ju[2]);let zu,Uu,Hu,Vu=!1,Gu=!1,Wu=[],Ku=[];for(;!this.tokenizer.endOfFile();){if(ju=this.tokenizer.nextToken(),zu=ju[0],zu==="("||zu==="["?Ku.push(zu==="("?")":"]"):zu==="{"&&Ku.length>0?Ku.push("}"):zu===Ku[Ku.length-1]&&Ku.pop(),Ku.length===0)if(zu===";"){Fu.source.end=this.getPosition(ju[2]),Fu.source.end.offset++,this.semicolon=!0;break}else if(zu==="{"){Gu=!0;break}else if(zu==="}"){if(Wu.length>0){for(Hu=Wu.length-1,Uu=Wu[Hu];Uu&&Uu[0]==="space";)Uu=Wu[--Hu];Uu&&(Fu.source.end=this.getPosition(Uu[3]||Uu[2]),Fu.source.end.offset++)}this.end(ju);break}else Wu.push(ju);else Wu.push(ju);if(this.tokenizer.endOfFile()){Vu=!0;break}}Fu.raws.between=this.spacesAndCommentsFromEnd(Wu),Wu.length?(Fu.raws.afterName=this.spacesAndCommentsFromStart(Wu),this.raw(Fu,"params",Wu),Vu&&(ju=Wu[Wu.length-1],Fu.source.end=this.getPosition(ju[3]||ju[2]),Fu.source.end.offset++,this.spaces=Fu.raws.between,Fu.raws.between="")):(Fu.raws.afterName="",Fu.params=""),Gu&&(Fu.nodes=[],this.current=Fu)}checkMissedSemicolon(ju){let Fu=this.colon(ju);if(Fu===!1)return;let zu=0,Uu;for(let Hu=Fu-1;Hu>=0&&(Uu=ju[Hu],!(Uu[0]!=="space"&&(zu+=1,zu===2)));Hu--);throw this.input.error("Missed semicolon",Uu[0]==="word"?Uu[3]+1:Uu[2])}colon(ju){let Fu=0,zu,Uu,Hu;for(let[Vu,Gu]of ju.entries()){if(Uu=Gu,Hu=Uu[0],Hu==="("&&(Fu+=1),Hu===")"&&(Fu-=1),Fu===0&&Hu===":")if(!zu)this.doubleColon(Uu);else{if(zu[0]==="word"&&zu[1]==="progid")continue;return Vu}zu=Uu}return!1}comment(ju){let Fu=new lo;this.init(Fu,ju[2]),Fu.source.end=this.getPosition(ju[3]||ju[2]),Fu.source.end.offset++;let zu=ju[1].slice(2,-2);if(!zu.trim())Fu.text="",Fu.raws.left=zu,Fu.raws.right="";else{let Uu=zu.match(/^(\s*)([^]*\S)(\s*)$/);Fu.text=Uu[2],Fu.raws.left=Uu[1],Fu.raws.right=Uu[3]}}createTokenizer(){this.tokenizer=Pu(this.input)}decl(ju,Fu){let zu=new $u;this.init(zu,ju[0][2]);let Uu=ju[ju.length-1];Uu[0]===";"&&(this.semicolon=!0,ju.pop()),zu.source.end=this.getPosition(Uu[3]||Uu[2]||Mu(ju)),zu.source.end.offset++;let Hu=0;for(;ju[Hu][0]!=="word";)Hu===ju.length-1&&this.unknownWord([ju[Hu]]),Hu++;zu.raws.before+=Du(ju,0,Hu),zu.source.start=this.getPosition(ju[Hu][2]);let Vu=Hu;for(;Hu<ju.length;){let Xu=ju[Hu][0];if(Xu===":"||Xu==="space"||Xu==="comment")break;Hu++}zu.prop=Du(ju,Vu,Hu);let Gu=Hu,Wu;for(;Hu<ju.length&&(Wu=ju[Hu],Hu++,Wu[0]!==":");)Wu[0]==="word"&&/\w/.test(Wu[1])&&this.unknownWord([Wu]);zu.raws.between=Du(ju,Gu,Hu),(zu.prop[0]==="_"||zu.prop[0]==="*")&&(zu.raws.before+=zu.prop[0],zu.prop=zu.prop.slice(1));let Ku=Hu;for(;Hu<ju.length;){let Xu=ju[Hu][0];if(Xu!=="space"&&Xu!=="comment")break;Hu++}let Ju=ju.slice(Ku,Hu);ju=ju.slice(Hu),this.precheckMissedSemicolon(ju);for(let Xu=ju.length-1;Xu>=0;Xu--){if(Wu=ju[Xu],Wu[1].toLowerCase()==="!important"){zu.important=!0;let ed=this.stringFrom(ju,Xu);ed=this.spacesFromEnd(ju)+ed,ed!==" !important"&&(zu.raws.important=ed);break}else if(Wu[1].toLowerCase()==="important"){let ed=ju.slice(0),td="";for(let nd=Xu;nd>0;nd--){let od=ed[nd][0];if(td.trim().startsWith("!")&&od!=="space")break;td=ed.pop()[1]+td}td.trim().startsWith("!")&&(zu.important=!0,zu.raws.important=td,ju=ed)}if(Wu[0]!=="space"&&Wu[0]!=="comment")break}ju.some(Xu=>Xu[0]!=="space"&&Xu[0]!=="comment")&&(zu.raws.between+=Ju.map(Xu=>Xu[1]).join(""),Ju=[]),this.raw(zu,"value",Ju.concat(ju),Fu),zu.value.includes(":")&&!Fu&&this.checkMissedSemicolon(ju)}doubleColon(ju){throw this.input.error("Double colon",{offset:ju[2]},{offset:ju[2]+ju[1].length})}emptyRule(ju){let Fu=new Iu;this.init(Fu,ju[2]),Fu.selector="",Fu.raws.between="",this.current=Fu}end(ju){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(ju[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(ju)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(ju){if(this.spaces+=ju[1],this.current.nodes){let Fu=this.current.nodes[this.current.nodes.length-1];Fu&&Fu.type==="rule"&&!Fu.raws.ownSemicolon&&(Fu.raws.ownSemicolon=this.spaces,this.spaces="",Fu.source.end=this.getPosition(ju[2]),Fu.source.end.offset++)}}getPosition(ju){let Fu=this.input.fromOffset(ju);return{column:Fu.col,line:Fu.line,offset:ju}}init(ju,Fu){this.current.push(ju),ju.source={input:this.input,start:this.getPosition(Fu)},ju.raws.before=this.spaces,this.spaces="",ju.type!=="comment"&&(this.semicolon=!1)}other(ju){let Fu=!1,zu=null,Uu=!1,Hu=null,Vu=[],Gu=ju[1].startsWith("--"),Wu=[],Ku=ju;for(;Ku;){if(zu=Ku[0],Wu.push(Ku),zu==="("||zu==="[")Hu||(Hu=Ku),Vu.push(zu==="("?")":"]");else if(Gu&&Uu&&zu==="{")Hu||(Hu=Ku),Vu.push("}");else if(Vu.length===0)if(zu===";")if(Uu){this.decl(Wu,Gu);return}else break;else if(zu==="{"){this.rule(Wu);return}else if(zu==="}"){this.tokenizer.back(Wu.pop()),Fu=!0;break}else zu===":"&&(Uu=!0);else zu===Vu[Vu.length-1]&&(Vu.pop(),Vu.length===0&&(Hu=null));Ku=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(Fu=!0),Vu.length>0&&this.unclosedBracket(Hu),Fu&&Uu){if(!Gu)for(;Wu.length&&(Ku=Wu[Wu.length-1][0],!(Ku!=="space"&&Ku!=="comment"));)this.tokenizer.back(Wu.pop());this.decl(Wu,Gu)}else this.unknownWord(Wu)}parse(){let ju;for(;!this.tokenizer.endOfFile();)switch(ju=this.tokenizer.nextToken(),ju[0]){case"space":this.spaces+=ju[1];break;case";":this.freeSemicolon(ju);break;case"}":this.end(ju);break;case"comment":this.comment(ju);break;case"at-word":this.atrule(ju);break;case"{":this.emptyRule(ju);break;default:this.other(ju);break}this.endFile()}precheckMissedSemicolon(){}raw(ju,Fu,zu,Uu){let Hu,Vu,Gu=zu.length,Wu="",Ku="",Ju=!0,Yu,Xu;for(let ed=0;ed<Gu;ed+=1)Hu=zu[ed],Vu=Hu[0],Vu==="space"&&ed===Gu-1&&!Uu?Ju=!1:Vu==="comment"?(Xu=zu[ed-1]?zu[ed-1][0]:"empty",Yu=zu[ed+1]?zu[ed+1][0]:"empty",!Ou[Xu]&&!Ou[Yu]?Ku===","?Ju=!1:(Wu+=Hu[1],Ku=Hu[1].slice(-1)):Ju=!1):(Wu+=Hu[1],Ku=Hu[1].slice(-1));if(!Ju){let ed=zu.reduce((td,nd)=>td+nd[1],"");ju.raws[Fu]={raw:ed,value:Wu}}ju[Fu]=Wu}rule(ju){ju.pop();let Fu=new Iu;this.init(Fu,ju[0][2]),Fu.raws.between=this.spacesAndCommentsFromEnd(ju),this.raw(Fu,"selector",ju),this.current=Fu}spacesAndCommentsFromEnd(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[ju.length-1][0],!(Fu!=="space"&&Fu!=="comment"));)zu=ju.pop()[1]+zu;return zu}spacesAndCommentsFromStart(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[0][0],!(Fu!=="space"&&Fu!=="comment"));)zu+=ju.shift()[1];return zu}spacesFromEnd(ju){let Fu,zu="";for(;ju.length&&(Fu=ju[ju.length-1][0],Fu==="space");)zu=ju.pop()[1]+zu;return zu}stringFrom(ju,Fu){let zu="";for(let Uu=Fu;Uu<ju.length;Uu++)zu+=ju[Uu][1];return ju.splice(Fu,ju.length-Fu),zu}unclosedBlock(){let ju=this.current.source.start;throw this.input.error("Unclosed block",ju.line,ju.column)}unclosedBracket(ju){throw this.input.error("Unclosed bracket",{offset:ju[2]},{offset:ju[2]+1})}unexpectedClose(ju){throw this.input.error("Unexpected }",{offset:ju[2]},{offset:ju[2]+1})}unknownWord(ju){throw this.input.error("Unknown word "+ju[0][1],{offset:ju[0][2]},{offset:ju[0][2]+ju[0][1].length})}unnamedAtrule(ju,Fu){throw this.input.error("At-rule without name",{offset:Fu[2]},{offset:Fu[2]+Fu[1].length})}}return parser=Lu,parser}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1;let Au=requireContainer(),lo=requireInput(),$u=requireParser();function Ru(Iu,Pu){let Ou=new lo(Iu,Pu),Mu=new $u(Ou);try{Mu.parse()}catch(Du){throw Du}return Mu.root}return parse_1=Ru,Ru.default=Ru,Au.registerParse(Ru),parse_1}var warning$1,hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning$1;hasRequiredWarning=1;let Au=requireContainer(),{my:lo}=requireSymbols();class $u{constructor(Iu,Pu={}){if(this.type="warning",this.text=Iu,Pu.node&&Pu.node.source){Pu.node[lo]||Au.rebuild(Pu.node);let Ou=Pu.node.rangeBy(Pu);this.line=Ou.start.line,this.column=Ou.start.column,this.endLine=Ou.end.line,this.endColumn=Ou.end.column}for(let Ou in Pu)this[Ou]=Pu[Ou]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return warning$1=$u,$u.default=$u,warning$1}var result,hasRequiredResult;function requireResult(){if(hasRequiredResult)return result;hasRequiredResult=1;let Au=requireWarning();class lo{get content(){return this.css}constructor(Ru,Iu,Pu){this.processor=Ru,this.messages=[],this.root=Iu,this.opts=Pu,this.css="",this.map=void 0}toString(){return this.css}warn(Ru,Iu={}){Iu.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(Iu.plugin=this.lastPlugin.postcssPlugin);let Pu=new Au(Ru,Iu);return this.messages.push(Pu),Pu}warnings(){return this.messages.filter(Ru=>Ru.type==="warning")}}return result=lo,lo.default=lo,result}var lazyResult,hasRequiredLazyResult;function requireLazyResult(){if(hasRequiredLazyResult)return lazyResult;hasRequiredLazyResult=1;let Au=requireContainer(),lo=requireDocument(),$u=requireMapGenerator(),Ru=requireParse(),Iu=requireResult(),Pu=requireRoot(),Ou=requireStringify(),{isClean:Mu,my:Du}=requireSymbols();const Lu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Bu={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ju={Once:!0,postcssPlugin:!0,prepare:!0},Fu=0;function zu(Ku){return typeof Ku=="object"&&typeof Ku.then=="function"}function Uu(Ku){let Ju=!1,Yu=Lu[Ku.type];return Ku.type==="decl"?Ju=Ku.prop.toLowerCase():Ku.type==="atrule"&&(Ju=Ku.name.toLowerCase()),Ju&&Ku.append?[Yu,Yu+"-"+Ju,Fu,Yu+"Exit",Yu+"Exit-"+Ju]:Ju?[Yu,Yu+"-"+Ju,Yu+"Exit",Yu+"Exit-"+Ju]:Ku.append?[Yu,Fu,Yu+"Exit"]:[Yu,Yu+"Exit"]}function Hu(Ku){let Ju;return Ku.type==="document"?Ju=["Document",Fu,"DocumentExit"]:Ku.type==="root"?Ju=["Root",Fu,"RootExit"]:Ju=Uu(Ku),{eventIndex:0,events:Ju,iterator:0,node:Ku,visitorIndex:0,visitors:[]}}function Vu(Ku){let Ju=[Ku];for(;Ju.length>0;){let Yu=Ju.pop();if(Yu[Mu]=!1,Yu.nodes)for(let Xu of Yu.nodes)Ju.push(Xu)}return Ku}let Gu={};class Wu{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(Ju,Yu,Xu){this.stringified=!1,this.processed=!1;let ed;if(typeof Yu=="object"&&Yu!==null&&(Yu.type==="root"||Yu.type==="document"))ed=Vu(Yu);else if(Yu instanceof Wu||Yu instanceof Iu)ed=Vu(Yu.root),Yu.map&&(typeof Xu.map>"u"&&(Xu.map={}),Xu.map.inline||(Xu.map.inline=!1),Xu.map.prev=Yu.map);else{let td=Ru;Xu.syntax&&(td=Xu.syntax.parse),Xu.parser&&(td=Xu.parser),td.parse&&(td=td.parse);try{ed=td(Yu,Xu)}catch(nd){this.processed=!0,this.error=nd}ed&&!ed[Du]&&Au.rebuild(ed)}this.result=new Iu(Ju,ed,Xu),this.helpers={...Gu,postcss:Gu,result:this.result},this.plugins=this.processor.plugins.map(td=>typeof td=="object"&&td.prepare?{...td,...td.prepare(this.result)}:td)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(Ju){return this.async().catch(Ju)}finally(Ju){return this.async().then(Ju,Ju)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(Ju,Yu){let Xu=this.result.lastPlugin;try{Yu&&Yu.addToError(Ju),this.error=Ju,Ju.name==="CssSyntaxError"&&!Ju.plugin?(Ju.plugin=Xu.postcssPlugin,Ju.setMessage()):Xu.postcssVersion}catch(ed){console&&console.error&&console.error(ed)}return Ju}prepareVisitors(){this.listeners={};let Ju=(Yu,Xu,ed)=>{this.listeners[Xu]||(this.listeners[Xu]=[]),this.listeners[Xu].push([Yu,ed])};for(let Yu of this.plugins)if(typeof Yu=="object")for(let Xu in Yu){if(!Bu[Xu]&&/^[A-Z]/.test(Xu))throw new Error(`Unknown event ${Xu} in ${Yu.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ju[Xu])if(typeof Yu[Xu]=="object")for(let ed in Yu[Xu])ed==="*"?Ju(Yu,Xu,Yu[Xu][ed]):Ju(Yu,Xu+"-"+ed.toLowerCase(),Yu[Xu][ed]);else typeof Yu[Xu]=="function"&&Ju(Yu,Xu,Yu[Xu])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let Ju=0;Ju<this.plugins.length;Ju++){let Yu=this.plugins[Ju],Xu=this.runOnRoot(Yu);if(zu(Xu))try{await Xu}catch(ed){throw this.handleError(ed)}}if(this.prepareVisitors(),this.hasListener){let Ju=this.result.root;for(;!Ju[Mu];){Ju[Mu]=!0;let Yu=[Hu(Ju)];for(;Yu.length>0;){let Xu=this.visitTick(Yu);if(zu(Xu))try{await Xu}catch(ed){let td=Yu[Yu.length-1].node;throw this.handleError(ed,td)}}}if(this.listeners.OnceExit)for(let[Yu,Xu]of this.listeners.OnceExit){this.result.lastPlugin=Yu;try{if(Ju.type==="document"){let ed=Ju.nodes.map(td=>Xu(td,this.helpers));await Promise.all(ed)}else await Xu(Ju,this.helpers)}catch(ed){throw this.handleError(ed)}}}return this.processed=!0,this.stringify()}runOnRoot(Ju){this.result.lastPlugin=Ju;try{if(typeof Ju=="object"&&Ju.Once){if(this.result.root.type==="document"){let Yu=this.result.root.nodes.map(Xu=>Ju.Once(Xu,this.helpers));return zu(Yu[0])?Promise.all(Yu):Yu}return Ju.Once(this.result.root,this.helpers)}else if(typeof Ju=="function")return Ju(this.result.root,this.result)}catch(Yu){throw this.handleError(Yu)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let Ju=this.result.opts,Yu=Ou;Ju.syntax&&(Yu=Ju.syntax.stringify),Ju.stringifier&&(Yu=Ju.stringifier),Yu.stringify&&(Yu=Yu.stringify);let Xu=this.result.root.source;if(Ju.map===void 0&&!(Xu&&Xu.input&&Xu.input.map)){let nd="";return Yu(this.result.root,od=>{nd+=od}),this.result.css=nd,this.result}let td=new $u(Yu,this.result.root,this.result.opts).generate();return this.result.css=td[0],this.result.map=td[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let Ju of this.plugins){let Yu=this.runOnRoot(Ju);if(zu(Yu))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let Ju=this.result.root;for(;!Ju[Mu];)Ju[Mu]=!0,this.walkSync(Ju);if(this.listeners.OnceExit)if(Ju.type==="document")for(let Yu of Ju.nodes)this.visitSync(this.listeners.OnceExit,Yu);else this.visitSync(this.listeners.OnceExit,Ju)}return this.result}then(Ju,Yu){return this.async().then(Ju,Yu)}toString(){return this.css}visitSync(Ju,Yu){for(let[Xu,ed]of Ju){this.result.lastPlugin=Xu;let td;try{td=ed(Yu,this.helpers)}catch(nd){throw this.handleError(nd,Yu.proxyOf)}if(Yu.type!=="root"&&Yu.type!=="document"&&!Yu.parent)return!0;if(zu(td))throw this.getAsyncError()}}visitTick(Ju){let Yu=Ju[Ju.length-1],{node:Xu,visitors:ed}=Yu;if(Xu.type!=="root"&&Xu.type!=="document"&&!Xu.parent){Ju.pop();return}if(ed.length>0&&Yu.visitorIndex<ed.length){let[nd,od]=ed[Yu.visitorIndex];Yu.visitorIndex+=1,Yu.visitorIndex===ed.length&&(Yu.visitors=[],Yu.visitorIndex=0),this.result.lastPlugin=nd;try{return od(Xu.toProxy(),this.helpers)}catch(sd){throw this.handleError(sd,Xu)}}if(Yu.iterator!==0){let nd=Yu.iterator;Yu.descending&&(Yu.descending=!1,Xu.indexes[nd]+=1);let od;for(;od=Xu.nodes[Xu.indexes[nd]];){if(!od[Mu]){od[Mu]=!0,Yu.descending=!0,Ju.push(Hu(od));return}Xu.indexes[nd]+=1}Yu.iterator=0,delete Xu.indexes[nd]}let td=Yu.events;for(;Yu.eventIndex<td.length;){let nd=td[Yu.eventIndex];if(Yu.eventIndex+=1,nd===Fu){Xu.nodes&&Xu.nodes.length&&(Xu[Mu]=!0,Yu.iterator=Xu.getIterator());return}else if(this.listeners[nd]){Yu.visitors=this.listeners[nd];return}}Ju.pop()}walkSync(Ju){Ju[Mu]=!0;let Yu=[{eventIndex:0,events:Uu(Ju),iterator:0,node:Ju}];for(;Yu.length>0;){let Xu=Yu[Yu.length-1],ed=Xu.node;if(Xu.iterator!==0){let td=Xu.iterator;Xu.descending&&(Xu.descending=!1,ed.indexes[td]+=1);let nd,od=!1;for(;nd=ed.nodes[ed.indexes[td]];){if(!nd[Mu]){nd[Mu]=!0,Xu.descending=!0,Yu.push({eventIndex:0,events:Uu(nd),iterator:0,node:nd}),od=!0;break}ed.indexes[td]+=1}if(od)continue;Xu.iterator=0,delete ed.indexes[td]}if(Xu.eventIndex<Xu.events.length){let td=Xu.events[Xu.eventIndex];if(Xu.eventIndex+=1,td===Fu)ed.nodes&&ed.nodes.length&&(Xu.iterator=ed.getIterator());else{let nd=this.listeners[td];nd&&this.visitSync(nd,ed.toProxy())&&Yu.pop()}continue}Yu.pop()}}warnings(){return this.sync().warnings()}}return Wu.registerPostcss=Ku=>{Gu=Ku},lazyResult=Wu,Wu.default=Wu,Pu.registerLazyResult(Wu),lo.registerLazyResult(Wu),lazyResult}var noWorkResult,hasRequiredNoWorkResult;function requireNoWorkResult(){if(hasRequiredNoWorkResult)return noWorkResult;hasRequiredNoWorkResult=1;let Au=requireMapGenerator(),lo=requireParse(),$u=requireResult(),Ru=requireStringify();class Iu{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let Ou,Mu=lo;try{Ou=Mu(this._css,this._opts)}catch(Du){this.error=Du}if(this.error)throw this.error;return this._root=Ou,Ou}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(Ou,Mu,Du){Mu=Mu.toString(),this.stringified=!1,this._processor=Ou,this._css=Mu,this._opts=Du,this._map=void 0;let Lu=Ru;this.result=new $u(this._processor,void 0,this._opts),this.result.css=Mu;let Bu=this;Object.defineProperty(this.result,"root",{get(){return Bu.root}});let ju=new Au(Lu,void 0,this._opts,Mu);if(ju.isMap()){let[Fu,zu]=ju.generate();Fu&&(this.result.css=Fu),zu&&(this.result.map=zu)}else ju.clearAnnotation(),this.result.css=ju.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(Ou){return this.async().catch(Ou)}finally(Ou){return this.async().then(Ou,Ou)}sync(){if(this.error)throw this.error;return this.result}then(Ou,Mu){return this.async().then(Ou,Mu)}toString(){return this._css}warnings(){return[]}}return noWorkResult=Iu,Iu.default=Iu,noWorkResult}var processor,hasRequiredProcessor;function requireProcessor(){if(hasRequiredProcessor)return processor;hasRequiredProcessor=1;let Au=requireDocument(),lo=requireLazyResult(),$u=requireNoWorkResult(),Ru=requireRoot();class Iu{constructor(Ou=[]){this.version="8.5.30",this.plugins=this.normalize(Ou)}normalize(Ou){let Mu=[];for(let Du of Ou)if(Du.postcss===!0?Du=Du():Du.postcss&&(Du=Du.postcss),typeof Du=="object"&&Array.isArray(Du.plugins))Mu=Mu.concat(Du.plugins);else if(typeof Du=="object"&&Du.postcssPlugin)Mu.push(Du);else if(typeof Du=="function")Mu.push(Du);else if(!(typeof Du=="object"&&(Du.parse||Du.stringify)))throw new Error(Du+" is not a PostCSS plugin");return Mu}process(Ou,Mu={}){return!this.plugins.length&&!Mu.parser&&!Mu.stringifier&&!Mu.syntax?new $u(this,Ou,Mu):new lo(this,Ou,Mu)}use(Ou){return this.plugins=this.plugins.concat(this.normalize([Ou])),this}}return processor=Iu,Iu.default=Iu,Ru.registerProcessor(Iu),Au.registerProcessor(Iu),processor}var postcss_1,hasRequiredPostcss;function requirePostcss(){if(hasRequiredPostcss)return postcss_1;hasRequiredPostcss=1;var Au={};let lo=requireAtRule(),$u=requireComment(),Ru=requireContainer(),Iu=requireCssSyntaxError(),Pu=requireDeclaration(),Ou=requireDocument(),Mu=requireFromJSON(),Du=requireInput(),Lu=requireLazyResult(),Bu=requireList(),ju=requireNode(),Fu=requireParse(),zu=requireProcessor(),Uu=requireResult(),Hu=requireRoot(),Vu=requireRule(),Gu=requireStringify(),Wu=requireWarning();function Ku(...Ju){return Ju.length===1&&Array.isArray(Ju[0])&&(Ju=Ju[0]),new zu(Ju)}return Ku.plugin=function(Yu,Xu){let ed=!1;function td(...od){console&&console.warn&&!ed&&(ed=!0,console.warn(Yu+`: postcss.plugin was deprecated. Migration guide:
1756
1756
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Au.LANG&&Au.LANG.startsWith("zh")&&console.warn(Yu+`: 里面 postcss.plugin 被弃用. 迁移指南:
1757
1757
  https://www.w3ctech.com/topic/2226`));let sd=Xu(...od);return sd.postcssPlugin=Yu,sd.postcssVersion=new zu().version,sd}let nd;return Object.defineProperty(td,"postcss",{get(){return nd||(nd=td()),nd}}),td.process=function(od,sd,ad){return Ku([td(ad)]).process(od,sd)},td},Ku.stringify=Gu,Ku.parse=Fu,Ku.fromJSON=Mu,Ku.list=Bu,Ku.comment=Ju=>new $u(Ju),Ku.atRule=Ju=>new lo(Ju),Ku.decl=Ju=>new Pu(Ju),Ku.rule=Ju=>new Vu(Ju),Ku.root=Ju=>new Hu(Ju),Ku.document=Ju=>new Ou(Ju),Ku.CssSyntaxError=Iu,Ku.Declaration=Pu,Ku.Container=Ru,Ku.Processor=zu,Ku.Document=Ou,Ku.Comment=$u,Ku.Warning=Wu,Ku.AtRule=lo,Ku.Result=Uu,Ku.Input=Du,Ku.Rule=Vu,Ku.Root=Hu,Ku.Node=ju,Lu.registerPostcss(Ku),postcss_1=Ku,Ku.default=Ku,postcss_1}var sanitizeHtml_1,hasRequiredSanitizeHtml;function requireSanitizeHtml(){if(hasRequiredSanitizeHtml)return sanitizeHtml_1;hasRequiredSanitizeHtml=1;const Au=requireLib$1(),lo=requireEscapeStringRegexp(),{isPlainObject:$u}=requireIsPlainObject(),Ru=requireCjs$3(),Iu=requireParseSrcset(),{parse:Pu}=requirePostcss(),Ou=["img","audio","video","picture","svg","object","map","iframe","embed"],Mu=["script","style"];function Du(Vu,Gu){Vu&&Object.keys(Vu).forEach(function(Wu){Gu(Vu[Wu],Wu)})}function Lu(Vu,Gu){return{}.hasOwnProperty.call(Vu,Gu)}function Bu(Vu,Gu){const Wu=[];return Du(Vu,function(Ku){Gu(Ku)&&Wu.push(Ku)}),Wu}function ju(Vu){for(const Gu in Vu)if(Lu(Vu,Gu))return!1;return!0}function Fu(Vu){return Vu.map(function(Gu){if(!Gu.url)throw new Error("URL missing");return Gu.url+(Gu.w?` ${Gu.w}w`:"")+(Gu.h?` ${Gu.h}h`:"")+(Gu.d?` ${Gu.d}x`:"")}).join(", ")}sanitizeHtml_1=Uu;const zu=/^[^\0\t\n\f\r /<=>]+$/;function Uu(Vu,Gu,Wu){if(Vu==null)return"";typeof Vu=="number"&&(Vu=Vu.toString());let Ku="",Ju="";function Yu(Ed,kd){const Id=this;this.tag=Ed,this.attribs=kd||{},this.tagPosition=Ku.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(yd.length){const Wd=yd[yd.length-1];Wd.text+=Id.text}},this.updateParentNodeMediaChildren=function(){yd.length&&Ou.includes(this.tag)&&yd[yd.length-1].mediaChildren.push(this.tag)}}Gu=Object.assign({},Uu.defaults,Gu),Gu.parser=Object.assign({},Hu,Gu.parser);const Xu=function(Ed){return Gu.allowedTags===!1||(Gu.allowedTags||[]).indexOf(Ed)>-1};Mu.forEach(function(Ed){Xu(Ed)&&!Gu.allowVulnerableTags&&console.warn(`
1758
1758
 
@@ -3841,7 +3841,7 @@ ${Mu}`:ju,inputs:Mu,clear:Ou?[]:[DRAFT.path],loop:Lu()}:{refused:"Nothing to sen
3841
3841
  }`;function SubagentPulse(){const Au=useAgentRuntimeActiveSubagentToolCallId(),lo=useAgentRuntimeSubagentActivity(Au??void 0),$u=useOptionalReactorPlatform(),Ru=lo[0]?.subagentName??Au??"",Iu=$u?.getOutput(AGENTS_PLUGIN_NAME)?.team?.members.find(Du=>Du.name===Ru),Pu=agentIcon(Iu?.icon);if(!Au)return null;const Mu=lo.some(Du=>Du.transport==="a2a")?`${Ru} is working over A2A…`:`${Ru} is working…`;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("style",{children:KEYFRAMES}),jsxRuntimeExports.jsx(Tooltip,{text:Mu,direction:"n",children:jsxRuntimeExports.jsx(Box,{as:"button",type:"button","aria-label":Mu,"data-subagent-pulse":Ru,display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,p:0,border:0,bg:"transparent",color:"accent.fg",cursor:"default",animation:`${PULSE_ANIMATION} 1.4s ease-in-out infinite`,children:jsxRuntimeExports.jsx(Pu,{size:16})})})]})}const SUBAGENT_ACTIVITY_PLUGIN_NAME="@datalayer/loop-plugin-subagent-activity",SubagentActivityPlugin={name:SUBAGENT_ACTIVITY_PLUGIN_NAME,displayName:"Subagent activity",description:"A delegated agent's icon, pulsing in the prompt's header while it works.",octicon:"people",emoji:"👥",dependencies:[InputPromptPlugin],build:()=>({components:[{id:"subagent-pulse",slot:LoopSlots.inpromptMenu,order:0,Component:SubagentPulse}]})},A2UI_PLUGIN_NAME="@datalayer/loop-plugin-a2ui",A2uiPlugin={name:A2UI_PLUGIN_NAME,displayName:"A2UI surfaces",description:"The last execution, rendered as a surface rather than dumped.",octicon:"browser",emoji:"🖼",dependencies:[AgentsPlugin],contributes:[contribution(LoopViewType,{viewType:"a2ui",title:"Surface",icon:BrowserIcon,order:30,canOpen:Au=>Au.sandbox.state==="running"&&Au.sandbox.variant!=="pyodide",unavailableReason:Au=>Au.sandbox.variant==="pyodide"?"Surfaces are rendered by the server; this sandbox runs in the browser":"Needs a running sandbox",load:()=>__vitePreload(()=>import("./chunks/A2uiView-EmeKVJZp.js"),[],import.meta.url)},{id:"a2ui",order:30}),contribution(LoopCommand,{name:"a2ui",aliases:["surface"],description:"Show the last execution as a rendered surface",group:"Open",keybinding:"Mod+Alt+U",run:async({workspace:Au})=>{Au.setActiveViewType("a2ui")}},{id:"a2ui"})]},NONE_VIEW="none";let state={viewId:NONE_VIEW,options:[],allowNone:!0},announcer=()=>!0;const listeners=new Set;function notify(){for(const Au of[...listeners])Au()}function getViewChoice(){return state}function subscribeViewChoice(Au){return listeners.add(Au),()=>{listeners.delete(Au)}}function setViewAnnouncer(Au){const lo=announcer;return announcer=Au,()=>{announcer=lo}}function setViewOptions(Au,lo=!0){if(lo===state.allowNone&&Au.length===state.options.length&&Au.every((Ru,Iu)=>Ru===state.options[Iu]))return;state={viewId:!lo&&!Au.includes(state.viewId)?Au[0]??NONE_VIEW:state.viewId,options:Au,allowNone:lo},notify()}function chooseView(Au){return state={...state,viewId:Au},notify(),announcer(Au)}function seedViewChoice(Au){state.viewId!==Au&&(state={...state,viewId:Au},notify())}function nextView(){const Au=state.allowNone?[NONE_VIEW,...state.options]:[...state.options];if(Au.length===0)return NONE_VIEW;const lo=Au.indexOf(state.viewId);return Au[(lo+1)%Au.length]}function ViewSelector({point:Au,describe:lo,context:$u,noneLabel:Ru,ariaLabel:Iu,allowNone:Pu=!0}){const Ou=useContributions(Au),Mu=reactExports.useSyncExternalStore(subscribeViewChoice,getViewChoice),[Du,Lu]=reactExports.useState(null),Bu=reactExports.useRef(null),ju=()=>{Bu.current!==null&&(window.clearTimeout(Bu.current),Bu.current=null)},Fu=Vu=>{ju(),Lu(Vu)},zu=()=>{ju(),Bu.current=window.setTimeout(()=>{Lu(null),Bu.current=null},250)};reactExports.useEffect(()=>ju,[]);const Uu=reactExports.useMemo(()=>Ou.map(Vu=>lo(Vu.value,$u)).sort((Vu,Gu)=>(Vu.order??100)-(Gu.order??100)),[Ou,lo,$u]);if(reactExports.useEffect(()=>{setViewOptions(Uu.map(Vu=>Vu.id),Pu)},[Uu,Pu]),Uu.length<(Pu?1:2))return null;const Hu=Uu.find(Vu=>Vu.id===Du&&Vu.details);return jsxRuntimeExports.jsxs(Box$1,{sx:{marginLeft:"auto",display:"flex",alignItems:"center",position:"relative"},children:[jsxRuntimeExports.jsxs(SegmentedControl,{"aria-label":Iu,size:"small",children:[Pu?jsxRuntimeExports.jsx(SegmentedControl.Button,{selected:Mu.viewId===NONE_VIEW,onClick:()=>chooseView(NONE_VIEW),children:Ru}):null,Uu.map(Vu=>jsxRuntimeExports.jsx(SegmentedControl.Button,{selected:Mu.viewId===Vu.id,"aria-disabled":Vu.disabled||void 0,title:Vu.disabled?Vu.disabledReason:Vu.title,leadingIcon:Vu.icon,onMouseEnter:Vu.details?()=>Fu(Vu.id):void 0,onMouseLeave:Vu.details?zu:void 0,onClick:()=>{Vu.disabled||chooseView(Vu.id)},children:Vu.badge?`${Vu.title} (${Vu.badge})`:Vu.title},Vu.id))]}),Hu?jsxRuntimeExports.jsx(Box$1,{onMouseEnter:ju,onMouseLeave:zu,sx:{position:"absolute",top:"calc(100% + 6px)",right:0,minWidth:260,maxWidth:380,maxHeight:320,overflowY:"auto",p:2,bg:"canvas.overlay",border:"1px solid",borderColor:"border.default",borderRadius:2,boxShadow:"shadow.large",zIndex:40,fontSize:0,color:"fg.default",textAlign:"left"},children:Hu.details}):null]})}const SHELL_PLUGIN_NAME$1="@datalayer/reactor-shell",ShellView=defineContributionPoint("reactor.shell.view"),describeAsIs=Au=>Au,ShellPlugin$1={name:SHELL_PLUGIN_NAME$1,displayName:"Shell",description:"A view point, its selector, and the choice as a command.",octicon:"columns",emoji:"📑",config:{point:ShellView,describe:describeAsIs,slot:"header",defaultView:NONE_VIEW,showSelector:!0,allowNone:!0,noneLabel:"None",ariaLabel:"View",announce:()=>!0,commandId:"shell.cycleView",commandName:"Switch the view",commandDescription:"Cycle through the contributed views, and none",keybinding:"Mod+Alt+E"},contributionPoints:[ShellView],register:({config:Au,registerCommand:lo})=>{const $u=setViewAnnouncer(Au.announce),Ru=lo({id:Au.commandId,name:Au.commandName,description:Au.commandDescription,emoji:"📑",category:"Workspace",keybinding:Au.keybinding||void 0,execute:()=>{chooseView(nextView())}});return()=>{$u(),Ru()}},build:({config:Au})=>(seedViewChoice(Au.defaultView||NONE_VIEW),{components:Au.showSelector?[{id:"view-selector",slot:Au.slot,Component:lo=>jsxRuntimeExports.jsx(ViewSelector,{point:Au.point,describe:Au.describe,context:lo,noneLabel:Au.noneLabel,allowNone:Au.allowNone,ariaLabel:Au.ariaLabel})}]:[]})};setViewAnnouncer(requestSurface);const NONE_EDITOR=NONE_VIEW;let mappedFor=null,mapped=null;function getEditorChoice(){const Au=getViewChoice();return(Au!==mappedFor||!mapped)&&(mappedFor=Au,mapped={editorId:Au.viewId,options:Au.options}),mapped}const subscribeEditorChoice=subscribeViewChoice,setEditorOptions=setViewOptions,chooseEditor=chooseView,seedEditorChoice=seedViewChoice,nextEditor=nextView;let jupyterReact=null;function loadJupyterReact(){return jupyterReact?Promise.resolve(jupyterReact):__vitePreload(()=>import("./chunks/index-BlWZloLe.js").then(Au=>Au.r),[],import.meta.url).then(Au=>(jupyterReact=Au,Au))}const PREVIEW_LENGTH=56;function stripped(Au){const $u=(Au.split(`
3842
3842
  `).find(Ru=>Ru.trim())??"").trim();return $u.length>PREVIEW_LENGTH?`${$u.slice(0,PREVIEW_LENGTH-1)}…`:$u||"(empty)"}function PreviewList({title:Au,rows:lo}){return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$3,{sx:{fontWeight:"semibold",display:"block",mb:1},children:Au}),lo.length===0?jsxRuntimeExports.jsx(Text$3,{sx:{color:"fg.muted"},children:"Empty so far."}):lo.map(($u,Ru)=>jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,py:"2px",alignItems:"baseline",children:[jsxRuntimeExports.jsxs(Text$3,{sx:{color:"fg.muted",flexShrink:0,fontFamily:"mono"},children:[Ru," · ",$u.kind]}),jsxRuntimeExports.jsx(Text$3,{sx:{fontFamily:"mono",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$u.text})]},Ru))]})}function useOfferedEditors(){return reactExports.useSyncExternalStore(subscribeEditorChoice,()=>getEditorChoice().options)}function useNotebookRows(Au,lo){const[$u,Ru]=reactExports.useState(0);return reactExports.useEffect(()=>{if(!lo)return;let Iu=!1;const Pu=()=>Ru(Du=>Du+1),Ou=[],Mu=jupyterReact!==null;return loadJupyterReact().then(({notebookStore:Du})=>{if(!Iu)try{const Lu=Du.subscribe?.(Pu);Lu&&Ou.push(Lu);const Bu=Du.getState()?.notebooks?.get(Au)?.model;if(Bu){const ju=[Bu.contentChanged,Bu.cells?.changed];for(const Fu of ju)Fu?.connect&&(Fu.connect(Pu),Ou.push(()=>Fu.disconnect(Pu)))}Mu||Pu()}catch{}}),()=>{Iu=!0;for(const Du of Ou)try{Du()}catch{}}},[lo,Au,$u]),reactExports.useMemo(()=>{if(!lo)return null;const Iu=safeModel(Au);if(!Iu)return null;const Pu=[],Ou=Iu.cells;for(let Mu=0;Mu<Ou.length;Mu+=1){const Du=Ou.get(Mu);Pu.push({kind:Du.type,text:stripped(Du.sharedModel.getSource())})}return Pu},[lo,Au,$u])}function safeModel(Au){try{return jupyterReact?.notebookStore.getState()?.notebooks?.get(Au)?.model??null}catch{return null}}function useDocumentRows(Au,lo){const[$u,Ru]=reactExports.useState(null);return reactExports.useEffect(()=>{if(!lo){Ru(null);return}let Iu=!1,Pu,Ou=!1;return __vitePreload(()=>import("./chunks/PrismCss-CcU1ChRk.js").then(Mu=>Mu.a),[],import.meta.url).then(()=>__vitePreload(()=>import("./chunks/index-3O3ob63z.js"),[],import.meta.url)).then(({lexicalStore:Mu})=>{if(Iu)return;const Du=()=>{Ou||(Ou=!0,Mu.getState().readAllBlocks(Au,"brief").then(Lu=>{Ou=!1,!(Iu||!Array.isArray(Lu))&&Ru(Lu.map(Bu=>({kind:Bu.block_type??"block",text:stripped(Bu.preview??"")})))}).catch(()=>{Ou=!1,Iu||Ru(null)}))};Du(),Pu=Mu.subscribe(Du)}).catch(()=>{Iu||Ru(null)}),()=>{Iu=!0,Pu?.()}},[lo,Au]),$u}function useEditorPreviews(Au){const lo=useOfferedEditors(),$u=useNotebookRows(Au,lo.includes("notebook")),Ru=useDocumentRows(Au,lo.includes("document"));return reactExports.useMemo(()=>{const Iu={};return $u&&(Iu.notebook={badge:String($u.length),details:jsxRuntimeExports.jsx(PreviewList,{title:"Cells",rows:$u})}),Ru&&(Iu.document={badge:String(Ru.length),details:jsxRuntimeExports.jsx(PreviewList,{title:"Blocks",rows:Ru})}),Iu},[$u,Ru])}const SHELL_PLUGIN_NAME="@datalayer/loop-plugin-shell";function describeEditor(Au,lo){const $u=Au,Ru=lo?.workspace,Iu=Ru?canOpenView($u,Ru):!0;return{id:$u.surfaceId,title:$u.title,icon:$u.icon,order:$u.order,disabled:!Iu,disabledReason:Iu?void 0:Ru&&$u.unavailableReason?.(Ru)||"Not available right now"}}function EditorSelectorComponent(Au){const lo=Au.workspace,$u=useEditorPreviews(lo?.surfaceId??""),Ru=(Iu,Pu)=>{const Ou=describeEditor(Iu,Pu),Mu=$u[Ou.id];return Mu?{...Ou,badge:Mu.badge,details:Mu.details}:Ou};return jsxRuntimeExports.jsx(ViewSelector,{point:LoopEditorView,describe:Ru,context:Au,noneLabel:"Chat",ariaLabel:"Editor"})}const ShellPlugin={name:SHELL_PLUGIN_NAME,displayName:"Loop shell",description:"The Loop workspace’s extension points, and the editor choice.",octicon:"columns",emoji:"📑",config:{defaultEditor:NONE_EDITOR,showSelector:!0},dependencies:[configurePlugin(ShellPlugin$1,{point:LoopEditorView,describe:describeEditor,showSelector:!1,announce:Au=>requestSurface(Au),commandId:"loop.shell.cycleEditor",commandName:"Switch the editor",commandDescription:"Cycle through the editors beside the conversation, and none",keybinding:""})],contributionPoints:[LoopViewType,LoopEditorView],contributes:[contribution(LoopCommand,{name:"editor",aliases:["editors"],description:"Switch the editor beside the conversation",group:"Open",keybinding:"Mod+Alt+E",args:[{name:"editor",description:"Which editor: none, or a surface id. Omit to cycle.",required:!1,choices:()=>[NONE_EDITOR,...getEditorChoice().options]}],run:async({argv:Au})=>{const lo=Au.trim(),$u=lo===""?nextEditor():lo,Ru=[NONE_EDITOR,...getEditorChoice().options];if(!Ru.includes($u))throw new Error(`No editor called '${$u}'. There is: ${Ru.join(", ")}.`);if(!chooseEditor($u))throw new Error("No chat is on screen to host the editor.")}},{id:"editor"})],build:({config:Au})=>(seedEditorChoice(Au.defaultEditor||NONE_EDITOR),{components:Au.showSelector?[{id:"editor-selector",slot:LoopSlots.header,Component:EditorSelectorComponent}]:[]})};function NewChatAction({workspace:Au}){return Au?jsxRuntimeExports.jsx(IconButton,{icon:PlusIcon,"aria-label":"New conversation",title:"New conversation",variant:"invisible",size:"small",onClick:()=>{Au.submit("/new")}}):null}const PROMPT_PLUGIN_NAME="@datalayer/loop-plugin-prompt",PromptPlugin={name:PROMPT_PLUGIN_NAME,displayName:"Prompt",description:"Prompt commands: focus the composer, start over, and the +.",octicon:"paper-airplane",emoji:"🪶",contributes:[contribution(LoopCommand,{name:"prompt",description:"Focus the prompt",group:"Session",keybinding:"Mod+Alt+P",run:async()=>{if(!focusPrompt())throw new Error("No prompt is on screen to focus.")}},{id:"prompt"}),contribution(LoopCommand,{name:"new",aliases:["reset"],description:"Start the conversation over",group:"Session",keybinding:"Mod+Alt+R",run:async({workspace:Au})=>{const lo=Au.viewControls.newChat;if(!lo)throw new Error("No conversation is on screen to start over.");lo()}},{id:"new"})],build:()=>({components:[{id:"new-chat",slot:LoopSlots.promptAction,Component:NewChatAction}]})};function AgentspecPicker({workspace:Au}){const[lo,$u]=reactExports.useState([]),[Ru,Iu]=reactExports.useState(!1),[Pu,Ou]=reactExports.useState(Au.agentId),Mu=Au.sandbox.target,Du=Au.sandbox.state;reactExports.useEffect(()=>{let Fu=!1;return fetch(`${Au.serverUrl}/api/v1/agents`).then(zu=>zu.ok?zu.json():{agents:[]}).then(zu=>{Fu||$u(zu.agents??[])}).catch(()=>{}),()=>{Fu=!0}},[Au.serverUrl,Mu,Du]),reactExports.useEffect(()=>{Ou(Au.agentId)},[Au.agentId]);const Lu=reactExports.useCallback(async Fu=>{Iu(!0);try{(await fetch(`${Au.serverUrl}/api/v1/loop/sessions/${encodeURIComponent(Au.conversationId||Au.agentId||"session")}/agent`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent_id:Fu})})).ok&&(Ou(Fu),Au.setAgentId(Fu))}finally{Iu(!1)}},[Au.agentId,Au.conversationId,Au.serverUrl,Au.setAgentId]),Bu=lo.find(Fu=>Fu.id===Pu),ju=Bu?.name||getAgentspecs(Pu)?.name||Pu||"Agent";return lo.length===0?null:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[Ru?jsxRuntimeExports.jsx(StyledSpinner,{size:"small"}):null,jsxRuntimeExports.jsxs(ActionMenu,{children:[jsxRuntimeExports.jsxs(ActionMenu.Button,{variant:"invisible",size:"small",children:[Bu?.emoji?`${Bu.emoji} `:"",ju]}),jsxRuntimeExports.jsx(ActionMenu.Overlay,{width:"medium",children:jsxRuntimeExports.jsx(ActionList,{selectionVariant:"single",children:lo.map(Fu=>jsxRuntimeExports.jsxs(ActionList.Item,{selected:Fu.id===Pu,onSelect:()=>{Lu(Fu.id)},children:[Fu.emoji?`${Fu.emoji} `:"",Fu.name||Fu.id,Fu.description?jsxRuntimeExports.jsx(ActionList.Description,{variant:"block",children:Fu.description}):null]},Fu.id))})})]})]})}const AGENTSPECS_PLUGIN_NAME="@datalayer/loop-plugin-agentspecs",AgentspecsPlugin={name:AGENTSPECS_PLUGIN_NAME,displayName:"Agentspecs",description:"Pick the agentspec this session runs.",octicon:"people",emoji:"🤖",build(){return{components:[{slot:LoopSlots.header,id:"agent-picker",Component:AgentspecPicker}]}},contributes:[contribution(LoopCommand,{name:"agents",aliases:["agent"],description:"Switch the agent this session is using",group:"Agents",keybinding:"Mod+Alt+A",args:[{name:"agent-id",description:"Agent to switch to"}],run:async({workspace:Au,argv:lo})=>{const $u=lo.trim();if(!$u)return{content:"Pick an agent from the header, or /agents <id>."};const Ru=await fetch(`${Au.serverUrl}/api/v1/loop/sessions/${encodeURIComponent(Au.conversationId||Au.agentId||"session")}/agent`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent_id:$u})});if(!Ru.ok)return{content:`Unknown agent: ${$u}`};const Iu=await Ru.json();return{content:`Now using ${Iu.name??Iu.agent_id}.`}}},{id:"agents"})]},CHAT_HEADER_PLUGIN_NAME="@datalayer/loop-plugin-chat-header",LazyHeaderView=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/HeaderView-DVGhaRai.js"),[],import.meta.url));function HeaderView(Au){return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(LazyHeaderView,{...Au})})}const ChatHeaderPlugin={name:CHAT_HEADER_PLUGIN_NAME,displayName:"Chat Header",description:"The conversation’s title bar: agent, kernel, actions.",octicon:"rows",emoji:"🏷️",contributes:[contribution(LoopChatHeader,{id:"chat-header",Component:HeaderView},{id:"chat-header"})]};function readA2uiToolResult(Au,lo){if(!Au)return null;let $u=Au;if(typeof Au=="string")try{$u=JSON.parse(Au)}catch{return null}if(typeof $u!="object"||$u===null||!Array.isArray($u.messages))return null;const Ru=$u,Iu=(Ru.messages??[]).map(Pu=>{const Ou=Pu;return Ou.createSurface&&Ou.createSurface.catalogId!==lo?{...Ou,createSurface:{...Ou.createSurface,catalogId:lo}}:Pu});return{...Ru,messages:Iu}}function isEmptyA2uiValue(Au){return Au==null?!0:typeof Au=="string"?Au.trim()==="":Array.isArray(Au)?Au.length===0:typeof Au=="boolean"?Au===!1:!1}const EMAIL_PATTERN=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function validateA2uiField(Au,lo){if(isEmptyA2uiValue(lo))return Au.required?`${Au.label} is required.`:null;if(Au.format==="email"&&typeof lo=="string"&&!EMAIL_PATTERN.test(lo.trim()))return`${Au.label} must be a valid email address.`;if(Au.pattern&&typeof lo=="string"){let $u;try{$u=new RegExp(Au.pattern).test(lo.trim())}catch{$u=!0}if(!$u)return`${Au.label} is not in the expected format.`}if(Au.minLength!==void 0&&typeof lo=="string"&&lo.trim().length<Au.minLength)return`${Au.label} must be at least ${Au.minLength} characters.`;if(Au.type==="slider"&&typeof lo=="number"){if(Au.min!==void 0&&lo<Au.min)return`${Au.label} must be at least ${Au.min}.`;if(Au.max!==void 0&&lo>Au.max)return`${Au.label} must be at most ${Au.max}.`}return null}function validateA2uiSubmission(Au,lo){return Au.map($u=>validateA2uiField($u,lo[$u.id])).filter($u=>$u!==null)}const ANSWER_DISPLAY_TYPE="application/vnd.datalayer.loop.answer+json";function answerSurface(Au,lo){return Au.type!==ANSWER_DISPLAY_TYPE?null:readA2uiToolResult(Au.data?.surface,lo)}function answerPress(Au,lo){const $u=lo.name.trim(),Ru=(Au.actions??[]).find(Iu=>Iu.name===$u);return Ru?{message:$u,forwardedProps:{loop:{action:{name:$u,display_id:Au.id,token:Ru.token,payload:{...lo.context}}}}}:{refused:`“${$u||"This button"}” was not offered here.`}}function AnswerShowsView({display:Au,send:lo}){const $u=reactExports.useMemo(()=>answerSurface(Au,SURFACE_CATALOG_ID),[Au]),Ru=useOwnCatalog(),[Iu,Pu]=reactExports.useState(null);if(!$u?.messages||$u.messages.length===0)return jsxRuntimeExports.jsx(Text$3,{sx:{color:"fg.muted"},children:Au.text});const Ou=Mu=>{const Du=answerPress(Au,Mu);if("refused"in Du){Pu(Du.refused);return}Pu(lo(Du.message,Du.forwardedProps)?null:"The chat is not ready to take it yet.")};return jsxRuntimeExports.jsx(InlineSurface,{messages:$u.messages,onAction:Ou,validationError:Iu,catalog:Ru},JSON.stringify(Au))}function SurfaceToolResult({context:Au,send:lo,onRendered:$u,onSubmitted:Ru}){const Iu=reactExports.useMemo(()=>Au.status==="complete"?readA2uiToolResult(Au.result,SURFACE_CATALOG_ID):null,[Au.status,Au.result]),Pu=Iu?.title??"the form",[Ou,Mu]=reactExports.useState(null),Du=useOwnCatalog();reactExports.useEffect(()=>{Iu?.messages&&Iu.messages.length>0&&$u?.({toolCallId:Au.toolCallId,surfaceId:Iu.surfaceId,title:Pu,messages:Iu.messages,result:Iu})},[Iu,Au.toolCallId]);const Lu=reactExports.useCallback(Bu=>{if(Bu.name!=="submit_a2ui_form")return;const ju=Bu.context??{},Fu=validateA2uiSubmission(Iu?.fieldRules??[],ju);if(Fu.length>0){Mu(Fu.join(" "));return}Mu(null),Ru?.({surfaceId:Bu.surfaceId,title:Pu,values:ju}),lo(encodeFormSubmission({title:Pu,surfaceId:Bu.surfaceId,values:ju}))||Mu("The chat is not ready to take the submission yet.")},[Iu,Pu,lo,Ru]);return!Iu?.messages||Iu.messages.length===0?jsxRuntimeExports.jsxs(Box,{border:"1px solid",borderColor:"border.default",borderRadius:2,px:3,py:2,bg:"canvas.default",display:"flex",alignItems:"center",gap:2,children:[jsxRuntimeExports.jsx(StyledSpinner,{size:"small"}),jsxRuntimeExports.jsx(Text$3,{sx:{fontSize:1,color:"fg.muted"},children:"Rendering A2UI surface..."})]}):jsxRuntimeExports.jsxs(Box,{display:"flex",flexDirection:"column",gap:2,children:[jsxRuntimeExports.jsx(Text$3,{sx:{fontWeight:"bold"},children:Pu}),jsxRuntimeExports.jsx(InlineSurface,{messages:Iu.messages,onAction:Lu,validationError:Ou,catalog:Du})]})}const A2UI_SURFACE_PLUGIN_NAME="@datalayer/loop-plugin-a2ui-surface",A2UI_SURFACE_RENDERER="a2ui-surface",A2UI_SURFACE_TYPE="application/vnd.datalayer.a2ui.surface+json";function surfaceToolNames(){const Au=new Set;for(const lo of Object.values(AGENTSPECS))for(const $u of lo.frontendRenderTools??[])$u.renderer===A2UI_SURFACE_RENDERER&&Au.add($u.tool);return Au}let counter=0;function createA2uiSurfacePlugin(Au={}){const lo=`a2ui-surface-${counter+=1}`;let $u;const Ru=(Du,Lu)=>$u?!$u(Du,Lu):!1;function Iu({workspace:Du}){const Lu=Du?.viewControls.send;return reactExports.useEffect(()=>($u=Lu,()=>{$u===Lu&&($u=void 0)}),[Lu]),null}function Pu({context:Du}){return Du?Du.status==="error"?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Du.defaultUI}):jsxRuntimeExports.jsx(SurfaceToolResult,{context:Du,send:Ru,onRendered:Au.onRendered,onSubmitted:Au.onSubmitted},Du.toolCallId):null}function Ou({display:Du}){return jsxRuntimeExports.jsx(AnswerShowsView,{display:Du,send:Ru})}return{name:counter===1?A2UI_SURFACE_PLUGIN_NAME:`${A2UI_SURFACE_PLUGIN_NAME}-${lo}`,displayName:"A2UI surfaces",description:"Generated surfaces drawn in the transcript, and submitted back to the agent.",octicon:"browser",emoji:"🪟",contributes:[contribution(Renderers,defineRenderer({type:A2UI_SURFACE_TYPE,component:Pu,rank:Au.onRendered||Au.onSubmitted?1:0}),{id:lo}),contribution(Renderers,defineRenderer({type:ANSWER_DISPLAY_TYPE,component:Ou}),{id:`${lo}:answer`}),...[...surfaceToolNames()].map(Du=>contribution(ToolBindings,{tool:Du,type:A2UI_SURFACE_TYPE},{id:`${lo}:${Du}`}))],build(){return{components:[{slot:LoopSlots.chatHeader,id:lo,Component:Iu}]}}}}const A2uiSurfacePlugin=createA2uiSurfacePlugin(),qrcode=function(Au,lo){let Iu=Au;const Pu=QRErrorCorrectionLevel[lo];let Ou=null,Mu=0,Du=null;const Lu=[],Bu={},ju=function(ed,td){Mu=Iu*4+17,Ou=(function(nd){const od=new Array(nd);for(let sd=0;sd<nd;sd+=1){od[sd]=new Array(nd);for(let ad=0;ad<nd;ad+=1)od[sd][ad]=null}return od})(Mu),Fu(0,0),Fu(Mu-7,0),Fu(0,Mu-7),Hu(),Uu(),Gu(ed,td),Iu>=7&&Vu(ed),Du==null&&(Du=Ju(Iu,Pu,Lu)),Wu(Du,td)},Fu=function(ed,td){for(let nd=-1;nd<=7;nd+=1)if(!(ed+nd<=-1||Mu<=ed+nd))for(let od=-1;od<=7;od+=1)td+od<=-1||Mu<=td+od||(0<=nd&&nd<=6&&(od==0||od==6)||0<=od&&od<=6&&(nd==0||nd==6)||2<=nd&&nd<=4&&2<=od&&od<=4?Ou[ed+nd][td+od]=!0:Ou[ed+nd][td+od]=!1)},zu=function(){let ed=0,td=0;for(let nd=0;nd<8;nd+=1){ju(!0,nd);const od=QRUtil.getLostPoint(Bu);(nd==0||ed>od)&&(ed=od,td=nd)}return td},Uu=function(){for(let ed=8;ed<Mu-8;ed+=1)Ou[ed][6]==null&&(Ou[ed][6]=ed%2==0);for(let ed=8;ed<Mu-8;ed+=1)Ou[6][ed]==null&&(Ou[6][ed]=ed%2==0)},Hu=function(){const ed=QRUtil.getPatternPosition(Iu);for(let td=0;td<ed.length;td+=1)for(let nd=0;nd<ed.length;nd+=1){const od=ed[td],sd=ed[nd];if(Ou[od][sd]==null)for(let ad=-2;ad<=2;ad+=1)for(let pd=-2;pd<=2;pd+=1)ad==-2||ad==2||pd==-2||pd==2||ad==0&&pd==0?Ou[od+ad][sd+pd]=!0:Ou[od+ad][sd+pd]=!1}},Vu=function(ed){const td=QRUtil.getBCHTypeNumber(Iu);for(let nd=0;nd<18;nd+=1){const od=!ed&&(td>>nd&1)==1;Ou[Math.floor(nd/3)][nd%3+Mu-8-3]=od}for(let nd=0;nd<18;nd+=1){const od=!ed&&(td>>nd&1)==1;Ou[nd%3+Mu-8-3][Math.floor(nd/3)]=od}},Gu=function(ed,td){const nd=Pu<<3|td,od=QRUtil.getBCHTypeInfo(nd);for(let sd=0;sd<15;sd+=1){const ad=!ed&&(od>>sd&1)==1;sd<6?Ou[sd][8]=ad:sd<8?Ou[sd+1][8]=ad:Ou[Mu-15+sd][8]=ad}for(let sd=0;sd<15;sd+=1){const ad=!ed&&(od>>sd&1)==1;sd<8?Ou[8][Mu-sd-1]=ad:sd<9?Ou[8][15-sd-1+1]=ad:Ou[8][15-sd-1]=ad}Ou[Mu-8][8]=!ed},Wu=function(ed,td){let nd=-1,od=Mu-1,sd=7,ad=0;const pd=QRUtil.getMaskFunction(td);for(let gd=Mu-1;gd>0;gd-=2)for(gd==6&&(gd-=1);;){for(let xd=0;xd<2;xd+=1)if(Ou[od][gd-xd]==null){let yd=!1;ad<ed.length&&(yd=(ed[ad]>>>sd&1)==1),pd(od,gd-xd)&&(yd=!yd),Ou[od][gd-xd]=yd,sd-=1,sd==-1&&(ad+=1,sd=7)}if(od+=nd,od<0||Mu<=od){od-=nd,nd=-nd;break}}},Ku=function(ed,td){let nd=0,od=0,sd=0;const ad=new Array(td.length),pd=new Array(td.length);for(let bd=0;bd<td.length;bd+=1){const wd=td[bd].dataCount,Ad=td[bd].totalCount-wd;od=Math.max(od,wd),sd=Math.max(sd,Ad),ad[bd]=new Array(wd);for(let ld=0;ld<ad[bd].length;ld+=1)ad[bd][ld]=255&ed.getBuffer()[ld+nd];nd+=wd;const cd=QRUtil.getErrorCorrectPolynomial(Ad),md=qrPolynomial(ad[bd],cd.getLength()-1).mod(cd);pd[bd]=new Array(cd.getLength()-1);for(let ld=0;ld<pd[bd].length;ld+=1){const hd=ld+md.getLength()-pd[bd].length;pd[bd][ld]=hd>=0?md.getAt(hd):0}}let gd=0;for(let bd=0;bd<td.length;bd+=1)gd+=td[bd].totalCount;const xd=new Array(gd);let yd=0;for(let bd=0;bd<od;bd+=1)for(let wd=0;wd<td.length;wd+=1)bd<ad[wd].length&&(xd[yd]=ad[wd][bd],yd+=1);for(let bd=0;bd<sd;bd+=1)for(let wd=0;wd<td.length;wd+=1)bd<pd[wd].length&&(xd[yd]=pd[wd][bd],yd+=1);return xd},Ju=function(ed,td,nd){const od=QRRSBlock.getRSBlocks(ed,td),sd=qrBitBuffer();for(let pd=0;pd<nd.length;pd+=1){const gd=nd[pd];sd.put(gd.getMode(),4),sd.put(gd.getLength(),QRUtil.getLengthInBits(gd.getMode(),ed)),gd.write(sd)}let ad=0;for(let pd=0;pd<od.length;pd+=1)ad+=od[pd].dataCount;if(sd.getLengthInBits()>ad*8)throw"code length overflow. ("+sd.getLengthInBits()+">"+ad*8+")";for(sd.getLengthInBits()+4<=ad*8&&sd.put(0,4);sd.getLengthInBits()%8!=0;)sd.putBit(!1);for(;!(sd.getLengthInBits()>=ad*8||(sd.put(236,8),sd.getLengthInBits()>=ad*8));)sd.put(17,8);return Ku(sd,od)};Bu.addData=function(ed,td){td=td||"Byte";let nd=null;switch(td){case"Numeric":nd=qrNumber(ed);break;case"Alphanumeric":nd=qrAlphaNum(ed);break;case"Byte":nd=qr8BitByte(ed);break;case"Kanji":nd=qrKanji(ed);break;default:throw"mode:"+td}Lu.push(nd),Du=null},Bu.isDark=function(ed,td){if(ed<0||Mu<=ed||td<0||Mu<=td)throw ed+","+td;return Ou[ed][td]},Bu.getModuleCount=function(){return Mu},Bu.make=function(){if(Iu<1){let ed=1;for(;ed<40;ed++){const td=QRRSBlock.getRSBlocks(ed,Pu),nd=qrBitBuffer();for(let sd=0;sd<Lu.length;sd++){const ad=Lu[sd];nd.put(ad.getMode(),4),nd.put(ad.getLength(),QRUtil.getLengthInBits(ad.getMode(),ed)),ad.write(nd)}let od=0;for(let sd=0;sd<td.length;sd++)od+=td[sd].dataCount;if(nd.getLengthInBits()<=od*8)break}Iu=ed}ju(!1,zu())},Bu.createTableTag=function(ed,td){ed=ed||2,td=typeof td>"u"?ed*4:td;let nd="";nd+='<table style="',nd+=" border-width: 0px; border-style: none;",nd+=" border-collapse: collapse;",nd+=" padding: 0px; margin: "+td+"px;",nd+='">',nd+="<tbody>";for(let od=0;od<Bu.getModuleCount();od+=1){nd+="<tr>";for(let sd=0;sd<Bu.getModuleCount();sd+=1)nd+='<td style="',nd+=" border-width: 0px; border-style: none;",nd+=" border-collapse: collapse;",nd+=" padding: 0px; margin: 0px;",nd+=" width: "+ed+"px;",nd+=" height: "+ed+"px;",nd+=" background-color: ",nd+=Bu.isDark(od,sd)?"#000000":"#ffffff",nd+=";",nd+='"/>';nd+="</tr>"}return nd+="</tbody>",nd+="</table>",nd},Bu.createSvgTag=function(ed,td,nd,od){let sd={};typeof arguments[0]=="object"&&(sd=arguments[0],ed=sd.cellSize,td=sd.margin,nd=sd.alt,od=sd.title),ed=ed||2,td=typeof td>"u"?ed*4:td,nd=typeof nd=="string"?{text:nd}:nd||{},nd.text=nd.text||null,nd.id=nd.text?nd.id||"qrcode-description":null,od=typeof od=="string"?{text:od}:od||{},od.text=od.text||null,od.id=od.text?od.id||"qrcode-title":null;const ad=Bu.getModuleCount()*ed+td*2;let pd,gd,xd,yd,bd="",wd;for(wd="l"+ed+",0 0,"+ed+" -"+ed+",0 0,-"+ed+"z ",bd+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',bd+=sd.scalable?"":' width="'+ad+'px" height="'+ad+'px"',bd+=' viewBox="0 0 '+ad+" "+ad+'" ',bd+=' preserveAspectRatio="xMinYMin meet"',bd+=od.text||nd.text?' role="img" aria-labelledby="'+Yu([od.id,nd.id].join(" ").trim())+'"':"",bd+=">",bd+=od.text?'<title id="'+Yu(od.id)+'">'+Yu(od.text)+"</title>":"",bd+=nd.text?'<description id="'+Yu(nd.id)+'">'+Yu(nd.text)+"</description>":"",bd+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',bd+='<path d="',xd=0;xd<Bu.getModuleCount();xd+=1)for(yd=xd*ed+td,pd=0;pd<Bu.getModuleCount();pd+=1)Bu.isDark(xd,pd)&&(gd=pd*ed+td,bd+="M"+gd+","+yd+wd);return bd+='" stroke="transparent" fill="black"/>',bd+="</svg>",bd},Bu.createDataURL=function(ed,td){ed=ed||2,td=typeof td>"u"?ed*4:td;const nd=Bu.getModuleCount()*ed+td*2,od=td,sd=nd-td;return createDataURL(nd,nd,function(ad,pd){if(od<=ad&&ad<sd&&od<=pd&&pd<sd){const gd=Math.floor((ad-od)/ed),xd=Math.floor((pd-od)/ed);return Bu.isDark(xd,gd)?0:1}else return 1})},Bu.createImgTag=function(ed,td,nd){ed=ed||2,td=typeof td>"u"?ed*4:td;const od=Bu.getModuleCount()*ed+td*2;let sd="";return sd+="<img",sd+=' src="',sd+=Bu.createDataURL(ed,td),sd+='"',sd+=' width="',sd+=od,sd+='"',sd+=' height="',sd+=od,sd+='"',nd&&(sd+=' alt="',sd+=Yu(nd),sd+='"'),sd+="/>",sd};const Yu=function(ed){let td="";for(let nd=0;nd<ed.length;nd+=1){const od=ed.charAt(nd);switch(od){case"<":td+="&lt;";break;case">":td+="&gt;";break;case"&":td+="&amp;";break;case'"':td+="&quot;";break;default:td+=od;break}}return td},Xu=function(ed){ed=typeof ed>"u"?2:ed;const nd=Bu.getModuleCount()*1+ed*2,od=ed,sd=nd-ed;let ad,pd,gd,xd,yd;const bd={"██":"█","█ ":"▀"," █":"▄"," ":" "},wd={"██":"▀","█ ":"▀"," █":" "," ":" "};let Ad="";for(ad=0;ad<nd;ad+=2){for(gd=Math.floor((ad-od)/1),xd=Math.floor((ad+1-od)/1),pd=0;pd<nd;pd+=1)yd="█",od<=pd&&pd<sd&&od<=ad&&ad<sd&&Bu.isDark(gd,Math.floor((pd-od)/1))&&(yd=" "),od<=pd&&pd<sd&&od<=ad+1&&ad+1<sd&&Bu.isDark(xd,Math.floor((pd-od)/1))?yd+=" ":yd+="█",Ad+=ed<1&&ad+1>=sd?wd[yd]:bd[yd];Ad+=`
3843
3843
  `}return nd%2&&ed>0?Ad.substring(0,Ad.length-nd-1)+Array(nd+1).join("▀"):Ad.substring(0,Ad.length-1)};return Bu.createASCII=function(ed,td){if(ed=ed||1,ed<2)return Xu(td);ed-=1,td=typeof td>"u"?ed*2:td;const nd=Bu.getModuleCount()*ed+td*2,od=td,sd=nd-td;let ad,pd,gd,xd;const yd=Array(ed+1).join("██"),bd=Array(ed+1).join(" ");let wd="",Ad="";for(ad=0;ad<nd;ad+=1){for(gd=Math.floor((ad-od)/ed),Ad="",pd=0;pd<nd;pd+=1)xd=1,od<=pd&&pd<sd&&od<=ad&&ad<sd&&Bu.isDark(gd,Math.floor((pd-od)/ed))&&(xd=0),Ad+=xd?yd:bd;for(gd=0;gd<ed;gd+=1)wd+=Ad+`
3844
- `}return wd.substring(0,wd.length-1)},Bu.renderTo2dContext=function(ed,td){td=td||2;const nd=Bu.getModuleCount();for(let od=0;od<nd;od++)for(let sd=0;sd<nd;sd++)ed.fillStyle=Bu.isDark(od,sd)?"black":"white",ed.fillRect(sd*td,od*td,td,td)},Bu};qrcode.stringToBytes=function(Au){const lo=[];for(let $u=0;$u<Au.length;$u+=1){const Ru=Au.charCodeAt($u);lo.push(Ru&255)}return lo};qrcode.createStringToBytes=function(Au,lo){const $u=(function(){const Iu=base64DecodeInputStream(Au),Pu=function(){const Du=Iu.read();if(Du==-1)throw"eof";return Du};let Ou=0;const Mu={};for(;;){const Du=Iu.read();if(Du==-1)break;const Lu=Pu(),Bu=Pu(),ju=Pu(),Fu=String.fromCharCode(Du<<8|Lu),zu=Bu<<8|ju;Mu[Fu]=zu,Ou+=1}if(Ou!=lo)throw Ou+" != "+lo;return Mu})(),Ru=63;return function(Iu){const Pu=[];for(let Ou=0;Ou<Iu.length;Ou+=1){const Mu=Iu.charCodeAt(Ou);if(Mu<128)Pu.push(Mu);else{const Du=$u[Iu.charAt(Ou)];typeof Du=="number"?(Du&255)==Du?Pu.push(Du):(Pu.push(Du>>>8),Pu.push(Du&255)):Pu.push(Ru)}}return Pu}};const QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectionLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil=(function(){const Au=[[],[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]],lo=1335,$u=7973,Ru=21522,Iu={},Pu=function(Ou){let Mu=0;for(;Ou!=0;)Mu+=1,Ou>>>=1;return Mu};return Iu.getBCHTypeInfo=function(Ou){let Mu=Ou<<10;for(;Pu(Mu)-Pu(lo)>=0;)Mu^=lo<<Pu(Mu)-Pu(lo);return(Ou<<10|Mu)^Ru},Iu.getBCHTypeNumber=function(Ou){let Mu=Ou<<12;for(;Pu(Mu)-Pu($u)>=0;)Mu^=$u<<Pu(Mu)-Pu($u);return Ou<<12|Mu},Iu.getPatternPosition=function(Ou){return Au[Ou-1]},Iu.getMaskFunction=function(Ou){switch(Ou){case QRMaskPattern.PATTERN000:return function(Mu,Du){return(Mu+Du)%2==0};case QRMaskPattern.PATTERN001:return function(Mu,Du){return Mu%2==0};case QRMaskPattern.PATTERN010:return function(Mu,Du){return Du%3==0};case QRMaskPattern.PATTERN011:return function(Mu,Du){return(Mu+Du)%3==0};case QRMaskPattern.PATTERN100:return function(Mu,Du){return(Math.floor(Mu/2)+Math.floor(Du/3))%2==0};case QRMaskPattern.PATTERN101:return function(Mu,Du){return Mu*Du%2+Mu*Du%3==0};case QRMaskPattern.PATTERN110:return function(Mu,Du){return(Mu*Du%2+Mu*Du%3)%2==0};case QRMaskPattern.PATTERN111:return function(Mu,Du){return(Mu*Du%3+(Mu+Du)%2)%2==0};default:throw"bad maskPattern:"+Ou}},Iu.getErrorCorrectPolynomial=function(Ou){let Mu=qrPolynomial([1],0);for(let Du=0;Du<Ou;Du+=1)Mu=Mu.multiply(qrPolynomial([1,QRMath.gexp(Du)],0));return Mu},Iu.getLengthInBits=function(Ou,Mu){if(1<=Mu&&Mu<10)switch(Ou){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw"mode:"+Ou}else if(Mu<27)switch(Ou){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw"mode:"+Ou}else if(Mu<41)switch(Ou){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw"mode:"+Ou}else throw"type:"+Mu},Iu.getLostPoint=function(Ou){const Mu=Ou.getModuleCount();let Du=0;for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu;Fu+=1){let zu=0;const Uu=Ou.isDark(ju,Fu);for(let Hu=-1;Hu<=1;Hu+=1)if(!(ju+Hu<0||Mu<=ju+Hu))for(let Vu=-1;Vu<=1;Vu+=1)Fu+Vu<0||Mu<=Fu+Vu||Hu==0&&Vu==0||Uu==Ou.isDark(ju+Hu,Fu+Vu)&&(zu+=1);zu>5&&(Du+=3+zu-5)}for(let ju=0;ju<Mu-1;ju+=1)for(let Fu=0;Fu<Mu-1;Fu+=1){let zu=0;Ou.isDark(ju,Fu)&&(zu+=1),Ou.isDark(ju+1,Fu)&&(zu+=1),Ou.isDark(ju,Fu+1)&&(zu+=1),Ou.isDark(ju+1,Fu+1)&&(zu+=1),(zu==0||zu==4)&&(Du+=3)}for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu-6;Fu+=1)Ou.isDark(ju,Fu)&&!Ou.isDark(ju,Fu+1)&&Ou.isDark(ju,Fu+2)&&Ou.isDark(ju,Fu+3)&&Ou.isDark(ju,Fu+4)&&!Ou.isDark(ju,Fu+5)&&Ou.isDark(ju,Fu+6)&&(Du+=40);for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu-6;Fu+=1)Ou.isDark(Fu,ju)&&!Ou.isDark(Fu+1,ju)&&Ou.isDark(Fu+2,ju)&&Ou.isDark(Fu+3,ju)&&Ou.isDark(Fu+4,ju)&&!Ou.isDark(Fu+5,ju)&&Ou.isDark(Fu+6,ju)&&(Du+=40);let Lu=0;for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu;Fu+=1)Ou.isDark(Fu,ju)&&(Lu+=1);const Bu=Math.abs(100*Lu/Mu/Mu-50)/5;return Du+=Bu*10,Du},Iu})(),QRMath=(function(){const Au=new Array(256),lo=new Array(256);for(let Ru=0;Ru<8;Ru+=1)Au[Ru]=1<<Ru;for(let Ru=8;Ru<256;Ru+=1)Au[Ru]=Au[Ru-4]^Au[Ru-5]^Au[Ru-6]^Au[Ru-8];for(let Ru=0;Ru<255;Ru+=1)lo[Au[Ru]]=Ru;const $u={};return $u.glog=function(Ru){if(Ru<1)throw"glog("+Ru+")";return lo[Ru]},$u.gexp=function(Ru){for(;Ru<0;)Ru+=255;for(;Ru>=256;)Ru-=255;return Au[Ru]},$u})(),qrPolynomial=function(Au,lo){if(typeof Au.length>"u")throw Au.length+"/"+lo;const $u=(function(){let Iu=0;for(;Iu<Au.length&&Au[Iu]==0;)Iu+=1;const Pu=new Array(Au.length-Iu+lo);for(let Ou=0;Ou<Au.length-Iu;Ou+=1)Pu[Ou]=Au[Ou+Iu];return Pu})(),Ru={};return Ru.getAt=function(Iu){return $u[Iu]},Ru.getLength=function(){return $u.length},Ru.multiply=function(Iu){const Pu=new Array(Ru.getLength()+Iu.getLength()-1);for(let Ou=0;Ou<Ru.getLength();Ou+=1)for(let Mu=0;Mu<Iu.getLength();Mu+=1)Pu[Ou+Mu]^=QRMath.gexp(QRMath.glog(Ru.getAt(Ou))+QRMath.glog(Iu.getAt(Mu)));return qrPolynomial(Pu,0)},Ru.mod=function(Iu){if(Ru.getLength()-Iu.getLength()<0)return Ru;const Pu=QRMath.glog(Ru.getAt(0))-QRMath.glog(Iu.getAt(0)),Ou=new Array(Ru.getLength());for(let Mu=0;Mu<Ru.getLength();Mu+=1)Ou[Mu]=Ru.getAt(Mu);for(let Mu=0;Mu<Iu.getLength();Mu+=1)Ou[Mu]^=QRMath.gexp(QRMath.glog(Iu.getAt(Mu))+Pu);return qrPolynomial(Ou,0).mod(Iu)},Ru},QRRSBlock=(function(){const Au=[[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]],lo=function(Iu,Pu){const Ou={};return Ou.totalCount=Iu,Ou.dataCount=Pu,Ou},$u={},Ru=function(Iu,Pu){switch(Pu){case QRErrorCorrectionLevel.L:return Au[(Iu-1)*4+0];case QRErrorCorrectionLevel.M:return Au[(Iu-1)*4+1];case QRErrorCorrectionLevel.Q:return Au[(Iu-1)*4+2];case QRErrorCorrectionLevel.H:return Au[(Iu-1)*4+3];default:return}};return $u.getRSBlocks=function(Iu,Pu){const Ou=Ru(Iu,Pu);if(typeof Ou>"u")throw"bad rs block @ typeNumber:"+Iu+"/errorCorrectionLevel:"+Pu;const Mu=Ou.length/3,Du=[];for(let Lu=0;Lu<Mu;Lu+=1){const Bu=Ou[Lu*3+0],ju=Ou[Lu*3+1],Fu=Ou[Lu*3+2];for(let zu=0;zu<Bu;zu+=1)Du.push(lo(ju,Fu))}return Du},$u})(),qrBitBuffer=function(){const Au=[];let lo=0;const $u={};return $u.getBuffer=function(){return Au},$u.getAt=function(Ru){const Iu=Math.floor(Ru/8);return(Au[Iu]>>>7-Ru%8&1)==1},$u.put=function(Ru,Iu){for(let Pu=0;Pu<Iu;Pu+=1)$u.putBit((Ru>>>Iu-Pu-1&1)==1)},$u.getLengthInBits=function(){return lo},$u.putBit=function(Ru){const Iu=Math.floor(lo/8);Au.length<=Iu&&Au.push(0),Ru&&(Au[Iu]|=128>>>lo%8),lo+=1},$u},qrNumber=function(Au){const lo=QRMode.MODE_NUMBER,$u=Au,Ru={};Ru.getMode=function(){return lo},Ru.getLength=function(Ou){return $u.length},Ru.write=function(Ou){const Mu=$u;let Du=0;for(;Du+2<Mu.length;)Ou.put(Iu(Mu.substring(Du,Du+3)),10),Du+=3;Du<Mu.length&&(Mu.length-Du==1?Ou.put(Iu(Mu.substring(Du,Du+1)),4):Mu.length-Du==2&&Ou.put(Iu(Mu.substring(Du,Du+2)),7))};const Iu=function(Ou){let Mu=0;for(let Du=0;Du<Ou.length;Du+=1)Mu=Mu*10+Pu(Ou.charAt(Du));return Mu},Pu=function(Ou){if("0"<=Ou&&Ou<="9")return Ou.charCodeAt(0)-48;throw"illegal char :"+Ou};return Ru},qrAlphaNum=function(Au){const lo=QRMode.MODE_ALPHA_NUM,$u=Au,Ru={};Ru.getMode=function(){return lo},Ru.getLength=function(Pu){return $u.length},Ru.write=function(Pu){const Ou=$u;let Mu=0;for(;Mu+1<Ou.length;)Pu.put(Iu(Ou.charAt(Mu))*45+Iu(Ou.charAt(Mu+1)),11),Mu+=2;Mu<Ou.length&&Pu.put(Iu(Ou.charAt(Mu)),6)};const Iu=function(Pu){if("0"<=Pu&&Pu<="9")return Pu.charCodeAt(0)-48;if("A"<=Pu&&Pu<="Z")return Pu.charCodeAt(0)-65+10;switch(Pu){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 :"+Pu}};return Ru},qr8BitByte=function(Au){const lo=QRMode.MODE_8BIT_BYTE,$u=qrcode.stringToBytes(Au),Ru={};return Ru.getMode=function(){return lo},Ru.getLength=function(Iu){return $u.length},Ru.write=function(Iu){for(let Pu=0;Pu<$u.length;Pu+=1)Iu.put($u[Pu],8)},Ru},qrKanji=function(Au){const lo=QRMode.MODE_KANJI,$u=qrcode.stringToBytes;(function(Pu,Ou){const Mu=$u(Pu);if(Mu.length!=2||(Mu[0]<<8|Mu[1])!=Ou)throw"sjis not supported."})("友",38726);const Ru=$u(Au),Iu={};return Iu.getMode=function(){return lo},Iu.getLength=function(Pu){return~~(Ru.length/2)},Iu.write=function(Pu){const Ou=Ru;let Mu=0;for(;Mu+1<Ou.length;){let Du=(255&Ou[Mu])<<8|255&Ou[Mu+1];if(33088<=Du&&Du<=40956)Du-=33088;else if(57408<=Du&&Du<=60351)Du-=49472;else throw"illegal char at "+(Mu+1)+"/"+Du;Du=(Du>>>8&255)*192+(Du&255),Pu.put(Du,13),Mu+=2}if(Mu<Ou.length)throw"illegal char at "+(Mu+1)},Iu},byteArrayOutputStream=function(){const Au=[],lo={};return lo.writeByte=function($u){Au.push($u&255)},lo.writeShort=function($u){lo.writeByte($u),lo.writeByte($u>>>8)},lo.writeBytes=function($u,Ru,Iu){Ru=Ru||0,Iu=Iu||$u.length;for(let Pu=0;Pu<Iu;Pu+=1)lo.writeByte($u[Pu+Ru])},lo.writeString=function($u){for(let Ru=0;Ru<$u.length;Ru+=1)lo.writeByte($u.charCodeAt(Ru))},lo.toByteArray=function(){return Au},lo.toString=function(){let $u="";$u+="[";for(let Ru=0;Ru<Au.length;Ru+=1)Ru>0&&($u+=","),$u+=Au[Ru];return $u+="]",$u},lo},base64EncodeOutputStream=function(){let Au=0,lo=0,$u=0,Ru="";const Iu={},Pu=function(Mu){Ru+=String.fromCharCode(Ou(Mu&63))},Ou=function(Mu){if(Mu<0)throw"n:"+Mu;if(Mu<26)return 65+Mu;if(Mu<52)return 97+(Mu-26);if(Mu<62)return 48+(Mu-52);if(Mu==62)return 43;if(Mu==63)return 47;throw"n:"+Mu};return Iu.writeByte=function(Mu){for(Au=Au<<8|Mu&255,lo+=8,$u+=1;lo>=6;)Pu(Au>>>lo-6),lo-=6},Iu.flush=function(){if(lo>0&&(Pu(Au<<6-lo),Au=0,lo=0),$u%3!=0){const Mu=3-$u%3;for(let Du=0;Du<Mu;Du+=1)Ru+="="}},Iu.toString=function(){return Ru},Iu},base64DecodeInputStream=function(Au){const lo=Au;let $u=0,Ru=0,Iu=0;const Pu={};Pu.read=function(){for(;Iu<8;){if($u>=lo.length){if(Iu==0)return-1;throw"unexpected end of file./"+Iu}const Du=lo.charAt($u);if($u+=1,Du=="=")return Iu=0,-1;if(Du.match(/^\s$/))continue;Ru=Ru<<6|Ou(Du.charCodeAt(0)),Iu+=6}const Mu=Ru>>>Iu-8&255;return Iu-=8,Mu};const Ou=function(Mu){if(65<=Mu&&Mu<=90)return Mu-65;if(97<=Mu&&Mu<=122)return Mu-97+26;if(48<=Mu&&Mu<=57)return Mu-48+52;if(Mu==43)return 62;if(Mu==47)return 63;throw"c:"+Mu};return Pu},gifImage=function(Au,lo){const $u=Au,Ru=lo,Iu=new Array(Au*lo),Pu={};Pu.setPixel=function(Lu,Bu,ju){Iu[Bu*$u+Lu]=ju},Pu.write=function(Lu){Lu.writeString("GIF87a"),Lu.writeShort($u),Lu.writeShort(Ru),Lu.writeByte(128),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(255),Lu.writeByte(255),Lu.writeByte(255),Lu.writeString(","),Lu.writeShort(0),Lu.writeShort(0),Lu.writeShort($u),Lu.writeShort(Ru),Lu.writeByte(0);const Bu=2,ju=Mu(Bu);Lu.writeByte(Bu);let Fu=0;for(;ju.length-Fu>255;)Lu.writeByte(255),Lu.writeBytes(ju,Fu,255),Fu+=255;Lu.writeByte(ju.length-Fu),Lu.writeBytes(ju,Fu,ju.length-Fu),Lu.writeByte(0),Lu.writeString(";")};const Ou=function(Lu){const Bu=Lu;let ju=0,Fu=0;const zu={};return zu.write=function(Uu,Hu){if(Uu>>>Hu)throw"length over";for(;ju+Hu>=8;)Bu.writeByte(255&(Uu<<ju|Fu)),Hu-=8-ju,Uu>>>=8-ju,Fu=0,ju=0;Fu=Uu<<ju|Fu,ju=ju+Hu},zu.flush=function(){ju>0&&Bu.writeByte(Fu)},zu},Mu=function(Lu){const Bu=1<<Lu,ju=(1<<Lu)+1;let Fu=Lu+1;const zu=Du();for(let Wu=0;Wu<Bu;Wu+=1)zu.add(String.fromCharCode(Wu));zu.add(String.fromCharCode(Bu)),zu.add(String.fromCharCode(ju));const Uu=byteArrayOutputStream(),Hu=Ou(Uu);Hu.write(Bu,Fu);let Vu=0,Gu=String.fromCharCode(Iu[Vu]);for(Vu+=1;Vu<Iu.length;){const Wu=String.fromCharCode(Iu[Vu]);Vu+=1,zu.contains(Gu+Wu)?Gu=Gu+Wu:(Hu.write(zu.indexOf(Gu),Fu),zu.size()<4095&&(zu.size()==1<<Fu&&(Fu+=1),zu.add(Gu+Wu)),Gu=Wu)}return Hu.write(zu.indexOf(Gu),Fu),Hu.write(ju,Fu),Hu.flush(),Uu.toByteArray()},Du=function(){const Lu={};let Bu=0;const ju={};return ju.add=function(Fu){if(ju.contains(Fu))throw"dup key:"+Fu;Lu[Fu]=Bu,Bu+=1},ju.size=function(){return Bu},ju.indexOf=function(Fu){return Lu[Fu]},ju.contains=function(Fu){return typeof Lu[Fu]<"u"},ju};return Pu},createDataURL=function(Au,lo,$u){const Ru=gifImage(Au,lo);for(let Mu=0;Mu<lo;Mu+=1)for(let Du=0;Du<Au;Du+=1)Ru.setPixel(Du,Mu,$u(Du,Mu));const Iu=byteArrayOutputStream();Ru.write(Iu);const Pu=base64EncodeOutputStream(),Ou=Iu.toByteArray();for(let Mu=0;Mu<Ou.length;Mu+=1)Pu.writeByte(Ou[Mu]);return Pu.flush(),"data:image/gif;base64,"+Pu};qrcode.stringToBytes;function _extends(){return _extends=Object.assign?Object.assign.bind():function(Au){for(var lo=1;lo<arguments.length;lo++){var $u=arguments[lo];for(var Ru in $u)({}).hasOwnProperty.call($u,Ru)&&(Au[Ru]=$u[Ru])}return Au},_extends.apply(null,arguments)}function _objectWithoutProperties(Au,lo){if(Au==null)return{};var $u,Ru,Iu=_objectWithoutPropertiesLoose(Au,lo);if(Object.getOwnPropertySymbols){var Pu=Object.getOwnPropertySymbols(Au);for(Ru=0;Ru<Pu.length;Ru++)$u=Pu[Ru],lo.indexOf($u)===-1&&{}.propertyIsEnumerable.call(Au,$u)&&(Iu[$u]=Au[$u])}return Iu}function _objectWithoutPropertiesLoose(Au,lo){if(Au==null)return{};var $u={};for(var Ru in Au)if({}.hasOwnProperty.call(Au,Ru)){if(lo.indexOf(Ru)!==-1)continue;$u[Ru]=Au[Ru]}return $u}var _excluded$1=["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"],propTypes$1={bgColor:s$5.oneOfType([s$5.object,s$5.string]).isRequired,bgD:s$5.string.isRequired,fgColor:s$5.oneOfType([s$5.object,s$5.string]).isRequired,fgD:s$5.string.isRequired,size:s$5.number.isRequired,title:s$5.string,viewBoxSize:s$5.number.isRequired,xmlns:s$5.string},QRCodeSvg=reactExports.forwardRef(function(Au,lo){var $u=Au.bgColor,Ru=Au.bgD,Iu=Au.fgD,Pu=Au.fgColor,Ou=Au.size,Mu=Au.title,Du=Au.viewBoxSize,Lu=Au.xmlns,Bu=Lu===void 0?"http://www.w3.org/2000/svg":Lu,ju=_objectWithoutProperties(Au,_excluded$1);return vM.createElement("svg",_extends({},ju,{height:Ou,ref:lo,viewBox:"0 0 ".concat(Du," ").concat(Du),width:Ou,xmlns:Bu}),Mu?vM.createElement("title",null,Mu):null,vM.createElement("path",{d:Ru,fill:$u}),vM.createElement("path",{d:Iu,fill:Pu}))});QRCodeSvg.displayName="QRCodeSvg";QRCodeSvg.propTypes=propTypes$1;var _excluded=["bgColor","fgColor","level","size","value"];qrcode.stringToBytes=function(Au){return Array.from(new TextEncoder().encode(Au))};var propTypes={bgColor:s$5.oneOfType([s$5.object,s$5.string]),fgColor:s$5.oneOfType([s$5.object,s$5.string]),level:s$5.string,size:s$5.number,value:s$5.string.isRequired},QRCode=reactExports.forwardRef(function(Au,lo){var $u=Au.bgColor,Ru=$u===void 0?"#FFFFFF":$u,Iu=Au.fgColor,Pu=Iu===void 0?"#000000":Iu,Ou=Au.level,Mu=Ou===void 0?"L":Ou,Du=Au.size,Lu=Du===void 0?256:Du,Bu=Au.value,ju=_objectWithoutProperties(Au,_excluded),Fu=qrcode(0,Mu);Fu.addData(Bu),Fu.make();var zu=Fu.getModuleCount(),Uu=Array.from({length:zu},function(Hu,Vu){return Array.from({length:zu},function(Gu,Wu){return Fu.isDark(Vu,Wu)})});return vM.createElement(QRCodeSvg,_extends({},ju,{bgColor:Ru,bgD:Uu.map(function(Hu,Vu){return Hu.map(function(Gu,Wu){return Gu?"":"M ".concat(Wu," ").concat(Vu," l 1 0 0 1 -1 0 Z")}).join(" ")}).join(" "),fgColor:Pu,fgD:Uu.map(function(Hu,Vu){return Hu.map(function(Gu,Wu){return Gu?"M ".concat(Wu," ").concat(Vu," l 1 0 0 1 -1 0 Z"):""}).join(" ")}).join(" "),ref:lo,size:Lu,viewBoxSize:zu}))});QRCode.displayName="QRCode";QRCode.propTypes=propTypes;const PAP_SIGN_IN_WORDS={title:Au=>`Sign in at ${Au}`,direct:"Open the company’s page, sign in there, and come back here.",device:"Open the company’s page and enter this code there.",open:Au=>`Open ${Au}`,code:"Your code",copy:"Copy the code",copied:"Copied",until:Au=>`Until ${new Date(Au).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}.`,checkAgain:"I have signed in: check again",tellMe:"Tell me when you are done.",checkMessage:Au=>`I have signed in at ${Au}. Please check again.`,refused:"This sign-in link cannot be opened safely, so it is not shown.",qr:Au=>`A code to scan to open ${Au} on your phone`},PAP_SIGN_IN_TOOL=/(^|[_.:\-/])pap_sign_in$/;function unwrapped(Au){let lo=Au;if(typeof lo=="string")try{lo=JSON.parse(lo)}catch{return null}if(!lo||typeof lo!="object"||Array.isArray(lo))return null;const $u=lo;if($u.structuredContent&&typeof $u.structuredContent=="object")return unwrapped($u.structuredContent);if(Array.isArray($u.content)){const Ru=$u.content.find(Iu=>Iu?.type==="text"&&typeof Iu.text=="string");return Ru?unwrapped(Ru.text):null}return $u.result&&typeof $u.result=="object"&&!("status"in $u)?unwrapped($u.result):$u}function safeSignInUrl(Au){if(typeof Au!="string")return null;try{const lo=new URL(Au);return lo.protocol==="https:"&&lo.hostname?lo:null}catch{return null}}function readPapSignIn(Au){const lo=unwrapped(Au);if(!lo||lo.status!=="waiting_for_the_person"||lo.mode!=="direct"&&lo.mode!=="device")return null;const $u=safeSignInUrl(lo.open);return $u?lo.mode==="device"&&(typeof lo.code!="string"||!lo.code)?null:{mode:lo.mode,open:$u.toString(),host:$u.hostname,...typeof lo.code=="string"&&lo.code?{code:lo.code}:{},...typeof lo.expires_at=="string"&&lo.expires_at?{expiresAt:lo.expires_at}:{}}:{refused:PAP_SIGN_IN_WORDS.refused}}function PapSignInCard({context:Au,send:lo}){const[$u,Ru]=reactExports.useState(!1),[Iu,Pu]=reactExports.useState(!1),Ou=Au.status==="complete"?readPapSignIn(Au.result):null;if(!Ou)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Au.defaultUI});if("refused"in Ou)return jsxRuntimeExports.jsx(Flash,{variant:"danger",role:"alert",sx:{my:2},children:Ou.refused});const Mu=async()=>{try{await navigator.clipboard.writeText(Ou.code??""),Ru(!0)}catch{Ru(!1)}};return jsxRuntimeExports.jsxs(Box,{as:"section","aria-label":PAP_SIGN_IN_WORDS.title(Ou.host),my:2,p:3,border:"1px solid",borderColor:"border.default",borderRadius:2,bg:"canvas.subtle",maxWidth:480,children:[jsxRuntimeExports.jsx(Heading$2,{as:"h4",sx:{fontSize:2,mb:1},children:PAP_SIGN_IN_WORDS.title(Ou.host)}),jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:0,mb:2,color:"fg.muted",fontSize:1},children:Ou.mode==="device"?PAP_SIGN_IN_WORDS.device:PAP_SIGN_IN_WORDS.direct}),Ou.code?jsxRuntimeExports.jsxs(Box,{display:"flex",gap:3,alignItems:"center",flexWrap:"wrap",mb:2,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$3,{as:"div",sx:{fontSize:0,color:"fg.muted"},children:PAP_SIGN_IN_WORDS.code}),jsxRuntimeExports.jsx(Text$3,{as:"div","aria-live":"polite",sx:{fontFamily:"mono",fontSize:5,fontWeight:"bold",letterSpacing:"0.15em"},children:Ou.code}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",leadingVisual:CopyIcon,onClick:()=>{Mu()},children:$u?PAP_SIGN_IN_WORDS.copied:PAP_SIGN_IN_WORDS.copy})]}),jsxRuntimeExports.jsx(Box,{bg:"#ffffff",p:2,borderRadius:2,lineHeight:0,children:jsxRuntimeExports.jsx(QRCode,{value:Ou.open,size:112,title:PAP_SIGN_IN_WORDS.qr(Ou.host)})})]}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center",children:[jsxRuntimeExports.jsx(ButtonComponent,{as:"a",href:Ou.open,target:"_blank",rel:"noopener noreferrer",variant:"primary",trailingVisual:LinkExternalIcon,children:PAP_SIGN_IN_WORDS.open(Ou.host)}),lo?jsxRuntimeExports.jsx(ButtonComponent,{disabled:Iu,onClick:()=>Pu(lo(PAP_SIGN_IN_WORDS.checkMessage(Ou.host))),children:PAP_SIGN_IN_WORDS.checkAgain}):null]}),Ou.expiresAt?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:2,mb:0,fontSize:0,color:"fg.muted"},children:PAP_SIGN_IN_WORDS.until(Ou.expiresAt)}):null,lo?null:jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:1,mb:0,fontSize:1},children:PAP_SIGN_IN_WORDS.tellMe})]})}const PAP_SIGN_IN_PLUGIN_NAME="@datalayer/loop-plugin-pap-sign-in",PAP_SIGN_IN_TYPE="application/vnd.datalayer.pap.sign-in+json";function resultOf(Au,lo){const $u=Au.data??{};return"toolName"in $u?lo?.result:{status:"waiting_for_the_person",...$u}}function createPapSignInPlugin(){let Au;const lo=Pu=>Au?!Au(Pu):!1;function $u({workspace:Pu}){const Ou=Pu?.viewControls.send;return reactExports.useEffect(()=>(Au=Ou,()=>{Au===Ou&&(Au=void 0)}),[Ou]),null}function Ru({display:Pu,context:Ou}){const Mu=resultOf(Pu,Ou);return reactExports.createElement(PapSignInCard,{key:Pu.id,context:Ou?{...Ou,result:Mu}:{toolCallId:Pu.id,toolName:"pap_sign_in",name:"pap_sign_in",args:{},status:"complete",result:Mu},send:Au?lo:void 0})}return{name:PAP_SIGN_IN_PLUGIN_NAME,displayName:"Sign in at a company",description:"The company’s page, the code and until when, where the agent asks the person to sign in.",octicon:"sign-in",emoji:"🔑",contributes:[contribution(Renderers,defineRenderer({type:PAP_SIGN_IN_TYPE,component:Ru}),{id:"pap-sign-in"}),contribution(ToolBindings,{tool:PAP_SIGN_IN_TOOL,type:PAP_SIGN_IN_TYPE},{id:"pap-sign-in"})],build(){return{components:[{slot:LoopSlots.chatHeader,id:"pap-sign-in",Component:$u}]}}}}const PapSignInPlugin=createPapSignInPlugin();function makeViewSwitchAction({viewId:Au,icon:lo,tooltip:$u}){return function(){const Iu=reactExports.useSyncExternalStore(subscribeEditorChoice,()=>getEditorChoice().editorId),Pu=useContributions(LoopEditorView);if(Au!==NONE_EDITOR&&!Pu.some(Mu=>Mu.value.surfaceId===Au))return null;const Ou=(Iu||NONE_EDITOR)===Au;return jsxRuntimeExports.jsx(IconButton,{icon:lo,"aria-label":$u,size:"small",variant:"invisible",onClick:()=>{chooseEditor(Au)||console.warn(`[loop] No chat is on screen to switch to '${Au}'.`)},sx:Ou?{color:"accent.fg"}:void 0})}}function defineViewPlugin(Au){const{key:lo,viewId:$u,displayName:Ru,description:Iu,icon:Pu,tooltip:Ou,order:Mu}=Au,Du=makeViewSwitchAction({viewId:$u,icon:Pu,tooltip:Ou});return{name:`@datalayer/loop-plugin-${lo}-view`,displayName:Ru,description:Iu,octicon:Au.octicon??"eye",emoji:Au.emoji,dependencies:[InputPromptPlugin],build:()=>({components:[{id:`${lo}-view-action`,slot:LoopSlots.promptAction,order:Mu,Component:Du}]})}}const ChatViewPlugin=defineViewPlugin({key:"chat",viewId:NONE_EDITOR,displayName:"Chat view",description:"The conversation on its own, from the composer footer.",icon:CommentDiscussionIcon,tooltip:"Show the chat",octicon:"comment-discussion",emoji:"💬",order:10}),DocumentViewPlugin=defineViewPlugin({key:"document",viewId:"document",displayName:"Document view",description:"The document beside the chat, from the composer footer.",icon:FileIcon,tooltip:"Show the document",octicon:"file",emoji:"📄",order:12}),NotebookViewPlugin=defineViewPlugin({key:"notebook",viewId:"notebook",displayName:"Notebook view",description:"The notebook beside the chat, from the composer footer.",icon:RowsIcon,tooltip:"Show the notebook",octicon:"rows",emoji:"📓",order:11}),STYLE_ELEMENT_ID="datalayer-reactor-commands-style",PALETTE_CSS=`
3844
+ `}return wd.substring(0,wd.length-1)},Bu.renderTo2dContext=function(ed,td){td=td||2;const nd=Bu.getModuleCount();for(let od=0;od<nd;od++)for(let sd=0;sd<nd;sd++)ed.fillStyle=Bu.isDark(od,sd)?"black":"white",ed.fillRect(sd*td,od*td,td,td)},Bu};qrcode.stringToBytes=function(Au){const lo=[];for(let $u=0;$u<Au.length;$u+=1){const Ru=Au.charCodeAt($u);lo.push(Ru&255)}return lo};qrcode.createStringToBytes=function(Au,lo){const $u=(function(){const Iu=base64DecodeInputStream(Au),Pu=function(){const Du=Iu.read();if(Du==-1)throw"eof";return Du};let Ou=0;const Mu={};for(;;){const Du=Iu.read();if(Du==-1)break;const Lu=Pu(),Bu=Pu(),ju=Pu(),Fu=String.fromCharCode(Du<<8|Lu),zu=Bu<<8|ju;Mu[Fu]=zu,Ou+=1}if(Ou!=lo)throw Ou+" != "+lo;return Mu})(),Ru=63;return function(Iu){const Pu=[];for(let Ou=0;Ou<Iu.length;Ou+=1){const Mu=Iu.charCodeAt(Ou);if(Mu<128)Pu.push(Mu);else{const Du=$u[Iu.charAt(Ou)];typeof Du=="number"?(Du&255)==Du?Pu.push(Du):(Pu.push(Du>>>8),Pu.push(Du&255)):Pu.push(Ru)}}return Pu}};const QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectionLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil=(function(){const Au=[[],[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]],lo=1335,$u=7973,Ru=21522,Iu={},Pu=function(Ou){let Mu=0;for(;Ou!=0;)Mu+=1,Ou>>>=1;return Mu};return Iu.getBCHTypeInfo=function(Ou){let Mu=Ou<<10;for(;Pu(Mu)-Pu(lo)>=0;)Mu^=lo<<Pu(Mu)-Pu(lo);return(Ou<<10|Mu)^Ru},Iu.getBCHTypeNumber=function(Ou){let Mu=Ou<<12;for(;Pu(Mu)-Pu($u)>=0;)Mu^=$u<<Pu(Mu)-Pu($u);return Ou<<12|Mu},Iu.getPatternPosition=function(Ou){return Au[Ou-1]},Iu.getMaskFunction=function(Ou){switch(Ou){case QRMaskPattern.PATTERN000:return function(Mu,Du){return(Mu+Du)%2==0};case QRMaskPattern.PATTERN001:return function(Mu,Du){return Mu%2==0};case QRMaskPattern.PATTERN010:return function(Mu,Du){return Du%3==0};case QRMaskPattern.PATTERN011:return function(Mu,Du){return(Mu+Du)%3==0};case QRMaskPattern.PATTERN100:return function(Mu,Du){return(Math.floor(Mu/2)+Math.floor(Du/3))%2==0};case QRMaskPattern.PATTERN101:return function(Mu,Du){return Mu*Du%2+Mu*Du%3==0};case QRMaskPattern.PATTERN110:return function(Mu,Du){return(Mu*Du%2+Mu*Du%3)%2==0};case QRMaskPattern.PATTERN111:return function(Mu,Du){return(Mu*Du%3+(Mu+Du)%2)%2==0};default:throw"bad maskPattern:"+Ou}},Iu.getErrorCorrectPolynomial=function(Ou){let Mu=qrPolynomial([1],0);for(let Du=0;Du<Ou;Du+=1)Mu=Mu.multiply(qrPolynomial([1,QRMath.gexp(Du)],0));return Mu},Iu.getLengthInBits=function(Ou,Mu){if(1<=Mu&&Mu<10)switch(Ou){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw"mode:"+Ou}else if(Mu<27)switch(Ou){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw"mode:"+Ou}else if(Mu<41)switch(Ou){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw"mode:"+Ou}else throw"type:"+Mu},Iu.getLostPoint=function(Ou){const Mu=Ou.getModuleCount();let Du=0;for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu;Fu+=1){let zu=0;const Uu=Ou.isDark(ju,Fu);for(let Hu=-1;Hu<=1;Hu+=1)if(!(ju+Hu<0||Mu<=ju+Hu))for(let Vu=-1;Vu<=1;Vu+=1)Fu+Vu<0||Mu<=Fu+Vu||Hu==0&&Vu==0||Uu==Ou.isDark(ju+Hu,Fu+Vu)&&(zu+=1);zu>5&&(Du+=3+zu-5)}for(let ju=0;ju<Mu-1;ju+=1)for(let Fu=0;Fu<Mu-1;Fu+=1){let zu=0;Ou.isDark(ju,Fu)&&(zu+=1),Ou.isDark(ju+1,Fu)&&(zu+=1),Ou.isDark(ju,Fu+1)&&(zu+=1),Ou.isDark(ju+1,Fu+1)&&(zu+=1),(zu==0||zu==4)&&(Du+=3)}for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu-6;Fu+=1)Ou.isDark(ju,Fu)&&!Ou.isDark(ju,Fu+1)&&Ou.isDark(ju,Fu+2)&&Ou.isDark(ju,Fu+3)&&Ou.isDark(ju,Fu+4)&&!Ou.isDark(ju,Fu+5)&&Ou.isDark(ju,Fu+6)&&(Du+=40);for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu-6;Fu+=1)Ou.isDark(Fu,ju)&&!Ou.isDark(Fu+1,ju)&&Ou.isDark(Fu+2,ju)&&Ou.isDark(Fu+3,ju)&&Ou.isDark(Fu+4,ju)&&!Ou.isDark(Fu+5,ju)&&Ou.isDark(Fu+6,ju)&&(Du+=40);let Lu=0;for(let ju=0;ju<Mu;ju+=1)for(let Fu=0;Fu<Mu;Fu+=1)Ou.isDark(Fu,ju)&&(Lu+=1);const Bu=Math.abs(100*Lu/Mu/Mu-50)/5;return Du+=Bu*10,Du},Iu})(),QRMath=(function(){const Au=new Array(256),lo=new Array(256);for(let Ru=0;Ru<8;Ru+=1)Au[Ru]=1<<Ru;for(let Ru=8;Ru<256;Ru+=1)Au[Ru]=Au[Ru-4]^Au[Ru-5]^Au[Ru-6]^Au[Ru-8];for(let Ru=0;Ru<255;Ru+=1)lo[Au[Ru]]=Ru;const $u={};return $u.glog=function(Ru){if(Ru<1)throw"glog("+Ru+")";return lo[Ru]},$u.gexp=function(Ru){for(;Ru<0;)Ru+=255;for(;Ru>=256;)Ru-=255;return Au[Ru]},$u})(),qrPolynomial=function(Au,lo){if(typeof Au.length>"u")throw Au.length+"/"+lo;const $u=(function(){let Iu=0;for(;Iu<Au.length&&Au[Iu]==0;)Iu+=1;const Pu=new Array(Au.length-Iu+lo);for(let Ou=0;Ou<Au.length-Iu;Ou+=1)Pu[Ou]=Au[Ou+Iu];return Pu})(),Ru={};return Ru.getAt=function(Iu){return $u[Iu]},Ru.getLength=function(){return $u.length},Ru.multiply=function(Iu){const Pu=new Array(Ru.getLength()+Iu.getLength()-1);for(let Ou=0;Ou<Ru.getLength();Ou+=1)for(let Mu=0;Mu<Iu.getLength();Mu+=1)Pu[Ou+Mu]^=QRMath.gexp(QRMath.glog(Ru.getAt(Ou))+QRMath.glog(Iu.getAt(Mu)));return qrPolynomial(Pu,0)},Ru.mod=function(Iu){if(Ru.getLength()-Iu.getLength()<0)return Ru;const Pu=QRMath.glog(Ru.getAt(0))-QRMath.glog(Iu.getAt(0)),Ou=new Array(Ru.getLength());for(let Mu=0;Mu<Ru.getLength();Mu+=1)Ou[Mu]=Ru.getAt(Mu);for(let Mu=0;Mu<Iu.getLength();Mu+=1)Ou[Mu]^=QRMath.gexp(QRMath.glog(Iu.getAt(Mu))+Pu);return qrPolynomial(Ou,0).mod(Iu)},Ru},QRRSBlock=(function(){const Au=[[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]],lo=function(Iu,Pu){const Ou={};return Ou.totalCount=Iu,Ou.dataCount=Pu,Ou},$u={},Ru=function(Iu,Pu){switch(Pu){case QRErrorCorrectionLevel.L:return Au[(Iu-1)*4+0];case QRErrorCorrectionLevel.M:return Au[(Iu-1)*4+1];case QRErrorCorrectionLevel.Q:return Au[(Iu-1)*4+2];case QRErrorCorrectionLevel.H:return Au[(Iu-1)*4+3];default:return}};return $u.getRSBlocks=function(Iu,Pu){const Ou=Ru(Iu,Pu);if(typeof Ou>"u")throw"bad rs block @ typeNumber:"+Iu+"/errorCorrectionLevel:"+Pu;const Mu=Ou.length/3,Du=[];for(let Lu=0;Lu<Mu;Lu+=1){const Bu=Ou[Lu*3+0],ju=Ou[Lu*3+1],Fu=Ou[Lu*3+2];for(let zu=0;zu<Bu;zu+=1)Du.push(lo(ju,Fu))}return Du},$u})(),qrBitBuffer=function(){const Au=[];let lo=0;const $u={};return $u.getBuffer=function(){return Au},$u.getAt=function(Ru){const Iu=Math.floor(Ru/8);return(Au[Iu]>>>7-Ru%8&1)==1},$u.put=function(Ru,Iu){for(let Pu=0;Pu<Iu;Pu+=1)$u.putBit((Ru>>>Iu-Pu-1&1)==1)},$u.getLengthInBits=function(){return lo},$u.putBit=function(Ru){const Iu=Math.floor(lo/8);Au.length<=Iu&&Au.push(0),Ru&&(Au[Iu]|=128>>>lo%8),lo+=1},$u},qrNumber=function(Au){const lo=QRMode.MODE_NUMBER,$u=Au,Ru={};Ru.getMode=function(){return lo},Ru.getLength=function(Ou){return $u.length},Ru.write=function(Ou){const Mu=$u;let Du=0;for(;Du+2<Mu.length;)Ou.put(Iu(Mu.substring(Du,Du+3)),10),Du+=3;Du<Mu.length&&(Mu.length-Du==1?Ou.put(Iu(Mu.substring(Du,Du+1)),4):Mu.length-Du==2&&Ou.put(Iu(Mu.substring(Du,Du+2)),7))};const Iu=function(Ou){let Mu=0;for(let Du=0;Du<Ou.length;Du+=1)Mu=Mu*10+Pu(Ou.charAt(Du));return Mu},Pu=function(Ou){if("0"<=Ou&&Ou<="9")return Ou.charCodeAt(0)-48;throw"illegal char :"+Ou};return Ru},qrAlphaNum=function(Au){const lo=QRMode.MODE_ALPHA_NUM,$u=Au,Ru={};Ru.getMode=function(){return lo},Ru.getLength=function(Pu){return $u.length},Ru.write=function(Pu){const Ou=$u;let Mu=0;for(;Mu+1<Ou.length;)Pu.put(Iu(Ou.charAt(Mu))*45+Iu(Ou.charAt(Mu+1)),11),Mu+=2;Mu<Ou.length&&Pu.put(Iu(Ou.charAt(Mu)),6)};const Iu=function(Pu){if("0"<=Pu&&Pu<="9")return Pu.charCodeAt(0)-48;if("A"<=Pu&&Pu<="Z")return Pu.charCodeAt(0)-65+10;switch(Pu){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 :"+Pu}};return Ru},qr8BitByte=function(Au){const lo=QRMode.MODE_8BIT_BYTE,$u=qrcode.stringToBytes(Au),Ru={};return Ru.getMode=function(){return lo},Ru.getLength=function(Iu){return $u.length},Ru.write=function(Iu){for(let Pu=0;Pu<$u.length;Pu+=1)Iu.put($u[Pu],8)},Ru},qrKanji=function(Au){const lo=QRMode.MODE_KANJI,$u=qrcode.stringToBytes;(function(Pu,Ou){const Mu=$u(Pu);if(Mu.length!=2||(Mu[0]<<8|Mu[1])!=Ou)throw"sjis not supported."})("友",38726);const Ru=$u(Au),Iu={};return Iu.getMode=function(){return lo},Iu.getLength=function(Pu){return~~(Ru.length/2)},Iu.write=function(Pu){const Ou=Ru;let Mu=0;for(;Mu+1<Ou.length;){let Du=(255&Ou[Mu])<<8|255&Ou[Mu+1];if(33088<=Du&&Du<=40956)Du-=33088;else if(57408<=Du&&Du<=60351)Du-=49472;else throw"illegal char at "+(Mu+1)+"/"+Du;Du=(Du>>>8&255)*192+(Du&255),Pu.put(Du,13),Mu+=2}if(Mu<Ou.length)throw"illegal char at "+(Mu+1)},Iu},byteArrayOutputStream=function(){const Au=[],lo={};return lo.writeByte=function($u){Au.push($u&255)},lo.writeShort=function($u){lo.writeByte($u),lo.writeByte($u>>>8)},lo.writeBytes=function($u,Ru,Iu){Ru=Ru||0,Iu=Iu||$u.length;for(let Pu=0;Pu<Iu;Pu+=1)lo.writeByte($u[Pu+Ru])},lo.writeString=function($u){for(let Ru=0;Ru<$u.length;Ru+=1)lo.writeByte($u.charCodeAt(Ru))},lo.toByteArray=function(){return Au},lo.toString=function(){let $u="";$u+="[";for(let Ru=0;Ru<Au.length;Ru+=1)Ru>0&&($u+=","),$u+=Au[Ru];return $u+="]",$u},lo},base64EncodeOutputStream=function(){let Au=0,lo=0,$u=0,Ru="";const Iu={},Pu=function(Mu){Ru+=String.fromCharCode(Ou(Mu&63))},Ou=function(Mu){if(Mu<0)throw"n:"+Mu;if(Mu<26)return 65+Mu;if(Mu<52)return 97+(Mu-26);if(Mu<62)return 48+(Mu-52);if(Mu==62)return 43;if(Mu==63)return 47;throw"n:"+Mu};return Iu.writeByte=function(Mu){for(Au=Au<<8|Mu&255,lo+=8,$u+=1;lo>=6;)Pu(Au>>>lo-6),lo-=6},Iu.flush=function(){if(lo>0&&(Pu(Au<<6-lo),Au=0,lo=0),$u%3!=0){const Mu=3-$u%3;for(let Du=0;Du<Mu;Du+=1)Ru+="="}},Iu.toString=function(){return Ru},Iu},base64DecodeInputStream=function(Au){const lo=Au;let $u=0,Ru=0,Iu=0;const Pu={};Pu.read=function(){for(;Iu<8;){if($u>=lo.length){if(Iu==0)return-1;throw"unexpected end of file./"+Iu}const Du=lo.charAt($u);if($u+=1,Du=="=")return Iu=0,-1;if(Du.match(/^\s$/))continue;Ru=Ru<<6|Ou(Du.charCodeAt(0)),Iu+=6}const Mu=Ru>>>Iu-8&255;return Iu-=8,Mu};const Ou=function(Mu){if(65<=Mu&&Mu<=90)return Mu-65;if(97<=Mu&&Mu<=122)return Mu-97+26;if(48<=Mu&&Mu<=57)return Mu-48+52;if(Mu==43)return 62;if(Mu==47)return 63;throw"c:"+Mu};return Pu},gifImage=function(Au,lo){const $u=Au,Ru=lo,Iu=new Array(Au*lo),Pu={};Pu.setPixel=function(Lu,Bu,ju){Iu[Bu*$u+Lu]=ju},Pu.write=function(Lu){Lu.writeString("GIF87a"),Lu.writeShort($u),Lu.writeShort(Ru),Lu.writeByte(128),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(0),Lu.writeByte(255),Lu.writeByte(255),Lu.writeByte(255),Lu.writeString(","),Lu.writeShort(0),Lu.writeShort(0),Lu.writeShort($u),Lu.writeShort(Ru),Lu.writeByte(0);const Bu=2,ju=Mu(Bu);Lu.writeByte(Bu);let Fu=0;for(;ju.length-Fu>255;)Lu.writeByte(255),Lu.writeBytes(ju,Fu,255),Fu+=255;Lu.writeByte(ju.length-Fu),Lu.writeBytes(ju,Fu,ju.length-Fu),Lu.writeByte(0),Lu.writeString(";")};const Ou=function(Lu){const Bu=Lu;let ju=0,Fu=0;const zu={};return zu.write=function(Uu,Hu){if(Uu>>>Hu)throw"length over";for(;ju+Hu>=8;)Bu.writeByte(255&(Uu<<ju|Fu)),Hu-=8-ju,Uu>>>=8-ju,Fu=0,ju=0;Fu=Uu<<ju|Fu,ju=ju+Hu},zu.flush=function(){ju>0&&Bu.writeByte(Fu)},zu},Mu=function(Lu){const Bu=1<<Lu,ju=(1<<Lu)+1;let Fu=Lu+1;const zu=Du();for(let Wu=0;Wu<Bu;Wu+=1)zu.add(String.fromCharCode(Wu));zu.add(String.fromCharCode(Bu)),zu.add(String.fromCharCode(ju));const Uu=byteArrayOutputStream(),Hu=Ou(Uu);Hu.write(Bu,Fu);let Vu=0,Gu=String.fromCharCode(Iu[Vu]);for(Vu+=1;Vu<Iu.length;){const Wu=String.fromCharCode(Iu[Vu]);Vu+=1,zu.contains(Gu+Wu)?Gu=Gu+Wu:(Hu.write(zu.indexOf(Gu),Fu),zu.size()<4095&&(zu.size()==1<<Fu&&(Fu+=1),zu.add(Gu+Wu)),Gu=Wu)}return Hu.write(zu.indexOf(Gu),Fu),Hu.write(ju,Fu),Hu.flush(),Uu.toByteArray()},Du=function(){const Lu={};let Bu=0;const ju={};return ju.add=function(Fu){if(ju.contains(Fu))throw"dup key:"+Fu;Lu[Fu]=Bu,Bu+=1},ju.size=function(){return Bu},ju.indexOf=function(Fu){return Lu[Fu]},ju.contains=function(Fu){return typeof Lu[Fu]<"u"},ju};return Pu},createDataURL=function(Au,lo,$u){const Ru=gifImage(Au,lo);for(let Mu=0;Mu<lo;Mu+=1)for(let Du=0;Du<Au;Du+=1)Ru.setPixel(Du,Mu,$u(Du,Mu));const Iu=byteArrayOutputStream();Ru.write(Iu);const Pu=base64EncodeOutputStream(),Ou=Iu.toByteArray();for(let Mu=0;Mu<Ou.length;Mu+=1)Pu.writeByte(Ou[Mu]);return Pu.flush(),"data:image/gif;base64,"+Pu};qrcode.stringToBytes;function _extends(){return _extends=Object.assign?Object.assign.bind():function(Au){for(var lo=1;lo<arguments.length;lo++){var $u=arguments[lo];for(var Ru in $u)({}).hasOwnProperty.call($u,Ru)&&(Au[Ru]=$u[Ru])}return Au},_extends.apply(null,arguments)}function _objectWithoutProperties(Au,lo){if(Au==null)return{};var $u,Ru,Iu=_objectWithoutPropertiesLoose(Au,lo);if(Object.getOwnPropertySymbols){var Pu=Object.getOwnPropertySymbols(Au);for(Ru=0;Ru<Pu.length;Ru++)$u=Pu[Ru],lo.indexOf($u)===-1&&{}.propertyIsEnumerable.call(Au,$u)&&(Iu[$u]=Au[$u])}return Iu}function _objectWithoutPropertiesLoose(Au,lo){if(Au==null)return{};var $u={};for(var Ru in Au)if({}.hasOwnProperty.call(Au,Ru)){if(lo.indexOf(Ru)!==-1)continue;$u[Ru]=Au[Ru]}return $u}var _excluded$1=["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"],propTypes$1={bgColor:s$5.oneOfType([s$5.object,s$5.string]).isRequired,bgD:s$5.string.isRequired,fgColor:s$5.oneOfType([s$5.object,s$5.string]).isRequired,fgD:s$5.string.isRequired,size:s$5.number.isRequired,title:s$5.string,viewBoxSize:s$5.number.isRequired,xmlns:s$5.string},QRCodeSvg=reactExports.forwardRef(function(Au,lo){var $u=Au.bgColor,Ru=Au.bgD,Iu=Au.fgD,Pu=Au.fgColor,Ou=Au.size,Mu=Au.title,Du=Au.viewBoxSize,Lu=Au.xmlns,Bu=Lu===void 0?"http://www.w3.org/2000/svg":Lu,ju=_objectWithoutProperties(Au,_excluded$1);return vM.createElement("svg",_extends({},ju,{height:Ou,ref:lo,viewBox:"0 0 ".concat(Du," ").concat(Du),width:Ou,xmlns:Bu}),Mu?vM.createElement("title",null,Mu):null,vM.createElement("path",{d:Ru,fill:$u}),vM.createElement("path",{d:Iu,fill:Pu}))});QRCodeSvg.displayName="QRCodeSvg";QRCodeSvg.propTypes=propTypes$1;var _excluded=["bgColor","fgColor","level","size","value"];qrcode.stringToBytes=function(Au){return Array.from(new TextEncoder().encode(Au))};var propTypes={bgColor:s$5.oneOfType([s$5.object,s$5.string]),fgColor:s$5.oneOfType([s$5.object,s$5.string]),level:s$5.string,size:s$5.number,value:s$5.string.isRequired},QRCode=reactExports.forwardRef(function(Au,lo){var $u=Au.bgColor,Ru=$u===void 0?"#FFFFFF":$u,Iu=Au.fgColor,Pu=Iu===void 0?"#000000":Iu,Ou=Au.level,Mu=Ou===void 0?"L":Ou,Du=Au.size,Lu=Du===void 0?256:Du,Bu=Au.value,ju=_objectWithoutProperties(Au,_excluded),Fu=qrcode(0,Mu);Fu.addData(Bu),Fu.make();var zu=Fu.getModuleCount(),Uu=Array.from({length:zu},function(Hu,Vu){return Array.from({length:zu},function(Gu,Wu){return Fu.isDark(Vu,Wu)})});return vM.createElement(QRCodeSvg,_extends({},ju,{bgColor:Ru,bgD:Uu.map(function(Hu,Vu){return Hu.map(function(Gu,Wu){return Gu?"":"M ".concat(Wu," ").concat(Vu," l 1 0 0 1 -1 0 Z")}).join(" ")}).join(" "),fgColor:Pu,fgD:Uu.map(function(Hu,Vu){return Hu.map(function(Gu,Wu){return Gu?"M ".concat(Wu," ").concat(Vu," l 1 0 0 1 -1 0 Z"):""}).join(" ")}).join(" "),ref:lo,size:Lu,viewBoxSize:zu}))});QRCode.displayName="QRCode";QRCode.propTypes=propTypes;const PAP_SIGN_IN_WORDS={title:Au=>`Sign in at ${Au}`,direct:"Open the company’s page, sign in there, and come back here.",device:"Open the company’s page and enter this code there.",mediatedTitle:Au=>`Sign in through ${Au}`,mediated:"Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.",sentTo:Au=>`The company sent a code to ${Au}.`,open:Au=>`Open ${Au}`,code:"Your code",copy:"Copy the code",copied:"Copied",until:Au=>`Until ${new Date(Au).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}.`,checkAgain:"I have signed in: check again",tellMe:"Tell me when you are done.",checkMessage:Au=>`I have signed in at ${Au}. Please check again.`,refused:"This sign-in link cannot be opened safely, so it is not shown.",qr:Au=>`A code to scan to open ${Au} on your phone`},PAP_SIGN_IN_TOOL=/(^|[_.:\-/])pa(?:p|ct)_sign_in$/;function unwrapped(Au){let lo=Au;if(typeof lo=="string")try{lo=JSON.parse(lo)}catch{return null}if(!lo||typeof lo!="object"||Array.isArray(lo))return null;const $u=lo;if($u.structuredContent&&typeof $u.structuredContent=="object")return unwrapped($u.structuredContent);if(Array.isArray($u.content)){const Ru=$u.content.find(Iu=>Iu?.type==="text"&&typeof Iu.text=="string");return Ru?unwrapped(Ru.text):null}return $u.result&&typeof $u.result=="object"&&!("status"in $u)?unwrapped($u.result):$u}function safeSignInUrl(Au){if(typeof Au!="string")return null;try{const lo=new URL(Au);return lo.protocol==="https:"&&lo.hostname?lo:null}catch{return null}}function readPapSignIn(Au){const lo=unwrapped(Au);if(!lo||lo.status!=="waiting_for_the_person"||lo.mode!=="direct"&&lo.mode!=="device"&&lo.mode!=="mediated")return null;const $u=safeSignInUrl(lo.open);return $u?lo.mode==="device"&&(typeof lo.code!="string"||!lo.code)?null:{mode:lo.mode,open:$u.toString(),host:$u.hostname,...typeof lo.code=="string"&&lo.code?{code:lo.code}:{},...lo.mode==="mediated"&&typeof lo.sent_to=="string"&&lo.sent_to?{sentTo:lo.sent_to}:{},...typeof lo.expires_at=="string"&&lo.expires_at?{expiresAt:lo.expires_at}:{}}:{refused:PAP_SIGN_IN_WORDS.refused}}function PapSignInCard({context:Au,send:lo}){const[$u,Ru]=reactExports.useState(!1),[Iu,Pu]=reactExports.useState(!1),Ou=Au.status==="complete"?readPapSignIn(Au.result):null;if(!Ou)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Au.defaultUI});if("refused"in Ou)return jsxRuntimeExports.jsx(Flash,{variant:"danger",role:"alert",sx:{my:2},children:Ou.refused});const Mu=async()=>{try{await navigator.clipboard.writeText(Ou.code??""),Ru(!0)}catch{Ru(!1)}},Du=Ou.mode==="mediated"?PAP_SIGN_IN_WORDS.mediatedTitle(Ou.host):PAP_SIGN_IN_WORDS.title(Ou.host);return jsxRuntimeExports.jsxs(Box,{as:"section","aria-label":Du,my:2,p:3,border:"1px solid",borderColor:"border.default",borderRadius:2,bg:"canvas.subtle",maxWidth:480,children:[jsxRuntimeExports.jsx(Heading$2,{as:"h4",sx:{fontSize:2,mb:1},children:Du}),jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:0,mb:2,color:"fg.muted",fontSize:1},children:Ou.mode==="device"?PAP_SIGN_IN_WORDS.device:Ou.mode==="mediated"?PAP_SIGN_IN_WORDS.mediated:PAP_SIGN_IN_WORDS.direct}),Ou.sentTo?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:0,mb:2,fontSize:1},children:PAP_SIGN_IN_WORDS.sentTo(Ou.sentTo)}):null,Ou.code?jsxRuntimeExports.jsxs(Box,{display:"flex",gap:3,alignItems:"center",flexWrap:"wrap",mb:2,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$3,{as:"div",sx:{fontSize:0,color:"fg.muted"},children:PAP_SIGN_IN_WORDS.code}),jsxRuntimeExports.jsx(Text$3,{as:"div","aria-live":"polite",sx:{fontFamily:"mono",fontSize:5,fontWeight:"bold",letterSpacing:"0.15em"},children:Ou.code}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",leadingVisual:CopyIcon,onClick:()=>{Mu()},children:$u?PAP_SIGN_IN_WORDS.copied:PAP_SIGN_IN_WORDS.copy})]}),jsxRuntimeExports.jsx(Box,{bg:"#ffffff",p:2,borderRadius:2,lineHeight:0,children:jsxRuntimeExports.jsx(QRCode,{value:Ou.open,size:112,title:PAP_SIGN_IN_WORDS.qr(Ou.host)})})]}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center",children:[jsxRuntimeExports.jsx(ButtonComponent,{as:"a",href:Ou.open,target:"_blank",rel:"noopener noreferrer",variant:"primary",trailingVisual:LinkExternalIcon,children:PAP_SIGN_IN_WORDS.open(Ou.host)}),lo?jsxRuntimeExports.jsx(ButtonComponent,{disabled:Iu,onClick:()=>Pu(lo(PAP_SIGN_IN_WORDS.checkMessage(Ou.host))),children:PAP_SIGN_IN_WORDS.checkAgain}):null]}),Ou.expiresAt?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:2,mb:0,fontSize:0,color:"fg.muted"},children:PAP_SIGN_IN_WORDS.until(Ou.expiresAt)}):null,lo?null:jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{mt:1,mb:0,fontSize:1},children:PAP_SIGN_IN_WORDS.tellMe})]})}const PAP_SIGN_IN_PLUGIN_NAME="@datalayer/loop-plugin-pap-sign-in",PAP_SIGN_IN_TYPE="application/vnd.datalayer.pap.sign-in+json";function resultOf(Au,lo){const $u=Au.data??{};return"toolName"in $u?lo?.result:{status:"waiting_for_the_person",...$u}}function createPapSignInPlugin(){let Au;const lo=Pu=>Au?!Au(Pu):!1;function $u({workspace:Pu}){const Ou=Pu?.viewControls.send;return reactExports.useEffect(()=>(Au=Ou,()=>{Au===Ou&&(Au=void 0)}),[Ou]),null}function Ru({display:Pu,context:Ou}){const Mu=resultOf(Pu,Ou);return reactExports.createElement(PapSignInCard,{key:Pu.id,context:Ou?{...Ou,result:Mu}:{toolCallId:Pu.id,toolName:"pap_sign_in",name:"pap_sign_in",args:{},status:"complete",result:Mu},send:Au?lo:void 0})}return{name:PAP_SIGN_IN_PLUGIN_NAME,displayName:"Sign in at a company",description:"The company’s page, the code and until when, where the agent asks the person to sign in.",octicon:"sign-in",emoji:"🔑",contributes:[contribution(Renderers,defineRenderer({type:PAP_SIGN_IN_TYPE,component:Ru}),{id:"pap-sign-in"}),contribution(ToolBindings,{tool:PAP_SIGN_IN_TOOL,type:PAP_SIGN_IN_TYPE},{id:"pap-sign-in"})],build(){return{components:[{slot:LoopSlots.chatHeader,id:"pap-sign-in",Component:$u}]}}}}const PapSignInPlugin=createPapSignInPlugin();function makeViewSwitchAction({viewId:Au,icon:lo,tooltip:$u}){return function(){const Iu=reactExports.useSyncExternalStore(subscribeEditorChoice,()=>getEditorChoice().editorId),Pu=useContributions(LoopEditorView);if(Au!==NONE_EDITOR&&!Pu.some(Mu=>Mu.value.surfaceId===Au))return null;const Ou=(Iu||NONE_EDITOR)===Au;return jsxRuntimeExports.jsx(IconButton,{icon:lo,"aria-label":$u,size:"small",variant:"invisible",onClick:()=>{chooseEditor(Au)||console.warn(`[loop] No chat is on screen to switch to '${Au}'.`)},sx:Ou?{color:"accent.fg"}:void 0})}}function defineViewPlugin(Au){const{key:lo,viewId:$u,displayName:Ru,description:Iu,icon:Pu,tooltip:Ou,order:Mu}=Au,Du=makeViewSwitchAction({viewId:$u,icon:Pu,tooltip:Ou});return{name:`@datalayer/loop-plugin-${lo}-view`,displayName:Ru,description:Iu,octicon:Au.octicon??"eye",emoji:Au.emoji,dependencies:[InputPromptPlugin],build:()=>({components:[{id:`${lo}-view-action`,slot:LoopSlots.promptAction,order:Mu,Component:Du}]})}}const ChatViewPlugin=defineViewPlugin({key:"chat",viewId:NONE_EDITOR,displayName:"Chat view",description:"The conversation on its own, from the composer footer.",icon:CommentDiscussionIcon,tooltip:"Show the chat",octicon:"comment-discussion",emoji:"💬",order:10}),DocumentViewPlugin=defineViewPlugin({key:"document",viewId:"document",displayName:"Document view",description:"The document beside the chat, from the composer footer.",icon:FileIcon,tooltip:"Show the document",octicon:"file",emoji:"📄",order:12}),NotebookViewPlugin=defineViewPlugin({key:"notebook",viewId:"notebook",displayName:"Notebook view",description:"The notebook beside the chat, from the composer footer.",icon:RowsIcon,tooltip:"Show the notebook",octicon:"rows",emoji:"📓",order:11}),STYLE_ELEMENT_ID="datalayer-reactor-commands-style",PALETTE_CSS=`
3845
3845
  /*
3846
3846
  * Colours live on the panel as variables with light defaults, and the dark
3847
3847
  * values are applied by whichever signal the host actually uses:
@@ -2,7 +2,9 @@
2
2
  * *Sign in at a company*, in the chat (AGENT_PROTOCOLS PI-56): where the
3
3
  * gateway's `pap_sign_in` answers, the company's page as a button opening a
4
4
  * new tab, the code large and copyable with a code to scan for Device
5
- * Sign-In, until when, and *I have signed in: check again* — sent as the
5
+ * Sign-In, Datalayer's own page for Mediated Sign-In (where the person types
6
+ * what the company asks, never in the chat) with where a code was sent,
7
+ * until when, and *I have signed in: check again* — sent as the
6
8
  * person's next message — when the chat can send one, otherwise a line
7
9
  * asking them to say so. What it reads is `signIn`'s.
8
10
  *
@@ -25,9 +25,14 @@ export function PapSignInCard({ context, send, }) {
25
25
  setCopied(false);
26
26
  }
27
27
  };
28
- return (_jsxs(Box, { as: "section", "aria-label": PAP_SIGN_IN_WORDS.title(read.host), my: 2, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.subtle", maxWidth: 480, children: [_jsx(Heading, { as: "h4", sx: { fontSize: 2, mb: 1 }, children: PAP_SIGN_IN_WORDS.title(read.host) }), _jsx(Text, { as: "p", sx: { mt: 0, mb: 2, color: 'fg.muted', fontSize: 1 }, children: read.mode === 'device'
28
+ const title = read.mode === 'mediated'
29
+ ? PAP_SIGN_IN_WORDS.mediatedTitle(read.host)
30
+ : PAP_SIGN_IN_WORDS.title(read.host);
31
+ return (_jsxs(Box, { as: "section", "aria-label": title, my: 2, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.subtle", maxWidth: 480, children: [_jsx(Heading, { as: "h4", sx: { fontSize: 2, mb: 1 }, children: title }), _jsx(Text, { as: "p", sx: { mt: 0, mb: 2, color: 'fg.muted', fontSize: 1 }, children: read.mode === 'device'
29
32
  ? PAP_SIGN_IN_WORDS.device
30
- : PAP_SIGN_IN_WORDS.direct }), read.code ? (_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", flexWrap: "wrap", mb: 2, children: [_jsxs(Box, { children: [_jsx(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: PAP_SIGN_IN_WORDS.code }), _jsx(Text, { as: "div", "aria-live": "polite", sx: {
33
+ : read.mode === 'mediated'
34
+ ? PAP_SIGN_IN_WORDS.mediated
35
+ : PAP_SIGN_IN_WORDS.direct }), read.sentTo ? (_jsx(Text, { as: "p", sx: { mt: 0, mb: 2, fontSize: 1 }, children: PAP_SIGN_IN_WORDS.sentTo(read.sentTo) })) : null, read.code ? (_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", flexWrap: "wrap", mb: 2, children: [_jsxs(Box, { children: [_jsx(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: PAP_SIGN_IN_WORDS.code }), _jsx(Text, { as: "div", "aria-live": "polite", sx: {
31
36
  fontFamily: 'mono',
32
37
  fontSize: 5,
33
38
  fontWeight: 'bold',
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * What the gateway's `pap_sign_in` tool answers, read and checked
3
3
  * (AGENT_PROTOCOLS PI-56, PAP_DATALAYER P-03): the person signs in at a
4
- * company themselves — on the company's page (`direct`), or by entering a
5
- * code there (`device`). The chat shows the link, the code and until when;
6
- * the agent never sees what the person types.
4
+ * company themselves — on the company's page (`direct`), by entering a
5
+ * code there (`device`), or by typing what the company asks on Datalayer's
6
+ * own page (`mediated`), never in the conversation. The chat shows the link,
7
+ * the code and until when; the agent never sees what the person types. A
8
+ * business over PACT answers its `pact_sign_in` the same way (a `device`
9
+ * sign-in at the business).
7
10
  *
8
11
  * Pure: no React. A test reaches it without a chat around it.
9
12
  *
@@ -11,13 +14,15 @@
11
14
  */
12
15
  /** A sign-in waiting for the person, as the card shows it. */
13
16
  export type PapSignInWaiting = {
14
- mode: 'direct' | 'device';
15
- /** The company's page, `https` only. */
17
+ mode: 'direct' | 'device' | 'mediated';
18
+ /** The company's page — Datalayer's own, for `mediated` — `https` only. */
16
19
  open: string;
17
- /** The company's domain, read from the page's address: what the person can trust. */
20
+ /** The page's domain, read from its address: what the person can trust. */
18
21
  host: string;
19
22
  /** The code to enter, for `device`. */
20
23
  code?: string;
24
+ /** Where the company sent a code, for `mediated`, when it did. */
25
+ sentTo?: string;
21
26
  /** Until when, ISO 8601. */
22
27
  expiresAt?: string;
23
28
  };
@@ -26,6 +31,10 @@ export declare const PAP_SIGN_IN_WORDS: {
26
31
  readonly title: (host: string) => string;
27
32
  readonly direct: "Open the company’s page, sign in there, and come back here.";
28
33
  readonly device: "Open the company’s page and enter this code there.";
34
+ /** `mediated`: the page is Datalayer's, which names the company and asks what it asks. */
35
+ readonly mediatedTitle: (host: string) => string;
36
+ readonly mediated: "Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.";
37
+ readonly sentTo: (to: string) => string;
29
38
  readonly open: (host: string) => string;
30
39
  readonly code: "Your code";
31
40
  readonly copy: "Copy the code";
@@ -37,9 +46,12 @@ export declare const PAP_SIGN_IN_WORDS: {
37
46
  readonly refused: "This sign-in link cannot be opened safely, so it is not shown.";
38
47
  readonly qr: (host: string) => string;
39
48
  };
40
- /** `pap_sign_in`, as the gateway names it with or without a prefix. */
49
+ /**
50
+ * `pap_sign_in` — or a business's `pact_sign_in` (PI-56) — as the gateway
51
+ * names it with or without a prefix.
52
+ */
41
53
  export declare const PAP_SIGN_IN_TOOL: RegExp;
42
- /** Whether a tool is `pap_sign_in`, as the gateway names it with or without a prefix. */
54
+ /** Whether a tool is `pap_sign_in` or `pact_sign_in`, as the gateway names it with or without a prefix. */
43
55
  export declare const isPapSignInTool: (name: string) => boolean;
44
56
  /** The page's address, `https` only; `null` for anything else. */
45
57
  export declare function safeSignInUrl(open: unknown): URL | null;
@@ -7,6 +7,10 @@ export const PAP_SIGN_IN_WORDS = {
7
7
  title: (host) => `Sign in at ${host}`,
8
8
  direct: 'Open the company’s page, sign in there, and come back here.',
9
9
  device: 'Open the company’s page and enter this code there.',
10
+ /** `mediated`: the page is Datalayer's, which names the company and asks what it asks. */
11
+ mediatedTitle: (host) => `Sign in through ${host}`,
12
+ mediated: 'Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.',
13
+ sentTo: (to) => `The company sent a code to ${to}.`,
10
14
  open: (host) => `Open ${host}`,
11
15
  code: 'Your code',
12
16
  copy: 'Copy the code',
@@ -18,9 +22,12 @@ export const PAP_SIGN_IN_WORDS = {
18
22
  refused: 'This sign-in link cannot be opened safely, so it is not shown.',
19
23
  qr: (host) => `A code to scan to open ${host} on your phone`,
20
24
  };
21
- /** `pap_sign_in`, as the gateway names it with or without a prefix. */
22
- export const PAP_SIGN_IN_TOOL = /(^|[_.:\-/])pap_sign_in$/;
23
- /** Whether a tool is `pap_sign_in`, as the gateway names it with or without a prefix. */
25
+ /**
26
+ * `pap_sign_in` — or a business's `pact_sign_in` (PI-56) — as the gateway
27
+ * names it with or without a prefix.
28
+ */
29
+ export const PAP_SIGN_IN_TOOL = /(^|[_.:\-/])pa(?:p|ct)_sign_in$/;
30
+ /** Whether a tool is `pap_sign_in` or `pact_sign_in`, as the gateway names it with or without a prefix. */
24
31
  export const isPapSignInTool = (name) => PAP_SIGN_IN_TOOL.test(name);
25
32
  /** An MCP result's own object: its structured content, or the JSON of its text. */
26
33
  function unwrapped(result) {
@@ -73,7 +80,9 @@ export function readPapSignIn(result) {
73
80
  if (!data || data.status !== 'waiting_for_the_person') {
74
81
  return null;
75
82
  }
76
- if (data.mode !== 'direct' && data.mode !== 'device') {
83
+ if (data.mode !== 'direct' &&
84
+ data.mode !== 'device' &&
85
+ data.mode !== 'mediated') {
77
86
  return null;
78
87
  }
79
88
  const url = safeSignInUrl(data.open);
@@ -88,6 +97,11 @@ export function readPapSignIn(result) {
88
97
  open: url.toString(),
89
98
  host: url.hostname,
90
99
  ...(typeof data.code === 'string' && data.code ? { code: data.code } : {}),
100
+ ...(data.mode === 'mediated' &&
101
+ typeof data.sent_to === 'string' &&
102
+ data.sent_to
103
+ ? { sentTo: data.sent_to }
104
+ : {}),
91
105
  ...(typeof data.expires_at === 'string' && data.expires_at
92
106
  ? { expiresAt: data.expires_at }
93
107
  : {}),