var S=Object.defineProperty;var b=(e,t,n)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var h=(e,t,n)=>b(e,typeof t!="symbol"?t+"":t,n);import{s as A,bD as L,b5 as I,r as y,by as R,p as B,aF as C,bE as U,bF as x,u as $,a0 as H,P as J,a6 as N,bG as M}from"./CmkECUHm.js";function P(e){return decodeURIComponent(Array.prototype.map.call(atob(e),function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}const p=class p{constructor(t){h(this,"value");this.value=t}singleReplaceTags(t){const n=this.value.matchAll(t);let s=null;do{const a=n.next();if(a.done===void 0||a.value===void 0)return this;s=!a.done,this.value=this.value.replace(a.value[0],a.value[2])}while(s)}standarizeEOL(){return this.value=this.value.replaceAll(`\r
`,`
`),this}removeHTMLTags(t,n=!1){const s=t.join("|"),a=new RegExp(`<(${s})[^>]*>([^<]*)<\\/\\1>`,"gmi");let r=null;do r=this.value.length,this.singleReplaceTags(a);while(n&&r!==this.value.length);return this}removeAllHTMLTags(){return this.value=!this.value||this.value===""?"":this.value.replace(/(<([^>]+)>)/gi,""),this}trim(t){return this.value.length>t&&(this.value=this.value.substring(0,t).trimEnd()+"…"),this}toString(){return this.value}toUpperCase(){return this.value=this.value.toUpperCase(),this}capitalize(){return this.value=this.value.charAt(0).toUpperCase()+this.value.slice(1),this}replaceAll(t,n){return this.value=this.value.replaceAll(t,n),this}mergeSameHTMLTags(t){const n=t.join("|"),s=new RegExp(`<(${n})[^>]*>([^<]*)<\\/\\1><\\1[^>]*>([^<]*)<\\/\\1>`,"gmi");return this.replaceAll(s,"<$1>$2$3</$1>")}replaceSpecialChars(){if(!this.value||this.value==="")return this;for(const[t,n]of Object.entries(p.specialCharsReplaceMap))this.value=this.value.replaceAll(t,n);return this}};h(p,"specialCharsReplaceMap",{"&nbsp;":" ","\n":" "});let l=p;const D=(e,t=!1)=>t?new l(e):new l(e).standarizeEOL();var G,V=()=>G;function F(e){return typeof e=="function"?e():$(e)}function v(e,t=""){if(e instanceof Promise)return e;const n=F(e);return!e||!n?n:Array.isArray(n)?n.map(s=>v(s,t)):typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,a])=>s==="titleTemplate"||s.startsWith("on")?[s,$(a)]:[s,v(a,s)])):n}var Z=typeof window<"u",z="usehead";function m(){return L()&&I(z)||V()}function K(e,t={}){const n=m(),s=y(!1),a=y({});R(()=>{a.value=s.value?{}:v(e)});const r=n.push(a.value,t);return B(a,d=>{r.patch(d)}),L()&&(C(()=>{r.dispose()}),U(()=>{s.value=!0}),x(()=>{s.value=!1})),r}function Q(e,t={}){return m().push(e,t)}function _(e,t={}){var s;const n=m();if(n){const a=Z||!!((s=n.resolvedOptions)!=null&&s.document);return t.mode==="server"&&a||t.mode==="client"&&!a?void 0:a?K(e,t):Q(e,t)}}var W=e=>typeof e=="function",te=e=>{if(!e)return;const t=A(()=>W(e)?e():e);_(()=>t.value?{script:[{type:"application/ld+json",children:JSON.stringify(t.value,null,"")}]}:{})};const c="https://r.pl",q=e=>{var s,a,r;const{index:t,bloczek:n}=e;return{"@context":"https://schema.org/","@type":"ListItem",position:`${t+1}`,name:((s=n.BazoweInformacje)==null?void 0:s.OfertaNazwa)||"",image:n!=null&&n.Zdjecia&&(n!=null&&n.Zdjecia[0])?`${n==null?void 0:n.Zdjecia[0]}`:"",url:(a=n.BazoweInformacje)!=null&&a.OfertaURL?`${c}${(r=n.BazoweInformacje)==null?void 0:r.OfertaURL}`:""}},X=e=>{const{Opisy:t}=e;return{"@context":"https://schema.org/","@type":"FAQPage",mainEntity:t==null?void 0:t.map(a=>{var r;return{"@type":"Question",name:a.Tytul||"",acceptedAnswer:{"@type":"Answer",text:(r=D(`${a.Opis||""}`).removeAllHTMLTags())==null?void 0:r.toString()}}})}},Y=(e,t)=>({"@type":"ListItem",position:t+1,name:e.Nazwa,item:`${c}${e.Url}`}),ne=e=>({"@context":"https://schema.org/","@type":"BreadcrumbList",itemListElement:e==null?void 0:e.flat().map(Y)}),se=(e="")=>({"@context":"https://schema.org/","@type":"Organization","@id":`${c}/`,url:`${c}/`,logo:"https://static.r.pl/rpl-cdn/images/icons/r-logo.SVG?v=0",legalName:"Rainbow",name:"Rainbow",description:e,sameAs:["https://www.facebook.com/RainbowToursSA","https://www.instagram.com/r.pl","https://www.youtube.com/user/mediarainbowtours"]}),ae=e=>e!=null&&e.length?{"@context":"https://schema.org/","@type":"ItemList",itemListElement:e.map((n,s)=>q({bloczek:n,index:s}))}:null,re=e=>{if(!e.Opisy.length)return null;const{Opisy:t}=e;return t[0].Tytul!==null&&t[0].Tytul!==void 0?X(e):null},ie=()=>{const{$ua:e}=H(),{routeInfo:t}=J(),n=N(M),s=A(()=>{if(!n.value)return null;try{const i=P(n.value);return JSON.parse(i)}catch{return null}}),a=()=>e.isSmartphone?"M":e.isTablet?"T":"D",r=i=>{var f,g,w;if(!s.value)return null;const o=((f=t.value)==null?void 0:f.Route)??"",O=((g=t.value)==null?void 0:g.SekcjaCache.Klucz)??"",j=a(),u=(w=s.value)==null?void 0:w.tests.find(T=>T.name===i);return!u||!u.devices.includes(j)?null:u.pathPattern&&new RegExp(u.pathPattern).test(o)||u.pagesTypes.includes(O)?u:null};return{getAbTestValue:i=>{const o=r(i);return!o||o.name!==i?null:o.value},writeGlobalVariable:()=>{var i;window.RAB=(i=s.value)==null?void 0:i.tests.map(o=>`${o.name}:${o.value}`).join("|")}}};export{re as a,ie as b,ae as c,se as d,ne as m,D as r,te as u};
//# sourceMappingURL=q3Yxt6ED.js.map
