PageSourceSearch

https://www.alleba.com/assets/laws-Ch_k4WpA.js

js alleba.com collected 2026-10-02 02:36:50 UTC 8,558 bytes, 15 lines download raw bytes

1import{n as e,t}from"./createServerFn-Bk23-1SV.js";var n=t({method:`GET`}).handler(e(`05b6c5a9f0e8105550f19877b85bc69d5ecba7400ada93e5df20713d3b8b0d0f`)),r=t({method:`GET`}).handler(e(`76afd430591aa66b611eda2bc1de146615292027af05d4a633fe7d4f7dc7b702`)),i=t({method:`GET`}).handler(e(`d562040dea2354082f0a24ce55452c67db4628706e138e31fa24733c76ffc02e`)),a=4e5,o=/^\s*\**\s*(SECTION|SEC|Section|Sec)\s*\.?\s*([0-9]+(?:[-–][0-9]+)?[A-Za-z]?)\s*\.?\s*\**\s*(.*)$/,s=/^\s*\**\s*(Article|ARTICLE|Art)\s*\.?\s*([0-9]+(?:[-–][0-9]+)?[A-Za-z]?)\s*\.\s*\**\s*(.*)$/,c=/^\s*\**\s*(?:SECTION|SEC|Section|Sec)\s*\.?\s*[0-9]+\s*\./m,l=/^\s*\**\s*(?:Article|ARTICLE)\s+1\s*\./m,u=/\*\*\s*(?:Article|ARTICLE|Art)\s*\.?\s*([0-9]+[A-Za-z]?)\s*\.\s*/g,d=/^\s*\**\s*((?:CHAPTER|ARTICLE|TITLE|BOOK|PART)\s+[A-Z0-9IVXL][^\n]{0,120}?)\s*\**\s*$/,f=/(?:amended|renumbered|inserted|added)[^.:]{0,120}(?:as|to read as)\s+follows\s*:\s*$/i,p=/\*\*\s*(?:SECTION|SEC|Section|Sec)\s*\.?\s*([0-9]+[A-Za-z]?)\s*\.?\s*\*\*/g,m=/^(.*?\b(?:amended|renumbered|inserted|added)[^:]{0,120}(?:as|to read as)\s+follows\s*:)\s*(?=>\s*["“]?\s*(?:\*\*)?\s*(?:Section|Sec)\b|["“]\s*(?:\*\*)?\s*(?:Section|Sec)\b|\*\*\s*(?:Section|Sec)\b)(.*)$/i;function h(e){let t=e.match(m),n=t?.[2]?.replace(/(^|\s)>\s*/g,`$1`).trim();return t?.[1]&&n?[t[1].trim(),n]:null}function g(e){let t=e.match(/^([0-9]+)/);return t?Number(t[1]):null}function _(e,t,n=p){if(t===null||e.length<100)return[e];let r=[],i=t;n.lastIndex=0;let a;for(;a=n.exec(e);){if(a.index===0){let e=g(a[1]??``);e!==null&&(i=e+1);continue}let t=e[a.index-1];t!==`"`&&t!==`“`&&t!==`>`&&g(a[1]??``)===i&&(r.push(a.index),i+=1)}if(!r.length)return[e];let o=[],s=0;for(let t of r)o.push(e.slice(s,t).trim()),s=t;return o.push(e.slice(s).trim()),o.filter(Boolean)}function v(e){return e.split(`
2`).map(e=>`> ${e.trim()}`).join(`
3`)}function y(e){return/^\s*>/.test(e)}function b(e){return e.split(`
4`).map(e=>e.replace(/^\s*>\s?/,``)).join(`
5`)}function x(e){if(!e.length)return e;let t=[...e];t[0]=(t[0]??``).replace(/^(\s*(?:>\s*)?(?:\*\*)?)["“]\s*/,`$1`);let n=t.length-1;return t[n]=(t[n]??``).replace(/["”](\s*)$/,`$1`),t[n]=(t[n]??``).replace(/(\bshall be known as(?: the)?\s+)'([^'\n]+)\.'(\s*)$/i,`$1$2.$3`),t}function S(e){return e.replace(/^\s*>\s?/gm,``).replace(/\s+(?:>\s*)+(?=\([a-z]\)|["“]|\bx\s+x\s+x\b)/gi,` `).replace(/\*\*/g,``).replace(/(^|[\s("“'‘])\*([^*\n]+)\*/g,`$1$2`).replace(/\*+/g,``).replace(/\s+/g,` `).trim()}var C=/(^|[.;:]\s+|\n)\(\s*([0-9]{1,2}|[A-Za-z]|[ivxIVX]{2,5}|[a-z]{2})\s*\)\s+/g,w=/^(?:\(\s*([0-9]{1,2}|[A-Za-z]|[ivxIVX]{2,5}|[a-z]{2})\s*\)|([0-9]{1,2})\.(?=\s))\s*/,T=/([:;](?:\s+(?:and|or))?)\s+([0-9]{1,2}\.\s+)(?=["“]?[A-Za-z0-9])|(\.)\s+([0-9]{1,2}\.\s+)(?=[a-z])/g,E=/^(?:x\s+){2,}x\.?$/i,D=/^(?:i{1,3}|iv|v|vi{1,3}|ix|x|xi{1,3})$/i;function O(e,t){if(/^[0-9]+$/.test(e))return 2;let n=e.toLowerCase();return n.length===1&&(n!==`i`||t===`h`||t===null)?1:D.test(n)?3:1}function k(e,t,n){let r=S(t);if(!r)return;if(E.test(r)){e.push({kind:`omission`,level:0,marker:``,text:r});return}let i=r.match(w);if(i?.[2]){e.push({kind:`item`,level:1,marker:`${i[2]}.`,text:r.replace(w,``).trim()});return}if(i?.[1]){let t=O(i[1],n.v);t===1&&(n.v=i[1].toLowerCase()),e.push({kind:`item`,level:t,marker:`(${i[1]})`,text:r.replace(w,``).trim()});return}e.push({kind:`para`,level:0,marker:``,text:r})}function A(e){let t=b(e).replace(/(^|[.;:]\s+(?:and\s+|or\s+)?)([a-z]{1,2}|[0-9]{1,2})\)\s+/g,`$1($2) `).replace(/(as follows:|[.;:]["”]|[.;]\*\*["”]?)\s+(?=["“]?(?:\*\*)?(?:Sec(?:tion)?\.?|Art(?:icle)?\.?)\s+[0-9]+(?:-[A-Z])?\.)/g,`$1
6`).replace(/([.;])\s+["“](?=(?:\*\*)?(?:Sec(?:tion)?\.?|Art(?:icle)?\.?)\s+[0-9]+(?:-[A-Z])?\.)/g,`$1
7`).replace(/(^|\s)((?:x\s+){2,}x\.?)(?=\s|$)/gi,(e,t,n)=>`${t}\n${n}\n`).replace(T,(e,t,n,r,i)=>`${t??r??``}\n${n??i??``}`),n=[],r={v:null};for(let e of N(t).split(`
8`)){let t=e.trim();if(!t)continue;C.lastIndex=0;let i=0,a;for(;a=C.exec(t);){let e=a.index+(a[1]??``).length;e>i&&k(n,t.slice(i,e),r),i=e,C.lastIndex=e+1}k(n,t.slice(i),r)}let i=n.flatMap(M);return i.length?i:[{kind:`para`,level:0,marker:``,text:S(t)}]}var j=/(?<=[.;])\s+(?=(?:Irrespective\b|Notwithstanding\b|Provided\b|Whenever\b|When\b|If\b|In case\b|The penalty\b|The death penalty\b|The crime\b|The same penalty\b|Any person\b|Otherwise\b|Every penalty\b|Should\b|The land\b))/g;function M(e){if(e.kind!==`item`)return[e];let t=e.text.split(j).map(e=>
8e.trim()).filter(Boolean);if(t.length<2)return[e];let[n,...r]=t;return[{...e,text:n??``},...r.map(e=>({kind:`para`,level:0,marker:``,text:e}))]}function N(e){return e.split(`
9`).map(e=>{let t=e.trim().match(/^([0-9]{1,2})\.\s/);if(!t)return e;let n=Number(t[1])+1,r=e;for(;;){let e=RegExp(`([.;:])\\s+(${n}\\.\\s+)(?=["“]?[A-Za-z0-9])`),t=r.match(e);if(!t||t.index===void 0)break;r=`${r.slice(0,t.index)}${t[1]}\n${t[2]}${r.slice(t.index+t[0].length)}`,n+=1}return r}).join(`
10`)}function P(e){let t=e.trim(),n=t.match(/^\*+([^*\n]{2,90}?)\.?\*+\s*(.*)$/)??t.match(/^([^*\n]{2,90}?)\.?\*+\s*([–—-].*)$/);if(n)return{heading:S(n[1]??``),lead:(n[2]??``).trim()};let r=t.match(/^([A-Z][A-Za-z ,'&/()-]{3,70})\.\s+(.*)$/);return r?{heading:S(r[1]??``),lead:(r[2]??``).trim()}:{heading:``,lead:t}}var F=/^\s*(?:\||\*?\*?\(?(?:Sgd|SGD)\.?\)|Approved\s*[,:])/,I=/(?:President of the Philippines|President of the Senate|Speaker of the House|Secretary of the Senate|Secretary General)/i,L=/^\s*\|?\s*This Act\b[^\n]*?\b(?:was (?:finally )?passed|is a consolidation|originated in)\b/i,R=/\s\bApproved\s*,(?=\s|$)/;function z(e){let t=[...e],n=[];for(;t.length;){let e=(t[t.length-1]??``).trim();if(!(F.test(e)||e.length<250&&I.test(e)))break;n.unshift(t.pop())}for(;n.length&&t.length&&L.test(t[t.length-1]??``);)n.unshift(t.pop());if(t.length){let e=t[t.length-1],r=e.search(R);r>=0&&(t[t.length-1]=e.slice(0,r).trim(),n.unshift(e.slice(r).trim()))}return{body:t.filter(Boolean),closing:n}}function B(e){let t=e.join(`
11`).replace(/\s*\|\s*/g,`
12`).replace(/(?<!\*)\s+(?=\(?(?:Sgd|SGD)\.?\))/g,`
13`).replace(/(?<=\S)\s+(?=Approved\s*[,:])/g,`
14`).split(`
15`),n=[];for(let e of t){let t=e.trim();if(!t)continue;if(/^Approved\s*,\s*$/i.test(t)){n.push({kind:`label`,text:`Approved,`});continue}let r=t.match(/^Approved\s*:\s*(.*)$/i);if(r){n.push({kind:`approval`,text:S(r[1]??``)});continue}let i=/^\*?\*?\(?(?:Sgd|SGD)\.?\)/.test(t),a=t.match(/^\*\*(.+?)\*\*\s*(.*)$/);if(a){let e=S(a[1]??``).replace(/^\(?(?:Sgd|SGD)\.?\)\s*/,``);
15n.push({kind:`signature`,name:e,title:S(a[2]??``)});continue}if(i){let e=t.replace(/^\(?(?:Sgd|SGD)\.?\)\s*/,``),r=e.match(/^\*\*(.+?)\*\*\s*(.*)$/);n.push({kind:`signature`,name:S(r?.[1]??e),title:S(r?.[2]??``)});continue}let o=n[n.length-1];if(o?.kind===`signature`&&!o.title&&t.length<90&&!/[.;]$/.test(t)){o.title=S(t);continue}n.push({kind:`note`,text:S(t)})}return n}function V(e){let t=e.length>a,n=t?e.slice(0,a):e,r=[],i={id:`chapter-0`,title:``,sections:[],intro:[]},m=null,b=new Set,x=null,C=!1,w=!c.test(n)&&l.test(n),T=w?u:p,E=w?s:o,D=w?`Article`:`Section`,O=()=>{(i.sections.length||i.intro.length)&&r.push(i)},k=n.split(/\n\s*\n/),A=[];for(let e of k){let t=e.trim();t&&A.push(t)}for(let e=0;e<A.length;e++){let t=A[e],n=t.length<160&&!(w&&s.test(t))?t.match(d):null;if(n){m&&i.sections.push(m),m=null,C=!1,O(),i={id:`chapter-${r.length+1}`,title:S(n[1]??``),sections:[],intro:[]};continue}let a=t.match(E);if(a){let n=a[2]??``,r=g(n),o=x!==null&&(r===null||r!==x+1);if(C&&o&&m){m.body.push(v(t)),C=!1;continue}let s=_(t,r===null?null:r+1,T);if(s.length>1){A.splice(e,1,...s),--e;continue}m&&i.sections.push(m);let c=D.toLowerCase(),l=`${c}-${n.toLowerCase()}`,u=2;for(;b.has(l);)l=`${c}-${n.toLowerCase()}-${u++}`;b.add(l);let{heading:d,lead:p}=P(a[3]??``),y=d?p.replace(/^[–—-]\s*/,``):p,S=h(y);m={id:l,label:`${D} ${n}`,heading:d,body:S?[S[0],v(S[1])]:y?[y]:[]},r!==null&&(x=r),C=!S&&(f.test(t)||!y);continue}let o=_(t,(x??0)+1,T);if(o.length>1){A.splice(e,1,...o),--e;continue}let c=/^\s*(?:>\s*)?["“]/.test(t),l=y(t)||C&&c;C=!l&&f.test(t),m?m.body.push(l?v(t):t):i.intro.push(l?v(t):t)}m&&i.sections.push(m),O();let j=[],M=r[r.length-1];if(M){let e=M.sections[M.sections.length-1],t=z(e?e.body:M.intro);t.closing.length&&(j=B(t.closing),e?e.body=t.body:M.intro=t.body)}return{chapters:r,closing:j,truncated:t}}function H(e){if(e.shortTitle)return e.shortTitle;let t=e.title.replace(/^REPUBLIC ACT NO\.?\s*[0-9]+\s*[–—-]\s*/i,``).trim();return t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():e.title}export{x as a,i as c,V as i,n as l,y as n,S as o,H as r,r as s,A as t};

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.