1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3213],{367:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>p});var a=n(37876);n(14232);var i=n(15039),s=n.n(i),l=n(47465),o=n(59306),r=n.n(o),d=n(36168),c=n.n(d),u=n(90701),x=n(30225),h=n(57158);let p=e=>{let{className:t,popupTitle:n,popupMessage:i,onClosePopup:o,footerButton:d,showCloseButton:p=!1,icon:m="kn-icon-more-info",footerButtonLink:v,setSubscribed:g,isSubscribed:f,toggleSubscriptionText:y,showSubscriptionToggle:T}=e;return(0,a.jsx)("div",{className:r()["entitlement-failure-popup"],children:(0,a.jsxs)(l.Ay,{isOpen:!0,onClose:o,headerContent:n,className:s()(c()["modal-popup-entitlement-failure"],t),footerContent:(0,a.jsx)(u.A,{to:v,className:"px-12 py-4 primary",styleAsButton:!0,children:d}),showCloseButton:p,extendedFooterContent:T&&(0,a.jsxs)("div",{className:s()(r()["entitlement-failure-popup__subscription-toggle"],"p-8"),children:[(0,a.jsxs)("div",{className:"flex pb-4",children:[(0,a.jsx)(h.A,{onToggle:g,isOn:!f}),(0,a.jsx)(x.A,{value:y,className:"pl-6"})]}),(0,a.jsx)(x.A,{value:"Activate this option to prevent seeing this message in the future.",className:r()["entitlement-failure-popup__subsription-message"]})]}),id:"entitlement-failure",children:[m&&(0,a.jsx)("span",{className:"pr-4",children:(0,a.jsx)("i",{className:s()(r()["entitlement-failure-popup__badge-icon"],"kn-icon-more-info mr-2"),id:"entitlement-failure-badge-icon"})}),i]})})}},5217:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eS});var a=n(37876),i=n(14232),s=n(22216),l=n(3576),o=n(62701),r=n(41291),d=n(35754),c=n(93709),u=n(89736),x=n(46319),h=n(48216),p=n(31236),m=n(48775),v=n(367),g=n(94359),f=n(15669),y=n(19166),T=n(1289),N=n(71771);class _{findClosestPoint(e,t){let n=0,a=0,i=1/0,s=this.coordinateTranslator.translateCanvasCoordsToChart({x:e,y:t});for(let e=s.x-12;e<=s.x+12;e+=this.graph.step)if(e>=this.graph.xRangeMin&&e<=this.graph.xRangeMax){let t=this.evaluateY(e),l=Math.sqrt((this.graph.xStretch*(e-s.x))**2+(this.graph.yStretch*(t-s.y))**2);l<i&&(n=e,a=t,i=l)}if(i===1/0)throw Error("Clicked too far from chart");return[n,a,i]}findDataPointByXorY(e,t){let n=!Number.isNaN(e),a=!Number.isNaN(t);if(n){if(e<this.graph.xRangeMin||e>this.graph.xRangeMax)throw Error("Out of bounds");let t=this.evaluateY(e);if(!t)throw Error("calculation failed");return{x:e,y:t}}if(a){let e,n=1/0,a=!1,i=!1;for(let s=this.graph.xRangeMin;s<=this.graph.xRangeMax;s+=this.graph.step/10){let l=this.evaluateY(s),o=Math.abs(l-t);o<n&&(e=s,n=o),l<=t&&(i=!0),l>=t&&(a=!0)}if(!(i&&a))throw Error("Out of bounds");return{x:e,y:t}}return null}draw(){let{context:e,graph:t}=this;if(e){e.strokeStyle="#00f",e.fillStyle="#ddd",e.lineWidth=1,e.beginPath();for(let n=t.xRangeMin;n<=t.xRangeMax;n+=t.step){let t=this.evaluateY(n),a=this.coordinateTranslator.translateChartCoordsToCanvas({x:n,y:t});e.lineTo(a.x,a.y)}e.stroke()}}constructor(e,t,n){this.evaluateY=e=>this.graph.expr.evaluate({x:e}),this.context=null==e?void 0:e.getContext("2d"),this.graph=t,this.coordinateTranslator=n}}class b{drawDynamicItems(e,t,n,a){this.context&&(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.drawNodes(e,t),this.context.beginPath(),this.context.lineWidth=1,this.context.strokeStyle="#555",this.drawDotUnderMouse(n,a))}drawNodes(e,t){e.forEach((e,n)=>{let a=this.coordinateTranslator.translateChartCoordsToCanvas({x:e.x,y:e.y});this.context.beginPath(),this.context.fillStyle=e.selected?"#88aaaa":"#2453ff",this.context.fillStyle=n===t?"#000000":"#2453ff",this.context.arc(a.x,a.y,4,0,2*Math.PI,!0),this.context.strokeStyle="#009999",this.context.fill(),this.context.stroke()})}drawDotUnderMouse(e,t){if(!e)return;this.context.beginPath(),this.context.fillStyle="#C00";let n=this.coordinateTranslator.translateChartCoordsToCanvas({x:t.x,y:t.y});this.context.arc(n.x,n.y,4,0,2*Math.PI,!0),this.context.strokeStyle="#C00",this.context.fill(),this.context.stroke()}constructor(e,t,n,a){this.canvas=e,this.context=null==e?void 0:e.getContext("2d"),this.coordinateTranslator=t,this.axes=n,this.equation=a}}var j=n(83182),E=n(49287);class S extends E.S{findMinMaxY(e,t,n){let a=1/0,i=-1/0;for(let s=e;s<=t;s+=this.graph.step){let e=n.evaluate({x:s});
1e<a&&(a=e),e>i&&(i=e)}return[a,i]}getEquationCanvasDetails(){return this.graph}constructor(e,t,n,a,i,s,l){super();const o={};o.formula=null!=n?n:"x",o.xRangeMin=e,o.xRangeMax=null!=t?t:200,o.step=(o.xRangeMax-o.xRangeMin)/5e3,o.axisPadding=35,o.topAndRightPadding=20,o.expr=(0,j.qg)(o.formula).compile(),o.canvasHeight=i,o.canvasWidth=a,this.graph=o,[o.yRangeMin,o.yRangeMax]=this.findMinMaxY(o.xRangeMin,o.xRangeMax,o.expr),o.yStretch=(o.canvasHeight-o.axisPadding-o.topAndRightPadding)/(o.yRangeMax-o.yRangeMin),this.calculateLogarithmicStretch(s,l),o.xStretch=(o.canvasWidth-o.axisPadding-o.topAndRightPadding)/(o.xRangeMax-o.xRangeMin),this.isXScaleLogarithmic=s,this.isYScaleLogarithmic=l}}let C=(0,i.createContext)({setEquation:()=>{}});var A=n(16634),w=n(68995),I=n(51211);let D=e=>{let{equationText:t,min:n,max:s,deleteNode:l,unitConverters:o,equationHtmlRef:r,unitUpdatedTrigger:d,axisXTitle:c,axisYTitle:u,setItemSaved:x,setIsBookmarkChecked:h}=e,p=(0,i.useRef)(null),m=(0,i.useRef)(null),[v,f]=(0,i.useState)(!1),[y,j]=(0,i.useState)({x:0,y:0}),[E,D]=(0,i.useState)({x:0,y:0}),O=(0,i.useRef)(null),P=(0,i.useRef)(0),R=(0,i.useContext)(C),{nodes:M,highlightedNodeIndex:k,setHighlightedNodeIndex:L,nodeAdd:q,nodeUpdate:U}=(0,I.A)(),{zoomScale:Y,showGridLines:X,isScaleLogarithmic:z,significantDigits:H}=(0,w.A)(),V=new S(n,s,t,Y/100*700,Y/100*700,z.x,z.y),F=V.getEquationCanvasDetails(),G=new N.A(m.current,F,V,o.x,o.y).getRequiredAxisPadding(H.y);G>F.axisPadding&&V.updateAxisPadding(G);let B=new N.A(m.current,F,V,o.x,o.y),W=new _(m.current,F,V),Z=new b(p.current,V,B,W);(0,i.useEffect)(()=>{J(),K()},[m.current]),(0,i.useEffect)(()=>{K()},[M]),(0,i.useEffect)(()=>{J(),K(),R.setEquation(W)},[X,d,Y,z.x,z.y,H.x,H.y]);let K=()=>{Z.drawDynamicItems(M,k,v,E)},J=()=>{B.clearCanvas(),B.draw(X,H.x,H.y),W.draw()},Q=(e,t)=>V?M.findIndex(n=>{let a=V.translateChartCoordsToCanvas({x:n.x,y:n.y});return a.x>e-4-7&&a.x<e+4+7&&a.y>t-4-7&&a.y<t+4+7}):-1;return(0,a.jsxs)("div",{className:"pl-12 w-3/4",children:[(0,a.jsxs)("div",{ref:r,style:{width:Y/100*700,height:Y/100*700,position:"relative"},children:[(0,a.jsx)("canvas",{id:"staticCanvas",ref:m,width:Y/100*700,height:Y/100*700,style:{zIndex:1,position:"absolute"}}),(0,a.jsx)("canvas",{id:"dynamicCanvas",ref:p,width:Y/100*700,height:Y/100*700,onMouseMove:e=>{let t,n,a,i,s,l=null==p?void 0:p.current,o=(i=null==p?void 0:p.current,-1!==(s=Q(e.nativeEvent.offsetX,e.nativeEvent.offsetY))?(i.style.cursor="grab",L(s),!0):(i.style.cursor="default",!1));try{[t,n,a]=W.findClosestPoint(e.nativeEvent.offsetX,e.nativeEvent.offsetY)}catch(e){f(!1),K();return}null!==O.current?(U(O.current,{x:t,y:n}),x(!1),l.style.cursor="move"):!o&&a<10?(j({x:e.clientX,y:e.clientY}),D({x:t,y:n}),f(!0)):f(!1),K()},onMouseDown:e=>{let t=Q(e.nativeEvent.offsetX,e.nativeEvent.offsetY);-1!==t&&(O.current=t,void 0!==M[t]&&(P.current=new Date().getTime()),L(t)),K()},onMouseUp:e=>{let t,n,a;if((null==p?void 0:p.current).style.cursor="default",null!==O.current){new Date().getTime()-P.current<300&&(l(k),x(!1)),O.current=null,K(),h(!0);return}try{if([t,n,a]=W.findClosestPoint(e.nativeEvent.offsetX,e.nativeEvent.offsetY),a>10)return}catch(e){}if(null===O.current){let e={x:t,y:n};q(e);let a=g.l.useLogger();null==a||a.logDatapointAddEvent(null==e?void 0:e.x,null==e?void 0:e.y),x(!1),(0,A.Vy)(A.i1.GRAPH_CLICK),K(),h(!0)}},onMouseLeave:()=>{f(!1),O.current=null,K()},style:{zIndex:2,position:"absolute"}}),(0,a.jsx)("div",{style:{position:"absolute",bottom:"".concat(-200/Y,"%"),left:"50%",transform:"translateX(-50%)",fontSize:"16px",fontWeight:"700"},children:c}),(0,a.jsx)("div",{id:"yAxisLabel",style:{position:"absolute",top:"50%",left:-20,writingMode:"vertical-rl",transform:"translateY(-50%) rotate(-180deg)",textAlign:"center",fontSize:"16px",fontWeight:"700"},title:u,children:u})]}),v&&(0,a.jsxs)("div",{className:"fixed bg-white bg-opacity-80 p-1 rounded shadow-md mt-8",style:{left:y.x,top:y.y},children:[(0,a.jsx)("span",{children:"x"}),": ",(0,T.ZV)(o.x.ConvertToSelectedUnit(E.x),H.x),", ",(0,a.jsx)("br",{}),(0,a.jsx)("span",{children:"y"}),": ",(0,T.ZV)(o.y.ConvertToSelectedUnit(E.y),H.y)]})]})};var O=n(86713),P=n(4591),R=n(61229),M=n(43728),k=n(12718),L=n.n(k),q=n(80747),U=n(43247),Y=n(86388),X=n(13017);let z=e=>{let{curveIds:t,hotLink:n,equationData:s,equationCompound:r,equationHtmlRef:d,unitConverters:c,dataToSaveToMyKnovel:u,itemSaved:x,setItemSaved:p,displayLeftPanel:m,downloadProtected:v=!1}=e,[T,N]=(0,i.useState)(u),{significantDigits:_}=(0,w.A)(),{nodes:b}=(0,I.A)(),j=g.l.useLogger();return(0,i.useEffect)(()=>{let e=(0,y.o4)(b,c,_);N((0,o._)((0,l._)({},T),{EQUATION_POINTS:e,CONTENT_NAME:null==n?void 0:n.NAME}))},[b,n,c,_]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex mr-3 items-center",children:[(0,a.jsx)("div",{children:(0,a.jsx)(P.A,{id:"equationPlotter",isSaved:x,label:"",saveParameters:T,itemParams:{curve_ids:t},className:L()["save-button__graph-design"],onSaveSuccess:()=>p(!0)})}),(0,a.jsx)(Y.A,{className:"ml-4",viewerType:f.kF.EPGRPH,curveIds:t,contentId:null==n?void 0:n.ITEM_CONTENT_ID,graphName:r,onLogEvent:()=>null==j?void 0:j.logCitationEvent()}),(0,a.jsx)(X.A,{onExportGraphClick:e=>{let t="equation",a=(0,A.Gr)(n,r,b,_.x,_.y,c.x,c.y);switch(j.logExportGraph(e),e){case q.MT.HTML:(0,A.ZV)(n,r,b,_.x,_.y,c.x,c.y);break;case q.MT.XLSX:(0,U.FW)(a,t);break;case q.MT.CSV:(0,U.eZ)(a,t);break;case q.MT.TEXT:(0,A.HJ)(n,r,b,_.x,_.y,c.x,c.y);break;case q.MT.JPG:case q.MT.PNG:case q.MT.GIF:(0,M.n3)(e.trim(),t,d,n);break;case q.MT.PDF:(0,M.I$)(n,s,d,b,_.x,_.y,c.x,c.y)}(0,A.$E)(null==n?void 0:n.NAME,e,null==n?void 0:n.ITEM_CONTENT_ID,null==n?void 0:n.ITEM_TYPE)},downloadProtected:v})]}),(0,a.jsx)("div",{className:"block g-lg:hidden",children:(0,a.jsx)(R.t,{trigger:(0,a.jsx)(h.t,{variant:"secondary",label:"Graph tools",size:"large",iconLeft:"hamburger-menu"}),mainTitle:"Graph tools",visibleTitle:!0,showBorderOnHeaderAndFooter:!0,style:{width:"100%"},children:m&&(0,a.jsx)(a.Fragment,{children:m(!0,!0,!1,!0,!0)})})})]})};var H=n(36544),V=n(13157),F=n(72620),G=n(39683),B=n(25918),W=n(15039),Z=n.n(W),K=n(87051),J=n.n(K),Q=n(70763),$=n(2694);let ee=e=>{let{unitConverters:t,setItemSaved:n,setIsBookmarkChecked:s}
1=e,[l,o]=(0,i.useState)(!1),[r,d]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!0),[x,h]=(0,i.useState)(""),[p,m]=(0,i.useState)(""),[v,f]=(0,i.useState)(""),[y,N]=(0,i.useState)(""),_=(0,i.useContext)(C),{nodes:b,nodeAdd:j}=(0,I.A)(),E=g.l.useLogger();function S(e,t){"x"===e?(h(t),""===t.trim()?(d(!1),u(!0)):(d(!0),u(!1)),(0,A.Vy)(A.i1.DATA_POINTS_X_AXIS)):(m(t),""===t.trim()?(o(!1),u(!0)):(o(!0),u(!1)),(0,A.Vy)(A.i1.DATA_POINTS_Y_AXIS))}function w(){if(D(),!(0,T.kf)(x)&&!(0,T.kf)(p))return void f("A numeric value for X or Y is required");let e=parseFloat(x),a=parseFloat(p),i=t.x.ConvertFromSelectedUnitToOriginal(e),l=t.y.ConvertFromSelectedUnitToOriginal(a);if(b.some(t=>t.x===e))return void f("Already contains this X");if(b.some(e=>e.y===a))return void N("Already contains this Y");if(!_.equation)return;let o=null;try{o=_.equation.findDataPointByXorY(i,l)}catch(t){Number.isNaN(e)||f(t.message),Number.isNaN(a)||N(t.message);return}n(!1),j(o),D(),s(!0),E&&(null==E||E.logDatapointAddEvent(null==o?void 0:o.x,null==o?void 0:o.y))}function D(){h(""),m(""),f(""),N(""),o(!1),d(!1),u(!0)}return(0,a.jsxs)("tr",{className:"bg-white",children:[(0,a.jsx)(V.E,{children:(0,a.jsx)(Q.t,{variant:"number",label:"",id:"xcoord",width:"100%",value:x,disabled:l,size:"small",placeholder:"xxxx.xx",className:"font-normal text-gray-500",errorLabel:v,hasError:""!==v,onChange:e=>S("x",e.target.value),onKeyDown:e=>"Enter"===e.key?w():""})}),(0,a.jsx)(V.E,{children:(0,a.jsx)(Q.t,{variant:"number",label:"",id:"ycoord",width:"100%",value:p,disabled:r,size:"small",placeholder:"yyyy.yy",className:"font-normal text-gray-500",errorLabel:y,hasError:""!==y,onChange:e=>S("y",e.target.value),onKeyDown:e=>"Enter"===e.key?w():""})}),(0,a.jsx)(V.E,{children:(0,a.jsx)(G.t,{id:"Add data point",label:"Add data point",size:"small",children:(0,a.jsx)($.t,{id:"add-data-point-button",iconName:"plus",disabled:c,variant:"secondary",size:"large","aria-label":"Add data point",onClick:()=>{w()}})})})]})},et=e=>{let{deleteNode:t,unitConverters:n,onCopyTableContent:s,setItemSaved:l,setIsBookmarkChecked:o}=e,[r,d]=(0,i.useState)("none"),[u,x]=(0,i.useState)("none"),{nodes:p,highlightedNodeIndex:m,nodesClear:v}=(0,I.A)(),[y,N]=(0,i.useState)([...p]),_=(0,i.useRef)(null),{significantDigits:b}=(0,w.A)(),j=(0,i.useCallback)(e=>{null!==e&&_.current&&(_.current.scrollTop=e.offsetTop-100)},[]);(0,i.useEffect)(()=>{N(e=>e.length===p.length&&e.every((e,t)=>e===p[t])?e:"none"!==r?S(r,p,"x"):"none"!==u?S(u,p,"y"):[...p])},[p,r,u]);let E=e=>p.indexOf(y[e]),S=(e,t,n)=>{let a=[...t];return a.sort((t,a)=>e===f.ks.ASCENDING?Number(t[n])-Number(a[n]):Number(a[n])-Number(t[n])),a};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:Z()(J()["xy-table"],"mb-6 mt-0"),children:[(0,a.jsx)(c.t,{as:"span",fontSize:16,fontWeight:700,className:"mb-0",children:"Data points"},"data_points"),(0,a.jsx)("div",{className:J()["xy-table__table-wrapper"],onCopy:s,ref:_,children:(0,a.jsxs)(H.X,{layout:"spacious",bodyFontSize:"small",dividers:"all",hideRowHover:!0,children:[(0,a.jsxs)("thead",{children:[(0,a.jsxs)("tr",{className:"bg-white",children:[(0,a.jsx)(V.E,{sortable:{onSort:e=>{d(e),x("none"),N(S(e,p,"x")),(0,A.Vy)(A.i1.X_DATAPOINT_SORT)},sortDirection:r},children:"X Axis"}),(0,a.jsx)(V.E,{sortable:{onSort:e=>{x(e),d("none"),N(S(e,p,"y")),(0,A.Vy)(A.i1.Y_DATAPOINT_SORT)},sortDirection:u},children:"Y Axis"}),(0,a.jsx)(V.E,{})]}),(0,a.jsx)(ee,{unitConverters:n,setItemSaved:l,setIsBookmarkChecked:o})]}),(0,a.jsx)("tbody",{children:y.length>0&&y.map((e,i)=>(0,a.jsxs)("tr",{className:E(i)===m?"text-blue-700":"",ref:E(i)===m?j:null,children:[(0,a.jsx)(F.N,{children:(0,T.ZV)(n.x.ConvertToSelectedUnit(e.x),b.x)}),(0,a.jsx)(F.N,{children:(0,T.ZV)(n.y.ConvertToSelectedUnit(e.y),b.y)}),(0,a.jsx)(F.N,{className:"flex justify-center",children:(0,a.jsx)("div",{className:"cursor-pointer",children:(0,a.jsx)(G.t,{id:"Delete data point",label:"Delete data point",size:"small",children:(0,a.jsx)(c.t,{onClick:()=>t(E(i)),children:(0,a.jsx)(B.t,{size:16,name:"delete",fill:"interaction"})})})})})]},e.x))})]})})]}),(0,a.jsx)("div",{className:Z()(J()["equation-container"],"flex justify-end pb-4"),children:y.length>0&&(0,a.jsx)(h.t,{variant:"tertiary",iconLeft:"delete",size:"large",label:"Clear All",onClick:()=>void((0,A.Vy)(A.i1.CLEAR_ALL),v(),l(!1),g.l.useLogger().logClearAllDataPoints(null==p?void 0:p.length)),className:J().clearAllPointsLabel})})]})};var en=n(32672),ea=n(37769);let ei=e=>{let{equationData:t,unitConverters:n,setUnitUpdatedTrigger:s}=e,[l,o]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[u,x]=(0,i.useState)(!1),[h,p]=(0,i.useState)(!1),[m,v]=(0,i.useState)(null),[f,y]=(0,i.useState)(null),N=g.l.useLogger(),{significantDigits:_}=(0,w.A)();return(0,i.useEffect)(()=>{(null==n?void 0:n.x)&&(null==n?void 0:n.y)&&(v(n.x.getDropDownUnitList()),o(n.x.getUnitFrom()),y(n.y.getDropDownUnitList()),d(n.y.getUnitFrom()))},[null==n?void 0:n.x,null==n?void 0:n.y]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:Z()(J()["equation-container"],"my-6"),children:[(0,a.jsx)("div",{className:"my-4",children:(0,a.jsxs)(c.t,{as:"span",children:["Variable Property (X):\xa0",(0,a.jsx)(c.t,{as:"span",color:"color-text-secondary",children:t.axisXTitle},"property-x-text")]},"property-x")}),(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsx)(c.t,{as:"span",children:"X Range:\xa0"},"x-range"),(0,a.jsxs)(c.t,{as:"span",color:"color-text-secondary",children:[(0,T.ZV)(null==n?void 0:n.x.ConvertToSelectedUnit(t.min),_.x)," -",(0,T.ZV)(null==n?void 0:n.x.ConvertToSelectedUnit(t.max),_.x)]},"x-range-text")]}),(0,a.jsx)("div",{className:Z()(J().dropdown,"py-6"),children:m&&(0,a.jsx)(en.m,{label:"X Unit",size:"medium",value:l,options:m,onChange:e=>(e=>{let t=null==e?void 0:e.indexNumber,[a]=[m].map(e=>{var n,a,i;return null==e||null==(i=e[0])||null==(a=i.options)||null==(n=a[t])?void 0:n.id});n.x.setUnitTo(a),o(a),s(1e6*Math.random()),(0,A.Vy)(A.i1.VARIABLE_X),N.log
1ChangeUnit("xAxisUnit",null==e?void 0:e.label)})(e),isOpen:u,onDropdownToggle:()=>x(!u),width:"100%"})}),(0,a.jsx)(ea.A,{axis:"x"})]}),(0,a.jsxs)("div",{className:Z()(J()["equation-container"],"my-6"),children:[(0,a.jsx)("div",{className:"my-4",children:(0,a.jsxs)(c.t,{as:"span",children:["Function Property (Y):\xa0",(0,a.jsx)(c.t,{as:"span",color:"color-text-secondary",children:t.axisYTitle},"property-y-text")]},"property-y")}),(0,a.jsx)("div",{className:Z()(J().dropdown,"py-6"),children:f&&(0,a.jsx)(en.m,{label:"Y Unit",size:"medium",value:r,options:f,onChange:e=>(e=>{let t=null==e?void 0:e.indexNumber,[a]=[f].map(e=>{var n,a,i;return null==e||null==(i=e[0])||null==(a=i.options)||null==(n=a[t])?void 0:n.id});n.y.setUnitTo(a),d(a),s(1e6*Math.random()),(0,A.Vy)(A.i1.FUNCTION_Y),N.logChangeUnit("yAxisUnit",null==e?void 0:e.label)})(e),isOpen:h,onDropdownToggle:()=>p(!h),width:"100%"})}),(0,a.jsx)(ea.A,{axis:"y"})]})]})};var es=n(98563),el=n(63032),eo=n(73970),er=n(8184);let ed=e=>{let{equationText:t,equationTextOriginal:n}=e,[s,l]=(0,i.useState)("1"),o={loader:{load:["input/asciimath"]}};return(0,a.jsx)("div",{className:Z()(J()["equation-container"],"my-6"),children:(0,a.jsx)(G.t,{id:"optionsPlotter",label:"Right click to see more options",size:"medium",align:"start",side:"bottom",className:"w-full",children:(0,a.jsxs)(es.t,{size:"small",orientation:"horizontalTop",onSelected:()=>{l("1"===s?"2":"1"),(0,A.Vy)("1"===s?A.i1.EQUATION_COEFFICIENTS:A.i1.EQUATION_ROW)},selectedTabId:s,className:"overflow-x-auto mt-4 max-w-[300px]",children:[(0,a.jsx)(el.n,{id:"1",label:"Raw",children:(0,a.jsx)(eo.A,{config:o,children:(0,a.jsx)(er.A,{className:"text-lg w-50",inline:!0,dynamic:!0,children:"`".concat(n,"`")})})}),(0,a.jsx)(el.n,{id:"2",label:"with Coefficients",children:(0,a.jsx)(eo.A,{config:o,children:(0,a.jsx)(er.A,{className:"text-lg",inline:!0,dynamic:!0,children:"`".concat(t,"`")})})})]})})})};n(29526);var ec=n(74641),eu=n(71539),ex=n(41501),eh=n(9990),ep=n(78529),em=n(66733),ev=n(54794),eg=n(8874),ef=n(1685),ey=n(40850);let eT=function(e,t,n,a,s,o,r,d){let c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,[u,x]=(0,i.useState)(!0),[h,p]=(0,i.useState)(),[m,v]=(0,i.useState)(null),[g,f]=(0,i.useState)(null),[y,T]=(0,i.useState)(null),[N,_]=(0,i.useState)(!1),[b,j]=(0,i.useState)(null),[E,S]=(0,i.useState)(null),[C,w]=(0,i.useState)(!1),I="";(0,i.useEffect)(()=>{D(),L()},[]);let D=async()=>{p((await (0,ex.Zd)(e)).BODY.RESPONSE.HOTLINK[0]);try{var t,i,s;let l=await (0,ex.Ay)(e,n,a);O(l);let o=await (0,ev.in)(e),r=null!=(t=null==o||null==(s=o.BODY)||null==(i=s.RESPONSE)?void 0:i.DATA)?t:null;S(r)}catch(e){if(e instanceof eu.h)x(!1),j(e.message);else throw e}},O=async e=>{x(!0),w((0,em.K)(null==e?void 0:e.DOWNLOADPROTECTED)),I=e.ITEM_NAME;try{let t=await (0,eg.tg)(a);await P(t,e.EKEY)}catch(e){j(e.message)}},P=async(t,n)=>{let i=(0,A.TA)(t);if(_(i.hasSingleCoefficientValue),i.compound=(0,A.sM)(t),i.functionName=I,s){let e=await (0,eg.D)(a,"x");M("x",e.equation_units,e.default_unit[0].unit_id);let t=await (0,eg.D)(a,"y");M("y",t.equation_units,t.default_unit[0].unit_id)}else k("x",await (0,eg.jD)(t[0].SOURCEUNITX),t[0].SOURCEUNITX),k("y",await (0,eg.jD)(t[0].SOURCEUNITY),t[0].SOURCEUNITY);R(await (0,eg.f6)(e,n),i)},R=(e,t)=>{let n=(0,l._)({},t);n.title=n.compound,n.axisXTitle=e.AXISTITLEX,n.axisYTitle=e.AXISTITLEY,r({x:"2"===e.SCALEMODEX,y:"2"===e.SCALEMODEY}),v(n)},M=(e,t,n)=>{void 0!==n&&("x"===e?f(new ey.Z(t,n)):"y"===e&&T(new ey.Z(t,n)))},k=(e,t,n)=>{"x"===e?f(new ef.e(t,n)):"y"===e&&T(new ef.e(t,n))},L=()=>{c&&(0,ev.dQ)(e=>{if((0,ec.oJ)(e)&&(0,ec.oJ)(null==e?void 0:e.BODY)){var t,n;let a=null==e||null==(t=e.BODY)?void 0:t.CONTENT_DATA;if(a)if(null==a||null==(n=a.trim())?void 0:n.startsWith("[")){let e=JSON.parse(a);e&&o(e),q(e)}else{let e=Array.from(new DOMParser().parseFromString(a,"application/xml").getElementsByTagName("point")).map(e=>({x:parseInt(e.getAttribute("x"),10),y:parseInt(e.getAttribute("y"),10)}));(null==e?void 0:e.length)>0&&o(e)}}}
1,c)},q=t=>{let i={SESSION_ID:(0,eh.u0)(),FOLDER_KEY:"",CONTENT_ID:e||"",REPRESENTATION_TYPE:n,ITEM_PARAMETERS:"",CUSTOM_DATA:""};i.CUSTOM_DATA=JSON.stringify(t),i.ITEM_PARAMETERS=JSON.stringify({curve_ids:a}),(0,ep.w7)(e=>{if((0,ec.oJ)(e)){var t;d((null==e||null==(t=e.BODY)?void 0:t.STATUS_MSG)==="ITEM EXISTS")}},i)};return{isAuthorized:u,hotLink:h,errorMessage:b,equationData:m,unitConverters:{x:g,y:y},isSingleCoefficient:N,parentITableData:E,downloadProtected:C}};var eN=n(36331);let e_=e=>{let{children:t,showfeedbackSection:n}=e;return(0,a.jsxs)("div",{className:Z()(J()["graph-leftPanel"],"lg:w-1/3 2xl:w-1/4 relative"),children:[(0,a.jsx)("div",{className:Z()(J()["graph-components"],"w-full"),children:t}),(0,a.jsx)("div",{className:"absolute bottom-[-3rem] right-0",children:n&&(0,a.jsx)(h.t,{variant:"tertiary",className:"pl-1",size:"small",label:"Leave Feedback",iconLeft:"comment"})})]})},eb=e=>{let{contentId:t,rootContentId:n,viewerType:s,curveIds:T,itemId:N}=e,_=(0,i.useRef)(null),[b,j]=(0,i.useState)(0),[E,S]=(0,i.useState)(null),[P,R]=(0,i.useState)(!1),[M,k]=(0,i.useState)(!1),[L,q]=(0,i.useState)({openEquation:!0,openAxes:!0,openDataSection:!0,openGraphSection:!0}),{zoomScale:U,setZoomScale:Y,showGridLines:X,setShowGridLines:H,significantDigits:V,setIsScaleLogarithmic:F}=(0,w.A)(),{nodes:G,setNodes:B,nodeDelete:W}=(0,I.A)(),{isAuthorized:Z,hotLink:K,errorMessage:J,equationData:Q,unitConverters:$,isSingleCoefficient:ee,parentITableData:en,downloadProtected:ea}=eT(t,n,s,T,!0,B,F,R,N),es=e=>{W(e),R(!1),(0,A.Vy)(A.i1.DATA_POINTS_DELETE_ROW,t),k(!0)},el=async()=>{R(await (0,y.ic)(G,$,V,t,s,T)),k(!1)};(0,i.useEffect)(()=>(g.l.initLogger(s,t,n,T),()=>{g.l.destroyLogger()}),[]),(0,i.useEffect)(()=>{M&&el()},[M,G]);let eo=()=>{(0,r.BM)("EQUATION TABLE COPY",t,()=>{})},er=()=>(0,a.jsx)(D,{equationText:Q.equationText,min:Q.min,max:Q.max,axisXTitle:Q.axisXTitle,axisYTitle:Q.axisYTitle,deleteNode:es,unitConverters:$,equationHtmlRef:_,unitUpdatedTrigger:b,setItemSaved:R,setIsBookmarkChecked:k}),ec=(e,n,i,s,r)=>{let h=g.l.useLogger();return(0,a.jsxs)(e_,{showfeedbackSection:r,children:[e&&(0,a.jsx)(d.t,{customHeaderRender:(0,a.jsxs)(c.t,{as:"span",fontSize:16,fontWeight:700,className:"mb-4",children:["Equation: ",Q.compound]},"equation"),label:"Equation:".concat(Q.compound),isOpen:L.openEquation,onToggle:()=>{q((0,o._)((0,l._)({},L),{openEquation:!L.openEquation})),(0,A.Vy)(A.i1.ACCORDION)},children:(0,a.jsx)(ed,{equationText:Q.equationText,equationTextOriginal:Q.equationTextOriginal})}),n&&(0,a.jsx)(d.t,{customHeaderRender:(0,a.jsx)(c.t,{as:"span",fontSize:16,fontWeight:700,children:"Axes"},"axes"),label:"Axes",isOpen:L.openAxes,onToggle:()=>{q((0,o._)((0,l._)({},L),{openAxes:!L.openAxes})),(0,A.Vy)(A.i1.ACCORDION)},children:(0,a.jsx)(ei,{equationData:Q,unitConverters:$,setUnitUpdatedTrigger:j})}),i&&(0,a.jsx)(d.t,{customHeaderRender:(0,a.jsx)(c.t,{as:"span",fontSize:16,fontWeight:700,className:"mb-0",children:"Data points"},"data_points"),label:"Axes",isOpen:L.openDataSection,onToggle:()=>{q((0,o._)((0,l._)({},L),{openDataSection:!L.openDataSection})),(0,A.Vy)(A.i1.ACCORDION)},children:(0,a.jsx)(et,{deleteNode:es,unitConverters:$,onCopyTableContent:eo,setItemSaved:R,setIsBookmarkChecked:k})}),s&&(0,a.jsx)(d.t,{customHeaderRender:(0,a.jsx)(c.t,{as:"span",fontSize:16,fontWeight:700,children:"Graph Area"},"graph_area"),label:"Axes",isOpen:L.openGraphSection,onToggle:()=>{q((0,o._)((0,l._)({},L),{openGraphSection:!L.openGraphSection})),(0,A.Vy)(A.i1.ACCORDION)},children:(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsx)("div",{className:"-ml-3",children:(0,a.jsx)(u.t,{active:X,size:"medium",position:"left",label:"Grid lines",onChange:()=>{H(!X),h.logToggleGridLines(!X),(0,A.Vy)(A.i1.GRID_LINES,t)}})}),(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(x.t,{min:50,max:200,step:2,value:U,label:"Zoom",visibleHeaderLabel:!0,onChange:e=>{Y(e),(0,A.Vy)(A.i1.ZOOM,t),h.logZoomChange(e)}})})]})})]})},eu=Q&&$.x&&$.y&&Z;return(0,a.jsxs)(C.Provider,{value:{equation:E,setEquation:S},children:[(0,a.jsxs)("div",{className:"flex justify-between py-4",children:[window.history&&window.history.length>1&&(0,a.jsx)(h.t,{variant:"link-tertiary",iconLeft:"left",size:"small",label:"Go back",onClick:()=>window.history.back()}),(0,a.jsxs)("div",{className:"flex ml-auto",children:[(0,a.jsx)(h.t,{size:"small",label:"Tutorial video",iconLeft:"play-video",onClick:()=>window.open(f.yK,"_blank"),variant:"tertiary"}),(0,a.jsx)("span",{className:"mr-4"}),(0,a.jsx)(h.t,{size:"small",label:"Help",iconLeft:"help",onClick:()=>window.open(f.zo,"_blank"),variant:"tertiary"})]})]}),ee&&(0,a.jsx)("div",{className:"w-1/2 m-auto",children:(0,a.jsx)(p.t,{variant:"error",isDismissible:!0,description:"Graph does not have enough data to be plotted, please try another.",title:"Graph unavailable",size:"large",link:{label:"Return to
1source",onClick:()=>(0,eN.h)(n)},onDismissClick:()=>(0,eN.h)(n)})}),J&&(0,a.jsx)("div",{className:"w-1/2 m-auto",children:(0,a.jsx)(p.t,{variant:"error",isDismissible:!0,description:J,title:"Graph unavailable",size:"large",link:{label:"Return to source",onClick:()=>(0,eN.h)(n)},onDismissClick:()=>(0,eN.h)(n)})}),(0,a.jsxs)("div",{className:"mb-10",children:[!eu&&(0,a.jsx)(m.t,{size:"large",label:"Loading equation data..."}),eu&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O.A,{title:Q.title,hotLink:K,parentITableData:en}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)(z,{curveIds:T,downloadProtected:ea,hotLink:K,equationData:Q,equationCompound:null==Q?void 0:Q.compound,equationHtmlRef:_,unitConverters:$,dataToSaveToMyKnovel:{REPRESENTATION_TYPE:s,CONTENT_ID:t},itemSaved:P,setItemSaved:R,displayLeftPanel:ec})}),(0,a.jsxs)("div",{className:"g-lg:flex block mt-6",children:[(0,a.jsxs)("div",{className:"block g-lg:hidden",children:[(0,a.jsx)("div",{className:"overflow-x-scroll overflow-y-hidden pb-6",children:er()}),(0,a.jsx)("div",{className:"mt-8",children:ec(!1,!1,!0,!1,!1)})]}),(0,a.jsx)("div",{className:"hidden g-lg:contents",children:ec(!0,!0,!0,!0,!0)}),(0,a.jsx)("div",{className:"hidden g-lg:block overflow-auto overflow-x-visible overflow-x-clip pb-16",children:er()})]}),(0,a.jsx)("br",{}),(0,a.jsx)("br",{})]}),!Z&&(0,a.jsx)(v.Ay,{popupTitle:null===eN.H||void 0===eN.H?void 0:eN.H.title,popupMessage:null===eN.H||void 0===eN.H?void 0:eN.H.description,footerButton:null===eN.H||void 0===eN.H?void 0:eN.H.footerButtonText,footerButtonLink:null===eN.H||void 0===eN.H?void 0:eN.H.footerButtonLink})]})]})};var ej=n(87530),eE=n(89099);let eS=()=>{let e=(0,eE.useRouter)(),t=(0,ej.PP)(e,null===ej.f0||void 0===ej.f0?void 0:ej.f0.CID),n=(0,ej.PP)(e,ej.f0.RCID),i=(0,ej.PP)(e,null===ej.f0||void 0===ej.f0?void 0:ej.f0.VIEWER_TYPE),l=(0,ej.PP)(e,null===ej.f0||void 0===ej.f0?void 0:ej.f0.CURVE_IDS),o=(0,ej.PP)(e,null===ej.f0||void 0===ej.f0?void 0:ej.f0.ITEM_ID);return(0,a.jsx)(s.A,{templateLayout:"left",className:"-mt-10",children:(0,a.jsx)(eb,{contentId:t,rootContentId:n,viewerType:i,curveIds:l,itemId:o})})}},41234:()=>{},59306:e=>{e.exports={"entitlement-failure-popup__badge-icon":"EntitlementFailurePopup_entitlement-failure-popup__badge-icon__SXqox","entitlement-failure-popup__subscription-toggle":"EntitlementFailurePopup_entitlement-failure-popup__subscription-toggle___CuHi","entitlement-failure-popup__subsription-message":"EntitlementFailurePopup_entitlement-failure-popup__subsription-message__zTPne"}},87051:e=>{e.exports={"graph-leftPanel":"EquationContainer_graph-leftPanel__V2Lku","axis-precision":"EquationContainer_axis-precision__n0Ivy","xy-table__table-wrapper":"EquationContainer_xy-table__table-wrapper__TN8uw","xy-table":"EquationContainer_xy-table__e9_ur",dropdown:"EquationContainer_dropdown__inRCi","data-sets":"EquationContainer_data-sets__fMvUB","data-sets__buttons":"EquationContainer_data-sets__buttons__Uv0zc","data-set-label":"EquationContainer_data-set-label__ToL8Q","add-data-points":"EquationContainer_add-data-points__heupu",clearAllPointsLabel:"EquationContainer_clearAllPointsLabel__qSw5I"}},93120:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/kn/resources/[cid]/[rcid]/[viewerType]/equation",function(){return n(5217)}])}},e=>{e.O(0,[347,4155,9509,2366,4519,3184,1574,2671,5493,9797,2629,7141,1704,2992,3480,3948,8965,4591,190,6135,5795,6652,850,636,6593,8792],()=>e(e.s=93120)),_N_E=e.O()}]); 2 3/* BUILD_VERSION: Release_2026_09_11.20260909.78.11031.d26b5eeee Time: Wed Sep 9 06:53:22 UTC 2026 */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.