{"version":3,"file":"src_app_home_home_module_ts.js","mappings":";;;;;;;;;;;;;AAAA,iEAAe,iJAAiJ,QAAQ,yOAAyO,+oDAA+oD,yOAAyO,mBAAmB,6KAA6K;;;;;;;;;;;;;;ACAz8E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC0B;;;;;;;;;;;;;;;;ACnC3B;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,WAAW,gBAAgB,sCAAsC,kBAAkB;AACnF,0BAA0B;AAC1B;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sCAAsC,gCAAgC;AACtE;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA;AACA,sCAAsC,mCAAmC;AACzE;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;;;;;;;;;;;;;;;;;ACtDxB;AACA;AACwD;AAChB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uEAAuB;AACtC;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAa;AACzB;AACA;AACA,oDAAoD,qFAAqC;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,iFAAiC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uEAAuB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;;;;;;;;;;;;;;;;;;;AClD7B;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,WAAW,gBAAgB,sCAAsC,kBAAkB;AACnF,0BAA0B;AAC1B;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,SAAI,IAAI,SAAI;AAC5B,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACmD;AACd;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa,yBAAyB;AAC1E;AACA;AACA,oCAAoC,aAAa,0BAA0B;AAC3E;AACA;AACA,oCAAoC,aAAa,4BAA4B;AAC7E;AACA;AACA,CAAC;AACqB;AACtB,+BAA+B,iCAAiC;AAChE;AACA;AACA,uCAAuC,wCAAwC,sBAAsB,+BAA+B;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA,iDAAiD,+DAA+D;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8CAAS;AACxC;AACA;AACA;AACA,iCAAiC,sDAAgB;AACjD,2BAA2B,8CAAS;AACpC;AACA;AACA,iCAAiC,sDAAgB;AACjD,2BAA2B,iDAAY;AACvC;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC4B;;;;;;;;;;;;;;;;;;;;;;AC7G7B;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACiD;AACZ;AAC4B;AACH;AACU;AAC5B;AACc;AAC1D;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,QAAQ,kDAAc;AACtB,sBAAsB,oDAAY;AAClC;AACA;AACA,kFAAkF,cAAc;AAChG;AACA,oDAAoD,0DAAiB;AACrE;AACA;AACA;AACA;AACA,2CAA2C,8DAAqB;AAChE,QAAQ,4CAAQ,iBAAiB,uDAAc;AAC/C,wBAAwB,oDAAc,iDAAiD,uDAAc;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,qEAA4B;AACrF;AACA,iEAAiE,qEAA4B;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,eAAe;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF;AACtF;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,uEAAoB;AAC1E;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc,sCAAsC,0DAAiB;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,iBAAiB,qEAA4B;AAC7C,2BAA2B,mEAAkB;AAC7C,iBAAiB,2EAAkC;AACnD,2BAA2B,iFAAyB;AACpD,iBAAiB,sEAA6B;AAC9C,2BAA2B,uEAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAAiB;AACzC;AACA,4BAA4B,oDAAc;AAC1C;AACA;AACA,8EAA8E,OAAO,uDAAc,MAAM;AACzG;AACA;AACA,uCAAuC,qEAA4B;AACnE,uCAAuC,2EAAkC;AACzE,wCAAwC,oDAAc,2BAA2B,0DAAiB;AAClG;AACA;AACA,wCAAwC,oDAAc,4BAA4B,0DAAiB;AACnG;AACA;AACA;AACA;AACA,oCAAoC,oDAAc,2BAA2B,0DAAiB,gFAAgF,uDAAc;AAC5L;AACA;AACA;AACA,gCAAgC,oDAAc,2BAA2B,0DAAiB;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oDAAc;AAClD;AACA;AACA,oCAAoC,0DAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;;;;;;;;;;;;;;;;;;;AC7YA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACwD;AACX;AACR;AACE;AACvC;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAc;AACtB,QAAQ,kDAAc;AACtB,QAAQ,kDAAc;AACtB;AACA;AACA;AACA;AACA,qCAAqC,iEAAiB;AACtD,sDAAsD;AACtD,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA,wCAAwC,0DAAoB;AAC5D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,iBAAiB,eAAe;AAChC;AACA;AACA,wBAAwB,oDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA,0BAA0B,2CAAO;AACjC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,yCAAyC,iEAAsB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,eAAe;AAChC;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,iEAAsB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,wBAAwB;AAC5E;AACA;AACA,yBAAyB,iEAAsB;AAC/C;AACA;AACA,yBAAyB,iEAAsB;AAC/C,yBAAyB,iEAAsB;AAC/C;AACA;AACA,iDAAiD,iEAAsB;AACvE;AACA;AACA;AACA;AACA;AACA,yBAAyB,2DAAgB;AACzC;AACA;AACA,yBAAyB,4DAAiB;AAC1C,wCAAwC,0DAAoB;AAC5D;AACA;AACA;AACA;AACA;AACA,wCAAwC,sDAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,qDAAqD;AAChG;AACA;AACA;AACA,gCAAgC,oDAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,oDAAoD,iCAAiC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iEAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iEAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uEAA4B;AAC9C;AACA;AACA;AACA;AACA;AACA,kBAAkB,uEAA4B;AAC9C;AACA;AACA;AACA,CAAC;AACwB;;;;;;;;;;;;;;;;;;;;ACzazB;AACA;AACkD;AACF;AACI;AACb;AACM;AAC7C,+BAA+B,qCAAqC;AACpE;AACA;AACA;AACA;AACA,QAAQ,kDAAc;AACtB;AACA;AACA;AACA;AACA,8BAA8B,iDAAa;AAC3C;AACA;AACA;AACA;AACA,QAAQ,kDAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qCAAqC;AAC7D;AACA,eAAe,cAAc,cAAc,oCAAoC;AAC/E;AACA;AACA,QAAQ,kDAAc;AACtB;AACA;AACA;AACA,mBAAmB,qCAAqC;AACxD;AACA,iBAAiB,eAAe,gBAAgB,oCAAoC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAc;AAC3C,eAAe,gEAAoB,4BAA4B,yDAAmB,uBAAuB,6DAAe;AACxH;AACA;AACA,CAAC;AAC+B;AAChC;AACA;AACA;;;;;;;;;;;;;;;ACtEA;AACA;AACA;AACO;AACP;AACA,2EAA2E,yCAAyC;AACpH;AACA,0EAA0E,yCAAyC;AACnH;AACA,0EAA0E,yCAAyC;AACnH;AACA,iFAAiF,+CAA+C;AAChI;AACA,iFAAiF,+CAA+C;AAChI;AACA,oEAAoE,mCAAmC;AACvG;AACA,qEAAqE,oCAAoC;AACzG;AACA,CAAC,kCAAkC;;;;;;;;;;;;;;;ACnBnC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;;;;;;;;;;;;;;;;ACvB7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;;;;;;;;;;;;;;;;;;;;ACtBzC;AACA;AAC6C;AACR;AACS;AACP;AACiB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4DAAmB;AACjD;AACA,6BAA6B,kCAAkC;AAC/D;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yDAAmB;AACxC;AACA;AACA,uBAAuB,uEAAuB;AAC9C;AACA,gDAAgD,wBAAwB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iEAAsB;AAC3C;AACA;AACA,qBAAqB,iEAAsB;AAC3C;AACA;AACA,qBAAqB,iEAAsB;AAC3C;AACA;AACA,qBAAqB,2DAAgB;AACrC;AACA;AACA,qBAAqB,4DAAiB;AACtC;AACA;AACA;AACA;AACA,+BAA+B,0DAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kCAAkC;AAChE;AACA,eAAe,YAAY;AAC3B,iBAAiB,QAAQ;AACzB;AACA;AACA,eAAe,uEAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;;;;;;;;;;;;;;;ACxG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iCAAiC;AACxE;AACA;AACA,CAAC;AACqB;;;;;;;;;;;;;;;;;;;;ACdtB;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACoD;AACD;AACd;AACS;AACY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,cAAc;AACrF;AACA,6BAA6B,6DAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC,wBAAwB,kDAAc;AACtC,wBAAwB,4CAAQ,iBAAiB,uDAAc;AAC/D;AACA,wCAAwC,oDAAc;AACtD,+CAA+C,8DAAqB;AACpE;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,+CAA+C,8DAAqB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA,4CAA4C,oDAAc;AAC1D;AACA,6CAA6C,8CAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA,4CAA4C,0DAAoB;AAChE;AACA;AACA;AACA,4CAA4C,oDAAc;AAC1D;AACA,6CAA6C,8CAAS;AACtD;AACA;AACA;AACA;AACA;AACA,gDAAgD,oDAAc,8CAA8C,qDAAa;AACzH;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,oDAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oDAAc;AAC1D;AACA;AACA,+CAA+C,iDAAY;AAC3D;AACA,gDAAgD,oDAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oDAAc;AAC1D;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mDAAW;AACjD,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA,iDAAiD,sDAAgB;AACjE;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AAC+B;;;;;;;;;;;;;;;;;;AChQhC;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACqC;AACS;AACY;AAC1D;AACA;AACA;AACA;AACA,uEAAuE,cAAc;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC,wBAAwB,kDAAc;AACtC,wBAAwB,4CAAQ,iBAAiB,uDAAc;AAC/D;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,4DAAmB;AAC1E;AACA;AACA,yEAAyE,uBAAuB;AAChG;AACA;AACA;AACA;AACA,iEAAiE,oDAAc,sCAAsC,qDAAa;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAAoB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mDAAW;AACjD,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoC;;;;;;;;;;;;;;;AC3IrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;;;;;;;;;;;;;;;;;;;;;;;;;ACtB7B;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACqC;AACE;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACc;AACf;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,+BAA+B,oDAAc;AAC7C;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,+BAA+B,oDAAc;AAC7C;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACO;AACP;AACA,iCAAiC,0DAAoB;AACrD;AACA;AACA,eAAe,yDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA,CAAC;AAC8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,uDAAiB;AACtC,qBAAqB,oDAAc;AACnC,kCAAkC,8CAAQ;AAC1C;AACA,qBAAqB,sDAAgB;AACrC,iCAAiC,8CAAQ;AACzC;AACA,qBAAqB,0DAAoB;AACzC,iCAAiC,8CAAQ;AACzC;AACA;AACA;AACA,gCAAgC,8CAAQ;AACxC;AACA;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACrNA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC,iEAAiE,wBAAwB;AACzH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACqC;AACS;AACD;AAC7C;AACA;AACA;AACA;AACA,uEAAuE,cAAc;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC,wBAAwB,kDAAc;AACtC,wBAAwB,4CAAQ,iBAAiB,uDAAc;AAC/D;AACA;AACA;AACA,wCAAwC,oDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,8DAAqB;AAC5E;AACA;AACA;AACA;AACA,qDAAqD,0DAAoB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,oDAAc,6CAA6C,qDAAa;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,oDAAc;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,4BAA4B,oDAAc,4CAA4C,qDAAa;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1H9B;AACA;AACA;AACA;AACO;AAC4C;AACwB;AAC3B;AACc;AACjB;AACR;AAC4B;AAC1B;AACa;;;;;;;;;;;;;;;;;;;;ACbX;AACc;AAChB;AAEvC,MAAM,MAAM,GAAW;IACrB;QACE,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,gDAAQ;KACpB;CACF,CAAC;IAMW,qBAAqB,SAArB,qBAAqB;CAAG;AAAxB,qBAAqB;IAJjC,uDAAQ,CAAC;QACR,OAAO,EAAE,CAAC,kEAAqB,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC,yDAAY,CAAC;KACxB,CAAC;GACW,qBAAqB,CAAG;AAAH;;;;;;;;;;;;;;;;;;;;;;;;ACfmC;AACkB;AACzB;AACvB;AACQ;AACN;AACI;IAchC,cAAc,SAAd,cAAc;CAAG;AAAjB,cAAc;IAb1B,uDAAQ,CAAC;QACR,OAAO,EAAE;YACP,yDAAY;YACZ,uDAAW;YACX,uEAAqB;YACrB,2EAAgB;YAChB,6FAAsB;SACvB;QACD,YAAY,EAAE,CAAC,gDAAQ,CAAC;QACxB,SAAS,EAAE,EAEV;KACF,CAAC;GACW,cAAc,CAAG;AAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpBwD;AACX;AACK;AAC3B;AACT;AACE;AAEuB;AAED;AACI;AACV;AAC3D,MAAM,IAAI,GAAG,4EAAkB,CAAC;IAMnB,QAAQ,SAAR,QAAQ;IAUnB,YACU,MAAc,EACd,mBAAwC,EACxC,YAA6B,EAC9B,SAA0B;QAHzB,WAAM,GAAN,MAAM,CAAQ;QACd,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,iBAAY,GAAZ,YAAY,CAAiB;QAC9B,cAAS,GAAT,SAAS,CAAiB;QAVnC,mBAAc,GAA4B,IAAI,iDAAe,CAAS,EAAE,CAAC,CAAC;QAC1E,aAAQ,GAAuB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QAElE,UAAK,GAAG,2EAAiB,CAAC;QAUxB,IAAI,CAAC,aAAa,GAAG,IAAI,iEAA4B,EAAE;aACpD,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC;aACzB,gBAAgB,CAAC,iEAA4B,CAAC;aAC9C,KAAK,EAAE,CAAC;QAEX,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAS,EAAE,EAAE;YAC1C,MAAM,YAAY,GAAG,GAAG,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC;gBAC3C,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC7D;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;YACnE,IAAI,CAAC,EAAE;gBACL,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;aAC5C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEK,gBAAgB;;YACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBAC3C,SAAS,EAAE,gFAAgB;aAC5B,CAAC,CAAC;YACH,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;KAAA;IAEK,YAAY;;YAChB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBACxC,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;gBAC7C,SAAS,EAAE,2FAAkB;gBAC7B,cAAc,EAAE;oBACd,QAAQ,EAAE,qFAAgB;iBAC3B;aACF,CAAC,CAAC;YAEH,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;KAAA;IAED,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,aAAa,EAAE;YACtB,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;SAClC;IACH,CAAC;CACF;;YArFQ,oDAAM;YAMN,+EAAmB;YAHnB,4DAAe;YAAE,4DAAe;;AAW5B,QAAQ;IALpB,yDAAS,CAAC;QACT,QAAQ,EAAE,UAAU;QACpB,0MAA6B;;KAE9B,CAAC;GACW,QAAQ,CAuEpB;AAvEoB","sources":["./src/app/home/home.page.html","./node_modules/@aspnet/signalr/dist/esm/AbortController.js","./node_modules/@aspnet/signalr/dist/esm/Errors.js","./node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js","./node_modules/@aspnet/signalr/dist/esm/HttpClient.js","./node_modules/@aspnet/signalr/dist/esm/HttpConnection.js","./node_modules/@aspnet/signalr/dist/esm/HubConnection.js","./node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js","./node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js","./node_modules/@aspnet/signalr/dist/esm/ILogger.js","./node_modules/@aspnet/signalr/dist/esm/ITransport.js","./node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js","./node_modules/@aspnet/signalr/dist/esm/Loggers.js","./node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js","./node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js","./node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js","./node_modules/@aspnet/signalr/dist/esm/Utils.js","./node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js","./node_modules/@aspnet/signalr/dist/esm/index.js","./src/app/home/home-routing.module.ts","./src/app/home/home.module.ts","./src/app/home/home.page.ts"],"sourcesContent":["export default \"\\n\\n \\n \\n \\n {{ title }}\\n \\n \\n \\n \\n \\n \\n \\n \\n Search for a Test\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n User Guide\\n \\n \\n Pathology website\\n \\n \\n Paediatric Draw Card\\n \\n \\n Draw Card\\n \\n \\n \\n \\n \\n \\n \\n Announcements\\n \\n \\n \\n {{ message$ | async }}\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n\";","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n// Not exported from index.\r\n/** @private */\r\nvar AbortController = /** @class */ (function () {\r\n function AbortController() {\r\n this.isAborted = false;\r\n }\r\n AbortController.prototype.abort = function () {\r\n if (!this.isAborted) {\r\n this.isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AbortController.prototype, \"signal\", {\r\n get: function () {\r\n return this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AbortController.prototype, \"aborted\", {\r\n get: function () {\r\n return this.isAborted;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AbortController;\r\n}());\r\nexport { AbortController };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\n/** Error thrown when an HTTP request fails. */\r\nvar HttpError = /** @class */ (function (_super) {\r\n __extends(HttpError, _super);\r\n /** Constructs a new instance of {@link @aspnet/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n function HttpError(errorMessage, statusCode) {\r\n var _newTarget = this.constructor;\r\n var _this = this;\r\n var trueProto = _newTarget.prototype;\r\n _this = _super.call(this, errorMessage) || this;\r\n _this.statusCode = statusCode;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n _this.__proto__ = trueProto;\r\n return _this;\r\n }\r\n return HttpError;\r\n}(Error));\r\nexport { HttpError };\r\n/** Error thrown when a timeout elapses. */\r\nvar TimeoutError = /** @class */ (function (_super) {\r\n __extends(TimeoutError, _super);\r\n /** Constructs a new instance of {@link @aspnet/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n function TimeoutError(errorMessage) {\r\n var _newTarget = this.constructor;\r\n if (errorMessage === void 0) { errorMessage = \"A timeout occurred.\"; }\r\n var _this = this;\r\n var trueProto = _newTarget.prototype;\r\n _this = _super.call(this, errorMessage) || this;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n _this.__proto__ = trueProto;\r\n return _this;\r\n }\r\n return TimeoutError;\r\n}(Error));\r\nexport { TimeoutError };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n/** @private */\r\nvar HandshakeProtocol = /** @class */ (function () {\r\n function HandshakeProtocol() {\r\n }\r\n // Handshake request is always JSON\r\n HandshakeProtocol.prototype.writeHandshakeRequest = function (handshakeRequest) {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n };\r\n HandshakeProtocol.prototype.parseHandshakeResponse = function (data) {\r\n var responseMessage;\r\n var messageData;\r\n var remainingData;\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n var binaryData = new Uint8Array(data);\r\n var separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n var responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n }\r\n else {\r\n var textData = data;\r\n var separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n var responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n // At this point we should have just the single handshake message\r\n var messages = TextMessageFormat.parse(messageData);\r\n responseMessage = JSON.parse(messages[0]);\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n };\r\n return HandshakeProtocol;\r\n}());\r\nexport { HandshakeProtocol };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { LogLevel } from \"./ILogger\";\r\n/** Represents an HTTP response. */\r\nvar HttpResponse = /** @class */ (function () {\r\n function HttpResponse(statusCode, statusText, content) {\r\n this.statusCode = statusCode;\r\n this.statusText = statusText;\r\n this.content = content;\r\n }\r\n return HttpResponse;\r\n}());\r\nexport { HttpResponse };\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nvar HttpClient = /** @class */ (function () {\r\n function HttpClient() {\r\n }\r\n HttpClient.prototype.get = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"GET\", url: url }));\r\n };\r\n HttpClient.prototype.post = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"POST\", url: url }));\r\n };\r\n HttpClient.prototype.delete = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"DELETE\", url: url }));\r\n };\r\n return HttpClient;\r\n}());\r\nexport { HttpClient };\r\n/** Default implementation of {@link @aspnet/signalr.HttpClient}. */\r\nvar DefaultHttpClient = /** @class */ (function (_super) {\r\n __extends(DefaultHttpClient, _super);\r\n /** Creates a new instance of the {@link @aspnet/signalr.DefaultHttpClient}, using the provided {@link @aspnet/signalr.ILogger} to log messages. */\r\n function DefaultHttpClient(logger) {\r\n var _this = _super.call(this) || this;\r\n _this.logger = logger;\r\n return _this;\r\n }\r\n /** @inheritDoc */\r\n DefaultHttpClient.prototype.send = function (request) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(request.method, request.url, true);\r\n xhr.withCredentials = true;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n if (request.headers) {\r\n Object.keys(request.headers)\r\n .forEach(function (header) { return xhr.setRequestHeader(header, request.headers[header]); });\r\n }\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = function () {\r\n xhr.abort();\r\n };\r\n }\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n xhr.onload = function () {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n }\r\n else {\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n }\r\n };\r\n xhr.onerror = function () {\r\n _this.logger.log(LogLevel.Warning, \"Error from HTTP request. \" + xhr.status + \": \" + xhr.statusText);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n xhr.ontimeout = function () {\r\n _this.logger.log(LogLevel.Warning, \"Timeout from HTTP request.\");\r\n reject(new TimeoutError());\r\n };\r\n xhr.send(request.content || \"\");\r\n });\r\n };\r\n return DefaultHttpClient;\r\n}(HttpClient));\r\nexport { DefaultHttpClient };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { DefaultHttpClient } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\nvar MAX_REDIRECTS = 100;\r\n/** @private */\r\nvar HttpConnection = /** @class */ (function () {\r\n function HttpConnection(url, options) {\r\n if (options === void 0) { options = {}; }\r\n this.features = {};\r\n Arg.isRequired(url, \"url\");\r\n this.logger = createLogger(options.logger);\r\n this.baseUrl = this.resolveUrl(url);\r\n options = options || {};\r\n options.accessTokenFactory = options.accessTokenFactory || (function () { return null; });\r\n options.logMessageContent = options.logMessageContent || false;\r\n this.httpClient = options.httpClient || new DefaultHttpClient(this.logger);\r\n this.connectionState = 2 /* Disconnected */;\r\n this.options = options;\r\n }\r\n HttpConnection.prototype.start = function (transferFormat) {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.logger.log(LogLevel.Debug, \"Starting connection with transfer format '\" + TransferFormat[transferFormat] + \"'.\");\r\n if (this.connectionState !== 2 /* Disconnected */) {\r\n return Promise.reject(new Error(\"Cannot start a connection that is not in the 'Disconnected' state.\"));\r\n }\r\n this.connectionState = 0 /* Connecting */;\r\n this.startPromise = this.startInternal(transferFormat);\r\n return this.startPromise;\r\n };\r\n HttpConnection.prototype.send = function (data) {\r\n if (this.connectionState !== 1 /* Connected */) {\r\n throw new Error(\"Cannot send data if the connection is not in the 'Connected' State.\");\r\n }\r\n return this.transport.send(data);\r\n };\r\n HttpConnection.prototype.stop = function (error) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.connectionState = 2 /* Disconnected */;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.startPromise];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 4:\r\n if (!this.transport) return [3 /*break*/, 6];\r\n this.stopError = error;\r\n return [4 /*yield*/, this.transport.stop()];\r\n case 5:\r\n _a.sent();\r\n this.transport = null;\r\n _a.label = 6;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.startInternal = function (transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var url, negotiateResponse, redirects, _loop_1, this_1, state_1, e_2;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n url = this.baseUrl;\r\n this.accessTokenFactory = this.options.accessTokenFactory;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 12, , 13]);\r\n if (!this.options.skipNegotiation) return [3 /*break*/, 5];\r\n if (!(this.options.transport === HttpTransportType.WebSockets)) return [3 /*break*/, 3];\r\n // No need to add a connection ID in this case\r\n this.transport = this.constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n return [4 /*yield*/, this.transport.connect(url, transferFormat)];\r\n case 2:\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3: throw Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n case 4: return [3 /*break*/, 11];\r\n case 5:\r\n negotiateResponse = null;\r\n redirects = 0;\r\n _loop_1 = function () {\r\n var accessToken_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this_1.getNegotiationResponse(url)];\r\n case 1:\r\n negotiateResponse = _a.sent();\r\n // the user tries to stop the connection when it is being started\r\n if (this_1.connectionState === 2 /* Disconnected */) {\r\n return [2 /*return*/, { value: void 0 }];\r\n }\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n if (negotiateResponse.accessToken) {\r\n accessToken_1 = negotiateResponse.accessToken;\r\n this_1.accessTokenFactory = function () { return accessToken_1; };\r\n }\r\n redirects++;\r\n return [2 /*return*/];\r\n }\r\n });\r\n };\r\n this_1 = this;\r\n _a.label = 6;\r\n case 6: return [5 /*yield**/, _loop_1()];\r\n case 7:\r\n state_1 = _a.sent();\r\n if (typeof state_1 === \"object\")\r\n return [2 /*return*/, state_1.value];\r\n _a.label = 8;\r\n case 8:\r\n if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3 /*break*/, 6];\r\n _a.label = 9;\r\n case 9:\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n return [4 /*yield*/, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)];\r\n case 10:\r\n _a.sent();\r\n _a.label = 11;\r\n case 11:\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n this.transport.onreceive = this.onreceive;\r\n this.transport.onclose = function (e) { return _this.stopConnection(e); };\r\n // only change the state if we were connecting to not overwrite\r\n // the state if the connection is already marked as Disconnected\r\n this.changeState(0 /* Connecting */, 1 /* Connected */);\r\n return [3 /*break*/, 13];\r\n case 12:\r\n e_2 = _a.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to start the connection: \" + e_2);\r\n this.connectionState = 2 /* Disconnected */;\r\n this.transport = null;\r\n throw e_2;\r\n case 13: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.getNegotiationResponse = function (url) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, token, headers, negotiateUrl, response, e_3;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _b.sent();\r\n if (token) {\r\n headers = (_a = {},\r\n _a[\"Authorization\"] = \"Bearer \" + token,\r\n _a);\r\n }\r\n negotiateUrl = this.resolveNegotiateUrl(url);\r\n this.logger.log(LogLevel.Debug, \"Sending negotiation request: \" + negotiateUrl);\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: headers,\r\n })];\r\n case 3:\r\n response = _b.sent();\r\n if (response.statusCode !== 200) {\r\n throw Error(\"Unexpected status code returned from negotiate \" + response.statusCode);\r\n }\r\n return [2 /*return*/, JSON.parse(response.content)];\r\n case 4:\r\n e_3 = _b.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to complete negotiation with the server: \" + e_3);\r\n throw e_3;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.createConnectUrl = function (url, connectionId) {\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + (\"id=\" + connectionId);\r\n };\r\n HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var connectUrl, transports, _i, transports_1, endpoint, transport, ex_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId);\r\n if (!this.isITransport(requestedTransport)) return [3 /*break*/, 2];\r\n this.logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)];\r\n case 1:\r\n _a.sent();\r\n // only change the state if we were connecting to not overwrite\r\n // the state if the connection is already marked as Disconnected\r\n this.changeState(0 /* Connecting */, 1 /* Connected */);\r\n return [2 /*return*/];\r\n case 2:\r\n transports = negotiateResponse.availableTransports;\r\n _i = 0, transports_1 = transports;\r\n _a.label = 3;\r\n case 3:\r\n if (!(_i < transports_1.length)) return [3 /*break*/, 9];\r\n endpoint = transports_1[_i];\r\n this.connectionState = 0 /* Connecting */;\r\n transport = this.resolveTransport(endpoint, requestedTransport, requestedTransferFormat);\r\n if (!(typeof transport === \"number\")) return [3 /*break*/, 8];\r\n this.transport = this.constructTransport(transport);\r\n if (!(negotiateResponse.connectionId === null)) return [3 /*break*/, 5];\r\n return [4 /*yield*/, this.getNegotiationResponse(url)];\r\n case 4:\r\n negotiateResponse = _a.sent();\r\n connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId);\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)];\r\n case 6:\r\n _a.sent();\r\n this.changeState(0 /* Connecting */, 1 /* Connected */);\r\n return [2 /*return*/];\r\n case 7:\r\n ex_1 = _a.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to start the transport '\" + HttpTransportType[transport] + \"': \" + ex_1);\r\n this.connectionState = 2 /* Disconnected */;\r\n negotiateResponse.connectionId = null;\r\n return [3 /*break*/, 8];\r\n case 8:\r\n _i++;\r\n return [3 /*break*/, 3];\r\n case 9: throw new Error(\"Unable to initialize any of the available transports.\");\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.constructTransport = function (transport) {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n return new WebSocketTransport(this.accessTokenFactory, this.logger, this.options.logMessageContent);\r\n case HttpTransportType.ServerSentEvents:\r\n return new ServerSentEventsTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent);\r\n default:\r\n throw new Error(\"Unknown transport: \" + transport + \".\");\r\n }\r\n };\r\n HttpConnection.prototype.resolveTransport = function (endpoint, requestedTransport, requestedTransferFormat) {\r\n var transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + endpoint.transport + \"' because it is not supported by this client.\");\r\n }\r\n else {\r\n var transferFormats = endpoint.transferFormats.map(function (s) { return TransferFormat[s]; });\r\n if (transportMatches(requestedTransport, transport)) {\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && typeof WebSocket === \"undefined\") ||\r\n (transport === HttpTransportType.ServerSentEvents && typeof EventSource === \"undefined\")) {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it is not supported in your environment.'\");\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Selecting transport '\" + HttpTransportType[transport] + \"'\");\r\n return transport;\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it does not support the requested transfer format '\" + TransferFormat[requestedTransferFormat] + \"'.\");\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it was disabled by the client.\");\r\n }\r\n }\r\n return null;\r\n };\r\n HttpConnection.prototype.isITransport = function (transport) {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n };\r\n HttpConnection.prototype.changeState = function (from, to) {\r\n if (this.connectionState === from) {\r\n this.connectionState = to;\r\n return true;\r\n }\r\n return false;\r\n };\r\n HttpConnection.prototype.stopConnection = function (error) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n this.transport = null;\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this.stopError || error;\r\n if (error) {\r\n this.logger.log(LogLevel.Error, \"Connection disconnected with error '\" + error + \"'.\");\r\n }\r\n else {\r\n this.logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n this.connectionState = 2 /* Disconnected */;\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.resolveUrl = function (url) {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n if (typeof window === \"undefined\" || !window || !window.document) {\r\n throw new Error(\"Cannot resolve '\" + url + \"'.\");\r\n }\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n var aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n this.logger.log(LogLevel.Information, \"Normalizing '\" + url + \"' to '\" + aTag.href + \"'.\");\r\n return aTag.href;\r\n };\r\n HttpConnection.prototype.resolveNegotiateUrl = function (url) {\r\n var index = url.indexOf(\"?\");\r\n var negotiateUrl = url.substring(0, index === -1 ? url.length : index);\r\n if (negotiateUrl[negotiateUrl.length - 1] !== \"/\") {\r\n negotiateUrl += \"/\";\r\n }\r\n negotiateUrl += \"negotiate\";\r\n negotiateUrl += index === -1 ? \"\" : url.substring(index);\r\n return negotiateUrl;\r\n };\r\n return HttpConnection;\r\n}());\r\nexport { HttpConnection };\r\nfunction transportMatches(requestedTransport, actualTransport) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { HandshakeProtocol } from \"./HandshakeProtocol\";\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Arg, Subject } from \"./Utils\";\r\nvar DEFAULT_TIMEOUT_IN_MS = 30 * 1000;\r\n/** Represents a connection to a SignalR Hub. */\r\nvar HubConnection = /** @class */ (function () {\r\n function HubConnection(connection, logger, protocol) {\r\n var _this = this;\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS;\r\n this.logger = logger;\r\n this.protocol = protocol;\r\n this.connection = connection;\r\n this.handshakeProtocol = new HandshakeProtocol();\r\n this.connection.onreceive = function (data) { return _this.processIncomingData(data); };\r\n this.connection.onclose = function (error) { return _this.connectionClosed(error); };\r\n this.callbacks = {};\r\n this.methods = {};\r\n this.closedCallbacks = [];\r\n this.id = 0;\r\n }\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n HubConnection.create = function (connection, logger, protocol) {\r\n return new HubConnection(connection, logger, protocol);\r\n };\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n HubConnection.prototype.start = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var handshakeRequest;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n handshakeRequest = {\r\n protocol: this.protocol.name,\r\n version: this.protocol.version,\r\n };\r\n this.logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n this.receivedHandshakeResponse = false;\r\n return [4 /*yield*/, this.connection.start(this.protocol.transferFormat)];\r\n case 1:\r\n _a.sent();\r\n this.logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n return [4 /*yield*/, this.connection.send(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))];\r\n case 2:\r\n _a.sent();\r\n this.logger.log(LogLevel.Information, \"Using HubProtocol '\" + this.protocol.name + \"'.\");\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this.cleanupTimeout();\r\n this.configureTimeout();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n HubConnection.prototype.stop = function () {\r\n this.logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n this.cleanupTimeout();\r\n return this.connection.stop();\r\n };\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult} An object that yields results from the server as they are received.\r\n */\r\n HubConnection.prototype.stream = function (methodName) {\r\n var _this = this;\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var invocationDescriptor = this.createStreamInvocation(methodName, args);\r\n var subject = new Subject(function () {\r\n var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId);\r\n var cancelMessage = _this.protocol.writeMessage(cancelInvocation);\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n return _this.connection.send(cancelMessage);\r\n });\r\n this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n }\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n }\r\n else {\r\n subject.complete();\r\n }\r\n }\r\n else {\r\n subject.next((invocationEvent.item));\r\n }\r\n };\r\n var message = this.protocol.writeMessage(invocationDescriptor);\r\n this.connection.send(message)\r\n .catch(function (e) {\r\n subject.error(e);\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n });\r\n return subject;\r\n };\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n HubConnection.prototype.send = function (methodName) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var invocationDescriptor = this.createInvocation(methodName, args, true);\r\n var message = this.protocol.writeMessage(invocationDescriptor);\r\n return this.connection.send(message);\r\n };\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n HubConnection.prototype.invoke = function (methodName) {\r\n var _this = this;\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var invocationDescriptor = this.createInvocation(methodName, args, false);\r\n var p = new Promise(function (resolve, reject) {\r\n _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) {\r\n if (error) {\r\n reject(error);\r\n return;\r\n }\r\n if (invocationEvent.type === MessageType.Completion) {\r\n var completionMessage = invocationEvent;\r\n if (completionMessage.error) {\r\n reject(new Error(completionMessage.error));\r\n }\r\n else {\r\n resolve(completionMessage.result);\r\n }\r\n }\r\n else {\r\n reject(new Error(\"Unexpected message type: \" + invocationEvent.type));\r\n }\r\n };\r\n var message = _this.protocol.writeMessage(invocationDescriptor);\r\n _this.connection.send(message)\r\n .catch(function (e) {\r\n reject(e);\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n });\r\n });\r\n return p;\r\n };\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n HubConnection.prototype.on = function (methodName, newMethod) {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n if (!this.methods[methodName]) {\r\n this.methods[methodName] = [];\r\n }\r\n // Preventing adding the same handler multiple times.\r\n if (this.methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n this.methods[methodName].push(newMethod);\r\n };\r\n HubConnection.prototype.off = function (methodName, method) {\r\n if (!methodName) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n var handlers = this.methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n var removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this.methods[methodName];\r\n }\r\n }\r\n }\r\n else {\r\n delete this.methods[methodName];\r\n }\r\n };\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n HubConnection.prototype.onclose = function (callback) {\r\n if (callback) {\r\n this.closedCallbacks.push(callback);\r\n }\r\n };\r\n HubConnection.prototype.processIncomingData = function (data) {\r\n this.cleanupTimeout();\r\n if (!this.receivedHandshakeResponse) {\r\n data = this.processHandshakeResponse(data);\r\n this.receivedHandshakeResponse = true;\r\n }\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n var messages = this.protocol.parseMessages(data, this.logger);\r\n for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) {\r\n var message = messages_1[_i];\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n this.invokeClientMethod(message);\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n var callback = this.callbacks[message.invocationId];\r\n if (callback != null) {\r\n if (message.type === MessageType.Completion) {\r\n delete this.callbacks[message.invocationId];\r\n }\r\n callback(message);\r\n }\r\n break;\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close:\r\n this.logger.log(LogLevel.Information, \"Close message received from server.\");\r\n // We don't want to wait on the stop itself.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(message.error ? new Error(\"Server returned an error on close: \" + message.error) : null);\r\n break;\r\n default:\r\n this.logger.log(LogLevel.Warning, \"Invalid message type: \" + message.type);\r\n break;\r\n }\r\n }\r\n }\r\n this.configureTimeout();\r\n };\r\n HubConnection.prototype.processHandshakeResponse = function (data) {\r\n var _a;\r\n var responseMessage;\r\n var remainingData;\r\n try {\r\n _a = this.handshakeProtocol.parseHandshakeResponse(data), remainingData = _a[0], responseMessage = _a[1];\r\n }\r\n catch (e) {\r\n var message = \"Error parsing handshake response: \" + e;\r\n this.logger.log(LogLevel.Error, message);\r\n var error = new Error(message);\r\n // We don't want to wait on the stop itself.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n var message = \"Server returned handshake error: \" + responseMessage.error;\r\n this.logger.log(LogLevel.Error, message);\r\n // We don't want to wait on the stop itself.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(new Error(message));\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n return remainingData;\r\n };\r\n HubConnection.prototype.configureTimeout = function () {\r\n var _this = this;\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this.timeoutHandle = setTimeout(function () { return _this.serverTimeout(); }, this.serverTimeoutInMilliseconds);\r\n }\r\n };\r\n HubConnection.prototype.serverTimeout = function () {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n };\r\n HubConnection.prototype.invokeClientMethod = function (invocationMessage) {\r\n var _this = this;\r\n var methods = this.methods[invocationMessage.target.toLowerCase()];\r\n if (methods) {\r\n methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); });\r\n if (invocationMessage.invocationId) {\r\n // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response.\r\n var message = \"Server requested a response, which is not supported in this version of the client.\";\r\n this.logger.log(LogLevel.Error, message);\r\n // We don't need to wait on this Promise.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(new Error(message));\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Warning, \"No client method with the name '\" + invocationMessage.target + \"' found.\");\r\n }\r\n };\r\n HubConnection.prototype.connectionClosed = function (error) {\r\n var _this = this;\r\n var callbacks = this.callbacks;\r\n this.callbacks = {};\r\n Object.keys(callbacks)\r\n .forEach(function (key) {\r\n var callback = callbacks[key];\r\n callback(undefined, error ? error : new Error(\"Invocation canceled due to connection being closed.\"));\r\n });\r\n this.cleanupTimeout();\r\n this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); });\r\n };\r\n HubConnection.prototype.cleanupTimeout = function () {\r\n if (this.timeoutHandle) {\r\n clearTimeout(this.timeoutHandle);\r\n }\r\n };\r\n HubConnection.prototype.createInvocation = function (methodName, args, nonblocking) {\r\n if (nonblocking) {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n var id = this.id;\r\n this.id++;\r\n return {\r\n arguments: args,\r\n invocationId: id.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n };\r\n HubConnection.prototype.createStreamInvocation = function (methodName, args) {\r\n var id = this.id;\r\n this.id++;\r\n return {\r\n arguments: args,\r\n invocationId: id.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n };\r\n HubConnection.prototype.createCancelInvocation = function (id) {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n };\r\n return HubConnection;\r\n}());\r\nexport { HubConnection };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\n/** A builder for configuring {@link @aspnet/signalr.HubConnection} instances. */\r\nvar HubConnectionBuilder = /** @class */ (function () {\r\n function HubConnectionBuilder() {\r\n }\r\n HubConnectionBuilder.prototype.configureLogging = function (logging) {\r\n Arg.isRequired(logging, \"logging\");\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n }\r\n else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n return this;\r\n };\r\n HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) {\r\n Arg.isRequired(url, \"url\");\r\n this.url = url;\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = transportTypeOrOptions;\r\n }\r\n else {\r\n this.httpConnectionOptions = {\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n return this;\r\n };\r\n /** Configures the {@link @aspnet/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @aspnet/signalr.IHubProtocol} implementation to use.\r\n */\r\n HubConnectionBuilder.prototype.withHubProtocol = function (protocol) {\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.protocol = protocol;\r\n return this;\r\n };\r\n /** Creates a {@link @aspnet/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @aspnet/signalr.HubConnection}.\r\n */\r\n HubConnectionBuilder.prototype.build = function () {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n var httpConnectionOptions = this.httpConnectionOptions || {};\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n var connection = new HttpConnection(this.url, httpConnectionOptions);\r\n return HubConnection.create(connection, this.logger || NullLogger.instance, this.protocol || new JsonHubProtocol());\r\n };\r\n return HubConnectionBuilder;\r\n}());\r\nexport { HubConnectionBuilder };\r\nfunction isLogger(logger) {\r\n return logger.log !== undefined;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n/** Defines the type of a Hub Message. */\r\nexport var MessageType;\r\n(function (MessageType) {\r\n /** Indicates the message is an Invocation message and implements the {@link @aspnet/signalr.InvocationMessage} interface. */\r\n MessageType[MessageType[\"Invocation\"] = 1] = \"Invocation\";\r\n /** Indicates the message is a StreamItem message and implements the {@link @aspnet/signalr.StreamItemMessage} interface. */\r\n MessageType[MessageType[\"StreamItem\"] = 2] = \"StreamItem\";\r\n /** Indicates the message is a Completion message and implements the {@link @aspnet/signalr.CompletionMessage} interface. */\r\n MessageType[MessageType[\"Completion\"] = 3] = \"Completion\";\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @aspnet/signalr.StreamInvocationMessage} interface. */\r\n MessageType[MessageType[\"StreamInvocation\"] = 4] = \"StreamInvocation\";\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @aspnet/signalr.CancelInvocationMessage} interface. */\r\n MessageType[MessageType[\"CancelInvocation\"] = 5] = \"CancelInvocation\";\r\n /** Indicates the message is a Ping message and implements the {@link @aspnet/signalr.PingMessage} interface. */\r\n MessageType[MessageType[\"Ping\"] = 6] = \"Ping\";\r\n /** Indicates the message is a Close message and implements the {@link @aspnet/signalr.CloseMessage} interface. */\r\n MessageType[MessageType[\"Close\"] = 7] = \"Close\";\r\n})(MessageType || (MessageType = {}));\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n /** Log level for very low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\r\n /** Log level for low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\r\n /** Log level for informational diagnostic messages. */\r\n LogLevel[LogLevel[\"Information\"] = 2] = \"Information\";\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n LogLevel[LogLevel[\"Warning\"] = 3] = \"Warning\";\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n LogLevel[LogLevel[\"Critical\"] = 5] = \"Critical\";\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n LogLevel[LogLevel[\"None\"] = 6] = \"None\";\r\n})(LogLevel || (LogLevel = {}));\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport var HttpTransportType;\r\n(function (HttpTransportType) {\r\n /** Specifies no transport preference. */\r\n HttpTransportType[HttpTransportType[\"None\"] = 0] = \"None\";\r\n /** Specifies the WebSockets transport. */\r\n HttpTransportType[HttpTransportType[\"WebSockets\"] = 1] = \"WebSockets\";\r\n /** Specifies the Server-Sent Events transport. */\r\n HttpTransportType[HttpTransportType[\"ServerSentEvents\"] = 2] = \"ServerSentEvents\";\r\n /** Specifies the Long Polling transport. */\r\n HttpTransportType[HttpTransportType[\"LongPolling\"] = 4] = \"LongPolling\";\r\n})(HttpTransportType || (HttpTransportType = {}));\r\n/** Specifies the transfer format for a connection. */\r\nexport var TransferFormat;\r\n(function (TransferFormat) {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Text\"] = 1] = \"Text\";\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Binary\"] = 2] = \"Binary\";\r\n})(TransferFormat || (TransferFormat = {}));\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nvar JSON_HUB_PROTOCOL_NAME = \"json\";\r\n/** Implements the JSON Hub Protocol. */\r\nvar JsonHubProtocol = /** @class */ (function () {\r\n function JsonHubProtocol() {\r\n /** @inheritDoc */\r\n this.name = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n this.version = 1;\r\n /** @inheritDoc */\r\n this.transferFormat = TransferFormat.Text;\r\n }\r\n /** Creates an array of {@link @aspnet/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n JsonHubProtocol.prototype.parseMessages = function (input, logger) {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n if (!input) {\r\n return [];\r\n }\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n // Parse the messages\r\n var messages = TextMessageFormat.parse(input);\r\n var hubMessages = [];\r\n for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) {\r\n var message = messages_1[_i];\r\n var parsedMessage = JSON.parse(message);\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this.isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this.isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this.isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n return hubMessages;\r\n };\r\n /** Writes the specified {@link @aspnet/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n JsonHubProtocol.prototype.writeMessage = function (message) {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n };\r\n JsonHubProtocol.prototype.isInvocationMessage = function (message) {\r\n this.assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n if (message.invocationId !== undefined) {\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n };\r\n JsonHubProtocol.prototype.isStreamItemMessage = function (message) {\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n };\r\n JsonHubProtocol.prototype.isCompletionMessage = function (message) {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n if (!message.result && message.error) {\r\n this.assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n };\r\n JsonHubProtocol.prototype.assertNotEmptyString = function (value, errorMessage) {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n };\r\n return JsonHubProtocol;\r\n}());\r\nexport { JsonHubProtocol };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n/** A logger that does nothing when log messages are sent to it. */\r\nvar NullLogger = /** @class */ (function () {\r\n function NullLogger() {\r\n }\r\n /** @inheritDoc */\r\n // tslint:disable-next-line\r\n NullLogger.prototype.log = function (_logLevel, _message) {\r\n };\r\n /** The singleton instance of the {@link @aspnet/signalr.NullLogger}. */\r\n NullLogger.instance = new NullLogger();\r\n return NullLogger;\r\n}());\r\nexport { NullLogger };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, sendMessage } from \"./Utils\";\r\nvar SHUTDOWN_TIMEOUT = 5 * 1000;\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nvar LongPollingTransport = /** @class */ (function () {\r\n function LongPollingTransport(httpClient, accessTokenFactory, logger, logMessageContent, shutdownTimeout) {\r\n this.httpClient = httpClient;\r\n this.accessTokenFactory = accessTokenFactory || (function () { return null; });\r\n this.logger = logger;\r\n this.pollAbort = new AbortController();\r\n this.logMessageContent = logMessageContent;\r\n this.shutdownTimeout = shutdownTimeout || SHUTDOWN_TIMEOUT;\r\n }\r\n Object.defineProperty(LongPollingTransport.prototype, \"pollAborted\", {\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n get: function () {\r\n return this.pollAbort.aborted;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LongPollingTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var pollOptions, token, closeError, pollUrl, response;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.url = url;\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting\");\r\n if (transferFormat === TransferFormat.Binary && (typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n // This will work if we fix: https://github.com/aspnet/SignalR/issues/742\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n pollOptions = {\r\n abortSignal: this.pollAbort.signal,\r\n headers: {},\r\n timeout: 90000,\r\n };\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n this.updateHeaderToken(pollOptions, token);\r\n pollUrl = url + \"&_=\" + Date.now();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) polling: \" + pollUrl);\r\n return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)];\r\n case 2:\r\n response = _a.sent();\r\n if (response.statusCode !== 200) {\r\n this.logger.log(LogLevel.Error, \"(LongPolling transport) Unexpected response code: \" + response.statusCode);\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n closeError = new HttpError(response.statusText, response.statusCode);\r\n this.running = false;\r\n }\r\n else {\r\n this.running = true;\r\n }\r\n // tslint:disable-next-line:no-floating-promises\r\n this.poll(this.url, pollOptions, closeError);\r\n return [2 /*return*/, Promise.resolve()];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.updateHeaderToken = function (request, token) {\r\n if (token) {\r\n // tslint:disable-next-line:no-string-literal\r\n request.headers[\"Authorization\"] = \"Bearer \" + token;\r\n return;\r\n }\r\n // tslint:disable-next-line:no-string-literal\r\n if (request.headers[\"Authorization\"]) {\r\n // tslint:disable-next-line:no-string-literal\r\n delete request.headers[\"Authorization\"];\r\n }\r\n };\r\n LongPollingTransport.prototype.poll = function (url, pollOptions, closeError) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, pollUrl, response, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, , 8, 9]);\r\n _a.label = 1;\r\n case 1:\r\n if (!this.running) return [3 /*break*/, 7];\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 2:\r\n token = _a.sent();\r\n this.updateHeaderToken(pollOptions, token);\r\n _a.label = 3;\r\n case 3:\r\n _a.trys.push([3, 5, , 6]);\r\n pollUrl = url + \"&_=\" + Date.now();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) polling: \" + pollUrl);\r\n return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)];\r\n case 4:\r\n response = _a.sent();\r\n if (response.statusCode === 204) {\r\n this.logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server\");\r\n this.running = false;\r\n }\r\n else if (response.statusCode !== 200) {\r\n this.logger.log(LogLevel.Error, \"(LongPolling transport) Unexpected response code: \" + response.statusCode);\r\n // Unexpected status code\r\n closeError = new HttpError(response.statusText, response.statusCode);\r\n this.running = false;\r\n }\r\n else {\r\n // Process the response\r\n if (response.content) {\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) data received. \" + getDataDetail(response.content, this.logMessageContent));\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n }\r\n else {\r\n // This is another way timeout manifest.\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n return [3 /*break*/, 6];\r\n case 5:\r\n e_1 = _a.sent();\r\n if (!this.running) {\r\n // Log but disregard errors that occur after we were stopped by DELETE\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll errored after shutdown: \" + e_1.message);\r\n }\r\n else {\r\n if (e_1 instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n else {\r\n // Close the connection with the error as the result.\r\n closeError = e_1;\r\n this.running = false;\r\n }\r\n }\r\n return [3 /*break*/, 6];\r\n case 6: return [3 /*break*/, 1];\r\n case 7: return [3 /*break*/, 9];\r\n case 8:\r\n // Indicate that we've stopped so the shutdown timer doesn't get registered.\r\n this.stopped = true;\r\n // Clean up the shutdown timer if it was registered\r\n if (this.shutdownTimer) {\r\n clearTimeout(this.shutdownTimer);\r\n }\r\n // Fire our onclosed event\r\n if (this.onclose) {\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Firing onclose event. Error: \" + (closeError || \"\"));\r\n this.onclose(closeError);\r\n }\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Transport finished.\");\r\n return [7 /*endfinally*/];\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.send = function (data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.running) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot send until the transport is connected\"))];\r\n }\r\n return [2 /*return*/, sendMessage(this.logger, \"LongPolling\", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)];\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.stop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var deleteOptions, token;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, , 3, 4]);\r\n this.running = false;\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) sending DELETE request to \" + this.url + \".\");\r\n deleteOptions = {\r\n headers: {},\r\n };\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n this.updateHeaderToken(deleteOptions, token);\r\n return [4 /*yield*/, this.httpClient.delete(this.url, deleteOptions)];\r\n case 2:\r\n _a.sent();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request accepted.\");\r\n return [3 /*break*/, 4];\r\n case 3:\r\n // Abort the poll after the shutdown timeout if the server doesn't stop the poll.\r\n if (!this.stopped) {\r\n this.shutdownTimer = setTimeout(function () {\r\n _this.logger.log(LogLevel.Warning, \"(LongPolling transport) server did not terminate after DELETE request, canceling poll.\");\r\n // Abort any outstanding poll\r\n _this.pollAbort.abort();\r\n }, this.shutdownTimeout);\r\n }\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return LongPollingTransport;\r\n}());\r\nexport { LongPollingTransport };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, sendMessage } from \"./Utils\";\r\n/** @private */\r\nvar ServerSentEventsTransport = /** @class */ (function () {\r\n function ServerSentEventsTransport(httpClient, accessTokenFactory, logger, logMessageContent) {\r\n this.httpClient = httpClient;\r\n this.accessTokenFactory = accessTokenFactory || (function () { return null; });\r\n this.logger = logger;\r\n this.logMessageContent = logMessageContent;\r\n }\r\n ServerSentEventsTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n if (typeof (EventSource) === \"undefined\") {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n this.logger.log(LogLevel.Trace, \"(SSE transport) Connecting\");\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + (\"access_token=\" + encodeURIComponent(token));\r\n }\r\n this.url = url;\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n }\r\n var eventSource = new EventSource(url, { withCredentials: true });\r\n try {\r\n eventSource.onmessage = function (e) {\r\n if (_this.onreceive) {\r\n try {\r\n _this.logger.log(LogLevel.Trace, \"(SSE transport) data received. \" + getDataDetail(e.data, _this.logMessageContent) + \".\");\r\n _this.onreceive(e.data);\r\n }\r\n catch (error) {\r\n if (_this.onclose) {\r\n _this.onclose(error);\r\n }\r\n return;\r\n }\r\n }\r\n };\r\n eventSource.onerror = function (e) {\r\n var error = new Error(e.message || \"Error occurred\");\r\n if (opened) {\r\n _this.close(error);\r\n }\r\n else {\r\n reject(error);\r\n }\r\n };\r\n eventSource.onopen = function () {\r\n _this.logger.log(LogLevel.Information, \"SSE connected to \" + _this.url);\r\n _this.eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n return Promise.reject(e);\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n ServerSentEventsTransport.prototype.send = function (data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.eventSource) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot send until the transport is connected\"))];\r\n }\r\n return [2 /*return*/, sendMessage(this.logger, \"SSE\", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)];\r\n });\r\n });\r\n };\r\n ServerSentEventsTransport.prototype.stop = function () {\r\n this.close();\r\n return Promise.resolve();\r\n };\r\n ServerSentEventsTransport.prototype.close = function (e) {\r\n if (this.eventSource) {\r\n this.eventSource.close();\r\n this.eventSource = null;\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n };\r\n return ServerSentEventsTransport;\r\n}());\r\nexport { ServerSentEventsTransport };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// Not exported from index\r\n/** @private */\r\nvar TextMessageFormat = /** @class */ (function () {\r\n function TextMessageFormat() {\r\n }\r\n TextMessageFormat.write = function (output) {\r\n return \"\" + output + TextMessageFormat.RecordSeparator;\r\n };\r\n TextMessageFormat.parse = function (input) {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n var messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n };\r\n TextMessageFormat.RecordSeparatorCode = 0x1e;\r\n TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n return TextMessageFormat;\r\n}());\r\nexport { TextMessageFormat };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\n/** @private */\r\nvar Arg = /** @class */ (function () {\r\n function Arg() {\r\n }\r\n Arg.isRequired = function (val, name) {\r\n if (val === null || val === undefined) {\r\n throw new Error(\"The '\" + name + \"' argument is required.\");\r\n }\r\n };\r\n Arg.isIn = function (val, values, name) {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(\"Unknown \" + name + \" value: \" + val + \".\");\r\n }\r\n };\r\n return Arg;\r\n}());\r\nexport { Arg };\r\n/** @private */\r\nexport function getDataDetail(data, includeContent) {\r\n var length = null;\r\n if (isArrayBuffer(data)) {\r\n length = \"Binary data of length \" + data.byteLength;\r\n if (includeContent) {\r\n length += \". Content: '\" + formatArrayBuffer(data) + \"'\";\r\n }\r\n }\r\n else if (typeof data === \"string\") {\r\n length = \"String data of length \" + data.length;\r\n if (includeContent) {\r\n length += \". Content: '\" + data + \"'.\";\r\n }\r\n }\r\n return length;\r\n}\r\n/** @private */\r\nexport function formatArrayBuffer(data) {\r\n var view = new Uint8Array(data);\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n var str = \"\";\r\n view.forEach(function (num) {\r\n var pad = num < 16 ? \"0\" : \"\";\r\n str += \"0x\" + pad + num.toString(16) + \" \";\r\n });\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n/** @private */\r\nexport function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, logMessageContent) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, headers, token, response;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, accessTokenFactory()];\r\n case 1:\r\n token = _b.sent();\r\n if (token) {\r\n headers = (_a = {},\r\n _a[\"Authorization\"] = \"Bearer \" + token,\r\n _a);\r\n }\r\n logger.log(LogLevel.Trace, \"(\" + transportName + \" transport) sending data. \" + getDataDetail(content, logMessageContent) + \".\");\r\n return [4 /*yield*/, httpClient.post(url, {\r\n content: content,\r\n headers: headers,\r\n })];\r\n case 2:\r\n response = _b.sent();\r\n logger.log(LogLevel.Trace, \"(\" + transportName + \" transport) request complete. Response status: \" + response.statusCode + \".\");\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** @private */\r\nexport function createLogger(logger) {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n if (logger.log) {\r\n return logger;\r\n }\r\n return new ConsoleLogger(logger);\r\n}\r\n/** @private */\r\nvar Subject = /** @class */ (function () {\r\n function Subject(cancelCallback) {\r\n this.observers = [];\r\n this.cancelCallback = cancelCallback;\r\n }\r\n Subject.prototype.next = function (item) {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n observer.next(item);\r\n }\r\n };\r\n Subject.prototype.error = function (err) {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n };\r\n Subject.prototype.complete = function () {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n };\r\n Subject.prototype.subscribe = function (observer) {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n };\r\n return Subject;\r\n}());\r\nexport { Subject };\r\n/** @private */\r\nvar SubjectSubscription = /** @class */ (function () {\r\n function SubjectSubscription(subject, observer) {\r\n this.subject = subject;\r\n this.observer = observer;\r\n }\r\n SubjectSubscription.prototype.dispose = function () {\r\n var index = this.subject.observers.indexOf(this.observer);\r\n if (index > -1) {\r\n this.subject.observers.splice(index, 1);\r\n }\r\n if (this.subject.observers.length === 0) {\r\n this.subject.cancelCallback().catch(function (_) { });\r\n }\r\n };\r\n return SubjectSubscription;\r\n}());\r\nexport { SubjectSubscription };\r\n/** @private */\r\nvar ConsoleLogger = /** @class */ (function () {\r\n function ConsoleLogger(minimumLogLevel) {\r\n this.minimumLogLevel = minimumLogLevel;\r\n }\r\n ConsoleLogger.prototype.log = function (logLevel, message) {\r\n if (logLevel >= this.minimumLogLevel) {\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n console.error(LogLevel[logLevel] + \": \" + message);\r\n break;\r\n case LogLevel.Warning:\r\n console.warn(LogLevel[logLevel] + \": \" + message);\r\n break;\r\n case LogLevel.Information:\r\n console.info(LogLevel[logLevel] + \": \" + message);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n console.log(LogLevel[logLevel] + \": \" + message);\r\n break;\r\n }\r\n }\r\n };\r\n return ConsoleLogger;\r\n}());\r\nexport { ConsoleLogger };\r\n/** @private */\r\nexport function isArrayBuffer(val) {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail } from \"./Utils\";\r\n/** @private */\r\nvar WebSocketTransport = /** @class */ (function () {\r\n function WebSocketTransport(accessTokenFactory, logger, logMessageContent) {\r\n this.logger = logger;\r\n this.accessTokenFactory = accessTokenFactory || (function () { return null; });\r\n this.logMessageContent = logMessageContent;\r\n }\r\n WebSocketTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n if (typeof (WebSocket) === \"undefined\") {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n this.logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting\");\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + (\"access_token=\" + encodeURIComponent(token));\r\n }\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n url = url.replace(/^http/, \"ws\");\r\n var webSocket = new WebSocket(url);\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n // tslint:disable-next-line:variable-name\r\n webSocket.onopen = function (_event) {\r\n _this.logger.log(LogLevel.Information, \"WebSocket connected to \" + url);\r\n _this.webSocket = webSocket;\r\n resolve();\r\n };\r\n webSocket.onerror = function (event) {\r\n reject(event.error);\r\n };\r\n webSocket.onmessage = function (message) {\r\n _this.logger.log(LogLevel.Trace, \"(WebSockets transport) data received. \" + getDataDetail(message.data, _this.logMessageContent) + \".\");\r\n if (_this.onreceive) {\r\n _this.onreceive(message.data);\r\n }\r\n };\r\n webSocket.onclose = function (event) {\r\n // webSocket will be null if the transport did not start successfully\r\n _this.logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n if (_this.onclose) {\r\n if (event.wasClean === false || event.code !== 1000) {\r\n _this.onclose(new Error(\"Websocket closed with status code: \" + event.code + \" (\" + event.reason + \")\"));\r\n }\r\n else {\r\n _this.onclose();\r\n }\r\n }\r\n };\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n WebSocketTransport.prototype.send = function (data) {\r\n if (this.webSocket && this.webSocket.readyState === WebSocket.OPEN) {\r\n this.logger.log(LogLevel.Trace, \"(WebSockets transport) sending data. \" + getDataDetail(data, this.logMessageContent) + \".\");\r\n this.webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n };\r\n WebSocketTransport.prototype.stop = function () {\r\n if (this.webSocket) {\r\n this.webSocket.close();\r\n this.webSocket = null;\r\n }\r\n return Promise.resolve();\r\n };\r\n return WebSocketTransport;\r\n}());\r\nexport { WebSocketTransport };\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\nexport var VERSION = \"1.0.27\";\r\nexport { HttpError, TimeoutError } from \"./Errors\";\r\nexport { DefaultHttpClient, HttpClient, HttpResponse } from \"./HttpClient\";\r\nexport { HubConnection } from \"./HubConnection\";\r\nexport { HubConnectionBuilder } from \"./HubConnectionBuilder\";\r\nexport { MessageType } from \"./IHubProtocol\";\r\nexport { LogLevel } from \"./ILogger\";\r\nexport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nexport { NullLogger } from \"./Loggers\";\r\nexport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { HomePage } from './home.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: HomePage,\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class HomePageRoutingModule {}\n","import { ComponentsModule } from './../components/components.module';\nimport { ModalContentPageModule } from './../pages/modal-content/modal-content.module';\nimport { HomePageRoutingModule } from './home-routing.module';\nimport { HomePage } from './home.page';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { IonicModule } from '@ionic/angular';\n@NgModule({\n imports: [\n CommonModule,\n IonicModule,\n HomePageRoutingModule,\n ComponentsModule,\n ModalContentPageModule\n ],\n declarations: [HomePage],\n providers: [\n\n ]\n})\nexport class HomePageModule {}\n","import { ModalBaseComponent } from '../components/modal-base/modal-base.component';\nimport { MessageModalPage } from '../pages/message-modal/message-modal';\nimport { ModalContentPage } from '../pages/modal-content/modal-content.page';\nimport { Component, OnInit } from '@angular/core';\nimport { Router } from '@angular/router';\nimport * as signalR from '@aspnet/signalr';\nimport { HubConnection } from '@aspnet/signalr';\nimport { IonRouterOutlet, ModalController } from '@ionic/angular';\nimport { IMessage } from 'models/message';\nimport { BehaviorSubject, Observable, Subscription } from 'rxjs';\nimport { MessageAdminService } from 'services/message-admin.service';\nimport { environment } from 'src/environments/environment';\nconst HOST = environment.apiURL;\n@Component({\n selector: 'app-home',\n templateUrl: 'home.page.html',\n styleUrls: ['home.page.scss'],\n})\nexport class HomePage implements OnInit {\n\n public async: any;\n message: IMessage;\n messageSubject: BehaviorSubject = new BehaviorSubject('');\n message$: Observable = this.messageSubject.asObservable();\n subscriptions: Subscription;\n title = environment.title;\n private hubConnection: HubConnection | undefined;\n\n constructor(\n private router: Router,\n private messageAdminService: MessageAdminService,\n private routerOutlet: IonRouterOutlet,\n public modalCtrl: ModalController,\n ) {\n\n this.hubConnection = new signalR.HubConnectionBuilder()\n .withUrl(`${HOST}message`)\n .configureLogging(signalR.LogLevel.Information)\n .build();\n\n this.hubConnection.start().catch(err => console.error(err.toString()));\n\n this.hubConnection.on('Send', (data: any) => {\n const notification = `${data}`;\n this.messageSubject.next(notification);\n if (this.message) {\n this.message.displayMessage = notification;\n this.messageAdminService.broadcastNextMessage(this.message);\n }\n });\n }\n\n ngOnInit() {\n this.subscriptions = this.messageAdminService.message$.subscribe(m => {\n if (m) {\n this.message = m;\n this.messageSubject.next(m.displayMessage);\n }\n });\n }\n\n async viewMessageModal() {\n const msgModal = await this.modalCtrl.create({\n component: MessageModalPage\n });\n msgModal.present();\n }\n\n async presentModal() {\n const modal = await this.modalCtrl.create({\n presentingElement: this.routerOutlet.nativeEl,\n component: ModalBaseComponent,\n componentProps: {\n rootPage: ModalContentPage,\n },\n });\n\n await modal.present();\n }\n\n openSearch() {\n this.router.navigate(['/search']);\n }\n\n ionViewWillLeave() {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n }\n}\n"],"names":[],"sourceRoot":"webpack:///"}
Search for a Test
User Guide
Pathology website
Paediatric Draw Card
Draw Card
Announcements
\\n {{ message$ | async }}\\n\\n