@opentrons/step-generation 0.3.19-alpha.0 → 0.3.21-alpha.0
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/README.md +1 -1
- package/lib/errorCreators.d.ts +3 -0
- package/lib/index.cjs +66 -61
- package/lib/index.mjs +863 -801
- package/lib/types.d.ts +22 -7
- package/lib/utils/misc.d.ts +17 -1
- package/lib/utils/pythonFileUtils.d.ts +2 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@opentrons/shared-data");function Db(){return{type:"INSUFFICIENT_TIPS",message:"Not enough tips to complete action"}}function Mb(){return{type:"MISSING_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips fully without an adapter"}}function Fb(){return{type:"REMOVE_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips partially with an adapter"}}function xt(e){const{actionName:t,pipette:r,labware:n,well:a}=e;return{message:n==null||a==null?`Attempted to ${t} with no tip on pipette: ${r} in place`:`Attempted to ${t} with no tip on pipette: ${r} from ${n}'s well ${a}`,type:"NO_TIP_ON_PIPETTE"}}function Ub(){return{message:"One or more of the pipettes has a tip",type:"PIPETTE_HAS_TIP"}}function ct(e){const{pipette:t}=e;return{message:`This step tries to use the ${t}. Add the pipette to your protocol or change the step to use a different pipette.`,type:"PIPETTE_DOES_NOT_EXIST"}}function pt(e){const{actionName:t,labware:r}=e;return console.warn(`Attempted to ${t} with labware id "${r}", this labware was not found under "labware"`),{message:`This step tries to use ${r}. Add the labware to your protocol or change the step to use a different labware.`,type:"LABWARE_DOES_NOT_EXIST"}}function Q(){return{message:"This step requires a module, but none is selected",type:"MISSING_MODULE"}}function qb(){return{message:"This module is not changing temperature because it has either been deactivated or is already holding a temperature. In order to pause the protocol and wait for your module to reach a temperature, you must first use a Temperature step to tell the module to start changing to a new temperature",type:"MISSING_TEMPERATURE_STEP"}}function dp(){return{message:"This module is not currently running a profile.",type:"MISSING_PROFILE_STEP"}}function $b(e){const{volume:t,maxVolume:r,actionName:n}=e;return{message:`This step tries to ${n} ${t}µL, but the tip can only hold ${r}µL.`,type:"TIP_VOLUME_EXCEEDED"}}function os(e){const{actionName:t,volume:r,maxVolume:n,disposalVolume:a}=e;return{message:a!=null?`Attemped to ${t} volume + disposal volume greater than pipette max volume (${r} + ${a} > ${n})`:`This step tries to ${t} ${r}µL, but the tip can only hold ${n}µL.`,type:"PIPETTE_VOLUME_EXCEEDED"}}const Vb=()=>({type:"MOVE_LOCATION_NOT_SPECIFIED",message:"This step is missing a move location."}),Ta=()=>({type:"MODULE_PIPETTE_COLLISION_DANGER",message:"Gen 1 8-Channel pipettes cannot access labware or tip racks in slot 4 or 6 because they are adjacent to modules."}),Bb=()=>({type:"THERMOCYCLER_BUSY_WITH_PROFILE",message:"This step cannot run while the Thermocycler is running a profile. Move the step outside the profile."}),In=()=>({type:"THERMOCYCLER_LID_CLOSED",message:"Attempted to interact with contents of a thermocycler with the lid closed."}),ps=()=>({type:"HEATER_SHAKER_LATCH_OPEN",message:"Attempted to interact with contents of a heater-shaker with the latch open."}),fp=()=>({type:"HEATER_SHAKER_LATCH_CLOSED",message:"Attempted to move the contents of a heater-shaker with the latch closed."}),Mr=()=>({type:"ABSORBANCE_READER_LID_CLOSED",message:"Attempted to interact with contents of an absorbance plate reader with the lid closed."}),xb=()=>({type:"ABSORBANCE_READER_NO_INITIALIZATION",message:"This step tries to read labware without initializing the Plate Reader first. Initialize the Plate Reader module or remove this step in order to proceed."}),Lh=()=>({type:"ABSORBANCE_READER_NO_GRIPPER",message:"This step involves opening or closing the Absorbance Plate Reader lid with a gripper. Add a gripper or remove step to proceed."}),Hb=()=>({type:"HOPPER_EMPTY",message:"Cannot retrieve labware from empty stacker"}),zb=()=>({type:"SHUTTLE_FULL",message:"Shuttle must be empty in order to retrieve labware from the stacker"}),jb=()=>({type:"SHUTTLE_EMPTY",message:"Shuttle must have labware in order to store it in the stacker"}),Oh=()=>({type:"MISMATCHED_STACKER_LABWARE_TYPE",message:"The stacker can only store a single type of labware at a time"}),Gb=()=>({type:"MISSING_STACKER_LABWARE_TYPE",message:"Add labware to the stacker in the starting deck so that you can refill it later"}),Rh=()=>({type:"HOPPER_FULL",message:"The hopper has reached capacity"}),En=()=>({type:"HEATER_SHAKER_IS_SHAKING",message:"Attempted to interact with the contents of a heater-shaker when it is shaking."}),Wb=e=>({type:"TALL_LABWARE_EAST_WEST_OF_HEATER_SHAKER",message:`Labware over 53 mm is ${e} of this Heater-Shaker module.`}),$t=e=>{const{unsafePipetteMovementReason:t}=e;switch(t.type){case"thermocyclerLidCollision":return{type:"POSSIBLE_PIPETTE_COLLISION_THERMOCYCLER_LID",message:"There is a possibility that the Pipette will collide with the Thermocycler lid"};case"outsidePipetteExtents":return{type:"POSSIBLE_PIPETTE_COLLISION_OUTSIDE_DECK_EXTENTS",message:"There is a possibility that the pipette will move outside the deck extents."};case"adjacentAdressableAreaCollision":return{type:"POSSIBLE_PIPETTE_COLLISION_ADJACENT_ADDRESSABLE_AREA",message:`There is a possibility that the pipette will collide with adjacent items in ${t.addressableAreaCausingCollision.displayName}`,translationParams:{addressableAreaCausingCollisionDisplayName:t.addressableAreaCausingCollision.displayName}}}},ga=()=>({type:"HEATER_SHAKER_EAST_WEST_LATCH_OPEN",message:"The Heater-Shaker labware latch is open"}),Ia=()=>({type:"HEATER_SHAKER_NORTH_SOUTH_EAST_WEST_SHAKING",message:"The Heater-Shaker is shaking"}),Ea=()=>({type:"HEATER_SHAKER_EAST_WEST_MULTI_CHANNEL",message:"The Heater-Shaker is shaking"}),ds=()=>({type:"HEATER_SHAKER_NORTH_SOUTH__OF_NON_TIPRACK_WITH_MULTI_CHANNEL",message:"8-Channel pipette cannot access labware"}),wn=()=>({type:"LABWARE_OFF_DECK",message:"Attempted to interact with labware off deck"}),Yb=()=>({type:"LABWARE_ON_ANOTHER_ENTITY",message:"Attempted to move labware onto another entity with the same slotName"}),Rn=()=>({type:"DROP_TIP_LOCATION_DOES_NOT_EXIST",message:"The destination for dropping tip does not exist"}),kh=()=>({type:"EQUIPMENT_DOES_NOT_EXIST",message:"Equipment does not exist."}),Kb=()=>({type:"GRIPPER_REQUIRED",message:"The gripper is required to fulfill this action"}),Vt=e=>({type:"PIPETTING_INTO_COLUMN_4",message:`Cannot ${e.typeOfStep} into a column 4 slot.`}),Xb=()=>({type:"CANNOT_MOVE_WITH_GRIPPER",message:"The gripper cannot move aluminum blocks"}),Zb=()=>({type:"NO_TIP_SELECTED",message:"No tips were selected for this step"}),wa=()=>({type:"LABWARE_DISCARDED_IN_TRASH",message:"The labware was discarded in trash in a previous step."}),vh=()=>({type:"SUBMERGE_BELOW_ASPIRATE",message:"The submerge position must be above the aspirate position"}),Ph=()=>({type:"RETRACT_BELOW_ASPIRATE",message:"The retract position must be above the aspirate position"}),Qb=()=>({type:"SUBMERGE_BELOW_DISPENSE",message:"The submerge position must be above the dispense position"}),Jb=()=>({type:"RETRACT_BELOW_DISPENSE",message:"The retract position must be above the dispense position"}),eT=()=>({type:"MULTI_ASPIRATE_VOLUME_TOO_HIGH",message:"Consolidate pipette path was selected but cannot fit volume for more than 1 well in the tip"}),tT=()=>({type:"MULTI_DISPENSE_VOLUME_TOO_HIGH",message:"Distribute pipette path was selected but cannot fit volume for more than 1 well in the tip"}),rT=e=>({type:"CLOSING_THERMOCYCLER_WITH_INVALID_LABWARE_LID",message:`Closing the Thermocycler lid with ${e.lidDisplayName} in place will cause damage`}),mp=()=>({type:"RETURN_TIP_UNAVAILABLE",message:"Current tip does not have a known location to return to"}),nT=()=>({type:"TIPRACK_LID_NOT_ALLOWED_ON_DECK",message:"The tip rack lid is not supported directly on the deck"}),aT=()=>({type:"NEXT_TIPRACK_HAS_LID",message:"A pipette cannot pick up tips from a tip rack with a lid"}),sT=e=>({type:"STACK_TOO_HIGH",message:`The stack on slot ${e.slot} is too high`}),oT=()=>({type:"TOO_MANY_TIPS",message:"Action will pick up too many tips"}),iT=()=>({type:"INCOMPLETE_PICKUP",message:"At least one of the selected tips is empty"}),lT=()=>({type:"LABWARE_ON_HOPPER",message:"Labware cannot be moved from the Flex Stacker Hopper"}),uT=()=>({type:"MISSING_PUMP_ACTIVITY",message:"This module is not currently running a pump activity."}),cT=e=>({type:"INVALID_WAIT_CONDITION",message:`Invalid wait condition: ${e}`}),Sa=()=>({type:"LIVE_TASK_ERROR",message:"This module is currently running a live task. Please wait for it to complete before performing this action."}),hp=()=>({type:"VACUUM_UNDER_PRESSURE",message:"The vacuum module is under pressure. Deactivate the pump to move labware to or from it."});function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bs,_p;function Ch(){if(_p)return Bs;_p=1;var e=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;return Bs=e,Bs}var xs,yp;function Ht(){if(yp)return xs;yp=1;var e=Ch(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return xs=r,xs}var Hs,bp;function kn(){if(bp)return Hs;bp=1;var e=Ht(),t=e.Symbol;return Hs=t,Hs}var zs,Tp;function pT(){if(Tp)return zs;Tp=1;var e=kn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function s(o){var i=r.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var p=n.call(o);return u&&(i?o[a]=l:delete o[a]),p}return zs=s,zs}var js,gp;function dT(){if(gp)return js;gp=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return js=r,js}var Gs,Ip;function vn(){if(Ip)return Gs;Ip=1;var e=kn(),t=pT(),r=dT(),n="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function o(i){return i==null?i===void 0?a:n:s&&s in Object(i)?t(i):r(i)}return Gs=o,Gs}var Ws,Ep;function nr(){if(Ep)return Ws;Ep=1;function e(t){return t!=null&&typeof t=="object"}return Ws=e,Ws}var Ys,wp;function Aa(){if(wp)return Ys;wp=1;var e=vn(),t=nr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Ys=n,Ys}var Ks,Sp;function Nh(){if(Sp)return Ks;Sp=1;var e=Aa();function t(r,n,a){for(var s=-1,o=r.length;++s<o;){var i=r[s],l=n(i);if(l!=null&&(u===void 0?l===l&&!e(l):a(l,u)))var u=l,p=i}return p}return Ks=t,Ks}var Xs,Ap;function fT(){if(Ap)return Xs;Ap=1;function e(t,r){return t<r}return Xs=e,Xs}var Zs,Lp;function La(){if(Lp)return Zs;Lp=1;function e(t){return t}return Zs=e,Zs}var Qs,Op;function mT(){if(Op)return Qs;Op=1;var e=Nh(),t=fT(),r=La();function n(a){return a&&a.length?e(a,r,t):void 0}return Qs=n,Qs}var hT=mT();const _T=xe(hT),Oa="TEMPERATURE_DEACTIVATED",lc="TEMPERATURE_AT_TARGET",uc="TEMPERATURE_APPROACHING_TARGET",xu=1,Dh=[c.MAGNETIC_MODULE_V1,c.TEMPERATURE_MODULE_V1],Hu="fixedTrash",Mh={type:c.MAGNETIC_MODULE_TYPE,engaged:!1},Fh={type:c.TEMPERATURE_MODULE_TYPE,status:Oa,targetTemperature:null},Uh={type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0},qh={type:c.HEATERSHAKER_MODULE_TYPE,targetTemp:null,targetSpeed:null,latchOpen:null},$h={type:"absorbanceReaderType",lidOpen:null,initialization:null},Vh={type:"magneticBlockType"},Bh={type:c.FLEX_STACKER_MODULE_TYPE,storedLabwareDetails:null,labwareInHopper:null,labwareOnShuttle:null,setStoredLabwareCount:1,fillCount:1},xh={type:c.VACUUM_MODULE_TYPE,ventStatus:null,numPumpActivitiesStarted:0,currentPumpActivity:{type:"pumpDeactivated"}},Hh={[c.MAGNETIC_MODULE_TYPE]:Mh,[c.TEMPERATURE_MODULE_TYPE]:Fh,[c.THERMOCYCLER_MODULE_TYPE]:Uh,[c.HEATERSHAKER_MODULE_TYPE]:qh,[c.ABSORBANCE_READER_TYPE]:$h,[c.MAGNETIC_BLOCK_TYPE]:Vh,[c.FLEX_STACKER_MODULE_TYPE]:Bh,[c.VACUUM_MODULE_TYPE]:xh},yT="opentrons/opentrons_1_trash_1100ml_fixed/1",bT="opentrons/opentrons_1_trash_3200ml_fixed/1",ve=["A4","B4","C4","D4"],wt={x:0,y:0,z:0},zh="mounted",Ra="CLEAN",Qt="DIRTY",ue="EMPTY",cc="automatic",St="manual",jh=["A4","B4","C4","D4"],TT=["7","8","10","11"],Ze="hopper",Gh=["hopperA4","hopperB4","hopperC4","hopperD4"],Wh={hopperA4:"A4",hopperB4:"B4",hopperC4:"C4",hopperD4:"D4"},Jt=["adapterLabwareId","primaryLabwareId","lidLabwareId"],gT=["adapterLabwareURI","primaryLabwareURI","lidLabwareURI"],IT={A4:"hopperA4",B4:"hopperB4",C4:"hopperC4",D4:"hopperD4"},pc="vacuumDock",Yh=c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA,dc="opened",ka="closed",zu="power",ju="pressure",ET="state",wT="profile",ST="pumpOff",AT="pumpOn",LT="vent",OT="open",RT="closed",kT="VACUUM_DEACTIVATED",vT="VACUUM_AT_TARGET",Kh=["opentrons_vacuum_manifold_spacer_short","opentrons_vacuum_manifold_spacer_tall"],Xh="A4",$e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function PT(e,t=0){return($e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]).toLowerCase()}const CT=new Uint8Array(16);function NT(){return crypto.getRandomValues(CT)}function DT(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():MT(e,t,r)}function MT(e,t,r){e=e||{};const n=e.random??e.rng?.()??NT();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)t[r+a]=n[a];return t}return PT(n)}var Js,Rp;function fc(){if(Rp)return Js;Rp=1;function e(t,r){for(var n=-1,a=r.length,s=t.length;++n<a;)t[s+n]=r[n];return t}return Js=e,Js}var eo,kp;function FT(){if(kp)return eo;kp=1;var e=vn(),t=nr(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return eo=n,eo}var to,vp;function fs(){if(vp)return to;vp=1;var e=FT(),t=nr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(o){return t(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return to=s,to}var ro,Pp;function Qe(){if(Pp)return ro;Pp=1;var e=Array.isArray;return ro=e,ro}var no,Cp;function UT(){if(Cp)return no;Cp=1;var e=kn(),t=fs(),r=Qe(),n=e?e.isConcatSpreadable:void 0;function a(s){return r(s)||t(s)||!!(n&&s&&s[n])}return no=a,no}var ao,Np;function Zh(){if(Np)return ao;Np=1;var e=fc(),t=UT();function r(n,a,s,o,i){var l=-1,u=n.length;for(s||(s=t),i||(i=[]);++l<u;){var p=n[l];a>0&&s(p)?a>1?r(p,a-1,s,o,i):e(i,p):o||(i[i.length]=p)}return i}return ao=r,ao}var so,Dp;function va(){if(Dp)return so;Dp=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=Array(a);++n<a;)s[n]=r(t[n],n,t);return s}return so=e,so}var oo,Mp;function qT(){if(Mp)return oo;Mp=1;function e(){this.__data__=[],this.size=0}return oo=e,oo}var io,Fp;function ms(){if(Fp)return io;Fp=1;function e(t,r){return t===r||t!==t&&r!==r}return io=e,io}var lo,Up;function hs(){if(Up)return lo;Up=1;var e=ms();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return lo=t,lo}var uo,qp;function $T(){if(qp)return uo;qp=1;var e=hs(),t=Array.prototype,r=t.splice;function n(a){var s=this.__data__,o=e(s,a);if(o<0)return!1;var i=s.length-1;return o==i?s.pop():r.call(s,o,1),--this.size,!0}return uo=n,uo}var co,$p;function VT(){if($p)return co;$p=1;var e=hs();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return co=t,co}var po,Vp;function BT(){if(Vp)return po;Vp=1;var e=hs();function t(r){return e(this.__data__,r)>-1}return po=t,po}var fo,Bp;function xT(){if(Bp)return fo;Bp=1;var e=hs();function t(r,n){var a=this.__data__,s=e(a,r);return s<0?(++this.size,a.push([r,n])):a[s][1]=n,this}return fo=t,fo}var mo,xp;function _s(){if(xp)return mo;xp=1;var e=qT(),t=$T(),r=VT(),n=BT(),a=xT();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,mo=s,mo}var ho,Hp;function HT(){if(Hp)return ho;Hp=1;var e=_s();function t(){this.__data__=new e,this.size=0}return ho=t,ho}var _o,zp;function zT(){if(zp)return _o;zp=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return _o=e,_o}var yo,jp;function jT(){if(jp)return yo;jp=1;function e(t){return this.__data__.get(t)}return yo=e,yo}var bo,Gp;function GT(){if(Gp)return bo;Gp=1;function e(t){return this.__data__.has(t)}return bo=e,bo}var To,Wp;function ar(){if(Wp)return To;Wp=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return To=e,To}var go,Yp;function Qh(){if(Yp)return go;Yp=1;var e=vn(),t=ar(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function o(i){if(!t(i))return!1;var l=e(i);return l==n||l==a||l==r||l==s}return go=o,go}var Io,Kp;function WT(){if(Kp)return Io;Kp=1;var e=Ht(),t=e["__core-js_shared__"];return Io=t,Io}var Eo,Xp;function YT(){if(Xp)return Eo;Xp=1;var e=WT(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Eo=r,Eo}var wo,Zp;function Jh(){if(Zp)return wo;Zp=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return wo=r,wo}var So,Qp;function KT(){if(Qp)return So;Qp=1;var e=Qh(),t=YT(),r=ar(),n=Jh(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,i=Object.prototype,l=o.toString,u=i.hasOwnProperty,p=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||t(f))return!1;var _=e(f)?p:s;return _.test(n(f))}return So=d,So}var Ao,Jp;function XT(){if(Jp)return Ao;Jp=1;function e(t,r){return t?.[r]}return Ao=e,Ao}var Lo,ed;function Br(){if(ed)return Lo;ed=1;var e=KT(),t=XT();function r(n,a){var s=t(n,a);return e(s)?s:void 0}return Lo=r,Lo}var Oo,td;function mc(){if(td)return Oo;td=1;var e=Br(),t=Ht(),r=e(t,"Map");return Oo=r,Oo}var Ro,rd;function ys(){if(rd)return Ro;rd=1;var e=Br(),t=e(Object,"create");return Ro=t,Ro}var ko,nd;function ZT(){if(nd)return ko;nd=1;var e=ys();function t(){this.__data__=e?e(null):{},this.size=0}return ko=t,ko}var vo,ad;function QT(){if(ad)return vo;ad=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return vo=e,vo}var Po,sd;function JT(){if(sd)return Po;sd=1;var e=ys(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(s){var o=this.__data__;if(e){var i=o[s];return i===t?void 0:i}return n.call(o,s)?o[s]:void 0}return Po=a,Po}var Co,od;function eg(){if(od)return Co;od=1;var e=ys(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var s=this.__data__;return e?s[a]!==void 0:r.call(s,a)}return Co=n,Co}var No,id;function tg(){if(id)return No;id=1;var e=ys(),t="__lodash_hash_undefined__";function r(n,a){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=e&&a===void 0?t:a,this}return No=r,No}var Do,ld;function rg(){if(ld)return Do;ld=1;var e=ZT(),t=QT(),r=JT(),n=eg(),a=tg();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,Do=s,Do}var Mo,ud;function ng(){if(ud)return Mo;ud=1;var e=rg(),t=_s(),r=mc();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Mo=n,Mo}var Fo,cd;function ag(){if(cd)return Fo;cd=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Fo=e,Fo}var Uo,pd;function bs(){if(pd)return Uo;pd=1;var e=ag();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Uo=t,Uo}var qo,dd;function sg(){if(dd)return qo;dd=1;var e=bs();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return qo=t,qo}var $o,fd;function og(){if(fd)return $o;fd=1;var e=bs();function t(r){return e(this,r).get(r)}return $o=t,$o}var Vo,md;function ig(){if(md)return Vo;md=1;var e=bs();function t(r){return e(this,r).has(r)}return Vo=t,Vo}var Bo,hd;function lg(){if(hd)return Bo;hd=1;var e=bs();function t(r,n){var a=e(this,r),s=a.size;return a.set(r,n),this.size+=a.size==s?0:1,this}return Bo=t,Bo}var xo,_d;function hc(){if(_d)return xo;_d=1;var e=ng(),t=sg(),r=og(),n=ig(),a=lg();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,xo=s,xo}var Ho,yd;function ug(){if(yd)return Ho;yd=1;var e=_s(),t=mc(),r=hc(),n=200;function a(s,o){var i=this.__data__;if(i instanceof e){var l=i.__data__;if(!t||l.length<n-1)return l.push([s,o]),this.size=++i.size,this;i=this.__data__=new r(l)}return i.set(s,o),this.size=i.size,this}return Ho=a,Ho}var zo,bd;function _c(){if(bd)return zo;bd=1;var e=_s(),t=HT(),r=zT(),n=jT(),a=GT(),s=ug();function o(i){var l=this.__data__=new e(i);this.size=l.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=s,zo=o,zo}var jo,Td;function cg(){if(Td)return jo;Td=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return jo=t,jo}var Go,gd;function pg(){if(gd)return Go;gd=1;function e(t){return this.__data__.has(t)}return Go=e,Go}var Wo,Id;function e_(){if(Id)return Wo;Id=1;var e=hc(),t=cg(),r=pg();function n(a){var s=-1,o=a==null?0:a.length;for(this.__data__=new e;++s<o;)this.add(a[s])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Wo=n,Wo}var Yo,Ed;function t_(){if(Ed)return Yo;Ed=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return Yo=e,Yo}var Ko,wd;function r_(){if(wd)return Ko;wd=1;function e(t,r){return t.has(r)}return Ko=e,Ko}var Xo,Sd;function n_(){if(Sd)return Xo;Sd=1;var e=e_(),t=t_(),r=r_(),n=1,a=2;function s(o,i,l,u,p,d){var f=l&n,_=o.length,m=i.length;if(_!=m&&!(f&&m>_))return!1;var h=d.get(o),b=d.get(i);if(h&&b)return h==i&&b==o;var T=-1,y=!0,A=l&a?new e:void 0;for(d.set(o,i),d.set(i,o);++T<_;){var w=o[T],I=i[T];if(u)var S=f?u(I,w,T,i,o,d):u(w,I,T,o,i,d);if(S!==void 0){if(S)continue;y=!1;break}if(A){if(!t(i,function(L,E){if(!r(A,E)&&(w===L||p(w,L,l,u,d)))return A.push(E)})){y=!1;break}}else if(!(w===I||p(w,I,l,u,d))){y=!1;break}}return d.delete(o),d.delete(i),y}return Xo=s,Xo}var Zo,Ad;function a_(){if(Ad)return Zo;Ad=1;var e=Ht(),t=e.Uint8Array;return Zo=t,Zo}var Qo,Ld;function dg(){if(Ld)return Qo;Ld=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,s){n[++r]=[s,a]}),n}return Qo=e,Qo}var Jo,Od;function yc(){if(Od)return Jo;Od=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return Jo=e,Jo}var ei,Rd;function fg(){if(Rd)return ei;Rd=1;var e=kn(),t=a_(),r=ms(),n=n_(),a=dg(),s=yc(),o=1,i=2,l="[object Boolean]",u="[object Date]",p="[object Error]",d="[object Map]",f="[object Number]",_="[object RegExp]",m="[object Set]",h="[object String]",b="[object Symbol]",T="[object ArrayBuffer]",y="[object DataView]",A=e?e.prototype:void 0,w=A?A.valueOf:void 0;function I(S,L,E,g,k,v,q){switch(E){case y:if(S.byteLength!=L.byteLength||S.byteOffset!=L.byteOffset)return!1;S=S.buffer,L=L.buffer;case T:return!(S.byteLength!=L.byteLength||!v(new t(S),new t(L)));case l:case u:case f:return r(+S,+L);case p:return S.name==L.name&&S.message==L.message;case _:case h:return S==L+"";case d:var $=a;case m:var ee=g&o;if($||($=s),S.size!=L.size&&!ee)return!1;var de=q.get(S);if(de)return de==L;g|=i,q.set(S,L);var Te=n($(S),$(L),g,k,v,q);return q.delete(S),Te;case b:if(w)return w.call(S)==w.call(L)}return!1}return ei=I,ei}var ti,kd;function s_(){if(kd)return ti;kd=1;var e=fc(),t=Qe();function r(n,a,s){var o=a(n);return t(n)?o:e(o,s(n))}return ti=r,ti}var ri,vd;function o_(){if(vd)return ri;vd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=0,o=[];++n<a;){var i=t[n];r(i,n,t)&&(o[s++]=i)}return o}return ri=e,ri}var ni,Pd;function i_(){if(Pd)return ni;Pd=1;function e(){return[]}return ni=e,ni}var ai,Cd;function bc(){if(Cd)return ai;Cd=1;var e=o_(),t=i_(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(i){return n.call(o,i)}))}:t;return ai=s,ai}var si,Nd;function l_(){if(Nd)return si;Nd=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return si=e,si}var ca={exports:{}},oi,Dd;function mg(){if(Dd)return oi;Dd=1;function e(){return!1}return oi=e,oi}ca.exports;var Md;function Ts(){return Md||(Md=1,(function(e,t){var r=Ht(),n=mg(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,i=o?r.Buffer:void 0,l=i?i.isBuffer:void 0,u=l||n;e.exports=u})(ca,ca.exports)),ca.exports}var ii,Fd;function gs(){if(Fd)return ii;Fd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var s=typeof n;return a=a??e,!!a&&(s=="number"||s!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return ii=r,ii}var li,Ud;function Tc(){if(Ud)return li;Ud=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return li=t,li}var ui,qd;function hg(){if(qd)return ui;qd=1;var e=vn(),t=Tc(),r=nr(),n="[object Arguments]",a="[object Array]",s="[object Boolean]",o="[object Date]",i="[object Error]",l="[object Function]",u="[object Map]",p="[object Number]",d="[object Object]",f="[object RegExp]",_="[object Set]",m="[object String]",h="[object WeakMap]",b="[object ArrayBuffer]",T="[object DataView]",y="[object Float32Array]",A="[object Float64Array]",w="[object Int8Array]",I="[object Int16Array]",S="[object Int32Array]",L="[object Uint8Array]",E="[object Uint8ClampedArray]",g="[object Uint16Array]",k="[object Uint32Array]",v={};v[y]=v[A]=v[w]=v[I]=v[S]=v[L]=v[E]=v[g]=v[k]=!0,v[n]=v[a]=v[b]=v[s]=v[T]=v[o]=v[i]=v[l]=v[u]=v[p]=v[d]=v[f]=v[_]=v[m]=v[h]=!1;function q($){return r($)&&t($.length)&&!!v[e($)]}return ui=q,ui}var ci,$d;function gc(){if($d)return ci;$d=1;function e(t){return function(r){return t(r)}}return ci=e,ci}var pa={exports:{}};pa.exports;var Vd;function Ic(){return Vd||(Vd=1,(function(e,t){var r=Ch(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s&&r.process,i=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();e.exports=i})(pa,pa.exports)),pa.exports}var pi,Bd;function Ec(){if(Bd)return pi;Bd=1;var e=hg(),t=gc(),r=Ic(),n=r&&r.isTypedArray,a=n?t(n):e;return pi=a,pi}var di,xd;function u_(){if(xd)return di;xd=1;var e=l_(),t=fs(),r=Qe(),n=Ts(),a=gs(),s=Ec(),o=Object.prototype,i=o.hasOwnProperty;function l(u,p){var d=r(u),f=!d&&t(u),_=!d&&!f&&n(u),m=!d&&!f&&!_&&s(u),h=d||f||_||m,b=h?e(u.length,String):[],T=b.length;for(var y in u)(p||i.call(u,y))&&!(h&&(y=="length"||_&&(y=="offset"||y=="parent")||m&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,T)))&&b.push(y);return b}return di=l,di}var fi,Hd;function Is(){if(Hd)return fi;Hd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return fi=t,fi}var mi,zd;function c_(){if(zd)return mi;zd=1;function e(t,r){return function(n){return t(r(n))}}return mi=e,mi}var hi,jd;function _g(){if(jd)return hi;jd=1;var e=c_(),t=e(Object.keys,Object);return hi=t,hi}var _i,Gd;function p_(){if(Gd)return _i;Gd=1;var e=Is(),t=_g(),r=Object.prototype,n=r.hasOwnProperty;function a(s){if(!e(s))return t(s);var o=[];for(var i in Object(s))n.call(s,i)&&i!="constructor"&&o.push(i);return o}return _i=a,_i}var yi,Wd;function xr(){if(Wd)return yi;Wd=1;var e=Qh(),t=Tc();function r(n){return n!=null&&t(n.length)&&!e(n)}return yi=r,yi}var bi,Yd;function Pa(){if(Yd)return bi;Yd=1;var e=u_(),t=p_(),r=xr();function n(a){return r(a)?e(a):t(a)}return bi=n,bi}var Ti,Kd;function d_(){if(Kd)return Ti;Kd=1;var e=s_(),t=bc(),r=Pa();function n(a){return e(a,r,t)}return Ti=n,Ti}var gi,Xd;function yg(){if(Xd)return gi;Xd=1;var e=d_(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i,l,u,p){var d=i&t,f=e(s),_=f.length,m=e(o),h=m.length;if(_!=h&&!d)return!1;for(var b=_;b--;){var T=f[b];if(!(d?T in o:n.call(o,T)))return!1}var y=p.get(s),A=p.get(o);if(y&&A)return y==o&&A==s;var w=!0;p.set(s,o),p.set(o,s);for(var I=d;++b<_;){T=f[b];var S=s[T],L=o[T];if(l)var E=d?l(L,S,T,o,s,p):l(S,L,T,s,o,p);if(!(E===void 0?S===L||u(S,L,i,l,p):E)){w=!1;break}I||(I=T=="constructor")}if(w&&!I){var g=s.constructor,k=o.constructor;g!=k&&"constructor"in s&&"constructor"in o&&!(typeof g=="function"&&g instanceof g&&typeof k=="function"&&k instanceof k)&&(w=!1)}return p.delete(s),p.delete(o),w}return gi=a,gi}var Ii,Zd;function bg(){if(Zd)return Ii;Zd=1;var e=Br(),t=Ht(),r=e(t,"DataView");return Ii=r,Ii}var Ei,Qd;function Tg(){if(Qd)return Ei;Qd=1;var e=Br(),t=Ht(),r=e(t,"Promise");return Ei=r,Ei}var wi,Jd;function f_(){if(Jd)return wi;Jd=1;var e=Br(),t=Ht(),r=e(t,"Set");return wi=r,wi}var Si,ef;function gg(){if(ef)return Si;ef=1;var e=Br(),t=Ht(),r=e(t,"WeakMap");return Si=r,Si}var Ai,tf;function Ca(){if(tf)return Ai;tf=1;var e=bg(),t=mc(),r=Tg(),n=f_(),a=gg(),s=vn(),o=Jh(),i="[object Map]",l="[object Object]",u="[object Promise]",p="[object Set]",d="[object WeakMap]",f="[object DataView]",_=o(e),m=o(t),h=o(r),b=o(n),T=o(a),y=s;return(e&&y(new e(new ArrayBuffer(1)))!=f||t&&y(new t)!=i||r&&y(r.resolve())!=u||n&&y(new n)!=p||a&&y(new a)!=d)&&(y=function(A){var w=s(A),I=w==l?A.constructor:void 0,S=I?o(I):"";if(S)switch(S){case _:return f;case m:return i;case h:return u;case b:return p;case T:return d}return w}),Ai=y,Ai}var Li,rf;function Ig(){if(rf)return Li;rf=1;var e=_c(),t=n_(),r=fg(),n=yg(),a=Ca(),s=Qe(),o=Ts(),i=Ec(),l=1,u="[object Arguments]",p="[object Array]",d="[object Object]",f=Object.prototype,_=f.hasOwnProperty;function m(h,b,T,y,A,w){var I=s(h),S=s(b),L=I?p:a(h),E=S?p:a(b);L=L==u?d:L,E=E==u?d:E;var g=L==d,k=E==d,v=L==E;if(v&&o(h)){if(!o(b))return!1;I=!0,g=!1}if(v&&!g)return w||(w=new e),I||i(h)?t(h,b,T,y,A,w):r(h,b,L,T,y,A,w);if(!(T&l)){var q=g&&_.call(h,"__wrapped__"),$=k&&_.call(b,"__wrapped__");if(q||$){var ee=q?h.value():h,de=$?b.value():b;return w||(w=new e),A(ee,de,T,y,w)}}return v?(w||(w=new e),n(h,b,T,y,A,w)):!1}return Li=m,Li}var Oi,nf;function wc(){if(nf)return Oi;nf=1;var e=Ig(),t=nr();function r(n,a,s,o,i){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,s,o,r,i)}return Oi=r,Oi}var Ri,af;function Eg(){if(af)return Ri;af=1;var e=_c(),t=wc(),r=1,n=2;function a(s,o,i,l){var u=i.length,p=u,d=!l;if(s==null)return!p;for(s=Object(s);u--;){var f=i[u];if(d&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++u<p;){f=i[u];var _=f[0],m=s[_],h=f[1];if(d&&f[2]){if(m===void 0&&!(_ in s))return!1}else{var b=new e;if(l)var T=l(m,h,_,s,o,b);if(!(T===void 0?t(h,m,r|n,l,b):T))return!1}}return!0}return Ri=a,Ri}var ki,sf;function m_(){if(sf)return ki;sf=1;var e=ar();function t(r){return r===r&&!e(r)}return ki=t,ki}var vi,of;function wg(){if(of)return vi;of=1;var e=m_(),t=Pa();function r(n){for(var a=t(n),s=a.length;s--;){var o=a[s],i=n[o];a[s]=[o,i,e(i)]}return a}return vi=r,vi}var Pi,lf;function h_(){if(lf)return Pi;lf=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Pi=e,Pi}var Ci,uf;function Sg(){if(uf)return Ci;uf=1;var e=Eg(),t=wg(),r=h_();function n(a){var s=t(a);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(o){return o===a||e(o,a,s)}}return Ci=n,Ci}var Ni,cf;function Sc(){if(cf)return Ni;cf=1;var e=Qe(),t=Aa(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(s,o){if(e(s))return!1;var i=typeof s;return i=="number"||i=="symbol"||i=="boolean"||s==null||t(s)?!0:n.test(s)||!r.test(s)||o!=null&&s in Object(o)}return Ni=a,Ni}var Di,pf;function Ag(){if(pf)return Di;pf=1;var e=hc(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var o=arguments,i=a?a.apply(this,o):o[0],l=s.cache;if(l.has(i))return l.get(i);var u=n.apply(this,o);return s.cache=l.set(i,u)||l,u};return s.cache=new(r.Cache||e),s}return r.Cache=e,Di=r,Di}var Mi,df;function Lg(){if(df)return Mi;df=1;var e=Ag(),t=500;function r(n){var a=e(n,function(o){return s.size===t&&s.clear(),o}),s=a.cache;return a}return Mi=r,Mi}var Fi,ff;function Og(){if(ff)return Fi;ff=1;var e=Lg(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(o,i,l,u){s.push(l?u.replace(r,"$1"):i||o)}),s});return Fi=n,Fi}var Ui,mf;function Rg(){if(mf)return Ui;mf=1;var e=kn(),t=va(),r=Qe(),n=Aa(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function o(i){if(typeof i=="string")return i;if(r(i))return t(i,o)+"";if(n(i))return s?s.call(i):"";var l=i+"";return l=="0"&&1/i==-1/0?"-0":l}return Ui=o,Ui}var qi,hf;function kg(){if(hf)return qi;hf=1;var e=Rg();function t(r){return r==null?"":e(r)}return qi=t,qi}var $i,_f;function Pn(){if(_f)return $i;_f=1;var e=Qe(),t=Sc(),r=Og(),n=kg();function a(s,o){return e(s)?s:t(s,o)?[s]:r(n(s))}return $i=a,$i}var Vi,yf;function Cn(){if(yf)return Vi;yf=1;var e=Aa();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Vi=t,Vi}var Bi,bf;function Es(){if(bf)return Bi;bf=1;var e=Pn(),t=Cn();function r(n,a){a=e(a,n);for(var s=0,o=a.length;n!=null&&s<o;)n=n[t(a[s++])];return s&&s==o?n:void 0}return Bi=r,Bi}var xi,Tf;function vg(){if(Tf)return xi;Tf=1;var e=Es();function t(r,n,a){var s=r==null?void 0:e(r,n);return s===void 0?a:s}return xi=t,xi}var Hi,gf;function Pg(){if(gf)return Hi;gf=1;function e(t,r){return t!=null&&r in Object(t)}return Hi=e,Hi}var zi,If;function Cg(){if(If)return zi;If=1;var e=Pn(),t=fs(),r=Qe(),n=gs(),a=Tc(),s=Cn();function o(i,l,u){l=e(l,i);for(var p=-1,d=l.length,f=!1;++p<d;){var _=s(l[p]);if(!(f=i!=null&&u(i,_)))break;i=i[_]}return f||++p!=d?f:(d=i==null?0:i.length,!!d&&a(d)&&n(_,d)&&(r(i)||t(i)))}return zi=o,zi}var ji,Ef;function Ng(){if(Ef)return ji;Ef=1;var e=Pg(),t=Cg();function r(n,a){return n!=null&&t(n,a,e)}return ji=r,ji}var Gi,wf;function Dg(){if(wf)return Gi;wf=1;var e=wc(),t=vg(),r=Ng(),n=Sc(),a=m_(),s=h_(),o=Cn(),i=1,l=2;function u(p,d){return n(p)&&a(d)?s(o(p),d):function(f){var _=t(f,p);return _===void 0&&_===d?r(f,p):e(d,_,i|l)}}return Gi=u,Gi}var Wi,Sf;function __(){if(Sf)return Wi;Sf=1;function e(t){return function(r){return r?.[t]}}return Wi=e,Wi}var Yi,Af;function Mg(){if(Af)return Yi;Af=1;var e=Es();function t(r){return function(n){return e(n,r)}}return Yi=t,Yi}var Ki,Lf;function Fg(){if(Lf)return Ki;Lf=1;var e=__(),t=Mg(),r=Sc(),n=Cn();function a(s){return r(s)?e(n(s)):t(s)}return Ki=a,Ki}var Xi,Of;function Nn(){if(Of)return Xi;Of=1;var e=Sg(),t=Dg(),r=La(),n=Qe(),a=Fg();function s(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?t(o[0],o[1]):e(o):a(o)}return Xi=s,Xi}var Zi,Rf;function Ug(){if(Rf)return Zi;Rf=1;function e(t){return function(r,n,a){for(var s=-1,o=Object(r),i=a(r),l=i.length;l--;){var u=i[t?l:++s];if(n(o[u],u,o)===!1)break}return r}}return Zi=e,Zi}var Qi,kf;function qg(){if(kf)return Qi;kf=1;var e=Ug(),t=e();return Qi=t,Qi}var Ji,vf;function y_(){if(vf)return Ji;vf=1;var e=qg(),t=Pa();function r(n,a){return n&&e(n,a,t)}return Ji=r,Ji}var el,Pf;function $g(){if(Pf)return el;Pf=1;var e=xr();function t(r,n){return function(a,s){if(a==null)return a;if(!e(a))return r(a,s);for(var o=a.length,i=n?o:-1,l=Object(a);(n?i--:++i<o)&&s(l[i],i,l)!==!1;);return a}}return el=t,el}var tl,Cf;function Ac(){if(Cf)return tl;Cf=1;var e=y_(),t=$g(),r=t(e);return tl=r,tl}var rl,Nf;function Vg(){if(Nf)return rl;Nf=1;var e=Ac(),t=xr();function r(n,a){var s=-1,o=t(n)?Array(n.length):[];return e(n,function(i,l,u){o[++s]=a(i,l,u)}),o}return rl=r,rl}var nl,Df;function Bg(){if(Df)return nl;Df=1;var e=va(),t=Nn(),r=Vg(),n=Qe();function a(s,o){var i=n(s)?e:r;return i(s,t(o,3))}return nl=a,nl}var al,Mf;function xg(){if(Mf)return al;Mf=1;var e=Zh(),t=Bg();function r(n,a){return e(t(n,a),1)}return al=r,al}var Hg=xg();const Sn=xe(Hg);var sl,Ff;function b_(){if(Ff)return sl;Ff=1;var e=Br(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return sl=t,sl}var ol,Uf;function Lc(){if(Uf)return ol;Uf=1;var e=b_();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return ol=t,ol}var il,qf;function zg(){if(qf)return il;qf=1;var e=Lc(),t=y_(),r=Nn();function n(a,s){var o={};return s=r(s,3),t(a,function(i,l,u){e(o,l,s(i,l,u))}),o}return il=n,il}var jg=zg();const rr=xe(jg);var ll,$f;function Gg(){if($f)return ll;$f=1;var e=Math.ceil,t=Math.max;function r(n,a,s,o){for(var i=-1,l=t(e((a-n)/(s||1)),0),u=Array(l);l--;)u[o?l:++i]=n,n+=s;return u}return ll=r,ll}var ul,Vf;function Oc(){if(Vf)return ul;Vf=1;var e=ms(),t=xr(),r=gs(),n=ar();function a(s,o,i){if(!n(i))return!1;var l=typeof o;return(l=="number"?t(i)&&r(o,i.length):l=="string"&&o in i)?e(i[o],s):!1}return ul=a,ul}var cl,Bf;function Wg(){if(Bf)return cl;Bf=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return cl=t,cl}var pl,xf;function Yg(){if(xf)return pl;xf=1;var e=Wg(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return pl=r,pl}var dl,Hf;function Kg(){if(Hf)return dl;Hf=1;var e=Yg(),t=ar(),r=Aa(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var p=typeof u.valueOf=="function"?u.valueOf():u;u=t(p)?p+"":p}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=s.test(u);return d||o.test(u)?i(u.slice(2),d?2:8):a.test(u)?n:+u}return dl=l,dl}var fl,zf;function T_(){if(zf)return fl;zf=1;var e=Kg(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var s=a<0?-1:1;return s*r}return a===a?a:0}return fl=n,fl}var ml,jf;function Xg(){if(jf)return ml;jf=1;var e=Gg(),t=Oc(),r=T_();function n(a){return function(s,o,i){return i&&typeof i!="number"&&t(s,o,i)&&(o=i=void 0),s=r(s),o===void 0?(o=s,s=0):o=r(o),i=i===void 0?s<o?1:-1:r(i),e(s,o,i,a)}}return ml=n,ml}var hl,Gf;function Zg(){if(Gf)return hl;Gf=1;var e=Xg(),t=e();return hl=t,hl}var Qg=Zg();const bn=xe(Qg);var _l,Wf;function Jg(){if(Wf)return _l;Wf=1;function e(t,r,n,a){var s=-1,o=t==null?0:t.length;for(a&&o&&(n=t[++s]);++s<o;)n=r(n,t[s],s,t);return n}return _l=e,_l}var yl,Yf;function eI(){if(Yf)return yl;Yf=1;function e(t,r,n,a,s){return s(t,function(o,i,l){n=a?(a=!1,o):r(n,o,i,l)}),n}return yl=e,yl}var bl,Kf;function tI(){if(Kf)return bl;Kf=1;var e=Jg(),t=Ac(),r=Nn(),n=eI(),a=Qe();function s(o,i,l){var u=a(o)?e:n,p=arguments.length<3;return u(o,r(i,4),l,p,t)}return bl=s,bl}var rI=tI();const ut=xe(rI),ws=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=zn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(Q()),o||i.push(Lh()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/closeLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.close_lid()`}},g_=(e,t,r)=>{const{moduleId:n,sampleWavelengths:a,measureMode:s,referenceWavelength:o}=e,i=t.moduleEntities[n].pythonName,l=o!=null?`, reference_wavelength=${o}`:"";return{commands:[{commandType:"absorbanceReader/initialize",key:D(),params:{moduleId:n,measureMode:s,sampleWavelengths:a,...o!=null?{referenceWavelength:o}:{}}}],python:`${i}.initialize(${N(s)}, ${Ls(a)}${l})`}},I_=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=zn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(Q()),o||i.push(Lh()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.open_lid()`}},E_=(e,t,r)=>{const{moduleId:n,fileName:a}=e,s=[],o=zn(r,n);if(o==null)return{errors:[Q()]};o.initialization===null&&s.push(Mr());const i=t.moduleEntities[n].pythonName,l=a!=null?`export_filename=${N(a)}`:"";return s.length>0?{errors:s}:{commands:[{commandType:"absorbanceReader/read",key:D(),params:{moduleId:n,...a!=null?{fileName:a}:{}}}],python:`${i}.read(${l})`}},At=(e,t,r)=>{const{flowRate:n,pipetteId:a,volume:s,correctionVolume:o}=e,i=[];t.pipetteEntities[a]?.spec||i.push(ct({pipette:a}));const u=t.pipetteEntities[a].pythonName;return{commands:[{commandType:"airGapInPlace",key:D(),params:{flowRate:n,pipetteId:a,volume:s,...o!=null?{correctionVolume:o}:{}}}],python:`${u}.air_gap(${[`volume=${s}`,"in_place=True",`flow_rate=${n}`].join(", ")})`}},nI=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,tipRack:u,wellLocation:p,primaryNozzle:d,nozzles:f}=e,_="aspirate",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=qn(s,r.labware);if(b||h.push(ct({pipette:n})),!s||!r.labware[s]?h.push(pt({actionName:_,labware:s})):G(r.labware[s].stack)==="offDeck"&&h.push(wn()),ve.includes(y))h.push(Vt({typeOfStep:_}));else if(m[y]!=null){const k=G(m[y].stack);ve.includes(k)&&h.push(Vt({typeOfStep:_}))}Vn({pipette:n,labware:s,invariantContext:t,prevRobotState:r})&&h.push(Ta()),r.tipState.pipettes[n]?.hasTip||h.push(xt({actionName:_,pipette:n,labware:s,well:o}));const A=t.pipetteEntities[n]?.spec.channels!==1,w=ft({robotState:r,invariantContext:t,pipetteId:n,labwareId:s,wellLocationOffset:p?.offset??{x:0,y:0,z:0},wellTargetName:o,primaryNozzle:d,nozzleConfiguration:f});if(A&&b&&!w.isSafe&&h.push($t({unsafePipetteMovementReason:w.reason})),Va(r.modules,r.labware,s)&&h.push(In()),Ua(r.modules,r.labware,s)&&h.push(Mr()),Ha(r.modules,r.labware,s)&&h.push(ps()),za(r.modules,r.labware,s)&&h.push(En()),Hn(r.modules,y,T?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&h.push(Ia()),T||(Bn(r.modules,y)&&h.push(ga()),xn(r.modules,y,b)&&h.push(Ea()),xa(r.modules,y,b,t.labwareEntities[s])&&h.push(ds())),h.length===0&&b&&b.liquids.default.maxVolume<a&&h.push(os({actionName:_,volume:a,maxVolume:b.liquids.default.maxVolume})),h.length===0&&b){const k=qs(n,t,u);k<a&&h.push($b({actionName:_,volume:a,maxVolume:k}))}if(h.length>0)return{errors:h};const I=[{commandType:"aspirate",key:D(),params:{pipetteId:n,volume:a,labwareId:s,wellName:o,wellLocation:p,flowRate:i},...l&&{meta:{isAirGap:l}}}],S=t.pipetteEntities[n].pythonName,L=t.labwareEntities[s].pythonName,E=[`volume=${a}`,`location=${L}[${N(o)}]${Bt(p)}`,`flow_rate=${i}`],g=`${S}.aspirate(
|
|
2
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@opentrons/shared-data");function Db(){return{type:"INSUFFICIENT_TIPS",message:"Not enough tips to complete action"}}function Mb(){return{type:"MISSING_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips fully without an adapter"}}function Fb(){return{type:"REMOVE_96_CHANNEL_TIPRACK_ADAPTER",message:"A 96-channel cannot pick up tips partially with an adapter"}}function xt(e){const{actionName:t,pipette:r,labware:n,well:a}=e;return{message:n==null||a==null?`Attempted to ${t} with no tip on pipette: ${r} in place`:`Attempted to ${t} with no tip on pipette: ${r} from ${n}'s well ${a}`,type:"NO_TIP_ON_PIPETTE"}}function Ub(){return{message:"One or more of the pipettes has a tip",type:"PIPETTE_HAS_TIP"}}function pt(e){const{pipette:t}=e;return{message:`This step tries to use the ${t}. Add the pipette to your protocol or change the step to use a different pipette.`,type:"PIPETTE_DOES_NOT_EXIST"}}function dt(e){const{actionName:t,labware:r}=e;return console.warn(`Attempted to ${t} with labware id "${r}", this labware was not found under "labware"`),{message:`This step tries to use ${r}. Add the labware to your protocol or change the step to use a different labware.`,type:"LABWARE_DOES_NOT_EXIST"}}function Q(){return{message:"This step requires a module, but none is selected",type:"MISSING_MODULE"}}function qb(){return{message:"This module is not changing temperature because it has either been deactivated or is already holding a temperature. In order to pause the protocol and wait for your module to reach a temperature, you must first use a Temperature step to tell the module to start changing to a new temperature",type:"MISSING_TEMPERATURE_STEP"}}function dp(){return{message:"This module is not currently running a profile.",type:"MISSING_PROFILE_STEP"}}function $b(e){const{volume:t,maxVolume:r,actionName:n}=e;return{message:`This step tries to ${n} ${t}µL, but the tip can only hold ${r}µL.`,type:"TIP_VOLUME_EXCEEDED"}}function os(e){const{actionName:t,volume:r,maxVolume:n,disposalVolume:a}=e;return{message:a!=null?`Attemped to ${t} volume + disposal volume greater than pipette max volume (${r} + ${a} > ${n})`:`This step tries to ${t} ${r}µL, but the tip can only hold ${n}µL.`,type:"PIPETTE_VOLUME_EXCEEDED"}}const Vb=()=>({type:"MOVE_LOCATION_NOT_SPECIFIED",message:"This step is missing a move location."}),Ta=()=>({type:"MODULE_PIPETTE_COLLISION_DANGER",message:"Gen 1 8-Channel pipettes cannot access labware or tip racks in slot 4 or 6 because they are adjacent to modules."}),Bb=()=>({type:"THERMOCYCLER_BUSY_WITH_PROFILE",message:"This step cannot run while the Thermocycler is running a profile. Move the step outside the profile."}),In=()=>({type:"THERMOCYCLER_LID_CLOSED",message:"Attempted to interact with contents of a thermocycler with the lid closed."}),ps=()=>({type:"HEATER_SHAKER_LATCH_OPEN",message:"Attempted to interact with contents of a heater-shaker with the latch open."}),fp=()=>({type:"HEATER_SHAKER_LATCH_CLOSED",message:"Attempted to move the contents of a heater-shaker with the latch closed."}),Mr=()=>({type:"ABSORBANCE_READER_LID_CLOSED",message:"Attempted to interact with contents of an absorbance plate reader with the lid closed."}),xb=()=>({type:"ABSORBANCE_READER_NO_INITIALIZATION",message:"This step tries to read labware without initializing the Plate Reader first. Initialize the Plate Reader module or remove this step in order to proceed."}),Lh=()=>({type:"ABSORBANCE_READER_NO_GRIPPER",message:"This step involves opening or closing the Absorbance Plate Reader lid with a gripper. Add a gripper or remove step to proceed."}),Hb=()=>({type:"HOPPER_EMPTY",message:"Cannot retrieve labware from empty stacker"}),zb=()=>({type:"SHUTTLE_FULL",message:"Shuttle must be empty in order to retrieve labware from the stacker"}),jb=()=>({type:"SHUTTLE_EMPTY",message:"Shuttle must have labware in order to store it in the stacker"}),Oh=()=>({type:"MISMATCHED_STACKER_LABWARE_TYPE",message:"The stacker can only store a single type of labware at a time"}),Gb=()=>({type:"MISSING_STACKER_LABWARE_TYPE",message:"Add labware to the stacker in the starting deck so that you can refill it later"}),Rh=()=>({type:"HOPPER_FULL",message:"The hopper has reached capacity"}),En=()=>({type:"HEATER_SHAKER_IS_SHAKING",message:"Attempted to interact with the contents of a heater-shaker when it is shaking."}),Wb=e=>({type:"TALL_LABWARE_EAST_WEST_OF_HEATER_SHAKER",message:`Labware over 53 mm is ${e} of this Heater-Shaker module.`}),$t=e=>{const{unsafePipetteMovementReason:t}=e;switch(t.type){case"thermocyclerLidCollision":return{type:"POSSIBLE_PIPETTE_COLLISION_THERMOCYCLER_LID",message:"There is a possibility that the Pipette will collide with the Thermocycler lid"};case"outsidePipetteExtents":return{type:"POSSIBLE_PIPETTE_COLLISION_OUTSIDE_DECK_EXTENTS",message:"There is a possibility that the pipette will move outside the deck extents."};case"adjacentAdressableAreaCollision":return{type:"POSSIBLE_PIPETTE_COLLISION_ADJACENT_ADDRESSABLE_AREA",message:`There is a possibility that the pipette will collide with adjacent items in ${t.addressableAreaCausingCollision.displayName}`,translationParams:{addressableAreaCausingCollisionDisplayName:t.addressableAreaCausingCollision.displayName}}}},ga=()=>({type:"HEATER_SHAKER_EAST_WEST_LATCH_OPEN",message:"The Heater-Shaker labware latch is open"}),Ia=()=>({type:"HEATER_SHAKER_NORTH_SOUTH_EAST_WEST_SHAKING",message:"The Heater-Shaker is shaking"}),Ea=()=>({type:"HEATER_SHAKER_EAST_WEST_MULTI_CHANNEL",message:"The Heater-Shaker is shaking"}),ds=()=>({type:"HEATER_SHAKER_NORTH_SOUTH__OF_NON_TIPRACK_WITH_MULTI_CHANNEL",message:"8-Channel pipette cannot access labware"}),wn=()=>({type:"LABWARE_OFF_DECK",message:"Attempted to interact with labware off deck"}),Yb=()=>({type:"LABWARE_ON_ANOTHER_ENTITY",message:"Attempted to move labware onto another entity with the same slotName"}),Rn=()=>({type:"DROP_TIP_LOCATION_DOES_NOT_EXIST",message:"The destination for dropping tip does not exist"}),kh=()=>({type:"EQUIPMENT_DOES_NOT_EXIST",message:"Equipment does not exist."}),Kb=()=>({type:"GRIPPER_REQUIRED",message:"The gripper is required to fulfill this action"}),Vt=e=>({type:"PIPETTING_INTO_COLUMN_4",message:`Cannot ${e.typeOfStep} into a column 4 slot.`}),Xb=()=>({type:"CANNOT_MOVE_WITH_GRIPPER",message:"The gripper cannot move aluminum blocks"}),Zb=()=>({type:"NO_TIP_SELECTED",message:"No tips were selected for this step"}),wa=()=>({type:"LABWARE_DISCARDED_IN_TRASH",message:"The labware was discarded in trash in a previous step."}),vh=()=>({type:"SUBMERGE_BELOW_ASPIRATE",message:"The submerge position must be above the aspirate position"}),Ph=()=>({type:"RETRACT_BELOW_ASPIRATE",message:"The retract position must be above the aspirate position"}),Qb=()=>({type:"SUBMERGE_BELOW_DISPENSE",message:"The submerge position must be above the dispense position"}),Jb=()=>({type:"RETRACT_BELOW_DISPENSE",message:"The retract position must be above the dispense position"}),eT=()=>({type:"MULTI_ASPIRATE_VOLUME_TOO_HIGH",message:"Consolidate pipette path was selected but cannot fit volume for more than 1 well in the tip"}),tT=()=>({type:"MULTI_DISPENSE_VOLUME_TOO_HIGH",message:"Distribute pipette path was selected but cannot fit volume for more than 1 well in the tip"}),rT=e=>({type:"CLOSING_THERMOCYCLER_WITH_INVALID_LABWARE_LID",message:`Closing the Thermocycler lid with ${e.lidDisplayName} in place will cause damage`}),mp=()=>({type:"RETURN_TIP_UNAVAILABLE",message:"Current tip does not have a known location to return to"}),nT=()=>({type:"TIPRACK_LID_NOT_ALLOWED_ON_DECK",message:"The tip rack lid is not supported directly on the deck"}),aT=()=>({type:"NEXT_TIPRACK_HAS_LID",message:"A pipette cannot pick up tips from a tip rack with a lid"}),sT=e=>({type:"STACK_TOO_HIGH",message:`The stack on slot ${e.slot} is too high`}),oT=()=>({type:"TOO_MANY_TIPS",message:"Action will pick up too many tips"}),iT=()=>({type:"INCOMPLETE_PICKUP",message:"At least one of the selected tips is empty"}),lT=()=>({type:"LABWARE_ON_HOPPER",message:"Labware cannot be moved from the Flex Stacker Hopper"}),uT=()=>({type:"MISSING_PUMP_ACTIVITY",message:"This module is not currently running a pump activity."}),cT=e=>({type:"INVALID_WAIT_CONDITION",message:`Invalid wait condition: ${e}`}),Sa=()=>({type:"LIVE_TASK_ERROR",message:"This module is currently running a live task. Please wait for it to complete before performing this action."}),hp=()=>({type:"VACUUM_UNDER_PRESSURE",message:"The vacuum module is under pressure. Deactivate the pump to move labware to or from it."});function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bs,_p;function Ch(){if(_p)return Bs;_p=1;var e=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;return Bs=e,Bs}var xs,yp;function Ht(){if(yp)return xs;yp=1;var e=Ch(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return xs=r,xs}var Hs,bp;function kn(){if(bp)return Hs;bp=1;var e=Ht(),t=e.Symbol;return Hs=t,Hs}var zs,Tp;function pT(){if(Tp)return zs;Tp=1;var e=kn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function s(o){var i=r.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var p=n.call(o);return u&&(i?o[a]=l:delete o[a]),p}return zs=s,zs}var js,gp;function dT(){if(gp)return js;gp=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return js=r,js}var Gs,Ip;function vn(){if(Ip)return Gs;Ip=1;var e=kn(),t=pT(),r=dT(),n="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function o(i){return i==null?i===void 0?a:n:s&&s in Object(i)?t(i):r(i)}return Gs=o,Gs}var Ws,Ep;function nr(){if(Ep)return Ws;Ep=1;function e(t){return t!=null&&typeof t=="object"}return Ws=e,Ws}var Ys,wp;function Aa(){if(wp)return Ys;wp=1;var e=vn(),t=nr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Ys=n,Ys}var Ks,Sp;function Nh(){if(Sp)return Ks;Sp=1;var e=Aa();function t(r,n,a){for(var s=-1,o=r.length;++s<o;){var i=r[s],l=n(i);if(l!=null&&(u===void 0?l===l&&!e(l):a(l,u)))var u=l,p=i}return p}return Ks=t,Ks}var Xs,Ap;function fT(){if(Ap)return Xs;Ap=1;function e(t,r){return t<r}return Xs=e,Xs}var Zs,Lp;function La(){if(Lp)return Zs;Lp=1;function e(t){return t}return Zs=e,Zs}var Qs,Op;function mT(){if(Op)return Qs;Op=1;var e=Nh(),t=fT(),r=La();function n(a){return a&&a.length?e(a,r,t):void 0}return Qs=n,Qs}var hT=mT();const _T=xe(hT),Oa="TEMPERATURE_DEACTIVATED",lc="TEMPERATURE_AT_TARGET",uc="TEMPERATURE_APPROACHING_TARGET",xu=1,Dh=[c.MAGNETIC_MODULE_V1,c.TEMPERATURE_MODULE_V1],Hu="fixedTrash",Mh={type:c.MAGNETIC_MODULE_TYPE,engaged:!1},Fh={type:c.TEMPERATURE_MODULE_TYPE,status:Oa,targetTemperature:null},Uh={type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0},qh={type:c.HEATERSHAKER_MODULE_TYPE,targetTemp:null,targetSpeed:null,latchOpen:null},$h={type:"absorbanceReaderType",lidOpen:null,initialization:null},Vh={type:"magneticBlockType"},Bh={type:c.FLEX_STACKER_MODULE_TYPE,storedLabwareDetails:null,labwareInHopper:null,labwareOnShuttle:null,setStoredLabwareCount:1,fillCount:1},xh={type:c.VACUUM_MODULE_TYPE,ventStatus:null,numPumpActivitiesStarted:0,currentPumpActivity:{type:"pumpDeactivated"}},Hh={[c.MAGNETIC_MODULE_TYPE]:Mh,[c.TEMPERATURE_MODULE_TYPE]:Fh,[c.THERMOCYCLER_MODULE_TYPE]:Uh,[c.HEATERSHAKER_MODULE_TYPE]:qh,[c.ABSORBANCE_READER_TYPE]:$h,[c.MAGNETIC_BLOCK_TYPE]:Vh,[c.FLEX_STACKER_MODULE_TYPE]:Bh,[c.VACUUM_MODULE_TYPE]:xh},yT="opentrons/opentrons_1_trash_1100ml_fixed/1",bT="opentrons/opentrons_1_trash_3200ml_fixed/1",ve=["A4","B4","C4","D4"],wt={x:0,y:0,z:0},zh="mounted",Ra="CLEAN",Qt="DIRTY",ue="EMPTY",cc="automatic",St="manual",jh=["A4","B4","C4","D4"],TT=["7","8","10","11"],Ze="hopper",Gh=["hopperA4","hopperB4","hopperC4","hopperD4"],Wh={hopperA4:"A4",hopperB4:"B4",hopperC4:"C4",hopperD4:"D4"},Jt=["adapterLabwareId","primaryLabwareId","lidLabwareId"],gT=["adapterLabwareURI","primaryLabwareURI","lidLabwareURI"],IT={A4:"hopperA4",B4:"hopperB4",C4:"hopperC4",D4:"hopperD4"},pc="vacuumDock",Yh=c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA,dc="opened",ka="closed",zu="power",ju="pressure",ET="state",wT="profile",ST="pumpOff",AT="pumpOn",LT="vent",OT="open",RT="closed",kT="VACUUM_DEACTIVATED",vT="VACUUM_AT_TARGET",Kh=["opentrons_vacuum_manifold_spacer_short","opentrons_vacuum_manifold_spacer_tall"],Xh="A4",$e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function PT(e,t=0){return($e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]).toLowerCase()}const CT=new Uint8Array(16);function NT(){return crypto.getRandomValues(CT)}function DT(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():MT(e,t,r)}function MT(e,t,r){e=e||{};const n=e.random??e.rng?.()??NT();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)t[r+a]=n[a];return t}return PT(n)}var Js,Rp;function fc(){if(Rp)return Js;Rp=1;function e(t,r){for(var n=-1,a=r.length,s=t.length;++n<a;)t[s+n]=r[n];return t}return Js=e,Js}var eo,kp;function FT(){if(kp)return eo;kp=1;var e=vn(),t=nr(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return eo=n,eo}var to,vp;function fs(){if(vp)return to;vp=1;var e=FT(),t=nr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(o){return t(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return to=s,to}var ro,Pp;function Qe(){if(Pp)return ro;Pp=1;var e=Array.isArray;return ro=e,ro}var no,Cp;function UT(){if(Cp)return no;Cp=1;var e=kn(),t=fs(),r=Qe(),n=e?e.isConcatSpreadable:void 0;function a(s){return r(s)||t(s)||!!(n&&s&&s[n])}return no=a,no}var ao,Np;function Zh(){if(Np)return ao;Np=1;var e=fc(),t=UT();function r(n,a,s,o,i){var l=-1,u=n.length;for(s||(s=t),i||(i=[]);++l<u;){var p=n[l];a>0&&s(p)?a>1?r(p,a-1,s,o,i):e(i,p):o||(i[i.length]=p)}return i}return ao=r,ao}var so,Dp;function va(){if(Dp)return so;Dp=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=Array(a);++n<a;)s[n]=r(t[n],n,t);return s}return so=e,so}var oo,Mp;function qT(){if(Mp)return oo;Mp=1;function e(){this.__data__=[],this.size=0}return oo=e,oo}var io,Fp;function ms(){if(Fp)return io;Fp=1;function e(t,r){return t===r||t!==t&&r!==r}return io=e,io}var lo,Up;function hs(){if(Up)return lo;Up=1;var e=ms();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return lo=t,lo}var uo,qp;function $T(){if(qp)return uo;qp=1;var e=hs(),t=Array.prototype,r=t.splice;function n(a){var s=this.__data__,o=e(s,a);if(o<0)return!1;var i=s.length-1;return o==i?s.pop():r.call(s,o,1),--this.size,!0}return uo=n,uo}var co,$p;function VT(){if($p)return co;$p=1;var e=hs();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return co=t,co}var po,Vp;function BT(){if(Vp)return po;Vp=1;var e=hs();function t(r){return e(this.__data__,r)>-1}return po=t,po}var fo,Bp;function xT(){if(Bp)return fo;Bp=1;var e=hs();function t(r,n){var a=this.__data__,s=e(a,r);return s<0?(++this.size,a.push([r,n])):a[s][1]=n,this}return fo=t,fo}var mo,xp;function _s(){if(xp)return mo;xp=1;var e=qT(),t=$T(),r=VT(),n=BT(),a=xT();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,mo=s,mo}var ho,Hp;function HT(){if(Hp)return ho;Hp=1;var e=_s();function t(){this.__data__=new e,this.size=0}return ho=t,ho}var _o,zp;function zT(){if(zp)return _o;zp=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return _o=e,_o}var yo,jp;function jT(){if(jp)return yo;jp=1;function e(t){return this.__data__.get(t)}return yo=e,yo}var bo,Gp;function GT(){if(Gp)return bo;Gp=1;function e(t){return this.__data__.has(t)}return bo=e,bo}var To,Wp;function ar(){if(Wp)return To;Wp=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return To=e,To}var go,Yp;function Qh(){if(Yp)return go;Yp=1;var e=vn(),t=ar(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function o(i){if(!t(i))return!1;var l=e(i);return l==n||l==a||l==r||l==s}return go=o,go}var Io,Kp;function WT(){if(Kp)return Io;Kp=1;var e=Ht(),t=e["__core-js_shared__"];return Io=t,Io}var Eo,Xp;function YT(){if(Xp)return Eo;Xp=1;var e=WT(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Eo=r,Eo}var wo,Zp;function Jh(){if(Zp)return wo;Zp=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return wo=r,wo}var So,Qp;function KT(){if(Qp)return So;Qp=1;var e=Qh(),t=YT(),r=ar(),n=Jh(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,i=Object.prototype,l=o.toString,u=i.hasOwnProperty,p=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||t(f))return!1;var _=e(f)?p:s;return _.test(n(f))}return So=d,So}var Ao,Jp;function XT(){if(Jp)return Ao;Jp=1;function e(t,r){return t?.[r]}return Ao=e,Ao}var Lo,ed;function Br(){if(ed)return Lo;ed=1;var e=KT(),t=XT();function r(n,a){var s=t(n,a);return e(s)?s:void 0}return Lo=r,Lo}var Oo,td;function mc(){if(td)return Oo;td=1;var e=Br(),t=Ht(),r=e(t,"Map");return Oo=r,Oo}var Ro,rd;function ys(){if(rd)return Ro;rd=1;var e=Br(),t=e(Object,"create");return Ro=t,Ro}var ko,nd;function ZT(){if(nd)return ko;nd=1;var e=ys();function t(){this.__data__=e?e(null):{},this.size=0}return ko=t,ko}var vo,ad;function QT(){if(ad)return vo;ad=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return vo=e,vo}var Po,sd;function JT(){if(sd)return Po;sd=1;var e=ys(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(s){var o=this.__data__;if(e){var i=o[s];return i===t?void 0:i}return n.call(o,s)?o[s]:void 0}return Po=a,Po}var Co,od;function eg(){if(od)return Co;od=1;var e=ys(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var s=this.__data__;return e?s[a]!==void 0:r.call(s,a)}return Co=n,Co}var No,id;function tg(){if(id)return No;id=1;var e=ys(),t="__lodash_hash_undefined__";function r(n,a){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=e&&a===void 0?t:a,this}return No=r,No}var Do,ld;function rg(){if(ld)return Do;ld=1;var e=ZT(),t=QT(),r=JT(),n=eg(),a=tg();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,Do=s,Do}var Mo,ud;function ng(){if(ud)return Mo;ud=1;var e=rg(),t=_s(),r=mc();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Mo=n,Mo}var Fo,cd;function ag(){if(cd)return Fo;cd=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Fo=e,Fo}var Uo,pd;function bs(){if(pd)return Uo;pd=1;var e=ag();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Uo=t,Uo}var qo,dd;function sg(){if(dd)return qo;dd=1;var e=bs();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return qo=t,qo}var $o,fd;function og(){if(fd)return $o;fd=1;var e=bs();function t(r){return e(this,r).get(r)}return $o=t,$o}var Vo,md;function ig(){if(md)return Vo;md=1;var e=bs();function t(r){return e(this,r).has(r)}return Vo=t,Vo}var Bo,hd;function lg(){if(hd)return Bo;hd=1;var e=bs();function t(r,n){var a=e(this,r),s=a.size;return a.set(r,n),this.size+=a.size==s?0:1,this}return Bo=t,Bo}var xo,_d;function hc(){if(_d)return xo;_d=1;var e=ng(),t=sg(),r=og(),n=ig(),a=lg();function s(o){var i=-1,l=o==null?0:o.length;for(this.clear();++i<l;){var u=o[i];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=a,xo=s,xo}var Ho,yd;function ug(){if(yd)return Ho;yd=1;var e=_s(),t=mc(),r=hc(),n=200;function a(s,o){var i=this.__data__;if(i instanceof e){var l=i.__data__;if(!t||l.length<n-1)return l.push([s,o]),this.size=++i.size,this;i=this.__data__=new r(l)}return i.set(s,o),this.size=i.size,this}return Ho=a,Ho}var zo,bd;function _c(){if(bd)return zo;bd=1;var e=_s(),t=HT(),r=zT(),n=jT(),a=GT(),s=ug();function o(i){var l=this.__data__=new e(i);this.size=l.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=s,zo=o,zo}var jo,Td;function cg(){if(Td)return jo;Td=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return jo=t,jo}var Go,gd;function pg(){if(gd)return Go;gd=1;function e(t){return this.__data__.has(t)}return Go=e,Go}var Wo,Id;function e_(){if(Id)return Wo;Id=1;var e=hc(),t=cg(),r=pg();function n(a){var s=-1,o=a==null?0:a.length;for(this.__data__=new e;++s<o;)this.add(a[s])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Wo=n,Wo}var Yo,Ed;function t_(){if(Ed)return Yo;Ed=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return Yo=e,Yo}var Ko,wd;function r_(){if(wd)return Ko;wd=1;function e(t,r){return t.has(r)}return Ko=e,Ko}var Xo,Sd;function n_(){if(Sd)return Xo;Sd=1;var e=e_(),t=t_(),r=r_(),n=1,a=2;function s(o,i,l,u,p,d){var f=l&n,_=o.length,m=i.length;if(_!=m&&!(f&&m>_))return!1;var h=d.get(o),b=d.get(i);if(h&&b)return h==i&&b==o;var T=-1,y=!0,A=l&a?new e:void 0;for(d.set(o,i),d.set(i,o);++T<_;){var w=o[T],I=i[T];if(u)var S=f?u(I,w,T,i,o,d):u(w,I,T,o,i,d);if(S!==void 0){if(S)continue;y=!1;break}if(A){if(!t(i,function(L,E){if(!r(A,E)&&(w===L||p(w,L,l,u,d)))return A.push(E)})){y=!1;break}}else if(!(w===I||p(w,I,l,u,d))){y=!1;break}}return d.delete(o),d.delete(i),y}return Xo=s,Xo}var Zo,Ad;function a_(){if(Ad)return Zo;Ad=1;var e=Ht(),t=e.Uint8Array;return Zo=t,Zo}var Qo,Ld;function dg(){if(Ld)return Qo;Ld=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,s){n[++r]=[s,a]}),n}return Qo=e,Qo}var Jo,Od;function yc(){if(Od)return Jo;Od=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return Jo=e,Jo}var ei,Rd;function fg(){if(Rd)return ei;Rd=1;var e=kn(),t=a_(),r=ms(),n=n_(),a=dg(),s=yc(),o=1,i=2,l="[object Boolean]",u="[object Date]",p="[object Error]",d="[object Map]",f="[object Number]",_="[object RegExp]",m="[object Set]",h="[object String]",b="[object Symbol]",T="[object ArrayBuffer]",y="[object DataView]",A=e?e.prototype:void 0,w=A?A.valueOf:void 0;function I(S,L,E,g,k,v,q){switch(E){case y:if(S.byteLength!=L.byteLength||S.byteOffset!=L.byteOffset)return!1;S=S.buffer,L=L.buffer;case T:return!(S.byteLength!=L.byteLength||!v(new t(S),new t(L)));case l:case u:case f:return r(+S,+L);case p:return S.name==L.name&&S.message==L.message;case _:case h:return S==L+"";case d:var $=a;case m:var ee=g&o;if($||($=s),S.size!=L.size&&!ee)return!1;var de=q.get(S);if(de)return de==L;g|=i,q.set(S,L);var Te=n($(S),$(L),g,k,v,q);return q.delete(S),Te;case b:if(w)return w.call(S)==w.call(L)}return!1}return ei=I,ei}var ti,kd;function s_(){if(kd)return ti;kd=1;var e=fc(),t=Qe();function r(n,a,s){var o=a(n);return t(n)?o:e(o,s(n))}return ti=r,ti}var ri,vd;function o_(){if(vd)return ri;vd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,s=0,o=[];++n<a;){var i=t[n];r(i,n,t)&&(o[s++]=i)}return o}return ri=e,ri}var ni,Pd;function i_(){if(Pd)return ni;Pd=1;function e(){return[]}return ni=e,ni}var ai,Cd;function bc(){if(Cd)return ai;Cd=1;var e=o_(),t=i_(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(i){return n.call(o,i)}))}:t;return ai=s,ai}var si,Nd;function l_(){if(Nd)return si;Nd=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return si=e,si}var ca={exports:{}},oi,Dd;function mg(){if(Dd)return oi;Dd=1;function e(){return!1}return oi=e,oi}ca.exports;var Md;function Ts(){return Md||(Md=1,(function(e,t){var r=Ht(),n=mg(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,i=o?r.Buffer:void 0,l=i?i.isBuffer:void 0,u=l||n;e.exports=u})(ca,ca.exports)),ca.exports}var ii,Fd;function gs(){if(Fd)return ii;Fd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var s=typeof n;return a=a??e,!!a&&(s=="number"||s!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return ii=r,ii}var li,Ud;function Tc(){if(Ud)return li;Ud=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return li=t,li}var ui,qd;function hg(){if(qd)return ui;qd=1;var e=vn(),t=Tc(),r=nr(),n="[object Arguments]",a="[object Array]",s="[object Boolean]",o="[object Date]",i="[object Error]",l="[object Function]",u="[object Map]",p="[object Number]",d="[object Object]",f="[object RegExp]",_="[object Set]",m="[object String]",h="[object WeakMap]",b="[object ArrayBuffer]",T="[object DataView]",y="[object Float32Array]",A="[object Float64Array]",w="[object Int8Array]",I="[object Int16Array]",S="[object Int32Array]",L="[object Uint8Array]",E="[object Uint8ClampedArray]",g="[object Uint16Array]",k="[object Uint32Array]",v={};v[y]=v[A]=v[w]=v[I]=v[S]=v[L]=v[E]=v[g]=v[k]=!0,v[n]=v[a]=v[b]=v[s]=v[T]=v[o]=v[i]=v[l]=v[u]=v[p]=v[d]=v[f]=v[_]=v[m]=v[h]=!1;function q($){return r($)&&t($.length)&&!!v[e($)]}return ui=q,ui}var ci,$d;function gc(){if($d)return ci;$d=1;function e(t){return function(r){return t(r)}}return ci=e,ci}var pa={exports:{}};pa.exports;var Vd;function Ic(){return Vd||(Vd=1,(function(e,t){var r=Ch(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s&&r.process,i=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();e.exports=i})(pa,pa.exports)),pa.exports}var pi,Bd;function Ec(){if(Bd)return pi;Bd=1;var e=hg(),t=gc(),r=Ic(),n=r&&r.isTypedArray,a=n?t(n):e;return pi=a,pi}var di,xd;function u_(){if(xd)return di;xd=1;var e=l_(),t=fs(),r=Qe(),n=Ts(),a=gs(),s=Ec(),o=Object.prototype,i=o.hasOwnProperty;function l(u,p){var d=r(u),f=!d&&t(u),_=!d&&!f&&n(u),m=!d&&!f&&!_&&s(u),h=d||f||_||m,b=h?e(u.length,String):[],T=b.length;for(var y in u)(p||i.call(u,y))&&!(h&&(y=="length"||_&&(y=="offset"||y=="parent")||m&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,T)))&&b.push(y);return b}return di=l,di}var fi,Hd;function Is(){if(Hd)return fi;Hd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return fi=t,fi}var mi,zd;function c_(){if(zd)return mi;zd=1;function e(t,r){return function(n){return t(r(n))}}return mi=e,mi}var hi,jd;function _g(){if(jd)return hi;jd=1;var e=c_(),t=e(Object.keys,Object);return hi=t,hi}var _i,Gd;function p_(){if(Gd)return _i;Gd=1;var e=Is(),t=_g(),r=Object.prototype,n=r.hasOwnProperty;function a(s){if(!e(s))return t(s);var o=[];for(var i in Object(s))n.call(s,i)&&i!="constructor"&&o.push(i);return o}return _i=a,_i}var yi,Wd;function xr(){if(Wd)return yi;Wd=1;var e=Qh(),t=Tc();function r(n){return n!=null&&t(n.length)&&!e(n)}return yi=r,yi}var bi,Yd;function Pa(){if(Yd)return bi;Yd=1;var e=u_(),t=p_(),r=xr();function n(a){return r(a)?e(a):t(a)}return bi=n,bi}var Ti,Kd;function d_(){if(Kd)return Ti;Kd=1;var e=s_(),t=bc(),r=Pa();function n(a){return e(a,r,t)}return Ti=n,Ti}var gi,Xd;function yg(){if(Xd)return gi;Xd=1;var e=d_(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i,l,u,p){var d=i&t,f=e(s),_=f.length,m=e(o),h=m.length;if(_!=h&&!d)return!1;for(var b=_;b--;){var T=f[b];if(!(d?T in o:n.call(o,T)))return!1}var y=p.get(s),A=p.get(o);if(y&&A)return y==o&&A==s;var w=!0;p.set(s,o),p.set(o,s);for(var I=d;++b<_;){T=f[b];var S=s[T],L=o[T];if(l)var E=d?l(L,S,T,o,s,p):l(S,L,T,s,o,p);if(!(E===void 0?S===L||u(S,L,i,l,p):E)){w=!1;break}I||(I=T=="constructor")}if(w&&!I){var g=s.constructor,k=o.constructor;g!=k&&"constructor"in s&&"constructor"in o&&!(typeof g=="function"&&g instanceof g&&typeof k=="function"&&k instanceof k)&&(w=!1)}return p.delete(s),p.delete(o),w}return gi=a,gi}var Ii,Zd;function bg(){if(Zd)return Ii;Zd=1;var e=Br(),t=Ht(),r=e(t,"DataView");return Ii=r,Ii}var Ei,Qd;function Tg(){if(Qd)return Ei;Qd=1;var e=Br(),t=Ht(),r=e(t,"Promise");return Ei=r,Ei}var wi,Jd;function f_(){if(Jd)return wi;Jd=1;var e=Br(),t=Ht(),r=e(t,"Set");return wi=r,wi}var Si,ef;function gg(){if(ef)return Si;ef=1;var e=Br(),t=Ht(),r=e(t,"WeakMap");return Si=r,Si}var Ai,tf;function Ca(){if(tf)return Ai;tf=1;var e=bg(),t=mc(),r=Tg(),n=f_(),a=gg(),s=vn(),o=Jh(),i="[object Map]",l="[object Object]",u="[object Promise]",p="[object Set]",d="[object WeakMap]",f="[object DataView]",_=o(e),m=o(t),h=o(r),b=o(n),T=o(a),y=s;return(e&&y(new e(new ArrayBuffer(1)))!=f||t&&y(new t)!=i||r&&y(r.resolve())!=u||n&&y(new n)!=p||a&&y(new a)!=d)&&(y=function(A){var w=s(A),I=w==l?A.constructor:void 0,S=I?o(I):"";if(S)switch(S){case _:return f;case m:return i;case h:return u;case b:return p;case T:return d}return w}),Ai=y,Ai}var Li,rf;function Ig(){if(rf)return Li;rf=1;var e=_c(),t=n_(),r=fg(),n=yg(),a=Ca(),s=Qe(),o=Ts(),i=Ec(),l=1,u="[object Arguments]",p="[object Array]",d="[object Object]",f=Object.prototype,_=f.hasOwnProperty;function m(h,b,T,y,A,w){var I=s(h),S=s(b),L=I?p:a(h),E=S?p:a(b);L=L==u?d:L,E=E==u?d:E;var g=L==d,k=E==d,v=L==E;if(v&&o(h)){if(!o(b))return!1;I=!0,g=!1}if(v&&!g)return w||(w=new e),I||i(h)?t(h,b,T,y,A,w):r(h,b,L,T,y,A,w);if(!(T&l)){var q=g&&_.call(h,"__wrapped__"),$=k&&_.call(b,"__wrapped__");if(q||$){var ee=q?h.value():h,de=$?b.value():b;return w||(w=new e),A(ee,de,T,y,w)}}return v?(w||(w=new e),n(h,b,T,y,A,w)):!1}return Li=m,Li}var Oi,nf;function wc(){if(nf)return Oi;nf=1;var e=Ig(),t=nr();function r(n,a,s,o,i){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,s,o,r,i)}return Oi=r,Oi}var Ri,af;function Eg(){if(af)return Ri;af=1;var e=_c(),t=wc(),r=1,n=2;function a(s,o,i,l){var u=i.length,p=u,d=!l;if(s==null)return!p;for(s=Object(s);u--;){var f=i[u];if(d&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++u<p;){f=i[u];var _=f[0],m=s[_],h=f[1];if(d&&f[2]){if(m===void 0&&!(_ in s))return!1}else{var b=new e;if(l)var T=l(m,h,_,s,o,b);if(!(T===void 0?t(h,m,r|n,l,b):T))return!1}}return!0}return Ri=a,Ri}var ki,sf;function m_(){if(sf)return ki;sf=1;var e=ar();function t(r){return r===r&&!e(r)}return ki=t,ki}var vi,of;function wg(){if(of)return vi;of=1;var e=m_(),t=Pa();function r(n){for(var a=t(n),s=a.length;s--;){var o=a[s],i=n[o];a[s]=[o,i,e(i)]}return a}return vi=r,vi}var Pi,lf;function h_(){if(lf)return Pi;lf=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Pi=e,Pi}var Ci,uf;function Sg(){if(uf)return Ci;uf=1;var e=Eg(),t=wg(),r=h_();function n(a){var s=t(a);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(o){return o===a||e(o,a,s)}}return Ci=n,Ci}var Ni,cf;function Sc(){if(cf)return Ni;cf=1;var e=Qe(),t=Aa(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(s,o){if(e(s))return!1;var i=typeof s;return i=="number"||i=="symbol"||i=="boolean"||s==null||t(s)?!0:n.test(s)||!r.test(s)||o!=null&&s in Object(o)}return Ni=a,Ni}var Di,pf;function Ag(){if(pf)return Di;pf=1;var e=hc(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var o=arguments,i=a?a.apply(this,o):o[0],l=s.cache;if(l.has(i))return l.get(i);var u=n.apply(this,o);return s.cache=l.set(i,u)||l,u};return s.cache=new(r.Cache||e),s}return r.Cache=e,Di=r,Di}var Mi,df;function Lg(){if(df)return Mi;df=1;var e=Ag(),t=500;function r(n){var a=e(n,function(o){return s.size===t&&s.clear(),o}),s=a.cache;return a}return Mi=r,Mi}var Fi,ff;function Og(){if(ff)return Fi;ff=1;var e=Lg(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(o,i,l,u){s.push(l?u.replace(r,"$1"):i||o)}),s});return Fi=n,Fi}var Ui,mf;function Rg(){if(mf)return Ui;mf=1;var e=kn(),t=va(),r=Qe(),n=Aa(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function o(i){if(typeof i=="string")return i;if(r(i))return t(i,o)+"";if(n(i))return s?s.call(i):"";var l=i+"";return l=="0"&&1/i==-1/0?"-0":l}return Ui=o,Ui}var qi,hf;function kg(){if(hf)return qi;hf=1;var e=Rg();function t(r){return r==null?"":e(r)}return qi=t,qi}var $i,_f;function Pn(){if(_f)return $i;_f=1;var e=Qe(),t=Sc(),r=Og(),n=kg();function a(s,o){return e(s)?s:t(s,o)?[s]:r(n(s))}return $i=a,$i}var Vi,yf;function Cn(){if(yf)return Vi;yf=1;var e=Aa();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Vi=t,Vi}var Bi,bf;function Es(){if(bf)return Bi;bf=1;var e=Pn(),t=Cn();function r(n,a){a=e(a,n);for(var s=0,o=a.length;n!=null&&s<o;)n=n[t(a[s++])];return s&&s==o?n:void 0}return Bi=r,Bi}var xi,Tf;function vg(){if(Tf)return xi;Tf=1;var e=Es();function t(r,n,a){var s=r==null?void 0:e(r,n);return s===void 0?a:s}return xi=t,xi}var Hi,gf;function Pg(){if(gf)return Hi;gf=1;function e(t,r){return t!=null&&r in Object(t)}return Hi=e,Hi}var zi,If;function Cg(){if(If)return zi;If=1;var e=Pn(),t=fs(),r=Qe(),n=gs(),a=Tc(),s=Cn();function o(i,l,u){l=e(l,i);for(var p=-1,d=l.length,f=!1;++p<d;){var _=s(l[p]);if(!(f=i!=null&&u(i,_)))break;i=i[_]}return f||++p!=d?f:(d=i==null?0:i.length,!!d&&a(d)&&n(_,d)&&(r(i)||t(i)))}return zi=o,zi}var ji,Ef;function Ng(){if(Ef)return ji;Ef=1;var e=Pg(),t=Cg();function r(n,a){return n!=null&&t(n,a,e)}return ji=r,ji}var Gi,wf;function Dg(){if(wf)return Gi;wf=1;var e=wc(),t=vg(),r=Ng(),n=Sc(),a=m_(),s=h_(),o=Cn(),i=1,l=2;function u(p,d){return n(p)&&a(d)?s(o(p),d):function(f){var _=t(f,p);return _===void 0&&_===d?r(f,p):e(d,_,i|l)}}return Gi=u,Gi}var Wi,Sf;function __(){if(Sf)return Wi;Sf=1;function e(t){return function(r){return r?.[t]}}return Wi=e,Wi}var Yi,Af;function Mg(){if(Af)return Yi;Af=1;var e=Es();function t(r){return function(n){return e(n,r)}}return Yi=t,Yi}var Ki,Lf;function Fg(){if(Lf)return Ki;Lf=1;var e=__(),t=Mg(),r=Sc(),n=Cn();function a(s){return r(s)?e(n(s)):t(s)}return Ki=a,Ki}var Xi,Of;function Nn(){if(Of)return Xi;Of=1;var e=Sg(),t=Dg(),r=La(),n=Qe(),a=Fg();function s(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?t(o[0],o[1]):e(o):a(o)}return Xi=s,Xi}var Zi,Rf;function Ug(){if(Rf)return Zi;Rf=1;function e(t){return function(r,n,a){for(var s=-1,o=Object(r),i=a(r),l=i.length;l--;){var u=i[t?l:++s];if(n(o[u],u,o)===!1)break}return r}}return Zi=e,Zi}var Qi,kf;function qg(){if(kf)return Qi;kf=1;var e=Ug(),t=e();return Qi=t,Qi}var Ji,vf;function y_(){if(vf)return Ji;vf=1;var e=qg(),t=Pa();function r(n,a){return n&&e(n,a,t)}return Ji=r,Ji}var el,Pf;function $g(){if(Pf)return el;Pf=1;var e=xr();function t(r,n){return function(a,s){if(a==null)return a;if(!e(a))return r(a,s);for(var o=a.length,i=n?o:-1,l=Object(a);(n?i--:++i<o)&&s(l[i],i,l)!==!1;);return a}}return el=t,el}var tl,Cf;function Ac(){if(Cf)return tl;Cf=1;var e=y_(),t=$g(),r=t(e);return tl=r,tl}var rl,Nf;function Vg(){if(Nf)return rl;Nf=1;var e=Ac(),t=xr();function r(n,a){var s=-1,o=t(n)?Array(n.length):[];return e(n,function(i,l,u){o[++s]=a(i,l,u)}),o}return rl=r,rl}var nl,Df;function Bg(){if(Df)return nl;Df=1;var e=va(),t=Nn(),r=Vg(),n=Qe();function a(s,o){var i=n(s)?e:r;return i(s,t(o,3))}return nl=a,nl}var al,Mf;function xg(){if(Mf)return al;Mf=1;var e=Zh(),t=Bg();function r(n,a){return e(t(n,a),1)}return al=r,al}var Hg=xg();const Sn=xe(Hg);var sl,Ff;function b_(){if(Ff)return sl;Ff=1;var e=Br(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return sl=t,sl}var ol,Uf;function Lc(){if(Uf)return ol;Uf=1;var e=b_();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return ol=t,ol}var il,qf;function zg(){if(qf)return il;qf=1;var e=Lc(),t=y_(),r=Nn();function n(a,s){var o={};return s=r(s,3),t(a,function(i,l,u){e(o,l,s(i,l,u))}),o}return il=n,il}var jg=zg();const rr=xe(jg);var ll,$f;function Gg(){if($f)return ll;$f=1;var e=Math.ceil,t=Math.max;function r(n,a,s,o){for(var i=-1,l=t(e((a-n)/(s||1)),0),u=Array(l);l--;)u[o?l:++i]=n,n+=s;return u}return ll=r,ll}var ul,Vf;function Oc(){if(Vf)return ul;Vf=1;var e=ms(),t=xr(),r=gs(),n=ar();function a(s,o,i){if(!n(i))return!1;var l=typeof o;return(l=="number"?t(i)&&r(o,i.length):l=="string"&&o in i)?e(i[o],s):!1}return ul=a,ul}var cl,Bf;function Wg(){if(Bf)return cl;Bf=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return cl=t,cl}var pl,xf;function Yg(){if(xf)return pl;xf=1;var e=Wg(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return pl=r,pl}var dl,Hf;function Kg(){if(Hf)return dl;Hf=1;var e=Yg(),t=ar(),r=Aa(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var p=typeof u.valueOf=="function"?u.valueOf():u;u=t(p)?p+"":p}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=s.test(u);return d||o.test(u)?i(u.slice(2),d?2:8):a.test(u)?n:+u}return dl=l,dl}var fl,zf;function T_(){if(zf)return fl;zf=1;var e=Kg(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var s=a<0?-1:1;return s*r}return a===a?a:0}return fl=n,fl}var ml,jf;function Xg(){if(jf)return ml;jf=1;var e=Gg(),t=Oc(),r=T_();function n(a){return function(s,o,i){return i&&typeof i!="number"&&t(s,o,i)&&(o=i=void 0),s=r(s),o===void 0?(o=s,s=0):o=r(o),i=i===void 0?s<o?1:-1:r(i),e(s,o,i,a)}}return ml=n,ml}var hl,Gf;function Zg(){if(Gf)return hl;Gf=1;var e=Xg(),t=e();return hl=t,hl}var Qg=Zg();const bn=xe(Qg);var _l,Wf;function Jg(){if(Wf)return _l;Wf=1;function e(t,r,n,a){var s=-1,o=t==null?0:t.length;for(a&&o&&(n=t[++s]);++s<o;)n=r(n,t[s],s,t);return n}return _l=e,_l}var yl,Yf;function eI(){if(Yf)return yl;Yf=1;function e(t,r,n,a,s){return s(t,function(o,i,l){n=a?(a=!1,o):r(n,o,i,l)}),n}return yl=e,yl}var bl,Kf;function tI(){if(Kf)return bl;Kf=1;var e=Jg(),t=Ac(),r=Nn(),n=eI(),a=Qe();function s(o,i,l){var u=a(o)?e:n,p=arguments.length<3;return u(o,r(i,4),l,p,t)}return bl=s,bl}var rI=tI();const ct=xe(rI),ws=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=zn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(Q()),o||i.push(Lh()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/closeLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.close_lid()`}},g_=(e,t,r)=>{const{moduleId:n,sampleWavelengths:a,measureMode:s,referenceWavelength:o}=e,i=t.moduleEntities[n].pythonName,l=o!=null?`, reference_wavelength=${o}`:"";return{commands:[{commandType:"absorbanceReader/initialize",key:D(),params:{moduleId:n,measureMode:s,sampleWavelengths:a,...o!=null?{referenceWavelength:o}:{}}}],python:`${i}.initialize(${N(s)}, ${Ls(a)}${l})`}},I_=(e,t,r)=>{const{gripperEntities:n,moduleEntities:a}=t,s=zn(r,e.moduleId),o=Object.keys(n).length>0,i=[];if((e.moduleId==null||s==null)&&i.push(Q()),o||i.push(Lh()),i.length>0)return{errors:i};const l=a[e.moduleId].pythonName;return{commands:[{commandType:"absorbanceReader/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${l}.open_lid()`}},E_=(e,t,r)=>{const{moduleId:n,fileName:a}=e,s=[],o=zn(r,n);if(o==null)return{errors:[Q()]};o.initialization===null&&s.push(Mr());const i=t.moduleEntities[n].pythonName,l=a!=null?`export_filename=${N(a)}`:"";return s.length>0?{errors:s}:{commands:[{commandType:"absorbanceReader/read",key:D(),params:{moduleId:n,...a!=null?{fileName:a}:{}}}],python:`${i}.read(${l})`}},At=(e,t,r)=>{const{flowRate:n,pipetteId:a,volume:s,correctionVolume:o}=e,i=[];t.pipetteEntities[a]?.spec||i.push(pt({pipette:a}));const u=t.pipetteEntities[a].pythonName;return{commands:[{commandType:"airGapInPlace",key:D(),params:{flowRate:n,pipetteId:a,volume:s,...o!=null?{correctionVolume:o}:{}}}],python:`${u}.air_gap(${[`volume=${s}`,"in_place=True",`flow_rate=${n}`].join(", ")})`}},nI=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,tipRack:u,wellLocation:p,primaryNozzle:d,nozzles:f}=e,_="aspirate",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=qn(s,r.labware);if(b||h.push(pt({pipette:n})),!s||!r.labware[s]?h.push(dt({actionName:_,labware:s})):W(r.labware[s].stack)==="offDeck"&&h.push(wn()),ve.includes(y))h.push(Vt({typeOfStep:_}));else if(m[y]!=null){const k=W(m[y].stack);ve.includes(k)&&h.push(Vt({typeOfStep:_}))}Vn({pipette:n,labware:s,invariantContext:t,prevRobotState:r})&&h.push(Ta()),r.tipState.pipettes[n]?.hasTip||h.push(xt({actionName:_,pipette:n,labware:s,well:o}));const A=t.pipetteEntities[n]?.spec.channels!==1,w=ft({robotState:r,invariantContext:t,pipetteId:n,labwareId:s,wellLocationOffset:p?.offset??{x:0,y:0,z:0},wellTargetName:o,primaryNozzle:d,nozzleConfiguration:f});if(A&&b&&!w.isSafe&&h.push($t({unsafePipetteMovementReason:w.reason})),Va(r.modules,r.labware,s)&&h.push(In()),Ua(r.modules,r.labware,s)&&h.push(Mr()),Ha(r.modules,r.labware,s)&&h.push(ps()),za(r.modules,r.labware,s)&&h.push(En()),Hn(r.modules,y,T?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&h.push(Ia()),T||(Bn(r.modules,y)&&h.push(ga()),xn(r.modules,y,b)&&h.push(Ea()),xa(r.modules,y,b,t.labwareEntities[s])&&h.push(ds())),h.length===0&&b&&b.liquids.default.maxVolume<a&&h.push(os({actionName:_,volume:a,maxVolume:b.liquids.default.maxVolume})),h.length===0&&b){const k=qs(n,t,u);k<a&&h.push($b({actionName:_,volume:a,maxVolume:k}))}if(h.length>0)return{errors:h};const I=[{commandType:"aspirate",key:D(),params:{pipetteId:n,volume:a,labwareId:s,wellName:o,wellLocation:p,flowRate:i},...l&&{meta:{isAirGap:l}}}],S=t.pipetteEntities[n].pythonName,L=t.labwareEntities[s].pythonName,E=[`volume=${a}`,`location=${L}[${N(o)}]${Bt(p)}`,`flow_rate=${i}`],g=`${S}.aspirate(
|
|
2
|
+
${G(E.join(`,
|
|
3
3
|
`))},
|
|
4
4
|
)`;return{commands:I,python:g}},Na=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,correctionVolume:o}=e,i=[{commandType:"aspirateInPlace",key:D(),params:{pipetteId:n,volume:a,flowRate:s,...o!=null?{correctionVolume:o}:{}}}],l=[];r.tipState.pipettes[n]?.hasTip||l.push(xt({actionName:"aspirate",pipette:n}));const u=t.pipetteEntities[n].pythonName,p=[`volume=${a}`,`flow_rate=${s}`],d=`${u}.aspirate(${p.join(", ")})`;return l.length>0?{errors:l}:{commands:i,python:d}},Dn=(e,t,r)=>{const{pipetteId:n,flowRate:a}=e,s=[];if(r.tipState.pipettes[n]?.hasTip||s.push(xt({actionName:"blowout",pipette:n})),s.length>0)return{errors:s};const o=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"blowOutInPlace",key:D(),params:{pipetteId:n,flowRate:a}}],python:`${o}.flow_rate.blow_out = ${a}
|
|
5
|
-
${o}.blow_out()`}},Rc=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,flowRate:i}=e,{pipetteEntities:l,labwareEntities:u}=t,p=l[n],d="blowout",f=[],_=p?.spec,m=(_?.displayCategory==="FLEX"||_?.channels===96)??!1,h=r.pipettes[n],b=r.labware,T=qn(a,r.labware);if(h||f.push(
|
|
5
|
+
${o}.blow_out()`}},Rc=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,flowRate:i}=e,{pipetteEntities:l,labwareEntities:u}=t,p=l[n],d="blowout",f=[],_=p?.spec,m=(_?.displayCategory==="FLEX"||_?.channels===96)??!1,h=r.pipettes[n],b=r.labware,T=qn(a,r.labware);if(h||f.push(pt({pipette:n})),_==null&&f.push(pt({pipette:n})),r.tipState.pipettes[n]?.hasTip||f.push(xt({actionName:d,pipette:n,labware:a,well:s})),!a||!r.labware[a]?f.push(dt({actionName:d,labware:a})):W(r.labware[a].stack)==="offDeck"&&f.push(wn()),ve.includes(T))f.push(Vt({typeOfStep:d}));else if(b[T]!=null){const I=W(b[T].stack);ve.includes(I)&&f.push(Vt({typeOfStep:d}))}if(Vn({pipette:n,labware:a,invariantContext:t,prevRobotState:r})&&f.push(Ta()),Va(r.modules,r.labware,a)&&f.push(In()),Ua(r.modules,r.labware,a)&&f.push(Mr()),Ha(r.modules,r.labware,a)&&f.push(ps()),za(r.modules,r.labware,a)&&f.push(En()),Hn(r.modules,T,m?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&f.push(Ia()),!m&&_!=null&&(Bn(r.modules,T)&&f.push(ga()),xn(r.modules,T,_)&&f.push(Ea()),xa(r.modules,T,_,t.labwareEntities[a])&&f.push(ds())),f.length>0)return{errors:f};const y=p.pythonName,A=u[a].pythonName;return{commands:[{commandType:"blowout",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,flowRate:i,wellLocation:o}}],python:`${y}.flow_rate.blow_out = ${i}
|
|
6
6
|
${y}.blow_out(${A}[${N(s)}]${Bt(o)})`}},w_=(e,t,r)=>{const n={commandType:"captureImage",key:D(),params:{homeBefore:e.homeBefore,fileName:e.fileName,resolution:e.resolution,zoom:e.zoom,contrast:e.contrast,brightness:e.brightness,saturation:e.saturation}},a=`${be}.capture_image()`;return{commands:[n],python:a}},S_=(e,t,r)=>{const{message:n}=e,a=[{commandType:"comment",key:D(),params:{message:n}}],s=`${be}.comment(${N(n)})`;return{commands:a,python:s}},An=(e,t,r)=>{const{pipetteId:n,volume:a}=e,s=t.pipetteEntities[n];return s?{commands:[{commandType:"configureForVolume",key:D(),params:{pipetteId:n,volume:a}}],python:`${s.pythonName}.configure_for_volume(${a})`}:{commands:[]}},A_=(e,t,r)=>{const{pipetteId:n,configurationParams:a}=e,{style:s,primaryNozzle:o}=a,i=[{commandType:"configureNozzleLayout",key:D(),params:{pipetteId:n,configurationParams:a}}],l=t.pipetteEntities[n].pythonName;let u;return s===c.PARTIAL_COLUMN?u=[`protocol_api.${s}`,...o!=null?[`start=${N(c.H1_NOZZLE)}, end=${N(o)}`]:[]]:u=[`protocol_api.${s}`,...o!=null?[`start=${N(o)}`]:[]],{commands:i,python:`${l}.configure_nozzle_layout(
|
|
7
|
-
${
|
|
7
|
+
${G(u.join(`,
|
|
8
8
|
`))},
|
|
9
9
|
)`}},L_=(e,t,r)=>{const{moduleId:n}=e;if(n===null)return{errors:[Q()]};const a=t.moduleEntities[n],s=a?.type,o=a?.pythonName,i={moduleId:n};return s===c.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/deactivate",key:D(),params:i}],python:`${o}.deactivate()`}:s===c.THERMOCYCLER_MODULE_TYPE?{commands:[{commandType:"thermocycler/deactivateLid",key:D(),params:i},{commandType:"thermocycler/deactivateBlock",key:D(),params:i}],python:`${o}.deactivate_lid()
|
|
10
|
-
${o}.deactivate_block()`}:s===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:i}],python:`${o}.deactivate_heater()`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${s}`),{errors:[Q()]})},me=(e,t,r)=>{const{message:n}=e;let a,s;if("seconds"in e){a={commandType:"waitForDuration",key:D(),params:{seconds:e.seconds,message:n}};const o=[`seconds=${e.seconds}`,...n?[`msg=${N(n)}`]:[]];s=`${be}.delay(${o.join(", ")})`}else a={commandType:"waitForResume",key:D(),params:{message:n}},s=`${be}.pause(${n?N(n):""})`;return{commands:[a],python:s}},O_=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t,s="magneticModule/disengage";if(n===null)return{errors:[Q()]};if(a[n]?.type!==c.MAGNETIC_MODULE_TYPE)throw new Error(`expected module ${n} to be magdeck, got ${a[n]?.type}`);const o=a[n].pythonName;return{commands:[{commandType:s,key:D(),params:{moduleId:n}}],python:`${o}.disengage()`}},kc=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,wellLocation:u,pushOut:p,primaryNozzle:d,nozzles:f}=e,_="dispense",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=qn(s,r.labware);if(b||h.push(
|
|
11
|
-
${
|
|
10
|
+
${o}.deactivate_block()`}:s===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:i}],python:`${o}.deactivate_heater()`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${s}`),{errors:[Q()]})},me=(e,t,r)=>{const{message:n}=e;let a,s;if("seconds"in e){a={commandType:"waitForDuration",key:D(),params:{seconds:e.seconds,message:n}};const o=[`seconds=${e.seconds}`,...n?[`msg=${N(n)}`]:[]];s=`${be}.delay(${o.join(", ")})`}else a={commandType:"waitForResume",key:D(),params:{message:n}},s=`${be}.pause(${n?N(n):""})`;return{commands:[a],python:s}},O_=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t,s="magneticModule/disengage";if(n===null)return{errors:[Q()]};if(a[n]?.type!==c.MAGNETIC_MODULE_TYPE)throw new Error(`expected module ${n} to be magdeck, got ${a[n]?.type}`);const o=a[n].pythonName;return{commands:[{commandType:s,key:D(),params:{moduleId:n}}],python:`${o}.disengage()`}},kc=(e,t,r)=>{const{pipetteId:n,volume:a,labwareId:s,wellName:o,flowRate:i,isAirGap:l,wellLocation:u,pushOut:p,primaryNozzle:d,nozzles:f}=e,_="dispense",m=r.labware,h=[],b=t.pipetteEntities[n]?.spec,T=(b?.displayCategory==="FLEX"||b?.channels===96)??!1,y=qn(s,r.labware);if(b||h.push(pt({pipette:n})),Vn({pipette:n,labware:s,invariantContext:t,prevRobotState:r})&&h.push(Ta()),r.tipState.pipettes[n]?.hasTip||h.push(xt({actionName:_,pipette:n,labware:s,well:o})),!s||!r.labware[s]?h.push(dt({actionName:_,labware:s})):W(r.labware[s].stack)==="offDeck"&&h.push(wn()),ve.includes(y))h.push(Vt({typeOfStep:_}));else if(m[y]!=null){const k=W(m[y].stack);ve.includes(k)&&h.push(Vt({typeOfStep:_}))}const A=t.pipetteEntities[n]?.spec.channels!==1,w=ft({robotState:r,invariantContext:t,pipetteId:n,labwareId:s,wellLocationOffset:u?.offset??{x:0,y:0,z:0},wellTargetName:o,primaryNozzle:d,nozzleConfiguration:f});if(A&&!w.isSafe&&h.push($t({unsafePipetteMovementReason:w.reason})),Va(r.modules,r.labware,s)&&h.push(In()),Ua(r.modules,r.labware,s)&&h.push(Mr()),Ha(r.modules,r.labware,s)&&h.push(ps()),za(r.modules,r.labware,s)&&h.push(En()),Hn(r.modules,y,T?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&h.push(Ia()),T||(Bn(r.modules,y)&&h.push(ga()),xn(r.modules,y,b)&&h.push(Ea()),xa(r.modules,y,b,t.labwareEntities[s])&&h.push(ds())),h.length>0)return{errors:h};const I=[{commandType:"dispense",key:D(),params:{pipetteId:n,volume:a,labwareId:s,wellName:o,wellLocation:u,flowRate:i,...p!=null?{pushOut:p}:{}},...l&&{meta:{isAirGap:l}}}],S=t.pipetteEntities[n].pythonName,L=t.labwareEntities[s].pythonName,E=[`volume=${a}`,`location=${L}[${N(o)}]${Bt(u)}`,`flow_rate=${i}`,...p!=null?[`push_out=${p}`]:[]],g=`${S}.dispense(
|
|
11
|
+
${G(E.join(`,
|
|
12
12
|
`))},
|
|
13
|
-
)`;return{commands:I,python:g}},Xe=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,pushOut:o,correctionVolume:i,isAirGap:l}=e,u=[];r.tipState.pipettes[n]?.hasTip||u.push(xt({actionName:"dispense",pipette:n}));const p=[{commandType:"dispenseInPlace",key:D(),params:{pipetteId:n,volume:a,flowRate:s,...o!=null?{pushOut:o}:{},...i!=null?{correctionVolume:i}:{}},...l?{meta:{isAirGap:l}}:{}}],d=t.pipetteEntities[n].pythonName,f=[`volume=${a}`,`flow_rate=${s}`,...o!=null?[`push_out=${o}`]:[]],_=`${d}.dispense(${f.join(", ")})`;return u.length>0?{errors:u}:{commands:p,python:_}},Hr=(e,t,r)=>{const{pipette:n,dropTipLocation:a,wellName:s,isReturnTip:o}=e;if(!r.tipState.pipettes[n]?.hasTip)return{commands:[]};const i=r.pipettes[n].tiprackId,l=r.pipettes[n].tipWell,u=Object.values(t.labwareEntities).find(({id:_})=>_===i),p=u!=null&&l!=null;if(o&&!p)return{errors:[mp()]};let d=null;if(o&&p){const _=t.pipetteEntities[n].pythonName,h=`${u.pythonName}["${l}"]`;d=`${_}.drop_tip(location=${h})`}let f=[];if(o){if(i==null||l==null)return{errors:[mp()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:i,wellName:l}}]}else{if(a==null||s==null)return{errors:[Rn()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:a,wellName:s}}]}return{commands:f,...d!=null?{python:d}:{}}},Ss=(e,t,r)=>{const{pipetteId:n}=e;
|
|
13
|
+
)`;return{commands:I,python:g}},Xe=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,pushOut:o,correctionVolume:i,isAirGap:l}=e,u=[];r.tipState.pipettes[n]?.hasTip||u.push(xt({actionName:"dispense",pipette:n}));const p=[{commandType:"dispenseInPlace",key:D(),params:{pipetteId:n,volume:a,flowRate:s,...o!=null?{pushOut:o}:{},...i!=null?{correctionVolume:i}:{}},...l?{meta:{isAirGap:l}}:{}}],d=t.pipetteEntities[n].pythonName,f=[`volume=${a}`,`flow_rate=${s}`,...o!=null?[`push_out=${o}`]:[]],_=`${d}.dispense(${f.join(", ")})`;return u.length>0?{errors:u}:{commands:p,python:_}},Hr=(e,t,r)=>{const{pipette:n,dropTipLocation:a,wellName:s,isReturnTip:o}=e;if(!r.tipState.pipettes[n]?.hasTip)return{commands:[]};const i=r.pipettes[n].tiprackId,l=r.pipettes[n].tipWell,u=Object.values(t.labwareEntities).find(({id:_})=>_===i),p=u!=null&&l!=null;if(o&&!p)return{errors:[mp()]};let d=null;if(o&&p){const _=t.pipetteEntities[n].pythonName,h=`${u.pythonName}["${l}"]`;d=`${_}.drop_tip(location=${h})`}let f=[];if(o){if(i==null||l==null)return{errors:[mp()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:i,wellName:l}}]}else{if(a==null||s==null)return{errors:[Rn()]};f=[{commandType:"dropTip",key:D(),params:{pipetteId:n,labwareId:a,wellName:s}}]}return{commands:f,...d!=null?{python:d}:{}}},Ss=(e,t,r)=>{const{pipetteId:n}=e;if(!r.tipState.pipettes[n]?.hasTip)return{commands:[]};const{pipetteEntities:a,trashBinEntities:s,wasteChuteEntities:o}=t,i=a[n].pythonName,l=r.pipettes[n]?.entityId??"",u=s[l],p=o[l],d=u!=null?`${u.pythonName}, alternate_drop_location=True`:p?.pythonName??"";return{commands:[{commandType:"dropTipInPlace",key:D(),params:{pipetteId:n}}],python:`${i}.drop_tip(${d})`}},R_=(e,t,r)=>{const{moduleId:n,height:a}=e,{moduleEntities:s}=t,o="magneticModule/engage";if(n===null)return{errors:[Q()]};if(s[n]?.type!==c.MAGNETIC_MODULE_TYPE)throw new Error(`expected module ${n} to be magdeck, got ${s[n]?.type}`);const i=s[n].pythonName;return{commands:[{commandType:o,key:D(),params:{moduleId:n,height:a}}],python:`${i}.engage(height_from_base=${a})`}},k_=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,strategy:s,message:o,count:i}=e,l=mt(r,a);if(a==null||n[a]==null)return{errors:[Q()]};const u=[];if(l==null&&u.push(Q()),u.length>0)return{errors:u};const p=n[a].pythonName;return{commands:[{commandType:"flexStacker/empty",key:D(),params:{moduleId:a,strategy:s,message:o,count:i}}],python:`${p}.empty(${e.message?`message=${N(e.message)}`:""})`}},v_=(e,t,r)=>{const{moduleId:n,interventionMessage:a,fillLabwareIds:s}=e,{labwareEntities:o,moduleEntities:i}=t;if(n==null||i[n]==null)return{errors:[Q()]};const l=mt(r,n),u=Wc(l,t.labwareEntities),p=i[n].pythonName,d=s.filter(T=>!c.getIsLid(o[T].def)).map(T=>o[T]?.pythonName),_=Os(d,4).map(T=>Ma+T.join(", ")).join(`,
|
|
14
14
|
`),m=d.length<4?d.join(", "):`
|
|
15
15
|
${_}
|
|
16
16
|
`;if(l!=null&&l.storedLabwareDetails===null&&l.labwareInHopper==null)return{errors:[Gb()]};if(u){if(s.length>0&&!s.every(y=>Gc(y,t,l)))return{errors:[Oh()]}}else return{errors:[Rh()]};const b=[...s.filter(T=>!c.getIsLid(o[T].def)).length>0?`labware=[${m}],
|
|
17
17
|
`:[],...a!=null?[`message=${N(a)},
|
|
18
18
|
`]:[]].join("");return{commands:[{commandType:"flexStacker/fillItems",key:D(),params:{moduleId:n,labware:s,message:a??void 0}}],python:`${p}.fill_items(
|
|
19
|
-
${
|
|
19
|
+
${G(b)})`}},P_=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a}=t;if(n==null||a[n]==null)return{errors:[Q()]};const s=a[n].pythonName,o=mt(r,n),i=o?.labwareInHopper!=null&&o.labwareInHopper.length>0;return o!==null&&jc(o)?{errors:[zb()]}:i?{commands:[{commandType:"flexStacker/retrieve",key:D(),params:{moduleId:n}}],python:`${s}.retrieve()`}:{errors:[Hb()]}},C_=(e,t,r)=>{const{moduleId:n}=e,{labwareEntities:a,moduleEntities:s}=t;if(n==null||s[n]==null)return{errors:[Q()]};const o=s[n].pythonName,i=mt(r,n),l=i?.labwareOnShuttle?.primaryLabwareId??null,u=Wc(i,a);return i!==null&&!jc(i)?{errors:[jb()]}:l!==null&&!Gc(l,t,i)?{errors:[Oh()]}:u?{commands:[{commandType:"flexStacker/store",key:D(),params:{moduleId:n,strategy:"automatic"}}],python:`${o}.store()`}:{errors:[Rh()]}};function Tl(){return{type:"ASPIRATE_MORE_THAN_WELL_CONTENTS",message:"Not enough liquid"}}function gl(){return{type:"ASPIRATE_FROM_PRISTINE_WELL",message:"This step tries to aspirate from an empty well."}}function aI(){return{type:"LABWARE_IN_WASTE_CHUTE_HAS_LIQUID",message:"Disposing of a labware with liquid"}}function sI(){return{type:"TIPRACK_IN_WASTE_CHUTE_HAS_TIPS",message:"Disposing unused tips"}}function oI(){return{type:"TEMPERATURE_IS_POTENTIALLY_UNREACHABLE",message:"The module set temperature is potentially unreachable."}}function iI(){return{type:"WAITING_FOR_NONEXISTENT_TASK",message:"This step is waiting for a task that was never started."}}const lI="opentrons_flex_tiprack_lid",N_=(e,t,r)=>{const{labwareId:n,strategy:a,newLocation:s}=e,o=a==="usingGripper",{gripperEntities:i,trashBinEntities:l,wasteChuteEntities:u,labwareEntities:p,moduleEntities:d}=t,f=Object.keys(i).length>0,_=Object.values(u).length>0,m=r.tipState!=null?ey(r.tipState,n):!1,h=r.liquidState!=null?ty(r.liquidState,n):!1,b=Object.values(r.tipState.pipettes).some(({hasTip:C})=>C),T="moveToLabware",y=[],A=[],w=c.locationIsOnAddressableArea(s)&&s.addressableAreaName==="gripperWasteChute";!n||!r.labware[n]?y.push(dt({actionName:T,labware:n})):W(r.labware[n].stack)==="offDeck"&&o?y.push(wn()):r.labware[n].stack.includes(Ze)&&y.push(lT());const I=p[n]?.def.metadata.displayCategory==="aluminumBlock";o&&I&&y.push(Xb()),(w&&f&&!o||!f&&o)&&y.push(Kb()),b&&o&&y.push(Ub());const S=r.labware[n]!=null?W(r.labware[n].stack):null;(_&&S==="gripperWasteChute"||c.MOVABLE_TRASH_ADDRESSABLE_AREAS.includes(S)||S==="fixedTrash")&&y.push(wa());const L=S!=null&&r.labware[S]!=null?W(r.labware[S].stack):null,E=L??S,g=C=>C==null?null:C in r.modules?r.modules[C].moduleState:Object.values(r.modules).find(({slot:P})=>P===C)?.moduleState??null,k=Object.entries(r.labware).filter(([C,P])=>P.stack.includes("offDeck")).map(([C])=>C),v=Object.values(s);k.some(C=>v.includes(C))&&o&&y.push(Vb());const q=g(E);q!=null&&(q.type===c.THERMOCYCLER_MODULE_TYPE&&q.lidOpen!==!0?y.push(In()):q.type===c.HEATERSHAKER_MODULE_TYPE?q.latchOpen!==!0?y.push(fp()):q.targetSpeed!==null&&y.push(En()):q.type===c.ABSORBANCE_READER_TYPE&&q.lidOpen!==!0?y.push(Mr()):q.type===c.VACUUM_MODULE_TYPE&&q.currentPumpActivity.type!=="pumpDeactivated"&&y.push(hp()));const $=c.locationIsOnModule(s)&&"moduleId"in s?s.moduleId:null,ee=c.locationIsOnLabware(s)?s.labwareId:null,de=ee!=null?r.labware[ee].stack[1]:null,Te=de??$;s==="offDeck"&&o&&y.push(wn()),m&&w&&_?A.push(sI()):h&&w&&_&&A.push(aI());const se=g(Te);se!=null&&(se.type===c.THERMOCYCLER_MODULE_TYPE&&se.lidOpen!==!0?y.push(In()):se.type===c.HEATERSHAKER_MODULE_TYPE?(se.latchOpen!==!0&&y.push(fp()),se.targetSpeed!==null&&y.push(En())):se.type===c.ABSORBANCE_READER_TYPE?se.lidOpen!==!0&&y.push(Mr()):se.type===c.VACUUM_MODULE_TYPE&&se.currentPumpActivity.type!=="pumpDeactivated"&&y.push(hp())),p[n]?.def.parameters.loadName===lI&&s!=null&&c.locationIsOnDeck(s)&&("slotName"in s||"addressableAreaName"in s&&c.FLEX_STAGING_AREA_SLOT_ADDRESSABLE_AREAS.includes(s.addressableAreaName))&&y.push(nT());const Pe={labwareId:n,strategy:a,newLocation:s},He=[{commandType:"moveLabware",key:D(),params:Pe}],Ve=p[n]?.pythonName;let te="",Se=null;if(s==="offDeck")te=Ln;else if(s==="systemLocation")te="system_location";else if(s==="wasteChuteLocation")te=Ln;else if("labwareId"in s){te=p[s.labwareId].pythonName;const C=r.labware[s.labwareId].stack;Se=C[C.length-1]}else if("moduleId"in s)Se=r.modules[s.moduleId].slot,te=d[s.moduleId].pythonName;else if("slotName"in s){const{slotName:C}=s;if(C in p){const P=W(r.labware[C].stack);te=c.getIsLid(p[C].def)?N(P):p[C].pythonName;const M=r.labware[C].stack;Se=M[M.length-1]}else te=N(C),Se=C}else if("addressableAreaName"in s){const C=ve.includes(s.addressableAreaName),P=c.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(s.addressableAreaName),V=s.addressableAreaName==="fixedTrash",oe=c.MOVABLE_TRASH_ADDRESSABLE_AREAS.includes(s.addressableAreaName)||V?Object.values(l)?.map(F=>F.location):[],U=!P&&!C&&!ma(s.addressableAreaName)?G_(s.addressableAreaName,V?"fixedTrashSlot":"trashBinAdapter",V?c.OT2_ROBOT_TYPE:c.FLEX_ROBOT_TYPE):null,z=oe.find(F=>F===U),x=z!=null?Object.values(l).find(F=>F.location===z)?.id:null;if(C)te=N(s.addressableAreaName);else if(x!=null&&!P)te=l[x]?.pythonName??"";else if(x==null&&P)te=Object.values(u)[0]?.pythonName??"";else if(ma(s.addressableAreaName)){const[F]=Object.entries(r.modules).find(([,H])=>H.moduleState.type===c.VACUUM_MODULE_TYPE)??[];if(F!=null&&d[F]!=null){const{pythonName:H}=d[F];te=`${H}.manifold_dock`}}else te=""}if(Se!=null){const C=fa({slot:Se,labwareState:r.labware,modulesState:r.modules}),P=W(C),{isCompatible:V,isAboveStackLimit:M}=sy(n,C,p,d);V||y.push(Yb()),M&&y.push(sT({slot:P}))}if(y.length>0)return{errors:y};te===""&&console.error("expected to find a python new location but could not");const ze=o?", use_gripper=True":"",Ce=c.getIsLid(p[n].def),Ee=r.labware[n].stack;let X="";if(Ce){const C=ry(Ee);if(C==null)console.error("expected to find a parent for labware to move but could not");else{const P=p[C]!=null,V=P&&c.getIsLid(p[C].def);Ee.length===2||P&&V?X=N(W(Ee)):(P||!c.getIsLid(p[C].def))&&(X=p[C].pythonName)}}Ce&&X===""&&console.error("expected to find a valid lid move location but could not");const Y=Ce?`${be}.move_lid(${X}, ${te}${ze})`:`${be}.move_labware(${Ve}, ${te}${ze})`;return{commands:He,...A.length>0?{warnings:A}:{},python:Y}},Fe=(e,t,r)=>{const{pipetteId:n,fixtureId:a,offset:s}=e,{pipetteEntities:o,trashBinEntities:i,wasteChuteEntities:l}=t,u=o[n],p=u.spec.channels,d=u.pythonName,f=i[a]??l[a],_=f.pythonName;let m=W_(p);return i[a]!=null&&(m=$c(f.location)),{commands:[{commandType:"moveToAddressableArea",key:D(),params:{pipetteId:n,addressableAreaName:m,offset:s}}],python:`${d}.move_to(${_})`}},vc=(e,t,r)=>{const{pipetteId:n,addressableAreaName:a}=e;return{commands:[{commandType:"moveToAddressableAreaForDropTip",key:D(),params:{pipetteId:n,addressableAreaName:a,offset:{x:0,y:0,z:0},alternateDropLocation:!0}}]}},B=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,minimumZHeight:i,forceDirect:l,speed:u}=e,p="moveToWell",d=[],f=r.labware,{pipetteEntities:_,labwareEntities:m}=t,h=_[n]?.spec,b=r.pipettes[n]?.nozzles??c.ALL,T=r.pipettes[n]?.primaryNozzle??cs({nozzles:b,channels:h?.channels}),y=(h?.displayCategory==="FLEX"||h?.channels===96)??!1,A=qn(a,r.labware);if(h||d.push(pt({pipette:n})),!a||!r.labware[a]?d.push(dt({actionName:p,labware:a})):W(r.labware[a].stack)==="offDeck"&&d.push(wn()),ve.includes(A))d.push(Vt({typeOfStep:"move to well"}));else if(f[A]!=null){const v=W(f[A].stack);ve.includes(v)&&d.push(Vt({typeOfStep:p}))}Vn({pipette:n,labware:a,invariantContext:t,prevRobotState:r})&&d.push(Ta()),Va(r.modules,r.labware,a)&&d.push(In()),Ha(r.modules,r.labware,a)&&d.push(ps()),Ua(r.modules,r.labware,a)&&d.push(Mr()),za(r.modules,r.labware,a)&&d.push(En()),Hn(r.modules,A,y?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE)&&d.push(Ia()),y||(Bn(r.modules,A)&&d.push(ga()),xn(r.modules,A,h)&&d.push(Ea()),xa(r.modules,A,h,m[a])&&d.push(ds()));const w=t.pipetteEntities[n]?.spec.channels!==1,I=t.pipetteEntities[n]?.spec,S=ft({robotState:r,invariantContext:t,pipetteId:n,labwareId:a,wellLocationOffset:o?.offset??{x:0,y:0,z:0},wellTargetName:s,nozzleConfiguration:b,primaryNozzle:T});if(w&&I&&!S.isSafe&&d.push($t({unsafePipetteMovementReason:S.reason})),d.length>0)return{errors:d};const L=_[n].pythonName,E=m[a].pythonName,g=[{commandType:"moveToWell",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,wellLocation:o,...l!=null?{forceDirect:l}:{},...i!=null?{minimumZHeight:i}:{},...u!=null?{speed:u}:null}}],k=[`${E}[${N(s)}]${Bt(o)}`,...l?["force_direct=True"]:[],...i?[`minimum_z_height=${i}`]:[],...u?[`speed=${u}`]:[]];return{commands:g,python:`${L}.move_to(${k.join(", ")})`}},ss=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,tipTrackingOption:o=cc,nozzles:i,primaryNozzle:l}=e,u=[],p=t.pipetteEntities[n].spec.channels,d=ft({robotState:r,invariantContext:t,pipetteId:n,labwareId:a,wellLocationOffset:{x:0,y:0},wellTargetName:s,nozzleConfiguration:i,primaryNozzle:l}),f=up({tipState:r.tipState.tipracks[a],primaryNozzle:l,channels:p,nozzleConfiguration:i,wellName:s,tiprackDef:t.labwareEntities[a].def});d.isSafe||u.push($t({unsafePipetteMovementReason:d.reason})),f.isSafe||u.push(oT()),f.isComplete!==!0&&u.push(iT());const _=W(r.labware[a].stack);if(ve.includes(_))u.push(Vt({typeOfStep:"pick up tip"}));else if(r.labware[_]!=null){const T=W(r.labware[_].stack);ve.includes(T)&&u.push(Vt({typeOfStep:"pick up tip"}))}const m=t.pipetteEntities[n].pythonName,h=t.labwareEntities[a].pythonName,b=`${m}.pick_up_tip(location=${h}${o===St?`[${N(s)}]`:""})`;return u.length>0?{errors:u}:{commands:[{commandType:"pickUpTip",key:D(),params:{pipetteId:n,labwareId:a,wellName:s}}],python:b}},D_=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:s,blockMaxVolumeUl:o}=e,i=t.moduleEntities[n].pythonName,l=sb(e.profileElements),u=l.repeatingProfileSteps.map(m=>`{${N("temperature")}: ${m.celsius}, ${N("hold_time_seconds")}: ${m.holdSeconds}},`).join(`
|
|
20
20
|
`),d=`${`[
|
|
21
|
-
${
|
|
21
|
+
${G(u)}
|
|
22
22
|
],`}
|
|
23
23
|
${l.numRepetitions},
|
|
24
24
|
`+(e.blockMaxVolumeUl!==void 0?`block_max_volume=${e.blockMaxVolumeUl},`:""),_=(a!=null?`${a} = `:"")+`${i}.start_execute_profile(
|
|
25
|
-
${
|
|
26
|
-
)`;return{commands:[{commandType:"thermocycler/startRunExtendedProfile",key:D(),params:{moduleId:n,taskId:a,profileElements:s,blockMaxVolumeUl:o}}],python:_}},Lt=(e,t,r)=>{const{pipetteId:n}=e,a=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"prepareToAspirate",key:D(),params:{pipetteId:n}}],python:`${a}.prepare_to_aspirate()`}},Pc=(e,t,r)=>{const{moduleId:n,celsius:a}=e;if(n===null)return{errors:[Q()]};const s=t.moduleEntities[n],o=s?.type;return o===c.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.start_set_temperature(${a})`}:o===c.THERMOCYCLER_MODULE_TYPE?(console.error("Thermocycler set temp not implemented!"),{commands:[]}):o===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.set_target_temperature(${a})`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${o}`),{errors:[Q()]})},Et=(e,t,r)=>{const n="touchTip",{pipetteId:a,labwareId:s,wellName:o,zOffsetFromTop:i,speed:l,mmFromEdge:u}=e,p=r.pipettes[a],d=[];if(p||d.push(
|
|
25
|
+
${G(d)}
|
|
26
|
+
)`;return{commands:[{commandType:"thermocycler/startRunExtendedProfile",key:D(),params:{moduleId:n,taskId:a,profileElements:s,blockMaxVolumeUl:o}}],python:_}},Lt=(e,t,r)=>{const{pipetteId:n}=e,a=t.pipetteEntities[n].pythonName;return{commands:[{commandType:"prepareToAspirate",key:D(),params:{pipetteId:n}}],python:`${a}.prepare_to_aspirate()`}},Pc=(e,t,r)=>{const{moduleId:n,celsius:a}=e;if(n===null)return{errors:[Q()]};const s=t.moduleEntities[n],o=s?.type;return o===c.TEMPERATURE_MODULE_TYPE?{commands:[{commandType:"temperatureModule/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.start_set_temperature(${a})`}:o===c.THERMOCYCLER_MODULE_TYPE?(console.error("Thermocycler set temp not implemented!"),{commands:[]}):o===c.HEATERSHAKER_MODULE_TYPE?{commands:[{commandType:"heaterShaker/setTargetTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s?.pythonName}.set_target_temperature(${a})`}:(console.error(`setTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE}, ${c.THERMOCYCLER_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${o}`),{errors:[Q()]})},Et=(e,t,r)=>{const n="touchTip",{pipetteId:a,labwareId:s,wellName:o,zOffsetFromTop:i,speed:l,mmFromEdge:u}=e,p=r.pipettes[a],d=[];if(p||d.push(pt({pipette:a})),r.tipState.pipettes[a]?.hasTip||d.push(xt({actionName:n,pipette:a,labware:s,well:o})),d.length>0)return{errors:d};const f=t.pipetteEntities[a].pythonName,m=[`${t.labwareEntities[s].pythonName}[${N(o)}]`,`v_offset=${i}`,...l!=null?[`speed=${l}`]:[],...u!=null?[`mm_from_edge=${u}`]:[]],h=`${f}.touch_tip(${m.join(", ")})`;return{commands:[{commandType:"touchTip",key:D(),params:{pipetteId:a,labwareId:s,wellName:o,wellLocation:{origin:c.WELL_ORIGIN_TOP,offset:{z:i}},speed:l,mmFromEdge:u}}],python:h}},Da=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n],s=it(r,n);if(a==null||s==null)return{errors:[Q()]};if($n(s))return{errors:[Sa()]};const i=`${a.pythonName}.close_vent()`;return{commands:[{commandType:"vacuumModule/closeVent",key:D(),params:{moduleId:n}}],python:i}},M_=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n],s=it(r,n);if(a==null||s==null)return{errors:[Q()]};if($n(s))return{errors:[Sa()]};const i=`${a.pythonName}.open_vent()`;return{commands:[{commandType:"vacuumModule/openVent",key:D(),params:{moduleId:n}}],python:i}},be="protocol",Ln="protocol_api.OFF_DECK",As="CUSTOM_LABWARE",Ma=" ";function G(e){return e.split(`
|
|
27
27
|
`).map(t=>t&&Ma+t).join(`
|
|
28
|
-
`)}function
|
|
29
|
-
${
|
|
28
|
+
`)}function st(e){switch(typeof e){case"undefined":return"None";case"boolean":return e?"True":"False";case"number":return Number.isFinite(e)?`${e}`:`float("${e}")`;case"string":return N(e);case"object":return e===null?"None":Array.isArray(e)?Ls(e):Fr(e);default:throw Error("Cannot render value as Python",{cause:e})}}function N(e){return JSON.stringify(e)}function Cc(e){return`(${e.map(t=>st(t)).join(", ")})`}function Ls(e){return e.every(t=>Array.isArray(t)&&t.length===2&&t.every(r=>typeof r=="number"))?`[${e.map(t=>Cc(t)).join(", ")}]`:`[${e.map(t=>st(t)).join(", ")}]`}function uI(e){return["undefined","boolean","number","string"].includes(typeof e)||e===null}function Fr(e){const t=Object.entries(e),r=t.every(([n,a])=>uI(a));if(t.length<=1||r){const n=`{${t.map(([a,s])=>`${N(a)}: ${st(s)}`).join(", ")}}`;if(t.length<=1||n.length<64)return n}return`{
|
|
29
|
+
${G(t.map(([n,a])=>`${N(n)}: ${st(a)}`).join(`,
|
|
30
30
|
`))},
|
|
31
|
-
}`}function Bt(e){const{x:t,y:r,z:n}=e?.offset||{};let a=!!n,s=e?.origin;!s&&(t||r||n)&&(s="top");let o="";if(s&&(o+=(()=>{switch(s){case"top":return a=!1,`.top(${n?`z=${n}`:""})`;case"bottom":return a=!1,`.bottom(${n?`z=${n}`:""})`;case"center":return".center()";case"meniscus":return a=!1,`.meniscus(${n?`z=${n}`:""})`}})()),t||r||a){const i=[...t?[`x=${t}`]:[],...r?[`y=${r}`]:[],...a?[`z=${n}`]:[]];o+=`.move(types.Point(${i.join(", ")}))`}return o}function Os(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}const F_=(e,t)=>[`duration_s=${
|
|
32
|
-
${
|
|
31
|
+
}`}function Bt(e){const{x:t,y:r,z:n}=e?.offset||{};let a=!!n,s=e?.origin;!s&&(t||r||n)&&(s="top");let o="";if(s&&(o+=(()=>{switch(s){case"top":return a=!1,`.top(${n?`z=${n}`:""})`;case"bottom":return a=!1,`.bottom(${n?`z=${n}`:""})`;case"center":return".center()";case"meniscus":return a=!1,`.meniscus(${n?`z=${n}`:""})`}})()),t||r||a){const i=[...t?[`x=${t}`]:[],...r?[`y=${r}`]:[],...a?[`z=${n}`]:[]];o+=`.move(types.Point(${i.join(", ")}))`}return o}function Os(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}const F_=(e,t)=>[`duration_s=${st(e)}`,...typeof t=="boolean"?[`vent_after=${st(t)}`]:[]],Nc=(e,t,r)=>{const{moduleId:n,percentPower:a,duration:s,ventAfter:o}=e,i=t.moduleEntities[n],l=it(r,n);if(l==null||i==null)return{errors:[Q()]};if($n(l))return{errors:[Sa()]};const p=s!=null,d=p?`${i.pythonName}_task_${l.numPumpActivitiesStarted+1}`:null,f=p?{duration:s,ventAfter:o,taskId:d}:null,_=`percent_power=${st(a)}`,m=p?F_(s,o):[],h=[_,...m],T=`${p?`${d} = `:""}${i.pythonName}.start_set_vacuum_power(
|
|
32
|
+
${G(h.join(`,
|
|
33
33
|
`))}
|
|
34
|
-
)`;return{commands:[{commandType:"vacuumModule/startSetVacuumPower",key:D(),params:{moduleId:n,percentPower:a,...f??{}}}],python:T}},Dc=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o}=e,i=t.moduleEntities[n],l=
|
|
35
|
-
${
|
|
34
|
+
)`;return{commands:[{commandType:"vacuumModule/startSetVacuumPower",key:D(),params:{moduleId:n,percentPower:a,...f??{}}}],python:T}},Dc=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o}=e,i=t.moduleEntities[n],l=it(r,n);if(l==null||i==null)return{errors:[Q()]};if($n(l))return{errors:[Sa()]};const p=s!=null,d=p?`${i.pythonName}_task_${l.numPumpActivitiesStarted+1}`:null,f=p?{duration:s,ventAfter:o,taskId:d}:null,_=`gauge_pressure_mbar=${st(a)}`,m=p?F_(s,o):[],h=[_,...m],T=`${p?`${d} = `:""}${i.pythonName}.start_set_vacuum_pressure(
|
|
35
|
+
${G(h.join(`,
|
|
36
36
|
`))}
|
|
37
37
|
)`;return{commands:[{commandType:"vacuumModule/startSetVacuumPressure",key:D(),params:{moduleId:n,gaugePressure:a,...f??{}}}],python:T}},cI=e=>{const{steps:t,repetitions:r}=e;return Array.from({length:r}).flatMap(()=>t)},pI=e=>e.reduce((t,r)=>{if("repetitions"in r){const n=cI(r);return[...t,...n]}return[...t,r]},[]),es=e=>{const{holdSeconds:t,ventAfter:r}=e,n={enable_pump:!0,hold_time_seconds:t,...r!=null?{vent_after:r}:{}};if("gaugePressureMbar"in e){const{gaugePressureMbar:s}=e;return Fr({gauge_pressure_mbar:s,...n,vent_after:r})}const{percentPower:a}=e;return Fr({percent_power:Number(a),...n})},dI=e=>{let t,r;if(e.length===1&&"repetitions"in e[0]){const{steps:a,repetitions:s}=e[0];return t=`steps=[
|
|
38
|
-
${
|
|
38
|
+
${G(a.map((o,i)=>(i===a.length-1,es(o))).join(`,
|
|
39
39
|
`))}
|
|
40
|
-
]`,r=`repetitions=${
|
|
41
|
-
${
|
|
40
|
+
]`,r=`repetitions=${st(s)}`,[t,r]}const n=pI(e);return t=`steps=[
|
|
41
|
+
${G(n.map((a,s)=>(s===n.length-1,es(a))).join(`,
|
|
42
42
|
`))}
|
|
43
|
-
]`,r=`repetitions=${
|
|
44
|
-
${
|
|
43
|
+
]`,r=`repetitions=${st(1)}`,[t,r]},Mc=(e,t,r)=>{const{moduleId:n,profile:a,ventAfter:s}=e,o=it(r,n);if(o===null)return{errors:[Q()]};if($n(o))return{errors:[Sa()]};const l=t.moduleEntities[n].pythonName,u=`${l}_task_${o.numPumpActivitiesStarted+1}`,p=dI(a),d=`vent_after=${st(s)}`,f=a.map((m,h)=>h===a.length-1?{...m,ventAfter:s}:m),_=`${u} = ${l}.start_execute_profile(
|
|
44
|
+
${G([...p,d].join(`,
|
|
45
45
|
`))}
|
|
46
46
|
)`;return{commands:[{commandType:"vacuumModule/startRunProfile",key:D(),params:{moduleId:n,steps:f,ventAfter:s,taskId:u}}],python:_}},U_=(e,t,r)=>{const{moduleId:n}=e,a=t.moduleEntities[n];if(a==null)return{errors:[Q()]};const s=`${a.pythonName}.stop_vacuum_pump()`;return{commands:[{commandType:"vacuumModule/stopVacuum",key:D(),params:{moduleId:n}}],python:s}},Fc=(e,t,r)=>{const{moduleId:n,celsius:a}=e,s=n?Ot(r,n):null,o=[];if(n===null||!s)return{errors:[Q()]};if(s.type!==c.TEMPERATURE_MODULE_TYPE&&s.type!==c.HEATERSHAKER_MODULE_TYPE)return console.error(`expected module to be ${c.TEMPERATURE_MODULE_TYPE} but got ${s.type}`),{errors:[Q()]};const i="status"in s&&s.status===lc&&s.targetTemperature!==a,l="status"in s&&s.status===uc&&s.targetTemperature!==a;if(i||"status"in s&&s.status===Oa||"targetTemp"in s&&s.targetTemp==null)return{errors:[qb()]};l&&o.push(oI());const u=t.moduleEntities[n],p=u?.type;switch(p){case c.TEMPERATURE_MODULE_TYPE:return{commands:[{commandType:"temperatureModule/waitForTemperature",key:D(),params:{moduleId:n,celsius:a}}],warnings:o.length>0?o:void 0,python:`${u?.pythonName}.await_temperature(${a})`};case c.HEATERSHAKER_MODULE_TYPE:return{commands:[{commandType:"heaterShaker/waitForTemperature",key:D(),params:{moduleId:n,celsius:a}}],warnings:o.length>0?o:void 0,python:`${u?.pythonName}.wait_for_temperature()`};default:return console.error(`awaitTemperature expected module ${n} to be ${c.TEMPERATURE_MODULE_TYPE} or ${c.HEATERSHAKER_MODULE_TYPE}, got ${p}`),{errors:[Q()]}}},fI=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,labwareId:o,wellName:i,trackFromLocation:l,trackToLocation:u}=e,p=[{commandType:"aspirateWhileTracking",key:D(),params:{pipetteId:n,volume:a,flowRate:s,labwareId:o,wellName:i,trackFromLocation:l,trackToLocation:u}}],d=t.pipetteEntities[n].pythonName,_=`${t.labwareEntities[o].pythonName}[${N(i)}]`,m=[`volume=${a}`,`location=${_}${Bt(l)}`,`flow_rate=${s}`,`end_location=${_}${Bt(u)}`],h=`${d}.aspirate(
|
|
47
|
-
${
|
|
47
|
+
${G(m.join(`,
|
|
48
48
|
`))},
|
|
49
49
|
)`;return{commands:p,python:h}},mI=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,labwareId:o,wellName:i,trackFromLocation:l,trackToLocation:u}=e,p=[{commandType:"dispenseWhileTracking",key:D(),params:{pipetteId:n,volume:a,flowRate:s,labwareId:o,wellName:i,trackFromLocation:l,trackToLocation:u}}],d=t.pipetteEntities[n].pythonName,_=`${t.labwareEntities[o].pythonName}[${N(i)}]`,m=[`volume=${a}`,`location=${_}${Bt(l)}`,`flow_rate=${s}`,`end_location=${_}${Bt(u)}`],h=`${d}.dispense(
|
|
50
|
-
${
|
|
50
|
+
${G(m.join(`,
|
|
51
51
|
`))},
|
|
52
52
|
)`;return{commands:p,python:h}},hI=(e,t,r)=>{const{axes:n,skipIfMountPositionOk:a}=e,s={commandType:"home",key:D(),params:{axes:n,skipIfMountPositionOk:a}},o=[...n!=null?[`axes=${Ls(n)},
|
|
53
53
|
`]:[],...a!=null?[`skipIfMountPositionOk=${N(a)},
|
|
54
|
-
`]:[]],i=`${be}.home(${o.join(", ")})`;return{commands:[s],python:i}},_I=(e,t,r)=>{const{pipetteId:n,axis:a,distance:s}=e,{pipetteEntities:o}=t,i=o[n].pythonName,l=[{commandType:"moveRelative",key:D(),params:{pipetteId:n,axis:a,distance:s}}],u=[`axis=${N(a)}`,`distance=${s}`];return{commands:l,python:`${i}.move_axes_relative(${u.join(", ")})`}},yI=(e,t,r)=>{const{pipetteId:n,coordinates:a,minimumZHeight:s,forceDirect:o}=e,{pipetteEntities:i}=t,l=i[n].pythonName,u=[{commandType:"moveToCoordinates",key:D(),params:{pipetteId:n,coordinates:a,minimumZHeight:s,forceDirect:o}}],p=[`coordinates=${Cc([a.x,a.y,a.z])}`,...o?["force_direct=True"]:[],...s?[`minimum_z_height=${s}`]:[]];return{commands:u,python:`${l}.move_axes_to(${p.join(", ")})`}},bI=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o}=e,{pipetteEntities:i}=t,l=i[n].pythonName,u=t.labwareEntities[a].pythonName;return{commands:[{commandType:"tryLiquidProbe",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,wellLocation:o}}],python:`${l}.detect_liquid_presence(${u}[${N(s)}])`}},q_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/closeLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.close_labware_latch()`}},Gu=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_heater()`}},TI=["1","4","7","10"],$_=(e,t,r)=>{const{pipetteEntities:n,labwareEntities:a,moduleEntities:s}=t,o=r.modules[e.moduleId].slot,i=Object.keys(n)[0],l=n[i]?.spec;if(!((l?.displayCategory==="FLEX"||l?.channels===96)??!1)&&Uy(r.labware,a,o)){const d=TI.includes(o)?"right":"left";return{errors:[Wb(d)]}}const p=s[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/openLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${p}.open_labware_latch()`}},V_=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,rpm:s}=e;if(a===null)return{errors:[Q()]};if(n[a]?.type!==c.HEATERSHAKER_MODULE_TYPE)throw new Error(`expected module ${a} to be heaterShaker, got ${n[a]?.type}`);const o=n[a].pythonName;return{commands:[{commandType:"heaterShaker/setAndWaitForShakeSpeed",key:D(),params:{moduleId:a,rpm:s}}],python:`${o}.set_and_wait_for_shake_speed(${s})`}},Wu=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateShaker",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_shaker()`}},Uc=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a,labwareEntities:s}=t,o=[],i=a[n].pythonName,u=Object.values(r.labware).filter(f=>f.stack.includes(n)).find(f=>f.stack.find(_=>s[_]?.def.allowedRoles?.includes("lid")&&s[_]?.def.parameters.loadName!=="opentrons_tough_pcr_auto_sealing_lid")),p=u!=null?xc(u.stack):null,d=p!=null?s[p].def.metadata.displayName:null;return d!=null&&o.push(rT({lidDisplayName:d})),o.length>0?{errors:o}:{commands:[{commandType:"thermocycler/closeLid",key:D(),params:{moduleId:n}}],python:`${i}.close_lid()`}},B_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateBlock",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_block()`}},x_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_lid()`}},H_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.open_lid()`}},z_=(e,t,r)=>{e.celsius!==void 0&&console.warn("'volume' param not implemented for thermocycler/setTargetBlockTemperature, should not be set!");const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/setTargetBlockTemperature",key:D(),params:{moduleId:e.moduleId,celsius:e.celsius}}],python:`${n}.set_block_temperature(${e.celsius})`}},qc=(e,t,r)=>{const{moduleId:n,celsius:a}=e,s=t.moduleEntities[n].pythonName;return{commands:[{commandType:"thermocycler/setTargetLidTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s}.set_lid_temperature(${a})`}};function O(e,t){return(r,n)=>e(t,r,n)}function R(e,t){return(r,n)=>{const a=e(t,r,n);if("python"in a){const{python:s,...o}=a;return o}return a}}const je="__air__",zr="source_well",Mn="dest_well";function j_(e){return Kh.includes(e.parameters.loadName)}const gI=e=>(e.parameters.quirks??[]).includes("vacuumModuleDock"),G_=(e,t,r)=>{const s=c.getDeckDefFromRobotType(r).cutoutFixtures.find(l=>l.id.includes(t))?.providesAddressableAreas,i=(l=>{if(s!=null){for(const u in s)if(s[u].includes(l))return u}return null})(e);if(i==null)throw Error(`expected to find cutoutId from addressableAreaName ${e} but could not`);return i};function W_(e){switch(e){case 1:return c.ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 8:return c.EIGHT_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 96:return c.NINETY_SIX_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA}}function $c(e){const t=c.getDeckDefFromRobotType(e==="cutout12"?c.OT2_ROBOT_TYPE:c.FLEX_ROBOT_TYPE);let r=null;return t.robot.model===c.FLEX_ROBOT_TYPE&&(r=t.cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null),t.robot.model===c.FLEX_ROBOT_TYPE&&r==null&&console.error(`expected to find a list of cutouts for the Flex but could not with trashLocation ${e}`),r!=null?r[e]?.[0]:"fixedTrash"}function Y_(e){if(e==="fixedTrash")return"cutout12";const r=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE).cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null;if(r==null)return console.error("Could not find trashBinAdapter cutouts for Flex"),null;for(const[n,a]of Object.entries(r))if(a.includes(e))return n;return console.error(`Could not find trashLocation for addressableAreaName ${e}`),null}function Fn(e,t,r,n){return e[n]!=null?"labware":t[n]!=null?"wasteChute":r[n]!=null?"trashBin":(console.error(`expected to determine if dest labware is a labware or waste chute with destLabware ${n} but could not`),null)}function K_(e,t){return Sn(bn(t),r=>e)}function mr(e){return ut(e,(t,r,n)=>n===je?t:t+r.volume,0)}function er(e,t){const r=mr(t);if(r===0)return{source:t,dest:{[je]:{volume:e}}};if(e>r)return{source:rr(t,()=>({volume:0})),dest:{...t,[je]:{volume:e-r}}};const n=ut(t,(a,s,o)=>({...a,[o]:s.volume/r}),{});return Object.keys(t).reduce((a,s)=>{const o=n[s]*e;return{source:{...a.source,[s]:{volume:t[s].volume-o}},dest:{...a.dest,[s]:{volume:o}}}},{source:{},dest:{}})}function hr(e,t){return{...t,...ut(e,(r,n,a)=>{const o=a in t?n.volume+t[a].volume:n.volume;return{...r,[a]:{volume:o}}},{})}}function Vc(e,t,r){const n=e===1?[r]:c.getWellNamePerMultiTip(t,r,e);if(!n)return console.warn(e===1?`Invalid well: ${r}`:`For labware def (URI ${c.getLabwareDefURI(t)}), with primary well ${r}, no wells are accessible by 8-channel's 1st tip`),{wellsForTips:[],allWellsShared:!1};const a=n.every(s=>s&&s===n[0]);return{wellsForTips:n,allWellsShared:a}}const X_=e=>{const{pipette:t,sourceLabwareId:r,sourceWell:n,destLabwareId:a,destWell:s,blowoutLocation:o,flowRate:i,offsetFromTopMm:l,invariantContext:u}=e;if(!o)return[];const{trashBinEntities:p,wasteChuteEntities:d}=u;let f=null,_=null;return o===zr?(f=r,_=n):o===Mn&&(f=a,_=s),_!=null&&f!=null?[O(Rc,{pipetteId:t,labwareId:f,wellName:_,flowRate:i,wellLocation:{origin:"top",offset:{z:l}}})]:d[o]!=null?[O(pb,{pipetteId:t,flowRate:i,wasteChuteId:Object.keys(d)[0]})]:[O(cb,{pipetteId:t,trashId:Object.keys(p)[0],flowRate:i})]};function Z_(e){const{labwareEntities:t,pipetteEntities:r,wasteChuteEntities:n,trashBinEntities:a}=e;return{pipettes:ut(r,(s,o,i)=>{const l=o.spec;return{...s,[i]:Q_(l.channels,{})}},{}),labware:ut(t,(s,o,i)=>({...s,[i]:rr(o.def.wells,()=>({}))}),{}),trashBins:ut(a,(s,o,i)=>({...s,[i]:{}}),{}),wasteChute:ut(n,(s,o,i)=>({...s,[i]:{}}),{})}}function Q_(e,t){return bn(e).reduce((r,n)=>({...r,[n]:t}),{})}const J_=e=>{const{blowoutLocation:t,sourceLabware:r,destLabware:n,sourceWell:a,destWell:s}=e;return t===zr&&r!=null&&a!=null?{dispenseAirGapLabware:r,dispenseAirGapWell:a}:{dispenseAirGapLabware:n,dispenseAirGapWell:s}};function Bc(e){const{invariantContext:t,labwareLocations:r,moduleLocations:n={},pipetteLocations:a}=e;return{labware:r,modules:n,pipettes:a,liquidState:Z_(t),tipState:{pipettes:ut(a,(s,o,i)=>o.mount?{...s,[i]:{hasTip:!1,tiprackURI:null}}:s,{}),tipracks:ut(r,(s,o,i)=>{const l=t.labwareEntities[i].def;if(!c.getIsTiprack(l))return s;const u=rr(l.wells,()=>Ra);return{...s,[i]:u}},{})}}}const ey=(e,t)=>e.tipracks[t]!=null?Object.values(e.tipracks[t]).some(r=>r!==ue):!1,ty=(e,t)=>e.labware[t]!=null?Object.values(e.labware[t]).some(r=>Object.values(r).some(n=>n.volume>0)):!1,II=(e,t,r)=>{const{destinationId:n,pipetteId:a,volume:s,flowRate:o,offsetFromBottomMm:i,well:l,xOffset:u,yOffset:p,tipRack:d,primaryNozzle:f,nozzles:_}=e,{labwareEntities:m,trashBinEntities:h,wasteChuteEntities:b}=t,T=Fn(m,b,h,n);let y=[];return T==="labware"&&i!=null&&l!=null?y=[O(kc,{pipetteId:a,volume:s,labwareId:n,wellName:l,flowRate:o,wellLocation:{origin:"bottom",offset:{z:i,x:u,y:p}},tipRack:d,primaryNozzle:f,nozzles:_})]:T==="wasteChute"?y=[O(cA,{pipetteId:a,volume:s,flowRate:o,wasteChuteId:b[n].id})]:y=[O(uA,{pipetteId:a,volume:s,flowRate:o,trashId:h[n].id})],ae(y,t,r)},EI=(e,t,r)=>{const{destinationId:n,pipetteId:a,zOffset:s,well:o}=e,{labwareEntities:i,wasteChuteEntities:l,trashBinEntities:u}=t,p=Fn(i,l,u,n);let d=[];return p==="labware"&&o!=null?d=[O(B,{pipetteId:a,labwareId:n,wellName:o,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:s}}})]:p==="wasteChute"?d=[O(Fe,{pipetteId:a,fixtureId:l[n].id,offset:{x:0,y:0,z:0}})]:d=[O(Fe,{pipetteId:a,fixtureId:u[n].id,offset:wt})],ae(d,t,r)},wI=(e,t,r)=>{const{blowOutLocation:n,destinationId:a,destWell:s,flowRate:o,pipetteId:i,sourceId:l,sourceWell:u,volume:p}=e,{labwareEntities:d,trashBinEntities:f,wasteChuteEntities:_}=t,m=Fn(d,_,f,a);let h=[];if(m==="labware"&&s!=null){const{dispenseAirGapLabware:b,dispenseAirGapWell:T}=J_({blowoutLocation:n,sourceLabware:l,destLabware:a,sourceWell:u,destWell:s});h=[O(aA,{flowRate:o,pipetteId:i,labwareId:b,wellName:T,volume:p,type:"dispense"})]}else m==="wasteChute"?h=[O(nA,{pipetteId:i,volume:p,flowRate:o,wasteChuteId:_[a].id})]:h=[O(rA,{pipetteId:i,volume:p,flowRate:o,trashId:f[a].id})];return ae(h,t,r)},SI=(e,t,r)=>{const{pipetteId:n,destinationId:a,well:s,zOffset:o,seconds:i}=e,{labwareEntities:l,trashBinEntities:u,wasteChuteEntities:p}=t,d=Fn(l,p,u,a);let f=[];return s!=null&&d==="labware"?f=[O(B,{pipetteId:n,labwareId:a,wellName:s,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:o}}}),O(me,{seconds:i})]:d==="wasteChute"?f=[O(Fe,{pipetteId:n,fixtureId:a,offset:wt}),O(me,{seconds:i})]:f=[O(Fe,{pipetteId:n,fixtureId:a,offset:wt}),O(me,{seconds:i})],ae(f,t,r)},G=(e,t=!1)=>{if(e==null)return console.error("expected to find stack but could not"),"unknown slot";{const r=e[e.length-1];return t?`STACKER ${r.slice(-2,-1)}`:r}},AI=e=>e===c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA?Xh:e,xc=e=>e==null?(console.error("expected to find stack but could not"),"unknown top location"):e[0],ry=e=>e.length>=2?e[1]:null,fa=e=>{const{slot:t,labwareState:r,modulesState:n}=e,a=Object.values(n).find(({slot:s,moduleState:o})=>s===t&&o.type===c.FLEX_STACKER_MODULE_TYPE);if(a!=null){const s=a.moduleState.labwareOnShuttle;return s==null?[]:[s.lidLabwareId,s.primaryLabwareId,s.adapterLabwareId].filter(i=>i!=null)}return Object.values(r).reduce((s,{stack:o})=>(o[o.length-1]===t&&o.length>s.length&&(s=o),s),[])},Hc=e=>c.FLEX_SINGLE_SLOT_BY_CUTOUT_ID[c.FLEX_CUTOUT_BY_SLOT_ID[e]],ny=e=>{const t=c.FLEX_STACKER_ADDRESSABLE_AREAS.indexOf(e);return t===-1?null:ve[t]},LI=e=>{const t=ny(e);return t!=null?Hc(t):null},ay=(e,t,r)=>{if(e==null)return null;if(ve.includes(e)){const n=Hc(e);return Object.entries(t).some(([s,o])=>r[s]?.type===c.FLEX_STACKER_MODULE_TYPE&&o.slot===n)?n:e}return e},Rs=e=>{const t=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),r=`${e[0]}3`,n=c.FLEX_CUTOUT_BY_SLOT_ID[r],a=t.cutoutFixtures.find(({id:s})=>s===c.FLEX_STACKER_V1_FIXTURE)?.providesAddressableAreas[n];return c.FLEX_STACKER_ADDRESSABLE_AREAS.find(s=>a?.includes(s))??null},sy=(e,t,r,n)=>{if(t.length===0)return{isCompatible:!0,isAboveStackLimit:!1};let a=!1;const s=t.find(u=>u in n);s!=null&&(a=n[s].type===c.FLEX_STACKER_MODULE_TYPE&&t.includes(Ze));const o=xc(t);let i=!0,l=!1;if(o in r){const u=r[e],p=r[o],d=t.filter(g=>r[g]!=null),f=d.filter(g=>r[g]?.def?.allowedRoles?.includes("lid"))[0],_=d.filter(g=>r[g]?.def?.allowedRoles?.includes("adapter"))[0],m=p.def.parameters.loadName,h=d.filter(g=>!r[g]?.def?.allowedRoles?.includes("adapter")&&!r[g]?.def?.allowedRoles?.includes("lid"))[0];if(a){const g=c.getMaxPoolCount({labwareDefinitions:{primary:r[h]?.def??null,adapter:r[_]?.def??null,lid:r[f]?.def??null},model:c.FLEX_STACKER_MODULE_V1});l=t.length>g}else{const g=p.def.stackLimit??1,k=m===u.def.parameters.loadName,v=t.filter(q=>r[q]?.def.parameters.loadName===m)?.length;l=k&&v>=g}const b=u.def.parameters.loadName==="opentrons_tough_universal_lid",T=p.def.metadata.displayCategory==="tubeRack",y=p.def.metadata.displayCategory==="aluminumBlock",A=p.def.parameters.isTiprack,I=(p.def.allowedRoles??[]).includes("lid"),S=j_(p.def),L=t.some(g=>g in r&&gI(r[g].def)),E=u.def.parameters.quirks?.includes("vacuumModuleDock")??!1;i=(u.def.parameters.quirks?.includes("filterPlate")??!1)&&!I&&!A&&!(p.def.parameters.quirks?.includes("filterPlate")??!1)||!L&&E||(p.def.parameters.quirks?.includes("providesStackingDefault")??!1)&&!S||u.def.compatibleParentLabware?.some(g=>g===m)||Object.keys(u.def.stackingOffsetWithLabware??{}).some(g=>g===m)||b&&!T&&!y&&!A&&(p.def.parameters.loadName==="opentrons_tough_universal_lid"||!I)}else if(o in n){const u=n[o],{model:p}=u;i=Object.keys(r[e].def.stackingOffsetWithModule??{}).some(d=>p===d)}return{isCompatible:i,isAboveStackLimit:l}},Fa=(e,t)=>t?.find(r=>e[r]!=null)??null,OI=(e,t,r)=>t?e:r?Wh[e]:e,ks=(e,t,r)=>{if(t==="offDeck"&&r==null)return console.error("offDeck slot is not allowed to be used without an offDeckOverrideId"),[];const n=ma(t),a=oy(t),s=OI(t,n,a),o=Object.values(e).filter(i=>i.stack.includes(s)&&(r==null||i.stack.includes(r))&&i.stack.includes(Ze)===a&&i.stack.includes(pc)===n);return o.length===0?[]:a?o.at(-1)?.stack??[]:n?o.at(-1)?.stack??[]:o.toSorted((i,l)=>l.stack.length-i.stack.length)[0]?.stack??[]},RI=(e,t)=>Object.values(t).filter(r=>r.stack.includes(e)).sort((r,n)=>n.stack.length-r.stack.length)[0]?.stack[0],ua=(e,t,r,n=!0)=>{const a=c.linearInterpolate(e,t)??0,s=c.linearInterpolate(e,r)??0;return e+(n?a:0)+s},zc=e=>{const{path:t,volume:r,pipetteSpecs:n,tiprackDefinition:a,conditioningByVolume:s,disposalByVolume:o,numDispenseWells:i,numAspirateWells:l,aspirateAirGapByVolume:u}=e,{liquids:p}=n,f=r<p.default.minVolume&&"lowVolumeDefault"in p?p.lowVolumeDefault.maxVolume:p.default.maxVolume,_=a?.wells.A1.totalLiquidVolume,m=_==null?f:Math.min(f,_),h=r*2,b=s!=null?c.linearInterpolate(h,s)??0:0,y=a?.namespace!=="opentrons"||s!=null&&o!=null&&m>=h+b+(c.linearInterpolate(h,o)??0)+(b===0?c.linearInterpolate(h,u)??0:0),A=m>=h;if(t==="multiAspirate"&&l<=i?console.warn("Invalid combination of source and destination wells for multiAspirate path"):t==="multiDispense"&&l>=i?console.warn("Invalid combination of source and destination wells for multiDispense path"):t==="single"&&l!==i&&console.warn("Invalid combination of source and destination wells for single path"),t==="single"||t==="multiDispense"&&!y||t==="multiAspirate"&&!A){const L=c.linearInterpolate(r,u)??0,E=Math.ceil((r+L)/m),g=r/E;return{referenceVolumes:{airGap:{aspirate:g,dispense:0},correction:{aspirate:g,dispense:g},pushOut:g,flowRate:{aspirate:g,dispense:g}},multiWellHandling:{isSupported:!1}}}if(t==="multiDispense"){let L=0,E=0;for(let g=0;g<i&&!(ua((g+1)*r,s??[],o??[])>m);g++)L=(g+1)*r,E+=1;return{referenceVolumes:{airGap:{aspirate:ua(L,s??[],o??[],!1),dispense:ua((E-1)*r,s??[],o??[],!1)},correction:{aspirate:ua(L,s??[],o??[]),dispense:r},flowRate:{aspirate:ua(L,s??[],o??[]),dispense:r},pushOut:r,conditioning:L,disposal:L},multiWellHandling:{isSupported:!0,numWellsToFitInTip:E}}}const w=Math.floor(m/r),I=Math.min(w,l),S=I*r;return{referenceVolumes:{airGap:{aspirate:S,dispense:0},pushOut:S,correction:{aspirate:S,dispense:S},flowRate:{aspirate:r,dispense:S}},multiWellHandling:{isSupported:!0,numWellsToFitInTip:I}}},Ur=e=>{const{retractZOffset:t,retractPositionReference:r,labwareId:n,labwareEntities:a,well:s}=e;if(s==null)return!1;const o=a[n]?.def.wells[s]?.depth;if(o==null)return!1;const i=c.getMmFromBottom(t,r,o);return i==null?!1:i-o>=c.SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM},Yu=e=>e.reduce((t,r)=>{const{kind:n}=r;return n==="onCutoutFixture"?t:n==="onLabware"?[...t,r.labwareId]:n==="onModule"||n==="inStackerHopper"?[...t,r.moduleId]:n==="onAddressableArea"?[...t,r.addressableAreaName]:[...t,r.logicalLocationName]},[]),kI={A4:"cutoutA3",B4:"cutoutB3",C4:"cutoutC3",D4:"cutoutD3"};function Ku(e){if(e.location!=="offDeck"&&e.location!=="systemLocation"&&e.location!=="wasteChuteLocation"&&"addressableAreaName"in e.location&&jh.includes(e.location.addressableAreaName)){const t=D(),r=e.location.addressableAreaName,n=kI[r]??r;return{[t]:{id:t,location:n}}}return{}}const oy=e=>Gh.includes(e),ma=e=>e===c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA,jc=e=>e.labwareOnShuttle?.primaryLabwareId??null,Gc=(e,t,r)=>{if(r?.storedLabwareDetails==null)return!0;const n=Object.values(r?.storedLabwareDetails??{}).reduce((s,o)=>o!=null?[...s,o]:s,[]),a=t.labwareEntities[e];return n.some(s=>a?.labwareDefURI===s)},Wc=(e,t)=>{const{storedLabwareDetails:r}=e??{};if(r==null)return!0;const{primaryLabwareURI:n,adapterLabwareURI:a,lidLabwareURI:s}=r,o=Object.values(t).find(({labwareDefURI:f})=>f===n),i=Object.values(t).find(({labwareDefURI:f})=>f===a),l=Object.values(t).find(({labwareDefURI:f})=>f===s);if(o==null)return console.error("Primary labware entity not found"),!1;const u=c.getMaxPoolCount({labwareDefinitions:{primary:o.def,adapter:i?.def??null,lid:l?.def??null},model:c.FLEX_STACKER_MODULE_V1}),d=e?.labwareInHopper?.length??0;return u>d},iy=e=>{const{labwareId:t,labwareRobotState:r,labwareEntities:n}=e;return Object.entries(r).some(([a,{stackedOnNode:s}])=>typeof s=="object"&&"labwareId"in s&&s.labwareId===t&&c.getIsLid(n[a].def))},ly=e=>![Ln,c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA,...ve].some(t=>e===t),Ua=(e,t,r)=>{const n=t[r]?.stack,a=Fa(e,n),s=a!=null?e[a].moduleState:null;return!!(s&&s.type===c.ABSORBANCE_READER_TYPE&&s.lidOpen!==!0)};var Il,Xf;function uy(){if(Xf)return Il;Xf=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Il=e,Il}var vI=uy();const Yc=xe(vI);var cy=Symbol.for("immer-nothing"),Zf=Symbol.for("immer-draftable"),st=Symbol.for("immer-state"),PI=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ke(e,...t){if(process.env.NODE_ENV!=="production"){const r=PI[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ha=Object.getPrototypeOf;function On(e){return!!e&&!!e[st]}function qr(e){return e?py(e)||Array.isArray(e)||!!e[Zf]||!!e.constructor?.[Zf]||qa(e)||Ps(e):!1}var CI=Object.prototype.constructor.toString(),Qf=new WeakMap;function py(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Qf.get(r);return n===void 0&&(n=Function.toString.call(r),Qf.set(r,n)),n===CI}function is(e,t,r=!0){vs(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function vs(e){const t=e[st];return t?t.type_:Array.isArray(e)?1:qa(e)?2:Ps(e)?3:0}function Xu(e,t){return vs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dy(e,t,r){const n=vs(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function NI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function qa(e){return e instanceof Map}function Ps(e){return e instanceof Set}function Nr(e){return e.copy_||e.base_}function Zu(e,t){if(qa(e))return new Map(e);if(Ps(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=py(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[st];let a=Reflect.ownKeys(n);for(let s=0;s<a.length;s++){const o=a[s],i=n[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ha(e),n)}else{const n=ha(e);if(n!==null&&r)return{...e};const a=Object.create(n);return Object.assign(a,e)}}function Kc(e,t=!1){return Cs(e)||On(e)||!qr(e)||(vs(e)>1&&Object.defineProperties(e,{set:ts,add:ts,clear:ts,delete:ts}),Object.freeze(e),t&&Object.values(e).forEach(r=>Kc(r,!0))),e}function DI(){Ke(2)}var ts={value:DI};function Cs(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var MI={};function $r(e){const t=MI[e];return t||Ke(0,e),t}var _a;function fy(){return _a}function FI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jf(e,t){t&&($r("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Qu(e){Ju(e),e.drafts_.forEach(UI),e.drafts_=null}function Ju(e){e===_a&&(_a=e.parent_)}function em(e){return _a=FI(_a,e)}function UI(e){const t=e[st];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tm(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[st].modified_&&(Qu(t),Ke(4)),qr(e)&&(e=ls(t,e),t.parent_||us(t,e)),t.patches_&&$r("Patches").generateReplacementPatches_(r[st].base_,e,t.patches_,t.inversePatches_)):e=ls(t,r,[]),Qu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cy?e:void 0}function ls(e,t,r){if(Cs(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[st];if(!a)return is(t,(s,o)=>rm(e,a,t,s,o,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return us(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const s=a.copy_;let o=s,i=!1;a.type_===3&&(o=new Set(s),s.clear(),i=!0),is(o,(l,u)=>rm(e,a,s,l,u,r,i),n),us(e,s,!1),r&&e.patches_&&$r("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function rm(e,t,r,n,a,s,o){if(a==null||typeof a!="object"&&!o)return;const i=Cs(a);if(!(i&&!o)){if(process.env.NODE_ENV!=="production"&&a===r&&Ke(5),On(a)){const l=s&&t&&t.type_!==3&&!Xu(t.assigned_,n)?s.concat(n):void 0,u=ls(e,a,l);if(dy(r,n,u),On(u))e.canAutoFreeze_=!1;else return}else o&&r.add(a);if(qr(a)&&!i){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&i)return;ls(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(qa(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&us(e,a)}}}function us(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kc(t,r)}function qI(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:fy(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,s=Xc;r&&(a=[n],s=ya);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return n.draft_=i,n.revoke_=o,i}var Xc={get(e,t){if(t===st)return e;const r=Nr(e);if(!Xu(r,t))return $I(e,r,t);const n=r[t];return e.finalized_||!qr(n)?n:n===El(e.base_,t)?(wl(e),e.copy_[t]=tc(n,e)):n},has(e,t){return t in Nr(e)},ownKeys(e){return Reflect.ownKeys(Nr(e))},set(e,t,r){const n=my(Nr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=El(Nr(e),t),s=a?.[st];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(NI(r,a)&&(r!==void 0||Xu(e.base_,t)))return!0;wl(e),ec(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return El(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,wl(e),ec(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Nr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ke(11)},getPrototypeOf(e){return ha(e.base_)},setPrototypeOf(){Ke(12)}},ya={};is(Xc,(e,t)=>{ya[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ya.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Ke(13),ya.set.call(this,e,t,void 0)};ya.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Ke(14),Xc.set.call(this,e[0],t,r,e[0])};function El(e,t){const r=e[st];return(r?Nr(r):e)[t]}function $I(e,t,r){const n=my(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function my(e,t){if(!(t in e))return;let r=ha(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ha(r)}}function ec(e){e.modified_||(e.modified_=!0,e.parent_&&ec(e.parent_))}function wl(e){e.copy_||(e.copy_=Zu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const o=this;return function(l=s,...u){return o.produce(l,p=>r.call(this,p,...u))}}typeof r!="function"&&Ke(6),n!==void 0&&typeof n!="function"&&Ke(7);let a;if(qr(t)){const s=em(this),o=tc(t,void 0);let i=!0;try{a=r(o),i=!1}finally{i?Qu(s):Ju(s)}return Jf(s,n),tm(a,s)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===cy&&(a=void 0),this.autoFreeze_&&Kc(a,!0),n){const s=[],o=[];$r("Patches").generateReplacementPatches_(t,a,s,o),n(s,o)}return a}else Ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...i)=>this.produceWithPatches(o,l=>t(l,...i));let n,a;return[this.produce(t,r,(o,i)=>{n=o,a=i}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){qr(e)||Ke(8),On(e)&&(e=BI(e));const t=em(this),r=tc(e,void 0);return r[st].isManual_=!0,Ju(t),r}finishDraft(e,t){const r=e&&e[st];(!r||!r.isManual_)&&Ke(9);const{scope_:n}=r;return Jf(n,t),tm(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=$r("Patches").applyPatches_;return On(e)?n(e,t):this.produce(e,a=>n(a,t))}};function tc(e,t){const r=qa(e)?$r("MapSet").proxyMap_(e,t):Ps(e)?$r("MapSet").proxySet_(e,t):qI(e,t);return(t?t.scope_:fy()).drafts_.push(r),r}function BI(e){return On(e)||Ke(10,e),hy(e)}function hy(e){if(!qr(e)||Cs(e))return e;const t=e[st];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Zu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Zu(e,!0);return is(r,(a,s)=>{dy(r,a,hy(s))},n),t&&(t.finalized_=!1),r}var xI=new VI,_y=xI.produce;function HI(e,t){let n=0;const a=[];for(;n+1<e.length;){const s=e[n],o=e[n+1];if(t(s,o)){n+=2;continue}else a.push(s),n+=1}return n+1===e.length&&a.push(e[n]),a}const zI=(e,t)=>["pipetteId","volume","labwareId","wellName"].every(n=>e[n]===t[n]),jI=e=>HI(e,(t,r)=>t.commandType==="aspirate"&&r.commandType==="dispense"&&zI(t.params,r.params)),yy=e=>jI(e),Zc=(e,t)=>{const r=Ot(e,t);return r.type===c.ABSORBANCE_READER_TYPE?r:(console.error(`Absorbance reader state updater expected ${t} moduleState to be absorbanceReader, but it was ${r.type}`),null)},GI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Zc(n,a);s!=null&&(s.lidOpen=!0)},WI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Zc(n,a);s!=null&&(s.lidOpen=!1)},YI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,measureMode:s,sampleWavelengths:o,referenceWavelength:i}=e,l=Zc(n,a);l!=null&&(l.initialization={mode:s,wavelengths:o,referenceWavelength:i},l.lidOpen=!1)};function KI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o=s.pipettes[n].nozzles;let l=t.pipetteEntities[n].spec.channels;o===c.COLUMN?l=8:o===c.SINGLE&&(l=1),bn(l).forEach(u=>{const p=s.liquidState.pipettes[n][u]??{},d=p[je]?.volume??0;s.liquidState.pipettes[n][u]={...p,[je]:{volume:d+a}}})}var Sl,nm;function XI(){if(nm)return Sl;nm=1;var e=p_(),t=Ca(),r=fs(),n=Qe(),a=xr(),s=Ts(),o=Is(),i=Ec(),l="[object Map]",u="[object Set]",p=Object.prototype,d=p.hasOwnProperty;function f(_){if(_==null)return!0;if(a(_)&&(n(_)||typeof _=="string"||typeof _.splice=="function"||s(_)||i(_)||r(_)))return!_.length;var m=t(_);if(m==l||m==u)return!_.size;if(o(_))return!e(_).length;for(var h in _)if(d.call(_,h))return!1;return!0}return Sl=f,Sl}var ZI=XI();const Al=xe(ZI);var Ll,am;function QI(){if(am)return Ll;am=1;function e(t,r,n,a){for(var s=t.length,o=n+(a?1:-1);a?o--:++o<s;)if(r(t[o],o,t))return o;return-1}return Ll=e,Ll}var Ol,sm;function JI(){if(sm)return Ol;sm=1;function e(t){return t!==t}return Ol=e,Ol}var Rl,om;function eE(){if(om)return Rl;om=1;function e(t,r,n){for(var a=n-1,s=t.length;++a<s;)if(t[a]===r)return a;return-1}return Rl=e,Rl}var kl,im;function tE(){if(im)return kl;im=1;var e=QI(),t=JI(),r=eE();function n(a,s,o){return s===s?r(a,s,o):e(a,t,o)}return kl=n,kl}var vl,lm;function rE(){if(lm)return vl;lm=1;var e=tE();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return vl=t,vl}var Pl,um;function nE(){if(um)return Pl;um=1;function e(t,r,n){for(var a=-1,s=t==null?0:t.length;++a<s;)if(n(r,t[a]))return!0;return!1}return Pl=e,Pl}var Cl,cm;function aE(){if(cm)return Cl;cm=1;function e(){}return Cl=e,Cl}var Nl,pm;function sE(){if(pm)return Nl;pm=1;var e=f_(),t=aE(),r=yc(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(s){return new e(s)}:t;return Nl=a,Nl}var Dl,dm;function oE(){if(dm)return Dl;dm=1;var e=e_(),t=rE(),r=nE(),n=r_(),a=sE(),s=yc(),o=200;function i(l,u,p){var d=-1,f=t,_=l.length,m=!0,h=[],b=h;if(p)m=!1,f=r;else if(_>=o){var T=u?null:a(l);if(T)return s(T);m=!1,f=n,b=new e}else b=u?[]:h;e:for(;++d<_;){var y=l[d],A=u?u(y):y;if(y=p||y!==0?y:0,m&&A===A){for(var w=b.length;w--;)if(b[w]===A)continue e;u&&b.push(A),h.push(y)}else f(b,A,p)||(b!==h&&b.push(A),h.push(y))}return h}return Dl=i,Dl}var Ml,fm;function iE(){if(fm)return Ml;fm=1;var e=oE();function t(r){return r&&r.length?e(r):[]}return Ml=t,Ml}var lE=iE();const uE=xe(lE),Qc=e=>{const{nozzles:t,pipetteSpec:r,primaryNozzle:n}=e,a=r.channels;if(t==null)return a;switch(t){case c.ROW:return 12;case c.COLUMN:return 8;case c.SINGLE:return 1;case c.ALL:return a;case c.PARTIAL_COLUMN:return c.PARTIAL_NOZZLE_MAP[n];default:return a}};function cE(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s,warnings:o}=r,i="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",l="wellName"in e?e.wellName:s.pipettes[n].wellName??"",{liquidState:u}=s,p=s.pipettes[n].nozzles,d=r.robotState.pipettes[n].primaryNozzle,f=t.pipetteEntities[n].spec,_=t.labwareEntities[i].def,m=_.metadata.displayCategory==="reservoir",h=Qc({pipetteSpec:f,nozzles:p,primaryNozzle:d}),{allWellsShared:b,wellsForTips:T}=Vc(h,_,l);if(console.assert(uE(T).length===b?1:T.length,`expected all wells to be shared, or no wells to be shared. Got: ${JSON.stringify(T)}`),h>1&&b){const A=T[0],w=u.labware[i][A],I=a*h>mr(w);Al(w)?o.push(gl()):I&&o.push(Tl());const S=I?mr(w)/h:a,L=er(S,w).dest;bn(h).forEach(E=>{const g=u.pipettes[n],k=E.toString(),v=g[k],q=I?hr(v,{...L,[je]:{volume:a-S}}):hr(v,L);g[k]=q}),u.labware[i][A]=er(a*h,u.labware[i][A]).source;return}if(h===96&&m){T.forEach(A=>{const w=u.labware[i][A],I=a*8>mr(w);Al(w)?o.push(gl()):I&&o.push(Tl());const S=I?mr(w)/8:a,L=er(S,w).dest;bn(h).forEach(E=>{const g=u.pipettes[n],k=E.toString(),v=g[k],q=I?hr(v,{...L,[je]:{volume:a-S}}):hr(v,L);g[k]=q}),u.labware[i][A]=er(S*8,u.labware[i][A]).source});return}bn(h).forEach(A=>{const w=A.toString(),I=u.pipettes[n],S=I[w],L=u.labware[i][T[A]],E=er(a,L).dest;Al(L)?o.push(gl()):a>mr(L)&&o.push(Tl()),I[w]=hr(S,E)});const y=u.labware[i];T.forEach(A=>{y[A]=er(a,y[A]).source}),"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId,wellName:l})}function Ns(e){const{robotStateAndWarnings:t,invariantContext:r,entityId:n,pipetteId:a,prevLiquidState:s,useFullVolume:o,volume:i,wellName:l}=e,u=r.pipetteEntities[a].spec,p=t.robotState.pipettes[a].nozzles,d=t.robotState.pipettes[a].primaryNozzle,f=Qc({pipetteSpec:u,nozzles:p,primaryNozzle:d}),_=l??null,m=r.labwareEntities[n]!=null?r.labwareEntities[n].def:null;console.assert(!(o&&typeof i=="number"),"dispenseUpdateLiquidState takes either `volume` or `useFullVolume`, but got both"),console.assert(typeof i=="number"||o,"in dispenseUpdateLiquidState, either volume or useFullVolume are required");const{wellsForTips:h,allWellsShared:b}=m!=null&&l!=null?Vc(f,m,l):{wellsForTips:null,allWellsShared:!0},T=s.labware[n]!=null?s.labware[n]:null;let y=null;s.trashBins[n]!=null?y=s.trashBins[n]:s.wasteChute[n]!=null&&(y=s.wasteChute[n]);const A=rr(s.pipettes[a],L=>{const{...E}=L;if(o){const g=mr(E);return g>0?er(g,E):{source:{},dest:{}}}return er(i||0,E)});let w=null;if(_!=null&&T!=null)w={[_]:ut(A,(L,E)=>hr(L,E.dest),T[_])};else if(y!=null){const L=Object.values(s.pipettes[a]).reduce((E,g)=>E+(g[0]?.volume??0),0);y[0]={volume:L}}w==null&&y==null&&console.assert(!1,`expected to merge liquid to a single well with sourceId ${n}`);const I=_!=null&&T!=null&&h!=null?h.reduce((L,E,g)=>({...L,[E]:hr(A[`${g}`].dest,T[E]||{})}),{}):{},S=b?w:I;s.pipettes[a]=rr(A,"source"),s.trashBins[n]!=null&&y!=null?Object.assign(s.trashBins[n],y):s.wasteChute[n]!=null&&y!=null?Object.assign(s.wasteChute[n],y):s.labware[n]!=null&&S!=null&&(s.labware[n]=Object.assign(T??{},S))}function pE(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;Ns({pipetteId:n,entityId:a,useFullVolume:!0,wellName:s,prevLiquidState:o.liquidState,invariantContext:t,robotStateAndWarnings:r})}function dE(e,t,r){const{pipetteId:n,configurationParams:a}=e,{robotState:s}=r;s.pipettes[n].nozzles=a.style,s.pipettes[n].primaryNozzle=a.primaryNozzle}function fE(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",i="wellName"in e?e.wellName:s.pipettes[n].wellName??"",l=s.liquidState.pipettes[n],p=Object.values(l)[0]?.[je]?.volume??0,d=r.robotState.pipettes[n].primaryNozzle;if(Ns({invariantContext:t,entityId:o,pipetteId:n,prevLiquidState:s.liquidState,useFullVolume:!1,volume:a,wellName:i,robotStateAndWarnings:r}),p>0){const f=r.robotState.pipettes[n].nozzles,_=t.pipetteEntities[n].spec,m=Qc({pipetteSpec:_,nozzles:f,primaryNozzle:d});Object.keys(l).slice(0,m).forEach(b=>{const T=l[b]??{};l[b]={...T,[je]:{volume:0}}})}"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId})}function mE(e,t,r){const{pipetteId:n,wellName:a,labwareId:s}=e,{robotState:o}=r;o.tipState.pipettes[n].hasTip=!1,o.tipState.pipettes[n].tiprackURI=null,o.pipettes[n].tiprackId=void 0;const i=o.tipState,l=t.pipetteEntities[n].spec,u=o.pipettes[n].nozzles,p=lp(u,l),d=(_,m)=>_.find(h=>h.includes(m)),f=t.labwareEntities[s]?.def;f==null||!c.getIsTiprack(f)?console.warn(`forDropTip expected ${s} to have definition and to be a tiprack`):(p===c.SINGLE?i.tipracks[s][a]=Qt:p===c.COLUMN?(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt):p===c.ALL?l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Qt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt):l.channels===1?i.tipracks[s][a]=Qt:l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Qt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt),o.pipettes[n].entityId=s,o.pipettes[n].wellName=a)}function hE(e,t,r){const{labwareId:n,liquidId:a,volumeByWell:s}=e;Object.entries(s).forEach(([o,i])=>{r.robotState.liquidState.labware[n][o][a]={volume:i}})}var Fl,mm;function _E(){if(mm)return Fl;mm=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return Fl=e,Fl}var Ul,hm;function Jc(){if(hm)return Ul;hm=1;var e=Lc(),t=ms(),r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i){var l=s[o];(!(n.call(s,o)&&t(l,i))||i===void 0&&!(o in s))&&e(s,o,i)}return Ul=a,Ul}var ql,_m;function $a(){if(_m)return ql;_m=1;var e=Jc(),t=Lc();function r(n,a,s,o){var i=!s;s||(s={});for(var l=-1,u=a.length;++l<u;){var p=a[l],d=o?o(s[p],n[p],p,s,n):void 0;d===void 0&&(d=n[p]),i?t(s,p,d):e(s,p,d)}return s}return ql=r,ql}var $l,ym;function yE(){if(ym)return $l;ym=1;var e=$a(),t=Pa();function r(n,a){return n&&e(a,t(a),n)}return $l=r,$l}var Vl,bm;function bE(){if(bm)return Vl;bm=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return Vl=e,Vl}var Bl,Tm;function TE(){if(Tm)return Bl;Tm=1;var e=ar(),t=Is(),r=bE(),n=Object.prototype,a=n.hasOwnProperty;function s(o){if(!e(o))return r(o);var i=t(o),l=[];for(var u in o)u=="constructor"&&(i||!a.call(o,u))||l.push(u);return l}return Bl=s,Bl}var xl,gm;function ep(){if(gm)return xl;gm=1;var e=u_(),t=TE(),r=xr();function n(a){return r(a)?e(a,!0):t(a)}return xl=n,xl}var Hl,Im;function gE(){if(Im)return Hl;Im=1;var e=$a(),t=ep();function r(n,a){return n&&e(a,t(a),n)}return Hl=r,Hl}var da={exports:{}};da.exports;var Em;function IE(){return Em||(Em=1,(function(e,t){var r=Ht(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s?r.Buffer:void 0,i=o?o.allocUnsafe:void 0;function l(u,p){if(p)return u.slice();var d=u.length,f=i?i(d):new u.constructor(d);return u.copy(f),f}e.exports=l})(da,da.exports)),da.exports}var zl,wm;function EE(){if(wm)return zl;wm=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return zl=e,zl}var jl,Sm;function wE(){if(Sm)return jl;Sm=1;var e=$a(),t=bc();function r(n,a){return e(n,t(n),a)}return jl=r,jl}var Gl,Am;function tp(){if(Am)return Gl;Am=1;var e=c_(),t=e(Object.getPrototypeOf,Object);return Gl=t,Gl}var Wl,Lm;function by(){if(Lm)return Wl;Lm=1;var e=fc(),t=tp(),r=bc(),n=i_(),a=Object.getOwnPropertySymbols,s=a?function(o){for(var i=[];o;)e(i,r(o)),o=t(o);return i}:n;return Wl=s,Wl}var Yl,Om;function SE(){if(Om)return Yl;Om=1;var e=$a(),t=by();function r(n,a){return e(n,t(n),a)}return Yl=r,Yl}var Kl,Rm;function rp(){if(Rm)return Kl;Rm=1;var e=s_(),t=by(),r=ep();function n(a){return e(a,r,t)}return Kl=n,Kl}var Xl,km;function AE(){if(km)return Xl;km=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,s=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(s.index=n.index,s.input=n.input),s}return Xl=r,Xl}var Zl,vm;function np(){if(vm)return Zl;vm=1;var e=a_();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return Zl=t,Zl}var Ql,Pm;function LE(){if(Pm)return Ql;Pm=1;var e=np();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Ql=t,Ql}var Jl,Cm;function OE(){if(Cm)return Jl;Cm=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Jl=t,Jl}var eu,Nm;function RE(){if(Nm)return eu;Nm=1;var e=kn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return eu=n,eu}var tu,Dm;function kE(){if(Dm)return tu;Dm=1;var e=np();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return tu=t,tu}var ru,Mm;function vE(){if(Mm)return ru;Mm=1;var e=np(),t=LE(),r=OE(),n=RE(),a=kE(),s="[object Boolean]",o="[object Date]",i="[object Map]",l="[object Number]",u="[object RegExp]",p="[object Set]",d="[object String]",f="[object Symbol]",_="[object ArrayBuffer]",m="[object DataView]",h="[object Float32Array]",b="[object Float64Array]",T="[object Int8Array]",y="[object Int16Array]",A="[object Int32Array]",w="[object Uint8Array]",I="[object Uint8ClampedArray]",S="[object Uint16Array]",L="[object Uint32Array]";function E(g,k,v){var q=g.constructor;switch(k){case _:return e(g);case s:case o:return new q(+g);case m:return t(g,v);case h:case b:case T:case y:case A:case w:case I:case S:case L:return a(g,v);case i:return new q;case l:case d:return new q(g);case u:return r(g);case p:return new q;case f:return n(g)}}return ru=E,ru}var nu,Fm;function PE(){if(Fm)return nu;Fm=1;var e=ar(),t=Object.create,r=(function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var s=new n;return n.prototype=void 0,s}})();return nu=r,nu}var au,Um;function CE(){if(Um)return au;Um=1;var e=PE(),t=tp(),r=Is();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return au=n,au}var su,qm;function NE(){if(qm)return su;qm=1;var e=Ca(),t=nr(),r="[object Map]";function n(a){return t(a)&&e(a)==r}return su=n,su}var ou,$m;function DE(){if($m)return ou;$m=1;var e=NE(),t=gc(),r=Ic(),n=r&&r.isMap,a=n?t(n):e;return ou=a,ou}var iu,Vm;function ME(){if(Vm)return iu;Vm=1;var e=Ca(),t=nr(),r="[object Set]";function n(a){return t(a)&&e(a)==r}return iu=n,iu}var lu,Bm;function FE(){if(Bm)return lu;Bm=1;var e=ME(),t=gc(),r=Ic(),n=r&&r.isSet,a=n?t(n):e;return lu=a,lu}var uu,xm;function Ty(){if(xm)return uu;xm=1;var e=_c(),t=_E(),r=Jc(),n=yE(),a=gE(),s=IE(),o=EE(),i=wE(),l=SE(),u=d_(),p=rp(),d=Ca(),f=AE(),_=vE(),m=CE(),h=Qe(),b=Ts(),T=DE(),y=ar(),A=FE(),w=Pa(),I=ep(),S=1,L=2,E=4,g="[object Arguments]",k="[object Array]",v="[object Boolean]",q="[object Date]",$="[object Error]",ee="[object Function]",de="[object GeneratorFunction]",Te="[object Map]",se="[object Number]",Ie="[object Object]",Pe="[object RegExp]",He="[object Set]",Ve="[object String]",te="[object Symbol]",Se="[object WeakMap]",ze="[object ArrayBuffer]",Ce="[object DataView]",Ee="[object Float32Array]",X="[object Float64Array]",W="[object Int8Array]",C="[object Int16Array]",P="[object Int32Array]",V="[object Uint8Array]",M="[object Uint8ClampedArray]",oe="[object Uint16Array]",U="[object Uint32Array]",z={};z[g]=z[k]=z[ze]=z[Ce]=z[v]=z[q]=z[Ee]=z[X]=z[W]=z[C]=z[P]=z[Te]=z[se]=z[Ie]=z[Pe]=z[He]=z[Ve]=z[te]=z[V]=z[M]=z[oe]=z[U]=!0,z[$]=z[ee]=z[Se]=!1;function x(F,H,ce,Ue,Je,Be){var pe,et=H&S,ht=H&L,Rt=H&E;if(ce&&(pe=Je?ce(F,Ue,Je,Be):ce(F)),pe!==void 0)return pe;if(!y(F))return F;var _t=h(F);if(_t){if(pe=f(F),!et)return o(F,pe)}else{var Re=d(F),tt=Re==ee||Re==de;if(b(F))return s(F,et);if(Re==Ie||Re==g||tt&&!Je){if(pe=ht||tt?{}:m(F),!et)return ht?l(F,a(pe,F)):i(F,n(pe,F))}else{if(!z[Re])return Je?F:{};pe=_(F,Re,et)}}Be||(Be=new e);var ge=Be.get(F);if(ge)return ge;Be.set(F,pe),A(F)?F.forEach(function(re){pe.add(x(re,H,ce,re,F,Be))}):T(F)&&F.forEach(function(re,ne){pe.set(ne,x(re,H,ce,ne,F,Be))});var ke=Rt?ht?p:u:ht?I:w,Ne=_t?void 0:ke(F);return t(Ne||F,function(re,ne){Ne&&(ne=re,re=F[ne]),r(pe,ne,x(re,H,ce,ne,F,Be))}),pe}return uu=x,uu}var cu,Hm;function gy(){if(Hm)return cu;Hm=1;function e(t,r,n){var a=-1,s=t.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(s);++a<s;)o[a]=t[a+r];return o}return cu=e,cu}var pu,zm;function UE(){if(zm)return pu;zm=1;var e=Es(),t=gy();function r(n,a){return a.length<2?n:e(n,t(a,0,-1))}return pu=r,pu}var du,jm;function qE(){if(jm)return du;jm=1;var e=Pn(),t=uy(),r=UE(),n=Cn(),a=Object.prototype,s=a.hasOwnProperty;function o(i,l){l=e(l,i);var u=-1,p=l.length;if(!p)return!0;for(;++u<p;){var d=n(l[u]);if(d==="__proto__"&&!s.call(i,"__proto__")||(d==="constructor"||d==="prototype")&&u<p-1)return!1}var f=r(i,l);return f==null||delete f[n(t(l))]}return du=o,du}var fu,Gm;function $E(){if(Gm)return fu;Gm=1;var e=vn(),t=tp(),r=nr(),n="[object Object]",a=Function.prototype,s=Object.prototype,o=a.toString,i=s.hasOwnProperty,l=o.call(Object);function u(p){if(!r(p)||e(p)!=n)return!1;var d=t(p);if(d===null)return!0;var f=i.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return fu=u,fu}var mu,Wm;function VE(){if(Wm)return mu;Wm=1;var e=$E();function t(r){return e(r)?void 0:r}return mu=t,mu}var hu,Ym;function BE(){if(Ym)return hu;Ym=1;var e=Zh();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return hu=t,hu}var _u,Km;function xE(){if(Km)return _u;Km=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return _u=e,_u}var yu,Xm;function Iy(){if(Xm)return yu;Xm=1;var e=xE(),t=Math.max;function r(n,a,s){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,i=-1,l=t(o.length-a,0),u=Array(l);++i<l;)u[i]=o[a+i];i=-1;for(var p=Array(a+1);++i<a;)p[i]=o[i];return p[a]=s(u),e(n,this,p)}}return yu=r,yu}var bu,Zm;function HE(){if(Zm)return bu;Zm=1;function e(t){return function(){return t}}return bu=e,bu}var Tu,Qm;function zE(){if(Qm)return Tu;Qm=1;var e=HE(),t=b_(),r=La(),n=t?function(a,s){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:r;return Tu=n,Tu}var gu,Jm;function jE(){if(Jm)return gu;Jm=1;var e=800,t=16,r=Date.now;function n(a){var s=0,o=0;return function(){var i=r(),l=t-(i-o);if(o=i,l>0){if(++s>=e)return arguments[0]}else s=0;return a.apply(void 0,arguments)}}return gu=n,gu}var Iu,eh;function Ey(){if(eh)return Iu;eh=1;var e=zE(),t=jE(),r=t(e);return Iu=r,Iu}var Eu,th;function GE(){if(th)return Eu;th=1;var e=BE(),t=Iy(),r=Ey();function n(a){return r(t(a,void 0,e),a+"")}return Eu=n,Eu}var wu,rh;function WE(){if(rh)return wu;rh=1;var e=va(),t=Ty(),r=qE(),n=Pn(),a=$a(),s=VE(),o=GE(),i=rp(),l=1,u=2,p=4,d=o(function(f,_){var m={};if(f==null)return m;var h=!1;_=e(_,function(T){return T=n(T,f),h||(h=T.length>1),T}),a(f,i(f),m),h&&(m=t(m,l|u|p,s));for(var b=_.length;b--;)r(m,_[b]);return m});return wu=d,wu}var YE=WE();const KE=xe(YE),rc="TOUCHED_PIPETTABLE_LABWARE";var Su,nh;function XE(){if(nh)return Su;nh=1;var e=wc();function t(r,n){return e(r,n)}return Su=t,Su}var ZE=XE();const QE=xe(ZE),Ds=e=>{const{node:t,stack:r=[],robotState:n,memo:a=new Map}=e;let s=r;if(!(typeof t=="object"&&"labwareId"in t))return s=[...r,t],a.set(t,s),{stack:s,memo:a};const{labwareId:o}=t,i=n.labware[o];if(i!=null&&i.stackedOnNode!=null){const{stack:l,memo:u}=Ds({node:i.stackedOnNode,stack:[...r,t],robotState:n,memo:a});wy(a,u),s=l,a.set(t,s)}return{stack:s,memo:a}},JE=e=>{const{node:t,robotState:r,deckDef:n,deckConfiguration:a}=e,{stack:s}=Ds({node:t,robotState:r}),{cutoutFixtures:o}=n,i=s.find(l=>typeof l=="object"&&"addressableAreaName"in l);if(i!=null&&typeof i=="object"&&"addressableAreaName"in i){const{addressableAreaName:l}=i;for(const{id:u,providesAddressableAreas:p}of o){const[d]=Object.entries(p).find(([f,_])=>_.includes(l))??[];if(d!=null){const f=a.find(({cutoutId:T})=>T===d),{cutoutFixtureId:_,cutoutId:m}=f,h=_===u&&m===d,b=Object.entries(r.modules).find(([T,{slot:y}])=>c.FLEX_CUTOUT_BY_SLOT_ID[y]===m);if(h&&b!=null)return b[0]}}}return null},wy=(e,t)=>{t.forEach((r,n)=>{e.set(n,r)})},ew=(e,t)=>e.some(r=>QE(r,t)),Sy=e=>{const{labwareId:t,robotState:r}=e,n=new Map,a={labwareId:t};let s=[];for(const[o,{stackedOnNode:i}]of Object.entries(r.labware)){const l={labwareId:o};if(i==null)continue;let u;const p=n.get(l);if(p!=null)u=p;else{const{stack:d,memo:f}=Ds({node:l,robotState:r,memo:n});if(wy(n,f),!ew(d,a))continue;n.set(l,d),u=d}u.length>s.length&&(s=u)}return s},Ay=e=>{const t=[],r=new Set;for(const n of Object.keys(e.labware)){if(r.has(n))continue;const a=Sy({labwareId:n,robotState:e});a.forEach(s=>{typeof s=="object"&&"labwareId"in s&&r.add(s.labwareId)}),t.push(a)}return t},ap=e=>{const{moduleId:t,robotState:r,moduleEntities:n,deckDef:a}=e,s=r.modules[t],o=n[t];if(s==null||o==null)return null;const{slot:i}=s,{model:l}=o,u=c.getAddressableAreaNamesFromLoadedModule(l,i,a);return u.length===0?null:u[0]},tw=e=>{const{location:t,robotState:r,moduleEntities:n,deckDef:a}=e;if(t==="offDeck"||t==="systemLocation"||t==="wasteChuteLocation")return null;if("slotName"in t)return t.slotName;if("addressableAreaName"in t)return t.addressableAreaName;if("moduleId"in t){const{moduleId:s}=t;return ap({moduleId:s,robotState:r,moduleEntities:n,deckDef:a})}return null},Ly=e=>{const{deckConfiguration:t,deckDefinition:r}=e;return t.reduce((n,{cutoutFixtureId:a,cutoutId:s})=>((r.cutoutFixtures.find(({id:i})=>a===i)?.providesAddressableAreas[s]??[]).forEach(i=>{n.add(i)}),n),new Set)},rw=e=>{const{robotState:t,deckConfiguration:r,deckDefinition:n,moduleEntities:a}=e,s=Ly({deckConfiguration:r,deckDefinition:n}),o=new Set(s),i=Ay(t);for(const l of i){const u=Yc(l);if(typeof u=="object"&&"addressableAreaName"in u){const{addressableAreaName:p}=u;o.delete(p)}if(typeof u=="object"&&"slotName"in u){const{slotName:p}=u;o.delete(p)}if(typeof u=="object"&&"moduleId"in u){const{moduleId:p}=u,d=ap({moduleId:p,robotState:t,moduleEntities:a,deckDef:n});d!=null&&o.delete(d)}}return o},nw=e=>{const t=e.toLowerCase();return t.includes("chute")||t.includes("waste")||t.startsWith("gripper")||t==="96channelwastechute"},Oy=e=>{const{stack:t,subjectLabwareId:r,moduleEntities:n,labwareEntityIds:a,modules:s}=e;if(t.length===0||t[0]!==r||t.length<2)return;const o=t[1];if(o===Ze){const u=t[2];return u==null?void 0:{kind:"inStackerHopper",moduleId:u}}if(n[o]!=null)return{moduleId:o};if(a.has(o))return{labwareId:o};if(o==="offDeck")return"offDeck";if(o==="systemLocation")return"systemLocation";if(o==="wasteChuteLocation")return"wasteChuteLocation";if(nw(o))return{addressableAreaName:o};const i=ay(o,s,n)??o;if(Object.entries(s).some(([u,p])=>n[u]?.type===c.FLEX_STACKER_MODULE_TYPE&&p.slot===i)){const u=Rs(i);if(u!=null)return{addressableAreaName:u}}return{slotName:o}},aw=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="inStackerHopper",sw=e=>typeof e!="object"||e===null?!1:!aw(e),ow=(e,t)=>{const{id:r,def:n}=e,{id:a,def:s}=t,o=n.dimensions.xDimension,i=n.dimensions.yDimension,l=s.dimensions.xDimension,u=s.dimensions.yDimension;return o>l&&i>u?{containerLabwareId:r,containedLabwareId:a}:l>o&&u>i?{containerLabwareId:a,containedLabwareId:r}:null},sp=(e,t)=>{const r=new Map;for(const a of Object.keys(e)){const s=e[a].stackedOnNode;if(s==null||!sw(s))continue;const o=JSON.stringify(s),i=r.get(o)??[];i.push(a),r.set(o,i)}const n={};for(const a of r.values()){if(a.length!==2)continue;const[s,o]=a,i=t[s],l=t[o];if(i==null||l==null)continue;const u=ow(i,l);if(u==null)continue;const{containerLabwareId:p,containedLabwareId:d}=u;n[p]=d}return Object.keys(n).length===0?e:rr(e,(a,s)=>n[s]!=null?{...a,contains:n[s]}:a)},iw=(e,t,r)=>{const n=Object.keys(e.labware),a=new Set(n);let s=rr(e.labware,(o,i)=>{const l=o.stackedOnNode??Oy({stack:o.stack,subjectLabwareId:i,moduleEntities:t,labwareEntityIds:a,modules:e.modules});return l!=null?{...o,stackedOnNode:l}:{...o}});return s=sp(s,r),{...e,labware:s}};function lw(e,t,r){const{labwareId:n,newLocation:a}=e,{robotState:s}=r,{labwareEntities:o}=t,{modules:i,labware:l}=s;if(l[n]==null)return;const u=G(l[n].stack),p=ks(l,u,n),d=p.indexOf(n),f=p.slice(0,d+1),_=c.getIsLid(o[n].def);let m=!1;const h=Object.entries(i).find(([E,{slot:g}])=>{const{type:k}=t.moduleEntities[E]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&g===u})??null,b=h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE?Jt.map(E=>h[1].moduleState.labwareOnShuttle?.[E]).filter(E=>E!=null):[],T=b.includes(n)?b.slice(0,b.indexOf(n)+1):[];if(h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const E=h[1].moduleState,g=Jt.findIndex(k=>E.labwareOnShuttle?.[k]===n);if(g!==-1&&E.labwareOnShuttle!=null)for(const k of Jt.slice(g,Jt.length))if(k==="primaryLabwareId"){E.labwareOnShuttle=null;break}else E.labwareOnShuttle[k]=null}const y=Object.entries(i).find(([E,{slot:g}])=>{const{type:k}=t.moduleEntities[E]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&typeof a=="object"&&("moduleId"in a&&a.moduleId===E||"slotName"in a&&g===a.slotName)})??null,[A,w]=y??[];if(A!=null&&w!=null){const E=T.length>0?T:fa({slot:u,labwareState:l,modulesState:i}),g=E.indexOf(n),k=w.moduleState;if(g!==-1){const v=E.slice(0,g+1).toReversed();if(k.labwareOnShuttle==null&&(k.labwareOnShuttle={primaryLabwareId:"",adapterLabwareId:null,lidLabwareId:null}),v.length===3)for(let q=0;q<Jt.length;q++){const $=Jt[q];k.labwareOnShuttle[$]=v[q]}else if(v.length===2){const q=v.some($=>t.labwareEntities[$].def.allowedRoles?.some(ee=>ee==="lid"))?["primaryLabwareId","lidLabwareId"]:["adapterLabwareId","primaryLabwareId"];for(let $=0;$<q.length;$++){const ee=q[$];k.labwareOnShuttle[ee]=v[$]}}else v.length===1&&(k.labwareOnShuttle.primaryLabwareId=v[0])}}const I=[];if(c.locationIsOffDeck(a))I.push(a);else if("moduleId"in a)if(i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE)I.push(i[a.moduleId].slot);else if(t.moduleEntities[a.moduleId]?.type===c.VACUUM_MODULE_TYPE){const E=i[a.moduleId].slot,g=fa({slot:E,labwareState:l,modulesState:i});g.length>0?I.push(...g):I.push(a.moduleId,E)}else I.push(a.moduleId,i[a.moduleId].slot);else if("slotName"in a){const{slotName:E}=a;E in l?(m=c.getIsPipettableLabware(o[E].def),I.push(...l[E].stack)):I.push(E)}else if("labwareId"in a){const E=a.labwareId;m=c.getIsPipettableLabware(o[E].def);const g=l[E].stack;I.push(...g)}else if("addressableAreaName"in a)if(ma(a.addressableAreaName)){const E=Object.entries(i).find(([g])=>t.moduleEntities[g]?.type===c.VACUUM_MODULE_TYPE)?.[0];I.push(pc),E!=null&&I.push(E),I.push(a.addressableAreaName)}else I.push(a.addressableAreaName);f.forEach((E,g)=>{if(l[E]!=null){const k=f.slice(g+1);s.labware[E]={...s.labware[E],stack:[E,...k,...I],..._&&m?{sterility:rc}:{}}}});const S=typeof a=="object"&&"labwareId"in a&&c.getIsPipettableLabware(o[a.labwareId].def);let L=a;if(typeof a=="object"&&a!==null&&"moduleId"in a&&i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const E=Rs(i[a.moduleId].slot);E!=null&&(L={addressableAreaName:E})}else if(typeof a=="object"&&a!==null&&"moduleId"in a&&t.moduleEntities[a.moduleId]?.type===c.VACUUM_MODULE_TYPE){const E=i[a.moduleId].slot,g=fa({slot:E,labwareState:l,modulesState:i}),k=g.length>0?g[0]:null;k!=null&&k in o&&(L={labwareId:k})}s.labware[n].stackedOnNode=L,S&&(s.labware[n].sterility=rc),s.labware=sp(rr(s.labware,E=>KE(E,"contains")),o)}function uw(e,t,r){const{pipetteId:n,addressableAreaName:a}=e,{wasteChuteEntities:s,trashBinEntities:o}=t,i=c.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(a),l=Object.values(o).find(d=>d.location===Y_(a))?.id,u=i?Object.values(s)[0].id:l,{robotState:p}=r;p.pipettes[n]={...p.pipettes[n],entityId:u}}function cw(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;o.pipettes[n]={...o.pipettes[n],entityId:a,wellName:s}}function pw(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,o=t.pipetteEntities[n].spec,i=t.labwareEntities[a].def;if(!c.getIsTiprack(i))throw new Error(`forPickUpTip expected ${a} to be a tiprack`);const l=r.robotState.tipState,u=r.robotState.pipettes[n].nozzles,p=r.robotState.pipettes[n].primaryNozzle,d=lp(u,o),f=(h,b)=>h.find(T=>T.includes(b)),_=(h,b)=>{const T=h.findIndex(A=>A.includes(b));if(T===-1)return null;const y=h[T].indexOf(b);return h.map(A=>A[y])},m=(h,b)=>{const T=c.PARTIAL_NOZZLE_MAP[p],y=h.findIndex(L=>L.includes(b)),A=h[y].indexOf(b),w=h[y];if(w.length-A<T){const L=w.length-T;return w.slice(L,w.length)}const S=A+T;return w.slice(A,Math.min(S,w.length))};if(l.pipettes[n].hasTip=!0,l.pipettes[n].tiprackURI=a,d===c.SINGLE)l.tipracks[a][s]=ue;else if(d===c.PARTIAL_COLUMN&&p){const h=m(i.ordering,s);h==null?console.error(`Invalid primary well for tip pick up for partial config: ${s}`):h.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.COLUMN){const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.ROW){const h=_(i.ordering,s);h==null&&console.error("Invalid primary well for tip pickup: "+s),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.ALL)if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=ue});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(o.channels===1)l.tipracks[a][s]=ue;else if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=ue});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}r.robotState.pipettes[n].tiprackId=a,r.robotState.pipettes[n].tipWell=s}const dw={clean:Ra,empty:ue,used:Qt};function fw(e,t,r){const{labwareId:n,wellNames:a,tipWellState:s="clean"}=e,o=dw[s],i=r.robotState.tipState.tipracks[n];i!=null&&a.forEach(l=>{i[l]=o})}const jr=(e,t)=>{const r=Ot(e,t);return r.type===c.THERMOCYCLER_MODULE_TYPE?r:(console.error(`Thermocycler state updater expected ${t} moduleState to be thermocycler, but it was ${r.type}`),{})},mw=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.currentBlockActivity={type:"blockTargetTemp",blockTargetTemp:a}},hw=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.lidTargetTemp=a},_w=(e,t,r)=>{},yw=(e,t,r)=>{},bw=(e,t,r)=>{},Tw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.currentBlockActivity={type:"blockDeactivated"}},gw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidTargetTemp=null},Iw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!1},Ew=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!0},ww=(e,t,r)=>{const{profile:n,...a}=e;Ry({profileElements:n,...a},t,r)},Ry=(e,t,r)=>{const n=NaN+D();ky({...e,taskId:n},t,r),vy(n,r,c.THERMOCYCLER_MODULE_TYPE)},ky=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:s}=e,{robotState:o}=r,i=jr(o,n);i.currentBlockActivity={type:"profile",profileElements:s,taskId:a??null},i.numProfilesStarted++},Sw=e=>{if(e.currentBlockActivity.type==="profile"){const t=Aw(e.currentBlockActivity.profileElements);return e.currentBlockActivity=t!=null?{type:"blockTargetTemp",blockTargetTemp:t}:{type:"blockDeactivated"},!0}else return!1};function Aw(e){const t=Yc(pp(e));return t!=null?t.celsius:null}const Lw=(e,t)=>{const[r,n]=[e.ordering,t.ordering];if(r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const[s,o]=[r[a],n[a]];if(s.length!==o.length)return!1}return!0},op=(e,t,r)=>{const{labware:n,liquidState:a}=t,o=ks(n,e).filter(i=>i in r&&c.getIsPipettableLabware(r[i].def));if(o.length===1){const i=a.labware[o[0]];Object.entries(i).forEach(([l,u])=>{i[l]={}});return}if(o.length===2){const i=o[0],l=o[1];if(!Lw(r[i].def,r[l].def))return;const u=a.labware[i],p=a.labware[l];Object.entries(p).forEach(([d,f])=>{const _=u[d];Object.entries(_).forEach(([m,{volume:h}])=>{f[m]={volume:m in f?f[m].volume+h:h}}),u[d]={}})}},Ow=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=ot(a,n);s!=null&&(s.ventStatus=dc)},Rw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=ot(a,n);s!=null&&(s.ventStatus=ka)},kw=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,{labwareEntities:u}=t,p=ot(l,n);p!=null&&(op(n,l,u),s==null||i==null?p.currentPumpActivity={type:"indefiniteHold",mode:ju,targetPressure:a}:(p.currentPumpActivity={type:"timedHold",mode:ju,targetPressure:a,durationSeconds:s,taskId:i,ventAfter:o},p.numPumpActivitiesStarted++),p.ventStatus=ka)},vw=(e,t,r)=>{const{moduleId:n,percentPower:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,{labwareEntities:u}=t,p=ot(l,n);p!=null&&(op(n,l,u),s==null||i==null?p.currentPumpActivity={type:"indefiniteHold",mode:zu,targetPower:a}:(p.currentPumpActivity={type:"timedHold",mode:zu,targetPower:a,durationSeconds:s,taskId:i,ventAfter:o},p.numPumpActivitiesStarted++),p.ventStatus=ka)},Pw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=ot(a,n);s!=null&&(s.currentPumpActivity={type:"pumpDeactivated"})},Cw=(e,t,r)=>{const{moduleId:n,steps:a,taskId:s,ventAfter:o=!0}=e,{robotState:i}=r,{labwareEntities:l}=t,u=ot(i,n);u==null||s==null||(op(n,i,l),u.currentPumpActivity={type:"profile",profileElements:a,taskId:s,ventAfter:o},u.numPumpActivitiesStarted++)},Nw=e=>{if(e.currentPumpActivity.type==="timedHold"||e.currentPumpActivity.type==="profile"){const t=e.currentPumpActivity.ventAfter;return e.currentPumpActivity={type:"pumpDeactivated"},e.ventStatus=t?dc:ka,!0}return!1};function Dw(e,t,r){for(const n of e.task_ids)vy(n,r)||r.warnings.push(iI())}const vy=(e,t,r)=>{const{robotState:n}=t,a=Object.values(n.modules).find(s=>{if(r&&s.moduleState.type!==r)return!1;const o=s.moduleState.type==="thermocyclerModuleType"&&s.moduleState.currentBlockActivity.type==="profile"&&s.moduleState.currentBlockActivity.taskId===e,i=s.moduleState.type==="vacuumModuleType"&&(s.moduleState.currentPumpActivity.type==="timedHold"||s.moduleState.currentPumpActivity.type==="profile")&&s.moduleState.currentPumpActivity.taskId===e;return o||i});return a==null?!1:a.moduleState.type==="thermocyclerModuleType"?Sw(a.moduleState):a.moduleState.type==="vacuumModuleType"?Nw(a.moduleState):(console.log(`unexpected module type with task: ${a.moduleState.type}`),!1)},Un=(e,t)=>{const r=Ot(e,t);return r.type===c.HEATERSHAKER_MODULE_TYPE?r:(console.error(`Heater-Shaker state updater expected ${t} moduleState to be heaterShaker, but it was ${r.type}`),{})},Mw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Un(n,a);o.targetTemp=s},Fw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.targetTemp=null},Uw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,rpm:s}=e,o=Un(n,a);o.targetSpeed=s},qw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.targetSpeed=null},$w=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.latchOpen=!0},Vw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.latchOpen=!1},Bw=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";Ns({invariantContext:t,pipetteId:n,prevLiquidState:a.liquidState,useFullVolume:!0,robotStateAndWarnings:r,entityId:s})},xw=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";a.tipState.pipettes[n]={hasTip:!1,tiprackURI:null},Ns({invariantContext:t,prevLiquidState:a.liquidState,pipetteId:n,useFullVolume:!0,robotStateAndWarnings:r,entityId:s}),a.pipettes[n].tiprackId=void 0};function Py(e,t){e.type===c.MAGNETIC_MODULE_TYPE&&(e.engaged=t)}function Hw(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=Ot(a,n);Py(s,!0)}function zw(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=Ot(a,n);Py(s,!1)}const Au=(e,t)=>{if(t==null)return console.error("expected to find defURI but could not in getLabwareByDefURI"),null;const r=e.findIndex(a=>a.labwareDefURI===t);if(r===-1)return null;const[n]=e.splice(r,1);return n.id},Cy=(e,t,r,n)=>{const a=e.labwareInHopper??[];t.forEach(s=>{const{primaryLabwareId:o,adapterLabwareId:i,lidLabwareId:l}=s;r.labware[o]={stack:[o,...l!=null?[l]:[],...n]},i!=null&&(r.labware[i]={stack:[i,o,...l!=null?[l]:[],...n]}),l!=null&&(r.labware[l]={stack:[l,...n]}),a.push({primaryLabwareId:o,adapterLabwareId:i??null,lidLabwareId:l??null})}),e.labwareInHopper=a},Ny=(e,t,r,n,a,s,o,i)=>{const u=Object.entries(e.labware).filter(([d,f])=>f[s]===t[s]).map(([d])=>d).map(d=>r[d]),p=[];for(let d=0;d<n;d++){const f=Au(u,t.storedLabwareDetails?.primaryLabwareURI),_=o!=null?Au(u,t.storedLabwareDetails?.adapterLabwareURI):null,m=i!=null?Au(u,t.storedLabwareDetails?.lidLabwareURI):null;f!=null&&(e.labware[f]={stack:[f,...m!=null?[m]:[],...a]},_!=null&&(e.labware[_]={stack:[_,f,...m!=null?[m]:[],...a]}),m!=null&&(e.labware[m]={stack:[m,...a]}),p.push({primaryLabwareId:f,adapterLabwareId:_,lidLabwareId:m})),t.labwareInHopper=p}},jw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Object.entries(n.labware).filter(([,i])=>i.stack.includes(Ze)&&i.stack.includes(a)),o=mt(n,a);o!=null&&o.labwareInHopper!=null&&(e.count!=null?o.labwareInHopper=o.labwareInHopper.slice(0,e.count):o.labwareInHopper=[]),s.forEach(([i])=>{n.labware[i]={...n.labware[i],stack:[i,c.SYSTEM_LOCATION]}})},Gw=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,labware:o}=e,i=n.modules[s].slot,l=mt(n,s);if(l==null||l.storedLabwareDetails==null)return;const{primaryLabwareURI:u,adapterLabwareURI:p,lidLabwareURI:d}=l.storedLabwareDetails,f=[];for(const b of o){const T=a[b].labwareDefURI;if(T===u)f.push({primaryLabwareId:b,adapterLabwareId:null,lidLabwareId:null});else if(T===p){const y=f[f.length-1];y&&(y.adapterLabwareId=b)}else if(T===d){const y=f[f.length-1];y&&(y.lidLabwareId=b)}}const _=[Ze,s,i];for(const b of f){const T=[b.adapterLabwareId,b.primaryLabwareId,b.lidLabwareId,..._].filter(A=>A!=null);n.labware[b.primaryLabwareId]={...n.labware[b.primaryLabwareId],stack:T.slice(T.indexOf(b.primaryLabwareId))},b.adapterLabwareId!=null&&(n.labware[b.adapterLabwareId]={...n.labware[b.adapterLabwareId],stack:T.slice(T.indexOf(b.adapterLabwareId))}),b.lidLabwareId!=null&&(n.labware[b.lidLabwareId]={...n.labware[b.lidLabwareId],stack:T.slice(T.indexOf(b.lidLabwareId))});let y=null;for(const A of T)a[A]!=null&&(y==null?n.labware[A].stackedOnNode={kind:"inStackerHopper",moduleId:s}:n.labware[A].stackedOnNode={labwareId:y},y=A)}const m=l.labwareInHopper??[],h=f.map(({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y})=>({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y}));l.labwareInHopper=[...m,...h]},Ww=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,primaryLabware:o,initialCount:i,adapterLabware:l,lidLabware:u,initialStoredLabware:p}=e,d=n.modules[s].slot,f=mt(n,s),_=[Ze,s,d];f!=null&&(f.storedLabwareDetails={primaryLabwareURI:`${o.namespace}/${o.loadName}/${o.version}`,adapterLabwareURI:l!=null?`${l.namespace}/${l.loadName}/${l.version}`:null,lidLabwareURI:u!=null?`${u.namespace}/${u.loadName}/${u.version}`:null},i!=null?Ny(n,f,a,i,_,"setStoredLabwareCount",l?.loadName,u?.loadName):p!=null&&Cy(f,p,n,_),f.setStoredLabwareCount=(f?.setStoredLabwareCount??0)+1)},Yw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,labware:s}=e,{labwareEntities:o}=t,i=n.modules[a].slot,l=mt(n,a);if(l==null)return;const u=s.map(I=>I.split(":")[1]),p=new Set(u),d=Array.from(p),f=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&!S.def.allowedRoles?.includes("lid")&&!S.def.allowedRoles?.includes("adapter"))),_=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&S.def.allowedRoles?.includes("adapter"))),m=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&S.def.allowedRoles?.includes("lid")));if(f==null)throw new Error(`expected to find primaryLabwareURI for storedLabwareDetails but could not with labware ${s}`);l.storedLabwareDetails={primaryLabwareURI:f,adapterLabwareURI:_??null,lidLabwareURI:m??null};const h=[];for(const I of s){const S=o[I].labwareDefURI;if(S===f)h.push({primary:I,adapter:null,lid:null});else if(S===_){const L=h[h.length-1];L&&(L.adapter=I)}else if(S===m){const L=h[h.length-1];L&&(L.lid=I)}}const b=[Ze,a,i];for(const I of h){const S=[I.adapter,I.primary,I.lid,...b].filter(L=>L!=null);n.labware[I.primary]={...n.labware[I.primary],stack:S.slice(S.indexOf(I.primary))},I.adapter!=null&&(n.labware[I.adapter]={...n.labware[I.adapter],stack:S.slice(S.indexOf(I.adapter))}),I.lid!=null&&(n.labware[I.lid]={...n.labware[I.lid],stack:S.slice(S.indexOf(I.lid))})}const T=l.labwareInHopper??[],y=h.map(I=>({primaryLabwareId:I.primary,adapterLabwareId:I.adapter,lidLabwareId:I.lid})),A=new Map(T.map(I=>[I.primaryLabwareId,I])),w=[];for(const I of y)w.push(I),A.delete(I.primaryLabwareId);for(const I of T)A.has(I.primaryLabwareId)&&w.push(I);l.labwareInHopper=w},Kw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,count:s,labwareToStore:o}=e,{labwareEntities:i}=t,l=n.modules[a].slot,u=mt(n,a),p=[Ze,a,l];if(u!=null){const d=u.storedLabwareDetails?.adapterLabwareURI,f=u.storedLabwareDetails?.lidLabwareURI;s!=null?Ny(n,u,i,s,p,"fillCount",d,f):o!=null&&Cy(u,o,n,p),u.fillCount=(u?.fillCount??0)+1}},Xw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=mt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareInHopper:i,labwareOnShuttle:l}=s;if(i!=null&&i.length>0&&l==null){const u=i[0];s.labwareOnShuttle=u,i.shift();const p=[o];let d=null;for(const f of Jt){const _=u[f];if(_!=null){if(p.unshift(_),n.labware[_].stack=[...p],d==null){const m=Rs(o);m!=null?n.labware[_].stackedOnNode={addressableAreaName:m}:console.warn(`Could not find an addressable area for retrieved labware in stacker module ${a} at slot ${o}`)}else n.labware[_].stackedOnNode={labwareId:d};d=_}}}}},Zw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=mt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareOnShuttle:i}=s;if(i!=null){s.labwareInHopper=[i,...s.labwareInHopper??[]],s.labwareOnShuttle=null;let l=null;for(const u of Jt){const p=i[u];p!=null&&(n.labware[p].stack=[p,Ze,a,o],l==null?(n.labware[p].stackedOnNode={kind:"inStackerHopper",moduleId:a},l=p):n.labware[p].stackedOnNode={labwareId:l})}s.storedLabwareDetails==null&&(s.storedLabwareDetails={primaryLabwareURI:t.labwareEntities[i.primaryLabwareId].labwareDefURI,adapterLabwareURI:i.adapterLabwareId!=null?t.labwareEntities[i.adapterLabwareId].labwareDefURI:null,lidLabwareURI:i.lidLabwareId!=null?t.labwareEntities[i.lidLabwareId].labwareDefURI:null})}}};function Dy(e,t,r){e.type===c.TEMPERATURE_MODULE_TYPE&&(e.targetTemperature=t,e.status=r)}function Qw(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Ot(n,a);Dy(o,s,uc)}function Jw(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Ot(n,a);o.type===c.TEMPERATURE_MODULE_TYPE&&s===o.targetTemperature&&(o.status=lc)}function eS(e,t,r){const{robotState:n}=r,{moduleId:a}=e,s=Ot(n,a);Dy(s,null,Oa)}function My(e,t,r){if(!e)throw new Error("undefined command passed to getNextRobotStateAndWarning");switch(e.commandType){case"aspirateWhileTracking":case"aspirate":case"aspirateInPlace":if(e.meta?.isAirGap===!0)break;cE(e.params,t,r);break;case"airGapInPlace":KI(e.params,t,r);break;case"dispenseWhileTracking":case"dispense":case"dispenseInPlace":if(e.meta?.isAirGap===!0)break;fE(e.params,t,r);break;case"blowout":pE(e.params,t,r);break;case"dropTip":mE(e.params,t,r);break;case"pickUpTip":pw(e.params,t,r);break;case"setTipState":fw(e.params,t,r);break;case"magneticModule/engage":Hw(e.params,t,r);break;case"magneticModule/disengage":zw(e.params,t,r);break;case"moveLabware":lw(e.params,t,r);break;case"waitForTasks":Dw(e.params,t,r);break;case"flexStacker/setStoredLabware":Ww(e.params,t,r);break;case"flexStacker/setStoredLabwareItems":Yw(e.params,t,r);break;case"flexStacker/prepareShuttle":case"flexStacker/closeLatch":case"flexStacker/openLatch":break;case"flexStacker/empty":jw(e.params,t,r);break;case"flexStacker/fill":Kw(e.params,t,r);break;case"flexStacker/fillItems":Gw(e.params,t,r);break;case"flexStacker/retrieve":Xw(e.params,t,r);break;case"flexStacker/store":Zw(e.params,t,r);break;case"setRailLights":case"touchTip":case"configureForVolume":case"loadPipette":case"loadLabware":case"loadModule":case"home":case"moveRelative":case"moveToSlot":case"moveToCoordinates":case"savePosition":case"waitForResume":case"waitForDuration":case"pause":case"delay":case"custom":case"comment":case"captureImage":case"prepareToAspirate":case"liquidProbe":case"loadLiquidClass":case"loadLidStack":case"loadLid":case"getTipPresence":case"identifyModule":case"getNextTip":case"retractAxis":case"sealPipetteToTip":case"tryLiquidProbe":case"unsealPipetteFromTip":case"verifyTipPresence":case"pressureDispense":case"createTimer":break;case"moveToAddressableArea":case"moveToAddressableAreaForDropTip":uw(e.params,t,r);break;case"moveToWell":cw(e.params,t,r);break;case"loadLiquid":hE(e.params,t,r);break;case"dropTipInPlace":xw(e.params,t,r);break;case"blowOutInPlace":Bw(e.params,t,r);break;case"configureNozzleLayout":dE(e.params,t,r);break;case"temperatureModule/setTargetTemperature":Qw(e.params,t,r);break;case"temperatureModule/deactivate":eS(e.params,t,r);break;case"temperatureModule/waitForTemperature":Jw(e.params,t,r);break;case"thermocycler/setTargetBlockTemperature":mw(e.params,t,r);break;case"thermocycler/setTargetLidTemperature":hw(e.params,t,r);break;case"thermocycler/waitForBlockTemperature":_w(e.params);break;case"thermocycler/waitForLidTemperature":yw(e.params);break;case"thermocycler/deactivateBlock":Tw(e.params,t,r);break;case"thermocycler/deactivateLid":gw(e.params,t,r);break;case"thermocycler/closeLid":Iw(e.params,t,r);break;case"thermocycler/openLid":Ew(e.params,t,r);break;case"thermocycler/runProfile":ww(e.params,t,r);break;case"thermocycler/runExtendedProfile":Ry(e.params,t,r);break;case"thermocycler/startRunExtendedProfile":ky(e.params,t,r);break;case"thermocycler/awaitProfileComplete":bw(e.params);break;case"heaterShaker/deactivateHeater":Fw(e.params,t,r);break;case"heaterShaker/setTargetTemperature":Mw(e.params,t,r);break;case"heaterShaker/setAndWaitForShakeSpeed":case"heaterShaker/setShakeSpeed":Uw(e.params,t,r);break;case"heaterShaker/deactivateShaker":qw(e.params,t,r);break;case"heaterShaker/openLabwareLatch":$w(e.params,t,r);break;case"heaterShaker/closeLabwareLatch":Vw(e.params,t,r);break;case"heaterShaker/waitForTemperature":break;case"absorbanceReader/openLid":GI(e.params,t,r);break;case"absorbanceReader/closeLid":WI(e.params,t,r);break;case"absorbanceReader/initialize":YI(e.params,t,r);break;case"absorbanceReader/read":break;case"vacuumModule/startSetVacuumPressure":kw(e.params,t,r);break;case"vacuumModule/startSetVacuumPower":vw(e.params,t,r);break;case"vacuumModule/openVent":Ow(e.params,t,r);break;case"vacuumModule/closeVent":Rw(e.params,t,r);break;case"vacuumModule/stopVacuum":Pw(e.params,t,r);break;case"vacuumModule/startRunProfile":Cw(e.params,t,r);break;default:console.error(`unknown command: ${e.commandType} passed to getNextRobotStateAndWarning`)}}function Fy(e,t,r){return _y({warnings:[],robotState:r},a=>{My(e,t,a)})}function ip(e,t,r){const n=yy(e);return _y({warnings:[],robotState:r},s=>{n.forEach(o=>{My(o,t,s)})})}const tS=(e,t,r)=>{const n=e.reduce((a,s,o)=>{const i=a.timeline.length===0?r:Yc(a.timeline).robotState;if(a.errors!=null)return a;const l=s(t,i);if("errors"in l)return{timeline:a.timeline,errors:l.errors};const p=yy(l.commands).reduce((f,_)=>Fy(_,t,f.robotState),{robotState:i,warnings:[]}),d={commands:l.commands,robotState:p.robotState,warnings:l.warnings,stepInfo:{stepNumber:l.stepNumber,name:l.name,description:l.description},python:l.python};return{timeline:[...a.timeline,d],errors:null}},{timeline:[],errors:null});return{timeline:n.timeline,errors:n.errors}},qn=(e,t)=>{const r=t[e]?.stack;return r!=null?G(r):""},$n=e=>{if(e.type===c.VACUUM_MODULE_TYPE){const t=e;return t.currentPumpActivity.type==="timedHold"||t.currentPumpActivity.type==="profile"}if(e.type===c.THERMOCYCLER_MODULE_TYPE){const t=e;return t.currentBlockActivity.type==="profile"||t.currentBlockActivity.type==="blockTargetTemp"}return!1},Vn=e=>{const{pipette:t,labware:r,invariantContext:n,prevRobotState:a}=e;if(n.config.OT_PD_DISABLE_MODULE_RESTRICTIONS)return!1;const s=t?n.pipetteEntities[t]:null,o=r?G(a.labware[r]?.stack):null;if(!t||!r||!s||!o)return!1;const i=Object.keys(n.moduleEntities).some(l=>{const u=n.moduleEntities[l].model;if(Dh.includes(u)){const p=a.modules[l]?.slot;return p==="1"&&o==="4"||p==="3"&&o==="6"}else return!1});return c.GEN_ONE_MULTI_PIPETTES.includes(s.name)&&i},ae=(e,t,r)=>{const n=e.reduce((a,s)=>{if(a.errors.length>0)return a;const o=s(t,a.robotState);if("errors"in o)return{robotState:a.robotState,commands:a.commands,errors:o.errors,warnings:a.warnings};const i=[...a.commands,...o.commands],l=[...a.python?[a.python]:[],...o.python?[o.python]:[]].join(`
|
|
55
|
-
`),u=ip(o.commands,t,a.robotState);return{...a,robotState:u.robotState,commands:i,warnings:[...a.warnings||[],...o.warnings||[],...u.warnings],...l&&{python:l}}},{robotState:r,commands:[],errors:[],warnings:[]});return n.errors.length>0?{errors:n.errors}:{commands:n.commands,warnings:n.warnings,...n.python&&{python:n.python}}},Va=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n&&e[n].moduleState;return!!(a&&a.type===c.THERMOCYCLER_MODULE_TYPE&&a.lidOpen!==!0)},rS=e=>e.commandCreatorFnName!=="delay"&&e.commandCreatorFnName!=="engageMagnet"&&e.commandCreatorFnName!=="disengageMagnet"&&e.commandCreatorFnName!=="setTemperature"&&e.commandCreatorFnName!=="deactivateTemperature"&&"pipette"in e?e.pipette:null,nS=e=>e.commandCreatorFnName==="delay"||e.commandCreatorFnName==="engageMagnet"||e.commandCreatorFnName==="disengageMagnet"||e.commandCreatorFnName==="setTemperature"||e.commandCreatorFnName==="deactivateTemperature",aS=new Date("2025-03-19T00:00:00Z"),sS=2,oS=22;function iS(e,t,r){const{labware:n,modules:a,pipettes:s,commands:o,liquids:i}=e,l=t.protocolType==="python"?t.apiVersion:null,u=l!=null&&l[0]>=sS&&l[1]>=oS,p=t.protocolType==="json"&&r>=aS,d=c.getLabwareDefinitionsByURIForProtocol(o),f=i.reduce((y,A)=>{const{id:w,description:I,displayName:S,displayColor:L}=A;return{...y,[w]:{description:I,displayName:S??"Unknown Liquid",pythonName:"n/a",displayColor:L??"#B7B8B9",liquidGroupId:w}}},{}),_=a.reduce((y,A)=>{const{id:w,model:I}=A;return{...y,[w]:{id:w,type:c.getModuleType(I),model:I,pythonName:"n/a"}}},{}),m=n.reduce((y,A)=>{const{id:w,definitionUri:I}=A,S=d[I];return S==null||S.schemaVersion===3?y:{...y,[w]:{id:w,labwareDefURI:I,def:S,pythonName:"n/a"}}},{}),h=o.reduce((y,A)=>{if(A.commandType==="loadLidStack"&&A.result!=null){const{stackLabwareId:w,lidStackDefinition:I}=A.result;if(w!=null&&I!=null&&y[w]==null&&I.schemaVersion!==3)return{...y,[w]:{id:w,labwareDefURI:c.getLabwareDefURI(I),def:I,pythonName:"n/a"}}}return y},m),b=s.reduce((y,A)=>{const{id:w,pipetteName:I}=A,S=c.getPipetteSpecsV2(I),E=o.filter(v=>v.commandType==="pickUpTip"&&v.params.pipetteId===w).map(v=>h[v.params.labwareId]),g=Array.from(new Set(E.map(v=>v.labwareDefURI))),k=Array.from(new Set(E.map(v=>v.def)));return S==null||(y[w]={name:I,id:w,tiprackLabwareDef:k,tiprackDefURI:g,spec:S,pythonName:"n/a"}),y},{}),T=o.reduce((y,A)=>{if(A.commandType==="loadLidStack"&&A.result!=null){const{params:w}=A,I=Ku(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...I}}}else if((A.commandType==="loadLabware"||A.commandType==="loadLid")&&A.result!=null){const{params:w}=A,I=Ku(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...I}}}else if(A.commandType==="moveToAddressableArea"||A.commandType==="moveToAddressableAreaForDropTip"){const w=A.params.addressableAreaName,I=`${D()}:${w}`;let S=zh;w==="fixedTrash"?S="cutout12":w.includes("WasteChute")?S="cutoutD3":w.includes("movableTrash")&&(S=`cutout${w.split("movableTrash")[1]}`);let L=y.trashBinEntities;Object.values(y.trashBinEntities).some(g=>g.location===S)||(w.includes("movableTrash")?L={...y.trashBinEntities,[I]:{pythonName:"trash_bin_1",id:I,location:S}}:w==="fixedTrash"&&(L={...y.trashBinEntities,[I]:{pythonName:"trash_bin_1",id:I,location:S}}));let E=y.wasteChuteEntities;return w.includes("WasteChute")&&(E={[I]:{pythonName:"waste_chute",id:I,location:S}}),{...y,trashBinEntities:L,wasteChuteEntities:E}}return y},{wasteChuteEntities:{},trashBinEntities:{},stagingAreaEntities:{},runtimeParameters:{},gripperEntities:{},config:{OT_PD_DISABLE_MODULE_RESTRICTIONS:!0}});return{labwareEntities:h,pipetteEntities:b,moduleEntities:_,liquidEntities:u||p?f:{},...T}}const lS={A3:"A4",B3:"B4",C3:"C4",D3:"D4"};function uS(e,t){const r=e.reduce((o,i)=>i.commandType==="loadPipette"&&i.result!=null?{...o,[i.result.pipetteId]:{mount:i.params.mount}}:o,{}),n=e.reduce((o,i)=>{if(i.commandType==="loadModule"&&i.result!=null){const l=c.getModuleDef(i.params.model).moduleType;return{...o,[i.result.moduleId]:{slot:l===c.FLEX_STACKER_MODULE_TYPE?lS[i.params.location.slotName]:i.params.location.slotName,moduleState:Hh[l]}}}return o},{}),a=e.reduce((o,i)=>{if(i.commandType==="loadLidStack"&&i.result!=null){const{result:l}=i,u=l.locationSequences,p=l.labwareIds,d=l.stackLabwareId,f=l.stackLocationSequence,_=m=>{if(c.locationIsOffDeck(m))return[m];if("slotName"in m)return[m.slotName];if("moduleId"in m){const h=n[m.moduleId]?.slot??"offDeck";return[m.moduleId,h]}else if("addressableAreaName"in m)return[m.addressableAreaName];return["offDeck"]};if(u!=null){const m=u.reduce((T,y)=>{const A=y.find(w=>w.kind==="onLabware");return A!=null&&(T[A.labwareId]=y),T},{}),h=p.reduce((T,y,A)=>{const w=m[y]??u[A];if(w!=null){const I=Yu(w);T[y]={stack:I[0]===y?I:[y,...I]}}else{const I=i.params.location;c.locationIsOffDeck(I)?T[y]={stack:[y,I]}:"slotName"in I?T[y]={stack:[y,I.slotName]}:T[y]={stack:[y,"offDeck"]}}return T},{}),b=d!=null&&f!=null?[d,...Yu(f)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}else{const m=i.params.location,h=p.reduce((T,y)=>{if(c.locationIsOffDeck(m))T[y]={stack:[y,m]};else if("slotName"in m)T[y]={stack:[y,m.slotName]};else if("moduleId"in m){const A=m.moduleId;T[y]={stack:[y,A,n[A].slot]}}else T[y]={stack:[y,"offDeck"]};return T},{}),b=d!=null?[d,..._(m)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}}else if((i.commandType==="loadLabware"||i.commandType==="loadLid")&&i.result!=null){const l=[i.result.labwareId];if(c.locationIsOffDeck(i.params.location))l.push(i.params.location);else if("slotName"in i.params.location)l.push(i.params.location.slotName);else if("moduleId"in i.params.location){const u=i.params.location.moduleId;if(n[u]==null)return console.warn(`Module ${u} not found when processing loadLabware/loadLid command. `),o;l.push(i.params.location.moduleId,n[i.params.location.moduleId].slot)}else if("labwareId"in i.params.location){const u=i.params.location.labwareId;o[u]==null&&(console.warn(`Parent labware ${u} not found when processing loadLabware/loadLid command. `),o[u]={stack:[u,"offDeck"]});const p=o[u].stack;l.push(u,...p)}else l.push(i.params.location.addressableAreaName);return{...o,[i.result.labwareId]:{stack:l}}}else{if(i.commandType==="flexStacker/setStoredLabware")return sh(i).forEach(u=>{ah(o,u,"setStoredLabwareCount")}),o;if(i.commandType==="flexStacker/fill")return sh(i).forEach(u=>{ah(o,u,"fillCount")}),o}return o},{}),s=Bc({invariantContext:t,labwareLocations:a,moduleLocations:n,pipetteLocations:r});return{frame:{...ip(e,t,s),command:e[e.length-1]},invariantContext:t}}const ah=(e,t,r)=>{const n=e[t]??{stack:[t,"offDeck"]};e[t]={...n,[r]:(n[r]??0)+1}},sh=e=>e.result?.storedLabware?.flatMap(r=>[r.primaryLabwareId,r.adapterLabwareId,r.lidLabwareId].filter(n=>n!=null))??[],lp=(e,t)=>e??(t.channels===1?c.SINGLE:t.channels===96?c.ALL:c.COLUMN);var Lu,oh;function cS(){if(oh)return Lu;oh=1;var e=Ac();function t(r,n){var a;return e(r,function(s,o,i){return a=n(s,o,i),!a}),!!a}return Lu=t,Lu}var Ou,ih;function pS(){if(ih)return Ou;ih=1;var e=t_(),t=Nn(),r=cS(),n=Qe(),a=Oc();function s(o,i,l){var u=n(o)?e:r;return l&&a(o,i,l)&&(i=void 0),u(o,t(i,3))}return Ou=s,Ou}var dS=pS();const Ba=xe(dS),Bn=(e,t)=>Ba(e,r=>r.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&r.moduleState.latchOpen!==!1&&c.getAreSlotsHorizontallyAdjacent(r.slot,t)),xn=(e,t,r)=>r.channels!==1&&Ba(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsHorizontallyAdjacent(n.slot,t)),xa=(e,t,r,n)=>r.channels!==1&&!n.def.parameters.isTiprack&&Ba(e,a=>a.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsVerticallyAdjacent(a.slot,t)),Uy=(e,t,r)=>Ba(e,(a,s)=>c.getAreSlotsHorizontallyAdjacent(r,G(a.stack))&&c.getIsLabwareAboveHeight(t[s].def,c.MAX_LABWARE_HEIGHT_EAST_WEST_HEATER_SHAKER_MM)),Ha=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.latchOpen!==!1)},Hn=(e,t,r)=>Ba(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&n.moduleState.targetSpeed!=null&&n.moduleState.targetSpeed>0&&(r===c.OT2_ROBOT_TYPE?c.getAreSlotsAdjacent(n.slot,t):c.getAreFlexSlotsAdjacent(n.slot,t))),za=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.targetSpeed!==null)},Ms=e=>{const{args:t,pipetteName:r,tiprackUri:n,liquidClassValuesForTip:a}=e;let s=null;"mixBeforeAspirate"in t?s=t.mixBeforeAspirate:"mixFirstAspirate"in t&&(s=t.mixFirstAspirate);const o=fS(t),i={dispense_position:{offset:{x:t.dispenseXOffset,y:t.dispenseYOffset,z:t.dispenseZOffset},position_reference:t.dispensePositionReference},flow_rate_by_volume:[[0,t.dispenseFlowRateUlSec??0]],delay:{enabled:!!t.dispenseDelay?.seconds,...t.dispenseDelay?.seconds?{duration:t.dispenseDelay?.seconds}:{}},submerge:{delay:{enabled:!!t.dispenseSubmergeDelay?.seconds,...t.dispenseSubmergeDelay?.seconds?{duration:t.dispenseSubmergeDelay?.seconds}:{}},speed:t.dispenseSubmergeSpeed??void 0,start_position:{offset:{x:t.dispenseSubmergeXOffset,y:t.dispenseSubmergeYOffset,z:t.dispenseSubmergeZOffset},position_reference:t.dispenseSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.dispenseAirGapVolume??0]],delay:{enabled:!!t.dispenseRetractDelay?.seconds,...t.dispenseRetractDelay?.seconds?{duration:t.dispenseRetractDelay?.seconds}:{}},end_position:{offset:{x:t.dispenseRetractXOffset,y:t.dispenseRetractYOffset,z:t.dispenseRetractZOffset},position_reference:t.dispenseRetractPositionReference},speed:t.dispenseRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterDispense,z_offset:t.touchTipAfterDispense?t.touchTipAfterDispenseOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterDispense&&t.touchTipAfterDispenseMmFromEdge!=null?t.touchTipAfterDispenseMmFromEdge:void 0,speed:t.touchTipAfterDispense?t.touchTipAfterDispenseSpeed:void 0},blowout:{enabled:t.blowoutLocation!=null,location:qy(t.blowoutLocation),flow_rate:t.blowoutLocation!=null?t.blowoutFlowRateUlSec:void 0,...o!=null?{blowout_position:o}:{}}}},l={[r]:{[n]:{aspirate:{aspirate_position:{offset:{x:t.aspirateXOffset,y:t.aspirateYOffset,z:t.aspirateZOffset},position_reference:t.aspiratePositionReference},flow_rate_by_volume:[[0,t.aspirateFlowRateUlSec]],pre_wet:t.preWetTip,correction_by_volume:a?.aspirate.correctionByVolume??[[0,0]],delay:{enabled:!!t.aspirateDelay?.seconds,...t.aspirateDelay?.seconds?{duration:t.aspirateDelay?.seconds}:{}},mix:{enabled:!!s?.volume,...s?.times?{repetitions:s.times}:{},...s?.volume?{volume:s.volume}:{}},submerge:{delay:{enabled:!!t.aspirateSubmergeDelay?.seconds,...t.aspirateSubmergeDelay?.seconds?{duration:t.aspirateSubmergeDelay?.seconds}:{}},speed:t.aspirateSubmergeSpeed??void 0,start_position:{offset:{x:t.aspirateSubmergeXOffset,y:t.aspirateSubmergeYOffset,z:t.aspirateSubmergeZOffset},position_reference:t.aspirateSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.aspirateAirGapVolume??0]],delay:{enabled:!!t.aspirateRetractDelay?.seconds,...t.aspirateRetractDelay?.seconds?{duration:t.aspirateRetractDelay?.seconds}:{}},end_position:{offset:{x:t.aspirateRetractXOffset,y:t.aspirateRetractYOffset,z:t.aspirateRetractZOffset},position_reference:t.aspirateRetractPositionReference},speed:t.aspirateRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterAspirate,z_offset:t.touchTipAfterAspirate?t.touchTipAfterAspirateOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterAspirate&&t.touchTipAfterAspirateMmFromEdge!=null?t.touchTipAfterAspirateMmFromEdge:void 0,speed:t.touchTipAfterAspirate?t.touchTipAfterAspirateSpeed:void 0}}},dispense:{...i,correction_by_volume:a?.singleDispense.correctionByVolume??[[0,0]],push_out_by_volume:[[0,t.pushOut??0]],mix:{enabled:"mixInDestination"in t?t.mixInDestination!=null:!1,repetitions:"mixInDestination"in t?t.mixInDestination?.times??void 0:void 0,volume:"mixInDestination"in t?t.mixInDestination?.volume??void 0:void 0}},...t.commandCreatorFnName==="distribute"?{multi_dispense:{...i,correction_by_volume:a?.multiDispense?.correctionByVolume??[[0,0]],..."conditioningVolume"in t?{conditioning_by_volume:[[0,t.conditioningVolume??0]]}:{},..."disposalVolume"in t?{disposal_by_volume:[[0,t.disposalVolume??0]]}:{}}}:{}}}},u=JSON.parse(JSON.stringify(l));return Fr(u)},ja=(e,t)=>`${c.getAllLiquidClassDefs()[e].liquidClassName}${t?"_base_class":""}`,qy=e=>{if(e!=null)return e===zr?"source":e===Mn?"destination":"trash"},fS=e=>{const t=qy(e.blowoutLocation);return!t||t==="trash"?null:{offset:{x:e.blowoutXPosition??0,y:e.blowoutYPosition??0,z:e.blowoutOffsetFromTopMm??1},position_reference:e.blowoutPositionReference??c.POSITION_REFERENCE_TOP}},Fs=e=>{const{labwareEntities:t,tiprackIds:r}=e;return`tip_racks=[${r.map(a=>t[a].pythonName).join(", ")}]`};var Ru,lh;function mS(){if(lh)return Ru;lh=1;var e="Expected a function";function t(r){if(typeof r!="function")throw new TypeError(e);return function(){var n=arguments;switch(n.length){case 0:return!r.call(this);case 1:return!r.call(this,n[0]);case 2:return!r.call(this,n[0],n[1]);case 3:return!r.call(this,n[0],n[1],n[2])}return!r.apply(this,n)}}return Ru=t,Ru}var ku,uh;function hS(){if(uh)return ku;uh=1;var e=Jc(),t=Pn(),r=gs(),n=ar(),a=Cn();function s(o,i,l,u){if(!n(o))return o;i=t(i,o);for(var p=-1,d=i.length,f=d-1,_=o;_!=null&&++p<d;){var m=a(i[p]),h=l;if(m==="__proto__"||m==="constructor"||m==="prototype")return o;if(p!=f){var b=_[m];h=u?u(b,m,_):void 0,h===void 0&&(h=n(b)?b:r(i[p+1])?[]:{})}e(_,m,h),_=_[m]}return o}return ku=s,ku}var vu,ch;function _S(){if(ch)return vu;ch=1;var e=Es(),t=hS(),r=Pn();function n(a,s,o){for(var i=-1,l=s.length,u={};++i<l;){var p=s[i],d=e(a,p);o(d,p)&&t(u,r(p,a),d)}return u}return vu=n,vu}var Pu,ph;function yS(){if(ph)return Pu;ph=1;var e=va(),t=Nn(),r=_S(),n=rp();function a(s,o){if(s==null)return{};var i=e(n(s),function(l){return[l]});return o=t(o),r(s,i,function(l,u){return o(l,u[0])})}return Pu=a,Pu}var Cu,dh;function bS(){if(dh)return Cu;dh=1;var e=Nn(),t=mS(),r=yS();function n(a,s){return r(a,t(e(s)))}return Cu=n,Cu}var TS=bS();const gS=xe(TS);function $y(e){return Object.keys(e.wells)}const IS=(e,t)=>{const r=Object.keys(e||{}).filter(n=>e[n]&&e[n].volume>0);return{wellName:t,groupIds:r,ingreds:gS(e,n=>!n||n.volume<=0)}},ES=(e,t)=>{const r=$y(t);return ut(r,(n,a)=>{const s=e&&e[a];return{...n,[a]:s?IS(e[a],a):{}}},{})},wS=(e,t)=>{const r={};return t.forEach(n=>{const a=e!=null?Object.values(e).reduce((s,o)=>{if(o.groupIds.indexOf(n)!==-1){const l=o.ingreds[n];l?.volume!=null&&(s[o.wellName??"A1"]=l.volume)}return s},{}):{};r[n]=a}),r},SS=e=>{const t=e.flatMap(r=>r==null?[]:Object.values(r).flatMap(n=>n.groupIds.filter(a=>a!==je)));return Array.from(new Set(t))},AS=e=>{const t=e!=null?Object.values(e).flatMap(r=>r.groupIds)?.filter(r=>r!==je):[];return Array.from(new Set(t))},Vy="#737578",By=e=>{const t=Number(e);return Number.isInteger(t)?c.DEFAULT_LIQUID_COLORS[t%c.DEFAULT_LIQUID_COLORS.length]:(e!==je&&console.warn(`swatchColors expected an integer or ${je}, got ${e}`),"transparent")},LS=(e,t)=>{const r=e.filter(n=>n!==je);return r.length===0?null:r.length===1?t[r[0]]??By(r[0]):Vy},OS=(e,t)=>ut(e,(r,n,a)=>{const s=LS(n.groupIds,t);return s?{...r,[a]:s}:r},{});var Nu,fh;function RS(){if(fh)return Nu;fh=1;function e(t,r){return t>r}return Nu=e,Nu}var Du,mh;function kS(){if(mh)return Du;mh=1;var e=Nh(),t=RS(),r=La();function n(a){return a&&a.length?e(a,r,t):void 0}return Du=n,Du}var vS=kS();const PS=xe(vS),xy="2.31",CS="9.0.1";function NS(){return["import json","from opentrons import protocol_api, types"].join(`
|
|
56
|
-
`)}function
|
|
54
|
+
`]:[]],i=`${be}.home(${o.join(", ")})`;return{commands:[s],python:i}},_I=(e,t,r)=>{const{pipetteId:n,axis:a,distance:s}=e,{pipetteEntities:o}=t,i=o[n].pythonName,l=[{commandType:"moveRelative",key:D(),params:{pipetteId:n,axis:a,distance:s}}],u=[`axis=${N(a)}`,`distance=${s}`];return{commands:l,python:`${i}.move_axes_relative(${u.join(", ")})`}},yI=(e,t,r)=>{const{pipetteId:n,coordinates:a,minimumZHeight:s,forceDirect:o}=e,{pipetteEntities:i}=t,l=i[n].pythonName,u=[{commandType:"moveToCoordinates",key:D(),params:{pipetteId:n,coordinates:a,minimumZHeight:s,forceDirect:o}}],p=[`coordinates=${Cc([a.x,a.y,a.z])}`,...o?["force_direct=True"]:[],...s?[`minimum_z_height=${s}`]:[]];return{commands:u,python:`${l}.move_axes_to(${p.join(", ")})`}},bI=(e,t,r)=>{const{pipetteId:n,labwareId:a,wellName:s,wellLocation:o}=e,{pipetteEntities:i}=t,l=i[n].pythonName,u=t.labwareEntities[a].pythonName;return{commands:[{commandType:"tryLiquidProbe",key:D(),params:{pipetteId:n,labwareId:a,wellName:s,wellLocation:o}}],python:`${l}.detect_liquid_presence(${u}[${N(s)}])`}},q_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/closeLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.close_labware_latch()`}},Gu=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateHeater",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_heater()`}},TI=["1","4","7","10"],$_=(e,t,r)=>{const{pipetteEntities:n,labwareEntities:a,moduleEntities:s}=t,o=r.modules[e.moduleId].slot,i=Object.keys(n)[0],l=n[i]?.spec;if(!((l?.displayCategory==="FLEX"||l?.channels===96)??!1)&&Uy(r.labware,a,o)){const d=TI.includes(o)?"right":"left";return{errors:[Wb(d)]}}const p=s[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/openLabwareLatch",key:D(),params:{moduleId:e.moduleId}}],python:`${p}.open_labware_latch()`}},V_=(e,t,r)=>{const{moduleEntities:n}=t,{moduleId:a,rpm:s}=e;if(a===null)return{errors:[Q()]};if(n[a]?.type!==c.HEATERSHAKER_MODULE_TYPE)throw new Error(`expected module ${a} to be heaterShaker, got ${n[a]?.type}`);const o=n[a].pythonName;return{commands:[{commandType:"heaterShaker/setAndWaitForShakeSpeed",key:D(),params:{moduleId:a,rpm:s}}],python:`${o}.set_and_wait_for_shake_speed(${s})`}},Wu=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"heaterShaker/deactivateShaker",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_shaker()`}},Uc=(e,t,r)=>{const{moduleId:n}=e,{moduleEntities:a,labwareEntities:s}=t,o=[],i=a[n].pythonName,u=Object.values(r.labware).filter(f=>f.stack.includes(n)).find(f=>f.stack.find(_=>s[_]?.def.allowedRoles?.includes("lid")&&s[_]?.def.parameters.loadName!=="opentrons_tough_pcr_auto_sealing_lid")),p=u!=null?xc(u.stack):null,d=p!=null?s[p].def.metadata.displayName:null;return d!=null&&o.push(rT({lidDisplayName:d})),o.length>0?{errors:o}:{commands:[{commandType:"thermocycler/closeLid",key:D(),params:{moduleId:n}}],python:`${i}.close_lid()`}},B_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateBlock",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_block()`}},x_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/deactivateLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.deactivate_lid()`}},H_=(e,t,r)=>{const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/openLid",key:D(),params:{moduleId:e.moduleId}}],python:`${n}.open_lid()`}},z_=(e,t,r)=>{e.celsius!==void 0&&console.warn("'volume' param not implemented for thermocycler/setTargetBlockTemperature, should not be set!");const n=t.moduleEntities[e.moduleId].pythonName;return{commands:[{commandType:"thermocycler/setTargetBlockTemperature",key:D(),params:{moduleId:e.moduleId,celsius:e.celsius}}],python:`${n}.set_block_temperature(${e.celsius})`}},qc=(e,t,r)=>{const{moduleId:n,celsius:a}=e,s=t.moduleEntities[n].pythonName;return{commands:[{commandType:"thermocycler/setTargetLidTemperature",key:D(),params:{moduleId:n,celsius:a}}],python:`${s}.set_lid_temperature(${a})`}};function O(e,t){return(r,n)=>e(t,r,n)}function R(e,t){return(r,n)=>{const a=e(t,r,n);if("python"in a){const{python:s,...o}=a;return o}return a}}const je="__air__",zr="source_well",Mn="dest_well";function j_(e){return Kh.includes(e.parameters.loadName)}const gI=e=>(e.parameters.quirks??[]).includes("vacuumModuleDock"),G_=(e,t,r)=>{const s=c.getDeckDefFromRobotType(r).cutoutFixtures.find(l=>l.id.includes(t))?.providesAddressableAreas,i=(l=>{if(s!=null){for(const u in s)if(s[u].includes(l))return u}return null})(e);if(i==null)throw Error(`expected to find cutoutId from addressableAreaName ${e} but could not`);return i};function W_(e){switch(e){case 1:return c.ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 8:return c.EIGHT_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA;case 96:return c.NINETY_SIX_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA}}function $c(e){const t=c.getDeckDefFromRobotType(e==="cutout12"?c.OT2_ROBOT_TYPE:c.FLEX_ROBOT_TYPE);let r=null;return t.robot.model===c.FLEX_ROBOT_TYPE&&(r=t.cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null),t.robot.model===c.FLEX_ROBOT_TYPE&&r==null&&console.error(`expected to find a list of cutouts for the Flex but could not with trashLocation ${e}`),r!=null?r[e]?.[0]:"fixedTrash"}function Y_(e){if(e==="fixedTrash")return"cutout12";const r=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE).cutoutFixtures.find(n=>n.id==="trashBinAdapter")?.providesAddressableAreas??null;if(r==null)return console.error("Could not find trashBinAdapter cutouts for Flex"),null;for(const[n,a]of Object.entries(r))if(a.includes(e))return n;return console.error(`Could not find trashLocation for addressableAreaName ${e}`),null}function Fn(e,t,r,n){return e[n]!=null?"labware":t[n]!=null?"wasteChute":r[n]!=null?"trashBin":(console.error(`expected to determine if dest labware is a labware or waste chute with destLabware ${n} but could not`),null)}function K_(e,t){return Sn(bn(t),r=>e)}function mr(e){return ct(e,(t,r,n)=>n===je?t:t+r.volume,0)}function er(e,t){const r=mr(t);if(r===0)return{source:t,dest:{[je]:{volume:e}}};if(e>r)return{source:rr(t,()=>({volume:0})),dest:{...t,[je]:{volume:e-r}}};const n=ct(t,(a,s,o)=>({...a,[o]:s.volume/r}),{});return Object.keys(t).reduce((a,s)=>{const o=n[s]*e;return{source:{...a.source,[s]:{volume:t[s].volume-o}},dest:{...a.dest,[s]:{volume:o}}}},{source:{},dest:{}})}function hr(e,t){return{...t,...ct(e,(r,n,a)=>{const o=a in t?n.volume+t[a].volume:n.volume;return{...r,[a]:{volume:o}}},{})}}function Vc(e,t,r){const n=e===1?[r]:c.getWellNamePerMultiTip(t,r,e);if(!n)return console.warn(e===1?`Invalid well: ${r}`:`For labware def (URI ${c.getLabwareDefURI(t)}), with primary well ${r}, no wells are accessible by 8-channel's 1st tip`),{wellsForTips:[],allWellsShared:!1};const a=n.every(s=>s&&s===n[0]);return{wellsForTips:n,allWellsShared:a}}const X_=e=>{const{pipette:t,sourceLabwareId:r,sourceWell:n,destLabwareId:a,destWell:s,blowoutLocation:o,flowRate:i,offsetFromTopMm:l,invariantContext:u}=e;if(!o)return[];const{trashBinEntities:p,wasteChuteEntities:d}=u;let f=null,_=null;return o===zr?(f=r,_=n):o===Mn&&(f=a,_=s),_!=null&&f!=null?[O(Rc,{pipetteId:t,labwareId:f,wellName:_,flowRate:i,wellLocation:{origin:"top",offset:{z:l}}})]:d[o]!=null?[O(pb,{pipetteId:t,flowRate:i,wasteChuteId:Object.keys(d)[0]})]:[O(cb,{pipetteId:t,trashId:Object.keys(p)[0],flowRate:i})]};function Z_(e){const{labwareEntities:t,pipetteEntities:r,wasteChuteEntities:n,trashBinEntities:a}=e;return{pipettes:ct(r,(s,o,i)=>{const l=o.spec;return{...s,[i]:Q_(l.channels,{})}},{}),labware:ct(t,(s,o,i)=>({...s,[i]:rr(o.def.wells,()=>({}))}),{}),trashBins:ct(a,(s,o,i)=>({...s,[i]:{}}),{}),wasteChute:ct(n,(s,o,i)=>({...s,[i]:{}}),{})}}function Q_(e,t){return bn(e).reduce((r,n)=>({...r,[n]:t}),{})}const J_=e=>{const{blowoutLocation:t,sourceLabware:r,destLabware:n,sourceWell:a,destWell:s}=e;return t===zr&&r!=null&&a!=null?{dispenseAirGapLabware:r,dispenseAirGapWell:a}:{dispenseAirGapLabware:n,dispenseAirGapWell:s}};function Bc(e){const{invariantContext:t,labwareLocations:r,moduleLocations:n={},pipetteLocations:a}=e;return{labware:r,modules:n,pipettes:a,liquidState:Z_(t),tipState:{pipettes:ct(a,(s,o,i)=>o.mount?{...s,[i]:{hasTip:!1,tiprackURI:null}}:s,{}),tipracks:ct(r,(s,o,i)=>{const l=t.labwareEntities[i].def;if(!c.getIsTiprack(l))return s;const u=rr(l.wells,()=>Ra);return{...s,[i]:u}},{})}}}const ey=(e,t)=>e.tipracks[t]!=null?Object.values(e.tipracks[t]).some(r=>r!==ue):!1,ty=(e,t)=>e.labware[t]!=null?Object.values(e.labware[t]).some(r=>Object.values(r).some(n=>n.volume>0)):!1,II=(e,t,r)=>{const{destinationId:n,pipetteId:a,volume:s,flowRate:o,offsetFromBottomMm:i,well:l,xOffset:u,yOffset:p,tipRack:d,primaryNozzle:f,nozzles:_}=e,{labwareEntities:m,trashBinEntities:h,wasteChuteEntities:b}=t,T=Fn(m,b,h,n);let y=[];return T==="labware"&&i!=null&&l!=null?y=[O(kc,{pipetteId:a,volume:s,labwareId:n,wellName:l,flowRate:o,wellLocation:{origin:"bottom",offset:{z:i,x:u,y:p}},tipRack:d,primaryNozzle:f,nozzles:_})]:T==="wasteChute"?y=[O(hA,{pipetteId:a,volume:s,flowRate:o,wasteChuteId:b[n].id})]:y=[O(mA,{pipetteId:a,volume:s,flowRate:o,trashId:h[n].id})],ae(y,t,r)},EI=(e,t,r)=>{const{destinationId:n,pipetteId:a,zOffset:s,well:o}=e,{labwareEntities:i,wasteChuteEntities:l,trashBinEntities:u}=t,p=Fn(i,l,u,n);let d=[];return p==="labware"&&o!=null?d=[O(B,{pipetteId:a,labwareId:n,wellName:o,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:s}}})]:p==="wasteChute"?d=[O(Fe,{pipetteId:a,fixtureId:l[n].id,offset:{x:0,y:0,z:0}})]:d=[O(Fe,{pipetteId:a,fixtureId:u[n].id,offset:wt})],ae(d,t,r)},wI=(e,t,r)=>{const{blowOutLocation:n,destinationId:a,destWell:s,flowRate:o,pipetteId:i,sourceId:l,sourceWell:u,volume:p}=e,{labwareEntities:d,trashBinEntities:f,wasteChuteEntities:_}=t,m=Fn(d,_,f,a);let h=[];if(m==="labware"&&s!=null){const{dispenseAirGapLabware:b,dispenseAirGapWell:T}=J_({blowoutLocation:n,sourceLabware:l,destLabware:a,sourceWell:u,destWell:s});h=[O(uA,{flowRate:o,pipetteId:i,labwareId:b,wellName:T,volume:p,type:"dispense"})]}else m==="wasteChute"?h=[O(lA,{pipetteId:i,volume:p,flowRate:o,wasteChuteId:_[a].id})]:h=[O(iA,{pipetteId:i,volume:p,flowRate:o,trashId:f[a].id})];return ae(h,t,r)},SI=(e,t,r)=>{const{pipetteId:n,destinationId:a,well:s,zOffset:o,seconds:i}=e,{labwareEntities:l,trashBinEntities:u,wasteChuteEntities:p}=t,d=Fn(l,p,u,a);let f=[];return s!=null&&d==="labware"?f=[O(B,{pipetteId:n,labwareId:a,wellName:s,wellLocation:{origin:"bottom",offset:{x:0,y:0,z:o}}}),O(me,{seconds:i})]:d==="wasteChute"?f=[O(Fe,{pipetteId:n,fixtureId:a,offset:wt}),O(me,{seconds:i})]:f=[O(Fe,{pipetteId:n,fixtureId:a,offset:wt}),O(me,{seconds:i})],ae(f,t,r)},W=(e,t=!1)=>{if(e==null)return console.error("expected to find stack but could not"),"unknown slot";{const r=e[e.length-1];return t?`STACKER ${r.slice(-2,-1)}`:r}},AI=e=>e===c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA?Xh:e,xc=e=>e==null?(console.error("expected to find stack but could not"),"unknown top location"):e[0],ry=e=>e.length>=2?e[1]:null,fa=e=>{const{slot:t,labwareState:r,modulesState:n}=e,a=Object.values(n).find(({slot:s,moduleState:o})=>s===t&&o.type===c.FLEX_STACKER_MODULE_TYPE);if(a!=null){const s=a.moduleState.labwareOnShuttle;return s==null?[]:[s.lidLabwareId,s.primaryLabwareId,s.adapterLabwareId].filter(i=>i!=null)}return Object.values(r).reduce((s,{stack:o})=>(o[o.length-1]===t&&o.length>s.length&&(s=o),s),[])},Hc=e=>c.FLEX_SINGLE_SLOT_BY_CUTOUT_ID[c.FLEX_CUTOUT_BY_SLOT_ID[e]],ny=e=>{const t=c.FLEX_STACKER_ADDRESSABLE_AREAS.indexOf(e);return t===-1?null:ve[t]},LI=e=>{const t=ny(e);return t!=null?Hc(t):null},ay=(e,t,r)=>{if(e==null)return null;if(ve.includes(e)){const n=Hc(e);return Object.entries(t).some(([s,o])=>r[s]?.type===c.FLEX_STACKER_MODULE_TYPE&&o.slot===n)?n:e}return e},Rs=e=>{const t=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),r=`${e[0]}3`,n=c.FLEX_CUTOUT_BY_SLOT_ID[r],a=t.cutoutFixtures.find(({id:s})=>s===c.FLEX_STACKER_V1_FIXTURE)?.providesAddressableAreas[n];return c.FLEX_STACKER_ADDRESSABLE_AREAS.find(s=>a?.includes(s))??null},sy=(e,t,r,n)=>{if(t.length===0)return{isCompatible:!0,isAboveStackLimit:!1};let a=!1;const s=t.find(u=>u in n);s!=null&&(a=n[s].type===c.FLEX_STACKER_MODULE_TYPE&&t.includes(Ze));const o=xc(t);let i=!0,l=!1;if(o in r){const u=r[e],p=r[o],d=t.filter(g=>r[g]!=null),f=d.filter(g=>r[g]?.def?.allowedRoles?.includes("lid"))[0],_=d.filter(g=>r[g]?.def?.allowedRoles?.includes("adapter"))[0],m=p.def.parameters.loadName,h=d.filter(g=>!r[g]?.def?.allowedRoles?.includes("adapter")&&!r[g]?.def?.allowedRoles?.includes("lid"))[0];if(a){const g=c.getMaxPoolCount({labwareDefinitions:{primary:r[h]?.def??null,adapter:r[_]?.def??null,lid:r[f]?.def??null},model:c.FLEX_STACKER_MODULE_V1});l=t.length>g}else{const g=p.def.stackLimit??1,k=m===u.def.parameters.loadName,v=t.filter(q=>r[q]?.def.parameters.loadName===m)?.length;l=k&&v>=g}const b=u.def.parameters.loadName==="opentrons_tough_universal_lid",T=p.def.metadata.displayCategory==="tubeRack",y=p.def.metadata.displayCategory==="aluminumBlock",A=p.def.parameters.isTiprack,I=(p.def.allowedRoles??[]).includes("lid"),S=j_(p.def),L=t.some(g=>g in r&&gI(r[g].def)),E=u.def.parameters.quirks?.includes("vacuumModuleDock")??!1;i=(u.def.parameters.quirks?.includes("filterPlate")??!1)&&!I&&!A&&!(p.def.parameters.quirks?.includes("filterPlate")??!1)||!L&&E||(p.def.parameters.quirks?.includes("providesStackingDefault")??!1)&&!S||u.def.compatibleParentLabware?.some(g=>g===m)||Object.keys(u.def.stackingOffsetWithLabware??{}).some(g=>g===m)||b&&!T&&!y&&!A&&(p.def.parameters.loadName==="opentrons_tough_universal_lid"||!I)}else if(o in n){const u=n[o],{model:p}=u;i=Object.keys(r[e].def.stackingOffsetWithModule??{}).some(d=>p===d)}return{isCompatible:i,isAboveStackLimit:l}},Fa=(e,t)=>t?.find(r=>e[r]!=null)??null,OI=(e,t,r)=>t?e:r?Wh[e]:e,ks=(e,t,r)=>{if(t==="offDeck"&&r==null)return console.error("offDeck slot is not allowed to be used without an offDeckOverrideId"),[];const n=ma(t),a=oy(t),s=OI(t,n,a),o=Object.values(e).filter(i=>i.stack.includes(s)&&(r==null||i.stack.includes(r))&&i.stack.includes(Ze)===a&&i.stack.includes(pc)===n);return o.length===0?[]:a?o.at(-1)?.stack??[]:n?o.at(-1)?.stack??[]:o.toSorted((i,l)=>l.stack.length-i.stack.length)[0]?.stack??[]},RI=(e,t)=>Object.values(t).filter(r=>r.stack.includes(e)).sort((r,n)=>n.stack.length-r.stack.length)[0]?.stack[0],ua=(e,t,r,n=!0)=>{const a=c.linearInterpolate(e,t)??0,s=c.linearInterpolate(e,r)??0;return e+(n?a:0)+s},zc=e=>{const{path:t,volume:r,pipetteSpecs:n,tiprackDefinition:a,conditioningByVolume:s,disposalByVolume:o,numDispenseWells:i,numAspirateWells:l,aspirateAirGapByVolume:u}=e,{liquids:p}=n,f=r<p.default.minVolume&&"lowVolumeDefault"in p?p.lowVolumeDefault.maxVolume:p.default.maxVolume,_=a?.wells.A1.totalLiquidVolume,m=_==null?f:Math.min(f,_),h=r*2,b=s!=null?c.linearInterpolate(h,s)??0:0,y=a?.namespace!=="opentrons"||s!=null&&o!=null&&m>=h+b+(c.linearInterpolate(h,o)??0)+(b===0?c.linearInterpolate(h,u)??0:0),A=m>=h;if(t==="multiAspirate"&&l<=i?console.warn("Invalid combination of source and destination wells for multiAspirate path"):t==="multiDispense"&&l>=i?console.warn("Invalid combination of source and destination wells for multiDispense path"):t==="single"&&l!==i&&console.warn("Invalid combination of source and destination wells for single path"),t==="single"||t==="multiDispense"&&!y||t==="multiAspirate"&&!A){const L=c.linearInterpolate(r,u)??0,E=Math.ceil((r+L)/m),g=r/E;return{referenceVolumes:{airGap:{aspirate:g,dispense:0},correction:{aspirate:g,dispense:g},pushOut:g,flowRate:{aspirate:g,dispense:g}},multiWellHandling:{isSupported:!1}}}if(t==="multiDispense"){let L=0,E=0;for(let g=0;g<i&&!(ua((g+1)*r,s??[],o??[])>m);g++)L=(g+1)*r,E+=1;return{referenceVolumes:{airGap:{aspirate:ua(L,s??[],o??[],!1),dispense:ua((E-1)*r,s??[],o??[],!1)},correction:{aspirate:ua(L,s??[],o??[]),dispense:r},flowRate:{aspirate:ua(L,s??[],o??[]),dispense:r},pushOut:r,conditioning:L,disposal:L},multiWellHandling:{isSupported:!0,numWellsToFitInTip:E}}}const w=Math.floor(m/r),I=Math.min(w,l),S=I*r;return{referenceVolumes:{airGap:{aspirate:S,dispense:0},pushOut:S,correction:{aspirate:S,dispense:S},flowRate:{aspirate:r,dispense:S}},multiWellHandling:{isSupported:!0,numWellsToFitInTip:I}}},Ur=e=>{const{retractZOffset:t,retractPositionReference:r,labwareId:n,labwareEntities:a,well:s}=e;if(s==null)return!1;const o=a[n]?.def.wells[s]?.depth;if(o==null)return!1;const i=c.getMmFromBottom(t,r,o);return i==null?!1:i-o>=c.SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM},Yu=e=>e.reduce((t,r)=>{const{kind:n}=r;return n==="onCutoutFixture"?t:n==="onLabware"?[...t,r.labwareId]:n==="onModule"||n==="inStackerHopper"?[...t,r.moduleId]:n==="onAddressableArea"?[...t,r.addressableAreaName]:[...t,r.logicalLocationName]},[]),kI={A4:"cutoutA3",B4:"cutoutB3",C4:"cutoutC3",D4:"cutoutD3"};function Ku(e){if(e.location!=="offDeck"&&e.location!=="systemLocation"&&e.location!=="wasteChuteLocation"&&"addressableAreaName"in e.location&&jh.includes(e.location.addressableAreaName)){const t=D(),r=e.location.addressableAreaName,n=kI[r]??r;return{[t]:{id:t,location:n}}}return{}}const oy=e=>Gh.includes(e),ma=e=>e===c.VACUUM_MODULE_DOCK_A4_ADDRESSABLE_AREA,jc=e=>e.labwareOnShuttle?.primaryLabwareId??null,Gc=(e,t,r)=>{if(r?.storedLabwareDetails==null)return!0;const n=Object.values(r?.storedLabwareDetails??{}).reduce((s,o)=>o!=null?[...s,o]:s,[]),a=t.labwareEntities[e];return n.some(s=>a?.labwareDefURI===s)},Wc=(e,t)=>{const{storedLabwareDetails:r}=e??{};if(r==null)return!0;const{primaryLabwareURI:n,adapterLabwareURI:a,lidLabwareURI:s}=r,o=Object.values(t).find(({labwareDefURI:f})=>f===n),i=Object.values(t).find(({labwareDefURI:f})=>f===a),l=Object.values(t).find(({labwareDefURI:f})=>f===s);if(o==null)return console.error("Primary labware entity not found"),!1;const u=c.getMaxPoolCount({labwareDefinitions:{primary:o.def,adapter:i?.def??null,lid:l?.def??null},model:c.FLEX_STACKER_MODULE_V1}),d=e?.labwareInHopper?.length??0;return u>d},iy=e=>{const{labwareId:t,labwareRobotState:r,labwareEntities:n}=e;return Object.entries(r).some(([a,{stackedOnNode:s}])=>typeof s=="object"&&"labwareId"in s&&s.labwareId===t&&c.getIsLid(n[a].def))},ly=e=>![Ln,c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA,...ve].some(t=>e===t);function vI(e,t){if(typeof e=="number")return e;const r=t[e];return r!=null&&(r.type==="float"||r.type==="int")?r.default:null}function PI(e,t){const r=t[e];return r==null?e:r.type==="string"?r.default:null}function CI(e,t){if(typeof e=="boolean")return e;const r=t[e];return r!=null&&r.type==="boolean"?r.default:null}const Ua=(e,t,r)=>{const n=t[r]?.stack,a=Fa(e,n),s=a!=null?e[a].moduleState:null;return!!(s&&s.type===c.ABSORBANCE_READER_TYPE&&s.lidOpen!==!0)};var Il,Xf;function uy(){if(Xf)return Il;Xf=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Il=e,Il}var NI=uy();const Yc=xe(NI);var cy=Symbol.for("immer-nothing"),Zf=Symbol.for("immer-draftable"),ot=Symbol.for("immer-state"),DI=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ke(e,...t){if(process.env.NODE_ENV!=="production"){const r=DI[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ha=Object.getPrototypeOf;function On(e){return!!e&&!!e[ot]}function qr(e){return e?py(e)||Array.isArray(e)||!!e[Zf]||!!e.constructor?.[Zf]||qa(e)||Ps(e):!1}var MI=Object.prototype.constructor.toString(),Qf=new WeakMap;function py(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Qf.get(r);return n===void 0&&(n=Function.toString.call(r),Qf.set(r,n)),n===MI}function is(e,t,r=!0){vs(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function vs(e){const t=e[ot];return t?t.type_:Array.isArray(e)?1:qa(e)?2:Ps(e)?3:0}function Xu(e,t){return vs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dy(e,t,r){const n=vs(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function FI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function qa(e){return e instanceof Map}function Ps(e){return e instanceof Set}function Nr(e){return e.copy_||e.base_}function Zu(e,t){if(qa(e))return new Map(e);if(Ps(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=py(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[ot];let a=Reflect.ownKeys(n);for(let s=0;s<a.length;s++){const o=a[s],i=n[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ha(e),n)}else{const n=ha(e);if(n!==null&&r)return{...e};const a=Object.create(n);return Object.assign(a,e)}}function Kc(e,t=!1){return Cs(e)||On(e)||!qr(e)||(vs(e)>1&&Object.defineProperties(e,{set:ts,add:ts,clear:ts,delete:ts}),Object.freeze(e),t&&Object.values(e).forEach(r=>Kc(r,!0))),e}function UI(){Ke(2)}var ts={value:UI};function Cs(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var qI={};function $r(e){const t=qI[e];return t||Ke(0,e),t}var _a;function fy(){return _a}function $I(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jf(e,t){t&&($r("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Qu(e){Ju(e),e.drafts_.forEach(VI),e.drafts_=null}function Ju(e){e===_a&&(_a=e.parent_)}function em(e){return _a=$I(_a,e)}function VI(e){const t=e[ot];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tm(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[ot].modified_&&(Qu(t),Ke(4)),qr(e)&&(e=ls(t,e),t.parent_||us(t,e)),t.patches_&&$r("Patches").generateReplacementPatches_(r[ot].base_,e,t.patches_,t.inversePatches_)):e=ls(t,r,[]),Qu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cy?e:void 0}function ls(e,t,r){if(Cs(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[ot];if(!a)return is(t,(s,o)=>rm(e,a,t,s,o,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return us(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const s=a.copy_;let o=s,i=!1;a.type_===3&&(o=new Set(s),s.clear(),i=!0),is(o,(l,u)=>rm(e,a,s,l,u,r,i),n),us(e,s,!1),r&&e.patches_&&$r("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function rm(e,t,r,n,a,s,o){if(a==null||typeof a!="object"&&!o)return;const i=Cs(a);if(!(i&&!o)){if(process.env.NODE_ENV!=="production"&&a===r&&Ke(5),On(a)){const l=s&&t&&t.type_!==3&&!Xu(t.assigned_,n)?s.concat(n):void 0,u=ls(e,a,l);if(dy(r,n,u),On(u))e.canAutoFreeze_=!1;else return}else o&&r.add(a);if(qr(a)&&!i){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&i)return;ls(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(qa(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&us(e,a)}}}function us(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kc(t,r)}function BI(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:fy(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,s=Xc;r&&(a=[n],s=ya);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return n.draft_=i,n.revoke_=o,i}var Xc={get(e,t){if(t===ot)return e;const r=Nr(e);if(!Xu(r,t))return xI(e,r,t);const n=r[t];return e.finalized_||!qr(n)?n:n===El(e.base_,t)?(wl(e),e.copy_[t]=tc(n,e)):n},has(e,t){return t in Nr(e)},ownKeys(e){return Reflect.ownKeys(Nr(e))},set(e,t,r){const n=my(Nr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=El(Nr(e),t),s=a?.[ot];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(FI(r,a)&&(r!==void 0||Xu(e.base_,t)))return!0;wl(e),ec(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return El(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,wl(e),ec(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Nr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ke(11)},getPrototypeOf(e){return ha(e.base_)},setPrototypeOf(){Ke(12)}},ya={};is(Xc,(e,t)=>{ya[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ya.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Ke(13),ya.set.call(this,e,t,void 0)};ya.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Ke(14),Xc.set.call(this,e[0],t,r,e[0])};function El(e,t){const r=e[ot];return(r?Nr(r):e)[t]}function xI(e,t,r){const n=my(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function my(e,t){if(!(t in e))return;let r=ha(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ha(r)}}function ec(e){e.modified_||(e.modified_=!0,e.parent_&&ec(e.parent_))}function wl(e){e.copy_||(e.copy_=Zu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var HI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const o=this;return function(l=s,...u){return o.produce(l,p=>r.call(this,p,...u))}}typeof r!="function"&&Ke(6),n!==void 0&&typeof n!="function"&&Ke(7);let a;if(qr(t)){const s=em(this),o=tc(t,void 0);let i=!0;try{a=r(o),i=!1}finally{i?Qu(s):Ju(s)}return Jf(s,n),tm(a,s)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===cy&&(a=void 0),this.autoFreeze_&&Kc(a,!0),n){const s=[],o=[];$r("Patches").generateReplacementPatches_(t,a,s,o),n(s,o)}return a}else Ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...i)=>this.produceWithPatches(o,l=>t(l,...i));let n,a;return[this.produce(t,r,(o,i)=>{n=o,a=i}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){qr(e)||Ke(8),On(e)&&(e=zI(e));const t=em(this),r=tc(e,void 0);return r[ot].isManual_=!0,Ju(t),r}finishDraft(e,t){const r=e&&e[ot];(!r||!r.isManual_)&&Ke(9);const{scope_:n}=r;return Jf(n,t),tm(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=$r("Patches").applyPatches_;return On(e)?n(e,t):this.produce(e,a=>n(a,t))}};function tc(e,t){const r=qa(e)?$r("MapSet").proxyMap_(e,t):Ps(e)?$r("MapSet").proxySet_(e,t):BI(e,t);return(t?t.scope_:fy()).drafts_.push(r),r}function zI(e){return On(e)||Ke(10,e),hy(e)}function hy(e){if(!qr(e)||Cs(e))return e;const t=e[ot];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Zu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Zu(e,!0);return is(r,(a,s)=>{dy(r,a,hy(s))},n),t&&(t.finalized_=!1),r}var jI=new HI,_y=jI.produce;function GI(e,t){let n=0;const a=[];for(;n+1<e.length;){const s=e[n],o=e[n+1];if(t(s,o)){n+=2;continue}else a.push(s),n+=1}return n+1===e.length&&a.push(e[n]),a}const WI=(e,t)=>["pipetteId","volume","labwareId","wellName"].every(n=>e[n]===t[n]),YI=e=>GI(e,(t,r)=>t.commandType==="aspirate"&&r.commandType==="dispense"&&WI(t.params,r.params)),yy=e=>YI(e),Zc=(e,t)=>{const r=Ot(e,t);return r.type===c.ABSORBANCE_READER_TYPE?r:(console.error(`Absorbance reader state updater expected ${t} moduleState to be absorbanceReader, but it was ${r.type}`),null)},KI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Zc(n,a);s!=null&&(s.lidOpen=!0)},XI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Zc(n,a);s!=null&&(s.lidOpen=!1)},ZI=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,measureMode:s,sampleWavelengths:o,referenceWavelength:i}=e,l=Zc(n,a);l!=null&&(l.initialization={mode:s,wavelengths:o,referenceWavelength:i},l.lidOpen=!1)};function QI(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o=s.pipettes[n].nozzles;let l=t.pipetteEntities[n].spec.channels;o===c.COLUMN?l=8:o===c.SINGLE&&(l=1),bn(l).forEach(u=>{const p=s.liquidState.pipettes[n][u]??{},d=p[je]?.volume??0;s.liquidState.pipettes[n][u]={...p,[je]:{volume:d+a}}})}var Sl,nm;function JI(){if(nm)return Sl;nm=1;var e=p_(),t=Ca(),r=fs(),n=Qe(),a=xr(),s=Ts(),o=Is(),i=Ec(),l="[object Map]",u="[object Set]",p=Object.prototype,d=p.hasOwnProperty;function f(_){if(_==null)return!0;if(a(_)&&(n(_)||typeof _=="string"||typeof _.splice=="function"||s(_)||i(_)||r(_)))return!_.length;var m=t(_);if(m==l||m==u)return!_.size;if(o(_))return!e(_).length;for(var h in _)if(d.call(_,h))return!1;return!0}return Sl=f,Sl}var eE=JI();const Al=xe(eE);var Ll,am;function tE(){if(am)return Ll;am=1;function e(t,r,n,a){for(var s=t.length,o=n+(a?1:-1);a?o--:++o<s;)if(r(t[o],o,t))return o;return-1}return Ll=e,Ll}var Ol,sm;function rE(){if(sm)return Ol;sm=1;function e(t){return t!==t}return Ol=e,Ol}var Rl,om;function nE(){if(om)return Rl;om=1;function e(t,r,n){for(var a=n-1,s=t.length;++a<s;)if(t[a]===r)return a;return-1}return Rl=e,Rl}var kl,im;function aE(){if(im)return kl;im=1;var e=tE(),t=rE(),r=nE();function n(a,s,o){return s===s?r(a,s,o):e(a,t,o)}return kl=n,kl}var vl,lm;function sE(){if(lm)return vl;lm=1;var e=aE();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return vl=t,vl}var Pl,um;function oE(){if(um)return Pl;um=1;function e(t,r,n){for(var a=-1,s=t==null?0:t.length;++a<s;)if(n(r,t[a]))return!0;return!1}return Pl=e,Pl}var Cl,cm;function iE(){if(cm)return Cl;cm=1;function e(){}return Cl=e,Cl}var Nl,pm;function lE(){if(pm)return Nl;pm=1;var e=f_(),t=iE(),r=yc(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(s){return new e(s)}:t;return Nl=a,Nl}var Dl,dm;function uE(){if(dm)return Dl;dm=1;var e=e_(),t=sE(),r=oE(),n=r_(),a=lE(),s=yc(),o=200;function i(l,u,p){var d=-1,f=t,_=l.length,m=!0,h=[],b=h;if(p)m=!1,f=r;else if(_>=o){var T=u?null:a(l);if(T)return s(T);m=!1,f=n,b=new e}else b=u?[]:h;e:for(;++d<_;){var y=l[d],A=u?u(y):y;if(y=p||y!==0?y:0,m&&A===A){for(var w=b.length;w--;)if(b[w]===A)continue e;u&&b.push(A),h.push(y)}else f(b,A,p)||(b!==h&&b.push(A),h.push(y))}return h}return Dl=i,Dl}var Ml,fm;function cE(){if(fm)return Ml;fm=1;var e=uE();function t(r){return r&&r.length?e(r):[]}return Ml=t,Ml}var pE=cE();const dE=xe(pE),Qc=e=>{const{nozzles:t,pipetteSpec:r,primaryNozzle:n}=e,a=r.channels;if(t==null)return a;switch(t){case c.ROW:return 12;case c.COLUMN:return 8;case c.SINGLE:return 1;case c.ALL:return a;case c.PARTIAL_COLUMN:return c.PARTIAL_NOZZLE_MAP[n];default:return a}};function fE(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s,warnings:o}=r,i="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",l="wellName"in e?e.wellName:s.pipettes[n].wellName??"",{liquidState:u}=s,p=s.pipettes[n].nozzles,d=r.robotState.pipettes[n].primaryNozzle,f=t.pipetteEntities[n].spec,_=t.labwareEntities[i].def,m=_.metadata.displayCategory==="reservoir",h=Qc({pipetteSpec:f,nozzles:p,primaryNozzle:d}),{allWellsShared:b,wellsForTips:T}=Vc(h,_,l);if(console.assert(dE(T).length===b?1:T.length,`expected all wells to be shared, or no wells to be shared. Got: ${JSON.stringify(T)}`),h>1&&b){const A=T[0],w=u.labware[i][A],I=a*h>mr(w);Al(w)?o.push(gl()):I&&o.push(Tl());const S=I?mr(w)/h:a,L=er(S,w).dest;bn(h).forEach(E=>{const g=u.pipettes[n],k=E.toString(),v=g[k],q=I?hr(v,{...L,[je]:{volume:a-S}}):hr(v,L);g[k]=q}),u.labware[i][A]=er(a*h,u.labware[i][A]).source;return}if(h===96&&m){T.forEach(A=>{const w=u.labware[i][A],I=a*8>mr(w);Al(w)?o.push(gl()):I&&o.push(Tl());const S=I?mr(w)/8:a,L=er(S,w).dest;bn(h).forEach(E=>{const g=u.pipettes[n],k=E.toString(),v=g[k],q=I?hr(v,{...L,[je]:{volume:a-S}}):hr(v,L);g[k]=q}),u.labware[i][A]=er(S*8,u.labware[i][A]).source});return}bn(h).forEach(A=>{const w=A.toString(),I=u.pipettes[n],S=I[w],L=u.labware[i][T[A]],E=er(a,L).dest;Al(L)?o.push(gl()):a>mr(L)&&o.push(Tl()),I[w]=hr(S,E)});const y=u.labware[i];T.forEach(A=>{y[A]=er(a,y[A]).source}),"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId,wellName:l})}function Ns(e){const{robotStateAndWarnings:t,invariantContext:r,entityId:n,pipetteId:a,prevLiquidState:s,useFullVolume:o,volume:i,wellName:l}=e,u=r.pipetteEntities[a].spec,p=t.robotState.pipettes[a].nozzles,d=t.robotState.pipettes[a].primaryNozzle,f=Qc({pipetteSpec:u,nozzles:p,primaryNozzle:d}),_=l??null,m=r.labwareEntities[n]!=null?r.labwareEntities[n].def:null;console.assert(!(o&&typeof i=="number"),"dispenseUpdateLiquidState takes either `volume` or `useFullVolume`, but got both"),console.assert(typeof i=="number"||o,"in dispenseUpdateLiquidState, either volume or useFullVolume are required");const{wellsForTips:h,allWellsShared:b}=m!=null&&l!=null?Vc(f,m,l):{wellsForTips:null,allWellsShared:!0},T=s.labware[n]!=null?s.labware[n]:null;let y=null;s.trashBins[n]!=null?y=s.trashBins[n]:s.wasteChute[n]!=null&&(y=s.wasteChute[n]);const A=rr(s.pipettes[a],L=>{const{...E}=L;if(o){const g=mr(E);return g>0?er(g,E):{source:{},dest:{}}}return er(i||0,E)});let w=null;if(_!=null&&T!=null)w={[_]:ct(A,(L,E)=>hr(L,E.dest),T[_])};else if(y!=null){const L=Object.values(s.pipettes[a]).reduce((E,g)=>E+(g[0]?.volume??0),0);y[0]={volume:L}}w==null&&y==null&&console.assert(!1,`expected to merge liquid to a single well with sourceId ${n}`);const I=_!=null&&T!=null&&h!=null?h.reduce((L,E,g)=>({...L,[E]:hr(A[`${g}`].dest,T[E]||{})}),{}):{},S=b?w:I;s.pipettes[a]=rr(A,"source"),s.trashBins[n]!=null&&y!=null?Object.assign(s.trashBins[n],y):s.wasteChute[n]!=null&&y!=null?Object.assign(s.wasteChute[n],y):s.labware[n]!=null&&S!=null&&(s.labware[n]=Object.assign(T??{},S))}function mE(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;Ns({pipetteId:n,entityId:a,useFullVolume:!0,wellName:s,prevLiquidState:o.liquidState,invariantContext:t,robotStateAndWarnings:r})}function hE(e,t,r){const{pipetteId:n,configurationParams:a}=e,{robotState:s}=r;s.pipettes[n].nozzles=a.style,s.pipettes[n].primaryNozzle=a.primaryNozzle}function _E(e,t,r){const{pipetteId:n,volume:a}=e,{robotState:s}=r,o="labwareId"in e?e.labwareId:s.pipettes[n].entityId??"",i="wellName"in e?e.wellName:s.pipettes[n].wellName??"",l=s.liquidState.pipettes[n],p=Object.values(l)[0]?.[je]?.volume??0,d=r.robotState.pipettes[n].primaryNozzle;if(Ns({invariantContext:t,entityId:o,pipetteId:n,prevLiquidState:s.liquidState,useFullVolume:!1,volume:a,wellName:i,robotStateAndWarnings:r}),p>0){const f=r.robotState.pipettes[n].nozzles,_=t.pipetteEntities[n].spec,m=Qc({pipetteSpec:_,nozzles:f,primaryNozzle:d});Object.keys(l).slice(0,m).forEach(b=>{const T=l[b]??{};l[b]={...T,[je]:{volume:0}}})}"labwareId"in e&&(s.pipettes[n]={...s.pipettes[n],entityId:e.labwareId})}function yE(e,t,r){const{pipetteId:n,wellName:a,labwareId:s}=e,{robotState:o}=r;o.tipState.pipettes[n].hasTip=!1,o.tipState.pipettes[n].tiprackURI=null,o.pipettes[n].tiprackId=void 0;const i=o.tipState,l=t.pipetteEntities[n].spec,u=o.pipettes[n].nozzles,p=lp(u,l),d=(_,m)=>_.find(h=>h.includes(m)),f=t.labwareEntities[s]?.def;f==null||!c.getIsTiprack(f)?console.warn(`forDropTip expected ${s} to have definition and to be a tiprack`):(p===c.SINGLE?i.tipracks[s][a]=Qt:p===c.COLUMN?(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt):p===c.ALL?l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Qt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt):l.channels===1?i.tipracks[s][a]=Qt:l.channels===96?f.ordering.reduce((m,h)=>m.concat(h),[]).forEach(function(m){i.tipracks[s][m]=Qt}):(d(f.ordering,a)??[]).forEach(m=>i.tipracks[s][m]=Qt),o.pipettes[n].entityId=s,o.pipettes[n].wellName=a)}function bE(e,t,r){const{labwareId:n,liquidId:a,volumeByWell:s}=e;Object.entries(s).forEach(([o,i])=>{r.robotState.liquidState.labware[n][o][a]={volume:i}})}var Fl,mm;function TE(){if(mm)return Fl;mm=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return Fl=e,Fl}var Ul,hm;function Jc(){if(hm)return Ul;hm=1;var e=Lc(),t=ms(),r=Object.prototype,n=r.hasOwnProperty;function a(s,o,i){var l=s[o];(!(n.call(s,o)&&t(l,i))||i===void 0&&!(o in s))&&e(s,o,i)}return Ul=a,Ul}var ql,_m;function $a(){if(_m)return ql;_m=1;var e=Jc(),t=Lc();function r(n,a,s,o){var i=!s;s||(s={});for(var l=-1,u=a.length;++l<u;){var p=a[l],d=o?o(s[p],n[p],p,s,n):void 0;d===void 0&&(d=n[p]),i?t(s,p,d):e(s,p,d)}return s}return ql=r,ql}var $l,ym;function gE(){if(ym)return $l;ym=1;var e=$a(),t=Pa();function r(n,a){return n&&e(a,t(a),n)}return $l=r,$l}var Vl,bm;function IE(){if(bm)return Vl;bm=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return Vl=e,Vl}var Bl,Tm;function EE(){if(Tm)return Bl;Tm=1;var e=ar(),t=Is(),r=IE(),n=Object.prototype,a=n.hasOwnProperty;function s(o){if(!e(o))return r(o);var i=t(o),l=[];for(var u in o)u=="constructor"&&(i||!a.call(o,u))||l.push(u);return l}return Bl=s,Bl}var xl,gm;function ep(){if(gm)return xl;gm=1;var e=u_(),t=EE(),r=xr();function n(a){return r(a)?e(a,!0):t(a)}return xl=n,xl}var Hl,Im;function wE(){if(Im)return Hl;Im=1;var e=$a(),t=ep();function r(n,a){return n&&e(a,t(a),n)}return Hl=r,Hl}var da={exports:{}};da.exports;var Em;function SE(){return Em||(Em=1,(function(e,t){var r=Ht(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,o=s?r.Buffer:void 0,i=o?o.allocUnsafe:void 0;function l(u,p){if(p)return u.slice();var d=u.length,f=i?i(d):new u.constructor(d);return u.copy(f),f}e.exports=l})(da,da.exports)),da.exports}var zl,wm;function AE(){if(wm)return zl;wm=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return zl=e,zl}var jl,Sm;function LE(){if(Sm)return jl;Sm=1;var e=$a(),t=bc();function r(n,a){return e(n,t(n),a)}return jl=r,jl}var Gl,Am;function tp(){if(Am)return Gl;Am=1;var e=c_(),t=e(Object.getPrototypeOf,Object);return Gl=t,Gl}var Wl,Lm;function by(){if(Lm)return Wl;Lm=1;var e=fc(),t=tp(),r=bc(),n=i_(),a=Object.getOwnPropertySymbols,s=a?function(o){for(var i=[];o;)e(i,r(o)),o=t(o);return i}:n;return Wl=s,Wl}var Yl,Om;function OE(){if(Om)return Yl;Om=1;var e=$a(),t=by();function r(n,a){return e(n,t(n),a)}return Yl=r,Yl}var Kl,Rm;function rp(){if(Rm)return Kl;Rm=1;var e=s_(),t=by(),r=ep();function n(a){return e(a,r,t)}return Kl=n,Kl}var Xl,km;function RE(){if(km)return Xl;km=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,s=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(s.index=n.index,s.input=n.input),s}return Xl=r,Xl}var Zl,vm;function np(){if(vm)return Zl;vm=1;var e=a_();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return Zl=t,Zl}var Ql,Pm;function kE(){if(Pm)return Ql;Pm=1;var e=np();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Ql=t,Ql}var Jl,Cm;function vE(){if(Cm)return Jl;Cm=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Jl=t,Jl}var eu,Nm;function PE(){if(Nm)return eu;Nm=1;var e=kn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return eu=n,eu}var tu,Dm;function CE(){if(Dm)return tu;Dm=1;var e=np();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return tu=t,tu}var ru,Mm;function NE(){if(Mm)return ru;Mm=1;var e=np(),t=kE(),r=vE(),n=PE(),a=CE(),s="[object Boolean]",o="[object Date]",i="[object Map]",l="[object Number]",u="[object RegExp]",p="[object Set]",d="[object String]",f="[object Symbol]",_="[object ArrayBuffer]",m="[object DataView]",h="[object Float32Array]",b="[object Float64Array]",T="[object Int8Array]",y="[object Int16Array]",A="[object Int32Array]",w="[object Uint8Array]",I="[object Uint8ClampedArray]",S="[object Uint16Array]",L="[object Uint32Array]";function E(g,k,v){var q=g.constructor;switch(k){case _:return e(g);case s:case o:return new q(+g);case m:return t(g,v);case h:case b:case T:case y:case A:case w:case I:case S:case L:return a(g,v);case i:return new q;case l:case d:return new q(g);case u:return r(g);case p:return new q;case f:return n(g)}}return ru=E,ru}var nu,Fm;function DE(){if(Fm)return nu;Fm=1;var e=ar(),t=Object.create,r=(function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var s=new n;return n.prototype=void 0,s}})();return nu=r,nu}var au,Um;function ME(){if(Um)return au;Um=1;var e=DE(),t=tp(),r=Is();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return au=n,au}var su,qm;function FE(){if(qm)return su;qm=1;var e=Ca(),t=nr(),r="[object Map]";function n(a){return t(a)&&e(a)==r}return su=n,su}var ou,$m;function UE(){if($m)return ou;$m=1;var e=FE(),t=gc(),r=Ic(),n=r&&r.isMap,a=n?t(n):e;return ou=a,ou}var iu,Vm;function qE(){if(Vm)return iu;Vm=1;var e=Ca(),t=nr(),r="[object Set]";function n(a){return t(a)&&e(a)==r}return iu=n,iu}var lu,Bm;function $E(){if(Bm)return lu;Bm=1;var e=qE(),t=gc(),r=Ic(),n=r&&r.isSet,a=n?t(n):e;return lu=a,lu}var uu,xm;function Ty(){if(xm)return uu;xm=1;var e=_c(),t=TE(),r=Jc(),n=gE(),a=wE(),s=SE(),o=AE(),i=LE(),l=OE(),u=d_(),p=rp(),d=Ca(),f=RE(),_=NE(),m=ME(),h=Qe(),b=Ts(),T=UE(),y=ar(),A=$E(),w=Pa(),I=ep(),S=1,L=2,E=4,g="[object Arguments]",k="[object Array]",v="[object Boolean]",q="[object Date]",$="[object Error]",ee="[object Function]",de="[object GeneratorFunction]",Te="[object Map]",se="[object Number]",Ie="[object Object]",Pe="[object RegExp]",He="[object Set]",Ve="[object String]",te="[object Symbol]",Se="[object WeakMap]",ze="[object ArrayBuffer]",Ce="[object DataView]",Ee="[object Float32Array]",X="[object Float64Array]",Y="[object Int8Array]",C="[object Int16Array]",P="[object Int32Array]",V="[object Uint8Array]",M="[object Uint8ClampedArray]",oe="[object Uint16Array]",U="[object Uint32Array]",z={};z[g]=z[k]=z[ze]=z[Ce]=z[v]=z[q]=z[Ee]=z[X]=z[Y]=z[C]=z[P]=z[Te]=z[se]=z[Ie]=z[Pe]=z[He]=z[Ve]=z[te]=z[V]=z[M]=z[oe]=z[U]=!0,z[$]=z[ee]=z[Se]=!1;function x(F,H,ce,Ue,Je,Be){var pe,et=H&S,ht=H&L,Rt=H&E;if(ce&&(pe=Je?ce(F,Ue,Je,Be):ce(F)),pe!==void 0)return pe;if(!y(F))return F;var _t=h(F);if(_t){if(pe=f(F),!et)return o(F,pe)}else{var Re=d(F),tt=Re==ee||Re==de;if(b(F))return s(F,et);if(Re==Ie||Re==g||tt&&!Je){if(pe=ht||tt?{}:m(F),!et)return ht?l(F,a(pe,F)):i(F,n(pe,F))}else{if(!z[Re])return Je?F:{};pe=_(F,Re,et)}}Be||(Be=new e);var ge=Be.get(F);if(ge)return ge;Be.set(F,pe),A(F)?F.forEach(function(re){pe.add(x(re,H,ce,re,F,Be))}):T(F)&&F.forEach(function(re,ne){pe.set(ne,x(re,H,ce,ne,F,Be))});var ke=Rt?ht?p:u:ht?I:w,Ne=_t?void 0:ke(F);return t(Ne||F,function(re,ne){Ne&&(ne=re,re=F[ne]),r(pe,ne,x(re,H,ce,ne,F,Be))}),pe}return uu=x,uu}var cu,Hm;function gy(){if(Hm)return cu;Hm=1;function e(t,r,n){var a=-1,s=t.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(s);++a<s;)o[a]=t[a+r];return o}return cu=e,cu}var pu,zm;function VE(){if(zm)return pu;zm=1;var e=Es(),t=gy();function r(n,a){return a.length<2?n:e(n,t(a,0,-1))}return pu=r,pu}var du,jm;function BE(){if(jm)return du;jm=1;var e=Pn(),t=uy(),r=VE(),n=Cn(),a=Object.prototype,s=a.hasOwnProperty;function o(i,l){l=e(l,i);var u=-1,p=l.length;if(!p)return!0;for(;++u<p;){var d=n(l[u]);if(d==="__proto__"&&!s.call(i,"__proto__")||(d==="constructor"||d==="prototype")&&u<p-1)return!1}var f=r(i,l);return f==null||delete f[n(t(l))]}return du=o,du}var fu,Gm;function xE(){if(Gm)return fu;Gm=1;var e=vn(),t=tp(),r=nr(),n="[object Object]",a=Function.prototype,s=Object.prototype,o=a.toString,i=s.hasOwnProperty,l=o.call(Object);function u(p){if(!r(p)||e(p)!=n)return!1;var d=t(p);if(d===null)return!0;var f=i.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return fu=u,fu}var mu,Wm;function HE(){if(Wm)return mu;Wm=1;var e=xE();function t(r){return e(r)?void 0:r}return mu=t,mu}var hu,Ym;function zE(){if(Ym)return hu;Ym=1;var e=Zh();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return hu=t,hu}var _u,Km;function jE(){if(Km)return _u;Km=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return _u=e,_u}var yu,Xm;function Iy(){if(Xm)return yu;Xm=1;var e=jE(),t=Math.max;function r(n,a,s){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,i=-1,l=t(o.length-a,0),u=Array(l);++i<l;)u[i]=o[a+i];i=-1;for(var p=Array(a+1);++i<a;)p[i]=o[i];return p[a]=s(u),e(n,this,p)}}return yu=r,yu}var bu,Zm;function GE(){if(Zm)return bu;Zm=1;function e(t){return function(){return t}}return bu=e,bu}var Tu,Qm;function WE(){if(Qm)return Tu;Qm=1;var e=GE(),t=b_(),r=La(),n=t?function(a,s){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:r;return Tu=n,Tu}var gu,Jm;function YE(){if(Jm)return gu;Jm=1;var e=800,t=16,r=Date.now;function n(a){var s=0,o=0;return function(){var i=r(),l=t-(i-o);if(o=i,l>0){if(++s>=e)return arguments[0]}else s=0;return a.apply(void 0,arguments)}}return gu=n,gu}var Iu,eh;function Ey(){if(eh)return Iu;eh=1;var e=WE(),t=YE(),r=t(e);return Iu=r,Iu}var Eu,th;function KE(){if(th)return Eu;th=1;var e=zE(),t=Iy(),r=Ey();function n(a){return r(t(a,void 0,e),a+"")}return Eu=n,Eu}var wu,rh;function XE(){if(rh)return wu;rh=1;var e=va(),t=Ty(),r=BE(),n=Pn(),a=$a(),s=HE(),o=KE(),i=rp(),l=1,u=2,p=4,d=o(function(f,_){var m={};if(f==null)return m;var h=!1;_=e(_,function(T){return T=n(T,f),h||(h=T.length>1),T}),a(f,i(f),m),h&&(m=t(m,l|u|p,s));for(var b=_.length;b--;)r(m,_[b]);return m});return wu=d,wu}var ZE=XE();const QE=xe(ZE),rc="TOUCHED_PIPETTABLE_LABWARE";var Su,nh;function JE(){if(nh)return Su;nh=1;var e=wc();function t(r,n){return e(r,n)}return Su=t,Su}var ew=JE();const tw=xe(ew),Ds=e=>{const{node:t,stack:r=[],robotState:n,memo:a=new Map}=e;let s=r;if(!(typeof t=="object"&&"labwareId"in t))return s=[...r,t],a.set(t,s),{stack:s,memo:a};const{labwareId:o}=t,i=n.labware[o];if(i!=null&&i.stackedOnNode!=null){const{stack:l,memo:u}=Ds({node:i.stackedOnNode,stack:[...r,t],robotState:n,memo:a});wy(a,u),s=l,a.set(t,s)}return{stack:s,memo:a}},rw=e=>{const{node:t,robotState:r,deckDef:n,deckConfiguration:a}=e,{stack:s}=Ds({node:t,robotState:r}),{cutoutFixtures:o}=n,i=s.find(l=>typeof l=="object"&&"addressableAreaName"in l);if(i!=null&&typeof i=="object"&&"addressableAreaName"in i){const{addressableAreaName:l}=i;for(const{id:u,providesAddressableAreas:p}of o){const[d]=Object.entries(p).find(([f,_])=>_.includes(l))??[];if(d!=null){const f=a.find(({cutoutId:T})=>T===d),{cutoutFixtureId:_,cutoutId:m}=f,h=_===u&&m===d,b=Object.entries(r.modules).find(([T,{slot:y}])=>c.FLEX_CUTOUT_BY_SLOT_ID[y]===m);if(h&&b!=null)return b[0]}}}return null},wy=(e,t)=>{t.forEach((r,n)=>{e.set(n,r)})},nw=(e,t)=>e.some(r=>tw(r,t)),Sy=e=>{const{labwareId:t,robotState:r}=e,n=new Map,a={labwareId:t};let s=[];for(const[o,{stackedOnNode:i}]of Object.entries(r.labware)){const l={labwareId:o};if(i==null)continue;let u;const p=n.get(l);if(p!=null)u=p;else{const{stack:d,memo:f}=Ds({node:l,robotState:r,memo:n});if(wy(n,f),!nw(d,a))continue;n.set(l,d),u=d}u.length>s.length&&(s=u)}return s},Ay=e=>{const t=[],r=new Set;for(const n of Object.keys(e.labware)){if(r.has(n))continue;const a=Sy({labwareId:n,robotState:e});a.forEach(s=>{typeof s=="object"&&"labwareId"in s&&r.add(s.labwareId)}),t.push(a)}return t},ap=e=>{const{moduleId:t,robotState:r,moduleEntities:n,deckDef:a}=e,s=r.modules[t],o=n[t];if(s==null||o==null)return null;const{slot:i}=s,{model:l}=o,u=c.getAddressableAreaNamesFromLoadedModule(l,i,a);return u.length===0?null:u[0]},aw=e=>{const{location:t,robotState:r,moduleEntities:n,deckDef:a}=e;if(t==="offDeck"||t==="systemLocation"||t==="wasteChuteLocation")return null;if("slotName"in t)return t.slotName;if("addressableAreaName"in t)return t.addressableAreaName;if("moduleId"in t){const{moduleId:s}=t;return ap({moduleId:s,robotState:r,moduleEntities:n,deckDef:a})}return null},Ly=e=>{const{deckConfiguration:t,deckDefinition:r}=e;return t.reduce((n,{cutoutFixtureId:a,cutoutId:s})=>((r.cutoutFixtures.find(({id:i})=>a===i)?.providesAddressableAreas[s]??[]).forEach(i=>{n.add(i)}),n),new Set)},sw=e=>{const{robotState:t,deckConfiguration:r,deckDefinition:n,moduleEntities:a}=e,s=Ly({deckConfiguration:r,deckDefinition:n}),o=new Set(s),i=Ay(t);for(const l of i){const u=Yc(l);if(typeof u=="object"&&"addressableAreaName"in u){const{addressableAreaName:p}=u;o.delete(p)}if(typeof u=="object"&&"slotName"in u){const{slotName:p}=u;o.delete(p)}if(typeof u=="object"&&"moduleId"in u){const{moduleId:p}=u,d=ap({moduleId:p,robotState:t,moduleEntities:a,deckDef:n});d!=null&&o.delete(d)}}return o},ow=e=>{const t=e.toLowerCase();return t.includes("chute")||t.includes("waste")||t.startsWith("gripper")||t==="96channelwastechute"},Oy=e=>{const{stack:t,subjectLabwareId:r,moduleEntities:n,labwareEntityIds:a,modules:s}=e;if(t.length===0||t[0]!==r||t.length<2)return;const o=t[1];if(o===Ze){const u=t[2];return u==null?void 0:{kind:"inStackerHopper",moduleId:u}}if(n[o]!=null)return{moduleId:o};if(a.has(o))return{labwareId:o};if(o==="offDeck")return"offDeck";if(o==="systemLocation")return"systemLocation";if(o==="wasteChuteLocation")return"wasteChuteLocation";if(ow(o))return{addressableAreaName:o};const i=ay(o,s,n)??o;if(Object.entries(s).some(([u,p])=>n[u]?.type===c.FLEX_STACKER_MODULE_TYPE&&p.slot===i)){const u=Rs(i);if(u!=null)return{addressableAreaName:u}}return{slotName:o}},iw=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="inStackerHopper",lw=e=>typeof e!="object"||e===null?!1:!iw(e),uw=(e,t)=>{const{id:r,def:n}=e,{id:a,def:s}=t,o=n.dimensions.xDimension,i=n.dimensions.yDimension,l=s.dimensions.xDimension,u=s.dimensions.yDimension;return o>l&&i>u?{containerLabwareId:r,containedLabwareId:a}:l>o&&u>i?{containerLabwareId:a,containedLabwareId:r}:null},sp=(e,t)=>{const r=new Map;for(const a of Object.keys(e)){const s=e[a].stackedOnNode;if(s==null||!lw(s))continue;const o=JSON.stringify(s),i=r.get(o)??[];i.push(a),r.set(o,i)}const n={};for(const a of r.values()){if(a.length!==2)continue;const[s,o]=a,i=t[s],l=t[o];if(i==null||l==null)continue;const u=uw(i,l);if(u==null)continue;const{containerLabwareId:p,containedLabwareId:d}=u;n[p]=d}return Object.keys(n).length===0?e:rr(e,(a,s)=>n[s]!=null?{...a,contains:n[s]}:a)},cw=(e,t,r)=>{const n=Object.keys(e.labware),a=new Set(n);let s=rr(e.labware,(o,i)=>{const l=o.stackedOnNode??Oy({stack:o.stack,subjectLabwareId:i,moduleEntities:t,labwareEntityIds:a,modules:e.modules});return l!=null?{...o,stackedOnNode:l}:{...o}});return s=sp(s,r),{...e,labware:s}};function pw(e,t,r){const{labwareId:n,newLocation:a}=e,{robotState:s}=r,{labwareEntities:o}=t,{modules:i,labware:l}=s;if(l[n]==null)return;const u=W(l[n].stack),p=ks(l,u,n),d=p.indexOf(n),f=p.slice(0,d+1),_=c.getIsLid(o[n].def);let m=!1;const h=Object.entries(i).find(([E,{slot:g}])=>{const{type:k}=t.moduleEntities[E]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&g===u})??null,b=h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE?Jt.map(E=>h[1].moduleState.labwareOnShuttle?.[E]).filter(E=>E!=null):[],T=b.includes(n)?b.slice(0,b.indexOf(n)+1):[];if(h!=null&&h[1].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const E=h[1].moduleState,g=Jt.findIndex(k=>E.labwareOnShuttle?.[k]===n);if(g!==-1&&E.labwareOnShuttle!=null)for(const k of Jt.slice(g,Jt.length))if(k==="primaryLabwareId"){E.labwareOnShuttle=null;break}else E.labwareOnShuttle[k]=null}const y=Object.entries(i).find(([E,{slot:g}])=>{const{type:k}=t.moduleEntities[E]??{};return k===c.FLEX_STACKER_MODULE_TYPE&&typeof a=="object"&&("moduleId"in a&&a.moduleId===E||"slotName"in a&&g===a.slotName)})??null,[A,w]=y??[];if(A!=null&&w!=null){const E=T.length>0?T:fa({slot:u,labwareState:l,modulesState:i}),g=E.indexOf(n),k=w.moduleState;if(g!==-1){const v=E.slice(0,g+1).toReversed();if(k.labwareOnShuttle==null&&(k.labwareOnShuttle={primaryLabwareId:"",adapterLabwareId:null,lidLabwareId:null}),v.length===3)for(let q=0;q<Jt.length;q++){const $=Jt[q];k.labwareOnShuttle[$]=v[q]}else if(v.length===2){const q=v.some($=>t.labwareEntities[$].def.allowedRoles?.some(ee=>ee==="lid"))?["primaryLabwareId","lidLabwareId"]:["adapterLabwareId","primaryLabwareId"];for(let $=0;$<q.length;$++){const ee=q[$];k.labwareOnShuttle[ee]=v[$]}}else v.length===1&&(k.labwareOnShuttle.primaryLabwareId=v[0])}}const I=[];if(c.locationIsOffDeck(a))I.push(a);else if("moduleId"in a)if(i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE)I.push(i[a.moduleId].slot);else if(t.moduleEntities[a.moduleId]?.type===c.VACUUM_MODULE_TYPE){const E=i[a.moduleId].slot,g=fa({slot:E,labwareState:l,modulesState:i});g.length>0?I.push(...g):I.push(a.moduleId,E)}else I.push(a.moduleId,i[a.moduleId].slot);else if("slotName"in a){const{slotName:E}=a;E in l?(m=c.getIsPipettableLabware(o[E].def),I.push(...l[E].stack)):I.push(E)}else if("labwareId"in a){const E=a.labwareId;m=c.getIsPipettableLabware(o[E].def);const g=l[E].stack;I.push(...g)}else if("addressableAreaName"in a)if(ma(a.addressableAreaName)){const E=Object.entries(i).find(([g])=>t.moduleEntities[g]?.type===c.VACUUM_MODULE_TYPE)?.[0];I.push(pc),E!=null&&I.push(E),I.push(a.addressableAreaName)}else I.push(a.addressableAreaName);f.forEach((E,g)=>{if(l[E]!=null){const k=f.slice(g+1);s.labware[E]={...s.labware[E],stack:[E,...k,...I],..._&&m?{sterility:rc}:{}}}});const S=typeof a=="object"&&"labwareId"in a&&c.getIsPipettableLabware(o[a.labwareId].def);let L=a;if(typeof a=="object"&&a!==null&&"moduleId"in a&&i[a.moduleId].moduleState.type===c.FLEX_STACKER_MODULE_TYPE){const E=Rs(i[a.moduleId].slot);E!=null&&(L={addressableAreaName:E})}else if(typeof a=="object"&&a!==null&&"moduleId"in a&&t.moduleEntities[a.moduleId]?.type===c.VACUUM_MODULE_TYPE){const E=i[a.moduleId].slot,g=fa({slot:E,labwareState:l,modulesState:i}),k=g.length>0?g[0]:null;k!=null&&k in o&&(L={labwareId:k})}s.labware[n].stackedOnNode=L,S&&(s.labware[n].sterility=rc),s.labware=sp(rr(s.labware,E=>QE(E,"contains")),o)}function dw(e,t,r){const{pipetteId:n,addressableAreaName:a}=e,{wasteChuteEntities:s,trashBinEntities:o}=t,i=c.WASTE_CHUTE_ADDRESSABLE_AREAS.includes(a),l=Object.values(o).find(d=>d.location===Y_(a))?.id,u=i?Object.values(s)[0].id:l,{robotState:p}=r;p.pipettes[n]={...p.pipettes[n],entityId:u}}function fw(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,{robotState:o}=r;o.pipettes[n]={...o.pipettes[n],entityId:a,wellName:s}}function mw(e,t,r){const{pipetteId:n,labwareId:a,wellName:s}=e,o=t.pipetteEntities[n].spec,i=t.labwareEntities[a].def;if(!c.getIsTiprack(i))throw new Error(`forPickUpTip expected ${a} to be a tiprack`);const l=r.robotState.tipState,u=r.robotState.pipettes[n].nozzles,p=r.robotState.pipettes[n].primaryNozzle,d=lp(u,o),f=(h,b)=>h.find(T=>T.includes(b)),_=(h,b)=>{const T=h.findIndex(A=>A.includes(b));if(T===-1)return null;const y=h[T].indexOf(b);return h.map(A=>A[y])},m=(h,b)=>{const T=c.PARTIAL_NOZZLE_MAP[p],y=h.findIndex(L=>L.includes(b)),A=h[y].indexOf(b),w=h[y];if(w.length-A<T){const L=w.length-T;return w.slice(L,w.length)}const S=A+T;return w.slice(A,Math.min(S,w.length))};if(l.pipettes[n].hasTip=!0,l.pipettes[n].tiprackURI=a,d===c.SINGLE)l.tipracks[a][s]=ue;else if(d===c.PARTIAL_COLUMN&&p){const h=m(i.ordering,s);h==null?console.error(`Invalid primary well for tip pick up for partial config: ${s}`):h.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.COLUMN){const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.ROW){const h=_(i.ordering,s);h==null&&console.error("Invalid primary well for tip pickup: "+s),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(d===c.ALL)if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=ue});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}else if(o.channels===1)l.tipracks[a][s]=ue;else if(o.channels===96)i.ordering.reduce((b,T)=>b.concat(T),[]).forEach(function(b){l.tipracks[a][b]=ue});else{const h=f(i.ordering,s);h==null&&console.error(`Invalid primary well for tip pickup: ${s}`),h?.forEach(function(b){l.tipracks[a][b]=ue})}r.robotState.pipettes[n].tiprackId=a,r.robotState.pipettes[n].tipWell=s}const hw={clean:Ra,empty:ue,used:Qt};function _w(e,t,r){const{labwareId:n,wellNames:a,tipWellState:s="clean"}=e,o=hw[s],i=r.robotState.tipState.tipracks[n];i!=null&&a.forEach(l=>{i[l]=o})}const jr=(e,t)=>{const r=Ot(e,t);return r.type===c.THERMOCYCLER_MODULE_TYPE?r:(console.error(`Thermocycler state updater expected ${t} moduleState to be thermocycler, but it was ${r.type}`),{})},yw=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.currentBlockActivity={type:"blockTargetTemp",blockTargetTemp:a}},bw=(e,t,r)=>{const{moduleId:n,celsius:a}=e,{robotState:s}=r,o=jr(s,n);o.lidTargetTemp=a},Tw=(e,t,r)=>{},gw=(e,t,r)=>{},Iw=(e,t,r)=>{},Ew=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.currentBlockActivity={type:"blockDeactivated"}},ww=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidTargetTemp=null},Sw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!1},Aw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=jr(a,n);s.lidOpen=!0},Lw=(e,t,r)=>{const{profile:n,...a}=e;Ry({profileElements:n,...a},t,r)},Ry=(e,t,r)=>{const n=NaN+D();ky({...e,taskId:n},t,r),vy(n,r,c.THERMOCYCLER_MODULE_TYPE)},ky=(e,t,r)=>{const{moduleId:n,taskId:a,profileElements:s}=e,{robotState:o}=r,i=jr(o,n);i.currentBlockActivity={type:"profile",profileElements:s,taskId:a??null},i.numProfilesStarted++},Ow=e=>{if(e.currentBlockActivity.type==="profile"){const t=Rw(e.currentBlockActivity.profileElements);return e.currentBlockActivity=t!=null?{type:"blockTargetTemp",blockTargetTemp:t}:{type:"blockDeactivated"},!0}else return!1};function Rw(e){const t=Yc(pp(e));return t!=null?t.celsius:null}const kw=(e,t)=>{const[r,n]=[e.ordering,t.ordering];if(r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const[s,o]=[r[a],n[a]];if(s.length!==o.length)return!1}return!0},op=(e,t,r)=>{const{labware:n,liquidState:a}=t,o=ks(n,e).filter(i=>i in r&&c.getIsPipettableLabware(r[i].def));if(o.length===1){const i=a.labware[o[0]];Object.entries(i).forEach(([l,u])=>{i[l]={}});return}if(o.length===2){const i=o[0],l=o[1];if(!kw(r[i].def,r[l].def))return;const u=a.labware[i],p=a.labware[l];Object.entries(p).forEach(([d,f])=>{const _=u[d];Object.entries(_).forEach(([m,{volume:h}])=>{f[m]={volume:m in f?f[m].volume+h:h}}),u[d]={}})}},vw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=it(a,n);s!=null&&(s.ventStatus=dc)},Pw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=it(a,n);s!=null&&(s.ventStatus=ka)},Cw=(e,t,r)=>{const{moduleId:n,gaugePressure:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,{labwareEntities:u}=t,p=it(l,n);p!=null&&(op(n,l,u),s==null||i==null?p.currentPumpActivity={type:"indefiniteHold",mode:ju,targetPressure:a}:(p.currentPumpActivity={type:"timedHold",mode:ju,targetPressure:a,durationSeconds:s,taskId:i,ventAfter:o},p.numPumpActivitiesStarted++),p.ventStatus=ka)},Nw=(e,t,r)=>{const{moduleId:n,percentPower:a,duration:s,ventAfter:o=!0,taskId:i}=e,{robotState:l}=r,{labwareEntities:u}=t,p=it(l,n);p!=null&&(op(n,l,u),s==null||i==null?p.currentPumpActivity={type:"indefiniteHold",mode:zu,targetPower:a}:(p.currentPumpActivity={type:"timedHold",mode:zu,targetPower:a,durationSeconds:s,taskId:i,ventAfter:o},p.numPumpActivitiesStarted++),p.ventStatus=ka)},Dw=(e,t,r)=>{const{moduleId:n}=e,{robotState:a}=r,s=it(a,n);s!=null&&(s.currentPumpActivity={type:"pumpDeactivated"})},Mw=(e,t,r)=>{const{moduleId:n,steps:a,taskId:s,ventAfter:o=!0}=e,{robotState:i}=r,{labwareEntities:l}=t,u=it(i,n);u==null||s==null||(op(n,i,l),u.currentPumpActivity={type:"profile",profileElements:a,taskId:s,ventAfter:o},u.numPumpActivitiesStarted++)},Fw=e=>{if(e.currentPumpActivity.type==="timedHold"||e.currentPumpActivity.type==="profile"){const t=e.currentPumpActivity.ventAfter;return e.currentPumpActivity={type:"pumpDeactivated"},e.ventStatus=t?dc:ka,!0}return!1};function Uw(e,t,r){for(const n of e.task_ids)vy(n,r)||r.warnings.push(iI())}const vy=(e,t,r)=>{const{robotState:n}=t,a=Object.values(n.modules).find(s=>{if(r&&s.moduleState.type!==r)return!1;const o=s.moduleState.type==="thermocyclerModuleType"&&s.moduleState.currentBlockActivity.type==="profile"&&s.moduleState.currentBlockActivity.taskId===e,i=s.moduleState.type==="vacuumModuleType"&&(s.moduleState.currentPumpActivity.type==="timedHold"||s.moduleState.currentPumpActivity.type==="profile")&&s.moduleState.currentPumpActivity.taskId===e;return o||i});return a==null?!1:a.moduleState.type==="thermocyclerModuleType"?Ow(a.moduleState):a.moduleState.type==="vacuumModuleType"?Fw(a.moduleState):(console.log(`unexpected module type with task: ${a.moduleState.type}`),!1)},Un=(e,t)=>{const r=Ot(e,t);return r.type===c.HEATERSHAKER_MODULE_TYPE?r:(console.error(`Heater-Shaker state updater expected ${t} moduleState to be heaterShaker, but it was ${r.type}`),{})},qw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Un(n,a);o.targetTemp=s},$w=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.targetTemp=null},Vw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,rpm:s}=e,o=Un(n,a);o.targetSpeed=s},Bw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.targetSpeed=null},xw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.latchOpen=!0},Hw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Un(n,a);s.latchOpen=!1},zw=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";Ns({invariantContext:t,pipetteId:n,prevLiquidState:a.liquidState,useFullVolume:!0,robotStateAndWarnings:r,entityId:s})},jw=(e,t,r)=>{const{pipetteId:n}=e,{robotState:a}=r,s=a.pipettes[n].entityId??"";a.tipState.pipettes[n]={hasTip:!1,tiprackURI:null},Ns({invariantContext:t,prevLiquidState:a.liquidState,pipetteId:n,useFullVolume:!0,robotStateAndWarnings:r,entityId:s}),a.pipettes[n].tiprackId=void 0};function Py(e,t){e.type===c.MAGNETIC_MODULE_TYPE&&(e.engaged=t)}function Gw(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=Ot(a,n);Py(s,!0)}function Ww(e,t,r){const{moduleId:n}=e,{robotState:a}=r,s=Ot(a,n);Py(s,!1)}const Au=(e,t)=>{if(t==null)return console.error("expected to find defURI but could not in getLabwareByDefURI"),null;const r=e.findIndex(a=>a.labwareDefURI===t);if(r===-1)return null;const[n]=e.splice(r,1);return n.id},Cy=(e,t,r,n)=>{const a=e.labwareInHopper??[];t.forEach(s=>{const{primaryLabwareId:o,adapterLabwareId:i,lidLabwareId:l}=s;r.labware[o]={stack:[o,...l!=null?[l]:[],...n]},i!=null&&(r.labware[i]={stack:[i,o,...l!=null?[l]:[],...n]}),l!=null&&(r.labware[l]={stack:[l,...n]}),a.push({primaryLabwareId:o,adapterLabwareId:i??null,lidLabwareId:l??null})}),e.labwareInHopper=a},Ny=(e,t,r,n,a,s,o,i)=>{const u=Object.entries(e.labware).filter(([d,f])=>f[s]===t[s]).map(([d])=>d).map(d=>r[d]),p=[];for(let d=0;d<n;d++){const f=Au(u,t.storedLabwareDetails?.primaryLabwareURI),_=o!=null?Au(u,t.storedLabwareDetails?.adapterLabwareURI):null,m=i!=null?Au(u,t.storedLabwareDetails?.lidLabwareURI):null;f!=null&&(e.labware[f]={stack:[f,...m!=null?[m]:[],...a]},_!=null&&(e.labware[_]={stack:[_,f,...m!=null?[m]:[],...a]}),m!=null&&(e.labware[m]={stack:[m,...a]}),p.push({primaryLabwareId:f,adapterLabwareId:_,lidLabwareId:m})),t.labwareInHopper=p}},Yw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=Object.entries(n.labware).filter(([,i])=>i.stack.includes(Ze)&&i.stack.includes(a)),o=mt(n,a);o!=null&&o.labwareInHopper!=null&&(e.count!=null?o.labwareInHopper=o.labwareInHopper.slice(0,e.count):o.labwareInHopper=[]),s.forEach(([i])=>{n.labware[i]={...n.labware[i],stack:[i,c.SYSTEM_LOCATION]}})},Kw=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,labware:o}=e,i=n.modules[s].slot,l=mt(n,s);if(l==null||l.storedLabwareDetails==null)return;const{primaryLabwareURI:u,adapterLabwareURI:p,lidLabwareURI:d}=l.storedLabwareDetails,f=[];for(const b of o){const T=a[b].labwareDefURI;if(T===u)f.push({primaryLabwareId:b,adapterLabwareId:null,lidLabwareId:null});else if(T===p){const y=f[f.length-1];y&&(y.adapterLabwareId=b)}else if(T===d){const y=f[f.length-1];y&&(y.lidLabwareId=b)}}const _=[Ze,s,i];for(const b of f){const T=[b.adapterLabwareId,b.primaryLabwareId,b.lidLabwareId,..._].filter(A=>A!=null);n.labware[b.primaryLabwareId]={...n.labware[b.primaryLabwareId],stack:T.slice(T.indexOf(b.primaryLabwareId))},b.adapterLabwareId!=null&&(n.labware[b.adapterLabwareId]={...n.labware[b.adapterLabwareId],stack:T.slice(T.indexOf(b.adapterLabwareId))}),b.lidLabwareId!=null&&(n.labware[b.lidLabwareId]={...n.labware[b.lidLabwareId],stack:T.slice(T.indexOf(b.lidLabwareId))});let y=null;for(const A of T)a[A]!=null&&(y==null?n.labware[A].stackedOnNode={kind:"inStackerHopper",moduleId:s}:n.labware[A].stackedOnNode={labwareId:y},y=A)}const m=l.labwareInHopper??[],h=f.map(({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y})=>({primaryLabwareId:b,adapterLabwareId:T,lidLabwareId:y}));l.labwareInHopper=[...m,...h]},Xw=(e,t,r)=>{const{robotState:n}=r,{labwareEntities:a}=t,{moduleId:s,primaryLabware:o,initialCount:i,adapterLabware:l,lidLabware:u,initialStoredLabware:p}=e,d=n.modules[s].slot,f=mt(n,s),_=[Ze,s,d];f!=null&&(f.storedLabwareDetails={primaryLabwareURI:`${o.namespace}/${o.loadName}/${o.version}`,adapterLabwareURI:l!=null?`${l.namespace}/${l.loadName}/${l.version}`:null,lidLabwareURI:u!=null?`${u.namespace}/${u.loadName}/${u.version}`:null},i!=null?Ny(n,f,a,i,_,"setStoredLabwareCount",l?.loadName,u?.loadName):p!=null&&Cy(f,p,n,_),f.setStoredLabwareCount=(f?.setStoredLabwareCount??0)+1)},Zw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,labware:s}=e,{labwareEntities:o}=t,i=n.modules[a].slot,l=mt(n,a);if(l==null)return;const u=s.map(I=>I.split(":")[1]),p=new Set(u),d=Array.from(p),f=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&!S.def.allowedRoles?.includes("lid")&&!S.def.allowedRoles?.includes("adapter"))),_=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&S.def.allowedRoles?.includes("adapter"))),m=d.find(I=>Object.values(o).find(S=>S.labwareDefURI===I&&S.def.allowedRoles?.includes("lid")));if(f==null)throw new Error(`expected to find primaryLabwareURI for storedLabwareDetails but could not with labware ${s}`);l.storedLabwareDetails={primaryLabwareURI:f,adapterLabwareURI:_??null,lidLabwareURI:m??null};const h=[];for(const I of s){const S=o[I].labwareDefURI;if(S===f)h.push({primary:I,adapter:null,lid:null});else if(S===_){const L=h[h.length-1];L&&(L.adapter=I)}else if(S===m){const L=h[h.length-1];L&&(L.lid=I)}}const b=[Ze,a,i];for(const I of h){const S=[I.adapter,I.primary,I.lid,...b].filter(L=>L!=null);n.labware[I.primary]={...n.labware[I.primary],stack:S.slice(S.indexOf(I.primary))},I.adapter!=null&&(n.labware[I.adapter]={...n.labware[I.adapter],stack:S.slice(S.indexOf(I.adapter))}),I.lid!=null&&(n.labware[I.lid]={...n.labware[I.lid],stack:S.slice(S.indexOf(I.lid))})}const T=l.labwareInHopper??[],y=h.map(I=>({primaryLabwareId:I.primary,adapterLabwareId:I.adapter,lidLabwareId:I.lid})),A=new Map(T.map(I=>[I.primaryLabwareId,I])),w=[];for(const I of y)w.push(I),A.delete(I.primaryLabwareId);for(const I of T)A.has(I.primaryLabwareId)&&w.push(I);l.labwareInHopper=w},Qw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a,count:s,labwareToStore:o}=e,{labwareEntities:i}=t,l=n.modules[a].slot,u=mt(n,a),p=[Ze,a,l];if(u!=null){const d=u.storedLabwareDetails?.adapterLabwareURI,f=u.storedLabwareDetails?.lidLabwareURI;s!=null?Ny(n,u,i,s,p,"fillCount",d,f):o!=null&&Cy(u,o,n,p),u.fillCount=(u?.fillCount??0)+1}},Jw=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=mt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareInHopper:i,labwareOnShuttle:l}=s;if(i!=null&&i.length>0&&l==null){const u=i[0];s.labwareOnShuttle=u,i.shift();const p=[o];let d=null;for(const f of Jt){const _=u[f];if(_!=null){if(p.unshift(_),n.labware[_].stack=[...p],d==null){const m=Rs(o);m!=null?n.labware[_].stackedOnNode={addressableAreaName:m}:console.warn(`Could not find an addressable area for retrieved labware in stacker module ${a} at slot ${o}`)}else n.labware[_].stackedOnNode={labwareId:d};d=_}}}}},eS=(e,t,r)=>{const{robotState:n}=r,{moduleId:a}=e,s=mt(n,a),o=n.modules[a].slot;if(s!=null){const{labwareOnShuttle:i}=s;if(i!=null){s.labwareInHopper=[i,...s.labwareInHopper??[]],s.labwareOnShuttle=null;let l=null;for(const u of Jt){const p=i[u];p!=null&&(n.labware[p].stack=[p,Ze,a,o],l==null?(n.labware[p].stackedOnNode={kind:"inStackerHopper",moduleId:a},l=p):n.labware[p].stackedOnNode={labwareId:l})}s.storedLabwareDetails==null&&(s.storedLabwareDetails={primaryLabwareURI:t.labwareEntities[i.primaryLabwareId].labwareDefURI,adapterLabwareURI:i.adapterLabwareId!=null?t.labwareEntities[i.adapterLabwareId].labwareDefURI:null,lidLabwareURI:i.lidLabwareId!=null?t.labwareEntities[i.lidLabwareId].labwareDefURI:null})}}};function Dy(e,t,r){e.type===c.TEMPERATURE_MODULE_TYPE&&(e.targetTemperature=t,e.status=r)}function tS(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Ot(n,a);Dy(o,s,uc)}function rS(e,t,r){const{robotState:n}=r,{moduleId:a,celsius:s}=e,o=Ot(n,a);o.type===c.TEMPERATURE_MODULE_TYPE&&s===o.targetTemperature&&(o.status=lc)}function nS(e,t,r){const{robotState:n}=r,{moduleId:a}=e,s=Ot(n,a);Dy(s,null,Oa)}function My(e,t,r){if(!e)throw new Error("undefined command passed to getNextRobotStateAndWarning");switch(e.commandType){case"aspirateWhileTracking":case"aspirate":case"aspirateInPlace":if(e.meta?.isAirGap===!0)break;fE(e.params,t,r);break;case"airGapInPlace":QI(e.params,t,r);break;case"dispenseWhileTracking":case"dispense":case"dispenseInPlace":if(e.meta?.isAirGap===!0)break;_E(e.params,t,r);break;case"blowout":mE(e.params,t,r);break;case"dropTip":yE(e.params,t,r);break;case"pickUpTip":mw(e.params,t,r);break;case"setTipState":_w(e.params,t,r);break;case"magneticModule/engage":Gw(e.params,t,r);break;case"magneticModule/disengage":Ww(e.params,t,r);break;case"moveLabware":pw(e.params,t,r);break;case"waitForTasks":Uw(e.params,t,r);break;case"flexStacker/setStoredLabware":Xw(e.params,t,r);break;case"flexStacker/setStoredLabwareItems":Zw(e.params,t,r);break;case"flexStacker/prepareShuttle":case"flexStacker/closeLatch":case"flexStacker/openLatch":break;case"flexStacker/empty":Yw(e.params,t,r);break;case"flexStacker/fill":Qw(e.params,t,r);break;case"flexStacker/fillItems":Kw(e.params,t,r);break;case"flexStacker/retrieve":Jw(e.params,t,r);break;case"flexStacker/store":eS(e.params,t,r);break;case"setRailLights":case"touchTip":case"configureForVolume":case"loadPipette":case"loadLabware":case"loadModule":case"home":case"moveRelative":case"moveToSlot":case"moveToCoordinates":case"savePosition":case"waitForResume":case"waitForDuration":case"pause":case"delay":case"custom":case"comment":case"captureImage":case"prepareToAspirate":case"liquidProbe":case"loadLiquidClass":case"loadLidStack":case"loadLid":case"getTipPresence":case"identifyModule":case"getNextTip":case"retractAxis":case"sealPipetteToTip":case"tryLiquidProbe":case"unsealPipetteFromTip":case"verifyTipPresence":case"pressureDispense":case"createTimer":break;case"moveToAddressableArea":case"moveToAddressableAreaForDropTip":dw(e.params,t,r);break;case"moveToWell":fw(e.params,t,r);break;case"loadLiquid":bE(e.params,t,r);break;case"dropTipInPlace":jw(e.params,t,r);break;case"blowOutInPlace":zw(e.params,t,r);break;case"configureNozzleLayout":hE(e.params,t,r);break;case"temperatureModule/setTargetTemperature":tS(e.params,t,r);break;case"temperatureModule/deactivate":nS(e.params,t,r);break;case"temperatureModule/waitForTemperature":rS(e.params,t,r);break;case"thermocycler/setTargetBlockTemperature":yw(e.params,t,r);break;case"thermocycler/setTargetLidTemperature":bw(e.params,t,r);break;case"thermocycler/waitForBlockTemperature":Tw(e.params);break;case"thermocycler/waitForLidTemperature":gw(e.params);break;case"thermocycler/deactivateBlock":Ew(e.params,t,r);break;case"thermocycler/deactivateLid":ww(e.params,t,r);break;case"thermocycler/closeLid":Sw(e.params,t,r);break;case"thermocycler/openLid":Aw(e.params,t,r);break;case"thermocycler/runProfile":Lw(e.params,t,r);break;case"thermocycler/runExtendedProfile":Ry(e.params,t,r);break;case"thermocycler/startRunExtendedProfile":ky(e.params,t,r);break;case"thermocycler/awaitProfileComplete":Iw(e.params);break;case"heaterShaker/deactivateHeater":$w(e.params,t,r);break;case"heaterShaker/setTargetTemperature":qw(e.params,t,r);break;case"heaterShaker/setAndWaitForShakeSpeed":case"heaterShaker/setShakeSpeed":Vw(e.params,t,r);break;case"heaterShaker/deactivateShaker":Bw(e.params,t,r);break;case"heaterShaker/openLabwareLatch":xw(e.params,t,r);break;case"heaterShaker/closeLabwareLatch":Hw(e.params,t,r);break;case"heaterShaker/waitForTemperature":break;case"absorbanceReader/openLid":KI(e.params,t,r);break;case"absorbanceReader/closeLid":XI(e.params,t,r);break;case"absorbanceReader/initialize":ZI(e.params,t,r);break;case"absorbanceReader/read":break;case"vacuumModule/startSetVacuumPressure":Cw(e.params,t,r);break;case"vacuumModule/startSetVacuumPower":Nw(e.params,t,r);break;case"vacuumModule/openVent":vw(e.params,t,r);break;case"vacuumModule/closeVent":Pw(e.params,t,r);break;case"vacuumModule/stopVacuum":Dw(e.params,t,r);break;case"vacuumModule/startRunProfile":Mw(e.params,t,r);break;default:console.error(`unknown command: ${e.commandType} passed to getNextRobotStateAndWarning`)}}function Fy(e,t,r){return _y({warnings:[],robotState:r},a=>{My(e,t,a)})}function ip(e,t,r){const n=yy(e);return _y({warnings:[],robotState:r},s=>{n.forEach(o=>{My(o,t,s)})})}const aS=(e,t,r)=>{const n=e.reduce((a,s,o)=>{const i=a.timeline.length===0?r:Yc(a.timeline).robotState;if(a.errors!=null)return a;const l=s(t,i);if("errors"in l)return{timeline:a.timeline,errors:l.errors};const p=yy(l.commands).reduce((f,_)=>Fy(_,t,f.robotState),{robotState:i,warnings:[]}),d={commands:l.commands,robotState:p.robotState,warnings:l.warnings,stepInfo:{stepNumber:l.stepNumber,name:l.name,description:l.description},python:l.python};return{timeline:[...a.timeline,d],errors:null}},{timeline:[],errors:null});return{timeline:n.timeline,errors:n.errors}},qn=(e,t)=>{const r=t[e]?.stack;return r!=null?W(r):""},$n=e=>{if(e.type===c.VACUUM_MODULE_TYPE){const t=e;return t.currentPumpActivity.type==="timedHold"||t.currentPumpActivity.type==="profile"}if(e.type===c.THERMOCYCLER_MODULE_TYPE){const t=e;return t.currentBlockActivity.type==="profile"||t.currentBlockActivity.type==="blockTargetTemp"}return!1},Vn=e=>{const{pipette:t,labware:r,invariantContext:n,prevRobotState:a}=e;if(n.config.OT_PD_DISABLE_MODULE_RESTRICTIONS)return!1;const s=t?n.pipetteEntities[t]:null,o=r?W(a.labware[r]?.stack):null;if(!t||!r||!s||!o)return!1;const i=Object.keys(n.moduleEntities).some(l=>{const u=n.moduleEntities[l].model;if(Dh.includes(u)){const p=a.modules[l]?.slot;return p==="1"&&o==="4"||p==="3"&&o==="6"}else return!1});return c.GEN_ONE_MULTI_PIPETTES.includes(s.name)&&i},ae=(e,t,r)=>{const n=e.reduce((a,s)=>{if(a.errors.length>0)return a;const o=s(t,a.robotState);if("errors"in o)return{robotState:a.robotState,commands:a.commands,errors:o.errors,warnings:a.warnings};const i=[...a.commands,...o.commands],l=[...a.python?[a.python]:[],...o.python?[o.python]:[]].join(`
|
|
55
|
+
`),u=ip(o.commands,t,a.robotState);return{...a,robotState:u.robotState,commands:i,warnings:[...a.warnings||[],...o.warnings||[],...u.warnings],...l&&{python:l}}},{robotState:r,commands:[],errors:[],warnings:[]});return n.errors.length>0?{errors:n.errors}:{commands:n.commands,warnings:n.warnings,...n.python&&{python:n.python}}},Va=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n&&e[n].moduleState;return!!(a&&a.type===c.THERMOCYCLER_MODULE_TYPE&&a.lidOpen!==!0)},sS=e=>e.commandCreatorFnName!=="delay"&&e.commandCreatorFnName!=="engageMagnet"&&e.commandCreatorFnName!=="disengageMagnet"&&e.commandCreatorFnName!=="setTemperature"&&e.commandCreatorFnName!=="deactivateTemperature"&&"pipette"in e?e.pipette:null,oS=e=>e.commandCreatorFnName==="delay"||e.commandCreatorFnName==="engageMagnet"||e.commandCreatorFnName==="disengageMagnet"||e.commandCreatorFnName==="setTemperature"||e.commandCreatorFnName==="deactivateTemperature",iS=new Date("2025-03-19T00:00:00Z"),lS=2,uS=22;function cS(e,t,r){const{labware:n,modules:a,pipettes:s,commands:o,liquids:i}=e,l=t.protocolType==="python"?t.apiVersion:null,u=l!=null&&l[0]>=lS&&l[1]>=uS,p=t.protocolType==="json"&&r>=iS,d=c.getLabwareDefinitionsByURIForProtocol(o),f=i.reduce((y,A)=>{const{id:w,description:I,displayName:S,displayColor:L}=A;return{...y,[w]:{description:I,displayName:S??"Unknown Liquid",pythonName:"n/a",displayColor:L??"#B7B8B9",liquidGroupId:w}}},{}),_=a.reduce((y,A)=>{const{id:w,model:I}=A;return{...y,[w]:{id:w,type:c.getModuleType(I),model:I,pythonName:"n/a"}}},{}),m=n.reduce((y,A)=>{const{id:w,definitionUri:I}=A,S=d[I];return S==null||S.schemaVersion===3?y:{...y,[w]:{id:w,labwareDefURI:I,def:S,pythonName:"n/a"}}},{}),h=o.reduce((y,A)=>{if(A.commandType==="loadLidStack"&&A.result!=null){const{stackLabwareId:w,lidStackDefinition:I}=A.result;if(w!=null&&I!=null&&y[w]==null&&I.schemaVersion!==3)return{...y,[w]:{id:w,labwareDefURI:c.getLabwareDefURI(I),def:I,pythonName:"n/a"}}}return y},m),b=s.reduce((y,A)=>{const{id:w,pipetteName:I}=A,S=c.getPipetteSpecsV2(I),E=o.filter(v=>v.commandType==="pickUpTip"&&v.params.pipetteId===w).map(v=>h[v.params.labwareId]),g=Array.from(new Set(E.map(v=>v.labwareDefURI))),k=Array.from(new Set(E.map(v=>v.def)));return S==null||(y[w]={name:I,id:w,tiprackLabwareDef:k,tiprackDefURI:g,spec:S,pythonName:"n/a"}),y},{}),T=o.reduce((y,A)=>{if(A.commandType==="loadLidStack"&&A.result!=null){const{params:w}=A,I=Ku(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...I}}}else if((A.commandType==="loadLabware"||A.commandType==="loadLid")&&A.result!=null){const{params:w}=A,I=Ku(w);return{...y,stagingAreaEntities:{...y.stagingAreaEntities,...I}}}else if(A.commandType==="moveToAddressableArea"||A.commandType==="moveToAddressableAreaForDropTip"){const w=A.params.addressableAreaName,I=`${D()}:${w}`;let S=zh;w==="fixedTrash"?S="cutout12":w.includes("WasteChute")?S="cutoutD3":w.includes("movableTrash")&&(S=`cutout${w.split("movableTrash")[1]}`);let L=y.trashBinEntities;Object.values(y.trashBinEntities).some(g=>g.location===S)||(w.includes("movableTrash")?L={...y.trashBinEntities,[I]:{pythonName:"trash_bin_1",id:I,location:S}}:w==="fixedTrash"&&(L={...y.trashBinEntities,[I]:{pythonName:"trash_bin_1",id:I,location:S}}));let E=y.wasteChuteEntities;return w.includes("WasteChute")&&(E={[I]:{pythonName:"waste_chute",id:I,location:S}}),{...y,trashBinEntities:L,wasteChuteEntities:E}}return y},{wasteChuteEntities:{},trashBinEntities:{},stagingAreaEntities:{},runtimeParameters:{},gripperEntities:{},config:{OT_PD_DISABLE_MODULE_RESTRICTIONS:!0}});return{labwareEntities:h,pipetteEntities:b,moduleEntities:_,liquidEntities:u||p?f:{},...T}}const pS={A3:"A4",B3:"B4",C3:"C4",D3:"D4"};function dS(e,t){const r=e.reduce((o,i)=>i.commandType==="loadPipette"&&i.result!=null?{...o,[i.result.pipetteId]:{mount:i.params.mount}}:o,{}),n=e.reduce((o,i)=>{if(i.commandType==="loadModule"&&i.result!=null){const l=c.getModuleDef(i.params.model).moduleType;return{...o,[i.result.moduleId]:{slot:l===c.FLEX_STACKER_MODULE_TYPE?pS[i.params.location.slotName]:i.params.location.slotName,moduleState:Hh[l]}}}return o},{}),a=e.reduce((o,i)=>{if(i.commandType==="loadLidStack"&&i.result!=null){const{result:l}=i,u=l.locationSequences,p=l.labwareIds,d=l.stackLabwareId,f=l.stackLocationSequence,_=m=>{if(c.locationIsOffDeck(m))return[m];if("slotName"in m)return[m.slotName];if("moduleId"in m){const h=n[m.moduleId]?.slot??"offDeck";return[m.moduleId,h]}else if("addressableAreaName"in m)return[m.addressableAreaName];return["offDeck"]};if(u!=null){const m=u.reduce((T,y)=>{const A=y.find(w=>w.kind==="onLabware");return A!=null&&(T[A.labwareId]=y),T},{}),h=p.reduce((T,y,A)=>{const w=m[y]??u[A];if(w!=null){const I=Yu(w);T[y]={stack:I[0]===y?I:[y,...I]}}else{const I=i.params.location;c.locationIsOffDeck(I)?T[y]={stack:[y,I]}:"slotName"in I?T[y]={stack:[y,I.slotName]}:T[y]={stack:[y,"offDeck"]}}return T},{}),b=d!=null&&f!=null?[d,...Yu(f)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}else{const m=i.params.location,h=p.reduce((T,y)=>{if(c.locationIsOffDeck(m))T[y]={stack:[y,m]};else if("slotName"in m)T[y]={stack:[y,m.slotName]};else if("moduleId"in m){const A=m.moduleId;T[y]={stack:[y,A,n[A].slot]}}else T[y]={stack:[y,"offDeck"]};return T},{}),b=d!=null?[d,..._(m)]:null;return{...o,...h,...d!=null&&b!=null?{[d]:{stack:b}}:{}}}}else if((i.commandType==="loadLabware"||i.commandType==="loadLid")&&i.result!=null){const l=[i.result.labwareId];if(c.locationIsOffDeck(i.params.location))l.push(i.params.location);else if("slotName"in i.params.location)l.push(i.params.location.slotName);else if("moduleId"in i.params.location){const u=i.params.location.moduleId;if(n[u]==null)return console.warn(`Module ${u} not found when processing loadLabware/loadLid command. `),o;l.push(i.params.location.moduleId,n[i.params.location.moduleId].slot)}else if("labwareId"in i.params.location){const u=i.params.location.labwareId;o[u]==null&&(console.warn(`Parent labware ${u} not found when processing loadLabware/loadLid command. `),o[u]={stack:[u,"offDeck"]});const p=o[u].stack;l.push(u,...p)}else l.push(i.params.location.addressableAreaName);return{...o,[i.result.labwareId]:{stack:l}}}else{if(i.commandType==="flexStacker/setStoredLabware")return sh(i).forEach(u=>{ah(o,u,"setStoredLabwareCount")}),o;if(i.commandType==="flexStacker/fill")return sh(i).forEach(u=>{ah(o,u,"fillCount")}),o}return o},{}),s=Bc({invariantContext:t,labwareLocations:a,moduleLocations:n,pipetteLocations:r});return{frame:{...ip(e,t,s),command:e[e.length-1]},invariantContext:t}}const ah=(e,t,r)=>{const n=e[t]??{stack:[t,"offDeck"]};e[t]={...n,[r]:(n[r]??0)+1}},sh=e=>e.result?.storedLabware?.flatMap(r=>[r.primaryLabwareId,r.adapterLabwareId,r.lidLabwareId].filter(n=>n!=null))??[],lp=(e,t)=>e??(t.channels===1?c.SINGLE:t.channels===96?c.ALL:c.COLUMN);var Lu,oh;function fS(){if(oh)return Lu;oh=1;var e=Ac();function t(r,n){var a;return e(r,function(s,o,i){return a=n(s,o,i),!a}),!!a}return Lu=t,Lu}var Ou,ih;function mS(){if(ih)return Ou;ih=1;var e=t_(),t=Nn(),r=fS(),n=Qe(),a=Oc();function s(o,i,l){var u=n(o)?e:r;return l&&a(o,i,l)&&(i=void 0),u(o,t(i,3))}return Ou=s,Ou}var hS=mS();const Ba=xe(hS),Bn=(e,t)=>Ba(e,r=>r.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&r.moduleState.latchOpen!==!1&&c.getAreSlotsHorizontallyAdjacent(r.slot,t)),xn=(e,t,r)=>r.channels!==1&&Ba(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsHorizontallyAdjacent(n.slot,t)),xa=(e,t,r,n)=>r.channels!==1&&!n.def.parameters.isTiprack&&Ba(e,a=>a.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&c.getAreSlotsVerticallyAdjacent(a.slot,t)),Uy=(e,t,r)=>Ba(e,(a,s)=>c.getAreSlotsHorizontallyAdjacent(r,W(a.stack))&&c.getIsLabwareAboveHeight(t[s].def,c.MAX_LABWARE_HEIGHT_EAST_WEST_HEATER_SHAKER_MM)),Ha=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.latchOpen!==!1)},Hn=(e,t,r)=>Ba(e,n=>n.moduleState.type===c.HEATERSHAKER_MODULE_TYPE&&n.moduleState.targetSpeed!=null&&n.moduleState.targetSpeed>0&&(r===c.OT2_ROBOT_TYPE?c.getAreSlotsAdjacent(n.slot,t):c.getAreFlexSlotsAdjacent(n.slot,t))),za=(e,t,r)=>{const n=Fa(e,t[r]?.stack),a=n!=null?e[n].moduleState:null;return!!(a&&a.type===c.HEATERSHAKER_MODULE_TYPE&&a.targetSpeed!==null)},Ms=e=>{const{args:t,pipetteName:r,tiprackUri:n,liquidClassValuesForTip:a}=e;let s=null;"mixBeforeAspirate"in t?s=t.mixBeforeAspirate:"mixFirstAspirate"in t&&(s=t.mixFirstAspirate);const o=_S(t),i={dispense_position:{offset:{x:t.dispenseXOffset,y:t.dispenseYOffset,z:t.dispenseZOffset},position_reference:t.dispensePositionReference},flow_rate_by_volume:[[0,t.dispenseFlowRateUlSec??0]],delay:{enabled:!!t.dispenseDelay?.seconds,...t.dispenseDelay?.seconds?{duration:t.dispenseDelay?.seconds}:{}},submerge:{delay:{enabled:!!t.dispenseSubmergeDelay?.seconds,...t.dispenseSubmergeDelay?.seconds?{duration:t.dispenseSubmergeDelay?.seconds}:{}},speed:t.dispenseSubmergeSpeed??void 0,start_position:{offset:{x:t.dispenseSubmergeXOffset,y:t.dispenseSubmergeYOffset,z:t.dispenseSubmergeZOffset},position_reference:t.dispenseSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.dispenseAirGapVolume??0]],delay:{enabled:!!t.dispenseRetractDelay?.seconds,...t.dispenseRetractDelay?.seconds?{duration:t.dispenseRetractDelay?.seconds}:{}},end_position:{offset:{x:t.dispenseRetractXOffset,y:t.dispenseRetractYOffset,z:t.dispenseRetractZOffset},position_reference:t.dispenseRetractPositionReference},speed:t.dispenseRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterDispense,z_offset:t.touchTipAfterDispense?t.touchTipAfterDispenseOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterDispense&&t.touchTipAfterDispenseMmFromEdge!=null?t.touchTipAfterDispenseMmFromEdge:void 0,speed:t.touchTipAfterDispense?t.touchTipAfterDispenseSpeed:void 0},blowout:{enabled:t.blowoutLocation!=null,location:qy(t.blowoutLocation),flow_rate:t.blowoutLocation!=null?t.blowoutFlowRateUlSec:void 0,...o!=null?{blowout_position:o}:{}}}},l={[r]:{[n]:{aspirate:{aspirate_position:{offset:{x:t.aspirateXOffset,y:t.aspirateYOffset,z:t.aspirateZOffset},position_reference:t.aspiratePositionReference},flow_rate_by_volume:[[0,t.aspirateFlowRateUlSec]],pre_wet:t.preWetTip,correction_by_volume:a?.aspirate.correctionByVolume??[[0,0]],delay:{enabled:!!t.aspirateDelay?.seconds,...t.aspirateDelay?.seconds?{duration:t.aspirateDelay?.seconds}:{}},mix:{enabled:!!s?.volume,...s?.times?{repetitions:s.times}:{},...s?.volume?{volume:s.volume}:{}},submerge:{delay:{enabled:!!t.aspirateSubmergeDelay?.seconds,...t.aspirateSubmergeDelay?.seconds?{duration:t.aspirateSubmergeDelay?.seconds}:{}},speed:t.aspirateSubmergeSpeed??void 0,start_position:{offset:{x:t.aspirateSubmergeXOffset,y:t.aspirateSubmergeYOffset,z:t.aspirateSubmergeZOffset},position_reference:t.aspirateSubmergePositionReference}},retract:{air_gap_by_volume:[[0,t.aspirateAirGapVolume??0]],delay:{enabled:!!t.aspirateRetractDelay?.seconds,...t.aspirateRetractDelay?.seconds?{duration:t.aspirateRetractDelay?.seconds}:{}},end_position:{offset:{x:t.aspirateRetractXOffset,y:t.aspirateRetractYOffset,z:t.aspirateRetractZOffset},position_reference:t.aspirateRetractPositionReference},speed:t.aspirateRetractSpeed??void 0,touch_tip:{enabled:t.touchTipAfterAspirate,z_offset:t.touchTipAfterAspirate?t.touchTipAfterAspirateOffsetMmFromTop:void 0,mm_from_edge:t.touchTipAfterAspirate&&t.touchTipAfterAspirateMmFromEdge!=null?t.touchTipAfterAspirateMmFromEdge:void 0,speed:t.touchTipAfterAspirate?t.touchTipAfterAspirateSpeed:void 0}}},dispense:{...i,correction_by_volume:a?.singleDispense.correctionByVolume??[[0,0]],push_out_by_volume:[[0,t.pushOut??0]],mix:{enabled:"mixInDestination"in t?t.mixInDestination!=null:!1,repetitions:"mixInDestination"in t?t.mixInDestination?.times??void 0:void 0,volume:"mixInDestination"in t?t.mixInDestination?.volume??void 0:void 0}},...t.commandCreatorFnName==="distribute"?{multi_dispense:{...i,correction_by_volume:a?.multiDispense?.correctionByVolume??[[0,0]],..."conditioningVolume"in t?{conditioning_by_volume:[[0,t.conditioningVolume??0]]}:{},..."disposalVolume"in t?{disposal_by_volume:[[0,t.disposalVolume??0]]}:{}}}:{}}}},u=JSON.parse(JSON.stringify(l));return Fr(u)},ja=(e,t)=>`${c.getAllLiquidClassDefs()[e].liquidClassName}${t?"_base_class":""}`,qy=e=>{if(e!=null)return e===zr?"source":e===Mn?"destination":"trash"},_S=e=>{const t=qy(e.blowoutLocation);return!t||t==="trash"?null:{offset:{x:e.blowoutXPosition??0,y:e.blowoutYPosition??0,z:e.blowoutOffsetFromTopMm??1},position_reference:e.blowoutPositionReference??c.POSITION_REFERENCE_TOP}},Fs=e=>{const{labwareEntities:t,tiprackIds:r}=e;return`tip_racks=[${r.map(a=>t[a].pythonName).join(", ")}]`};var Ru,lh;function yS(){if(lh)return Ru;lh=1;var e="Expected a function";function t(r){if(typeof r!="function")throw new TypeError(e);return function(){var n=arguments;switch(n.length){case 0:return!r.call(this);case 1:return!r.call(this,n[0]);case 2:return!r.call(this,n[0],n[1]);case 3:return!r.call(this,n[0],n[1],n[2])}return!r.apply(this,n)}}return Ru=t,Ru}var ku,uh;function bS(){if(uh)return ku;uh=1;var e=Jc(),t=Pn(),r=gs(),n=ar(),a=Cn();function s(o,i,l,u){if(!n(o))return o;i=t(i,o);for(var p=-1,d=i.length,f=d-1,_=o;_!=null&&++p<d;){var m=a(i[p]),h=l;if(m==="__proto__"||m==="constructor"||m==="prototype")return o;if(p!=f){var b=_[m];h=u?u(b,m,_):void 0,h===void 0&&(h=n(b)?b:r(i[p+1])?[]:{})}e(_,m,h),_=_[m]}return o}return ku=s,ku}var vu,ch;function TS(){if(ch)return vu;ch=1;var e=Es(),t=bS(),r=Pn();function n(a,s,o){for(var i=-1,l=s.length,u={};++i<l;){var p=s[i],d=e(a,p);o(d,p)&&t(u,r(p,a),d)}return u}return vu=n,vu}var Pu,ph;function gS(){if(ph)return Pu;ph=1;var e=va(),t=Nn(),r=TS(),n=rp();function a(s,o){if(s==null)return{};var i=e(n(s),function(l){return[l]});return o=t(o),r(s,i,function(l,u){return o(l,u[0])})}return Pu=a,Pu}var Cu,dh;function IS(){if(dh)return Cu;dh=1;var e=Nn(),t=yS(),r=gS();function n(a,s){return r(a,t(e(s)))}return Cu=n,Cu}var ES=IS();const wS=xe(ES);function $y(e){return Object.keys(e.wells)}const SS=(e,t)=>{const r=Object.keys(e||{}).filter(n=>e[n]&&e[n].volume>0);return{wellName:t,groupIds:r,ingreds:wS(e,n=>!n||n.volume<=0)}},AS=(e,t)=>{const r=$y(t);return ct(r,(n,a)=>{const s=e&&e[a];return{...n,[a]:s?SS(e[a],a):{}}},{})},LS=(e,t)=>{const r={};return t.forEach(n=>{const a=e!=null?Object.values(e).reduce((s,o)=>{if(o.groupIds.indexOf(n)!==-1){const l=o.ingreds[n];l?.volume!=null&&(s[o.wellName??"A1"]=l.volume)}return s},{}):{};r[n]=a}),r},OS=e=>{const t=e.flatMap(r=>r==null?[]:Object.values(r).flatMap(n=>n.groupIds.filter(a=>a!==je)));return Array.from(new Set(t))},RS=e=>{const t=e!=null?Object.values(e).flatMap(r=>r.groupIds)?.filter(r=>r!==je):[];return Array.from(new Set(t))},Vy="#737578",By=e=>{const t=Number(e);return Number.isInteger(t)?c.DEFAULT_LIQUID_COLORS[t%c.DEFAULT_LIQUID_COLORS.length]:(e!==je&&console.warn(`swatchColors expected an integer or ${je}, got ${e}`),"transparent")},kS=(e,t)=>{const r=e.filter(n=>n!==je);return r.length===0?null:r.length===1?t[r[0]]??By(r[0]):Vy},vS=(e,t)=>ct(e,(r,n,a)=>{const s=kS(n.groupIds,t);return s?{...r,[a]:s}:r},{});var Nu,fh;function PS(){if(fh)return Nu;fh=1;function e(t,r){return t>r}return Nu=e,Nu}var Du,mh;function CS(){if(mh)return Du;mh=1;var e=Nh(),t=PS(),r=La();function n(a){return a&&a.length?e(a,r,t):void 0}return Du=n,Du}var NS=CS();const DS=xe(NS),xy="2.31",MS="9.0.1";function FS(){return["import json","from opentrons import protocol_api, types"].join(`
|
|
56
|
+
`)}function US(e){function t(n){return n?new Date(n).toISOString():""}const r=Object.fromEntries(Object.entries({protocolName:e.protocolName,author:e.author,description:e.description,created:t(e.created),internalAppBuildDate:e.internalAppBuildDate,lastModified:t(e.lastModified),category:e.category,subcategory:e.subcategory,tags:e.tags?.length&&e.tags.join(", "),protocolDesigner:e.protocolDesigner,source:e.source}).filter(([n,a])=>a));return`metadata = ${Fr(r)}`}function qS(e){const r={robotType:{[c.OT2_ROBOT_TYPE]:"OT-2",[c.FLEX_ROBOT_TYPE]:"Flex"}[e],apiLevel:xy};return`requirements = ${Fr(r)}`}function Hy(e,t){const r=Object.keys(e).length>0,n=r?Object.values(e).map(a=>`${a.pythonName} = ${be}.load_module(${N(a.model)}, ${N(t[a.id].slot)})`).join(`
|
|
57
57
|
`):"";return r?`# Load Modules:
|
|
58
58
|
${n}`:""}function zy(e,t,r){const n=Object.values(t).filter(s=>s.def.allowedRoles?.includes("adapter")),a=Object.values(n).map(s=>{const{id:o,def:i,pythonName:l}=s,{parameters:u,namespace:p,version:d}=i,f=r[o].stack[1],_=r[o].stack.find(y=>y in e),m=r[o].stack.some(y=>y===Yh);let h,b=null;if(_!=null){const y=e[_];[h,b]=m?[be,`location=${y.pythonName}.manifold_dock`]:[y.pythonName,null]}else h=be,b=`location=${f==="offDeck"?Ln:N(f)}`;if(c.getLabwareDefIsStandard(i)){const y=[`${N(u.loadName)}`,...b?[b]:[],`namespace=${N(p)}`,`version=${d}`].join(`,
|
|
59
59
|
`);return`${l} = ${h}.load_adapter(
|
|
60
|
-
${
|
|
60
|
+
${G(y)},
|
|
61
61
|
)`}else{const y=[`${As}[${N(c.getLabwareDefURI(i))}]`,...b?[b]:[]].join(`,
|
|
62
62
|
`);return`${l} = ${h}.load_adapter_from_definition(
|
|
63
|
-
${
|
|
63
|
+
${G(y)},
|
|
64
64
|
)`}}).join(`
|
|
65
65
|
`);return a?`# Load Adapters:
|
|
66
|
-
${a}`:""}const
|
|
67
|
-
`),_=
|
|
66
|
+
${a}`:""}const $S=(e,t,r)=>e.reduce((n,{id:a,labwareDefURI:s,def:o})=>{const{stack:i}=r[a],l=i.length-1,u=i.slice(1,l),p=u.find(T=>t[T]?.def.parameters.loadName==="opentrons_flex_deck_riser"),d=u.every(T=>t[T]?.labwareDefURI===s)||p!=null,f=o.parameters.loadName;if(!d)return n;const _=p!=null?t[p]?.pythonName:W(i),m=i.length-(p!=null?2:1);if(!(_ in n))return{...n,[_]:{loadName:f,quantity:m}};const{quantity:h}=n[_],b=DS([h,m])??h;return{...n,[_]:{loadName:f,quantity:b}}},{}),jy=(e,t)=>{const r=Object.values(e).filter(s=>s.def.allowedRoles?.includes("lid")),n=$S(r,e,t),a=Object.entries(n).map(([s,{loadName:o,quantity:i}])=>{const l=Object.values(e).some(({pythonName:m})=>m===s),u=`load_name=${N(o)}`,p=`location=${l?s:N(s)}`,d=`quantity=${i}`,f=[u,p,d].join(`,
|
|
67
|
+
`),_=G(f);return`lid_stack_${s} = ${be}.load_lid_stack(
|
|
68
68
|
${_},
|
|
69
69
|
)`}).join(`
|
|
70
70
|
`);return a?`# Load Lid Stacks:
|
|
71
|
-
${a}`:""},
|
|
71
|
+
${a}`:""},VS=e=>{const{parameters:t,namespace:r,version:n}=e;return[`lid=${N(t.loadName)}`,`lid_namespace=${N(r)}`,`lid_version=${n}`]};function Gy(e,t,r,n,a){const s=Object.values(r).filter(l=>!l.def.allowedRoles?.includes("adapter")&&!l.def.allowedRoles?.includes("lid")),o=Object.values(r).filter(l=>l.def.allowedRoles?.includes("lid")),i=Object.values(s).reduce((l,u)=>{const{id:p,def:d,pythonName:f}=u,{metadata:_,parameters:m,namespace:h,version:b}=d,T=Object.values(o).find($=>n[$.id].stack[1]===p),y=a[p]!=null&&a[p]!==_.displayName,A=n[p].stack.includes(Ze),w=n[p].stack[1],I=W(n[p].stack),S=Object.entries(e).find(([$,ee])=>ee.slot===I&&ee.moduleState.type===c.FLEX_STACKER_MODULE_TYPE),L=t[w]!=null||I===S?.[1].slot&&!A,E=r[w]!=null;let g,k;if(E&&!A)g=r[w].pythonName;else if(L){const $=S!=null?S?.[0]:w;g=t[$].pythonName}else g=be,k=`location=${w==="offDeck"||A?Ln:N(w)}`;const v=y?`label=${N(a[p])}`:void 0;if(c.getLabwareDefIsStandard(d)){const $=[`${N(m.loadName)}`,...k?[k]:[],...v?[v]:[],`namespace=${N(h)}`,`version=${b}`,...T!=null?VS(T.def):[]].join(`,
|
|
72
72
|
`);return[...l,`${f} = ${g}.load_labware(
|
|
73
|
-
${
|
|
73
|
+
${G($)},
|
|
74
74
|
)`]}else{const $=[`${As}[${N(c.getLabwareDefURI(d))}]`,...k?[k]:[],...v?[v]:[]].join(`,
|
|
75
75
|
`);return[...l,`${f} = ${g}.load_labware_from_definition(
|
|
76
|
-
${
|
|
76
|
+
${G($)},
|
|
77
77
|
)`]}},[]).join(`
|
|
78
78
|
`);return i?`# Load Labware:
|
|
79
79
|
${i}`:""}function Wy(e,t){const r=Object.values(e).map(n=>{const{name:a,id:s,spec:o,pythonName:i}=n,l=o.channels===96?"":N(t[s].mount),u=c.isFlexPipette(a)?c.getFlexNameConversion(o):a;return`${i} = ${be}.load_instrument(${[N(u),...l?[l]:[]].join(", ")})`}).join(`
|
|
80
80
|
`);return r?`# Load Pipettes:
|
|
81
81
|
${r}`:""}function Yy(e){const t=Object.values(e).map(r=>{const{pythonName:n,displayColor:a,displayName:s,description:o}=r,i=[`${N(s)}`,...o?[`description=${N(o)}`]:[],`display_color=${N(a)}`].join(`,
|
|
82
82
|
`);return`${n} = ${be}.define_liquid(
|
|
83
|
-
${
|
|
83
|
+
${G(i)},
|
|
84
84
|
)`}).join(`
|
|
85
85
|
`);return t?`# Define Liquids:
|
|
86
86
|
${t}`:""}function Ky(e,t,r){const n=Object.entries(e).reduce((s,[o,i])=>{const l=r[o].pythonName;return Object.entries(i).forEach(([u,p])=>{Object.entries(p).forEach(([d,f])=>{const _=t[d].pythonName,m=`${l}__${_}__${f.volume}`;s[m]||(s[m]={labwarePythonName:l,liquidPythonName:_,volume:f.volume,wells:[]}),s[m].wells.push(u)})}),s},{}),a=Object.values(n).map(({labwarePythonName:s,liquidPythonName:o,volume:i,wells:l})=>{const u=l.map(m=>N(m)),d=Os(u,8).map(m=>Ma+m.join(", ")).join(`,
|
|
@@ -90,61 +90,66 @@ ${d}
|
|
|
90
90
|
liquid=${o},
|
|
91
91
|
volume=${i},
|
|
92
92
|
`].join();return`${s}.load_liquid(
|
|
93
|
-
${
|
|
93
|
+
${G(_)})`}).join(`
|
|
94
94
|
`);return a?`# Load Liquids:
|
|
95
95
|
${a}`:""}function Xy(e){const t=c.getAllLiquidClassDefs(),r=e.map(n=>n==null?"":`${ja(n,!0)} = ${be}.get_liquid_class(${N(t[n].liquidClassName)})`).join(`
|
|
96
96
|
`);return e.length>0?`# Load Liquid Classes:
|
|
97
97
|
${r}`:""}function Zy(e){const t=Object.values(e)?.map(r=>{const n=N(c.getCutoutDisplayName(r.location));return`${r.pythonName} = ${be}.load_trash_bin(${n})`}).join(`
|
|
98
98
|
`);return t?`# Load Trash Bins:
|
|
99
99
|
${t}`:""}function Qy(e){const t=Object.values(e)?.map(r=>`${r.pythonName} = ${be}.load_waste_chute()`);return t.length>0?`# Load Waste Chute:
|
|
100
|
-
${t}`:""}const
|
|
100
|
+
${t}`:""}const BS=e=>e?`
|
|
101
101
|
`+e.split(/\r\n|\r|\n/).map(t=>`# ${t}`).join(`
|
|
102
102
|
`):"";function Jy(e){return`# PROTOCOL STEPS
|
|
103
103
|
|
|
104
|
-
`+e.timeline.map(t=>{const{stepInfo:r}=t,n=r?.description;return`# Step ${r?.stepNumber}: ${r?.name}${
|
|
104
|
+
`+e.timeline.map(t=>{const{stepInfo:r}=t,n=r?.description;return`# Step ${r?.stepNumber}: ${r?.name}${BS(n)}
|
|
105
105
|
${t.python||"pass"}`}).join(`
|
|
106
106
|
|
|
107
|
-
`)}function
|
|
107
|
+
`)}function xS(e,t,r,n,a,s,o){const{moduleEntities:i,labwareEntities:l,pipetteEntities:u,liquidEntities:p,wasteChuteEntities:d,trashBinEntities:f}=e,{modules:_,labware:m,pipettes:h}=t,T=[Hy(i,_),zy(i,l,m),jy(l,m),Gy(_,i,l,m,a),Wy(u,h),...s===c.FLEX_ROBOT_TYPE?[Zy(f),Qy(d)]:[],Yy(p),Ky(n,p,l),Xy(o),eb(i,l,m,_,r),Jy(r)].filter(y=>y).join(`
|
|
108
108
|
|
|
109
109
|
`)||"pass";return`def run(${be}: protocol_api.ProtocolContext) -> None:
|
|
110
|
-
${
|
|
110
|
+
${G(T)}`}function HS(e){const t=Object.values(e).filter(r=>!c.getLabwareDefIsStandard(r.def)).map(r=>r.def);if(t.length>0){const r=Object.fromEntries(t.map(n=>[c.getLabwareDefURI(n),n]));return`${As} = json.loads("""${JSON.stringify(r)}""")`}else return""}const Us=e=>{switch(e){case"perDest":return"per destination";case"perSource":return"per source";default:return e}},eb=(e,t,r,n,a)=>{const o=Object.values(e).map(i=>{const{id:l,type:u,pythonName:p}=i;if(u===c.FLEX_STACKER_MODULE_TYPE){const d=n[l].slot,f=a.timeline.map(h=>h.robotState.labware),_=Object.entries(r).filter(([h,b])=>b.stack.includes(l)&&b.stack.includes(Ze)),m=[...Object.entries(r),...f.flatMap(h=>Object.entries(h))].filter(([h,b])=>W(b.stack)===d&&!b.stack.includes(Ze));if(_.length===0){if(m.length===0)return"";const h=m.find(([y])=>t[y].def.allowedRoles?.includes("lid")),b=m.find(([y])=>!t[y].def.allowedRoles?.includes("lid"));if(b==null)return"";const T=[`load_name=${N(t[b[0]].def.parameters.loadName)}`,`namespace=${N(t[b[0]].def.namespace)}`,`version=${t[b[0]].def.version}`,"count=0",...h!=null?[`lid=${N(t[h[0]].def.parameters.loadName)}`]:[]].join(`,
|
|
111
111
|
`);return`${p}.set_stored_labware(
|
|
112
|
-
${
|
|
112
|
+
${G(T)}
|
|
113
113
|
)`}else{const h=Object.values(_).filter(w=>!t[w[0]]?.def.allowedRoles?.includes("lid")).map(w=>t[w[0]].pythonName),T=Os(h,4).map(w=>Ma+w.join(", ")).join(`,
|
|
114
114
|
`),A=`labware=[${h.length<4?h.join(", "):`
|
|
115
115
|
${T}
|
|
116
116
|
`}],
|
|
117
117
|
`;return`${p}.set_stored_labware_items(
|
|
118
|
-
${
|
|
118
|
+
${G(A)})`}}}).filter(Boolean);return o.length>0?`# Set Stored Labware:
|
|
119
119
|
${o.join(`
|
|
120
|
-
`).trimStart()}`:""},BS=(e,t,r,n)=>{const{spec:a}=t,s=e===c.ROW,o=e===c.COLUMN||e===c.ALL&&a.channels===8,i=n.ordering[0].length===1;if(s&&i){const u=o?`H${r.slice(1)}`:`${r.charAt(0)}12`,p=a.nozzleMap[u],d=a.nozzleMap[r],f=p.map((h,b)=>h-d[b]),_=[f[0]/2,f[1]/2,0],m=d.map((h,b)=>h+_[b]);return{x:m[0],y:m[1],z:m[2]}}const l=a.nozzleMap[r];return{x:l[0],y:l[1],z:l[2]}},Tn={back_left:{x:-43.25,y:454.9,z:211.91},front_right:{x:128.75,y:402,z:211.91}},hh={x:Tn.back_left.x,y:Tn.back_left.y,z:Tn.back_left.z},xS={x:Tn.front_right.x,y:Tn.front_right.y,z:Tn.front_right.z},HS=49.5,tb=e=>{if(e.addressableArea?.areaType==="slot"){const t=`cutout${e.addressableArea?.id}`;if(t)return t}return null},zS=(e,t,r,n,a,s,o)=>{const{pipetteBoundingBoxOffsets:i}=e.spec,l=BS(s,e,a,n),u=i.backLeftCorner[0],p=i.frontRightCorner[0],d=i.backLeftCorner[1],f=i.frontRightCorner[1],_=r.x-(l.x-u),m=r.x+(p-l.x),h=r.y+(d-l.y),b=r.y-(l.y-f),T=(r.z??0)+t-o;return[{x:_,y:h,z:T},{x:m,y:b,z:T},{x:m,y:h,z:T},{x:_,y:b,z:T}]},rb=(e,t)=>{const r=e[1].x<t[0].x,n=e[0].x>t[1].x,a=e[0].y<t[1].y,s=e[1].y>t[0].y;return!(r||n||a||s)},_h=(e,t)=>{if(t===c.FLEX_ROBOT_TYPE){const r=c.getDeckDefFromRobotType(t),{addressableAreas:n}=r.locations;return n.find(s=>s.id.includes(e))?.offsetFromCutoutFixture[2]??0}return c.getModuleDef(e).dimensions.bareOverallHeight},jS=e=>{const t=c.getDeckDefFromRobotType(e);return Object.values(t.cutoutFixtures).find(n=>c.WASTE_CHUTE_FIXTURES.includes(n.id))?.height??0},GS=(e,t,r,n)=>{const{modules:a,labware:s}=e,{moduleEntities:o,labwareEntities:i,wasteChuteEntities:l}=t;let u=0;const p=r?.addressableArea?.id;if(p){const d=ks(s,p),f=Object.keys(a).find(m=>a[m].slot===p);Object.values(l).find(m=>m.location===tb(r))&&(u+=jS(n)),d.length>0?d.forEach(m=>{a[m]!=null&&(u+=_h(o[m].model,n)),s[m]!=null&&(u+=i[m].def.dimensions.zDimension)}):f!=null&&(u+=_h(o[f].model,n))}return u},WS=(e,t,r,n,a)=>{for(const s of t){const o=s.addressableArea?.boundingBox,i=s.position;if(i==null||o==null)continue;const l={x:i[0],y:o.yDimension+i[1],z:i[2]},u={x:i[0]+o.xDimension,y:i[1],z:i[2]};if(rb([e[0],e[1]],[l,u])&&e[0].z!=null&&GS(r,n,s,a)>=e[0]?.z&&s.addressableArea!=null)return{addressableAreaCausingCollision:s.addressableArea}}return null},YS=(e,t)=>Object.values(t).find(r=>r.type===c.THERMOCYCLER_MODULE_TYPE)?rb([hh,xS],[e[0],e[1]])&&e[0].x<=hh.z:!1,KS=(e,t,r,n)=>{const{wells:a}=e.def,s=a[t];return{x:s.x+r.x,y:s.y+r.y,z:n?s.z+(r.z??0):e.def.dimensions.zDimension}},ft=e=>{const{robotState:t,invariantContext:r,pipetteId:n,labwareId:a,wellLocationOffset:s={x:0,y:0,z:0},wellTargetName:o,primaryNozzle:i,nozzleConfiguration:l,tiprackId:u}=e,{pipetteEntities:p,labwareEntities:d,stagingAreaEntities:f,moduleEntities:_}=r,{labware:m,tipState:h}=t,b=p[n];if(b==null)return{isSafe:!0};const{spec:T}=b,{channels:y}=T,I=T?.displayCategory==="FLEX"?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE,S=c.getDeckDefFromRobotType(I);if(d[a]==null||o==null||y===1)return{isSafe:!0};const L=u?!0:h.pipettes[n]?.hasTip??!1,E=u??h.pipettes[n]?.tiprackURI,g=E!=null?d[E]:null,k=g!=null?g.def.parameters.tipLength:0,v=Object.values(f).map(P=>P.location),q=L?k??0:0,$=G(m[a].stack),ee=m[a].stack.some(P=>_[P]?.type===c.THERMOCYCLER_MODULE_TYPE),de=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),Te=(ee?c.getPositionFromSlotId(c.B1_ADDRESSABLE_AREA,de):c.getPositionFromSlotId($,S))??[0,0,0],se=ee?de.locations.addressableAreas.find(P=>P.id===c.THERMOCYCLER_MODULE_V2)?.offsetFromCutoutFixture??[0,0,0]:[0,0,0],Ie={x:se[0]+Te[0],y:se[1]+Te[1],z:se[2]+Te[2]},{def:Pe}=d[a],He=ab({wellTargetName:o,primaryNozzle:i,nozzleConfiguration:l,specs:T,labwareDef:Pe}),Ve={x:s.x+He.x+Ie.x,y:s.y+He.y+Ie.y,z:(s.z??0)+(Ie.z??0)},te=KS(d[a],o,Ve,L),Se=g!=null?XS({pipetteSpecs:T,tiprackUri:g.labwareDefURI,nozzles:l}):0,ze=d[a].def,Ce=zS(b,q,te,ze,i,l,Se);if(!QS({channels:y,boundingBox:Ce,robotType:I}))return{isSafe:!1,reason:{type:"outsidePipetteExtents"}};const W=(I===c.OT2_ROBOT_TYPE?c.getOt2SurroundingSlots($):c.getFlexSurroundingSlots($,v)).map(P=>{const V=c.getAddressableAreaFromSlotId(P,S),M=c.getPositionFromSlotId(P,S);return{addressableArea:V,position:M}});if(YS(Ce,_))return{isSafe:!1,reason:{type:"thermocyclerLidCollision"}};const C=WS(Ce,W,t,r,I);return C!=null?{isSafe:!1,reason:{type:"adjacentAdressableAreaCollision",addressableAreaCausingCollision:C.addressableAreaCausingCollision}}:{isSafe:!0}},up=e=>{const{tipState:t,primaryNozzle:r,channels:n,nozzleConfiguration:a,wellName:s,tiprackDef:o,tipsToIgnore:i=[]}=e,{ordering:l}=o;if(n===1)return{isSafe:!0,isComplete:t[s]!==ue};if(n===8){const u=r!==c.A1_NOZZLE,p=nc(s),d=l[p],f=u?[...d].reverse():d;if(a===c.SINGLE){const _=f.indexOf(s);return{isSafe:f.slice(_+1).every(m=>t[m]===ue||i.includes(m)),isComplete:t[s]!==ue}}if(a===c.PARTIAL_COLUMN){const _=f.indexOf(s),m=c.PARTIAL_NOZZLE_MAP[r],h=u?f.slice(_-m+1,_+1):f.slice(_,_+m);return{isSafe:f.slice(_+1).every(b=>t[b]===ue||i.includes(b)),isComplete:h.every(b=>t[b]!==ue&&!i.includes(b))}}return{isSafe:!0,isComplete:f.every(_=>t[_]!==ue)}}if(a===c.ALL)return{isSafe:!0,isComplete:Object.keys(o.wells).every(u=>t[u]!==ue)};if(a===c.COLUMN){const u=r===c.A12_NOZZLE,p=nc(s),d=l[p],f=u?[...l].reverse():l,_=f.indexOf(d);return{isSafe:f.slice(_+1).flat().every(m=>t[m]===ue||i.includes(m)),isComplete:f[_].every(m=>t[m]!==ue)}}if(a===c.ROW){const u=l[0].map((_,m)=>l.map(h=>h[m])),d=r===c.H1_NOZZLE?[...u].reverse():u,f=d.findIndex(_=>_.some(m=>m===s));return{isSafe:d.slice(f+1).flat().every(_=>t[_]===ue||i.includes(_)),isComplete:d[f].every(_=>t[_]!==ue)}}if(a===c.SINGLE){const u=gn(r??cs({nozzles:a,channels:n})),p=cp(r??cs({nozzles:a,channels:n})),d=u==="H",_=p==="12"?[...l].reverse():l,m=_.findIndex(h=>h.some(b=>b===s));return{isSafe:_.slice(m).every(h=>{const b=d?[...h].reverse():h,T=b.findIndex(y=>gn(y)===gn(s));return b.slice(T).every(y=>t[y]===ue||i.includes(y)||y===s)}),isComplete:t[s]!==ue}}return{isSafe:!1}},gn=e=>e.slice(0,1),cp=e=>e.slice(1),nc=e=>parseInt(e.slice(1))-1,cs=e=>{const{nozzles:t,channels:r}=e;if(r===8&&t===c.SINGLE)return"H1";if(r===96){if(t===c.COLUMN)return"A12";if(t===c.SINGLE)return"H12"}return"A1"},Ga=e=>{const{wellSets:t,nozzles:r,channels:n,primaryNozzle:a}=e;return r===c.ROW?t.map(s=>s[0]):t.map(s=>n===96&&r===c.ALL?a:r===c.COLUMN||n===8&&r===c.ALL||n===8&&r===c.PARTIAL_COLUMN?gn(a)==="H"?s[s.length-1]:s[0]:(console.assert(s.length===1,"Well set for SINGLE nozzle configuration should have exactly 1 well"),s[0]))},XS=e=>{const{pipetteSpecs:t,tiprackUri:r,nozzles:n}=e,{channels:a}=t,s=ZS(a,n),o=t.pickUpTipConfigurations.pressFit.configurationsByNozzleMap[s]?.default.tipOverlaps;if(o==null)return console.error(`No tip overlaps found for ${n} and ${s} overlap.`),0;const i=Math.max(...Object.keys(o).map(l=>Number(l.slice(1))));return o[`v${i}`]?.[r]??o[`v${i}`]?.default??0},ZS=(e,t)=>{if(e===1)return"SingleA1";if(e===8)return t===c.SINGLE?"SingleH1":"Full";if(e===96){if(t===c.SINGLE)return"SingleH12";if(t===c.COLUMN)return"Column12";if(t===c.ROW)return"RowA"}return"Full"},QS=e=>{const{channels:t,boundingBox:r,robotType:n}=e,a=c.getRobotDefFromRobotType(n),{paddingOffsets:s}=a,{front:o,rear:i,leftSide:l,rightSide:u}=s,[p,d]=a.extents,[f,_]=r,{x:m,y:h}=f,{x:b,y:T}=_;if(t===96){if(b<l)return!1;const y=p+u;if(m>y)return!1}if(t!==1){if(h<o)return!1;const y=d+i;if(T>y)return!1}return!0},nb=e=>{const{channels:t,nozzleMap:r}=e;if(t===1)return 0;const[n,a]=["A1","B1"].map(o=>r[o][1]);return Math.abs(n-a)},ab=e=>{const t=JS(e),r=eA(e);return{x:t,y:r}},JS=e=>{const{primaryNozzle:t,nozzleConfiguration:r,specs:n,labwareDef:a}=e,{channels:s}=n;if(s!==96)return 0;const{ordering:o}=a,i=o.length===1;if(!i)return 0;let l;const u=cp(t)==="12"?1:-1;if(r===c.ALL&&s===96||r===c.ROW)l=12;else if(r===c.QUADRANT)l=6;else return u*HS;const p=nb(n);return i?(l-1)*p/2*u:0},eA=e=>{const{wellTargetName:t,primaryNozzle:r,nozzleConfiguration:n,specs:a,labwareDef:s}=e,{channels:o}=a;if(o===1)return 0;const i=nb(a),{ordering:l}=s,u=l.findIndex(f=>f.includes(t));if(l[u].length!==1)return 0;if(n===c.PARTIAL_COLUMN){const _=-1*(8-c.PARTIAL_NOZZLE_MAP[r])*i,m=7*i/2;return _+m}const d=gn(r)==="H"?-1:1;return 7*i/2*d};function sb(e){const t=e.length===1?e[0]:null;return t!=null&&"steps"in t?{numRepetitions:t.repetitions,repeatingProfileSteps:t.steps}:{numRepetitions:1,repeatingProfileSteps:pp(e)}}function pp(e){return e.flatMap(t=>"steps"in t?K_(t.steps,t.repetitions):t)}const tA=e=>{switch(e.commandCreatorFnName){case"consolidate":return O(_b,e);case"delay":return O(me,e);case"waitForModuleTask":return O(Lb,e);case"distribute":return O(yb,e);case"transfer":return O(Ib,e);case"mix":return O(hb,e);case"moveLabware":return O(N_,e);case"captureImage":return O(w_,e);case"engageMagnet":return O(R_,e);case"disengageMagnet":return O(O_,e);case"setTemperature":return O(Pc,e);case"deactivateTemperature":return O(L_,e);case"waitForTemperature":return O(Fc,e);case"thermocyclerProfile":return O(Tb,e);case"thermocyclerState":return O(gb,e);case"heaterShaker":return O(bb,e);case"comment":return O(S_,e);case"absorbanceReaderOpenLid":return O(I_,e);case"absorbanceReaderCloseLid":return O(ws,e);case"absorbanceReaderRead":return O(ub,e);case"absorbanceReaderInitialize":return O(lb,e);case"flexStackerEmpty":return O(k_,{...e,strategy:"manualWithPause"});case"flexStackerFillItems":return O(v_,e);case"flexStackerRetrieve":return O(P_,e);case"flexStackerStore":return O(C_,{...e,strategy:"automatic"});case"vacuumCloseVent":return O(Da,e);case"vacuumOpenVent":return O(M_,e);case"vacuumSetPumpPower":return O(Nc,e);case"vacuumSetPumpPressure":return O(Dc,e);case"vacuumStartRunProfile":return O(Mc,e);case"vacuumStopPump":return O(U_,e);case"vacuumCloseVentSetPumpPressure":return O(wb,e);case"vacuumCloseVentSetPumpPower":return O(Eb,e);case"vacuumCloseVentStartProfile":return O(Sb,e);case"airGapInPlace":return O(At,e);case"aspirate":return O(At,e);case"aspirateInPlace":return O(Na,e);case"aspirateWhileTracking":return O(fI,e);case"blowOutInPlace":return O(Dn,e);case"blowout":return O(Rc,e);case"configureForVolume":return O(An,e);case"configureNozzleLayout":return O(A_,e);case"dispense":return O(kc,e);case"dispenseInPlace":return O(Xe,e);case"dispenseWhileTracking":return O(mI,e);case"dropTip":return O(Hr,e);case"dropTipInPlace":return O(Ss,e);case"home":return O(hI,e);case"moveRelative":return O(_I,e);case"moveToAddressableArea":return O(Fe,e);case"moveToAddressableAreaForDropTip":return O(vc,e);case"moveToCoordinates":return O(yI,e);case"moveToWell":return O(B,e);case"pickUpTip":return O(ss,e);case"prepareToAspirate":return O(Lt,e);case"touchTip":return O(Et,e);case"tryLiquidProbe":return O(bI,e);case"heaterShaker/closeLabwareLatch":return O(q_,e);case"heaterShaker/openLabwareLatch":return O($_,e);case"heaterShaker/setAndWaitForShakeSpeed":return O(V_,e);case"heaterShaker/deactivateHeater":return O(Gu,e);case"heaterShaker/deactivateShaker":return O(Wu,e);case"thermocycler/closeLid":return O(Uc,e);case"thermocycler/openLid":return O(H_,e);case"thermocycler/deactivateBlock":return O(B_,e);case"thermocycler/deactivateLid":return O(x_,e);case"thermocycler/setTargetBlockTemperature":return O(z_,e);case"thermocycler/setTargetLidTemperature":return O(qc,e);case"thermocycler/startRunExtendedProfile":return O(D_,e)}},D=DT;function ob(e){return Object.keys(e).sort((r,n)=>{const a=G(e[r].stack),s=G(e[n].stack),o=parseInt(a),i=parseInt(s);return ve.includes(a)&&ve.includes(s)?r.localeCompare(n):ve.includes(a)?1:ve.includes(s)?-1:o-i})}function ib(e){const{pipetteId:t,tiprackId:r,invariantContext:n,robotState:a,nozzles:s,primaryNozzle:o}=e,i=n.pipetteEntities[t]?.spec?.channels,l=n.labwareEntities[r]?.def,u=a.tipState.tipracks[r];if(!i||!l||!u)return console.assert(!1,`Pipette ${t} missing channels/spec or tiprack definition`),null;const p=g=>u[g]===Ra,d=c.orderWells(l.ordering,"t2b","l2r"),f=c.orderWells(l.ordering,"b2t","l2r"),_=g=>g.find(p)??null,m=g=>[...g].reverse().find(p)??null,h=g=>g.find(k=>k.every(p))??null,b=g=>[...g].reverse().find(k=>k.every(p))??null,T=i===8&&s===c.SINGLE,y=T&&o===c.H1_NOZZLE,A=T&&o===c.A1_NOZZLE,w=i===96&&s===c.SINGLE,I=w&&o===c.H12_NOZZLE,S=w&&o===c.A12_NOZZLE,L=w&&o===c.H1_NOZZLE,E=w&&o===c.A1_NOZZLE;if(i===1||y||I)return _(d);if(A)return _(f);if(s===c.PARTIAL_COLUMN){const g=_(d);if(!g)return null;const k=d.indexOf(g);return d[k]??null}if(s===c.ALL&&i===8)return h(l.ordering)?.[0]??null;if(E)return m(d);if(S)return _(f);if(L)return m(f);if(s===c.COLUMN){const g=l.ordering;return(o===c.A1_NOZZLE?b(g):h(g))?.[0]??null}if(s===c.ROW){const g=l.ordering,k=g[0].map((q,$)=>g.map(ee=>ee[$]));return(o===c.A1_NOZZLE?b(k):h(k))?.[0]??null}return s===c.ALL&&i===96?d.every(p)?d[0]:null:(console.assert(!1,`Unhandled _getNextTip case for pipette ${t}`),null)}function Wa(e,t,r,n,a,s){const o=r.pipetteEntities[e];if(!o)throw new Error(`cannot getNextTiprack, no pipette entity for pipette "${e}"`);const i=[],l=ob(n.labware).filter(m=>{console.assert(r.labwareEntities[m]?.labwareDefURI!=null,`cannot getNextTiprack, no labware entity for "${m}"`);const h=G(n.labware[m].stack),b=ly(h),T=iy({labwareId:m,labwareRobotState:n.labware,labwareEntities:r.labwareEntities});if(b&&T&&c.getIsTiprack(r.labwareEntities[m].def))return i.push(m),!1;const y=r.labwareEntities[m].labwareDefURI;return b&&y===t});let u=l;const p=o.spec.channels===96,d=[];p&&(u=u.filter(m=>{const h=n.labware[m].stack[1],b=r.labwareEntities[h],T=b?.def.parameters.loadName==="opentrons_flex_96_tiprack_adapter"&&c.getLabwareDefIsStandard(b?.def),y=s===c.ALL?T:!T;return y||d.push(m),y}));let f=null,_=null;for(const m of u){const h=ib({pipetteId:e,tiprackId:m,nozzles:s,invariantContext:r,robotState:n,primaryNozzle:a}),{isSafe:b}=h!=null?ft({robotState:n,invariantContext:r,pipetteId:e,labwareId:m,wellTargetName:h,primaryNozzle:a,nozzleConfiguration:s}):{isSafe:!1},{isSafe:T,isComplete:y=!1}=h!=null?up({tipState:n.tipState.tipracks[m],primaryNozzle:a,channels:o.spec.channels,nozzleConfiguration:s,wellName:h,tiprackDef:r.labwareEntities[m].def}):{isSafe:!1};if(h&&b&&T&&y){f=m,_=h;break}}return f&&_?{nextTiprack:{tiprackId:f,well:_},tipracks:{totalTipracks:l.length,excludedBy96Channel:d.length,excludedByLid:i.length,filteredSortedTiprackIds:u}}:{nextTiprack:null,tipracks:{totalTipracks:l.length,excludedBy96Channel:d.length,excludedByLid:i.length,filteredSortedTiprackIds:u}}}function qs(e,t,r){const n=t.pipetteEntities[e],a=n.spec.liquids.default.maxVolume,s=n.tiprackLabwareDef;let o=null;for(const l of s)if(c.getLabwareDefURI(l)===r){o=l;break}const i=c.getTiprackVolume(o??s[0]);return!a||!i?(console.assert(!1,`getPipetteEffectiveMaxVol expected tiprackMaxVol and pipette maxVolume to be > 0, got',
|
|
121
|
-
|
|
120
|
+
`).trimStart()}`:""},zS={boolean:"add_bool",int:"add_int",float:"add_float",string:"add_str",csv:"add_csv_file"};function jS(e){const t=Object.values(e).map(r=>{const n="choices"in r?r.choices:void 0,a={variable_name:r.variableName,display_name:r.displayName,description:r.description||void 0,default:r.type==="csv"?void 0:r.default,choices:n?.map(o=>({display_name:String(o),value:o})),..."minimum"in r?{minimum:r.minimum,maximum:r.maximum,unit:n==null?r.unit:void 0}:{}},s=Object.entries(a).filter(([,o])=>o!=null).map(([o,i])=>`${o}=${st(i)}`).join(`,
|
|
121
|
+
`);return`parameters.${zS[r.type]}(
|
|
122
|
+
${G(s)},
|
|
123
|
+
)`}).join(`
|
|
124
|
+
`);return t?`def add_parameters(parameters: protocol_api.ParameterContext) -> None:
|
|
125
|
+
${G(t)}`:""}const GS=(e,t,r,n)=>{const{spec:a}=t,s=e===c.ROW,o=e===c.COLUMN||e===c.ALL&&a.channels===8,i=n.ordering[0].length===1;if(s&&i){const u=o?`H${r.slice(1)}`:`${r.charAt(0)}12`,p=a.nozzleMap[u],d=a.nozzleMap[r],f=p.map((h,b)=>h-d[b]),_=[f[0]/2,f[1]/2,0],m=d.map((h,b)=>h+_[b]);return{x:m[0],y:m[1],z:m[2]}}const l=a.nozzleMap[r];return{x:l[0],y:l[1],z:l[2]}},Tn={back_left:{x:-43.25,y:454.9,z:211.91},front_right:{x:128.75,y:402,z:211.91}},hh={x:Tn.back_left.x,y:Tn.back_left.y,z:Tn.back_left.z},WS={x:Tn.front_right.x,y:Tn.front_right.y,z:Tn.front_right.z},YS=49.5,tb=e=>{if(e.addressableArea?.areaType==="slot"){const t=`cutout${e.addressableArea?.id}`;if(t)return t}return null},KS=(e,t,r,n,a,s,o)=>{const{pipetteBoundingBoxOffsets:i}=e.spec,l=GS(s,e,a,n),u=i.backLeftCorner[0],p=i.frontRightCorner[0],d=i.backLeftCorner[1],f=i.frontRightCorner[1],_=r.x-(l.x-u),m=r.x+(p-l.x),h=r.y+(d-l.y),b=r.y-(l.y-f),T=(r.z??0)+t-o;return[{x:_,y:h,z:T},{x:m,y:b,z:T},{x:m,y:h,z:T},{x:_,y:b,z:T}]},rb=(e,t)=>{const r=e[1].x<t[0].x,n=e[0].x>t[1].x,a=e[0].y<t[1].y,s=e[1].y>t[0].y;return!(r||n||a||s)},_h=(e,t)=>{if(t===c.FLEX_ROBOT_TYPE){const r=c.getDeckDefFromRobotType(t),{addressableAreas:n}=r.locations;return n.find(s=>s.id.includes(e))?.offsetFromCutoutFixture[2]??0}return c.getModuleDef(e).dimensions.bareOverallHeight},XS=e=>{const t=c.getDeckDefFromRobotType(e);return Object.values(t.cutoutFixtures).find(n=>c.WASTE_CHUTE_FIXTURES.includes(n.id))?.height??0},ZS=(e,t,r,n)=>{const{modules:a,labware:s}=e,{moduleEntities:o,labwareEntities:i,wasteChuteEntities:l}=t;let u=0;const p=r?.addressableArea?.id;if(p){const d=ks(s,p),f=Object.keys(a).find(m=>a[m].slot===p);Object.values(l).find(m=>m.location===tb(r))&&(u+=XS(n)),d.length>0?d.forEach(m=>{a[m]!=null&&(u+=_h(o[m].model,n)),s[m]!=null&&(u+=i[m].def.dimensions.zDimension)}):f!=null&&(u+=_h(o[f].model,n))}return u},QS=(e,t,r,n,a)=>{for(const s of t){const o=s.addressableArea?.boundingBox,i=s.position;if(i==null||o==null)continue;const l={x:i[0],y:o.yDimension+i[1],z:i[2]},u={x:i[0]+o.xDimension,y:i[1],z:i[2]};if(rb([e[0],e[1]],[l,u])&&e[0].z!=null&&ZS(r,n,s,a)>=e[0]?.z&&s.addressableArea!=null)return{addressableAreaCausingCollision:s.addressableArea}}return null},JS=(e,t)=>Object.values(t).find(r=>r.type===c.THERMOCYCLER_MODULE_TYPE)?rb([hh,WS],[e[0],e[1]])&&e[0].x<=hh.z:!1,eA=(e,t,r,n)=>{const{wells:a}=e.def,s=a[t];return{x:s.x+r.x,y:s.y+r.y,z:n?s.z+(r.z??0):e.def.dimensions.zDimension}},ft=e=>{const{robotState:t,invariantContext:r,pipetteId:n,labwareId:a,wellLocationOffset:s={x:0,y:0,z:0},wellTargetName:o,primaryNozzle:i,nozzleConfiguration:l,tiprackId:u}=e,{pipetteEntities:p,labwareEntities:d,stagingAreaEntities:f,moduleEntities:_}=r,{labware:m,tipState:h}=t,b=p[n];if(b==null)return{isSafe:!0};const{spec:T}=b,{channels:y}=T,I=T?.displayCategory==="FLEX"?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE,S=c.getDeckDefFromRobotType(I);if(d[a]==null||o==null||y===1)return{isSafe:!0};const L=u?!0:h.pipettes[n]?.hasTip??!1,E=u??h.pipettes[n]?.tiprackURI,g=E!=null?d[E]:null,k=g!=null?g.def.parameters.tipLength:0,v=Object.values(f).map(P=>P.location),q=L?k??0:0,$=W(m[a].stack),ee=m[a].stack.some(P=>_[P]?.type===c.THERMOCYCLER_MODULE_TYPE),de=c.getDeckDefFromRobotType(c.FLEX_ROBOT_TYPE),Te=(ee?c.getPositionFromSlotId(c.B1_ADDRESSABLE_AREA,de):c.getPositionFromSlotId($,S))??[0,0,0],se=ee?de.locations.addressableAreas.find(P=>P.id===c.THERMOCYCLER_MODULE_V2)?.offsetFromCutoutFixture??[0,0,0]:[0,0,0],Ie={x:se[0]+Te[0],y:se[1]+Te[1],z:se[2]+Te[2]},{def:Pe}=d[a],He=ab({wellTargetName:o,primaryNozzle:i,nozzleConfiguration:l,specs:T,labwareDef:Pe}),Ve={x:s.x+He.x+Ie.x,y:s.y+He.y+Ie.y,z:(s.z??0)+(Ie.z??0)},te=eA(d[a],o,Ve,L),Se=g!=null?tA({pipetteSpecs:T,tiprackUri:g.labwareDefURI,nozzles:l}):0,ze=d[a].def,Ce=KS(b,q,te,ze,i,l,Se);if(!nA({channels:y,boundingBox:Ce,robotType:I}))return{isSafe:!1,reason:{type:"outsidePipetteExtents"}};const Y=(I===c.OT2_ROBOT_TYPE?c.getOt2SurroundingSlots($):c.getFlexSurroundingSlots($,v)).map(P=>{const V=c.getAddressableAreaFromSlotId(P,S),M=c.getPositionFromSlotId(P,S);return{addressableArea:V,position:M}});if(JS(Ce,_))return{isSafe:!1,reason:{type:"thermocyclerLidCollision"}};const C=QS(Ce,Y,t,r,I);return C!=null?{isSafe:!1,reason:{type:"adjacentAdressableAreaCollision",addressableAreaCausingCollision:C.addressableAreaCausingCollision}}:{isSafe:!0}},up=e=>{const{tipState:t,primaryNozzle:r,channels:n,nozzleConfiguration:a,wellName:s,tiprackDef:o,tipsToIgnore:i=[]}=e,{ordering:l}=o;if(n===1)return{isSafe:!0,isComplete:t[s]!==ue};if(n===8){const u=r!==c.A1_NOZZLE,p=nc(s),d=l[p],f=u?[...d].reverse():d;if(a===c.SINGLE){const _=f.indexOf(s);return{isSafe:f.slice(_+1).every(m=>t[m]===ue||i.includes(m)),isComplete:t[s]!==ue}}if(a===c.PARTIAL_COLUMN){const _=f.indexOf(s),m=c.PARTIAL_NOZZLE_MAP[r],h=u?f.slice(_-m+1,_+1):f.slice(_,_+m);return{isSafe:f.slice(_+1).every(b=>t[b]===ue||i.includes(b)),isComplete:h.every(b=>t[b]!==ue&&!i.includes(b))}}return{isSafe:!0,isComplete:f.every(_=>t[_]!==ue)}}if(a===c.ALL)return{isSafe:!0,isComplete:Object.keys(o.wells).every(u=>t[u]!==ue)};if(a===c.COLUMN){const u=r===c.A12_NOZZLE,p=nc(s),d=l[p],f=u?[...l].reverse():l,_=f.indexOf(d);return{isSafe:f.slice(_+1).flat().every(m=>t[m]===ue||i.includes(m)),isComplete:f[_].every(m=>t[m]!==ue)}}if(a===c.ROW){const u=l[0].map((_,m)=>l.map(h=>h[m])),d=r===c.H1_NOZZLE?[...u].reverse():u,f=d.findIndex(_=>_.some(m=>m===s));return{isSafe:d.slice(f+1).flat().every(_=>t[_]===ue||i.includes(_)),isComplete:d[f].every(_=>t[_]!==ue)}}if(a===c.SINGLE){const u=gn(r??cs({nozzles:a,channels:n})),p=cp(r??cs({nozzles:a,channels:n})),d=u==="H",_=p==="12"?[...l].reverse():l,m=_.findIndex(h=>h.some(b=>b===s));return{isSafe:_.slice(m).every(h=>{const b=d?[...h].reverse():h,T=b.findIndex(y=>gn(y)===gn(s));return b.slice(T).every(y=>t[y]===ue||i.includes(y)||y===s)}),isComplete:t[s]!==ue}}return{isSafe:!1}},gn=e=>e.slice(0,1),cp=e=>e.slice(1),nc=e=>parseInt(e.slice(1))-1,cs=e=>{const{nozzles:t,channels:r}=e;if(r===8&&t===c.SINGLE)return"H1";if(r===96){if(t===c.COLUMN)return"A12";if(t===c.SINGLE)return"H12"}return"A1"},Ga=e=>{const{wellSets:t,nozzles:r,channels:n,primaryNozzle:a}=e;return r===c.ROW?t.map(s=>s[0]):t.map(s=>n===96&&r===c.ALL?a:r===c.COLUMN||n===8&&r===c.ALL||n===8&&r===c.PARTIAL_COLUMN?gn(a)==="H"?s[s.length-1]:s[0]:(console.assert(s.length===1,"Well set for SINGLE nozzle configuration should have exactly 1 well"),s[0]))},tA=e=>{const{pipetteSpecs:t,tiprackUri:r,nozzles:n}=e,{channels:a}=t,s=rA(a,n),o=t.pickUpTipConfigurations.pressFit.configurationsByNozzleMap[s]?.default.tipOverlaps;if(o==null)return console.error(`No tip overlaps found for ${n} and ${s} overlap.`),0;const i=Math.max(...Object.keys(o).map(l=>Number(l.slice(1))));return o[`v${i}`]?.[r]??o[`v${i}`]?.default??0},rA=(e,t)=>{if(e===1)return"SingleA1";if(e===8)return t===c.SINGLE?"SingleH1":"Full";if(e===96){if(t===c.SINGLE)return"SingleH12";if(t===c.COLUMN)return"Column12";if(t===c.ROW)return"RowA"}return"Full"},nA=e=>{const{channels:t,boundingBox:r,robotType:n}=e,a=c.getRobotDefFromRobotType(n),{paddingOffsets:s}=a,{front:o,rear:i,leftSide:l,rightSide:u}=s,[p,d]=a.extents,[f,_]=r,{x:m,y:h}=f,{x:b,y:T}=_;if(t===96){if(b<l)return!1;const y=p+u;if(m>y)return!1}if(t!==1){if(h<o)return!1;const y=d+i;if(T>y)return!1}return!0},nb=e=>{const{channels:t,nozzleMap:r}=e;if(t===1)return 0;const[n,a]=["A1","B1"].map(o=>r[o][1]);return Math.abs(n-a)},ab=e=>{const t=aA(e),r=sA(e);return{x:t,y:r}},aA=e=>{const{primaryNozzle:t,nozzleConfiguration:r,specs:n,labwareDef:a}=e,{channels:s}=n;if(s!==96)return 0;const{ordering:o}=a,i=o.length===1;if(!i)return 0;let l;const u=cp(t)==="12"?1:-1;if(r===c.ALL&&s===96||r===c.ROW)l=12;else if(r===c.QUADRANT)l=6;else return u*YS;const p=nb(n);return i?(l-1)*p/2*u:0},sA=e=>{const{wellTargetName:t,primaryNozzle:r,nozzleConfiguration:n,specs:a,labwareDef:s}=e,{channels:o}=a;if(o===1)return 0;const i=nb(a),{ordering:l}=s,u=l.findIndex(f=>f.includes(t));if(l[u].length!==1)return 0;if(n===c.PARTIAL_COLUMN){const _=-1*(8-c.PARTIAL_NOZZLE_MAP[r])*i,m=7*i/2;return _+m}const d=gn(r)==="H"?-1:1;return 7*i/2*d};function sb(e){const t=e.length===1?e[0]:null;return t!=null&&"steps"in t?{numRepetitions:t.repetitions,repeatingProfileSteps:t.steps}:{numRepetitions:1,repeatingProfileSteps:pp(e)}}function pp(e){return e.flatMap(t=>"steps"in t?K_(t.steps,t.repetitions):t)}const oA=e=>{switch(e.commandCreatorFnName){case"consolidate":return O(_b,e);case"delay":return O(me,e);case"waitForModuleTask":return O(Lb,e);case"distribute":return O(yb,e);case"transfer":return O(Ib,e);case"mix":return O(hb,e);case"moveLabware":return O(N_,e);case"captureImage":return O(w_,e);case"engageMagnet":return O(R_,e);case"disengageMagnet":return O(O_,e);case"setTemperature":return O(Pc,e);case"deactivateTemperature":return O(L_,e);case"waitForTemperature":return O(Fc,e);case"thermocyclerProfile":return O(Tb,e);case"thermocyclerState":return O(gb,e);case"heaterShaker":return O(bb,e);case"comment":return O(S_,e);case"absorbanceReaderOpenLid":return O(I_,e);case"absorbanceReaderCloseLid":return O(ws,e);case"absorbanceReaderRead":return O(ub,e);case"absorbanceReaderInitialize":return O(lb,e);case"flexStackerEmpty":return O(k_,{...e,strategy:"manualWithPause"});case"flexStackerFillItems":return O(v_,e);case"flexStackerRetrieve":return O(P_,e);case"flexStackerStore":return O(C_,{...e,strategy:"automatic"});case"vacuumCloseVent":return O(Da,e);case"vacuumOpenVent":return O(M_,e);case"vacuumSetPumpPower":return O(Nc,e);case"vacuumSetPumpPressure":return O(Dc,e);case"vacuumStartRunProfile":return O(Mc,e);case"vacuumStopPump":return O(U_,e);case"vacuumCloseVentSetPumpPressure":return O(wb,e);case"vacuumCloseVentSetPumpPower":return O(Eb,e);case"vacuumCloseVentStartProfile":return O(Sb,e);case"airGapInPlace":return O(At,e);case"aspirate":return O(At,e);case"aspirateInPlace":return O(Na,e);case"aspirateWhileTracking":return O(fI,e);case"blowOutInPlace":return O(Dn,e);case"blowout":return O(Rc,e);case"configureForVolume":return O(An,e);case"configureNozzleLayout":return O(A_,e);case"dispense":return O(kc,e);case"dispenseInPlace":return O(Xe,e);case"dispenseWhileTracking":return O(mI,e);case"dropTip":return O(Hr,e);case"dropTipInPlace":return O(Ss,e);case"home":return O(hI,e);case"moveRelative":return O(_I,e);case"moveToAddressableArea":return O(Fe,e);case"moveToAddressableAreaForDropTip":return O(vc,e);case"moveToCoordinates":return O(yI,e);case"moveToWell":return O(B,e);case"pickUpTip":return O(ss,e);case"prepareToAspirate":return O(Lt,e);case"touchTip":return O(Et,e);case"tryLiquidProbe":return O(bI,e);case"heaterShaker/closeLabwareLatch":return O(q_,e);case"heaterShaker/openLabwareLatch":return O($_,e);case"heaterShaker/setAndWaitForShakeSpeed":return O(V_,e);case"heaterShaker/deactivateHeater":return O(Gu,e);case"heaterShaker/deactivateShaker":return O(Wu,e);case"thermocycler/closeLid":return O(Uc,e);case"thermocycler/openLid":return O(H_,e);case"thermocycler/deactivateBlock":return O(B_,e);case"thermocycler/deactivateLid":return O(x_,e);case"thermocycler/setTargetBlockTemperature":return O(z_,e);case"thermocycler/setTargetLidTemperature":return O(qc,e);case"thermocycler/startRunExtendedProfile":return O(D_,e)}},D=DT;function ob(e){return Object.keys(e).sort((r,n)=>{const a=W(e[r].stack),s=W(e[n].stack),o=parseInt(a),i=parseInt(s);return ve.includes(a)&&ve.includes(s)?r.localeCompare(n):ve.includes(a)?1:ve.includes(s)?-1:o-i})}function ib(e){const{pipetteId:t,tiprackId:r,invariantContext:n,robotState:a,nozzles:s,primaryNozzle:o}=e,i=n.pipetteEntities[t]?.spec?.channels,l=n.labwareEntities[r]?.def,u=a.tipState.tipracks[r];if(!i||!l||!u)return console.assert(!1,`Pipette ${t} missing channels/spec or tiprack definition`),null;const p=g=>u[g]===Ra,d=c.orderWells(l.ordering,"t2b","l2r"),f=c.orderWells(l.ordering,"b2t","l2r"),_=g=>g.find(p)??null,m=g=>[...g].reverse().find(p)??null,h=g=>g.find(k=>k.every(p))??null,b=g=>[...g].reverse().find(k=>k.every(p))??null,T=i===8&&s===c.SINGLE,y=T&&o===c.H1_NOZZLE,A=T&&o===c.A1_NOZZLE,w=i===96&&s===c.SINGLE,I=w&&o===c.H12_NOZZLE,S=w&&o===c.A12_NOZZLE,L=w&&o===c.H1_NOZZLE,E=w&&o===c.A1_NOZZLE;if(i===1||y||I)return _(d);if(A)return _(f);if(s===c.PARTIAL_COLUMN){const g=_(d);if(!g)return null;const k=d.indexOf(g);return d[k]??null}if(s===c.ALL&&i===8)return h(l.ordering)?.[0]??null;if(E)return m(d);if(S)return _(f);if(L)return m(f);if(s===c.COLUMN){const g=l.ordering;return(o===c.A1_NOZZLE?b(g):h(g))?.[0]??null}if(s===c.ROW){const g=l.ordering,k=g[0].map((q,$)=>g.map(ee=>ee[$]));return(o===c.A1_NOZZLE?b(k):h(k))?.[0]??null}return s===c.ALL&&i===96?d.every(p)?d[0]:null:(console.assert(!1,`Unhandled _getNextTip case for pipette ${t}`),null)}function Wa(e,t,r,n,a,s){const o=r.pipetteEntities[e];if(!o)throw new Error(`cannot getNextTiprack, no pipette entity for pipette "${e}"`);const i=[],l=ob(n.labware).filter(m=>{console.assert(r.labwareEntities[m]?.labwareDefURI!=null,`cannot getNextTiprack, no labware entity for "${m}"`);const h=W(n.labware[m].stack),b=ly(h),T=iy({labwareId:m,labwareRobotState:n.labware,labwareEntities:r.labwareEntities});if(b&&T&&c.getIsTiprack(r.labwareEntities[m].def))return i.push(m),!1;const y=r.labwareEntities[m].labwareDefURI;return b&&y===t});let u=l;const p=o.spec.channels===96,d=[];p&&(u=u.filter(m=>{const h=n.labware[m].stack[1],b=r.labwareEntities[h],T=b?.def.parameters.loadName==="opentrons_flex_96_tiprack_adapter"&&c.getLabwareDefIsStandard(b?.def),y=s===c.ALL?T:!T;return y||d.push(m),y}));let f=null,_=null;for(const m of u){const h=ib({pipetteId:e,tiprackId:m,nozzles:s,invariantContext:r,robotState:n,primaryNozzle:a}),{isSafe:b}=h!=null?ft({robotState:n,invariantContext:r,pipetteId:e,labwareId:m,wellTargetName:h,primaryNozzle:a,nozzleConfiguration:s}):{isSafe:!1},{isSafe:T,isComplete:y=!1}=h!=null?up({tipState:n.tipState.tipracks[m],primaryNozzle:a,channels:o.spec.channels,nozzleConfiguration:s,wellName:h,tiprackDef:r.labwareEntities[m].def}):{isSafe:!1};if(h&&b&&T&&y){f=m,_=h;break}}return f&&_?{nextTiprack:{tiprackId:f,well:_},tipracks:{totalTipracks:l.length,excludedBy96Channel:d.length,excludedByLid:i.length,filteredSortedTiprackIds:u}}:{nextTiprack:null,tipracks:{totalTipracks:l.length,excludedBy96Channel:d.length,excludedByLid:i.length,filteredSortedTiprackIds:u}}}function qs(e,t,r){const n=t.pipetteEntities[e],a=n.spec.liquids.default.maxVolume,s=n.tiprackLabwareDef;let o=null;for(const l of s)if(c.getLabwareDefURI(l)===r){o=l;break}const i=c.getTiprackVolume(o??s[0]);return!a||!i?(console.assert(!1,`getPipetteEffectiveMaxVol expected tiprackMaxVol and pipette maxVolume to be > 0, got',
|
|
126
|
+
${a}, ${i}`),NaN):_T([i,a])??NaN}function Ot(e,t){return t in e.modules||console.warn(`getModuleState expected module id "${t}" to be in robot state`),e.modules[t]?.moduleState}const $s=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.THERMOCYCLER_MODULE_TYPE?r:null},zn=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.ABSORBANCE_READER_TYPE?r:null},mt=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.FLEX_STACKER_MODULE_TYPE?r:null},it=(e,t)=>{const r=e.modules[t]?.moduleState;return r&&r.type===c.VACUUM_MODULE_TYPE?r:null},lb=(e,t,r)=>{const{moduleId:n,measureMode:a,sampleWavelengths:s,referenceWavelength:o}=e,i=zn(r,n),l=[];if(i==null&&l.push(Q()),l.length>0)return{errors:l};const u=[O(ws,{moduleId:n}),O(g_,{moduleId:n,measureMode:a,sampleWavelengths:s,referenceWavelength:o??void 0})];return ae(u,t,r)},ub=(e,t,r)=>{const n=[],a=zn(r,e.moduleId);if((a==null||e.moduleId==null)&&n.push(Q()),a?.initialization==null&&n.push(xb()),n.length>0)return{errors:n};const{moduleId:s,fileName:o}=e,i=[O(ws,{moduleId:s}),O(E_,{moduleId:s,fileName:o})];return ae(i,t,r)},iA=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s,volume:o}=e,i=[O(Fe,{pipetteId:n,fixtureId:a,offset:wt}),R(Lt,{pipetteId:n}),O(At,{pipetteId:n,volume:o,flowRate:s})];return ae(i,t,r)},lA=(e,t,r)=>{const{pipetteId:n,volume:a,flowRate:s,wasteChuteId:o}=e,i=[O(Fe,{pipetteId:n,fixtureId:o,offset:wt}),R(Lt,{pipetteId:n}),O(At,{pipetteId:n,flowRate:s,volume:a})];return ae(i,t,r)},uA=(e,t,r)=>{const{labwareId:n,wellName:a,flowRate:s,pipetteId:o,volume:i,type:l}=e,u=t.pipetteEntities[o].pythonName,p=l==="aspirate"?[]:[R(Lt,{pipetteId:o})],d=()=>({commands:[],python:`${u}.air_gap(${[`volume=${i}`,`height=${xu}`,`flow_rate=${s}`].join(", ")})`}),f=[R(B,{pipetteId:o,labwareId:n,wellName:a,wellLocation:{origin:"top",offset:{z:xu,x:0,y:0}}}),...p,R(At,{pipetteId:o,volume:i,flowRate:s}),d];return ae(f,t,r)},cb=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s}=e,{pipetteEntities:o,trashBinEntities:i}=t,l=o[n].pythonName,u=i[a].pythonName,p=()=>({commands:[],python:`${l}.flow_rate.blow_out = ${s}
|
|
122
127
|
${l}.blow_out(${u})`}),d=[R(Fe,{pipetteId:n,fixtureId:a,offset:wt}),R(Dn,{pipetteId:n,flowRate:s}),p];return ae(d,t,r)},pb=(e,t,r)=>{const{pipetteId:n,flowRate:a,wasteChuteId:s}=e,{pipetteEntities:o,wasteChuteEntities:i}=t,l=o[n].pythonName,u=i[s].pythonName,p=()=>({commands:[],python:`${l}.flow_rate.blow_out = ${a}
|
|
123
|
-
${l}.blow_out(${u})`}),d=[R(Fe,{pipetteId:n,fixtureId:s,offset:wt}),R(Dn,{pipetteId:n,flowRate:a}),p];return ae(d,t,r)};var Mu,yh;function
|
|
124
|
-
${
|
|
128
|
+
${l}.blow_out(${u})`}),d=[R(Fe,{pipetteId:n,fixtureId:s,offset:wt}),R(Dn,{pipetteId:n,flowRate:a}),p];return ae(d,t,r)};var Mu,yh;function cA(){if(yh)return Mu;yh=1;var e=T_();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return Mu=t,Mu}var Fu,bh;function pA(){if(bh)return Fu;bh=1;var e=gy(),t=Oc(),r=cA(),n=Math.ceil,a=Math.max;function s(o,i,l){(l?t(o,i,l):i===void 0)?i=1:i=a(r(i),0);var u=o==null?0:o.length;if(!u||i<1)return[];for(var p=0,d=0,f=Array(n(u/i));p<u;)f[d++]=e(o,p,p+=i);return f}return Fu=s,Fu}var dA=pA();const db=xe(dA),tr=e=>{const{labwareDef:t,wells:r,primaryNozzle:n}=e,a=c.PARTIAL_NOZZLE_MAP[n]-1,{ordering:s,parameters:o}=t;return r.map(i=>{const l=s.find(p=>p.includes(i));if(l==null)return console.warn(`Could not find column for ${i} in ${o.loadName}`),i;if(l.length===1)return i;const u=l.indexOf(i);return u===-1?(console.warn(`Could not find column index of ${i}`),i):l[u+a]})},fb=(e,t,r)=>{const{pipetteId:n,trashLocation:a}=e;let s=[];const o=$c(a);if(r.tipState.pipettes[n]?.hasTip){const i=t.pipetteEntities[n].pythonName,l=()=>({commands:[],python:`${i}.drop_tip()`});s=[R(vc,{pipetteId:n,addressableAreaName:o}),R(Ss,{pipetteId:n}),l]}return ae(s,t,r)},mb=(e,t,r)=>{const n=wt,{pipetteId:a,wasteChuteId:s}=e,{pipetteEntities:o,wasteChuteEntities:i}=t;let l=[];if(!r.tipState.pipettes[a].hasTip)l=[];else{const u=o[a].pythonName,p=i[s].pythonName,d=()=>({commands:[],python:`${u}.drop_tip(${p})`});l=[R(Fe,{pipetteId:a,fixtureId:s,offset:n}),R(Ss,{pipetteId:a}),d]}return ae(l,t,r)},Ya=(e,t,r)=>{const{pipette:n,dropTipLocation:a,nozzles:s,primaryNozzle:o,tipRack:i,isFromMixCommand:l=!1,tipSelectionArgs:u}=e,p=r.pipettes[n].nozzles,d=r.pipettes[n].tiprackId,f=t.pipetteEntities[n]?.spec,_=f?.channels;let m=null;if(u==null){if(i==null)return{errors:[Zb()]};const g=Wa(n,i,t,r,o,s);m=g.nextTiprack;const k=g.tipracks,{excludedBy96Channel:v,excludedByLid:q}=k??{},$=m==null&&_===96&&v>0;if(s===c.ALL&&$)return{errors:[Mb()]};if(s===c.COLUMN&&$)return{errors:[Fb()]};if(q>0&&m==null)return{errors:[aT()]}}else m={tiprackId:u.tipRackId,well:u.tipWell};if(m==null)return{errors:[Db()]};const h=(f?.displayCategory==="FLEX"||_===96)??!1;if(!f)return{errors:[pt({pipette:n})]};const b=t.labwareEntities[m.tiprackId]?.def,T=t.wasteChuteEntities[a]!=null,y=t.trashBinEntities[a]!=null;if(!b)return{errors:[dt({actionName:"replaceTip",labware:m.tiprackId})]};const A=r.tipState.pipettes[n]?.hasTip;if(!a||!T&&!y&&A)return{errors:[Rn()]};if(Vn({pipette:n,labware:m.tiprackId,invariantContext:t,prevRobotState:r}))return{errors:[Ta()]};const w=qn(m.tiprackId,r.labware);if(Hn(r.modules,w,h?c.FLEX_ROBOT_TYPE:c.OT2_ROBOT_TYPE))return{errors:[Ia()]};if(!h){if(Bn(r.modules,w))return{errors:[ga()]};if(xn(r.modules,w,f))return{errors:[Ea()]}}const I=l?O:R,S=[];_!==1&&e.nozzles!=null&&(e.nozzles!==p||m.tiprackId!==d)&&S.push(O(A_,{configurationParams:{primaryNozzle:o,style:e.nozzles},pipetteId:e.pipette}));const L=u?St:cc;let E=[I(Hr,{pipette:n,dropTipLocation:a}),...S,I(ss,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})];return T&&(E=[I(mb,{pipetteId:e.pipette,wasteChuteId:t.wasteChuteEntities[e.dropTipLocation].id}),...S,I(ss,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})]),y&&(E=[I(fb,{pipetteId:n,trashLocation:t.trashBinEntities[e.dropTipLocation].location}),...S,I(ss,{pipetteId:n,labwareId:m.tiprackId,wellName:m.well,nozzles:e.nozzles,tipTrackingOption:L,primaryNozzle:o})]),ae(E,t,r)},Th=(e=0)=>e>0?[R(me,{seconds:e})]:[],fA=e=>()=>{const{invariantContext:t,pipette:r,times:n,volume:a,aspirateDelaySeconds:s,dispenseDelaySeconds:o,finalPushOut:i,aspirateFlowRateUlSec:l,dispenseFlowRateUlSec:u,positionArgs:p}=e,{pipetteEntities:d,labwareEntities:f}=t,_=d[r].pythonName;let m=null;if(p!=null){const{labware:b,well:T,wellOrigin:y,xOffset:A,yOffset:w,zOffset:I}=p,S=f[b].pythonName,L={origin:y,offset:{x:A,y:w,z:I}};m=`location=${S}[${N(T)}]${Bt(L)}`}const h=[`repetitions=${n}`,`volume=${a}`,...m!=null?[m]:[],`aspirate_flow_rate=${l}`,`dispense_flow_rate=${u}`,...s!=null&&s!==0?[`aspirate_delay=${s}`]:[],...o!=null&&o!==0?[`dispense_delay=${o}`]:[],...i!=null?[`final_push_out=${i}`]:[]];return{commands:[],python:`${_}.mix(
|
|
129
|
+
${G(h.join(`,
|
|
125
130
|
`))},
|
|
126
|
-
)`}},Dr=e=>{const{pipette:t,volume:r,times:n,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:s,aspirateDelaySeconds:o=0,dispenseDelaySeconds:i=0,finalPushOut:l,invariantContext:u,liquidClass:p,tiprack:d,moveToWellParams:f,generatePython:_}=e,m=
|
|
127
|
-
${
|
|
131
|
+
)`}},Dr=e=>{const{pipette:t,volume:r,times:n,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:s,aspirateDelaySeconds:o=0,dispenseDelaySeconds:i=0,finalPushOut:l,invariantContext:u,liquidClass:p,tiprack:d,moveToWellParams:f,generatePython:_}=e,m=fA({invariantContext:u,pipette:t,volume:r,times:n,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:s,aspirateDelaySeconds:o,dispenseDelaySeconds:i,finalPushOut:l,positionArgs:f!=null?{labware:f.labwareId,well:f.wellName,wellOrigin:f.wellLocation?.origin??c.WELL_ORIGIN_BOTTOM,xOffset:f.wellLocation?.offset?.x??0,yOffset:f.wellLocation?.offset?.y??0,zOffset:f.wellLocation?.offset?.z??0}:void 0}),h=u.pipetteEntities[t].spec,b=c.getByVolumeValue({liquidClass:p,pipetteSpecs:h,tiprackDefUri:d,targetVolume:r,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,T=c.getByVolumeValue({liquidClass:p,pipetteSpecs:h,tiprackDefUri:d,targetVolume:r,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,A=f!=null?[R(B,{...f,wellLocation:{...f.wellLocation}})]:[];for(let w=0;w<n;w++)A.push(R(Na,{pipetteId:t,volume:r,flowRate:a,...b>0?{correctionVolume:b}:{}}),...Th(o),R(Xe,{pipetteId:t,volume:r,flowRate:s,...w<n-1?{pushOut:0}:l==null?{}:{pushOut:l},...T>0?{correctionVolume:T}:{}}),...Th(i));return[...A,..._?[m]:[]]},hb=(e,t,r)=>{const{pipette:a,labware:s,wells:o,volume:i,times:l,changeTip:u,aspirateFlowRateUlSec:p,dispenseFlowRateUlSec:d,blowoutFlowRateUlSec:f,blowoutOffsetFromTopMm:_,dropTipLocation:m,tipRack:h,positionReference:b,xOffset:T,yOffset:y,zOffset:A,finalPushOut:w,nozzles:I,primaryNozzle:S,tipsSelected:L,tiprackSelected:E,tipTracking:g}=e,k=e.aspirateDelaySeconds??0,v=e.dispenseDelaySeconds??0,q=t.pipetteEntities[a]?.spec.channels!==1;if(r.pipettes[a]==null||t.pipetteEntities[a]==null)return{errors:[pt({pipette:a})]};if(r.labware[s]==null)return{errors:[dt({actionName:"mix",labware:s})]};const $=W(r.labware[s]?.stack);if(Object.keys(t.wasteChuteEntities).length>0&&$===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)return{errors:[wa()]};const de=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],Te=de.length>0?de[0]:null,se=Object.values(t.labwareEntities).find(({labwareDefURI:Y})=>Y===m),Ie=se!=null&&c.getIsTiprack(se.def),Pe=t.wasteChuteEntities[m]!=null,He=t.trashBinEntities[m]!=null,Ve=r.pipettes[a]?.tipWell!=null;if(m==null||Ie&&Te==null&&u!=="never"&&Ve||!Ie&&!Pe&&!He)return{errors:[Rn()]};if(q){const Y=ft({robotState:r,invariantContext:t,pipetteId:a,labwareId:s,wellLocationOffset:{x:T,y},wellTargetName:o[0],primaryNozzle:S,nozzleConfiguration:I});if(!Y.isSafe)return{errors:[$t({unsafePipetteMovementReason:Y.reason})]};const C=ft({robotState:r,invariantContext:t,pipetteId:a,labwareId:s,wellLocationOffset:{x:T,y},wellTargetName:o[0],primaryNozzle:S,nozzleConfiguration:I});if(!C.isSafe)return{errors:[$t({unsafePipetteMovementReason:C.reason})]}}const te=c.LOW_VOLUME_PIPETTES.includes(t.pipetteEntities[a].name),Se=te?[O(An,{pipetteId:a,volume:i})]:[],ze=t.pipetteEntities[a].spec,Ee=g===St&&E!=null&&L!=null&&L.length>0?Ga({wellSets:L,nozzles:I,channels:ze.channels,primaryNozzle:S}):null,X=Sn(o,(Y,C)=>{let P=[];if(u==="always"||u==="once"&&C===0){const ce=Ee?.shift();P=[O(Ya,{pipette:a,primaryNozzle:S,dropTipLocation:Ie&&Te!=null?Te:m,tipRack:h,nozzles:I,...g===St&&ce!=null&&E!=null?{tipSelectionArgs:{tipRackId:E,tipWell:ce}}:{},isFromMixCommand:!0})]}const V=te||e.blowoutLocation!=null&&C>0?[O(Lt,{pipetteId:a})]:[],M=e.touchTip?[O(Et,{pipetteId:a,labwareId:s,wellName:Y,zOffsetFromTop:e.touchTipMmFromTop})]:[],oe=X_({pipette:e.pipette,sourceLabwareId:e.labware,sourceWell:Y,destLabwareId:e.labware,destWell:Y,blowoutLocation:e.blowoutLocation,flowRate:f,offsetFromTopMm:_,invariantContext:t}),x=[...Object.keys(t.wasteChuteEntities),...Object.keys(t.trashBinEntities)].some(ce=>ce===e.blowoutLocation)?[...M,...oe]:[...oe,...M],F=Ie&&(C===o.length-1||u==="always")?[O(Hr,{pipette:a,dropTipLocation:h,isReturnTip:Ie})]:[],H=Dr({pipette:a,volume:i,times:l,aspirateFlowRateUlSec:p,dispenseFlowRateUlSec:d,invariantContext:t,liquidClass:null,tiprack:h,finalPushOut:w,aspirateDelaySeconds:k,dispenseDelaySeconds:v,moveToWellParams:{pipetteId:a,labwareId:s,wellName:Y,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[b],offset:{x:T,y,z:A}}},generatePython:!0});return[...P,...Se,...V,...H,...x,...F]});return ae(X,t,r)},_b=(e,t,r)=>{const{aspirateDelay:n,aspirateFlowRateUlSec:a,aspiratePositionReference:s,aspirateRetractDelay:o,aspirateRetractPositionReference:i,aspirateRetractSpeed:l,aspirateRetractXOffset:u,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:f,aspirateSubmergePositionReference:_,aspirateSubmergeSpeed:m,aspirateSubmergeXOffset:h,aspirateSubmergeYOffset:b,aspirateSubmergeZOffset:T,aspirateXOffset:y,aspirateYOffset:A,aspirateZOffset:w,blowoutFlowRateUlSec:I,blowoutLocation:S,changeTip:L,destLabware:E,destWell:g,dispenseDelay:k,dispenseFlowRateUlSec:v,dispensePositionReference:q,dispenseRetractPositionReference:$,dispenseRetractXOffset:ee,dispenseRetractYOffset:de,dispenseRetractZOffset:Te,dispenseSubmergeDelay:se,dispenseSubmergePositionReference:Ie,dispenseSubmergeSpeed:Pe,dispenseSubmergeXOffset:He,dispenseSubmergeYOffset:Ve,dispenseSubmergeZOffset:te,dispenseXOffset:Se,dispenseYOffset:ze,dispenseZOffset:Ce,dropTipLocation:Ee,liquidClass:X,mixInDestination:Y,nozzles:C,pipette:P,primaryNozzle:V,pushOut:M,sourceLabware:oe,sourceWells:U,tipRack:z,tipTracking:x,tiprackSelected:F,tipsSelected:H,touchTipAfterAspirate:ce,touchTipAfterAspirateMmFromEdge:Ue,touchTipAfterAspirateOffsetMmFromTop:Je,touchTipAfterAspirateSpeed:Be,touchTipAfterDispense:pe,touchTipAfterDispenseMmFromEdge:et,touchTipAfterDispenseOffsetMmFromTop:ht,touchTipAfterDispenseSpeed:Rt,stepNumber:_t,volume:Re}=e,{pipetteEntities:tt,labwareEntities:ge,trashBinEntities:ke,wasteChuteEntities:Ne}=t,re="consolidate",ne=[],kt=r.pipettes[P],Ge=tt[P]?.spec.channels!==1,K=e.aspirateAirGapVolume??0,he=e.dispenseAirGapVolume??0;kt==null&&ne.push(pt({pipette:P})),(E==null||ge[E]==null&&ke[E]==null&&Ne[E]==null)&&ne.push(kh());const _r=W(r.labware[E]?.stack),rt=W(r.labware[oe]?.stack);Object.keys(Ne).length>0&&(_r===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||rt===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&ne.push(wa());const _e=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],nt=_e.length>0?_e[0]:null,Wr=Object.values(t.labwareEntities).find(({labwareDefURI:ye})=>ye===Ee),vt=Wr!=null&&c.getIsTiprack(Wr.def),Ka=t.wasteChuteEntities[Ee]!=null,Yr=t.trashBinEntities[Ee]!=null,sr=r.tipState.pipettes[P]?.hasTip;(Ee==null||vt&&nt==null&&L!=="never"&&sr||!vt&&!Ka&&!Yr)&&ne.push(Rn());let We,J;if(L==="never"){const ye=r.tipState.pipettes[P]?.tiprackURI;We=t.labwareEntities[ye??""],J=We?.labwareDefURI}else We=Object.values(ge).find(({labwareDefURI:ye})=>ye===z),J=z;We==null&&(L==="never"?ne.push(xt({actionName:re,pipette:P})):ne.push(dt({actionName:re,labware:J})));const{def:Pt=null}=We??{},{spec:we,name:lt,pythonName:Z}=tt[P],j=c.getAllLiquidClassDefs()[X===c.NONE_LIQUID_CLASS_NAME||X==null?c.WATER_LIQUID_CLASS_NAME:X].byPipette?.find(({pipetteModel:ye})=>ye===c.getFlexNameConversion(we))?.byTipType.find(({tiprack:ye})=>ye===J)??null,{aspirate:ut}=j??{},{multiWellHandling:fe}=zc({pipetteSpecs:we,tiprackDefinition:Pt,volume:Re,path:"multiAspirate",numAspirateWells:U.length,numDispenseWells:1,aspirateAirGapByVolume:ut?.retract.airGapByVolume??[],conditioningByVolume:null,disposalByVolume:null}),{numWellsToFitInTip:at}=fe;if((!fe.isSupported||at==null||at===1)&&ne.push(eT()),Ge&&C!==c.ALL){const ye=ft({robotState:r,invariantContext:t,pipetteId:P,labwareId:oe,wellLocationOffset:{x:y,y:A},primaryNozzle:V,nozzleConfiguration:C});ye.isSafe||ne.push($t({unsafePipetteMovementReason:ye.reason}));const ie=ft({robotState:r,invariantContext:t,pipetteId:P,labwareId:E,wellLocationOffset:{x:Se,y:ze},primaryNozzle:V,nozzleConfiguration:C});ie.isSafe||ne.push($t({unsafePipetteMovementReason:ie.reason}))}const zt=g!=null?ge[oe]?.def.wells[g]?.depth:null,Ct=c.getMmFromBottom(Ce,q,zt),Kr=c.getMmFromBottom(te,Ie,zt),or=c.getMmFromBottom(Te,$,zt);if(Ct!=null&&Kr!=null&&Ct>Kr&&ne.push(Qb()),Ct!=null&&or!=null&&Ct>or&&ne.push(Jb()),ne.length>0)return{errors:ne};const{tipracks:yr}=Wa(P,J,t,r,V,C),ir=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:Re,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ae=ke[E]?.pythonName??Ne[E]?.pythonName,Nt=ke[Ee]?.pythonName??Ne[Ee]?.pythonName,br=S==null?null:ke[S]?.pythonName??Ne[S]?.pythonName,Tr=ge[oe].pythonName,Xr=ge[E]?.pythonName,gr=C===c.PARTIAL_COLUMN?tr({labwareDef:ge[oe].def,wells:U,primaryNozzle:V}):U,Zr=(C===c.PARTIAL_COLUMN&&g!=null&&ge[E]!=null?tr({labwareDef:ge[E].def,wells:[g],primaryNozzle:V}):[g])[0],Qr=gr.map(ye=>`${Tr}[${N(ye)}]`).join(", "),Jr=Zr!=null&&Xr!=null?`${Xr}[${N(Zr)}]`:null,en=[`name=${N(`${e.commandCreatorFnName}_step_${_t}`)}`,...X!=null?[`base_liquid_class=${ja(X,!0)}`]:[],`properties=${Ms({args:e,pipetteName:c.isFlexPipette(lt)?c.getFlexNameConversion(we):lt,tiprackUri:J,liquidClassValuesForTip:j})}`],Gn=`${be}.define_liquid_class(
|
|
132
|
+
${G(en.join(`,
|
|
128
133
|
`))},
|
|
129
134
|
)`,jt=x===St&&F!=null&&H!=null&&H.length>0?Ga({wellSets:H,nozzles:C,channels:we.channels,primaryNozzle:V}):null,rn=jt!=null&&We!=null&&C===c.PARTIAL_COLUMN?tr({labwareDef:We?.def,wells:jt,primaryNozzle:V}):jt,nn=F!=null?ge[F]?.pythonName:null,an=rn?.map(ye=>`${nn}[${N(ye)}]`).join(", "),Wn=[`volume=${Re}`,`source=[${Qr}]`,`dest=${Jr!=null?`[${Jr}]`:Ae}`,`new_tip=${N(Us(L))}`,...vt?["return_tip=True",...br!=null?[`trash_location=${br}`]:[]]:[`trash_location=${Nt}`,"keep_last_tip=True"],...we.channels>1?["group_wells=False"]:[],...yr.filteredSortedTiprackIds.length>0?[Fs({labwareEntities:ge,tiprackIds:yr.filteredSortedTiprackIds})]:[],`liquid_class=${Gn}`,...jt!=null&&nn!=null?[`tips=[${an}]`]:[]],Yn=()=>({commands:[],python:`${Z}.consolidate_with_liquid_class(
|
|
130
|
-
${
|
|
135
|
+
${G(Wn.join(`,
|
|
131
136
|
`))},
|
|
132
|
-
)`}),sn=db(U,at),Gt=c.LOW_VOLUME_PIPETTES.includes(
|
|
133
|
-
${
|
|
137
|
+
)`}),sn=db(U,at),Gt=c.LOW_VOLUME_PIPETTES.includes(lt)?[R(An,{pipetteId:P,volume:Re})]:[],Kn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[Ie],offset:{x:He,y:Ve,z:te}},Dt={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[$],offset:{x:ee,y:de,z:Te}},lr=n!=null?[R(me,{seconds:n.seconds})]:[],Xn=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:he,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ir=k!=null?[R(me,{seconds:k.seconds})]:[],Zn=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:K,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,on=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:K,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,Qn=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:he,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,ln=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:he,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,Er=Ur({retractZOffset:Te,retractPositionReference:$,labwareId:E,labwareEntities:ge,well:g}),wr=!Er&&g!=null?[R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],Xa=[...Sn(sn,(ye,ie)=>{const yt=(Oe,Kt=!0)=>he>0&&!(L==="never"&&De&&Oe)?[...Kt?wr:[],R(Lt,{pipetteId:P}),R(At,{pipetteId:P,volume:he,flowRate:Qn,...Xn>0?{correctionVolume:Xn}:{}}),...lr]:[],Mt=Oe=>g!=null&&pe?[R(Et,{pipetteId:P,labwareId:E,wellName:g,...et!=null?{mmFromEdge:et}:{},zOffsetFromTop:ht,...Rt!=null?{speed:Rt}:{}}),...yt(Oe).length>0&&Er?[R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:Dt})]:[]]:[],Le=ie===0,De=ie===sn.length-1,ea=ye.length,le=Re*ea,Ye=L==="always"||L==="once"&&Le;let ur=[];if(Ye){const Oe=jt?.shift();ur=[O(Ya,{pipette:P,primaryNozzle:V,nozzles:C,dropTipLocation:vt&&nt!=null?nt:Ee,tipRack:J,...x===St&&Oe!=null&&F!=null?{tipSelectionArgs:{tipRackId:F,tipWell:Oe}}:{}})]}const Sr=Sn(ye,(Oe,Kt)=>{const Rr=Kt===0;let Tt=0,Xt=v;Rr&&!Ye&&!Le?(Tt=he,Xt=ln):Rr||(Tt=K,Xt=on);const na={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_],offset:{x:h,y:b,z:T}},dn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:u,y:p,z:d}},fn=Ur({retractZOffset:d,retractPositionReference:i,labwareId:oe,labwareEntities:ge,well:Oe}),aa=!fn&&Oe!=null?[R(B,{pipetteId:P,labwareId:oe,wellName:Oe,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],mn=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:Tt,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,kr=Rr?[...c.LOW_VOLUME_PIPETTES.includes(t.pipetteEntities[P].name)?[R(An,{pipetteId:P,volume:le})]:[],R(Lt,{pipetteId:P})]:[],sa=Tt>0?[R(Xe,{pipetteId:P,volume:Tt,flowRate:Xt,...mn>0?{correctionVolume:mn}:{},isAirGap:!0,pushOut:0}),...Ir]:[],vr=[...[R(B,{pipetteId:P,labwareId:oe,wellName:Oe,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],...sa,...kr],hn=[R(B,{pipetteId:P,labwareId:oe,wellName:Oe,wellLocation:na}),R(B,{pipetteId:P,labwareId:oe,...m!=null?{speed:m}:{},wellName:Oe,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:y,y:A,z:w}}}),...f!=null&&f.seconds>0?[R(me,{seconds:f.seconds})]:[]],dr=ce?[R(Et,{pipetteId:P,labwareId:oe,wellName:Oe,...Ue!=null?{mmFromEdge:Ue}:{},zOffsetFromTop:Je,...Be!=null?{speed:Be}:{}}),...K>0&&fn?[R(B,{pipetteId:P,labwareId:oe,wellName:Oe,wellLocation:dn})]:[]]:[],Pr=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:K,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zt=K>0?[...aa,R(At,{pipetteId:P,volume:K,flowRate:Zn,...Pr>0?{correctionVolume:Pr}:{}}),...lr]:[],fr=[R(Na,{pipetteId:P,volume:Re,flowRate:a,correctionVolume:ir}),...lr],oa=[R(B,{pipetteId:P,labwareId:oe,...l!=null?{speed:l}:{},wellName:Oe,wellLocation:dn}),...o!=null&&o?.seconds>0?[R(me,{seconds:o.seconds})]:[]];return[...vr,...hn,...fr,...oa,...dr,...Zt]}),Ar=g!=null?[R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION}),R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:Kn,...Pe!=null?{speed:Pe}:{}})]:[R(Fe,{pipetteId:P,fixtureId:E,offset:{x:0,y:0,z:0}})],ta=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:K,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,un=K>0?[R(Xe,{pipetteId:P,volume:K,flowRate:on,pushOut:0,correctionVolume:ta,isAirGap:!0}),...Ir]:[],bt=g!=null?[R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:Kn}),R(B,{pipetteId:P,labwareId:E,...Pe!=null?{speed:Pe}:{},wellName:g,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[q],offset:{x:Se,y:ze,z:Ce}}}),...se!=null&&se.seconds>0?[R(me,{seconds:se.seconds})]:[]]:[],ra=c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:le,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,cr=Y!=null?0:M,Lr=[R(Xe,{pipetteId:P,volume:le,flowRate:v,...cr!=null?{pushOut:cr}:{},correctionVolume:ra}),...Ir],Wt=(Y!=null?c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:Y.volume,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null}):a)??a,Yt=(Y!=null?c.getByVolumeValue({liquidClass:X,pipetteSpecs:we,tiprackDefUri:J,targetVolume:Y.volume,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null}):v)??v,cn=Y!=null?Dr({pipette:P,volume:Y.volume,times:Y.times,aspirateFlowRateUlSec:Wt,dispenseFlowRateUlSec:Yt,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:k?.seconds,finalPushOut:M,invariantContext:t,liquidClass:X,tiprack:J,generatePython:!1}):[],Or=[R(Dn,{pipetteId:P,flowRate:I})];let pr=[];S==null||S===zr?pr=[...Mt(!0),...yt(!0)]:S===Mn&&g!=null?pr=[R(B,{pipetteId:P,labwareId:E,wellName:g,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Or,...Mt(!0),...yt(!0)]:pr=[...Mt(!1),...yt(!1),R(Fe,{pipetteId:P,fixtureId:Object.values(ke).length>0?Object.values(ke)[0].id:Object.values(Ne)[0].id,offset:{x:0,y:0,z:0}}),...Or,...yt(!0,!1)];const pn=vt&&(ie===sn.length-1||L==="always")?[R(Hr,{pipette:P,dropTipLocation:J,isReturnTip:vt})]:[];return[...ur,...Gt,...Sr,...Ar,...un,...bt,...Lr,...cn,...pr,...pn]}),Yn];return ae(Xa,t,r)},mA=(e,t,r)=>{const{pipetteId:n,trashId:a,flowRate:s,volume:o}=e,{pipetteEntities:i,trashBinEntities:l}=t,u=l[a],p=i[n].pythonName,d=u.pythonName,f=[`volume=${o}`,`location=${d}`,`rate=${s} / ${p}.flow_rate.dispense`],_=()=>({commands:[],python:`${p}.dispense(
|
|
138
|
+
${G(f.join(`,
|
|
134
139
|
`))},
|
|
135
|
-
)`}),m=[R(Fe,{pipetteId:n,fixtureId:a,offset:wt}),R(Xe,{pipetteId:n,volume:o,flowRate:s}),_];return ae(m,t,r)},
|
|
136
|
-
${
|
|
140
|
+
)`}),m=[R(Fe,{pipetteId:n,fixtureId:a,offset:wt}),R(Xe,{pipetteId:n,volume:o,flowRate:s}),_];return ae(m,t,r)},hA=(e,t,r)=>{const{pipetteId:n,flowRate:a,volume:s,wasteChuteId:o}=e,{pipetteEntities:i,wasteChuteEntities:l}=t,u=l[o].pythonName,p=i[n].pythonName,d=[`volume=${s}`,`location=${u}`,`rate=${a} / ${p}.flow_rate.dispense`],f=()=>({commands:[],python:`${p}.dispense(
|
|
141
|
+
${G(d.join(`,
|
|
137
142
|
`))},
|
|
138
|
-
)`}),_=[R(Fe,{pipetteId:n,fixtureId:o,offset:wt}),R(Xe,{pipetteId:n,flowRate:a,volume:s}),f];return ae(_,t,r)},yb=(e,t,r)=>{const{aspirateDelay:n,aspirateFlowRateUlSec:a,aspiratePositionReference:s,aspirateRetractDelay:o,aspirateRetractPositionReference:i,aspirateRetractSpeed:l,aspirateRetractXOffset:u,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:f,aspirateSubmergePositionReference:_,aspirateSubmergeSpeed:m,aspirateSubmergeXOffset:h,aspirateSubmergeYOffset:b,aspirateSubmergeZOffset:T,aspirateXOffset:y,aspirateYOffset:A,aspirateZOffset:w,blowoutFlowRateUlSec:I,blowoutLocation:S,changeTip:L,destLabware:E,destWells:g,dispenseDelay:k,dispenseFlowRateUlSec:v,dispensePositionReference:q,dispenseRetractDelay:$,dispenseRetractPositionReference:ee,dispenseRetractSpeed:de,dispenseRetractXOffset:Te,dispenseRetractYOffset:se,dispenseRetractZOffset:Ie,dispenseSubmergeDelay:Pe,dispenseSubmergePositionReference:He,dispenseSubmergeSpeed:Ve,dispenseSubmergeXOffset:te,dispenseSubmergeYOffset:Se,dispenseSubmergeZOffset:ze,dispenseXOffset:Ce,dispenseYOffset:Ee,dispenseZOffset:X,dropTipLocation:
|
|
139
|
-
${
|
|
143
|
+
)`}),_=[R(Fe,{pipetteId:n,fixtureId:o,offset:wt}),R(Xe,{pipetteId:n,flowRate:a,volume:s}),f];return ae(_,t,r)},yb=(e,t,r)=>{const{aspirateDelay:n,aspirateFlowRateUlSec:a,aspiratePositionReference:s,aspirateRetractDelay:o,aspirateRetractPositionReference:i,aspirateRetractSpeed:l,aspirateRetractXOffset:u,aspirateRetractYOffset:p,aspirateRetractZOffset:d,aspirateSubmergeDelay:f,aspirateSubmergePositionReference:_,aspirateSubmergeSpeed:m,aspirateSubmergeXOffset:h,aspirateSubmergeYOffset:b,aspirateSubmergeZOffset:T,aspirateXOffset:y,aspirateYOffset:A,aspirateZOffset:w,blowoutFlowRateUlSec:I,blowoutLocation:S,changeTip:L,destLabware:E,destWells:g,dispenseDelay:k,dispenseFlowRateUlSec:v,dispensePositionReference:q,dispenseRetractDelay:$,dispenseRetractPositionReference:ee,dispenseRetractSpeed:de,dispenseRetractXOffset:Te,dispenseRetractYOffset:se,dispenseRetractZOffset:Ie,dispenseSubmergeDelay:Pe,dispenseSubmergePositionReference:He,dispenseSubmergeSpeed:Ve,dispenseSubmergeXOffset:te,dispenseSubmergeYOffset:Se,dispenseSubmergeZOffset:ze,dispenseXOffset:Ce,dispenseYOffset:Ee,dispenseZOffset:X,dropTipLocation:Y,liquidClass:C,mixBeforeAspirate:P,nozzles:V,pipette:M,preWetTip:oe,primaryNozzle:U,pushOut:z,sourceLabware:x,sourceWell:F,tipRack:H,tipTracking:ce,tiprackSelected:Ue,tipsSelected:Je,touchTipAfterAspirate:Be,touchTipAfterAspirateMmFromEdge:pe,touchTipAfterAspirateOffsetMmFromTop:et,touchTipAfterAspirateSpeed:ht,touchTipAfterDispense:Rt,touchTipAfterDispenseMmFromEdge:_t,touchTipAfterDispenseOffsetMmFromTop:Re,touchTipAfterDispenseSpeed:tt,stepNumber:ge,volume:ke}=e,{pipetteEntities:Ne,labwareEntities:re,trashBinEntities:ne,wasteChuteEntities:kt}=t,Ge="distribute",K=[],he=Ne[M]?.spec.channels!==1,_r=re[x]?.def.parameters.quirks?.includes("touchTipDisabled"),rt=e.aspirateAirGapVolume??0,qe=e.dispenseAirGapVolume??0,_e=e.disposalVolume!=null&&e.disposalVolume>0?e.disposalVolume:0,nt=e.conditioningVolume!=null&&e.conditioningVolume>0?e.conditioningVolume:0;(r.pipettes[M]==null||Ne[M]==null)&&K.push(pt({pipette:M})),(!x||!r.labware[x])&&K.push(dt({actionName:Ge,labware:x}));const Wr=W(r.labware[E]?.stack),vt=W(r.labware[x]?.stack);Object.keys(kt).length>0&&(Wr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||vt===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&K.push(wa());const Yr=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],sr=Yr.length>0?Yr[0]:null,We=Object.values(t.labwareEntities).find(({labwareDefURI:le})=>le===Y),J=We!=null&&c.getIsTiprack(We.def),Pt=t.wasteChuteEntities[Y]!=null,we=t.trashBinEntities[Y]!=null,lt=r.tipState.pipettes[M]?.hasTip;(Y==null||J&&sr==null&&L!=="never"&<||!J&&!Pt&&!we)&&K.push(Rn());let Z,j;if(L==="never"){const le=r.tipState.pipettes[M]?.tiprackURI;Z=t.labwareEntities[le??""],j=Z?.labwareDefURI}else Z=Object.values(re).find(({labwareDefURI:le})=>le===H),j=H;Z==null&&(L==="never"?K.push(xt({actionName:Ge,pipette:M})):K.push(dt({actionName:Ge,labware:j})));const{def:ut=null}=Z??{},{spec:fe,name:at,pythonName:zt}=Ne[M],Ct=c.getAllLiquidClassDefs()[C===c.NONE_LIQUID_CLASS_NAME||C==null?c.WATER_LIQUID_CLASS_NAME:C].byPipette?.find(({pipetteModel:le})=>le===c.getFlexNameConversion(fe))?.byTipType.find(({tiprack:le})=>le===j)??null,{aspirate:Kr,multiDispense:or}=Ct??{},{multiWellHandling:yr}=zc({pipetteSpecs:fe,tiprackDefinition:ut,volume:ke,path:"multiDispense",numAspirateWells:1,numDispenseWells:g.length,conditioningByVolume:or?.conditioningByVolume??[],disposalByVolume:or?.disposalByVolume??[],aspirateAirGapByVolume:Kr?.retract.airGapByVolume??[]}),{numWellsToFitInTip:ir}=yr;if((!yr.isSupported||ir==null||ir===1)&&K.push(tT()),he&&V!==c.ALL){const le=ft({robotState:r,invariantContext:t,pipetteId:M,labwareId:x,wellLocationOffset:{x:y,y:A},wellTargetName:F,primaryNozzle:U,nozzleConfiguration:V});le.isSafe||K.push($t({unsafePipetteMovementReason:le.reason}));const Ye=ft({robotState:r,invariantContext:t,pipetteId:M,labwareId:E,wellLocationOffset:{x:Ce,y:Ee},wellTargetName:g[0],primaryNozzle:U,nozzleConfiguration:V});Ye.isSafe||K.push($t({unsafePipetteMovementReason:Ye.reason}))}const Ae=t.labwareEntities[x]?.def.wells[F]?.depth??null,Nt=c.getMmFromBottom(w,s,Ae),br=c.getMmFromBottom(T,_,Ae),Tr=c.getMmFromBottom(d,i,Ae);Nt!=null&&br!=null&&Nt>br&&K.push(vh()),Nt!=null&&Tr!=null&&Nt>Tr&&K.push(Ph());const Xr=[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],gr=qs(M,t,j)-rt;if(Math.floor((gr-_e)/ke)===0&&K.push(os({actionName:Ge,volume:ke,maxVolume:gr,disposalVolume:_e})),K.length>0)return{errors:K};const{tipracks:Qr}=Wa(M,j,t,r,U,V),Jr=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:ke,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,en=ne[E]?.pythonName??kt[E]?.pythonName,Gn=ne[Y]?.pythonName??kt[Y]?.pythonName,tn=S==null?null:ne[S]?.pythonName??kt[S]?.pythonName,jt=re[x].pythonName,rn=re[E]?.pythonName,nn=(V===c.PARTIAL_COLUMN?tr({labwareDef:re[x].def,wells:[F],primaryNozzle:U}):[F])[0],an=V===c.PARTIAL_COLUMN&&g!=null&&re[E]!=null?tr({labwareDef:re[E].def,wells:g,primaryNozzle:U}):g,Wn=`${jt}[${N(nn)}]`,Yn=an.map(le=>`${rn}[${N(le)}]`).join(", "),sn=[`name=${N(`${e.commandCreatorFnName}_step_${ge}`)}`,...C!=null?[`base_liquid_class=${ja(C,!0)}`]:[],`properties=${Ms({args:e,pipetteName:c.isFlexPipette(at)?c.getFlexNameConversion(fe):at,tiprackUri:j,liquidClassValuesForTip:Ct})}`],Gt=`${be}.define_liquid_class(
|
|
144
|
+
${G(sn.join(`,
|
|
140
145
|
`))},
|
|
141
146
|
)`,Dt=ce===St&&Ue!=null&&Je!=null&&Je.length>0?Ga({wellSets:Je,nozzles:V,channels:fe.channels,primaryNozzle:U}):null,lr=Ue!=null?re[Ue]?.pythonName:null,Ir=(Dt!=null&&Z!=null&&V===c.PARTIAL_COLUMN?tr({labwareDef:Z?.def,wells:Dt,primaryNozzle:U}):Dt)?.map(le=>`${lr}[${N(le)}]`).join(", "),Zn=[`volume=${ke}`,`source=[${Wn}]`,`dest=[${Yn??en}]`,`new_tip=${N(Us(L))}`,...J?["return_tip=True",...tn!=null?[`trash_location=${tn}`]:[]]:[`trash_location=${Gn}`,"keep_last_tip=True"],...fe.channels>1?["group_wells=False"]:[],...Qr.filteredSortedTiprackIds.length>0?[Fs({labwareEntities:re,tiprackIds:Qr.filteredSortedTiprackIds})]:[],`liquid_class=${Gt}`,...Dt!=null&&lr!=null?[`tips=[${Ir}]`]:[]],on=()=>({commands:[],python:`${zt}.distribute_with_liquid_class(
|
|
142
|
-
${
|
|
147
|
+
${G(Zn.join(`,
|
|
143
148
|
`))},
|
|
144
|
-
)`}),Qn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_],offset:{x:h,y:b,z:T}},ln={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:u,y:p,z:d}},Er={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[He],offset:{x:te,y:Se,z:ze}},wr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ee],offset:{x:Te,y:se,z:Ie}},Jn=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,Xa=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,ye=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,ie=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,yt=db(g,ir),Mt=Ur({retractZOffset:d,retractPositionReference:i,labwareId:x,labwareEntities:re,well:F}),Le=!Mt&&F!=null?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],ea=[...Sn(yt,(le,Ye)=>{const ur=le.length,Sr=ke*ur,Ar=Sr+_e+nt,ta=Ye===0,un=Ye===yt.length-1,bt=L==="always"||L==="once"&&ta,ra=c.LOW_VOLUME_PIPETTES.includes(at)?[R(An,{pipetteId:M,volume:Ar})]:[];let cr=[];if(bt){const Me=Dt?.shift();cr=[O(Ya,{pipette:M,nozzles:V,primaryNozzle:U,dropTipLocation:J&&sr!=null?sr:W,tipRack:j,...ce===St&&Me!=null&&Ue!=null?{tipSelectionArgs:{tipRackId:Ue,tipWell:Me}}:{}})]}const Lr=[R(Lt,{pipetteId:M})],Wt=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Yt=k!=null?[R(me,{seconds:k.seconds})]:[],cn=qe>0&&!bt&&!ta&&_e===0&&S==null?[R(Xe,{isAirGap:!0,pipetteId:M,volume:qe,flowRate:ie,...Wt>0?{correctionVolume:Wt}:{},pushOut:0}),...Yt]:[],Or=[...Xr,...cn,...ra,...Lr],pr=[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:Qn}),R(B,{pipetteId:M,labwareId:x,...m!=null?{speed:m}:{},wellName:F,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:y,y:A,z:w}}}),...f!=null&&f.seconds>0?[R(me,{seconds:f.seconds})]:[]],pn=oe?Dr({pipette:M,volume:Sr,times:1,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:v,aspirateDelaySeconds:n?.seconds??0,dispenseDelaySeconds:k?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:C,tiprack:j,generatePython:!1}):[],Oe=P!=null?Dr({pipette:M,volume:P.volume,times:P.times,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:v,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:k?.seconds,finalPushOut:0,invariantContext:t,liquidClass:C,tiprack:j,generatePython:!1}):[],Kt=n!=null?[R(me,{seconds:n.seconds})]:[],Rr=Be?[R(Et,{pipetteId:M,labwareId:x,wellName:F,...pe!=null?{mmFromEdge:pe}:{},zOffsetFromTop:et,...ht!=null?{speed:ht}:{}}),...rt>0&&Mt?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:ln})]:[]]:[],Tt=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Xt=rt>0?[...Le,R(At,{pipetteId:M,volume:rt,flowRate:Jn,...Tt>0?{correctionVolume:Tt}:{}}),...Kt]:[],na=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Ar,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,dn=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:nt,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,fn=nt!=null&&nt>0?[R(Xe,{pipetteId:M,volume:nt,flowRate:v,correctionVolume:dn,pushOut:0}),...Yt]:[],aa=[R(Na,{pipetteId:M,volume:Ar,flowRate:a,correctionVolume:na}),...Kt,...fn],mn=[R(B,{pipetteId:M,labwareId:x,...l!=null?{speed:l}:{},wellName:F,wellLocation:ln}),...o!=null&&o?.seconds>0?[R(me,{seconds:o.seconds})]:[]],kr=Sn(le,(Me,vr)=>{const hn=vr===0,dr=vr===le.length-1,Pr=un&&dr;let Zt=0,fr=v;hn&&rt>0?(Zt=rt,fr=Xa):!hn&&qe>0&&nt===0&&(Zt=qe,fr=ie);const oa=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Zt,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Za=Ur({retractZOffset:Ie,retractPositionReference:ee,labwareId:E,labwareEntities:re,well:Me}),Vs=Za?[]:[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],Qa=Me!=null?[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:Er}),...Zt>0?[R(Xe,{isAirGap:!0,pipetteId:M,volume:Zt,flowRate:fr,pushOut:0,correctionVolume:oa}),...Yt]:[],R(B,{pipetteId:M,labwareId:E,...Ve!=null?{speed:Ve}:{},wellName:Me,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[q],offset:{x:Ce,y:Ee,z:X}}}),...Pe!=null&&Pe.seconds>0?[R(me,{seconds:Pe.seconds})]:[]]:[R(Fe,{fixtureId:E,pipetteId:M,offset:{x:0,y:0,z:0}})],ia=_e===0&&dr?z:0,gt=[R(Xe,{pipetteId:M,volume:ke,flowRate:v,...ia!=null?{pushOut:ia}:{},correctionVolume:Jr}),...Yt],_n=Me!=null?[R(B,{pipetteId:M,labwareId:E,...de!=null?{speed:de}:{},wellName:Me,wellLocation:wr}),...$!=null&&$?.seconds>0?[R(me,{seconds:$.seconds})]:[]]:[],Ft=dr?[R(Dn,{pipetteId:M,flowRate:I})]:[],Ja=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ut=(la,Nb=!0)=>qe>0&&!(vr<le.length-1&&nt>0)&&!(L==="never"&&Pr&&la)?[...Nb?Vs:[],R(Lt,{pipetteId:M}),R(At,{pipetteId:M,volume:qe,flowRate:ye,...Ja>0?{correctionVolume:Ja}:{}}),...Kt]:[],It=la=>Me!=null&&Rt?[R(Et,{pipetteId:M,labwareId:E,wellName:Me,..._t!=null?{mmFromEdge:_t}:{},zOffsetFromTop:Re,...tt!=null?{speed:tt}:{}}),...Ut(la).length>0&&Za?[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:wr})]:[]]:[];let Cr=[];if(S==null||!dr)Cr=[...It(!0),...Ut(!0)];else if(S===Mn)Cr=[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Ft,...It(!0),...Ut(!0)];else if(S===zr){const la=Ut(!0);Cr=[...It(!1),...Ut(!1),R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Ft,...Rt&&!_r?[R(Et,{pipetteId:M,labwareId:x,wellName:F,..._t!=null?{mmFromEdge:_t}:{},zOffsetFromTop:Re,...tt!=null?{speed:tt}:{}})]:[],...la.length>0?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...Ut(!0,!1)]}else Cr=[...It(!1),...Ut(!1),R(Fe,{pipetteId:M,fixtureId:Object.values(ne).length>0?Object.values(ne)[0].id:Object.values(kt)[0].id,offset:{x:0,y:0,z:0}}),...Ft,...Ut(!0,!1)];return[...Qa,...gt,..._n,...Cr]}),sa=J&&(Ye===yt.length-1||L==="always")?[R(Hr,{pipette:M,dropTipLocation:j,isReturnTip:J})]:[];return[...cr,...Or,...pr,...Oe,...pn,...aa,...mn,...Rr,...Xt,...kr,...sa]}),on];return ae(ea,t,r)},bb=(e,t,r)=>{const{timerHours:n,timerMinutes:a,timerSeconds:s,latchOpen:o,targetTemperature:i,rpm:l}=e;if(e.moduleId==null)return{errors:[Q()]};const u=Ot(r,e.moduleId),p=e.moduleId??"";if(u==null)return{errors:[Q()]};const d=[];if(o||d.push(O(q_,{moduleId:p})),i===null?d.push(O(Gu,{moduleId:p})):d.push(O(Pc,{moduleId:p,celsius:i})),l===null&&"targetSpeed"in u&&u.targetSpeed!==null?d.push(O(Wu,{moduleId:p})):l!==null&&d.push(O(V_,{moduleId:p,rpm:l})),[n,a,s].some(_=>_!=null&&_!==0)){i!==null&&d.push(O(Fc,{moduleId:p,celsius:i}));const _=(n??0)*3600+(a??0)*60+(s??0);d.push(O(me,{seconds:_})),d.push(O(Wu,{moduleId:p})),d.push(O(Gu,{moduleId:p}))}return o&&d.push(O($_,{moduleId:p})),ae(d,t,r)},Tb=(e,t,r)=>{const{moduleId:n,profileElements:a,profileTargetLidTemp:s,profileVolume:o}=e,i=$s(r,n);if(i===null)return{errors:[Q()]};const l=t.moduleEntities[n].pythonName,u=[];i.lidOpen!==!1&&u.push(O(Uc,{moduleId:n})),s!==i.lidTargetTemp&&u.push(O(qc,{moduleId:n,celsius:s}));const p=`${l}_task_${i.numProfilesStarted+1}`;return u.push(O(D_,{moduleId:n,profileElements:a,blockMaxVolumeUl:o,taskId:p})),ae(u,t,r)},pA=()=>({lidOpen:!1,lidClosed:!1,setBlockTemperature:!1,deactivateBlockTemperature:!1,setLidTemperature:!1,deactivateLidTemperature:!1}),dA=(e,t)=>!e.lidOpen&&t.lidOpen?{lidOpen:!0}:{},fA=(e,t)=>e.lidOpen&&!t.lidOpen||e.lidOpen===null&&!t.lidOpen?{lidClosed:!0}:{},mA=(e,t)=>t==null?e.currentBlockActivity.type==="blockDeactivated":e.currentBlockActivity.type==="blockTargetTemp"&&e.currentBlockActivity.blockTargetTemp===t,hA=(e,t)=>{const r={...dA(e,t)},n={...fA(e,t)},a=!mA(e,t.blockTargetTemp),s=a&&t.blockTargetTemp===null,o=a&&t.blockTargetTemp!==null,i=e.lidTargetTemp!==t.lidTargetTemp,l=i&&t.lidTargetTemp===null,u=i&&t.lidTargetTemp!==null;return{...pA(),...r,...n,setBlockTemperature:o,deactivateBlockTemperature:s,setLidTemperature:u,deactivateLidTemperature:l}},gb=(e,t,r)=>{const n=$s(r,e.moduleId);if(n===null)return{errors:[Q()]};if(n.currentBlockActivity.type==="profile")return{errors:[Bb()]};const{lidOpen:a,lidClosed:s,setBlockTemperature:o,deactivateBlockTemperature:i,setLidTemperature:l,deactivateLidTemperature:u}=hA(n,e),{blockTargetTemp:p,lidTargetTemp:d}=e,f=[];return a&&f.push(O(H_,{moduleId:e.moduleId})),s&&f.push(O(Uc,{moduleId:e.moduleId})),i&&f.push(O(B_,{moduleId:e.moduleId})),p!==null&&o&&f.push(O(z_,{moduleId:e.moduleId,celsius:p})),u&&f.push(O(x_,{moduleId:e.moduleId})),d!==null&&l&&f.push(O(qc,{moduleId:e.moduleId,celsius:d})),ae(f,t,r)};var Uu,gh;function _A(){if(gh)return Uu;gh=1;var e=La(),t=Iy(),r=Ey();function n(a,s){return r(t(a,s,e),a+"")}return Uu=n,Uu}var qu,Ih;function yA(){if(Ih)return qu;Ih=1;var e=xr(),t=nr();function r(n){return t(n)&&e(n)}return qu=r,qu}var $u,Eh;function bA(){if(Eh)return $u;Eh=1;var e=o_(),t=va(),r=__(),n=l_(),a=yA(),s=Math.max;function o(i){if(!(i&&i.length))return[];var l=0;return i=e(i,function(u){if(a(u))return l=s(u.length,l),!0}),n(l,function(u){return t(i,r(u))})}return $u=o,$u}var Vu,wh;function TA(){if(wh)return Vu;wh=1;var e=_A(),t=bA(),r=e(t);return Vu=r,Vu}var gA=TA();const IA=xe(gA),Ib=(e,t,r)=>{const{aspirateAirGapVolume:n,aspirateDelay:a,aspirateFlowRateUlSec:s,aspiratePositionReference:o,aspirateRetractDelay:i,aspirateRetractPositionReference:l,aspirateRetractSpeed:u,aspirateRetractXOffset:p,aspirateRetractYOffset:d,aspirateRetractZOffset:f,aspirateSubmergeDelay:_,aspirateSubmergePositionReference:m,aspirateSubmergeSpeed:h,aspirateSubmergeXOffset:b,aspirateSubmergeYOffset:T,aspirateSubmergeZOffset:y,aspirateXOffset:A,aspirateYOffset:w,aspirateZOffset:I,blowoutFlowRateUlSec:S,blowoutLocation:L,changeTip:E,destLabware:g,destWells:k,dispenseAirGapVolume:v,dispenseDelay:q,dispenseFlowRateUlSec:$,dispensePositionReference:ee,dispenseRetractDelay:de,dispenseRetractPositionReference:Te,dispenseRetractSpeed:se,dispenseRetractXOffset:Ie,dispenseRetractYOffset:Pe,dispenseRetractZOffset:He,dispenseSubmergeDelay:Ve,dispenseSubmergePositionReference:te,dispenseSubmergeSpeed:Se,dispenseSubmergeXOffset:ze,dispenseSubmergeYOffset:Ce,dispenseSubmergeZOffset:Ee,dispenseXOffset:X,dispenseYOffset:W,dispenseZOffset:C,dropTipLocation:P,liquidClass:V,mixBeforeAspirate:M,mixInDestination:oe,pipette:U,preWetTip:z,primaryNozzle:x,pushOut:F,sourceLabware:H,nozzles:ce,sourceWells:Ue,tipRack:Je,tipTracking:Be,tiprackSelected:pe,tipsSelected:et,touchTipAfterAspirate:ht,touchTipAfterAspirateMmFromEdge:Rt,touchTipAfterAspirateOffsetMmFromTop:_t,touchTipAfterAspirateSpeed:Re,touchTipAfterDispense:tt,touchTipAfterDispenseMmFromEdge:ge,touchTipAfterDispenseOffsetMmFromTop:ke,touchTipAfterDispenseSpeed:Ne,volume:re,stepNumber:ne}=e,{pipetteEntities:kt,trashBinEntities:Ge,wasteChuteEntities:Y,labwareEntities:he}=t,_r=Fn(he,Y,Ge,g),rt=he[H]?.def.parameters.quirks?.includes("touchTipDisabled");if(!(_r==="labware"&&k!=null&&Ue.length===k.length||(_r==="wasteChute"||_r==="trashBin")&&k==null&&Ue.length>=1))throw new Error(`Transfer command creator expected N:N source-to-dest wells ratio. Got ${Ue.length}:${k?.length} in labware`);const qe="transfer",_e=[];(!r.pipettes[U]||!kt[U])&&_e.push(ct({pipette:U})),(!H||!r.labware[H])&&_e.push(pt({actionName:qe,labware:H}));const nt=r.labware[g]!=null?G(r.labware[g].stack):"",Wr=G(r.labware[H]?.stack),vt=Object.keys(Y).length>0,Ka=Y[P]!=null,Yr=Ge[P]!=null;vt&&(nt===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Wr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&_e.push(wa());const sr=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],We=sr.length>0?sr[0]:null,J=Object.values(t.labwareEntities).find(({labwareDefURI:ie})=>ie===P),Pt=J!=null&&c.getIsTiprack(J.def),we=r.tipState.pipettes[U]?.hasTip;if(P==null||Pt&&We==null&&E!=="never"&&we||!Pt&&!Ka&&!Yr)return{errors:[Rn()]};(!g||!he[g]&&!Y[g]&&!Ge[g])&&_e.push(kh());let it,Z;if(E==="never"){const ie=r.tipState.pipettes[U]?.tiprackURI;it=t.labwareEntities[ie??""],Z=it?.labwareDefURI}else it=Object.values(he).find(({labwareDefURI:ie})=>ie===Je),Z=Je;if(it==null&&(E==="never"?_e.push(xt({actionName:qe,pipette:U})):_e.push(pt({actionName:qe,labware:Z}))),_e.length>0)return{errors:_e};const j=n||0,lt=v||0,fe=qs(U,t,Z)-j;if(fe<=0||!isFinite(fe))return _e.push(os({volume:re,maxVolume:fe,actionName:qe})),{errors:_e};const at=Math.ceil(re/fe);if(!isFinite(at)||at<=0)return _e.push(os({volume:re,maxVolume:at,actionName:qe})),{errors:_e};const zt=re/at,Ct=Array(at).fill(zt),Kr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[m],offset:{x:b,y:T,z:y}},or={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[l],offset:{x:p,y:d,z:f}},yr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[te],offset:{x:ze,y:Ce,z:Ee}},ir={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[Te],offset:{x:Ie,y:Pe,z:He}},{spec:Ae,name:Nt,pythonName:br}=kt[U],{tipracks:Tr}=Wa(U,Z,t,r,x,ce),Xr=c.getAllLiquidClassDefs()[V===c.NONE_LIQUID_CLASS_NAME||V==null?c.WATER_LIQUID_CLASS_NAME:V].byPipette?.find(({pipetteModel:ie})=>ie===c.getFlexNameConversion(Ae))?.byTipType.find(({tiprack:ie})=>ie===Z)??null,gr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:zt,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:zt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Qr=Ge[g]?.pythonName??Y[g]?.pythonName,Jr=Ge[P]?.pythonName??Y[P]?.pythonName,en=L==null?null:Ge[L]?.pythonName??Y[L]?.pythonName,Gn=he[H].pythonName,tn=he[g]?.pythonName,jt=ce===c.PARTIAL_COLUMN?tr({labwareDef:he[H].def,wells:Ue,primaryNozzle:x}):Ue,rn=ce===c.PARTIAL_COLUMN&&k!=null&&he[g]!=null?tr({labwareDef:he[g].def,wells:k,primaryNozzle:x}):k,nn=jt.map(ie=>`${Gn}[${N(ie)}]`).join(", "),an=rn!=null&&tn!=null?rn.map(ie=>`${tn}[${N(ie)}]`).join(", "):null,Wn=[`name=${N(`${e.commandCreatorFnName}_step_${ne}`)}`,...V!=null?[`base_liquid_class=${ja(V,!0)}`]:[],`properties=${Ms({args:e,pipetteName:c.isFlexPipette(Nt)?c.getFlexNameConversion(Ae):Nt,tiprackUri:Z,liquidClassValuesForTip:Xr})}`],Yn=`${be}.define_liquid_class(
|
|
145
|
-
${
|
|
149
|
+
)`}),Qn={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[_],offset:{x:h,y:b,z:T}},ln={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[i],offset:{x:u,y:p,z:d}},Er={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[He],offset:{x:te,y:Se,z:ze}},wr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ee],offset:{x:Te,y:se,z:Ie}},Jn=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,Xa=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,ye=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??a,ie=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"multiDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??v,yt=db(g,ir),Mt=Ur({retractZOffset:d,retractPositionReference:i,labwareId:x,labwareEntities:re,well:F}),Le=!Mt&&F!=null?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],ea=[...Sn(yt,(le,Ye)=>{const ur=le.length,Sr=ke*ur,Ar=Sr+_e+nt,ta=Ye===0,un=Ye===yt.length-1,bt=L==="always"||L==="once"&&ta,ra=c.LOW_VOLUME_PIPETTES.includes(at)?[R(An,{pipetteId:M,volume:Ar})]:[];let cr=[];if(bt){const Me=Dt?.shift();cr=[O(Ya,{pipette:M,nozzles:V,primaryNozzle:U,dropTipLocation:J&&sr!=null?sr:Y,tipRack:j,...ce===St&&Me!=null&&Ue!=null?{tipSelectionArgs:{tipRackId:Ue,tipWell:Me}}:{}})]}const Lr=[R(Lt,{pipetteId:M})],Wt=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Yt=k!=null?[R(me,{seconds:k.seconds})]:[],cn=qe>0&&!bt&&!ta&&_e===0&&S==null?[R(Xe,{isAirGap:!0,pipetteId:M,volume:qe,flowRate:ie,...Wt>0?{correctionVolume:Wt}:{},pushOut:0}),...Yt]:[],Or=[...Xr,...cn,...ra,...Lr],pr=[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:Qn}),R(B,{pipetteId:M,labwareId:x,...m!=null?{speed:m}:{},wellName:F,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[s],offset:{x:y,y:A,z:w}}}),...f!=null&&f.seconds>0?[R(me,{seconds:f.seconds})]:[]],pn=oe?Dr({pipette:M,volume:Sr,times:1,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:v,aspirateDelaySeconds:n?.seconds??0,dispenseDelaySeconds:k?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:C,tiprack:j,generatePython:!1}):[],Oe=P!=null?Dr({pipette:M,volume:P.volume,times:P.times,aspirateFlowRateUlSec:a,dispenseFlowRateUlSec:v,aspirateDelaySeconds:n?.seconds,dispenseDelaySeconds:k?.seconds,finalPushOut:0,invariantContext:t,liquidClass:C,tiprack:j,generatePython:!1}):[],Kt=n!=null?[R(me,{seconds:n.seconds})]:[],Rr=Be?[R(Et,{pipetteId:M,labwareId:x,wellName:F,...pe!=null?{mmFromEdge:pe}:{},zOffsetFromTop:et,...ht!=null?{speed:ht}:{}}),...rt>0&&Mt?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:ln})]:[]]:[],Tt=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:rt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Xt=rt>0?[...Le,R(At,{pipetteId:M,volume:rt,flowRate:Jn,...Tt>0?{correctionVolume:Tt}:{}}),...Kt]:[],na=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Ar,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,dn=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:nt,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,fn=nt!=null&&nt>0?[R(Xe,{pipetteId:M,volume:nt,flowRate:v,correctionVolume:dn,pushOut:0}),...Yt]:[],aa=[R(Na,{pipetteId:M,volume:Ar,flowRate:a,correctionVolume:na}),...Kt,...fn],mn=[R(B,{pipetteId:M,labwareId:x,...l!=null?{speed:l}:{},wellName:F,wellLocation:ln}),...o!=null&&o?.seconds>0?[R(me,{seconds:o.seconds})]:[]],kr=Sn(le,(Me,vr)=>{const hn=vr===0,dr=vr===le.length-1,Pr=un&&dr;let Zt=0,fr=v;hn&&rt>0?(Zt=rt,fr=Xa):!hn&&qe>0&&nt===0&&(Zt=qe,fr=ie);const oa=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:Zt,liquidHandlingAction:"multiDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Za=Ur({retractZOffset:Ie,retractPositionReference:ee,labwareId:E,labwareEntities:re,well:Me}),Vs=Za?[]:[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],Qa=Me!=null?[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:Er}),...Zt>0?[R(Xe,{isAirGap:!0,pipetteId:M,volume:Zt,flowRate:fr,pushOut:0,correctionVolume:oa}),...Yt]:[],R(B,{pipetteId:M,labwareId:E,...Ve!=null?{speed:Ve}:{},wellName:Me,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[q],offset:{x:Ce,y:Ee,z:X}}}),...Pe!=null&&Pe.seconds>0?[R(me,{seconds:Pe.seconds})]:[]]:[R(Fe,{fixtureId:E,pipetteId:M,offset:{x:0,y:0,z:0}})],ia=_e===0&&dr?z:0,gt=[R(Xe,{pipetteId:M,volume:ke,flowRate:v,...ia!=null?{pushOut:ia}:{},correctionVolume:Jr}),...Yt],_n=Me!=null?[R(B,{pipetteId:M,labwareId:E,...de!=null?{speed:de}:{},wellName:Me,wellLocation:wr}),...$!=null&&$?.seconds>0?[R(me,{seconds:$.seconds})]:[]]:[],Ft=dr?[R(Dn,{pipetteId:M,flowRate:I})]:[],Ja=c.getByVolumeValue({liquidClass:C,pipetteSpecs:fe,tiprackDefUri:j,targetVolume:qe,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Ut=(la,Nb=!0)=>qe>0&&!(vr<le.length-1&&nt>0)&&!(L==="never"&&Pr&&la)?[...Nb?Vs:[],R(Lt,{pipetteId:M}),R(At,{pipetteId:M,volume:qe,flowRate:ye,...Ja>0?{correctionVolume:Ja}:{}}),...Kt]:[],It=la=>Me!=null&&Rt?[R(Et,{pipetteId:M,labwareId:E,wellName:Me,..._t!=null?{mmFromEdge:_t}:{},zOffsetFromTop:Re,...tt!=null?{speed:tt}:{}}),...Ut(la).length>0&&Za?[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:wr})]:[]]:[];let Cr=[];if(S==null||!dr)Cr=[...It(!0),...Ut(!0)];else if(S===Mn)Cr=[R(B,{pipetteId:M,labwareId:E,wellName:Me,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Ft,...It(!0),...Ut(!0)];else if(S===zr){const la=Ut(!0);Cr=[...It(!1),...Ut(!1),R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),...Ft,...Rt&&!_r?[R(Et,{pipetteId:M,labwareId:x,wellName:F,..._t!=null?{mmFromEdge:_t}:{},zOffsetFromTop:Re,...tt!=null?{speed:tt}:{}})]:[],...la.length>0?[R(B,{pipetteId:M,labwareId:x,wellName:F,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...Ut(!0,!1)]}else Cr=[...It(!1),...Ut(!1),R(Fe,{pipetteId:M,fixtureId:Object.values(ne).length>0?Object.values(ne)[0].id:Object.values(kt)[0].id,offset:{x:0,y:0,z:0}}),...Ft,...Ut(!0,!1)];return[...Qa,...gt,..._n,...Cr]}),sa=J&&(Ye===yt.length-1||L==="always")?[R(Hr,{pipette:M,dropTipLocation:j,isReturnTip:J})]:[];return[...cr,...Or,...pr,...Oe,...pn,...aa,...mn,...Rr,...Xt,...kr,...sa]}),on];return ae(ea,t,r)},bb=(e,t,r)=>{const{timerHours:n,timerMinutes:a,timerSeconds:s,latchOpen:o,targetTemperature:i,rpm:l}=e;if(e.moduleId==null)return{errors:[Q()]};const u=Ot(r,e.moduleId),p=e.moduleId??"";if(u==null)return{errors:[Q()]};const d=[];if(o||d.push(O(q_,{moduleId:p})),i===null?d.push(O(Gu,{moduleId:p})):d.push(O(Pc,{moduleId:p,celsius:i})),l===null&&"targetSpeed"in u&&u.targetSpeed!==null?d.push(O(Wu,{moduleId:p})):l!==null&&d.push(O(V_,{moduleId:p,rpm:l})),[n,a,s].some(_=>_!=null&&_!==0)){i!==null&&d.push(O(Fc,{moduleId:p,celsius:i}));const _=(n??0)*3600+(a??0)*60+(s??0);d.push(O(me,{seconds:_})),d.push(O(Wu,{moduleId:p})),d.push(O(Gu,{moduleId:p}))}return o&&d.push(O($_,{moduleId:p})),ae(d,t,r)},Tb=(e,t,r)=>{const{moduleId:n,profileElements:a,profileTargetLidTemp:s,profileVolume:o}=e,i=$s(r,n);if(i===null)return{errors:[Q()]};const l=t.moduleEntities[n].pythonName,u=[];i.lidOpen!==!1&&u.push(O(Uc,{moduleId:n})),s!==i.lidTargetTemp&&u.push(O(qc,{moduleId:n,celsius:s}));const p=`${l}_task_${i.numProfilesStarted+1}`;return u.push(O(D_,{moduleId:n,profileElements:a,blockMaxVolumeUl:o,taskId:p})),ae(u,t,r)},_A=()=>({lidOpen:!1,lidClosed:!1,setBlockTemperature:!1,deactivateBlockTemperature:!1,setLidTemperature:!1,deactivateLidTemperature:!1}),yA=(e,t)=>!e.lidOpen&&t.lidOpen?{lidOpen:!0}:{},bA=(e,t)=>e.lidOpen&&!t.lidOpen||e.lidOpen===null&&!t.lidOpen?{lidClosed:!0}:{},TA=(e,t)=>t==null?e.currentBlockActivity.type==="blockDeactivated":e.currentBlockActivity.type==="blockTargetTemp"&&e.currentBlockActivity.blockTargetTemp===t,gA=(e,t)=>{const r={...yA(e,t)},n={...bA(e,t)},a=!TA(e,t.blockTargetTemp),s=a&&t.blockTargetTemp===null,o=a&&t.blockTargetTemp!==null,i=e.lidTargetTemp!==t.lidTargetTemp,l=i&&t.lidTargetTemp===null,u=i&&t.lidTargetTemp!==null;return{..._A(),...r,...n,setBlockTemperature:o,deactivateBlockTemperature:s,setLidTemperature:u,deactivateLidTemperature:l}},gb=(e,t,r)=>{const n=$s(r,e.moduleId);if(n===null)return{errors:[Q()]};if(n.currentBlockActivity.type==="profile")return{errors:[Bb()]};const{lidOpen:a,lidClosed:s,setBlockTemperature:o,deactivateBlockTemperature:i,setLidTemperature:l,deactivateLidTemperature:u}=gA(n,e),{blockTargetTemp:p,lidTargetTemp:d}=e,f=[];return a&&f.push(O(H_,{moduleId:e.moduleId})),s&&f.push(O(Uc,{moduleId:e.moduleId})),i&&f.push(O(B_,{moduleId:e.moduleId})),p!==null&&o&&f.push(O(z_,{moduleId:e.moduleId,celsius:p})),u&&f.push(O(x_,{moduleId:e.moduleId})),d!==null&&l&&f.push(O(qc,{moduleId:e.moduleId,celsius:d})),ae(f,t,r)};var Uu,gh;function IA(){if(gh)return Uu;gh=1;var e=La(),t=Iy(),r=Ey();function n(a,s){return r(t(a,s,e),a+"")}return Uu=n,Uu}var qu,Ih;function EA(){if(Ih)return qu;Ih=1;var e=xr(),t=nr();function r(n){return t(n)&&e(n)}return qu=r,qu}var $u,Eh;function wA(){if(Eh)return $u;Eh=1;var e=o_(),t=va(),r=__(),n=l_(),a=EA(),s=Math.max;function o(i){if(!(i&&i.length))return[];var l=0;return i=e(i,function(u){if(a(u))return l=s(u.length,l),!0}),n(l,function(u){return t(i,r(u))})}return $u=o,$u}var Vu,wh;function SA(){if(wh)return Vu;wh=1;var e=IA(),t=wA(),r=e(t);return Vu=r,Vu}var AA=SA();const LA=xe(AA),Ib=(e,t,r)=>{const{aspirateAirGapVolume:n,aspirateDelay:a,aspirateFlowRateUlSec:s,aspiratePositionReference:o,aspirateRetractDelay:i,aspirateRetractPositionReference:l,aspirateRetractSpeed:u,aspirateRetractXOffset:p,aspirateRetractYOffset:d,aspirateRetractZOffset:f,aspirateSubmergeDelay:_,aspirateSubmergePositionReference:m,aspirateSubmergeSpeed:h,aspirateSubmergeXOffset:b,aspirateSubmergeYOffset:T,aspirateSubmergeZOffset:y,aspirateXOffset:A,aspirateYOffset:w,aspirateZOffset:I,blowoutFlowRateUlSec:S,blowoutLocation:L,changeTip:E,destLabware:g,destWells:k,dispenseAirGapVolume:v,dispenseDelay:q,dispenseFlowRateUlSec:$,dispensePositionReference:ee,dispenseRetractDelay:de,dispenseRetractPositionReference:Te,dispenseRetractSpeed:se,dispenseRetractXOffset:Ie,dispenseRetractYOffset:Pe,dispenseRetractZOffset:He,dispenseSubmergeDelay:Ve,dispenseSubmergePositionReference:te,dispenseSubmergeSpeed:Se,dispenseSubmergeXOffset:ze,dispenseSubmergeYOffset:Ce,dispenseSubmergeZOffset:Ee,dispenseXOffset:X,dispenseYOffset:Y,dispenseZOffset:C,dropTipLocation:P,liquidClass:V,mixBeforeAspirate:M,mixInDestination:oe,pipette:U,preWetTip:z,primaryNozzle:x,pushOut:F,sourceLabware:H,nozzles:ce,sourceWells:Ue,tipRack:Je,tipTracking:Be,tiprackSelected:pe,tipsSelected:et,touchTipAfterAspirate:ht,touchTipAfterAspirateMmFromEdge:Rt,touchTipAfterAspirateOffsetMmFromTop:_t,touchTipAfterAspirateSpeed:Re,touchTipAfterDispense:tt,touchTipAfterDispenseMmFromEdge:ge,touchTipAfterDispenseOffsetMmFromTop:ke,touchTipAfterDispenseSpeed:Ne,volume:re,stepNumber:ne}=e,{pipetteEntities:kt,trashBinEntities:Ge,wasteChuteEntities:K,labwareEntities:he}=t,_r=Fn(he,K,Ge,g),rt=he[H]?.def.parameters.quirks?.includes("touchTipDisabled");if(!(_r==="labware"&&k!=null&&Ue.length===k.length||(_r==="wasteChute"||_r==="trashBin")&&k==null&&Ue.length>=1))throw new Error(`Transfer command creator expected N:N source-to-dest wells ratio. Got ${Ue.length}:${k?.length} in labware`);const qe="transfer",_e=[];(!r.pipettes[U]||!kt[U])&&_e.push(pt({pipette:U})),(!H||!r.labware[H])&&_e.push(dt({actionName:qe,labware:H}));const nt=r.labware[g]!=null?W(r.labware[g].stack):"",Wr=W(r.labware[H]?.stack),vt=Object.keys(K).length>0,Ka=K[P]!=null,Yr=Ge[P]!=null;vt&&(nt===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA||Wr===c.GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA)&&_e.push(wa());const sr=[...Object.keys(t.trashBinEntities),...Object.keys(t.wasteChuteEntities)],We=sr.length>0?sr[0]:null,J=Object.values(t.labwareEntities).find(({labwareDefURI:ie})=>ie===P),Pt=J!=null&&c.getIsTiprack(J.def),we=r.tipState.pipettes[U]?.hasTip;if(P==null||Pt&&We==null&&E!=="never"&&we||!Pt&&!Ka&&!Yr)return{errors:[Rn()]};(!g||!he[g]&&!K[g]&&!Ge[g])&&_e.push(kh());let lt,Z;if(E==="never"){const ie=r.tipState.pipettes[U]?.tiprackURI;lt=t.labwareEntities[ie??""],Z=lt?.labwareDefURI}else lt=Object.values(he).find(({labwareDefURI:ie})=>ie===Je),Z=Je;if(lt==null&&(E==="never"?_e.push(xt({actionName:qe,pipette:U})):_e.push(dt({actionName:qe,labware:Z}))),_e.length>0)return{errors:_e};const j=n||0,ut=v||0,fe=qs(U,t,Z)-j;if(fe<=0||!isFinite(fe))return _e.push(os({volume:re,maxVolume:fe,actionName:qe})),{errors:_e};const at=Math.ceil(re/fe);if(!isFinite(at)||at<=0)return _e.push(os({volume:re,maxVolume:at,actionName:qe})),{errors:_e};const zt=re/at,Ct=Array(at).fill(zt),Kr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[m],offset:{x:b,y:T,z:y}},or={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[l],offset:{x:p,y:d,z:f}},yr={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[te],offset:{x:ze,y:Ce,z:Ee}},ir={origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[Te],offset:{x:Ie,y:Pe,z:He}},{spec:Ae,name:Nt,pythonName:br}=kt[U],{tipracks:Tr}=Wa(U,Z,t,r,x,ce),Xr=c.getAllLiquidClassDefs()[V===c.NONE_LIQUID_CLASS_NAME||V==null?c.WATER_LIQUID_CLASS_NAME:V].byPipette?.find(({pipetteModel:ie})=>ie===c.getFlexNameConversion(Ae))?.byTipType.find(({tiprack:ie})=>ie===Z)??null,gr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:zt,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:zt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Qr=Ge[g]?.pythonName??K[g]?.pythonName,Jr=Ge[P]?.pythonName??K[P]?.pythonName,en=L==null?null:Ge[L]?.pythonName??K[L]?.pythonName,Gn=he[H].pythonName,tn=he[g]?.pythonName,jt=ce===c.PARTIAL_COLUMN?tr({labwareDef:he[H].def,wells:Ue,primaryNozzle:x}):Ue,rn=ce===c.PARTIAL_COLUMN&&k!=null&&he[g]!=null?tr({labwareDef:he[g].def,wells:k,primaryNozzle:x}):k,nn=jt.map(ie=>`${Gn}[${N(ie)}]`).join(", "),an=rn!=null&&tn!=null?rn.map(ie=>`${tn}[${N(ie)}]`).join(", "):null,Wn=[`name=${N(`${e.commandCreatorFnName}_step_${ne}`)}`,...V!=null?[`base_liquid_class=${ja(V,!0)}`]:[],`properties=${Ms({args:e,pipetteName:c.isFlexPipette(Nt)?c.getFlexNameConversion(Ae):Nt,tiprackUri:Z,liquidClassValuesForTip:Xr})}`],Yn=`${be}.define_liquid_class(
|
|
150
|
+
${G(Wn.join(`,
|
|
146
151
|
`))},
|
|
147
|
-
)`,Gt=Be===St&&pe!=null&&et!=null&&et.length>0?Ga({wellSets:et,nozzles:ce,channels:Ae.channels,primaryNozzle:x}):null,Kn=Gt!=null&&
|
|
148
|
-
${
|
|
152
|
+
)`,Gt=Be===St&&pe!=null&&et!=null&&et.length>0?Ga({wellSets:et,nozzles:ce,channels:Ae.channels,primaryNozzle:x}):null,Kn=Gt!=null&<!=null&&ce===c.PARTIAL_COLUMN?tr({labwareDef:lt?.def,wells:Gt,primaryNozzle:x}):Gt,Dt=pe!=null?he[pe]?.pythonName:null,lr=Kn?.map(ie=>`${Dt}[${N(ie)}]`).join(", "),Xn=[`volume=${re}`,`source=[${nn}]`,`dest=${an!=null?`[${an}]`:Qr}`,`new_tip=${N(Us(E))}`,...Pt?["return_tip=True",...en!=null?[`trash_location=${en}`]:[]]:[`trash_location=${Jr}`,"keep_last_tip=True"],...Ae.channels>1?["group_wells=False"]:[],...Tr.filteredSortedTiprackIds.length>0?[Fs({labwareEntities:he,tiprackIds:Tr.filteredSortedTiprackIds})]:[],`liquid_class=${Yn}`,...Gt!=null&&Dt!=null?[`tips=[${lr}]`]:[]],Ir=()=>({commands:[],python:`${br}.transfer_with_liquid_class(
|
|
153
|
+
${G(Xn.join(`,
|
|
149
154
|
`))},
|
|
150
|
-
)`}),Zn=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,on=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,Qn=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:lt,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,ln=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:lt,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,Er=IA(Ue,k);let wr=null,Jn=null;const ye=[...Er.reduce((ie,yt,Mt)=>{const[Le,De]=yt,ea=Ct.reduce((le,Ye,ur)=>{const Sr=Mt===0&&ur===0,Ar=Mt+1===Er.length,un=ur+1===Ct.length&&Ar;let bt=!1;E==="always"?bt=!0:E==="once"?bt=Sr:E==="perSource"?bt=Le!==wr:E==="perDest"&&(bt=Sr||De!==Jn);const ra=c.LOW_VOLUME_PIPETTES.includes(Nt)?[R(An,{pipetteId:U,volume:Ye})]:[];let cr=[];if(bt){const It=Gt?.shift();cr=[O(Ya,{pipette:U,primaryNozzle:x,nozzles:ce,dropTipLocation:Pt&&We!=null?We:P,tipRack:Z,...ce!=null?{nozzles:ce}:{},...Be===St&&It!=null&&pe!=null?{tipSelectionArgs:{tipRackId:pe,tipWell:It}}:{}})]}const Lr=he[H]?.def.wells[Le]?.depth??null,Wt=c.getMmFromBottom(I,o,Lr),Yt=c.getMmFromBottom(y,m,Lr),cn=c.getMmFromBottom(f,l,Lr);Wt!=null&&Yt!=null&&Wt>Yt&&_e.push(vh());const Or=Ur({retractZOffset:f,retractPositionReference:l,labwareId:H,labwareEntities:he,well:Le}),pr=!Or&&Le!=null?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],pn=Ur({retractZOffset:He,retractPositionReference:Te,labwareId:g,labwareEntities:he,well:De}),Oe=!pn&&De!=null?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[];Wt!=null&&cn!=null&&Wt>cn&&_e.push(Ph());const Kt=[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],Rr=[R(Lt,{pipetteId:U})],Tt=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:lt,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Xt=q!=null?[R(me,{seconds:q.seconds})]:[],na=lt>0&&!bt&&(ur>0||Mt>0)?[R(Xe,{isAirGap:!0,pipetteId:U,volume:lt,flowRate:ln,...Tt>0?{correctionVolume:Tt}:{},pushOut:0}),...Xt]:[],dn=[...Kt,...na,...ra,...Rr],fn=[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:Kr}),R(B,{pipetteId:U,labwareId:H,...h!=null?{speed:h}:{},wellName:Le,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[o],offset:{x:A,y:w,z:I}}}),..._!=null&&_.seconds>0?[R(me,{seconds:_.seconds})]:[]],aa=z?Dr({pipette:U,volume:Ye,times:1,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds??0,dispenseDelaySeconds:q?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],mn=M!=null?Dr({pipette:U,volume:M.volume,times:M.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:q?.seconds,finalPushOut:0,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],kr=a!=null?[R(me,{seconds:a.seconds})]:[],sa=ht?[R(Et,{pipetteId:U,labwareId:H,wellName:Le,...Rt!=null?{mmFromEdge:Rt}:{},zOffsetFromTop:_t,...Re!=null?{speed:Re}:{}}),...j>0&&Or?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:or})]:[]]:[],Me=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,vr=j>0?[...pr,R(At,{pipetteId:U,volume:j,flowRate:Zn,...Me>0?{correctionVolume:Me}:{}}),...kr]:[],hn=[R(Na,{pipetteId:U,volume:Ye,flowRate:s,...Zr>0?{correctionVolume:Zr}:{}}),...kr],dr=[R(B,{pipetteId:U,labwareId:H,...u!=null?{speed:u}:{},wellName:Le,wellLocation:or}),...i!=null&&i?.seconds>0?[R(me,{seconds:i.seconds})]:[]],Pr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zt=De!=null?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:yr}),...j>0?[R(Xe,{isAirGap:!0,pipetteId:U,volume:j,flowRate:on,pushOut:0,...Pr>0?{correctionVolume:Pr}:{}}),...Xt]:[],R(B,{pipetteId:U,labwareId:g,...Se!=null?{speed:Se}:{},wellName:De,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ee],offset:{x:X,y:W,z:C}}}),...Ve!=null&&Ve.seconds>0?[R(me,{seconds:Ve.seconds})]:[]]:[R(Fe,{fixtureId:g,pipetteId:U,offset:{x:0,y:0,z:0}})],fr=oe!=null&&De!=null?0:F,oa=[R(Xe,{pipetteId:U,volume:Ye,flowRate:$,...fr!=null?{pushOut:fr}:{},...gr>0?{correctionVolume:gr}:{}}),...Xt],Za=oe!=null&&De!=null?Dr({pipette:U,volume:oe.volume,times:oe.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:q?.seconds,finalPushOut:F,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],Vs=De!=null?[R(B,{pipetteId:U,labwareId:g,...se!=null?{speed:se}:{},wellName:De,wellLocation:ir}),...de!=null&&de?.seconds>0?[R(me,{seconds:de.seconds})]:[]]:[],Qa=R(Dn,{pipetteId:U,flowRate:S}),ia=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:lt,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,gt=(It,Cr=!0)=>lt>0&&!(E==="never"&&un&&It)?[...Cr?Oe:[],R(Lt,{pipetteId:U}),R(At,{pipetteId:U,volume:lt,flowRate:Qn,...ia>0?{correctionVolume:ia}:{}}),...kr]:[],_n=It=>De!=null&&tt?[R(Et,{pipetteId:U,labwareId:g,wellName:De,...ge!=null?{mmFromEdge:ge}:{},zOffsetFromTop:ke,...Ne!=null?{speed:Ne}:{}}),...gt(It).length>0&&pn?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:ir})]:[]]:[];let Ft=[];switch(L){case null:case void 0:Ft=[..._n(!0),...gt(!0)];break;case Mn:Ft=[Qa,..._n(!0),...gt(!0)];break;case zr:Ft=[..._n(!0),...gt(!1),R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),Qa,...tt&&!rt?[R(Et,{pipetteId:U,labwareId:H,wellName:Le,...ge!=null?{mmFromEdge:ge}:{},zOffsetFromTop:ke,...Ne!=null?{speed:Ne}:{}})]:[],...gt(!0).length>0?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...gt(!0,!1)];break;default:L in Ge?Ft=[..._n(!1),...gt(!1),R(cb,{pipetteId:U,flowRate:S,trashId:L}),...gt(!0,!1)]:L in Y&&(Ft=[R(pb,{pipetteId:U,flowRate:S,wasteChuteId:L}),...gt(!0,!1)]);break}const Ja=Pt&&(un||E==="always")?[R(Hr,{pipette:U,dropTipLocation:Z,isReturnTip:Pt})]:[],Ut=[...cr,...dn,...fn,...mn,...aa,...hn,...dr,...sa,...vr,...Zt,...oa,...Za,...Vs,...Ft,...Ja];return wr=Le,Jn=De,[...le,...Ut]},[]);return[...ie,...ea]},[]),Ir];return ae(ye,t,r)},Eb=(e,t,r)=>ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Nc,{...e,commandCreatorFnName:"vacuumSetPumpPower"})],t,r),wb=(e,t,r)=>ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Dc,{...e,commandCreatorFnName:"vacuumSetPumpPressure"})],t,r),Sb=(e,t,r)=>{const{ventAfter:n}=e;return ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Mc,{...e,commandCreatorFnName:"vacuumStartRunProfile",ventAfter:n})],t,r)},Ab=(e,t,r)=>{const n=`[${e.task_ids.join(", ")}]`,a=`${be}.wait_for_tasks(${n})`;return{commands:[{key:D(),commandType:"waitForTasks",params:e}],python:a}},Lb=(e,t,r)=>{const{waitCondition:n}=e;return n==="thermocyclerProfileComplete"?EA(e,t,r):n==="vacuumProfileComplete"||n==="vacuumStateComplete"?wA(e,t,r):{errors:[cT(n)]}},EA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=$s(r,n);if(s==null)return{errors:[Q()]};if(s.currentBlockActivity.type!=="profile")return{errors:[dp()]};const{taskId:o}=s.currentBlockActivity;return o==null?{errors:[dp()]}:(a.push(O(Ab,{task_ids:[o]})),ae(a,t,r))},wA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=ot(r,n);if(s==null)return{errors:[Q()]};if(s.currentPumpActivity.type!=="timedHold"&&s.currentPumpActivity.type!=="profile")return{errors:[uT()]};const o=s.currentPumpActivity.taskId;return a.push(O(Ab,{task_ids:[o]})),ae(a,t,r)};var Bu,Sh;function SA(){if(Sh)return Bu;Sh=1;var e=Ty(),t=1,r=4;function n(a){return e(a,t|r)}return Bu=n,Bu}var AA=SA();const LA=xe(AA),Ob=["A1","B1","C1","D1","E1","F1","G1","H1","A2","B2","C2","D2","E2","F2","G2","H2","A3","B3","C3","D3","E3","F3","G3","H3","A4","B4","C4","D4","E4","F4","G4","H4","A5","B5","C5","D5","E5","F5","G5","H5","A6","B6","C6","D6","E6","F6","G6","H6","A7","B7","C7","D7","E7","F7","G7","H7","A8","B8","C8","D8","E8","F8","G8","H8","A9","B9","C9","D9","E9","F9","G9","H9","A10","B10","C10","D10","E10","F10","G10","H10","A11","B11","C11","D11","E11","F11","G11","H11","A12","B12","C12","D12","E12","F12","G12","H12"],Vr="p300SingleId",ba="p300MultiId",ac="p100096Id",sc="sourcePlateId",oc="destPlateId",ic="troughId",OA="A1",RA="tiprack1Id",kA={isAirGap:!0},rs=c.fixture96Plate,Ah=c.fixture12Trough,ns=c.fixtureTiprack10ul,qt=c.fixtureTiprack300ul,yn=c.fixtureTiprack1000ul,as=c.fixtureTiprackAdapter,Rb={OT_PD_DISABLE_MODULE_RESTRICTIONS:!1};function kb(e){return Ob.reduce((t,r)=>({...t,[r]:e?Ra:ue}),{})}function vA(e,t){return Array.from("ABCDEFGH").map(r=>`${r}${e}`).reduce((r,n)=>({...r,[n]:t}),{})}function vb(){const e={[sc]:{id:sc,pythonName:"mock_source_plate",labwareDefURI:c.getLabwareDefURI(rs),def:rs},[oc]:{id:oc,pythonName:"mock_dest_plate",labwareDefURI:c.getLabwareDefURI(rs),def:rs},[ic]:{id:ic,pythonName:"mock_trough",labwareDefURI:c.getLabwareDefURI(Ah),def:Ah},tiprack1Id:{id:"tiprack1Id",pythonName:"mock_tip_rack_1",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack2Id:{id:"tiprack2Id",pythonName:"mock_tip_rack_2",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack3Id:{id:"tiprack3Id",pythonName:"mock_tip_rack_3",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack4AdapterId:{id:"tiprack4AdapterId",pythonName:"mock_adapter_4",labwareDefURI:c.getLabwareDefURI(as),def:as},tiprack5AdapterId:{id:"tiprack5AdapterId",pythonName:"mock_adapter_5",labwareDefURI:c.getLabwareDefURI(as),def:as},tiprack4Id:{id:"tiprack4Id",pythonName:"mock_tip_rack_4",labwareDefURI:c.getLabwareDefURI(yn),def:yn},tiprack5Id:{id:"tiprack5Id",pythonName:"mock_tip_rack_5",labwareDefURI:c.getLabwareDefURI(yn),def:yn}},t={},r={[Hu]:{id:Hu,location:"cutoutA3",pythonName:"trash_bin_1"}},n={p10SingleId:{name:"p10_single",id:"p10SingleId",pythonName:"mock_pipette_p10",tiprackDefURI:[c.getLabwareDefURI(ns)],tiprackLabwareDef:[ns],spec:c.fixtureP10SingleV2Specs},p10MultiId:{name:"p10_multi",id:"p10MultiId",tiprackDefURI:[c.getLabwareDefURI(ns)],tiprackLabwareDef:[ns],spec:c.fixtureP10MultiV2Specs,pythonName:"mock_pipette_p10_multi"},[Vr]:{name:"p300_single",id:Vr,tiprackDefURI:[c.getLabwareDefURI(qt)],tiprackLabwareDef:[qt],spec:c.fixtureP300SingleV2Specs,pythonName:"mock_pipette"},[ba]:{name:"p300_multi",id:ba,tiprackDefURI:[c.getLabwareDefURI(qt)],tiprackLabwareDef:[qt],spec:c.fixtureP300MultiV2Specs,pythonName:"mock_pipette_p300_multi"},[ac]:{name:"p1000_96",id:ac,tiprackDefURI:[c.getLabwareDefURI(yn)],tiprackLabwareDef:[yn],spec:c.fixtureP100096V2Specs,pythonName:"mock_pipette_p1000_96"}};return{labwareEntities:e,moduleEntities:t,pipetteEntities:n,trashBinEntities:r,wasteChuteEntities:{},stagingAreaEntities:{},gripperEntities:{},liquidEntities:{},runtimeParameters:{},config:Rb}}const Gr=e=>{const{invariantContext:t,labwareLocations:r,moduleLocations:n,pipetteLocations:a,tiprackSetting:s}=e,o=Bc({invariantContext:t,labwareLocations:r,moduleLocations:n||{},pipetteLocations:a});return o.tipState.tipracks=rr(s,i=>kb(i)),o},jn=()=>({pipetteLocations:{[Vr]:{mount:"left",tiprackId:"tiprack1Id"},[ba]:{mount:"right",tiprackId:"tiprack1Id"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","1"]},tiprack2Id:{stack:["tiprack2Id","5"]},tiprack4AdapterId:{stack:["tiprack4AdapterId","7"]},tiprack5AdapterId:{stack:["tiprack5AdapterId","8"]},tiprack4Id:{stack:["tiprack4Id","tiprack4AdapterId","7"]},tiprack5Id:{stack:["tiprack5Id","tiprack5AdapterId","8"]},sourcePlateId:{stack:["sourcePlateId","2"]},destPlateId:{stack:["destPlateId","3"]}},moduleLocations:{}}),Pb=()=>({pipetteLocations:{[Vr]:{mount:"left"},[ba]:{mount:"right"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","B1"]},tiprack2Id:{stack:["tiprack2Id","A2"]},sourcePlateId:{stack:["sourcePlateId","offDeck"]},destPlateId:{stack:["destPlateId","C2"]}},moduleLocations:{}}),Cb=e=>Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),PA=e=>Gr({...Pb(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),CA=e=>({robotState:Cb(e),warnings:[]}),NA=e=>{const t=Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}});return t.tipState.pipettes[Vr]={hasTip:!0,tiprackURI:"tiprack1Id"},t},DA=e=>{const t=Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0}});return t.tipState.pipettes[Vr]={hasTip:!0,tiprackURI:"tiprack1Id"},t.tipState.tipracks.tiprack1Id.A1=ue,t},MA=e=>Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!1,tiprack2Id:!1}}),FA=({temperatureModuleId:e,thermocyclerId:t})=>{const r=vb();r.moduleEntities={[e]:{id:e,type:c.TEMPERATURE_MODULE_TYPE,model:"foo",pythonName:"mock_temperature_module_1"},[t]:{id:t,type:c.THERMOCYCLER_MODULE_TYPE,model:"foo",pythonName:"mock_thermocycler"}};const n=Gr({...jn(),invariantContext:r,tiprackSetting:{tiprack1Id:!0}});return n.modules={[e]:{slot:"3",moduleState:{type:c.TEMPERATURE_MODULE_TYPE,status:Oa,targetTemperature:null}},[t]:{slot:"span7_8_10_11",moduleState:{type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0}}},{invariantContext:r,robotState:n}},UA=(e,t,r,n)=>{const a=LA(e);return a.modules[t].moduleState={type:c.TEMPERATURE_MODULE_TYPE,targetTemperature:n,status:r},a};exports.ABSORBANCE_READER_INITIAL_STATE=$h;exports.AIR=je;exports.AIR_GAP_META=kA;exports.AIR_GAP_OFFSET_FROM_TOP=xu;exports.AUTOMATIC=cc;exports.BOTTOM_UP_LABWARE_POOL_KEYS=Jt;exports.BOTTOM_UP_STORED_LABWARE_URI_KEYS=gT;exports.CLEAN=Ra;exports.COLUMN_4_SLOTS=ve;exports.CUSTOM_LABWARE_DICT_NAME=As;exports.DEFAULT_BLOWOUT_WELL=OA;exports.DEFAULT_CONFIG=Rb;exports.DEFAULT_PIPETTE=Vr;exports.DEST_LABWARE=oc;exports.DEST_WELL_BLOWOUT_DESTINATION=Mn;exports.DIRTY=Qt;exports.EMPTY=ue;exports.FAKE_HOPPER_LOCATION_MAP=Wh;exports.FIXED_TRASH_ID=Hu;exports.FLEX_STACKER_MODULE_INITIAL_STATE=Bh;exports.FLEX_TRASH_DEF_URI=bT;exports.GRIPPER_LOCATION=zh;exports.HEATERSHAKER_MODULE_INITIAL_STATE=qh;exports.HOPPER_FAKE_LOCATIONS=Gh;exports.HOPPER_STACKER_LOCATION=Ze;exports.INDENT=Ma;exports.MAGNETIC_BLOCK_INITIAL_STATE=Vh;exports.MAGNETIC_MODULE_INITIAL_STATE=Mh;exports.MANUAL=St;exports.MIXED_WELL_COLOR=Vy;exports.MODULES_WITH_COLLISION_ISSUES=Dh;exports.MODULE_INITIAL_STATE_BY_TYPE=Hh;exports.MULTI_PIPETTE=ba;exports.OFF_DECK=Ln;exports.OT2_TC_SLOTS=TT;exports.OT_2_TRASH_DEF_URI=yT;exports.PAPI_VERSION=xy;exports.PD_APPLICATION_VERSION=CS;exports.PIPETTE_96=ac;exports.PROTOCOL_CONTEXT_NAME=be;exports.SLOT_LOCATIONS_TO_FAKE_HOPPER_LOCATIONS=IT;exports.SOURCE_LABWARE=sc;exports.SOURCE_WELL_BLOWOUT_DESTINATION=zr;exports.STAGING_AREA_SLOTS=jh;exports.TEMPERATURE_APPROACHING_TARGET=uc;exports.TEMPERATURE_AT_TARGET=lc;exports.TEMPERATURE_DEACTIVATED=Oa;exports.TEMPERATURE_MODULE_INITIAL_STATE=Fh;exports.THERMOCYCLER_MODULE_INITIAL_STATE=Uh;exports.TIPRACK_1=RA;exports.TOUCHED_PIPETTABLE_LABWARE=rc;exports.TROUGH_LABWARE=ic;exports.VACUUM_AT_TARGET=vT;exports.VACUUM_DEACTIVATED=kT;exports.VACUUM_DOCK_ADDRESSABLE_AREA=Yh;exports.VACUUM_DOCK_DISPLAY_LOCATION=Xh;exports.VACUUM_DOCK_LOCATION=pc;exports.VACUUM_MODE_POWER=zu;exports.VACUUM_MODE_PRESSURE=ju;exports.VACUUM_MODULE_INITIAL_STATE=xh;exports.VACUUM_PROGRAM_PROFILE=wT;exports.VACUUM_PROGRAM_STATE=ET;exports.VACUUM_SPACER_LOAD_NAMES=Kh;exports.VACUUM_STATE_PUMP_OFF=ST;exports.VACUUM_STATE_PUMP_ON=AT;exports.VACUUM_STATE_VENT=LT;exports.VACUUM_VENT_CLOSED=ka;exports.VACUUM_VENT_OPEN=dc;exports.VACUUM_VENT_SET_CLOSED=RT;exports.VACUUM_VENT_SET_OPEN=OT;exports.ZERO_OFFSET=wt;exports._getNextTip=ib;exports._wellContentsForLabware=ES;exports.absorbanceReaderCloseInitialize=lb;exports.absorbanceReaderCloseLid=ws;exports.absorbanceReaderCloseRead=ub;exports.absorbanceReaderCollision=Ua;exports.absorbanceReaderInitialize=g_;exports.absorbanceReaderOpenLid=I_;exports.absorbanceReaderRead=E_;exports.absorbanceReaderStateGetter=zn;exports.airGapLocationHelper=wI;exports.aspirate=nI;exports.assignContainsAmongSiblings=sp;exports.blowOutInWell=Rc;exports.captureImage=w_;exports.column4StagingSlotIdFromFlexStackerShuttleAddressableArea=ny;exports.commandCreatorsTimeline=tS;exports.comment=S_;exports.consolidate=_b;exports.constructInvariantContextFromAnalysis=iS;exports.createEmptyLiquidState=Z_;exports.createStagingAreaForInvariantContext=Ku;exports.createTipLiquidState=Q_;exports.curryCommandCreator=O;exports.curryWithoutPython=R;exports.deactivateTemperature=L_;exports.deckSlotKeyForFlexStackerShuttleAddressableArea=LI;exports.delay=me;exports.delayLocationHelper=SI;exports.disengageMagnet=O_;exports.dispense=kc;exports.dispenseLocationHelper=II;exports.distribute=yb;exports.dropTip=Hr;exports.dropTipInPlace=Ss;exports.dropTipInTrash=fb;exports.dropTipInWasteChute=mb;exports.engageMagnet=R_;exports.enrichRobotStateForStackGraphTraversals=iw;exports.flexStackerEmpty=k_;exports.flexStackerFillItems=v_;exports.flexStackerRetrieve=P_;exports.flexStackerStateGetter=mt;exports.flexStackerStore=C_;exports.formatChangeTipArg=Us;exports.formatPyDict=Fr;exports.formatPyList=Ls;exports.formatPyStr=N;exports.formatPyTuple=Cc;exports.formatPyValue=dt;exports.formatPyWellLocation=Bt;exports.getAddressableAreaFromModule=ap;exports.getAddressableAreaNameFromLabwareLocation=tw;exports.getAllLargestStacks=Ay;exports.getAllProvidedAddressableAreasFromDeckConfig=Ly;exports.getAllWellsForLabware=$y;exports.getChunkForIndentingLists=Os;exports.getCommandCreatorFromStepArgs=tA;exports.getCustomLiquidClassProperties=Ms;exports.getCutoutFromSlot=tb;exports.getCutoutIdByAddressableArea=G_;exports.getDefaultPrimaryNozzle=cs;exports.getDefineLiquids=Yy;exports.getDispenseAirGapLocation=J_;exports.getFlexStackerCutoutBaseDeckSlotId=Hc;exports.getFlexStackerShuttleAddressableArea=Rs;exports.getFullStackFromLabwares=ks;exports.getFullStackFromNodeTopDownRecursive=Ds;exports.getHasNoWellsFromCCArgs=nS;exports.getInitialRobotStateStandard=Cb;exports.getInitialRobotStateWithOffDeckLabwareStandard=PA;exports.getIsHeaterShakerEastWestMultiChannelPipette=xn;exports.getIsHeaterShakerEastWestWithLatchOpen=Bn;exports.getIsHeaterShakerNorthSouthOfNonTiprackWithMultiChannelPipette=xa;exports.getIsInPipettableLocation=ly;exports.getIsLabwareCompatibleWithStack=sy;exports.getIsRetractSafeForAirGap=Ur;exports.getIsSafePickupWithinTiprack=up;exports.getIsSlotAHopper=oy;exports.getIsSlotAVacuumDock=ma;exports.getIsSpaceInHopper=Wc;exports.getIsTallLabwareEastWestOfHeaterShaker=Uy;exports.getIsVacuumSpacer=j_;exports.getLabwareHasLid=iy;exports.getLabwareHasLiquid=ty;exports.getLabwareIdOnShuttle=jc;exports.getLabwareSlot=qn;exports.getLargestStackContainingLabware=Sy;exports.getLargestStackInSlot=fa;exports.getLiquidClassName=ja;exports.getLiquidIdsOnLabware=AS;exports.getLiquidIdsOnLabwareStack=SS;exports.getLoadAdapters=zy;exports.getLoadLabware=Gy;exports.getLoadLidStacks=jy;exports.getLoadLiquidClasses=Xy;exports.getLoadLiquids=Ky;exports.getLoadModules=Hy;exports.getLoadPipettes=Wy;exports.getLoadTrashBins=Zy;exports.getLoadWasteChute=Qy;exports.getLocationTotalVolume=mr;exports.getModuleHasLiveTask=$n;exports.getModuleIdFromRobotStateStack=Fa;exports.getModuleLocationSlot=AI;exports.getModuleState=Ot;exports.getNearestParentInStack=ry;exports.getNextRobotStateAndWarnings=ip;exports.getNextRobotStateAndWarningsSingleCommand=Fy;exports.getNextTiprack=Wa;exports.getNodeParentModuleId=JE;exports.getNozzleConfig=lp;exports.getPipetteCenteringFullOffset=ab;exports.getPipetteIdFromCCArgs=rS;exports.getPipetteMovementSafetyStatus=ft;exports.getPipetteWithTipMaxVol=qs;exports.getProvidedAddressableAreasExposed=rw;exports.getPythonAssignTipRacksString=Fs;exports.getResultingTimelineFrameFromRunCommands=uS;exports.getRobotInitialStateNoTipsRemain=MA;exports.getRobotStateAndWarningsStandard=CA;exports.getRobotStatePickedUpTipStandard=DA;exports.getRobotStateWithTipStandard=NA;exports.getSetStoredLabware=eb;exports.getSlotInLocationStack=G;exports.getStackForLabwareLocation=Yu;exports.getStackedOnNodeFromPdStack=Oy;exports.getStateAndContextTempTCModules=FA;exports.getTargetTipsFromWellSets=Ga;exports.getThermocyclerProfileRepetitionsForPython=sb;exports.getTipColumn=vA;exports.getTipColumnIndex=nc;exports.getTipColumnName=cp;exports.getTipRowName=gn;exports.getTiprackHasTips=ey;exports.getTiprackTipstate=kb;exports.getTopLocationInStack=xc;exports.getTopmostLabwareOnModuleFromStackRobotState=RI;exports.getTransferPlanAndReferenceVolumes=zc;exports.getTrashBinAddressableAreaName=$c;exports.getTrashLocationFromAddressableAreaName=Y_;exports.getTrashOrLabware=Fn;exports.getVolumesPerLiquid=wS;exports.getWasteChuteAddressableAreaNamePip=W_;exports.getWellsForTips=Vc;exports.heaterShaker=bb;exports.indentPyLines=K;exports.labwareMatchesLabwareInHopper=Gc;exports.makeContext=vb;exports.makeInitialRobotState=Bc;exports.makeState=Gr;exports.makeStateArgsLabwareOffDeck=Pb;exports.makeStateArgsStandard=jn;exports.mergeLiquid=hr;exports.mix=hb;exports.mixBlowoutLocationHelper=X_;exports.modulePipetteCollision=Vn;exports.moveHelper=EI;exports.moveLabware=N_;exports.moveToAddressableArea=Fe;exports.moveToAddressableAreaForDropTip=vc;exports.pipetteAdjacentHeaterShakerWhileShaking=Hn;exports.pipetteIntoHeaterShakerLatchOpen=Ha;exports.pipetteIntoHeaterShakerWhileShaking=za;exports.pythonCustomLabwareDict=VS;exports.pythonDefRun=$S;exports.pythonImports=NS;exports.pythonMetadata=DS;exports.pythonRequirements=MS;exports.reduceCommandCreators=ae;exports.repeatArray=K_;exports.replaceTip=Ya;exports.resolveDeckSlotKeyForLabwareStackInSlot=ay;exports.robotWithStatusAndTemp=UA;exports.setTemperature=Pc;exports.sortLabwareBySlot=ob;exports.splitLiquid=er;exports.stepCommands=Jy;exports.swatchColors=By;exports.thermocyclerPipetteCollision=Va;exports.thermocyclerProfileStep=Tb;exports.thermocyclerStateGetter=$s;exports.thermocyclerStateStep=gb;exports.tiprackWellNamesFlat=Ob;exports.touchTip=Et;exports.transfer=Ib;exports.unrollThermocyclerProfile=pp;exports.uuid=D;exports.vacuumCloseVent=Da;exports.vacuumCloseVentSetPumpPower=Eb;exports.vacuumCloseVentSetPumpPressure=wb;exports.vacuumCloseVentStartProfile=Sb;exports.vacuumModuleStateGetter=ot;exports.vacuumOpenVent=M_;exports.vacuumSetPumpPower=Nc;exports.vacuumSetPumpPressure=Dc;exports.vacuumStartRunProfile=Mc;exports.vacuumStopPump=U_;exports.waitForModuleTask=Lb;exports.waitForTemperature=Fc;exports.wellFillFromWellContents=OS;
|
|
155
|
+
)`}),Zn=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,on=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,Qn=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:ut,liquidHandlingAction:"aspirate",byVolumeProperty:"flowRateByVolume",defaultValue:null})??s,ln=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:ut,liquidHandlingAction:"singleDispense",byVolumeProperty:"flowRateByVolume",defaultValue:null})??$,Er=LA(Ue,k);let wr=null,Jn=null;const ye=[...Er.reduce((ie,yt,Mt)=>{const[Le,De]=yt,ea=Ct.reduce((le,Ye,ur)=>{const Sr=Mt===0&&ur===0,Ar=Mt+1===Er.length,un=ur+1===Ct.length&&Ar;let bt=!1;E==="always"?bt=!0:E==="once"?bt=Sr:E==="perSource"?bt=Le!==wr:E==="perDest"&&(bt=Sr||De!==Jn);const ra=c.LOW_VOLUME_PIPETTES.includes(Nt)?[R(An,{pipetteId:U,volume:Ye})]:[];let cr=[];if(bt){const It=Gt?.shift();cr=[O(Ya,{pipette:U,primaryNozzle:x,nozzles:ce,dropTipLocation:Pt&&We!=null?We:P,tipRack:Z,...ce!=null?{nozzles:ce}:{},...Be===St&&It!=null&&pe!=null?{tipSelectionArgs:{tipRackId:pe,tipWell:It}}:{}})]}const Lr=he[H]?.def.wells[Le]?.depth??null,Wt=c.getMmFromBottom(I,o,Lr),Yt=c.getMmFromBottom(y,m,Lr),cn=c.getMmFromBottom(f,l,Lr);Wt!=null&&Yt!=null&&Wt>Yt&&_e.push(vh());const Or=Ur({retractZOffset:f,retractPositionReference:l,labwareId:H,labwareEntities:he,well:Le}),pr=!Or&&Le!=null?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[],pn=Ur({retractZOffset:He,retractPositionReference:Te,labwareId:g,labwareEntities:he,well:De}),Oe=!pn&&De!=null?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})]:[];Wt!=null&&cn!=null&&Wt>cn&&_e.push(Ph());const Kt=[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:c.SAFE_MOVE_TO_WELL_LOCATION})],Rr=[R(Lt,{pipetteId:U})],Tt=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:ut,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Xt=q!=null?[R(me,{seconds:q.seconds})]:[],na=ut>0&&!bt&&(ur>0||Mt>0)?[R(Xe,{isAirGap:!0,pipetteId:U,volume:ut,flowRate:ln,...Tt>0?{correctionVolume:Tt}:{},pushOut:0}),...Xt]:[],dn=[...Kt,...na,...ra,...Rr],fn=[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:Kr}),R(B,{pipetteId:U,labwareId:H,...h!=null?{speed:h}:{},wellName:Le,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[o],offset:{x:A,y:w,z:I}}}),..._!=null&&_.seconds>0?[R(me,{seconds:_.seconds})]:[]],aa=z?Dr({pipette:U,volume:Ye,times:1,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds??0,dispenseDelaySeconds:q?.seconds??0,finalPushOut:0,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],mn=M!=null?Dr({pipette:U,volume:M.volume,times:M.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:q?.seconds,finalPushOut:0,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],kr=a!=null?[R(me,{seconds:a.seconds})]:[],sa=ht?[R(Et,{pipetteId:U,labwareId:H,wellName:Le,...Rt!=null?{mmFromEdge:Rt}:{},zOffsetFromTop:_t,...Re!=null?{speed:Re}:{}}),...j>0&&Or?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:or})]:[]]:[],Me=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,vr=j>0?[...pr,R(At,{pipetteId:U,volume:j,flowRate:Zn,...Me>0?{correctionVolume:Me}:{}}),...kr]:[],hn=[R(Na,{pipetteId:U,volume:Ye,flowRate:s,...Zr>0?{correctionVolume:Zr}:{}}),...kr],dr=[R(B,{pipetteId:U,labwareId:H,...u!=null?{speed:u}:{},wellName:Le,wellLocation:or}),...i!=null&&i?.seconds>0?[R(me,{seconds:i.seconds})]:[]],Pr=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:j,liquidHandlingAction:"singleDispense",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,Zt=De!=null?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:yr}),...j>0?[R(Xe,{isAirGap:!0,pipetteId:U,volume:j,flowRate:on,pushOut:0,...Pr>0?{correctionVolume:Pr}:{}}),...Xt]:[],R(B,{pipetteId:U,labwareId:g,...Se!=null?{speed:Se}:{},wellName:De,wellLocation:{origin:c.POSITION_REFERENCE_MAPPED_TO_WELL_ORIGIN[ee],offset:{x:X,y:Y,z:C}}}),...Ve!=null&&Ve.seconds>0?[R(me,{seconds:Ve.seconds})]:[]]:[R(Fe,{fixtureId:g,pipetteId:U,offset:{x:0,y:0,z:0}})],fr=oe!=null&&De!=null?0:F,oa=[R(Xe,{pipetteId:U,volume:Ye,flowRate:$,...fr!=null?{pushOut:fr}:{},...gr>0?{correctionVolume:gr}:{}}),...Xt],Za=oe!=null&&De!=null?Dr({pipette:U,volume:oe.volume,times:oe.times,aspirateFlowRateUlSec:s,dispenseFlowRateUlSec:$,aspirateDelaySeconds:a?.seconds,dispenseDelaySeconds:q?.seconds,finalPushOut:F,invariantContext:t,liquidClass:V,tiprack:Z,generatePython:!1}):[],Vs=De!=null?[R(B,{pipetteId:U,labwareId:g,...se!=null?{speed:se}:{},wellName:De,wellLocation:ir}),...de!=null&&de?.seconds>0?[R(me,{seconds:de.seconds})]:[]]:[],Qa=R(Dn,{pipetteId:U,flowRate:S}),ia=c.getByVolumeValue({liquidClass:V,pipetteSpecs:Ae,tiprackDefUri:Z,targetVolume:ut,liquidHandlingAction:"aspirate",byVolumeProperty:"correctionByVolume",defaultValue:0})??0,gt=(It,Cr=!0)=>ut>0&&!(E==="never"&&un&&It)?[...Cr?Oe:[],R(Lt,{pipetteId:U}),R(At,{pipetteId:U,volume:ut,flowRate:Qn,...ia>0?{correctionVolume:ia}:{}}),...kr]:[],_n=It=>De!=null&&tt?[R(Et,{pipetteId:U,labwareId:g,wellName:De,...ge!=null?{mmFromEdge:ge}:{},zOffsetFromTop:ke,...Ne!=null?{speed:Ne}:{}}),...gt(It).length>0&&pn?[R(B,{pipetteId:U,labwareId:g,wellName:De,wellLocation:ir})]:[]]:[];let Ft=[];switch(L){case null:case void 0:Ft=[..._n(!0),...gt(!0)];break;case Mn:Ft=[Qa,..._n(!0),...gt(!0)];break;case zr:Ft=[..._n(!0),...gt(!1),R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:{origin:c.WELL_ORIGIN_TOP}}),Qa,...tt&&!rt?[R(Et,{pipetteId:U,labwareId:H,wellName:Le,...ge!=null?{mmFromEdge:ge}:{},zOffsetFromTop:ke,...Ne!=null?{speed:Ne}:{}})]:[],...gt(!0).length>0?[R(B,{pipetteId:U,labwareId:H,wellName:Le,wellLocation:{origin:c.WELL_ORIGIN_TOP}})]:[],...gt(!0,!1)];break;default:L in Ge?Ft=[..._n(!1),...gt(!1),R(cb,{pipetteId:U,flowRate:S,trashId:L}),...gt(!0,!1)]:L in K&&(Ft=[R(pb,{pipetteId:U,flowRate:S,wasteChuteId:L}),...gt(!0,!1)]);break}const Ja=Pt&&(un||E==="always")?[R(Hr,{pipette:U,dropTipLocation:Z,isReturnTip:Pt})]:[],Ut=[...cr,...dn,...fn,...mn,...aa,...hn,...dr,...sa,...vr,...Zt,...oa,...Za,...Vs,...Ft,...Ja];return wr=Le,Jn=De,[...le,...Ut]},[]);return[...ie,...ea]},[]),Ir];return ae(ye,t,r)},Eb=(e,t,r)=>ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Nc,{...e,commandCreatorFnName:"vacuumSetPumpPower"})],t,r),wb=(e,t,r)=>ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Dc,{...e,commandCreatorFnName:"vacuumSetPumpPressure"})],t,r),Sb=(e,t,r)=>{const{ventAfter:n}=e;return ae([O(Da,{moduleId:e.moduleId,commandCreatorFnName:"vacuumCloseVent"}),O(Mc,{...e,commandCreatorFnName:"vacuumStartRunProfile",ventAfter:n})],t,r)},Ab=(e,t,r)=>{const n=`[${e.task_ids.join(", ")}]`,a=`${be}.wait_for_tasks(${n})`;return{commands:[{key:D(),commandType:"waitForTasks",params:e}],python:a}},Lb=(e,t,r)=>{const{waitCondition:n}=e;return n==="thermocyclerProfileComplete"?OA(e,t,r):n==="vacuumProfileComplete"||n==="vacuumStateComplete"?RA(e,t,r):{errors:[cT(n)]}},OA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=$s(r,n);if(s==null)return{errors:[Q()]};if(s.currentBlockActivity.type!=="profile")return{errors:[dp()]};const{taskId:o}=s.currentBlockActivity;return o==null?{errors:[dp()]}:(a.push(O(Ab,{task_ids:[o]})),ae(a,t,r))},RA=(e,t,r)=>{const{moduleId:n}=e,a=[],s=it(r,n);if(s==null)return{errors:[Q()]};if(s.currentPumpActivity.type!=="timedHold"&&s.currentPumpActivity.type!=="profile")return{errors:[uT()]};const o=s.currentPumpActivity.taskId;return a.push(O(Ab,{task_ids:[o]})),ae(a,t,r)};var Bu,Sh;function kA(){if(Sh)return Bu;Sh=1;var e=Ty(),t=1,r=4;function n(a){return e(a,t|r)}return Bu=n,Bu}var vA=kA();const PA=xe(vA),Ob=["A1","B1","C1","D1","E1","F1","G1","H1","A2","B2","C2","D2","E2","F2","G2","H2","A3","B3","C3","D3","E3","F3","G3","H3","A4","B4","C4","D4","E4","F4","G4","H4","A5","B5","C5","D5","E5","F5","G5","H5","A6","B6","C6","D6","E6","F6","G6","H6","A7","B7","C7","D7","E7","F7","G7","H7","A8","B8","C8","D8","E8","F8","G8","H8","A9","B9","C9","D9","E9","F9","G9","H9","A10","B10","C10","D10","E10","F10","G10","H10","A11","B11","C11","D11","E11","F11","G11","H11","A12","B12","C12","D12","E12","F12","G12","H12"],Vr="p300SingleId",ba="p300MultiId",ac="p100096Id",sc="sourcePlateId",oc="destPlateId",ic="troughId",CA="A1",NA="tiprack1Id",DA={isAirGap:!0},rs=c.fixture96Plate,Ah=c.fixture12Trough,ns=c.fixtureTiprack10ul,qt=c.fixtureTiprack300ul,yn=c.fixtureTiprack1000ul,as=c.fixtureTiprackAdapter,Rb={OT_PD_DISABLE_MODULE_RESTRICTIONS:!1};function kb(e){return Ob.reduce((t,r)=>({...t,[r]:e?Ra:ue}),{})}function MA(e,t){return Array.from("ABCDEFGH").map(r=>`${r}${e}`).reduce((r,n)=>({...r,[n]:t}),{})}function vb(){const e={[sc]:{id:sc,pythonName:"mock_source_plate",labwareDefURI:c.getLabwareDefURI(rs),def:rs},[oc]:{id:oc,pythonName:"mock_dest_plate",labwareDefURI:c.getLabwareDefURI(rs),def:rs},[ic]:{id:ic,pythonName:"mock_trough",labwareDefURI:c.getLabwareDefURI(Ah),def:Ah},tiprack1Id:{id:"tiprack1Id",pythonName:"mock_tip_rack_1",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack2Id:{id:"tiprack2Id",pythonName:"mock_tip_rack_2",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack3Id:{id:"tiprack3Id",pythonName:"mock_tip_rack_3",labwareDefURI:c.getLabwareDefURI(qt),def:qt},tiprack4AdapterId:{id:"tiprack4AdapterId",pythonName:"mock_adapter_4",labwareDefURI:c.getLabwareDefURI(as),def:as},tiprack5AdapterId:{id:"tiprack5AdapterId",pythonName:"mock_adapter_5",labwareDefURI:c.getLabwareDefURI(as),def:as},tiprack4Id:{id:"tiprack4Id",pythonName:"mock_tip_rack_4",labwareDefURI:c.getLabwareDefURI(yn),def:yn},tiprack5Id:{id:"tiprack5Id",pythonName:"mock_tip_rack_5",labwareDefURI:c.getLabwareDefURI(yn),def:yn}},t={},r={[Hu]:{id:Hu,location:"cutoutA3",pythonName:"trash_bin_1"}},n={p10SingleId:{name:"p10_single",id:"p10SingleId",pythonName:"mock_pipette_p10",tiprackDefURI:[c.getLabwareDefURI(ns)],tiprackLabwareDef:[ns],spec:c.fixtureP10SingleV2Specs},p10MultiId:{name:"p10_multi",id:"p10MultiId",tiprackDefURI:[c.getLabwareDefURI(ns)],tiprackLabwareDef:[ns],spec:c.fixtureP10MultiV2Specs,pythonName:"mock_pipette_p10_multi"},[Vr]:{name:"p300_single",id:Vr,tiprackDefURI:[c.getLabwareDefURI(qt)],tiprackLabwareDef:[qt],spec:c.fixtureP300SingleV2Specs,pythonName:"mock_pipette"},[ba]:{name:"p300_multi",id:ba,tiprackDefURI:[c.getLabwareDefURI(qt)],tiprackLabwareDef:[qt],spec:c.fixtureP300MultiV2Specs,pythonName:"mock_pipette_p300_multi"},[ac]:{name:"p1000_96",id:ac,tiprackDefURI:[c.getLabwareDefURI(yn)],tiprackLabwareDef:[yn],spec:c.fixtureP100096V2Specs,pythonName:"mock_pipette_p1000_96"}};return{labwareEntities:e,moduleEntities:t,pipetteEntities:n,trashBinEntities:r,wasteChuteEntities:{},stagingAreaEntities:{},gripperEntities:{},liquidEntities:{},runtimeParameters:{},config:Rb}}const Gr=e=>{const{invariantContext:t,labwareLocations:r,moduleLocations:n,pipetteLocations:a,tiprackSetting:s}=e,o=Bc({invariantContext:t,labwareLocations:r,moduleLocations:n||{},pipetteLocations:a});return o.tipState.tipracks=rr(s,i=>kb(i)),o},jn=()=>({pipetteLocations:{[Vr]:{mount:"left",tiprackId:"tiprack1Id"},[ba]:{mount:"right",tiprackId:"tiprack1Id"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","1"]},tiprack2Id:{stack:["tiprack2Id","5"]},tiprack4AdapterId:{stack:["tiprack4AdapterId","7"]},tiprack5AdapterId:{stack:["tiprack5AdapterId","8"]},tiprack4Id:{stack:["tiprack4Id","tiprack4AdapterId","7"]},tiprack5Id:{stack:["tiprack5Id","tiprack5AdapterId","8"]},sourcePlateId:{stack:["sourcePlateId","2"]},destPlateId:{stack:["destPlateId","3"]}},moduleLocations:{}}),Pb=()=>({pipetteLocations:{[Vr]:{mount:"left"},[ba]:{mount:"right"}},labwareLocations:{tiprack1Id:{stack:["tiprack1Id","B1"]},tiprack2Id:{stack:["tiprack2Id","A2"]},sourcePlateId:{stack:["sourcePlateId","offDeck"]},destPlateId:{stack:["destPlateId","C2"]}},moduleLocations:{}}),Cb=e=>Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),FA=e=>Gr({...Pb(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}}),UA=e=>({robotState:Cb(e),warnings:[]}),qA=e=>{const t=Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0,tiprack2Id:!0}});return t.tipState.pipettes[Vr]={hasTip:!0,tiprackURI:"tiprack1Id"},t},$A=e=>{const t=Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!0}});return t.tipState.pipettes[Vr]={hasTip:!0,tiprackURI:"tiprack1Id"},t.tipState.tipracks.tiprack1Id.A1=ue,t},VA=e=>Gr({...jn(),invariantContext:e,tiprackSetting:{tiprack1Id:!1,tiprack2Id:!1}}),BA=({temperatureModuleId:e,thermocyclerId:t})=>{const r=vb();r.moduleEntities={[e]:{id:e,type:c.TEMPERATURE_MODULE_TYPE,model:"foo",pythonName:"mock_temperature_module_1"},[t]:{id:t,type:c.THERMOCYCLER_MODULE_TYPE,model:"foo",pythonName:"mock_thermocycler"}};const n=Gr({...jn(),invariantContext:r,tiprackSetting:{tiprack1Id:!0}});return n.modules={[e]:{slot:"3",moduleState:{type:c.TEMPERATURE_MODULE_TYPE,status:Oa,targetTemperature:null}},[t]:{slot:"span7_8_10_11",moduleState:{type:c.THERMOCYCLER_MODULE_TYPE,currentBlockActivity:{type:"blockDeactivated"},lidTargetTemp:null,lidOpen:null,numProfilesStarted:0}}},{invariantContext:r,robotState:n}},xA=(e,t,r,n)=>{const a=PA(e);return a.modules[t].moduleState={type:c.TEMPERATURE_MODULE_TYPE,targetTemperature:n,status:r},a};exports.ABSORBANCE_READER_INITIAL_STATE=$h;exports.AIR=je;exports.AIR_GAP_META=DA;exports.AIR_GAP_OFFSET_FROM_TOP=xu;exports.AUTOMATIC=cc;exports.BOTTOM_UP_LABWARE_POOL_KEYS=Jt;exports.BOTTOM_UP_STORED_LABWARE_URI_KEYS=gT;exports.CLEAN=Ra;exports.COLUMN_4_SLOTS=ve;exports.CUSTOM_LABWARE_DICT_NAME=As;exports.DEFAULT_BLOWOUT_WELL=CA;exports.DEFAULT_CONFIG=Rb;exports.DEFAULT_PIPETTE=Vr;exports.DEST_LABWARE=oc;exports.DEST_WELL_BLOWOUT_DESTINATION=Mn;exports.DIRTY=Qt;exports.EMPTY=ue;exports.FAKE_HOPPER_LOCATION_MAP=Wh;exports.FIXED_TRASH_ID=Hu;exports.FLEX_STACKER_MODULE_INITIAL_STATE=Bh;exports.FLEX_TRASH_DEF_URI=bT;exports.GRIPPER_LOCATION=zh;exports.HEATERSHAKER_MODULE_INITIAL_STATE=qh;exports.HOPPER_FAKE_LOCATIONS=Gh;exports.HOPPER_STACKER_LOCATION=Ze;exports.INDENT=Ma;exports.MAGNETIC_BLOCK_INITIAL_STATE=Vh;exports.MAGNETIC_MODULE_INITIAL_STATE=Mh;exports.MANUAL=St;exports.MIXED_WELL_COLOR=Vy;exports.MODULES_WITH_COLLISION_ISSUES=Dh;exports.MODULE_INITIAL_STATE_BY_TYPE=Hh;exports.MULTI_PIPETTE=ba;exports.OFF_DECK=Ln;exports.OT2_TC_SLOTS=TT;exports.OT_2_TRASH_DEF_URI=yT;exports.PAPI_VERSION=xy;exports.PD_APPLICATION_VERSION=MS;exports.PIPETTE_96=ac;exports.PROTOCOL_CONTEXT_NAME=be;exports.SLOT_LOCATIONS_TO_FAKE_HOPPER_LOCATIONS=IT;exports.SOURCE_LABWARE=sc;exports.SOURCE_WELL_BLOWOUT_DESTINATION=zr;exports.STAGING_AREA_SLOTS=jh;exports.TEMPERATURE_APPROACHING_TARGET=uc;exports.TEMPERATURE_AT_TARGET=lc;exports.TEMPERATURE_DEACTIVATED=Oa;exports.TEMPERATURE_MODULE_INITIAL_STATE=Fh;exports.THERMOCYCLER_MODULE_INITIAL_STATE=Uh;exports.TIPRACK_1=NA;exports.TOUCHED_PIPETTABLE_LABWARE=rc;exports.TROUGH_LABWARE=ic;exports.VACUUM_AT_TARGET=vT;exports.VACUUM_DEACTIVATED=kT;exports.VACUUM_DOCK_ADDRESSABLE_AREA=Yh;exports.VACUUM_DOCK_DISPLAY_LOCATION=Xh;exports.VACUUM_DOCK_LOCATION=pc;exports.VACUUM_MODE_POWER=zu;exports.VACUUM_MODE_PRESSURE=ju;exports.VACUUM_MODULE_INITIAL_STATE=xh;exports.VACUUM_PROGRAM_PROFILE=wT;exports.VACUUM_PROGRAM_STATE=ET;exports.VACUUM_SPACER_LOAD_NAMES=Kh;exports.VACUUM_STATE_PUMP_OFF=ST;exports.VACUUM_STATE_PUMP_ON=AT;exports.VACUUM_STATE_VENT=LT;exports.VACUUM_VENT_CLOSED=ka;exports.VACUUM_VENT_OPEN=dc;exports.VACUUM_VENT_SET_CLOSED=RT;exports.VACUUM_VENT_SET_OPEN=OT;exports.ZERO_OFFSET=wt;exports._getNextTip=ib;exports._wellContentsForLabware=AS;exports.absorbanceReaderCloseInitialize=lb;exports.absorbanceReaderCloseLid=ws;exports.absorbanceReaderCloseRead=ub;exports.absorbanceReaderCollision=Ua;exports.absorbanceReaderInitialize=g_;exports.absorbanceReaderOpenLid=I_;exports.absorbanceReaderRead=E_;exports.absorbanceReaderStateGetter=zn;exports.airGapLocationHelper=wI;exports.aspirate=nI;exports.assignContainsAmongSiblings=sp;exports.blowOutInWell=Rc;exports.captureImage=w_;exports.column4StagingSlotIdFromFlexStackerShuttleAddressableArea=ny;exports.commandCreatorsTimeline=aS;exports.comment=S_;exports.consolidate=_b;exports.constructInvariantContextFromAnalysis=cS;exports.createEmptyLiquidState=Z_;exports.createStagingAreaForInvariantContext=Ku;exports.createTipLiquidState=Q_;exports.curryCommandCreator=O;exports.curryWithoutPython=R;exports.deactivateTemperature=L_;exports.deckSlotKeyForFlexStackerShuttleAddressableArea=LI;exports.delay=me;exports.delayLocationHelper=SI;exports.disengageMagnet=O_;exports.dispense=kc;exports.dispenseLocationHelper=II;exports.distribute=yb;exports.dropTip=Hr;exports.dropTipInPlace=Ss;exports.dropTipInTrash=fb;exports.dropTipInWasteChute=mb;exports.engageMagnet=R_;exports.enrichRobotStateForStackGraphTraversals=cw;exports.flexStackerEmpty=k_;exports.flexStackerFillItems=v_;exports.flexStackerRetrieve=P_;exports.flexStackerStateGetter=mt;exports.flexStackerStore=C_;exports.formatChangeTipArg=Us;exports.formatPyDict=Fr;exports.formatPyList=Ls;exports.formatPyStr=N;exports.formatPyTuple=Cc;exports.formatPyValue=st;exports.formatPyWellLocation=Bt;exports.getAddressableAreaFromModule=ap;exports.getAddressableAreaNameFromLabwareLocation=aw;exports.getAllLargestStacks=Ay;exports.getAllProvidedAddressableAreasFromDeckConfig=Ly;exports.getAllWellsForLabware=$y;exports.getChunkForIndentingLists=Os;exports.getCommandCreatorFromStepArgs=oA;exports.getCustomLiquidClassProperties=Ms;exports.getCutoutFromSlot=tb;exports.getCutoutIdByAddressableArea=G_;exports.getDefaultPrimaryNozzle=cs;exports.getDefineLiquids=Yy;exports.getDispenseAirGapLocation=J_;exports.getFlexStackerCutoutBaseDeckSlotId=Hc;exports.getFlexStackerShuttleAddressableArea=Rs;exports.getFullStackFromLabwares=ks;exports.getFullStackFromNodeTopDownRecursive=Ds;exports.getHasNoWellsFromCCArgs=oS;exports.getInitialRobotStateStandard=Cb;exports.getInitialRobotStateWithOffDeckLabwareStandard=FA;exports.getIsHeaterShakerEastWestMultiChannelPipette=xn;exports.getIsHeaterShakerEastWestWithLatchOpen=Bn;exports.getIsHeaterShakerNorthSouthOfNonTiprackWithMultiChannelPipette=xa;exports.getIsInPipettableLocation=ly;exports.getIsLabwareCompatibleWithStack=sy;exports.getIsRetractSafeForAirGap=Ur;exports.getIsSafePickupWithinTiprack=up;exports.getIsSlotAHopper=oy;exports.getIsSlotAVacuumDock=ma;exports.getIsSpaceInHopper=Wc;exports.getIsTallLabwareEastWestOfHeaterShaker=Uy;exports.getIsVacuumSpacer=j_;exports.getLabwareHasLid=iy;exports.getLabwareHasLiquid=ty;exports.getLabwareIdOnShuttle=jc;exports.getLabwareSlot=qn;exports.getLargestStackContainingLabware=Sy;exports.getLargestStackInSlot=fa;exports.getLiquidClassName=ja;exports.getLiquidIdsOnLabware=RS;exports.getLiquidIdsOnLabwareStack=OS;exports.getLoadAdapters=zy;exports.getLoadLabware=Gy;exports.getLoadLidStacks=jy;exports.getLoadLiquidClasses=Xy;exports.getLoadLiquids=Ky;exports.getLoadModules=Hy;exports.getLoadPipettes=Wy;exports.getLoadTrashBins=Zy;exports.getLoadWasteChute=Qy;exports.getLocationTotalVolume=mr;exports.getModuleHasLiveTask=$n;exports.getModuleIdFromRobotStateStack=Fa;exports.getModuleLocationSlot=AI;exports.getModuleState=Ot;exports.getNearestParentInStack=ry;exports.getNextRobotStateAndWarnings=ip;exports.getNextRobotStateAndWarningsSingleCommand=Fy;exports.getNextTiprack=Wa;exports.getNodeParentModuleId=rw;exports.getNozzleConfig=lp;exports.getPipetteCenteringFullOffset=ab;exports.getPipetteIdFromCCArgs=sS;exports.getPipetteMovementSafetyStatus=ft;exports.getPipetteWithTipMaxVol=qs;exports.getProvidedAddressableAreasExposed=sw;exports.getPythonAssignTipRacksString=Fs;exports.getResultingTimelineFrameFromRunCommands=dS;exports.getRobotInitialStateNoTipsRemain=VA;exports.getRobotStateAndWarningsStandard=UA;exports.getRobotStatePickedUpTipStandard=$A;exports.getRobotStateWithTipStandard=qA;exports.getRunTimeParameters=jS;exports.getSetStoredLabware=eb;exports.getSlotInLocationStack=W;exports.getStackForLabwareLocation=Yu;exports.getStackedOnNodeFromPdStack=Oy;exports.getStateAndContextTempTCModules=BA;exports.getTargetTipsFromWellSets=Ga;exports.getThermocyclerProfileRepetitionsForPython=sb;exports.getTipColumn=MA;exports.getTipColumnIndex=nc;exports.getTipColumnName=cp;exports.getTipRowName=gn;exports.getTiprackHasTips=ey;exports.getTiprackTipstate=kb;exports.getTopLocationInStack=xc;exports.getTopmostLabwareOnModuleFromStackRobotState=RI;exports.getTransferPlanAndReferenceVolumes=zc;exports.getTrashBinAddressableAreaName=$c;exports.getTrashLocationFromAddressableAreaName=Y_;exports.getTrashOrLabware=Fn;exports.getVolumesPerLiquid=LS;exports.getWasteChuteAddressableAreaNamePip=W_;exports.getWellsForTips=Vc;exports.heaterShaker=bb;exports.indentPyLines=G;exports.labwareMatchesLabwareInHopper=Gc;exports.makeContext=vb;exports.makeInitialRobotState=Bc;exports.makeState=Gr;exports.makeStateArgsLabwareOffDeck=Pb;exports.makeStateArgsStandard=jn;exports.mergeLiquid=hr;exports.mix=hb;exports.mixBlowoutLocationHelper=X_;exports.modulePipetteCollision=Vn;exports.moveHelper=EI;exports.moveLabware=N_;exports.moveToAddressableArea=Fe;exports.moveToAddressableAreaForDropTip=vc;exports.pipetteAdjacentHeaterShakerWhileShaking=Hn;exports.pipetteIntoHeaterShakerLatchOpen=Ha;exports.pipetteIntoHeaterShakerWhileShaking=za;exports.pythonCustomLabwareDict=HS;exports.pythonDefRun=xS;exports.pythonImports=FS;exports.pythonMetadata=US;exports.pythonRequirements=qS;exports.reduceCommandCreators=ae;exports.repeatArray=K_;exports.replaceTip=Ya;exports.resolveBooleanRuntimeValue=CI;exports.resolveDeckSlotKeyForLabwareStackInSlot=ay;exports.resolveNumericRuntimeValue=vI;exports.resolveStringRuntimeValue=PI;exports.robotWithStatusAndTemp=xA;exports.setTemperature=Pc;exports.sortLabwareBySlot=ob;exports.splitLiquid=er;exports.stepCommands=Jy;exports.swatchColors=By;exports.thermocyclerPipetteCollision=Va;exports.thermocyclerProfileStep=Tb;exports.thermocyclerStateGetter=$s;exports.thermocyclerStateStep=gb;exports.tiprackWellNamesFlat=Ob;exports.touchTip=Et;exports.transfer=Ib;exports.unrollThermocyclerProfile=pp;exports.uuid=D;exports.vacuumCloseVent=Da;exports.vacuumCloseVentSetPumpPower=Eb;exports.vacuumCloseVentSetPumpPressure=wb;exports.vacuumCloseVentStartProfile=Sb;exports.vacuumModuleStateGetter=it;exports.vacuumOpenVent=M_;exports.vacuumSetPumpPower=Nc;exports.vacuumSetPumpPressure=Dc;exports.vacuumStartRunProfile=Mc;exports.vacuumStopPump=U_;exports.waitForModuleTask=Lb;exports.waitForTemperature=Fc;exports.wellFillFromWellContents=vS;
|