1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3240],{3240:(D,m,o)=>{o.r(m),o.d(m,{TapConnectSocketTabModule:()=>l});var d=o(9312),k=o(8062),a=o(209),T=o(9101),u=o(9379),v=o(7845),b=o(6745),n=o(3847),r=o(3310),C=o(4857),g=o(8938);function _(c,t){1&c&&n._UZ(0,"ion-progress-bar",11)}function I(c,t){1&c&&(n.TgZ(0,"div",12),n._UZ(1,"ion-icon",13),n.TgZ(2,"p"),n._uU(3," Run scanner to find Tap. "),n.qZA()())}function Z(c,t){if(1&c){const e=n.EpF();n.TgZ(0,"ion-fab-button",14),n.NdJ("click",function(){return n.CHM(e),n.oxw().startScan()}),n._UZ(1,"ion-icon",15),n.qZA()}}function w(c,t){if(1&c){const e=n.EpF();n.TgZ(0,"ion-fab-button",16),n.NdJ("click",function(){return n.CHM(e),n.oxw().stopScan()}),n._UZ(1,"ion-icon",17),n.qZA()}}const y=function(){return["socket","websocket"]},S=(0,b.Z)("TapConnectSocketTabComponent");class f{constructor(t,e,s,i,N){this.changeDetectorRef=t,this.platform=e,this.tapConnectionService=s,this.wifiScanner=i,this.networkScanner=N,this.showScan=!1,this.networkDevices=this.networkScanner.results,this.infraDevices=this.wifiScanner.results.pipe((0,u.U)(h=>h.filter(p=>(S("Filtering Wi-Fi device",p),!!p.SSID&&p.SSID.match(/_[0-9A-Fa-f]{5}$/))))),this.allDevices=(0,T.aj)([this.networkDevices.pipe((0,v.O)([])),this.infraDevices.pipe((0,v.O)([]))]).pipe((0,u.U)(([h,p])=>[...h,...p])),this.showScan=this.platform.is("cordova"),this.scanning=(0,T.aj)(this.wifiScanner.scanning,this.networkScanner.scanning).pipe((0,u.U)(([h,p])=>h||p))}ngOnInit(){var t;this.deviceSub=null===(t=this.allDevices)||void 0===t?void 0:t.subscribe(e=>{this.devicesSnapshot=e.filter(s=>!!s),this.changeDetectorRef.detectChanges()})}ngOnDestroy(){var t;null===(t=this.deviceSub)||void 0===t||t.unsubscribe()}onItemClicked(t){return(0,d.mG)(this,void 0,void 0,function*(){return S("onItemClicked",t),t.SSID?this.onInfraItemClicked(t):this.onNetworkItemClicked(t)})}onNetworkItemClicked(t){return(0,d.mG)(this,void 0,void 0,function*(){S("onNetworkItemClicked",t),t&&t.ipv4Addresses&&0!=t.ipv4Addresses.length?this.tapConnectionService.connectWithLoader({type:"socket",info:{url:`tcp://${t.ipv4Addresses[0]}:${t.port}`}}):this.onError(new Error("This device does not have an IP address"))})}onInfraItemClicked(t){return(0,d.mG)(this,void 0,void 0,function*(){S("onInfraItemClicked",event),this.tapConnectionService.connectWithLoader({type:"wifi",info:{ssid:t.SSID,name:t.SSID,url:"tcp://192.168.4.1:2000",algorithm:"WPA",password:void 0}})})}onProtocolSelected(t){return(0,d.mG)(this,void 0,void 0,function*(){this.tapConnectionService.connectWithLoader(t.meta)})}onError(t){this.error=t}startScan(){return this.error=void 0,Promise.all([this.refreshNetwork(),this.refreshWifi()])}stopScan(){this.networkScanner.stop().catch(t=>this.onError(t)),this.wifiScanner.stop().catch(t=>this.onError(t))}refreshScan(t){return(0,d.mG)(this,void 0,void 0,function*(){t.target.complete(),yield this.stopScan(),yield this.startScan()})}refreshNetwork(){this.networkScanner.start().catch(t=>this.onError(t))}refreshWifi(){this.wifiScanner.start().catch(t=>this.onError(t))}clearList(){this.devicesSnapshot=[]}onStoredTapSelected(t){this.tapConnectionService.connectWithLoader(t.connection)}}f.\u0275fac=function(t){return new(t||f)(n.Y36(n.sBO),n.Y36(r.t4),n.Y36(k.M),n.Y36(a.PH),n.Y36(a.G9))},f.\u0275cmp=n.Xpm({type:f,selectors:[["app-tap-connect-socket-tab"]],decls:21,vars:16,consts:[["type","indeterminate",4,"ngIf"],[3,"connectionTypes","selected"],[1,"center-form"],[3,"onError","onProtocolSelected"],["pullmin","120","slot","fixed",3,"ionRefresh"],[3,"error"],[3,"devices","onItemClicked"],["class","no-tap-found",4,"ngIf"],["horizontal","end","slot","fixed","vertical","bottom"],["id","BtnStartScan",3,"click",4,"ngIf"],["id","BtnStopScan",3,"click",4,"ngIf"],["type","indeterminate"],[1,"no-tap-found"],["name","list-outline"],["id","BtnStartScan",3,"click"],["name","search"],["id","BtnStopScan",3,"click"],["name","pause"]],template:function(t,e){1&t&&(n.TgZ(0,"ion-content"),n.YNc(1,_,1,0,"ion-progress-bar",0),n.ALo(2,"async"),n.TgZ(3,"tap-connection-store-list",1),n.NdJ("selected",function(i){return e.onStoredTapSelected(i)}),n.qZA(),n.TgZ(4,"ion-grid",2)(5,"ion-row")(6,"ion-col")(7,"tap-connect-socket",3),n.NdJ("onError",function(i){return e.onError(i)})("onProtocolSelected",function(i){return e.onProtocolSelected(i)}),n.qZA()()(),n.TgZ(8,"ion-row")(9,"ion-col")(10,"ion-refresher",4),n.NdJ("ionRefresh",function(i){return e.refreshScan(i)}),n._UZ(11,"ion-refresher-content"),n.qZA(),n._UZ(12,"app-feedback-error",5),n.TgZ(13,"tap-scanner
1-wifi-item",6),n.NdJ("onItemClicked",function(i){return e.onItemClicked(i)}),n.qZA(),n.YNc(14,I,4,0,"div",7),n.ALo(15,"async"),n.qZA()()(),n.TgZ(16,"ion-fab",8),n.YNc(17,Z,2,0,"ion-fab-button",9),n.ALo(18,"async"),n.YNc(19,w,2,0,"ion-fab-button",10),n.ALo(20,"async"),n.qZA()()),2&t&&(n.xp6(1),n.Q6J("ngIf",n.lcZ(2,7,e.scanning)),n.xp6(2),n.Q6J("connectionTypes",n.DdM(15,y)),n.xp6(9),n.Q6J("error",e.error),n.xp6(1),n.Q6J("devices",e.devicesSnapshot),n.xp6(1),n.Q6J("ngIf",!(e.devicesSnapshot&&0!==e.devicesSnapshot.length||n.lcZ(15,9,e.scanning))),n.xp6(3),n.Q6J("ngIf",!n.lcZ(18,11,e.scanning)),n.xp6(2),n.Q6J("ngIf",n.lcZ(20,13,e.scanning)))},directives:[r.W2,C.O5,r.X7,a.W8,r.jY,r.Nd,r.wI,a.KW,r.nJ,r.Wo,g.W,a.cb,r.gu,r.IJ,r.W4],pipes:[C.Ov],styles:[""]});var A=o(8736),J=o(8241);class l{}l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=n.oAB({type:l}),l.\u0275inj=n.cJS({imports:[[J.Rh,a.sw,a.ld,a.fs,A.Bz.forChild([{path:"",component:f}])]]})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.