PageSourceSearch

https://www.campbellsci.com/_nuxt/DP_y1VY-.js

js campbellsci.com collected 2026-09-24 18:32:27 UTC 9,404 bytes, 1 lines download raw bytes

1import{_ as T}from"./DSr8MJwO.js";import{p as A,_ as W,a as X}from"./C_EYd6b8.js";import Z from"./UCPWY6Xk.js";import{U as E,aJ as ee,aa as L,M as u,O as s,N as r,aB as c,P as o,ao as _,Y as e,b5 as te,Q as p,a1 as k,ar as oe,b2 as ae,aI as se,S as m,aE as d,ap as C,aq as D,G as ne}from"./DPjEYeee.js";import le from"./HNfl-PTo.js";import re from"./D-iRvg2W.js";import{d as ie,a as B}from"./OthAtrZD.js";import{a as de,u as j,_ as pe}from"./CnGwPZ-n.js";import"./_cF7CpUZ.js";import"./ud4_Ojlb.js";import"./zX0r6Ewz.js";import"./DydmrGus.js";import"./DLmn-p3p.js";import"./CPw0_RdU.js";import"./hzXG2y6G.js";import"./BsxZF9Js.js";import"./BiJeP6yc.js";import"./4y5ao4b1.js";import"./c06c0GOX.js";import"./DcIqBEt1.js";import"./C3kfGWWI.js";import"./B1aJJIQa.js";import"./D91aNTax.js";import"./CtOQag3_.js";import"./kRIii9yh.js";import"./B9W2LXBV.js";import"./B7MF4u0b.js";import"./CxWgFQGr.js";import"./CyuN6n02.js";import"./Dc6ut2Xe.js";import"./BBlq_Huc.js";import"./C6mutSiB.js";import"./C6Y-ieo6.js";import"./Bqumoc59.js";import"./D8RLQJcs.js";import"./VHYYwZHU.js";import"./CLCjusQa.js";import"./BHcE1ZFs.js";import"./Bu8zQJeA.js";import"./DpV0svzd.js";import"./DUFVYz29.js";const ue={class:"flex items-start justify-between gap-4"},ce={class:"text-base font-semibold text-secondary"},me={class:"grid gap-4 md:grid-cols-2"},_e={class:"grid gap-4 md:grid-cols-2 mt-4"},fe={class:"space-y-2"},ye={class:"space-y-2"},ve={class:"flex flex-wrap items-end gap-2 mt-4"},ge={key:1,class:"text-sm text-error mt-3"},be={key:2,class:"mt-5"},he={class:"flex flex-wrap items-center gap-2 mb-3"},ke={class:"text-xs text-muted"},xe={class:"overflow-x-auto"},we={class:"w-full text-sm"},Pe={class:"divide-y divide-neutral-100"},Ie={class:"py-2 pr-3"},Se={class:"py-2 pr-3"},Ve={class:"py-2 pr-3 text-xs"},ze={class:"py-2 pr-3 text-right"},Ce={class:"py-2 text-right"},Me={key:0,class:"text-sm text-neutral-600 mt-2"},Oe=E({__name:"Operations",props:{scope:{default:"contact"}},setup(M){const f=M,y=k(()=>f.scope==="organization"),{state:i,capabilities:v,result:l,error:x,busy:w,survivorId:S,totals:b,applyReady:V,canDryRun:F,loadCapabilities:R,run:O}=de(f.scope),{result:U,resolution:$}=j(),Y=k(()=>y.value?"Organization / Account operations":"Contact operations"),q=[{label:"Merge person",value:"merge-person",description:"The old record is superseded. Its data moves to the new one."},{label:"Transfer assets",value:"transfer-assets",description:"The old record keeps existing. Only its assets move."}],P=k(()=>{if(y.value){const n=new Set;return(U.value?.organizations??[]).filter(t=>n.has(t.organizationPartyId)?!1:n.add(t.organizationPartyId)).map(t=>({value:String(t.organizationPartyId),label:A(t.organizationPartyId,t.d365AccountName,t.name??"unnamed"),description:[t.isPrincipal?"principal":null,t.priceCode?`price ${t.priceCode}`:null].filter(Boolean).join(" · ")}))}return($.value?.candidates??[]).map(n=>({value:String(n.partyId),label:A(n.partyId,n.d365ContactForPartyName,n.fullName),description:[n.isEffective?"selected":null,n.personActive?"active":"inactive",`${n.counts.softwareKeys} keys`,`${n.counts.orders} orders`,`${n.counts.cellSims} SIMs`].filter(Boolean).join(" · ")}))}),G=k(()=>{const n=new Set((U.value?.organizations??[]).filter(t=>t.isPrincipal).map(t=>t.organizationPartyId));return n.size===1?[...n][0]:null}),H=k(()=>y.value?G.value:$.value?.effectivePartyId??null);return ee(H,n=>
1{n!=null&&!i.value.newPartyId&&(i.value.newPartyId=String(n))},{immediate:!0}),L(R),(n,t)=>{const g=Z,J=te,z=le,h=re,I=ae,N=se,K=T;return s(),u(K,null,{header:r(()=>[o("div",ue,[o("div",null,[o("h3",ce,d(e(Y)),1),t[9]||(t[9]=o("p",{class:"text-xs text-neutral-600 mt-1"}," Always start with a dry run. It does the real work, then undoes it, so the result below is exactly what would happen for real. ",-1))]),e(v)?.writesEnabled?(s(),u(g,{key:0,color:"warning",variant:"solid",size:"sm",class:"shrink-0"},{default:r(()=>[...t[10]||(t[10]=[m(" Apply enabled ",-1)])]),_:1})):(s(),u(g,{key:1,color:"neutral",variant:"solid",size:"sm",class:"shrink-0"},{default:r(()=>[...t[11]||(t[11]=[m(" Dry run only ",-1)])]),_:1}))])]),default:r(()=>[e(v)&&!e(v).actor.resolved?(s(),u(J,{key:0,class:"mb-4",color:"error",variant:"subtle",title:"Your account is not linked to a customer record",description:"Every merge records who ran it, so you cannot run one until that link exists. Ask a developer to link your account."})):c("",!0),o("div",me,[e(y)?c("",!0):(s(),u(h,{key:0,label:"Operation"},{default:r(()=>[p(z,{modelValue:e(i).operation,"onUpdate:modelValue":t[0]||(t[0]=a=>e(i).operation=a),items:q,"value-key":"value","label-key":"label","description-key":"description",class:"w-full"},null,8,["modelValue"])]),_:1})),p(h,{label:"Note",help:"Saved with the record of this merge. Include the ticket.",class:oe(e(y)?"md:col-span-2":"")},{default:r(()=>[p(I,{modelValue:e(i).note,"onUpdate:modelValue":t[1]||(t[1]=a=>e(i).note=a),placeholder:"CHD-12345 duplicate from sales",class:"w-full"},null,8,["modelValue"])]),_:1},8,["class"])]),o("div",_e,[p(h,{label:"Old ID"},{default:r(()=>[o("div",fe,[p(I,{modelValue:e(i).oldPartyId,"onUpdate:modelValue":t[2]||(t[2]=a=>e(i).oldPartyId=a),placeholder:"223344",class:"w-full"},null,8,["modelValue"]),e(P).length?(s(),u(z,{key:0,items:e(P),"model-value":void 0,"label-key":"label","description-key":"description",placeholder:"Pick",icon:"i-lucide-list",color:"neutral",variant:"subtle",class:"w-full","aria-label":"Pick the old record","onUpdate:modelValue":t[3]||(t[3]=a=>a&&(e(i).oldPartyId=a.value))},null,8,["items"])):c("",!0)])]),_:1}),p(h,{label:"New ID",help:"Prefilled from the lookup above. Verify before applying."},{default:r(()=>[o("div",ye,[p(I,{modelValue:e(i).newPartyId,"onUpdate:modelValue":t[4]||(t[4]=a=>e(i).newPartyId=a),placeholder:"123456",class:"w-full"},null,8,["modelValue"]),e(P).length?(s(),u(z,{key:0,items:e(P),"model-value":void 0,"label-key":"label","description-key":"description",placeholder:"Pick",icon:"i-lucide-list",color:"neutral",variant:"subtle",class:"w-full","aria-label":"Pick the new record","onUpdate:modelValue":t[5]||(t[5]=a=>a&&(e(i).newPartyId=a.value))},null,8,["items"])):c("",!0)])]),_:1})]),o("div",ve,[p(N,{loading:e(w),disabled:!e(F),color:"neutral",variant:"subtle",onClick:t[6]||(t[6]=a=>e(O)(!1))},{default:r(()=>[...t[12]||(t[12]=[m(" Dry run ",-1)])]),_:1},8,["loading","disabled"]),e(l)&&!e(l).applied&&e(v)?.writesEnabled?(s(),u(h,{key:0,label:"Type the new ID to confirm"},{default:r(()=>[p(I,{modelValue:e(i).confirmPartyId,"onUpdate:modelValue":t[7]||(t[7]=a=>e(i).confirmPartyId=a),placeholder:e(S),class:"w-56"},null,8,["modelValue","placeholder"])]),_:1})):c("",!0),e(l)&&!e(l).applied&&e(v)?.writesEnabled?(s(),u(N,{key:1,disabled:!e(V)||e(w),color:"error",onClick:t[8]||(t[8]=a=>e(O)(!0))},{default:r(()=>[...t[13]||(t[13]=[m(" Apply ",-1)])]),_:1},8,["disabled"])):c("",!0)]),e(x)?(s(),_("p",ge,d(e(x)),1)):c("",!0),e(l)?(s(),_("div",be,[o("div",he,[p(g,{color:e(l).applied?"success":"info",variant:"solid"},{default:r(()=>[m(d(e(l).applied?"Applied and committed":"Dry run, rolled back"),1)]),_:1},8,["color"]),p(g,{color:"neutral",variant:"subtle"},{default:r(()=>[m(d(e(b)?.moved)+" row(s) moved",1)]),_:1}),p(g,{color:"neutral",variant:"subtle"},{default:r(()=>[m(d(e(b)?.removed)+" superseded",1)]),_:1}),e(l).audit.leftover_references?.length?(s(),u(g,{key:0,color:"error",variant:"solid"},{default:r(()=>[m(d(e(l).audit.leftover_references.length)+" leftover reference(s) ",1)]),_:1})):c("",!0),o("span",ke," audit "+d(e(l).auditId)+" · "+d(e(l).functionVersion)+" · "+d(e(l).durationMs)+"ms ",1)]),(s(!0),_(C,null,D(e(l).notices,a=>(s(),_("p",{key:a,class:"text-xs text-warning mb-1"},d(a),1))),128)),o("div",xe,[o("table",we,[t[14]||(t[14]=o("thead",null,[o("tr",{class:"text-left text-xs uppercase tracking-wide text-muted"},[o("th",{class:"py-2 pr-3 font-medium"},"What happened"),o("th",{class:"py-2 pr-3 font-medium"},"Table"),o("th",{class:"py-2 pr-3 font-medium"},"Column"),o("th",{class:"py-2 pr-3 font-medium text-right"},"Moved"),o("th",{class:"py-2 font-medium text-right"},"Superseded")])],-1)),o("tbody",Pe,[(s(!0),_(C,null,D(e(l).audit.actions??[],(a,Q)=>(s(),_("tr",{key:Q},[o("td",Ie,d(e(ie)(a.action)),1),o("td",Se,[o("code",null,d(a.schema)+"."+d(a.table),1)]),o("td",Ve,[o("code",null,d(a.column),1)]),o("td",ze,d(e(B)(a).moved),1),o("td",Ce,d(e(B)(a).removed),1)]))),128))])])]),(e(l).audit.actions??[]).length?c("",!0):(s(),_("p",Me," Nothing to move. These two records share no data. "))])):c("",!0)]),_:1})}}}),Ue=Object.assign(Oe,{__name:"SiteManagementPartyOperations"}),ht=E({__name:"operations",setup(M){ne({title:"Operations - Site Management",robots:"noindex, nofollow"});const{result:f,pending:y,ensureLoaded:i}=j();return L(i),(v,l)=>{const x=T,w=W,S=X,b=Ue,V=pe;return s(),u(V,{title:"Operations"},{default:r(()=>[!e(f)&&!e(y)?(s(),u(x,{key:0,title:"Operations"},{default:r(()=>[...l[0]||(l[0]=[o("p",{class:"text-sm text-neutral-600"}," Look up a user above first. The merge fields then fill from their own records, so you are never merging two ids you typed from memory. ",-1)])]),_:1})):e(f)?(s(),_(C,{key:1},[p(w,{candidates:e(f).resolution.candidates},null,8,["candidates"]),p(S,{organizations:e(f).organizations},null,8,["organizations"]),p(b,{scope:"contact"}),p(b,{scope:"organization"})],64)):c("",!0)]),_:1})}}});
1export{ht as default};

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.