"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[93055],{93055:(n,o,t)=>{t.r(o),t.d(o,{AddonModDataFieldLatlongComponent:()=>h});var e=t(10467),a=t(10093),r=t(79555),d=t(86654),i=t(8014),l=t(54438),s=t(89417),p=t(60177),_=t(2910),c=t(25880),m=t(17778),u=t(86198),f=t(58197),g=t(23007),C=t(73955);const _c0=n=>({url:n});function AddonModDataFieldLatlongComponent_span_0_ion_input_1_Template(n,o){if(1&n&&l.nrm(0,"ion-input",4),2&n){const n=l.XpG(2);l.Y8G("placeholder",n.field.name)("formControlName","f_"+n.field.id)}}function AddonModDataFieldLatlongComponent_span_0_ng_container_2_core_input_errors_16_Template(n,o){if(1&n&&l.nrm(0,"core-input-errors",13),2&n){const n=l.XpG(3);l.Y8G("control",n.form.controls["f_"+n.field.id])("errorText",n.error)}}function AddonModDataFieldLatlongComponent_span_0_ng_container_2_Template(n,o){if(1&n&&(l.qex(0),l.nrm(1,"span",5),l.j41(2,"div",6)(3,"ion-input",7)(4,"div",8),l.EFF(5,"°N"),l.k0s()()(),l.j41(6,"div",6)(7,"ion-input",7)(8,"div",8),l.EFF(9,"°E"),l.k0s()()(),l.j41(10,"div",9)(11,"ion-note"),l.nrm(12,"ion-icon",10),l.j41(13,"span"),l.nrm(14,"core-format-text",11),l.nI1(15,"translate"),l.k0s()()(),l.DNE(16,AddonModDataFieldLatlongComponent_span_0_ng_container_2_core_input_errors_16_Template,1,2,"core-input-errors",12),l.bVm()),2&n){const n=l.XpG(2);l.R7$(),l.Y8G("core-mark-required",n.field.required),l.R7$(2),l.Y8G("formControlName","f_"+n.field.id+"_0"),l.R7$(4),l.Y8G("formControlName","f_"+n.field.id+"_1"),l.R7$(7),l.Y8G("text",l.i5U(15,6,"core.howtoobtaincoordinates",l.eq3(9,_c0,n.mapsUrl)))("showBrowserWarningInLinks",!1),l.R7$(2),l.Y8G("ngIf",n.error)}}function AddonModDataFieldLatlongComponent_span_0_Template(n,o){if(1&n&&(l.j41(0,"span",2),l.DNE(1,AddonModDataFieldLatlongComponent_span_0_ion_input_1_Template,1,2,"ion-input",3)(2,AddonModDataFieldLatlongComponent_span_0_ng_container_2_Template,17,11,"ng-container",1),l.k0s()),2&n){const n=l.XpG();l.Y8G("formGroup",n.form),l.R7$(),l.Y8G("ngIf",n.searchMode),l.R7$(),l.Y8G("ngIf",n.editMode)}}function AddonModDataFieldLatlongComponent_span_1_Template(n,o){if(1&n&&(l.j41(0,"span")(1,"a",14),l.EFF(2),l.k0s()()),2&n){const n=l.XpG();l.R7$(),l.Y8G("href",n.getLatLongLink(n.north,n.east),l.B4B),l.R7$(),l.JRh(n.formatLatLong(n.north,n.east))}}let h=(()=>{var n;class AddonModDataFieldLatlongComponent extends a.u{constructor(n){super(n),this.mapsUrl=""}formatLatLong(n,o){if(void 0!==n||void 0!==o){n=n||0,o=o||0;return Math.abs(n).toFixed(4)+(n<0?"°S":"°N")+" "+Math.abs(o).toFixed(4)+(o<0?"°W":"°E")}return""}getLatLongLink(n,o){return r.up.bypassSecurityTrustUrl(i.F.buildMapsURL({coordinates:{latitude:n,longitude:o}}))}init(){var n=this;return(0,e.A)((function*(){n.value&&n.updateValue(n.value),n.editMode?(n.addControl(`f_${n.field.id}_0`,n.north),n.addControl(`f_${n.field.id}_1`,n.east),n.mapsUrl=i.F.buildMapsURL()):n.searchMode&&n.addControl(`f_${n.field.id}`)}))()}updateValue(n){var o,t;this.value=n,this.north=n&&parseFloat(null!==(o=n.content)&&void 0!==o?o:"")||void 0,this.east=n&&parseFloat(null!==(t=n.content1)&&void 0!==t?t:"")||void 0}}return(n=AddonModDataFieldLatlongComponent).ɵfac=function AddonModDataFieldLatlongComponent_Factory(o){return new(o||n)(l.rXU(s.ok))},n.ɵcmp=l.VBU({type:n,selectors:[["addon-mod-data-field-latlong"]],standalone:!0,features:[l.Vt3,l.aNF],decls:2,vars:2,consts:[[3,"formGroup",4,"ngIf"],[4,"ngIf"],[3,"formGroup"],["type","text",3,"placeholder","formControlName",4,"ngIf"],["type","text",3,"placeholder","formControlName"],[1,"core-mark-required",3,"core-mark-required"],[1,"addon-data-latlong"],["type","text","maxlength","10","placeholder","0.0",3,"formControlName"],["slot","end",1,"input-units"],[1,"addon-data-latlong","addon-data-latlong-coordinates-instructions"],["name","fas-circle-question","aria-hidden","true",1,"text-info"],[3,"text","showBrowserWarningInLinks"],[3,"control","errorText",4,"ngIf"],[3,"control","errorText"],["core-link","",3,"href"]],template:function AddonModDataFieldLatlongComponent_Template(n,o){1&n&&l.DNE(0,AddonModDataFieldLatlongComponent_span_0_Template,3,3,"span",0)(1,AddonModDataFieldLatlongComponent_span_1_Template,3,2,"span",1),2&n&&(l.Y8G("ngIf",o.inputMode&&o.form),l.R7$(),l.Y8G("ngIf",o.displayMode&&o.value))},dependencies:[d.n,p.bT,s.BC,s.cb,s.tU,_.iq,_.$w,_.JI,_.Gw,s.j4,s.JD,c.q,m.j,u.t,f.B,g.j,C.D9],styles:["[_nghost-%COMP%]   .addon-data-latlong-coordinates-instructions[_ngcontent-%COMP%]   ion-note[_ngcontent-%COMP%]   *[_ngcontent-%COMP%]{line-height:var(--mdl-typography-label-lineHeight-sm);vertical-align:middle}[_nghost-%COMP%]   .addon-data-latlong-coordinates-instructions[_ngcontent-%COMP%]   ion-icon[_ngcontent-%COMP%]{margin-inline-start:0px;margin-inline-end:.25rem}"]}),AddonModDataFieldLatlongComponent})()}}]);