1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4323],{8297:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/interactions",function(){return i(97874)}])},54342:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(37876),r=i(52862),o=i(5646);let s=e=>{let{smallMargins:t}=e;return(0,n.jsx)(l,{$smallMargins:t,children:(0,n.jsx)("span",{children:(0,n.jsx)(r.sA,{id:"registration.sso.or"})})})},l=o.I4.div.withConfig({componentId:"sc-eb9ae047-0"})(["position:relative;color:",";border-bottom:0.5px solid ",";margin:32px 16px;span{display:block;padding:0 16px;position:absolute;left:50%;top:50%;font-size:12px;text-transform:uppercase;transform:translate(-50%,-50%);background-color:",";}",""],e=>e.theme.color.textLight,e=>e.theme.color.textLight,e=>e.theme.color.backgroundSecond,e=>{let{$smallMargins:t}=e;return t&&(0,o.AH)(["margin-top:15px;margin-bottom:15px;"])})},97874:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__N_SSP:()=>tP,default:()=>tz});var n=i(37876),r=i(63843),o=i(11857),s=i(5646),l=i(56005);let a=e=>{let{tabs:t,selectedTab:i,setSelectedTab:r}=e;return(0,n.jsx)(c,{children:t.map(e=>{let{tabName:t,suffix:o}=e;return(0,n.jsxs)(l.A,{onClick:()=>r(t),variant:i===t?"primary":"secondary",children:[t,o?" ".concat(o):""]},t)})})},c=s.I4.div.withConfig({componentId:"sc-1b7c0bc1-0"})(["width:100%;display:flex;gap:2px;background:var(--color-md-blue-secondary);border-radius:9px;padding:2px;margin-bottom:32px;button{flex:1;border-radius:7px;}"]);var d=i(53626),x=i(14232),p=i(58546),h=i(15526),g=i(89099),u=i(99468),m=i(91056),j=i(15836),_=i(34094),f=i(52862);let v=()=>(0,n.jsxs)(b,{children:[(0,n.jsx)(o.UV,{}),(0,n.jsx)("div",{children:(0,n.jsx)(f.sA,{id:"resolver_drugs_loader"})})]}),b=s.I4.div.withConfig({componentId:"sc-28adc9f8-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:",";"],e=>e.theme.color.textLight);var I=i(86225);let w=e=>{let{chooseDrugOptions:t,isLoading:i,selectedSuggestionItem:o,onChooseDrugConfirm:s}=e,[l,a]=x.useState(o);return i||!t?(0,n.jsx)(m.IQ,{children:(0,n.jsx)(v,{})}):(0,n.jsxs)(m.IQ,{$hasFloatingButton:!0,children:[(0,n.jsxs)(r.KY,{$withBottomMargin:!0,children:[(0,n.jsxs)(y,{onClick:()=>a(o),children:[l.ix_id===o.ix_id&&(0,n.jsx)(A,{}),o.name]}),t.map(e=>(0,n.jsxs)(y,{onClick:t=>{t.defaultPrevented||a(e)},children:[l.uuid===e.uuid&&(0,n.jsx)(A,{}),(0,n.jsxs)(k,{children:[(0,n.jsx)("b",{children:e.name}),(0,n.jsx)("div",{children:e.active_ingredient})]}),(0,n.jsx)(C,{drugUuid:e.uuid})]},e.uuid))]}),(0,n.jsx)(I.Q,{onClick:()=>{s(l)},buttonCopyTranslationId:"resolver_drugs_screen_button"})]})},C=(0,s.I4)(_.Gl).withConfig({componentId:"sc-d6ed3cc6-0"})(["margin-left:auto;"]),y=s.I4.div.withConfig({componentId:"sc-d6ed3cc6-1"})(["display:flex;align-items:center;padding-left:40px;position:relative;cursor:pointer;"]),k=s.I4.div.withConfig({componentId:"sc-d6ed3cc6-2"})(["color:",";b{font-weight:400;color:",";}"],e=>{let{theme:t}=e;return t.color.textLight},e=>{let{theme:t}=e;return t.color.text}),A=(0,s.I4)(j.A).withConfig({componentId:"sc-d6ed3cc6-3"})(["width:16px;height:16px;position:absolute;left:16px;color:",";"],e=>{let{theme:t}=e;return t.color.mdBluePrimary});var S=i(11649),F=i(78191),T=i(32446),D=i(84002),R=i(23570);let L=e=>{let{item:t,removeItem:i,onReplace:r}=e,s=x.useMemo(()=>t.is_ingredient_combination||t.has_no_atcs,[t.is_ingredient_combination,t.has_no_atcs]);return(0,n.jsxs)(B,{children:[(0,n.jsx)("b",{children:t.name}),t.active_ingredient&&(0,n.jsx)("div",{children:t.active_ingredient}),(0,n.jsxs)($,{children:[(0,n.jsxs)(o.lD,{variant:"secondary",onClick:()=>{i(t)},children:[(0,n.jsx)(D.A,{}),(0,n.jsx)(f.sA,{id:"resolver_options_action_1"})]}),(0,n.jsxs)(o.lD,{disabled:s,variant:"secondary",onClick:()=>{s||r(t)},children:[(0,n.jsx)(R.A,{}),(0,n.jsx)(f.sA,{id:"resolver_options_action_2"})]})]})]})},M=e=>{let{interaction:t,onReplace:i}=e,{selectedInteractionsReducer:o}=(0,d.wv)(),{article:s}=(0,F.GJ)(t),{messages:l}=(0,f.tz)(),a=(0,F.sD)(),c=x.useMemo(()=>null==s?void 0:s.sections.find(e=>"Recommendation"===e.section_header),[s]),p=x.useCallback(e=>{a.IRRemoveItem({item:e,interaction:t}),o({type:"remove",item:e}),T.oR.info(l["drug-details-ic.drugs.removed-from-ic"])},[a,t,o,l]),h=t.item_1.is_ingredient_combination||t.item_2.is_ingredient_combination;return(0,n.jsxs)(m.IQ,{children:[(0,n.jsx)(N,{$withBottomMargin:!0,children:(0,n.jsx)(S.ux,{interaction:t})}),c&&(0,n.jsx)(r.KY,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("b",{children:c.section_header}),(0,n.jsx)("div",{children:c.text})]})}),(0,n.jsx)(r._x,{children:(0,n.jsx)(f.sA,{id:"resolver_options_section_title"})}),(0,n.jsxs)(r.KY,{$withBottomMargin:!h,children:[(0,n.jsx)(L,{item:t.item_1,removeItem:p,onReplace:i}),(0,n.jsx)(L,{item:t.item_2,removeItem:p,onReplace:i})]}),h&&(0,n.jsx)(m.Z3,{children:(0,n.jsx)(f.sA,{id:"resolver_options_explanation"})})]})},$=s.I4.div.withConfig({componentId:"sc-1ba6e39f-0"})(["display:flex;gap:8px;margin-top:8px;button{flex:1;svg{width:20px;height:20px;}>
1 div span{display:flex;align-items:center;gap:6px;}}"]),B=s.I4.div.withConfig({componentId:"sc-1ba6e39f-1"})(["display:flex;flex-direction:column;"]),N=(0,s.I4)(r.KY).withConfig({componentId:"sc-1ba6e39f-2"})(["> *{background:transparent;}"]);var P=i(96631),z=i(79819),O=i(21437);let H=e=>{let{data:t,onSelect:i,isFetching:s,ignoreSelectedInteractions:l,query:a,onLoadMore:c,isFetchingNextPage:p}=e,{selectedInteractions:h}=(0,d.wv)(),g=!t||!t.length,u=x.useCallback(e=>{e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight&&c()},[c]);return a?s&&!t?(0,n.jsx)(E,{$empty:!0,children:(0,n.jsx)(K,{$fixedHeight:!0,children:(0,n.jsxs)(Q,{$gap:8,children:[(0,n.jsx)(o.UV,{}),(0,n.jsx)(f.sA,{id:"resolver_drugs_loader"})]})})}):g?(0,n.jsx)(E,{$empty:!0,children:(0,n.jsx)(K,{$fixedHeight:!0,children:(0,n.jsx)(f.sA,{id:"common.search.empty"})})}):(0,n.jsx)(E,{onScroll:u,children:(0,n.jsxs)(r.KY,{children:[t.map((e,t)=>{let r=!l&&h.items.find(t=>t.ix_id===e.ix_id)?"remove":"add";return(0,n.jsx)(_.Ay,{query:a,item:e,action:r,onSelect:()=>{i({type:r,item:e,index:t})}},e.ix_id)}),p&&(0,n.jsx)(K,{children:(0,n.jsx)(o.UV,{})})]})}):(0,n.jsx)(E,{$empty:!0,children:(0,n.jsx)(K,{$fixedHeight:!0,children:(0,n.jsxs)(Q,{$gap:24,children:[(0,n.jsx)(O.A,{darkSrc:"empty-search-dark.svg",lightSrc:"empty-search-light.svg",width:120,height:121}),(0,n.jsx)(f.sA,{id:"drug-list.search.placeholder-long"})]})})})},E=s.I4.div.withConfig({componentId:"sc-233e5412-0"})(["position:absolute;left:0;right:0;z-index:10;margin-top:4px;max-height:420px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:"," transparent;border:1px solid var(--cool-grey-grey750);background:",";border-radius:12px;box-shadow:0 12px 24px 0 ",";@media (max-height:760px){max-height:350px;}@media (max-height:630px){max-height:260px;}",""],e=>{let{theme:t}=e;return t.color.gray},e=>{let{theme:t}=e;return t.color.backgroundSecond},e=>e.theme.color.boxShadow1,e=>{let{$empty:t}=e;return t&&(0,s.AH)(["background:",";"],e=>{let{theme:t}=e;return t.color.backgroundFirst})}),K=s.I4.div.withConfig({componentId:"sc-233e5412-1"})(["display:flex;justify-content:center;align-items:center;color:",";text-align:center;",""],e=>{let{theme:t}=e;return t.color.textLight},e=>{let{$fixedHeight:t}=e;return t&&(0,s.AH)(["height:320px;padding:64px;align-items:unset;@media (max-height:630px){height:240px;padding:32px;}"])}),Q=s.I4.div.withConfig({componentId:"sc-233e5412-2"})(["display:flex;flex-direction:column;align-items:center;gap:","px;"],e=>{let{$gap:t}=e;return t});var q=i(39223),U=i(43590);let Y=e=>{let{onSelect:t,whiteBackground:i,placeholderKey:r,ignoreSelectedInteractions:o,feature:s,showEmptyState:l,includeSubstancesWithoutAtc:a}=e,{locale:c}=(0,g.useRouter)(),{user:d}=(0,u.ur)(),[h,m]=x.useState(""),j=(0,F.sD)(),[_,f]=x.useState(!1),{data:v,isFetching:b,fetchNextPage:I,isFetchingNextPage:w}=(0,z.q)({queryKey:["interactionsSearchApi",c,h],queryFn:e=>{let{pageParam:t}=e;return j.SearchPagination({pageParam:t,query:h,feature:s}),(0,p.UP)({locale:c,query:h,user:d,page:t,includeSubstancesWithoutAtc:a})},getNextPageParam:(e,t)=>{if(!((null==e?void 0:e.length)<20))return t.length+1},enabled:!!h}),C=x.useMemo(()=>{if(v&&v.pages)return v.pages.flatMap(e=>e)},[v]);return x.useEffect(()=>{!C&&h&&j.ICNoResult(h)},[j,h,C]),x.useEffect(()=>{h&&j.SearchPerformed({query:h,from:s})},[s,j,h]),(0,n.jsxs)(J,{children:[(0,n.jsx)(q.A,{shallowNavigation:!0,whiteBackground:i,clearOnBlur:!0,placeholderKey:r,customQueryHandler:m,onFocus:()=>{f(!0)},onCancelSearch:()=>{f(!1)},noAutoFocus:l}),(v||b||l&&_)&&(0,n.jsx)(H,{query:h,isFetching:b,isFetchingNextPage:w,data:C,onLoadMore:()=>I(),onSelect:e=>{"add"===e.type?j.ICAddItem({item:e.item,from:s}):j.ICRemoveItem(),(0,U.J0)(U.lB.InteractionsMeaningfulAction),t({type:e.type,item:e.item}),m("")},ignoreSelectedInteractions:o})]})},J=s.I4.div.withConfig({componentId:"sc-8ba9c8e6-0"})(["position:relative;width:100%;"]);var V=i(28866);let W=()=>(0,n.jsxs)(G,{children:[(0,n.jsx)(O.A,{darkSrc:"resolver-no-alternatives-dark.svg",lightSrc:"resolver-no-alternatives-light.svg",width:120,height:98}),(0,n.jsx)(f.sA,{id:"resolver_alternatives_nothing_found"})]}),G=s.I4.div.withConfig({componentId:"sc-b9ac0157-0"})(["padding:64px 32px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:16px;color:",";font-size:14px;img{width:120px;height:auto;}"],e=>{let{theme:t}=e;return t.color.textLight}),X=e=>{let{isLoadingFetchSuggestions:t,isLoadingFetchInteractionsSingle:i,onSuggestionSelect:o,otherSuggestions:s,suggestions:l,onSearchSelect:a,replaceItem:c,onInfoCl
1ick:d}=e,{messages:x}=(0,f.tz)();return(0,n.jsx)(m.IQ,{children:t?(0,n.jsx)(v,{}):(0,n.jsxs)("div",{children:[(0,n.jsxs)(et,{children:[(0,n.jsx)("b",{children:c.name}),c.active_ingredient&&(0,n.jsx)("div",{children:c.active_ingredient})]}),(0,n.jsx)(Y,{whiteBackground:!0,placeholderKey:"resolver_search_screen_title",onSelect:a,ignoreSelectedInteractions:!0,feature:"Interactions resolver",showEmptyState:!0,includeSubstancesWithoutAtc:!1}),(0,n.jsxs)(ee,{children:[(s.length>0||i)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r._x,{children:(0,n.jsx)(f.sA,{id:"resolver_searched_section_title"})}),(0,n.jsxs)(r.KY,{children:[s.map(e=>(0,n.jsx)(P.A,{suggestion:e,onClick:()=>o(e)},e.item.ix_id)),i&&(0,n.jsx)(v,{})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)(Z,{children:[(0,V.sprintf)(x.resolver_alternatives_section_title,null==l?void 0:l.atc.name),(0,n.jsx)(r.xv,{onClick:d})]}),(0,n.jsx)(r.KY,{children:(null==l?void 0:l.suggestions.length)?l.suggestions.map(e=>(0,n.jsx)(P.A,{suggestion:e,onClick:()=>o(e)},e.item.ix_id)):(0,n.jsx)(W,{})})]})]})]})})},Z=(0,s.I4)(r._x).withConfig({componentId:"sc-b9ac0157-1"})(["display:flex;gap:20px;align-items:center;svg{color:",";}"],e=>{let{theme:t}=e;return t.color.textLink}),ee=s.I4.div.withConfig({componentId:"sc-b9ac0157-2"})(["display:flex;flex-direction:column;margin-bottom:40px;"]),et=s.I4.div.withConfig({componentId:"sc-b9ac0157-3"})(["margin-bottom:32px;padding:0 16px;b + div{margin-top:4px;font-size:14px;color:",";}"],e=>{let{theme:t}=e;return t.color.textLight});var ei=i(96913),en=i(89106);let er=e=>{let{replaceItem:t,originalInteractionItem:i,interaction:s,selectedSuggestion:l,onConfirmReplacement:a,showInteractionDetails:c}=e,d=0===l.interactions.length,p=x.useMemo(()=>l.interactions.map(e=>({...e,item_1:e.item_1.ix_id===i.ix_id?{...e.item_1,...l.item}:e.item_1,item_2:e.item_2.ix_id===i.ix_id?{...e.item_2,...l.item}:e.item_2})),[l.interactions,l.item,i]),h=x.useCallback(e=>"drug"===e?(0,n.jsx)(ei.A,{}):(0,n.jsx)(en.A,{}),[]);return(0,n.jsxs)(m.IQ,{$hasFloatingButton:!0,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(r._x,{$noMarginTop:!0,children:(0,n.jsx)(f.sA,{id:"resolver_confirm_section_1_title"})}),(0,n.jsxs)(eo,{$noMarginTop:!0,children:[(0,n.jsxs)(el,{children:[(0,n.jsx)(ea,{children:h(t.type)}),(0,n.jsx)("b",{children:t.name})]}),(0,n.jsx)(S.ux,{interaction:s}),(0,n.jsx)(ec,{children:(0,n.jsx)(o.lD,{variant:"secondary",onClick:()=>c(s),children:(0,n.jsx)(f.sA,{id:"ic_button_details"})})})]}),(0,n.jsx)(r.jP,{children:(0,n.jsx)(es,{})}),(0,n.jsx)(r._x,{$noMarginTop:!0,children:(0,n.jsx)(f.sA,{id:"resolver_confirm_section_2_title"})}),(0,n.jsxs)(eo,{$withBottomMargin:!d,$noMarginTop:!0,children:[(0,n.jsxs)(el,{children:[(0,n.jsx)(ea,{children:h(l.item.type)}),(0,n.jsx)("b",{children:l.item.name})]}),d?(0,n.jsx)(S.ux,{}):p.map(e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.ux,{interaction:e},e.item_1.ix_id+e.item_2.ix_id),(0,n.jsx)(ec,{children:(0,n.jsx)(o.lD,{variant:"secondary",onClick:()=>c(e),children:(0,n.jsx)(f.sA,{id:"ic_button_details"})})})]}))]}),d&&(0,n.jsx)(m.Z3,{children:(0,n.jsx)(f.sA,{id:"resolver_confirm_no_interactions_footer"})})]}),(0,n.jsx)(I.Q,{onClick:()=>{a()},buttonCopyTranslationId:"resolver_confirm_button"})]})},eo=(0,s.I4)(r.KY).withConfig({componentId:"sc-590984e0-0"})([""]),es=(0,s.I4)(R.A).withConfig({componentId:"sc-590984e0-1"})(["width:44px;height:44px;margin:32px auto;color:",";text-align:center;"],e=>{let{theme:t}=e;return t.color.textLight}),el=s.I4.div.withConfig({componentId:"sc-590984e0-2"})(["align-items:center;display:flex;gap:16px;margin-bottom:2px;"]),ea=s.I4.div.withConfig({componentId:"sc-590984e0-3"})(["height:29px;width:29px;"]),ec=s.I4.div.withConfig({componentId:"sc-590984e0-4"})(["display:flex;margin-bottom:2px;padding-top:0;button{width:100%;}"]);var ed=i(7034);let ex=e=>{let{interaction:t,onShowInfo:i}=e;return(0,n.jsx)(m.IQ,{children:(0,n.jsx)(ed.A,{inModal:!0,interaction:t,onShowInfo:i})})};var ep=i(2225),eh=i(84721),eg=function(e){return e[e.Step1Options=0]="Step1Options",e[e.Step2Alternatives=1]="Step2Alternatives",e[e.SubStep2Info=2]="SubStep2Info",e[e.Step3ChooseDrug=3]="Step3ChooseDrug",e[e.Step4Confirm=4]="Step4Confirm",e[e.SubStep4InteractionDetail
1s=5]="SubStep4InteractionDetails",e[e.SubStep4InteractionDetailsLegend=6]="SubStep4InteractionDetailsLegend",e}(eg||{});let eu=["resolver_screen_title","resolver_alternatives_screen_title","resolver_legend_screen_title","resolver_drugs_screen_title","resolver_confirm_screen_title","ic.interaction.title","common.legend_screen_title"],em=e=>{let{interaction:t}=e,i=(0,F.sD)(),{messages:r}=(0,f.tz)(),{selectedInteractions:s,selectedInteractionsReducer:l,getSelectedXIds:a}=(0,d.wv)();(0,F.GJ)(t);let[c,j]=x.useState(!1),[_,v]=x.useState(!1),[b,I]=x.useState(eu[0]),[C,y]=x.useState(null),[k,A]=x.useState(null),[D,R]=x.useState(null),[L,$]=x.useState(null),[B,N]=x.useState(null),[P,z]=x.useState([]),[O,H]=x.useState(null),[E,K]=x.useState(null),{locale:Q}=(0,g.useRouter)(),{user:q}=(0,u.ur)(),{mutate:U,isLoading:Y}=(0,h.n)({mutationFn:p.tx}),{mutate:J,isLoading:V}=(0,h.n)({mutationFn:p.f2}),{mutate:W,isLoading:G}=(0,h.n)({mutationFn:p.m0}),Z=x.useCallback(e=>{i.IRReplaceItem({item:e,interaction:t}),$(e),I(eu[1]),U({...a(e.ix_id),[(0,p.SS)(e)]:e.ix_id,user:q,locale:Q},{onSuccess:e=>{0===e.suggestions.length&&i.IRNoATCResult(),N(e)}})},[i,t,U,a,q,Q]),ee=x.useCallback(e=>{let{item:t,type:i}=e;if("remove"===i)return void z(e=>e.filter(e=>e.item.ix_id!==t.ix_id));W({...a(L.ix_id),[(0,p.SS)(t)]:t.ix_id,locale:Q,user:q},{onSuccess:e=>{z(i=>[...i,{item:t,interactions:e.interactions}])}})},[W,a,L,z,Q,q]),et=x.useCallback(e=>{K({item:e,interactions:E.interactions}),A({step:3,selectedSuggestion:E}),I(eu[4])},[E]),ei=x.useCallback(e=>{if("drug"===e.item.type){i.IRSelectAlternative({interaction:t,suggestion:e,replaceItem:L}),H(e.item),K(e),A({step:1,selectedSuggestion:null}),I(eu[4]);return}H(e.item),K(e),I(eu[3]),J({id:e.item.ix_id,locale:Q,user:q,..."drug"===L.type?{replacing_drug_ix_id:L.ix_id}:{replacing_substance_ix_id:L.ix_id}},{onSuccess:e=>{R(e)}})},[J,t,Q,i,L,q]),en=x.useCallback(()=>{v(!1),I(eu[0]),$(null),N(null),H(null),z([]),R(null),z([]),K(null),j(!1)},[]),eo=x.useCallback(()=>{if(b===eu[0])return void en();j(!0)},[b,en]),es=x.useCallback(()=>{switch(b){case eu[2]:I(eu[1]);break;case eu[1]:$(null),I(eu[0]);break;case eu[3]:K(null),R(null),I(eu[1]);break;case eu[4]:I(eu[k.step]),K(k.selectedSuggestion);break;case eu[5]:I(eu[4]);break;case eu[6]:I(eu[5])}},[b,k]),el=x.useCallback(()=>{E&&(l({type:"set",newState:{items:[...s.items.filter(e=>e.ix_id!==L.ix_id),E.item]}}),T.oR.info(r.resolver_message_replace_success)),eo()},[r,eo,L,s.items,l,E]),ea=x.useCallback(e=>{i.ICInteractionOpened(e,"Interactions resolver"),y(e),I(eu[5])},[i]),ec=x.useMemo(()=>{switch(b){case eu[0]:return(0,n.jsx)(M,{onReplace:Z,interaction:t});case eu[1]:return(0,n.jsx)(X,{isLoadingFetchSuggestions:Y,isLoadingFetchInteractionsSingle:G,onSuggestionSelect:ei,otherSuggestions:P,suggestions:B,onSearchSelect:ee,replaceItem:L,onInfoClick:()=>I(eu[2])});case eu[2]:return(0,n.jsxs)(m.IQ,{children:[(0,n.jsx)(S.JP,{noMarginTop:!0}),(0,n.jsx)(S.eG,{purpose:"resolver"})]});case eu[3]:return(0,n.jsx)(w,{isLoading:V,chooseDrugOptions:D,selectedSuggestionItem:E.item,onChooseDrugConfirm:et});case eu[4]:return(0,n.jsx)(er,{interaction:t,originalInteractionItem:O,replaceItem:L,selectedSuggestion:E,onConfirmReplacement:el,showInteractionDetails:ea});case eu[5]:return(0,n.jsx)(ex,{interaction:C,onShowInfo:()=>I(eu[6])});case eu[6]:return(0,n.jsxs)(m.IQ,{children:[(0,n.jsx)(S.eG,{noMarginTop:!0}),(0,n.jsx)(S.V2,{})]})}},[b,Z,t,Y,G,ei,P,B,ee,L,V,D,E,et,el,ea,C,O]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.lD,{variant:"secondary",onClick:()=>{i.IRResolveInteraction(t),v(!0)},children:(0,n.jsx)(f.sA,{id:"ic_button_resolve"})}),(0,n.jsx)(eh.A,{show:_,currentStep:b,steps:eu,onBack:es,onHide:eo,children:ec}),(0,n.jsx)(ep.A,{show:c,onClose:()=>{j(!1)},onConfirm:en,onCancelTranslationId:"resolver_dialog_action_button_cancel",onConfirmTranslationId:"resolver_dialog_action_button_distructive",titleTranslationId:"resolver_dialog_title",messageTranslationId:"resolver_dialog_explanation"})]})};var ej=i(72912),e_=i(40469),ef=i(93694);let ev=()=>{let e=(0,e_.P8)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsx)(m.c3,{children:(0,n.jsx)(f.sA,{id:"ic.navigation.title"})})}),(0,n.jsxs)(m.gA,{$height:448,children:[(0,n.jsx)(r.kd,{children:(0,n.jsx)(ej.aW,{})}),(0,n.jsx)(m.pK,{$marginTop:0,children:(0,n.jsx)(f.sA,{id:"interactions_web_locked_state_body_text"})}),(0,n.jsx)(eA,{variant:"teal",size:"lg",onClick:()=>{e({variant:e_.NR.Interactions,triggerLocation:"IC tab"})},children:(0,n.jsx)(f.sA,{id:"common-ic_popup_cta"})}),(0,n.jsx)(m.pK,{children:(0,n.jsx)(f.ZL,{id:"Pro_to_web_ic_popup_text_above_login"})})]})]})},eb=()=>{let{fetchInteractions:e,interactionsFetchError:t}=(0,d.wv)(),{title:i,description:s}=x.useMemo(()=>"too_many_substances"===t?{title:"ic_error_max_substances_title",description:"ic_error_max_substances_description"}:{title:"ic.error.general.title",description:"ic.error.general.description"},[t]);return t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsx)(m.c3,{children:(0,n.jsx)(f.sA,{id:"ic.navigation.title"})})}),(0,n.jsx)(m.gA,{$height:448,children:(0,n.jsxs)(eI,{children:[(0,n.jsx)("b",{children:(0,n.jsx)(f.sA,{id:i})}),(0,n.jsx)("p",{children:(0,n.jsx)(f.sA,{id:s})}),"too_many_substances"!==t&&(0,n.jsx)(o.lD,{onClick:()=>{e()},children:(0,n.jsx)(f.sA,{id:"ic.action.try-again"})})]})})]}):null},eI=s.Ay.div.withConfig({componentId:"sc-13bf728e-0"})(["b{margin-bottom:8px;display:block;}p{max-width:300px;margin:0 auto 32px;}text-align:center;"]),ew=e=>{let{onViewDetails:t}=e,{userFeatures:i}=(0,u.ur)(),{interactions:s,interactionsFetchError:l,isLoading:a,selectedInteractions:c}=(0,d.wv)();return i.interactions?a?(0,n.jsx)(ej.gm,{}):l?(0,n.jsx)(eb,{error:l}):s?(null==s?void 0:s.interactions.length)===0?(0,n.jsx)(ej.Nd,{}):(0,n.jsxs)(eC,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsx)(m.c3,{children:(0,n.jsx)(f.sA,{id:"ic.navigation.title"})})}),s.interactions.map((e,i,s)=>(0,n.jsxs)(r.KY,{$withBottomMargin:i!==s.length-1,children:[(0,n.jsx)(S.ux,{interaction:e,hideNames:!0}),(0,n.jsx)(ef.A,{interaction:e}),(0,n.jsxs)(ey,{children:[(0,n.jsx)("div",{children:e.article.text}),(0,n.jsxs)(ek,{children:[(0,n.jsx)(o.lD,{variant:"secondary",onClick:()=>t(e),children:(0,n.jsx)(f.sA,{id:"ic_button_details"})}),(0,n.jsx)(em,{interaction:e})]})]})]},e.item_1.name+e.item_2.name))]}):(0,n.jsx)(ej.J,{}):c.items.length<2?(0,n.jsx)(ej.J,{}):(0,n.jsx)(ev,{})},eC=s.Ay.div.withConfig({componentId:"sc-13bf728e-1"})([""]),ey=s.Ay.div.withConfig({componentId:"sc-13bf728e-2"})(["line-height:20px;"]),ek=s.Ay.div.withConfig({componentId:"sc-13bf728e-3"})(["display:flex;margin-top:16px;gap:8px;button{flex:1;}"]),eA=(0,s.Ay)(o.lD).withConfig({componentId:"sc-13bf728e-4"})(["margin-top:18px;"]);var eS=i(87936),eF=i(76700),eT=i(27773),eD=i(60160),eR=i(76717);let eL=e=>{let{children:t,tooltip:i,id:r,disableTooltip:o,placement:s="bottom-end",className:l,forceShow:a=!1}=e,[c,d]=x.useState(!1),[p,h]=x.useState(!1),g=r+x.useId();return x.useEffect(()=>{o&&h(!0)},[o]),x.useEffect(()=>{let e=!a&&localStorage.getItem(r);if(p)return void d(!1);if(!e){d(!0);let e=document.querySelector('[data-tooltip-id="'.concat(g,"]"));if(!e)return;e.dispatchEvent(new MouseEvent("mouseover",{view:window,bubbles:!0,cancelable:!0}))}}
1,[g,p,r,a]),(0,n.jsxs)(n.Fragment,{children:[x.cloneElement(t,{"data-tooltip-id":g}),(0,n.jsxs)(e$,{id:g,isOpen:c,place:s,$isOpen:c,className:l,children:[i,(0,n.jsx)(eM,{onClick:e=>{e.stopPropagation(),d(!1),localStorage.setItem(r,"true")},children:(0,n.jsx)(eD.A,{})})]})]})},eM=s.I4.div.withConfig({componentId:"sc-a86dca4d-0"})(["cursor:pointer;position:absolute;top:8px;right:8px;svg{width:22px;height:22px;}"]),e$=(0,s.I4)(eR.Tooltip).withConfig({componentId:"sc-a86dca4d-1"})(["z-index:1;background:"," !important;border-radius:12px !important;box-shadow:0px 0px 20px 0px rgba(0,0,0,0.16) !important;color:"," !important;max-width:300px !important;padding:12px 24px 12px 16px !important;pointer-events:none;font-size:15px;"," b{font-size:17px;margin-right:22px;}"],e=>{let{theme:t}=e;return t.color.backgroundFirst},e=>{let{theme:t}=e;return t.color.text},e=>{let{$isOpen:t}=e;return t&&(0,s.AH)(["pointer-events:all !important;"])});var eB=i(92393),eN=i(22182),eP=i(85500),ez=i(94085);let eO=()=>{let{mixpanel:e}=(0,eN.Hq)(),{messages:t}=(0,f.tz)(),i=x.useCallback(i=>{let{data:r,interactionsList:o}=i;return(T.oR.info((0,n.jsx)("div",{children:(0,n.jsx)(eB.A,{url:"https://mediately1.typeform.com/to/SvAXaRJT",onFeedback:t=>{null==e||e.track(eP.ef.SearchUploadFeedback,{Feedback:t?"Positive":"Negative"})},titleKey:"ic_ocr_message_feedback",isInToastMessage:!0})}),{delay:5e3,autoClose:!1,toastId:"ocr-feedback-toast",position:ez.Fr?"bottom-right":"top-right"}),o.length>0&&!r.meta.has_drugs_that_arent_for_interactions)?void T.oR.info(t.ic_ocr_message_success,{position:ez.Fr?"bottom-right":"top-right",autoClose:4e3,pauseOnHover:!1}):o.length>0&&r.meta.has_drugs_that_arent_for_interactions?void T.oR.error(t.ic_ocr_message_error_some_drugs_found,{position:ez.Fr?"bottom-right":"top-right",autoClose:4e3,pauseOnHover:!1}):0===o.length?void T.oR.error(t.ic_ocr_message_error_nothing_found,{position:ez.Fr?"bottom-right":"top-right",autoClose:4e3,pauseOnHover:!1}):void 0},[e,t]),r=x.useCallback(t=>{var i;let{data:n,interactionsList:r,error:o,type:s}=t,l="";n?r&&r.length>0?l="Success":r&&0===r.length&&n.meta.has_drugs_that_arent_for_interactions?l="Drug not recognized":r&&0===r.length&&(l="No drugs found"):l="Failed",null==e||e.track(eP.ef.SearchUploadComplete,{From:"IC",Status:l,"Number of items recognized":null!=(i=null==r?void 0:r.length)?i:0,"Recognized item names":null==r?void 0:r.map(e=>e.name).join(", "),"Query ID":n?n.meta.query_id:null,Error:o,Type:s})},[e]);return{openToastMessages:i,trackSearchCompleted:r,trackImageInserted:x.useCallback(t=>{let{image:i,uploadType:n}=t;i&&(null==e||e.track(eP.ef.SearchInputInserted,{From:"IC",Format:i.type,"Upload type":n,Type:"Image"}))},[e]),trackTextPaste:x.useCallback(()=>{null==e||e.track(eP.ef.SearchInputInserted,{From:"IC",Format:"Plain text","Upload type":"Text paste",Type:"text"})},[e])}};var eH=i(7431),eE=i(71440);let eK=()=>(0,n.jsxs)(eU,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("b",{children:(0,n.jsx)(f.sA,{id:"ic_ocr_image_field_title"})})}),(0,n.jsx)("p",{children:(0,n.jsx)(f.sA,{id:"ic_ocr_image_field_explanation"})}),(0,n.jsx)(o.lD,{variant:"outlined",children:(0,n.jsx)(f.sA,{id:"ic_ocr_image_field_button"})})]}),eQ=()=>(0,n.jsx)(eq,{children:(0,n.jsxs)(o.lD,{children:[(0,n.jsx)(eE.A,{}),(0,n.jsx)(f.sA,{id:"ic_ocr_image_menu_take_photo"})]})}),eq=s.I4.div.withConfig({componentId:"sc-4d0e1e2c-0"})(["position:absolute;top:50%;left:50%;pointer-events:none;transform:translate(-50%,-50%);button{width:max-content;svg{width:22px;height:22px;}span{display:flex;gap:8px;align-items:center;}}"]),eU=s.I4.div.withConfig({componentId:"sc-4d0e1e2c-1"})(["background:",";border-radius:12px;border:1px dashed ",";pointer-events:none;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:16px;p{margin-bottom:0;color:",";font-size:12px;b{color:",";font-size:14px;}}button{margin-top:16px;}"],e=>{let{theme:t}=e;return t.color.backgroundFirst},e=>{let{theme:t}=e;return t.color.textLight},e=>{let{theme:t}=e;return t.color.textLight},e=>{let{theme:t}=e;return t.color.text});var eY=i(74391),eJ=i(50656);let eV=()=>
1{let[e,t]=x.useState(!1);return(0,n.jsx)(eG,{variant:"warning",children:(0,n.jsxs)(eW,{children:[(0,n.jsx)(eJ.A,{}),(0,n.jsxs)("div",{children:[(0,n.jsx)(f.sA,{id:"ic_ocr_privacy_warning"})," ",(0,n.jsx)("a",{href:"#",onClick:()=>{t(!0)},children:(0,n.jsx)(f.sA,{id:"ic_ocr_privacy_read_more"})}),(0,n.jsx)(ep.A,{show:e,onClose:()=>{t(!1)},onCancelTranslationId:"resolver_search_error_button",messageTranslationId:"ic_ocr_privacy_disclaimer"})]})]})})},eW=s.I4.div.withConfig({componentId:"sc-7570e88e-0"})(["display:flex;align-items:center;gap:12px;svg{flex-shrink:0;color:var(--color-restriction-caution);width:24px;height:auto;}"]),eG=(0,s.I4)(eY.A).withConfig({componentId:"sc-7570e88e-1"})(["margin-top:32px;"]);var eX=i(54342);let eZ=e=>{let{loading:t,imgSrc:i,selectedImage:r,setSelectedImage:s,textValue:l,setTextValue:a,fileDragged:c,setFileDragged:d,onSubmit:p,isTextToLong:h,show:g}=e,{trackImageInserted:u,trackTextPaste:j}=eO(),{messages:_}=(0,f.tz)(),[v,b]=(0,eH.iQ)();return x.useEffect(()=>{setTimeout(()=>{b()},0)},[g,b]),(0,n.jsxs)(m.IQ,{children:[t?(0,n.jsx)(m.IQ,{children:(0,n.jsxs)(e1,{children:[(0,n.jsx)(o.UV,{}),(0,n.jsx)(e0,{children:(0,n.jsx)(f.sA,{id:"ic_ocr_loader"})})]})}):i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e8,{onClick:()=>{s(null)},children:(0,n.jsx)(f.sA,{id:"ic_ocr_image_clear"})}),(0,n.jsx)(e5,{children:(0,n.jsx)("img",{src:i,alt:"Selected image"})})]}):(0,n.jsx)(n.Fragment,{children:ez.Fr?(0,n.jsxs)(e4,{children:[(0,n.jsx)(e6,{type:"file",accept:"image/*",multiple:!0,onChange:e=>{var t;d(!1);let i=null==(t=e.target.files)?void 0:t[0];u({image:i,uploadType:"File upload"}),s(i)}}),(0,n.jsx)(eQ,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(e2,{children:[(0,n.jsx)(e6,{$active:c,onDragEnter:()=>{d(!0)},onDragLeave:()=>{d(!1)},onDragExit:()=>{d(!1)},onDrop:e=>{d(!1);let t=e.dataTransfer.files&&e.dataTransfer.files[0];u({image:t,uploadType:"Drag & drop"}),s(t)},type:"file",accept:"image/*",onChange:e=>{var t;d(!1);let i=null==(t=e.target.files)?void 0:t[0];u({image:i,uploadType:"File upload"}),s(i)}}),(0,n.jsx)(eK,{})]}),(0,n.jsx)(eX.A,{smallMargins:!0}),(0,n.jsxs)(e7,{children:[(0,n.jsx)(e3,{ref:v,onPaste:e=>{let t=e.clipboardData.files&&e.clipboardData.files[0];if(!t)return void j();u({image:t,uploadType:"Image paste"}),s(t)},placeholder:_.ic_ocr_text_placeholder,onChange:e=>{a(e.target.value)}}),(0,n.jsx)(te,{$hide:!!l,children:(0,n.jsx)(f.ZL,{id:"ic_ocr_screenshot_instructions"})}),(0,n.jsxs)(e9,{$disabled:h,children:[(null==l?void 0:l.length)||0," / ",ts]})]})]})}),!t&&(0,n.jsxs)(n.Fragment,{children:[ez.Fr&&!r?null:(0,n.jsx)(o.lD,{disabled:!r&&(h||!l),onClick:p,children:(0,n.jsx)(f.sA,{id:"ic_ocr_button_add"})}),(0,n.jsx)(eV,{})]})]})},e0=s.I4.div.withConfig({componentId:"sc-14222c75-0"})(["opacity:0;animation:fadeIn 0.5s forwards;@keyframes fadeIn{from{opacity:0;transform:translateX(100%);}to{opacity:1;}}"]),e1=s.I4.div.withConfig({componentId:"sc-14222c75-1"})(["display:flex;flex-direction:column;gap:18px;align-items:center;"]),e2=s.I4.div.withConfig({componentId:"sc-14222c75-2"})(["position:relative;"]),e4=s.I4.div.withConfig({componentId:"sc-14222c75-3"})(["--wrapper-height:261px;position:relative;min-height:var(--wrapper-height);display:flex;justify-content:center;align-items:center;background:",";border-radius:12px;border:1px solid ",";margin-top:8px;input{bottom:calc((var(--wrapper-height) / 2) - 22px);}"],e=>{let{theme:t}=e;return t.color.backgroundFirst},e=>{let{theme:t}=e;return t.color.textLight}),e6=s.I4.input.withConfig({componentId:"sc-14222c75-4"})(["opacity:0;position:absolute;inset:0;opacity:0;cursor:pointer;",""],e=>{let{$active:t}=e;return t&&(0,s.AH)(["+ div{border:1px solid ",";}"],e=>{let{theme:t}=e;return t.color.mdBluePrimary})}),e3=s.I4.textarea.withConfig({componentId:"sc-14222c75-5"})(["background:",";padding:16px;border-radius:12px;border:1px solid ",";margin-bottom:16px;max-height:200px;min-height:200px;min-width:100%;max-width:100%;&::placeholder{color:",";opacity:1;}"],e=>{let{theme:t}=e;return t.color.backgroundFirst},e=>{let{theme:t}=e;return t.color.textLight},e=>{let{theme:t}=e;return t.color.textLight}),e5=s.I4.div.withConfig({componentId:"sc-14222c75-6"})(["--ocr-img-height:336px;margin-bottom:16px;position:relative;max-height:var(--ocr-img-height);min-height:var(--ocr-img-height);display:flex;justify-content:center;align-items:center;border-radius:12px;border:1px solid ",";background:",";overflow:hidden;img{margin:0 auto;max-width:100%;max-height:var(--ocr-img-height);min-height:var(--ocr-img-height);height:auto;object-fit:contain;}@media (max-width:","){--ocr-img-height:261px;}"],e=>{let{theme:t}=e;return t.color.textLight},e=>{let{theme:t}=e;return t.color.backgroundFirst},e=>e.theme.gridBreakpoints.mdMax),e8=s.I4.div.withConfig({componentId:"sc-14222c75-7"})(["color:",";width:fit-content;margin:0 0 8px auto;&:hover{cursor:pointer;text-decoration:underline;}"],e=>{let{theme:t}=e;return t.color.mdBluePrimary}),e7=s.I4.div.withConfig({componentId:"sc-14222c75-8"})(["position:relative;"]),e9=s.I4.div.withConfig({componentId:"sc-14222c75-9"})(["z-index:1;position:absolute;bottom:42px;right:16px;font-size:12px;color:",";pointer-events:none;",""],e=>{let{theme:t}=e;return t.color.textLight},e=>{let{$disabled:t}=e;return t&&(0,s.AH)(["color:",";"],e=>{let{theme:t}=e;return t.color.red})}),te=s.I4.div.withConfig({componentId:"sc-14222c75-10"})(["position:absolute;top:72px;left:16px;color:",";font-size:14px;pointer-events:none;",""],e=>{let{theme:t}=e;return t.color.textLight},e=>{let{$hide:t}=e;return t&&(0,s.AH)(["display:none;"])}),tt=()=>(0,n.jsx)(ti,{children:(0,n.jsx)("h2",{children:(0,n.jsx)(f.sA,{id:"ic_ocr_screen_title"})})}),ti=s.I4.div.withConfig({componentId:"sc-16f21f39-0"})(["display:flex;gap:20px;align-items:center;justify-content:center;flex-grow:1;padding:0 40px 0 16px;h2{font-size:20px;@media (max-width:","){font-size:14px;}}"],e=>e.theme.gridBreakpoints.lgMax);var tn=i(83587),tr=i(50859),to=i.n(tr);let ts=12e3,tl=()=>{let{mixpanel:e}=(0,eN.Hq)(),{setOcrModalOpened:t,ocrModalOpened:i}=(0,d.wv)(),{userFeatures:r}=(0,u.ur)(),s=(0,e_.P8)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(eL,{id:"ocr-modal-new-feature",disableTooltip:i||!r.interactions,tooltip:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:(0,n.jsx)("b",{children:(0,n.jsx)(f.sA,{id:"ic_ocr_tip_title"})})}),(0,n.jsx)("div",{children:(0,n.jsx)(f.sA,{id:"ic_ocr_tip_description"})})]}),children:(0,n.jsxs)(o.lD,{onClick:()=>
1{if((0,U.J0)(U.lB.InteractionsMeaningfulAction),!r.interactions)return void s({variant:e_.NR.OCR,triggerLocation:"IC tab"});t(!0),null==e||e.track(eP.ef.SearchUploadOpened,{From:"IC"})},children:[(0,n.jsx)(td,{}),(0,n.jsx)(tc,{children:(0,n.jsx)(f.sA,{id:"ic_ocr_button"})})]})})})},ta=()=>{let{messages:e}=(0,f.tz)(),[t,i]=x.useState(null),[r,o]=x.useState(null),[s,l]=x.useState(null),[a,c]=x.useState(!1),{locale:m}=(0,g.useRouter)(),{user:j}=(0,u.ur)(),[_,v]=x.useState(!1),{selectedInteractionsReducer:b,setOcrModalOpened:w,ocrModalOpened:C}=(0,d.wv)(),{openToastMessages:y,trackSearchCompleted:k}=eO(),A=!!s&&s.length>ts,S=x.useCallback(()=>{o(null),i(null),l(null),c(!1),v(!1),w(!1)},[w]),F=x.useCallback(e=>{let i=(0,eF.U)(e);i.forEach(e=>{b({type:"add",item:e})}),k({data:e,interactionsList:i,type:t?"image":"text"}),y({data:e,interactionsList:i}),S()},[k,t,y,S,b]),D=i=>{var n,r,o;T.oR.error(e.ic_ocr_message_error_general,{position:ez.Fr?"bottom-right":"top-right"}),k({error:"".concat(null==i?void 0:i.message," - ").concat(null==i||null==(o=i.response)||null==(r=o.data)||null==(n=r.error)?void 0:n.msg),type:t?"image":"text"}),S()},R=(0,h.n)({mutationFn:async()=>await (0,p.dk)({locale:m,text:s,user:j}),onSuccess:F,onError:D}),L=(0,h.n)({mutationFn:async e=>await (0,p.B5)({locale:m,file:e,user:j}),onSuccess:F,onError:D}),M=x.useCallback(async()=>{if(v(!0),t){let e=new FormData,i=null;try{i=await (0,tn.A)(t,{maxSizeMB:3,maxWidthOrHeight:1600,useWebWorker:!0})}catch(e){to().notify("Failed to compress image. Image type: ".concat(t.type," Error: ").concat(JSON.stringify(e))),i=t}e.append("file",i),L.mutate(e);return}R.mutate()},[L,t,R]),$=x.useCallback(e=>{e||(i(null),o(null)),e&&e.type.includes("image")&&(i(e),o(URL.createObjectURL(e)))},[]);return(0,n.jsx)(I.A,{header:(0,n.jsx)(tt,{}),show:C,onHide:()=>w(!1),children:(0,n.jsx)(eZ,{show:C,setSelectedImage:$,onSubmit:M,isTextToLong:A,loading:_,imgSrc:r,selectedImage:t,textValue:s,setTextValue:l,fileDragged:a,setFileDragged:c})})},tc=s.I4.span.withConfig({componentId:"sc-dbbd5ccc-0"})(["@media (max-width:","){display:none;}"],e=>e.theme.gridBreakpoints.lgMax),td=(0,s.I4)(eT.A).withConfig({componentId:"sc-dbbd5ccc-1"})(["width:20px;height:20px;margin-right:8px;margin-top:-2px;@media (max-width:","){margin-right:0;margin-top:0;}"],e=>e.theme.gridBreakpoints.lgMax);var tx=i(17065),tp=i(48230),th=i.n(tp),tg=i(35045),tu=i(315),tm=i(50816);let tj=e=>{let{item:t,onSelect:i,query:r}=e;return(0,n.jsxs)(t_,{children:[(0,n.jsx)(_.vi,{item:t,query:r}),(0,n.jsx)(tf,{item:t,onAction:i})]})},t_=s.Ay.div.withConfig({componentId:"sc-43ed4da6-0"})(["align-items:center;display:flex;gap:10px;justify-content:space-between;"]),tf=e=>{let{item:t,onAction:i}=e,{locale:r}=(0,g.useRouter)(),o=(0,F.sD)();return(0,n.jsx)(tx.Ay,{variant:"checker","data-testid":"interaction-item-dropdown",closeOnItemClick:!0,toggle:(0,n.jsx)(tx.Pl,{}),children:(0,n.jsxs)(tv,{children:[(0,n.jsxs)("div",{onClick:()=>i("remove"),children:[(0,n.jsx)(f.sA,{id:"resolver_options_action_1"}),(0,n.jsx)(tg.A,{})]}),"drug"===t.type&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(th(),{onClick:e=>{e.stopPropagation(),o.DrugOpened(t.name)},href:{pathname:"".concat(r,"/drugs/").concat(t.uuid),query:{web_only_link:1}},target:"_blank",children:[(0,n.jsx)(f.sA,{id:"resolver_drugs_menu_action_smpc"}),(0,n.jsx)(tu.A,{})]})}),(0,n.jsxs)("div",{onClick:()=>i("ic_list"),children:[(0,n.jsx)(f.sA,{id:"drug-details.interactions-list"}),(0,n.jsx)(tm.A,{})]})]})},t.ix_id)},tv=(0,s.Ay)(r.KY).withConfig({componentId:"sc-43ed4da6-1"})(["> *{display:flex;align-items:center;justify-content:space-between;color:",";gap:40px;&:hover{color:",";cursor:pointer;text-decoration:none;}svg{flex-shrink:0;width:24px;height:24px;}}"],e=>{let{theme:t}=e;return t.color.text},e=>{let{theme:t}=e;return t.color.text});var tb=i(55754);let tI=e=>{let{buttonTranslationId:t,onConfirm:i}=e,[o,s]=x.useState(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.jP,{children:(0,n.jsx)(tw,{onClick:()=>s(!0),children:(0,n.jsx)(f.sA,{id:t})})}),(0,n.jsx)(ep.A,{messageTranslationId:"ic.clear-drugs.title",show:o,onConfirm:()=>{i(),s(!1)},onClose:()=>s(!1)})]})},tw=s.I4.a.withConfig({componentId:"sc-f7f11fe-0"})(["display:inline-block;margin-bottom:2px;margin-left:auto;padding:0 20px;margin-bottom:6px;cursor:pointer;@media (min-width:","){padding:10px 20px;margin-bottom:4px;}"],e=>e.theme.gridBreakpoints.lg),tC=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsxs)(m.gA,{children:[(0,n.jsx)(eS.F,{}),(0,n.jsx)(eS.F,{}),(0,n.jsx)(eS.F,{}),(0,n.jsx)(m.pK,{$marginTop:32,children:(0,n.jsx)(f.sA,{id:"ic.drug-list.empty"})})]})}),(0,n.jsx)(r.QO,{children:(0,n.jsx)(m.pK,{$marginTop:32,children:(0,n.jsx)(f.sA,{id:"ic.drug-list.empty"})})})]}),ty=()=>{let{selectedInteractions:e,selectedInteractionsReducer:t}=(0,d.wv)(),i=(0,F.sD)(),[o,s]=x.useState(null),{userFeatures:l}=(0,u.ur)(),a=(0,e_.P8)(),c=x.useCallback((e,n)=>{if("remove"===e&&(i.ICRemoveItem(),t({type:"remove",item:n})),"ic_list"===e){if(!l.interactions)return void a({variant:e_.NR.Interactions2,triggerLocation:"List of interactions IC tab"});i.ICDrugListOpened({from:"IC tab"}),s(n)}},[i,l,a,t]);return(0,n.jsxs)(tA,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsxs)(tS,{children:[(0,n.jsx)(m.c3,{children:(0,n.jsx)(f.sA,{id:"drug-list.navbar.title"})}),(0,n.jsx)(tl,{})]})}),(0,n.jsx)(r.kd,{children:(0,n.jsx)(tk,{children:(0,n.jsx)(Y,{whiteBackgroun
1d:!0,onSelect:t,feature:"Interactions checker"})})}),0===e.items.length?(0,n.jsx)(tC,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tI,{onConfirm:()=>t({type:"clear"}),buttonTranslationId:"ic.action.clear"}),(0,n.jsx)(r.KY,{$withBottomMargin:!0,children:e.items.map(e=>(0,n.jsx)(tj,{item:e,onSelect:t=>{c(t,e)}},e.ix_id))}),1===e.items.length&&(0,n.jsx)(m.pK,{children:(0,n.jsx)(f.sA,{id:"ic.drug-list.empty"})})]}),(0,n.jsx)(tb.A,{item:o,show:null!==o,onHide:()=>{s(null)}})]})},tk=s.I4.div.withConfig({componentId:"sc-f7f11fe-1"})(["margin-bottom:16px;width:100%;"]),tA=s.I4.div.withConfig({componentId:"sc-f7f11fe-2"})(["width:100%;"]),tS=s.I4.div.withConfig({componentId:"sc-f7f11fe-3"})(["display:flex;justify-content:space-between;align-items:start;"]),tF=()=>{let{selectedInteractionsReducer:e}=(0,d.wv)();return(0,n.jsxs)(tT,{children:[(0,n.jsx)(r.kd,{children:(0,n.jsx)(tR,{children:(0,n.jsx)(f.sA,{id:"ic.navigation.title"})})}),(0,n.jsxs)(r.QO,{children:[(0,n.jsx)(tR,{children:(0,n.jsx)(f.sA,{id:"ic.navigation.title"})}),(0,n.jsxs)(tD,{children:[(0,n.jsx)(Y,{onSelect:e,feature:"Interactions checker"}),(0,n.jsx)(tl,{})]})]})]})},tT=s.I4.div.withConfig({componentId:"sc-af1f2761-0"})(["width:100%;"]),tD=s.I4.div.withConfig({componentId:"sc-af1f2761-1"})(["display:flex;gap:16px;> button{flex-shrink:0;}"]),tR=(0,s.I4)(r.t9).withConfig({componentId:"sc-af1f2761-2"})(["margin-bottom:8px;"]);var tL=i(53068),tM=i(46992),t$=i(90280);let tB=e=>{let{interaction:t,onBack:i,link:r}=e;return(0,n.jsx)(tL.A,{overrideHeader:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(t$.A,{link:r,onClick:i,message:(0,n.jsx)(f.sA,{id:"common.back_button"})})}),children:(0,n.jsx)(o.Wt,{children:(0,n.jsx)(ed.A,{interaction:t})})})},tN=(0,s.I4)(o.je).withConfig({componentId:"sc-7048b646-0"})(["",";@media (max-width:","){width:100% !important;max-width:100% !important;}"],e=>{let{$show:t}=e;return!t&&(0,s.AH)(["@media (max-width:","){display:none;}"],e=>e.theme.gridBreakpoints.lgMax)},e=>e.theme.gridBreakpoints.lgMax);var tP=!0;let tz=()=>{let{messages:e}=(0,f.tz)(),[t,i]=x.useState(null),{interactions:s,selectedInteractions:l}=(0,d.wv)(),c=(0,F.sD)(),p=(0,g.useRouter)();(0,F.Rf)(),x.useEffect(()=>{c.ICTabOpened()},[c,c.ICTabOpened]);let h=x.useMemo(()=>[{tabName:e["drug-list.navbar.title"],suffix:(null==l?void 0:l.items)!==void 0?" (".concat(l.items.length,")"):void 0},{tabName:e["ic.navigation.title"],suffix:(null==s?void 0:s.interactions)!==void 0?" (".concat(s.interactions.length,")"):void 0}],[e,l,s]),[u,m]=x.useState(h[0].tabName);x.useEffect(()=>{p.query.interaction_details||i(null)},[p.query.interaction_details]);let j=x.useCallback(e=>{c.ICInteractionOpened(e,"Interactions checker"),p.push({query:{...p.query,interaction_details:!0}}),i(e)},[c,p]);return t?(0,n.jsx)(tB,{interaction:t,onBack:()=>{i(null)}}):(0,n.jsx)(tL.A,{overrideHeader:tF,pageTitle:"ic.navigation.title",children:(0,n.jsxs)(o.Wt,{children:[(0,n.jsx)(r.QO,{children:(0,n.jsx)(a,{tabs:h,selectedTab:u,setSelectedTab:e=>{e===h[1].tabName&&(0,U.J0)(U.lB.InteractionsMeaningfulAction),m(e)}})}),(0,n.jsxs)(o.p_,{colSpan:"1|1",children:[(0,n.jsx)(tN,{$show:u===h[0].tabName,children:(0,n.jsx)(ty,{})}),(0,n.jsx)(tN,{$show:u===h[1].tabName,children:(0,n.jsx)(ew,{onViewDetails:j})})]}),(0,n.jsx)(r.kd,{children:(0,n.jsx)(tM.A,{})}),(0,n.jsx)(ta,{})]})})}}},e=>{e.O(0,[7921,2019,7849,970,6593,636,8792],()=>e(e.s=8297)),_N_E=e.O()}]);
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.