wi-chat 0.6.0 → 0.6.1
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/core/useChat.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +51 -51
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +1 -1
- package/dist/mobile-ui/index.js +16 -16
- package/dist/parser/answerCom/actionExecute/{parseAgentAction.d.ts → parseHostAction.d.ts} +8 -8
- package/dist/parser/answerCom/actionExecute/types.d.ts +9 -10
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +3 -3
- package/dist/parser/index.js +16 -16
- package/dist/parser/registry.d.ts +3 -3
- package/dist/renderers/{agentAction/AgentActionStatus.vue.d.ts → hostAction/HostActionStatus.vue.d.ts} +3 -3
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/index.js +194 -194
- package/dist/renderers/style.css +1 -1
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +1 -1
- package/dist/web-ui/index.js +5 -5
- package/package.json +1 -1
package/dist/parser/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=()=>({answer_type:"knowledge_stream_result",values:[{answer:""}]}),G=e=>(e.answer_type="knowledge_stream_result",(!Array.isArray(e.values)||!e.values.length)&&(e.values=[{answer:""}]),e),K=(e="",t="")=>({id:e,question:t,answer:{reports:[]}}),Me=["knowledge_stream_begin","knowledge_stream","knowledge_stream_result","knowledge_stream_end"],I=(e,t,n,r)=>{var u;if(!e.mode||!Me.includes(e.mode))return!1;if(e.mode==="knowledge_stream_result"||e.mode==="knowledge_stream_end")return!0;const o=r==null?void 0:r.beforeKnowledgeRender,s=l=>o?o(l):l;if(e.mode==="knowledge_stream_begin"){const l=t.at(-1);return(l==null?void 0:l.answer_type)==="knowledge_stream_result"?(l.values=l.values??[],l.values.push({answer:""}),!0):l&&!l.answer_type?(G(l),!0):(t.push(q()),!0)}if(e.mode!=="knowledge_stream")return!1;let a=t.at(-1);a&&!a.answer_type?a=G(a):(!a||a.answer_type!=="knowledge_stream_result")&&(a=q(),t.push(a)),a.values=(u=a.values)!=null&&u.length?a.values:[{answer:""}];const i=a.values[a.values.length-1],c=`${i.raw??""}${e.value||""}`;return i.raw=c,i.answer=s(c),!0},V=(e,t)=>{if(Array.isArray(e.values)&&e.values.length)return e;const n=t==null?void 0:t.beforeKnowledgeRender,r=s=>n?n(s):s;let o=[];return Array.isArray(e.knowledge)&&(o=e.knowledge.map(s=>typeof s=="string"?s:s==null?void 0:s.answer).filter(s=>typeof s=="string"&&s!=="")),o.length===0&&typeof e.answer=="string"&&e.answer!==""&&(o=[e.answer]),o.length&&(e.values=o.map(s=>({answer:r(s),raw:s}))),e},J={id:"knowledge_stream",answerType:"knowledge_stream_result",applyChunk:I,normalizeReport:V},Z=["begin","begin_stream","send_stream","end_stream"],F=(e,t)=>{if(!Z.includes(e.mode||""))return!1;let n=t.at(-1);return(!n||n.answer_type)&&(n={exec_process:[]},t.push(n)),n.exec_process=n.exec_process??[],n.exec_process.push({mode:e.mode,type:e.type,value:e.value}),!0},Q=e=>{const t=[];let n="",r=!1;for(const o of(e.exec_process??[]).filter(s=>Z.includes(s.mode||""))){const s=typeof o.value=="string"?o.value:"";o.mode==="begin"?(r&&n.trim()&&t.push(n.trim()),r=!1,n="",s.trim()&&t.push(s.trim())):o.mode==="begin_stream"?(r&&n.trim()&&t.push(n.trim()),r=!0,n=s):o.mode==="send_stream"&&r?n+=s:o.mode==="end_stream"&&r&&(n+=s,n.trim()&&t.push(n.trim()),r=!1,n="")}return r&&n.trim()&&t.push(n.trim()),t},$=e=>{var t;return(((t=e.answer)==null?void 0:t.reports)??[]).flatMap(Q)},ee={id:"deep_thinking",applyChunk:F},te='/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n',Ne="iframe-resizer/child 5.1.5",Le=te,C=`<script>${te}<\/script>`,He=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),ne=e=>{if(!e||typeof e!="object")return{};const t=e.values,n=s=>{const a=t&&typeof t=="object"?t[s]:void 0;if(typeof a=="string"&&a)return a;const i=e[s];return typeof i=="string"&&i?i:void 0},r=n("url"),o=n("srcdoc");return{...r?{url:r}:{},...o?{srcdoc:o}:{}}},j=e=>e&&(e.includes("</head>")?e.replace("</head>",`${C}</head>`):e.includes("<body")?e.replace("<body",`${C}<body`):C+e),De=e=>!e||typeof e!="object"||Array.isArray(e)||!e.url&&!e.srcdoc?!1:!e.srcdoc||e.srcdoc.includes(Ne),re=(e,t)=>{if(e.mode!=="result"||He(e.value)!=="url")return!1;const n=ne(e.value);return!n.url&&!n.srcdoc||(n.srcdoc&&(n.srcdoc=j(n.srcdoc)),t.push({answer_type:"url",values:n})),!0},oe=e=>{if(De(e.values))return e;const t=ne(e);return!t.url&&!t.srcdoc||(t.srcdoc&&(t.srcdoc=j(t.srcdoc)),e.values=t),e},se={id:"iframe_page",answerType:"url",applyChunk:re,normalizeReport:oe},z="recordset",Be=["cols","values","chart","title","max_cols","parent_link_col","agent_key"],Ue=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),A=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&(Array.isArray(e.cols)||Array.isArray(e.values)),ae=e=>{if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.values;if(A(t))return t;if(A(e))return e},ie=(e,t)=>{if(e.mode!=="result"||Ue(e.value)!==z)return!1;const n=ae(e.value);return n&&t.push({answer_type:z,values:n}),!0},ce=e=>{if(A(e.values))return e;const t=e;if(!A(t))return e;const n={};for(const r of Be)n[r]=t[r];return e.values=n,e},le={id:"recordset",answerType:z,applyChunk:ie,normalizeReport:ce},w="output_file",We=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),_=(e,t)=>{if(!e||typeof e!="object")return;const n=e[t];return typeof n=="string"&&n?n:void 0},P=e=>{if(!e||typeof e!="object")return{};const t=e.values&&typeof e.values=="object"?e.values:void 0,n=_(t,"file_id")??_(e,"file_id"),r=_(t,"file_name")??_(e,"file_name");return{...n?{file_id:n}:{},...r?{file_name:r}:{}}},ue=(e,t)=>{if(e.mode!=="result"||We(e.value)!==w)return!1;const n=P(e.value);return!n.file_id&&!n.file_name||t.push({answer_type:w,values:n}),!0},de=e=>{const t=P(e);if(!t.file_id&&!t.file_name)return e;const n=e.values&&typeof e.values=="object"&&!Array.isArray(e.values)?e.values:{};return(!t.file_id||n.file_id)&&(!t.file_name||n.file_name)||(e.values={...n,...t}),e},fe={id:w,answerType:w,applyChunk:ue,normalizeReport:de},h=e=>({success:!1,message:e,data:null}),qe=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{throw new Error("执行指令不是合法的 JSON")}},me=e=>{const t=qe(e);if(!t||typeof t!="object")throw new Error("执行指令格式无效");const{type:n,executor:r,action:o}=t;if(n!=="action_execute")throw new Error(`不支持的指令类型:${String(n??"")}`);if(r!=="host"&&r!=="agent")throw new Error(`不支持的执行端:${String(r??"")}`);if(!o||typeof o!="object"||typeof o.name!="string"||!o.name.trim())throw new Error("执行指令缺少合法的 action.name");if(!o.arguments||typeof o.arguments!="object"||Array.isArray(o.arguments))throw new Error("执行指令的 action.arguments 必须是对象");return{type:n,executor:r,action:{name:o.name,arguments:o.arguments}}},pe=(e,t="执行端未返回有效的执行结果")=>{if(!e||typeof e!="object")return h(t);const n=e;return typeof n.success!="boolean"?h("执行端返回的 success 必须是布尔值"):{success:n.success,message:typeof n.message=="string"?n.message:n.success?"操作成功":"操作失败",data:Object.prototype.hasOwnProperty.call(n,"data")?n.data??null:null}},Ge=e=>{if(e&&typeof e=="object"){const t=e;if(typeof t.success=="boolean")return e;if(t.json_ok===!0)return{success:!0,message:"操作成功",data:e};if(t.json_ok===!1)return{success:!1,message:typeof t.error=="string"?t.error:"操作失败",data:e}}return h("系统操作返回了无法识别的报文帧")},Xe=e=>({name:e.name,arguments:e.arguments}),Ye=e=>typeof e.reply_id=="string"||typeof e.reply_id=="number"?e.reply_id:void 0,k=e=>{if((e==null?void 0:e.mode)!=="front_reply")return{kind:"ignored"};const t=Ye(e),n=e.values??e.value;let r=n;if(typeof n=="string")try{r=JSON.parse(n)}catch{return{kind:"ignored"}}if(!r||typeof r!="object"||Array.isArray(r)||r.type!=="action_execute")return{kind:"ignored"};try{return{kind:"ok",replyId:t,command:me(r)}}catch(o){return{kind:"invalid",replyId:t,error:o instanceof Error?o:new Error("执行指令解析失败")}}},Ke=["single_select","multi_select","date","text"],y=new Map;let X=0;const b=e=>!!e&&typeof e=="object"&&!Array.isArray(e),g=e=>typeof e=="string"&&e.trim()?e:void 0,Ve=(e,t)=>{if(!Array.isArray(e)||e.length===0)throw new Error(`确认项 ${t} 缺少可选项`);return e.map((n,r)=>{if(!b(n)||typeof n.label!="string"||!n.label.trim())throw new Error(`确认项 ${t} 的第 ${r+1} 个选项格式无效`);if(!Object.prototype.hasOwnProperty.call(n,"value"))throw new Error(`确认项 ${t} 的第 ${r+1} 个选项缺少 value`);return{label:n.label,value:n.value}})},Je=e=>{if(e===void 0)return;if(!b(e))throw new Error("确认项的 binding 必须是对象");const t={};return typeof e.actionIndex=="number"&&(t.actionIndex=e.actionIndex),typeof e.actionName=="string"&&(t.actionName=e.actionName),typeof e.parameterPath=="string"&&(t.parameterPath=e.parameterPath),t},Ze=(e,t)=>{if(!b(e)||!Ke.includes(e.type))throw new Error(`确认项 ${t} 的 input.type 无效`);const n=e.type,r={type:n,placeholder:g(e.placeholder)};if((n==="single_select"||n==="multi_select")&&(r.options=Ve(e.options,t)),n==="date"){if(e.format!==void 0&&e.format!=="YYYY-MM-DD")throw new Error(`确认项 ${t} 暂不支持日期格式 ${String(e.format)}`);r.format="YYYY-MM-DD"}if(e.textInput!==void 0){if(!b(e.textInput))throw new Error(`确认项 ${t} 的 textInput 必须是对象`);r.textInput={placeholder:g(e.textInput.placeholder)}}return r},ye=e=>{if(!Array.isArray(e.items)||e.items.length===0)throw new Error("collect_clarifications 至少需要一个确认项");const t=new Set,n=e.items.map((r,o)=>{if(!b(r))throw new Error(`第 ${o+1} 个确认项格式无效`);const s=typeof r.id=="string"?r.id.trim():"",a=typeof r.question=="string"?r.question.trim():"";if(!s)throw new Error(`第 ${o+1} 个确认项缺少 id`);if(t.has(s))throw new Error(`确认项 id 重复:${s}`);if(!a)throw new Error(`确认项 ${s} 缺少 question`);return t.add(s),{id:s,question:a,description:g(r.description),required:r.required!==!1,default:r.default,binding:Je(r.binding),input:Ze(r.input,s)}});return{title:g(e.title)??"需要你确认几项信息",description:g(e.description)??"请补充以下信息,我会据此继续完成操作。",items:n}},he=e=>e!==void 0?String(e):(X+=1,`clarification-${Date.now()}-${X}`),ge=e=>{y.set(e.reportId,e)},Fe=e=>y.has(e),O=(e,t)=>{const n=e.reports.findIndex(r=>{var o;return((o=r.values)==null?void 0:o.requestId)===e.reportId});n<0||e.reports.splice(n,1,{...e.reports[n],values:{...e.reports[n].values,...t}})},we=(e,t)=>{var n;if(!e.reply)return!1;try{return e.reply({type:"wait_reply",reply_id:e.replyId,values:t})!==!1}catch(r){return(n=e.onError)==null||n.call(e,r),!1}},Qe=(e,t)=>{const n=y.get(e);if(!n)return!1;y.delete(e);const r=we(n,{success:!0,message:"用户已提交补充信息",data:{answers:t}});return O(n,{status:"submitted",resultMessage:r?"补充信息已提交":"补充信息已提交,但结果回传失败(连接已关闭)",answers:t}),!0},et=e=>{const t=y.get(e);if(!t)return!1;y.delete(e);const n=we(t,{success:!1,message:"用户取消了补充信息",data:null});return O(t,{status:"cancelled",resultMessage:n?"已取消补充信息":"已取消补充信息,但结果回传失败(连接已关闭)"}),!0},tt=()=>{y.forEach(e=>{O(e,{status:"expired",resultMessage:"本次补充信息已失效(回答已结束)"})}),y.clear()},be=(e,t,n)=>{var r;if(!(e!=null&&e.reply))return!1;try{const o={type:"wait_reply",reply_id:t,values:n};return e.reply(o)!==!1}catch(o){return(r=e.onError)==null||r.call(e,o),!1}},ve=(e,t,n)=>{be(e,t,h(n))},x="collect_clarifications",_e=(e,t,n,r)=>{var m;const o=k(e);if(o.kind!=="ok")return!1;const{command:s,replyId:a}=o;if(s.executor!=="host"||s.action.name!=="collect_clarifications")return!1;const i=r==null?void 0:r.actionExecute;let c;try{c=ye(s.action.arguments)}catch(d){return(m=i==null?void 0:i.onError)==null||m.call(i,d),ve(i,a,d instanceof Error?d.message:"确认项参数无效"),!0}const u=he(a),l={requestId:u,...c,status:"pending",resultMessage:""};return ge({reportId:u,replyId:a,reports:t,reply:i==null?void 0:i.reply,onError:i==null?void 0:i.onError}),t.push({answer_type:x,values:l}),!0},ze=e=>{const t=e.values;!t||typeof t!="object"||t.status==="pending"&&(t.status="expired",t.resultMessage="本次补充信息已失效(回答已结束)")},Ae={id:"collect_clarifications",answerType:x,applyChunk:_e,normalizeReport:ze},S="agent_action";let Y=0;const nt=e=>e!==void 0?String(e):(Y+=1,`agent-action-${Date.now()}-${Y}`),rt=(e,t,n)=>{const r=e.findIndex(o=>{var s;return o.answer_type===S&&((s=o.values)==null?void 0:s.id)===t});r<0||e.splice(r,1,{...e[r],values:{...e[r].values,...n}})},ot=async(e,t,n,r,o)=>{var a,i;let s;if(!(o!=null&&o.execute))s=h(`宿主未注入执行器,无法执行:${e.name}`);else try{s=pe(await o.execute(e),`宿主未返回 ${e.name} 的执行结果`)}catch(c){(a=o.onError)==null||a.call(o,c),s=h(c instanceof Error?c.message:`${e.name} 执行失败`)}rt(r,t,{status:s.success?"success":"error",message:s.message,data:s.data??void 0}),be(o,n,s)||(i=o==null?void 0:o.onError)==null||i.call(o,new Error(`${e.name} 已执行,但 wait_reply 回传失败(连接已关闭)`))},Ee=(e,t,n,r)=>{var l;const o=k(e);if(o.kind==="ignored")return!1;const s=r==null?void 0:r.actionExecute;if(o.kind==="invalid")return(l=s==null?void 0:s.onError)==null||l.call(s,o.error),ve(s,o.replyId,o.error.message),!0;const{command:a,replyId:i}=o;if(a.executor!=="agent")return!1;const c=nt(i),u={id:c,name:a.action.name,arguments:a.action.arguments,status:"running",message:"执行中…"};return t.push({answer_type:S,values:u}),ot(a.action,c,i,t,s),!0},Se=e=>{const t=e.values;!t||typeof t!="object"||t.status==="running"&&(t.status="unknown",t.message="执行状态未知(回答已结束)")},Ce={id:"agent_action",answerType:S,applyChunk:Ee,normalizeReport:Se},E=[ee,J,se,le,fe,Ae,Ce],st=e=>{const t=(e==null?void 0:e.parsers)??[];return t.length?[...E,...t]:E},at=(e,t,n)=>{var a;const r=(a=e.answer)==null?void 0:a.reports;if(!r)return[];const o=new Set(((n==null?void 0:n.parsers)??[]).filter(i=>i.applyChunk&&i.answerType).map(i=>i.answerType)),s=[];for(const i of st(n))i.applyChunk&&(E.includes(i)&&i.answerType&&o.has(i.answerType)||i.applyChunk(t,r,e,n)&&s.push(i.id));return s},Re=(e,t)=>{var s;const n=e.answer_type;if(!n)return;const o=((t==null?void 0:t.parsers)??[]).find(a=>a.answerType===n&&!!a.normalizeReport)??E.find(a=>a.answerType===n&&!!a.normalizeReport);(s=o==null?void 0:o.normalizeReport)==null||s.call(o,e,t)},M=(e,t="",n="",r)=>{var a;const o=(e==null?void 0:e.values)??e;if((a=o==null?void 0:o.answer)!=null&&a.reports){const i=o;for(const c of i.answer.reports)Re(c,r);return i}const s=K(t,n);return typeof o=="string"&&I({mode:"knowledge_stream",value:o},s.answer.reports,s,r),s},it={User:"user",Assistant:"assistant"};let ct=0;const N=(e="msg")=>`${e}-${++ct}`,Te=e=>{const t=e.trim();if(!t||t==="[DONE]")return null;const n=t.replace(/^data:\s*/,"");try{return JSON.parse(n)}catch{try{return JSON.parse(decodeURIComponent(n))}catch{return null}}},Ie=()=>{let e="";return{push(t){const n=(e+t).split(`
|
|
2
|
-
`);return e=n.pop()||"",n},flush(){const t=e;return e="",t?[t]:[]}}},$e=30,lt=/[A-Za-z]:[\\/][^\s"'`,。;;、,()()【】\[\]<>|?*]*/g,ut=/\\\\[^\s"'`,。;;、,()()【】\[\]<>|?*]+/g,dt=/(^|[\s"'`((【\[::,,、])((?:\/[^\s"'`,。;;、,()()【】\[\]<>|?*\/]+){2,})/g,ft=/^(?:请帮忙|请帮我|帮我看看|帮我把|帮我|帮忙|请把|麻烦你|麻烦|劳驾|请你|请问|帮(?!助))\s*[::,,、\-—]?\s*/,R=e=>{const t=e.split(/[\\/]+/).filter(Boolean);return t.length?t[t.length-1]:""},mt=e=>e.replace(ut,t=>R(t)).replace(lt,t=>R(t)).replace(dt,(t,n,r)=>n+R(r)),pt=e=>{let t=String(e??"").replace(/\r\n|\r|\n/g," ").replace(/\s+/g," ").trim();if(!t)return"";t=mt(t).replace(/\s+/g," ").trim();let n="";for(;n!==t;)n=t,t=t.replace(ft,"").trim(),t=t.replace(/^[::,,、\-—\s]+/,"").trim();return t.slice(0,$e)},yt=async(e,t)=>{const n=e.getReader(),r=new TextDecoder,o=Ie(),s=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=()=>({answer_type:"knowledge_stream_result",values:[{answer:""}]}),G=e=>(e.answer_type="knowledge_stream_result",(!Array.isArray(e.values)||!e.values.length)&&(e.values=[{answer:""}]),e),K=(e="",t="")=>({id:e,question:t,answer:{reports:[]}}),Me=["knowledge_stream_begin","knowledge_stream","knowledge_stream_result","knowledge_stream_end"],I=(e,t,n,r)=>{var u;if(!e.mode||!Me.includes(e.mode))return!1;if(e.mode==="knowledge_stream_result"||e.mode==="knowledge_stream_end")return!0;const o=r==null?void 0:r.beforeKnowledgeRender,s=l=>o?o(l):l;if(e.mode==="knowledge_stream_begin"){const l=t.at(-1);return(l==null?void 0:l.answer_type)==="knowledge_stream_result"?(l.values=l.values??[],l.values.push({answer:""}),!0):l&&!l.answer_type?(G(l),!0):(t.push(q()),!0)}if(e.mode!=="knowledge_stream")return!1;let i=t.at(-1);i&&!i.answer_type?i=G(i):(!i||i.answer_type!=="knowledge_stream_result")&&(i=q(),t.push(i)),i.values=(u=i.values)!=null&&u.length?i.values:[{answer:""}];const a=i.values[i.values.length-1],c=`${a.raw??""}${e.value||""}`;return a.raw=c,a.answer=s(c),!0},V=(e,t)=>{if(Array.isArray(e.values)&&e.values.length)return e;const n=t==null?void 0:t.beforeKnowledgeRender,r=s=>n?n(s):s;let o=[];return Array.isArray(e.knowledge)&&(o=e.knowledge.map(s=>typeof s=="string"?s:s==null?void 0:s.answer).filter(s=>typeof s=="string"&&s!=="")),o.length===0&&typeof e.answer=="string"&&e.answer!==""&&(o=[e.answer]),o.length&&(e.values=o.map(s=>({answer:r(s),raw:s}))),e},J={id:"knowledge_stream",answerType:"knowledge_stream_result",applyChunk:I,normalizeReport:V},Z=["begin","begin_stream","send_stream","end_stream"],F=(e,t)=>{if(!Z.includes(e.mode||""))return!1;let n=t.at(-1);return(!n||n.answer_type)&&(n={exec_process:[]},t.push(n)),n.exec_process=n.exec_process??[],n.exec_process.push({mode:e.mode,type:e.type,value:e.value}),!0},Q=e=>{const t=[];let n="",r=!1;for(const o of(e.exec_process??[]).filter(s=>Z.includes(s.mode||""))){const s=typeof o.value=="string"?o.value:"";o.mode==="begin"?(r&&n.trim()&&t.push(n.trim()),r=!1,n="",s.trim()&&t.push(s.trim())):o.mode==="begin_stream"?(r&&n.trim()&&t.push(n.trim()),r=!0,n=s):o.mode==="send_stream"&&r?n+=s:o.mode==="end_stream"&&r&&(n+=s,n.trim()&&t.push(n.trim()),r=!1,n="")}return r&&n.trim()&&t.push(n.trim()),t},$=e=>{var t;return(((t=e.answer)==null?void 0:t.reports)??[]).flatMap(Q)},ee={id:"deep_thinking",applyChunk:F},te='/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n',Ne="iframe-resizer/child 5.1.5",He=te,C=`<script>${te}<\/script>`,Le=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),ne=e=>{if(!e||typeof e!="object")return{};const t=e.values,n=s=>{const i=t&&typeof t=="object"?t[s]:void 0;if(typeof i=="string"&&i)return i;const a=e[s];return typeof a=="string"&&a?a:void 0},r=n("url"),o=n("srcdoc");return{...r?{url:r}:{},...o?{srcdoc:o}:{}}},j=e=>e&&(e.includes("</head>")?e.replace("</head>",`${C}</head>`):e.includes("<body")?e.replace("<body",`${C}<body`):C+e),De=e=>!e||typeof e!="object"||Array.isArray(e)||!e.url&&!e.srcdoc?!1:!e.srcdoc||e.srcdoc.includes(Ne),re=(e,t)=>{if(e.mode!=="result"||Le(e.value)!=="url")return!1;const n=ne(e.value);return!n.url&&!n.srcdoc||(n.srcdoc&&(n.srcdoc=j(n.srcdoc)),t.push({answer_type:"url",values:n})),!0},oe=e=>{if(De(e.values))return e;const t=ne(e);return!t.url&&!t.srcdoc||(t.srcdoc&&(t.srcdoc=j(t.srcdoc)),e.values=t),e},se={id:"iframe_page",answerType:"url",applyChunk:re,normalizeReport:oe},z="recordset",Be=["cols","values","chart","title","max_cols","parent_link_col","agent_key"],Ue=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),E=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&(Array.isArray(e.cols)||Array.isArray(e.values)),ie=e=>{if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.values;if(E(t))return t;if(E(e))return e},ae=(e,t)=>{if(e.mode!=="result"||Ue(e.value)!==z)return!1;const n=ie(e.value);return n&&t.push({answer_type:z,values:n}),!0},ce=e=>{if(E(e.values))return e;const t=e;if(!E(t))return e;const n={};for(const r of Be)n[r]=t[r];return e.values=n,e},le={id:"recordset",answerType:z,applyChunk:ae,normalizeReport:ce},w="output_file",We=e=>!e||typeof e!="object"?"":String(e.type||e.answer_type||""),_=(e,t)=>{if(!e||typeof e!="object")return;const n=e[t];return typeof n=="string"&&n?n:void 0},P=e=>{if(!e||typeof e!="object")return{};const t=e.values&&typeof e.values=="object"?e.values:void 0,n=_(t,"file_id")??_(e,"file_id"),r=_(t,"file_name")??_(e,"file_name");return{...n?{file_id:n}:{},...r?{file_name:r}:{}}},ue=(e,t)=>{if(e.mode!=="result"||We(e.value)!==w)return!1;const n=P(e.value);return!n.file_id&&!n.file_name||t.push({answer_type:w,values:n}),!0},de=e=>{const t=P(e);if(!t.file_id&&!t.file_name)return e;const n=e.values&&typeof e.values=="object"&&!Array.isArray(e.values)?e.values:{};return(!t.file_id||n.file_id)&&(!t.file_name||n.file_name)||(e.values={...n,...t}),e},fe={id:w,answerType:w,applyChunk:ue,normalizeReport:de},h=e=>({success:!1,message:e,data:null}),qe=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{throw new Error("执行指令不是合法的 JSON")}},me=e=>{const t=qe(e);if(!t||typeof t!="object")throw new Error("执行指令格式无效");const{type:n,executor:r,action:o}=t;if(n!=="action_execute")throw new Error(`不支持的指令类型:${String(n??"")}`);if(r!=="host"&&r!=="agent")throw new Error(`不支持的执行端:${String(r??"")}`);if(!o||typeof o!="object"||typeof o.name!="string"||!o.name.trim())throw new Error("执行指令缺少合法的 action.name");if(!o.arguments||typeof o.arguments!="object"||Array.isArray(o.arguments))throw new Error("执行指令的 action.arguments 必须是对象");return{type:n,executor:r,action:{name:o.name,arguments:o.arguments}}},pe=(e,t="执行端未返回有效的执行结果")=>{if(!e||typeof e!="object")return h(t);const n=e;return typeof n.success!="boolean"?h("执行端返回的 success 必须是布尔值"):{success:n.success,message:typeof n.message=="string"?n.message:n.success?"操作成功":"操作失败",data:Object.prototype.hasOwnProperty.call(n,"data")?n.data??null:null}},Ge=e=>{if(e&&typeof e=="object"){const t=e;if(typeof t.success=="boolean")return e;if(t.json_ok===!0)return{success:!0,message:"操作成功",data:e};if(t.json_ok===!1)return{success:!1,message:typeof t.error=="string"?t.error:"操作失败",data:e}}return h("系统操作返回了无法识别的报文帧")},Xe=e=>({name:e.name,arguments:e.arguments}),Ye=e=>typeof e.reply_id=="string"||typeof e.reply_id=="number"?e.reply_id:void 0,k=e=>{if((e==null?void 0:e.mode)!=="front_reply")return{kind:"ignored"};const t=Ye(e),n=e.values??e.value;let r=n;if(typeof n=="string")try{r=JSON.parse(n)}catch{return{kind:"ignored"}}if(!r||typeof r!="object"||Array.isArray(r)||r.type!=="action_execute")return{kind:"ignored"};try{return{kind:"ok",replyId:t,command:me(r)}}catch(o){return{kind:"invalid",replyId:t,error:o instanceof Error?o:new Error("执行指令解析失败")}}},Ke=["single_select","multi_select","date","text"],y=new Map;let X=0;const b=e=>!!e&&typeof e=="object"&&!Array.isArray(e),g=e=>typeof e=="string"&&e.trim()?e:void 0,Ve=(e,t)=>{if(!Array.isArray(e)||e.length===0)throw new Error(`确认项 ${t} 缺少可选项`);return e.map((n,r)=>{if(!b(n)||typeof n.label!="string"||!n.label.trim())throw new Error(`确认项 ${t} 的第 ${r+1} 个选项格式无效`);if(!Object.prototype.hasOwnProperty.call(n,"value"))throw new Error(`确认项 ${t} 的第 ${r+1} 个选项缺少 value`);return{label:n.label,value:n.value}})},Je=e=>{if(e===void 0)return;if(!b(e))throw new Error("确认项的 binding 必须是对象");const t={};return typeof e.actionIndex=="number"&&(t.actionIndex=e.actionIndex),typeof e.actionName=="string"&&(t.actionName=e.actionName),typeof e.parameterPath=="string"&&(t.parameterPath=e.parameterPath),t},Ze=(e,t)=>{if(!b(e)||!Ke.includes(e.type))throw new Error(`确认项 ${t} 的 input.type 无效`);const n=e.type,r={type:n,placeholder:g(e.placeholder)};if((n==="single_select"||n==="multi_select")&&(r.options=Ve(e.options,t)),n==="date"){if(e.format!==void 0&&e.format!=="YYYY-MM-DD")throw new Error(`确认项 ${t} 暂不支持日期格式 ${String(e.format)}`);r.format="YYYY-MM-DD"}if(e.textInput!==void 0){if(!b(e.textInput))throw new Error(`确认项 ${t} 的 textInput 必须是对象`);r.textInput={placeholder:g(e.textInput.placeholder)}}return r},ye=e=>{if(!Array.isArray(e.items)||e.items.length===0)throw new Error("collect_clarifications 至少需要一个确认项");const t=new Set,n=e.items.map((r,o)=>{if(!b(r))throw new Error(`第 ${o+1} 个确认项格式无效`);const s=typeof r.id=="string"?r.id.trim():"",i=typeof r.question=="string"?r.question.trim():"";if(!s)throw new Error(`第 ${o+1} 个确认项缺少 id`);if(t.has(s))throw new Error(`确认项 id 重复:${s}`);if(!i)throw new Error(`确认项 ${s} 缺少 question`);return t.add(s),{id:s,question:i,description:g(r.description),required:r.required!==!1,default:r.default,binding:Je(r.binding),input:Ze(r.input,s)}});return{title:g(e.title)??"需要你确认几项信息",description:g(e.description)??"请补充以下信息,我会据此继续完成操作。",items:n}},he=e=>e!==void 0?String(e):(X+=1,`clarification-${Date.now()}-${X}`),ge=e=>{y.set(e.reportId,e)},Fe=e=>y.has(e),O=(e,t)=>{const n=e.reports.findIndex(r=>{var o;return((o=r.values)==null?void 0:o.requestId)===e.reportId});n<0||e.reports.splice(n,1,{...e.reports[n],values:{...e.reports[n].values,...t}})},we=(e,t)=>{var n;if(!e.reply)return!1;try{return e.reply({type:"wait_reply",reply_id:e.replyId,values:t})!==!1}catch(r){return(n=e.onError)==null||n.call(e,r),!1}},Qe=(e,t)=>{const n=y.get(e);if(!n)return!1;y.delete(e);const r=we(n,{success:!0,message:"用户已提交补充信息",data:{answers:t}});return O(n,{status:"submitted",resultMessage:r?"补充信息已提交":"补充信息已提交,但结果回传失败(连接已关闭)",answers:t}),!0},et=e=>{const t=y.get(e);if(!t)return!1;y.delete(e);const n=we(t,{success:!1,message:"用户取消了补充信息",data:null});return O(t,{status:"cancelled",resultMessage:n?"已取消补充信息":"已取消补充信息,但结果回传失败(连接已关闭)"}),!0},tt=()=>{y.forEach(e=>{O(e,{status:"expired",resultMessage:"本次补充信息已失效(回答已结束)"})}),y.clear()},be=(e,t,n)=>{var r;if(!(e!=null&&e.reply))return!1;try{const o={type:"wait_reply",reply_id:t,values:n};return e.reply(o)!==!1}catch(o){return(r=e.onError)==null||r.call(e,o),!1}},ve=(e,t,n)=>{be(e,t,h(n))},x="collect_clarifications",_e=(e,t,n,r)=>{var m;const o=k(e);if(o.kind!=="ok")return!1;const{command:s,replyId:i}=o;if(s.executor!=="agent"||s.action.name!=="collect_clarifications")return!1;const a=r==null?void 0:r.actionExecute;let c;try{c=ye(s.action.arguments)}catch(d){return(m=a==null?void 0:a.onError)==null||m.call(a,d),ve(a,i,d instanceof Error?d.message:"确认项参数无效"),!0}const u=he(i),l={requestId:u,...c,status:"pending",resultMessage:""};return ge({reportId:u,replyId:i,reports:t,reply:a==null?void 0:a.reply,onError:a==null?void 0:a.onError}),t.push({answer_type:x,values:l}),!0},ze=e=>{const t=e.values;!t||typeof t!="object"||t.status==="pending"&&(t.status="expired",t.resultMessage="本次补充信息已失效(回答已结束)")},Ee={id:"collect_clarifications",answerType:x,applyChunk:_e,normalizeReport:ze},S="host_action";let Y=0;const nt=e=>e!==void 0?String(e):(Y+=1,`host-action-${Date.now()}-${Y}`),rt=(e,t,n)=>{const r=e.findIndex(o=>{var s;return o.answer_type===S&&((s=o.values)==null?void 0:s.id)===t});r<0||e.splice(r,1,{...e[r],values:{...e[r].values,...n}})},ot=async(e,t,n,r,o)=>{var i,a;let s;if(!(o!=null&&o.execute))s=h(`宿主未注入执行器,无法执行:${e.name}`);else try{s=pe(await o.execute(e),`宿主未返回 ${e.name} 的执行结果`)}catch(c){(i=o.onError)==null||i.call(o,c),s=h(c instanceof Error?c.message:`${e.name} 执行失败`)}rt(r,t,{status:s.success?"success":"error",message:s.message,data:s.data??void 0}),be(o,n,s)||(a=o==null?void 0:o.onError)==null||a.call(o,new Error(`${e.name} 已执行,但 wait_reply 回传失败(连接已关闭)`))},Ae=(e,t,n,r)=>{var l;const o=k(e);if(o.kind==="ignored")return!1;const s=r==null?void 0:r.actionExecute;if(o.kind==="invalid")return(l=s==null?void 0:s.onError)==null||l.call(s,o.error),ve(s,o.replyId,o.error.message),!0;const{command:i,replyId:a}=o;if(i.executor!=="host")return!1;const c=nt(a),u={id:c,name:i.action.name,arguments:i.action.arguments,status:"running",message:"执行中…"};return t.push({answer_type:S,values:u}),ot(i.action,c,a,t,s),!0},Se=e=>{const t=e.values;!t||typeof t!="object"||t.status==="running"&&(t.status="unknown",t.message="执行状态未知(回答已结束)")},Ce={id:"host_action",answerType:S,applyChunk:Ae,normalizeReport:Se},A=[ee,J,se,le,fe,Ee,Ce],st=e=>{const t=(e==null?void 0:e.parsers)??[];return t.length?[...A,...t]:A},it=(e,t,n)=>{var i;const r=(i=e.answer)==null?void 0:i.reports;if(!r)return[];const o=new Set(((n==null?void 0:n.parsers)??[]).filter(a=>a.applyChunk&&a.answerType).map(a=>a.answerType)),s=[];for(const a of st(n))a.applyChunk&&(A.includes(a)&&a.answerType&&o.has(a.answerType)||a.applyChunk(t,r,e,n)&&s.push(a.id));return s},Re=(e,t)=>{var s;const n=e.answer_type;if(!n)return;const o=((t==null?void 0:t.parsers)??[]).find(i=>i.answerType===n&&!!i.normalizeReport)??A.find(i=>i.answerType===n&&!!i.normalizeReport);(s=o==null?void 0:o.normalizeReport)==null||s.call(o,e,t)},M=(e,t="",n="",r)=>{var i;const o=(e==null?void 0:e.values)??e;if((i=o==null?void 0:o.answer)!=null&&i.reports){const a=o;for(const c of a.answer.reports)Re(c,r);return a}const s=K(t,n);return typeof o=="string"&&I({mode:"knowledge_stream",value:o},s.answer.reports,s,r),s},at={User:"user",Assistant:"assistant"};let ct=0;const N=(e="msg")=>`${e}-${++ct}`,Te=e=>{const t=e.trim();if(!t||t==="[DONE]")return null;const n=t.replace(/^data:\s*/,"");try{return JSON.parse(n)}catch{try{return JSON.parse(decodeURIComponent(n))}catch{return null}}},Ie=()=>{let e="";return{push(t){const n=(e+t).split(`
|
|
2
|
+
`);return e=n.pop()||"",n},flush(){const t=e;return e="",t?[t]:[]}}},$e=30,lt=/[A-Za-z]:[\\/][^\s"'`,。;;、,()()【】\[\]<>|?*]*/g,ut=/\\\\[^\s"'`,。;;、,()()【】\[\]<>|?*]+/g,dt=/(^|[\s"'`((【\[::,,、])((?:\/[^\s"'`,。;;、,()()【】\[\]<>|?*\/]+){2,})/g,ft=/^(?:请帮忙|请帮我|帮我看看|帮我把|帮我|帮忙|请把|麻烦你|麻烦|劳驾|请你|请问|帮(?!助))\s*[::,,、\-—]?\s*/,R=e=>{const t=e.split(/[\\/]+/).filter(Boolean);return t.length?t[t.length-1]:""},mt=e=>e.replace(ut,t=>R(t)).replace(lt,t=>R(t)).replace(dt,(t,n,r)=>n+R(r)),pt=e=>{let t=String(e??"").replace(/\r\n|\r|\n/g," ").replace(/\s+/g," ").trim();if(!t)return"";t=mt(t).replace(/\s+/g," ").trim();let n="";for(;n!==t;)n=t,t=t.replace(ft,"").trim(),t=t.replace(/^[::,,、\-—\s]+/,"").trim();return t.slice(0,$e)},yt=async(e,t)=>{const n=e.getReader(),r=new TextDecoder,o=Ie(),s=i=>{const a=Te(i);a&&t(a)};try{for(;;){const{done:i,value:a}=await n.read();if(i)break;o.push(r.decode(a,{stream:!0})).forEach(s)}o.flush().forEach(s)}catch(i){throw await n.cancel().catch(()=>{}),i}finally{n.releaseLock()}},v=new Set(["png","jpg","jpeg","gif","webp","svg","bmp"]),H=e=>!e||isNaN(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,ht=e=>{var r;if(e.type&&e.type!=="file")return!1;const t=e.attachContent||{};if(t.groupType==="image")return!0;const n=(t.suffix||((r=e.name)!=null&&r.includes(".")?e.name.split(".").pop():"")||"").toLowerCase();return!!(v.has(n)||t.raw&&typeof t.raw.type=="string"&&t.raw.type.startsWith("image/"))},je=(e,t,n)=>e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`${(t||"").replace(/\/$/,"")}${n}?file_id=${e}`,Pe=(e,t="",n)=>e?n?n(e):je(e,t,"/file/download_file"):"",gt=(e,t="",n)=>{const r=e.attachContent||{};return r.url?r.url:typeof r.fileContent=="string"&&r.fileContent.startsWith("data:image/")?r.fileContent:r.fileId?Pe(r.fileId,t,n):""},T=e=>{var a;const t=(e==null?void 0:e.name)||"",n=t.includes(".")&&((a=t.split(".").pop())==null?void 0:a.toLowerCase())||"",r=v.has(n)||(e==null?void 0:e.type)&&typeof e.type=="string"&&e.type.startsWith("image/");let o;if(r&&typeof window<"u"&&typeof URL<"u"&&e instanceof Blob)try{o=URL.createObjectURL(e)}catch{o=void 0}const s=H(e==null?void 0:e.size),i=[n.toUpperCase(),s].filter(Boolean).join(" · ");return{type:"file",name:t,description:i,attachContent:{file_name:t,size:e==null?void 0:e.size,suffix:n,raw:e,url:o,groupType:r?"image":"file"}}},L=e=>{var s;const t=(e==null?void 0:e.file_name)??(e==null?void 0:e.name)??(e==null?void 0:e.title)??"",n=t.includes(".")&&((s=t.split(".").pop())==null?void 0:s.toLowerCase())||"",r=v.has(n)||(e==null?void 0:e.groupType)==="image",o=n?n.toUpperCase():"";return{type:"file",name:t,description:o,attachContent:{file_name:(e==null?void 0:e.file_name)??t,fileId:(e==null?void 0:e.file_id)??(e==null?void 0:e.id),fileContent:e==null?void 0:e.file_content,suffix:n,groupType:r?"image":"file"}}},ke=e=>{var r,o,s,i;const t=(e==null?void 0:e.values)??e,n=((r=t==null?void 0:t.attach)==null?void 0:r.files)??((s=(o=t==null?void 0:t.answer)==null?void 0:o.attach)==null?void 0:s.files)??(t==null?void 0:t.attach_files)??((i=t==null?void 0:t.answer)==null?void 0:i.attach_files)??[];return!Array.isArray(n)||n.length===0?[]:n.map(a=>L(a))},wt=e=>{var r,o;if(!e)return{type:"file",name:"",description:"",attachContent:{}};if(typeof Blob<"u"&&e instanceof Blob)return T(e);if(typeof e=="object"&&e.attachContent){const s=e.type||"file",i=e.name||e.attachContent.file_name||e.attachContent.name||"";let a=e.description||"";const c={...e.attachContent};if(s==="file"&&(!c.suffix&&i.includes(".")&&(c.suffix=((r=i.split(".").pop())==null?void 0:r.toLowerCase())||""),(c.groupType==="image"||c.suffix&&v.has(c.suffix.toLowerCase())||c.raw&&typeof c.raw.type=="string"&&c.raw.type.startsWith("image/"))&&(c.groupType="image"),!a)){const l=typeof c.size=="number"?H(c.size):c.size||"";a=[c.suffix?c.suffix.toUpperCase():"",l].filter(Boolean).join(" · ")}return{...e,type:s,name:i,description:a,attachContent:c}}if(e.file_id||e.fileId)return L(e);if(e.raw&&typeof Blob<"u"&&e.raw instanceof Blob){const s=T(e.raw);return{...s,...e,attachContent:{...s.attachContent,...e.attachContent}}}const t=e.name||e.title||"",n=t.includes(".")&&((o=t.split(".").pop())==null?void 0:o.toLowerCase())||"";return{type:e.type||"file",name:t,description:e.description||(n?n.toUpperCase():""),attachContent:{file_name:t,suffix:n,...e}}},D=e=>ke(e),bt=async e=>[...(await e.getHistoryGroups()).groups??[]].sort((r,o)=>String(o.create_time??"").localeCompare(String(r.create_time??""))),vt=async(e,t)=>{const n=await e.createHistoryGroup(t),r=(n==null?void 0:n.group_id)??(n==null?void 0:n.history_group_id)??"";if(!r)throw new Error("创建对话分组失败");return r},_t=(e,t)=>e.deleteHistoryGroup(t),zt=(e,t,n)=>e.setHistoryGroupTitle(t,n),Oe=5,xe=async(e,t,n)=>{const r=new Array(e.length);let o=0;const s=Array.from({length:Math.min(t,e.length)},async()=>{for(;o<e.length;){const i=o++;r[i]=await n(e[i],i)}});return await Promise.all(s),r},Et=async(e,t,n=10,r=0,o)=>{if(!t)return[];const i=[...await e.getHistoryDetail(t,r,n)].sort((u,l)=>String(u.create_time||"").localeCompare(String(l.create_time||""))),a=await xe(i,Oe,async u=>{try{return await e.getHistoryAnswer(u.history_id||"")}catch{return null}}),c=[];return i.forEach((u,l)=>{const m=u.history_id||N("h"),d=a[l],f=d!=null?D(d):[];if(c.push({id:m,historyId:u.history_id,role:"user",content:u.question??"",attachments:f.length>0?f:void 0}),d!=null){const p=M(d,m,u.question??"",o);c.push({id:`${m}-answer`,historyId:u.history_id,role:"assistant",answer:p,error:!1,stopped:!1,thinking:{steps:$(p),expanded:!1}})}}),c},At=async(e,t,n=10,r,o=0,s)=>{if(!t)return r==null||r({type:"users",users:[]}),[];const a=[...await e.getHistoryDetail(t,o,n)].sort((d,f)=>String(d.create_time||"").localeCompare(String(f.create_time||""))),c=a.map(d=>d.history_id||N("h")),u=a.map((d,f)=>({id:c[f],historyId:d.history_id,role:"user",content:d.question??""}));r==null||r({type:"users",users:u});const l=new Array(a.length).fill(null);await xe(a,Oe,async(d,f)=>{let p=null;try{p=await e.getHistoryAnswer(d.history_id||"")}catch{p=null}if(p==null)return;const B=D(p);B.length>0&&(u[f].attachments=B);const U=M(p,c[f],d.question??"",s),W={id:`${c[f]}-answer`,historyId:d.history_id,role:"assistant",answer:U,error:!1,stopped:!1,thinking:{steps:$(U),expanded:!1}};l[f]=W,r==null||r({type:"assistant",index:f,user:u[f],assistant:W})});const m=[];return a.forEach((d,f)=>{m.push(u[f]);const p=l[f];p&&m.push(p)}),m};exports.CHAT_TITLE_MAX_LENGTH=$e;exports.COLLECT_CLARIFICATIONS_ANSWER_TYPE=x;exports.HOST_ACTION_ANSWER_TYPE=S;exports.IFRAME_RESIZER_CHILD_SCRIPT=He;exports.IMAGE_EXTENSIONS=v;exports.OUTPUT_FILE_ANSWER_TYPE=w;exports.RECORDSET_ANSWER_TYPE=z;exports.RoleEnum=at;exports.applyAnswerChunk=it;exports.applyCollectClarificationsChunk=_e;exports.applyDeepThinkingChunk=F;exports.applyHostActionChunk=Ae;exports.applyIframePageChunk=re;exports.applyKnowledgeStreamChunk=I;exports.applyOutputFileChunk=ue;exports.applyRecordsetChunk=ae;exports.buildChatTitle=pt;exports.cancelClarification=et;exports.clearPendingClarifications=tt;exports.collectClarificationsParser=Ee;exports.collectDeepThinkingSteps=Q;exports.collectThinkingSteps=$;exports.consumeStream=yt;exports.createEmptyAnswerValues=K;exports.createFailureResult=h;exports.createHistoryGroup=vt;exports.createLineSplitter=Ie;exports.deepThinkingParser=ee;exports.deleteHistoryGroup=_t;exports.extractAttachmentsFromHistory=D;exports.extractHistoryAttachments=ke;exports.formatFileSize=H;exports.getHistoryGroups=bt;exports.hasPendingClarification=Fe;exports.hostActionParser=Ce;exports.iframePageParser=se;exports.injectIframeResizerScript=j;exports.isImageAttachment=ht;exports.knowledgeStreamParser=J;exports.loadGroupMessages=Et;exports.loadGroupMessagesByStep=At;exports.nextClarificationRequestId=he;exports.nextLocalMessageId=N;exports.normalizeActionDefinition=Xe;exports.normalizeActionResult=pe;exports.normalizeAnswer=M;exports.normalizeAnswerReport=Re;exports.normalizeAttachment=wt;exports.normalizeCollectClarificationsReport=ze;exports.normalizeHostActionReport=Se;exports.normalizeIframePageReport=oe;exports.normalizeKnowledgeStreamReport=V;exports.normalizeOutputFileReport=de;exports.normalizeRecordsetReport=ce;exports.outputFileParser=fe;exports.parseActionExecuteCommand=me;exports.parseClarificationArguments=ye;exports.parseHistoryAttachment=L;exports.parseRealtimeAttachment=T;exports.parseSseLine=Te;exports.readFrontReplyAction=k;exports.readOutputFilePayload=P;exports.readRecordsetPayload=ie;exports.recordsetParser=le;exports.registerClarification=ge;exports.resolveAttachDownloadUrl=Pe;exports.resolveAttachPreviewUrl=gt;exports.resolveRemoteFileUrl=je;exports.setHistoryGroupTitle=zt;exports.submitClarification=Qe;exports.wrapActionFrame=Ge;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* - `./answerCom/recordset`:记录集表格(applyRecordsetChunk / normalizeRecordsetReport / types)
|
|
17
17
|
* - `./answerCom/outputFile`:输出文件(applyOutputFileChunk / normalizeOutputFileReport / types)
|
|
18
18
|
* - `./answerCom/actionExecute`:front_reply 内的 action_execute 指令——
|
|
19
|
-
*
|
|
19
|
+
* agent 端 collect_clarifications(确认卡片)/ host 端命令执行过程(进度卡片)
|
|
20
20
|
* - `./deepThinking`:思考(applyDeepThinkingChunk / collectDeepThinkingSteps / types)
|
|
21
21
|
* - `./history`:历史分组与会话的业务逻辑(依赖 wi-chat-request)
|
|
22
22
|
*
|
|
@@ -44,12 +44,12 @@ export type { RecordsetColumn, RecordsetValue } from './answerCom/recordset/type
|
|
|
44
44
|
export { OUTPUT_FILE_ANSWER_TYPE, readOutputFilePayload, applyOutputFileChunk, normalizeOutputFileReport, outputFileParser } from './answerCom/outputFile/parseOutputFile';
|
|
45
45
|
export type { OutputFileValue } from './answerCom/outputFile/types';
|
|
46
46
|
export { COLLECT_CLARIFICATIONS_ANSWER_TYPE, applyCollectClarificationsChunk, normalizeCollectClarificationsReport, collectClarificationsParser } from './answerCom/actionExecute/parseCollectClarifications';
|
|
47
|
-
export {
|
|
47
|
+
export { HOST_ACTION_ANSWER_TYPE, applyHostActionChunk, normalizeHostActionReport, hostActionParser } from './answerCom/actionExecute/parseHostAction';
|
|
48
48
|
export { createFailureResult, normalizeActionResult, parseActionExecuteCommand, wrapActionFrame, normalizeActionDefinition, readFrontReplyAction } from './answerCom/actionExecute/actionProtocol';
|
|
49
49
|
export type { FrontReplyActionResult } from './answerCom/actionExecute/actionProtocol';
|
|
50
50
|
export { parseClarificationArguments, nextClarificationRequestId, registerClarification, hasPendingClarification, submitClarification, cancelClarification, clearPendingClarifications } from './answerCom/actionExecute/clarification';
|
|
51
51
|
export type { ParsedClarificationArguments } from './answerCom/actionExecute/clarification';
|
|
52
|
-
export type { ActionExecutor, ActionDefinition, ActionExecuteCommand, ActionResult, WaitReplyPayload, ActionExecuteOptions,
|
|
52
|
+
export type { ActionExecutor, ActionDefinition, ActionExecuteCommand, ActionResult, WaitReplyPayload, ActionExecuteOptions, HostActionState, HostActionValue, ClarificationInputType, ClarificationAnswerMode, ClarificationOption, ClarificationBinding, ClarificationInput, ClarificationItem, ClarificationAnswer, ClarificationStatus, ClarificationViewModel, } from './answerCom/actionExecute/types';
|
|
53
53
|
export { applyDeepThinkingChunk, collectDeepThinkingSteps, collectThinkingSteps, deepThinkingParser } from './deepThinking/parseDeepThinking';
|
|
54
54
|
export type { ExecProcessItem } from './deepThinking/types';
|
|
55
55
|
export { extractAttachmentsFromHistory, getHistoryGroups, createHistoryGroup, deleteHistoryGroup, setHistoryGroupTitle, loadGroupMessages, loadGroupMessagesByStep } from './history';
|
package/dist/parser/index.js
CHANGED
|
@@ -53,13 +53,13 @@ const x = () => ({
|
|
|
53
53
|
o.mode === "begin" ? (r && n.trim() && t.push(n.trim()), r = !1, n = "", s.trim() && t.push(s.trim())) : o.mode === "begin_stream" ? (r && n.trim() && t.push(n.trim()), r = !0, n = s) : o.mode === "send_stream" && r ? n += s : o.mode === "end_stream" && r && (n += s, n.trim() && t.push(n.trim()), r = !1, n = "");
|
|
54
54
|
}
|
|
55
55
|
return r && n.trim() && t.push(n.trim()), t;
|
|
56
|
-
},
|
|
56
|
+
}, H = (e) => {
|
|
57
57
|
var t;
|
|
58
58
|
return (((t = e.answer) == null ? void 0 : t.reports) ?? []).flatMap(ae);
|
|
59
59
|
}, ce = {
|
|
60
60
|
id: "deep_thinking",
|
|
61
61
|
applyChunk: ie
|
|
62
|
-
}, H = '/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n', le = "iframe-resizer/child 5.1.5", st = H, S = `<script>${H}<\/script>`, ue = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), B = (e) => {
|
|
62
|
+
}, D = '/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n', le = "iframe-resizer/child 5.1.5", st = D, S = `<script>${D}<\/script>`, ue = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), B = (e) => {
|
|
63
63
|
if (!e || typeof e != "object")
|
|
64
64
|
return {};
|
|
65
65
|
const t = e.values, n = (s) => {
|
|
@@ -375,7 +375,7 @@ const w = (e) => !!e && typeof e == "object" && !Array.isArray(e), g = (e) => ty
|
|
|
375
375
|
if (o.kind !== "ok")
|
|
376
376
|
return !1;
|
|
377
377
|
const { command: s, replyId: i } = o;
|
|
378
|
-
if (s.executor !== "
|
|
378
|
+
if (s.executor !== "agent" || s.action.name !== "collect_clarifications")
|
|
379
379
|
return !1;
|
|
380
380
|
const a = r == null ? void 0 : r.actionExecute;
|
|
381
381
|
let c;
|
|
@@ -405,9 +405,9 @@ const w = (e) => !!e && typeof e == "object" && !Array.isArray(e), g = (e) => ty
|
|
|
405
405
|
answerType: Y,
|
|
406
406
|
applyChunk: Me,
|
|
407
407
|
normalizeReport: Ne
|
|
408
|
-
}, R = "
|
|
408
|
+
}, R = "host_action";
|
|
409
409
|
let P = 0;
|
|
410
|
-
const
|
|
410
|
+
const He = (e) => e !== void 0 ? String(e) : (P += 1, `host-action-${Date.now()}-${P}`), De = (e, t, n) => {
|
|
411
411
|
const r = e.findIndex((o) => {
|
|
412
412
|
var s;
|
|
413
413
|
return o.answer_type === R && ((s = o.values) == null ? void 0 : s.id) === t;
|
|
@@ -427,7 +427,7 @@ const De = (e) => e !== void 0 ? String(e) : (P += 1, `agent-action-${Date.now()
|
|
|
427
427
|
} catch (c) {
|
|
428
428
|
(i = o.onError) == null || i.call(o, c), s = h(c instanceof Error ? c.message : `${e.name} 执行失败`);
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
De(r, t, {
|
|
431
431
|
status: s.success ? "success" : "error",
|
|
432
432
|
message: s.message,
|
|
433
433
|
data: s.data ?? void 0
|
|
@@ -441,9 +441,9 @@ const De = (e) => e !== void 0 ? String(e) : (P += 1, `agent-action-${Date.now()
|
|
|
441
441
|
if (o.kind === "invalid")
|
|
442
442
|
return (l = s == null ? void 0 : s.onError) == null || l.call(s, o.error), V(s, o.replyId, o.error.message), !0;
|
|
443
443
|
const { command: i, replyId: a } = o;
|
|
444
|
-
if (i.executor !== "
|
|
444
|
+
if (i.executor !== "host")
|
|
445
445
|
return !1;
|
|
446
|
-
const c =
|
|
446
|
+
const c = He(a), u = {
|
|
447
447
|
id: c,
|
|
448
448
|
name: i.action.name,
|
|
449
449
|
arguments: i.action.arguments,
|
|
@@ -455,7 +455,7 @@ const De = (e) => e !== void 0 ? String(e) : (P += 1, `agent-action-${Date.now()
|
|
|
455
455
|
const t = e.values;
|
|
456
456
|
!t || typeof t != "object" || t.status === "running" && (t.status = "unknown", t.message = "执行状态未知(回答已结束)");
|
|
457
457
|
}, qe = {
|
|
458
|
-
id: "
|
|
458
|
+
id: "host_action",
|
|
459
459
|
answerType: R,
|
|
460
460
|
applyChunk: Ue,
|
|
461
461
|
normalizeReport: We
|
|
@@ -706,7 +706,7 @@ const J = (e = "msg") => `${e}-${++Ve}`, Ye = (e) => {
|
|
|
706
706
|
answer: p,
|
|
707
707
|
error: !1,
|
|
708
708
|
stopped: !1,
|
|
709
|
-
thinking: { steps:
|
|
709
|
+
thinking: { steps: H(p), expanded: !1 }
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
}), c;
|
|
@@ -739,7 +739,7 @@ const J = (e = "msg") => `${e}-${++Ve}`, Ye = (e) => {
|
|
|
739
739
|
answer: I,
|
|
740
740
|
error: !1,
|
|
741
741
|
stopped: !1,
|
|
742
|
-
thinking: { steps:
|
|
742
|
+
thinking: { steps: H(I), expanded: !1 }
|
|
743
743
|
};
|
|
744
744
|
l[f] = j, r == null || r({
|
|
745
745
|
type: "assistant",
|
|
@@ -756,19 +756,18 @@ const J = (e = "msg") => `${e}-${++Ve}`, Ye = (e) => {
|
|
|
756
756
|
}), m;
|
|
757
757
|
};
|
|
758
758
|
export {
|
|
759
|
-
R as AGENT_ACTION_ANSWER_TYPE,
|
|
760
759
|
Je as CHAT_TITLE_MAX_LENGTH,
|
|
761
760
|
Y as COLLECT_CLARIFICATIONS_ANSWER_TYPE,
|
|
761
|
+
R as HOST_ACTION_ANSWER_TYPE,
|
|
762
762
|
st as IFRAME_RESIZER_CHILD_SCRIPT,
|
|
763
763
|
E as IMAGE_EXTENSIONS,
|
|
764
764
|
_ as OUTPUT_FILE_ANSWER_TYPE,
|
|
765
765
|
C as RECORDSET_ANSWER_TYPE,
|
|
766
766
|
mt as RoleEnum,
|
|
767
|
-
qe as agentActionParser,
|
|
768
|
-
Ue as applyAgentActionChunk,
|
|
769
767
|
ft as applyAnswerChunk,
|
|
770
768
|
Me as applyCollectClarificationsChunk,
|
|
771
769
|
ie as applyDeepThinkingChunk,
|
|
770
|
+
Ue as applyHostActionChunk,
|
|
772
771
|
fe as applyIframePageChunk,
|
|
773
772
|
N as applyKnowledgeStreamChunk,
|
|
774
773
|
ze as applyOutputFileChunk,
|
|
@@ -778,7 +777,7 @@ export {
|
|
|
778
777
|
dt as clearPendingClarifications,
|
|
779
778
|
Le as collectClarificationsParser,
|
|
780
779
|
ae as collectDeepThinkingSteps,
|
|
781
|
-
|
|
780
|
+
H as collectThinkingSteps,
|
|
782
781
|
yt as consumeStream,
|
|
783
782
|
ne as createEmptyAnswerValues,
|
|
784
783
|
h as createFailureResult,
|
|
@@ -791,6 +790,7 @@ export {
|
|
|
791
790
|
Z as formatFileSize,
|
|
792
791
|
bt as getHistoryGroups,
|
|
793
792
|
ct as hasPendingClarification,
|
|
793
|
+
qe as hostActionParser,
|
|
794
794
|
pe as iframePageParser,
|
|
795
795
|
U as injectIframeResizerScript,
|
|
796
796
|
ht as isImageAttachment,
|
|
@@ -801,11 +801,11 @@ export {
|
|
|
801
801
|
J as nextLocalMessageId,
|
|
802
802
|
at as normalizeActionDefinition,
|
|
803
803
|
Te as normalizeActionResult,
|
|
804
|
-
We as normalizeAgentActionReport,
|
|
805
804
|
G as normalizeAnswer,
|
|
806
805
|
Ke as normalizeAnswerReport,
|
|
807
806
|
wt as normalizeAttachment,
|
|
808
807
|
Ne as normalizeCollectClarificationsReport,
|
|
808
|
+
We as normalizeHostActionReport,
|
|
809
809
|
me as normalizeIframePageReport,
|
|
810
810
|
oe as normalizeKnowledgeStreamReport,
|
|
811
811
|
Ee as normalizeOutputFileReport,
|
|
@@ -56,14 +56,14 @@ export interface AnswerParseOptions extends KnowledgeRenderOptions {
|
|
|
56
56
|
*/
|
|
57
57
|
parsers?: AnswerParser[];
|
|
58
58
|
/**
|
|
59
|
-
* action_execute 指令处理配置(只用于 `executor === '
|
|
59
|
+
* action_execute 指令处理配置(只用于 `executor === 'host'` 的指令:命令下发给宿主执行)。
|
|
60
60
|
* useChat 会自动注入 reply(sendWsMessage),宿主通常只需提供 execute;
|
|
61
|
-
* `executor === '
|
|
61
|
+
* `executor === 'agent'` 的 collect_clarifications 走确认卡片,不需要宿主注入执行器。
|
|
62
62
|
*/
|
|
63
63
|
actionExecute?: ActionExecuteOptions;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* 实时流 chunk 分发:按「内置(deepThinking → knowledgeStream → iframePage → recordset → outputFile → collectClarifications →
|
|
66
|
+
* 实时流 chunk 分发:按「内置(deepThinking → knowledgeStream → iframePage → recordset → outputFile → collectClarifications → hostAction)+ options.parsers」
|
|
67
67
|
* 顺序把 chunk **广播**给每个 parser——`applyChunk` 返回 true 表示已消费,但不再中断后续遍历,
|
|
68
68
|
* 返回全部消费者 id。
|
|
69
69
|
* 自定义 parser 声明了与内置相同的 `answerType` 且实现 `applyChunk` 时,同类型内置会被**自动替换**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AiAnswerReport,
|
|
1
|
+
import { AiAnswerReport, HostActionValue } from 'wi-chat/parser';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
/** 本卡片对应的回答报告(values 为解析器产出的执行过程) */
|
|
5
|
-
report: AiAnswerReport<
|
|
5
|
+
report: AiAnswerReport<HostActionValue>;
|
|
6
6
|
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
7
|
/** 本卡片对应的回答报告(values 为解析器产出的执行过程) */
|
|
8
|
-
report: AiAnswerReport<
|
|
8
|
+
report: AiAnswerReport<HostActionValue>;
|
|
9
9
|
}>>>, {}, {}>;
|
|
10
10
|
export default _default;
|
|
11
11
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|