PageSourceSearch

https://topografiapamieci.pl/chunk-DDHQBKUS.js

js topografiapamieci.pl collected 2026-10-08 12:04:25 UTC 16,306 bytes, 1 lines download raw bytes

1import{a as O,b as ne}from"./chunk-OE57CPA5.js";import{a as U}from"./chunk-FQJZPOXY.js";import{a as M}from"./chunk-4GXCJFHC.js";import{a as w}from"./chunk-VSVX6VL4.js";import{m as ie,x as Q,y as A}from"./chunk-24MP32AG.js";import{A as W,Ab as u,C as G,Eb as P,F as J,Fb as v,G as D,Gb as s,Jc as $,Nb as Y,Ob as Z,P as V,Ra as a,Rb as ee,S as X,Ub as d,Vb as C,Wb as b,_ as S,bb as L,c as z,ea as p,f as K,fa as m,gc as _,hc as h,j as k,ka as F,mc as E,na as g,nc as N,pc as H,qb as R,qc as T,rb as f,rc as te,sb as x,vb as B,wb as j,xb as I,yb as o,zb as r}from"./chunk-TH2R3M5J.js";import"./chunk-GAL4ENT6.js";var le=["searchInput"],ce=(n,c)=>c.id;function se(n,c){n&1&&u(0,"span",5)}function de(n,c){if(n&1&&(o(0,"div",12),u(1,"i",13),d(2),r()),n&2){let e=s().$implicit;a(2),b(" ",e.address," ")}}function pe(n,c){if(n&1){let e=P();o(0,"li",9)(1,"button",10),v("click",function(){let t=p(e).$implicit,l=s(2);return m(l.selectPlace(t))})("mouseenter",function(){let t=p(e).$index,l=s(2);return m(l.setHighlightedIndex(t))})("keydown.enter",function(){let t=p(e).$implicit,l=s(2);return m(l.selectPlace(t))})("keydown.space",function(t){let l=p(e).$implicit;return s(2).selectPlace(l),m(t.preventDefault())}),o(2,"div",11),d(3),r(),f(4,de,3,1,"div",12),r()()}if(n&2){let e=c.$implicit,i=c.$index,t=s(2);a(),ee("bg-base-200",t.highlightedIndex()===i),R("aria-selected",t.highlightedIndex()===i),a(2),C(t.getPlaceTitle(e)),a(),x(e.address?4:-1)}}function me(n,c){if(n&1&&(o(0,"div",6)(1,"ul",8),B(2,pe,5,5,"li",9,ce),r()()),n&2){let e=s();R("aria-label","Search results"),a(2),j(e.filteredPlaces())}}function _e(n,c){n&1&&(o(0,"div",7)(1,"div",14),u(2,"i",15),o(3,"p"),d(4),_(5,"translate"),r()()()),n&2&&(a(4),C(h(5,1,"components.placeSearch.noResults")))}function he(n,c){n&1&&(o(0,"div",7)(1,"div",14),u(2,"i",16),o(3,"p"),d(4),_(5,"translate"),r()()()),n&2&&(a(4),C(h(5,1,"components.placeSearch.minCharsWarning")))}var ae=(()=>{class n{recordingId=T();excludeIds=T([]);placeholder=T("components.placeSearch.placeholder");disabled=T(!1);placeSelected=H();searchStateChanged=H();searchInput=te.required("searchInput");recordingService=S(U);languageService=S(M);destroyRef=S(F);_searchQuery=g("");_availablePlaces=g([]);_isSearching=g(!1);_isFocused=g(!1);_highlightedIndex=g(-1);searchSubject=new K;searchQuery=this._searchQuery.asReadonly();isSearching=this._isSearching.asReadonly();highlightedIndex=this._highlightedIndex.asReadonly();filteredPlaces=E(()=>{let e=this._availablePlaces(),i=this.excludeIds();return e.filter(t=>!i.includes(t.id))});showDropdown=E(()=>this._isFocused()&&this._searchQuery().length>0&&!this.disabled());constructor(){N(()=>{this.recordingId()!==void 0||console.error("PlaceSearchComponent requires recordingId")}),this.searchSubject.pipe(G(500),J(),V(e=>this.performSearchObservable(e)),w(this.destroyRef)).subscribe({next:e=>{this._availablePlaces.set(e),this._isSearching.set(!1),this._highlightedIndex.set(-1)},error:e=>{console.error("Error searching places:",e),this._availablePlaces.set([]),this._isSearching.set(!1)}}),N(()=>{let e=this._isSearching(),i=!e&&this.filteredPlaces().length>0;this.searchStateChanged.emit({isSearching:e,hasResults:i})})}ngOnInit(){this.loadAvailablePlaces()}onSearchInput(e){let t=e.target.value;this._searchQuery.set(t),this._highlightedIndex.set(-1),t.length>=3?this.searchSubject.next(t):t.length===0?this.loadAvailablePlaces():this._availablePlaces.set([])}onFocus(){this._isFocused.set(!0),this._availablePlaces().length===0&&this.loadAvailablePlaces()}onBlur(){setTimeout(()=>{this._isFocused.set(!1),this._highlightedIndex.set(-1)},150)}onKeyDown(e){let i=this.filteredPlaces(),t=this._highlightedIndex();switch(e.key){case"ArrowDown":{e.preventDefault();let l=t<i.length-1?t+1:0;this._highlightedIndex.set(l);break}case"ArrowUp":{e.preventDefault();let l=t>0?t-1:i.length-1;this._highlightedIndex.set(l);break}case"Enter":e.preventDefault(),t>=0&&i[t]&&this.selectPlace(i[t]);break;case"Escape":e.preventDefault(),this._isFocused.set(!1),this.searchInput().nativeElement.blur();break}}selectPlace(e){this.placeSelected.emit(e),this.clearSearch(),this._isFocused.set(!1)}setHighlightedIndex(e){this._highlightedIndex.set(e)}clearSearch(){this._searchQuery.set(""),this._highlightedIndex.set(-1),this.searchInput().nativeElement.value="",this.loadAvailablePlaces()}getPlaceTitle(e){let i=this.languageService.getCurrentLanguage();return e.translations?.find(l=>l.language===i)?.name||e.address||"Unknown Place"}getPlaceTranslation(e){let t=this.languageService.getCurrentLanguage()==="pl"?"en":"pl",l=e.translations?.find(y=>y.language===t);return l&&l.name!==this.getPlaceTitle(e)?l.name:null}loadAvailablePlaces(){let e=this.recordingId();if(e===void 0){this._isSearching.set(!1);return}this._isSearching.set(!0),this.recordingService.getAvailablePlaces(e).pipe(w(this.destroyRef)).subscribe({next:i=>{this._availablePlaces.set(i),this._isSearching.set(!1)},error:i=>{console.error("Error loading available places:",i),this._availablePlaces.set([]),this._isSearching.set(!1)}})}performSearchObservable(e){if(e.length<3)return new z(t=>{t.next([]),t.complete()});let i=this.recordingId();return i===void 0?new z(t=>{t.next([]),t.complete()}):(this._isSearching.set(!0),this.recordingService.getAvailablePlaces(i,e))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=L({type:n,selectors:[["jw-place-search"]],viewQuery:function(i,t){i&1&&Y(t.searchInput,le,5),i&2&&Z()},inputs:{recordingId:[1,"recordingId"],excludeIds:[1,"excludeIds"],placeholder:[1,"placeholder"],disabled:[1,"disabled"]},outputs:{placeSelected:"placeSelected",searchStateChanged:"searchStateChanged"},decls:11,vars:14,consts:[["searchInput",""],[1,"relative","w-full"],[1,"input","input-bordered","flex","items-center","gap-2","w-full"],["aria-hidden","true",1,"fas","fa-search","text-base-content/50"],["type","text","role","combobox",1,"grow",3,"input","focus","blur","keydown","placeholder","value"],["aria-label","Searching...",1,"loading","loading-spinner","loading-xs"],["role","listbox","id","place-listbox",1,"absolute","z-50","w-full","mt-1","max-h-60","overflow-y-auto","bg-base-100","border","border-base-300","rounded-box","shadow-lg"],[1,"absolute","z-50","w-full","mt-1","bg-base-100","border","border-base-300","rounded-box","shadow-lg"],[1,"list-none","p-0","m-0","w-full"],[1,"w-full","p-0","m-0"],["type","button","role","option",1,"flex","flex-col","w-full","text-left","px-4","py-3","hover:bg-base-200","transition-colors","border-none","bg-transparent","cursor-pointer",3,"click","mouseenter","keydown.enter","keydown.space"],[1,"font-medium"],[1,"text-xs","text-base-content/60","mt-1"],[1,"fas","fa-map-marker-alt","mr-1"],[1,"p-4","text-center","text-base-content/70"],[1,"fas","fa-search-minus","text-2xl","mb-2"],[1,"fas","fa-info-circle","text-xl","mb-2"]],template:function(i,t){if(i&1){let l=P();o(0,"div",1)(1,"label",2),u(2,"i",3),o(3,"input",4,0),_(5,"translate"),_(6,"translate"),v("input",function(q){return p(l),m(t.onSearchInput(q))})("focus",function(){return p(l),m(t.onFocus())})("blur",function(){return p(l),m(t.onBlur())})("keydown",function(q){return p(l),m(t.onKeyDown(q))}),r(),f(7,se,1,0,"span",5),r(),f(8,me,4,1,"div",6),f(9,_e,6,3,"div",7),f(10,he,6,3,"div",7),r()}i&2&&(a(3),I("placeholder",h(5,10,t.placeholder()))("value",t.searchQuery()),R("aria-label",h(6,12,t.placeholder()))("aria-expanded",t.showDropdown())("aria-haspopup","listbox")("aria-controls","place-listbox"),a(4),x(t.isSearching()?7:-1),a(),x(t.showDropdown()&&t.filteredPlaces().length>0?8:-1),a(),x(t.showDropdown()&&t.searchQuery().length>=3&&t.filteredPlaces().length===0&&!t.isSearching()?9:-1),a(),x(t.showDropdown()&&t.searchQuery().length>0&&t.searchQuery().length<3&&t.filteredPlaces().length===0?10:-1))},dependencies:[$,A,Q],encapsulation:2,changeDetection:0})}return n})();var ge=(n,c)=>c.id;function ue(n,c){if(n&1){let e=P();o(0,"jw-place-search",12),v("placeSelected",function(t){p(e);let l=s();return m(l.onPlaceSelected(t))}),r()}if(n&2){let e=s();I("recordingId",e.recordingId())("excludeIds",e.connectedPlaceIds())("placeholder","panel.recordings.edit.tabs.places.search.placeholder")("disabled",e.isConnecting())}}function fe(n,c){n&1&&(o(0,"div",6),u(1,"span",13),o(2,"span",14),d(3),_(4,"translate"),r()()),n&2&&(a(3),C(h(4,1,"panel.recordings.edit.tabs.places.loading")))}function xe(n,c){if(n&1){let e=P();o(0,"div",7),u(1,"i",15),o(2,"span"),d(3),r(),o(4,"button",16),v("click",function(){p(e);let t=s();return m(t.loadConnectedPlaces())}),d(5),_(6,"translate"),r()()}if(n&2){let e=s();a(3),C(e.error()),a(2),b(" ",h(6,2,"common.retry")," ")}}function be(n,c){n&1&&(o(0,"div",8),u(1,"i",17),o(2,"p",18),d(3),_(4,"translate"),r(),o(5,"p"),d(6),_(7,"translate"),r()()),n&2&&(a(3),b(" ",h(4,2,"panel.recordings.edit.tabs.places.noPlaces.title")," "),a(3),C(h(
17,4,"panel.recordings.edit.tabs.places.noPlaces.description")))}function ve(n,c){if(n&1&&(o(0,"p",22),u(1,"i",27),d(2),r()),n&2){let e=s().$implicit;a(2),b(" ",e.address," ")}}function Ce(n,c){n&1&&u(0,"span",25)}function Se(n,c){n&1&&u(0,"i",26)}function Pe(n,c){if(n&1){let e=P();o(0,"div",19)(1,"div",20)(2,"h4",21),d(3),r(),f(4,ve,3,1,"p",22),r(),o(5,"div",23)(6,"button",24),_(7,"translate"),v("click",function(){let t=p(e).$implicit,l=s(2);return m(l.showDeleteConfirmation(t))}),f(8,Ce,1,0,"span",25)(9,Se,1,0,"i",26),r()()()}if(n&2){let e,i=c.$implicit,t=s(2);a(3),b(" ",t.getPlaceTitle(i)," "),a(),x(i.address?4:-1),a(2),I("disabled",t.isConnecting()||t.isDisconnecting())("title",h(7,6,"panel.recordings.edit.tabs.places.actions.remove")),R("aria-label","Remove place: "+t.getPlaceTitle(i)),a(2),x(t.isDisconnecting()&&((e=t.placeToRemove())==null?null:e.id)===i.id?8:9)}}function we(n,c){if(n&1&&(o(0,"div",9),B(1,Pe,10,8,"div",19,ge),r()),n&2){let e=s();a(),j(e.sortedPlaces())}}function Ie(n,c){n&1&&(o(0,"div",10),u(1,"span",28),o(2,"span"),d(3),_(4,"translate"),r()()),n&2&&(a(3),C(h(4,1,"panel.recordings.edit.tabs.places.connecting")))}function ye(n,c){n&1&&u(0,"span",28)}function Re(n,c){if(n&1){let e=P();o(0,"div",11)(1,"div",29)(2,"h3",30),d(3),_(4,"translate"),r(),o(5,"p",31),d(6),_(7,"translate"),o(8,"strong"),d(9),r(),d(10,"? "),r(),o(11,"div",32)(12,"button",33),v("click",function(){p(e);let t=s();return m(t.cancelRemove())}),d(13),_(14,"translate"),r(),o(15,"button",34),v("click",function(){p(e);let t=s();return m(t.confirmRemove())}),f(16,ye,1,0,"span",28),d(17),_(18,"translate"),r()()(),o(19,"button",35),v("click",function(){p(e);let t=s();return m(t.cancelRemove())})("keydown.enter",function(){p(e);let t=s();return m(t.cancelRemove())})("keydown.space",function(t){return p(e),s().cancelRemove(),m(t.preventDefault())}),r()()}if(n&2){let e=s();a(3),b(" ",h(4,8,"panel.recordings.edit.tabs.places.confirmRemove.title")," "),a(3),b(" ",h(7,10,"panel.recordings.edit.tabs.places.confirmRemove.message")," "),a(3),C(e.getPlaceTitle(e.placeToRemove())),a(3),I("disabled",e.isDisconnecting()),a(),b(" ",h(14,12,"common.cancel")," "),a(2),I("disabled",e.isDisconnecting()),a(),x(e.isDisconnecting()?16:-1),a(),b(" ",h(18,14,"common.remove")," ")}}var Je=(()=>{class n{route=S(ie);recordingService=S(U);languageService=S(M);destroyRef=S(F);_recordingId=g(null);_connectedPlaces=g([]);_isLoadingPlaces=g(!1);_isConnecting=g(!1);_isDisconnecting=g(!1);_error=g(null);_showConfirmDialog=g(!1);_placeToRemove=g(null);recordingId=this._recordingId.asReadonly();connectedPlaces=this._connectedPlaces.asReadonly();isLoadingPlaces=this._isLoadingPlaces.asReadonly();isConnecting=this._isConnecting.asReadonly();isDisconnecting=this._isDisconnecting.asReadonly();error=this._error.asReadonly();showConfirmDialog=this._showConfirmDialog.asReadonly();placeToRemove=this._placeToRemove.asReadonly();connectedPlaceIds=E(()=>this._connectedPlaces().map(e=>e.id));sortedPlaces=E(()=>{let e=this.languageService.getCurrentLanguage();return[...this._connectedPlaces()].sort((i,t)=>O(i,e).localeCompare(O(t,e)))});ngOnInit(){this.route.params.pipe(w(this.destroyRef),V(e=>{let i=Number(e.id);return this._recordingId.set(i),isNaN(i)?(this._error.set("Invalid recording ID"),k([])):this.loadConnectedPlaces()})).subscribe()}onPlaceSelected(e){let i=this._recordingId();i&&(this._isConnecting.set(!0),this._error.set(null),this.recordingService.connectPlace(i,e.id).pipe(w(this.destroyRef),D(()=>this._isConnecting.set(!1))).subscribe({next:()=>{this._connectedPlaces.update(t=>[...t,e])},error:t=>{console.error("Error connecting place to recording:",t),this._error.set("Failed to connect place to recording")}}))}showDeleteConfirmation(e){this._placeToRemove.set(e),this._showConfirmDialog.set(!0)}cancelRemove(){this._showConfirmDialog.set(!1),this._placeToRemove.set(null)}confirmRemove(){let e=this._placeToRemove(),i=this._recordingId();!e||!i||(this._isDisconnecting.set(!0),this._error.set(null),this.recordingService.disconnectPlace(i,e.id).pipe(w(this.destroyRef),D(()=>{this._isDisconnecting.set(!1),this._showConfirmDialog.set(!1),this._placeToRemove.set(null)})).subscribe({next:()=>{this._connectedPlaces.update(t=>t.filter(l=>l.id!==e.id))},error:t=>{console.error("Error disconnecting place from recording:",t),this._error.set("Failed to remove place connection")}}))}loadConnectedPlaces(){let e=this._recordingId();return e?(this._isLoadingPlaces.set(!0),this._error.set(null),this.recordingService.getRecordingPlaces(e).pipe(w(this.destroyRef),W(i=>(console.error("Error loading recording places:",i),this._error.set("Failed to load connected places"),k([]))),D(()=>this._isLoadingPlaces.set(!1)),X(i=>{this._connectedPlaces.set(i)}))):k([])}getPlaceTitle(e){let i=this.languageService.getCurrentLanguage();return O(e,i)}getPlaceTranslation(e){let i=this.languageService.getCurrentLanguage();return ne(e,i)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=L({type:n,selectors:[["jw-edit-recording-places"]],decls:18,vars:10,consts:[[1,"flex","justify-center","items-center"],[1,"bg-base-100","max-w-2xl","lg:min-w-2xl"],[1,""],[1,"mb-6"],[1,"text-lg","font-semibold","mb-3"],[3,"re
1cordingId","excludeIds","placeholder","disabled"],[1,"flex","justify-center","py-8"],[1,"alert","alert-error","mb-4"],[1,"text-center","py-8","text-base-content/70"],[1,"space-y-3"],[1,"alert","alert-info","mt-4"],[1,"modal","modal-open"],[3,"placeSelected","recordingId","excludeIds","placeholder","disabled"],[1,"loading","loading-spinner","loading-lg"],[1,"ml-3","text-lg"],["aria-hidden","true",1,"fas","fa-exclamation-triangle","mr-2"],[1,"btn","btn-sm","btn-outline",3,"click"],[1,"fas","fa-map-marker-alt","text-4xl","mb-4"],[1,"text-lg","font-medium","mb-2"],[1,"flex","items-center","justify-between","p-4","bg-base-200","rounded-lg","hover:bg-base-300","transition-colors"],[1,"flex-1","min-w-0"],[1,"font-medium","text-base","truncate"],[1,"text-xs","text-base-content/60","mt-1"],[1,"flex","gap-2","ml-4"],[1,"btn","btn-circle","btn-sm","btn-ghost","text-error","hover:bg-error","hover:text-error-content",3,"click","disabled","title"],[1,"loading","loading-spinner","loading-xs"],["aria-hidden","true",1,"fas","fa-trash"],[1,"fas","fa-map-marker-alt","mr-1"],[1,"loading","loading-spinner","loading-sm"],[1,"modal-box"],[1,"font-bold","text-lg"],[1,"py-4"],[1,"modal-action"],[1,"btn","btn-ghost",3,"click","disabled"],[1,"btn","btn-error",3,"click","disabled"],["type","button","aria-label","Close modal",1,"modal-backdrop","cursor-pointer","border-0","p-0","m-0","bg-transparent",3,"click","keydown.enter","keydown.space"]],template:function(i,t){i&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h3",4),d(5),_(6,"translate"),r(),f(7,ue,1,4,"jw-place-search",5),r(),o(8,"div")(9,"h3",4),d(10),_(11,"translate"),r(),f(12,fe,5,3,"div",6)(13,xe,7,4,"div",7)(14,be,8,6,"div",8)(15,we,3,0,"div",9),r(),f(16,Ie,5,3,"div",10),r()()(),f(17,Re,20,16,"div",11)),i&2&&(a(5),b(" ",h(6,6,"panel.recordings.edit.tabs.places.search.title")," "),a(2),x(t.recordingId()?7:-1),a(3),b(" ",h(11,8,"panel.recordings.edit.tabs.places.connected.title")," "),a(2),x(t.isLoadingPlaces()?12:t.error()?13:t.connectedPlaces().length===0?14:15),a(4),x(t.isConnecting()?16:-1),a(),x(t.showConfirmDialog()?17:-1))},dependencies:[$,A,Q,ae],encapsulation:2,changeDetection:0})}return n})();export{Je as EditRecordingPlacesComponent};

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.