@piedata/pieui 1.2.3 → 1.2.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.
package/dist/index.js CHANGED
@@ -107,4 +107,4 @@ npm install @modelcontextprotocol/sdk
107
107
  Failed Guardrail Reason: ${$.guardrail.policyHint}.
108
108
  Failure Details: ${JSON.stringify($.output.outputInfo??{})}.
109
109
  Please respond again following policy. Apologize for not being able to answer the question (while avoiding the specific reason) and divert discussion back to an approved topic immediately and not invite more discussion.
110
- `.trim()}function v7($,X){return $ in X&&typeof X[$]!=="undefined"}function kU$($){return v7("modalities",$)||v7("inputAudioFormat",$)||v7("outputAudioFormat",$)||v7("inputAudioTranscription",$)||v7("turnDetection",$)||v7("inputAudioNoiseReduction",$)||v7("speed",$)}function Rd($){if(!kU$($)){let X=$.audio?.input?{format:Hq($.audio.input.format),noiseReduction:$.audio.input.noiseReduction??null,transcription:$.audio.input.transcription,turnDetection:$.audio.input.turnDetection}:void 0,Q=$.audio?.output?.voice??$.voice,J=$.audio?.output||typeof Q!=="undefined"?{format:Hq($.audio?.output?.format),voice:Q,speed:$.audio?.output?.speed}:void 0;return{model:$.model,instructions:$.instructions,toolChoice:$.toolChoice,tools:$.tools,tracing:$.tracing,providerData:$.providerData,prompt:$.prompt,outputModalities:$.outputModalities,audio:X||J?{input:X,output:J}:void 0}}return{model:$.model,instructions:$.instructions,toolChoice:$.toolChoice,tools:$.tools,tracing:$.tracing,providerData:$.providerData,prompt:$.prompt,outputModalities:$.modalities,audio:{input:{format:Hq($.inputAudioFormat),noiseReduction:$.inputAudioNoiseReduction??null,transcription:$.inputAudioTranscription,turnDetection:$.turnDetection},output:{format:Hq($.outputAudioFormat),voice:$.voice,speed:$.speed}}}}function Hq($){if(!$)return;if(typeof $==="object")return $;let X=String($);if(X==="pcm16")return{type:"audio/pcm",rate:24000};if(X==="g711_ulaw")return{type:"audio/pcmu"};if(X==="g711_alaw")return{type:"audio/pcma"};return{type:"audio/pcm",rate:24000}}var og$=B.object({itemId:B.string()}),CP=B.discriminatedUnion("role",[B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("system"),content:B.array(B.object({type:B.literal("input_text"),text:B.string()}))}),B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("user"),status:B.enum(["in_progress","completed"]),content:B.array(B.object({type:B.literal("input_text"),text:B.string()}).or(B.object({type:B.literal("input_audio"),audio:B.string().nullable().optional(),transcript:B.string().nullable()})))}),B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("assistant"),status:B.enum(["in_progress","completed","incomplete"]),content:B.array(B.object({type:B.literal("output_text"),text:B.string()}).or(B.object({type:B.literal("output_audio"),audio:B.string().nullable().optional(),transcript:B.string().nullable().optional()})))})]),yP=B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("function_call"),status:B.enum(["in_progress","completed","incomplete"]),arguments:B.string(),name:B.string(),output:B.string().nullable()}),fP=B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.enum(["mcp_call","mcp_tool_call"]),status:B.enum(["in_progress","completed","incomplete"]),arguments:B.string(),name:B.string(),output:B.string().nullable()}),Ed=B.object({itemId:B.string(),type:B.literal("mcp_approval_request"),serverLabel:B.string(),name:B.string(),arguments:B.record(B.string(),B.any()),approved:B.boolean().optional().nullable()});var SU$=Q8("openai-agents:realtime"),J6=SU$;var _d=B.object({id:B.string().optional().nullable(),conversation_id:B.string().optional().nullable(),max_output_tokens:B.number().or(B.literal("inf")).optional().nullable(),metadata:B.record(B.string(),B.any()).optional().nullable(),output_modalities:B.array(B.string()).optional().nullable(),object:B.literal("realtime.response").optional().nullable(),output:B.array(B.any()).optional().nullable(),audio:B.object({output:B.object({format:B.any().optional().nullable(),voice:B.string().optional().nullable()}).optional().nullable()}).optional().nullable(),status:B.enum(["completed","incomplete","failed","cancelled","in_progress"]).optional().nullable(),status_details:B.record(B.string(),B.any()).optional().nullable(),usage:B.object({input_tokens:B.number().optional(),input_token_details:B.record(B.string(),B.any()).optional().nullable(),output_tokens:B.number().optional(),output_token_details:B.record(B.string(),B.any()).optional().nullable()}).optional().nullable()}),CU$=B.object({id:B.string().optional(),audio:B.string().nullable().optional(),text:B.string().nullable().optional(),transcript:B.string().nullable().optional(),type:B.union([B.literal("input_text"),B.literal("input_audio"),B.literal("item_reference"),B.literal("output_text"),B.literal("output_audio")])}),r3=B.object({id:B.string().optional(),arguments:B.string().optional(),call_id:B.string().optional(),content:B.array(CU$).optional(),name:B.string().optional(),output:B.string().nullable().optional(),role:B.enum(["user","assistant","system"]).optional(),status:B.enum(["completed","incomplete","in_progress"]).optional(),type:B.enum(["message","function_call","function_call_output","mcp_list_tools","mcp_tool_call","mcp_call","mcp_approval_request","mcp_approval_response"]).optional(),approval_request_id:B.string().nullable().optional(),approve:B.boolean().nullable().optional(),reason:B.string().nullable().optional(),server_label:B.string().optional(),error:B.any().nullable().optional(),tools:B.array(B.object({name:B.string(),description:B.string(),input_schema:B.record(B.string(),B.any()).optional()}).passthrough()).optional()}).passthrough(),yU$=B.object({type:B.literal("conversation.created"),event_id:B.string(),conversation:B.object({id:B.string().optional(),object:B.literal("realtime.conversation").optional()})}),fU$=B.object({type:B.literal("conversation.item.added"),event_id:B.string(),item:r3,previous_item_id:B.string().nullable().optional()}),gU$=B.object({type:B.literal("conversation.item.done"),event_id:B.string(),item:r3,previous_item_id:B.string().nullable().optional()}),hU$=B.object({type:B.literal("conversation.item.deleted"),event_id:B.string(),item_id:B.string()}),uU$=B.object({type:B.literal("conversation.item.input_audio_transcription.completed"),event_id:B.string(),item_id:B.string(),content_index:B.number(),transcript:B.string(),logprobs:B.array(B.any()).nullable().optional(),usage:B.object({type:B.literal("tokens"),total_tokens:B.number(),input_tokens:B.number(),input_token_details:B.object({text_tokens:B.number(),audio_tokens:B.number()}),output_tokens:B.number()}).optional()}),mU$=B.object({type:B.literal("conversation.item.input_audio_transcription.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number().optional(),delta:B.string().optional(),logprobs:B.array(B.any()).nullable().optional()}),cU$=B.object({type:B.literal("conversation.item.input_audio_transcription.failed"),event_id:B.string(),item_id:B.string(),content_index:B.number(),error:B.object({code:B.string().optional(),message:B.string().optional(),param:B.string().optional(),type:B.string().optional()})}),iU$=B.object({type:B.literal("conversation.item.retrieved"),event_id:B.string(),item:r3}),lU$=B.object({type:B.literal("conversation.item.truncated"),event_id:B.string(),item_id:B.string(),audio_end_ms:B.number(),content_index:B.number()}),pU$=B.object({type:B.literal("conversation.item.create"),item:r3,event_id:B.string().optional(),previous_item_id:B.string().nullable().optional()}),nU$=B.object({type:B.literal("conversation.item.delete"),item_id:B.string(),event_id:B.string().optional()}),dU$=B.object({type:B.literal("conversation.item.retrieve"),item_id:B.string(),event_id:B.string().optional()}),aU$=B.object({type:B.literal("conversation.item.truncate"),item_id:B.string(),audio_end_ms:B.number(),content_index:B.number(),event_id:B.string().optional()}),oU$=B.object({type:B.literal("error"),event_id:B.string().optional(),error:B.any().optional()}),rU$=B.object({type:B.literal("input_audio_buffer.cleared"),event_id:B.string()}),tU$=B.object({type:B.literal("input_audio_buffer.append"),audio:B.string(),event_id:B.string().optional()}),sU$=B.object({type:B.literal("input_audio_buffer.clear"),event_id:B.string().optional()}),eU$=B.object({type:B.literal("input_audio_buffer.commit"),event_id:B.string().optional()}),$B$=B.object({type:B.literal("input_audio_buffer.committed"),event_id:B.string(),item_id:B.string(),previous_item_id:B.string().nullable().optional()}),XB$=B.object({type:B.literal("input_audio_buffer.speech_started"),event_id:B.string(),item_id:B.string(),audio_start_ms:B.number()}),QB$=B.object({type:B.literal("input_audio_buffer.speech_stopped"),event_id:B.string(),item_id:B.string(),audio_end_ms:B.number()}),YB$=B.object({type:B.literal("output_audio_buffer.started"),event_id:B.string()}).passthrough(),JB$=B.object({type:B.literal("output_audio_buffer.stopped"),event_id:B.string()}).passthrough(),GB$=B.object({type:B.literal("output_audio_buffer.cleared"),event_id:B.string()}),WB$=B.object({type:B.literal("rate_limits.updated"),event_id:B.string(),rate_limits:B.array(B.object({limit:B.number().optional(),name:B.enum(["requests","tokens"]).optional(),remaining:B.number().optional(),reset_seconds:B.number().optional()}))}),KB$=B.object({type:B.literal("response.output_audio.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),VB$=B.object({type:B.literal("response.output_audio.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string()}),HB$=B.object({type:B.literal("response.output_audio_transcript.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),UB$=B.object({type:B.literal("response.output_audio_transcript.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),transcript:B.string(),output_index:B.number(),response_id:B.string()}),BB$=B.object({type:B.literal("response.content_part.added"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string(),part:B.object({audio:B.string().optional(),text:B.string().optional(),transcript:B.string().optional(),type:B.enum(["text","audio"]).optional()})}),qB$=B.object({type:B.literal("response.content_part.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string(),part:B.object({audio:B.string().optional(),text:B.string().optional(),transcript:B.string().optional(),type:B.enum(["text","audio"]).optional()})}),wB$=B.object({type:B.literal("response.created"),event_id:B.string(),response:_d}),gP=B.object({type:B.literal("response.done"),event_id:B.string(),response:_d}),zB$=B.object({type:B.literal("response.function_call_arguments.delta"),event_id:B.string(),item_id:B.string(),call_id:B.string(),delta:B.string(),output_index:B.number(),response_id:B.string()}),NB$=B.object({type:B.literal("response.function_call_arguments.done"),event_id:B.string(),item_id:B.string(),call_id:B.string(),arguments:B.string(),output_index:B.number(),response_id:B.string()}),DB$=B.object({type:B.literal("response.output_item.added"),event_id:B.string(),item:r3,output_index:B.number(),response_id:B.string()}),LB$=B.object({type:B.literal("response.output_item.done"),event_id:B.string(),item:r3,output_index:B.number(),response_id:B.string()}),FB$=B.object({type:B.literal("response.output_text.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),OB$=B.object({type:B.literal("response.output_text.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),text:B.string(),output_index:B.number(),response_id:B.string()}),ZB$=B.object({type:B.literal("session.created"),event_id:B.string(),session:B.any()}),MB$=B.object({type:B.literal("session.updated"),event_id:B.string(),session:B.any()}),AB$=B.object({type:B.literal("response.cancel"),event_id:B.string().optional(),response_id:B.string().optional()}),jB$=B.object({type:B.literal("response.create"),event_id:B.string().optional(),response:B.any().optional()}),vB$=B.object({type:B.literal("session.update"),event_id:B.string().optional(),session:B.any()}),PB$=B.object({type:B.literal("mcp_list_tools.in_progress"),event_id:B.string().optional(),item_id:B.string().optional()}),xB$=B.object({type:B.literal("mcp_list_tools.completed"),event_id:B.string().optional(),item_id:B.string().optional()}),bB$=B.object({type:B.literal("response.mcp_call_arguments.delta"),event_id:B.string(),response_id:B.string(),item_id:B.string(),output_index:B.number(),delta:B.string(),obfuscation:B.string()}),IB$=B.object({type:B.literal("response.mcp_call_arguments.done"),event_id:B.string(),response_id:B.string(),item_id:B.string(),output_index:B.number(),arguments:B.string()}),RB$=B.object({type:B.literal("response.mcp_call.in_progress"),event_id:B.string(),output_index:B.number(),item_id:B.string()}),EB$=B.object({type:B.literal("response.mcp_call.completed"),event_id:B.string(),output_index:B.number(),item_id:B.string()}),_B$=B.object({type:B.literal("mcp_list_tools.failed"),event_id:B.string().optional(),item_id:B.string().optional()}),TB$=B.object({type:B.string(),event_id:B.string().optional().nullable()}).passthrough(),kB$=B.discriminatedUnion("type",[yU$,fU$,gU$,hU$,uU$,mU$,cU$,iU$,lU$,oU$,rU$,$B$,XB$,QB$,YB$,JB$,GB$,WB$,KB$,VB$,HB$,UB$,BB$,qB$,wB$,gP,zB$,NB$,DB$,LB$,FB$,OB$,ZB$,MB$,PB$,xB$,_B$,bB$,IB$,RB$,EB$]),$h$=B.discriminatedUnion("type",[pU$,nU$,dU$,aU$,tU$,sU$,eU$,AB$,jB$,vB$]);function t3($){let X=JSON.parse($.data.toString()),Q=kB$.safeParse(X);if(!Q.success){let J=TB$.safeParse(X);if(J.success)return{data:J.data,isGeneric:!0};return{data:null,isGeneric:!0}}return{data:Q.data,isGeneric:!1}}var Td="gpt-realtime",X0={outputModalities:["audio"],audio:{input:{format:{type:"audio/pcm",rate:24000},transcription:{model:"gpt-4o-mini-transcribe"},turnDetection:{type:"semantic_vad"},noiseReduction:null},output:{format:{type:"audio/pcm",rate:24000},speed:1}}};class P7 extends a3{#$;#X;#G=null;#Q=null;eventEmitter=new H8.EventEmitter;constructor($={}){super();this.#$=$.model??Td,this.#X=$.apiKey}get currentModel(){return this.#$}set currentModel($){this.#$=$}_afterAudioDoneEvent(){}get _rawSessionConfig(){return this.#Q??null}async _getApiKey($){let X=$.apiKey??this.#X;if(typeof X==="function")return await X();return X}_onMessage($){let{data:X,isGeneric:Q}=t3($);if(X===null)return;if(this.emit("*",X),Q)return;if(X.type==="error")this.emit("error",{type:"error",error:X});else this.emit(X.type,X);if(X.type==="response.created"){this.emit("turn_started",{type:"response_started",providerData:{...X}});return}if(X.type==="session.updated")this.#Q=X.session;if(X.type==="response.done"){let J=gP.safeParse(X);if(!J.success){J6.error("Error parsing response done event",J.error);return}let Y=J.data.response.usage?.input_tokens??0,G=J.data.response.usage?.output_tokens??0,W=Y+G,K=new $0({inputTokens:Y,inputTokensDetails:J.data.response.usage?.input_token_details??{},outputTokens:G,outputTokensDetails:J.data.response.usage?.output_token_details??{},totalTokens:W});this.emit("usage_update",K),this.emit("turn_done",{type:"response_done",response:{id:J.data.response.id??"",output:J.data.response.output??[],usage:{inputTokens:Y,inputTokensDetails:J.data.response.usage?.input_token_details??{},outputTokens:G,outputTokensDetails:J.data.response.usage?.output_token_details??{},totalTokens:W}}});return}if(X.type==="response.output_audio.done"){this.emit("audio_done"),this._afterAudioDoneEvent();return}if(X.type==="conversation.item.deleted"){this.emit("item_deleted",{itemId:X.item_id});return}if(X.type==="conversation.item.input_audio_transcription.completed"||X.type==="conversation.item.truncated"){this.sendEvent({type:"conversation.item.retrieve",item_id:X.item_id});return}if(X.type==="conversation.item.input_audio_transcription.delta"||X.type==="response.output_text.delta"||X.type==="response.output_audio_transcript.delta"||X.type==="response.function_call_arguments.delta"){if(X.type==="response.output_audio_transcript.delta")this.emit("audio_transcript_delta",{type:"transcript_delta",delta:X.delta,itemId:X.item_id,responseId:X.response_id});return}if(X.type==="conversation.item.added"||X.type==="conversation.item.done"||X.type==="conversation.item.retrieved"){if(X.item.type==="mcp_list_tools"&&X.type==="conversation.item.done"){let J=X.item.server_label??"",Y=X.item.tools??[];try{this.emit("mcp_tools_listed",{serverLabel:J,tools:Y})}catch(G){J6.error("Error emitting mcp_tools_listed",G,X.item)}return}if(X.item.type==="message"){let J=X.type==="conversation.item.added"||X.type==="conversation.item.done"?X.previous_item_id:null,Y=CP.parse({itemId:X.item.id,previousItemId:J,type:X.item.type,role:X.item.role,content:X.item.content,status:X.item.status});this.emit("item_update",Y);return}if(X.item.type==="mcp_approval_request"&&X.type==="conversation.item.done"){let J=X.item,Y=Ed.parse({itemId:J.id,type:J.type,serverLabel:J.server_label,name:J.name,arguments:JSON.parse(J.arguments||"{}"),approved:J.approved});this.emit("item_update",Y),this.emit("mcp_approval_request",Y);return}if(X.item.type==="mcp_tool_call"||X.item.type==="mcp_call"){let J=X.type==="conversation.item.done"?"completed":"in_progress",Y=fP.parse({itemId:X.item.id,type:X.item.type,status:J,arguments:X.item.arguments,name:X.item.name,output:X.item.output});if(this.emit("item_update",Y),X.type==="conversation.item.done")this.emit("mcp_tool_call_completed",Y);return}}if(X.type==="response.mcp_call.in_progress"){let J=X;this.sendEvent({type:"conversation.item.retrieve",item_id:J.item_id});return}if(X.type==="mcp_list_tools.in_progress"){let J=X;if(J.item_id)this.sendEvent({type:"conversation.item.retrieve",item_id:J.item_id});return}if(X.type==="response.output_item.done"||X.type==="response.output_item.added"){let J=X.item;if(J.type==="function_call"&&J.status==="completed"){let Y=yP.parse({itemId:J.id,type:J.type,status:"in_progress",arguments:J.arguments,name:J.name,output:null});this.emit("item_update",Y),this.emit("function_call",{id:J.id,type:"function_call",callId:J.call_id??"",arguments:J.arguments??"",name:J.name??""});return}if(J.type==="mcp_tool_call"||J.type==="mcp_call"){let Y=fP.parse({itemId:J.id,type:J.type,status:X.type==="response.output_item.done"?"completed":"in_progress",arguments:J.arguments,name:J.name,output:J.output});this.emit("item_update",Y);return}if(J.type==="message"){let Y=CP.parse({itemId:X.item.id,type:X.item.type,role:X.item.role,content:X.item.content,status:X.type==="response.output_item.done"?J.status??"completed":J.status??"in_progress"});this.emit("item_update",Y);return}}}_onError($){this.emit("error",{type:"error",error:$})}_onOpen(){this.emit("connected")}_onClose(){this.emit("disconnected")}sendMessage($,X,{triggerResponse:Q=!0}={}){let J=typeof $==="string"?[{type:"input_text",text:$}]:$.content.map((Y)=>{if(Y.type==="input_image")return{type:"input_image",image_url:Y.image,...Y.providerData??{}};return Y});if(this.sendEvent({type:"conversation.item.create",item:{type:"message",role:"user",content:J},...X}),Q)this.sendEvent({type:"response.create"})}addImage($,{triggerResponse:X=!0}={}){this.sendMessage({type:"message",role:"user",content:[{type:"input_image",image:$}]},{},{triggerResponse:X})}_getMergedSessionConfig($){let X=Rd($),Q=X.audio?.input?.noiseReduction,J=X.audio?.input?.transcription,Y=P7.buildTurnDetectionConfig(X.audio?.input?.turnDetection),G={type:"realtime",instructions:X.instructions,model:X.model??this.#$,output_modalities:X.outputModalities??X0.outputModalities,audio:{input:{format:X.audio?.input?.format??X0.audio?.input?.format,noise_reduction:Q===void 0?X0.audio?.input?.noiseReduction:Q,transcription:J===void 0?X0.audio?.input?.transcription:J,turn_detection:Y===void 0?X0.audio?.input?.turnDetection:Y},output:{format:X.audio?.output?.format??X0.audio?.output?.format,voice:X.audio?.output?.voice??X0.audio?.output?.voice,speed:X.audio?.output?.speed??X0.audio?.output?.speed}},tool_choice:X.toolChoice??X0.toolChoice,...X.providerData??{}};if(X.prompt)G.prompt={id:X.prompt.promptId,version:X.prompt.version,variables:X.prompt.variables};if(X.tools&&X.tools.length>0)G.tools=X.tools.map((W)=>{let K=(V)=>Object.fromEntries(Object.entries(V).filter(([,H])=>typeof H!=="undefined"));if(W.type==="mcp")return K({type:"mcp",server_label:W.server_label,server_url:W.server_url,server_description:W.server_description,connector_id:W.connector_id,authorization:W.authorization,headers:W.headers,allowed_tools:W.allowed_tools,require_approval:W.require_approval});return K({type:W.type,name:W.name,description:W.description,parameters:W.parameters})});return G}buildSessionPayload($){return this._getMergedSessionConfig($)}static buildTurnDetectionConfig($){if(typeof $==="undefined")return;if($===null)return null;let{type:X,createResponse:Q,create_response:J,eagerness:Y,interruptResponse:G,interrupt_response:W,prefixPaddingMs:K,prefix_padding_ms:V,silenceDurationMs:H,silence_duration_ms:U,threshold:q,idleTimeoutMs:w,idle_timeout_ms:D,modelVersion:z,model_version:N,...L}=$,O={type:X,create_response:Q??J,eagerness:Y,interrupt_response:G??W,prefix_padding_ms:K??V,silence_duration_ms:H??U,idle_timeout_ms:w??D,model_version:z??N,threshold:q,...L};return Object.keys(O).forEach((Z)=>{if(O[Z]===void 0)delete O[Z]}),Object.keys(O).length>0?O:void 0}set _tracingConfig($){this.#G=$}_updateTracingConfig($){if(typeof this.#G==="undefined")this.#G=null;if($==="auto"){this.sendEvent({type:"session.update",session:{type:"realtime",tracing:"auto"}});return}if(this.#G!==null&&typeof this.#G!=="string"&&typeof $!=="string"){J6.warn("Tracing config is already set, skipping setting it again. This likely happens when you already set a tracing config on session creation.");return}if($===null){J6.debug("Disabling tracing for this session. It cannot be turned on for this session from this point on."),this.sendEvent({type:"session.update",session:{type:"realtime",tracing:null}});return}if(this.#G===null||typeof this.#G==="string"){this.sendEvent({type:"session.update",session:{type:"realtime",tracing:$}});return}if($?.group_id!==this.#G?.group_id||$?.metadata!==this.#G?.metadata||$?.workflow_name!==this.#G?.workflow_name){J6.warn("Mismatch in tracing config. Ignoring the new tracing config. This likely happens when you already set a tracing config on session creation. Current tracing config: %s, new tracing config: %s",JSON.stringify(this.#G),JSON.stringify($));return}this.sendEvent({type:"session.update",session:{type:"realtime",tracing:$}})}updateSessionConfig($){let X=this.buildSessionPayload($);this.sendEvent({type:"session.update",session:X})}sendFunctionCallOutput($,X,Q=!0){this.sendEvent({type:"conversation.item.create",item:{type:"function_call_output",output:X,call_id:$.callId}});try{let J=yP.parse({itemId:$.id,previousItemId:$.previousItemId,type:"function_call",status:"completed",arguments:$.arguments,name:$.name,output:X});this.emit("item_update",J)}catch(J){J6.error("Error parsing tool call item",J,$)}if(Q)this.sendEvent({type:"response.create"})}sendAudio($,{commit:X=!1}={}){if(this.sendEvent({type:"input_audio_buffer.append",audio:_P($)}),X)this.sendEvent({type:"input_audio_buffer.commit"})}resetHistory($,X){let{removals:Q,additions:J,updates:Y}=Ad($,X),G=new Set(Q.map((K)=>K.itemId));for(let K of Y)G.add(K.itemId);if(G.size>0)for(let K of G)this.sendEvent({type:"conversation.item.delete",item_id:K});let W=[...J,...Y];for(let K of W)if(K.type==="message"){let V={type:"message",role:K.role,content:K.content,id:K.itemId};if(K.role!=="system"&&K.status)V.status=K.status;this.sendEvent({type:"conversation.item.create",item:V})}else if(K.type==="function_call")J6.warn("Function calls cannot be manually added or updated at the moment. Ignoring.")}sendMcpResponse($,X){this.sendEvent({type:"conversation.item.create",previous_item_id:$.itemId,item:{type:"mcp_approval_response",approval_request_id:$.itemId,approve:X}})}}class s3 extends P7{options;#$;#X={status:"disconnected",peerConnection:void 0,dataChannel:void 0,callId:void 0};#G;#Q=!1;#W=!1;#J;#K=0;constructor($={}){if(typeof RTCPeerConnection==="undefined")throw new Error("WebRTC is not supported in this environment");super($);this.options=$,this.#$=$.baseUrl??"https://api.openai.com/v1/realtime/calls",this.#G=$.useInsecureApiKey??!1}get callId(){return this.#X.callId}get status(){return this.#X.status}get connectionState(){return this.#X}get muted(){return this.#W}async connect($){if(this.#X.status==="connected")return;if(this.#X.status==="connecting"){if(this.#J)return this.#J;J6.warn("Realtime connection already in progress but no promise found");return}let X=$.model??this.currentModel;this.currentModel=X;let Q=$.url??this.#$,J=await this._getApiKey($),Y=typeof J==="string"&&J.startsWith("ek_");if(yJ()&&!this.#G&&!Y)throw new H$("Using the WebRTC connection in a browser environment requires an ephemeral client key. If you need to use a regular API key, use the WebSocket transport or set the `useInsecureApiKey` option to true.");let G=++this.#K;return this.#J=new Promise(async(W,K)=>{try{let V={...$.initialSessionConfig||{},model:this.currentModel},H=new URL(Q),U=new RTCPeerConnection,q=U.createDataChannel("oai-events"),w=void 0,D=(F)=>{F.onconnectionstatechange=()=>{switch(F.connectionState){case"disconnected":case"failed":case"closed":this.close();break}}};D(U),this.#X={status:"connecting",peerConnection:U,dataChannel:q,callId:w},this.emit("connection_change",this.#X.status),q.addEventListener("open",()=>{this.#X={status:"connecting",peerConnection:U,dataChannel:q,callId:w};let F=!1,M,A=()=>{if(F)return;if(F=!0,M!==void 0)clearTimeout(M);if(q.removeEventListener("message",P),q.removeEventListener("close",_),this.#X.status!=="connecting"||this.#X.dataChannel!==q||q.readyState!=="open"){if(this.#X.dataChannel===q)this.close();K(new Error("Connection closed before session config was acknowledged"));return}this.#X={status:"connected",peerConnection:U,dataChannel:q,callId:w},this.emit("connection_change",this.#X.status),this._onOpen(),W()},P=(I)=>{if(JSON.parse(I.data).type==="session.updated")A()},_=()=>{A()};M=setTimeout(()=>{if(!F)J6.warn("Timed out waiting for session.updated ack — resolving connect() anyway"),A()},5000),q.addEventListener("message",P),q.addEventListener("close",_),q.addEventListener("message",(I)=>{this._onMessage(I);let{data:c,isGeneric:J$}=t3(I);if(!c||J$)return;if(c.type==="response.created")this.#Q=!0;else if(c.type==="response.done")this.#Q=!1;if(c.type==="session.created"){this._tracingConfig=c.session.tracing;let U$=typeof V.tracing==="undefined"?"auto":V.tracing;this._updateTracingConfig(U$)}}),this.updateSessionConfig(V)}),q.addEventListener("error",(F)=>{this.close(),this._onError(F),K(F)});let z=this.options.audioElement??document.createElement("audio");z.autoplay=!0,U.ontrack=(F)=>{z.srcObject=F.streams[0]};let N=this.options.mediaStream??await navigator.mediaDevices.getUserMedia({audio:!0});if(U.addTrack(N.getAudioTracks()[0]),this.options.changePeerConnection){let F=U;if(U=await this.options.changePeerConnection(U),F!==U)F.onconnectionstatechange=null;D(U),this.#X={...this.#X,peerConnection:U}}let L=await U.createOffer();if(await U.setLocalDescription(L),!L.sdp)throw new Error("Failed to create offer");let O=await fetch(H,{method:"POST",body:L.sdp,headers:{"Content-Type":"application/sdp",Authorization:`Bearer ${J}`,"X-OpenAI-Agents-SDK":Kq["X-OpenAI-Agents-SDK"]}});w=O.headers?.get("Location")?.split("/").pop(),this.#X={...this.#X,callId:w};let Z={type:"answer",sdp:await O.text()};await U.setRemoteDescription(Z)}catch(V){this.close(),this._onError(V),K(V)}}).finally(()=>{if(this.#K===G)this.#J=void 0}),this.#J}sendEvent($){if(!this.#X.dataChannel||this.#X.dataChannel.readyState!=="open")throw new Error("WebRTC data channel is not connected. Make sure you call `connect()` before sending events.");this.#X.dataChannel.send(JSON.stringify($))}mute($){if(this.#W=$,this.#X.peerConnection)this.#X.peerConnection.getSenders().forEach((Q)=>{if(Q.track)Q.track.enabled=!$})}_afterAudioDoneEvent(){this.#Q=!1}close(){if(this.#X.dataChannel)this.#X.dataChannel.close();if(this.#X.peerConnection){let $=this.#X.peerConnection;$.onconnectionstatechange=null,$.getSenders().forEach((X)=>{X.track?.stop()}),$.close()}if(this.#X.status!=="disconnected")this.#X={status:"disconnected",peerConnection:void 0,dataChannel:void 0,callId:void 0},this.emit("connection_change",this.#X.status),this._onClose()}interrupt(){if(this.#Q)this.sendEvent({type:"response.cancel"}),this.#Q=!1;this.sendEvent({type:"output_audio_buffer.clear"})}}function kd(){return!1}var Sd=!1;class hG extends P7{#$;#X;#G;#Q={status:"disconnected",websocket:void 0};#W;#J;#K;_firstAudioTimestamp;_audioLengthMs=0;#Y=!1;#V;#U;#H(){this.#J=void 0,this._firstAudioTimestamp=void 0,this._audioLengthMs=0,this.#K=void 0}constructor($={}){super($);this.#X=$.url,this.#G=$.url,this.#W=$.useInsecureApiKey??!1,this.#V=$.createWebSocket,this.#U=$.skipOpenEventListeners??!1}getCommonRequestHeaders(){return Kq}get status(){return this.#Q.status}get connectionState(){return this.#Q}get muted(){return null}get currentItemId(){return this.#J}_onAudio($){this.emit("audio",$)}_afterAudioDoneEvent(){this.#H()}async#q($,X,Q){if(this.#Q.websocket){$();return}if(!this.#$)throw new H$("API key is not set. Please call `connect()` with an API key first.");if(kd()&&!this.#$.startsWith("ek_")&&!this.#W)throw new H$("Using the WebSocket connection in a browser environment requires an ephemeral client key. If you have to use a regular API key, set the `useInsecureApiKey` option to true.");let J=null;if(this.#V)J=await this.#V({url:this.#X,apiKey:this.#$});else{let G=Sd?["realtime","openai-insecure-api-key."+this.#$,vd]:{headers:{Authorization:`Bearer ${this.#$}`,...this.getCommonRequestHeaders()}};J=new m7.default(this.#X,G)}this.#Q={status:"connecting",websocket:J},this.emit("connection_change",this.#Q.status);let Y=()=>{this.#Q={status:"connected",websocket:J},this.emit("connection_change",this.#Q.status),this._onOpen(),$()};if(this.#U===!0)Y();else J.addEventListener("open",Y);J.addEventListener("error",(G)=>{this._onError(G),this.#Q={status:"disconnected",websocket:void 0},this.emit("connection_change",this.#Q.status),X(G)}),J.addEventListener("message",(G)=>{this._onMessage(G);let{data:W,isGeneric:K}=t3(G);if(!W||K)return;if(W.type==="response.output_audio.delta"){if(this.#K=W.content_index,this.#J=W.item_id,this._firstAudioTimestamp===void 0)this._firstAudioTimestamp=Date.now(),this._audioLengthMs=0;let V=EP(W.delta),H=this._rawSessionConfig?.audio?.output?.format;if(H&&typeof H==="object"){let q=H.type;if(q==="audio/pcmu"||q==="audio/pcma")this._audioLengthMs+=V.byteLength/8;else if(q==="audio/pcm"){let w=H.rate??24000;this._audioLengthMs+=V.byteLength/2/w*1000}else this._audioLengthMs+=V.byteLength/24/2}else if(typeof H==="string")if(H.startsWith("g711_"))this._audioLengthMs+=V.byteLength/8;else this._audioLengthMs+=V.byteLength/24/2;else this._audioLengthMs+=V.byteLength/24/2;let U={type:"audio",data:V,responseId:W.response_id};this._onAudio(U)}else if(W.type==="input_audio_buffer.speech_started"){let V=this._rawSessionConfig?.audio?.input?.turn_detection?.interrupt_response??!1;this.interrupt(!V)}else if(W.type==="response.created")this.#Y=!0;else if(W.type==="response.done")this.#Y=!1;else if(W.type==="session.created"){this._tracingConfig=W.session.tracing;let V=typeof Q.tracing==="undefined"?"auto":Q.tracing;this._updateTracingConfig(V)}}),J.addEventListener("close",()=>{this.#Q={status:"disconnected",websocket:void 0},this.emit("connection_change",this.#Q.status),this._onClose()})}async connect($){let X=$.model??this.currentModel;this.currentModel=X,this.#$=await this._getApiKey($);let Q=$.callId,J;if($.url)J=$.url,this.#G=$.url;else if(Q)J=`wss://api.openai.com/v1/realtime?call_id=${Q}`;else if(this.#G)J=this.#G;else J=`wss://api.openai.com/v1/realtime?model=${this.currentModel}`;this.#X=J;let Y={...$.initialSessionConfig||{},model:this.currentModel};await new Promise((G,W)=>{this.#q(G,W,Y).catch(W)}),await this.updateSessionConfig(Y)}sendEvent($){if(!this.#Q.websocket)throw new Error("WebSocket is not connected. Make sure you call `connect()` before sending events.");this.#Q.websocket.send(JSON.stringify($))}close(){this.#Q.websocket?.close(),this.#J=void 0,this._firstAudioTimestamp=void 0,this._audioLengthMs=0,this.#K=void 0}mute($){throw new Error("Mute is not supported for the WebSocket transport. You have to mute the audio input yourself.")}sendAudio($,X={}){if(this.#Q.status==="connected")super.sendAudio($,X)}_cancelResponse(){if(this.#Y)this.sendEvent({type:"response.cancel"}),this.#Y=!1}_interrupt($,X=!0){if($<0)return;if(X)this._cancelResponse();let Q=this._audioLengthMs??Number.POSITIVE_INFINITY,J=Math.max(0,Math.floor(Math.min($,Q)));this.emit("audio_interrupted"),this.sendEvent({type:"conversation.item.truncate",item_id:this.#J,content_index:this.#K,audio_end_ms:J})}interrupt($=!0){if(!this.#J||typeof this._firstAudioTimestamp!=="number")return;let X=Date.now()-this._firstAudioTimestamp;if(X>=0)this._interrupt(X,$);this.#H()}}var SB$=Symbol("backgroundResult");function hP($){return typeof $==="object"&&$!==null&&SB$ in $}function Cd($){return $.type==="function"||$.type==="hosted_tool"&&$.name==="hosted_mcp"}function yd($){if($.type==="function")return $;if($.type==="hosted_tool"&&$.name==="hosted_mcp"){let X=$.providerData.server_url&&$.providerData.server_url.length>0?$.providerData.server_url:void 0;return{type:"mcp",server_label:$.providerData.server_label,server_url:X,headers:$.providerData.headers,allowed_tools:$.providerData.allowed_tools,require_approval:$.providerData.require_approval}}throw new H$(`Invalid tool type: ${$}`)}function CB$(){return JSON.parse(JSON.stringify(X0))}var uP="Tool execution was not approved.";function yB$($){return $ instanceof Error?$.message:String($)}class e3 extends H8.EventEmitter{initialAgent;options;#$;#X;#G;#Q;#W=[];#J;#K={};#Y=[];#V;#U={};#H=!1;#q=new Map;#B=[];#z=CB$();#N=!0;#w=!1;constructor($,X={}){super();if(this.initialAgent=$,this.options=X,typeof X.transport==="undefined"&&jd()||X.transport==="webrtc")this.#$=new s3;else if(X.transport==="websocket"||typeof X.transport==="undefined")this.#$=new hG;else this.#$=X.transport;this.#X=$,this.#Q=new N6({...X.context??{},history:this.#Y}),this.#W=(X.outputGuardrails??[]).map(bd),this.#J=xd(X.outputGuardrailSettings??{}),this.#V=X.historyStoreAudio??!1,this.#N=X.automaticallyTriggerResponseForMcpToolCalls??!0}get transport(){return this.#$}get currentAgent(){return this.#X}get usage(){return this.#Q.usage}get context(){return this.#Q}get muted(){return this.#$.muted}get history(){return this.#Y}get availableMcpTools(){return this.#B}async#D($){this.#X=$;let X=await this.#X.getEnabledHandoffs(this.#Q),Q=X.map((W)=>W.getHandoffAsFunctionTool()),J=(await this.#X.getAllTools(this.#Q)).filter(Cd).map(yd),Y=typeof this.#X.tools!=="undefined"||typeof this.#X.mcpServers!=="undefined",G=X.length>0;this.#G=Y||G?[...J,...Q]:void 0,this.#Z()}async#L($={}){let X=$??{},Q=this.options.config??{},J=await this.#X.getSystemPrompt(this.#Q),Y=(q)=>{return q.audio?.output?.voice},G=this.options.tracingDisabled?null:this.options.workflowName?{workflow_name:this.options.workflowName}:"auto";if(G!==null&&G!=="auto"){if(this.options.groupId)G.group_id=this.options.groupId;if(this.options.traceMetadata)G.metadata=this.options.traceMetadata}else if(this.options.groupId||this.options.traceMetadata)J6.warn("In order to set traceMetadata or a groupId you need to specify a workflowName.");let W=Y(X)??Y(Q),K=X.voice??Q.voice,V=typeof W!=="undefined"?W:typeof K!=="undefined"?K:this.#X.voice,U={...{...this.#z??{},...Q,...X},instructions:J,voice:V,model:this.options.model,tools:this.#G,tracing:G,prompt:typeof this.#X.prompt==="function"?await this.#X.prompt(this.#Q,this.#X):this.#X.prompt};return this.#z=U,U}async getInitialSessionConfig($={}){return await this.#D(this.initialAgent),this.#L({...this.options.config??{},...$??{}})}static async computeInitialSessionConfig($,X={},Q={}){let J=new e3($,X);try{return await J.getInitialSessionConfig(Q)}finally{J.close()}}async updateAgent($){return this.#X.emit("agent_handoff",this.#Q,$),this.emit("agent_handoff",this.#Q,this.#X,$),await this.#D($),await this.#$.updateSessionConfig(await this.#L()),$}async#M($,X){let Q=await X.onInvokeHandoff(this.#Q,$.arguments);this.#X.emit("agent_handoff",this.#Q,Q),this.emit("agent_handoff",this.#Q,this.#X,Q),await this.#D(Q),await this.#$.updateSessionConfig(await this.#L());let J=_G(Q);return this.#$.sendFunctionCallOutput($,J,!0),Q}async#A($,X){let{toolErrorFormatter:Q}=this.options;if(!Q)return uP;try{let J=await Q({kind:"approval_rejected",toolType:"function",toolName:$,callId:X,defaultMessage:uP,runContext:this.#Q});if(typeof J==="string")return J;if(typeof J!=="undefined")J6.warn("toolErrorFormatter returned a non-string value. Falling back to the default tool approval rejection message.")}catch(J){J6.warn(`toolErrorFormatter threw while formatting approval rejection: ${yB$(J)}`)}return uP}async#F($,X){this.#Q.context.history=JSON.parse(JSON.stringify(this.#Y));let Q=$.arguments;if(X.parameters)if(l6(X.parameters))Q=X.parameters.parse(Q);else Q=JSON.parse(Q);if(await X.needsApproval(this.#Q,Q,$.callId)){let V=this.context.isToolApproved({toolName:X.name,callId:$.callId});if(V===!1){this.emit("agent_tool_start",this.#Q,this.#X,X,{toolCall:$}),this.#X.emit("agent_tool_start",this.#Q,X,{toolCall:$});let H=await this.#A(X.name,$.callId);this.#$.sendFunctionCallOutput($,H,!0),this.emit("agent_tool_end",this.#Q,this.#X,X,H,{toolCall:$}),this.#X.emit("agent_tool_end",this.#Q,X,H,{toolCall:$});return}else if(typeof V==="undefined"){this.emit("tool_approval_requested",this.#Q,this.#X,{type:"function_approval",tool:X,approvalItem:new i$($,this.#X)});return}}let Y=await SG({guardrails:X.inputGuardrails,context:this.#Q,agent:this.#X,toolCall:$});this.emit("agent_tool_start",this.#Q,this.#X,X,{toolCall:$}),this.#X.emit("agent_tool_start",this.#Q,X,{toolCall:$}),this.#Q.context.history=JSON.parse(JSON.stringify(this.#Y));let G=Y.type==="reject"?Y.message:await uJ({tool:X,runContext:this.#Q,input:$.arguments,details:{toolCall:$}}),W=Y.type==="reject"?G:await CG({guardrails:X.outputGuardrails,context:this.#Q,agent:this.#X,toolCall:$,toolOutput:G}),K;if(hP(W))K=E1(W.content),this.#$.sendFunctionCallOutput($,K,!1);else K=E1(W),this.#$.sendFunctionCallOutput($,K,!0);this.emit("agent_tool_end",this.#Q,this.#X,X,K,{toolCall:$}),this.#X.emit("agent_tool_end",this.#Q,X,K,{toolCall:$})}async#j($){let X=await this.#X.getEnabledHandoffs(this.#Q),Q=new Map(X.map((W)=>[W.toolName,W])),J=await this.#X.getAllTools(this.#Q),Y=new Map(J.map((W)=>[W.name,W])),G=Q.get($.name);if(G)await this.#M($,G);else{let W=Y.get($.name);if(W&&W.type==="function")await this.#F($,W);else throw new b4(`Tool ${$.name} not found`)}}async#O($,X,Q){if(this.#W.length===0)return;let J={agent:this.#X,agentOutput:$,context:this.#Q},G=(await Promise.all(this.#W.map((W)=>W.run(J)))).find((W)=>W.output.tripwireTriggered);if(G){if(this.#U[X])return;this.#U[X]=!0;let W=new u9(`Output guardrail triggered: ${JSON.stringify(G.output.outputInfo)}`,G);this.emit("guardrail_tripped",this.#Q,this.#X,W,{itemId:Q}),this.interrupt();let K=Id(G);this.sendMessage(K);return}}#v(){this.#$.on("*",(Q)=>{if(this.emit("transport_event",Q),Q.type==="conversation.item.input_audio_transcription.completed")try{let J=Q;this.#Y=kP(this.#Y,J,this.#V),this.#Q.context.history=this.#Y,this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("mcp_tools_listed",({serverLabel:Q,tools:J})=>{try{this.#q.set(Q,J??[]),this.#Z()}catch(Y){this.emit("error",{type:"error",error:Y})}}),this.#$.on("audio",(Q)=>{if(!this.#H)this.#H=!0,this.emit("audio_start",this.#Q,this.#X);this.emit("audio",Q)}),this.#$.on("turn_started",()=>{this.#H=!1,this.emit("agent_start",this.#Q,this.#X),this.#X.emit("agent_start",this.#Q,this.#X)}),this.#$.on("turn_done",(Q)=>{let J=Q.response.output??[],Y="",G="";for(let W=J.length-1;W>=0;W--){let K=J[W],V=TP(K);if(typeof V==="string"){Y=V;let H=K?.id;G=typeof H==="string"?H:"";break}}if(!G&&J.length>0){let W=J[J.length-1];G=typeof W?.id==="string"?W.id:""}this.emit("agent_end",this.#Q,this.#X,Y),this.#X.emit("agent_end",this.#Q,Y),this.#O(Y,Q.response.id,G)}),this.#$.on("audio_done",()=>{if(this.#H)this.#H=!1;this.emit("audio_stopped",this.#Q,this.#X)});let $=0,X;this.#$.on("audio_transcript_delta",(Q)=>{try{let{delta:J,itemId:Y,responseId:G}=Q;if(X!==Y)X=Y,$=0;let K=(this.#K[Y]??"")+J;if(this.#K[Y]=K,this.#J.debounceTextLength<0)return;let V=Math.floor(K.length/this.#J.debounceTextLength);if(V>$)$=V,this.#O(K,G,Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("item_update",(Q)=>{try{let J=!this.#Y.some((Y)=>Y.itemId===Q.itemId);if(this.#Y=kP(this.#Y,Q,this.#V),this.#Q.context.history=this.#Y,J){let Y=this.#Y.find((G)=>G.itemId===Q.itemId);if(Y)this.emit("history_added",Y)}this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("item_deleted",(Q)=>{try{this.#Y=this.#Y.filter((J)=>J.itemId!==Q.itemId),this.#Q.context.history=this.#Y,this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("function_call",async(Q)=>{try{await this.#j(Q)}catch(J){J6.error("Error handling function call",J),this.emit("error",{type:"error",error:J})}}),this.#$.on("usage_update",(Q)=>{this.#Q.usage.add(Q)}),this.#$.on("audio_interrupted",()=>{if(this.#H)this.#H=!1;this.emit("audio_interrupted",this.#Q,this.#X)}),this.#$.on("error",(Q)=>{this.emit("error",Q)}),this.#$.on("mcp_tool_call_completed",(Q)=>{if(this.emit("mcp_tool_call_completed",this.#Q,this.#X,Q),this.#N)this.#$.sendEvent({type:"response.create"})}),this.#$.on("mcp_approval_request",(Q)=>{this.emit("tool_approval_requested",this.#Q,this.#X,{type:"mcp_approval_request",approvalItem:Pd(this.#X,Q)})})}#Z(){let $=this.#G?.filter((W)=>W.type==="mcp"),X=(W)=>{let K=W.allowed_tools;if(!K)return;if(Array.isArray(K))return K;if(K&&Array.isArray(K.tool_names))return K.tool_names;return},Q=new Map;for(let W of $){let K=this.#q.get(W.server_label)??[],V=X(W);for(let H of K){if(V&&!V.includes(H.name))continue;if(!Q.has(H.name))Q.set(H.name,H)}}let J=Array.from(Q.values()),Y=this.#B;if(Y.length!==J.length||JSON.stringify(Y.map((W)=>W.name).sort())!==JSON.stringify(J.map((W)=>W.name).sort()))this.#B=J,this.emit("mcp_tools_changed",this.#B)}async connect($){if(await this.#D(this.initialAgent),!this.#w)this.#v(),this.#w=!0;await this.#$.connect({apiKey:$.apiKey??this.options.apiKey,model:this.options.model,url:$.url,callId:$.callId,initialSessionConfig:await this.#L(this.options.config)}),this.#Y=[],this.emit("history_updated",this.#Y)}updateHistory($){let X;if(typeof $==="function")X=$(this.#Y);else X=$;this.#$.resetHistory(this.#Y,X)}sendMessage($,X={}){this.#$.sendMessage($,X)}addImage($,{triggerResponse:X=!0}={}){this.#$.addImage($,{triggerResponse:X})}mute($){this.#$.mute($)}close(){this.#U={},this.#$.close()}sendAudio($,X={}){this.#$.sendAudio($,X)}interrupt(){this.#$.interrupt()}async approve($,X={alwaysApprove:!1}){this.#Q.approveTool($,X);let Q=$.toolName??$.rawItem.name,J=this.#X.tools.find((Y)=>Y.name===Q);if(J&&J.type==="function"&&$.rawItem.type==="function_call")await this.#F($.rawItem,J);else if($.rawItem.type==="hosted_tool_call"){if(X.alwaysApprove)J6.warn("Always approving MCP tools is not supported. Use the allowed tools configuration instead.");let Y=SP($);this.#$.sendMcpResponse(Y,!0)}else throw new b4(`Tool ${Q??"unknown"} not found`)}async reject($,X={alwaysReject:!1}){this.#Q.rejectTool($,X);let Q=$.toolName??$.rawItem.name,J=this.#X.tools.find((Y)=>Y.name===Q);if(J&&J.type==="function"&&$.rawItem.type==="function_call")await this.#F($.rawItem,J);else if($.rawItem.type==="hosted_tool_call"){if(X.alwaysReject)J6.warn("Always rejecting MCP tools is not supported. Use the allowed tools configuration instead.");let Y=SP($);this.#$.sendMcpResponse(Y,!1)}else throw new b4(`Tool ${Q??"unknown"} not found`)}}X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();var fB$=class{apply($,X){if(!X.type)return;let Q=Array.isArray(X.type)?X.type:[X.type],J=new Set(Q);if(!J.has("string"))$.string=!1;if(!J.has("number")&&!J.has("integer"))$.number=!1;if(!J.has("boolean"))$.boolean=!1;if(!J.has("null"))$.null=!1;if(!J.has("array"))$.array=!1;if(!J.has("object"))$.object=!1;if(J.has("integer")&&$.number!==!1){let Y=$.number||B.number();if(Y instanceof B.ZodNumber)$.number=Y.int()}}},gB$=class{apply($,X){if(X.const===void 0)return;let Q=X.const;if($.string=!1,$.number=!1,$.boolean=!1,$.null=!1,$.array=!1,$.object=!1,typeof Q==="string")$.string=B.literal(Q);else if(typeof Q==="number")$.number=B.literal(Q);else if(typeof Q==="boolean")$.boolean=B.literal(Q);else if(Q===null)$.null=B.null();else if(Array.isArray(Q))$.array=void 0;else if(typeof Q==="object")$.object=void 0}},hB$=class{apply($,X){if(!X.enum)return;if(X.enum.length===0){if(!X.type)$.string=!1,$.number=!1,$.boolean=!1,$.null=!1,$.array=!1,$.object=!1;return}let Q={string:X.enum.filter((J)=>typeof J==="string"),number:X.enum.filter((J)=>typeof J==="number"),boolean:X.enum.filter((J)=>typeof J==="boolean"),null:X.enum.filter((J)=>J===null),array:X.enum.filter((J)=>Array.isArray(J)),object:X.enum.filter((J)=>typeof J==="object"&&J!==null&&!Array.isArray(J))};$.string=this.createTypeSchema(Q.string,"string"),$.number=this.createTypeSchema(Q.number,"number"),$.boolean=this.createTypeSchema(Q.boolean,"boolean"),$.null=Q.null.length>0?B.null():!1,$.array=Q.array.length>0?void 0:!1,$.object=Q.object.length>0?void 0:!1}createTypeSchema($,X){if($.length===0)return!1;if($.length===1)return B.literal($[0]);if(X==="string")return B.enum($);if(X==="number"){let[Q,J,...Y]=$;return B.union([B.literal(Q),B.literal(J),...Y.map((G)=>B.literal(G))])}if(X==="boolean")return B.union([B.literal(!0),B.literal(!1)]);return!1}},uB$=class{apply($,X){let Q=X;if(Q.type==="string"&&Q.format==="binary"&&Q.contentEncoding==="binary"){let J=B.file();if(Q.minLength!==void 0)J=J.min(Q.minLength);if(Q.maxLength!==void 0)J=J.max(Q.maxLength);if(Q.contentMediaType!==void 0)J=J.mime(Q.contentMediaType);$.file=J,$.string=!1}}},mB$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.minLength!==void 0||Q.maxLength!==void 0||Q.pattern!==void 0)){if($.string===void 0)$.string=B.string()}}},cB$=class{apply($,X){let Q=X;if(Q.minLength===void 0)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString)$.string=J.refine((Y)=>{return Array.from(Y).length>=Q.minLength},{message:`String must be at least ${Q.minLength} characters long`})}}},iB$=class{apply($,X){let Q=X;if(Q.maxLength===void 0)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString)$.string=J.refine((Y)=>{return Array.from(Y).length<=Q.maxLength},{message:`String must be at most ${Q.maxLength} characters long`})}}},lB$=class{apply($,X){let Q=X;if(!Q.pattern)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString){let Y=new RegExp(Q.pattern);$.string=J.regex(Y)}}}},pB$=class{apply($,X){let Q=X;if(Q.minimum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.min(Q.minimum)}}},nB$=class{apply($,X){let Q=X;if(Q.maximum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.max(Q.maximum)}}},dB$=class{apply($,X){let Q=X;if(Q.exclusiveMinimum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)if(typeof Q.exclusiveMinimum==="number")$.number=J.gt(Q.exclusiveMinimum);else $.number=!1}}},aB$=class{apply($,X){let Q=X;if(Q.exclusiveMaximum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)if(typeof Q.exclusiveMaximum==="number")$.number=J.lt(Q.exclusiveMaximum);else $.number=!1}}},oB$=class{apply($,X){let Q=X;if(Q.multipleOf===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.refine((Y)=>{if(Q.multipleOf===0)return!1;let G=Y/Q.multipleOf,W=Math.round(G),K=Math.min(Math.abs(Y)*Number.EPSILON*10,Math.abs(Q.multipleOf)*Number.EPSILON*10);return Math.abs(G-W)<=K/Math.abs(Q.multipleOf)},{message:`Must be a multiple of ${Q.multipleOf}`})}}},rB$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.minItems!==void 0||Q.maxItems!==void 0||Q.items!==void 0||Q.prefixItems!==void 0)){if($.array===void 0)$.array=B.array(B.any())}}},tB$=class{apply($,X){let Q=X;if(Q.minItems===void 0)return;if($.array!==!1)$.array=($.array||B.array(B.any())).min(Q.minItems)}},sB$=class{apply($,X){let Q=X;if(Q.maxItems===void 0)return;if($.array!==!1)$.array=($.array||B.array(B.any())).max(Q.maxItems)}},eB$=class{apply($,X){let Q=X;if($.array===!1)return;if(Array.isArray(Q.items))$.array=$.array||B.array(B.any());else if(Q.items&&typeof Q.items!=="boolean"&&!Q.prefixItems){let J=v6(Q.items),Y=B.array(J);if($.array&&$.array instanceof B.ZodArray){let G=$.array._def;if(G.checks)G.checks.forEach((W)=>{if(W._zod&&W._zod.def){let K=W._zod.def;if(K.check==="min_length"&&K.minimum!==void 0)Y=Y.min(K.minimum);else if(K.check==="max_length"&&K.maximum!==void 0)Y=Y.max(K.maximum)}})}$.array=Y}else if(typeof Q.items==="boolean"&&Q.items===!1)if(!Q.prefixItems)$.array=B.array(B.any()).max(0);else $.array=$.array||B.array(B.any());else if(typeof Q.items==="boolean"&&Q.items===!0)$.array=$.array||B.array(B.any());else if(Q.prefixItems)$.array=$.array||B.array(B.any())}},$q$=class{apply($,X){if(X.type!=="array")return;let Q=X;if(!Array.isArray(Q.items))return;if($.array===!1)return;let J=Q.items.map((G)=>v6(G)),Y;if(J.length===0)Y=B.tuple([]);else Y=B.tuple(J);if(Q.minItems!==void 0&&Q.minItems>J.length)Y=!1;if(Q.maxItems!==void 0&&Q.maxItems<J.length)Y=!1;$.tuple=Y,$.array=!1}},Xq$=class{apply($,X){let Q=X;if($.object===!1)return;if(Q.properties||Q.required||Q.additionalProperties!==void 0)$.object=$.object||B.object({}).passthrough()}},Qq$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.maxProperties!==void 0||Q.minProperties!==void 0)){if($.object===void 0)$.object=B.object({}).passthrough()}}},Yq$=class{apply($,X){let Q=X;if(Q.maxProperties===void 0)return;if($.object!==!1){let J=$.object||B.object({}).passthrough();$.object=J.refine((Y)=>Object.keys(Y).length<=Q.maxProperties,{message:`Object must have at most ${Q.maxProperties} properties`})}}},Jq$=class{apply($,X){let Q=X;if(Q.minProperties===void 0)return;if($.object!==!1){let J=$.object||B.object({}).passthrough();$.object=J.refine((Y)=>Object.keys(Y).length>=Q.minProperties,{message:`Object must have at least ${Q.minProperties} properties`})}}};function uG($,X){if($===X)return!0;if($==null||X==null)return $===X;if(typeof $!==typeof X)return!1;if(Array.isArray($)&&Array.isArray(X)){if($.length!==X.length)return!1;return $.every((Q,J)=>uG(Q,X[J]))}if(typeof $==="object"&&typeof X==="object"){let Q=Object.keys($),J=Object.keys(X);if(Q.length!==J.length)return!1;return Q.every((Y)=>J.includes(Y)&&uG($[Y],X[Y]))}return!1}function Gq$(){return($)=>{if(!Array.isArray($))return!0;let X=[];return $.every((Q)=>{if(X.some((Y)=>uG(Q,Y)))return!1;return X.push(Q),!0})}}function Uq($,X){return $.safeParse(X).success}var Wq$=class{apply($,X){if(!X.not)return $;let Q=v6(X.not);return $.refine((J)=>!Uq(Q,J),{message:"Value must not match the 'not' schema"})}},Kq$=class{apply($,X){if(X.uniqueItems!==!0)return $;return $.refine(Gq$(),{message:"Array items must be unique"})}},Vq$=class{apply($,X){if(!X.allOf||X.allOf.length===0)return $;return X.allOf.map((J)=>v6(J)).reduce((J,Y)=>B.intersection(J,Y),$)}},Hq$=class{apply($,X){if(!X.anyOf||X.anyOf.length===0)return $;let Q=X.anyOf.length===1?v6(X.anyOf[0]):B.union([v6(X.anyOf[0]),v6(X.anyOf[1]),...X.anyOf.slice(2).map((J)=>v6(J))]);return B.intersection($,Q)}},Uq$=class{apply($,X){if(!X.oneOf||X.oneOf.length===0)return $;let Q=X.oneOf.map((J)=>v6(J));return $.refine((J)=>{let Y=0;for(let G of Q)if(G.safeParse(J).success){if(Y++,Y>1)return!1}return Y===1},{message:"Value must match exactly one of the oneOf schemas"})}},Bq$=class{apply($,X){let Q=X;if(Q.prefixItems&&Array.isArray(Q.prefixItems)){let Y=Q.prefixItems.map((G)=>v6(G));return $.refine((G)=>{if(!Array.isArray(G))return!0;for(let W=0;W<Math.min(G.length,Y.length);W++)if(!Uq(Y[W],G[W]))return!1;if(G.length>Y.length){if(typeof Q.items==="boolean"&&Q.items===!1)return!1;else if(Q.items&&typeof Q.items==="object"&&!Array.isArray(Q.items)){let W=v6(Q.items);for(let K=Y.length;K<G.length;K++)if(!Uq(W,G[K]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return $}},qq$=class{apply($,X){let Q=X;if(!Q.properties&&!Q.required&&Q.additionalProperties!==!1)return $;if($ instanceof B.ZodObject||$ instanceof B.ZodRecord){let J={};if(Q.properties){for(let[Y,G]of Object.entries(Q.properties))if(G!==void 0)J[Y]=v6(G)}if(Q.required&&Array.isArray(Q.required)){let Y=new Set(Q.required);for(let G of Object.keys(J))if(!Y.has(G))J[G]=J[G].optional()}else for(let Y of Object.keys(J))J[Y]=J[Y].optional();if(Q.additionalProperties===!1)return B.object(J);else return B.object(J).passthrough()}return $.refine((J)=>{if(typeof J!=="object"||J===null||Array.isArray(J))return!0;if(Q.properties){for(let[Y,G]of Object.entries(Q.properties))if(G!==void 0){if(Object.getOwnPropertyDescriptor(J,Y)!==void 0){if(!v6(G).safeParse(J[Y]).success)return!1}}}if(Q.required&&Array.isArray(Q.required)){for(let Y of Q.required)if(Object.getOwnPropertyDescriptor(J,Y)===void 0)return!1}if(Q.additionalProperties===!1&&Q.properties){let Y=new Set(Object.keys(Q.properties));for(let G in J)if(!Y.has(G))return!1}return!0},{message:"Object constraints validation failed"})}},wq$=class{apply($,X){if(!X.enum||X.enum.length===0)return $;let Q=X.enum.filter((J)=>Array.isArray(J)||typeof J==="object"&&J!==null);if(Q.length===0)return $;return $.refine((J)=>{if(typeof J!=="object"||J===null)return!0;return Q.some((Y)=>uG(J,Y))},{message:"Value must match one of the enum values"})}},zq$=class{apply($,X){if(X.const===void 0)return $;let Q=X.const;if(typeof Q!=="object"||Q===null)return $;return $.refine((J)=>uG(J,Q),{message:"Value must equal the const value"})}},Nq$=class{apply($,X){if(X.description)$=$.describe(X.description);return $}},Dq$=class{apply($,X){var Q;let J=X;if(!((Q=J.required)==null?void 0:Q.includes("__proto__"))||X.type!==void 0)return $;return B.any().refine((Y)=>this.validateRequired(Y,J.required),{message:"Missing required properties"})}validateRequired($,X){if(typeof $!=="object"||$===null||Array.isArray($))return!0;return X.every((Q)=>Object.prototype.hasOwnProperty.call($,Q))}},Lq$=class{apply($,X){var Q;let J=X;if(J.contains===void 0)return $;let Y=v6(J.contains),G=(Q=J.minContains)!=null?Q:1,W=J.maxContains;return $.refine((K)=>{if(!Array.isArray(K))return!0;let V=0;for(let H of K)if(Uq(Y,H))V++;if(V<G)return!1;if(W!==void 0&&V>W)return!1;return!0},{message:"Array must contain required items matching the schema"})}},Fq$=class{apply($,X){let{default:Q}=X;if(Q===void 0)return $;if(!$.safeParse(Q).success)return $;return $.default(Q)}},Oq$=[new gB$,new hB$,new fB$,new uB$,new mB$,new rB$,new Qq$,new cB$,new iB$,new lB$,new pB$,new nB$,new dB$,new aB$,new oB$,new $q$,new tB$,new sB$,new eB$,new Yq$,new Jq$,new Xq$],Zq$=[new Dq$,new wq$,new zq$,new Vq$,new Hq$,new Uq$,new Bq$,new qq$,new Lq$,new Wq$,new Kq$,new Fq$,new Nq$];function v6($){if(typeof $==="boolean")return $?B.any():B.never();let X={};for(let Y of Oq$)Y.apply(X,$);let Q=[];if(X.string!==!1)Q.push(X.string||B.string());if(X.number!==!1)Q.push(X.number||B.number());if(X.boolean!==!1)Q.push(X.boolean||B.boolean());if(X.null!==!1)Q.push(X.null||B.null());if(X.array!==!1)Q.push(X.array||B.array(B.any()));if(X.tuple!==!1&&X.tuple!==void 0)Q.push(X.tuple);if(X.object!==!1)if(X.object)Q.push(X.object);else{let Y=B.custom((G)=>{return typeof G==="object"&&G!==null&&!Array.isArray(G)},"Must be an object, not an array");Q.push(Y)}if(X.file!==!1&&X.file!==void 0)Q.push(X.file);let J;if(Q.length===0)J=B.never();else if(Q.length===1)J=Q[0];else if(!Object.keys($).some((G)=>G!=="$schema"&&G!=="title"&&G!=="description"))J=B.any();else J=B.union(Q);for(let Y of Zq$)J=Y.apply(J,$);return J}var H5=require("react/jsx-runtime"),Mq$=({data:$,setUiAjaxConfiguration:X})=>{let{name:Q,titles:J,instructions:Y,tools:G,token:W,autoStart:K,muted:V,language:H,outputModalities:U,sxMap:q,iconUrl:w,iconPosition:D,useSocketioSupport:z,useCentrifugeSupport:N,useMittSupport:L,centrifugeChannel:O}=$,{apiServer:Z,enableRenderingLog:F}=s8(),[M,A]=P6.useState(null),[P,_]=P6.useState(null),[I,c]=P6.useState(null),[J$,U$]=P6.useState(!1),[I$,t]=P6.useState([]),[,R$]=P6.useState(null),T$=P6.useRef(null),g=P6.useMemo(()=>{return G.map((m)=>{let B$=Dz(X??(()=>{}),m.kwargs,m.depsNames,m.pathname,{apiServer:Z,renderingLogEnabled:F});return u8({name:m.name,description:m.description,parameters:v6(m.params),async execute(w4){console.log(`Calling tool: ${m.name} with: ${JSON.stringify(w4)}`);let N$=await B$(w4);if(!Array.isArray(N$))return[];return N$.filter((O$)=>O$.name===`pietoolOutput_${Q}`).map((O$)=>O$.data.output)}})})},[G,X]),r=()=>{if(console.log("Disconnecting session..."),P)P.close();_(null),A(null),U$(!1)},K$=async(m)=>{if(!P){console.error("Session not initialized");return}if(J$){console.log("Already connected, skipping...");return}try{P.on("history_updated",(B$)=>{t(B$)}),console.log("Connecting to session..."),R$(null),await P.connect({apiKey:m}),U$(!0),console.log("Connected successfully")}catch(B$){console.error("Failed to connect to session:",B$),R$(B$ instanceof Error?B$.message:"Failed to connect"),U$(!1)}};return P6.useEffect(()=>{if(!T$.current)return;if(!I)navigator.mediaDevices.getUserMedia({audio:!0}).then(async(m)=>{c(new s3({mediaStream:m,audioElement:T$.current}))})},[T$]),P6.useEffect(()=>{if(!T$.current)return;if(!I)return;if(M===null||P===null){let m=new Vq({name:Q,instructions:Y,tools:g}),B$=new e3(m,{model:"gpt-realtime",transport:I,config:{outputModalities:U,audio:{input:{transcription:{language:H??void 0,model:"gpt-4o-mini-transcribe"}}},inputAudioTranscription:{language:H??void 0,model:"gpt-4o-mini-transcribe"}}});A(m),_(B$)}},[M,P,Q,Y,g,T$,I]),P6.useEffect(()=>{if(M!==null&&P!==null&&K&&W&&!J$)console.log("Auto-connecting..."),K$(W).catch((m)=>{console.error("Auto-connection failed:",m)})},[M,P]),P6.useEffect(()=>{return()=>{console.log("Disconnecting..."),r()}},[]),H5.jsxs(B4,{card:"VoiceAgentCard",data:$,methods:{initializeAI:async(m)=>{if(M!==null&&P!==null&&m.token&&!J$)console.log("Connecting via initialize event..."),await K$(m.token).catch((B$)=>{console.error("Auto-connection failed:",B$)})},stop:()=>{r()}},useCentrifugeSupport:N,useSocketioSupport:z,useMittSupport:L,centrifugeChannel:O,children:[H5.jsxs("button",{id:Q,value:Q,onClick:async()=>{if(J$)r();else if(W)await K$(W)},style:J$?q.enabled:q.disabled,type:"button",children:[w&&D==="start"&&H5.jsx("img",{src:w,alt:""}),m1(J$?J.enabled:J.disabled),w&&D==="end"&&H5.jsx("img",{src:w,alt:""})]}),H5.jsx("input",{type:"hidden",name:Q,value:JSON.stringify(I$)}),H5.jsx("audio",{ref:T$,autoPlay:!0,muted:V,style:{display:"none"}})]})},Bq=Mq$;var U5=require("react");var mP=({data:$})=>{return m1($)};var fd=require("react/jsx-runtime"),cP=({data:$,setUiAjaxConfiguration:X})=>{return fd.jsx(S4,{uiConfig:$,setUiAjaxConfiguration:X})};var d6=require("react/jsx-runtime"),Aq$=({name:$,headers:X,rows:Q,rowUrls:J,selected:Y,columnHeights:G,sx:W,sxMap:K,setUiAjaxConfiguration:V})=>{let H=U5.useContext($6),U=(N,L)=>Array(N.length*L).fill(0).map((O,Z)=>N[Z%N.length]),q=X.map((N)=>N.length),w=q.reduce((N,L)=>N*L,1),D=q.map((N,L)=>Math.floor(w/q.slice(0,L+1).reduce((O,Z)=>O*Z,1))),z=X.map((N,L)=>{return U(N,q.slice(0,L).reduce((O,Z)=>O*Z,1))});return d6.jsxs("table",{id:$,className:"w-full table-auto border-collapse overflow-hidden text-left",style:{...K?.table,...W},children:[d6.jsx("thead",{className:"bg-gray-100",children:z.map((N,L)=>d6.jsx("tr",{className:"border-none",style:K?.row,children:N.map((O,Z)=>d6.jsx("th",{colSpan:D[L],className:"border border-gray-200 px-4 py-2 text-gray-500",style:{width:G?G[Z]:"auto",...K?.cell},children:typeof O==="string"?d6.jsx(mP,{data:O,setUiAjaxConfiguration:V}):d6.jsx(cP,{data:O,setUiAjaxConfiguration:V})},Z))},L))}),d6.jsx("tbody",{children:Q.map((N,L)=>d6.jsx("tr",{className:`border border-gray-200 bg-white ${J&&J[L]?"cursor-pointer":""} ${Y&&Y[L]?"bg-gray-200":""}`,style:K?.row,children:N.map((O,Z)=>d6.jsx("td",{onClick:()=>{if(typeof O==="string"&&J&&J[L])if(J[L].startsWith("http"))window.location.href=J[L];else H?.(J[L])},className:"border border-gray-200 px-4 py-2 text-gray-900",style:{width:G?G[Z]:"auto",...K?.cell},children:typeof O==="string"?d6.jsx(mP,{data:O,setUiAjaxConfiguration:V}):d6.jsx(cP,{data:O,setUiAjaxConfiguration:V})},Z))},L))})]})},jq$=({data:$,setUiAjaxConfiguration:X})=>{let{name:Q,headers:J,rows:Y,rowUrls:G,sx:W,sxMap:K,useSocketioSupport:V,useCentrifugeSupport:H,useMittSupport:U,centrifugeChannel:q}=$,[w,D]=U5.useState([]),[z,N]=U5.useState([]);return U5.useEffect(()=>{D(Y)},[Y]),U5.useEffect(()=>{N(G)},[G]),d6.jsx(B4,{card:"TableCard",data:$,methods:{addrow:(M)=>{D((A)=>[...A,M.row]),N((A)=>[...A,M.url??null])},insertrow:(M)=>{D((A)=>[...A.slice(0,M.idx),M.row,...A.slice(M.idx)]),N((A)=>[...A.slice(0,M.idx),M.url??null,...A.slice(M.idx)])},delrow:(M)=>{D((A)=>[...A.slice(0,M.idx),...A.slice(M.idx+1)]),N((A)=>[...A.slice(0,M.idx),...A.slice(M.idx+1)])},clear:()=>{D(()=>[]),N(()=>[])}},useSocketioSupport:V,useCentrifugeSupport:H,useMittSupport:U,centrifugeChannel:q,children:d6.jsx(Aq$,{name:Q,rows:w,rowUrls:z,headers:J,setUiAjaxConfiguration:X,sx:W,sxMap:K})})},iP=jq$;var gd=require("react");var qq=require("react/jsx-runtime"),vq$=({data:$,content:X,setUiAjaxConfiguration:Q})=>{let{name:J,url:Y,sx:G}=$,W=gd.useContext($6);return qq.jsx(B4,{card:J,data:$,children:qq.jsx("div",{style:G,id:J,onClick:(V)=>{if(Y)if(V.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(Y))window.location.href=Y;else W?.(Y)},children:qq.jsx(S4,{setUiAjaxConfiguration:Q,uiConfig:X})})})},lP=vq$;var pP=!1;function q8(){if(pP)return;D6({name:"SequenceCard",component:ST,metadata:{author:"PieData",description:"Simple div with styles joining few components"}}),D6({name:"BoxCard",component:lP,metadata:{author:"PieData",description:"Simple div with styles joining few components"}}),D6({name:"UnionCard",component:CT,metadata:{author:"PieData",description:"Renders one of many components"}}),D6({name:"AjaxGroupCard",component:yT,metadata:{author:"PieData",description:"Group card with AJAX support"}}),D6({name:"AjaxButtonCard",component:xS,metadata:{author:"PieData",description:"Button with AJAX support"}}),D6({name:"RedirectButtonCard",component:fN,metadata:{author:"PieData",description:"Button with Redirect on click"}}),D6({name:"ChatCard",component:cS,metadata:{author:"PieData"}}),D6({name:"HiddenCard",component:bN,metadata:{author:"PieData"}}),D6({name:"AutoRedirectCard",component:IN,metadata:{author:"PieData"}}),D6({name:"HTMLEmbedCard",component:RN,metadata:{author:"PieData"}}),D6({name:"IOEventsCard",component:yN,metadata:{author:"PieData"}}),D6({name:"OpenAIVoiceAgentCard",component:Bq,metadata:{author:"PieData"}}),D6({name:"TableCard",component:iP,metadata:{author:"PieData"}}),pP=!0}function x6(){return pP}var b6=require("react/jsx-runtime"),Pq$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();B5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=B5.useMemo(()=>hd.createAxiosDateTransformer({baseURL:Y||""}),[Y]),V=B5.useMemo(()=>$9(),[]),H=B5.useMemo(()=>Y?W9(Y):null,[Y]),U=B5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),{data:q,isLoading:w,error:D}=$Q.useQuery({queryKey:["uiConfig",$.pathname+$.search,x6(),Y],queryFn:async()=>{if(!Y||!x6())return;let z="/api/content"+$.pathname+($.search.startsWith("?")?$.search:`?${$.search}`);if(W)console.log("[PieRoot] Fetching UI configuration from:",z);let N=await K.get(z,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",N.data);return N.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(z)=>Math.min(1000*2**z,30000)});if(!Y)return X??null;if(W)console.log("[PieRoot] Rendering with location:",$),console.log("[PieRoot] API_SERVER:",Y),console.log("[PieRoot] CENTRIFUGE_SERVER:",G),console.log("[PieRoot] Fallback provided:",!!X);if(D){if(W)console.error("[PieRoot] Error fetching UI configuration:",D),console.error("[PieRoot] Error details:",{message:D.message,status:D.response?.status,data:D.response?.data});return Q?.(),X}if(w||!q){if(W)console.log("[PieRoot] Loading state:",{isLoading:w,hasUiConfiguration:!!q});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",q),console.log("[PieRoot] Rendering UI with configuration");return b6.jsx(y1.Provider,{value:V,children:b6.jsx(g1.Provider,{value:H,children:b6.jsx(h1.Provider,{value:U,children:b6.jsx(k1.Provider,{value:X??b6.jsx(b6.Fragment,{}),children:b6.jsx(H9,{children:b6.jsx(U9,{children:b6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:b6.jsx(S4,{uiConfig:q})})})})})})})})},xq$=($)=>{let X=B5.useMemo(()=>new $Q.QueryClient,[]);return b6.jsx($6.Provider,{value:$.onNavigate,children:b6.jsx(w8.Provider,{value:$.config,children:b6.jsx($Q.QueryClientProvider,{client:X,children:b6.jsx(Pq$,{...$})})})})},ud=xq$;var q5=require("react"),XQ=require("@tanstack/react-query");var cd=Z$(aW());var wq=require("react");var md=()=>{let[$,X]=wq.useState(null),Q=Yx();return wq.useEffect(()=>{if(typeof window==="undefined")return;let J=window.Telegram.WebApp;if(J.ready(),Q==="telegram_expanded"&&(J.platform==="ios"||J.platform==="android"))J.expand();X(J)},[]),$};var I6=require("react/jsx-runtime"),bq$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();q5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=q5.useMemo(()=>cd.createAxiosDateTransformer({baseURL:Y}),[Y]),V=q5.useMemo(()=>$9(),[]),H=q5.useMemo(()=>Y?W9(Y):null,[Y]),U=q5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),q=md(),{data:w,isLoading:D,error:z}=XQ.useQuery({queryKey:["uiConfig",$.pathname+$.search,q?.initData,x6()],queryFn:async()=>{if(!x6())return;let N=$.search?"&":"",L=q?.initData?`${N}initData=${encodeURIComponent(q.initData)}`:"",O="/api/content"+$.pathname+($.search.startsWith("?")?$.search:`?${$.search}`)+L;if(W)console.log("[PieRoot] Fetching UI configuration from:",O);let Z=await K.get(O,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",Z.data);return Z.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(N)=>Math.min(1000*2**N,30000)});if(!Y)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&W)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),Q?.(),X;if(D||!w){if(W)console.log("[PieRoot] Loading state:",{isLoading:D,hasUiConfiguration:!!w});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",w),console.log("[PieRoot] Rendering UI with configuration");return I6.jsx(y1.Provider,{value:V,children:I6.jsx(g1.Provider,{value:H,children:I6.jsx(h1.Provider,{value:U,children:I6.jsx(k1.Provider,{value:X??I6.jsx(I6.Fragment,{}),children:I6.jsx(H9,{children:I6.jsx(U9,{children:I6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:I6.jsx(S4,{uiConfig:w})})})})})})})})},Iq$=($)=>{let X=q5.useMemo(()=>new XQ.QueryClient,[]);return I6.jsx($6.Provider,{value:$.onNavigate,children:I6.jsx(w8.Provider,{value:$.config,children:I6.jsx(XQ.QueryClientProvider,{client:X,children:I6.jsx(bq$,{...$})})})})},id=Iq$;var x7=require("react"),zq=require("@tanstack/react-query");var a6=require("react/jsx-runtime"),Rq$=({location:$,fallback:X,initializePie:Q,children:J})=>{let Y=S1(),G=e8(),W=C1();x7.useEffect(()=>{if(x6())return;q8(),Q()},[]);let K=x7.useMemo(()=>$9(),[]),V=x7.useMemo(()=>Y?W9(Y):null,[Y]),H=x7.useMemo(()=>Y?V9(Y,G):null,[Y,G]);if(W)console.log("[PieRoot] Rendering with location:",$),console.log("[PieRoot] API_SERVER:",Y),console.log("[PieRoot] CENTRIFUGE_SERVER:",G),console.log("[PieRoot] Fallback provided:",!!X);return a6.jsx(y1.Provider,{value:K,children:a6.jsx(g1.Provider,{value:V,children:a6.jsx(h1.Provider,{value:H,children:a6.jsx(k1.Provider,{value:X??a6.jsx(a6.Fragment,{}),children:a6.jsx(H9,{children:a6.jsx(U9,{children:a6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:J})})})})})})})},Eq$=($)=>{let X=x7.useMemo(()=>new zq.QueryClient,[]);return a6.jsx($6.Provider,{value:$.onNavigate,children:a6.jsx(w8.Provider,{value:$.config,children:a6.jsx(zq.QueryClientProvider,{client:X,children:a6.jsx(Rq$,{...$})})})})},ld=Eq$;var w5=require("react"),QQ=require("@tanstack/react-query");var nd=Z$(aW());var Nq=require("react"),pd=()=>{let[$,X]=Nq.useState(null);return Nq.useEffect(()=>{if(typeof window==="undefined")return;let Q=window.WebApp;if(!Q)return;Q.ready(),X(Q)},[]),$};var R6=require("react/jsx-runtime"),_q$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();w5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=w5.useMemo(()=>nd.createAxiosDateTransformer({baseURL:Y}),[Y]),V=w5.useMemo(()=>$9(),[]),H=w5.useMemo(()=>Y?W9(Y):null,[Y]),U=w5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),q=pd(),{data:w,isLoading:D,error:z}=QQ.useQuery({queryKey:["uiConfig",$.pathname+$.search,q?.initData,x6()],queryFn:async()=>{if(!x6())return;let N=$.search?"&":"",L=q?.initData?`${N}initData=${encodeURIComponent(q.initData)}`:"",O="/api/content"+$.pathname+($.search.startsWith("?")?$.search:`?${$.search}`)+L;if(W)console.log("[PieRoot] Fetching UI configuration from:",O);let Z=await K.get(O,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",Z.data);return Z.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(N)=>Math.min(1000*2**N,30000)});if(!Y)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&W)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),Q?.(),X;if(D||!w){if(W)console.log("[PieRoot] Loading state:",{isLoading:D,hasUiConfiguration:!!w});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",w),console.log("[PieRoot] Rendering UI with configuration");return R6.jsx(y1.Provider,{value:V,children:R6.jsx(g1.Provider,{value:H,children:R6.jsx(h1.Provider,{value:U,children:R6.jsx(k1.Provider,{value:X??R6.jsx(R6.Fragment,{}),children:R6.jsx(H9,{children:R6.jsx(U9,{children:R6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:R6.jsx(S4,{uiConfig:w})})})})})})})})},Tq$=($)=>{let X=w5.useMemo(()=>new QQ.QueryClient,[]);return R6.jsx($6.Provider,{value:$.onNavigate,children:R6.jsx(w8.Provider,{value:$.config,children:R6.jsx(QQ.QueryClientProvider,{client:X,children:R6.jsx(_q$,{...$})})})})},dd=Tq$;function ad($){if(!$)return{};return{...$}}var kq$=($,X)=>{let Q=new Array($.length+X.length);for(let J=0;J<$.length;J++)Q[J]=$[J];for(let J=0;J<X.length;J++)Q[$.length+J]=X[J];return Q},Sq$=($,X)=>({classGroupId:$,validator:X}),$a=($=new Map,X=null,Q)=>({nextPart:$,validators:X,classGroupId:Q});var od=[];var Cq$=($)=>{let X=fq$($),{conflictingClassGroups:Q,conflictingClassGroupModifiers:J}=$;return{getClassGroupId:(W)=>{if(W.startsWith("[")&&W.endsWith("]"))return yq$(W);let K=W.split("-"),V=K[0]===""&&K.length>1?1:0;return Xa(K,V,X)},getConflictingClassGroupIds:(W,K)=>{if(K){let V=J[W],H=Q[W];if(V){if(H)return kq$(H,V);return V}return H||od}return Q[W]||od}}},Xa=($,X,Q)=>{if($.length-X===0)return Q.classGroupId;let Y=$[X],G=Q.nextPart.get(Y);if(G){let H=Xa($,X+1,G);if(H)return H}let W=Q.validators;if(W===null)return;let K=X===0?$.join("-"):$.slice(X).join("-"),V=W.length;for(let H=0;H<V;H++){let U=W[H];if(U.validator(K))return U.classGroupId}return},yq$=($)=>$.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let X=$.slice(1,-1),Q=X.indexOf(":"),J=X.slice(0,Q);return J?"arbitrary.."+J:void 0})(),fq$=($)=>{let{theme:X,classGroups:Q}=$;return gq$(Q,X)},gq$=($,X)=>{let Q=$a();for(let J in $){let Y=$[J];dP(Y,Q,J,X)}return Q},dP=($,X,Q,J)=>{let Y=$.length;for(let G=0;G<Y;G++){let W=$[G];hq$(W,X,Q,J)}},hq$=($,X,Q,J)=>{if(typeof $==="string"){uq$($,X,Q);return}if(typeof $==="function"){mq$($,X,Q,J);return}cq$($,X,Q,J)},uq$=($,X,Q)=>{let J=$===""?X:Qa(X,$);J.classGroupId=Q},mq$=($,X,Q,J)=>{if(iq$($)){dP($(J),X,Q,J);return}if(X.validators===null)X.validators=[];X.validators.push(Sq$(Q,$))},cq$=($,X,Q,J)=>{let Y=Object.entries($),G=Y.length;for(let W=0;W<G;W++){let[K,V]=Y[W];dP(V,Qa(X,K),Q,J)}},Qa=($,X)=>{let Q=$,J=X.split("-"),Y=J.length;for(let G=0;G<Y;G++){let W=J[G],K=Q.nextPart.get(W);if(!K)K=$a(),Q.nextPart.set(W,K);Q=K}return Q},iq$=($)=>("isThemeGetter"in $)&&$.isThemeGetter===!0,lq$=($)=>{if($<1)return{get:()=>{return},set:()=>{}};let X=0,Q=Object.create(null),J=Object.create(null),Y=(G,W)=>{if(Q[G]=W,X++,X>$)X=0,J=Q,Q=Object.create(null)};return{get(G){let W=Q[G];if(W!==void 0)return W;if((W=J[G])!==void 0)return Y(G,W),W},set(G,W){if(G in Q)Q[G]=W;else Y(G,W)}}};var pq$=[],rd=($,X,Q,J,Y)=>({modifiers:$,hasImportantModifier:X,baseClassName:Q,maybePostfixModifierPosition:J,isExternal:Y}),nq$=($)=>{let{prefix:X,experimentalParseClassName:Q}=$,J=(Y)=>{let G=[],W=0,K=0,V=0,H,U=Y.length;for(let N=0;N<U;N++){let L=Y[N];if(W===0&&K===0){if(L===":"){G.push(Y.slice(V,N)),V=N+1;continue}if(L==="/"){H=N;continue}}if(L==="[")W++;else if(L==="]")W--;else if(L==="(")K++;else if(L===")")K--}let q=G.length===0?Y:Y.slice(V),w=q,D=!1;if(q.endsWith("!"))w=q.slice(0,-1),D=!0;else if(q.startsWith("!"))w=q.slice(1),D=!0;let z=H&&H>V?H-V:void 0;return rd(G,D,w,z)};if(X){let Y=X+":",G=J;J=(W)=>W.startsWith(Y)?G(W.slice(Y.length)):rd(pq$,!1,W,void 0,!0)}if(Q){let Y=J;J=(G)=>Q({className:G,parseClassName:Y})}return J},dq$=($)=>{let X=new Map;return $.orderSensitiveModifiers.forEach((Q,J)=>{X.set(Q,1e6+J)}),(Q)=>{let J=[],Y=[];for(let G=0;G<Q.length;G++){let W=Q[G],K=W[0]==="[",V=X.has(W);if(K||V){if(Y.length>0)Y.sort(),J.push(...Y),Y=[];J.push(W)}else Y.push(W)}if(Y.length>0)Y.sort(),J.push(...Y);return J}},aq$=($)=>({cache:lq$($.cacheSize),parseClassName:nq$($),sortModifiers:dq$($),...Cq$($)}),oq$=/\s+/,rq$=($,X)=>{let{parseClassName:Q,getClassGroupId:J,getConflictingClassGroupIds:Y,sortModifiers:G}=X,W=[],K=$.trim().split(oq$),V="";for(let H=K.length-1;H>=0;H-=1){let U=K[H],{isExternal:q,modifiers:w,hasImportantModifier:D,baseClassName:z,maybePostfixModifierPosition:N}=Q(U);if(q){V=U+(V.length>0?" "+V:V);continue}let L=!!N,O=J(L?z.substring(0,N):z);if(!O){if(!L){V=U+(V.length>0?" "+V:V);continue}if(O=J(z),!O){V=U+(V.length>0?" "+V:V);continue}L=!1}let Z=w.length===0?"":w.length===1?w[0]:G(w).join(":"),F=D?Z+"!":Z,M=F+O;if(W.indexOf(M)>-1)continue;W.push(M);let A=Y(O,L);for(let P=0;P<A.length;++P){let _=A[P];W.push(F+_)}V=U+(V.length>0?" "+V:V)}return V},tq$=(...$)=>{let X=0,Q,J,Y="";while(X<$.length)if(Q=$[X++]){if(J=Ya(Q))Y&&(Y+=" "),Y+=J}return Y},Ya=($)=>{if(typeof $==="string")return $;let X,Q="";for(let J=0;J<$.length;J++)if($[J]){if(X=Ya($[J]))Q&&(Q+=" "),Q+=X}return Q},sq$=($,...X)=>{let Q,J,Y,G,W=(V)=>{let H=X.reduce((U,q)=>q(U),$());return Q=aq$(H),J=Q.cache.get,Y=Q.cache.set,G=K,K(V)},K=(V)=>{let H=J(V);if(H)return H;let U=rq$(V,Q);return Y(V,U),U};return G=W,(...V)=>G(tq$(...V))},eq$=[],n4=($)=>{let X=(Q)=>Q[$]||eq$;return X.isThemeGetter=!0,X},Ja=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ga=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$w$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xw$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qw$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yw$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jw$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gw$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z5=($)=>$w$.test($),_$=($)=>!!$&&!Number.isNaN(Number($)),N5=($)=>!!$&&Number.isInteger(Number($)),nP=($)=>$.endsWith("%")&&_$($.slice(0,-1)),r8=($)=>Xw$.test($),Wa=()=>!0,Ww$=($)=>Qw$.test($)&&!Yw$.test($),aP=()=>!1,Kw$=($)=>Jw$.test($),Vw$=($)=>Gw$.test($),Hw$=($)=>!s($)&&!e($),Uw$=($)=>D5($,Ha,aP),s=($)=>Ja.test($),b7=($)=>D5($,Ua,Ww$),td=($)=>D5($,Fw$,_$),Bw$=($)=>D5($,qa,Wa),qw$=($)=>D5($,Ba,aP),sd=($)=>D5($,Ka,aP),ww$=($)=>D5($,Va,Vw$),Dq=($)=>D5($,wa,Kw$),e=($)=>Ga.test($),mG=($)=>I7($,Ua),zw$=($)=>I7($,Ba),ed=($)=>I7($,Ka),Nw$=($)=>I7($,Ha),Dw$=($)=>I7($,Va),Lq=($)=>I7($,wa,!0),Lw$=($)=>I7($,qa,!0),D5=($,X,Q)=>{let J=Ja.exec($);if(J){if(J[1])return X(J[1]);return Q(J[2])}return!1},I7=($,X,Q=!1)=>{let J=Ga.exec($);if(J){if(J[1])return X(J[1]);return Q}return!1},Ka=($)=>$==="position"||$==="percentage",Va=($)=>$==="image"||$==="url",Ha=($)=>$==="length"||$==="size"||$==="bg-size",Ua=($)=>$==="length",Fw$=($)=>$==="number",Ba=($)=>$==="family-name",qa=($)=>$==="number"||$==="weight",wa=($)=>$==="shadow";var Ow$=()=>{let $=n4("color"),X=n4("font"),Q=n4("text"),J=n4("font-weight"),Y=n4("tracking"),G=n4("leading"),W=n4("breakpoint"),K=n4("container"),V=n4("spacing"),H=n4("radius"),U=n4("shadow"),q=n4("inset-shadow"),w=n4("text-shadow"),D=n4("drop-shadow"),z=n4("blur"),N=n4("perspective"),L=n4("aspect"),O=n4("ease"),Z=n4("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...M(),e,s],P=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[e,s,V],c=()=>[z5,"full","auto",...I()],J$=()=>[N5,"none","subgrid",e,s],U$=()=>["auto",{span:["full",N5,e,s]},N5,e,s],I$=()=>[N5,"auto",e,s],t=()=>["auto","min","max","fr",e,s],R$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T$=()=>["start","end","center","stretch","center-safe","end-safe"],g=()=>["auto",...I()],r=()=>[z5,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],K$=()=>[z5,"screen","full","dvw","lvw","svw","min","max","fit",...I()],k4=()=>[z5,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],T=()=>[$,e,s],m=()=>[...M(),ed,sd,{position:[e,s]}],B$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w4=()=>["auto","cover","contain",Nw$,Uw$,{size:[e,s]}],N$=()=>[nP,mG,b7],O$=()=>["","none","full",H,e,s],h$=()=>["",_$,mG,b7],a$=()=>["solid","dashed","dotted","double"],Q0=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U4=()=>[_$,nP,ed,sd],O4=()=>["","none",z,e,s],Y0=()=>["none",_$,e,s],t8=()=>["none",_$,e,s],R7=()=>[_$,e,s],YQ=()=>[z5,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[r8],breakpoint:[r8],color:[Wa],container:[r8],"drop-shadow":[r8],ease:["in","out","in-out"],font:[Hw$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[r8],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[r8],shadow:[r8],spacing:["px",_$],text:[r8],"text-shadow":[r8],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",z5,s,e,L]}],container:["container"],columns:[{columns:[_$,s,e,K]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:c()}],"inset-x":[{"inset-x":c()}],"inset-y":[{"inset-y":c()}],start:[{"inset-s":c(),start:c()}],end:[{"inset-e":c(),end:c()}],"inset-bs":[{"inset-bs":c()}],"inset-be":[{"inset-be":c()}],top:[{top:c()}],right:[{right:c()}],bottom:[{bottom:c()}],left:[{left:c()}],visibility:["visible","invisible","collapse"],z:[{z:[N5,"auto",e,s]}],basis:[{basis:[z5,"full","auto",K,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_$,z5,"auto","initial","none",s]}],grow:[{grow:["",_$,e,s]}],shrink:[{shrink:["",_$,e,s]}],order:[{order:[N5,"first","last","none",e,s]}],"grid-cols":[{"grid-cols":J$()}],"col-start-end":[{col:U$()}],"col-start":[{"col-start":I$()}],"col-end":[{"col-end":I$()}],"grid-rows":[{"grid-rows":J$()}],"row-start-end":[{row:U$()}],"row-start":[{"row-start":I$()}],"row-end":[{"row-end":I$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":t()}],"auto-rows":[{"auto-rows":t()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...R$(),"normal"]}],"justify-items":[{"justify-items":[...T$(),"normal"]}],"justify-self":[{"justify-self":["auto",...T$()]}],"align-content":[{content:["normal",...R$()]}],"align-items":[{items:[...T$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T$(),{baseline:["","last"]}]}],"place-content":[{"place-content":R$()}],"place-items":[{"place-items":[...T$(),"baseline"]}],"place-self":[{"place-self":["auto",...T$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:g()}],mx:[{mx:g()}],my:[{my:g()}],ms:[{ms:g()}],me:[{me:g()}],mbs:[{mbs:g()}],mbe:[{mbe:g()}],mt:[{mt:g()}],mr:[{mr:g()}],mb:[{mb:g()}],ml:[{ml:g()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:r()}],"inline-size":[{inline:["auto",...K$()]}],"min-inline-size":[{"min-inline":["auto",...K$()]}],"max-inline-size":[{"max-inline":["none",...K$()]}],"block-size":[{block:["auto",...k4()]}],"min-block-size":[{"min-block":["auto",...k4()]}],"max-block-size":[{"max-block":["none",...k4()]}],w:[{w:[K,"screen",...r()]}],"min-w":[{"min-w":[K,"screen","none",...r()]}],"max-w":[{"max-w":[K,"screen","none","prose",{screen:[W]},...r()]}],h:[{h:["screen","lh",...r()]}],"min-h":[{"min-h":["screen","lh","none",...r()]}],"max-h":[{"max-h":["screen","lh",...r()]}],"font-size":[{text:["base",Q,mG,b7]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[J,Lw$,Bw$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nP,s]}],"font-family":[{font:[zw$,qw$,X]}],"font-features":[{"font-features":[s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[Y,e,s]}],"line-clamp":[{"line-clamp":[_$,"none",e,td]}],leading:[{leading:[G,...I()]}],"list-image":[{"list-image":["none",e,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",e,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...a$(),"wavy"]}],"text-decoration-thickness":[{decoration:[_$,"from-font","auto",e,b7]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[_$,"auto",e,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",e,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",e,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:m()}],"bg-repeat":[{bg:B$()}],"bg-size":[{bg:w4()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},N5,e,s],radial:["",e,s],conic:[N5,e,s]},Dw$,ww$]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:N$()}],"gradient-via-pos":[{via:N$()}],"gradient-to-pos":[{to:N$()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:O$()}],"rounded-s":[{"rounded-s":O$()}],"rounded-e":[{"rounded-e":O$()}],"rounded-t":[{"rounded-t":O$()}],"rounded-r":[{"rounded-r":O$()}],"rounded-b":[{"rounded-b":O$()}],"rounded-l":[{"rounded-l":O$()}],"rounded-ss":[{"rounded-ss":O$()}],"rounded-se":[{"rounded-se":O$()}],"rounded-ee":[{"rounded-ee":O$()}],"rounded-es":[{"rounded-es":O$()}],"rounded-tl":[{"rounded-tl":O$()}],"rounded-tr":[{"rounded-tr":O$()}],"rounded-br":[{"rounded-br":O$()}],"rounded-bl":[{"rounded-bl":O$()}],"border-w":[{border:h$()}],"border-w-x":[{"border-x":h$()}],"border-w-y":[{"border-y":h$()}],"border-w-s":[{"border-s":h$()}],"border-w-e":[{"border-e":h$()}],"border-w-bs":[{"border-bs":h$()}],"border-w-be":[{"border-be":h$()}],"border-w-t":[{"border-t":h$()}],"border-w-r":[{"border-r":h$()}],"border-w-b":[{"border-b":h$()}],"border-w-l":[{"border-l":h$()}],"divide-x":[{"divide-x":h$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":h$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...a$(),"hidden","none"]}],"divide-style":[{divide:[...a$(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...a$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_$,e,s]}],"outline-w":[{outline:["",_$,mG,b7]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",U,Lq,Dq]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",q,Lq,Dq]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:h$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[_$,b7]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":h$()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",w,Lq,Dq]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[_$,e,s]}],"mix-blend":[{"mix-blend":[...Q0(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q0()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_$]}],"mask-image-linear-from-pos":[{"mask-linear-from":U4()}],"mask-image-linear-to-pos":[{"mask-linear-to":U4()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":U4()}],"mask-image-t-to-pos":[{"mask-t-to":U4()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":U4()}],"mask-image-r-to-pos":[{"mask-r-to":U4()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":U4()}],"mask-image-b-to-pos":[{"mask-b-to":U4()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":U4()}],"mask-image-l-to-pos":[{"mask-l-to":U4()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":U4()}],"mask-image-x-to-pos":[{"mask-x-to":U4()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":U4()}],"mask-image-y-to-pos":[{"mask-y-to":U4()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[e,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":U4()}],"mask-image-radial-to-pos":[{"mask-radial-to":U4()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[_$]}],"mask-image-conic-from-pos":[{"mask-conic-from":U4()}],"mask-image-conic-to-pos":[{"mask-conic-to":U4()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:m()}],"mask-repeat":[{mask:B$()}],"mask-size":[{mask:w4()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",e,s]}],filter:[{filter:["","none",e,s]}],blur:[{blur:O4()}],brightness:[{brightness:[_$,e,s]}],contrast:[{contrast:[_$,e,s]}],"drop-shadow":[{"drop-shadow":["","none",D,Lq,Dq]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",_$,e,s]}],"hue-rotate":[{"hue-rotate":[_$,e,s]}],invert:[{invert:["",_$,e,s]}],saturate:[{saturate:[_$,e,s]}],sepia:[{sepia:["",_$,e,s]}],"backdrop-filter":[{"backdrop-filter":["","none",e,s]}],"backdrop-blur":[{"backdrop-blur":O4()}],"backdrop-brightness":[{"backdrop-brightness":[_$,e,s]}],"backdrop-contrast":[{"backdrop-contrast":[_$,e,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_$,e,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_$,e,s]}],"backdrop-invert":[{"backdrop-invert":["",_$,e,s]}],"backdrop-opacity":[{"backdrop-opacity":[_$,e,s]}],"backdrop-saturate":[{"backdrop-saturate":[_$,e,s]}],"backdrop-sepia":[{"backdrop-sepia":["",_$,e,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",e,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_$,"initial",e,s]}],ease:[{ease:["linear","initial",O,e,s]}],delay:[{delay:[_$,e,s]}],animate:[{animate:["none",Z,e,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,e,s]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Y0()}],"rotate-x":[{"rotate-x":Y0()}],"rotate-y":[{"rotate-y":Y0()}],"rotate-z":[{"rotate-z":Y0()}],scale:[{scale:t8()}],"scale-x":[{"scale-x":t8()}],"scale-y":[{"scale-y":t8()}],"scale-z":[{"scale-z":t8()}],"scale-3d":["scale-3d"],skew:[{skew:R7()}],"skew-x":[{"skew-x":R7()}],"skew-y":[{"skew-y":R7()}],transform:[{transform:[e,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:YQ()}],"translate-x":[{"translate-x":YQ()}],"translate-y":[{"translate-y":YQ()}],"translate-z":[{"translate-z":YQ()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",e,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",e,s]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[_$,mG,b7,td]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var za=sq$(Ow$);function Na(...$){return za(EN($))}var Da=()=>{if(typeof document==="undefined")return;let $=document.getElementById("piedata_global_form");$&&$.submit()};
110
+ `.trim()}function v7($,X){return $ in X&&typeof X[$]!=="undefined"}function kU$($){return v7("modalities",$)||v7("inputAudioFormat",$)||v7("outputAudioFormat",$)||v7("inputAudioTranscription",$)||v7("turnDetection",$)||v7("inputAudioNoiseReduction",$)||v7("speed",$)}function Rd($){if(!kU$($)){let X=$.audio?.input?{format:Hq($.audio.input.format),noiseReduction:$.audio.input.noiseReduction??null,transcription:$.audio.input.transcription,turnDetection:$.audio.input.turnDetection}:void 0,Q=$.audio?.output?.voice??$.voice,J=$.audio?.output||typeof Q!=="undefined"?{format:Hq($.audio?.output?.format),voice:Q,speed:$.audio?.output?.speed}:void 0;return{model:$.model,instructions:$.instructions,toolChoice:$.toolChoice,tools:$.tools,tracing:$.tracing,providerData:$.providerData,prompt:$.prompt,outputModalities:$.outputModalities,audio:X||J?{input:X,output:J}:void 0}}return{model:$.model,instructions:$.instructions,toolChoice:$.toolChoice,tools:$.tools,tracing:$.tracing,providerData:$.providerData,prompt:$.prompt,outputModalities:$.modalities,audio:{input:{format:Hq($.inputAudioFormat),noiseReduction:$.inputAudioNoiseReduction??null,transcription:$.inputAudioTranscription,turnDetection:$.turnDetection},output:{format:Hq($.outputAudioFormat),voice:$.voice,speed:$.speed}}}}function Hq($){if(!$)return;if(typeof $==="object")return $;let X=String($);if(X==="pcm16")return{type:"audio/pcm",rate:24000};if(X==="g711_ulaw")return{type:"audio/pcmu"};if(X==="g711_alaw")return{type:"audio/pcma"};return{type:"audio/pcm",rate:24000}}var og$=B.object({itemId:B.string()}),CP=B.discriminatedUnion("role",[B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("system"),content:B.array(B.object({type:B.literal("input_text"),text:B.string()}))}),B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("user"),status:B.enum(["in_progress","completed"]),content:B.array(B.object({type:B.literal("input_text"),text:B.string()}).or(B.object({type:B.literal("input_audio"),audio:B.string().nullable().optional(),transcript:B.string().nullable()})))}),B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("message"),role:B.literal("assistant"),status:B.enum(["in_progress","completed","incomplete"]),content:B.array(B.object({type:B.literal("output_text"),text:B.string()}).or(B.object({type:B.literal("output_audio"),audio:B.string().nullable().optional(),transcript:B.string().nullable().optional()})))})]),yP=B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.literal("function_call"),status:B.enum(["in_progress","completed","incomplete"]),arguments:B.string(),name:B.string(),output:B.string().nullable()}),fP=B.object({itemId:B.string(),previousItemId:B.string().nullable().optional(),type:B.enum(["mcp_call","mcp_tool_call"]),status:B.enum(["in_progress","completed","incomplete"]),arguments:B.string(),name:B.string(),output:B.string().nullable()}),Ed=B.object({itemId:B.string(),type:B.literal("mcp_approval_request"),serverLabel:B.string(),name:B.string(),arguments:B.record(B.string(),B.any()),approved:B.boolean().optional().nullable()});var SU$=Q8("openai-agents:realtime"),J6=SU$;var _d=B.object({id:B.string().optional().nullable(),conversation_id:B.string().optional().nullable(),max_output_tokens:B.number().or(B.literal("inf")).optional().nullable(),metadata:B.record(B.string(),B.any()).optional().nullable(),output_modalities:B.array(B.string()).optional().nullable(),object:B.literal("realtime.response").optional().nullable(),output:B.array(B.any()).optional().nullable(),audio:B.object({output:B.object({format:B.any().optional().nullable(),voice:B.string().optional().nullable()}).optional().nullable()}).optional().nullable(),status:B.enum(["completed","incomplete","failed","cancelled","in_progress"]).optional().nullable(),status_details:B.record(B.string(),B.any()).optional().nullable(),usage:B.object({input_tokens:B.number().optional(),input_token_details:B.record(B.string(),B.any()).optional().nullable(),output_tokens:B.number().optional(),output_token_details:B.record(B.string(),B.any()).optional().nullable()}).optional().nullable()}),CU$=B.object({id:B.string().optional(),audio:B.string().nullable().optional(),text:B.string().nullable().optional(),transcript:B.string().nullable().optional(),type:B.union([B.literal("input_text"),B.literal("input_audio"),B.literal("item_reference"),B.literal("output_text"),B.literal("output_audio")])}),r3=B.object({id:B.string().optional(),arguments:B.string().optional(),call_id:B.string().optional(),content:B.array(CU$).optional(),name:B.string().optional(),output:B.string().nullable().optional(),role:B.enum(["user","assistant","system"]).optional(),status:B.enum(["completed","incomplete","in_progress"]).optional(),type:B.enum(["message","function_call","function_call_output","mcp_list_tools","mcp_tool_call","mcp_call","mcp_approval_request","mcp_approval_response"]).optional(),approval_request_id:B.string().nullable().optional(),approve:B.boolean().nullable().optional(),reason:B.string().nullable().optional(),server_label:B.string().optional(),error:B.any().nullable().optional(),tools:B.array(B.object({name:B.string(),description:B.string(),input_schema:B.record(B.string(),B.any()).optional()}).passthrough()).optional()}).passthrough(),yU$=B.object({type:B.literal("conversation.created"),event_id:B.string(),conversation:B.object({id:B.string().optional(),object:B.literal("realtime.conversation").optional()})}),fU$=B.object({type:B.literal("conversation.item.added"),event_id:B.string(),item:r3,previous_item_id:B.string().nullable().optional()}),gU$=B.object({type:B.literal("conversation.item.done"),event_id:B.string(),item:r3,previous_item_id:B.string().nullable().optional()}),hU$=B.object({type:B.literal("conversation.item.deleted"),event_id:B.string(),item_id:B.string()}),uU$=B.object({type:B.literal("conversation.item.input_audio_transcription.completed"),event_id:B.string(),item_id:B.string(),content_index:B.number(),transcript:B.string(),logprobs:B.array(B.any()).nullable().optional(),usage:B.object({type:B.literal("tokens"),total_tokens:B.number(),input_tokens:B.number(),input_token_details:B.object({text_tokens:B.number(),audio_tokens:B.number()}),output_tokens:B.number()}).optional()}),mU$=B.object({type:B.literal("conversation.item.input_audio_transcription.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number().optional(),delta:B.string().optional(),logprobs:B.array(B.any()).nullable().optional()}),cU$=B.object({type:B.literal("conversation.item.input_audio_transcription.failed"),event_id:B.string(),item_id:B.string(),content_index:B.number(),error:B.object({code:B.string().optional(),message:B.string().optional(),param:B.string().optional(),type:B.string().optional()})}),iU$=B.object({type:B.literal("conversation.item.retrieved"),event_id:B.string(),item:r3}),lU$=B.object({type:B.literal("conversation.item.truncated"),event_id:B.string(),item_id:B.string(),audio_end_ms:B.number(),content_index:B.number()}),pU$=B.object({type:B.literal("conversation.item.create"),item:r3,event_id:B.string().optional(),previous_item_id:B.string().nullable().optional()}),nU$=B.object({type:B.literal("conversation.item.delete"),item_id:B.string(),event_id:B.string().optional()}),dU$=B.object({type:B.literal("conversation.item.retrieve"),item_id:B.string(),event_id:B.string().optional()}),aU$=B.object({type:B.literal("conversation.item.truncate"),item_id:B.string(),audio_end_ms:B.number(),content_index:B.number(),event_id:B.string().optional()}),oU$=B.object({type:B.literal("error"),event_id:B.string().optional(),error:B.any().optional()}),rU$=B.object({type:B.literal("input_audio_buffer.cleared"),event_id:B.string()}),tU$=B.object({type:B.literal("input_audio_buffer.append"),audio:B.string(),event_id:B.string().optional()}),sU$=B.object({type:B.literal("input_audio_buffer.clear"),event_id:B.string().optional()}),eU$=B.object({type:B.literal("input_audio_buffer.commit"),event_id:B.string().optional()}),$B$=B.object({type:B.literal("input_audio_buffer.committed"),event_id:B.string(),item_id:B.string(),previous_item_id:B.string().nullable().optional()}),XB$=B.object({type:B.literal("input_audio_buffer.speech_started"),event_id:B.string(),item_id:B.string(),audio_start_ms:B.number()}),QB$=B.object({type:B.literal("input_audio_buffer.speech_stopped"),event_id:B.string(),item_id:B.string(),audio_end_ms:B.number()}),YB$=B.object({type:B.literal("output_audio_buffer.started"),event_id:B.string()}).passthrough(),JB$=B.object({type:B.literal("output_audio_buffer.stopped"),event_id:B.string()}).passthrough(),GB$=B.object({type:B.literal("output_audio_buffer.cleared"),event_id:B.string()}),WB$=B.object({type:B.literal("rate_limits.updated"),event_id:B.string(),rate_limits:B.array(B.object({limit:B.number().optional(),name:B.enum(["requests","tokens"]).optional(),remaining:B.number().optional(),reset_seconds:B.number().optional()}))}),KB$=B.object({type:B.literal("response.output_audio.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),VB$=B.object({type:B.literal("response.output_audio.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string()}),HB$=B.object({type:B.literal("response.output_audio_transcript.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),UB$=B.object({type:B.literal("response.output_audio_transcript.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),transcript:B.string(),output_index:B.number(),response_id:B.string()}),BB$=B.object({type:B.literal("response.content_part.added"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string(),part:B.object({audio:B.string().optional(),text:B.string().optional(),transcript:B.string().optional(),type:B.enum(["text","audio"]).optional()})}),qB$=B.object({type:B.literal("response.content_part.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),output_index:B.number(),response_id:B.string(),part:B.object({audio:B.string().optional(),text:B.string().optional(),transcript:B.string().optional(),type:B.enum(["text","audio"]).optional()})}),wB$=B.object({type:B.literal("response.created"),event_id:B.string(),response:_d}),gP=B.object({type:B.literal("response.done"),event_id:B.string(),response:_d}),zB$=B.object({type:B.literal("response.function_call_arguments.delta"),event_id:B.string(),item_id:B.string(),call_id:B.string(),delta:B.string(),output_index:B.number(),response_id:B.string()}),NB$=B.object({type:B.literal("response.function_call_arguments.done"),event_id:B.string(),item_id:B.string(),call_id:B.string(),arguments:B.string(),output_index:B.number(),response_id:B.string()}),DB$=B.object({type:B.literal("response.output_item.added"),event_id:B.string(),item:r3,output_index:B.number(),response_id:B.string()}),LB$=B.object({type:B.literal("response.output_item.done"),event_id:B.string(),item:r3,output_index:B.number(),response_id:B.string()}),FB$=B.object({type:B.literal("response.output_text.delta"),event_id:B.string(),item_id:B.string(),content_index:B.number(),delta:B.string(),output_index:B.number(),response_id:B.string()}),OB$=B.object({type:B.literal("response.output_text.done"),event_id:B.string(),item_id:B.string(),content_index:B.number(),text:B.string(),output_index:B.number(),response_id:B.string()}),ZB$=B.object({type:B.literal("session.created"),event_id:B.string(),session:B.any()}),MB$=B.object({type:B.literal("session.updated"),event_id:B.string(),session:B.any()}),AB$=B.object({type:B.literal("response.cancel"),event_id:B.string().optional(),response_id:B.string().optional()}),jB$=B.object({type:B.literal("response.create"),event_id:B.string().optional(),response:B.any().optional()}),vB$=B.object({type:B.literal("session.update"),event_id:B.string().optional(),session:B.any()}),PB$=B.object({type:B.literal("mcp_list_tools.in_progress"),event_id:B.string().optional(),item_id:B.string().optional()}),xB$=B.object({type:B.literal("mcp_list_tools.completed"),event_id:B.string().optional(),item_id:B.string().optional()}),bB$=B.object({type:B.literal("response.mcp_call_arguments.delta"),event_id:B.string(),response_id:B.string(),item_id:B.string(),output_index:B.number(),delta:B.string(),obfuscation:B.string()}),IB$=B.object({type:B.literal("response.mcp_call_arguments.done"),event_id:B.string(),response_id:B.string(),item_id:B.string(),output_index:B.number(),arguments:B.string()}),RB$=B.object({type:B.literal("response.mcp_call.in_progress"),event_id:B.string(),output_index:B.number(),item_id:B.string()}),EB$=B.object({type:B.literal("response.mcp_call.completed"),event_id:B.string(),output_index:B.number(),item_id:B.string()}),_B$=B.object({type:B.literal("mcp_list_tools.failed"),event_id:B.string().optional(),item_id:B.string().optional()}),TB$=B.object({type:B.string(),event_id:B.string().optional().nullable()}).passthrough(),kB$=B.discriminatedUnion("type",[yU$,fU$,gU$,hU$,uU$,mU$,cU$,iU$,lU$,oU$,rU$,$B$,XB$,QB$,YB$,JB$,GB$,WB$,KB$,VB$,HB$,UB$,BB$,qB$,wB$,gP,zB$,NB$,DB$,LB$,FB$,OB$,ZB$,MB$,PB$,xB$,_B$,bB$,IB$,RB$,EB$]),$h$=B.discriminatedUnion("type",[pU$,nU$,dU$,aU$,tU$,sU$,eU$,AB$,jB$,vB$]);function t3($){let X=JSON.parse($.data.toString()),Q=kB$.safeParse(X);if(!Q.success){let J=TB$.safeParse(X);if(J.success)return{data:J.data,isGeneric:!0};return{data:null,isGeneric:!0}}return{data:Q.data,isGeneric:!1}}var Td="gpt-realtime",X0={outputModalities:["audio"],audio:{input:{format:{type:"audio/pcm",rate:24000},transcription:{model:"gpt-4o-mini-transcribe"},turnDetection:{type:"semantic_vad"},noiseReduction:null},output:{format:{type:"audio/pcm",rate:24000},speed:1}}};class P7 extends a3{#$;#X;#G=null;#Q=null;eventEmitter=new H8.EventEmitter;constructor($={}){super();this.#$=$.model??Td,this.#X=$.apiKey}get currentModel(){return this.#$}set currentModel($){this.#$=$}_afterAudioDoneEvent(){}get _rawSessionConfig(){return this.#Q??null}async _getApiKey($){let X=$.apiKey??this.#X;if(typeof X==="function")return await X();return X}_onMessage($){let{data:X,isGeneric:Q}=t3($);if(X===null)return;if(this.emit("*",X),Q)return;if(X.type==="error")this.emit("error",{type:"error",error:X});else this.emit(X.type,X);if(X.type==="response.created"){this.emit("turn_started",{type:"response_started",providerData:{...X}});return}if(X.type==="session.updated")this.#Q=X.session;if(X.type==="response.done"){let J=gP.safeParse(X);if(!J.success){J6.error("Error parsing response done event",J.error);return}let Y=J.data.response.usage?.input_tokens??0,G=J.data.response.usage?.output_tokens??0,W=Y+G,K=new $0({inputTokens:Y,inputTokensDetails:J.data.response.usage?.input_token_details??{},outputTokens:G,outputTokensDetails:J.data.response.usage?.output_token_details??{},totalTokens:W});this.emit("usage_update",K),this.emit("turn_done",{type:"response_done",response:{id:J.data.response.id??"",output:J.data.response.output??[],usage:{inputTokens:Y,inputTokensDetails:J.data.response.usage?.input_token_details??{},outputTokens:G,outputTokensDetails:J.data.response.usage?.output_token_details??{},totalTokens:W}}});return}if(X.type==="response.output_audio.done"){this.emit("audio_done"),this._afterAudioDoneEvent();return}if(X.type==="conversation.item.deleted"){this.emit("item_deleted",{itemId:X.item_id});return}if(X.type==="conversation.item.input_audio_transcription.completed"||X.type==="conversation.item.truncated"){this.sendEvent({type:"conversation.item.retrieve",item_id:X.item_id});return}if(X.type==="conversation.item.input_audio_transcription.delta"||X.type==="response.output_text.delta"||X.type==="response.output_audio_transcript.delta"||X.type==="response.function_call_arguments.delta"){if(X.type==="response.output_audio_transcript.delta")this.emit("audio_transcript_delta",{type:"transcript_delta",delta:X.delta,itemId:X.item_id,responseId:X.response_id});return}if(X.type==="conversation.item.added"||X.type==="conversation.item.done"||X.type==="conversation.item.retrieved"){if(X.item.type==="mcp_list_tools"&&X.type==="conversation.item.done"){let J=X.item.server_label??"",Y=X.item.tools??[];try{this.emit("mcp_tools_listed",{serverLabel:J,tools:Y})}catch(G){J6.error("Error emitting mcp_tools_listed",G,X.item)}return}if(X.item.type==="message"){let J=X.type==="conversation.item.added"||X.type==="conversation.item.done"?X.previous_item_id:null,Y=CP.parse({itemId:X.item.id,previousItemId:J,type:X.item.type,role:X.item.role,content:X.item.content,status:X.item.status});this.emit("item_update",Y);return}if(X.item.type==="mcp_approval_request"&&X.type==="conversation.item.done"){let J=X.item,Y=Ed.parse({itemId:J.id,type:J.type,serverLabel:J.server_label,name:J.name,arguments:JSON.parse(J.arguments||"{}"),approved:J.approved});this.emit("item_update",Y),this.emit("mcp_approval_request",Y);return}if(X.item.type==="mcp_tool_call"||X.item.type==="mcp_call"){let J=X.type==="conversation.item.done"?"completed":"in_progress",Y=fP.parse({itemId:X.item.id,type:X.item.type,status:J,arguments:X.item.arguments,name:X.item.name,output:X.item.output});if(this.emit("item_update",Y),X.type==="conversation.item.done")this.emit("mcp_tool_call_completed",Y);return}}if(X.type==="response.mcp_call.in_progress"){let J=X;this.sendEvent({type:"conversation.item.retrieve",item_id:J.item_id});return}if(X.type==="mcp_list_tools.in_progress"){let J=X;if(J.item_id)this.sendEvent({type:"conversation.item.retrieve",item_id:J.item_id});return}if(X.type==="response.output_item.done"||X.type==="response.output_item.added"){let J=X.item;if(J.type==="function_call"&&J.status==="completed"){let Y=yP.parse({itemId:J.id,type:J.type,status:"in_progress",arguments:J.arguments,name:J.name,output:null});this.emit("item_update",Y),this.emit("function_call",{id:J.id,type:"function_call",callId:J.call_id??"",arguments:J.arguments??"",name:J.name??""});return}if(J.type==="mcp_tool_call"||J.type==="mcp_call"){let Y=fP.parse({itemId:J.id,type:J.type,status:X.type==="response.output_item.done"?"completed":"in_progress",arguments:J.arguments,name:J.name,output:J.output});this.emit("item_update",Y);return}if(J.type==="message"){let Y=CP.parse({itemId:X.item.id,type:X.item.type,role:X.item.role,content:X.item.content,status:X.type==="response.output_item.done"?J.status??"completed":J.status??"in_progress"});this.emit("item_update",Y);return}}}_onError($){this.emit("error",{type:"error",error:$})}_onOpen(){this.emit("connected")}_onClose(){this.emit("disconnected")}sendMessage($,X,{triggerResponse:Q=!0}={}){let J=typeof $==="string"?[{type:"input_text",text:$}]:$.content.map((Y)=>{if(Y.type==="input_image")return{type:"input_image",image_url:Y.image,...Y.providerData??{}};return Y});if(this.sendEvent({type:"conversation.item.create",item:{type:"message",role:"user",content:J},...X}),Q)this.sendEvent({type:"response.create"})}addImage($,{triggerResponse:X=!0}={}){this.sendMessage({type:"message",role:"user",content:[{type:"input_image",image:$}]},{},{triggerResponse:X})}_getMergedSessionConfig($){let X=Rd($),Q=X.audio?.input?.noiseReduction,J=X.audio?.input?.transcription,Y=P7.buildTurnDetectionConfig(X.audio?.input?.turnDetection),G={type:"realtime",instructions:X.instructions,model:X.model??this.#$,output_modalities:X.outputModalities??X0.outputModalities,audio:{input:{format:X.audio?.input?.format??X0.audio?.input?.format,noise_reduction:Q===void 0?X0.audio?.input?.noiseReduction:Q,transcription:J===void 0?X0.audio?.input?.transcription:J,turn_detection:Y===void 0?X0.audio?.input?.turnDetection:Y},output:{format:X.audio?.output?.format??X0.audio?.output?.format,voice:X.audio?.output?.voice??X0.audio?.output?.voice,speed:X.audio?.output?.speed??X0.audio?.output?.speed}},tool_choice:X.toolChoice??X0.toolChoice,...X.providerData??{}};if(X.prompt)G.prompt={id:X.prompt.promptId,version:X.prompt.version,variables:X.prompt.variables};if(X.tools&&X.tools.length>0)G.tools=X.tools.map((W)=>{let K=(V)=>Object.fromEntries(Object.entries(V).filter(([,H])=>typeof H!=="undefined"));if(W.type==="mcp")return K({type:"mcp",server_label:W.server_label,server_url:W.server_url,server_description:W.server_description,connector_id:W.connector_id,authorization:W.authorization,headers:W.headers,allowed_tools:W.allowed_tools,require_approval:W.require_approval});return K({type:W.type,name:W.name,description:W.description,parameters:W.parameters})});return G}buildSessionPayload($){return this._getMergedSessionConfig($)}static buildTurnDetectionConfig($){if(typeof $==="undefined")return;if($===null)return null;let{type:X,createResponse:Q,create_response:J,eagerness:Y,interruptResponse:G,interrupt_response:W,prefixPaddingMs:K,prefix_padding_ms:V,silenceDurationMs:H,silence_duration_ms:U,threshold:q,idleTimeoutMs:w,idle_timeout_ms:D,modelVersion:z,model_version:N,...L}=$,O={type:X,create_response:Q??J,eagerness:Y,interrupt_response:G??W,prefix_padding_ms:K??V,silence_duration_ms:H??U,idle_timeout_ms:w??D,model_version:z??N,threshold:q,...L};return Object.keys(O).forEach((Z)=>{if(O[Z]===void 0)delete O[Z]}),Object.keys(O).length>0?O:void 0}set _tracingConfig($){this.#G=$}_updateTracingConfig($){if(typeof this.#G==="undefined")this.#G=null;if($==="auto"){this.sendEvent({type:"session.update",session:{type:"realtime",tracing:"auto"}});return}if(this.#G!==null&&typeof this.#G!=="string"&&typeof $!=="string"){J6.warn("Tracing config is already set, skipping setting it again. This likely happens when you already set a tracing config on session creation.");return}if($===null){J6.debug("Disabling tracing for this session. It cannot be turned on for this session from this point on."),this.sendEvent({type:"session.update",session:{type:"realtime",tracing:null}});return}if(this.#G===null||typeof this.#G==="string"){this.sendEvent({type:"session.update",session:{type:"realtime",tracing:$}});return}if($?.group_id!==this.#G?.group_id||$?.metadata!==this.#G?.metadata||$?.workflow_name!==this.#G?.workflow_name){J6.warn("Mismatch in tracing config. Ignoring the new tracing config. This likely happens when you already set a tracing config on session creation. Current tracing config: %s, new tracing config: %s",JSON.stringify(this.#G),JSON.stringify($));return}this.sendEvent({type:"session.update",session:{type:"realtime",tracing:$}})}updateSessionConfig($){let X=this.buildSessionPayload($);this.sendEvent({type:"session.update",session:X})}sendFunctionCallOutput($,X,Q=!0){this.sendEvent({type:"conversation.item.create",item:{type:"function_call_output",output:X,call_id:$.callId}});try{let J=yP.parse({itemId:$.id,previousItemId:$.previousItemId,type:"function_call",status:"completed",arguments:$.arguments,name:$.name,output:X});this.emit("item_update",J)}catch(J){J6.error("Error parsing tool call item",J,$)}if(Q)this.sendEvent({type:"response.create"})}sendAudio($,{commit:X=!1}={}){if(this.sendEvent({type:"input_audio_buffer.append",audio:_P($)}),X)this.sendEvent({type:"input_audio_buffer.commit"})}resetHistory($,X){let{removals:Q,additions:J,updates:Y}=Ad($,X),G=new Set(Q.map((K)=>K.itemId));for(let K of Y)G.add(K.itemId);if(G.size>0)for(let K of G)this.sendEvent({type:"conversation.item.delete",item_id:K});let W=[...J,...Y];for(let K of W)if(K.type==="message"){let V={type:"message",role:K.role,content:K.content,id:K.itemId};if(K.role!=="system"&&K.status)V.status=K.status;this.sendEvent({type:"conversation.item.create",item:V})}else if(K.type==="function_call")J6.warn("Function calls cannot be manually added or updated at the moment. Ignoring.")}sendMcpResponse($,X){this.sendEvent({type:"conversation.item.create",previous_item_id:$.itemId,item:{type:"mcp_approval_response",approval_request_id:$.itemId,approve:X}})}}class s3 extends P7{options;#$;#X={status:"disconnected",peerConnection:void 0,dataChannel:void 0,callId:void 0};#G;#Q=!1;#W=!1;#J;#K=0;constructor($={}){if(typeof RTCPeerConnection==="undefined")throw new Error("WebRTC is not supported in this environment");super($);this.options=$,this.#$=$.baseUrl??"https://api.openai.com/v1/realtime/calls",this.#G=$.useInsecureApiKey??!1}get callId(){return this.#X.callId}get status(){return this.#X.status}get connectionState(){return this.#X}get muted(){return this.#W}async connect($){if(this.#X.status==="connected")return;if(this.#X.status==="connecting"){if(this.#J)return this.#J;J6.warn("Realtime connection already in progress but no promise found");return}let X=$.model??this.currentModel;this.currentModel=X;let Q=$.url??this.#$,J=await this._getApiKey($),Y=typeof J==="string"&&J.startsWith("ek_");if(yJ()&&!this.#G&&!Y)throw new H$("Using the WebRTC connection in a browser environment requires an ephemeral client key. If you need to use a regular API key, use the WebSocket transport or set the `useInsecureApiKey` option to true.");let G=++this.#K;return this.#J=new Promise(async(W,K)=>{try{let V={...$.initialSessionConfig||{},model:this.currentModel},H=new URL(Q),U=new RTCPeerConnection,q=U.createDataChannel("oai-events"),w=void 0,D=(F)=>{F.onconnectionstatechange=()=>{switch(F.connectionState){case"disconnected":case"failed":case"closed":this.close();break}}};D(U),this.#X={status:"connecting",peerConnection:U,dataChannel:q,callId:w},this.emit("connection_change",this.#X.status),q.addEventListener("open",()=>{this.#X={status:"connecting",peerConnection:U,dataChannel:q,callId:w};let F=!1,M,A=()=>{if(F)return;if(F=!0,M!==void 0)clearTimeout(M);if(q.removeEventListener("message",P),q.removeEventListener("close",_),this.#X.status!=="connecting"||this.#X.dataChannel!==q||q.readyState!=="open"){if(this.#X.dataChannel===q)this.close();K(new Error("Connection closed before session config was acknowledged"));return}this.#X={status:"connected",peerConnection:U,dataChannel:q,callId:w},this.emit("connection_change",this.#X.status),this._onOpen(),W()},P=(I)=>{if(JSON.parse(I.data).type==="session.updated")A()},_=()=>{A()};M=setTimeout(()=>{if(!F)J6.warn("Timed out waiting for session.updated ack — resolving connect() anyway"),A()},5000),q.addEventListener("message",P),q.addEventListener("close",_),q.addEventListener("message",(I)=>{this._onMessage(I);let{data:c,isGeneric:J$}=t3(I);if(!c||J$)return;if(c.type==="response.created")this.#Q=!0;else if(c.type==="response.done")this.#Q=!1;if(c.type==="session.created"){this._tracingConfig=c.session.tracing;let U$=typeof V.tracing==="undefined"?"auto":V.tracing;this._updateTracingConfig(U$)}}),this.updateSessionConfig(V)}),q.addEventListener("error",(F)=>{this.close(),this._onError(F),K(F)});let z=this.options.audioElement??document.createElement("audio");z.autoplay=!0,U.ontrack=(F)=>{z.srcObject=F.streams[0]};let N=this.options.mediaStream??await navigator.mediaDevices.getUserMedia({audio:!0});if(U.addTrack(N.getAudioTracks()[0]),this.options.changePeerConnection){let F=U;if(U=await this.options.changePeerConnection(U),F!==U)F.onconnectionstatechange=null;D(U),this.#X={...this.#X,peerConnection:U}}let L=await U.createOffer();if(await U.setLocalDescription(L),!L.sdp)throw new Error("Failed to create offer");let O=await fetch(H,{method:"POST",body:L.sdp,headers:{"Content-Type":"application/sdp",Authorization:`Bearer ${J}`,"X-OpenAI-Agents-SDK":Kq["X-OpenAI-Agents-SDK"]}});w=O.headers?.get("Location")?.split("/").pop(),this.#X={...this.#X,callId:w};let Z={type:"answer",sdp:await O.text()};await U.setRemoteDescription(Z)}catch(V){this.close(),this._onError(V),K(V)}}).finally(()=>{if(this.#K===G)this.#J=void 0}),this.#J}sendEvent($){if(!this.#X.dataChannel||this.#X.dataChannel.readyState!=="open")throw new Error("WebRTC data channel is not connected. Make sure you call `connect()` before sending events.");this.#X.dataChannel.send(JSON.stringify($))}mute($){if(this.#W=$,this.#X.peerConnection)this.#X.peerConnection.getSenders().forEach((Q)=>{if(Q.track)Q.track.enabled=!$})}_afterAudioDoneEvent(){this.#Q=!1}close(){if(this.#X.dataChannel)this.#X.dataChannel.close();if(this.#X.peerConnection){let $=this.#X.peerConnection;$.onconnectionstatechange=null,$.getSenders().forEach((X)=>{X.track?.stop()}),$.close()}if(this.#X.status!=="disconnected")this.#X={status:"disconnected",peerConnection:void 0,dataChannel:void 0,callId:void 0},this.emit("connection_change",this.#X.status),this._onClose()}interrupt(){if(this.#Q)this.sendEvent({type:"response.cancel"}),this.#Q=!1;this.sendEvent({type:"output_audio_buffer.clear"})}}function kd(){return!1}var Sd=!1;class hG extends P7{#$;#X;#G;#Q={status:"disconnected",websocket:void 0};#W;#J;#K;_firstAudioTimestamp;_audioLengthMs=0;#Y=!1;#V;#U;#H(){this.#J=void 0,this._firstAudioTimestamp=void 0,this._audioLengthMs=0,this.#K=void 0}constructor($={}){super($);this.#X=$.url,this.#G=$.url,this.#W=$.useInsecureApiKey??!1,this.#V=$.createWebSocket,this.#U=$.skipOpenEventListeners??!1}getCommonRequestHeaders(){return Kq}get status(){return this.#Q.status}get connectionState(){return this.#Q}get muted(){return null}get currentItemId(){return this.#J}_onAudio($){this.emit("audio",$)}_afterAudioDoneEvent(){this.#H()}async#q($,X,Q){if(this.#Q.websocket){$();return}if(!this.#$)throw new H$("API key is not set. Please call `connect()` with an API key first.");if(kd()&&!this.#$.startsWith("ek_")&&!this.#W)throw new H$("Using the WebSocket connection in a browser environment requires an ephemeral client key. If you have to use a regular API key, set the `useInsecureApiKey` option to true.");let J=null;if(this.#V)J=await this.#V({url:this.#X,apiKey:this.#$});else{let G=Sd?["realtime","openai-insecure-api-key."+this.#$,vd]:{headers:{Authorization:`Bearer ${this.#$}`,...this.getCommonRequestHeaders()}};J=new m7.default(this.#X,G)}this.#Q={status:"connecting",websocket:J},this.emit("connection_change",this.#Q.status);let Y=()=>{this.#Q={status:"connected",websocket:J},this.emit("connection_change",this.#Q.status),this._onOpen(),$()};if(this.#U===!0)Y();else J.addEventListener("open",Y);J.addEventListener("error",(G)=>{this._onError(G),this.#Q={status:"disconnected",websocket:void 0},this.emit("connection_change",this.#Q.status),X(G)}),J.addEventListener("message",(G)=>{this._onMessage(G);let{data:W,isGeneric:K}=t3(G);if(!W||K)return;if(W.type==="response.output_audio.delta"){if(this.#K=W.content_index,this.#J=W.item_id,this._firstAudioTimestamp===void 0)this._firstAudioTimestamp=Date.now(),this._audioLengthMs=0;let V=EP(W.delta),H=this._rawSessionConfig?.audio?.output?.format;if(H&&typeof H==="object"){let q=H.type;if(q==="audio/pcmu"||q==="audio/pcma")this._audioLengthMs+=V.byteLength/8;else if(q==="audio/pcm"){let w=H.rate??24000;this._audioLengthMs+=V.byteLength/2/w*1000}else this._audioLengthMs+=V.byteLength/24/2}else if(typeof H==="string")if(H.startsWith("g711_"))this._audioLengthMs+=V.byteLength/8;else this._audioLengthMs+=V.byteLength/24/2;else this._audioLengthMs+=V.byteLength/24/2;let U={type:"audio",data:V,responseId:W.response_id};this._onAudio(U)}else if(W.type==="input_audio_buffer.speech_started"){let V=this._rawSessionConfig?.audio?.input?.turn_detection?.interrupt_response??!1;this.interrupt(!V)}else if(W.type==="response.created")this.#Y=!0;else if(W.type==="response.done")this.#Y=!1;else if(W.type==="session.created"){this._tracingConfig=W.session.tracing;let V=typeof Q.tracing==="undefined"?"auto":Q.tracing;this._updateTracingConfig(V)}}),J.addEventListener("close",()=>{this.#Q={status:"disconnected",websocket:void 0},this.emit("connection_change",this.#Q.status),this._onClose()})}async connect($){let X=$.model??this.currentModel;this.currentModel=X,this.#$=await this._getApiKey($);let Q=$.callId,J;if($.url)J=$.url,this.#G=$.url;else if(Q)J=`wss://api.openai.com/v1/realtime?call_id=${Q}`;else if(this.#G)J=this.#G;else J=`wss://api.openai.com/v1/realtime?model=${this.currentModel}`;this.#X=J;let Y={...$.initialSessionConfig||{},model:this.currentModel};await new Promise((G,W)=>{this.#q(G,W,Y).catch(W)}),await this.updateSessionConfig(Y)}sendEvent($){if(!this.#Q.websocket)throw new Error("WebSocket is not connected. Make sure you call `connect()` before sending events.");this.#Q.websocket.send(JSON.stringify($))}close(){this.#Q.websocket?.close(),this.#J=void 0,this._firstAudioTimestamp=void 0,this._audioLengthMs=0,this.#K=void 0}mute($){throw new Error("Mute is not supported for the WebSocket transport. You have to mute the audio input yourself.")}sendAudio($,X={}){if(this.#Q.status==="connected")super.sendAudio($,X)}_cancelResponse(){if(this.#Y)this.sendEvent({type:"response.cancel"}),this.#Y=!1}_interrupt($,X=!0){if($<0)return;if(X)this._cancelResponse();let Q=this._audioLengthMs??Number.POSITIVE_INFINITY,J=Math.max(0,Math.floor(Math.min($,Q)));this.emit("audio_interrupted"),this.sendEvent({type:"conversation.item.truncate",item_id:this.#J,content_index:this.#K,audio_end_ms:J})}interrupt($=!0){if(!this.#J||typeof this._firstAudioTimestamp!=="number")return;let X=Date.now()-this._firstAudioTimestamp;if(X>=0)this._interrupt(X,$);this.#H()}}var SB$=Symbol("backgroundResult");function hP($){return typeof $==="object"&&$!==null&&SB$ in $}function Cd($){return $.type==="function"||$.type==="hosted_tool"&&$.name==="hosted_mcp"}function yd($){if($.type==="function")return $;if($.type==="hosted_tool"&&$.name==="hosted_mcp"){let X=$.providerData.server_url&&$.providerData.server_url.length>0?$.providerData.server_url:void 0;return{type:"mcp",server_label:$.providerData.server_label,server_url:X,headers:$.providerData.headers,allowed_tools:$.providerData.allowed_tools,require_approval:$.providerData.require_approval}}throw new H$(`Invalid tool type: ${$}`)}function CB$(){return JSON.parse(JSON.stringify(X0))}var uP="Tool execution was not approved.";function yB$($){return $ instanceof Error?$.message:String($)}class e3 extends H8.EventEmitter{initialAgent;options;#$;#X;#G;#Q;#W=[];#J;#K={};#Y=[];#V;#U={};#H=!1;#q=new Map;#B=[];#z=CB$();#N=!0;#w=!1;constructor($,X={}){super();if(this.initialAgent=$,this.options=X,typeof X.transport==="undefined"&&jd()||X.transport==="webrtc")this.#$=new s3;else if(X.transport==="websocket"||typeof X.transport==="undefined")this.#$=new hG;else this.#$=X.transport;this.#X=$,this.#Q=new N6({...X.context??{},history:this.#Y}),this.#W=(X.outputGuardrails??[]).map(bd),this.#J=xd(X.outputGuardrailSettings??{}),this.#V=X.historyStoreAudio??!1,this.#N=X.automaticallyTriggerResponseForMcpToolCalls??!0}get transport(){return this.#$}get currentAgent(){return this.#X}get usage(){return this.#Q.usage}get context(){return this.#Q}get muted(){return this.#$.muted}get history(){return this.#Y}get availableMcpTools(){return this.#B}async#D($){this.#X=$;let X=await this.#X.getEnabledHandoffs(this.#Q),Q=X.map((W)=>W.getHandoffAsFunctionTool()),J=(await this.#X.getAllTools(this.#Q)).filter(Cd).map(yd),Y=typeof this.#X.tools!=="undefined"||typeof this.#X.mcpServers!=="undefined",G=X.length>0;this.#G=Y||G?[...J,...Q]:void 0,this.#Z()}async#L($={}){let X=$??{},Q=this.options.config??{},J=await this.#X.getSystemPrompt(this.#Q),Y=(q)=>{return q.audio?.output?.voice},G=this.options.tracingDisabled?null:this.options.workflowName?{workflow_name:this.options.workflowName}:"auto";if(G!==null&&G!=="auto"){if(this.options.groupId)G.group_id=this.options.groupId;if(this.options.traceMetadata)G.metadata=this.options.traceMetadata}else if(this.options.groupId||this.options.traceMetadata)J6.warn("In order to set traceMetadata or a groupId you need to specify a workflowName.");let W=Y(X)??Y(Q),K=X.voice??Q.voice,V=typeof W!=="undefined"?W:typeof K!=="undefined"?K:this.#X.voice,U={...{...this.#z??{},...Q,...X},instructions:J,voice:V,model:this.options.model,tools:this.#G,tracing:G,prompt:typeof this.#X.prompt==="function"?await this.#X.prompt(this.#Q,this.#X):this.#X.prompt};return this.#z=U,U}async getInitialSessionConfig($={}){return await this.#D(this.initialAgent),this.#L({...this.options.config??{},...$??{}})}static async computeInitialSessionConfig($,X={},Q={}){let J=new e3($,X);try{return await J.getInitialSessionConfig(Q)}finally{J.close()}}async updateAgent($){return this.#X.emit("agent_handoff",this.#Q,$),this.emit("agent_handoff",this.#Q,this.#X,$),await this.#D($),await this.#$.updateSessionConfig(await this.#L()),$}async#M($,X){let Q=await X.onInvokeHandoff(this.#Q,$.arguments);this.#X.emit("agent_handoff",this.#Q,Q),this.emit("agent_handoff",this.#Q,this.#X,Q),await this.#D(Q),await this.#$.updateSessionConfig(await this.#L());let J=_G(Q);return this.#$.sendFunctionCallOutput($,J,!0),Q}async#A($,X){let{toolErrorFormatter:Q}=this.options;if(!Q)return uP;try{let J=await Q({kind:"approval_rejected",toolType:"function",toolName:$,callId:X,defaultMessage:uP,runContext:this.#Q});if(typeof J==="string")return J;if(typeof J!=="undefined")J6.warn("toolErrorFormatter returned a non-string value. Falling back to the default tool approval rejection message.")}catch(J){J6.warn(`toolErrorFormatter threw while formatting approval rejection: ${yB$(J)}`)}return uP}async#F($,X){this.#Q.context.history=JSON.parse(JSON.stringify(this.#Y));let Q=$.arguments;if(X.parameters)if(l6(X.parameters))Q=X.parameters.parse(Q);else Q=JSON.parse(Q);if(await X.needsApproval(this.#Q,Q,$.callId)){let V=this.context.isToolApproved({toolName:X.name,callId:$.callId});if(V===!1){this.emit("agent_tool_start",this.#Q,this.#X,X,{toolCall:$}),this.#X.emit("agent_tool_start",this.#Q,X,{toolCall:$});let H=await this.#A(X.name,$.callId);this.#$.sendFunctionCallOutput($,H,!0),this.emit("agent_tool_end",this.#Q,this.#X,X,H,{toolCall:$}),this.#X.emit("agent_tool_end",this.#Q,X,H,{toolCall:$});return}else if(typeof V==="undefined"){this.emit("tool_approval_requested",this.#Q,this.#X,{type:"function_approval",tool:X,approvalItem:new i$($,this.#X)});return}}let Y=await SG({guardrails:X.inputGuardrails,context:this.#Q,agent:this.#X,toolCall:$});this.emit("agent_tool_start",this.#Q,this.#X,X,{toolCall:$}),this.#X.emit("agent_tool_start",this.#Q,X,{toolCall:$}),this.#Q.context.history=JSON.parse(JSON.stringify(this.#Y));let G=Y.type==="reject"?Y.message:await uJ({tool:X,runContext:this.#Q,input:$.arguments,details:{toolCall:$}}),W=Y.type==="reject"?G:await CG({guardrails:X.outputGuardrails,context:this.#Q,agent:this.#X,toolCall:$,toolOutput:G}),K;if(hP(W))K=E1(W.content),this.#$.sendFunctionCallOutput($,K,!1);else K=E1(W),this.#$.sendFunctionCallOutput($,K,!0);this.emit("agent_tool_end",this.#Q,this.#X,X,K,{toolCall:$}),this.#X.emit("agent_tool_end",this.#Q,X,K,{toolCall:$})}async#j($){let X=await this.#X.getEnabledHandoffs(this.#Q),Q=new Map(X.map((W)=>[W.toolName,W])),J=await this.#X.getAllTools(this.#Q),Y=new Map(J.map((W)=>[W.name,W])),G=Q.get($.name);if(G)await this.#M($,G);else{let W=Y.get($.name);if(W&&W.type==="function")await this.#F($,W);else throw new b4(`Tool ${$.name} not found`)}}async#O($,X,Q){if(this.#W.length===0)return;let J={agent:this.#X,agentOutput:$,context:this.#Q},G=(await Promise.all(this.#W.map((W)=>W.run(J)))).find((W)=>W.output.tripwireTriggered);if(G){if(this.#U[X])return;this.#U[X]=!0;let W=new u9(`Output guardrail triggered: ${JSON.stringify(G.output.outputInfo)}`,G);this.emit("guardrail_tripped",this.#Q,this.#X,W,{itemId:Q}),this.interrupt();let K=Id(G);this.sendMessage(K);return}}#v(){this.#$.on("*",(Q)=>{if(this.emit("transport_event",Q),Q.type==="conversation.item.input_audio_transcription.completed")try{let J=Q;this.#Y=kP(this.#Y,J,this.#V),this.#Q.context.history=this.#Y,this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("mcp_tools_listed",({serverLabel:Q,tools:J})=>{try{this.#q.set(Q,J??[]),this.#Z()}catch(Y){this.emit("error",{type:"error",error:Y})}}),this.#$.on("audio",(Q)=>{if(!this.#H)this.#H=!0,this.emit("audio_start",this.#Q,this.#X);this.emit("audio",Q)}),this.#$.on("turn_started",()=>{this.#H=!1,this.emit("agent_start",this.#Q,this.#X),this.#X.emit("agent_start",this.#Q,this.#X)}),this.#$.on("turn_done",(Q)=>{let J=Q.response.output??[],Y="",G="";for(let W=J.length-1;W>=0;W--){let K=J[W],V=TP(K);if(typeof V==="string"){Y=V;let H=K?.id;G=typeof H==="string"?H:"";break}}if(!G&&J.length>0){let W=J[J.length-1];G=typeof W?.id==="string"?W.id:""}this.emit("agent_end",this.#Q,this.#X,Y),this.#X.emit("agent_end",this.#Q,Y),this.#O(Y,Q.response.id,G)}),this.#$.on("audio_done",()=>{if(this.#H)this.#H=!1;this.emit("audio_stopped",this.#Q,this.#X)});let $=0,X;this.#$.on("audio_transcript_delta",(Q)=>{try{let{delta:J,itemId:Y,responseId:G}=Q;if(X!==Y)X=Y,$=0;let K=(this.#K[Y]??"")+J;if(this.#K[Y]=K,this.#J.debounceTextLength<0)return;let V=Math.floor(K.length/this.#J.debounceTextLength);if(V>$)$=V,this.#O(K,G,Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("item_update",(Q)=>{try{let J=!this.#Y.some((Y)=>Y.itemId===Q.itemId);if(this.#Y=kP(this.#Y,Q,this.#V),this.#Q.context.history=this.#Y,J){let Y=this.#Y.find((G)=>G.itemId===Q.itemId);if(Y)this.emit("history_added",Y)}this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("item_deleted",(Q)=>{try{this.#Y=this.#Y.filter((J)=>J.itemId!==Q.itemId),this.#Q.context.history=this.#Y,this.emit("history_updated",this.#Y)}catch(J){this.emit("error",{type:"error",error:J})}}),this.#$.on("function_call",async(Q)=>{try{await this.#j(Q)}catch(J){J6.error("Error handling function call",J),this.emit("error",{type:"error",error:J})}}),this.#$.on("usage_update",(Q)=>{this.#Q.usage.add(Q)}),this.#$.on("audio_interrupted",()=>{if(this.#H)this.#H=!1;this.emit("audio_interrupted",this.#Q,this.#X)}),this.#$.on("error",(Q)=>{this.emit("error",Q)}),this.#$.on("mcp_tool_call_completed",(Q)=>{if(this.emit("mcp_tool_call_completed",this.#Q,this.#X,Q),this.#N)this.#$.sendEvent({type:"response.create"})}),this.#$.on("mcp_approval_request",(Q)=>{this.emit("tool_approval_requested",this.#Q,this.#X,{type:"mcp_approval_request",approvalItem:Pd(this.#X,Q)})})}#Z(){let $=this.#G?.filter((W)=>W.type==="mcp"),X=(W)=>{let K=W.allowed_tools;if(!K)return;if(Array.isArray(K))return K;if(K&&Array.isArray(K.tool_names))return K.tool_names;return},Q=new Map;for(let W of $){let K=this.#q.get(W.server_label)??[],V=X(W);for(let H of K){if(V&&!V.includes(H.name))continue;if(!Q.has(H.name))Q.set(H.name,H)}}let J=Array.from(Q.values()),Y=this.#B;if(Y.length!==J.length||JSON.stringify(Y.map((W)=>W.name).sort())!==JSON.stringify(J.map((W)=>W.name).sort()))this.#B=J,this.emit("mcp_tools_changed",this.#B)}async connect($){if(await this.#D(this.initialAgent),!this.#w)this.#v(),this.#w=!0;await this.#$.connect({apiKey:$.apiKey??this.options.apiKey,model:this.options.model,url:$.url,callId:$.callId,initialSessionConfig:await this.#L(this.options.config)}),this.#Y=[],this.emit("history_updated",this.#Y)}updateHistory($){let X;if(typeof $==="function")X=$(this.#Y);else X=$;this.#$.resetHistory(this.#Y,X)}sendMessage($,X={}){this.#$.sendMessage($,X)}addImage($,{triggerResponse:X=!0}={}){this.#$.addImage($,{triggerResponse:X})}mute($){this.#$.mute($)}close(){this.#U={},this.#$.close()}sendAudio($,X={}){this.#$.sendAudio($,X)}interrupt(){this.#$.interrupt()}async approve($,X={alwaysApprove:!1}){this.#Q.approveTool($,X);let Q=$.toolName??$.rawItem.name,J=this.#X.tools.find((Y)=>Y.name===Q);if(J&&J.type==="function"&&$.rawItem.type==="function_call")await this.#F($.rawItem,J);else if($.rawItem.type==="hosted_tool_call"){if(X.alwaysApprove)J6.warn("Always approving MCP tools is not supported. Use the allowed tools configuration instead.");let Y=SP($);this.#$.sendMcpResponse(Y,!0)}else throw new b4(`Tool ${Q??"unknown"} not found`)}async reject($,X={alwaysReject:!1}){this.#Q.rejectTool($,X);let Q=$.toolName??$.rawItem.name,J=this.#X.tools.find((Y)=>Y.name===Q);if(J&&J.type==="function"&&$.rawItem.type==="function_call")await this.#F($.rawItem,J);else if($.rawItem.type==="hosted_tool_call"){if(X.alwaysReject)J6.warn("Always rejecting MCP tools is not supported. Use the allowed tools configuration instead.");let Y=SP($);this.#$.sendMcpResponse(Y,!1)}else throw new b4(`Tool ${Q??"unknown"} not found`)}}X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();X6();var fB$=class{apply($,X){if(!X.type)return;let Q=Array.isArray(X.type)?X.type:[X.type],J=new Set(Q);if(!J.has("string"))$.string=!1;if(!J.has("number")&&!J.has("integer"))$.number=!1;if(!J.has("boolean"))$.boolean=!1;if(!J.has("null"))$.null=!1;if(!J.has("array"))$.array=!1;if(!J.has("object"))$.object=!1;if(J.has("integer")&&$.number!==!1){let Y=$.number||B.number();if(Y instanceof B.ZodNumber)$.number=Y.int()}}},gB$=class{apply($,X){if(X.const===void 0)return;let Q=X.const;if($.string=!1,$.number=!1,$.boolean=!1,$.null=!1,$.array=!1,$.object=!1,typeof Q==="string")$.string=B.literal(Q);else if(typeof Q==="number")$.number=B.literal(Q);else if(typeof Q==="boolean")$.boolean=B.literal(Q);else if(Q===null)$.null=B.null();else if(Array.isArray(Q))$.array=void 0;else if(typeof Q==="object")$.object=void 0}},hB$=class{apply($,X){if(!X.enum)return;if(X.enum.length===0){if(!X.type)$.string=!1,$.number=!1,$.boolean=!1,$.null=!1,$.array=!1,$.object=!1;return}let Q={string:X.enum.filter((J)=>typeof J==="string"),number:X.enum.filter((J)=>typeof J==="number"),boolean:X.enum.filter((J)=>typeof J==="boolean"),null:X.enum.filter((J)=>J===null),array:X.enum.filter((J)=>Array.isArray(J)),object:X.enum.filter((J)=>typeof J==="object"&&J!==null&&!Array.isArray(J))};$.string=this.createTypeSchema(Q.string,"string"),$.number=this.createTypeSchema(Q.number,"number"),$.boolean=this.createTypeSchema(Q.boolean,"boolean"),$.null=Q.null.length>0?B.null():!1,$.array=Q.array.length>0?void 0:!1,$.object=Q.object.length>0?void 0:!1}createTypeSchema($,X){if($.length===0)return!1;if($.length===1)return B.literal($[0]);if(X==="string")return B.enum($);if(X==="number"){let[Q,J,...Y]=$;return B.union([B.literal(Q),B.literal(J),...Y.map((G)=>B.literal(G))])}if(X==="boolean")return B.union([B.literal(!0),B.literal(!1)]);return!1}},uB$=class{apply($,X){let Q=X;if(Q.type==="string"&&Q.format==="binary"&&Q.contentEncoding==="binary"){let J=B.file();if(Q.minLength!==void 0)J=J.min(Q.minLength);if(Q.maxLength!==void 0)J=J.max(Q.maxLength);if(Q.contentMediaType!==void 0)J=J.mime(Q.contentMediaType);$.file=J,$.string=!1}}},mB$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.minLength!==void 0||Q.maxLength!==void 0||Q.pattern!==void 0)){if($.string===void 0)$.string=B.string()}}},cB$=class{apply($,X){let Q=X;if(Q.minLength===void 0)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString)$.string=J.refine((Y)=>{return Array.from(Y).length>=Q.minLength},{message:`String must be at least ${Q.minLength} characters long`})}}},iB$=class{apply($,X){let Q=X;if(Q.maxLength===void 0)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString)$.string=J.refine((Y)=>{return Array.from(Y).length<=Q.maxLength},{message:`String must be at most ${Q.maxLength} characters long`})}}},lB$=class{apply($,X){let Q=X;if(!Q.pattern)return;if($.string!==!1){let J=$.string||B.string();if(J instanceof B.ZodString){let Y=new RegExp(Q.pattern);$.string=J.regex(Y)}}}},pB$=class{apply($,X){let Q=X;if(Q.minimum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.min(Q.minimum)}}},nB$=class{apply($,X){let Q=X;if(Q.maximum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.max(Q.maximum)}}},dB$=class{apply($,X){let Q=X;if(Q.exclusiveMinimum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)if(typeof Q.exclusiveMinimum==="number")$.number=J.gt(Q.exclusiveMinimum);else $.number=!1}}},aB$=class{apply($,X){let Q=X;if(Q.exclusiveMaximum===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)if(typeof Q.exclusiveMaximum==="number")$.number=J.lt(Q.exclusiveMaximum);else $.number=!1}}},oB$=class{apply($,X){let Q=X;if(Q.multipleOf===void 0)return;if($.number!==!1){let J=$.number||B.number();if(J instanceof B.ZodNumber)$.number=J.refine((Y)=>{if(Q.multipleOf===0)return!1;let G=Y/Q.multipleOf,W=Math.round(G),K=Math.min(Math.abs(Y)*Number.EPSILON*10,Math.abs(Q.multipleOf)*Number.EPSILON*10);return Math.abs(G-W)<=K/Math.abs(Q.multipleOf)},{message:`Must be a multiple of ${Q.multipleOf}`})}}},rB$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.minItems!==void 0||Q.maxItems!==void 0||Q.items!==void 0||Q.prefixItems!==void 0)){if($.array===void 0)$.array=B.array(B.any())}}},tB$=class{apply($,X){let Q=X;if(Q.minItems===void 0)return;if($.array!==!1)$.array=($.array||B.array(B.any())).min(Q.minItems)}},sB$=class{apply($,X){let Q=X;if(Q.maxItems===void 0)return;if($.array!==!1)$.array=($.array||B.array(B.any())).max(Q.maxItems)}},eB$=class{apply($,X){let Q=X;if($.array===!1)return;if(Array.isArray(Q.items))$.array=$.array||B.array(B.any());else if(Q.items&&typeof Q.items!=="boolean"&&!Q.prefixItems){let J=v6(Q.items),Y=B.array(J);if($.array&&$.array instanceof B.ZodArray){let G=$.array._def;if(G.checks)G.checks.forEach((W)=>{if(W._zod&&W._zod.def){let K=W._zod.def;if(K.check==="min_length"&&K.minimum!==void 0)Y=Y.min(K.minimum);else if(K.check==="max_length"&&K.maximum!==void 0)Y=Y.max(K.maximum)}})}$.array=Y}else if(typeof Q.items==="boolean"&&Q.items===!1)if(!Q.prefixItems)$.array=B.array(B.any()).max(0);else $.array=$.array||B.array(B.any());else if(typeof Q.items==="boolean"&&Q.items===!0)$.array=$.array||B.array(B.any());else if(Q.prefixItems)$.array=$.array||B.array(B.any())}},$q$=class{apply($,X){if(X.type!=="array")return;let Q=X;if(!Array.isArray(Q.items))return;if($.array===!1)return;let J=Q.items.map((G)=>v6(G)),Y;if(J.length===0)Y=B.tuple([]);else Y=B.tuple(J);if(Q.minItems!==void 0&&Q.minItems>J.length)Y=!1;if(Q.maxItems!==void 0&&Q.maxItems<J.length)Y=!1;$.tuple=Y,$.array=!1}},Xq$=class{apply($,X){let Q=X;if($.object===!1)return;if(Q.properties||Q.required||Q.additionalProperties!==void 0)$.object=$.object||B.object({}).passthrough()}},Qq$=class{apply($,X){let Q=X;if(X.type===void 0&&(Q.maxProperties!==void 0||Q.minProperties!==void 0)){if($.object===void 0)$.object=B.object({}).passthrough()}}},Yq$=class{apply($,X){let Q=X;if(Q.maxProperties===void 0)return;if($.object!==!1){let J=$.object||B.object({}).passthrough();$.object=J.refine((Y)=>Object.keys(Y).length<=Q.maxProperties,{message:`Object must have at most ${Q.maxProperties} properties`})}}},Jq$=class{apply($,X){let Q=X;if(Q.minProperties===void 0)return;if($.object!==!1){let J=$.object||B.object({}).passthrough();$.object=J.refine((Y)=>Object.keys(Y).length>=Q.minProperties,{message:`Object must have at least ${Q.minProperties} properties`})}}};function uG($,X){if($===X)return!0;if($==null||X==null)return $===X;if(typeof $!==typeof X)return!1;if(Array.isArray($)&&Array.isArray(X)){if($.length!==X.length)return!1;return $.every((Q,J)=>uG(Q,X[J]))}if(typeof $==="object"&&typeof X==="object"){let Q=Object.keys($),J=Object.keys(X);if(Q.length!==J.length)return!1;return Q.every((Y)=>J.includes(Y)&&uG($[Y],X[Y]))}return!1}function Gq$(){return($)=>{if(!Array.isArray($))return!0;let X=[];return $.every((Q)=>{if(X.some((Y)=>uG(Q,Y)))return!1;return X.push(Q),!0})}}function Uq($,X){return $.safeParse(X).success}var Wq$=class{apply($,X){if(!X.not)return $;let Q=v6(X.not);return $.refine((J)=>!Uq(Q,J),{message:"Value must not match the 'not' schema"})}},Kq$=class{apply($,X){if(X.uniqueItems!==!0)return $;return $.refine(Gq$(),{message:"Array items must be unique"})}},Vq$=class{apply($,X){if(!X.allOf||X.allOf.length===0)return $;return X.allOf.map((J)=>v6(J)).reduce((J,Y)=>B.intersection(J,Y),$)}},Hq$=class{apply($,X){if(!X.anyOf||X.anyOf.length===0)return $;let Q=X.anyOf.length===1?v6(X.anyOf[0]):B.union([v6(X.anyOf[0]),v6(X.anyOf[1]),...X.anyOf.slice(2).map((J)=>v6(J))]);return B.intersection($,Q)}},Uq$=class{apply($,X){if(!X.oneOf||X.oneOf.length===0)return $;let Q=X.oneOf.map((J)=>v6(J));return $.refine((J)=>{let Y=0;for(let G of Q)if(G.safeParse(J).success){if(Y++,Y>1)return!1}return Y===1},{message:"Value must match exactly one of the oneOf schemas"})}},Bq$=class{apply($,X){let Q=X;if(Q.prefixItems&&Array.isArray(Q.prefixItems)){let Y=Q.prefixItems.map((G)=>v6(G));return $.refine((G)=>{if(!Array.isArray(G))return!0;for(let W=0;W<Math.min(G.length,Y.length);W++)if(!Uq(Y[W],G[W]))return!1;if(G.length>Y.length){if(typeof Q.items==="boolean"&&Q.items===!1)return!1;else if(Q.items&&typeof Q.items==="object"&&!Array.isArray(Q.items)){let W=v6(Q.items);for(let K=Y.length;K<G.length;K++)if(!Uq(W,G[K]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return $}},qq$=class{apply($,X){let Q=X;if(!Q.properties&&!Q.required&&Q.additionalProperties!==!1)return $;if($ instanceof B.ZodObject||$ instanceof B.ZodRecord){let J={};if(Q.properties){for(let[Y,G]of Object.entries(Q.properties))if(G!==void 0)J[Y]=v6(G)}if(Q.required&&Array.isArray(Q.required)){let Y=new Set(Q.required);for(let G of Object.keys(J))if(!Y.has(G))J[G]=J[G].optional()}else for(let Y of Object.keys(J))J[Y]=J[Y].optional();if(Q.additionalProperties===!1)return B.object(J);else return B.object(J).passthrough()}return $.refine((J)=>{if(typeof J!=="object"||J===null||Array.isArray(J))return!0;if(Q.properties){for(let[Y,G]of Object.entries(Q.properties))if(G!==void 0){if(Object.getOwnPropertyDescriptor(J,Y)!==void 0){if(!v6(G).safeParse(J[Y]).success)return!1}}}if(Q.required&&Array.isArray(Q.required)){for(let Y of Q.required)if(Object.getOwnPropertyDescriptor(J,Y)===void 0)return!1}if(Q.additionalProperties===!1&&Q.properties){let Y=new Set(Object.keys(Q.properties));for(let G in J)if(!Y.has(G))return!1}return!0},{message:"Object constraints validation failed"})}},wq$=class{apply($,X){if(!X.enum||X.enum.length===0)return $;let Q=X.enum.filter((J)=>Array.isArray(J)||typeof J==="object"&&J!==null);if(Q.length===0)return $;return $.refine((J)=>{if(typeof J!=="object"||J===null)return!0;return Q.some((Y)=>uG(J,Y))},{message:"Value must match one of the enum values"})}},zq$=class{apply($,X){if(X.const===void 0)return $;let Q=X.const;if(typeof Q!=="object"||Q===null)return $;return $.refine((J)=>uG(J,Q),{message:"Value must equal the const value"})}},Nq$=class{apply($,X){if(X.description)$=$.describe(X.description);return $}},Dq$=class{apply($,X){var Q;let J=X;if(!((Q=J.required)==null?void 0:Q.includes("__proto__"))||X.type!==void 0)return $;return B.any().refine((Y)=>this.validateRequired(Y,J.required),{message:"Missing required properties"})}validateRequired($,X){if(typeof $!=="object"||$===null||Array.isArray($))return!0;return X.every((Q)=>Object.prototype.hasOwnProperty.call($,Q))}},Lq$=class{apply($,X){var Q;let J=X;if(J.contains===void 0)return $;let Y=v6(J.contains),G=(Q=J.minContains)!=null?Q:1,W=J.maxContains;return $.refine((K)=>{if(!Array.isArray(K))return!0;let V=0;for(let H of K)if(Uq(Y,H))V++;if(V<G)return!1;if(W!==void 0&&V>W)return!1;return!0},{message:"Array must contain required items matching the schema"})}},Fq$=class{apply($,X){let{default:Q}=X;if(Q===void 0)return $;if(!$.safeParse(Q).success)return $;return $.default(Q)}},Oq$=[new gB$,new hB$,new fB$,new uB$,new mB$,new rB$,new Qq$,new cB$,new iB$,new lB$,new pB$,new nB$,new dB$,new aB$,new oB$,new $q$,new tB$,new sB$,new eB$,new Yq$,new Jq$,new Xq$],Zq$=[new Dq$,new wq$,new zq$,new Vq$,new Hq$,new Uq$,new Bq$,new qq$,new Lq$,new Wq$,new Kq$,new Fq$,new Nq$];function v6($){if(typeof $==="boolean")return $?B.any():B.never();let X={};for(let Y of Oq$)Y.apply(X,$);let Q=[];if(X.string!==!1)Q.push(X.string||B.string());if(X.number!==!1)Q.push(X.number||B.number());if(X.boolean!==!1)Q.push(X.boolean||B.boolean());if(X.null!==!1)Q.push(X.null||B.null());if(X.array!==!1)Q.push(X.array||B.array(B.any()));if(X.tuple!==!1&&X.tuple!==void 0)Q.push(X.tuple);if(X.object!==!1)if(X.object)Q.push(X.object);else{let Y=B.custom((G)=>{return typeof G==="object"&&G!==null&&!Array.isArray(G)},"Must be an object, not an array");Q.push(Y)}if(X.file!==!1&&X.file!==void 0)Q.push(X.file);let J;if(Q.length===0)J=B.never();else if(Q.length===1)J=Q[0];else if(!Object.keys($).some((G)=>G!=="$schema"&&G!=="title"&&G!=="description"))J=B.any();else J=B.union(Q);for(let Y of Zq$)J=Y.apply(J,$);return J}var H5=require("react/jsx-runtime"),Mq$=({data:$,setUiAjaxConfiguration:X})=>{let{name:Q,titles:J,instructions:Y,tools:G,token:W,autoStart:K,muted:V,language:H,outputModalities:U,sxMap:q,iconUrl:w,iconPosition:D,useSocketioSupport:z,useCentrifugeSupport:N,useMittSupport:L,centrifugeChannel:O}=$,{apiServer:Z,enableRenderingLog:F}=s8(),[M,A]=P6.useState(null),[P,_]=P6.useState(null),[I,c]=P6.useState(null),[J$,U$]=P6.useState(!1),[I$,t]=P6.useState([]),[,R$]=P6.useState(null),T$=P6.useRef(null),g=P6.useMemo(()=>{return G.map((m)=>{let B$=Dz(X??(()=>{}),m.kwargs,m.depsNames,m.pathname,{apiServer:Z,renderingLogEnabled:F});return u8({name:m.name,description:m.description,parameters:v6(m.params),async execute(w4){console.log(`Calling tool: ${m.name} with: ${JSON.stringify(w4)}`);let N$=await B$(w4);if(!Array.isArray(N$))return[];return N$.filter((O$)=>O$.name===`pietoolOutput_${Q}`).map((O$)=>O$.data.output)}})})},[G,X]),r=()=>{if(console.log("Disconnecting session..."),P)P.close();_(null),A(null),U$(!1)},K$=async(m)=>{if(!P){console.error("Session not initialized");return}if(J$){console.log("Already connected, skipping...");return}try{P.on("history_updated",(B$)=>{t(B$)}),console.log("Connecting to session..."),R$(null),await P.connect({apiKey:m}),U$(!0),console.log("Connected successfully")}catch(B$){console.error("Failed to connect to session:",B$),R$(B$ instanceof Error?B$.message:"Failed to connect"),U$(!1)}};return P6.useEffect(()=>{if(!T$.current)return;if(!I)navigator.mediaDevices.getUserMedia({audio:!0}).then(async(m)=>{c(new s3({mediaStream:m,audioElement:T$.current}))})},[T$]),P6.useEffect(()=>{if(!T$.current)return;if(!I)return;if(M===null||P===null){let m=new Vq({name:Q,instructions:Y,tools:g}),B$=new e3(m,{model:"gpt-realtime",transport:I,config:{outputModalities:U,audio:{input:{transcription:{language:H??void 0,model:"gpt-4o-mini-transcribe"}}},inputAudioTranscription:{language:H??void 0,model:"gpt-4o-mini-transcribe"}}});A(m),_(B$)}},[M,P,Q,Y,g,T$,I]),P6.useEffect(()=>{if(M!==null&&P!==null&&K&&W&&!J$)console.log("Auto-connecting..."),K$(W).catch((m)=>{console.error("Auto-connection failed:",m)})},[M,P]),P6.useEffect(()=>{return()=>{console.log("Disconnecting..."),r()}},[]),H5.jsxs(B4,{card:"VoiceAgentCard",data:$,methods:{initializeAI:async(m)=>{if(M!==null&&P!==null&&m.token&&!J$)console.log("Connecting via initialize event..."),await K$(m.token).catch((B$)=>{console.error("Auto-connection failed:",B$)})},stop:()=>{r()}},useCentrifugeSupport:N,useSocketioSupport:z,useMittSupport:L,centrifugeChannel:O,children:[H5.jsxs("button",{id:Q,value:Q,onClick:async()=>{if(J$)r();else if(W)await K$(W)},style:J$?q.enabled:q.disabled,type:"button",children:[w&&D==="start"&&H5.jsx("img",{src:w,alt:""}),m1(J$?J.enabled:J.disabled),w&&D==="end"&&H5.jsx("img",{src:w,alt:""})]}),H5.jsx("input",{type:"hidden",name:Q,value:JSON.stringify(I$)}),H5.jsx("audio",{ref:T$,autoPlay:!0,muted:V,style:{display:"none"}})]})},Bq=Mq$;var U5=require("react");var mP=({data:$})=>{return m1($)};var fd=require("react/jsx-runtime"),cP=({data:$,setUiAjaxConfiguration:X})=>{return fd.jsx(S4,{uiConfig:$,setUiAjaxConfiguration:X})};var d6=require("react/jsx-runtime"),Aq$=({name:$,headers:X,rows:Q,rowUrls:J,selected:Y,columnHeights:G,sx:W,sxMap:K,setUiAjaxConfiguration:V})=>{let H=U5.useContext($6),U=(N,L)=>Array(N.length*L).fill(0).map((O,Z)=>N[Z%N.length]),q=X.map((N)=>N.length),w=q.reduce((N,L)=>N*L,1),D=q.map((N,L)=>Math.floor(w/q.slice(0,L+1).reduce((O,Z)=>O*Z,1))),z=X.map((N,L)=>{return U(N,q.slice(0,L).reduce((O,Z)=>O*Z,1))});return d6.jsxs("table",{id:$,className:"w-full table-auto border-collapse overflow-hidden text-left",style:{...K?.table,...W},children:[d6.jsx("thead",{className:"bg-gray-100",children:z.map((N,L)=>d6.jsx("tr",{className:"border-none",style:K?.row,children:N.map((O,Z)=>d6.jsx("th",{colSpan:D[L],className:"border border-gray-200 px-4 py-2 text-gray-500",style:{width:G?G[Z]:"auto",...K?.cell},children:typeof O==="string"?d6.jsx(mP,{data:O,setUiAjaxConfiguration:V}):d6.jsx(cP,{data:O,setUiAjaxConfiguration:V})},Z))},L))}),d6.jsx("tbody",{children:Q.map((N,L)=>d6.jsx("tr",{className:`border border-gray-200 bg-white ${J&&J[L]?"cursor-pointer":""} ${Y&&Y[L]?"bg-gray-200":""}`,style:K?.row,children:N.map((O,Z)=>d6.jsx("td",{onClick:()=>{if(typeof O==="string"&&J&&J[L])if(J[L].startsWith("http"))window.location.href=J[L];else H?.(J[L])},className:"border border-gray-200 px-4 py-2 text-gray-900",style:{width:G?G[Z]:"auto",...K?.cell},children:typeof O==="string"?d6.jsx(mP,{data:O,setUiAjaxConfiguration:V}):d6.jsx(cP,{data:O,setUiAjaxConfiguration:V})},Z))},L))})]})},jq$=({data:$,setUiAjaxConfiguration:X})=>{let{name:Q,headers:J,rows:Y,rowUrls:G,sx:W,sxMap:K,useSocketioSupport:V,useCentrifugeSupport:H,useMittSupport:U,centrifugeChannel:q}=$,[w,D]=U5.useState([]),[z,N]=U5.useState([]);return U5.useEffect(()=>{D(Y)},[Y]),U5.useEffect(()=>{N(G)},[G]),d6.jsx(B4,{card:"TableCard",data:$,methods:{addrow:(M)=>{D((A)=>[...A,M.row]),N((A)=>[...A,M.url??null])},insertrow:(M)=>{D((A)=>[...A.slice(0,M.idx),M.row,...A.slice(M.idx)]),N((A)=>[...A.slice(0,M.idx),M.url??null,...A.slice(M.idx)])},delrow:(M)=>{D((A)=>[...A.slice(0,M.idx),...A.slice(M.idx+1)]),N((A)=>[...A.slice(0,M.idx),...A.slice(M.idx+1)])},clear:()=>{D(()=>[]),N(()=>[])}},useSocketioSupport:V,useCentrifugeSupport:H,useMittSupport:U,centrifugeChannel:q,children:d6.jsx(Aq$,{name:Q,rows:w,rowUrls:z,headers:J,setUiAjaxConfiguration:X,sx:W,sxMap:K})})},iP=jq$;var gd=require("react");var qq=require("react/jsx-runtime"),vq$=({data:$,content:X,setUiAjaxConfiguration:Q})=>{let{name:J,url:Y,sx:G}=$,W=gd.useContext($6);return qq.jsx(B4,{card:J,data:$,children:qq.jsx("div",{style:G,id:J,onClick:(V)=>{if(Y)if(V.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(Y))window.location.href=Y;else W?.(Y)},children:qq.jsx(S4,{setUiAjaxConfiguration:Q,uiConfig:X})})})},lP=vq$;var pP=!1;function q8(){if(pP)return;D6({name:"SequenceCard",component:ST,metadata:{author:"PieData",description:"Simple div with styles joining few components"}}),D6({name:"BoxCard",component:lP,metadata:{author:"PieData",description:"Simple div with styles joining few components"}}),D6({name:"UnionCard",component:CT,metadata:{author:"PieData",description:"Renders one of many components"}}),D6({name:"AjaxGroupCard",component:yT,metadata:{author:"PieData",description:"Group card with AJAX support"}}),D6({name:"AjaxButtonCard",component:xS,metadata:{author:"PieData",description:"Button with AJAX support"}}),D6({name:"RedirectButtonCard",component:fN,metadata:{author:"PieData",description:"Button with Redirect on click"}}),D6({name:"ChatCard",component:cS,metadata:{author:"PieData"}}),D6({name:"HiddenCard",component:bN,metadata:{author:"PieData"}}),D6({name:"AutoRedirectCard",component:IN,metadata:{author:"PieData"}}),D6({name:"HTMLEmbedCard",component:RN,metadata:{author:"PieData"}}),D6({name:"IOEventsCard",component:yN,metadata:{author:"PieData"}}),D6({name:"OpenAIVoiceAgentCard",component:Bq,metadata:{author:"PieData"}}),D6({name:"TableCard",component:iP,metadata:{author:"PieData"}}),pP=!0}function x6(){return pP}var b6=require("react/jsx-runtime"),Pq$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();B5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=B5.useMemo(()=>hd.createAxiosDateTransformer({baseURL:Y||""}),[Y]),V=B5.useMemo(()=>$9(),[]),H=B5.useMemo(()=>Y?W9(Y):null,[Y]),U=B5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),{data:q,isLoading:w,error:D}=$Q.useQuery({queryKey:["uiConfig",$.pathname+$.search,x6(),Y],queryFn:async()=>{if(!Y||!x6())return;let z=new URLSearchParams($.search);z.set("__pieroot","web");let N="/api/content"+$.pathname+"?"+z.toString();if(W)console.log("[PieRoot] Fetching UI configuration from:",N);let L=await K.get(N,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",L.data);return L.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(z)=>Math.min(1000*2**z,30000)});if(!Y)return X??null;if(W)console.log("[PieRoot] Rendering with location:",$),console.log("[PieRoot] API_SERVER:",Y),console.log("[PieRoot] CENTRIFUGE_SERVER:",G),console.log("[PieRoot] Fallback provided:",!!X);if(D){if(W)console.error("[PieRoot] Error fetching UI configuration:",D),console.error("[PieRoot] Error details:",{message:D.message,status:D.response?.status,data:D.response?.data});return Q?.(),X}if(w||!q){if(W)console.log("[PieRoot] Loading state:",{isLoading:w,hasUiConfiguration:!!q});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",q),console.log("[PieRoot] Rendering UI with configuration");return b6.jsx(y1.Provider,{value:V,children:b6.jsx(g1.Provider,{value:H,children:b6.jsx(h1.Provider,{value:U,children:b6.jsx(k1.Provider,{value:X??b6.jsx(b6.Fragment,{}),children:b6.jsx(H9,{children:b6.jsx(U9,{children:b6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:b6.jsx(S4,{uiConfig:q})})})})})})})})},xq$=($)=>{let X=B5.useMemo(()=>new $Q.QueryClient,[]);return b6.jsx($6.Provider,{value:$.onNavigate,children:b6.jsx(w8.Provider,{value:$.config,children:b6.jsx($Q.QueryClientProvider,{client:X,children:b6.jsx(Pq$,{...$})})})})},ud=xq$;var q5=require("react"),XQ=require("@tanstack/react-query");var cd=Z$(aW());var wq=require("react");var md=()=>{let[$,X]=wq.useState(null),Q=Yx();return wq.useEffect(()=>{if(typeof window==="undefined")return;let J=window.Telegram.WebApp;if(J.ready(),Q==="telegram_expanded"&&(J.platform==="ios"||J.platform==="android"))J.expand();X(J)},[]),$};var I6=require("react/jsx-runtime"),bq$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();q5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=q5.useMemo(()=>cd.createAxiosDateTransformer({baseURL:Y}),[Y]),V=q5.useMemo(()=>$9(),[]),H=q5.useMemo(()=>Y?W9(Y):null,[Y]),U=q5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),q=md(),{data:w,isLoading:D,error:z}=XQ.useQuery({queryKey:["uiConfig",$.pathname+$.search,q?.initData,x6()],queryFn:async()=>{if(!x6())return;let N=new URLSearchParams($.search);if(N.set("__pieroot","telegram"),q?.initData)N.set("initData",q.initData);let L="/api/content"+$.pathname+"?"+N.toString();if(W)console.log("[PieRoot] Fetching UI configuration from:",L);let O=await K.get(L,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",O.data);return O.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(N)=>Math.min(1000*2**N,30000)});if(!Y)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&W)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),Q?.(),X;if(D||!w){if(W)console.log("[PieRoot] Loading state:",{isLoading:D,hasUiConfiguration:!!w});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",w),console.log("[PieRoot] Rendering UI with configuration");return I6.jsx(y1.Provider,{value:V,children:I6.jsx(g1.Provider,{value:H,children:I6.jsx(h1.Provider,{value:U,children:I6.jsx(k1.Provider,{value:X??I6.jsx(I6.Fragment,{}),children:I6.jsx(H9,{children:I6.jsx(U9,{children:I6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:I6.jsx(S4,{uiConfig:w})})})})})})})})},Iq$=($)=>{let X=q5.useMemo(()=>new XQ.QueryClient,[]);return I6.jsx($6.Provider,{value:$.onNavigate,children:I6.jsx(w8.Provider,{value:$.config,children:I6.jsx(XQ.QueryClientProvider,{client:X,children:I6.jsx(bq$,{...$})})})})},id=Iq$;var x7=require("react"),zq=require("@tanstack/react-query");var a6=require("react/jsx-runtime"),Rq$=({location:$,fallback:X,initializePie:Q,children:J})=>{let Y=S1(),G=e8(),W=C1();x7.useEffect(()=>{if(x6())return;q8(),Q()},[]);let K=x7.useMemo(()=>$9(),[]),V=x7.useMemo(()=>Y?W9(Y):null,[Y]),H=x7.useMemo(()=>Y?V9(Y,G):null,[Y,G]);if(W)console.log("[PieRoot] Rendering with location:",$),console.log("[PieRoot] API_SERVER:",Y),console.log("[PieRoot] CENTRIFUGE_SERVER:",G),console.log("[PieRoot] Fallback provided:",!!X);return a6.jsx(y1.Provider,{value:K,children:a6.jsx(g1.Provider,{value:V,children:a6.jsx(h1.Provider,{value:H,children:a6.jsx(k1.Provider,{value:X??a6.jsx(a6.Fragment,{}),children:a6.jsx(H9,{children:a6.jsx(U9,{children:a6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:J})})})})})})})},Eq$=($)=>{let X=x7.useMemo(()=>new zq.QueryClient,[]);return a6.jsx($6.Provider,{value:$.onNavigate,children:a6.jsx(w8.Provider,{value:$.config,children:a6.jsx(zq.QueryClientProvider,{client:X,children:a6.jsx(Rq$,{...$})})})})},ld=Eq$;var w5=require("react"),QQ=require("@tanstack/react-query");var nd=Z$(aW());var Nq=require("react"),pd=()=>{let[$,X]=Nq.useState(null);return Nq.useEffect(()=>{if(typeof window==="undefined")return;let Q=window.WebApp;if(!Q)return;Q.ready(),X(Q)},[]),$};var R6=require("react/jsx-runtime"),_q$=({location:$,fallback:X,onError:Q,initializePie:J})=>{let Y=S1(),G=e8(),W=C1();w5.useEffect(()=>{if(x6())return;q8(),J()},[]);let K=w5.useMemo(()=>nd.createAxiosDateTransformer({baseURL:Y}),[Y]),V=w5.useMemo(()=>$9(),[]),H=w5.useMemo(()=>Y?W9(Y):null,[Y]),U=w5.useMemo(()=>Y?V9(Y,G):null,[Y,G]),q=pd(),{data:w,isLoading:D,error:z}=QQ.useQuery({queryKey:["uiConfig",$.pathname+$.search,q?.initData,x6()],queryFn:async()=>{if(!x6())return;let N=new URLSearchParams($.search);if(N.set("__pieroot","max"),q?.initData)N.set("initData",q.initData);let L="/api/content"+$.pathname+"?"+N.toString();if(W)console.log("[PieRoot] Fetching UI configuration from:",L);let O=await K.get(L,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(W)console.log("[PieRoot] Received UI configuration:",O.data);return O.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(N)=>Math.min(1000*2**N,30000)});if(!Y)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&W)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),Q?.(),X;if(D||!w){if(W)console.log("[PieRoot] Loading state:",{isLoading:D,hasUiConfiguration:!!w});return X}if(W)console.log("[PieRoot] UI configuration loaded successfully:",w),console.log("[PieRoot] Rendering UI with configuration");return R6.jsx(y1.Provider,{value:V,children:R6.jsx(g1.Provider,{value:H,children:R6.jsx(h1.Provider,{value:U,children:R6.jsx(k1.Provider,{value:X??R6.jsx(R6.Fragment,{}),children:R6.jsx(H9,{children:R6.jsx(U9,{children:R6.jsx("form",{id:"piedata_global_form",action:Y+"api/process"+$.pathname,method:"post",encType:"multipart/form-data",children:R6.jsx(S4,{uiConfig:w})})})})})})})})},Tq$=($)=>{let X=w5.useMemo(()=>new QQ.QueryClient,[]);return R6.jsx($6.Provider,{value:$.onNavigate,children:R6.jsx(w8.Provider,{value:$.config,children:R6.jsx(QQ.QueryClientProvider,{client:X,children:R6.jsx(_q$,{...$})})})})},dd=Tq$;function ad($){if(!$)return{};return{...$}}var kq$=($,X)=>{let Q=new Array($.length+X.length);for(let J=0;J<$.length;J++)Q[J]=$[J];for(let J=0;J<X.length;J++)Q[$.length+J]=X[J];return Q},Sq$=($,X)=>({classGroupId:$,validator:X}),$a=($=new Map,X=null,Q)=>({nextPart:$,validators:X,classGroupId:Q});var od=[];var Cq$=($)=>{let X=fq$($),{conflictingClassGroups:Q,conflictingClassGroupModifiers:J}=$;return{getClassGroupId:(W)=>{if(W.startsWith("[")&&W.endsWith("]"))return yq$(W);let K=W.split("-"),V=K[0]===""&&K.length>1?1:0;return Xa(K,V,X)},getConflictingClassGroupIds:(W,K)=>{if(K){let V=J[W],H=Q[W];if(V){if(H)return kq$(H,V);return V}return H||od}return Q[W]||od}}},Xa=($,X,Q)=>{if($.length-X===0)return Q.classGroupId;let Y=$[X],G=Q.nextPart.get(Y);if(G){let H=Xa($,X+1,G);if(H)return H}let W=Q.validators;if(W===null)return;let K=X===0?$.join("-"):$.slice(X).join("-"),V=W.length;for(let H=0;H<V;H++){let U=W[H];if(U.validator(K))return U.classGroupId}return},yq$=($)=>$.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let X=$.slice(1,-1),Q=X.indexOf(":"),J=X.slice(0,Q);return J?"arbitrary.."+J:void 0})(),fq$=($)=>{let{theme:X,classGroups:Q}=$;return gq$(Q,X)},gq$=($,X)=>{let Q=$a();for(let J in $){let Y=$[J];dP(Y,Q,J,X)}return Q},dP=($,X,Q,J)=>{let Y=$.length;for(let G=0;G<Y;G++){let W=$[G];hq$(W,X,Q,J)}},hq$=($,X,Q,J)=>{if(typeof $==="string"){uq$($,X,Q);return}if(typeof $==="function"){mq$($,X,Q,J);return}cq$($,X,Q,J)},uq$=($,X,Q)=>{let J=$===""?X:Qa(X,$);J.classGroupId=Q},mq$=($,X,Q,J)=>{if(iq$($)){dP($(J),X,Q,J);return}if(X.validators===null)X.validators=[];X.validators.push(Sq$(Q,$))},cq$=($,X,Q,J)=>{let Y=Object.entries($),G=Y.length;for(let W=0;W<G;W++){let[K,V]=Y[W];dP(V,Qa(X,K),Q,J)}},Qa=($,X)=>{let Q=$,J=X.split("-"),Y=J.length;for(let G=0;G<Y;G++){let W=J[G],K=Q.nextPart.get(W);if(!K)K=$a(),Q.nextPart.set(W,K);Q=K}return Q},iq$=($)=>("isThemeGetter"in $)&&$.isThemeGetter===!0,lq$=($)=>{if($<1)return{get:()=>{return},set:()=>{}};let X=0,Q=Object.create(null),J=Object.create(null),Y=(G,W)=>{if(Q[G]=W,X++,X>$)X=0,J=Q,Q=Object.create(null)};return{get(G){let W=Q[G];if(W!==void 0)return W;if((W=J[G])!==void 0)return Y(G,W),W},set(G,W){if(G in Q)Q[G]=W;else Y(G,W)}}};var pq$=[],rd=($,X,Q,J,Y)=>({modifiers:$,hasImportantModifier:X,baseClassName:Q,maybePostfixModifierPosition:J,isExternal:Y}),nq$=($)=>{let{prefix:X,experimentalParseClassName:Q}=$,J=(Y)=>{let G=[],W=0,K=0,V=0,H,U=Y.length;for(let N=0;N<U;N++){let L=Y[N];if(W===0&&K===0){if(L===":"){G.push(Y.slice(V,N)),V=N+1;continue}if(L==="/"){H=N;continue}}if(L==="[")W++;else if(L==="]")W--;else if(L==="(")K++;else if(L===")")K--}let q=G.length===0?Y:Y.slice(V),w=q,D=!1;if(q.endsWith("!"))w=q.slice(0,-1),D=!0;else if(q.startsWith("!"))w=q.slice(1),D=!0;let z=H&&H>V?H-V:void 0;return rd(G,D,w,z)};if(X){let Y=X+":",G=J;J=(W)=>W.startsWith(Y)?G(W.slice(Y.length)):rd(pq$,!1,W,void 0,!0)}if(Q){let Y=J;J=(G)=>Q({className:G,parseClassName:Y})}return J},dq$=($)=>{let X=new Map;return $.orderSensitiveModifiers.forEach((Q,J)=>{X.set(Q,1e6+J)}),(Q)=>{let J=[],Y=[];for(let G=0;G<Q.length;G++){let W=Q[G],K=W[0]==="[",V=X.has(W);if(K||V){if(Y.length>0)Y.sort(),J.push(...Y),Y=[];J.push(W)}else Y.push(W)}if(Y.length>0)Y.sort(),J.push(...Y);return J}},aq$=($)=>({cache:lq$($.cacheSize),parseClassName:nq$($),sortModifiers:dq$($),...Cq$($)}),oq$=/\s+/,rq$=($,X)=>{let{parseClassName:Q,getClassGroupId:J,getConflictingClassGroupIds:Y,sortModifiers:G}=X,W=[],K=$.trim().split(oq$),V="";for(let H=K.length-1;H>=0;H-=1){let U=K[H],{isExternal:q,modifiers:w,hasImportantModifier:D,baseClassName:z,maybePostfixModifierPosition:N}=Q(U);if(q){V=U+(V.length>0?" "+V:V);continue}let L=!!N,O=J(L?z.substring(0,N):z);if(!O){if(!L){V=U+(V.length>0?" "+V:V);continue}if(O=J(z),!O){V=U+(V.length>0?" "+V:V);continue}L=!1}let Z=w.length===0?"":w.length===1?w[0]:G(w).join(":"),F=D?Z+"!":Z,M=F+O;if(W.indexOf(M)>-1)continue;W.push(M);let A=Y(O,L);for(let P=0;P<A.length;++P){let _=A[P];W.push(F+_)}V=U+(V.length>0?" "+V:V)}return V},tq$=(...$)=>{let X=0,Q,J,Y="";while(X<$.length)if(Q=$[X++]){if(J=Ya(Q))Y&&(Y+=" "),Y+=J}return Y},Ya=($)=>{if(typeof $==="string")return $;let X,Q="";for(let J=0;J<$.length;J++)if($[J]){if(X=Ya($[J]))Q&&(Q+=" "),Q+=X}return Q},sq$=($,...X)=>{let Q,J,Y,G,W=(V)=>{let H=X.reduce((U,q)=>q(U),$());return Q=aq$(H),J=Q.cache.get,Y=Q.cache.set,G=K,K(V)},K=(V)=>{let H=J(V);if(H)return H;let U=rq$(V,Q);return Y(V,U),U};return G=W,(...V)=>G(tq$(...V))},eq$=[],n4=($)=>{let X=(Q)=>Q[$]||eq$;return X.isThemeGetter=!0,X},Ja=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ga=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$w$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xw$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qw$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yw$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jw$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gw$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z5=($)=>$w$.test($),_$=($)=>!!$&&!Number.isNaN(Number($)),N5=($)=>!!$&&Number.isInteger(Number($)),nP=($)=>$.endsWith("%")&&_$($.slice(0,-1)),r8=($)=>Xw$.test($),Wa=()=>!0,Ww$=($)=>Qw$.test($)&&!Yw$.test($),aP=()=>!1,Kw$=($)=>Jw$.test($),Vw$=($)=>Gw$.test($),Hw$=($)=>!s($)&&!e($),Uw$=($)=>D5($,Ha,aP),s=($)=>Ja.test($),b7=($)=>D5($,Ua,Ww$),td=($)=>D5($,Fw$,_$),Bw$=($)=>D5($,qa,Wa),qw$=($)=>D5($,Ba,aP),sd=($)=>D5($,Ka,aP),ww$=($)=>D5($,Va,Vw$),Dq=($)=>D5($,wa,Kw$),e=($)=>Ga.test($),mG=($)=>I7($,Ua),zw$=($)=>I7($,Ba),ed=($)=>I7($,Ka),Nw$=($)=>I7($,Ha),Dw$=($)=>I7($,Va),Lq=($)=>I7($,wa,!0),Lw$=($)=>I7($,qa,!0),D5=($,X,Q)=>{let J=Ja.exec($);if(J){if(J[1])return X(J[1]);return Q(J[2])}return!1},I7=($,X,Q=!1)=>{let J=Ga.exec($);if(J){if(J[1])return X(J[1]);return Q}return!1},Ka=($)=>$==="position"||$==="percentage",Va=($)=>$==="image"||$==="url",Ha=($)=>$==="length"||$==="size"||$==="bg-size",Ua=($)=>$==="length",Fw$=($)=>$==="number",Ba=($)=>$==="family-name",qa=($)=>$==="number"||$==="weight",wa=($)=>$==="shadow";var Ow$=()=>{let $=n4("color"),X=n4("font"),Q=n4("text"),J=n4("font-weight"),Y=n4("tracking"),G=n4("leading"),W=n4("breakpoint"),K=n4("container"),V=n4("spacing"),H=n4("radius"),U=n4("shadow"),q=n4("inset-shadow"),w=n4("text-shadow"),D=n4("drop-shadow"),z=n4("blur"),N=n4("perspective"),L=n4("aspect"),O=n4("ease"),Z=n4("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...M(),e,s],P=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[e,s,V],c=()=>[z5,"full","auto",...I()],J$=()=>[N5,"none","subgrid",e,s],U$=()=>["auto",{span:["full",N5,e,s]},N5,e,s],I$=()=>[N5,"auto",e,s],t=()=>["auto","min","max","fr",e,s],R$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T$=()=>["start","end","center","stretch","center-safe","end-safe"],g=()=>["auto",...I()],r=()=>[z5,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],K$=()=>[z5,"screen","full","dvw","lvw","svw","min","max","fit",...I()],k4=()=>[z5,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],T=()=>[$,e,s],m=()=>[...M(),ed,sd,{position:[e,s]}],B$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w4=()=>["auto","cover","contain",Nw$,Uw$,{size:[e,s]}],N$=()=>[nP,mG,b7],O$=()=>["","none","full",H,e,s],h$=()=>["",_$,mG,b7],a$=()=>["solid","dashed","dotted","double"],Q0=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U4=()=>[_$,nP,ed,sd],O4=()=>["","none",z,e,s],Y0=()=>["none",_$,e,s],t8=()=>["none",_$,e,s],R7=()=>[_$,e,s],YQ=()=>[z5,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[r8],breakpoint:[r8],color:[Wa],container:[r8],"drop-shadow":[r8],ease:["in","out","in-out"],font:[Hw$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[r8],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[r8],shadow:[r8],spacing:["px",_$],text:[r8],"text-shadow":[r8],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",z5,s,e,L]}],container:["container"],columns:[{columns:[_$,s,e,K]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:c()}],"inset-x":[{"inset-x":c()}],"inset-y":[{"inset-y":c()}],start:[{"inset-s":c(),start:c()}],end:[{"inset-e":c(),end:c()}],"inset-bs":[{"inset-bs":c()}],"inset-be":[{"inset-be":c()}],top:[{top:c()}],right:[{right:c()}],bottom:[{bottom:c()}],left:[{left:c()}],visibility:["visible","invisible","collapse"],z:[{z:[N5,"auto",e,s]}],basis:[{basis:[z5,"full","auto",K,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_$,z5,"auto","initial","none",s]}],grow:[{grow:["",_$,e,s]}],shrink:[{shrink:["",_$,e,s]}],order:[{order:[N5,"first","last","none",e,s]}],"grid-cols":[{"grid-cols":J$()}],"col-start-end":[{col:U$()}],"col-start":[{"col-start":I$()}],"col-end":[{"col-end":I$()}],"grid-rows":[{"grid-rows":J$()}],"row-start-end":[{row:U$()}],"row-start":[{"row-start":I$()}],"row-end":[{"row-end":I$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":t()}],"auto-rows":[{"auto-rows":t()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...R$(),"normal"]}],"justify-items":[{"justify-items":[...T$(),"normal"]}],"justify-self":[{"justify-self":["auto",...T$()]}],"align-content":[{content:["normal",...R$()]}],"align-items":[{items:[...T$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T$(),{baseline:["","last"]}]}],"place-content":[{"place-content":R$()}],"place-items":[{"place-items":[...T$(),"baseline"]}],"place-self":[{"place-self":["auto",...T$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:g()}],mx:[{mx:g()}],my:[{my:g()}],ms:[{ms:g()}],me:[{me:g()}],mbs:[{mbs:g()}],mbe:[{mbe:g()}],mt:[{mt:g()}],mr:[{mr:g()}],mb:[{mb:g()}],ml:[{ml:g()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:r()}],"inline-size":[{inline:["auto",...K$()]}],"min-inline-size":[{"min-inline":["auto",...K$()]}],"max-inline-size":[{"max-inline":["none",...K$()]}],"block-size":[{block:["auto",...k4()]}],"min-block-size":[{"min-block":["auto",...k4()]}],"max-block-size":[{"max-block":["none",...k4()]}],w:[{w:[K,"screen",...r()]}],"min-w":[{"min-w":[K,"screen","none",...r()]}],"max-w":[{"max-w":[K,"screen","none","prose",{screen:[W]},...r()]}],h:[{h:["screen","lh",...r()]}],"min-h":[{"min-h":["screen","lh","none",...r()]}],"max-h":[{"max-h":["screen","lh",...r()]}],"font-size":[{text:["base",Q,mG,b7]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[J,Lw$,Bw$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nP,s]}],"font-family":[{font:[zw$,qw$,X]}],"font-features":[{"font-features":[s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[Y,e,s]}],"line-clamp":[{"line-clamp":[_$,"none",e,td]}],leading:[{leading:[G,...I()]}],"list-image":[{"list-image":["none",e,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",e,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...a$(),"wavy"]}],"text-decoration-thickness":[{decoration:[_$,"from-font","auto",e,b7]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[_$,"auto",e,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",e,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",e,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:m()}],"bg-repeat":[{bg:B$()}],"bg-size":[{bg:w4()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},N5,e,s],radial:["",e,s],conic:[N5,e,s]},Dw$,ww$]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:N$()}],"gradient-via-pos":[{via:N$()}],"gradient-to-pos":[{to:N$()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:O$()}],"rounded-s":[{"rounded-s":O$()}],"rounded-e":[{"rounded-e":O$()}],"rounded-t":[{"rounded-t":O$()}],"rounded-r":[{"rounded-r":O$()}],"rounded-b":[{"rounded-b":O$()}],"rounded-l":[{"rounded-l":O$()}],"rounded-ss":[{"rounded-ss":O$()}],"rounded-se":[{"rounded-se":O$()}],"rounded-ee":[{"rounded-ee":O$()}],"rounded-es":[{"rounded-es":O$()}],"rounded-tl":[{"rounded-tl":O$()}],"rounded-tr":[{"rounded-tr":O$()}],"rounded-br":[{"rounded-br":O$()}],"rounded-bl":[{"rounded-bl":O$()}],"border-w":[{border:h$()}],"border-w-x":[{"border-x":h$()}],"border-w-y":[{"border-y":h$()}],"border-w-s":[{"border-s":h$()}],"border-w-e":[{"border-e":h$()}],"border-w-bs":[{"border-bs":h$()}],"border-w-be":[{"border-be":h$()}],"border-w-t":[{"border-t":h$()}],"border-w-r":[{"border-r":h$()}],"border-w-b":[{"border-b":h$()}],"border-w-l":[{"border-l":h$()}],"divide-x":[{"divide-x":h$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":h$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...a$(),"hidden","none"]}],"divide-style":[{divide:[...a$(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...a$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_$,e,s]}],"outline-w":[{outline:["",_$,mG,b7]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",U,Lq,Dq]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",q,Lq,Dq]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:h$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[_$,b7]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":h$()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",w,Lq,Dq]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[_$,e,s]}],"mix-blend":[{"mix-blend":[...Q0(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q0()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_$]}],"mask-image-linear-from-pos":[{"mask-linear-from":U4()}],"mask-image-linear-to-pos":[{"mask-linear-to":U4()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":U4()}],"mask-image-t-to-pos":[{"mask-t-to":U4()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":U4()}],"mask-image-r-to-pos":[{"mask-r-to":U4()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":U4()}],"mask-image-b-to-pos":[{"mask-b-to":U4()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":U4()}],"mask-image-l-to-pos":[{"mask-l-to":U4()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":U4()}],"mask-image-x-to-pos":[{"mask-x-to":U4()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":U4()}],"mask-image-y-to-pos":[{"mask-y-to":U4()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[e,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":U4()}],"mask-image-radial-to-pos":[{"mask-radial-to":U4()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[_$]}],"mask-image-conic-from-pos":[{"mask-conic-from":U4()}],"mask-image-conic-to-pos":[{"mask-conic-to":U4()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:m()}],"mask-repeat":[{mask:B$()}],"mask-size":[{mask:w4()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",e,s]}],filter:[{filter:["","none",e,s]}],blur:[{blur:O4()}],brightness:[{brightness:[_$,e,s]}],contrast:[{contrast:[_$,e,s]}],"drop-shadow":[{"drop-shadow":["","none",D,Lq,Dq]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",_$,e,s]}],"hue-rotate":[{"hue-rotate":[_$,e,s]}],invert:[{invert:["",_$,e,s]}],saturate:[{saturate:[_$,e,s]}],sepia:[{sepia:["",_$,e,s]}],"backdrop-filter":[{"backdrop-filter":["","none",e,s]}],"backdrop-blur":[{"backdrop-blur":O4()}],"backdrop-brightness":[{"backdrop-brightness":[_$,e,s]}],"backdrop-contrast":[{"backdrop-contrast":[_$,e,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_$,e,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_$,e,s]}],"backdrop-invert":[{"backdrop-invert":["",_$,e,s]}],"backdrop-opacity":[{"backdrop-opacity":[_$,e,s]}],"backdrop-saturate":[{"backdrop-saturate":[_$,e,s]}],"backdrop-sepia":[{"backdrop-sepia":["",_$,e,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",e,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_$,"initial",e,s]}],ease:[{ease:["linear","initial",O,e,s]}],delay:[{delay:[_$,e,s]}],animate:[{animate:["none",Z,e,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,e,s]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Y0()}],"rotate-x":[{"rotate-x":Y0()}],"rotate-y":[{"rotate-y":Y0()}],"rotate-z":[{"rotate-z":Y0()}],scale:[{scale:t8()}],"scale-x":[{"scale-x":t8()}],"scale-y":[{"scale-y":t8()}],"scale-z":[{"scale-z":t8()}],"scale-3d":["scale-3d"],skew:[{skew:R7()}],"skew-x":[{"skew-x":R7()}],"skew-y":[{"skew-y":R7()}],transform:[{transform:[e,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:YQ()}],"translate-x":[{"translate-x":YQ()}],"translate-y":[{"translate-y":YQ()}],"translate-z":[{"translate-z":YQ()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",e,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",e,s]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[_$,mG,b7,td]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var za=sq$(Ow$);function Na(...$){return za(EN($))}var Da=()=>{if(typeof document==="undefined")return;let $=document.getElementById("piedata_global_form");$&&$.submit()};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piedata/pieui",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "A React component library featuring PieCard component",
5
5
  "repository": {
6
6
  "type": "git",