module.exports=[629173,t=>{"use strict";t.s(["sanitizeSurrogates",0,function(t){return t.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}])},373391,t=>{"use strict";t.s(["adjustMaxTokensForThinking",0,function(t,e,o,n){let i={minimal:1024,low:2048,medium:8192,high:16384,...n}["xhigh"===o?"high":o],r=void 0===t?e:Math.min(t+i,e);return r<=i&&(i=Math.max(0,r-1024)),{maxTokens:r,thinkingBudget:i}},"buildBaseOptions",0,function(t,e,o){return{temperature:e?.temperature,maxTokens:e?.maxTokens,signal:e?.signal,apiKey:o||e?.apiKey,transport:e?.transport,cacheRetention:e?.cacheRetention,sessionId:e?.sessionId,headers:e?.headers,onPayload:e?.onPayload,onResponse:e?.onResponse,timeoutMs:e?.timeoutMs,maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,metadata:e?.metadata}}])},455646,t=>{"use strict";function e(t,e){let o=[],n=!1;for(let i of t){if("image"===i.type){n||o.push({type:"text",text:e}),n=!0;continue}o.push(i),n=i.text===e}return o}t.s(["transformMessages",0,function(t,o,n){let i=new Map,r=(o.input.includes("image")?t:t.map(t=>"user"===t.role&&Array.isArray(t.content)?{...t,content:e(t.content,"(image omitted: model does not support images)")}:"toolResult"===t.role?{...t,content:e(t.content,"(tool image omitted: model does not support images)")}:t)).map(t=>{if("user"===t.role)return t;if("toolResult"===t.role){let e=i.get(t.toolCallId);return e&&e!==t.toolCallId?{...t,toolCallId:e}:t}if("assistant"===t.role){let e=t.provider===o.provider&&t.api===o.api&&t.model===o.id,r=t.content.flatMap(r=>{if("thinking"===r.type)return r.redacted?e?r:[]:e&&r.thinkingSignature?r:r.thinking&&""!==r.thinking.trim()?e?r:{type:"text",text:r.thinking}:[];if("text"===r.type)return e?r:{type:"text",text:r.text};if("toolCall"===r.type){let a=r;if(!e&&r.thoughtSignature&&(a={...r},delete a.thoughtSignature),!e&&n){let e=n(r.id,o,t);e!==r.id&&(i.set(r.id,e),a={...a,id:e})}return a}return r});return{...t,content:r}}return t}),a=[],l=[],s=new Set,u=()=>{if(l.length>0){for(let t of l)s.has(t.id)||a.push({role:"toolResult",toolCallId:t.id,toolName:t.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});l=[],s=new Set}};for(let t=0;t<r.length;t++){let e=r[t];if("assistant"===e.role){if(u(),"error"===e.stopReason||"aborted"===e.stopReason)continue;let t=e.content.filter(t=>"toolCall"===t.type);t.length>0&&(l=t,s=new Set),a.push(e)}else"toolResult"===e.role?s.add(e.toolCallId):"user"===e.role&&u(),a.push(e)}return u(),a}])},857880,t=>{"use strict";t.s(["shortHash",0,function(t){let e=0xdeadbeef,o=0x41c6ce57;for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);e=Math.imul(e^i,0x9e3779b1),o=Math.imul(o^i,0x5f356495)}return e=Math.imul(e^e>>>16,0x85ebca6b)^Math.imul(o^o>>>13,0xc2b2ae35),((o=Math.imul(o^o>>>16,0x85ebca6b)^Math.imul(e^e>>>13,0xc2b2ae35))>>>0).toString(36)+(e>>>0).toString(36)}])}];

//# sourceMappingURL=node_modules_%40earendil-works_pi-ai_dist_02f~ish._.js.map