@opencx/widget-react 5.10.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Chart.impl-BJv8nMFH.js → Chart.impl-BiHsmCGG.js} +2 -2
- package/dist/{Chart.impl-BJv8nMFH.js.map → Chart.impl-BiHsmCGG.js.map} +1 -1
- package/dist/{Chart.impl-bhOhKeoS.cjs → Chart.impl-CNaZah97.cjs} +2 -2
- package/dist/{Chart.impl-bhOhKeoS.cjs.map → Chart.impl-CNaZah97.cjs.map} +1 -1
- package/dist/{index-CKgXh5ot.js → index-BdjYf3YD.js} +35 -26
- package/dist/index-BdjYf3YD.js.map +1 -0
- package/dist/{index-CLteV-u1.cjs → index-CcE7410P.cjs} +5 -5
- package/dist/{index-CLteV-u1.cjs.map → index-CcE7410P.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/src/screens/chat/ChatInput.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatMain.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/index-CKgXh5ot.js.map +0 -1
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
`);i.push(`${x}
|
|
9
9
|
|
|
10
10
|
Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),i.push(""),i.push("INITIAL STATE:"),i.push("Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it."),i.push("CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items."),i.push("Output state patches right after the elements that reference them, so the UI fills in progressively as it streams."),i.push("Stream state progressively - output one patch per array item instead of one giant blob:"),i.push(' For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.'),i.push(' For scalars: {"op":"add","path":"/state/newTodoText","value":""}'),i.push(' Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}'),i.push('When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.'),i.push("Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty."),i.push(""),i.push("DYNAMIC LISTS (repeat field):"),i.push('Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.'),i.push('The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.'),i.push(`Example: ${JSON.stringify({type:l,props:f,repeat:{statePath:"/todos",key:"id"},children:["todo-item"]})}`),i.push('Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.'),i.push("ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item."),i.push('IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.'),i.push(""),i.push("ARRAY STATE ACTIONS:"),i.push('Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.'),i.push('Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).'),i.push('Use "$id" inside a pushState value to auto-generate a unique ID.'),i.push('Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }'),i.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),i.push("For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState."),i.push(""),i.push('IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.'),i.push("");const S=c;if(S){i.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),i.push("");for(const[E,I]of Object.entries(S)){const H=I.props?Se(I.props):"{}",q=I.slots&&I.slots.length>0?" [accepts children]":"",X=I.events&&I.events.length>0?` [events: ${I.events.join(", ")}]`:"",B=I.description?` - ${I.description}`:"";i.push(`- ${E}: ${H}${B}${q}${X}`)}i.push("")}const w=e.data.actions,N=e.schema.builtInActions??[],C=w&&e.actionNames.length>0,v=N.length>0;if(C||v){i.push("AVAILABLE ACTIONS:"),i.push("");for(const E of N)i.push(`- ${E.name}: ${E.description} [built-in]`);if(C)for(const[E,I]of Object.entries(w))i.push(`- ${E}${I.description?`: ${I.description}`:""}`);i.push("")}i.push("EVENTS (the `on` field):"),i.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),i.push(""),i.push("Example:"),i.push(` ${JSON.stringify({type:l,props:f,on:{press:{action:"setState",params:{statePath:"/saved",value:!0}}},children:[]})}`),i.push(""),i.push('Action params can use dynamic references to read from state: { "$state": "/statePath" }.'),i.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),i.push(""),i.push("VISIBILITY CONDITIONS:"),i.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),i.push(`Correct: ${JSON.stringify({type:l,props:f,visible:{$state:"/activeTab",eq:"home"},children:["..."]})}`),i.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),i.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),i.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),i.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),i.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),i.push("- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators."),i.push('- Any condition can add `"not": true` to invert its result'),i.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),i.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),i.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),i.push("- `true` / `false` - always visible/hidden"),i.push(""),i.push("Use a component with on.press bound to setState to update state and drive visibility."),i.push(`Example: A ${l} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),i.push(""),i.push('For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.'),i.push(""),i.push("DYNAMIC PROPS:"),i.push("Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:"),i.push(""),i.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),i.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),i.push(""),i.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),i.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),i.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),i.push(""),i.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),i.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),i.push(""),i.push("Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ."),i.push(""),i.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates references in the string. Absolute paths like `${/path}` resolve against the state model. Bare names like `${field}` resolve against the current repeat item first, then fall back to the state model at `/<field>`.'),i.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00. Inside a repeat, `{ "$template": "${name} - ${email}" }` reads name and email from each item.'),i.push("");const _=e.data.functions;if(_&&Object.keys(_).length>0){i.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),i.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),i.push(" Available functions:");for(const E of Object.keys(_))i.push(` - ${E}`);i.push("")}const R=t.directives;if(R&&R.length>0){i.push("CUSTOM DYNAMIC VALUES:"),i.push("");for(const E of R){const I=E.description?` (${E.description})`:"";i.push(`- ${E.name}${I}: ${Se(E.schema)}`)}i.push(""),i.push("Directives compose: any value field can contain another directive or a $state expression, resolved inside-out."),i.push("")}(c?Object.entries(c).some(([,E])=>E.props?Se(E.props).includes("checks"):!1):!1)&&(i.push("VALIDATION:"),i.push("Form components that accept a `checks` prop support client-side validation."),i.push('Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }'),i.push(""),i.push("Built-in validation types:"),i.push(" - required — value must be non-empty"),i.push(" - email — valid email format"),i.push(' - minLength — minimum string length (args: { "min": N })'),i.push(' - maxLength — maximum string length (args: { "max": N })'),i.push(' - pattern — match a regex (args: { "pattern": "regex" })'),i.push(' - min — minimum numeric value (args: { "min": N })'),i.push(' - max — maximum numeric value (args: { "max": N })'),i.push(" - numeric — value must be a number"),i.push(" - url — valid URL format"),i.push(' - matches — must equal another field (args: { "other": { "$state": "/path" } })'),i.push(' - equalTo — alias for matches (args: { "other": { "$state": "/path" } })'),i.push(' - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })'),i.push(' - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })'),i.push(' - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })'),i.push(""),i.push("Example:"),i.push(' "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]'),i.push(""),i.push("IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding."),i.push("Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength)."),i.push("")),(C||v)&&(i.push("STATE WATCHERS:"),i.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push("Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically."),i.push(""),i.push("Example (cascading select — country changes trigger city loading):"),i.push(` ${JSON.stringify({type:"Select",props:{value:{$bindState:"/form/country"},options:["US","Canada","UK"]},watch:{"/form/country":{action:"loadCities",params:{country:{$state:"/form/country"}}}},children:[]})}`),i.push(""),i.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),i.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),i.push(""));const M=t.editModes;M&&M.length>0&&i.push(ml({modes:M})),i.push("RULES:");const D=a==="inline"?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence","Write a brief conversational response before any JSONL output",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"]:["Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"],O=e.schema.defaultRules??[];return[...D,...O,...o].forEach((E,I)=>{i.push(`${I+1}. ${E}`)}),i.join(`
|
|
11
|
-
`)}function Fo(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?aa(e.props):{}}function aa(e){if(!e||!e._def)return{};const t=e._def,n=pt(e);if(n!=="ZodObject"&&n!=="object")return{};const o=typeof t.shape=="function"?t.shape():t.shape;if(!o)return{};const s={};for(const[a,i]of Object.entries(o)){const c=pt(i);c==="ZodOptional"||c==="optional"||c==="ZodNullable"||c==="nullable"||(s[a]=ar(i))}return s}function ar(e){if(!e||!e._def)return"...";const t=e._def;switch(pt(e)){case"ZodString":case"string":return"example";case"ZodNumber":case"number":return 0;case"ZodBoolean":case"boolean":return!0;case"ZodLiteral":case"literal":return t.value;case"ZodEnum":case"enum":{if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries=="object"){const o=Object.values(t.entries);return o.length>0?o[0]:"example"}return"example"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":case"ZodDefault":case"default":{const o=t.innerType??t.wrapped;return o?ar(o):null}case"ZodArray":case"array":return[];case"ZodObject":case"object":return aa(e);case"ZodUnion":case"union":{const o=t.options;return o&&o.length>0?ar(o[0]):"..."}default:return"..."}}function yl(e){if(!e||!e._def)return null;const t=e._def,n=pt(e);if(n!=="ZodObject"&&n!=="object")return null;const o=typeof t.shape=="function"?t.shape():t.shape;if(!o)return null;for(const[s,a]of Object.entries(o)){const i=pt(a);if(!(i==="ZodOptional"||i==="optional"||i==="ZodNullable"||i==="nullable")&&(i==="ZodString"||i==="string"))return s}return null}function pt(e){if(!e||!e._def)return"";const t=e._def;return t.typeName??t.type??""}function Se(e){if(!e||!e._def)return"unknown";const t=e._def;switch(pt(e)){case"ZodString":case"string":return"string";case"ZodNumber":case"number":return"number";case"ZodBoolean":case"boolean":return"boolean";case"ZodLiteral":case"literal":{const o=t.values,s=(o==null?void 0:o[0])??t.value;return JSON.stringify(s)}case"ZodEnum":case"enum":{let o;if(Array.isArray(t.values))o=t.values;else if(t.entries&&typeof t.entries=="object")o=Object.values(t.entries);else return"enum";return o.map(s=>`"${s}"`).join(" | ")}case"ZodArray":case"array":{const o=typeof t.element=="object"?t.element:typeof t.type=="object"?t.type:void 0;return o?`Array<${Se(o)}>`:"Array<unknown>"}case"ZodObject":case"object":{const o=typeof t.shape=="function"?t.shape():t.shape;return o?`{ ${Object.entries(o).map(([a,i])=>{const c=pt(i);return`${a}${c==="ZodOptional"||c==="ZodNullable"||c==="optional"||c==="nullable"?"?":""}: ${Se(i)}`}).join(", ")} }`:"object"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":{const o=t.innerType??t.wrapped;return o?Se(o):"unknown"}case"ZodUnion":case"union":{const o=t.options;return o?o.map(s=>Se(s)).join(" | "):"unknown"}case"ZodRecord":case"record":{const o=t.keyType??void 0,s=t.valueType??t.element??void 0,a=o?Se(o):"string",i=s?Se(s):"unknown";return`Record<${a}, ${i}>`}case"ZodDefault":case"default":{const o=t.innerType??t.wrapped;return o?Se(o):"unknown"}default:return"unknown"}}function Ho(e){return typeof e.type=="string"?e.type:typeof e.typeName=="string"?e.typeName:""}function Wo(e){return e.startsWith("Zod")?e.slice(3).toLowerCase():e.toLowerCase()}function Ye(e,t=!1){const n=e._def;switch(Wo(Ho(n))){case"string":return{type:"string"};case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"literal":{const s=n.values;return{const:s?s[0]:n.value}}case"enum":{const s=n.entries;return{enum:(s?Object.values(s):n.values)??[]}}case"array":{const s=n.element??n.type;return{type:"array",items:s?Ye(s,t):{}}}case"object":{const s=n.shape,a=typeof s=="function"?s():s;if(!a)return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{type:"object"};const i={},c=[];for(const[u,l]of Object.entries(a)){const m=l._def,p=Wo(Ho(m)),h=p==="optional"||p==="nullable";if(t)if(c.push(u),h){const f=Ye(l,t);i[u]={anyOf:[f,{type:"null"}]}}else i[u]=Ye(l,t);else i[u]=Ye(l),h||c.push(u)}return{type:"object",properties:i,required:c.length>0?c:void 0,additionalProperties:!1}}case"record":{const s=n.valueType;return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{type:"object",additionalProperties:s?Ye(s):!0}}case"optional":case"nullable":{const s=n.innerType;return s?Ye(s,t):{}}case"union":{const s=n.options;return s?{anyOf:s.map(a=>Ye(a,t))}:{}}case"any":case"unknown":return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{};default:return{}}}function kl(e,t){return e.createCatalog(t)}var jl=fl(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref("catalog.components"),props:e.propsOf("catalog.components"),children:e.array(e.string()),visible:e.any()}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:"setState",description:"Update a value in the state model at the given statePath. Params: { statePath: string, value: any }"},{name:"pushState",description:'Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.'},{name:"removeState",description:"Remove an item from an array in state by index. Params: { statePath: string, index: number }"},{name:"validateForm",description:"Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }."}],defaultRules:["CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.","SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.",'CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.','CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.',"When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).",'When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.',"Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.","For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.","Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty."]}),ia=d.createContext(null);function Cl(e,t){return e?null:Object.keys(t).length===0?{}:Or(t)}function Sl({store:e,initialState:t={},onStateChange:n,children:o}){const s=d.useRef(void 0);!e&&!s.current&&(s.current=Tc(t));const a=e??s.current,i=d.useRef(a);i.current=a;const c=d.useRef(!!e);c.current=!!e;const u=d.useRef(e?"controlled":"uncontrolled"),l=d.useRef(!1);if(process.env.NODE_ENV!=="production"){const w=e?"controlled":"uncontrolled";w!==u.current&&!l.current&&(l.current=!0,console.warn(`StateProvider: switching from ${u.current} to ${w} mode is not supported.`))}const m=d.useRef(t),p=d.useRef(Cl(!!e,t));d.useEffect(()=>{if(e||t===m.current)return;m.current=t;const w=t&&Object.keys(t).length>0?Or(t):{},N=p.current??{},C=new Set([...Object.keys(N),...Object.keys(w)]),v={};for(const _ of C)N[_]!==w[_]&&(v[_]=_ in w?w[_]:void 0);p.current=w,Object.keys(v).length>0&&a.update(v)},[e,t,a]);const h=d.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getServerSnapshot??a.getSnapshot),f=d.useRef(n);f.current=n;const b=d.useCallback((w,N)=>{var _;const C=i.current,v=C.getSnapshot();C.set(w,N),!c.current&&C.getSnapshot()!==v&&((_=f.current)==null||_.call(f,[{path:w,value:N}]))},[]),g=d.useCallback(w=>{var v;const N=i.current,C=N.getSnapshot();if(N.update(w),!c.current&&N.getSnapshot()!==C){const _=[];for(const[R,z]of Object.entries(w))ae(C,R)!==z&&_.push({path:R,value:z});_.length>0&&((v=f.current)==null||v.call(f,_))}},[]),j=d.useCallback(w=>i.current.get(w),[]),x=d.useCallback(()=>i.current.getSnapshot(),[]),S=d.useMemo(()=>({state:h,get:j,set:b,update:g,getSnapshot:x}),[h,j,b,g,x]);return r.jsx(ia.Provider,{value:S,children:o})}function Kt(){const e=d.useContext(ia);if(!e)throw new Error("useStateStore must be used within a StateProvider");return e}var ca=d.createContext(null);function Nl({children:e}){const{state:t}=Kt(),n=d.useMemo(()=>({stateModel:t}),[t]),o=d.useMemo(()=>a=>_t(a,n),[n]),s=d.useMemo(()=>({isVisible:o,ctx:n}),[o,n]);return r.jsx(ca.Provider,{value:s,children:e})}function _l(){const e=d.useContext(ca);if(!e)throw new Error("useVisibility must be used within a VisibilityProvider");return e}var la=d.createContext(null);function El(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n){const a=e[s],i=t[s];if(a!==i){if(typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null){const c=a.$state,u=i.$state;if(typeof c=="string"&&c===u)continue}return!1}}return!0}function Tl(e,t){if(e===t)return!0;if(e.validateOn!==t.validateOn)return!1;const n=e.checks??[],o=t.checks??[];if(n.length!==o.length)return!1;for(let s=0;s<n.length;s++){const a=n[s],i=o[s];if(a.type!==i.type||a.message!==i.message||!El(a.args,i.args))return!1}return!0}function Al({customFunctions:e={},children:t}){const{state:n,getSnapshot:o}=Kt(),[s,a]=d.useState({}),i=d.useRef({}),[c,u]=d.useState({}),l=d.useCallback((g,j)=>{u(x=>{const S=x[g];return S&&Tl(S,j)?x:{...x,[g]:j}})},[]),m=d.useCallback((g,j)=>{var v;const x=o(),S=g.split("/").filter(Boolean);let w=x;for(const _ of S)if(w!=null&&typeof w=="object")w=w[_];else{w=void 0;break}const N=al(j,{value:w,stateModel:x,customFunctions:e}),C={touched:((v=i.current[g])==null?void 0:v.touched)??!0,validated:!0,result:N};return i.current={...i.current,[g]:C},a(i.current),N},[e,o]),p=d.useCallback(g=>{var j,x;i.current={...i.current,[g]:{...i.current[g],touched:!0,validated:((j=i.current[g])==null?void 0:j.validated)??!1,result:((x=i.current[g])==null?void 0:x.result)??null}},a(i.current)},[]),h=d.useCallback(g=>{const{[g]:j,...x}=i.current;i.current=x,a(x)},[]),f=d.useCallback(()=>{let g=!0;for(const[j,x]of Object.entries(c))m(j,x).valid||(g=!1);return g},[c,m]),b=d.useMemo(()=>({customFunctions:e,get fieldStates(){return i.current},validate:m,touch:p,clear:h,validateAll:f,registerField:l}),[e,s,m,p,h,f,l]);return r.jsx(la.Provider,{value:b,children:t})}function Il(){return d.useContext(la)}var Uo=0;function Bo(){return Uo+=1,`${Date.now()}-${Uo}`}function ir(e,t){if(e==null)return e;if(e==="$id")return Bo();if(typeof e=="object"&&!Array.isArray(e)){const n=e,o=Object.keys(n);if(o.length===1&&typeof n.$state=="string")return t(n.$state);if(o.length===1&&"$id"in n)return Bo()}if(Array.isArray(e))return e.map(n=>ir(n,t));if(typeof e=="object"){const n={};for(const[o,s]of Object.entries(e))n[o]=ir(s,t);return n}return e}var da=d.createContext(null);function zl({handlers:e={},navigate:t,children:n}){const{get:o,set:s,getSnapshot:a}=Kt(),i=Il(),[c,u]=d.useState(e),[l,m]=d.useState(new Set),[p,h]=d.useState(null),f=d.useCallback((S,w)=>{u(N=>({...N,[S]:w}))},[]),b=d.useCallback(async S=>{var R;const w=nl(S,a()),N=Gc(),C=Date.now();Yc({id:N,name:w.action,params:w.params,at:C});let v=!0,_;try{if(w.action==="setState"&&w.params){const M=w.params.statePath,D=w.params.value;M&&s(M,D);return}if(w.action==="pushState"&&w.params){const M=w.params.statePath,D=w.params.value;if(M){const O=ir(D,o),U=o(M)??[];s(M,[...U,O]);const E=w.params.clearStatePath;E&&s(E,"")}return}if(w.action==="removeState"&&w.params){const M=w.params.statePath,D=w.params.index;if(M!==void 0&&D!==void 0){const O=o(M)??[];s(M,O.filter((U,E)=>E!==D))}return}if(w.action==="push"&&w.params){const M=w.params.screen;if(M){const D=o("/currentScreen"),O=o("/navStack")??[];D?s("/navStack",[...O,D]):s("/navStack",[...O,""]),s("/currentScreen",M)}return}if(w.action==="pop"){const M=o("/navStack")??[];if(M.length>0){const D=M[M.length-1];s("/navStack",M.slice(0,-1)),D?s("/currentScreen",D):s("/currentScreen",void 0)}return}if(w.action==="validateForm"){const M=i==null?void 0:i.validateAll;if(!M){console.warn("validateForm action was dispatched but no ValidationProvider is connected. Ensure ValidationProvider is rendered inside the provider tree.");return}const D=M(),O={};for(const[E,I]of Object.entries(i.fieldStates))I.result&&!I.result.valid&&(O[E]=I.result.errors);const U=((R=w.params)==null?void 0:R.statePath)||"/formValidation";s(U,{valid:D,errors:O});return}const z=c[w.action];if(!z){console.warn(`No handler registered for action: ${w.action}`);return}if(w.confirm)return new Promise((M,D)=>{h({action:w,handler:z,resolve:()=>{h(null),M()},reject:()=>{h(null),D(new Error("Action cancelled"))}})}).then(async()=>{m(M=>new Set(M).add(w.action));try{await Lo({action:w,handler:z,setState:s,navigate:t,executeAction:async M=>{await b({action:M})}})}finally{m(M=>{const D=new Set(M);return D.delete(w.action),D})}});m(M=>new Set(M).add(w.action));try{await Lo({action:w,handler:z,setState:s,navigate:t,executeAction:async M=>{await b({action:M})}})}finally{m(M=>{const D=new Set(M);return D.delete(w.action),D})}}catch(z){throw v=!1,_=z,z}finally{const z=Date.now();Xc({id:N,name:w.action,ok:v,at:z,durationMs:z-C,error:_})}},[c,o,s,a,t,i]),g=d.useCallback(()=>{p==null||p.resolve()},[p]),j=d.useCallback(()=>{p==null||p.reject()},[p]),x=d.useMemo(()=>({handlers:c,loadingActions:l,pendingConfirmation:p,execute:b,confirm:g,cancel:j,registerHandler:f}),[c,l,p,b,g,j,f]);return r.jsx(da.Provider,{value:x,children:n})}function ua(){const e=d.useContext(da);if(!e)throw new Error("useActions must be used within an ActionProvider");return e}function Ml({confirm:e,onConfirm:t,onCancel:n}){const o=e.variant==="danger";return r.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50},onClick:n,children:r.jsxs("div",{style:{backgroundColor:"white",borderRadius:"8px",padding:"24px",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)"},onClick:s=>s.stopPropagation(),children:[r.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"18px",fontWeight:600},children:e.title}),r.jsx("p",{style:{margin:"0 0 24px 0",color:"#6b7280"},children:e.message}),r.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[r.jsx("button",{onClick:n,style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #d1d5db",backgroundColor:"white",cursor:"pointer"},children:e.cancelLabel??"Cancel"}),r.jsx("button",{onClick:t,style:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:o?"#dc2626":"#3b82f6",color:"white",cursor:"pointer"},children:e.confirmLabel??"Confirm"})]})]})})}var pa=d.createContext(null);function Rl({item:e,index:t,basePath:n,children:o}){return r.jsx(pa.Provider,{value:{item:e,index:t,basePath:n},children:o})}function Pl(){return d.useContext(pa)}var Ol=class extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}render(){return this.state.hasError?null:this.props.children}},ma={},ha=d.createContext(ma);function $l(){return d.useContext(ha)}var fa=d.createContext(void 0);function Ll(){return d.useContext(fa)}function Dl(){return d.useSyncExternalStore(Jc,Zc,()=>!1)}var ga=d.memo(function e({element:t,elementKey:n,spec:o,registry:s,loading:a,fallback:i}){var H;const c=Dl(),u=Pl(),{ctx:l}=_l(),{execute:m}=ua(),{getSnapshot:p,state:h}=Kt(),f=$l(),b=Ll(),g=d.useMemo(()=>{const L=u?{...l,repeatItem:u.item,repeatIndex:u.index,repeatBasePath:u.basePath}:{...l};return L.functions=f,L.directives=b,L},[l,u,f,b]),j=t.visible===void 0?!0:_t(t.visible,g),x=t.on,S=d.useCallback(async L=>{const q=x==null?void 0:x[L];if(!q)return;const X=Array.isArray(q)?q:[q];for(const B of X){if(!B.params){await m(B);continue}const F={...g,stateModel:p()},J={};for(const[re,$]of Object.entries(B.params))J[re]=Ro($,F);await m({...B,params:J})}},[x,m,g,p]),w=d.useCallback(L=>{const q=x==null?void 0:x[L];if(!q)return{emit:()=>{},shouldPreventDefault:!1,bound:!1};const B=(Array.isArray(q)?q:[q]).some(F=>F.preventDefault);return{emit:()=>S(L),shouldPreventDefault:B,bound:!0}},[x,S]),N=t.watch,C=d.useRef(null),v=d.useRef(void 0),_=d.useMemo(()=>{if(!N)return;const L={};for(const X of Object.keys(N))L[X]=ae(h,X);const q=v.current;if(q){const X=Object.keys(L);if(X.length===Object.keys(q).length&&X.every(B=>L[B]===q[B]))return q}return v.current=L,L},[N,h]);if(d.useEffect(()=>{if(!N||!_)return;const L=Object.keys(N);if(L.length===0)return;const q=C.current;if(C.current=_,q===null)return;let X=!1;return(async()=>{for(const B of L){if(X)break;if(_[B]!==q[B]){const F=N[B];if(!F)continue;const J=Array.isArray(F)?F:[F];for(const re of J){if(X)break;if(!re.params){if(await m(re),X)break;continue}const $={...g,stateModel:p()},te={};for(const[K,oe]of Object.entries(re.params))te[K]=Ro(oe,$);if(await m({...re,params:te}),X)break}}}})().catch(console.error),()=>{X=!0}},[N,_,m,g,p]),!j)return null;const R=t.props,z=Vc(R,g),M=qc(R,g),D=M!==t.props?{...t,props:M}:t,O=s[D.type]??i;if(!O)return console.warn(`No renderer for component type: ${D.type}`),null;const U=D.repeat?r.jsx(Fl,{element:D,spec:o,registry:s,loading:a,fallback:i}):(H=D.children)==null?void 0:H.map(L=>{const q=o.elements[L];return q?r.jsx(e,{element:q,elementKey:L,spec:o,registry:s,loading:a,fallback:i},L):(a||console.warn(`[json-render] Missing element "${L}" referenced as child of "${D.type}". This element will not render.`),null)}),E=r.jsx(O,{element:D,emit:S,on:w,bindings:z,loading:a,children:U}),I=c&&n?r.jsx("span",{"data-jr-key":n,style:{display:"contents"},children:E}):E;return r.jsx(Ol,{elementType:D.type,children:I})});function Fl({element:e,spec:t,registry:n,loading:o,fallback:s}){const{state:a}=Kt(),i=e.repeat,c=i.statePath,u=ae(a,c)??[];return r.jsx(r.Fragment,{children:u.map((l,m)=>{var h;const p=i.key&&typeof l=="object"&&l!==null?String(l[i.key]??m):String(m);return r.jsx(Rl,{item:l,index:m,basePath:`${c}/${m}`,children:(h=e.children)==null?void 0:h.map(f=>{const b=t.elements[f];return b?r.jsx(ga,{element:b,elementKey:f,spec:t,registry:n,loading:o,fallback:s},f):(o||console.warn(`[json-render] Missing element "${f}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},p)})})}function Hl({spec:e,registry:t,loading:n,fallback:o}){if(!e||!e.root)return null;const s=e.elements[e.root];return s?r.jsx(ga,{element:s,elementKey:e.root,spec:e,registry:t,loading:n,fallback:o}):null}function Wl({registry:e,store:t,initialState:n,handlers:o,navigate:s,validationFunctions:a,functions:i,directives:c,onStateChange:u,children:l}){const m=d.useMemo(()=>c?Lc(c):void 0,[c]);return r.jsx(Sl,{store:t,initialState:n,onStateChange:u,children:r.jsx(Nl,{children:r.jsx(Al,{customFunctions:a,children:r.jsx(zl,{handlers:o,navigate:s,children:r.jsx(ha.Provider,{value:i??ma,children:r.jsxs(fa.Provider,{value:m,children:[l,r.jsx(Ul,{})]})})})})})})}function Ul(){const{pendingConfirmation:e,confirm:t,cancel:n}=ua();return e!=null&&e.action.confirm?r.jsx(Ml,{confirm:e.action.confirm,onConfirm:t,onCancel:n}):null}function Bl(e,t){const n={};if(t.components)for(const[i,c]of Object.entries(t.components))n[i]=({element:u,children:l,emit:m,on:p,bindings:h,loading:f})=>c({props:u.props,children:l,emit:m,on:p,bindings:h,loading:f});const o=t.actions?Object.entries(t.actions):[];return{registry:n,handlers:(i,c)=>{const u={};for(const[l,m]of o)u[l]=async p=>{const h=i(),f=c();h&&await m(p,h,f)};return u},executeAction:async(i,c,u,l={})=>{const m=o.find(([p])=>p===i);m?await m[1](c,u,l):console.warn(`Unknown action: ${i}`)}}}function ql(e){if(typeof e!="object"||e===null)return!1;const t=e;switch(t.type){case"patch":return typeof t.patch=="object"&&t.patch!==null;case"flat":case"nested":return typeof t.spec=="object"&&t.spec!==null;default:return!1}}function Vl(e){const t={root:"",elements:{}};let n=!1;for(const o of e)if(o.type===Ec){if(!ql(o.data))continue;const s=o.data;if(s.type==="patch")n=!0,Cc(t,s.patch);else if(s.type==="flat")n=!0,Object.assign(t,s.spec);else if(s.type==="nested"){n=!0;const a=Sc(s.spec);Object.assign(t,a)}}return n?t:null}function G(){const{dir:e}=k.useDocumentDir(),t=k.useConfig();return d.useMemo(()=>{const n=Z.resolveLanguage(t.language);return{t:(s,a)=>Z.getTranslation(s,n,t.translationOverrides,a),language:n,dir:Z.isRtlLanguage(n)?"rtl":"ltr",hostDocumentDir:e}},[t.language,t.translationOverrides,e])}function xa(e){const t=Z.resolveLanguage(e);return(n,o)=>Z.getTranslation(n,t,void 0,o)}const Yl={t:xa("en"),anchorTarget:"_blank"},ba=d.createContext(Yl);function Xl({host:e,children:t}){return r.jsx(ba.Provider,{value:e,children:t})}function Zt(){return d.useContext(ba)}function Gl({language:e,onUiAction:t,anchorTarget:n="_blank"}){return d.useMemo(()=>({t:xa(e),anchorTarget:n,onUiAction:t}),[e,n,t])}class Kl extends d.Component{constructor(){super(...arguments);Eo(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){Z.log.error("json-render: spec failed to render",{_e:n instanceof Error?n.message:String(n)})}componentDidUpdate(n){this.state.hasError&&n.resetKey!==this.props.resetKey&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}}function Zl(e){if(!e.elements)return e;let t=!1;const n={};for(const[o,s]of Object.entries(e.elements)){const a=Jl(s,e);a!==s&&(t=!0),n[o]=a}return t?{...e,elements:n}:e}function Jl(e,t){if(e.type!=="List")return e;const n=e.repeat;if(!n||typeof n.statePath!="string")return e;const o=Z.isRecord(e.props)?e.props:{},s=o.items;if(Array.isArray(s)&&s.length>0)return e;const i=ae(t.state??{},n.statePath);if(!Array.isArray(i)||i.length===0)return e;const{repeat:c,...u}=e;return{...u,props:{...o,items:i}}}function A(...e){return pc.twMerge(uc.clsx(e))}const Ql=d.lazy(()=>Promise.resolve().then(()=>require("./Chart.impl-bhOhKeoS.cjs")));function ed(e){const t=e.height??220;return r.jsx(d.Suspense,{fallback:r.jsx(td,{height:t}),children:r.jsx(Ql,{...e})})}function td({height:e}){return r.jsx("div",{className:"w-full animate-pulse rounded-lg bg-muted-foreground/10",style:{height:e},"aria-hidden":!0})}const wa=y.z.object({title:y.z.string().nullish(),description:y.z.string().nullish()}),va=y.z.object({direction:y.z.enum(["row","column"]).nullish(),gap:y.z.enum(["sm","md","lg"]).nullish(),align:y.z.enum(["start","center","end","stretch"]).nullish(),justify:y.z.enum(["start","center","end","between"]).nullish()}),ya=y.z.object({columns:y.z.union([y.z.literal(1),y.z.literal(2),y.z.literal(3)]).nullish(),gap:y.z.enum(["sm","md","lg"]).nullish()}),ka=y.z.object({text:y.z.string(),level:y.z.union([y.z.literal(1),y.z.literal(2),y.z.literal(3),y.z.literal(4)]).nullish()}),ja=y.z.object({text:y.z.string(),variant:y.z.enum(["body","caption","muted","code"]).nullish()}),Ca=y.z.object({text:y.z.string(),variant:y.z.enum(["default","secondary","success","warning","destructive"]).nullish()}),nd=new Set(["http:","https:","mailto:"]),rd=y.z.string().nullish().transform(e=>{if(!e)return null;try{return nd.has(new URL(e).protocol)?e:null}catch{return null}}),Sa=y.z.object({id:y.z.string().nullish(),label:y.z.string(),secondary:y.z.string().nullish(),badge:y.z.string().nullish(),status:y.z.enum(["success","warning","error","info","neutral"]).nullish(),href:rd}),Na=y.z.object({items:y.z.array(Sa),maxVisible:y.z.number().int().positive().nullish()}),od=y.z.object({items:y.z.array(Sa.extend({href:y.z.string().nullish()})),maxVisible:Na.shape.maxVisible}),_a=y.z.object({columns:y.z.array(y.z.string()),rows:y.z.array(y.z.array(y.z.string())),caption:y.z.string().nullish()}),sd=y.z.object({value:y.z.string(),direction:y.z.enum(["up","down","flat"]),label:y.z.string().nullish()}),Ea=y.z.object({label:y.z.string(),value:y.z.string(),description:y.z.string().nullish(),trend:y.z.enum(["up","down","neutral"]).nullish(),delta:sd.nullish()}),Ta=y.z.object({type:y.z.enum(["info","tip","warning","important"]).nullish(),title:y.z.string().nullish(),content:y.z.string()}),ad=y.z.object({label:y.z.string(),value:y.z.number()}),Aa=y.z.object({type:y.z.enum(["bar","line","pie"]),data:y.z.array(ad),title:y.z.string().nullish(),height:y.z.number().int().positive().nullish(),centerLabel:y.z.string().nullish()}),Ia=y.z.object({agentId:y.z.string(),agentName:y.z.string(),model:y.z.string().nullish()});function ke(e,t,n){const o=e.safeParse(t);return o.success?o.data:n}const id=kl(jl,{components:{Card:{props:wa,slots:["default"],description:"Container card with an optional title/description. Group related content.",example:{title:"Order summary",description:"Placed 2 days ago"}},Stack:{props:va,slots:["default"],description:'Flex layout. Use direction="row" for side-by-side, "column" (default) to stack.'},Grid:{props:ya,slots:["default"],description:"Column grid that wraps on narrow screens. columns=2 for side-by-side metrics or cards; columns=3 only for three short metrics — the chat panel is about 400px wide, so three wide cells wrap."},Heading:{props:ka,description:"Section heading. level 1 (largest) to 4.",example:{text:"Your orders",level:3}},Text:{props:ja,description:'A paragraph of text. variant "muted"/"caption" for secondary text, "code" for monospace.'},Badge:{props:Ca,description:"Small status pill. Use variant to convey state (success/warning/destructive).",example:{text:"Delivered",variant:"success"}},List:{props:od,description:"A vertical list of items, each with a label and optional secondary text, badge, and status dot. Pass the full array in `items` — do NOT use repeat/state for the rows.",example:{items:[{label:"Order #1024",secondary:"Shipped",status:"success"},{label:"Order #1025",secondary:"Processing",status:"warning"}]}},Table:{props:_a,description:"A data table. `columns` are header strings; `rows` is a 2D array of cell strings (each row same length as columns).",example:{columns:["Item","Qty","Price"],rows:[["Widget","2","$20"],["Gadget","1","$15"]]}},Metric:{props:Ea,description:"A single key figure (KPI / insight card) with a label, big value, optional description, trend arrow, and an optional period-over-period delta ({ value, direction, label }).",example:{label:"Total spent",value:"$1,240",description:"Last 30 days",trend:"up",delta:{value:"+8%",direction:"up",label:"vs previous 30d"}}},Callout:{props:Ta,description:"A highlighted info / tip / warning box for a single important note. Use for one call-out, not for long prose.",example:{type:"tip",title:"Heads up",content:"Free shipping over $50."}},PhoneAgentCard:{props:Ia,description:'A phone agent card with a "Test via web" action. NEVER author this yourself: it only comes back, already fenced, from the phone-agent tools — carry that fence verbatim.',example:{agentId:"00000000-0000-4000-8000-000000000000",agentName:"Support line",model:"oppie-vox-livekit"}},Chart:{props:Aa,description:"A bar, line, or pie (donut) chart. `data` is an array of { label, value } points. Choose by the question: line = trend over time, bar = comparison across categories, pie = share of a total (optional `centerLabel` shows a big number in the donut hole). Use for trends or distributions, not for a handful of numbers (use Metric for those). Colours, axes, legend, and tooltips are handled for you.",example:{type:"bar",title:"Orders per month",data:[{label:"Jan",value:12},{label:"Feb",value:18}]}}},actions:{}});function cr({height:e=64}){return r.jsx("div",{className:"w-full animate-pulse rounded-lg bg-muted-foreground/10",style:{height:e},"aria-hidden":!0})}const qo={sm:"gap-1.5",md:"gap-3",lg:"gap-4"},cd="10rem";function ld(e){return e===1?"minmax(0, 1fr)":`repeat(auto-fit, minmax(max(${cd}, calc(100% / ${e} - 1rem)), 1fr))`}const{registry:Vo}=Bl(id,{components:{Card:({props:e,children:t,loading:n})=>{const o=ke(wa,e,{});return r.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-muted-foreground/15 p-3",children:[(o.title||o.description)&&r.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.title&&r.jsx("div",{className:"text-sm font-semibold text-foreground",children:o.title}),o.description&&r.jsx("div",{className:"text-xs text-muted-foreground",children:o.description})]}),Vn(t,n)]})},Stack:({props:e,children:t,loading:n})=>{const o=ke(va,e,{}),s={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"}[o.align??"stretch"],a={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between"}[o.justify??"start"];return r.jsx("div",{className:A("flex",o.direction==="row"?"flex-row":"flex-col",qo[o.gap??"md"],s,a),children:Vn(t,n)})},Grid:({props:e,children:t,loading:n})=>{const o=ke(ya,e,{});return r.jsx("div",{className:A("grid",qo[o.gap??"md"]),style:{gridTemplateColumns:ld(o.columns??1)},children:Vn(t,n)})},Heading:({props:e})=>{const t=ke(ka,e,{text:""}),n=t.level??3,o={1:"text-xl font-bold",2:"text-lg font-bold",3:"text-base font-semibold",4:"text-sm font-semibold"}[n]??"text-base font-semibold";return d.createElement(`h${n}`,{className:A("text-foreground",o)},t.text)},Text:({props:e})=>{const t=ke(ja,e,{text:""});if(t.variant==="code")return r.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:t.text});const n=t.variant==="muted"||t.variant==="caption";return r.jsx("p",{className:A("whitespace-pre-wrap",n?"text-xs text-muted-foreground":"text-sm text-foreground"),children:t.text})},Badge:({props:e})=>{const t=ke(Ca,e,{text:""}),n={default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",warning:"bg-amber-500/15 text-amber-600 dark:text-amber-400",destructive:"bg-destructive/15 text-destructive"}[t.variant??"secondary"];return r.jsx("span",{className:A("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",n),children:t.text})},List:({props:e,loading:t})=>{const n=ke(Na,e,{items:[]});return n.items.length===0?t?r.jsx(cr,{}):r.jsx(Yo,{translationKey:"json_no_items"}):r.jsx(yd,{items:n.items,maxVisible:n.maxVisible})},Table:({props:e,loading:t})=>{const n=ke(_a,e,{columns:[],rows:[]});return t&&n.rows.length===0?r.jsx(cr,{}):n.columns.length===0?r.jsx(Yo,{translationKey:"json_no_data"}):r.jsx("div",{className:"overflow-x-auto rounded-lg border border-muted-foreground/15",children:r.jsxs("table",{className:"w-full text-sm",children:[n.caption&&r.jsx("caption",{className:"px-3 py-2 text-start text-xs text-muted-foreground",children:n.caption}),r.jsx("thead",{children:r.jsx("tr",{className:"border-b border-muted-foreground/15 bg-muted/40",children:n.columns.map((o,s)=>r.jsx("th",{className:"px-3 py-2 text-start font-medium text-foreground",children:o},s))})}),r.jsx("tbody",{children:n.rows.map((o,s)=>r.jsx("tr",{className:"border-b border-muted-foreground/10 last:border-0",children:o.map((a,i)=>r.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:a},i))},s))})]})})},Metric:({props:e})=>{const t=ke(Ea,e,{label:"",value:""});return r.jsx(bd,{label:t.label,value:t.value,description:t.description,trend:t.trend,delta:t.delta})},Callout:({props:e})=>{const t=ke(Ta,e,{content:""}),n=ud[t.type??"info"],o=n.Icon;return r.jsxs("div",{className:A("flex gap-2 rounded-lg border-l-2 p-3",n.cls),children:[r.jsx(o,{className:"mt-0.5 size-4 shrink-0"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.title&&r.jsx("span",{className:"text-sm font-semibold",children:t.title}),r.jsx("span",{className:"text-sm",children:t.content})]})]})},PhoneAgentCard:({props:e})=>{const t=ke(Ia,e,{agentId:"",agentName:""});return r.jsx(md,{...t})},Chart:({props:e})=>{const t=ke(Aa,e,{type:"bar",data:[]});return r.jsxs("div",{className:"flex flex-col gap-1",children:[t.title&&r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.title}),r.jsx(ed,{...t})]})}}}),dd=({element:e})=>{const{t}=Zt();return r.jsx("div",{className:"rounded-lg border border-dashed border-muted-foreground/30 px-2 py-1.5 text-xs text-muted-foreground",children:t("json_unsupported",{type:e.type})})},ud={info:{Icon:T.Info,cls:"border-l-blue-500 bg-blue-500/5 text-foreground"},tip:{Icon:T.Lightbulb,cls:"border-l-emerald-500 bg-emerald-500/5 text-foreground"},warning:{Icon:T.AlertTriangle,cls:"border-l-amber-500 bg-amber-500/5 text-foreground"},important:{Icon:T.AlertCircle,cls:"border-l-red-500 bg-red-500/5 text-foreground"}};function Vn(e,t){return d.Children.toArray(e).length>0?e:t?r.jsx(cr,{}):null}function Yo({translationKey:e}){const{t}=Zt();return r.jsx("div",{className:"rounded-lg border border-muted-foreground/15 px-3 py-2 text-xs text-muted-foreground",children:t(e)})}const pd="oppie-vox-livekit";function md({agentId:e,agentName:t,model:n}){const{t:o,onUiAction:s}=Zt(),a=!!s&&!!e&&n===pd;return r.jsxs("div",{className:"flex w-full flex-col gap-3 rounded-xl border border-muted-foreground/15 p-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:r.jsx(T.Phone,{className:"size-4","aria-hidden":!0})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t}),r.jsx("div",{className:"text-xs text-muted-foreground",children:o("json_phone_agent")})]})]}),a&&r.jsxs("button",{type:"button",className:"flex w-full items-center justify-center gap-2 rounded-lg bg-secondary px-3 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80",onClick:()=>s==null?void 0:s({type:"test-phone-agent",payload:{agentId:e,model:n??null}}),children:[r.jsx(T.Play,{className:"size-4","aria-hidden":!0}),o("json_phone_agent_test")]})]})}const hd={up:"↑",down:"↓",neutral:"→"},fd={up:"text-emerald-600 dark:text-emerald-400",down:"text-red-600 dark:text-red-400",neutral:"text-muted-foreground"},gd={up:"↑",down:"↓",flat:"→"},xd={up:"text-emerald-600 dark:text-emerald-400",down:"text-red-600 dark:text-red-400",flat:"text-muted-foreground"};function bd({label:e,value:t,description:n,trend:o,delta:s}){return r.jsxs("div",{className:"min-w-[140px] space-y-1 rounded-xl border border-muted-foreground/15 p-3",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e}),r.jsxs("div",{className:"flex items-baseline gap-2",children:[r.jsx("span",{className:"text-2xl font-medium tracking-tight text-foreground",children:t}),o?r.jsx("span",{className:A("text-sm font-medium",fd[o]),children:hd[o]}):null]}),s?r.jsxs("div",{className:"flex items-baseline gap-1 text-xs",children:[r.jsxs("span",{className:A("font-medium",xd[s.direction]),children:[gd[s.direction]," ",s.value]}),s.label?r.jsx("span",{className:"text-muted-foreground",children:s.label}):null]}):null,n?r.jsx("span",{className:"block text-xs text-muted-foreground",children:n}):null]})}const wd={success:"bg-emerald-500",warning:"bg-amber-500",error:"bg-red-500",info:"bg-blue-500",neutral:"bg-muted-foreground/40"};function vd({item:e,showBadge:t,showSecondary:n,showStatus:o}){return r.jsxs(r.Fragment,{children:[t&&(e.badge?r.jsx("span",{className:"block min-w-0 truncate text-xs font-medium",title:e.badge,children:e.badge}):r.jsx("span",{})),r.jsx("span",{className:"block min-w-0 truncate",title:e.label,children:e.label}),n&&(e.secondary?r.jsx("span",{className:"block min-w-0 truncate text-xs text-muted-foreground",title:e.secondary,children:e.secondary}):r.jsx("span",{})),o&&(e.status?r.jsx("span",{className:A("size-2 rounded-full",wd[e.status]),"aria-hidden":!0}):r.jsx("span",{}))]})}function yd({items:e,maxVisible:t}){const n=t??10,{anchorTarget:o,t:s}=Zt(),[a,i]=d.useState(!1),c=e.length>n,u=a?e:e.slice(0,n),l=u.some(b=>!!b.badge),m=u.some(b=>!!b.secondary),p=u.some(b=>!!b.status),h=[l&&"auto","minmax(0,1fr)",m&&"minmax(0,2fr)",p&&"auto"].filter(Boolean).join(" "),f="grid min-w-0 grid-cols-[subgrid] col-span-full items-center gap-x-2.5 px-3 py-2 text-sm text-foreground";return r.jsxs("div",{className:"grid overflow-hidden rounded-lg border border-muted-foreground/15",style:{gridTemplateColumns:h},children:[u.map((b,g)=>{const j=b.id??`row-${g}`,x=r.jsx(vd,{item:b,showBadge:l,showSecondary:m,showStatus:p});return b.href?r.jsx("a",{href:b.href,target:o||"_top",rel:"noopener noreferrer",className:A(f,"transition-colors hover:bg-muted/50",g>0&&"border-t border-muted-foreground/10"),children:x},j):r.jsx("div",{className:A(f,g>0&&"border-t border-muted-foreground/10"),children:x},j)}),c&&r.jsx("button",{type:"button",className:"col-span-full flex w-full items-center justify-center gap-1 border-t border-muted-foreground/10 py-2 text-xs text-muted-foreground transition-colors hover:bg-muted/50",onClick:()=>i(b=>!b),children:a?r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronUp,{className:"size-3"}),s("json_see_less")]}):r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronDown,{className:"size-3"}),s("json_see_more",{count:e.length-n})]})})]})}function za({spec:e,active:t=!1}){const{anchorTarget:n,onUiAction:o}=k.useConfig(),{t:s}=G(),a=d.useMemo(()=>({t:s,anchorTarget:n??"_blank",onUiAction:o}),[s,n,o]);return r.jsx(Ma,{spec:e,host:a,active:t})}function kd({spec:e,language:t,onUiAction:n,anchorTarget:o}){const s=Gl({language:t,onUiAction:n,anchorTarget:o});return r.jsx(Ma,{spec:e,host:s})}function Ma({spec:e,host:t,active:n=!1}){return r.jsx(Xl,{host:t,children:r.jsx(Kl,{resetKey:e,children:r.jsx(jd,{spec:e,active:n})})})}function jd({spec:e,active:t}){const n=d.useMemo(()=>e?Zl(e):null,[e]);return!n||!sa(n)?null:r.jsx(Wl,{registry:Vo,initialState:n.state,children:r.jsx(Hl,{spec:n,registry:Vo,loading:t,fallback:dd})})}function Ra(e){if(!e)return[];const t=e.split(`
|
|
11
|
+
`)}function Fo(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?aa(e.props):{}}function aa(e){if(!e||!e._def)return{};const t=e._def,n=pt(e);if(n!=="ZodObject"&&n!=="object")return{};const o=typeof t.shape=="function"?t.shape():t.shape;if(!o)return{};const s={};for(const[a,i]of Object.entries(o)){const c=pt(i);c==="ZodOptional"||c==="optional"||c==="ZodNullable"||c==="nullable"||(s[a]=ar(i))}return s}function ar(e){if(!e||!e._def)return"...";const t=e._def;switch(pt(e)){case"ZodString":case"string":return"example";case"ZodNumber":case"number":return 0;case"ZodBoolean":case"boolean":return!0;case"ZodLiteral":case"literal":return t.value;case"ZodEnum":case"enum":{if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries=="object"){const o=Object.values(t.entries);return o.length>0?o[0]:"example"}return"example"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":case"ZodDefault":case"default":{const o=t.innerType??t.wrapped;return o?ar(o):null}case"ZodArray":case"array":return[];case"ZodObject":case"object":return aa(e);case"ZodUnion":case"union":{const o=t.options;return o&&o.length>0?ar(o[0]):"..."}default:return"..."}}function yl(e){if(!e||!e._def)return null;const t=e._def,n=pt(e);if(n!=="ZodObject"&&n!=="object")return null;const o=typeof t.shape=="function"?t.shape():t.shape;if(!o)return null;for(const[s,a]of Object.entries(o)){const i=pt(a);if(!(i==="ZodOptional"||i==="optional"||i==="ZodNullable"||i==="nullable")&&(i==="ZodString"||i==="string"))return s}return null}function pt(e){if(!e||!e._def)return"";const t=e._def;return t.typeName??t.type??""}function Se(e){if(!e||!e._def)return"unknown";const t=e._def;switch(pt(e)){case"ZodString":case"string":return"string";case"ZodNumber":case"number":return"number";case"ZodBoolean":case"boolean":return"boolean";case"ZodLiteral":case"literal":{const o=t.values,s=(o==null?void 0:o[0])??t.value;return JSON.stringify(s)}case"ZodEnum":case"enum":{let o;if(Array.isArray(t.values))o=t.values;else if(t.entries&&typeof t.entries=="object")o=Object.values(t.entries);else return"enum";return o.map(s=>`"${s}"`).join(" | ")}case"ZodArray":case"array":{const o=typeof t.element=="object"?t.element:typeof t.type=="object"?t.type:void 0;return o?`Array<${Se(o)}>`:"Array<unknown>"}case"ZodObject":case"object":{const o=typeof t.shape=="function"?t.shape():t.shape;return o?`{ ${Object.entries(o).map(([a,i])=>{const c=pt(i);return`${a}${c==="ZodOptional"||c==="ZodNullable"||c==="optional"||c==="nullable"?"?":""}: ${Se(i)}`}).join(", ")} }`:"object"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":{const o=t.innerType??t.wrapped;return o?Se(o):"unknown"}case"ZodUnion":case"union":{const o=t.options;return o?o.map(s=>Se(s)).join(" | "):"unknown"}case"ZodRecord":case"record":{const o=t.keyType??void 0,s=t.valueType??t.element??void 0,a=o?Se(o):"string",i=s?Se(s):"unknown";return`Record<${a}, ${i}>`}case"ZodDefault":case"default":{const o=t.innerType??t.wrapped;return o?Se(o):"unknown"}default:return"unknown"}}function Ho(e){return typeof e.type=="string"?e.type:typeof e.typeName=="string"?e.typeName:""}function Wo(e){return e.startsWith("Zod")?e.slice(3).toLowerCase():e.toLowerCase()}function Ye(e,t=!1){const n=e._def;switch(Wo(Ho(n))){case"string":return{type:"string"};case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"literal":{const s=n.values;return{const:s?s[0]:n.value}}case"enum":{const s=n.entries;return{enum:(s?Object.values(s):n.values)??[]}}case"array":{const s=n.element??n.type;return{type:"array",items:s?Ye(s,t):{}}}case"object":{const s=n.shape,a=typeof s=="function"?s():s;if(!a)return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{type:"object"};const i={},c=[];for(const[u,l]of Object.entries(a)){const m=l._def,p=Wo(Ho(m)),h=p==="optional"||p==="nullable";if(t)if(c.push(u),h){const f=Ye(l,t);i[u]={anyOf:[f,{type:"null"}]}}else i[u]=Ye(l,t);else i[u]=Ye(l),h||c.push(u)}return{type:"object",properties:i,required:c.length>0?c:void 0,additionalProperties:!1}}case"record":{const s=n.valueType;return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{type:"object",additionalProperties:s?Ye(s):!0}}case"optional":case"nullable":{const s=n.innerType;return s?Ye(s,t):{}}case"union":{const s=n.options;return s?{anyOf:s.map(a=>Ye(a,t))}:{}}case"any":case"unknown":return t?{type:"object",properties:{},required:[],additionalProperties:!1}:{};default:return{}}}function kl(e,t){return e.createCatalog(t)}var jl=fl(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref("catalog.components"),props:e.propsOf("catalog.components"),children:e.array(e.string()),visible:e.any()}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:"setState",description:"Update a value in the state model at the given statePath. Params: { statePath: string, value: any }"},{name:"pushState",description:'Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.'},{name:"removeState",description:"Remove an item from an array in state by index. Params: { statePath: string, index: number }"},{name:"validateForm",description:"Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }."}],defaultRules:["CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.","SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.",'CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.','CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.',"When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).",'When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.',"Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.","For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.","Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty."]}),ia=d.createContext(null);function Cl(e,t){return e?null:Object.keys(t).length===0?{}:Or(t)}function Sl({store:e,initialState:t={},onStateChange:n,children:o}){const s=d.useRef(void 0);!e&&!s.current&&(s.current=Tc(t));const a=e??s.current,i=d.useRef(a);i.current=a;const c=d.useRef(!!e);c.current=!!e;const u=d.useRef(e?"controlled":"uncontrolled"),l=d.useRef(!1);if(process.env.NODE_ENV!=="production"){const w=e?"controlled":"uncontrolled";w!==u.current&&!l.current&&(l.current=!0,console.warn(`StateProvider: switching from ${u.current} to ${w} mode is not supported.`))}const m=d.useRef(t),p=d.useRef(Cl(!!e,t));d.useEffect(()=>{if(e||t===m.current)return;m.current=t;const w=t&&Object.keys(t).length>0?Or(t):{},N=p.current??{},C=new Set([...Object.keys(N),...Object.keys(w)]),v={};for(const _ of C)N[_]!==w[_]&&(v[_]=_ in w?w[_]:void 0);p.current=w,Object.keys(v).length>0&&a.update(v)},[e,t,a]);const h=d.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getServerSnapshot??a.getSnapshot),f=d.useRef(n);f.current=n;const b=d.useCallback((w,N)=>{var _;const C=i.current,v=C.getSnapshot();C.set(w,N),!c.current&&C.getSnapshot()!==v&&((_=f.current)==null||_.call(f,[{path:w,value:N}]))},[]),g=d.useCallback(w=>{var v;const N=i.current,C=N.getSnapshot();if(N.update(w),!c.current&&N.getSnapshot()!==C){const _=[];for(const[R,z]of Object.entries(w))ae(C,R)!==z&&_.push({path:R,value:z});_.length>0&&((v=f.current)==null||v.call(f,_))}},[]),j=d.useCallback(w=>i.current.get(w),[]),x=d.useCallback(()=>i.current.getSnapshot(),[]),S=d.useMemo(()=>({state:h,get:j,set:b,update:g,getSnapshot:x}),[h,j,b,g,x]);return r.jsx(ia.Provider,{value:S,children:o})}function Kt(){const e=d.useContext(ia);if(!e)throw new Error("useStateStore must be used within a StateProvider");return e}var ca=d.createContext(null);function Nl({children:e}){const{state:t}=Kt(),n=d.useMemo(()=>({stateModel:t}),[t]),o=d.useMemo(()=>a=>_t(a,n),[n]),s=d.useMemo(()=>({isVisible:o,ctx:n}),[o,n]);return r.jsx(ca.Provider,{value:s,children:e})}function _l(){const e=d.useContext(ca);if(!e)throw new Error("useVisibility must be used within a VisibilityProvider");return e}var la=d.createContext(null);function El(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n){const a=e[s],i=t[s];if(a!==i){if(typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null){const c=a.$state,u=i.$state;if(typeof c=="string"&&c===u)continue}return!1}}return!0}function Tl(e,t){if(e===t)return!0;if(e.validateOn!==t.validateOn)return!1;const n=e.checks??[],o=t.checks??[];if(n.length!==o.length)return!1;for(let s=0;s<n.length;s++){const a=n[s],i=o[s];if(a.type!==i.type||a.message!==i.message||!El(a.args,i.args))return!1}return!0}function Al({customFunctions:e={},children:t}){const{state:n,getSnapshot:o}=Kt(),[s,a]=d.useState({}),i=d.useRef({}),[c,u]=d.useState({}),l=d.useCallback((g,j)=>{u(x=>{const S=x[g];return S&&Tl(S,j)?x:{...x,[g]:j}})},[]),m=d.useCallback((g,j)=>{var v;const x=o(),S=g.split("/").filter(Boolean);let w=x;for(const _ of S)if(w!=null&&typeof w=="object")w=w[_];else{w=void 0;break}const N=al(j,{value:w,stateModel:x,customFunctions:e}),C={touched:((v=i.current[g])==null?void 0:v.touched)??!0,validated:!0,result:N};return i.current={...i.current,[g]:C},a(i.current),N},[e,o]),p=d.useCallback(g=>{var j,x;i.current={...i.current,[g]:{...i.current[g],touched:!0,validated:((j=i.current[g])==null?void 0:j.validated)??!1,result:((x=i.current[g])==null?void 0:x.result)??null}},a(i.current)},[]),h=d.useCallback(g=>{const{[g]:j,...x}=i.current;i.current=x,a(x)},[]),f=d.useCallback(()=>{let g=!0;for(const[j,x]of Object.entries(c))m(j,x).valid||(g=!1);return g},[c,m]),b=d.useMemo(()=>({customFunctions:e,get fieldStates(){return i.current},validate:m,touch:p,clear:h,validateAll:f,registerField:l}),[e,s,m,p,h,f,l]);return r.jsx(la.Provider,{value:b,children:t})}function Il(){return d.useContext(la)}var Uo=0;function Bo(){return Uo+=1,`${Date.now()}-${Uo}`}function ir(e,t){if(e==null)return e;if(e==="$id")return Bo();if(typeof e=="object"&&!Array.isArray(e)){const n=e,o=Object.keys(n);if(o.length===1&&typeof n.$state=="string")return t(n.$state);if(o.length===1&&"$id"in n)return Bo()}if(Array.isArray(e))return e.map(n=>ir(n,t));if(typeof e=="object"){const n={};for(const[o,s]of Object.entries(e))n[o]=ir(s,t);return n}return e}var da=d.createContext(null);function zl({handlers:e={},navigate:t,children:n}){const{get:o,set:s,getSnapshot:a}=Kt(),i=Il(),[c,u]=d.useState(e),[l,m]=d.useState(new Set),[p,h]=d.useState(null),f=d.useCallback((S,w)=>{u(N=>({...N,[S]:w}))},[]),b=d.useCallback(async S=>{var R;const w=nl(S,a()),N=Gc(),C=Date.now();Yc({id:N,name:w.action,params:w.params,at:C});let v=!0,_;try{if(w.action==="setState"&&w.params){const M=w.params.statePath,D=w.params.value;M&&s(M,D);return}if(w.action==="pushState"&&w.params){const M=w.params.statePath,D=w.params.value;if(M){const O=ir(D,o),U=o(M)??[];s(M,[...U,O]);const E=w.params.clearStatePath;E&&s(E,"")}return}if(w.action==="removeState"&&w.params){const M=w.params.statePath,D=w.params.index;if(M!==void 0&&D!==void 0){const O=o(M)??[];s(M,O.filter((U,E)=>E!==D))}return}if(w.action==="push"&&w.params){const M=w.params.screen;if(M){const D=o("/currentScreen"),O=o("/navStack")??[];D?s("/navStack",[...O,D]):s("/navStack",[...O,""]),s("/currentScreen",M)}return}if(w.action==="pop"){const M=o("/navStack")??[];if(M.length>0){const D=M[M.length-1];s("/navStack",M.slice(0,-1)),D?s("/currentScreen",D):s("/currentScreen",void 0)}return}if(w.action==="validateForm"){const M=i==null?void 0:i.validateAll;if(!M){console.warn("validateForm action was dispatched but no ValidationProvider is connected. Ensure ValidationProvider is rendered inside the provider tree.");return}const D=M(),O={};for(const[E,I]of Object.entries(i.fieldStates))I.result&&!I.result.valid&&(O[E]=I.result.errors);const U=((R=w.params)==null?void 0:R.statePath)||"/formValidation";s(U,{valid:D,errors:O});return}const z=c[w.action];if(!z){console.warn(`No handler registered for action: ${w.action}`);return}if(w.confirm)return new Promise((M,D)=>{h({action:w,handler:z,resolve:()=>{h(null),M()},reject:()=>{h(null),D(new Error("Action cancelled"))}})}).then(async()=>{m(M=>new Set(M).add(w.action));try{await Lo({action:w,handler:z,setState:s,navigate:t,executeAction:async M=>{await b({action:M})}})}finally{m(M=>{const D=new Set(M);return D.delete(w.action),D})}});m(M=>new Set(M).add(w.action));try{await Lo({action:w,handler:z,setState:s,navigate:t,executeAction:async M=>{await b({action:M})}})}finally{m(M=>{const D=new Set(M);return D.delete(w.action),D})}}catch(z){throw v=!1,_=z,z}finally{const z=Date.now();Xc({id:N,name:w.action,ok:v,at:z,durationMs:z-C,error:_})}},[c,o,s,a,t,i]),g=d.useCallback(()=>{p==null||p.resolve()},[p]),j=d.useCallback(()=>{p==null||p.reject()},[p]),x=d.useMemo(()=>({handlers:c,loadingActions:l,pendingConfirmation:p,execute:b,confirm:g,cancel:j,registerHandler:f}),[c,l,p,b,g,j,f]);return r.jsx(da.Provider,{value:x,children:n})}function ua(){const e=d.useContext(da);if(!e)throw new Error("useActions must be used within an ActionProvider");return e}function Ml({confirm:e,onConfirm:t,onCancel:n}){const o=e.variant==="danger";return r.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50},onClick:n,children:r.jsxs("div",{style:{backgroundColor:"white",borderRadius:"8px",padding:"24px",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)"},onClick:s=>s.stopPropagation(),children:[r.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"18px",fontWeight:600},children:e.title}),r.jsx("p",{style:{margin:"0 0 24px 0",color:"#6b7280"},children:e.message}),r.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[r.jsx("button",{onClick:n,style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #d1d5db",backgroundColor:"white",cursor:"pointer"},children:e.cancelLabel??"Cancel"}),r.jsx("button",{onClick:t,style:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:o?"#dc2626":"#3b82f6",color:"white",cursor:"pointer"},children:e.confirmLabel??"Confirm"})]})]})})}var pa=d.createContext(null);function Rl({item:e,index:t,basePath:n,children:o}){return r.jsx(pa.Provider,{value:{item:e,index:t,basePath:n},children:o})}function Pl(){return d.useContext(pa)}var Ol=class extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}render(){return this.state.hasError?null:this.props.children}},ma={},ha=d.createContext(ma);function $l(){return d.useContext(ha)}var fa=d.createContext(void 0);function Ll(){return d.useContext(fa)}function Dl(){return d.useSyncExternalStore(Jc,Zc,()=>!1)}var ga=d.memo(function e({element:t,elementKey:n,spec:o,registry:s,loading:a,fallback:i}){var H;const c=Dl(),u=Pl(),{ctx:l}=_l(),{execute:m}=ua(),{getSnapshot:p,state:h}=Kt(),f=$l(),b=Ll(),g=d.useMemo(()=>{const L=u?{...l,repeatItem:u.item,repeatIndex:u.index,repeatBasePath:u.basePath}:{...l};return L.functions=f,L.directives=b,L},[l,u,f,b]),j=t.visible===void 0?!0:_t(t.visible,g),x=t.on,S=d.useCallback(async L=>{const q=x==null?void 0:x[L];if(!q)return;const X=Array.isArray(q)?q:[q];for(const B of X){if(!B.params){await m(B);continue}const F={...g,stateModel:p()},J={};for(const[re,$]of Object.entries(B.params))J[re]=Ro($,F);await m({...B,params:J})}},[x,m,g,p]),w=d.useCallback(L=>{const q=x==null?void 0:x[L];if(!q)return{emit:()=>{},shouldPreventDefault:!1,bound:!1};const B=(Array.isArray(q)?q:[q]).some(F=>F.preventDefault);return{emit:()=>S(L),shouldPreventDefault:B,bound:!0}},[x,S]),N=t.watch,C=d.useRef(null),v=d.useRef(void 0),_=d.useMemo(()=>{if(!N)return;const L={};for(const X of Object.keys(N))L[X]=ae(h,X);const q=v.current;if(q){const X=Object.keys(L);if(X.length===Object.keys(q).length&&X.every(B=>L[B]===q[B]))return q}return v.current=L,L},[N,h]);if(d.useEffect(()=>{if(!N||!_)return;const L=Object.keys(N);if(L.length===0)return;const q=C.current;if(C.current=_,q===null)return;let X=!1;return(async()=>{for(const B of L){if(X)break;if(_[B]!==q[B]){const F=N[B];if(!F)continue;const J=Array.isArray(F)?F:[F];for(const re of J){if(X)break;if(!re.params){if(await m(re),X)break;continue}const $={...g,stateModel:p()},te={};for(const[K,oe]of Object.entries(re.params))te[K]=Ro(oe,$);if(await m({...re,params:te}),X)break}}}})().catch(console.error),()=>{X=!0}},[N,_,m,g,p]),!j)return null;const R=t.props,z=Vc(R,g),M=qc(R,g),D=M!==t.props?{...t,props:M}:t,O=s[D.type]??i;if(!O)return console.warn(`No renderer for component type: ${D.type}`),null;const U=D.repeat?r.jsx(Fl,{element:D,spec:o,registry:s,loading:a,fallback:i}):(H=D.children)==null?void 0:H.map(L=>{const q=o.elements[L];return q?r.jsx(e,{element:q,elementKey:L,spec:o,registry:s,loading:a,fallback:i},L):(a||console.warn(`[json-render] Missing element "${L}" referenced as child of "${D.type}". This element will not render.`),null)}),E=r.jsx(O,{element:D,emit:S,on:w,bindings:z,loading:a,children:U}),I=c&&n?r.jsx("span",{"data-jr-key":n,style:{display:"contents"},children:E}):E;return r.jsx(Ol,{elementType:D.type,children:I})});function Fl({element:e,spec:t,registry:n,loading:o,fallback:s}){const{state:a}=Kt(),i=e.repeat,c=i.statePath,u=ae(a,c)??[];return r.jsx(r.Fragment,{children:u.map((l,m)=>{var h;const p=i.key&&typeof l=="object"&&l!==null?String(l[i.key]??m):String(m);return r.jsx(Rl,{item:l,index:m,basePath:`${c}/${m}`,children:(h=e.children)==null?void 0:h.map(f=>{const b=t.elements[f];return b?r.jsx(ga,{element:b,elementKey:f,spec:t,registry:n,loading:o,fallback:s},f):(o||console.warn(`[json-render] Missing element "${f}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},p)})})}function Hl({spec:e,registry:t,loading:n,fallback:o}){if(!e||!e.root)return null;const s=e.elements[e.root];return s?r.jsx(ga,{element:s,elementKey:e.root,spec:e,registry:t,loading:n,fallback:o}):null}function Wl({registry:e,store:t,initialState:n,handlers:o,navigate:s,validationFunctions:a,functions:i,directives:c,onStateChange:u,children:l}){const m=d.useMemo(()=>c?Lc(c):void 0,[c]);return r.jsx(Sl,{store:t,initialState:n,onStateChange:u,children:r.jsx(Nl,{children:r.jsx(Al,{customFunctions:a,children:r.jsx(zl,{handlers:o,navigate:s,children:r.jsx(ha.Provider,{value:i??ma,children:r.jsxs(fa.Provider,{value:m,children:[l,r.jsx(Ul,{})]})})})})})})}function Ul(){const{pendingConfirmation:e,confirm:t,cancel:n}=ua();return e!=null&&e.action.confirm?r.jsx(Ml,{confirm:e.action.confirm,onConfirm:t,onCancel:n}):null}function Bl(e,t){const n={};if(t.components)for(const[i,c]of Object.entries(t.components))n[i]=({element:u,children:l,emit:m,on:p,bindings:h,loading:f})=>c({props:u.props,children:l,emit:m,on:p,bindings:h,loading:f});const o=t.actions?Object.entries(t.actions):[];return{registry:n,handlers:(i,c)=>{const u={};for(const[l,m]of o)u[l]=async p=>{const h=i(),f=c();h&&await m(p,h,f)};return u},executeAction:async(i,c,u,l={})=>{const m=o.find(([p])=>p===i);m?await m[1](c,u,l):console.warn(`Unknown action: ${i}`)}}}function ql(e){if(typeof e!="object"||e===null)return!1;const t=e;switch(t.type){case"patch":return typeof t.patch=="object"&&t.patch!==null;case"flat":case"nested":return typeof t.spec=="object"&&t.spec!==null;default:return!1}}function Vl(e){const t={root:"",elements:{}};let n=!1;for(const o of e)if(o.type===Ec){if(!ql(o.data))continue;const s=o.data;if(s.type==="patch")n=!0,Cc(t,s.patch);else if(s.type==="flat")n=!0,Object.assign(t,s.spec);else if(s.type==="nested"){n=!0;const a=Sc(s.spec);Object.assign(t,a)}}return n?t:null}function G(){const{dir:e}=k.useDocumentDir(),t=k.useConfig();return d.useMemo(()=>{const n=Z.resolveLanguage(t.language);return{t:(s,a)=>Z.getTranslation(s,n,t.translationOverrides,a),language:n,dir:Z.isRtlLanguage(n)?"rtl":"ltr",hostDocumentDir:e}},[t.language,t.translationOverrides,e])}function xa(e){const t=Z.resolveLanguage(e);return(n,o)=>Z.getTranslation(n,t,void 0,o)}const Yl={t:xa("en"),anchorTarget:"_blank"},ba=d.createContext(Yl);function Xl({host:e,children:t}){return r.jsx(ba.Provider,{value:e,children:t})}function Zt(){return d.useContext(ba)}function Gl({language:e,onUiAction:t,anchorTarget:n="_blank"}){return d.useMemo(()=>({t:xa(e),anchorTarget:n,onUiAction:t}),[e,n,t])}class Kl extends d.Component{constructor(){super(...arguments);Eo(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){Z.log.error("json-render: spec failed to render",{_e:n instanceof Error?n.message:String(n)})}componentDidUpdate(n){this.state.hasError&&n.resetKey!==this.props.resetKey&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}}function Zl(e){if(!e.elements)return e;let t=!1;const n={};for(const[o,s]of Object.entries(e.elements)){const a=Jl(s,e);a!==s&&(t=!0),n[o]=a}return t?{...e,elements:n}:e}function Jl(e,t){if(e.type!=="List")return e;const n=e.repeat;if(!n||typeof n.statePath!="string")return e;const o=Z.isRecord(e.props)?e.props:{},s=o.items;if(Array.isArray(s)&&s.length>0)return e;const i=ae(t.state??{},n.statePath);if(!Array.isArray(i)||i.length===0)return e;const{repeat:c,...u}=e;return{...u,props:{...o,items:i}}}function A(...e){return pc.twMerge(uc.clsx(e))}const Ql=d.lazy(()=>Promise.resolve().then(()=>require("./Chart.impl-CNaZah97.cjs")));function ed(e){const t=e.height??220;return r.jsx(d.Suspense,{fallback:r.jsx(td,{height:t}),children:r.jsx(Ql,{...e})})}function td({height:e}){return r.jsx("div",{className:"w-full animate-pulse rounded-lg bg-muted-foreground/10",style:{height:e},"aria-hidden":!0})}const wa=y.z.object({title:y.z.string().nullish(),description:y.z.string().nullish()}),va=y.z.object({direction:y.z.enum(["row","column"]).nullish(),gap:y.z.enum(["sm","md","lg"]).nullish(),align:y.z.enum(["start","center","end","stretch"]).nullish(),justify:y.z.enum(["start","center","end","between"]).nullish()}),ya=y.z.object({columns:y.z.union([y.z.literal(1),y.z.literal(2),y.z.literal(3)]).nullish(),gap:y.z.enum(["sm","md","lg"]).nullish()}),ka=y.z.object({text:y.z.string(),level:y.z.union([y.z.literal(1),y.z.literal(2),y.z.literal(3),y.z.literal(4)]).nullish()}),ja=y.z.object({text:y.z.string(),variant:y.z.enum(["body","caption","muted","code"]).nullish()}),Ca=y.z.object({text:y.z.string(),variant:y.z.enum(["default","secondary","success","warning","destructive"]).nullish()}),nd=new Set(["http:","https:","mailto:"]),rd=y.z.string().nullish().transform(e=>{if(!e)return null;try{return nd.has(new URL(e).protocol)?e:null}catch{return null}}),Sa=y.z.object({id:y.z.string().nullish(),label:y.z.string(),secondary:y.z.string().nullish(),badge:y.z.string().nullish(),status:y.z.enum(["success","warning","error","info","neutral"]).nullish(),href:rd}),Na=y.z.object({items:y.z.array(Sa),maxVisible:y.z.number().int().positive().nullish()}),od=y.z.object({items:y.z.array(Sa.extend({href:y.z.string().nullish()})),maxVisible:Na.shape.maxVisible}),_a=y.z.object({columns:y.z.array(y.z.string()),rows:y.z.array(y.z.array(y.z.string())),caption:y.z.string().nullish()}),sd=y.z.object({value:y.z.string(),direction:y.z.enum(["up","down","flat"]),label:y.z.string().nullish()}),Ea=y.z.object({label:y.z.string(),value:y.z.string(),description:y.z.string().nullish(),trend:y.z.enum(["up","down","neutral"]).nullish(),delta:sd.nullish()}),Ta=y.z.object({type:y.z.enum(["info","tip","warning","important"]).nullish(),title:y.z.string().nullish(),content:y.z.string()}),ad=y.z.object({label:y.z.string(),value:y.z.number()}),Aa=y.z.object({type:y.z.enum(["bar","line","pie"]),data:y.z.array(ad),title:y.z.string().nullish(),height:y.z.number().int().positive().nullish(),centerLabel:y.z.string().nullish()}),Ia=y.z.object({agentId:y.z.string(),agentName:y.z.string(),model:y.z.string().nullish()});function ke(e,t,n){const o=e.safeParse(t);return o.success?o.data:n}const id=kl(jl,{components:{Card:{props:wa,slots:["default"],description:"Container card with an optional title/description. Group related content.",example:{title:"Order summary",description:"Placed 2 days ago"}},Stack:{props:va,slots:["default"],description:'Flex layout. Use direction="row" for side-by-side, "column" (default) to stack.'},Grid:{props:ya,slots:["default"],description:"Column grid that wraps on narrow screens. columns=2 for side-by-side metrics or cards; columns=3 only for three short metrics — the chat panel is about 400px wide, so three wide cells wrap."},Heading:{props:ka,description:"Section heading. level 1 (largest) to 4.",example:{text:"Your orders",level:3}},Text:{props:ja,description:'A paragraph of text. variant "muted"/"caption" for secondary text, "code" for monospace.'},Badge:{props:Ca,description:"Small status pill. Use variant to convey state (success/warning/destructive).",example:{text:"Delivered",variant:"success"}},List:{props:od,description:"A vertical list of items, each with a label and optional secondary text, badge, and status dot. Pass the full array in `items` — do NOT use repeat/state for the rows.",example:{items:[{label:"Order #1024",secondary:"Shipped",status:"success"},{label:"Order #1025",secondary:"Processing",status:"warning"}]}},Table:{props:_a,description:"A data table. `columns` are header strings; `rows` is a 2D array of cell strings (each row same length as columns).",example:{columns:["Item","Qty","Price"],rows:[["Widget","2","$20"],["Gadget","1","$15"]]}},Metric:{props:Ea,description:"A single key figure (KPI / insight card) with a label, big value, optional description, trend arrow, and an optional period-over-period delta ({ value, direction, label }).",example:{label:"Total spent",value:"$1,240",description:"Last 30 days",trend:"up",delta:{value:"+8%",direction:"up",label:"vs previous 30d"}}},Callout:{props:Ta,description:"A highlighted info / tip / warning box for a single important note. Use for one call-out, not for long prose.",example:{type:"tip",title:"Heads up",content:"Free shipping over $50."}},PhoneAgentCard:{props:Ia,description:'A phone agent card with a "Test via web" action. NEVER author this yourself: it only comes back, already fenced, from the phone-agent tools — carry that fence verbatim.',example:{agentId:"00000000-0000-4000-8000-000000000000",agentName:"Support line",model:"oppie-vox-livekit"}},Chart:{props:Aa,description:"A bar, line, or pie (donut) chart. `data` is an array of { label, value } points. Choose by the question: line = trend over time, bar = comparison across categories, pie = share of a total (optional `centerLabel` shows a big number in the donut hole). Use for trends or distributions, not for a handful of numbers (use Metric for those). Colours, axes, legend, and tooltips are handled for you.",example:{type:"bar",title:"Orders per month",data:[{label:"Jan",value:12},{label:"Feb",value:18}]}}},actions:{}});function cr({height:e=64}){return r.jsx("div",{className:"w-full animate-pulse rounded-lg bg-muted-foreground/10",style:{height:e},"aria-hidden":!0})}const qo={sm:"gap-1.5",md:"gap-3",lg:"gap-4"},cd="10rem";function ld(e){return e===1?"minmax(0, 1fr)":`repeat(auto-fit, minmax(max(${cd}, calc(100% / ${e} - 1rem)), 1fr))`}const{registry:Vo}=Bl(id,{components:{Card:({props:e,children:t,loading:n})=>{const o=ke(wa,e,{});return r.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-muted-foreground/15 p-3",children:[(o.title||o.description)&&r.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.title&&r.jsx("div",{className:"text-sm font-semibold text-foreground",children:o.title}),o.description&&r.jsx("div",{className:"text-xs text-muted-foreground",children:o.description})]}),Vn(t,n)]})},Stack:({props:e,children:t,loading:n})=>{const o=ke(va,e,{}),s={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"}[o.align??"stretch"],a={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between"}[o.justify??"start"];return r.jsx("div",{className:A("flex",o.direction==="row"?"flex-row":"flex-col",qo[o.gap??"md"],s,a),children:Vn(t,n)})},Grid:({props:e,children:t,loading:n})=>{const o=ke(ya,e,{});return r.jsx("div",{className:A("grid",qo[o.gap??"md"]),style:{gridTemplateColumns:ld(o.columns??1)},children:Vn(t,n)})},Heading:({props:e})=>{const t=ke(ka,e,{text:""}),n=t.level??3,o={1:"text-xl font-bold",2:"text-lg font-bold",3:"text-base font-semibold",4:"text-sm font-semibold"}[n]??"text-base font-semibold";return d.createElement(`h${n}`,{className:A("text-foreground",o)},t.text)},Text:({props:e})=>{const t=ke(ja,e,{text:""});if(t.variant==="code")return r.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:t.text});const n=t.variant==="muted"||t.variant==="caption";return r.jsx("p",{className:A("whitespace-pre-wrap",n?"text-xs text-muted-foreground":"text-sm text-foreground"),children:t.text})},Badge:({props:e})=>{const t=ke(Ca,e,{text:""}),n={default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",warning:"bg-amber-500/15 text-amber-600 dark:text-amber-400",destructive:"bg-destructive/15 text-destructive"}[t.variant??"secondary"];return r.jsx("span",{className:A("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",n),children:t.text})},List:({props:e,loading:t})=>{const n=ke(Na,e,{items:[]});return n.items.length===0?t?r.jsx(cr,{}):r.jsx(Yo,{translationKey:"json_no_items"}):r.jsx(yd,{items:n.items,maxVisible:n.maxVisible})},Table:({props:e,loading:t})=>{const n=ke(_a,e,{columns:[],rows:[]});return t&&n.rows.length===0?r.jsx(cr,{}):n.columns.length===0?r.jsx(Yo,{translationKey:"json_no_data"}):r.jsx("div",{className:"overflow-x-auto rounded-lg border border-muted-foreground/15",children:r.jsxs("table",{className:"w-full text-sm",children:[n.caption&&r.jsx("caption",{className:"px-3 py-2 text-start text-xs text-muted-foreground",children:n.caption}),r.jsx("thead",{children:r.jsx("tr",{className:"border-b border-muted-foreground/15 bg-muted/40",children:n.columns.map((o,s)=>r.jsx("th",{className:"px-3 py-2 text-start font-medium text-foreground",children:o},s))})}),r.jsx("tbody",{children:n.rows.map((o,s)=>r.jsx("tr",{className:"border-b border-muted-foreground/10 last:border-0",children:o.map((a,i)=>r.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:a},i))},s))})]})})},Metric:({props:e})=>{const t=ke(Ea,e,{label:"",value:""});return r.jsx(bd,{label:t.label,value:t.value,description:t.description,trend:t.trend,delta:t.delta})},Callout:({props:e})=>{const t=ke(Ta,e,{content:""}),n=ud[t.type??"info"],o=n.Icon;return r.jsxs("div",{className:A("flex gap-2 rounded-lg border-l-2 p-3",n.cls),children:[r.jsx(o,{className:"mt-0.5 size-4 shrink-0"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.title&&r.jsx("span",{className:"text-sm font-semibold",children:t.title}),r.jsx("span",{className:"text-sm",children:t.content})]})]})},PhoneAgentCard:({props:e})=>{const t=ke(Ia,e,{agentId:"",agentName:""});return r.jsx(md,{...t})},Chart:({props:e})=>{const t=ke(Aa,e,{type:"bar",data:[]});return r.jsxs("div",{className:"flex flex-col gap-1",children:[t.title&&r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.title}),r.jsx(ed,{...t})]})}}}),dd=({element:e})=>{const{t}=Zt();return r.jsx("div",{className:"rounded-lg border border-dashed border-muted-foreground/30 px-2 py-1.5 text-xs text-muted-foreground",children:t("json_unsupported",{type:e.type})})},ud={info:{Icon:T.Info,cls:"border-l-blue-500 bg-blue-500/5 text-foreground"},tip:{Icon:T.Lightbulb,cls:"border-l-emerald-500 bg-emerald-500/5 text-foreground"},warning:{Icon:T.AlertTriangle,cls:"border-l-amber-500 bg-amber-500/5 text-foreground"},important:{Icon:T.AlertCircle,cls:"border-l-red-500 bg-red-500/5 text-foreground"}};function Vn(e,t){return d.Children.toArray(e).length>0?e:t?r.jsx(cr,{}):null}function Yo({translationKey:e}){const{t}=Zt();return r.jsx("div",{className:"rounded-lg border border-muted-foreground/15 px-3 py-2 text-xs text-muted-foreground",children:t(e)})}const pd="oppie-vox-livekit";function md({agentId:e,agentName:t,model:n}){const{t:o,onUiAction:s}=Zt(),a=!!s&&!!e&&n===pd;return r.jsxs("div",{className:"flex w-full flex-col gap-3 rounded-xl border border-muted-foreground/15 p-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:r.jsx(T.Phone,{className:"size-4","aria-hidden":!0})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t}),r.jsx("div",{className:"text-xs text-muted-foreground",children:o("json_phone_agent")})]})]}),a&&r.jsxs("button",{type:"button",className:"flex w-full items-center justify-center gap-2 rounded-lg bg-secondary px-3 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80",onClick:()=>s==null?void 0:s({type:"test-phone-agent",payload:{agentId:e,model:n??null}}),children:[r.jsx(T.Play,{className:"size-4","aria-hidden":!0}),o("json_phone_agent_test")]})]})}const hd={up:"↑",down:"↓",neutral:"→"},fd={up:"text-emerald-600 dark:text-emerald-400",down:"text-red-600 dark:text-red-400",neutral:"text-muted-foreground"},gd={up:"↑",down:"↓",flat:"→"},xd={up:"text-emerald-600 dark:text-emerald-400",down:"text-red-600 dark:text-red-400",flat:"text-muted-foreground"};function bd({label:e,value:t,description:n,trend:o,delta:s}){return r.jsxs("div",{className:"min-w-[140px] space-y-1 rounded-xl border border-muted-foreground/15 p-3",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e}),r.jsxs("div",{className:"flex items-baseline gap-2",children:[r.jsx("span",{className:"text-2xl font-medium tracking-tight text-foreground",children:t}),o?r.jsx("span",{className:A("text-sm font-medium",fd[o]),children:hd[o]}):null]}),s?r.jsxs("div",{className:"flex items-baseline gap-1 text-xs",children:[r.jsxs("span",{className:A("font-medium",xd[s.direction]),children:[gd[s.direction]," ",s.value]}),s.label?r.jsx("span",{className:"text-muted-foreground",children:s.label}):null]}):null,n?r.jsx("span",{className:"block text-xs text-muted-foreground",children:n}):null]})}const wd={success:"bg-emerald-500",warning:"bg-amber-500",error:"bg-red-500",info:"bg-blue-500",neutral:"bg-muted-foreground/40"};function vd({item:e,showBadge:t,showSecondary:n,showStatus:o}){return r.jsxs(r.Fragment,{children:[t&&(e.badge?r.jsx("span",{className:"block min-w-0 truncate text-xs font-medium",title:e.badge,children:e.badge}):r.jsx("span",{})),r.jsx("span",{className:"block min-w-0 truncate",title:e.label,children:e.label}),n&&(e.secondary?r.jsx("span",{className:"block min-w-0 truncate text-xs text-muted-foreground",title:e.secondary,children:e.secondary}):r.jsx("span",{})),o&&(e.status?r.jsx("span",{className:A("size-2 rounded-full",wd[e.status]),"aria-hidden":!0}):r.jsx("span",{}))]})}function yd({items:e,maxVisible:t}){const n=t??10,{anchorTarget:o,t:s}=Zt(),[a,i]=d.useState(!1),c=e.length>n,u=a?e:e.slice(0,n),l=u.some(b=>!!b.badge),m=u.some(b=>!!b.secondary),p=u.some(b=>!!b.status),h=[l&&"auto","minmax(0,1fr)",m&&"minmax(0,2fr)",p&&"auto"].filter(Boolean).join(" "),f="grid min-w-0 grid-cols-[subgrid] col-span-full items-center gap-x-2.5 px-3 py-2 text-sm text-foreground";return r.jsxs("div",{className:"grid overflow-hidden rounded-lg border border-muted-foreground/15",style:{gridTemplateColumns:h},children:[u.map((b,g)=>{const j=b.id??`row-${g}`,x=r.jsx(vd,{item:b,showBadge:l,showSecondary:m,showStatus:p});return b.href?r.jsx("a",{href:b.href,target:o||"_top",rel:"noopener noreferrer",className:A(f,"transition-colors hover:bg-muted/50",g>0&&"border-t border-muted-foreground/10"),children:x},j):r.jsx("div",{className:A(f,g>0&&"border-t border-muted-foreground/10"),children:x},j)}),c&&r.jsx("button",{type:"button",className:"col-span-full flex w-full items-center justify-center gap-1 border-t border-muted-foreground/10 py-2 text-xs text-muted-foreground transition-colors hover:bg-muted/50",onClick:()=>i(b=>!b),children:a?r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronUp,{className:"size-3"}),s("json_see_less")]}):r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronDown,{className:"size-3"}),s("json_see_more",{count:e.length-n})]})})]})}function za({spec:e,active:t=!1}){const{anchorTarget:n,onUiAction:o}=k.useConfig(),{t:s}=G(),a=d.useMemo(()=>({t:s,anchorTarget:n??"_blank",onUiAction:o}),[s,n,o]);return r.jsx(Ma,{spec:e,host:a,active:t})}function kd({spec:e,language:t,onUiAction:n,anchorTarget:o}){const s=Gl({language:t,onUiAction:n,anchorTarget:o});return r.jsx(Ma,{spec:e,host:s})}function Ma({spec:e,host:t,active:n=!1}){return r.jsx(Xl,{host:t,children:r.jsx(Kl,{resetKey:e,children:r.jsx(jd,{spec:e,active:n})})})}function jd({spec:e,active:t}){const n=d.useMemo(()=>e?Zl(e):null,[e]);return!n||!sa(n)?null:r.jsx(Wl,{registry:Vo,initialState:n.state,children:r.jsx(Hl,{spec:n,registry:Vo,loading:t,fallback:dd})})}function Ra(e){if(!e)return[];const t=e.split(`
|
|
12
12
|
`),n=[];let o=[],s=[],a=[],i=!1,c=!1;function u(){if(o.length===0)return;const p=o.join(`
|
|
13
13
|
`);p.trim()&&n.push({type:"markdown",content:p}),o=[]}function l(){if(s.length===0)return;let p=null;if(a.length>0)try{p=Nc(a.join(`
|
|
14
|
-
`),{root:"",elements:{}})}catch{}p&&Cd(p)?(u(),n.push({type:"ui",spec:p})):o.push(...s),a=[],s=[]}function m(){c&&(l(),c=!1)}for(let p=0;p<t.length;p+=1){const h=t[p]??"",f=h.trim(),b=p===t.length-1;if(!i&&f==="```spec"){m(),i=!0,s=[h];continue}if(i&&f==="```"){s.push(h),l(),i=!1;continue}if(i){s.push(h),f!==""&&or(h)&&a.push(h);continue}if(f!==""&&or(h)){c=!0,s.push(h),a.push(h);continue}if(c){if(f===""||b&&Nd(f)){s.push(h);continue}m()}o.push(h)}return l(),u(),n}function Cd(e){return sa(e)&&e.elements[e.root]!==void 0}const Sd='{"op":';function Nd(e){return!e.startsWith("{")||e.endsWith("}")?!1:/"op"\s*:/.test(e)?!0:Sd.startsWith(e.replace(/\s+/g,""))}function _d(e){return Vl(e)}function P(e){return{"data-component":e}}const lr=[{kind:"csv",label:"CSV",mimes:["text/csv","application/csv"],extensions:["csv"]},{kind:"excel",label:"Excel",mimes:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],extensions:["xls","xlsx"]}],Ed=Object.fromEntries(lr.flatMap(e=>e.mimes.map(t=>[t,e.extensions.map(n=>`.${n}`)]))),Td={"video/mp4":[".mp4"],"video/webm":[".webm"],"video/quicktime":[".mov"],"video/x-m4v":[".m4v"],"video/x-matroska":[".mkv"],"video/3gpp":[".3gp"]};function Pa({type:e,name:t}){var s,a;const n=((s=t.split(".").pop())==null?void 0:s.toLowerCase())??"",o=((a=e.toLowerCase().split(";")[0])==null?void 0:a.trim())??"";return lr.find(i=>n&&i.extensions.includes(n))??lr.find(i=>o&&i.mimes.includes(o))??null}function An(){const[e]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches);return e}const Et={x:2,y:2},Re=d.memo(d.forwardRef(({children:e,className:t,scale:n=1.02,off:o=!1},s)=>{const[a,i]=d.useState(!1),[c,u]=d.useState({x:0,y:0}),l=An(),m=W.useReducedMotion();if(o||!l||m)return d.cloneElement(e,{ref:s??e.props.ref});if(/translate/.test(e.props.className||""))return e;const h=j=>{var M,D;const{clientX:x,clientY:S}=j,w=j.currentTarget.getBoundingClientRect(),N=x-(w.left+w.width/2),C=S-(w.top+w.height/2),v=Math.max(-1,Math.min(1,N/(w.width/2))),_=Math.max(-1,Math.min(1,C/(w.height/2))),R=v*Et.x,z=_*Et.y;u({x:R,y:z}),(D=(M=e.props).onMouseMove)==null||D.call(M,j)},f=j=>{var x,S;i(!0),(S=(x=e.props).onMouseEnter)==null||S.call(x,j)},b=j=>{var x,S;i(!1),u({x:0,y:0}),(S=(x=e.props).onMouseLeave)==null||S.call(x,j)},g={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(n-1)};return d.cloneElement(e,{ref:s,onMouseMove:h,onMouseEnter:f,onMouseLeave:b,style:{...g,...e.props.style},className:A("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",t,e.props.className,"transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]")})}));Re.displayName="Wobble";const et=[.23,1,.32,1],Ad=`cubic-bezier(${et.join(", ")})`,Te={duration:.2,ease:et},we={duration:.15,ease:et},Tt={type:"spring",stiffness:500,damping:45,mass:1},Id=[.32,.72,.24,1],zd=`cubic-bezier(${Id.join(", ")})`,Md="0 2px 12px 0 rgba(0,0,0,0.18), 0 1px 4px 0 rgba(0,0,0,0), 0 0 0 1px rgba(255,255,255,0.08), inset 0 1px 0 0 rgba(255,255,255,0)",Rd="0 8px 28px 0 rgba(0,0,0,0.10), 0 1px 4px 0 rgba(0,0,0,0), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",Pd="0 12px 40px 0 rgba(0,0,0,0.12), 0 2px 8px 0 rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",Od="0 24px 48px -16px rgba(0,0,0,0.18), 0 4px 16px 0 rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",$d=10,Ld=(e,t,n)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,x:e,...t.exit,transition:we},transition:Te}),Dd=(e,t,n)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,x:-e,...t.exit,transition:we},transition:Te}),Fd=(e,t,n)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,y:-e,...t.exit,transition:we},transition:Te}),Hd=(e,t,n)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,y:e,...t.exit,transition:we},transition:Te}),Wd={right:Ld,left:Dd,up:Fd,down:Hd},ee=d.forwardRef(({fadeIn:e="down",distance:t=$d,children:n,snapExit:o=!1,overrides:s={},delay:a=0,...i},c)=>{const u=e?Wd[e](t,s,a):{};return o&&u.exit&&typeof u.exit=="object"&&!Array.isArray(u.exit)&&(u.exit.transition={duration:0}),r.jsx(W.motion.div,{ref:c,...i,...u,children:n})});ee.displayName="MotionDiv";const dr=qs.cva(A("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-[0.97] motion-reduce:active:scale-100","rounded-xl","transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background border",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),V=Qe.forwardRef(({className:e,variant:t="default",size:n,asChild:o=!1,wobble:s=!0,...a},i)=>{const c=o?mc.Slot:"button";return r.jsx(Re,{ref:i,off:!s,children:r.jsx(c,{...P("ui_lib/btn"),"data-variant":t,className:A(dr({variant:t,size:n,className:e})),...a})})});V.displayName="Button";const Oa=d.createContext(null);function Ud({children:e}){const[t,n]=d.useState(!1),[o,s]=d.useState(null),a=c=>{s(c),n(!0)},i=d.useCallback(()=>{n(!1),setTimeout(()=>{s(null)},200)},[]);return r.jsxs(Oa.Provider,{value:{open:a,close:i,isOpen:t,content:o},children:[r.jsx(Bd,{}),e]})}function In(){const e=d.useContext(Oa);return e||(Z.log.error("useDialoger must be used within a DialogerProvider"),{open:()=>{},close:()=>{},isOpen:!1,content:null})}function Bd(){const{contentIframeRef:e}=k.useWidget(),{isOpen:t,content:n,close:o}=In();return d.useEffect(()=>{var i,c;if(!t)return;const s=u=>{u.defaultPrevented||u.key!=="Escape"||(u.preventDefault(),o())},a=(c=(i=e==null?void 0:e.current)==null?void 0:i.contentWindow)==null?void 0:c.document;return a==null||a.addEventListener("keydown",s),()=>a==null?void 0:a.removeEventListener("keydown",s)},[o,e,t]),r.jsx(W.AnimatePresence,{mode:"wait",children:t&&n&&r.jsx(ee,{overrides:{initial:{y:0},exit:{y:0}},className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",tabIndex:-1,onClick:o,children:n},"dialog-content")})}function Jt({children:e,className:t,withClose:n=!1}){const{close:o}=In(),{t:s}=G();return r.jsxs("div",{"data-opencx-escape-scope":!0,className:A("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",t),onClick:a=>a.stopPropagation(),children:[e,n&&r.jsxs(V,{size:"fit",className:"rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",onClick:o,children:[r.jsx(T.X,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:s("dialog_close")})]})]})}const Dr=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2 text-center pt-2",e),...t});Dr.displayName="DialogerHeader";const Fr=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2 text-center",e),...t});Fr.displayName="DialogerBody";const $a=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2",e),...t});$a.displayName="DialogerFooter";const Hr=d.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:A("text-lg font-semibold leading-none tracking-tight",e),...t}));Hr.displayName="DialogerTitle";const Wr=d.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:A("text-sm text-muted-foreground",e),...t}));Wr.displayName="DialogerDescription";function Qt({children:e,trigger:t}){const{open:n}=In();return d.cloneElement(t,{onClick:()=>{var s,a;n(e),(a=(s=t.props).onClick)==null||a.call(s)}})}const Xo=1,Go=5,Ko=.5,qd=2.5;function Vd(e,t,n,o){if(!n||!o||t<=1)return{x:0,y:0};const s=n.getBoundingClientRect(),a=o.offsetWidth,i=o.offsetHeight,c=Math.max(0,(a*t-s.width)/(2*t)),u=Math.max(0,(i*t-s.height)/(2*t));return{x:Math.min(c,Math.max(-c,e.x)),y:Math.min(u,Math.max(-u,e.y))}}function La({src:e,alt:t}){const{t:n}=G(),[o,s]=d.useState(1),[a,i]=d.useState({x:0,y:0}),[c,u]=d.useState(!1),l=d.useRef({x:0,y:0}),m=d.useRef({x:0,y:0}),p=d.useRef(null),h=d.useRef(null),f=d.useRef(!1),b=v=>Math.min(Go,Math.max(Xo,v)),g=d.useCallback(()=>{s(1),i({x:0,y:0})},[]),j=d.useCallback(()=>{s(v=>b(v+Ko))},[]),x=d.useCallback(()=>{s(v=>{const _=b(v-Ko);return _<=1&&i({x:0,y:0}),_})},[]),S=d.useCallback(v=>{v.preventDefault(),f.current=!1,u(!0),l.current={x:v.clientX,y:v.clientY},m.current={...a},v.target.setPointerCapture(v.pointerId)},[a]),w=d.useCallback(v=>{if(!c)return;const _=v.clientX-l.current.x,R=v.clientY-l.current.y;if((Math.abs(_)>3||Math.abs(R)>3)&&(f.current=!0),o<=1)return;const z={x:m.current.x+_/o,y:m.current.y+R/o};i(Vd(z,o,p.current,h.current))},[c,o]),N=d.useCallback(()=>{const v=f.current;u(!1),!v&&s(_=>_>1?(i({x:0,y:0}),1):qd)},[]),C=o>1;return r.jsxs("div",{className:"relative size-full flex items-center justify-center select-none",onClick:v=>v.stopPropagation(),children:[r.jsx("div",{ref:p,className:A("overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",C&&"size-full"),onPointerDown:S,onPointerMove:w,onPointerUp:N,onPointerCancel:N,style:{cursor:c?"grabbing":C?"grab":"zoom-in",touchAction:"none"},children:r.jsx("img",{ref:h,src:e,alt:t,className:"block max-w-full object-contain pointer-events-none",draggable:!1,style:{maxHeight:"100vh",transform:`scale(${o}) translate(${a.x}px, ${a.y}px)`,transformOrigin:"center center"}})}),r.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100",children:[r.jsx(Yn,{onClick:x,label:n("zoom_out"),disabled:o<=Xo,children:r.jsx(T.ZoomOut,{className:"size-3.5"})}),r.jsxs("span",{className:"text-white text-xs font-medium min-w-[3ch] text-center tabular-nums",children:[Math.round(o*100),"%"]}),r.jsx(Yn,{onClick:j,label:n("zoom_in"),disabled:o>=Go,children:r.jsx(T.ZoomIn,{className:"size-3.5"})}),C&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"w-px h-4 bg-white/30 mx-0.5"}),r.jsx(Yn,{onClick:g,label:n("reset_zoom"),children:r.jsx(T.RotateCcw,{className:"size-3.5"})})]})]})]})}function Yn({onClick:e,label:t,children:n,disabled:o}){return r.jsx("button",{onClick:e,"aria-label":t,disabled:o,className:"text-white/80 hover:text-white disabled:text-white/30 disabled:hover:bg-transparent p-1.5 rounded-full hover:bg-white/15 transition-colors",children:n})}function Zo({url:e,name:t,size:n,icon:o,label:s}){return r.jsx(Re,{children:r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:A("block size-fit max-w-[min(100%,16rem)] shrink-0 rounded-2xl border","bg-background/80 transition-colors hover:bg-accent/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:r.jsxs("div",{className:"flex items-center gap-3 p-3 min-w-0",children:[r.jsx("div",{className:A("flex size-10 shrink-0 items-center justify-center rounded-xl","bg-secondary text-muted-foreground"),"aria-hidden":!0,children:o}),r.jsxs("div",{className:"min-w-0 flex-1 flex flex-col gap-0.5 text-left",children:[r.jsx("span",{className:A("text-xs font-medium text-foreground line-clamp-1","break-words [word-break:break-word]"),children:t}),r.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[(n/1024).toFixed(2)," KB · ",s]})]})]})})})}function Da({attachment:e}){const{name:t,size:n,type:o,url:s}=e,a=o.startsWith("image/"),i=o.startsWith("video/"),c=o.startsWith("audio/"),u=o==="application/pdf";if(c)return r.jsx(Re,{children:r.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:r.jsxs("audio",{controls:!0,className:"w-full",children:[r.jsx("source",{src:s,type:o}),"Your browser does not support the audio tag."]})})});if(i)return r.jsx(Re,{children:r.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:r.jsxs("video",{controls:!0,children:[r.jsx("source",{src:s,type:o}),"Your browser does not support the video tag."]})})});if(a)return r.jsx(Qt,{trigger:r.jsx("div",{children:r.jsx(Re,{children:r.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:r.jsx("img",{src:s,className:"object-cover size-16",alt:t})})})}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx(La,{src:s,alt:t})})});if(u)return r.jsx(Zo,{url:s,name:t,size:n,icon:r.jsx(T.FileText,{className:"size-5",strokeWidth:1.75}),label:"PDF"});const l=Pa({type:o,name:t});return l?r.jsx(Zo,{url:s,name:t,size:n,icon:r.jsx(T.FileSpreadsheet,{className:"size-5",strokeWidth:1.75}),label:l.label}):r.jsx(Re,{children:r.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:r.jsxs("div",{className:"flex items-end gap-2 p-2",children:[r.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:A("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:t}),r.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})})})}function Yd({replyTo:e}){const t=k.useBot(),{humanAgent:n}=k.useConfig(),{sender:o}=e,s=o.kind==="user"?"You":o.kind==="ai"?t.name:o.kind==="agent"?(n==null?void 0:n.name)||o.name||"Team":o.name;return r.jsxs("button",{...P("chat/agent_msg/reply_to"),type:"button",onClick:a=>{const i=a.currentTarget.ownerDocument.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);i==null||i.scrollIntoView({behavior:"smooth",block:"center"}),i==null||i.animate([{opacity:.35},{opacity:1}],{duration:900,easing:"ease-out"})},className:A("not-prose mb-2 block w-full min-w-0 text-start","rounded-xl border-s-2 border-primary/50 bg-primary/[0.07] ps-2.5 pe-2 py-1.5","text-xs leading-snug text-muted-foreground","transition-colors hover:bg-primary/10 hover:text-foreground"),children:[s&&r.jsx("span",{className:"block font-medium text-foreground/80",children:s}),r.jsx("span",{className:"line-clamp-2 break-words",children:e.text})]})}const Fa=d.memo(hc,(e,t)=>e.children===t.children&&e.className===t.className);var Ls,Ds,Fs;const Xd={...ve.defaultSchema,attributes:{...ve.defaultSchema.attributes,"*":[...((Ls=ve.defaultSchema.attributes)==null?void 0:Ls["*"])??[],"style"],code:[...((Ds=ve.defaultSchema.attributes)==null?void 0:Ds.code)??[],"className"],pre:[...((Fs=ve.defaultSchema.attributes)==null?void 0:Fs.pre)??[],"className"]}},Gd=/^(color|background-color|font-(family|size|style|weight)|text-(align|decoration|transform)|line-height|letter-spacing|white-space|display|width|height|max-width|min-width|margin(-top|-right|-bottom|-left)?|padding(-top|-right|-bottom|-left)?|border(-width|-style|-color|-radius)?)$/i,Kd=/^[\w\s#.,%()'"+-]+$/,Zd=/\b(url|expression|var|attr)\s*\(/i;function Jd(){return function e(t){var o,s;const n=(o=t.properties)==null?void 0:o.style;typeof n=="string"&&t.properties&&(t.properties.style=n.split(";").filter(a=>{const i=a.indexOf(":");if(i<0)return!1;const c=a.slice(0,i).trim(),u=a.slice(i+1).trim();return Gd.test(c)&&Kd.test(u)&&!Zd.test(u)}).join(";")),(s=t.children)==null||s.forEach(e)}}function Ha(e){return e.replace(/<citations>[\s\S]*?<\/citations>/g,"").replace(/<citations[\s\S]*$/,"").replace(/<(?:ref|cite)\s[^>]*?\/?>/g,"").replace(/<r(?:e(?:f[^>]*)?)?$/,"").replace(/<c(?:i(?:t(?:a(?:t(?:i(?:o(?:n(?:s)?)?)?)?)?)?(?:e[^>]*)?)?)?$/,"").trimEnd()}const Qd=/^[\w-]{11}$/,eu=new Set(["youtube.com","www.youtube.com","m.youtube.com","youtube-nocookie.com","www.youtube-nocookie.com"]);function tu(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:")return null;const n=nu(t);return n&&Qd.test(n)?n:null}function nu(e){const[t,n]=e.pathname.split("/").filter(Boolean);return e.hostname==="youtu.be"?t:eu.has(e.hostname)?t==="watch"?e.searchParams.get("v"):t==="shorts"||t==="embed"?n:null:null}function ru({id:e,title:t}){return r.jsx(Qt,{trigger:r.jsxs("button",{type:"button",className:"not-prose relative block w-full max-w-64 overflow-hidden rounded-xl border",children:[r.jsx("img",{src:`https://i.ytimg.com/vi/${e}/hqdefault.jpg`,alt:t,className:"aspect-video w-full object-cover"}),r.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-black/60 text-white",children:r.jsx(T.Play,{className:"size-5 fill-current"})})})]}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx("iframe",{src:`https://www.youtube-nocookie.com/embed/${e}?autoplay=1`,title:t,allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,className:"aspect-video w-full rounded-2xl"})})})}const ou=new Map([["youtube",/^[\w-]{11}$/],["vimeo",/^\d+(?:\/[\da-f]+)?$/],["loom",/^[\da-f]{32}$/],["wistia",/^[\da-z]{10}$/]]),su=new Map([["youtube","YouTube video"],["vimeo","Vimeo video"],["loom","Loom video"],["wistia","Wistia video"]]);function au(e,t){var o;if(typeof e!="string"||typeof t!="string"||!((o=ou.get(e))!=null&&o.test(t)))return;const n=su.get(e)??"Video";switch(e){case"youtube":return{src:`https://www.youtube-nocookie.com/embed/${t}`,title:n};case"vimeo":{const[s,a]=t.split("/");return{src:`https://player.vimeo.com/video/${s}${a?`?h=${a}`:""}`,title:n}}case"loom":return{src:`https://www.loom.com/embed/${t}`,title:n};case"wistia":return{src:`https://fast.wistia.net/embed/iframe/${t}`,title:n};default:return}}var Hs,Ws;const ur={...ve.defaultSchema,attributes:{...ve.defaultSchema.attributes,code:[...((Hs=ve.defaultSchema.attributes)==null?void 0:Hs.code)??[],"className"],pre:[...((Ws=ve.defaultSchema.attributes)==null?void 0:Ws.pre)??[],"className"]}};var Us,Bs;const iu={...ur,attributes:{...ur.attributes,div:[...((Us=ve.defaultSchema.attributes)==null?void 0:Us.div)??[],"dataEmbed","dataEmbedId"],a:[...((Bs=ve.defaultSchema.attributes)==null?void 0:Bs.a)??[],"dataArticleSlug"]}};function Ur(e){return r.jsx(Br,{...e})}function cu({openArticle:e,...t}){return r.jsx(Br,{...t,articleEmbeds:!0,openArticle:e})}function lu(e){return r.jsx(Br,{...e,configuredStyles:!0})}function Br({children:e,messageType:t,messageId:n,configuredStyles:o=!1,articleEmbeds:s=!1,openArticle:a}){const{anchorTarget:i}=k.useConfig();return r.jsx(Fa,{"data-type":t,"data-id":n,remarkPlugins:[Vs],rehypePlugins:o?[nr,Jd,[ve,Xd]]:[nr,[ve,s?iu:ur]],components:{div:({node:c,...u})=>{const l=s?au(c==null?void 0:c.properties.dataEmbed,c==null?void 0:c.properties.dataEmbedId):void 0;return l?r.jsx("iframe",{src:l.src,title:l.title,loading:"lazy",allow:"encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,className:"not-prose my-4 aspect-video w-full rounded-xl border"}):r.jsx("div",{...u})},a:({node:c,children:u,...l})=>{const{href:m}=l,p=s?c==null?void 0:c.properties.dataArticleSlug:void 0;if(typeof p=="string")return a?r.jsx("a",{href:"#",onClick:f=>{f.preventDefault(),a(p)},children:u}):r.jsx(r.Fragment,{children:u});const h=m?tu(m):null;return m&&h?r.jsx(ru,{id:h,title:typeof u=="string"?u:m}):r.jsx("a",{target:l.target||i||"_top",...l,children:u})},img:({src:c,alt:u,...l})=>c?r.jsx(Qt,{trigger:r.jsx("img",{src:c,alt:u,...l,className:"cursor-pointer rounded-xl"}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx(La,{src:c,alt:u})})}):r.jsx("img",{src:c,alt:u,...l})},children:Ha(e)})}function Fe(){const{widgetCtx:{org:e}}=k.useWidget(),{sessionState:{session:t}}=k.useSessions(),n=k.useConfig(),{messagesState:{messages:o}}=k.useMessages(),{routerState:{screen:s}}=k.useWidgetRouter();return{react:d,org:e,session:t,config:n,messages:o,currentScreen:s}}function du({currentMessage:e}){var o;const t=Fe(),n=(o=t.config.customComponents)==null?void 0:o["message::after"];return n?r.jsx(n,{...t,currentMessage:e}):null}const Wa=d.createContext(null);function uu({children:e}){const{widgetCtx:t,config:n}=k.useWidget(),o=d.useRef({widgetCtx:t,config:n});d.useLayoutEffect(()=>{o.current={widgetCtx:t,config:n}},[t,n]);const s=d.useRef({kind:"main"}),a=d.useMemo(()=>({report:i=>{var b;const{widgetCtx:c,config:u}=o.current,l=(b=u.hooks)==null?void 0:b.onUserActivity;if(!l)return;const{screen:m}=c.routerCtx.state.get(),p=m==="home"?{screen:m,view:s.current}:{screen:m},{session:h}=c.sessionCtx.sessionState.get(),f=h?{...i,session:h,page:p}:{...i,page:p};try{l(f)}catch(g){Z.log.error("onUserActivity hook failed",g)}},setHomeView:i=>{s.current=i}}),[]);return r.jsx(Wa.Provider,{value:a,children:e})}function qr(){return d.useContext(Wa)}function Vr(e){var n;const t=(n=qr())==null?void 0:n.setHomeView;d.useLayoutEffect(()=>{t==null||t(e)},[t,e])}function en(){var n;const{sendMessage:e}=k.useMessages(),t=(n=qr())==null?void 0:n.report;return d.useCallback(o=>e(t?{...o,onSubmitted:s=>{var a;(a=o.onSubmitted)==null||a.call(o,s),t({type:"message-sent",message:s})}}:o),[e,t])}function pu({messageId:e,messageOptions:t}){var u;const{messagesState:n}=k.useMessages(),o=en(),{sessionState:s}=k.useSessions(),{pickedOptionId:a}=t,i=((u=Z.tappableOptionsMessage(n.messages,s.session))==null?void 0:u.id)===e,c=t.options.find(l=>l.id===a);return c?r.jsx("div",{...P("chat/agent_msg/options"),className:"flex",children:r.jsxs(V,{...P("chat/agent_msg/option_btn"),"data-picked":!0,"aria-pressed":!0,size:"sm",variant:"outline",className:"w-fit pl-2 text-sm text-muted-foreground disabled:opacity-100",disabled:!0,children:[r.jsx(T.CheckIcon,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),c.label]})}):i?r.jsx("div",{...P("chat/agent_msg/options"),role:"group",className:"flex flex-row flex-wrap gap-1.5 [@media(pointer:coarse)]:gap-y-3",children:t.options.map(l=>r.jsxs(V,{...P("chat/agent_msg/option_btn"),size:"sm",variant:"outline",className:"relative w-fit text-sm hover:bg-secondary",onClick:()=>o({content:l.label,optionReply:{messageId:e,optionId:l.id}}),children:[r.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 left-1/2 size-[max(100%,3rem)] -translate-x-1/2 -translate-y-1/2 [@media(pointer:fine)]:hidden"}),l.label]},l.id))}):null}const mu=["[--tw-prose-body:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-headings:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-lead:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-bold:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-links:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-code:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-counters:hsl(var(--opencx-muted-foreground))]","[--tw-prose-bullets:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quotes:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quote-borders:hsl(var(--opencx-border))]","[--tw-prose-hr:hsl(var(--opencx-border))]","[--tw-prose-th-borders:hsl(var(--opencx-border))]","[--tw-prose-td-borders:hsl(var(--opencx-border))]","[--tw-prose-pre-bg:hsl(var(--opencx-muted))]","[--tw-prose-pre-code:hsl(var(--opencx-foreground))]"].join(" ");function pr(e){const{data:t,id:n,type:o,attachments:s,isFirstInGroup:a,isLastInGroup:i,isAloneInGroup:c,dataComponentNames:u,classNames:l}=e,m=o==="AI"||o==="AGENT"?t.message:"",p=d.useMemo(()=>o==="AI"?Ra(m):null,[o,m]);if(o!=="AI"&&o!=="AGENT")return null;const{variant:h="default"}=t,f=e.replyTo?r.jsx(Yd,{replyTo:e.replyTo}):null,b=(S,w,N=!0,C=!0)=>r.jsxs("div",{className:"flex flex-row gap-2",children:[r.jsxs("div",{...P((u==null?void 0:u.message)??"chat/agent_msg/msg"),"data-first":a,"data-last":i,"data-alone":c,"data-variant":h,className:A("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline",mu,"break-words [word-break:break-word]",h==="error"&&"bg-destructive/15 text-destructive",a&&!c&&"rounded-bl-md",i&&!c&&"rounded-tl-md",!a&&!i&&!c&&"rounded-l-md",l==null?void 0:l.message),children:[C&&f,r.jsx(Ur,{messageType:o,messageId:n,children:S})]}),N&&r.jsx(du,{currentMessage:e})]},w),g=(p==null?void 0:p.some(S=>S.type==="ui"))??!1,j=(p==null?void 0:p.reduce((S,w,N)=>w.type==="markdown"?N:S,-1))??-1,x=(p==null?void 0:p.findIndex(S=>S.type==="markdown"))??-1;return r.jsxs("div",{...P((u==null?void 0:u.messageContainer)??"chat/agent_msg/root"),"data-message-id":n,className:A("w-5/6 flex flex-col items-start gap-1",l==null?void 0:l.messageContainer),children:[s&&s.length>0&&r.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:s==null?void 0:s.map(S=>r.jsx(Da,{attachment:S},S.id))}),g&&p?p.map((S,w)=>S.type==="markdown"?b(S.content,`md-${w}`,w===j,w===x):r.jsx("div",{className:"w-full",children:r.jsx(za,{spec:S.spec})},`ui-${w}`)):m.length>0&&b(m),e.messageOptions&&r.jsx(pu,{messageId:n,messageOptions:e.messageOptions})]})}function hu(e){return r.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:r.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(e,null,1)})})}const Yr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Root,{ref:n,className:A("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",e),...t}));Yr.displayName=zt.Root.displayName;const Xr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Image,{ref:n,className:A("aspect-square h-full w-full",e),...t}));Xr.displayName=zt.Image.displayName;const Gr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Fallback,{ref:n,className:A("flex size-full text-xs items-center justify-center rounded-lg",e),...t}));Gr.displayName=zt.Fallback.displayName;function mr({agent:e,...t}){var n,o;return r.jsxs(Yr,{...t,children:[r.jsx(Xr,{src:(e==null?void 0:e.avatarUrl)||(e==null?void 0:e.avatar)||"",alt:"Agent Icon"}),(e==null?void 0:e.name)&&r.jsx(Gr,{children:(o=(n=e==null?void 0:e.name)==null?void 0:n.slice(0,1))==null?void 0:o.toUpperCase()})]})}function fu({agent:e}){return r.jsx(W.AnimatePresence,{children:r.jsxs(ee,{...P("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[r.jsx(mr,{agent:e}),r.jsxs("div",{...P("chat/bot_loading/bouncing_dots_container"),className:A("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[r.jsx(W.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),r.jsx(W.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),r.jsx(W.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const gu='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.\\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.opencx-text-shimmer{animation:opencx-text-shimmer 2.5s ease-in-out infinite}.opencx-fade-up{animation:opencx-fade-up .3s cubic-bezier(.23,1,.32,1) both}[data-component="trigger/unread"],[data-component="sessions/unread"],[data-component="home/tab_unread"]{pointer-events:none;border-radius:9999px;background-color:hsl(var(--opencx-destructive));text-align:center;font-weight:600;--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);color:hsl(var(--opencx-destructive-foreground));font-size:11px;line-height:18px;box-shadow:0 0 0 2px hsl(var(--opencx-background))}[data-component="trigger/unread"]{position:absolute;z-index:1}[data-component="sessions/unread"]{flex-shrink:0;box-shadow:none}[data-component="home/tab_unread"]{position:absolute;top:-2px;inset-inline-end:-2px}[data-unread-look=dot]{width:9px;height:9px}[data-unread-look=count]{min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px}.opencx-placeholder-in{animation:opencx-placeholder-in .2s cubic-bezier(.23,1,.32,1) both}.opencx-placeholder-out{animation:opencx-placeholder-out .18s cubic-bezier(.23,1,.32,1) both}@keyframes opencx-text-shimmer{0%,to{opacity:.45}50%{opacity:1}}@keyframes opencx-fade-up{0%{opacity:0;filter:blur(4px);transform:translateY(8px)}to{opacity:1;filter:blur(0px);transform:translateY(0)}}@keyframes opencx-placeholder-in{0%{opacity:0;transform:translateY(4px);filter:blur(1px)}to{opacity:1;transform:translateY(0);filter:blur(0)}}@keyframes opencx-placeholder-out{0%{opacity:1;transform:translateY(0);filter:blur(0)}to{opacity:0;transform:translateY(-8px);filter:blur(1px)}}.opencx-input-recall{animation:opencx-input-recall .15s cubic-bezier(.23,1,.32,1)}@keyframes opencx-input-recall{0%{opacity:.25;translate:0 -3px}to{opacity:1;translate:0 0}}@media(prefers-reduced-motion:reduce){.opencx-text-shimmer,.opencx-fade-up,.opencx-placeholder-in,.opencx-placeholder-out,.opencx-input-recall{animation:none}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-0\\.5{top:.125rem;right:.125rem;bottom:.125rem;left:.125rem}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.end-1{inset-inline-end:.25rem}.end-4{inset-inline-end:1rem}.end-6{inset-inline-end:1.5rem}.left-1\\/2,.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.start-10{inset-inline-start:2.5rem}.start-2{inset-inline-start:.5rem}.start-4{inset-inline-start:1rem}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.col-span-full{grid-column:1 / -1}.m-2{margin:.5rem}.-mx-0\\.5{margin-left:-.125rem;margin-right:-.125rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-0\\.5{margin-top:-.125rem}.-mt-6{margin-top:-1.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.ms-1\\.5{margin-inline-start:.375rem}.ms-\\[30px\\]{margin-inline-start:30px}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-12{margin-top:3rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-0{width:0px;height:0px}.size-1\\.5{width:.375rem;height:.375rem}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-2\\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\\[18px\\]{width:18px;height:18px}.size-\\[max\\(100\\%\\,3rem\\)\\]{width:max(100%,3rem);height:max(100%,3rem)}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-0{height:0px}.h-1{height:.25rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-16{max-height:4rem}.max-h-40{max-height:10rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-\\[160px\\]{max-height:160px}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[50vh\\]{max-height:50vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-12{min-height:3rem}.min-h-8{min-height:2rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-1\\/4{width:25%}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-2\\/3{width:66.666667%}.w-2\\/5{width:40%}.w-3\\/4{width:75%}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-7{width:1.75rem}.w-\\[32px\\]{width:32px}.w-\\[3px\\]{width:3px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.w-svw{width:100svw}.min-w-0{min-width:0px}.min-w-80{min-width:20rem}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[3ch\\]{min-width:3ch}.max-w-40{max-width:10rem}.max-w-48{max-width:12rem}.max-w-64{max-width:16rem}.max-w-96{max-width:24rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-\\[min\\(100\\%\\,16rem\\)\\]{max-width:min(100%,16rem)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.shrink-\\[2\\]{flex-shrink:2}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--radix-popover-content-transform-origin\\)\\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\[var\\(--radix-tooltip-content-transform-origin\\)\\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-center{transform-origin:center}.origin-top{transform-origin:top}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-50{--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[subgrid\\]{grid-template-columns:subgrid}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.gap-\\[3px\\]{gap:3px}.gap-x-2\\.5{column-gap:.625rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-foreground\\/10>:not([hidden])~:not([hidden]){border-color:hsl(var(--opencx-foreground) / .1)}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-pretty{text-wrap:pretty}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[19px\\]{border-radius:19px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[calc\\(var\\(--opencx-inset-radius\\)\\+var\\(--cx-p\\)\\)\\]{border-radius:calc(var(--opencx-inset-radius) + var(--cx-p))}.rounded-\\[calc\\(var\\(--pk-r\\)-var\\(--pk-p\\)\\)\\]{border-radius:calc(var(--pk-r) - var(--pk-p))}.rounded-\\[var\\(--opencx-inset-radius\\)\\]{border-radius:var(--opencx-inset-radius)}.rounded-\\[var\\(--pk-r\\)\\]{border-radius:var(--pk-r)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-\\[1\\.5px\\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-s{border-inline-start-width:1px}.border-s-2{border-inline-start-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-border{border-color:hsl(var(--opencx-border))}.border-destructive\\/30{border-color:hsl(var(--opencx-destructive) / .3)}.border-foreground\\/10{border-color:hsl(var(--opencx-foreground) / .1)}.border-foreground\\/15{border-color:hsl(var(--opencx-foreground) / .15)}.border-muted-foreground\\/10{border-color:hsl(var(--opencx-muted-foreground) / .1)}.border-muted-foreground\\/15{border-color:hsl(var(--opencx-muted-foreground) / .15)}.border-muted-foreground\\/20{border-color:hsl(var(--opencx-muted-foreground) / .2)}.border-muted-foreground\\/30{border-color:hsl(var(--opencx-muted-foreground) / .3)}.border-primary{border-color:hsl(var(--opencx-primary))}.border-primary\\/10{border-color:hsl(var(--opencx-primary) / .1)}.border-primary\\/50{border-color:hsl(var(--opencx-primary) / .5)}.border-l-amber-500{--tw-border-opacity: 1;border-left-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-l-emerald-500{--tw-border-opacity: 1;border-left-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-t-current{border-top-color:currentColor}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\\/15{background-color:#f59e0b26}.bg-amber-500\\/5{background-color:#f59e0b0d}.bg-background{background-color:hsl(var(--opencx-background))}.bg-background\\/80{background-color:hsl(var(--opencx-background) / .8)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\\/5{background-color:#3b82f60d}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-destructive\\/10{background-color:hsl(var(--opencx-destructive) / .1)}.bg-destructive\\/15{background-color:hsl(var(--opencx-destructive) / .15)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\\/10{background-color:#10b9811a}.bg-emerald-500\\/15{background-color:#10b98126}.bg-emerald-500\\/5{background-color:#10b9810d}.bg-foreground\\/5{background-color:hsl(var(--opencx-foreground) / .05)}.bg-foreground\\/50{background-color:hsl(var(--opencx-foreground) / .5)}.bg-foreground\\/60{background-color:hsl(var(--opencx-foreground) / .6)}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-muted-foreground{background-color:hsl(var(--opencx-muted-foreground))}.bg-muted-foreground\\/10{background-color:hsl(var(--opencx-muted-foreground) / .1)}.bg-muted-foreground\\/30{background-color:hsl(var(--opencx-muted-foreground) / .3)}.bg-muted-foreground\\/40{background-color:hsl(var(--opencx-muted-foreground) / .4)}.bg-muted\\/30{background-color:hsl(var(--opencx-muted) / .3)}.bg-muted\\/40{background-color:hsl(var(--opencx-muted) / .4)}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-primary-foreground\\/20{background-color:hsl(var(--opencx-primary-foreground) / .2)}.bg-primary\\/10{background-color:hsl(var(--opencx-primary) / .1)}.bg-primary\\/25{background-color:hsl(var(--opencx-primary) / .25)}.bg-primary\\/\\[0\\.07\\]{background-color:hsl(var(--opencx-primary) / .07)}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\\/5{background-color:#ef44440d}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-secondary-foreground\\/10{background-color:hsl(var(--opencx-secondary-foreground) / .1)}.bg-secondary-foreground\\/20{background-color:hsl(var(--opencx-secondary-foreground) / .2)}.bg-transparent{background-color:transparent}.bg-white\\/30{background-color:#ffffff4d}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-foreground\\/70{--tw-gradient-from: hsl(var(--opencx-foreground) / .7) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--opencx-foreground) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-foreground\\/0{--tw-gradient-to: hsl(var(--opencx-foreground) / 0) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-foreground{fill:hsl(var(--opencx-foreground))}.stroke-current{stroke:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-left-top{object-position:left top}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[var\\(--cx-p\\)\\]{padding:var(--cx-p)}.p-\\[var\\(--pk-p\\)\\]{padding:var(--pk-p)}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\\[3px\\]{padding-top:3px;padding-bottom:3px}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-14{padding-bottom:3.5rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pe-1{padding-inline-end:.25rem}.pe-2{padding-inline-end:.5rem}.pe-2\\.5{padding-inline-end:.625rem}.pe-4{padding-inline-end:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pr-16{padding-right:4rem}.ps-1{padding-inline-start:.25rem}.ps-1\\.5{padding-inline-start:.375rem}.ps-10{padding-inline-start:2.5rem}.ps-2{padding-inline-start:.5rem}.ps-2\\.5{padding-inline-start:.625rem}.ps-3{padding-inline-start:.75rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-2\\.5{padding-top:.625rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[0\\.8125rem\\]{font-size:.8125rem}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-background{color:hsl(var(--opencx-background))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-foreground\\/50{color:hsl(var(--opencx-foreground) / .5)}.text-foreground\\/60{color:hsl(var(--opencx-foreground) / .6)}.text-foreground\\/80{color:hsl(var(--opencx-foreground) / .8)}.text-foreground\\/90{color:hsl(var(--opencx-foreground) / .9)}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/40{color:hsl(var(--opencx-muted-foreground) / .4)}.text-muted-foreground\\/50{color:hsl(var(--opencx-muted-foreground) / .5)}.text-muted-foreground\\/60{color:hsl(var(--opencx-muted-foreground) / .6)}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-primary-foreground\\/60{color:hsl(var(--opencx-primary-foreground) / .6)}.text-primary\\/10{color:hsl(var(--opencx-primary) / .1)}.text-primary\\/40{color:hsl(var(--opencx-primary) / .4)}.text-primary\\/50{color:hsl(var(--opencx-primary) / .5)}.text-primary\\/60{color:hsl(var(--opencx-primary) / .6)}.text-primary\\/70{color:hsl(var(--opencx-primary) / .7)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.text-secondary-foreground\\/60{color:hsl(var(--opencx-secondary-foreground) / .6)}.text-secondary-foreground\\/70{color:hsl(var(--opencx-secondary-foreground) / .7)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.caret-foreground{caret-color:hsl(var(--opencx-foreground))}.accent-current{accent-color:currentColor}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-border{--tw-ring-color: hsl(var(--opencx-border))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[background-color\\,color\\,transform\\]{transition-property:background-color,color,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[height\\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[width\\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-opencx{transition-timing-function:cubic-bezier(.23,1,.32,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-opencx{animation-timing-function:cubic-bezier(.23,1,.32,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.paused{animation-play-state:paused}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-foreground))}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-bold\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-bold: hsl(var(--opencx-foreground))}.\\[--tw-prose-bold\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-bold: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-bullets\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-bullets: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-code\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-code: hsl(var(--opencx-foreground))}.\\[--tw-prose-code\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-code: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-counters\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-counters: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-headings\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-headings: hsl(var(--opencx-foreground))}.\\[--tw-prose-headings\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-headings: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-hr\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-hr: hsl(var(--opencx-border))}.\\[--tw-prose-lead\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-lead: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-links\\:hsl\\(var\\(--opencx-primary\\)\\)\\]{--tw-prose-links: hsl(var(--opencx-primary))}.\\[--tw-prose-links\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-links: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-pre-bg\\:hsl\\(var\\(--opencx-muted\\)\\)\\]{--tw-prose-pre-bg: hsl(var(--opencx-muted))}.\\[--tw-prose-pre-code\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-pre-code: hsl(var(--opencx-foreground))}.\\[--tw-prose-quote-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-quote-borders: hsl(var(--opencx-border))}.\\[--tw-prose-quotes\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-quotes: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-td-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-td-borders: hsl(var(--opencx-border))}.\\[--tw-prose-th-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-th-borders: hsl(var(--opencx-border))}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.\\[word-break\\:break-word\\]{word-break:break-word}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.last\\:border-0:last-child{border-width:0px}.focus-within\\:opacity-100:focus-within{opacity:1}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:bg-accent\\/60:hover{background-color:hsl(var(--opencx-accent) / .6)}.hover\\:bg-foreground:hover{background-color:hsl(var(--opencx-foreground))}.hover\\:bg-muted:hover{background-color:hsl(var(--opencx-muted))}.hover\\:bg-muted\\/50:hover{background-color:hsl(var(--opencx-muted) / .5)}.hover\\:bg-muted\\/60:hover{background-color:hsl(var(--opencx-muted) / .6)}.hover\\:bg-primary\\/10:hover{background-color:hsl(var(--opencx-primary) / .1)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--opencx-primary) / .9)}.hover\\:bg-primary\\/\\[0\\.02\\]:hover{background-color:hsl(var(--opencx-primary) / .02)}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--opencx-secondary) / .8)}.hover\\:bg-transparent:hover{background-color:transparent}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-foreground:hover{color:hsl(var(--opencx-foreground))}.hover\\:text-muted-foreground:hover{color:hsl(var(--opencx-muted-foreground))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:text-primary-foreground:hover{color:hsl(var(--opencx-primary-foreground))}.hover\\:text-secondary-foreground:hover{color:hsl(var(--opencx-secondary-foreground))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:opacity-80:hover{opacity:.8}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-ring:focus-visible{outline-color:hsl(var(--opencx-ring))}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset: inset}.focus-visible\\:ring-primary\\/40:focus-visible{--tw-ring-color: hsl(var(--opencx-primary) / .4)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-\\[0\\.97\\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-white\\/30:disabled{color:#ffffff4d}.disabled\\:opacity-100:disabled{opacity:1}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\\:opacity-100{opacity:1}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:hsl(var(--opencx-muted))}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.prose-headings\\:my-1\\.5 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.375rem;margin-bottom:.375rem}.prose-headings\\:text-\\[13px\\] :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:13px}.prose-p\\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.prose-pre\\:my-1\\.5 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.375rem;margin-bottom:.375rem}.prose-pre\\:p-2 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){padding:.5rem}.prose-pre\\:text-\\[11px\\] :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:11px}.prose-ol\\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\\:my-0\\.5 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.125rem;margin-bottom:.125rem}.prose-table\\:block :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){display:block}.prose-table\\:overflow-x-auto :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){overflow-x:auto}.prose-table\\:\\[overflow-wrap\\:normal\\] :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){overflow-wrap:normal}.prose-table\\:\\[word-break\\:normal\\] :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){word-break:normal}.prose-img\\:rounded-xl :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.75rem}.prose-hr\\:my-2 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}@media(prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:active\\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media(min-width:640px){.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(prefers-color-scheme:dark){.dark\\:text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\\:text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.dark\\:text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}}.\\[\\&\\>\\*\\:first-child\\]\\:mt-0>*:first-child{margin-top:0}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>*:last-child{margin-bottom:0}.\\[\\&_\\.animate-spin\\]\\:animate-none .animate-spin{animation:none}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}@media(hover:none){.\\[\\@media\\(hover\\:none\\)\\]\\:opacity-100{opacity:1}}@media(pointer:coarse){.\\[\\@media\\(pointer\\:coarse\\)\\]\\:min-h-12{min-height:3rem}.\\[\\@media\\(pointer\\:coarse\\)\\]\\:gap-y-3{row-gap:.75rem}}@media(pointer:fine){.\\[\\@media\\(pointer\\:fine\\)\\]\\:hidden{display:none}}',xu="5.10.0";function bu(e,t){const n=typeof(e==null?void 0:e.right)=="number",o=typeof(e==null?void 0:e.left)=="number";return n&&!o?"right":o&&!n||t==="rtl"?"left":"right"}const Jo=450;function ye(){const[e,t]=d.useState(()=>(window.top||window).innerWidth<Jo);return d.useEffect(()=>{const n=window.top||window,o=()=>{t(n.innerWidth<Jo)};return o(),n.addEventListener("resize",o),()=>{n.removeEventListener("resize",o)}},[]),{isSmallScreen:e}}const pn={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function de(){var h,f,b,g,j,x,S,w,N,C,v,_,R,z,M,D,O,U,E,I,H,L,q,X,B,F,J,re,$,te,K,oe,he,le,se,ne,Ie,ie,ue,gt,tt,ze,He,nt,We,Oe,Ue,Be;const{dir:e}=k.useDocumentDir(),{isSmallScreen:t}=ye(),{theme:n,inline:o}=k.useConfig(),s=ge=>o?"100%":ge,a=(ge,Me)=>t?`100dv${ge}`:Me,i=(ge,Me)=>s(a(ge,Me)),c=bu((h=n==null?void 0:n.widgetTrigger)==null?void 0:h.offset,e),u={zIndex:((f=n==null?void 0:n.widgetTrigger)==null?void 0:f.zIndex)??1e7,offset:{bottom:((g=(b=n==null?void 0:n.widgetTrigger)==null?void 0:b.offset)==null?void 0:g.bottom)??20,right:((x=(j=n==null?void 0:n.widgetTrigger)==null?void 0:j.offset)==null?void 0:x.right)??(c==="right"?20:"initial"),left:((w=(S=n==null?void 0:n.widgetTrigger)==null?void 0:S.offset)==null?void 0:w.left)??(c==="left"?20:"initial")},size:{button:((C=(N=n==null?void 0:n.widgetTrigger)==null?void 0:N.size)==null?void 0:C.button)??48,icon:((_=(v=n==null?void 0:n.widgetTrigger)==null?void 0:v.size)==null?void 0:_.icon)??24}},l=(()=>{const ge=c==="right"?u.offset.right:u.offset.left;return typeof ge!="number"?0:ge})(),m={palette:(n==null?void 0:n.palette)??"neutral",primaryColor:(n==null?void 0:n.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:u,widgetContentContainer:{borderRadius:t?"0px":((R=n==null?void 0:n.widgetContentContainer)==null?void 0:R.borderRadius)??"32px",zIndex:((z=n==null?void 0:n.widgetContentContainer)==null?void 0:z.zIndex)??u.zIndex+1,outline:((M=n==null?void 0:n.widgetContentContainer)==null?void 0:M.outline)??"none",outlineColor:((D=n==null?void 0:n.widgetContentContainer)==null?void 0:D.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((O=n==null?void 0:n.widgetContentContainer)==null?void 0:O.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((U=n==null?void 0:n.widgetContentContainer)==null?void 0:U.transitionProperty)??"all",transitionTimingFunction:((E=n==null?void 0:n.widgetContentContainer)==null?void 0:E.transitionTimingFunction)??pn.transitionTimingFunction,transitionDuration:((I=n==null?void 0:n.widgetContentContainer)==null?void 0:I.transitionDuration)??pn.transitionDuration,offset:{side:t?0:u.offset.bottom+u.size.button+Et.y*2+(((L=(H=n==null?void 0:n.widgetContentContainer)==null?void 0:H.offset)==null?void 0:L.side)??10),align:t?0:l+(((X=(q=n==null?void 0:n.widgetContentContainer)==null?void 0:q.offset)==null?void 0:X.align)??0)}},screens:{welcome:{width:i("w",((F=(B=n==null?void 0:n.screens)==null?void 0:B.welcome)==null?void 0:F.width)??"400px"),minHeight:i("h",((re=(J=n==null?void 0:n.screens)==null?void 0:J.welcome)==null?void 0:re.minHeight)??"1px")},sessions:{width:i("w",((te=($=n==null?void 0:n.screens)==null?void 0:$.sessions)==null?void 0:te.width)??"450px"),height:i("h",((oe=(K=n==null?void 0:n.screens)==null?void 0:K.sessions)==null?void 0:oe.height)??"600px")},chat:{width:i("w",((le=(he=n==null?void 0:n.screens)==null?void 0:he.chat)==null?void 0:le.width)??"525px"),height:i("h",((ne=(se=n==null?void 0:n.screens)==null?void 0:se.chat)==null?void 0:ne.height)??"700px"),withCanvas:{width:i("w",((ue=(ie=(Ie=n==null?void 0:n.screens)==null?void 0:Ie.chat)==null?void 0:ie.withCanvas)==null?void 0:ue.width)??"min(1050px, 100vw)"),height:i("h",((ze=(tt=(gt=n==null?void 0:n.screens)==null?void 0:gt.chat)==null?void 0:tt.withCanvas)==null?void 0:ze.height)??"min(800px, 100vh)"),transitionTimingFunction:((We=(nt=(He=n==null?void 0:n.screens)==null?void 0:He.chat)==null?void 0:nt.withCanvas)==null?void 0:We.transitionTimingFunction)??pn.transitionTimingFunction,transitionDuration:((Be=(Ue=(Oe=n==null?void 0:n.screens)==null?void 0:Oe.chat)==null?void 0:Ue.withCanvas)==null?void 0:Be.transitionDuration)??pn.transitionDuration}}}},p={maxHeight:i("h",`calc(
|
|
14
|
+
`),{root:"",elements:{}})}catch{}p&&Cd(p)?(u(),n.push({type:"ui",spec:p})):o.push(...s),a=[],s=[]}function m(){c&&(l(),c=!1)}for(let p=0;p<t.length;p+=1){const h=t[p]??"",f=h.trim(),b=p===t.length-1;if(!i&&f==="```spec"){m(),i=!0,s=[h];continue}if(i&&f==="```"){s.push(h),l(),i=!1;continue}if(i){s.push(h),f!==""&&or(h)&&a.push(h);continue}if(f!==""&&or(h)){c=!0,s.push(h),a.push(h);continue}if(c){if(f===""||b&&Nd(f)){s.push(h);continue}m()}o.push(h)}return l(),u(),n}function Cd(e){return sa(e)&&e.elements[e.root]!==void 0}const Sd='{"op":';function Nd(e){return!e.startsWith("{")||e.endsWith("}")?!1:/"op"\s*:/.test(e)?!0:Sd.startsWith(e.replace(/\s+/g,""))}function _d(e){return Vl(e)}function P(e){return{"data-component":e}}const lr=[{kind:"csv",label:"CSV",mimes:["text/csv","application/csv"],extensions:["csv"]},{kind:"excel",label:"Excel",mimes:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],extensions:["xls","xlsx"]}],Ed=Object.fromEntries(lr.flatMap(e=>e.mimes.map(t=>[t,e.extensions.map(n=>`.${n}`)]))),Td={"video/mp4":[".mp4"],"video/webm":[".webm"],"video/quicktime":[".mov"],"video/x-m4v":[".m4v"],"video/x-matroska":[".mkv"],"video/3gpp":[".3gp"]};function Pa({type:e,name:t}){var s,a;const n=((s=t.split(".").pop())==null?void 0:s.toLowerCase())??"",o=((a=e.toLowerCase().split(";")[0])==null?void 0:a.trim())??"";return lr.find(i=>n&&i.extensions.includes(n))??lr.find(i=>o&&i.mimes.includes(o))??null}function An(){const[e]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches);return e}const Et={x:2,y:2},Re=d.memo(d.forwardRef(({children:e,className:t,scale:n=1.02,off:o=!1},s)=>{const[a,i]=d.useState(!1),[c,u]=d.useState({x:0,y:0}),l=An(),m=W.useReducedMotion();if(o||!l||m)return d.cloneElement(e,{ref:s??e.props.ref});if(/translate/.test(e.props.className||""))return e;const h=j=>{var M,D;const{clientX:x,clientY:S}=j,w=j.currentTarget.getBoundingClientRect(),N=x-(w.left+w.width/2),C=S-(w.top+w.height/2),v=Math.max(-1,Math.min(1,N/(w.width/2))),_=Math.max(-1,Math.min(1,C/(w.height/2))),R=v*Et.x,z=_*Et.y;u({x:R,y:z}),(D=(M=e.props).onMouseMove)==null||D.call(M,j)},f=j=>{var x,S;i(!0),(S=(x=e.props).onMouseEnter)==null||S.call(x,j)},b=j=>{var x,S;i(!1),u({x:0,y:0}),(S=(x=e.props).onMouseLeave)==null||S.call(x,j)},g={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(n-1)};return d.cloneElement(e,{ref:s,onMouseMove:h,onMouseEnter:f,onMouseLeave:b,style:{...g,...e.props.style},className:A("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",t,e.props.className,"transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]")})}));Re.displayName="Wobble";const et=[.23,1,.32,1],Ad=`cubic-bezier(${et.join(", ")})`,Te={duration:.2,ease:et},we={duration:.15,ease:et},Tt={type:"spring",stiffness:500,damping:45,mass:1},Id=[.32,.72,.24,1],zd=`cubic-bezier(${Id.join(", ")})`,Md="0 2px 12px 0 rgba(0,0,0,0.18), 0 1px 4px 0 rgba(0,0,0,0), 0 0 0 1px rgba(255,255,255,0.08), inset 0 1px 0 0 rgba(255,255,255,0)",Rd="0 8px 28px 0 rgba(0,0,0,0.10), 0 1px 4px 0 rgba(0,0,0,0), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",Pd="0 12px 40px 0 rgba(0,0,0,0.12), 0 2px 8px 0 rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",Od="0 24px 48px -16px rgba(0,0,0,0.18), 0 4px 16px 0 rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.05), inset 0 1px 0 0 rgba(255,255,255,0.5)",$d=10,Ld=(e,t,n)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,x:e,...t.exit,transition:we},transition:Te}),Dd=(e,t,n)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,x:-e,...t.exit,transition:we},transition:Te}),Fd=(e,t,n)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,y:-e,...t.exit,transition:we},transition:Te}),Hd=(e,t,n)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate,transition:{...Te,delay:n}},exit:{opacity:0,y:e,...t.exit,transition:we},transition:Te}),Wd={right:Ld,left:Dd,up:Fd,down:Hd},ee=d.forwardRef(({fadeIn:e="down",distance:t=$d,children:n,snapExit:o=!1,overrides:s={},delay:a=0,...i},c)=>{const u=e?Wd[e](t,s,a):{};return o&&u.exit&&typeof u.exit=="object"&&!Array.isArray(u.exit)&&(u.exit.transition={duration:0}),r.jsx(W.motion.div,{ref:c,...i,...u,children:n})});ee.displayName="MotionDiv";const dr=qs.cva(A("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-[0.97] motion-reduce:active:scale-100","rounded-xl","transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background border",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),V=Qe.forwardRef(({className:e,variant:t="default",size:n,asChild:o=!1,wobble:s=!0,...a},i)=>{const c=o?mc.Slot:"button";return r.jsx(Re,{ref:i,off:!s,children:r.jsx(c,{...P("ui_lib/btn"),"data-variant":t,className:A(dr({variant:t,size:n,className:e})),...a})})});V.displayName="Button";const Oa=d.createContext(null);function Ud({children:e}){const[t,n]=d.useState(!1),[o,s]=d.useState(null),a=c=>{s(c),n(!0)},i=d.useCallback(()=>{n(!1),setTimeout(()=>{s(null)},200)},[]);return r.jsxs(Oa.Provider,{value:{open:a,close:i,isOpen:t,content:o},children:[r.jsx(Bd,{}),e]})}function In(){const e=d.useContext(Oa);return e||(Z.log.error("useDialoger must be used within a DialogerProvider"),{open:()=>{},close:()=>{},isOpen:!1,content:null})}function Bd(){const{contentIframeRef:e}=k.useWidget(),{isOpen:t,content:n,close:o}=In();return d.useEffect(()=>{var i,c;if(!t)return;const s=u=>{u.defaultPrevented||u.key!=="Escape"||(u.preventDefault(),o())},a=(c=(i=e==null?void 0:e.current)==null?void 0:i.contentWindow)==null?void 0:c.document;return a==null||a.addEventListener("keydown",s),()=>a==null?void 0:a.removeEventListener("keydown",s)},[o,e,t]),r.jsx(W.AnimatePresence,{mode:"wait",children:t&&n&&r.jsx(ee,{overrides:{initial:{y:0},exit:{y:0}},className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",tabIndex:-1,onClick:o,children:n},"dialog-content")})}function Jt({children:e,className:t,withClose:n=!1}){const{close:o}=In(),{t:s}=G();return r.jsxs("div",{"data-opencx-escape-scope":!0,className:A("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",t),onClick:a=>a.stopPropagation(),children:[e,n&&r.jsxs(V,{size:"fit",className:"rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",onClick:o,children:[r.jsx(T.X,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:s("dialog_close")})]})]})}const Dr=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2 text-center pt-2",e),...t});Dr.displayName="DialogerHeader";const Fr=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2 text-center",e),...t});Fr.displayName="DialogerBody";const $a=({className:e,...t})=>r.jsx("div",{className:A("flex flex-col gap-2",e),...t});$a.displayName="DialogerFooter";const Hr=d.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:A("text-lg font-semibold leading-none tracking-tight",e),...t}));Hr.displayName="DialogerTitle";const Wr=d.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:A("text-sm text-muted-foreground",e),...t}));Wr.displayName="DialogerDescription";function Qt({children:e,trigger:t}){const{open:n}=In();return d.cloneElement(t,{onClick:()=>{var s,a;n(e),(a=(s=t.props).onClick)==null||a.call(s)}})}const Xo=1,Go=5,Ko=.5,qd=2.5;function Vd(e,t,n,o){if(!n||!o||t<=1)return{x:0,y:0};const s=n.getBoundingClientRect(),a=o.offsetWidth,i=o.offsetHeight,c=Math.max(0,(a*t-s.width)/(2*t)),u=Math.max(0,(i*t-s.height)/(2*t));return{x:Math.min(c,Math.max(-c,e.x)),y:Math.min(u,Math.max(-u,e.y))}}function La({src:e,alt:t}){const{t:n}=G(),[o,s]=d.useState(1),[a,i]=d.useState({x:0,y:0}),[c,u]=d.useState(!1),l=d.useRef({x:0,y:0}),m=d.useRef({x:0,y:0}),p=d.useRef(null),h=d.useRef(null),f=d.useRef(!1),b=v=>Math.min(Go,Math.max(Xo,v)),g=d.useCallback(()=>{s(1),i({x:0,y:0})},[]),j=d.useCallback(()=>{s(v=>b(v+Ko))},[]),x=d.useCallback(()=>{s(v=>{const _=b(v-Ko);return _<=1&&i({x:0,y:0}),_})},[]),S=d.useCallback(v=>{v.preventDefault(),f.current=!1,u(!0),l.current={x:v.clientX,y:v.clientY},m.current={...a},v.target.setPointerCapture(v.pointerId)},[a]),w=d.useCallback(v=>{if(!c)return;const _=v.clientX-l.current.x,R=v.clientY-l.current.y;if((Math.abs(_)>3||Math.abs(R)>3)&&(f.current=!0),o<=1)return;const z={x:m.current.x+_/o,y:m.current.y+R/o};i(Vd(z,o,p.current,h.current))},[c,o]),N=d.useCallback(()=>{const v=f.current;u(!1),!v&&s(_=>_>1?(i({x:0,y:0}),1):qd)},[]),C=o>1;return r.jsxs("div",{className:"relative size-full flex items-center justify-center select-none",onClick:v=>v.stopPropagation(),children:[r.jsx("div",{ref:p,className:A("overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",C&&"size-full"),onPointerDown:S,onPointerMove:w,onPointerUp:N,onPointerCancel:N,style:{cursor:c?"grabbing":C?"grab":"zoom-in",touchAction:"none"},children:r.jsx("img",{ref:h,src:e,alt:t,className:"block max-w-full object-contain pointer-events-none",draggable:!1,style:{maxHeight:"100vh",transform:`scale(${o}) translate(${a.x}px, ${a.y}px)`,transformOrigin:"center center"}})}),r.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100",children:[r.jsx(Yn,{onClick:x,label:n("zoom_out"),disabled:o<=Xo,children:r.jsx(T.ZoomOut,{className:"size-3.5"})}),r.jsxs("span",{className:"text-white text-xs font-medium min-w-[3ch] text-center tabular-nums",children:[Math.round(o*100),"%"]}),r.jsx(Yn,{onClick:j,label:n("zoom_in"),disabled:o>=Go,children:r.jsx(T.ZoomIn,{className:"size-3.5"})}),C&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"w-px h-4 bg-white/30 mx-0.5"}),r.jsx(Yn,{onClick:g,label:n("reset_zoom"),children:r.jsx(T.RotateCcw,{className:"size-3.5"})})]})]})]})}function Yn({onClick:e,label:t,children:n,disabled:o}){return r.jsx("button",{onClick:e,"aria-label":t,disabled:o,className:"text-white/80 hover:text-white disabled:text-white/30 disabled:hover:bg-transparent p-1.5 rounded-full hover:bg-white/15 transition-colors",children:n})}function Zo({url:e,name:t,size:n,icon:o,label:s}){return r.jsx(Re,{children:r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:A("block size-fit max-w-[min(100%,16rem)] shrink-0 rounded-2xl border","bg-background/80 transition-colors hover:bg-accent/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:r.jsxs("div",{className:"flex items-center gap-3 p-3 min-w-0",children:[r.jsx("div",{className:A("flex size-10 shrink-0 items-center justify-center rounded-xl","bg-secondary text-muted-foreground"),"aria-hidden":!0,children:o}),r.jsxs("div",{className:"min-w-0 flex-1 flex flex-col gap-0.5 text-left",children:[r.jsx("span",{className:A("text-xs font-medium text-foreground line-clamp-1","break-words [word-break:break-word]"),children:t}),r.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[(n/1024).toFixed(2)," KB · ",s]})]})]})})})}function Da({attachment:e}){const{name:t,size:n,type:o,url:s}=e,a=o.startsWith("image/"),i=o.startsWith("video/"),c=o.startsWith("audio/"),u=o==="application/pdf";if(c)return r.jsx(Re,{children:r.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:r.jsxs("audio",{controls:!0,className:"w-full",children:[r.jsx("source",{src:s,type:o}),"Your browser does not support the audio tag."]})})});if(i)return r.jsx(Re,{children:r.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:r.jsxs("video",{controls:!0,children:[r.jsx("source",{src:s,type:o}),"Your browser does not support the video tag."]})})});if(a)return r.jsx(Qt,{trigger:r.jsx("div",{children:r.jsx(Re,{children:r.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:r.jsx("img",{src:s,className:"object-cover size-16",alt:t})})})}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx(La,{src:s,alt:t})})});if(u)return r.jsx(Zo,{url:s,name:t,size:n,icon:r.jsx(T.FileText,{className:"size-5",strokeWidth:1.75}),label:"PDF"});const l=Pa({type:o,name:t});return l?r.jsx(Zo,{url:s,name:t,size:n,icon:r.jsx(T.FileSpreadsheet,{className:"size-5",strokeWidth:1.75}),label:l.label}):r.jsx(Re,{children:r.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:r.jsxs("div",{className:"flex items-end gap-2 p-2",children:[r.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:A("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:t}),r.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})})})}function Yd({replyTo:e}){const t=k.useBot(),{humanAgent:n}=k.useConfig(),{sender:o}=e,s=o.kind==="user"?"You":o.kind==="ai"?t.name:o.kind==="agent"?(n==null?void 0:n.name)||o.name||"Team":o.name;return r.jsxs("button",{...P("chat/agent_msg/reply_to"),type:"button",onClick:a=>{const i=a.currentTarget.ownerDocument.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);i==null||i.scrollIntoView({behavior:"smooth",block:"center"}),i==null||i.animate([{opacity:.35},{opacity:1}],{duration:900,easing:"ease-out"})},className:A("not-prose mb-2 block w-full min-w-0 text-start","rounded-xl border-s-2 border-primary/50 bg-primary/[0.07] ps-2.5 pe-2 py-1.5","text-xs leading-snug text-muted-foreground","transition-colors hover:bg-primary/10 hover:text-foreground"),children:[s&&r.jsx("span",{className:"block font-medium text-foreground/80",children:s}),r.jsx("span",{className:"line-clamp-2 break-words",children:e.text})]})}const Fa=d.memo(hc,(e,t)=>e.children===t.children&&e.className===t.className);var Ls,Ds,Fs;const Xd={...ve.defaultSchema,attributes:{...ve.defaultSchema.attributes,"*":[...((Ls=ve.defaultSchema.attributes)==null?void 0:Ls["*"])??[],"style"],code:[...((Ds=ve.defaultSchema.attributes)==null?void 0:Ds.code)??[],"className"],pre:[...((Fs=ve.defaultSchema.attributes)==null?void 0:Fs.pre)??[],"className"]}},Gd=/^(color|background-color|font-(family|size|style|weight)|text-(align|decoration|transform)|line-height|letter-spacing|white-space|display|width|height|max-width|min-width|margin(-top|-right|-bottom|-left)?|padding(-top|-right|-bottom|-left)?|border(-width|-style|-color|-radius)?)$/i,Kd=/^[\w\s#.,%()'"+-]+$/,Zd=/\b(url|expression|var|attr)\s*\(/i;function Jd(){return function e(t){var o,s;const n=(o=t.properties)==null?void 0:o.style;typeof n=="string"&&t.properties&&(t.properties.style=n.split(";").filter(a=>{const i=a.indexOf(":");if(i<0)return!1;const c=a.slice(0,i).trim(),u=a.slice(i+1).trim();return Gd.test(c)&&Kd.test(u)&&!Zd.test(u)}).join(";")),(s=t.children)==null||s.forEach(e)}}function Ha(e){return e.replace(/<citations>[\s\S]*?<\/citations>/g,"").replace(/<citations[\s\S]*$/,"").replace(/<(?:ref|cite)\s[^>]*?\/?>/g,"").replace(/<r(?:e(?:f[^>]*)?)?$/,"").replace(/<c(?:i(?:t(?:a(?:t(?:i(?:o(?:n(?:s)?)?)?)?)?)?(?:e[^>]*)?)?)?$/,"").trimEnd()}const Qd=/^[\w-]{11}$/,eu=new Set(["youtube.com","www.youtube.com","m.youtube.com","youtube-nocookie.com","www.youtube-nocookie.com"]);function tu(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:")return null;const n=nu(t);return n&&Qd.test(n)?n:null}function nu(e){const[t,n]=e.pathname.split("/").filter(Boolean);return e.hostname==="youtu.be"?t:eu.has(e.hostname)?t==="watch"?e.searchParams.get("v"):t==="shorts"||t==="embed"?n:null:null}function ru({id:e,title:t}){return r.jsx(Qt,{trigger:r.jsxs("button",{type:"button",className:"not-prose relative block w-full max-w-64 overflow-hidden rounded-xl border",children:[r.jsx("img",{src:`https://i.ytimg.com/vi/${e}/hqdefault.jpg`,alt:t,className:"aspect-video w-full object-cover"}),r.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-black/60 text-white",children:r.jsx(T.Play,{className:"size-5 fill-current"})})})]}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx("iframe",{src:`https://www.youtube-nocookie.com/embed/${e}?autoplay=1`,title:t,allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,className:"aspect-video w-full rounded-2xl"})})})}const ou=new Map([["youtube",/^[\w-]{11}$/],["vimeo",/^\d+(?:\/[\da-f]+)?$/],["loom",/^[\da-f]{32}$/],["wistia",/^[\da-z]{10}$/]]),su=new Map([["youtube","YouTube video"],["vimeo","Vimeo video"],["loom","Loom video"],["wistia","Wistia video"]]);function au(e,t){var o;if(typeof e!="string"||typeof t!="string"||!((o=ou.get(e))!=null&&o.test(t)))return;const n=su.get(e)??"Video";switch(e){case"youtube":return{src:`https://www.youtube-nocookie.com/embed/${t}`,title:n};case"vimeo":{const[s,a]=t.split("/");return{src:`https://player.vimeo.com/video/${s}${a?`?h=${a}`:""}`,title:n}}case"loom":return{src:`https://www.loom.com/embed/${t}`,title:n};case"wistia":return{src:`https://fast.wistia.net/embed/iframe/${t}`,title:n};default:return}}var Hs,Ws;const ur={...ve.defaultSchema,attributes:{...ve.defaultSchema.attributes,code:[...((Hs=ve.defaultSchema.attributes)==null?void 0:Hs.code)??[],"className"],pre:[...((Ws=ve.defaultSchema.attributes)==null?void 0:Ws.pre)??[],"className"]}};var Us,Bs;const iu={...ur,attributes:{...ur.attributes,div:[...((Us=ve.defaultSchema.attributes)==null?void 0:Us.div)??[],"dataEmbed","dataEmbedId"],a:[...((Bs=ve.defaultSchema.attributes)==null?void 0:Bs.a)??[],"dataArticleSlug"]}};function Ur(e){return r.jsx(Br,{...e})}function cu({openArticle:e,...t}){return r.jsx(Br,{...t,articleEmbeds:!0,openArticle:e})}function lu(e){return r.jsx(Br,{...e,configuredStyles:!0})}function Br({children:e,messageType:t,messageId:n,configuredStyles:o=!1,articleEmbeds:s=!1,openArticle:a}){const{anchorTarget:i}=k.useConfig();return r.jsx(Fa,{"data-type":t,"data-id":n,remarkPlugins:[Vs],rehypePlugins:o?[nr,Jd,[ve,Xd]]:[nr,[ve,s?iu:ur]],components:{div:({node:c,...u})=>{const l=s?au(c==null?void 0:c.properties.dataEmbed,c==null?void 0:c.properties.dataEmbedId):void 0;return l?r.jsx("iframe",{src:l.src,title:l.title,loading:"lazy",allow:"encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,className:"not-prose my-4 aspect-video w-full rounded-xl border"}):r.jsx("div",{...u})},a:({node:c,children:u,...l})=>{const{href:m}=l,p=s?c==null?void 0:c.properties.dataArticleSlug:void 0;if(typeof p=="string")return a?r.jsx("a",{href:"#",onClick:f=>{f.preventDefault(),a(p)},children:u}):r.jsx(r.Fragment,{children:u});const h=m?tu(m):null;return m&&h?r.jsx(ru,{id:h,title:typeof u=="string"?u:m}):r.jsx("a",{target:l.target||i||"_top",...l,children:u})},img:({src:c,alt:u,...l})=>c?r.jsx(Qt,{trigger:r.jsx("img",{src:c,alt:u,...l,className:"cursor-pointer rounded-xl"}),children:r.jsx(Jt,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:r.jsx(La,{src:c,alt:u})})}):r.jsx("img",{src:c,alt:u,...l})},children:Ha(e)})}function Fe(){const{widgetCtx:{org:e}}=k.useWidget(),{sessionState:{session:t}}=k.useSessions(),n=k.useConfig(),{messagesState:{messages:o}}=k.useMessages(),{routerState:{screen:s}}=k.useWidgetRouter();return{react:d,org:e,session:t,config:n,messages:o,currentScreen:s}}function du({currentMessage:e}){var o;const t=Fe(),n=(o=t.config.customComponents)==null?void 0:o["message::after"];return n?r.jsx(n,{...t,currentMessage:e}):null}const Wa=d.createContext(null);function uu({children:e}){const{widgetCtx:t,config:n}=k.useWidget(),o=d.useRef({widgetCtx:t,config:n});d.useLayoutEffect(()=>{o.current={widgetCtx:t,config:n}},[t,n]);const s=d.useRef({kind:"main"}),a=d.useMemo(()=>({report:i=>{var b;const{widgetCtx:c,config:u}=o.current,l=(b=u.hooks)==null?void 0:b.onUserActivity;if(!l)return;const{screen:m}=c.routerCtx.state.get(),p=m==="home"?{screen:m,view:s.current}:{screen:m},{session:h}=c.sessionCtx.sessionState.get(),f=h?{...i,session:h,page:p}:{...i,page:p};try{l(f)}catch(g){Z.log.error("onUserActivity hook failed",g)}},setHomeView:i=>{s.current=i}}),[]);return r.jsx(Wa.Provider,{value:a,children:e})}function qr(){return d.useContext(Wa)}function Vr(e){var n;const t=(n=qr())==null?void 0:n.setHomeView;d.useLayoutEffect(()=>{t==null||t(e)},[t,e])}function en(){var n;const{sendMessage:e}=k.useMessages(),t=(n=qr())==null?void 0:n.report;return d.useCallback(o=>e(t?{...o,onSubmitted:s=>{var a;(a=o.onSubmitted)==null||a.call(o,s),t({type:"message-sent",message:s})}}:o),[e,t])}function pu({messageId:e,messageOptions:t}){var u;const{messagesState:n}=k.useMessages(),o=en(),{sessionState:s}=k.useSessions(),{pickedOptionId:a}=t,i=((u=Z.tappableOptionsMessage(n.messages,s.session))==null?void 0:u.id)===e,c=t.options.find(l=>l.id===a);return c?r.jsx("div",{...P("chat/agent_msg/options"),className:"flex",children:r.jsxs(V,{...P("chat/agent_msg/option_btn"),"data-picked":!0,"aria-pressed":!0,size:"sm",variant:"outline",className:"w-fit pl-2 text-sm text-muted-foreground disabled:opacity-100",disabled:!0,children:[r.jsx(T.CheckIcon,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),c.label]})}):i?r.jsx("div",{...P("chat/agent_msg/options"),role:"group",className:"flex flex-row flex-wrap gap-1.5 [@media(pointer:coarse)]:gap-y-3",children:t.options.map(l=>r.jsxs(V,{...P("chat/agent_msg/option_btn"),size:"sm",variant:"outline",className:"relative w-fit text-sm hover:bg-secondary",onClick:()=>o({content:l.label,optionReply:{messageId:e,optionId:l.id}}),children:[r.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 left-1/2 size-[max(100%,3rem)] -translate-x-1/2 -translate-y-1/2 [@media(pointer:fine)]:hidden"}),l.label]},l.id))}):null}const mu=["[--tw-prose-body:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-headings:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-lead:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-bold:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-links:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-code:hsl(var(--opencx-secondary-foreground))]","[--tw-prose-counters:hsl(var(--opencx-muted-foreground))]","[--tw-prose-bullets:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quotes:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quote-borders:hsl(var(--opencx-border))]","[--tw-prose-hr:hsl(var(--opencx-border))]","[--tw-prose-th-borders:hsl(var(--opencx-border))]","[--tw-prose-td-borders:hsl(var(--opencx-border))]","[--tw-prose-pre-bg:hsl(var(--opencx-muted))]","[--tw-prose-pre-code:hsl(var(--opencx-foreground))]"].join(" ");function pr(e){const{data:t,id:n,type:o,attachments:s,isFirstInGroup:a,isLastInGroup:i,isAloneInGroup:c,dataComponentNames:u,classNames:l}=e,m=o==="AI"||o==="AGENT"?t.message:"",p=d.useMemo(()=>o==="AI"?Ra(m):null,[o,m]);if(o!=="AI"&&o!=="AGENT")return null;const{variant:h="default"}=t,f=e.replyTo?r.jsx(Yd,{replyTo:e.replyTo}):null,b=(S,w,N=!0,C=!0)=>r.jsxs("div",{className:"flex flex-row gap-2",children:[r.jsxs("div",{...P((u==null?void 0:u.message)??"chat/agent_msg/msg"),"data-first":a,"data-last":i,"data-alone":c,"data-variant":h,className:A("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline",mu,"break-words [word-break:break-word]",h==="error"&&"bg-destructive/15 text-destructive",a&&!c&&"rounded-bl-md",i&&!c&&"rounded-tl-md",!a&&!i&&!c&&"rounded-l-md",l==null?void 0:l.message),children:[C&&f,r.jsx(Ur,{messageType:o,messageId:n,children:S})]}),N&&r.jsx(du,{currentMessage:e})]},w),g=(p==null?void 0:p.some(S=>S.type==="ui"))??!1,j=(p==null?void 0:p.reduce((S,w,N)=>w.type==="markdown"?N:S,-1))??-1,x=(p==null?void 0:p.findIndex(S=>S.type==="markdown"))??-1;return r.jsxs("div",{...P((u==null?void 0:u.messageContainer)??"chat/agent_msg/root"),"data-message-id":n,className:A("w-5/6 flex flex-col items-start gap-1",l==null?void 0:l.messageContainer),children:[s&&s.length>0&&r.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:s==null?void 0:s.map(S=>r.jsx(Da,{attachment:S},S.id))}),g&&p?p.map((S,w)=>S.type==="markdown"?b(S.content,`md-${w}`,w===j,w===x):r.jsx("div",{className:"w-full",children:r.jsx(za,{spec:S.spec})},`ui-${w}`)):m.length>0&&b(m),e.messageOptions&&r.jsx(pu,{messageId:n,messageOptions:e.messageOptions})]})}function hu(e){return r.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:r.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(e,null,1)})})}const Yr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Root,{ref:n,className:A("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",e),...t}));Yr.displayName=zt.Root.displayName;const Xr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Image,{ref:n,className:A("aspect-square h-full w-full",e),...t}));Xr.displayName=zt.Image.displayName;const Gr=Qe.forwardRef(({className:e,...t},n)=>r.jsx(zt.Fallback,{ref:n,className:A("flex size-full text-xs items-center justify-center rounded-lg",e),...t}));Gr.displayName=zt.Fallback.displayName;function mr({agent:e,...t}){var n,o;return r.jsxs(Yr,{...t,children:[r.jsx(Xr,{src:(e==null?void 0:e.avatarUrl)||(e==null?void 0:e.avatar)||"",alt:"Agent Icon"}),(e==null?void 0:e.name)&&r.jsx(Gr,{children:(o=(n=e==null?void 0:e.name)==null?void 0:n.slice(0,1))==null?void 0:o.toUpperCase()})]})}function fu({agent:e}){return r.jsx(W.AnimatePresence,{children:r.jsxs(ee,{...P("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[r.jsx(mr,{agent:e}),r.jsxs("div",{...P("chat/bot_loading/bouncing_dots_container"),className:A("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[r.jsx(W.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),r.jsx(W.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),r.jsx(W.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const gu='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.\\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.opencx-text-shimmer{animation:opencx-text-shimmer 2.5s ease-in-out infinite}.opencx-fade-up{animation:opencx-fade-up .3s cubic-bezier(.23,1,.32,1) both}[data-component="trigger/unread"],[data-component="sessions/unread"],[data-component="home/tab_unread"]{pointer-events:none;border-radius:9999px;background-color:hsl(var(--opencx-destructive));text-align:center;font-weight:600;--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);color:hsl(var(--opencx-destructive-foreground));font-size:11px;line-height:18px;box-shadow:0 0 0 2px hsl(var(--opencx-background))}[data-component="trigger/unread"]{position:absolute;z-index:1}[data-component="sessions/unread"]{flex-shrink:0;box-shadow:none}[data-component="home/tab_unread"]{position:absolute;top:-2px;inset-inline-end:-2px}[data-unread-look=dot]{width:9px;height:9px}[data-unread-look=count]{min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px}.opencx-placeholder-in{animation:opencx-placeholder-in .2s cubic-bezier(.23,1,.32,1) both}.opencx-placeholder-out{animation:opencx-placeholder-out .18s cubic-bezier(.23,1,.32,1) both}@keyframes opencx-text-shimmer{0%,to{opacity:.45}50%{opacity:1}}@keyframes opencx-fade-up{0%{opacity:0;filter:blur(4px);transform:translateY(8px)}to{opacity:1;filter:blur(0px);transform:translateY(0)}}@keyframes opencx-placeholder-in{0%{opacity:0;transform:translateY(4px);filter:blur(1px)}to{opacity:1;transform:translateY(0);filter:blur(0)}}@keyframes opencx-placeholder-out{0%{opacity:1;transform:translateY(0);filter:blur(0)}to{opacity:0;transform:translateY(-8px);filter:blur(1px)}}.opencx-input-recall{animation:opencx-input-recall .15s cubic-bezier(.23,1,.32,1)}@keyframes opencx-input-recall{0%{opacity:.25;translate:0 -3px}to{opacity:1;translate:0 0}}@media(prefers-reduced-motion:reduce){.opencx-text-shimmer,.opencx-fade-up,.opencx-placeholder-in,.opencx-placeholder-out,.opencx-input-recall{animation:none}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-0\\.5{top:.125rem;right:.125rem;bottom:.125rem;left:.125rem}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.end-1{inset-inline-end:.25rem}.end-4{inset-inline-end:1rem}.end-6{inset-inline-end:1.5rem}.left-1\\/2,.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.start-10{inset-inline-start:2.5rem}.start-2{inset-inline-start:.5rem}.start-4{inset-inline-start:1rem}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.col-span-full{grid-column:1 / -1}.m-2{margin:.5rem}.-mx-0\\.5{margin-left:-.125rem;margin-right:-.125rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-0\\.5{margin-top:-.125rem}.-mt-6{margin-top:-1.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.ms-1\\.5{margin-inline-start:.375rem}.ms-\\[30px\\]{margin-inline-start:30px}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-12{margin-top:3rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-0{width:0px;height:0px}.size-1\\.5{width:.375rem;height:.375rem}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-2\\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\\[18px\\]{width:18px;height:18px}.size-\\[max\\(100\\%\\,3rem\\)\\]{width:max(100%,3rem);height:max(100%,3rem)}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-0{height:0px}.h-1{height:.25rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-16{max-height:4rem}.max-h-40{max-height:10rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-\\[160px\\]{max-height:160px}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[50vh\\]{max-height:50vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-12{min-height:3rem}.min-h-8{min-height:2rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-1\\/4{width:25%}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-2\\/3{width:66.666667%}.w-2\\/5{width:40%}.w-3\\/4{width:75%}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-7{width:1.75rem}.w-\\[32px\\]{width:32px}.w-\\[3px\\]{width:3px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.w-svw{width:100svw}.min-w-0{min-width:0px}.min-w-80{min-width:20rem}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[3ch\\]{min-width:3ch}.max-w-40{max-width:10rem}.max-w-48{max-width:12rem}.max-w-64{max-width:16rem}.max-w-96{max-width:24rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-\\[min\\(100\\%\\,16rem\\)\\]{max-width:min(100%,16rem)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.shrink-\\[2\\]{flex-shrink:2}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--radix-popover-content-transform-origin\\)\\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\[var\\(--radix-tooltip-content-transform-origin\\)\\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-center{transform-origin:center}.origin-top{transform-origin:top}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-50{--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[subgrid\\]{grid-template-columns:subgrid}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.gap-\\[3px\\]{gap:3px}.gap-x-2\\.5{column-gap:.625rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-foreground\\/10>:not([hidden])~:not([hidden]){border-color:hsl(var(--opencx-foreground) / .1)}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-pretty{text-wrap:pretty}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[19px\\]{border-radius:19px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[calc\\(var\\(--opencx-inset-radius\\)\\+var\\(--cx-p\\)\\)\\]{border-radius:calc(var(--opencx-inset-radius) + var(--cx-p))}.rounded-\\[calc\\(var\\(--pk-r\\)-var\\(--pk-p\\)\\)\\]{border-radius:calc(var(--pk-r) - var(--pk-p))}.rounded-\\[var\\(--opencx-inset-radius\\)\\]{border-radius:var(--opencx-inset-radius)}.rounded-\\[var\\(--pk-r\\)\\]{border-radius:var(--pk-r)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-\\[1\\.5px\\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-s{border-inline-start-width:1px}.border-s-2{border-inline-start-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-border{border-color:hsl(var(--opencx-border))}.border-destructive\\/30{border-color:hsl(var(--opencx-destructive) / .3)}.border-foreground\\/10{border-color:hsl(var(--opencx-foreground) / .1)}.border-foreground\\/15{border-color:hsl(var(--opencx-foreground) / .15)}.border-muted-foreground\\/10{border-color:hsl(var(--opencx-muted-foreground) / .1)}.border-muted-foreground\\/15{border-color:hsl(var(--opencx-muted-foreground) / .15)}.border-muted-foreground\\/20{border-color:hsl(var(--opencx-muted-foreground) / .2)}.border-muted-foreground\\/30{border-color:hsl(var(--opencx-muted-foreground) / .3)}.border-primary{border-color:hsl(var(--opencx-primary))}.border-primary\\/10{border-color:hsl(var(--opencx-primary) / .1)}.border-primary\\/50{border-color:hsl(var(--opencx-primary) / .5)}.border-l-amber-500{--tw-border-opacity: 1;border-left-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-l-emerald-500{--tw-border-opacity: 1;border-left-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-t-current{border-top-color:currentColor}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\\/15{background-color:#f59e0b26}.bg-amber-500\\/5{background-color:#f59e0b0d}.bg-background{background-color:hsl(var(--opencx-background))}.bg-background\\/80{background-color:hsl(var(--opencx-background) / .8)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\\/5{background-color:#3b82f60d}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-destructive\\/10{background-color:hsl(var(--opencx-destructive) / .1)}.bg-destructive\\/15{background-color:hsl(var(--opencx-destructive) / .15)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\\/10{background-color:#10b9811a}.bg-emerald-500\\/15{background-color:#10b98126}.bg-emerald-500\\/5{background-color:#10b9810d}.bg-foreground\\/5{background-color:hsl(var(--opencx-foreground) / .05)}.bg-foreground\\/50{background-color:hsl(var(--opencx-foreground) / .5)}.bg-foreground\\/60{background-color:hsl(var(--opencx-foreground) / .6)}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-muted-foreground{background-color:hsl(var(--opencx-muted-foreground))}.bg-muted-foreground\\/10{background-color:hsl(var(--opencx-muted-foreground) / .1)}.bg-muted-foreground\\/30{background-color:hsl(var(--opencx-muted-foreground) / .3)}.bg-muted-foreground\\/40{background-color:hsl(var(--opencx-muted-foreground) / .4)}.bg-muted\\/30{background-color:hsl(var(--opencx-muted) / .3)}.bg-muted\\/40{background-color:hsl(var(--opencx-muted) / .4)}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-primary-foreground\\/20{background-color:hsl(var(--opencx-primary-foreground) / .2)}.bg-primary\\/10{background-color:hsl(var(--opencx-primary) / .1)}.bg-primary\\/25{background-color:hsl(var(--opencx-primary) / .25)}.bg-primary\\/\\[0\\.07\\]{background-color:hsl(var(--opencx-primary) / .07)}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\\/5{background-color:#ef44440d}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-secondary-foreground\\/10{background-color:hsl(var(--opencx-secondary-foreground) / .1)}.bg-secondary-foreground\\/20{background-color:hsl(var(--opencx-secondary-foreground) / .2)}.bg-transparent{background-color:transparent}.bg-white\\/30{background-color:#ffffff4d}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-foreground\\/70{--tw-gradient-from: hsl(var(--opencx-foreground) / .7) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--opencx-foreground) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-foreground\\/0{--tw-gradient-to: hsl(var(--opencx-foreground) / 0) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-foreground{fill:hsl(var(--opencx-foreground))}.stroke-current{stroke:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-left-top{object-position:left top}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[var\\(--cx-p\\)\\]{padding:var(--cx-p)}.p-\\[var\\(--pk-p\\)\\]{padding:var(--pk-p)}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\\[3px\\]{padding-top:3px;padding-bottom:3px}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-14{padding-bottom:3.5rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pe-1{padding-inline-end:.25rem}.pe-2{padding-inline-end:.5rem}.pe-2\\.5{padding-inline-end:.625rem}.pe-4{padding-inline-end:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pr-16{padding-right:4rem}.ps-1{padding-inline-start:.25rem}.ps-1\\.5{padding-inline-start:.375rem}.ps-10{padding-inline-start:2.5rem}.ps-2{padding-inline-start:.5rem}.ps-2\\.5{padding-inline-start:.625rem}.ps-3{padding-inline-start:.75rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-2\\.5{padding-top:.625rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[0\\.8125rem\\]{font-size:.8125rem}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-background{color:hsl(var(--opencx-background))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-foreground\\/50{color:hsl(var(--opencx-foreground) / .5)}.text-foreground\\/60{color:hsl(var(--opencx-foreground) / .6)}.text-foreground\\/80{color:hsl(var(--opencx-foreground) / .8)}.text-foreground\\/90{color:hsl(var(--opencx-foreground) / .9)}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/40{color:hsl(var(--opencx-muted-foreground) / .4)}.text-muted-foreground\\/50{color:hsl(var(--opencx-muted-foreground) / .5)}.text-muted-foreground\\/60{color:hsl(var(--opencx-muted-foreground) / .6)}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-primary-foreground\\/60{color:hsl(var(--opencx-primary-foreground) / .6)}.text-primary\\/10{color:hsl(var(--opencx-primary) / .1)}.text-primary\\/40{color:hsl(var(--opencx-primary) / .4)}.text-primary\\/50{color:hsl(var(--opencx-primary) / .5)}.text-primary\\/60{color:hsl(var(--opencx-primary) / .6)}.text-primary\\/70{color:hsl(var(--opencx-primary) / .7)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.text-secondary-foreground\\/60{color:hsl(var(--opencx-secondary-foreground) / .6)}.text-secondary-foreground\\/70{color:hsl(var(--opencx-secondary-foreground) / .7)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.caret-foreground{caret-color:hsl(var(--opencx-foreground))}.accent-current{accent-color:currentColor}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-border{--tw-ring-color: hsl(var(--opencx-border))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[background-color\\,color\\,transform\\]{transition-property:background-color,color,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[height\\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[width\\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-opencx{transition-timing-function:cubic-bezier(.23,1,.32,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-opencx{animation-timing-function:cubic-bezier(.23,1,.32,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.paused{animation-play-state:paused}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-foreground))}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-body\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-body: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-bold\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-bold: hsl(var(--opencx-foreground))}.\\[--tw-prose-bold\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-bold: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-bullets\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-bullets: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-code\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-code: hsl(var(--opencx-foreground))}.\\[--tw-prose-code\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-code: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-counters\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-counters: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-headings\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-headings: hsl(var(--opencx-foreground))}.\\[--tw-prose-headings\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-headings: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-hr\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-hr: hsl(var(--opencx-border))}.\\[--tw-prose-lead\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-lead: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-links\\:hsl\\(var\\(--opencx-primary\\)\\)\\]{--tw-prose-links: hsl(var(--opencx-primary))}.\\[--tw-prose-links\\:hsl\\(var\\(--opencx-secondary-foreground\\)\\)\\]{--tw-prose-links: hsl(var(--opencx-secondary-foreground))}.\\[--tw-prose-pre-bg\\:hsl\\(var\\(--opencx-muted\\)\\)\\]{--tw-prose-pre-bg: hsl(var(--opencx-muted))}.\\[--tw-prose-pre-code\\:hsl\\(var\\(--opencx-foreground\\)\\)\\]{--tw-prose-pre-code: hsl(var(--opencx-foreground))}.\\[--tw-prose-quote-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-quote-borders: hsl(var(--opencx-border))}.\\[--tw-prose-quotes\\:hsl\\(var\\(--opencx-muted-foreground\\)\\)\\]{--tw-prose-quotes: hsl(var(--opencx-muted-foreground))}.\\[--tw-prose-td-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-td-borders: hsl(var(--opencx-border))}.\\[--tw-prose-th-borders\\:hsl\\(var\\(--opencx-border\\)\\)\\]{--tw-prose-th-borders: hsl(var(--opencx-border))}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.\\[word-break\\:break-word\\]{word-break:break-word}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.last\\:border-0:last-child{border-width:0px}.focus-within\\:opacity-100:focus-within{opacity:1}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:bg-accent\\/60:hover{background-color:hsl(var(--opencx-accent) / .6)}.hover\\:bg-foreground:hover{background-color:hsl(var(--opencx-foreground))}.hover\\:bg-muted:hover{background-color:hsl(var(--opencx-muted))}.hover\\:bg-muted\\/50:hover{background-color:hsl(var(--opencx-muted) / .5)}.hover\\:bg-muted\\/60:hover{background-color:hsl(var(--opencx-muted) / .6)}.hover\\:bg-primary\\/10:hover{background-color:hsl(var(--opencx-primary) / .1)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--opencx-primary) / .9)}.hover\\:bg-primary\\/\\[0\\.02\\]:hover{background-color:hsl(var(--opencx-primary) / .02)}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--opencx-secondary) / .8)}.hover\\:bg-transparent:hover{background-color:transparent}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-foreground:hover{color:hsl(var(--opencx-foreground))}.hover\\:text-muted-foreground:hover{color:hsl(var(--opencx-muted-foreground))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:text-primary-foreground:hover{color:hsl(var(--opencx-primary-foreground))}.hover\\:text-secondary-foreground:hover{color:hsl(var(--opencx-secondary-foreground))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:opacity-80:hover{opacity:.8}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-ring:focus-visible{outline-color:hsl(var(--opencx-ring))}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset: inset}.focus-visible\\:ring-primary\\/40:focus-visible{--tw-ring-color: hsl(var(--opencx-primary) / .4)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-\\[0\\.97\\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-white\\/30:disabled{color:#ffffff4d}.disabled\\:opacity-100:disabled{opacity:1}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\\:opacity-100{opacity:1}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:hsl(var(--opencx-muted))}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.prose-headings\\:my-1\\.5 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.375rem;margin-bottom:.375rem}.prose-headings\\:text-\\[13px\\] :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:13px}.prose-p\\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.prose-pre\\:my-1\\.5 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.375rem;margin-bottom:.375rem}.prose-pre\\:p-2 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){padding:.5rem}.prose-pre\\:text-\\[11px\\] :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:11px}.prose-ol\\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\\:my-0\\.5 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.125rem;margin-bottom:.125rem}.prose-table\\:block :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){display:block}.prose-table\\:overflow-x-auto :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){overflow-x:auto}.prose-table\\:\\[overflow-wrap\\:normal\\] :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){overflow-wrap:normal}.prose-table\\:\\[word-break\\:normal\\] :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){word-break:normal}.prose-img\\:rounded-xl :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.75rem}.prose-hr\\:my-2 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}@media(prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:active\\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media(min-width:640px){.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(prefers-color-scheme:dark){.dark\\:text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\\:text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.dark\\:text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}}.\\[\\&\\>\\*\\:first-child\\]\\:mt-0>*:first-child{margin-top:0}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>*:last-child{margin-bottom:0}.\\[\\&_\\.animate-spin\\]\\:animate-none .animate-spin{animation:none}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}@media(hover:none){.\\[\\@media\\(hover\\:none\\)\\]\\:opacity-100{opacity:1}}@media(pointer:coarse){.\\[\\@media\\(pointer\\:coarse\\)\\]\\:min-h-12{min-height:3rem}.\\[\\@media\\(pointer\\:coarse\\)\\]\\:gap-y-3{row-gap:.75rem}}@media(pointer:fine){.\\[\\@media\\(pointer\\:fine\\)\\]\\:hidden{display:none}}',xu="5.11.0";function bu(e,t){const n=typeof(e==null?void 0:e.right)=="number",o=typeof(e==null?void 0:e.left)=="number";return n&&!o?"right":o&&!n||t==="rtl"?"left":"right"}const Jo=450;function ye(){const[e,t]=d.useState(()=>(window.top||window).innerWidth<Jo);return d.useEffect(()=>{const n=window.top||window,o=()=>{t(n.innerWidth<Jo)};return o(),n.addEventListener("resize",o),()=>{n.removeEventListener("resize",o)}},[]),{isSmallScreen:e}}const pn={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function de(){var h,f,b,g,j,x,S,w,N,C,v,_,R,z,M,D,O,U,E,I,H,L,q,X,B,F,J,re,$,te,K,oe,he,le,se,ne,Ie,ie,ue,gt,tt,ze,He,nt,We,Oe,Ue,Be;const{dir:e}=k.useDocumentDir(),{isSmallScreen:t}=ye(),{theme:n,inline:o}=k.useConfig(),s=ge=>o?"100%":ge,a=(ge,Me)=>t?`100dv${ge}`:Me,i=(ge,Me)=>s(a(ge,Me)),c=bu((h=n==null?void 0:n.widgetTrigger)==null?void 0:h.offset,e),u={zIndex:((f=n==null?void 0:n.widgetTrigger)==null?void 0:f.zIndex)??1e7,offset:{bottom:((g=(b=n==null?void 0:n.widgetTrigger)==null?void 0:b.offset)==null?void 0:g.bottom)??20,right:((x=(j=n==null?void 0:n.widgetTrigger)==null?void 0:j.offset)==null?void 0:x.right)??(c==="right"?20:"initial"),left:((w=(S=n==null?void 0:n.widgetTrigger)==null?void 0:S.offset)==null?void 0:w.left)??(c==="left"?20:"initial")},size:{button:((C=(N=n==null?void 0:n.widgetTrigger)==null?void 0:N.size)==null?void 0:C.button)??48,icon:((_=(v=n==null?void 0:n.widgetTrigger)==null?void 0:v.size)==null?void 0:_.icon)??24}},l=(()=>{const ge=c==="right"?u.offset.right:u.offset.left;return typeof ge!="number"?0:ge})(),m={palette:(n==null?void 0:n.palette)??"neutral",primaryColor:(n==null?void 0:n.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:u,widgetContentContainer:{borderRadius:t?"0px":((R=n==null?void 0:n.widgetContentContainer)==null?void 0:R.borderRadius)??"32px",zIndex:((z=n==null?void 0:n.widgetContentContainer)==null?void 0:z.zIndex)??u.zIndex+1,outline:((M=n==null?void 0:n.widgetContentContainer)==null?void 0:M.outline)??"none",outlineColor:((D=n==null?void 0:n.widgetContentContainer)==null?void 0:D.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((O=n==null?void 0:n.widgetContentContainer)==null?void 0:O.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((U=n==null?void 0:n.widgetContentContainer)==null?void 0:U.transitionProperty)??"all",transitionTimingFunction:((E=n==null?void 0:n.widgetContentContainer)==null?void 0:E.transitionTimingFunction)??pn.transitionTimingFunction,transitionDuration:((I=n==null?void 0:n.widgetContentContainer)==null?void 0:I.transitionDuration)??pn.transitionDuration,offset:{side:t?0:u.offset.bottom+u.size.button+Et.y*2+(((L=(H=n==null?void 0:n.widgetContentContainer)==null?void 0:H.offset)==null?void 0:L.side)??10),align:t?0:l+(((X=(q=n==null?void 0:n.widgetContentContainer)==null?void 0:q.offset)==null?void 0:X.align)??0)}},screens:{welcome:{width:i("w",((F=(B=n==null?void 0:n.screens)==null?void 0:B.welcome)==null?void 0:F.width)??"400px"),minHeight:i("h",((re=(J=n==null?void 0:n.screens)==null?void 0:J.welcome)==null?void 0:re.minHeight)??"1px")},sessions:{width:i("w",((te=($=n==null?void 0:n.screens)==null?void 0:$.sessions)==null?void 0:te.width)??"450px"),height:i("h",((oe=(K=n==null?void 0:n.screens)==null?void 0:K.sessions)==null?void 0:oe.height)??"600px")},chat:{width:i("w",((le=(he=n==null?void 0:n.screens)==null?void 0:he.chat)==null?void 0:le.width)??"525px"),height:i("h",((ne=(se=n==null?void 0:n.screens)==null?void 0:se.chat)==null?void 0:ne.height)??"700px"),withCanvas:{width:i("w",((ue=(ie=(Ie=n==null?void 0:n.screens)==null?void 0:Ie.chat)==null?void 0:ie.withCanvas)==null?void 0:ue.width)??"min(1050px, 100vw)"),height:i("h",((ze=(tt=(gt=n==null?void 0:n.screens)==null?void 0:gt.chat)==null?void 0:tt.withCanvas)==null?void 0:ze.height)??"min(800px, 100vh)"),transitionTimingFunction:((We=(nt=(He=n==null?void 0:n.screens)==null?void 0:He.chat)==null?void 0:nt.withCanvas)==null?void 0:We.transitionTimingFunction)??pn.transitionTimingFunction,transitionDuration:((Be=(Ue=(Oe=n==null?void 0:n.screens)==null?void 0:Oe.chat)==null?void 0:Ue.withCanvas)==null?void 0:Be.transitionDuration)??pn.transitionDuration}}}},p={maxHeight:i("h",`calc(
|
|
15
15
|
100vh
|
|
16
16
|
- ${m.widgetTrigger.offset.bottom}px
|
|
17
17
|
- ${m.widgetContentContainer.offset.side}px
|
|
@@ -125,8 +125,8 @@ ${o.note}`:o.note)}return n}const os=20,Ap=4e3;function kr(e,t){for(let n=e.next
|
|
|
125
125
|
[data-opencx-mark-hint], [data-opencx-mark-editor],
|
|
126
126
|
[data-opencx-mark-frame] { animation: none !important; }
|
|
127
127
|
}
|
|
128
|
-
`}),!t&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{"data-opencx-mark-hint":"",style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:m.chromeZIndex,display:"flex",alignItems:"center",gap:8,background:`color-mix(in srgb, ${m.surface} 92%, transparent)`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:m.foreground,font:"500 12px/1.4 system-ui, sans-serif",padding:"7px 12px 7px 10px",borderRadius:999,whiteSpace:"nowrap",boxShadow:`0 0 0 1px ${m.border}, 0 8px 24px color-mix(in srgb, ${m.foreground} 14%, transparent)`,animation:"opencx-mark-hint-in 200ms cubic-bezier(0.23, 1, 0.32, 1)"},children:[r.jsx("span",{style:{width:7,height:7,borderRadius:999,background:p}}),l("page_mark_hint"),r.jsx(xm,{theme:m,children:l("page_mark_escape")})]}),n&&r.jsx("div",{"data-opencx-mark-frame":"",style:{position:"fixed",left:n.rect.x-4,top:n.rect.y-4,width:n.rect.width+8,height:n.rect.height+8,zIndex:m.chromeZIndex,borderRadius:10,boxShadow:`0 0 0 2px ${m.surface}, 0 0 0 3.5px ${p}, 0 12px 32px color-mix(in srgb, ${m.foreground} 16%, transparent)`,animation:"opencx-mark-frame-in 140ms cubic-bezier(0.23, 1, 0.32, 1)",transitionProperty:"left, top, width, height",transitionDuration:"90ms",transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)",pointerEvents:"none"}},n.key)]}),t&&r.jsxs(r.Fragment,{children:[[[t.rect.x,t.rect.y],[t.rect.x+t.rect.width,t.rect.y],[t.rect.x,t.rect.y+t.rect.height],[t.rect.x+t.rect.width,t.rect.y+t.rect.height]].map(([h,f],b)=>r.jsx("div",{style:{position:"fixed",left:h-5,top:f-5,width:10,height:10,borderRadius:999,background:m.surface,boxShadow:`0 0 0 2px ${p}, 0 2px 6px color-mix(in srgb, ${m.foreground} 25%, transparent)`,zIndex:m.chromeZIndex,pointerEvents:"none"}},b)),r.jsx(vm,{draft:t,theme:m,onShapeChange:o,onAttach:s,onDiscard:a},"editor")]})]}),i)}function xm({children:e,theme:t}){return r.jsx("span",{style:{font:"600 10px/1 system-ui, sans-serif",color:t.mutedForeground,background:`color-mix(in srgb, ${t.foreground} 7%, transparent)`,border:`1px solid ${t.border}`,borderRadius:5,padding:"3px 5px 2px"},children:e})}const bm={box:r.jsx("rect",{x:"3",y:"5",width:"14",height:"10",rx:"1"}),circle:r.jsx("ellipse",{cx:"10",cy:"10",rx:"7",ry:"5.5"}),arrow:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 10h13"}),r.jsx("path",{d:"M12 6l4 4-4 4"})]}),bracket:r.jsx("path",{d:"M7 4H4v12h3"}),underline:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M5 8h10",opacity:"0.35"}),r.jsx("path",{d:"M4 14h12"})]}),highlight:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"7",width:"14",height:"6",rx:"1",fill:"currentColor",opacity:"0.3",stroke:"none"}),r.jsx("path",{d:"M5 10h10"})]}),"strike-through":r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M6 6h8",opacity:"0.35"}),r.jsx("path",{d:"M6 14h8",opacity:"0.35"}),r.jsx("path",{d:"M4 10h12"})]}),"crossed-off":r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M4 5l12 10"}),r.jsx("path",{d:"M16 5L4 15"})]})},wm={box:"page_mark_shape_box",circle:"page_mark_shape_circle",arrow:"page_mark_shape_arrow",bracket:"page_mark_shape_bracket",underline:"page_mark_shape_underline",highlight:"page_mark_shape_highlight","strike-through":"page_mark_shape_strike_through","crossed-off":"page_mark_shape_crossed_off"};function vm({draft:e,theme:t,onShapeChange:n,onAttach:o,onDiscard:s}){const{accent:a}=t,{t:i}=G(),[c,u]=d.useState(""),l=d.useRef(null);d.useEffect(()=>{var x;(x=l.current)==null||x.focus()},[]);const m=320,p=window.innerWidth,h=window.innerHeight,{rect:f}=e,b=Math.max(12,Math.min(f.x+f.width/2-m/2,p-m-12)),g=f.y+f.height+16,j=g+120>h?Math.max(12,f.y-116):g;return r.jsxs("div",{"data-opencx-mark-editor":"",style:{position:"fixed",left:b,top:j,width:m,zIndex:t.editorZIndex,pointerEvents:"auto",display:"flex",flexDirection:"column",gap:6,background:`color-mix(in srgb, ${t.surface} 96%, transparent)`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",padding:8,borderRadius:14,boxShadow:`0 0 0 1px ${t.border}, 0 12px 32px color-mix(in srgb, ${t.foreground} 18%, transparent)`,animation:"opencx-mark-editor-in 180ms cubic-bezier(0.23, 1, 0.32, 1)"},children:[r.jsx("div",{style:{display:"flex",gap:2,justifyContent:"space-between"},children:Ep.map(x=>{const S=x===e.shape,w=i(wm[x]);return r.jsx("button",{type:"button",title:w,"aria-label":i("page_mark_shape_aria",{shape:w}),"aria-pressed":S,onClick:()=>n(x),style:{border:"none",cursor:"pointer",borderRadius:8,width:32,height:28,display:"flex",alignItems:"center",justifyContent:"center",background:S?a:"transparent",color:S?t.surface:t.mutedForeground},children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:bm[x]})},x)})}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[r.jsx("input",{ref:l,value:c,onChange:x=>u(x.target.value),onKeyDown:x=>{x.key==="Enter"?(x.preventDefault(),o(c)):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),s())},placeholder:i("page_mark_note_placeholder"),style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",color:t.foreground,font:"500 13px/1.4 system-ui, sans-serif",paddingInlineStart:4}}),r.jsx("button",{type:"button","aria-label":i("page_mark_attach"),onClick:()=>o(c),style:{border:"none",borderRadius:999,width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:a,color:t.surface,font:"600 13px/1 system-ui, sans-serif",cursor:"pointer"},children:"↑"})]})]})}function ym({mark:e,onRemove:t}){var c;const{t:n}=G(),o=hi(e),s=e.note??((c=e.elements[0])==null?void 0:c.name)??n("page_mark_region"),a=n("page_mark_remove",{label:s}),i=e.elements.map(u=>u.name).join(", ");return o?r.jsx(ui,{...P("chat/input_box/page_mark_pill"),className:"group",shape:"tile",src:o,alt:s,title:i,note:e.note,children:r.jsx("button",{type:"button","aria-label":a,className:A("absolute top-1 end-1 rounded-full p-0.5","bg-foreground/60 text-background backdrop-blur-sm","opacity-0 group-hover:opacity-100 focus-visible:opacity-100","transition-opacity active:scale-90"),onClick:t,children:r.jsx(T.XIcon,{className:"size-3"})})}):r.jsxs("div",{...P("chat/input_box/page_mark_pill"),title:i,className:A("group relative size-12 shrink-0 overflow-hidden","flex items-center justify-center","rounded-2xl bg-background ring-1 ring-border"),children:[r.jsx(T.PenLineIcon,{className:"size-4 shrink-0 text-primary"}),r.jsx("span",{className:A("absolute inset-x-0 bottom-0 truncate px-1.5 py-0.5","bg-gradient-to-t from-foreground/70 to-foreground/0","text-[10px] font-medium leading-tight text-background"),children:s}),r.jsx("button",{type:"button","aria-label":a,className:A("absolute top-1 end-1 rounded-full p-0.5","bg-foreground/60 text-background backdrop-blur-sm","opacity-0 group-hover:opacity-100 focus-visible:opacity-100","transition-opacity active:scale-90"),onClick:t,children:r.jsx(T.XIcon,{className:"size-3"})})]})}const Pe={"close-panel":"Escape","toggle-fullscreen":"Mod+Shift+F",send:"Enter","send-alt":"Mod+Enter","history-prev":"ArrowUp","history-next":"ArrowDown"};function Ni(){return typeof navigator>"u"?!1:/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function ht(e,t,n=Ni()){const o=t.split("+"),s=o.at(-1)??"",a=new Set(o.slice(0,-1)),i=a.has("Cmd")||a.has("Mod")&&n,c=a.has("Ctrl")||a.has("Mod")&&!n;return e.metaKey!==i||e.ctrlKey!==c||e.altKey!==a.has("Alt")||e.shiftKey!==a.has("Shift")?!1:e.key.toLowerCase()===s.toLowerCase()}const km={Mod:"⌘",Cmd:"⌘",Ctrl:"⌃",Alt:"⌥",Shift:"⇧"},jm={Escape:"Esc",Enter:"⏎",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→"};function lo(e,t=Ni()){const n=e.split("+"),o=n.at(-1)??"",s=n.slice(0,-1),a=jm[o]??(o.length===1?o.toUpperCase():o);return t?[...s.map(i=>km[i]??i),a].join(""):[...s.map(i=>i==="Mod"?"Ctrl":i),a].join("+")}const Cm=50*1024*1024,_i={"application/pdf":[".pdf"],...Ed,...Td},Sm={"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],..._i},Nm={"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],..._i};function _m({status:e}){switch(e){case"uploading":return r.jsx(T.Loader2,{className:"size-4 animate-spin"});case"error":return r.jsx(T.AlertCircle,{className:"size-4 text-destructive"});default:return null}}function Em({file:e,fileContent:t}){const n=e.type.split("/")[0];return n==="image"&&t?r.jsx("img",{src:typeof t=="string"?t:"",className:"object-cover bg-secondary size-full",alt:e.name}):n==="audio"?r.jsx(T.FileAudio2Icon,{className:"size-4 text-muted-foreground"}):n==="video"?r.jsx(T.FileVideo2Icon,{className:"size-4 text-muted-foreground"}):e.type==="application/pdf"?r.jsx(T.FileText,{className:"size-4 text-muted-foreground"}):Pa({type:e.type,name:e.name})?r.jsx(T.FileSpreadsheet,{className:"size-4 text-muted-foreground"}):r.jsx(T.FileIcon,{className:"size-4 text-muted-foreground"})}function Tm({file:{status:e,file:t,error:n},onCancel:o}){const{t:s}=G(),[a,i]=d.useState(null);return d.useEffect(()=>{if(!t.type.startsWith("image/"))return;const c=new FileReader;return c.onload=()=>i(c.result),c.onerror=()=>Z.log.error("failed to read file for preview"),c.readAsDataURL(t),()=>c.abort()},[t]),r.jsx(Ee,{side:"bottom",content:e==="error"?r.jsx("span",{className:"text-destructive",children:s("upload_failed",{error:n??""})}):t.name,children:r.jsxs("div",{className:A(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(_m,{status:e})}),r.jsx("button",{type:"button",className:A("absolute bg-foreground/50 inset-0 size-full z-10","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:o,"aria-label":s("remove_attachment"),children:r.jsx(T.XIcon,{className:"size-4 text-primary-foreground"})}),r.jsx(Em,{file:t,fileContent:a})]})})}function Am(){const{queuedUserMessages:e,removeQueued:t,stop:n}=k.useAgentChatUi(),{messagesState:{messages:o}}=k.useMessages(),{t:s}=G(),a=d.useMemo(()=>e.filter(i=>!o.some(c=>c.id===i.id)),[e,o]);return r.jsx(W.AnimatePresence,{children:a.length>0&&r.jsx(je,{children:r.jsxs("div",{...P("chat/queued_sends/root"),className:"mb-1 rounded-2xl border border-muted-foreground/15 bg-background shadow-sm",children:[r.jsxs("div",{...P("chat/queued_sends/header"),className:"flex items-center justify-between px-3 pt-2 pb-1",children:[r.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("queued_label",{count:a.length})}),r.jsx("button",{type:"button",...P("chat/queued_sends/send_now"),"aria-label":s("send_queued_now"),title:s("send_queued_now"),onClick:n,className:"rounded-md p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground hover:bg-muted",children:r.jsx(T.CornerDownLeftIcon,{className:"size-3"})})]}),r.jsx("ul",{...P("chat/queued_sends/list"),className:"flex flex-col pb-1",children:a.map(i=>r.jsxs("li",{...P("chat/queued_sends/item"),className:"group flex items-center gap-2 px-3 py-1",children:[r.jsx("button",{type:"button",title:s("send_queued_now"),onClick:n,className:"min-w-0 flex-1 truncate text-start text-xs text-foreground/80 hover:text-foreground",children:i.content}),r.jsx("button",{type:"button",...P("chat/queued_sends/remove"),"aria-label":s("remove_queued_message"),onClick:()=>t(i.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground hover:bg-muted",children:r.jsx(T.XIcon,{className:"size-3.5"})})]},i.id))})]})},"queued-sends-pill")})}function Im({levelRef:e}){const t=d.useRef(null);return d.useEffect(()=>{let n=0;const o=new Z.DictationLevelSmoother({attack:.2,release:.07}),s=[],a=()=>{var c;const i=(c=t.current)==null?void 0:c.children;if(i){const u=o.next(e.current);for(let l=0;l<i.length;l++){const m=i[l];if(m instanceof HTMLElement){const p=.75+.25*Math.sin(Date.now()/260+l*1.7),h=`scaleY(${Math.max(.25,Math.min(1,u*1.8*p)).toFixed(3)})`;s[l]!==h&&(m.style.transform=h,s[l]=h)}}}n=requestAnimationFrame(a)};return n=requestAnimationFrame(a),()=>cancelAnimationFrame(n)},[e]),r.jsx("div",{ref:t,"aria-hidden":"true",className:"flex h-3.5 shrink-0 items-center gap-[3px]",children:[0,1,2,3].map(n=>r.jsx("span",{className:"h-full w-[3px] origin-center scale-y-50 rounded-full bg-current transition-transform duration-100 ease-out"},n))})}function zm({status:e,levelRef:t,onToggle:n,onPrewarm:o}){const{t:s}=G(),a=e==="listening",i=e==="connecting",c=s(a||i?"stop_dictation":"dictate");return r.jsx(Ee,{side:"top",align:"start",content:c,children:r.jsxs(V,{...P("chat/input_box/dictate_btn"),onClick:n,onPointerDown:u=>u.preventDefault(),onPointerEnter:o,onFocus:o,"aria-pressed":a||i,"aria-label":c,size:"fit",variant:"ghost",className:A("relative",vn,a&&Si),children:[i&&r.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0.5 animate-spin rounded-full border-[1.5px] border-current/20 border-t-current"}),r.jsx(W.AnimatePresence,{mode:"wait",children:a?r.jsx(ee,{distance:0,children:r.jsx(Im,{levelRef:t})},"bars"):r.jsx(ee,{distance:0,children:r.jsx(T.MicIcon,{className:A("size-4",i&&"opacity-60")})},"mic")})]})})}function Mm(e,t){const n=e.ownerDocument;if(!n.defaultView)return null;const s=n.createElement("div");Ei(e,s),Object.assign(s.style,{position:"absolute",visibility:"hidden",top:"0",left:"-9999px",height:"auto",overflow:"hidden",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:`${e.clientWidth}px`}),s.textContent=e.value.slice(0,t);const a=n.createElement("span");a.textContent="",s.appendChild(a),n.body.appendChild(s);const i=a.offsetLeft,c=a.offsetTop-e.scrollTop;return s.remove(),{left:i,top:c}}function Ei(e,t){const n=e.ownerDocument.defaultView;if(!n)return;const o=n.getComputedStyle(e);for(const s of Rm)t.style.setProperty(s,o.getPropertyValue(s))}const Rm=["box-sizing","font-family","font-size","font-weight","font-style","letter-spacing","line-height","text-transform","text-indent","word-spacing","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"],Pm=300,Ti=260,Om=8,Ai="rounded-xl border border-border bg-background shadow-lg";function $m({anchorRef:e,inputRef:t,anchorIndex:n,preview:o,groups:s,visible:a,searching:i,highlighted:c,onHighlight:u,onPick:l,onExpand:m}){var S;const{t:p}=G(),[h,f]=d.useState(null);d.useLayoutEffect(()=>{const w=e.current;if(!w)return;const N=w.ownerDocument.defaultView,C=()=>{const _=w.getBoundingClientRect(),R=(N==null?void 0:N.innerWidth)??_.right,z=Math.min(Pm,Math.max(0,R-16)),M=t.current,D=M&&n!==null?Mm(M,n):null,O=M==null?void 0:M.getBoundingClientRect(),U=D&&O?O.left+D.left:_.left+8,E=Math.max(8,Math.min(U,R-8-z)),I=D&&O?O.top+D.top-4:_.top-4;f({left:E,width:z,top:I,detailBeside:o&&E+z+Om+Ti<=R-8})};C(),N==null||N.addEventListener("resize",C);const v=typeof ResizeObserver>"u"?null:new ResizeObserver(C);return v==null||v.observe(w),()=>{N==null||N.removeEventListener("resize",C),v==null||v.disconnect()}},[n,e,t,o,a.length]);const b=(S=e.current)==null?void 0:S.closest("[data-version]");if(!b||!h||a.length===0&&i)return null;const g=a[c],j=g!=null&&g.description?g:null;let x=-1;return Yt.createPortal(r.jsxs("div",{...P("chat/input_box/mention_picker"),style:{position:"fixed",left:h.left,top:h.top,transform:"translateY(-100%)"},className:"z-50 flex items-end gap-2",children:[r.jsx("div",{role:"listbox",style:{width:h.width},className:A("flex max-h-72 flex-col overflow-hidden",Ai),children:r.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-1",children:a.length===0?r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:p("mentions_empty")}):s.map(w=>d.createElement("div",{...P("chat/input_box/mention_picker/group"),key:w.type,role:"group","aria-label":w.type},r.jsx("div",{className:"px-2 pb-0.5 pt-1.5 text-xs capitalize text-muted-foreground",children:w.type}),w.items.map(N=>{const C=++x;return d.createElement("button",{...P("chat/input_box/mention_picker/option"),key:`${N.type}:${N.id}`,type:"button",role:"option","aria-selected":C===c,onMouseDown:v=>v.preventDefault(),onMouseEnter:()=>u(C),onClick:()=>l(N),className:A("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start text-sm",C===c?"bg-muted":"hover:bg-muted/60")},r.jsx(Ii,{item:N}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-foreground",children:N.title}))}),w.hidden>0&&r.jsx("button",{...P("chat/input_box/mention_picker/more"),type:"button",onMouseDown:N=>N.preventDefault(),onClick:()=>m(w.type),className:A("w-full rounded-lg px-2 py-1 text-start text-xs","text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:p("json_see_more",{count:String(w.hidden)})})))})}),j&&h.detailBeside&&r.jsx(Lm,{item:j})]}),b)}function Lm({item:e}){return r.jsxs("div",{...P("chat/input_box/mention_picker/detail"),style:{width:Ti},className:A("flex gap-3 p-3",Ai),children:[r.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted",children:r.jsx(Ii,{item:e,className:"size-4"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block text-[10px] uppercase tracking-wide text-muted-foreground",children:e.type}),r.jsx("span",{className:"block truncate text-sm font-medium text-foreground",children:e.title}),r.jsx("span",{className:"mt-0.5 line-clamp-3 text-xs text-muted-foreground",children:e.description})]})]})}function Ii({item:e,className:t}){return e.icon?r.jsx("img",{src:e.icon,alt:"",className:A("size-4 shrink-0 rounded-sm object-contain",t)}):r.jsx(At,{name:e.iconName??"AtSign",className:A("size-3.5 shrink-0 text-primary",t)})}const zi=d.createContext(null);function Dm({children:e}){const[t,n]=d.useState([]),[o,s]=d.useState(!1),a=d.useRef(new Map),i=d.useCallback(p=>{s(p)},[]),c=d.useCallback((p,h)=>{a.current.set(p,h),n(f=>[...f,p])},[]),u=d.useCallback(p=>{const h=a.current.get(p);h&&(a.current.delete(p),h.undraw()),n(f=>f.filter(b=>b!==p))},[]),l=d.useCallback(()=>{const p=Array.from(a.current.values());a.current.clear();for(const h of p)h.undraw();n([])},[]);d.useEffect(()=>()=>{a.current.forEach(p=>p.remove()),a.current.clear()},[]);const m=d.useMemo(()=>({marks:t,isArmed:o,setArmed:i,attach:c,detach:u,detachAll:l}),[t,o,i,c,u,l]);return r.jsx(zi.Provider,{value:m,children:e})}function uo(){const e=d.useContext(zi);if(!e)throw new Error("usePageMarks must be used within a PageMarksProvider");return e}const Fm="data-opencx-mark-cursor",Hm=5,fn=4,gn=6,Gn={width:160,height:100},Wm=10,Um=no.map(e=>`:not(${e}):not(${e} *)`).join(""),Bm=e=>e==="nw"||e==="se"?"nwse-resize":"nesw-resize";function qm({enabled:e,onAttach:t,accentColor:n,zIndex:o}){const{isArmed:s,setArmed:a,attach:i}=uo(),c=e&&s,[u,l]=d.useState(null),[m,p]=d.useState(null),h=d.useRef(null),f=d.useRef(null);f.current=u;const b=d.useCallback(()=>{var N;(N=h.current)==null||N.undraw(),h.current=null,l(null)},[]),g=d.useCallback(()=>a(!1),[a]),j=d.useCallback(N=>{var C;l(v=>v&&{...v,rect:N}),(C=h.current)==null||C.setRect({x:N.x+window.scrollX,y:N.y+window.scrollY,width:N.width,height:N.height})},[]),x=d.useCallback(N=>{var C;l(v=>v&&{...v,shape:N}),(C=h.current)==null||C.setShape(N)},[]);d.useEffect(()=>{!e&&s&&a(!1)},[e,s,a]),d.useEffect(()=>{if(!c)return;const N=document.createElement("style");N.setAttribute(Fm,"");let C=null;const v=$=>{$!==C&&(C=$,N.textContent=`*${Um} { cursor: ${$} !important; }`)};v("crosshair"),document.head.appendChild(N);let _=null;const R=$=>$.target instanceof Element&&tn($.target),z=$=>R($)?!1:($.preventDefault(),$.stopPropagation(),$.stopImmediatePropagation(),!0),M=($,te,K)=>{const oe=[["nw",$.x,$.y],["ne",$.x+$.width,$.y],["sw",$.x,$.y+$.height],["se",$.x+$.width,$.y+$.height]];for(const[he,le,se]of oe)if(Math.hypot(te-le,K-se)<=Wm)return he;return null},D=($,te,K)=>te>=$.x&&te<=$.x+$.width&&K>=$.y&&K<=$.y+$.height,O=($,te)=>{var le;const K=jr($,te),oe=as(K?(()=>{const se=K.getBoundingClientRect();return{x:se.left-gn,y:se.top-gn,width:se.width+gn*2,height:se.height+gn*2}})():{x:$-Gn.width/2,y:te-Gn.height/2,...Gn}),he=((le=f.current)==null?void 0:le.shape)??"box";p(null),h.current=Ip({x:oe.x+window.scrollX,y:oe.y+window.scrollY,width:oe.width,height:oe.height},he,n,o),l({rect:oe,shape:he})},U=$=>{var oe;if(!z($)||$.button!==0)return;const te=f.current;if(!te){O($.clientX,$.clientY);return}const K=M(te.rect,$.clientX,$.clientY);if(K){_={kind:"resize",corner:K};return}if(D(te.rect,$.clientX,$.clientY)){_={kind:"move",grabX:$.clientX-te.rect.x,grabY:$.clientY-te.rect.y};return}(oe=h.current)==null||oe.undraw(),h.current=null,O($.clientX,$.clientY)};let E=null,I=0;const H=$=>{if(!z($))return;const te=f.current;if(!te){v("crosshair");const ie=jr($.clientX,$.clientY);if(!ie){E=null,p(null);return}ie!==E&&(E=ie,I+=1),p({rect:as($p(ie)),key:I});return}if(!_){const ie=M(te.rect,$.clientX,$.clientY);v(ie?Bm(ie):D(te.rect,$.clientX,$.clientY)?"move":"crosshair");return}const{rect:K}=te;if(_.kind==="move"){j({...K,x:$.clientX-_.grabX,y:$.clientY-_.grabY});return}const oe=_.corner.includes("w")?K.x+K.width:K.x,he=_.corner.includes("n")?K.y+K.height:K.y,le=Math.min(oe,$.clientX),se=Math.max(oe,$.clientX),ne=Math.min(he,$.clientY),Ie=Math.max(he,$.clientY);j({x:le,y:ne,width:Math.max(os,se-le),height:Math.max(os,Ie-ne)})},L=$=>{z($)&&(_=null)},q=$=>{R($)||z($),_=null},X=$=>{z($)},B=$=>{var te;if($.key==="Escape"){if($.preventDefault(),$.stopPropagation(),_=null,f.current){(te=h.current)==null||te.undraw(),h.current=null,l(null),v("crosshair");return}a(!1)}};let F=window.scrollX,J=window.scrollY;const re=()=>{p(null);const $=window.scrollX-F,te=window.scrollY-J;F=window.scrollX,J=window.scrollY,!($===0&&te===0)&&l(K=>K&&{...K,rect:{...K.rect,x:K.rect.x-$,y:K.rect.y-te}})};return document.addEventListener("pointerdown",U,!0),document.addEventListener("pointermove",H,!0),document.addEventListener("pointerup",L,!0),document.addEventListener("pointercancel",q,!0),document.addEventListener("click",X,!0),document.addEventListener("keydown",B,!0),document.addEventListener("scroll",re,!0),()=>{N.remove(),document.removeEventListener("pointerdown",U,!0),document.removeEventListener("pointermove",H,!0),document.removeEventListener("pointerup",L,!0),document.removeEventListener("pointercancel",q,!0),document.removeEventListener("click",X,!0),document.removeEventListener("keydown",B,!0),document.removeEventListener("scroll",re,!0),p(null)}},[c,n,o,j,a]),d.useEffect(()=>{!c&&f.current&&b()},[c,b]),d.useEffect(()=>()=>{var N;(N=h.current)==null||N.remove(),h.current=null},[]);const S=d.useCallback(N=>{if(!e)return;const C=f.current,v=h.current;if(!C||!v)return;const _=N.trim(),R=Vm(C.rect),z={shape:C.shape,..._?{note:_}:{},pageUrl:ro(window.location.href),rect:C.rect,elements:R.map(bi)};Fp(z,R),R[0]&&tp(z,R[0]),h.current=null,l(null),a(!1),i(z,v),t==null||t(z)},[i,e,t,a]),w=d.useCallback(()=>{e&&a(!s)},[e,s,a]);return{isActive:c,draft:u,hover:m,setShape:x,attach:S,dropDraft:b,disarm:g,toggle:w}}function Vm(e){const t=new Set,n=(o,s)=>{const a=jr(o,s);a&&t.add(a)};n(e.x+e.width/2,e.y+e.height/2);for(let o=0;o<=fn;o++)for(let s=0;s<=fn;s++)n(e.x+e.width*o/fn,e.y+e.height*s/fn);return Array.from(t).slice(0,Hm)}function Ym({enabled:e,inputRef:t}){const{widgetCtx:n}=k.useWidget(),{theme:o,cssVars:s}=de(),a=co({cssVars:s,primaryColor:o.primaryColor,contentZIndex:o.widgetContentContainer.zIndex}),{marks:i,detach:c}=uo(),u=d.useCallback(()=>{var p;(p=t.current)==null||p.focus()},[t]),l=d.useCallback(async p=>{if(!n.features.pageContext||!n.features.attachments)return null;try{const{fileUrl:h}=await n.api.uploadFile({file:p,abortSignal:new AbortController().signal});return h??null}catch(h){return Z.log.warn("page mark snapshot upload failed",h),null}},[n]),m=qm({enabled:e,onAttach:u,accentColor:a.accent,zIndex:a.inkZIndex});return{marks:i,detach:c,marking:m,uploadSnapshot:l}}function Xm({inputText:e,setInputText:t,inputRef:n,getSentTextHistory:o}){const s=d.useRef(null),a=d.useRef(""),i=()=>{const p=n.current;p&&(p.classList.remove("opencx-input-recall"),p.offsetWidth,p.classList.add("opencx-input-recall"))},c=(p,{animate:h=!0}={})=>{t(p),h&&i(),requestAnimationFrame(()=>{var f;return(f=n.current)==null?void 0:f.setSelectionRange(p.length,p.length)})};return{onKeyDown:p=>{if(ht(p,Pe["history-prev"])){const h=o();if(h.length===0)return!1;const f=s.current;if(f===null){const b=n.current;if(!((b==null?void 0:b.selectionStart)===0&&(b==null?void 0:b.selectionEnd)===0)&&e!=="")return!1;a.current=e,s.current=h.length-1}else{if(f===0)return!1;s.current=f-1}return p.preventDefault(),c(h[s.current],{animate:!p.repeat}),!0}if(ht(p,Pe["history-next"])){const h=s.current;if(h===null)return!1;p.preventDefault();const f=o();return h>=f.length-1?(s.current=null,c(a.current,{animate:!p.repeat}),a.current=""):(s.current=h+1,c(f[s.current],{animate:!p.repeat})),!0}return!1},onEdit:()=>{s.current=null},onSent:()=>{s.current=null,a.current=""}}}const gs="max-h-16 [field-sizing:content] w-full px-2";function Mi({trailingActions:e,placeholder:t,hideAttachTools:n,disabled:o=!1}={}){var an;const{isSmallScreen:s}=ye(),a=d.useRef(null),i=d.useRef(null),c=d.useRef(null),u=d.useRef(!0),{messagesState:l,rememberSentText:m,getSentTextHistory:p}=k.useMessages(),h=en(),{widgetCtx:f,componentStore:b}=k.useWidget(),{attachments:g,pageContext:j}=f.features,{isStreaming:x,stop:S,queuedUserMessages:w,pendingClarification:N,pendingConnection:C,pendingPageAction:v}=k.useAgentChatUi(),{sessionState:_}=k.useSessions(),R=o||vr({isStreaming:x,messages:l.messages,session:_.session}),z=d.useRef(x);z.current=x;const{t:M}=G(),{text:D,setText:O,clearSubmitted:U}=k.useComposerDraft(),E=fm(),I=hp({text:D,setText:O,inputRef:a}),H=I.picked.length>0;d.useLayoutEffect(()=>{const Y=a.current,fe=c.current;!Y||!fe||Ei(Y,fe)},[H,D]);const[L,q]=d.useState(!1),X=E?`${E.type}:${E.id}`:"";d.useEffect(()=>{q(!1)},[X]);const[B,F]=d.useState(null),J=d.useRef(D);J.current=D;const re=d.useRef(()=>{}),$=k.useDictation({getValue:()=>J.current,setValue:Y=>{J.current=Y,O(Y)},onSend:()=>re.current()}),{stop:te}=$;d.useEffect(()=>{R&&te({executeFinalCommand:!1})},[R,te]),d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const K=Xm({inputText:D,setInputText:O,inputRef:a,getSentTextHistory:p}),oe=j&&!s,he=!R&&oe&&n!==!0,{marks:le,detach:se,marking:ne,uploadSnapshot:Ie}=Ym({enabled:he,inputRef:a});d.useEffect(()=>{j||le.forEach(se)},[j,le,se]);const{allFiles:ie,handleCancelUpload:ue,appendFiles:gt,emptyTheFiles:tt,isUploading:ze,successFiles:He}=k.useUploadFiles();d.useEffect(()=>{!g&&ie.length>0&&tt()},[g,ie.length,tt]);const nt=!!((an=_.session)!=null&&an.isHandedOff),{isAwaitingBotReply:We}=k.useIsAwaitingBotReply(),Oe=f.messageCtx.blocksSendWhileAwaitingReply&&We,Ue=Y=>{R||!g||(F(null),gt(Y))},Be=E!==null&&!L,ge=ie.length>0||le.length>0,Me=!D.trim()&&He.length===0&&(!j||!le.some(wn)),$e=x&&Me,Ln=$e&&w.length>0,rn=R||ze||Oe||Me,xe=()=>{if($.stop({executeFinalCommand:!1}),R||Oe||ze)return;const Y=J.current,fe=f.messageCtx.captureConversation(),Pt=f.messageCtx.draftState.get(),Le=le.filter(be=>f.features.pageContext&&wn(be)?!0:(se(be),!1)),rt=f.features.attachments?[...He]:[];if(!Y.trim()&&rt.length===0&&Le.length===0)return;const Ot=ie.map(be=>be.id);Le.forEach(be=>np(be,Ie)),Promise.all(Le.map(be=>rp(be,Gm))).then(()=>Rt({isCurrentConversation:fe,submittedText:Y,submittedDraft:Pt,submittedMarks:Le,submittedFiles:rt,submittedFileIds:Ot}))},Rt=({isCurrentConversation:Y,submittedText:fe,submittedDraft:Pt,submittedMarks:Le,submittedFiles:rt,submittedFileIds:Ot})=>{if(!Y()||vr({isStreaming:z.current,messages:f.messageCtx.state.get().messages,session:f.sessionCtx.sessionState.get().session}))return;const bt=f.features.pageContext,wt=Le.filter(pe=>bt&&wn(pe)?!0:(se(pe),!1));if(!fe.trim()&&rt.length===0&&wt.length===0)return;const vt=fe.trim()||(wt.length>0?Km(wt)??M("page_mark_default_message"):"");let $t=!1;const cn=I.picked;h({content:vt,withPageEntity:!L,mentions:cn.length>0?cn:void 0,attachments:rt.flatMap(pe=>pe.fileUrl?[{url:pe.fileUrl,type:pe.file.type,name:pe.file.name,id:pe.id,size:pe.file.size}]:[]),clientContext:Ci({marks:wt,readsPage:bt}),onAccepted:()=>{if($t||!Y())return;$t=!0,m(vt),Le.forEach(ot=>se(ot)),Ot.forEach(ot=>ue(ot));const pe=U(Pt);u.current&&(K.onSent(),q(!1),pe&&I.reset())}}).catch(pe=>{Z.log.error("failed to send message",pe)})},{getRootProps:Dn,getInputProps:xt,open:on}=wc.useDropzone({onDrop:Ue,noClick:!0,disabled:R||!g,onDropRejected(){F(M("file_rejected"))},maxSize:Cm,accept:nt?Sm:Nm}),Fn=Y=>{const fe=Y.clipboardData;fe&&fe.files.length>0&&Ue(Array.from(fe.files))};re.current=xe;const sn=b.getComponent("agent_chat_questions");return!C&&N&&sn?r.jsx("div",{...P("chat/input_box/root"),className:"p-2 relative space-y-1",children:r.jsx(sn,{request:N})}):r.jsxs("div",{...P("chat/input_box/root"),className:"p-2 relative space-y-1",...Dn({ref:i}),children:[_.session&&r.jsx(Sp,{sessionId:_.session.id,active:x||We},_.session.id),C&&r.jsx(_p,{request:C},C.request_id),v&&r.jsx(um,{request:v},v.callId),r.jsx("input",{...xt()}),I.isOpen&&r.jsx($m,{anchorRef:i,inputRef:a,anchorIndex:I.anchorIndex,preview:I.preview,groups:I.groups,visible:I.visible,searching:I.searching,highlighted:I.highlighted,onHighlight:I.setHighlighted,onPick:I.pick,onExpand:I.expandGroup}),he&&r.jsx(gm,{isActive:ne.isActive,draft:ne.draft,hover:ne.hover,onShapeChange:ne.setShape,onAttach:ne.attach,onDiscard:ne.dropDraft}),r.jsx(Am,{}),B&&r.jsx("p",{role:"alert",className:"px-2 text-xs text-destructive",children:B}),$.error&&r.jsx("p",{role:"alert",className:"px-2 text-xs text-destructive",children:$.error==="microphone"?M("dictation_mic_blocked"):M("dictation_unavailable")}),r.jsxs("div",{...P("chat/input_box/attached_context_tray"),style:{"--cx-p":"0.25rem"},className:A("flex flex-col","rounded-[calc(var(--opencx-inset-radius)+var(--cx-p))] p-[var(--cx-p)]","transition-colors duration-200 ease-opencx",Be?"bg-muted":"bg-transparent"),children:[r.jsx(W.AnimatePresence,{children:Be&&r.jsx(je,{children:r.jsx("div",{...P("chat/input_box/page_context_container"),className:"flex items-center gap-1 flex-wrap ps-3 pe-1 py-1",children:r.jsx(W.AnimatePresence,{mode:"popLayout",children:E&&!L&&r.jsx(ee,{snapExit:!0,children:r.jsx(mm,{entity:E,onRemove:()=>q(!0)})},"page-entity")})})},"attached-context")}),r.jsxs("div",{...P("chat/input_box/inner_root"),className:A("transition-colors","bg-background","border border-border","relative rounded-[var(--opencx-inset-radius)] flex flex-col gap-2 p-2"),children:[r.jsxs("div",{...P("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[ge&&r.jsx("div",{...P("chat/input_box/attachments_container"),className:"flex items-center gap-1 overflow-x-auto",children:r.jsxs(W.AnimatePresence,{mode:"popLayout",children:[ie.map(Y=>r.jsx(ee,{snapExit:!0,children:r.jsx(Tm,{onCancel:()=>ue(Y.id),file:Y})},Y.id)),le.map((Y,fe)=>r.jsx(ee,{snapExit:!0,children:r.jsx(ym,{mark:Y,onRemove:()=>se(Y)})},`mark-${fe}-${Y.note??""}`))]})}),r.jsxs("div",{className:"relative",children:[H&&r.jsx("div",{ref:c,"aria-hidden":!0,className:A(gs,"pointer-events-none absolute inset-0 overflow-hidden","whitespace-pre-wrap break-words text-foreground",!ge&&"pt-1",s?"text-[16px]":"text-sm"),children:r.jsx(fi,{text:D,mentions:I.picked,tokenClassName:"bg-primary/10 text-primary"})}),r.jsx("textarea",{...P("chat/input_box/textarea"),disabled:R,onPaste:Fn,ref:a,id:"chat-input",value:D,rows:3,className:A(gs,"relative resize-none",!ge&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",H&&"text-transparent caret-foreground",s?"text-[16px]":"text-sm"),onScroll:Y=>{c.current&&(c.current.scrollTop=Y.currentTarget.scrollTop)},onChange:Y=>{K.onEdit(),O(Y.target.value)},onClick:()=>I.onCaretMove("nearest"),onKeyUp:Y=>{Y.key==="ArrowRight"||Y.key==="ArrowDown"?I.onCaretMove("forward"):Y.key==="ArrowLeft"||Y.key==="ArrowUp"?I.onCaretMove("backward"):(Y.key==="Home"||Y.key==="End")&&I.onCaretMove("nearest")},onKeyDown:Y=>{if(!Y.nativeEvent.isComposing&&!I.onKeyDown(Y)){if(ht(Y,Pe.send)||ht(Y,Pe["send-alt"])){Y.preventDefault(),Ln?S():xe();return}if(Y.key==="Escape"&&ne.isActive){ne.disarm();return}K.onKeyDown(Y)}},placeholder:t??M("write_a_message_placeholder")})]})]}),r.jsxs("div",{className:"gap-2 flex justify-between",children:[r.jsx("div",{className:"flex items-center gap-1",children:!R&&!n&&r.jsxs(r.Fragment,{children:[g&&r.jsx(Ee,{side:"top",align:"start",content:M("attach_files"),children:r.jsx(V,{onClick:on,"aria-label":M("attach_files"),size:"fit",variant:"ghost",className:vn,children:r.jsx(W.AnimatePresence,{mode:"wait",children:Oe?r.jsx(ee,{distance:0,children:r.jsx(T.PaperclipIcon,{className:"size-4 opacity-50"})},"paper-clip-disabled"):r.jsx(ee,{distance:0,children:r.jsx(T.PaperclipIcon,{className:"size-4"})},"paper-clip")})})}),$.enabled&&r.jsx(zm,{status:$.status,levelRef:$.levelRef,onToggle:$.toggle,onPrewarm:$.prewarm}),oe&&r.jsx(Ee,{side:"top",align:"start",content:ne.isActive?M("mark_page_active"):M("mark_page"),children:r.jsx(V,{...P("chat/input_box/page_mark_btn"),onClick:ne.toggle,"aria-label":ne.isActive?M("mark_page_active"):M("mark_page"),size:"fit",variant:"ghost",className:A(vn,ne.isActive&&Si),children:r.jsx(T.MousePointerClickIcon,{className:"size-4"})})})]})}),r.jsxs("div",{className:"flex items-center gap-1",children:[e,r.jsx(Ee,{content:M($e?"stop_response":"send_message"),shortcut:$e?void 0:lo(Pe.send),side:"top",align:"end",children:r.jsx(V,{size:"fit",onClick:$e?S:xe,"aria-label":M($e?"stop_response":"send_message"),disabled:R||!$e&&rn,className:vn,children:r.jsx(W.AnimatePresence,{mode:"wait",children:$e?r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.SquareIcon,{className:"size-3 fill-current"})},"stop"):!x&&(Oe||ze)?r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})]})]})}const Gm=1500;function Km(e){const t=e.flatMap(n=>{var s;const o=(s=n.note)==null?void 0:s.trim();return o?[o]:[]});return t.length>0?t.join(`
|
|
129
|
-
`):null}function xs(){const{widgetCtx:e}=k.useWidget(),{router:t}=k.useConfig(),{canCreateNewSession:n}=k.useSessions(),{toSessionsScreen:o}=k.useWidgetRouter(),{t:s}=G();return r.jsx(r.Fragment,{children:n||t!=null&&t.chatScreenOnly?r.jsx(V,{onClick:e.resetChat,className:"rounded-2xl w-full",children:s("new_conversation")}):r.jsx(V,{onClick:o,className:"rounded-2xl w-full",children:s("back_to_conversations")})})}function Zm(){const{t:e}=G(),{isCsatRequested:t,isCsatSubmitted:n}=k.useCsat();return r.jsx("div",{className:"p-2",children:r.jsx("div",{className:"p-2 bg-muted rounded-[var(--opencx-inset-radius)]",children:r.jsx(W.AnimatePresence,{mode:"wait",children:t||n?r.jsxs(je,{children:[r.jsx(jp,{}),r.jsx(W.AnimatePresence,{mode:"wait",children:n&&r.jsx(je,{children:r.jsx(xs,{})},"new-conv-or-back-to-convs-button")})]},"csat"):r.jsxs(je,{children:[r.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[r.jsx(T.CircleCheckIcon,{className:"size-4 text-emerald-600"}),r.jsx("h2",{className:"text-sm font-medium",children:e("your_issue_has_been_resolved")})]}),r.jsx(xs,{})]},"session-closed")})})})}function Jm(){var l;const{initialQuestions:e,initialQuestionsPosition:t,thisWasHelpfulOrNot:n}=k.useConfig(),{sessionState:o}=k.useSessions(),{messagesState:s}=k.useMessages(),{isStreaming:a}=k.useAgentChatUi(),i=s.messages.length===0,c=gi(),u=vr({isStreaming:a,messages:s.messages,session:o.session});return r.jsx("footer",{children:r.jsx(W.AnimatePresence,{mode:"wait",children:o.session&&!((l=o.session)!=null&&l.isOpened)?r.jsxs(je,{children:[r.jsx(Zm,{}),r.jsx(yr,{})]},"session-closed"):r.jsxs(je,{children:[s.lastAIResMightSolveUserIssue&&(n==null?void 0:n.enabled)!==!1&&r.jsx(Cp,{}),i&&e&&t!=="below-initial-messages"&&r.jsx("div",{className:A("flex items-center flex-row justify-end gap-2 flex-wrap px-2",c&&"pb-4"),children:e==null?void 0:e.map((m,p)=>r.jsx(Rn,{suggestion:m},`${m}-${p}`))}),!c&&!u&&r.jsx(Mi,{}),r.jsx(yr,{})]},"chat-input")})})}function Qm(){const{messagesState:{messages:e}}=k.useMessages(),{isAwaitingBotReply:t}=k.useIsAwaitingBotReply(),{componentStore:n}=k.useWidget(),o=k.useBot(),s=d.useMemo(()=>si(e),[e]),a=e.at(-1),i=a==null?void 0:a.id,c=a==null?void 0:a.type,u=d.useRef(i),[l,m]=d.useState(!1),p=t&&!l;d.useEffect(()=>{const g=u.current!==i;if(u.current=i,!t||c!=="AI"){m(!1);return}if(!g)return;m(!0);const j=setTimeout(()=>m(!1),600);return()=>clearTimeout(j)},[t,i,c]);const h=n.getComponent("loading"),f=d.useRef(null);function b(){setTimeout(()=>{const g=f.current;g&&(g.scrollTop=g.scrollHeight)},0)}return d.useEffect(()=>{b()},[e,p]),r.jsxs("div",{...P("chat/msgs/root"),ref:f,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[r.jsx(li,{}),r.jsx(ai,{}),r.jsx(di,{}),r.jsx(wr,{groups:s,pendingReply:t}),p&&h&&r.jsx(h,{agent:o}),r.jsx(oi,{}),r.jsx(ri,{})]})}function eh(){const{messagesState:{isInitialFetchLoading:e}}=k.useMessages(),{widgetCtx:t}=k.useWidget(),n=t.streaming,{sessionState:{session:o}}=k.useSessions(),{isCanvasOpen:s}=Ou(),{theme:a}=de();Mt({width:s?a.screens.chat.withCanvas.width:a.screens.chat.width,height:s?a.screens.chat.withCanvas.height:a.screens.chat.height});const i=d.useRef((o==null?void 0:o.id)||"chat").current;return r.jsx("div",{...P("chat/root"),className:A("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:r.jsxs("div",{className:"relative size-full justify-between flex flex-col",children:[r.jsx(Ja,{}),r.jsx(W.AnimatePresence,{mode:"wait",children:e?r.jsx(ee,{className:"flex flex-col items-center justify-center w-full flex-1",children:r.jsx(Qa,{})},"loading"):r.jsxs(ee,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[r.jsxs("div",{...P("chat/main/root"),className:A("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:a.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:a.screens.chat.withCanvas.transitionDuration},children:[n?r.jsx(vp,{}):r.jsx(Qm,{}),r.jsx(Jm,{})]}),r.jsx("div",{...P("chat/canvas/root"),className:A("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:a.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:a.screens.chat.withCanvas.transitionDuration},children:r.jsx(yp,{})})]},i)})]})})}const Wt=Qe.forwardRef(({className:e,type:t,...n},o)=>{const{isSmallScreen:s}=ye();return r.jsx("input",{ref:o,type:t,className:A(s?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",e),...n})});Wt.displayName="Input";function th({className:e}){return r.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:A("text-primary-foreground",e),children:r.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function nn({className:e}){const{token:t}=k.useConfig();return r.jsx("div",{className:A("flex items-center justify-center gap-2 p-2 pt-0",e),children:r.jsx(Re,{children:r.jsxs("a",{dir:"ltr",href:`https://open.cx/?ref=${t}`,target:"_blank",rel:"noreferrer",className:A("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[r.jsx("span",{children:"Powered by"}),r.jsx("span",{children:" "}),r.jsxs("span",{className:"flex items-center gap-[1px]",children:[r.jsx("span",{children:r.jsx(th,{className:"size-3 inline-block"})}),r.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function lt({className:e,...t}){return r.jsx("div",{className:A("animate-pulse rounded-md bg-secondary",e),...t})}const nh=3;function Ri(e,t){for(const n of e){if(n.id===t)return n;const o=Ri(n.topics,t);if(o)return o}}function rh({articleId:e,siblings:t,popular:n}){const o=new Set([e]),s=[];for(const{id:a,title:i,slug:c}of[...t,...n])if(!o.has(a)&&(o.add(a),s.push({id:a,title:i,slug:c}),s.length===nh))break;return s}const po="w-full justify-between gap-3 rounded-[19px] px-3 py-2.5 text-start whitespace-normal";function ft({title:e,children:t,component:n}){return r.jsxs("section",{...P(n),className:"rounded-3xl border bg-background p-1",children:[e&&r.jsx("p",{className:"px-3 pt-2.5 pb-1 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:e}),r.jsx("div",{className:"flex flex-col",children:t})]})}function Pi({topic:e,onOpen:t}){return r.jsxs(V,{...P("home/topic_row"),variant:"ghost",wobble:!1,size:"free",className:po,onClick:()=>t(e.id),children:[r.jsx(T.FolderIcon,{className:"size-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug [overflow-wrap:anywhere]",children:e.name}),r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.article_count}),r.jsx(T.ChevronRightIcon,{className:"size-4 shrink-0 text-muted-foreground rtl:-scale-100"})]})}function Oi({article:e,onOpen:t}){return r.jsxs(V,{...P("home/article_link"),variant:"ghost",wobble:!1,size:"free",className:po,onClick:()=>t(e.slug),children:[r.jsx("span",{className:"min-w-0 flex-1 text-sm leading-snug [overflow-wrap:anywhere]",children:e.title}),r.jsx(T.ChevronRightIcon,{className:"size-4 shrink-0 text-muted-foreground rtl:-scale-100"})]})}function $i({component:e,onBack:t,children:n}){const{setIsOpen:o}=k.useWidgetTrigger(),{isSmallScreen:s}=ye(),{t:a}=G();return r.jsxs("header",{...P(e),className:"shrink-0 flex items-center gap-2 px-4 py-2 border-b",children:[r.jsx(V,{variant:"ghost",size:"fit",className:"shrink-0 rounded-full","aria-label":a("article_back"),onClick:t,children:r.jsx(T.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})}),n,s&&r.jsx(V,{variant:"ghost",size:"fit",className:"shrink-0 rounded-full",onClick:()=>o(!1),children:r.jsx(T.XIcon,{className:"size-4"})})]})}function _n(){return r.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[r.jsx(lt,{className:"h-4 w-2/3"}),r.jsx(lt,{className:"h-3 w-full"})]})}function Li({onClick:e}){const{t}=G();return r.jsx(V,{...P("home/show_more"),variant:"ghost",wobble:!1,size:"free",className:"w-full justify-center rounded-[19px] px-3 py-2.5 text-sm font-medium text-primary",onClick:e,children:t("home_show_more")})}const bs=99,oh=e=>e?16:9,Di=(e,t)=>e/2*(1-Math.SQRT1_2)-oh(t)/2;function Fi({count:e,showCount:t,component:n="trigger/unread",style:o}){return e<=0?null:r.jsx(W.motion.span,{...P(n),"data-unread-look":t?"count":"dot","aria-hidden":!0,initial:{scale:0},animate:{scale:1},transition:we,style:o,children:t?e>bs?`${bs}+`:e:null})}function sh(){return r.jsx("style",{children:`
|
|
128
|
+
`}),!t&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{"data-opencx-mark-hint":"",style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:m.chromeZIndex,display:"flex",alignItems:"center",gap:8,background:`color-mix(in srgb, ${m.surface} 92%, transparent)`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:m.foreground,font:"500 12px/1.4 system-ui, sans-serif",padding:"7px 12px 7px 10px",borderRadius:999,whiteSpace:"nowrap",boxShadow:`0 0 0 1px ${m.border}, 0 8px 24px color-mix(in srgb, ${m.foreground} 14%, transparent)`,animation:"opencx-mark-hint-in 200ms cubic-bezier(0.23, 1, 0.32, 1)"},children:[r.jsx("span",{style:{width:7,height:7,borderRadius:999,background:p}}),l("page_mark_hint"),r.jsx(xm,{theme:m,children:l("page_mark_escape")})]}),n&&r.jsx("div",{"data-opencx-mark-frame":"",style:{position:"fixed",left:n.rect.x-4,top:n.rect.y-4,width:n.rect.width+8,height:n.rect.height+8,zIndex:m.chromeZIndex,borderRadius:10,boxShadow:`0 0 0 2px ${m.surface}, 0 0 0 3.5px ${p}, 0 12px 32px color-mix(in srgb, ${m.foreground} 16%, transparent)`,animation:"opencx-mark-frame-in 140ms cubic-bezier(0.23, 1, 0.32, 1)",transitionProperty:"left, top, width, height",transitionDuration:"90ms",transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)",pointerEvents:"none"}},n.key)]}),t&&r.jsxs(r.Fragment,{children:[[[t.rect.x,t.rect.y],[t.rect.x+t.rect.width,t.rect.y],[t.rect.x,t.rect.y+t.rect.height],[t.rect.x+t.rect.width,t.rect.y+t.rect.height]].map(([h,f],b)=>r.jsx("div",{style:{position:"fixed",left:h-5,top:f-5,width:10,height:10,borderRadius:999,background:m.surface,boxShadow:`0 0 0 2px ${p}, 0 2px 6px color-mix(in srgb, ${m.foreground} 25%, transparent)`,zIndex:m.chromeZIndex,pointerEvents:"none"}},b)),r.jsx(vm,{draft:t,theme:m,onShapeChange:o,onAttach:s,onDiscard:a},"editor")]})]}),i)}function xm({children:e,theme:t}){return r.jsx("span",{style:{font:"600 10px/1 system-ui, sans-serif",color:t.mutedForeground,background:`color-mix(in srgb, ${t.foreground} 7%, transparent)`,border:`1px solid ${t.border}`,borderRadius:5,padding:"3px 5px 2px"},children:e})}const bm={box:r.jsx("rect",{x:"3",y:"5",width:"14",height:"10",rx:"1"}),circle:r.jsx("ellipse",{cx:"10",cy:"10",rx:"7",ry:"5.5"}),arrow:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 10h13"}),r.jsx("path",{d:"M12 6l4 4-4 4"})]}),bracket:r.jsx("path",{d:"M7 4H4v12h3"}),underline:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M5 8h10",opacity:"0.35"}),r.jsx("path",{d:"M4 14h12"})]}),highlight:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"7",width:"14",height:"6",rx:"1",fill:"currentColor",opacity:"0.3",stroke:"none"}),r.jsx("path",{d:"M5 10h10"})]}),"strike-through":r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M6 6h8",opacity:"0.35"}),r.jsx("path",{d:"M6 14h8",opacity:"0.35"}),r.jsx("path",{d:"M4 10h12"})]}),"crossed-off":r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M4 5l12 10"}),r.jsx("path",{d:"M16 5L4 15"})]})},wm={box:"page_mark_shape_box",circle:"page_mark_shape_circle",arrow:"page_mark_shape_arrow",bracket:"page_mark_shape_bracket",underline:"page_mark_shape_underline",highlight:"page_mark_shape_highlight","strike-through":"page_mark_shape_strike_through","crossed-off":"page_mark_shape_crossed_off"};function vm({draft:e,theme:t,onShapeChange:n,onAttach:o,onDiscard:s}){const{accent:a}=t,{t:i}=G(),[c,u]=d.useState(""),l=d.useRef(null);d.useEffect(()=>{var x;(x=l.current)==null||x.focus()},[]);const m=320,p=window.innerWidth,h=window.innerHeight,{rect:f}=e,b=Math.max(12,Math.min(f.x+f.width/2-m/2,p-m-12)),g=f.y+f.height+16,j=g+120>h?Math.max(12,f.y-116):g;return r.jsxs("div",{"data-opencx-mark-editor":"",style:{position:"fixed",left:b,top:j,width:m,zIndex:t.editorZIndex,pointerEvents:"auto",display:"flex",flexDirection:"column",gap:6,background:`color-mix(in srgb, ${t.surface} 96%, transparent)`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",padding:8,borderRadius:14,boxShadow:`0 0 0 1px ${t.border}, 0 12px 32px color-mix(in srgb, ${t.foreground} 18%, transparent)`,animation:"opencx-mark-editor-in 180ms cubic-bezier(0.23, 1, 0.32, 1)"},children:[r.jsx("div",{style:{display:"flex",gap:2,justifyContent:"space-between"},children:Ep.map(x=>{const S=x===e.shape,w=i(wm[x]);return r.jsx("button",{type:"button",title:w,"aria-label":i("page_mark_shape_aria",{shape:w}),"aria-pressed":S,onClick:()=>n(x),style:{border:"none",cursor:"pointer",borderRadius:8,width:32,height:28,display:"flex",alignItems:"center",justifyContent:"center",background:S?a:"transparent",color:S?t.surface:t.mutedForeground},children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:bm[x]})},x)})}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[r.jsx("input",{ref:l,value:c,onChange:x=>u(x.target.value),onKeyDown:x=>{x.key==="Enter"?(x.preventDefault(),o(c)):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),s())},placeholder:i("page_mark_note_placeholder"),style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",color:t.foreground,font:"500 13px/1.4 system-ui, sans-serif",paddingInlineStart:4}}),r.jsx("button",{type:"button","aria-label":i("page_mark_attach"),onClick:()=>o(c),style:{border:"none",borderRadius:999,width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:a,color:t.surface,font:"600 13px/1 system-ui, sans-serif",cursor:"pointer"},children:"↑"})]})]})}function ym({mark:e,onRemove:t}){var c;const{t:n}=G(),o=hi(e),s=e.note??((c=e.elements[0])==null?void 0:c.name)??n("page_mark_region"),a=n("page_mark_remove",{label:s}),i=e.elements.map(u=>u.name).join(", ");return o?r.jsx(ui,{...P("chat/input_box/page_mark_pill"),className:"group",shape:"tile",src:o,alt:s,title:i,note:e.note,children:r.jsx("button",{type:"button","aria-label":a,className:A("absolute top-1 end-1 rounded-full p-0.5","bg-foreground/60 text-background backdrop-blur-sm","opacity-0 group-hover:opacity-100 focus-visible:opacity-100","transition-opacity active:scale-90"),onClick:t,children:r.jsx(T.XIcon,{className:"size-3"})})}):r.jsxs("div",{...P("chat/input_box/page_mark_pill"),title:i,className:A("group relative size-12 shrink-0 overflow-hidden","flex items-center justify-center","rounded-2xl bg-background ring-1 ring-border"),children:[r.jsx(T.PenLineIcon,{className:"size-4 shrink-0 text-primary"}),r.jsx("span",{className:A("absolute inset-x-0 bottom-0 truncate px-1.5 py-0.5","bg-gradient-to-t from-foreground/70 to-foreground/0","text-[10px] font-medium leading-tight text-background"),children:s}),r.jsx("button",{type:"button","aria-label":a,className:A("absolute top-1 end-1 rounded-full p-0.5","bg-foreground/60 text-background backdrop-blur-sm","opacity-0 group-hover:opacity-100 focus-visible:opacity-100","transition-opacity active:scale-90"),onClick:t,children:r.jsx(T.XIcon,{className:"size-3"})})]})}const Pe={"close-panel":"Escape","toggle-fullscreen":"Mod+Shift+F",send:"Enter","send-alt":"Mod+Enter","history-prev":"ArrowUp","history-next":"ArrowDown"};function Ni(){return typeof navigator>"u"?!1:/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function ht(e,t,n=Ni()){const o=t.split("+"),s=o.at(-1)??"",a=new Set(o.slice(0,-1)),i=a.has("Cmd")||a.has("Mod")&&n,c=a.has("Ctrl")||a.has("Mod")&&!n;return e.metaKey!==i||e.ctrlKey!==c||e.altKey!==a.has("Alt")||e.shiftKey!==a.has("Shift")?!1:e.key.toLowerCase()===s.toLowerCase()}const km={Mod:"⌘",Cmd:"⌘",Ctrl:"⌃",Alt:"⌥",Shift:"⇧"},jm={Escape:"Esc",Enter:"⏎",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→"};function lo(e,t=Ni()){const n=e.split("+"),o=n.at(-1)??"",s=n.slice(0,-1),a=jm[o]??(o.length===1?o.toUpperCase():o);return t?[...s.map(i=>km[i]??i),a].join(""):[...s.map(i=>i==="Mod"?"Ctrl":i),a].join("+")}const Cm=50*1024*1024,_i={"application/pdf":[".pdf"],...Ed,...Td},Sm={"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],..._i},Nm={"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],..._i};function _m({status:e}){switch(e){case"uploading":return r.jsx(T.Loader2,{className:"size-4 animate-spin"});case"error":return r.jsx(T.AlertCircle,{className:"size-4 text-destructive"});default:return null}}function Em({file:e,fileContent:t}){const n=e.type.split("/")[0];return n==="image"&&t?r.jsx("img",{src:typeof t=="string"?t:"",className:"object-cover bg-secondary size-full",alt:e.name}):n==="audio"?r.jsx(T.FileAudio2Icon,{className:"size-4 text-muted-foreground"}):n==="video"?r.jsx(T.FileVideo2Icon,{className:"size-4 text-muted-foreground"}):e.type==="application/pdf"?r.jsx(T.FileText,{className:"size-4 text-muted-foreground"}):Pa({type:e.type,name:e.name})?r.jsx(T.FileSpreadsheet,{className:"size-4 text-muted-foreground"}):r.jsx(T.FileIcon,{className:"size-4 text-muted-foreground"})}function Tm({file:{status:e,file:t,error:n},onCancel:o}){const{t:s}=G(),[a,i]=d.useState(null);return d.useEffect(()=>{if(!t.type.startsWith("image/"))return;const c=new FileReader;return c.onload=()=>i(c.result),c.onerror=()=>Z.log.error("failed to read file for preview"),c.readAsDataURL(t),()=>c.abort()},[t]),r.jsx(Ee,{side:"bottom",content:e==="error"?r.jsx("span",{className:"text-destructive",children:s("upload_failed",{error:n??""})}):t.name,children:r.jsxs("div",{className:A(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(_m,{status:e})}),r.jsx("button",{type:"button",className:A("absolute bg-foreground/50 inset-0 size-full z-10","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:o,"aria-label":s("remove_attachment"),children:r.jsx(T.XIcon,{className:"size-4 text-primary-foreground"})}),r.jsx(Em,{file:t,fileContent:a})]})})}function Am(){const{queuedUserMessages:e,removeQueued:t,stop:n}=k.useAgentChatUi(),{messagesState:{messages:o}}=k.useMessages(),{t:s}=G(),a=d.useMemo(()=>e.filter(i=>!o.some(c=>c.id===i.id)),[e,o]);return r.jsx(W.AnimatePresence,{children:a.length>0&&r.jsx(je,{children:r.jsxs("div",{...P("chat/queued_sends/root"),className:"mb-1 rounded-2xl border border-muted-foreground/15 bg-background shadow-sm",children:[r.jsxs("div",{...P("chat/queued_sends/header"),className:"flex items-center justify-between px-3 pt-2 pb-1",children:[r.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("queued_label",{count:a.length})}),r.jsx("button",{type:"button",...P("chat/queued_sends/send_now"),"aria-label":s("send_queued_now"),title:s("send_queued_now"),onClick:n,className:"rounded-md p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground hover:bg-muted",children:r.jsx(T.CornerDownLeftIcon,{className:"size-3"})})]}),r.jsx("ul",{...P("chat/queued_sends/list"),className:"flex flex-col pb-1",children:a.map(i=>r.jsxs("li",{...P("chat/queued_sends/item"),className:"group flex items-center gap-2 px-3 py-1",children:[r.jsx("button",{type:"button",title:s("send_queued_now"),onClick:n,className:"min-w-0 flex-1 truncate text-start text-xs text-foreground/80 hover:text-foreground",children:i.content}),r.jsx("button",{type:"button",...P("chat/queued_sends/remove"),"aria-label":s("remove_queued_message"),onClick:()=>t(i.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground hover:bg-muted",children:r.jsx(T.XIcon,{className:"size-3.5"})})]},i.id))})]})},"queued-sends-pill")})}function Im({levelRef:e}){const t=d.useRef(null);return d.useEffect(()=>{let n=0;const o=new Z.DictationLevelSmoother({attack:.2,release:.07}),s=[],a=()=>{var c;const i=(c=t.current)==null?void 0:c.children;if(i){const u=o.next(e.current);for(let l=0;l<i.length;l++){const m=i[l];if(m instanceof HTMLElement){const p=.75+.25*Math.sin(Date.now()/260+l*1.7),h=`scaleY(${Math.max(.25,Math.min(1,u*1.8*p)).toFixed(3)})`;s[l]!==h&&(m.style.transform=h,s[l]=h)}}}n=requestAnimationFrame(a)};return n=requestAnimationFrame(a),()=>cancelAnimationFrame(n)},[e]),r.jsx("div",{ref:t,"aria-hidden":"true",className:"flex h-3.5 shrink-0 items-center gap-[3px]",children:[0,1,2,3].map(n=>r.jsx("span",{className:"h-full w-[3px] origin-center scale-y-50 rounded-full bg-current transition-transform duration-100 ease-out"},n))})}function zm({status:e,levelRef:t,onToggle:n,onPrewarm:o}){const{t:s}=G(),a=e==="listening",i=e==="connecting",c=s(a||i?"stop_dictation":"dictate");return r.jsx(Ee,{side:"top",align:"start",content:c,children:r.jsxs(V,{...P("chat/input_box/dictate_btn"),onClick:n,onPointerDown:u=>u.preventDefault(),onPointerEnter:o,onFocus:o,"aria-pressed":a||i,"aria-label":c,size:"fit",variant:"ghost",className:A("relative",vn,a&&Si),children:[i&&r.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0.5 animate-spin rounded-full border-[1.5px] border-current/20 border-t-current"}),r.jsx(W.AnimatePresence,{mode:"wait",children:a?r.jsx(ee,{distance:0,children:r.jsx(Im,{levelRef:t})},"bars"):r.jsx(ee,{distance:0,children:r.jsx(T.MicIcon,{className:A("size-4",i&&"opacity-60")})},"mic")})]})})}function Mm(e,t){const n=e.ownerDocument;if(!n.defaultView)return null;const s=n.createElement("div");Ei(e,s),Object.assign(s.style,{position:"absolute",visibility:"hidden",top:"0",left:"-9999px",height:"auto",overflow:"hidden",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:`${e.clientWidth}px`}),s.textContent=e.value.slice(0,t);const a=n.createElement("span");a.textContent="",s.appendChild(a),n.body.appendChild(s);const i=a.offsetLeft,c=a.offsetTop-e.scrollTop;return s.remove(),{left:i,top:c}}function Ei(e,t){const n=e.ownerDocument.defaultView;if(!n)return;const o=n.getComputedStyle(e);for(const s of Rm)t.style.setProperty(s,o.getPropertyValue(s))}const Rm=["box-sizing","font-family","font-size","font-weight","font-style","letter-spacing","line-height","text-transform","text-indent","word-spacing","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"],Pm=300,Ti=260,Om=8,Ai="rounded-xl border border-border bg-background shadow-lg";function $m({anchorRef:e,inputRef:t,anchorIndex:n,preview:o,groups:s,visible:a,searching:i,highlighted:c,onHighlight:u,onPick:l,onExpand:m}){var S;const{t:p}=G(),[h,f]=d.useState(null);d.useLayoutEffect(()=>{const w=e.current;if(!w)return;const N=w.ownerDocument.defaultView,C=()=>{const _=w.getBoundingClientRect(),R=(N==null?void 0:N.innerWidth)??_.right,z=Math.min(Pm,Math.max(0,R-16)),M=t.current,D=M&&n!==null?Mm(M,n):null,O=M==null?void 0:M.getBoundingClientRect(),U=D&&O?O.left+D.left:_.left+8,E=Math.max(8,Math.min(U,R-8-z)),I=D&&O?O.top+D.top-4:_.top-4;f({left:E,width:z,top:I,detailBeside:o&&E+z+Om+Ti<=R-8})};C(),N==null||N.addEventListener("resize",C);const v=typeof ResizeObserver>"u"?null:new ResizeObserver(C);return v==null||v.observe(w),()=>{N==null||N.removeEventListener("resize",C),v==null||v.disconnect()}},[n,e,t,o,a.length]);const b=(S=e.current)==null?void 0:S.closest("[data-version]");if(!b||!h||a.length===0&&i)return null;const g=a[c],j=g!=null&&g.description?g:null;let x=-1;return Yt.createPortal(r.jsxs("div",{...P("chat/input_box/mention_picker"),style:{position:"fixed",left:h.left,top:h.top,transform:"translateY(-100%)"},className:"z-50 flex items-end gap-2",children:[r.jsx("div",{role:"listbox",style:{width:h.width},className:A("flex max-h-72 flex-col overflow-hidden",Ai),children:r.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-1",children:a.length===0?r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:p("mentions_empty")}):s.map(w=>d.createElement("div",{...P("chat/input_box/mention_picker/group"),key:w.type,role:"group","aria-label":w.type},r.jsx("div",{className:"px-2 pb-0.5 pt-1.5 text-xs capitalize text-muted-foreground",children:w.type}),w.items.map(N=>{const C=++x;return d.createElement("button",{...P("chat/input_box/mention_picker/option"),key:`${N.type}:${N.id}`,type:"button",role:"option","aria-selected":C===c,onMouseDown:v=>v.preventDefault(),onMouseEnter:()=>u(C),onClick:()=>l(N),className:A("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start text-sm",C===c?"bg-muted":"hover:bg-muted/60")},r.jsx(Ii,{item:N}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-foreground",children:N.title}))}),w.hidden>0&&r.jsx("button",{...P("chat/input_box/mention_picker/more"),type:"button",onMouseDown:N=>N.preventDefault(),onClick:()=>m(w.type),className:A("w-full rounded-lg px-2 py-1 text-start text-xs","text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:p("json_see_more",{count:String(w.hidden)})})))})}),j&&h.detailBeside&&r.jsx(Lm,{item:j})]}),b)}function Lm({item:e}){return r.jsxs("div",{...P("chat/input_box/mention_picker/detail"),style:{width:Ti},className:A("flex gap-3 p-3",Ai),children:[r.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted",children:r.jsx(Ii,{item:e,className:"size-4"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block text-[10px] uppercase tracking-wide text-muted-foreground",children:e.type}),r.jsx("span",{className:"block truncate text-sm font-medium text-foreground",children:e.title}),r.jsx("span",{className:"mt-0.5 line-clamp-3 text-xs text-muted-foreground",children:e.description})]})]})}function Ii({item:e,className:t}){return e.icon?r.jsx("img",{src:e.icon,alt:"",className:A("size-4 shrink-0 rounded-sm object-contain",t)}):r.jsx(At,{name:e.iconName??"AtSign",className:A("size-3.5 shrink-0 text-primary",t)})}const zi=d.createContext(null);function Dm({children:e}){const[t,n]=d.useState([]),[o,s]=d.useState(!1),a=d.useRef(new Map),i=d.useCallback(p=>{s(p)},[]),c=d.useCallback((p,h)=>{a.current.set(p,h),n(f=>[...f,p])},[]),u=d.useCallback(p=>{const h=a.current.get(p);h&&(a.current.delete(p),h.undraw()),n(f=>f.filter(b=>b!==p))},[]),l=d.useCallback(()=>{const p=Array.from(a.current.values());a.current.clear();for(const h of p)h.undraw();n([])},[]);d.useEffect(()=>()=>{a.current.forEach(p=>p.remove()),a.current.clear()},[]);const m=d.useMemo(()=>({marks:t,isArmed:o,setArmed:i,attach:c,detach:u,detachAll:l}),[t,o,i,c,u,l]);return r.jsx(zi.Provider,{value:m,children:e})}function uo(){const e=d.useContext(zi);if(!e)throw new Error("usePageMarks must be used within a PageMarksProvider");return e}const Fm="data-opencx-mark-cursor",Hm=5,fn=4,gn=6,Gn={width:160,height:100},Wm=10,Um=no.map(e=>`:not(${e}):not(${e} *)`).join(""),Bm=e=>e==="nw"||e==="se"?"nwse-resize":"nesw-resize";function qm({enabled:e,onAttach:t,accentColor:n,zIndex:o}){const{isArmed:s,setArmed:a,attach:i}=uo(),c=e&&s,[u,l]=d.useState(null),[m,p]=d.useState(null),h=d.useRef(null),f=d.useRef(null);f.current=u;const b=d.useCallback(()=>{var N;(N=h.current)==null||N.undraw(),h.current=null,l(null)},[]),g=d.useCallback(()=>a(!1),[a]),j=d.useCallback(N=>{var C;l(v=>v&&{...v,rect:N}),(C=h.current)==null||C.setRect({x:N.x+window.scrollX,y:N.y+window.scrollY,width:N.width,height:N.height})},[]),x=d.useCallback(N=>{var C;l(v=>v&&{...v,shape:N}),(C=h.current)==null||C.setShape(N)},[]);d.useEffect(()=>{!e&&s&&a(!1)},[e,s,a]),d.useEffect(()=>{if(!c)return;const N=document.createElement("style");N.setAttribute(Fm,"");let C=null;const v=$=>{$!==C&&(C=$,N.textContent=`*${Um} { cursor: ${$} !important; }`)};v("crosshair"),document.head.appendChild(N);let _=null;const R=$=>$.target instanceof Element&&tn($.target),z=$=>R($)?!1:($.preventDefault(),$.stopPropagation(),$.stopImmediatePropagation(),!0),M=($,te,K)=>{const oe=[["nw",$.x,$.y],["ne",$.x+$.width,$.y],["sw",$.x,$.y+$.height],["se",$.x+$.width,$.y+$.height]];for(const[he,le,se]of oe)if(Math.hypot(te-le,K-se)<=Wm)return he;return null},D=($,te,K)=>te>=$.x&&te<=$.x+$.width&&K>=$.y&&K<=$.y+$.height,O=($,te)=>{var le;const K=jr($,te),oe=as(K?(()=>{const se=K.getBoundingClientRect();return{x:se.left-gn,y:se.top-gn,width:se.width+gn*2,height:se.height+gn*2}})():{x:$-Gn.width/2,y:te-Gn.height/2,...Gn}),he=((le=f.current)==null?void 0:le.shape)??"box";p(null),h.current=Ip({x:oe.x+window.scrollX,y:oe.y+window.scrollY,width:oe.width,height:oe.height},he,n,o),l({rect:oe,shape:he})},U=$=>{var oe;if(!z($)||$.button!==0)return;const te=f.current;if(!te){O($.clientX,$.clientY);return}const K=M(te.rect,$.clientX,$.clientY);if(K){_={kind:"resize",corner:K};return}if(D(te.rect,$.clientX,$.clientY)){_={kind:"move",grabX:$.clientX-te.rect.x,grabY:$.clientY-te.rect.y};return}(oe=h.current)==null||oe.undraw(),h.current=null,O($.clientX,$.clientY)};let E=null,I=0;const H=$=>{if(!z($))return;const te=f.current;if(!te){v("crosshair");const ie=jr($.clientX,$.clientY);if(!ie){E=null,p(null);return}ie!==E&&(E=ie,I+=1),p({rect:as($p(ie)),key:I});return}if(!_){const ie=M(te.rect,$.clientX,$.clientY);v(ie?Bm(ie):D(te.rect,$.clientX,$.clientY)?"move":"crosshair");return}const{rect:K}=te;if(_.kind==="move"){j({...K,x:$.clientX-_.grabX,y:$.clientY-_.grabY});return}const oe=_.corner.includes("w")?K.x+K.width:K.x,he=_.corner.includes("n")?K.y+K.height:K.y,le=Math.min(oe,$.clientX),se=Math.max(oe,$.clientX),ne=Math.min(he,$.clientY),Ie=Math.max(he,$.clientY);j({x:le,y:ne,width:Math.max(os,se-le),height:Math.max(os,Ie-ne)})},L=$=>{z($)&&(_=null)},q=$=>{R($)||z($),_=null},X=$=>{z($)},B=$=>{var te;if($.key==="Escape"){if($.preventDefault(),$.stopPropagation(),_=null,f.current){(te=h.current)==null||te.undraw(),h.current=null,l(null),v("crosshair");return}a(!1)}};let F=window.scrollX,J=window.scrollY;const re=()=>{p(null);const $=window.scrollX-F,te=window.scrollY-J;F=window.scrollX,J=window.scrollY,!($===0&&te===0)&&l(K=>K&&{...K,rect:{...K.rect,x:K.rect.x-$,y:K.rect.y-te}})};return document.addEventListener("pointerdown",U,!0),document.addEventListener("pointermove",H,!0),document.addEventListener("pointerup",L,!0),document.addEventListener("pointercancel",q,!0),document.addEventListener("click",X,!0),document.addEventListener("keydown",B,!0),document.addEventListener("scroll",re,!0),()=>{N.remove(),document.removeEventListener("pointerdown",U,!0),document.removeEventListener("pointermove",H,!0),document.removeEventListener("pointerup",L,!0),document.removeEventListener("pointercancel",q,!0),document.removeEventListener("click",X,!0),document.removeEventListener("keydown",B,!0),document.removeEventListener("scroll",re,!0),p(null)}},[c,n,o,j,a]),d.useEffect(()=>{!c&&f.current&&b()},[c,b]),d.useEffect(()=>()=>{var N;(N=h.current)==null||N.remove(),h.current=null},[]);const S=d.useCallback(N=>{if(!e)return;const C=f.current,v=h.current;if(!C||!v)return;const _=N.trim(),R=Vm(C.rect),z={shape:C.shape,..._?{note:_}:{},pageUrl:ro(window.location.href),rect:C.rect,elements:R.map(bi)};Fp(z,R),R[0]&&tp(z,R[0]),h.current=null,l(null),a(!1),i(z,v),t==null||t(z)},[i,e,t,a]),w=d.useCallback(()=>{e&&a(!s)},[e,s,a]);return{isActive:c,draft:u,hover:m,setShape:x,attach:S,dropDraft:b,disarm:g,toggle:w}}function Vm(e){const t=new Set,n=(o,s)=>{const a=jr(o,s);a&&t.add(a)};n(e.x+e.width/2,e.y+e.height/2);for(let o=0;o<=fn;o++)for(let s=0;s<=fn;s++)n(e.x+e.width*o/fn,e.y+e.height*s/fn);return Array.from(t).slice(0,Hm)}function Ym({enabled:e,inputRef:t}){const{widgetCtx:n}=k.useWidget(),{theme:o,cssVars:s}=de(),a=co({cssVars:s,primaryColor:o.primaryColor,contentZIndex:o.widgetContentContainer.zIndex}),{marks:i,detach:c}=uo(),u=d.useCallback(()=>{var p;(p=t.current)==null||p.focus()},[t]),l=d.useCallback(async p=>{if(!n.features.pageContext||!n.features.attachments)return null;try{const{fileUrl:h}=await n.api.uploadFile({file:p,abortSignal:new AbortController().signal});return h??null}catch(h){return Z.log.warn("page mark snapshot upload failed",h),null}},[n]),m=qm({enabled:e,onAttach:u,accentColor:a.accent,zIndex:a.inkZIndex});return{marks:i,detach:c,marking:m,uploadSnapshot:l}}function Xm({inputText:e,setInputText:t,inputRef:n,getSentTextHistory:o}){const s=d.useRef(null),a=d.useRef(""),i=()=>{const p=n.current;p&&(p.classList.remove("opencx-input-recall"),p.offsetWidth,p.classList.add("opencx-input-recall"))},c=(p,{animate:h=!0}={})=>{t(p),h&&i(),requestAnimationFrame(()=>{var f;return(f=n.current)==null?void 0:f.setSelectionRange(p.length,p.length)})};return{onKeyDown:p=>{if(ht(p,Pe["history-prev"])){const h=o();if(h.length===0)return!1;const f=s.current;if(f===null){const b=n.current;if(!((b==null?void 0:b.selectionStart)===0&&(b==null?void 0:b.selectionEnd)===0)&&e!=="")return!1;a.current=e,s.current=h.length-1}else{if(f===0)return!1;s.current=f-1}return p.preventDefault(),c(h[s.current],{animate:!p.repeat}),!0}if(ht(p,Pe["history-next"])){const h=s.current;if(h===null)return!1;p.preventDefault();const f=o();return h>=f.length-1?(s.current=null,c(a.current,{animate:!p.repeat}),a.current=""):(s.current=h+1,c(f[s.current],{animate:!p.repeat})),!0}return!1},onEdit:()=>{s.current=null},onSent:()=>{s.current=null,a.current=""}}}const gs="max-h-16 [field-sizing:content] w-full px-2";function Mi({trailingActions:e,placeholder:t,hideAttachTools:n,disabled:o=!1}={}){var an;const{isSmallScreen:s}=ye(),a=d.useRef(null),i=d.useRef(null),c=d.useRef(null),u=d.useRef(!0),{messagesState:l,rememberSentText:m,getSentTextHistory:p}=k.useMessages(),h=en(),{widgetCtx:f,componentStore:b}=k.useWidget(),{attachments:g,pageContext:j}=f.features,{isStreaming:x,stop:S,queuedUserMessages:w,pendingClarification:N,pendingConnection:C,pendingPageAction:v}=k.useAgentChatUi(),{sessionState:_}=k.useSessions(),R=o||vr({isStreaming:x,messages:l.messages,session:_.session}),z=d.useRef(x);z.current=x;const{t:M}=G(),{text:D,setText:O,clearSubmitted:U}=k.useComposerDraft(),E=fm(),I=hp({text:D,setText:O,inputRef:a}),H=I.picked.length>0;d.useLayoutEffect(()=>{const Y=a.current,fe=c.current;!Y||!fe||Ei(Y,fe)},[H,D]);const[L,q]=d.useState(!1),X=E?`${E.type}:${E.id}`:"";d.useEffect(()=>{q(!1)},[X]);const[B,F]=d.useState(null),J=d.useRef(D);J.current=D;const re=d.useRef(()=>{}),$=k.useDictation({getValue:()=>J.current,setValue:Y=>{J.current=Y,O(Y)},onSend:()=>re.current()}),{stop:te}=$;d.useEffect(()=>{R&&te({executeFinalCommand:!1})},[R,te]),d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const K=Xm({inputText:D,setInputText:O,inputRef:a,getSentTextHistory:p}),oe=j&&!s,he=!R&&oe&&n!==!0,{marks:le,detach:se,marking:ne,uploadSnapshot:Ie}=Ym({enabled:he,inputRef:a});d.useEffect(()=>{j||le.forEach(se)},[j,le,se]);const{allFiles:ie,handleCancelUpload:ue,appendFiles:gt,emptyTheFiles:tt,isUploading:ze,successFiles:He}=k.useUploadFiles();d.useEffect(()=>{!g&&ie.length>0&&tt()},[g,ie.length,tt]);const nt=!!((an=_.session)!=null&&an.isHandedOff),{isAwaitingBotReply:We}=k.useIsAwaitingBotReply(),Oe=f.messageCtx.blocksSendWhileAwaitingReply&&We,Ue=Y=>{R||!g||(F(null),gt(Y))},Be=E!==null&&!L,ge=ie.length>0||le.length>0,Me=!D.trim()&&He.length===0&&(!j||!le.some(wn)),$e=x&&Me,Ln=$e&&w.length>0,rn=R||ze||Oe||Me,xe=()=>{if($.stop({executeFinalCommand:!1}),R||Oe||ze)return;const Y=J.current,fe=f.messageCtx.captureConversation(),Pt=f.messageCtx.draftState.get(),Le=le.filter(be=>f.features.pageContext&&wn(be)?!0:(se(be),!1)),rt=f.features.attachments?[...He]:[];if(!Y.trim()&&rt.length===0&&Le.length===0)return;const Ot=ie.map(be=>be.id);Le.forEach(be=>np(be,Ie)),Promise.all(Le.map(be=>rp(be,Gm))).then(()=>Rt({isCurrentConversation:fe,submittedText:Y,submittedDraft:Pt,submittedMarks:Le,submittedFiles:rt,submittedFileIds:Ot}))},Rt=({isCurrentConversation:Y,submittedText:fe,submittedDraft:Pt,submittedMarks:Le,submittedFiles:rt,submittedFileIds:Ot})=>{if(!Y()||vr({isStreaming:z.current,messages:f.messageCtx.state.get().messages,session:f.sessionCtx.sessionState.get().session}))return;const bt=f.features.pageContext,wt=Le.filter(pe=>bt&&wn(pe)?!0:(se(pe),!1));if(!fe.trim()&&rt.length===0&&wt.length===0)return;const vt=fe.trim()||(wt.length>0?Km(wt)??M("page_mark_default_message"):"");let $t=!1;const cn=I.picked;h({content:vt,withPageEntity:!L,mentions:cn.length>0?cn:void 0,attachments:rt.flatMap(pe=>pe.fileUrl?[{url:pe.fileUrl,type:pe.file.type,name:pe.file.name,id:pe.id,size:pe.file.size}]:[]),clientContext:Ci({marks:wt,readsPage:bt}),onAccepted:()=>{if($t||!Y())return;$t=!0,m(vt),Le.forEach(ot=>se(ot)),Ot.forEach(ot=>ue(ot));const pe=U(Pt);u.current&&(K.onSent(),q(!1),pe&&I.reset())}}).catch(pe=>{Z.log.error("failed to send message",pe)})},{getRootProps:Dn,getInputProps:xt,open:on}=wc.useDropzone({onDrop:Ue,noClick:!0,disabled:R||!g,onDropRejected(){F(M("file_rejected"))},maxSize:Cm,accept:nt?Sm:Nm}),Fn=Y=>{const fe=Y.clipboardData;fe&&fe.files.length>0&&Ue(Array.from(fe.files))};re.current=xe;const sn=b.getComponent("agent_chat_questions");return!C&&N&&sn?r.jsx("div",{...P("chat/input_box/root"),className:"p-2 relative space-y-1",children:r.jsx(sn,{request:N})}):r.jsxs("div",{...P("chat/input_box/root"),className:"p-2 relative space-y-1",...Dn({ref:i}),children:[_.session&&r.jsx(Sp,{sessionId:_.session.id,active:x||We},_.session.id),C&&r.jsx(_p,{request:C},C.request_id),v&&r.jsx(um,{request:v},v.callId),r.jsx("input",{...xt()}),I.isOpen&&r.jsx($m,{anchorRef:i,inputRef:a,anchorIndex:I.anchorIndex,preview:I.preview,groups:I.groups,visible:I.visible,searching:I.searching,highlighted:I.highlighted,onHighlight:I.setHighlighted,onPick:I.pick,onExpand:I.expandGroup}),he&&r.jsx(gm,{isActive:ne.isActive,draft:ne.draft,hover:ne.hover,onShapeChange:ne.setShape,onAttach:ne.attach,onDiscard:ne.dropDraft}),r.jsx(Am,{}),B&&r.jsx("p",{role:"alert",className:"px-2 text-xs text-destructive",children:B}),$.error&&r.jsx("p",{role:"alert",className:"px-2 text-xs text-destructive",children:$.error==="microphone"?M("dictation_mic_blocked"):M("dictation_unavailable")}),r.jsxs("div",{...P("chat/input_box/attached_context_tray"),style:{"--cx-p":"0.25rem"},className:A("flex flex-col","rounded-[calc(var(--opencx-inset-radius)+var(--cx-p))] p-[var(--cx-p)]","transition-colors duration-200 ease-opencx",Be?"bg-muted":"bg-transparent"),children:[r.jsx(W.AnimatePresence,{children:Be&&r.jsx(je,{children:r.jsx("div",{...P("chat/input_box/page_context_container"),className:"flex items-center gap-1 flex-wrap ps-3 pe-1 py-1",children:r.jsx(W.AnimatePresence,{mode:"popLayout",children:E&&!L&&r.jsx(ee,{snapExit:!0,children:r.jsx(mm,{entity:E,onRemove:()=>q(!0)})},"page-entity")})})},"attached-context")}),r.jsxs("div",{...P("chat/input_box/inner_root"),className:A("transition-colors","bg-background","border border-border","relative rounded-[var(--opencx-inset-radius)] flex flex-col gap-2 p-2"),children:[r.jsxs("div",{...P("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[ge&&r.jsx("div",{...P("chat/input_box/attachments_container"),className:"flex items-center gap-1 overflow-x-auto",children:r.jsxs(W.AnimatePresence,{mode:"popLayout",children:[ie.map(Y=>r.jsx(ee,{snapExit:!0,children:r.jsx(Tm,{onCancel:()=>ue(Y.id),file:Y})},Y.id)),le.map((Y,fe)=>r.jsx(ee,{snapExit:!0,children:r.jsx(ym,{mark:Y,onRemove:()=>se(Y)})},`mark-${fe}-${Y.note??""}`))]})}),r.jsxs("div",{className:"relative",children:[H&&r.jsx("div",{ref:c,"aria-hidden":!0,className:A(gs,"pointer-events-none absolute inset-0 overflow-hidden","whitespace-pre-wrap break-words text-foreground",!ge&&"pt-1",s?"text-[16px]":"text-sm"),children:r.jsx(fi,{text:D,mentions:I.picked,tokenClassName:"bg-primary/10 text-primary"})}),r.jsx("textarea",{...P("chat/input_box/textarea"),disabled:R,onPaste:Fn,ref:a,id:"chat-input",value:D,rows:3,className:A(gs,"relative resize-none",!ge&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",H&&"text-transparent caret-foreground",s?"text-[16px]":"text-sm"),onScroll:Y=>{c.current&&(c.current.scrollTop=Y.currentTarget.scrollTop)},onChange:Y=>{K.onEdit(),O(Y.target.value),f.messageCtx.notifyTyping()},onClick:()=>I.onCaretMove("nearest"),onKeyUp:Y=>{Y.key==="ArrowRight"||Y.key==="ArrowDown"?I.onCaretMove("forward"):Y.key==="ArrowLeft"||Y.key==="ArrowUp"?I.onCaretMove("backward"):(Y.key==="Home"||Y.key==="End")&&I.onCaretMove("nearest")},onKeyDown:Y=>{if(!Y.nativeEvent.isComposing&&!I.onKeyDown(Y)){if(ht(Y,Pe.send)||ht(Y,Pe["send-alt"])){Y.preventDefault(),Ln?S():xe();return}if(Y.key==="Escape"&&ne.isActive){ne.disarm();return}K.onKeyDown(Y)}},placeholder:t??M("write_a_message_placeholder")})]})]}),r.jsxs("div",{className:"gap-2 flex justify-between",children:[r.jsx("div",{className:"flex items-center gap-1",children:!R&&!n&&r.jsxs(r.Fragment,{children:[g&&r.jsx(Ee,{side:"top",align:"start",content:M("attach_files"),children:r.jsx(V,{onClick:on,"aria-label":M("attach_files"),size:"fit",variant:"ghost",className:vn,children:r.jsx(W.AnimatePresence,{mode:"wait",children:Oe?r.jsx(ee,{distance:0,children:r.jsx(T.PaperclipIcon,{className:"size-4 opacity-50"})},"paper-clip-disabled"):r.jsx(ee,{distance:0,children:r.jsx(T.PaperclipIcon,{className:"size-4"})},"paper-clip")})})}),$.enabled&&r.jsx(zm,{status:$.status,levelRef:$.levelRef,onToggle:$.toggle,onPrewarm:$.prewarm}),oe&&r.jsx(Ee,{side:"top",align:"start",content:ne.isActive?M("mark_page_active"):M("mark_page"),children:r.jsx(V,{...P("chat/input_box/page_mark_btn"),onClick:ne.toggle,"aria-label":ne.isActive?M("mark_page_active"):M("mark_page"),size:"fit",variant:"ghost",className:A(vn,ne.isActive&&Si),children:r.jsx(T.MousePointerClickIcon,{className:"size-4"})})})]})}),r.jsxs("div",{className:"flex items-center gap-1",children:[e,r.jsx(Ee,{content:M($e?"stop_response":"send_message"),shortcut:$e?void 0:lo(Pe.send),side:"top",align:"end",children:r.jsx(V,{size:"fit",onClick:$e?S:xe,"aria-label":M($e?"stop_response":"send_message"),disabled:R||!$e&&rn,className:vn,children:r.jsx(W.AnimatePresence,{mode:"wait",children:$e?r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.SquareIcon,{className:"size-3 fill-current"})},"stop"):!x&&(Oe||ze)?r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):r.jsx(ee,{snapExit:!0,distance:0,children:r.jsx(T.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})]})]})}const Gm=1500;function Km(e){const t=e.flatMap(n=>{var s;const o=(s=n.note)==null?void 0:s.trim();return o?[o]:[]});return t.length>0?t.join(`
|
|
129
|
+
`):null}function xs(){const{widgetCtx:e}=k.useWidget(),{router:t}=k.useConfig(),{canCreateNewSession:n}=k.useSessions(),{toSessionsScreen:o}=k.useWidgetRouter(),{t:s}=G();return r.jsx(r.Fragment,{children:n||t!=null&&t.chatScreenOnly?r.jsx(V,{onClick:e.resetChat,className:"rounded-2xl w-full",children:s("new_conversation")}):r.jsx(V,{onClick:o,className:"rounded-2xl w-full",children:s("back_to_conversations")})})}function Zm(){const{t:e}=G(),{isCsatRequested:t,isCsatSubmitted:n}=k.useCsat();return r.jsx("div",{className:"p-2",children:r.jsx("div",{className:"p-2 bg-muted rounded-[var(--opencx-inset-radius)]",children:r.jsx(W.AnimatePresence,{mode:"wait",children:t||n?r.jsxs(je,{children:[r.jsx(jp,{}),r.jsx(W.AnimatePresence,{mode:"wait",children:n&&r.jsx(je,{children:r.jsx(xs,{})},"new-conv-or-back-to-convs-button")})]},"csat"):r.jsxs(je,{children:[r.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[r.jsx(T.CircleCheckIcon,{className:"size-4 text-emerald-600"}),r.jsx("h2",{className:"text-sm font-medium",children:e("your_issue_has_been_resolved")})]}),r.jsx(xs,{})]},"session-closed")})})})}function Jm(){var l;const{initialQuestions:e,initialQuestionsPosition:t,thisWasHelpfulOrNot:n}=k.useConfig(),{sessionState:o}=k.useSessions(),{messagesState:s}=k.useMessages(),{isStreaming:a}=k.useAgentChatUi(),i=s.messages.length===0,c=gi(),u=vr({isStreaming:a,messages:s.messages,session:o.session});return r.jsx("footer",{children:r.jsx(W.AnimatePresence,{mode:"wait",children:o.session&&!((l=o.session)!=null&&l.isOpened)?r.jsxs(je,{children:[r.jsx(Zm,{}),r.jsx(yr,{})]},"session-closed"):r.jsxs(je,{children:[s.lastAIResMightSolveUserIssue&&(n==null?void 0:n.enabled)!==!1&&r.jsx(Cp,{}),i&&e&&t!=="below-initial-messages"&&r.jsx("div",{className:A("flex items-center flex-row justify-end gap-2 flex-wrap px-2",c&&"pb-4"),children:e==null?void 0:e.map((m,p)=>r.jsx(Rn,{suggestion:m},`${m}-${p}`))}),!c&&!u&&r.jsx(Mi,{}),r.jsx(yr,{})]},"chat-input")})})}function Qm(){var j;const{messagesState:{messages:e,isAgentTyping:t}}=k.useMessages(),{isAwaitingBotReply:n}=k.useIsAwaitingBotReply(),{componentStore:o}=k.useWidget(),s=k.useBot(),a=d.useMemo(()=>si(e),[e]),i=e.at(-1),c=i==null?void 0:i.id,u=i==null?void 0:i.type,l=d.useRef(c),[m,p]=d.useState(!1),h=n&&!m;d.useEffect(()=>{const x=l.current!==c;if(l.current=c,!n||u!=="AI"){p(!1);return}if(!x)return;p(!0);const S=setTimeout(()=>p(!1),600);return()=>clearTimeout(S)},[n,c,u]);const f=o.getComponent("loading"),b=d.useRef(null);function g(){setTimeout(()=>{const x=b.current;x&&(x.scrollTop=x.scrollHeight)},0)}return d.useEffect(()=>{g()},[e,h,t]),r.jsxs("div",{...P("chat/msgs/root"),ref:b,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[r.jsx(li,{}),r.jsx(ai,{}),r.jsx(di,{}),r.jsx(wr,{groups:a,pendingReply:n}),h&&f&&r.jsx(f,{agent:s}),t&&!h&&f&&r.jsx(f,{agent:(j=e.findLast(x=>x.type==="AGENT"))==null?void 0:j.agent}),r.jsx(oi,{}),r.jsx(ri,{})]})}function eh(){const{messagesState:{isInitialFetchLoading:e}}=k.useMessages(),{widgetCtx:t}=k.useWidget(),n=t.streaming,{sessionState:{session:o}}=k.useSessions(),{isCanvasOpen:s}=Ou(),{theme:a}=de();Mt({width:s?a.screens.chat.withCanvas.width:a.screens.chat.width,height:s?a.screens.chat.withCanvas.height:a.screens.chat.height});const i=d.useRef((o==null?void 0:o.id)||"chat").current;return r.jsx("div",{...P("chat/root"),className:A("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:r.jsxs("div",{className:"relative size-full justify-between flex flex-col",children:[r.jsx(Ja,{}),r.jsx(W.AnimatePresence,{mode:"wait",children:e?r.jsx(ee,{className:"flex flex-col items-center justify-center w-full flex-1",children:r.jsx(Qa,{})},"loading"):r.jsxs(ee,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[r.jsxs("div",{...P("chat/main/root"),className:A("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:a.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:a.screens.chat.withCanvas.transitionDuration},children:[n?r.jsx(vp,{}):r.jsx(Qm,{}),r.jsx(Jm,{})]}),r.jsx("div",{...P("chat/canvas/root"),className:A("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:a.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:a.screens.chat.withCanvas.transitionDuration},children:r.jsx(yp,{})})]},i)})]})})}const Wt=Qe.forwardRef(({className:e,type:t,...n},o)=>{const{isSmallScreen:s}=ye();return r.jsx("input",{ref:o,type:t,className:A(s?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",e),...n})});Wt.displayName="Input";function th({className:e}){return r.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:A("text-primary-foreground",e),children:r.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function nn({className:e}){const{token:t}=k.useConfig();return r.jsx("div",{className:A("flex items-center justify-center gap-2 p-2 pt-0",e),children:r.jsx(Re,{children:r.jsxs("a",{dir:"ltr",href:`https://open.cx/?ref=${t}`,target:"_blank",rel:"noreferrer",className:A("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[r.jsx("span",{children:"Powered by"}),r.jsx("span",{children:" "}),r.jsxs("span",{className:"flex items-center gap-[1px]",children:[r.jsx("span",{children:r.jsx(th,{className:"size-3 inline-block"})}),r.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function lt({className:e,...t}){return r.jsx("div",{className:A("animate-pulse rounded-md bg-secondary",e),...t})}const nh=3;function Ri(e,t){for(const n of e){if(n.id===t)return n;const o=Ri(n.topics,t);if(o)return o}}function rh({articleId:e,siblings:t,popular:n}){const o=new Set([e]),s=[];for(const{id:a,title:i,slug:c}of[...t,...n])if(!o.has(a)&&(o.add(a),s.push({id:a,title:i,slug:c}),s.length===nh))break;return s}const po="w-full justify-between gap-3 rounded-[19px] px-3 py-2.5 text-start whitespace-normal";function ft({title:e,children:t,component:n}){return r.jsxs("section",{...P(n),className:"rounded-3xl border bg-background p-1",children:[e&&r.jsx("p",{className:"px-3 pt-2.5 pb-1 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:e}),r.jsx("div",{className:"flex flex-col",children:t})]})}function Pi({topic:e,onOpen:t}){return r.jsxs(V,{...P("home/topic_row"),variant:"ghost",wobble:!1,size:"free",className:po,onClick:()=>t(e.id),children:[r.jsx(T.FolderIcon,{className:"size-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug [overflow-wrap:anywhere]",children:e.name}),r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.article_count}),r.jsx(T.ChevronRightIcon,{className:"size-4 shrink-0 text-muted-foreground rtl:-scale-100"})]})}function Oi({article:e,onOpen:t}){return r.jsxs(V,{...P("home/article_link"),variant:"ghost",wobble:!1,size:"free",className:po,onClick:()=>t(e.slug),children:[r.jsx("span",{className:"min-w-0 flex-1 text-sm leading-snug [overflow-wrap:anywhere]",children:e.title}),r.jsx(T.ChevronRightIcon,{className:"size-4 shrink-0 text-muted-foreground rtl:-scale-100"})]})}function $i({component:e,onBack:t,children:n}){const{setIsOpen:o}=k.useWidgetTrigger(),{isSmallScreen:s}=ye(),{t:a}=G();return r.jsxs("header",{...P(e),className:"shrink-0 flex items-center gap-2 px-4 py-2 border-b",children:[r.jsx(V,{variant:"ghost",size:"fit",className:"shrink-0 rounded-full","aria-label":a("article_back"),onClick:t,children:r.jsx(T.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})}),n,s&&r.jsx(V,{variant:"ghost",size:"fit",className:"shrink-0 rounded-full",onClick:()=>o(!1),children:r.jsx(T.XIcon,{className:"size-4"})})]})}function _n(){return r.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[r.jsx(lt,{className:"h-4 w-2/3"}),r.jsx(lt,{className:"h-3 w-full"})]})}function Li({onClick:e}){const{t}=G();return r.jsx(V,{...P("home/show_more"),variant:"ghost",wobble:!1,size:"free",className:"w-full justify-center rounded-[19px] px-3 py-2.5 text-sm font-medium text-primary",onClick:e,children:t("home_show_more")})}const bs=99,oh=e=>e?16:9,Di=(e,t)=>e/2*(1-Math.SQRT1_2)-oh(t)/2;function Fi({count:e,showCount:t,component:n="trigger/unread",style:o}){return e<=0?null:r.jsx(W.motion.span,{...P(n),"data-unread-look":t?"count":"dot","aria-hidden":!0,initial:{scale:0},animate:{scale:1},transition:we,style:o,children:t?e>bs?`${bs}+`:e:null})}function sh(){return r.jsx("style",{children:`
|
|
130
130
|
[data-component='trigger/unread'] {
|
|
131
131
|
position: absolute;
|
|
132
132
|
z-index: 1;
|
|
@@ -387,4 +387,4 @@ html[${qt}] body {
|
|
|
387
387
|
</svg>`;const o=e??{x:window.innerWidth-40,y:window.innerHeight-40};let s=o;n.style.transform=`translate(${o.x-yn}px, ${o.y-kn}px)`,document.documentElement.appendChild(t);const a=n.querySelector("path");n.offsetWidth,n.style.opacity="1";let i=!1;const c={async moveTo(u,l){if(i)return;const m=`translate(${u-yn}px, ${l-kn}px)`;if(yo()||typeof n.animate!="function"){n.style.transform=m;return}n.style.transition=`opacity ${tr}ms ease`;const p=og(s,{x:u,y:l});await n.animate(p,{duration:eg,easing:"linear",fill:"forwards"}).finished.catch(()=>{}),!i&&(n.style.transform=m,s={x:u,y:l},await Rs(tg))},async press(){i||!a||(a.style.transform="scale(0.86)",await Rs(zs),a.style.transform="")},release(){i||(i=!0,n.style.opacity="0",window.setTimeout(()=>t.remove(),tr+60))}};return ut=c,Rr(),c}catch{return null}}function cg(e){const t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}async function rc(e,{press:t=!1}={}){var o;const n=ig();if(!n)return{done:()=>{}};try{(o=e.scrollIntoView)==null||o.call(e,{behavior:yo()?"auto":"smooth",block:"center",inline:"nearest"});const{x:s,y:a}=cg(e);await n.moveTo(s,a),t&&await n.press()}catch{}return{done:Rr}}const lg=y.z.object({ref:y.z.string().min(1),action:y.z.enum(Up),value:y.z.string().max(500).optional()});function oc(e,t){const n=d.useRef({effects:e,isStreaming:t});n.current={effects:e,isStreaming:t};const o=d.useRef(!1);return d.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]),d.useCallback(s=>o.current&&n.current.isStreaming&&n.current.effects.some(a=>a.key===s),[])}const dg=200;function ug(){const{widgetCtx:e}=k.useWidget(),{pageEffects:t,replyToPageCall:n,requestPageActionConsent:o,isStreaming:s}=k.useAgentChatUi(),a=d.useRef(new Set),i=oc(t,s);return d.useEffect(()=>{const c=a.current;for(const u of t){if(u.type!=="act-on-page"||c.has(u.key))continue;for(c.add(u.key);c.size>dg;){const f=c.values().next().value;if(f===void 0)break;c.delete(f)}const l=lg.safeParse(u.input);if(!l.success){Z.log.warn("act_on_page: invalid tool input",{issues:l.error.issues}),n(u.callId,"unsupported");continue}const{ref:m,action:p,value:h}=l.data;(async()=>{let f;try{const b=()=>i(u.key)&&e.features.pageContext&&e.features.clientTools&&e.features.pageActions;if(!b()){n(u.callId,"declined");return}const g=ps(m);if(!g){n(u.callId,"gone",void 0,b()?Nr():void 0);return}const j=It(g)||"this control",x=p==="select"?zr(g,h):null;if(p==="select"&&!x){n(u.callId,"no_change","That option is unavailable or ambiguous.");return}const S=x==null?void 0:x.value,w=x==null?void 0:x.label.trim(),N=vi(g),C=()=>b()&&ps(m)===g&&N()&&j===(It(g)||"this control")&&(!x||zr(g,h)===x&&x.value===S&&x.label.trim()===w);if(!await o({callId:u.callId,action:p,controlName:j,...p==="fill"||p==="select"?{value:h}:{},...x?{valueLabel:w||"(empty option)"}:{}})){n(u.callId,"declined");return}if(!C()){n(u.callId,"declined");return}if(f=await rc(g,{press:!0}),!C()){n(u.callId,"declined");return}const _=await Zf({ref:m,action:p,value:h,consentIsCurrent:C,observationIsCurrent:b}),R=b()&&_.outcome!=="declined"&&_.outcome!=="unsupported"?Nr():null;n(u.callId,_.outcome,_.detail,R?{controls:R.controls,truncated:R.truncated}:void 0)}catch{n(u.callId,"unsupported","The page action could not be completed.")}finally{f==null||f.done()}})()}},[t,n,o,e,i]),null}const pg=["circle","box","underline","bracket","arrow"],mg=y.z.object({ref:y.z.string().min(1),label:y.z.string().optional(),type:y.z.enum(pg).optional().catch(void 0)}),hg=8e3;function fg(e,t,n){return t.display==="inline"&&e.height<=n*2.5?"underline":e.width<=220&&e.height<=80?"circle":"box"}let De=null;function gg(){De==null||De()}function xg(e,t,{accentColor:n="hsl(0 0% 9%)",surfaceColor:o="hsl(0 0% 9%)",foregroundColor:s="hsl(0 0% 98%)",zIndex:a=10000002,durationMs:i=hg,seed:c}={}){if(!e.isConnected)return!1;De==null||De();const u=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollIntoView({behavior:u?"auto":"smooth",block:"center",inline:"nearest"});const l=e.getBoundingClientRect(),m=getComputedStyle(e),p=parseFloat(m.fontSize)||16,h=l.width<160&&l.height<56,f=Xs.annotate(e,{type:t.type??fg(l,m,p),color:n,strokeWidth:Math.min(3,Math.max(1.6,p*.11)),wobble:h?.6:.9,rtl:m.direction==="rtl",seed:c});let b=!1;const g=()=>{if(!b)try{f.show(),kr(e,a)}catch(M){Z.log.warn("highlight_element: mark could not be drawn",M)}},j=document.fonts;j!=null&&j.ready&&typeof j.ready.then=="function"?j.ready.then(g):g();const x=document.createElement("div");x.setAttribute("data-opencx-overlay",""),x.style.pointerEvents="none";let S=null,w=null;t.label&&(S=document.createElement("div"),S.setAttribute("data-cx-role","callout"),Object.assign(S.style,{position:"fixed",zIndex:String(a+1),background:o,color:s,font:"500 13px/1.4 system-ui, sans-serif",padding:"9px 13px",borderRadius:"11px",maxWidth:"240px",boxShadow:`0 10px 30px -8px color-mix(in srgb, ${s} 35%, transparent)`,opacity:"0",transform:u?"none":"translateY(4px)",transition:"opacity 280ms cubic-bezier(0.23, 1, 0.32, 1), transform 280ms cubic-bezier(0.23, 1, 0.32, 1)",pointerEvents:"none"}),S.textContent=t.label,w=document.createElement("div"),Object.assign(w.style,{position:"absolute",width:"10px",height:"10px",background:o,transform:"rotate(45deg)"}),S.appendChild(w),x.appendChild(S)),document.documentElement.appendChild(x);let N=0;if(S&&w){const M=S,D=w,O=()=>{const U=e.getBoundingClientRect(),E=window.innerWidth,I=U.top>90?"top":"bottom",H=Math.min(240,M.offsetWidth||240),L=Math.max(12,Math.min(U.left+U.width/2-H/2,E-H-12));M.style.left=`${L}px`,M.style.width=`${H}px`,M.style.top=I==="top"?`${U.top-M.offsetHeight-12}px`:`${U.bottom+12}px`,D.style.left=`${Math.max(10,Math.min(U.left+U.width/2-L-5,H-20))}px`,I==="top"?(D.style.bottom="-4px",D.style.top=""):(D.style.top="-4px",D.style.bottom=""),N=requestAnimationFrame(O)};O()}const C=S?window.setTimeout(()=>{S&&(S.style.opacity="1",S.style.transform="translateY(0)")},350):0,v=()=>{if(!b){b=!0,De===v&&(De=null),cancelAnimationFrame(N),window.clearTimeout(z),window.clearTimeout(C),document.removeEventListener("click",_,!0),document.removeEventListener("keydown",R,!0),S&&(S.style.opacity="0",S.style.transform=u?"none":"translateY(4px)");try{f.hide(),f.finished.then(()=>f.remove())}catch{f.remove()}window.setTimeout(()=>x.remove(),300)}},_=()=>v(),R=M=>{M.key==="Escape"&&v()},z=window.setTimeout(v,Math.max(0,i));return document.addEventListener("click",_,!0),document.addEventListener("keydown",R,!0),De=v,!0}const bg=200;function wg(){const{pageMarkHighlightDurationMs:e}=k.useConfig(),{pageEffects:t,replyToPageCall:n,isStreaming:o}=k.useAgentChatUi(),{widgetCtx:s}=k.useWidget(),a=oc(t,o),{theme:i,cssVars:c}=de(),u=co({cssVars:c,primaryColor:i.primaryColor,contentZIndex:i.widgetContentContainer.zIndex}),l=d.useRef(new Set);return d.useEffect(()=>()=>{gg(),Tn()},[]),d.useEffect(()=>{o||Tn()},[o]),d.useEffect(()=>{const m=l.current;for(const p of t){if(p.type!=="highlight-element"||m.has(p.key))continue;for(m.add(p.key);m.size>bg;){const S=m.values().next().value;if(S===void 0)break;m.delete(S)}const h=()=>a(p.key)&&s.features.pageContext&&s.features.clientTools;if(!h()){n(p.callId,"declined");continue}const f=mg.safeParse(p.input);if(!f.success){Z.log.warn("highlight_element: invalid tool input",{issues:f.error.issues}),n(p.callId,"unsupported");continue}const b=Ir(f.data.ref);if(!b.ok){Z.log.warn("highlight_element: not drawn",{ref:f.data.ref,reason:b.reason}),b.reason==="off-limits"?n(p.callId,"unsupported",b.detail):n(p.callId,b.reason);continue}const g=b.element,j=p.callId,x=f.data;(async()=>{let S;try{if(S=await rc(g),!h()){n(j,"declined");return}const w=Ir(x.ref);if(!w.ok){n(j,w.reason==="off-limits"?"unsupported":w.reason);return}const N=xg(g,x,{accentColor:u.accent,surfaceColor:u.surface,foregroundColor:u.foreground,zIndex:u.inkZIndex,durationMs:e});n(j,N?"done":"gone"),N||Z.log.warn("highlight_element: the mark could not be drawn",x)}catch{n(j,"unsupported","The page highlight could not be completed.")}finally{S==null||S.done()}})()}},[t,n,e,u.accent,u.surface,u.foreground,u.inkZIndex,a,s]),null}const vg=/(\*\*\*|\*\*|\*|~~|`+)(?=\S)([\s\S]*?\S)\1/g,yg=/(^|[^\w`])(___|__|_)(?=\S)([\s\S]*?\S)\2(?!\w)/g,kg=3;function Pr(e){let t=e.replace(/^\s{0,3}(?:```+|~~~+)\S*\s*/,"").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+|\d+[.)]\s+)/,"").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1");for(let n=0;n<kg;n++){const o=t.replace(vg,"$2").replace(yg,"$1$3");if(o===t)break;t=o}return t.trim()}function sc({className:e}){const[t,n]=d.useState(()=>new Set);return d.useEffect(()=>{const o=Array.from({length:9},(a,i)=>i),s=setInterval(()=>{const a=2+Math.floor(Math.random()*3),i=[...o].sort(()=>Math.random()-.5).slice(0,a);n(new Set(i))},110);return()=>clearInterval(s)},[]),r.jsx("div",{className:A("inline-grid shrink-0 grid-cols-3",e),style:{gap:1,width:14,height:14},children:Array.from({length:9},(o,s)=>r.jsx("div",{className:"rounded-[1px]",style:{width:4,height:4,background:t.has(s)?"hsl(var(--opencx-foreground))":"hsl(var(--opencx-border))",transition:"background 66ms ease"}},s))})}function jg({labels:e,active:t}){const n=d.useRef(e);n.current=e;const[o,s]=d.useState(()=>e[e.length-1]??""),[a,i]=d.useState("in"),c=d.useRef(e.length);return d.useEffect(()=>{const u=n.current.length;if(!t||u<=c.current){c.current=u;return}c.current=u;const l=n.current[u-1]??"";i("out");const m=setTimeout(()=>{s(l),i("in")},180);return()=>clearTimeout(m)},[t,e.length]),r.jsx("span",{className:A("truncate text-[12px] text-muted-foreground/60",t&&(a==="in"?"opencx-placeholder-in":"opencx-placeholder-out")),children:o})}function ko(e,t){if(e.kind==="tool")return jo(e.label);const n=e.label.split(`
|
|
388
388
|
`).find(s=>s.trim());if(!n)return t;const o=Pr(n);return o?o.length>40?`${o.slice(0,40)}...`:o:t}function Cg(e,t,n=3){const o=e.filter(s=>s.kind==="tool").map(s=>jo(s.label));if(o.length===0){const s=e.find(a=>a.kind==="reasoning");return s?ko(s,t):t}return o.length<=n?o.join(" → "):`${o.slice(0,n).join(" → ")} → ...`}const Sg=["prose prose-sm max-w-none","[--tw-prose-body:hsl(var(--opencx-muted-foreground))]","[--tw-prose-headings:hsl(var(--opencx-foreground))]","[--tw-prose-bold:hsl(var(--opencx-foreground))]","[--tw-prose-code:hsl(var(--opencx-foreground))]","[--tw-prose-links:hsl(var(--opencx-primary))]","[--tw-prose-bullets:hsl(var(--opencx-muted-foreground))]","[--tw-prose-counters:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quotes:hsl(var(--opencx-muted-foreground))]","[--tw-prose-quote-borders:hsl(var(--opencx-border))]","[--tw-prose-hr:hsl(var(--opencx-border))]","[--tw-prose-pre-bg:hsl(var(--opencx-muted))]","[--tw-prose-pre-code:hsl(var(--opencx-foreground))]","prose-p:my-1 prose-headings:my-1.5 prose-headings:text-[13px]","prose-ul:my-1 prose-ol:my-1 prose-li:my-0.5","prose-pre:my-1.5 prose-pre:p-2 prose-pre:text-[11px] prose-hr:my-2","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"].join(" ");function Ng({step:e,isLive:t,thinkingLabel:n}){const[o,s]=d.useState(!1),a=ko(e,n),i=a!==Pr(e.label),c=t?(()=>{const u=e.label.split(`
|
|
389
389
|
`).filter(m=>m.trim()),l=Pr(u[u.length-1]??"");return l?l.length>80?`${l.slice(0,80)}...`:l:n})():a;return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:A("flex min-w-0 items-center gap-2.5 py-[3px]",i&&"cursor-pointer"),onClick:()=>i&&s(u=>!u),children:[r.jsx("div",{className:"relative z-10 flex size-[18px] shrink-0 items-center justify-center rounded-full bg-background",children:t?r.jsx(to,{className:"text-[14px] leading-none text-primary/70"}):r.jsx("span",{className:"text-[14px] leading-none text-muted-foreground/40",children:"⠿"})}),r.jsx("span",{className:A("min-w-0 truncate text-[13px] italic text-muted-foreground/60",t&&"opencx-text-shimmer"),children:c}),i&&r.jsx(T.ChevronRightIcon,{className:A("size-2.5 shrink-0 text-muted-foreground/40 transition-transform duration-200",o&&"rotate-90")})]}),i&&o&&r.jsx("div",{className:"opencx-fade-up ms-[30px]",children:r.jsx("div",{className:A("max-h-[160px] overflow-y-auto py-1.5 text-[13px] leading-relaxed [overflow-wrap:anywhere]",Sg),children:r.jsx(Ur,{children:e.label})})})]})}const Ps=4e3;function _g(e){const t=typeof e=="string"?e:Eg(e)??String(e);return t.length>Ps?`${t.slice(0,Ps)}…`:t}function Eg(e){try{return JSON.stringify(e,null,2)}catch{return null}}function Os({label:e,value:t}){return r.jsxs("div",{className:"pt-1.5",children:[r.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground/50",children:e}),r.jsx("pre",{className:"mt-0.5 max-h-[200px] overflow-auto whitespace-pre-wrap [overflow-wrap:anywhere] rounded-lg bg-muted/40 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground",children:_g(t)})]})}function Tg({step:e,showIO:t}){const{t:n}=G(),[o,s]=d.useState(!1),a=t&&(e.input!==void 0||e.output!==void 0);return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:A("flex min-w-0 items-center gap-2.5 py-[3px]",a&&"cursor-pointer"),onClick:()=>a&&s(i=>!i),children:[r.jsx("div",{className:"relative z-10 flex size-[18px] shrink-0 items-center justify-center rounded-full bg-background",children:e.done?r.jsx("div",{className:"size-1.5 rounded-full bg-muted-foreground/30"}):r.jsx(sc,{})}),r.jsx("span",{className:A("min-w-0 truncate text-[13px] text-muted-foreground/70",!e.done&&"opencx-text-shimmer"),children:jo(e.label)}),a&&r.jsx(T.ChevronRightIcon,{className:A("size-2.5 shrink-0 text-muted-foreground/40 transition-transform duration-200",o&&"rotate-90")})]}),a&&o&&r.jsxs("div",{className:"opencx-fade-up ms-[30px] pb-1",children:[e.input!==void 0&&r.jsx(Os,{label:n("step_arguments"),value:e.input}),e.output!==void 0&&r.jsx(Os,{label:n("step_result"),value:e.output})]})]})}function Ag({steps:e,active:t}){var b;const{t:n}=G(),{showStepToolIO:o,presentation:s}=k.useConfig(),{widgetCtx:a}=k.useWidget(),i=(b=Z.resolveClientPresentation(a.agent.presentation,s))==null?void 0:b.toolActivity,c=o!==!1&&(i==="details"||i===void 0&&o===!0),u=n("thinking"),l=t?e:e.map(g=>g.done?g:{...g,done:!0}),m=l.some(g=>!g.done),[p,h]=d.useState(t),f=d.useRef(t);return d.useEffect(()=>{f.current&&!t?h(!1):!f.current&&t&&h(!0),f.current=t},[t]),l.length===0?null:r.jsxs("div",{...P("chat/streaming_turn/steps"),className:"w-full min-w-0 overflow-hidden",children:[r.jsx("button",{type:"button",className:"flex min-w-0 max-w-full items-center gap-1.5 py-0.5 text-[12px] text-muted-foreground/60 transition-colors duration-150 hover:text-muted-foreground",onClick:()=>h(g=>!g),children:p?r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronDownIcon,{className:"size-2.5 shrink-0"}),r.jsx("span",{className:"text-[11px] font-medium tabular-nums",children:l.length}),r.jsx("span",{className:A("text-muted-foreground/40",m&&"opencx-text-shimmer"),children:n(m?"running":"steps")})]}):m?r.jsxs(r.Fragment,{children:[r.jsx(sc,{className:"opacity-70"}),r.jsx("span",{className:"text-[11px] font-medium tabular-nums",children:l.length}),r.jsx(jg,{labels:l.map(g=>ko(g,u)),active:m})]}):r.jsxs(r.Fragment,{children:[r.jsx(T.ChevronRightIcon,{className:"size-2.5 shrink-0"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-start text-[12px] text-muted-foreground/50",children:Cg(l,u)})]})}),p&&r.jsxs("div",{className:"relative pt-1",children:[l.length>1&&r.jsx("div",{className:"absolute bottom-3 start-2 top-3 border-s border-dashed border-muted-foreground/20"}),l.map((g,j)=>r.jsx("div",{className:"opencx-fade-up",style:{animationDelay:`${j*40}ms`},children:g.kind==="reasoning"?r.jsx(Ng,{step:g,isLive:m&&j===l.length-1,thinkingLabel:u}):r.jsx(Tg,{step:g,showIO:c})},j))]})]})}function jo(e){const n=e.replace(/^mcp_[a-f0-9]{16}__/,"").replaceAll(/[_-]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function $s(e){var n;if(e.manual){const o=e.manualText.trim();return o.length>0?o:void 0}if(e.question.selection==="single")return e.singleId?(n=e.question.options.find(o=>o.id===e.singleId))==null?void 0:n.label:void 0;const t=Array.from(e.multiIds).map(o=>{var s;return(s=e.question.options.find(a=>a.id===o))==null?void 0:s.label}).filter(o=>typeof o=="string"&&o.length>0);return t.length>0?t.join(", "):void 0}function Ig({request:e}){const{t}=G(),n=en(),{widgetCtx:o}=k.useWidget(),s=e.questions,[a,i]=d.useState(0),[c,u]=d.useState(!1),[l,m]=d.useState({}),[p,h]=d.useState({}),[f,b]=d.useState({}),[g,j]=d.useState({}),x=s[a],S=s.length,w=d.useCallback(O=>$s({question:O,manual:!!l[O.id],manualText:p[O.id]??"",singleId:f[O.id],multiIds:g[O.id]??new Set})!==void 0,[l,p,g,f]),N=x?w(x):!1,C=d.useMemo(()=>s.every(O=>w(O)),[w,s]),v=d.useCallback((O,U)=>{b(E=>({...E,[O]:U})),m(E=>({...E,[O]:!1}))},[]),_=d.useCallback((O,U)=>{j(E=>{const I=new Set(E[O]??[]);return I.has(U)?I.delete(U):I.add(U),{...E,[O]:I}}),m(E=>({...E,[O]:!1}))},[]),R=d.useCallback(O=>{m(U=>({...U,[O]:!0})),b(U=>({...U,[O]:void 0})),j(U=>({...U,[O]:new Set}))},[]),z=d.useCallback(()=>{N&&i(O=>Math.min(S-1,O+1))},[N,S]),M=d.useCallback(()=>{if(c||!C)return;const O=new Map;for(const E of s){const I=$s({question:E,manual:!!l[E.id],manualText:p[E.id]??"",singleId:f[E.id],multiIds:g[E.id]??new Set});I&&O.set(E.id,I)}const U=k.formatAskQuestionsAnswers(e,O);U.trim().length!==0&&(u(!0),n({content:U,clientContext:Ci({marks:[],readsPage:o.features.pageContext})}))},[C,c,l,p,g,s,e,n,f,o]);if(!x)return null;const D=!!l[x.id];return r.jsxs("div",{...P("chat/clarification_questions/root"),className:A("w-full rounded-2xl border border-border bg-background shadow-sm",c&&"pointer-events-none opacity-60"),children:[r.jsxs("div",{className:"flex items-start gap-2.5 px-4 pt-4",children:[r.jsx("span",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground",children:r.jsx(T.SparklesIcon,{className:"size-4"})}),r.jsx("p",{...P("chat/clarification_questions/prompt"),className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground",children:x.prompt})]}),r.jsx("div",{className:"px-4 pb-3 pt-3",children:D?r.jsx("textarea",{...P("chat/clarification_questions/manual_input"),value:p[x.id]??"",onChange:O=>h(U=>({...U,[x.id]:O.target.value})),placeholder:t("questions_answer_placeholder"),rows:3,className:A("w-full resize-none rounded-xl border border-border bg-muted/30 px-3 py-2.5","text-sm text-foreground placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"),onKeyDown:O=>{O.key!=="Enter"||O.shiftKey||(O.preventDefault(),a<S-1?z():M())}}):r.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.options.map(O=>{var E;const U=x.selection==="single"?f[x.id]===O.id:((E=g[x.id])==null?void 0:E.has(O.id))??!1;return d.createElement("button",{...P("chat/clarification_questions/option"),key:O.id,type:"button","aria-pressed":U,onClick:()=>x.selection==="single"?v(x.id,O.id):_(x.id,O.id),className:A("rounded-full border px-3 py-1.5 text-sm transition-colors",U?"border-primary bg-primary/10 text-foreground":"border-border bg-muted/40 text-foreground/90 hover:bg-muted")},O.label)}),r.jsx("button",{...P("chat/clarification_questions/type_it"),type:"button",onClick:()=>R(x.id),className:A("rounded-full border border-dashed border-border px-3 py-1.5 text-sm","text-muted-foreground hover:bg-muted hover:text-foreground"),children:t("questions_type_answer")})]})}),r.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border px-3 py-2",children:[r.jsxs("button",{...P("chat/clarification_questions/back"),type:"button",onClick:()=>i(O=>Math.max(0,O-1)),disabled:a===0,className:"inline-flex items-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground hover:bg-muted disabled:opacity-40",children:[r.jsx(T.ChevronLeftIcon,{className:"size-3.5"}),t("questions_back")]}),S>1?r.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[a+1," / ",S]}):null,a<S-1?r.jsxs("button",{...P("chat/clarification_questions/next"),type:"button",onClick:z,disabled:!N,className:"inline-flex items-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-primary hover:bg-muted disabled:opacity-40",children:[t("questions_next"),r.jsx(T.ChevronRightIcon,{className:"size-3.5"})]}):r.jsx("button",{...P("chat/clarification_questions/send"),type:"button",onClick:M,disabled:!C,className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium text-primary hover:bg-muted disabled:opacity-40",children:t("questions_send")})]}),r.jsx("div",{className:"h-1 w-full overflow-hidden rounded-b-2xl bg-muted",children:r.jsx("div",{className:"h-full bg-primary transition-[width] duration-300 ease-out",style:{width:`${(a+1)/Math.max(1,S)*100}%`}})})]})}function zg({widgetRef:e}){const{contactState:t}=k.useContact(),{setIsOpen:n}=k.useWidgetTrigger(),{toChatScreen:o}=k.useWidgetRouter();return d.useImperativeHandle(e,()=>({newChat:async s=>{var i;if(!((i=t.contact)!=null&&i.token)){Z.log.warn("cannot start a new chat: contact not yet initialized");return}n(!0);const a=o();a&&(s!=null&&s.message)&&await a.messageCtx.sendMessage({content:s.message})}}),[t,n,o]),null}function Mg(){const{isOpen:e,setIsOpen:t}=k.useWidgetTrigger();return r.jsxs(Ge.Root,{open:e,onOpenChange:t,children:[r.jsx(wo,{}),r.jsx(Xh,{}),r.jsx(Yh,{}),r.jsx(Bh,{})]})}function Rg(){return k.useDisplayMode()==="companion"?r.jsx(k.WidgetLayoutProvider,{children:r.jsx(Xf,{})}):r.jsx(Mg,{})}const Pg=[{key:"loading",component:fu},{key:"fallback",component:hu},{key:"bot_message",component:pr},{key:"agent_message",component:pr},{key:"agent_chat_steps",component:Ag},{key:"agent_chat_spec",component:Wu},{key:"agent_chat_questions",component:Ig}],Og={get:async e=>localStorage.getItem(e),set:async(e,t)=>{localStorage.setItem(e,t)},remove:async e=>{localStorage.removeItem(e)}},ac=d.forwardRef(function({options:t,components:n=[],loadingComponent:o,errorComponent:s},a){var i,c,u,l;return r.jsx(W.MotionConfig,{reducedMotion:"user",children:r.jsx(k.WidgetProvider,{components:[...Pg,...n],options:{...t,capabilities:{...t.capabilities,richReplies:((i=t.capabilities)==null?void 0:i.richReplies)??!n.some(({key:m})=>["AGENT_CHAT_SPEC","BOT_MESSAGE","AGENT_MESSAGE"].includes(m.toUpperCase())),connections:((c=t.capabilities)==null?void 0:c.connections)===!0,pageEffects:((u=t.capabilities)==null?void 0:u.pageEffects)??!0,structuredQuestions:((l=t.capabilities)==null?void 0:l.structuredQuestions)??!n.some(({key:m})=>m.toUpperCase()==="AGENT_CHAT_QUESTIONS")}},storage:Og,loadingComponent:o,errorComponent:s,children:r.jsx(uu,{children:r.jsx(k.WidgetTriggerProvider,{children:r.jsxs(Dm,{children:[r.jsx(wg,{}),r.jsx(ug,{}),r.jsx(zg,{widgetRef:a}),t.inline?r.jsxs(r.Fragment,{children:[r.jsx(wo,{}),r.jsx(Yi,{})]}):r.jsx(Rg,{})]})})})})})});ac.displayName="Widget";exports.HostedSpecRenderer=kd;exports.Widget=ac;exports.segmentContent=Ra;exports.useJsonRenderHost=Zt;
|
|
390
|
-
//# sourceMappingURL=index-
|
|
390
|
+
//# sourceMappingURL=index-CcE7410P.cjs.map
|